Commit Graph

167 Commits

Author SHA1 Message Date
Matt 1ca41da2aa Unload objects from context destructor. 2018-08-31 07:18:51 +02:00
Matt 8c6f6a18ab Remove unused passing of object manager. 2018-08-31 07:18:50 +02:00
Matt 71e1b1c21a Remove unnecessary call that can cause null dereference. 2018-08-31 07:18:50 +02:00
Matt 2ac6262293 Use std::unique_ptr for LocalisationService 2018-08-31 07:18:50 +02:00
Matt 837c0a9e7f Use std::unique_ptr for ObjectManager and ObjectRepository 2018-08-31 07:18:49 +02:00
Matt 04928d4b84 Refactor reference over std::shared_ptr. 2018-08-31 07:18:48 +02:00
Michael Steenbeek f9d60ea106
Allow loading CSS17.DAT and MP.DAT on all three RCT1 sources
This should equalise the three in terms of supported features.
2018-08-14 15:41:51 +02: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
Hielke Morsink 73a7e935c3 Correct formatting for files in the project root 2018-07-23 16:00:17 +02:00
clang-format c57bbca827 clang-format root 2018-07-23 16:00:14 +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
Aaron van Geffen f1d4e5b596 Rename Http namespace, add default initialisers. 2018-06-11 11:19:04 +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
Ted John e38f4df575 [wip] Move themes to libopenrct2ui 2018-06-10 23:34:12 +01:00
Ted John f880290b00 Create WinSSL implementation and refactor to class 2018-06-01 21:27:33 +01:00
Ted John 92f6ac7333 Rename header files to match renamed source files 2018-06-01 09:38:30 +02:00
Ted John 056b596124 Use reference types in TitleSequencePlayer 2018-05-31 12:49:09 +01:00
Aaron van Geffen dcff6895b5 Refactor game_init_all into GameState::InitAll. 2018-05-30 11:53:32 +02:00
Ted John f1ee5cad83 Call Park from GameState. 2018-05-30 11:53:32 +02:00
Ted John 4d4e7ba4b1 Create new GameState class for updating the game 2018-05-30 11:53:30 +02:00
Ted John 6af0cb2b88 Fix import of S4 and S6 2018-05-29 18:39:12 +01:00
Ted John 96a0a22cd1 Make start on loading objects only once 2018-05-29 18:39:12 +01:00
Michael Steenbeek d44d727fac
Merge pull request #7543 from AaronVanGeffen/refactor/park
Create new Park class
2018-05-21 10:17:38 +02:00
Ted John 46300f216f Fix #7544: Freeze when starting headless server with no arguments
Fixes #7313: Loading an invalid path with openrct2 produces results different than expected

Do not load title sequences in headless mode and prevent use of null audio mixer when ride music is stopped.
2018-05-20 02:21:44 +01:00
Ted John 721dc00778 Move park_update into Park class.
Co-authored-by: Aaron van Geffen <aaron@aaronweb.net>
2018-05-19 19:44:01 +02:00
Ted John 0d6cde2cdb Create a Park class 2018-05-19 19:43:39 +02:00
Ted John 20fdd46b96
Fix #7513: OpenRCT2 freezes on shutdown (#7514)
Store drawing engine and painter inside Context so that it is disposed before Context.
2018-05-13 15:52:59 +01:00
Ted John 7eb1703f36 Remove old bitmap code via UiContext 2018-05-13 01:11:56 +01:00
Ted John 529c744276 Use unique_ptr and shared_ptr for services in Context 2018-05-13 00:43:50 +01:00
Ted John 9e72e51bab Use std::unique_ptr for discord service 2018-05-11 20:39:00 +01:00
Ted John 8eacc3582c Remove PlainContext 2018-05-11 20:39:00 +01:00
Ted John 302fe00805 Always pass shared_ptr by reference 2018-05-11 20:39:00 +01:00
Ted John d1cbf998a0 Do not return shared_ptr for LocalisationService
GetLocalisationService is currently used a lot, so remove overhead of shared_ptr copy.
2018-05-11 20:39:00 +01:00
Ted John 35df72e61f Remove use of gCurrentLanguage 2018-05-11 20:39:00 +01:00
Ted John 8681b4fac9 [wip] Create new localisation service 2018-05-11 20:37:48 +01:00
Ted John 7b610fd3c0 Use shared_ptr more for UiContext in relation to DrawingEngine 2018-05-11 20:37:48 +01:00
Ted John 7dc170ef85 Use shared_ptr for long-life objects
Use unique_ptr and shared_ptr for IContext, IPlatformEnvironment, IUiContext, and IAudioContext.
2018-05-11 20:37:48 +01:00
woj1993 4b372120f1 Fix #6141: CSS50.dat is never loaded (#7357) 2018-04-13 11:29:31 +01:00
Hielke Morsink dc673a64d8 Give context the ownership of repositories and the object manager (#7340)
This makes them no longer a singleton, which fixes annoying behaviour when launching multiple contexts in one game session.
2018-04-10 13:19:23 +01:00
Duncan 0ab3d0955c
Merge pull request #7310 from OpenRCT2/json-objects
Add support for new JSON object format
2018-04-08 10:45:55 +01:00
Michał Janiszewski 3b7864957a Cleanly shutdown in case of invalid g1.dat (#7361) 2018-03-30 15:38:22 +01:00
Ted John f91449190a Allow game to run without RCT2 install path 2018-03-26 21:38:09 +02:00
Hielke Morsink c5aececcb1 Set scenario save path upon successfully loading a park
Instead of setting the path when clicking on a file in the loadsave dialog, it's now set when the park gets actually loaded.

This fixes the System Dialog not showing when saving a park loaded from command.
2018-03-24 13:24:39 +01:00
Ted John a6d03b3b0f Fix segfault when exiting a network game
Separate out closing of connection into a new method so only that is called when closing the game which then means gfx_invalidate_screen is not called.
2018-03-23 21:54:45 +00:00
Ted John f7dafa9bbb Only enable interactive console for headless 2018-03-22 20:16:58 +00:00