Commit Graph

132 Commits

Author SHA1 Message Date
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
Ted John dd0573b235 Move in game console to UI library 2018-03-22 20:16:58 +00:00
Ted John d18f416370 Add basic interactive console using linenoise 2018-03-22 20:16:58 +00:00
Michał Janiszewski fc97c8c5db Reduce inclusion of <string> header 2018-03-21 22:39:19 +01:00
Michał Janiszewski cd065d4f41 Reduce includes in common header 2018-03-20 00:27:58 +01:00
Michał Janiszewski 4dd0995efb Move cmath out of common.h 2018-03-18 23:29:13 +01:00
Hielke Morsink 69867bcecd Fix typo 'instad' -> 'instead' [ci skip] 2018-03-13 23:44:34 +01:00
Michał Janiszewski 764520076f
Reduce header inclusion
* Update includes in PlatformEnvironment.cpp

* Update includes in ParkImporter.h

* Update includes of OpenRCT2.h

* Update includes in Intro.h

* Remove unused include from Input.cpp

* Update includes of Imaging.h

* Update includes in Game.h

* Update includes in Editor.h

* Update includes of Context.cpp

* Update includes in Cheats.cpp, CmdlineSprite.cpp

* Update includes of some source files

* Update includes in some cpp files

* Update includes in some cpp files

* Update includes in TextureCache.h

* Fix tests

* Update includes in Font.cpp

* Update includes in LightFX files

* Update some includes

* Fix GCC builds

* Update some includes

* Update some includes

* Update includes in FontsFamilies.*

* Update includes of Console.h

* Improve includes in Window.h

* Improve headers in Viewport.h/Window.h

* Fix MSVC build

* Fix network-less builds

* Reduce inclusion of Map.h
2018-03-13 13:14:02 +01:00
Michał Janiszewski 282553f0c5 Upgrade some char arrays to strings 2018-02-07 23:14:29 +01:00
Ted John b0755123fd Fix loading of bad g1.dat 2018-02-05 18:47:40 +00:00
Ted John 76344498bb Fix outPath not set in platform_get_user_directory 2018-02-05 17:19:39 +00:00
Gymnasiast 778ba466c5 Remove almost every extern C block 2018-02-05 16:20:15 +01:00
Ted John 0c71855769 Replace Memory::Copy with std::copy 2018-02-04 12:40:24 +00:00
Ted John 87cd9f88b3 Rewrite Platform::GetInstallPath 2018-02-02 12:41:26 +00:00
ZehMatt abd74dbb1e Add exception handling in LoadParkFromFile. 2018-01-21 21:46:11 +00:00
Ted John d9d2b2373d Rename crash.h to Crash.h 2018-01-18 21:12:41 +00:00
ZehMatt 84f2917f59 Use const and constexpr whenever possible. 2018-01-11 22:29:08 +01:00
Michael Steenbeek 6a88d6e04d Move and rename RCT{1,2,12}.h 2018-01-09 13:36:41 +01:00
Ted John c974daf467 Refactor console.c to C++ 2018-01-07 12:39:58 +01:00
Ted John b781291b58 Refactor chat.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
Ted John 0c3c998177 Refactor lightfx.c to C++ 2018-01-05 22:57:55 +01:00
Ted John 02c58a6c5a Remove custom base Exception class 2018-01-05 18:11:47 +00:00
Michael Steenbeek 347ff702d0 Refactor objects 2018-01-03 10:16:51 +01:00
Tomas Dittmann c22dac0a29 add missing exception handling.
LoadParkFromStream() now handles exceptions from parkImporter->LoadFromStream().
2017-12-27 14:32:19 +00:00
Marijn van der Werf e9ef843619 Move majority of input.c to UI 2017-12-16 15:47:38 +02:00
Ted John 6e34aaa321 Fix debug assert when closing game from object selection 2017-12-16 12:22:14 +00:00
Michael Steenbeek 1a9975d683 Compile util and cheats as C++ 2017-12-14 10:03:21 +01:00
Michael Steenbeek 6dc49d643a Compile files in base dir as C++ 2017-12-13 08:03:48 +01:00
Christian F. Coors 0aa515355a Add cursor scaling 2017-12-12 22:11:40 +01:00
Michael Steenbeek 60d8865efb Compile game.c and game.h as C++ 2017-12-05 09:10:27 +01:00
Ted John 99d7aaa2d6 Remove RCT2 interop 2017-12-04 19:04:06 +00:00
Ted John 66a6aa95f6 Redirect platform_get_user_directory to IPlatformEnvironment
- Remove old code for getting user directory, redirect to IPlatformEnvironment.
- Fix config loading so that it uses path straight from IPlatformEnvironment.
- Add more special folder implementation in Platform2.
2017-12-01 21:09:52 +00:00
Ted John 323b8dd352 Partially fix #6129: Guest List not updating after a ride rename
- Force refresh of ride list and guest list for both rename ride and demolish ride actions.
2017-11-23 09:40:39 +01:00
Ted John b5137b0e37
Merge pull request #6574 from IntelOrca/protect-g1-access
Refactor g1 access
2017-11-16 18:51:32 +00:00
Ted John 83e80d9658 Implement basic discord status report 2017-11-11 23:48:04 +00:00