Commit Graph

92 Commits

Author SHA1 Message Date
ζeh Matt acf71315b5
Cleanup variables usage and initialize them 2021-01-06 22:29:40 +01:00
Duncan 7440d7eb2b
Fix #13567: Added ability for peeps to stop eating certain food constanly (#13592)
* Fix #13567: Cure guests of severe gluttony

Incorrect assumption that bitscanforward itertated over 64 bits meant that food that was previously within the ExtraItemFlags would never get removed from the peeps inventory. bitscanforward function has been replaced with a 64bit version

* Bump network version
2020-12-17 17:45:40 +00:00
Duncan e23c1cded7
Fix logical sort 2020-10-09 20:59:43 +02:00
Vinicius Sa ca8fa55fdb
Use EnumValue to get the underlying value of an enum
Applied to objects of the enum class PeepActionSpriteType when they are
used as arrays subscripts.
2020-09-29 11:15:07 -03:00
Łukasz Pękalski 065da23b3b
Close #12437, refactor: RIDE_MODE_* to strong enums (#12833)
* partial refactor: RIDE_MODE_* to strong enums

* Close #12437, refactor: RIDE_MODE_* to strong enums

* chore: code formatting

* refactor: RideMode, change enum names to CamelCase

and resolve casting order.

* chore: refactor due to code formatting

* Close #12437, refactor: RIDE_MODE_* to strong enums

Resolved comments

* chore: Formatting correction.

* Use EnumsToFlags constexpr

* refactor: resolved comments

added newline at the end of file

* refactor: Change case stack to default in Switch

Co-authored-by: duncanspumpkin <duncans_pumpkin@hotmail.co.uk>
2020-09-28 14:09:59 +01:00
Richard Fine d21da12f9f
Fix 11414: ‘Possible misuse of comma operator’ warnings (#12919)
Fix the ‘possible misuse of comma operator’ warnings reported by XCode - the two original ones reported in #11414, plus one more in Util.cpp.
2020-09-13 17:43:59 +01:00
Aaron van Geffen 7b5087f057
Update copyright year to 2020 2020-07-21 15:04:34 +02:00
frutiemax bee0b4b82d
Part of #11159: Optimize util_zlib_deflate return (#12111) 2020-07-04 09:21:50 -03:00
Michał Janiszewski 7f8a65c095 Make strlogicalcmp case insensitive 2020-05-20 08:35:41 +02:00
Michał Janiszewski 16d8c64cea Improve strlogicalcmp for strings of unequal lengths
This version actually works and doesn't overrun provided buffers
2020-05-20 08:33:25 +02:00
Tulio Leao 116bcb5ccb
Use named casts on openrct2/(util|windows|scenario|title) (#11146) 2020-04-17 19:45:19 +02:00
Tulio Leao 9123b597a9 Use constexpr on openrct2/* 2019-10-29 18:44:14 -03:00
Matt c6ea47c631
Make util_rand thread safe 2019-05-12 11:32:33 +02:00
Matt 6aa0e74d3e
Fix util_rand only returning 15 bit values. 2019-05-11 22:37:19 +02:00
Filip Gawin 6833da77e3 Simplify boolean expresions 2019-05-10 22:00:38 +02:00
Michael Steenbeek cf913d1419
Remove two unused functions 2019-03-25 15:56:40 +01:00
Gymnasiast 262a9f29e8 Fix formatting 2019-03-24 22:24:40 +01:00
ζeh Matt 184d95c720 Fix #8947: Detection of AVX2 support 2019-03-24 21:53:54 +01:00
Aaron van Geffen 2af13904c5 Update copyright notices for 2019. (#8903) 2019-03-17 07:16:15 +00:00
Matt ecd4f61115 Add Network window 2019-02-07 18:50:58 +01:00
ζeh Matt 7d19a5bc77 Refactor memcpy to std::memcpy and memset to std::memset (#8408) 2018-12-15 22:23:31 +01:00
Michał Janiszewski 2d95052477 Compress minidumps with gzip 2018-10-24 23:36:14 +02:00
Michał Janiszewski f9600ccfd9 Only provide strcasestr for WIN32 toolchains
All the other toolchains appear to be providing this function and only
MSVC+mingw are missing out.

cf. https://github.com/OpenRCT2/OpenRCT2/pull/7942
2018-08-30 22:56:14 +02:00
Hielke Morsink e7af3290c0 Fix system file browser not populating properly (#7916) 2018-08-21 23:19:32 +02:00
Linus Unnebäck fd07be587a
Remove Math::Clamp in favour of std::clamp 2018-08-12 16:47:12 +01:00
Hielke Morsink 0b03464186
Replace 0 and NULL with nullptr (#7827) 2018-07-25 22:49:20 +02:00
clang-format d787872cbe Indent preprocessor directives 2018-07-23 16:00:23 +02:00
clang-format adb69a2fe8 clang-format ui/util/windows 2018-07-23 16:00:12 +02:00
Michael Steenbeek 1b08fb4e69 Replace our own integer types with standard ones 2018-06-20 17:30:40 +02:00
Michael Steenbeek ec3a1e575e
Replace Math::Min and Max with std variants 2018-06-20 17:11:35 +02:00
Hielke Morsink 0cf256ac9e Ready copyright notice for clang-format
Clang-format sees the text behind `#pragma region` as code and formats it. Instead of stating the copyright and date there, it's now in the comment block right below it. The text "Copyright" is left in the `#pragma region` line, as clang-format sees it as a single identifier.

I took the opportunity to normalize the dates, and add the copyright notice to the source files where it was missing them (except for third-party and the generated resources.h file).
2018-06-15 14:07:34 +02:00
Hielke Morsink aad1e69d7e
Add parentheses to macro arguments (#7686)
This adds parentheses around macro arguments that are either negative or used for calculations inside the macro itself. Doing this avoids getting errors in code that may look right.
2018-06-15 10:54:05 +02:00
Ted John 2ea857a10e Improve IZipArchive so that it is more C++ 2018-05-06 17:46:45 +01:00
Michał Janiszewski 7d67291910 Synchronise definition guards with declarations for str utils 2018-03-21 22:39:19 +01:00
Michał Janiszewski 06e97ab6e2 Fix linkage on macOS 2018-03-21 22:39:19 +01:00
pkubaj 38cdf5e8c9 Corrected fix to use AVX on FreeBSD>10 2018-03-20 23:15:28 +01:00
pkubaj 1191f64091 Fix build on FreeBSD 10
NOTE: This can be reverted once FreeBSD 10.4-RELEASE goes EoL.
2018-03-20 23:15:28 +01:00
Michał Janiszewski 4dd0995efb Move cmath out of common.h 2018-03-18 23:29:13 +01:00
Michał Janiszewski 28391eaf5d Move cstring out of common.h 2018-03-18 23:29:13 +01:00
Hielke Morsink 55979a3fff Remove and replace C typedefs
`typedef struct/union/enum name { ... } name_again;` is not needed whe compiling C++, moving the name at the back to be in front of the object and removing `typedef` makes it usable the very same way.
This also replaces typedefs with the using keyword. They have better readability, especially for function pointer types, and would allow more flexibility when used with templates.
2018-02-14 09:42:26 +01:00
Michał Janiszewski 06e139f4cb Use __builtin_cpu_supports for AVX2 detection 2018-02-12 22:24:22 +01:00
Michał Janiszewski 6a71688db7 Allow specifying cpuid subleaf 2018-02-12 22:24:22 +01:00
Michał Janiszewski ad27806534 Implement AVX2 masking 2018-02-12 22:24:22 +01:00
Gymnasiast 778ba466c5 Remove almost every extern C block 2018-02-05 16:20:15 +01:00
Gymnasiast 5cc21fd21b Replace NULL with nullptr in C++ files 2018-01-29 21:33:21 +00:00
ZehMatt 84f2917f59 Use const and constexpr whenever possible. 2018-01-11 22:29:08 +01:00
Ted John c3eab7ead6 Refactor window.c to C++ 2018-01-07 12:39:58 +01:00
Michael Steenbeek 755add6c9a
Compile localisation folder as C++ 2018-01-06 18:32:25 +01:00
Michał Janiszewski 33a94fe1bb Use C++ headers in C++ code 2018-01-04 07:36:54 +01:00
Michał Janiszewski b2bc974fe7
Use nullptr where possible 2018-01-04 06:58:44 +01:00