Commit Graph

195 Commits

Author SHA1 Message Date
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
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