1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-25 15:54:31 +01:00
Commit Graph

233 Commits

Author SHA1 Message Date
Tom Lankhorst
dfe7f0614c Consistency 2019-02-01 21:00:19 +01:00
Tom Lankhorst
16691b22ba Use state struct 2019-02-01 19:29:43 +01:00
Tom Lankhorst
2ea347f15f MSVC SFINAE compatibility 2019-02-01 15:50:09 +01:00
Tom Lankhorst
1a81d60609 Expose gScenarioRand, add <algorithm> 2019-02-01 14:48:45 +01:00
Tom Lankhorst
6a42a95495 Refactor random engine
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>.
2019-02-01 14:32:04 +01:00
Tom Lankhorst
4c015edaf6 Templatise rorN and rolN with N in {8, 16, 32, 64} 2019-01-28 10:55:24 +01:00
IntelOrca
b9fd90ffd3 Implement ClearAction. 2019-01-07 09:04:51 +01:00
Michał Janiszewski
7e769ed662 Fix #7536: Android build fails to start (#8554)
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.
2019-01-04 19:48:26 +01:00
Matt
fc4e45562d Use stringstream to log integral values. 2019-01-02 06:39:59 +01:00
Matt
a8254aa292 Add 64 bit serialisation support. 2019-01-02 05:18:36 +01:00
Matt
ccc3227113 Cleanup. 2018-12-29 19:23:27 +01:00
Matt
f6dbf5f1a2 Add std::array serialiser support. 2018-12-29 19:23:27 +01:00
Matt
000a9694f9 Fix DataSerialiser not accepting temporary values. 2018-12-29 19:23:27 +01:00
Matt
a6efef1e81 Add support to record and replay game commands/actions. 2018-12-29 19:23:27 +01:00
ζeh Matt
7d19a5bc77 Refactor memcpy to std::memcpy and memset to std::memset (#8408) 2018-12-15 22:23:31 +01:00
Hielke Morsink
354d973a48 Use std::size instead of Util::CountOf 2018-11-23 21:59:08 +01:00
ζeh Matt
1abb31a159 Implement game action logging. (#8138) 2018-11-20 06:04:42 +01:00
Michał Janiszewski
180655dafa Fix printf format specifiers (#8160) 2018-10-26 06:09:12 -07:00
Michał Janiszewski
d5be45e27a Add missing argument to format (#8082) 2018-10-11 06:20:01 +02:00
Ted John
b9c2fdedd1 Resolve absolute path when indexing files
This ensures scenarios are displayed with their full path in the scenario select window rather than as specified in config or command line.
2018-09-08 22:17:21 +01:00
Michael Steenbeek
13c326eb50 Fix part of #7415: Korean scenario descriptions are mangled
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.
2018-08-13 15:53:44 +02:00
Linus Unnebäck
2b3370228b Remove the last usage of Math.hpp 2018-08-12 16:47:12 +01:00
Linus Unnebäck
fd07be587a Remove Math::Clamp in favour of std::clamp 2018-08-12 16:47:12 +01:00
clang-format
d787872cbe Indent preprocessor directives 2018-07-23 16:00:23 +02:00
clang-format
b02dfdbc93 Binpack function arguments together
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>
2018-07-23 16:00:22 +02:00
clang-format
95ce592579 Enforce not breaking before assignments and function names
Co-authored-by: Hielke Morsink <hielke.morsink@gmail.com>
2018-07-23 16:00:19 +02:00
clang-format
3a4a11f738 clang-format core 2018-07-23 16:00:03 +02:00
Hielke Morsink
ce59ed0ba2 Fix include order and defines for Windows builds 2018-07-23 15:57:59 +02:00
Øystein Dale
de464e2783 Use a better constructor in StringBuilder::GetStdString 2018-07-18 23:57:11 +02:00
Øystein Dale
934e53869c Fix memory leaks in localisation
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.
2018-07-18 00:07:48 +02:00
Ted John
f728a5074a Fix #7765: Crash when opening ride list window on Windows Vista (#7781)
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.
2018-07-14 08:52:12 +01:00
Aaron van Geffen
f963f969c1 Fix compilation on Linux, macOS. (#7732) 2018-06-26 11:16:03 +02:00
Ted John
0f2ccebfe7 Fix #7533: Screenshot is incorrectly named in CJK
For Windows, convert path to UTF-16 before passing to fstream constructor.
2018-06-25 18:14:55 +01: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
Ted John
7373987f0a Merge pull request #6978 from tobiaskohlbau/refactor/network
HTTP: Refactor into modern C++
2018-06-12 21:50:46 +01:00
pkubaj
7fbbce5712 Include cstddef
This fixes compilation on FreeBSD and LLVM 6.0.
2018-06-12 14:38:59 +02:00
Tobias Kohlbau
62c25d88fb HTTP: refactor http into modern C++
Signed-off-by: Tobias Kohlbau <tobias@kohlbau.de>
2018-06-11 10:24:19 +02:00
Michał Janiszewski
1d28826b79 Fix -Wdocumentation and add it to default warnings 2018-06-11 09:52:54 +02:00
Aaron van Geffen
ee4b8c11ae Prevent invoking a copy constructor in some ranged for loops. 2018-06-08 22:29:42 +02:00
Michał Janiszewski
320eee0d59 Fix -Wunreachable-code-break and add it to deafult warnings (#7634) 2018-06-06 22:30:21 +02:00
Hielke Morsink
5d0022a5cb Remove argument list from zero-initializers with zero/false/nullptr value 2018-06-04 19:50:46 +02:00
Ted John
a413d43cda Fix mingw 2018-06-01 22:44:25 +01:00
Aaron van Geffen
53b66fd250 Add Crypt files to Xcode project. 2018-06-01 22:41:42 +02:00
Ted John
ae81af7965 Fix Linux 2018-06-01 21:28:27 +01:00
Ted John
72293f2208 Implement new Crypt code and remove CNG for now 2018-06-01 21:27:34 +01:00
Ted John
b8d37548ed Implement PEM writing for CNG implementation 2018-06-01 21:27:34 +01:00
Ted John
9467438c1c Implement PEM reading for CNG implementation 2018-06-01 21:27:34 +01:00
Ted John
3b2b15c0f3 Implement CNG implementation bar pem reading 2018-06-01 21:27:34 +01:00