Since many of the changes were made before the clang-format changes went live, the new source files used a different format still. This PR applies the new style to all the new source files.
It byte swapped uint16_t and then during decode byte swapped it as uint32_t, now it always uses uint32_t for ride/player id. I could use the underlying type but that would require to re-create all replays again.
Closes#10713
This reduces the number of third party dependencies for Windows builds. WinHttp is quite a nice straight forward API so doesn't involve too much extra code.
std::optional is supported by Xcode 10. The non-polyfill variant was already used in our code, so this is not likely to break anything that wasn't broken before.
Define ftello/fseeko to ftello64/fseeko64 only on Linux,
these functions are Linux-specific extensions.
Define ftello/fseeko to _ftelli64/_fseeki64 on MSC.
Otherwise, just use the standardized ftello/fseeko, and avoid
duplicating code for different names of the same function.
This allows this code to be reused on e.g. NetBSD without piling
on additional #ifdefs for any other POSIX operating systems.
* Fix errors where "std::max" was not recognized while compiling with the latest Visual Studio (2019 16.4.0 Preview 2.0) due to a missing "#include" statement.
* Ran clang-format.
This file enables access to std::filesystem as `fs` namespace
or injects third-party drop-in replacement on build configs
where std::filesystem is not available.
Occasionally I need to build a binary compatible with WinNT 5.1, e.g.
when testing out Wine or ReactOS. There are just a few minor changes
required to have a working build, but as they are not part of the
repository, I always end up doing them from scratch. I would like to
upstream them instead so I don't have to recreate them each time, even
if this is not the most common use case.
If we want to have more semantically meaningful types (like Direction), it's useful to be able to support those in the DataSerializer too. Swapping bytes for entire structures is probably never going to make sense, but for types that are pure wrappers around integer types, we want to be able to swap them as if they were the integer they wrap.
* Add initial interface.
* Implement move operator in MemoryStream
* Add pod array serialisation traits.
* Add push_back with move semantics to CircularBuffer
* Initial implementation of GameStateSnapshots
* Add GameStateSnapshots to Context.
* Add mp_desync console command.
* Compare sprite data and fill change list.
* Minor changes.
* Proof of concept.
* Calculate offset instead of using offsetof
* Implement game state difference detection
* Update mp_desync console command.
* Fix identification of sprite remove/add.
* Fix crash when only one peep in park when using mp_desync
* Output state differences into user directory desync folder.
* Add desync debugging as an option.
* Add information to network status when a desync report was created.
* Cast to proper type for %llu.
* Update xcode project
* Add more information to the diffed data.
* Remove client-only relevant fields.
* Cleanup.
* Add better name output for misc sprites
* Add srand0 and tick information to the output
* Bump up network version
* Cleanup
* Set desync_debugging to false as default
* Apply suggestions
Introduce RotateEngine and Rct2Engine, FixedSeedSequence and Rct2Seed.
Adhere respectively to requirements `RandomNumberEngine` and `SeedSequence`.
Can be used with C++11 adaptors and distributions in <random>.
This was a regression from #7435 which introduced threads and caused JNI
to misbehave and fail to load our expected classes. Provide a workaround
based on the description in https://stackoverflow.com/a/16302771 which
stores a main thread's class loader and uses that in neighbouring
threads.
OpenRCT2 used to incorrectly write UTF-8 to SV6 names and descriptions. This fixes reading such scenarios. It should also fix the game crashing when attempting to load such a scenario.
What this doesn't do is add support for the encoding that vanilla used for CJK, or add support for creating scenarios with Korean descriptions. That will only be feasible when switching to our own format.
Previously when the arguments of a function wouldn't fit on a single line, clang-format would put each argument on its own line instead. By enabling the binpack parameter setting, it tried to fit as many on one line as possible instead.
Co-authored-by: Hielke Morsink <hielke.morsink@gmail.com>
Assigning a pointer to std::string appears to only perform a copy and
does not transfer ownership of the pointer, thus the allocated memory is
will never be freed.
Implement a method to construct an std::string from a StringBuilder to
avoid memory leaks when retreiving the contents of a StringBuilder and
storing it in a std::string.
It has been reported that Windows Vista crashes in LCMapStringEx when
using LOCALE_NAME_INVARIANT even though it is documented as supported.
As a counter measure, use LOCALE_NAME_USER_DEFAULT for the time being.
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).