Commit Graph

307 Commits

Author SHA1 Message Date
frutiemax 5c261b6d2e Part of #13874: TrackElementDescriptor loader 2021-08-22 17:47:10 -04:00
Hielke Morsink 6011478590 Directly use std::unique_ptr prvalues
This removes the unnecessary constructor calls and improves flexibility in case of typename changes.
All cases, except for the one in Context.cpp, are temporaries.
2021-08-20 23:38:15 +02:00
ZehMatt 72a6373520
Guard code with DISABLE_NETWORK 2021-08-17 11:30:13 +03:00
ZehMatt 95c2e817f7
Directly call functions in NetworkBase from Context 2021-08-17 06:29:29 +03:00
ZehMatt e440942c54
Remove SetEnvironment from NetworkBase and all its other wrappers 2021-08-17 06:25:47 +03:00
ZehMatt 40313b1ea3
Move network instance into Context 2021-08-17 06:20:07 +03:00
ZehMatt 47287e7fb1
Save crash dumps into a separate directory 2021-07-27 18:39:13 +03:00
duncanspumpkin 3199029168 Split off EntityTweener into seperate file 2021-05-29 07:47:49 +01:00
Silent 94da3cf422
Fix #13445: Make FileScanner::ScanDirectory return a unique_ptr
Also fixes a resource leak in TitleSequence::GetSaves.
2021-05-20 19:22:36 +02:00
Michael Steenbeek 4014fbe861
Add missing call to gfx_unload_csg() 2021-03-30 22:49:00 +02:00
Michał Janiszewski 8ee49ab615 Reduce inclusion of world/Sprite.h 2021-02-25 10:56:27 +01:00
Ted John 3f5698b1e0 Fix REPL write line on Linux 2021-02-16 20:24:51 +00:00
Ted John 2f39442d25 Implement ride music objects and refactor 2021-01-27 18:45:27 +00:00
Matt f684ebd7d9
Allow the main game loop to scale the delta time 2021-01-20 23:13:02 +02:00
Duncan 0c91ed9bdd
Fix #13755. Regression causing entity position corruption (#13828)
When switching from variable frame to fixed frame the entity positions could become corrupted. This would cause to end up being stuck inside of tiles that they could not path out of. When switching from normal speed to hyperspeed the rendering switches from variable to fixed frame. Therefore entitys could end up corrupted when enabling hyperspeed. Due to the way the corruption occured a hang or crash could also occur.
2021-01-13 17:29:30 +00:00
Mathias Gibbens b1e5a11bf3
Several more spelling fixes (#13752)
Signed-off-by: Mathias Gibbens <mathias@calenhad.com>

Co-authored-by: Mathias Gibbens <mathias@calenhad.com>
2021-01-10 18:23:35 +00:00
ζeh Matt 011588b01e
Move window update out of variable frame updates (#13704) 2021-01-10 09:36:34 -03:00
Matt c442ef6207
Improve performance of tweening entities between ticks 2021-01-05 00:26:58 +02:00
Łukasz Pękalski af6512da19
Close #13386: Show a GUI error message if en-GB.txt cannot be loaded 2020-12-16 13:21:07 +01: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
Duncan dcabc8451e
Fix #13250: Crash when opening parks with new ride types (#13256)
This only happens when a new ride type is added and the park is opened in the older version of the game where the ride type does not exist.

Reworked so that invalid rides are not loadable. Force reload of title if current scenario is corrupted.
2020-11-01 14:49:43 +01:00
Keith Stellyes 41c0395adb
Fix #13226: No error is shown when attempting to load a corrupted save 2020-10-18 19:54:26 +02:00
ζeh Matt 645289f4ec
Rename GameActionResult and use GameActions namespace instead (#13184) 2020-10-14 22:04:39 -03:00
Julia Pinheiro cba1d48226
Close #12408: Refactor CURSOR_ID to use strong enum 2020-10-11 18:01:14 +02:00
Keith Stellyes 3468d1fc6b
Close #13125: Selecting the RCT2 files now uses localised dialogs 2020-10-09 21:13:14 +02:00
Matt 091145037e
Move the audio code into OpenRCT2 namespace 2020-10-07 00:34:42 +03:00
Julia Pinheiro 6a76547c5b
Close #12412: Refactor PROMPT_MODE to use strong enum (#13076) 2020-10-02 23:04:59 -03:00
Julia Pinheiro 8800c32e52
Close #12404: Refactor DRAWING_ENGINE to use strong enum (#13070) 2020-10-02 22:41:30 -03:00
Duncan da82144bfb
Fix #12944. Mistake from refactor meant formatter optimised away (#12961)
Not sure why it should get optimised away but this will fix the crashes.
2020-09-18 09:25:17 +01:00
Matt b3b9a348c5
Apply review suggestions 2020-09-17 22:16:05 +03:00
Matt ccde06ab0f
Explicitly pass formatter arguments to ShowError and family 2020-09-17 22:14:36 +03:00
Ted John a1cd02c61c Disable closer zoom levels for software rendering 2020-08-28 01:29:59 +01:00
Michał Janiszewski ddee3c0e46 Postpone update check until the context gets fully initialised 2020-08-14 10:18:17 +02:00
Michał Janiszewski 6ae5645686 Show update information on main screen & in floppy menu 2020-08-14 10:18:17 +02:00
Michał Janiszewski 55835456a0 Pester users to update to latest release 2020-08-14 10:18:17 +02:00
frutiemax 67554a2aae
Close #12458 : Refactor STARTUP_ACTION to use strong enum (#12480) 2020-07-28 17:23:09 +01:00
frutiemax 6598ae14aa Close #12457: Rename INTRO_STATE to use PascalCase 2020-07-26 09:32:53 -04:00
frutiemax 0f1788d273 Part of #12457: Refactor INTRO_STATE to use strong enum 2020-07-26 09:25:29 -04:00
Aaron van Geffen 7b5087f057
Update copyright year to 2020 2020-07-21 15:04:34 +02:00
ζeh Matt 2d81e9c51c
Fix #12229, fix #12312: No error message when loading a save fails 2020-07-19 14:33:32 +02:00
Ted John 3a93525a11 Add rename error message if sea file fails to open 2020-07-12 00:15:21 +01:00
Ted John 8c81cacc6f Add sea decryption 2020-07-11 11:40:34 +01:00
Michael Steenbeek e83b86df4d
Replace occurrences of OpenRCT with OpenRCT2 (#11898) 2020-06-08 15:11:07 +02:00
Michael Steenbeek 9ef8d6da42
Convert most remaining C-style casts to C++-style ones (#11867) 2020-06-07 23:18:11 +02:00
Gymnasiast 9a9ab47856
Remove Twitch from the rest of the code 2020-05-28 09:28:32 +02:00
Ted John c0aa5bdcc8 Create plugin directory automatically 2020-04-26 14:52:57 +01:00
Ted John c67962577a Rename __ENABLE_SCRIPTING__ to ENABLE_SCRIPTING 2020-04-26 14:35:08 +01:00
Ted John bac91cd563 Allow scripting to be compile-disabled 2020-04-26 14:35:03 +01:00
Ted John dc64d3541d Transfer server-client scripts over network 2020-04-26 14:35:03 +01:00
Ted John 639faa2085 Fix GCC issues 2020-04-26 14:35:03 +01:00
Ted John b47bcabaf1 Move ui scripting API to libopenrct2ui 2020-04-26 14:34:59 +01:00
Ted John 4a575975f6 Add hook system 2020-04-26 14:34:59 +01:00
Ted John 1acf1e870a Add park API 2020-04-26 14:34:59 +01:00
Ted John 43508e0402 Add script engine and connect to std console 2020-04-26 14:34:58 +01:00
Breno Rodrigues Guimarães a0619d04cf
Replace usage of set_format_arg by Formatter::Common() (#11412) 2020-04-25 18:44:14 -03:00
ifimfree aaaae16d15
Close #11209: Show a warning when the user is running OpenRCT2 in Wine (#11395) 2020-04-23 19:12:54 +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
Tulio Leao c17127f65b
Use named casts on openrct2 root folder (#11139) 2020-04-17 21:36:25 +02:00
Michał Janiszewski e19eaa6a98 Upload park recording in case of crash 2020-04-02 23:44:59 +02:00
Tulio Leao 9bcd20e0e6 Prefer const ref to send ScreenCoordsXY over 2020-02-29 08:25:48 -03:00
Michael Steenbeek 4c2a0f279b
Fix #10752: Mute button state not correctly set at startup (#10816) 2020-02-22 19:20:14 +01: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
Lomash Gupta 36840f3fe0 fixed gExitCode 2020-01-19 18:35:24 -03:00
Tulio Leao 9d09f1b95c Use ScreenCoordsXY on context cursor operations (#10364) 2019-12-14 22:52:18 +01:00
babywashbear 86844d2a57 Context: replace 2nd std::make_unique<Context> with CreateContext call (#10139) 2019-10-29 17:41:49 +01:00
Michael Steenbeek a11762b11a
Remove old C functions that only call their equivalent
* Remove old C functions that only call their equivalent

* fix formatting
2019-09-22 14:12:49 +02:00
Michał Janiszewski 8637eb6c57
Rename some bits to allow unity builds of libopenrct2 (#9944)
* Rename some bits to allow unity builds of libopenrct2

Some names are clashing when doing a unity build, renaming them solves
the problem.
2019-08-29 23:03:56 +02:00
Ted John adb5c3aa7f Fix assert when exiting game in scenario editor
The object selection window loads objects when it is closed which is triggered from window_close_all. We need to unload all the objects after this step on shutdown.
2019-08-23 20:15:53 +01:00
Matt 769ed255f3
Refactor game action queue out of network into GameActions 2019-08-21 00:15:39 +02:00
Ted John c3234b1442 Refactor map animations and dynamically create on park load (#9705) 2019-08-03 22:18:33 +02:00
Ted John 3e28073981 Log path when loading / saving park 2019-07-22 22:15:01 +01:00
nhair eb13c5a776 Fix #9245: Headless servers apply Discord Rich Presence 2019-06-19 23:02:57 +02:00
ζeh Matt ee79c11389 Fix desync when host changes map 2019-05-19 17:44:43 +02:00
Matt c6ea47c631
Make util_rand thread safe 2019-05-12 11:32:33 +02:00
ζeh Matt c8f822ea70
Gamestate snapshots (#8819)
* 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
2019-05-11 21:31:34 +02:00
Matt 65ef018e4e Move paint_session_alloc and paint_session_free into Painter. 2019-03-31 15:50:55 +02:00
Matt db96df010f Expose Painter in Context 2019-03-31 15:50:55 +02:00
Aaron van Geffen 2af13904c5 Update copyright notices for 2019. (#8903) 2019-03-17 07:16:15 +00:00
Matt a7f8c8aa36 Refactor utf8* use over std::string 2019-02-24 00:08:05 +01:00
ζeh Matt a34422dc26 Fix #8591: Game loop does not run at a consistent tick rate of 40 Hz (#8594)
* Fix #8591: Run game loop at consistent tick rate of 40hz.

* Update distribution/changelog.txt

Co-Authored-By: ZehMatt <m.moninger.h@gmail.com>
2019-01-17 23:22:27 +01:00
Matt 0ba42d6899 Fix TileElementWantsFootpathConnection test not releasing context. 2018-12-29 22:58:33 +01:00
Matt a6efef1e81 Add support to record and replay game commands/actions. 2018-12-29 19:23:27 +01:00
Matt 8e2e60b117 Fix #8464: Crash on game shutdown. 2018-12-17 23:51:43 +01:00
Ted John 08b02943d3 Use std::string for scenario name, details etc. 2018-12-16 19:01:14 +00:00
Michael Steenbeek 6d0f0334d7
Merge pull request #8339 from ZehMatt/realtime-ticks
Use real time ticks for UI effects.
2018-12-15 21:00:44 +01:00
roosen5 d9806305b0 Fix #8358: infinite loop when changing vehicle count on stopped ride. (#8375)
The sprite_remove in Sprite.cpp tries to find itself inside the quadrant.
It does not find itself, and because the rest of the code assumes that it will always find it
The normal code tries to set the value of the next_in_quadrant so that whoever points at it, will now point at its next sprite.
But because it didn't find whoever was pointing to it, it would set the pointer to SPRITE_INDEX_NULL to its next sprite.
This would lead to cycles in the linked list

The reason that the sprite was not found is that during the entry of a ride, the position of a peep is set to LOCATION_NULL
Exiting a ride sets it back to whatever the location is of an exit.
However stopping a ride that still has people in it would go wrong, as the people are removed from the ride through ride_remove_peeps

This function was called during the PaintWindows.
The fact that this function is called during the painting is the problem, because of the tweening:
Before painting all the positions are stored (Which would at that point be the LOCATION_NULL), during the painting
the peep would be removed from the ride, setting their location to the enrance/exit
After painting is done all the positions are restored again, so the patched position is forgotten and then it would be
removing a sprite with location LOCATION_NULL and that goes wrong

The fix is to have the window update outside of paint
2018-12-09 20:46:04 +01:00
Matt 4bc69a0111 Introduce gCurrentRealTimeTicks and refactor some variable names. 2018-12-01 16:36:00 +01:00
Hielke Morsink 354d973a48 Use std::size instead of Util::CountOf 2018-11-23 21:59:08 +01:00
ζeh Matt 223ae74c6b Refactor code to obtain resolutions. (#8215) 2018-11-06 07:20:57 +01:00
Christian Schubert f1d5989bc3 Implement #7930: automatically create custom user content folders 2018-09-01 20:36:18 +02:00
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