Commit Graph

417 Commits

Author SHA1 Message Date
Ted John 14377be487 Create new templated format string 2020-11-27 18:54:55 +00:00
Michael Steenbeek 8b27f7cdf8
Implement ToUpper for WinNT 5.1 (#13422) 2020-11-16 08:12:28 -03:00
Hielke Morsink f0c1ea1d37
Split declarations and definitions to improve compile times when editing (#13332)
* Split FileStream declarations and definitions

* Split JobPool declarations and definitions

* Split StringBuilder declarations and definitions

* Split StringReader declarations and definitions

* Split ZoomLevel declarations and definitions

* Fix missing include in FileClassifier.cpp

* Remove pragma once from source files

* Fix missing include in StringBuilder.h

* Update Xcode project

* Fix compilation of tests

Co-authored-by: Michael Steenbeek <m.o.steenbeek@gmail.com>
2020-11-07 12:42:04 +00:00
Tulio Leao 7b10fa57bb
Merge pull request #13280 from Broxzier/bugfix/filestream-file-nonexisting-folder
Fix crash when using a writable FileStream to a file in non-existing folder
2020-10-25 14:46:48 -03:00
Hielke Morsink b54574fe19 Ensure path exists for writable filestreams 2020-10-24 17:39:16 +02:00
Keith Stellyes 782fab93b4
Add compile-time check for nlohmann json (#13277) 2020-10-24 15:23:17 +02:00
ζeh Matt 645289f4ec
Rename GameActionResult and use GameActions namespace instead (#13184) 2020-10-14 22:04:39 -03:00
Simon Jarrett 134371f03c Change includes of nlohmann/json_fwd.hpp to new core/JsonFwd.hpp 2020-10-06 00:16:21 +02:00
Michał Janiszewski 17e86a61c9
WinNT5.1 networking fixes (#12759) 2020-09-24 10:28:24 +02:00
Gymnasiast a896d238b1
Remove optional arguments to json_t::parse 2020-09-18 23:46:07 +02:00
Gymnasiast 72c13c8e77
Allow compilation with nlohmann/json < 3.9.0 2020-09-18 23:31:09 +02:00
Gymnasiast 265429c85a
Fix compilation on 32-bit Windows and MinGW 2020-09-18 20:54:36 +02:00
Ted John c204767176
Fix RTL for Windows 2020-09-18 19:46:12 +02:00
Michael Steenbeek 1982e8491b
Merge pull request #12667 from mwnciau/json-refactor
Migrate JSON library to JSON for Modern C++
2020-09-17 21:11:06 +02:00
Simon Jarrett 324e94e6ce Fix #9088: refactor JSON code to use a more modern C++ library
- Removed dependency on jansson
- Implemented nlohmann JSON for Modern C++
- Moved generic GetString, etc., helper functions out of ObjectJsonHelpers.hpp to Json.hpp
- Added GetEnum helper function
- Added AsObject and AsArray helper functions
- Removed GetStringArray, etc., helper functions as they're not needed with the better language features
- Added second GetFlags definition that allows specifying inverted flags - this is a bit cleaner than previous hacks
- Comments!
2020-09-16 20:18:52 +01:00
Matt 3eff713765
Remove unused Registration.hpp 2020-09-16 20:23:39 +03:00
Tulio Leao 55f2eeb04d
Favour constexpr function over macro on Crypt.CNG.cpp 2020-09-10 21:36:21 +02:00
Tulio Leao fc59cb55a5
Cleanup c-style casts from Path.cpp 2020-09-10 21:36:21 +02:00
Tulio Leao 9d2a9d76d3
Cleanup c-style casts from String.cpp 2020-09-10 21:36:21 +02:00
Tulio Leao 5f47546392
Cleanup c-style casts from Http.WinHttp.cpp 2020-09-10 21:36:21 +02:00
Tulio Leao 5afe6407a1
Cleanup c-style casts from FileWatcher.cpp 2020-09-10 21:36:21 +02:00
Tulio Leao 5abbbf1357
Cleanup c-style casts from Crypt.CNG.cpp 2020-09-10 21:36:21 +02:00
Tulio Leao cb7e190c8a
Cleanup c-style casts from File.cpp 2020-09-10 21:36:21 +02:00
Tulio Leao de58f0f7a0
Cleanup c-style casts from FileScanner.hpp 2020-09-10 21:36:21 +02:00
Gymnasiast c83ddefe47
Convert remaining C-style casts to C++-style ones 2020-09-10 21:36:20 +02:00
Duncan c0255efeaa
Create an enum class serializer (#12810)
* Create an enum class serializer

* Make visitor work again

* Make suggested changes
2020-09-03 21:55:46 +01:00
Gabriel Guedes 95ae589750 Part of #11159: Prefer std::basic_string<utf8> over raw pointer
Usage of std::basic_string to improve readability and maintainability.
2020-08-31 21:06:02 -03:00
Gabriel Guedes 332e9e76d5 Part of #11159: Removing unused functions from StringBuilder.hpp 2020-08-29 14:34:30 -03:00
ζeh Matt e464c9e522
Invert the condition (#12645) 2020-08-11 19:29:18 +01:00
Matt 2a9796f2cc Add more guards in network code 2020-08-11 15:56:09 +02:00
ceeac db010cd971
Fix compile error when compiling with clang-10 (#12599)
<cstddef> is required for size_t (used in CircularBuffer.h)
2020-08-06 16:24:50 +01:00
ζeh Matt 765eada18e
Merge pull request #12526 from ZehMatt/win32-cleanup
Win32 and namespace cleanup
2020-08-05 17:18:50 +02:00
Matt 97d14feaa6 Rebase fixes 2020-08-05 16:35:40 +02:00
Matt 0dc43d66e4 Remove the use of INTERFACE macro and macro its self 2020-08-05 16:30:44 +02:00
Matt 83355e35cc Move IStream, MemoryStream, FileStream into OpenRCT2 namespace 2020-08-05 16:29:36 +02:00
Matt 30376085cf Include missing headers 2020-08-05 16:29:29 +02:00
Matt 05a9b27136 Fix ByteSwapBE type safety 2020-08-05 16:17:18 +02:00
Sidney 7c0b03463c
Close #12452: Refactor DIAGNOSTIC_LEVEL to use strong enum (#12549) 2020-08-02 07:51:02 +01:00
Aaron van Geffen 7b5087f057
Update copyright year to 2020 2020-07-21 15:04:34 +02:00
Ted John cca43eb9e1 Fix mingw build 2020-07-11 11:45:50 +01:00
Tulio Leao f725fff2da
Clarify CoordsRange-derived interface methods (#12127) 2020-07-06 14:42:11 +02:00
frutiemax 26ae2dbf04
Part of #11437: Move PlatformFileExists to Platform2.h (#12077) 2020-07-02 12:03:31 -03:00
Tulio Leao 03ba7e5301
Merge pull request #11933 from AaronVanGeffen/unused-vars
Patch unused variables
2020-06-11 12:12:06 -03:00
Aaron van Geffen 3090e2af79 Fix compilation failure due to unused vars.
Compilation fails due to warnings-turned-errors.
2020-06-11 15:22:06 +02:00
Michael Steenbeek 9ef8d6da42
Convert most remaining C-style casts to C++-style ones (#11867) 2020-06-07 23:18:11 +02:00
Ted John 8f77125cdb
Fix #11298: Unable to advertise server (500): Retry with ipv4 only (#11824)
Add new config option to allow any address to be advertised. This then
doesn't rely on the master server retrieving the server IP address via
the HTTP request which can often be IPv6 by default.
2020-05-30 18:21:22 +02:00
Ted John 46bb30f8a1 Refactor rct_palette to GamePalette 2020-05-27 20:52:51 +01:00
Gymnasiast de69bbd661
Guard against illegal access 2020-05-19 21:25:27 +02:00
Gymnasiast 4b25345d8d
Create GamePalette struct 2020-05-19 21:09:51 +02:00
Michael Steenbeek f0bd05cf6d
Part of #11158: Remove more C-style casts (#11743) 2020-05-13 21:22:50 -03:00
Michael Steenbeek d7637cd70f
Replace many C-style casts (#11720) 2020-05-11 14:32:56 +02:00
Michael Steenbeek a261b4ce33
Remove commented out code (#11721) 2020-05-11 13:54:15 +02:00
Ted John 45d32bec68
[Plugin] Add API for taking captures and giant captures of the park 2020-05-09 13:55:24 +02:00
Ted John 51ed760409 Fix FileWatcher header file 2020-04-26 14:35:09 +01:00
Ted John 127dd1543e Disable FileWatcher for macOS 2020-04-26 14:35:08 +01:00
Ted John 2f525e0539 Apply more code review comments 2020-04-26 14:35:07 +01:00
Ted John d480fb8daa Apply suggestions from code review
Co-Authored-By: Tulio Leao <tupaschoal@gmail.com>
Co-Authored-By: Michael Steenbeek <m.o.steenbeek@gmail.com>
2020-04-26 14:35:07 +01:00
Ted John 62d15e44db Fix mingw build 2020-04-26 14:35:07 +01:00
Ted John e6341f0a42 Get scripting compiling on clang 2020-04-26 14:35:03 +01:00
Ted John 4109b2c55a Fix build errors 2020-04-26 14:35:01 +01:00
Hielke Morsink e8bdb95f13 format new files
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.
2020-04-26 14:35:00 +01:00
Hielke Morsink c064614280 Use new copyright/license notice 2020-04-26 14:35:00 +01:00
Ted John 5ba96a34ac Fix FileWatcher for Windows 2020-04-26 14:35:00 +01:00
Ted John 1fd33dd86a Use new FileWatcher class 2020-04-26 14:35:00 +01:00
Ted John 834cfad502 Create new FileWatcher class 2020-04-26 14:34:59 +01:00
FlukiestEmperor 23d295924d
Fix Android filesystem compilation error when using NDK revision 19+
When attemping to build with ndk 19+ I get the following error: error: undefined reference to 'std::__ndk1::__fs::filesystem::path::__extension() const'

Looking at this issue here https://github.com/android/ndk/issues/609 and https://android.googlesource.com/platform/ndk/+/master/docs/Roadmap.md#package-management it's stated that the ndk does not support std::filesystem.
2020-04-24 13:08:44 +02:00
Michael Steenbeek f5e2efac77
Close #11390: Write OpenRCT2 build hash to screenshot metadata (#11423) 2020-04-24 04:00:17 +02:00
Michał Janiszewski 2323cc1596
Use named casts instead of old-style casts
Change prepared with clang-tidy and google-readability-casting check
2020-04-22 17:09:29 +02:00
Michał Janiszewski 5f97637d5e Only suggest final when using non-LTO builds
In LTO builds GCC issues the suggestion-warning from linking stage,
when pragmas are already gone and do nothing.
2020-04-21 13:31:01 +02:00
Michael Steenbeek 4f86d0115c
Merge pull request #10866 from Gymnasiast/refactor/more-tile-element-prep
Refactor/more tile element prep
2020-03-06 09:25:32 +01:00
Michał Janiszewski 92e5958ab6
Improve WinNT 5.1/MinGW support (#10869) 2020-03-05 19:35:23 +01:00
Gymnasiast 3ed7694495
Move tile element-specific flags 2020-03-04 22:01:09 +01:00
ζeh Matt 12ab1e9633
Fix #10713: Correctly encode network ride id over network (#10802)
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
2020-02-21 18:11:26 +01:00
Tulio Leao 0c4623a39f
Replace typedef aliasing by using (#10712) 2020-02-17 11:43:47 +01:00
Michał Janiszewski 38907fd0c7
Fix memory leaks around PNG/sprite handling (#10711) 2020-02-16 07:25:30 +01:00
Ted John 4e032aeff0 Improve WinHttp code 2020-02-08 18:11:08 +00:00
Ted John 4af69555d1 Improve WinHttp logic / code 2020-02-08 17:47:03 +00:00
Ted John be9cb19df5 Replace cURL with WinHttp implementation on Windows
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.
2020-02-08 17:47:03 +00:00
Ted John b76092eda3 Fix mingw 2020-02-05 22:39:22 +00:00
Ted John d6da718717 Link to bcrypt instead of ncrypt 2020-02-05 21:24:31 +00:00
Ted John 0cc02f397e Fix guards on crypto implementations 2020-02-05 08:04:05 +00:00
Ted John 57a758b9c0 Get all crypto tests passing 2020-02-05 02:09:19 +00:00
Ted John e2a541bff4 Get import / export of public key working 2020-02-05 00:36:41 +00:00
Ted John c8ef6233aa Add CNG implementation of crypto functions 2020-02-04 22:49:43 +00:00
Gymnasiast ca2f37ae7f
Remove opt::optional polyfill
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.
2020-02-01 22:25:03 +01:00
Michael Steenbeek 77d18a664b
Implement #10358: Clean up leftover references to openrct2.website 2020-01-13 20:20:49 +01:00
ζeh Matt 2242a72b29 Add assertion failure reason to the Backtrace service integration (#10562) 2020-01-13 19:22:45 +01:00
Ted John 171969f5fb Fix #10496: Game can't handle path with non-english string 2020-01-11 00:43:00 +00:00
Tulio Leao 6cdbb901a5 Fix C26439 SPECIAL_NOEXCEPT 2019-12-27 15:05:27 -03:00
nia 1f220f2d62 Simplify OS-specific FileStream code (#10270)
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.
2019-12-19 18:34:31 +01:00
duncanspumpkin df5d5f4eb1 Fix the logging once and for all 2019-12-15 16:48:14 +00:00
duncanspumpkin cfb4bba721 Remove todo and clang format where required
Change array type to avoid additional code

Make CI's happier
2019-12-15 08:21:32 +00:00
duncanspumpkin 7dbf0353ff Serialise scenery, mazes, entrances 2019-12-15 08:21:32 +00:00
duncanspumpkin 83503f4c69 Serialise track design. Start work on making it work
Fix track designs issuing extra game actions
2019-12-15 08:21:32 +00:00
tjwrona1992 5f41e9df38 Add missing include for std::max to fix VS16.4.0P2 compilation (#10282)
* 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.
2019-11-24 08:12:50 +01:00
Paweł Bylica 7e7e088d8e
Use fs::path for some implementations in Path 2019-11-21 13:40:21 +01:00
Paweł Bylica 45002d723a
Add core/FileSystem.hpp for accessing std::filesystem
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.
2019-11-21 13:40:20 +01:00
ζeh Matt f6a23fd5f5 Add compile time selection for copying data with specialised paths (#9331) 2019-11-09 15:54:43 +01:00
Michał Janiszewski afc92ee15a
ifdef-out WinNT 6.0+ APIs (#10198)
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.
2019-11-08 23:16:15 +01:00
Richard Fine 0e04dbeea1 Allow SwapBE to swap non-uint types
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.
2019-09-01 18:40:11 +01:00