1011 Commits

Author SHA1 Message Date
Marino Rottier 45ff80d890 Refactor widget state to single storage model (#26443)
* Allow flag/bitmask coexistence in readers

* Add factory helpers and bulk setters for per-widget flags

* Switch coexistence from OR-both to per-window opt-in

* Migrate seven small windows to per-widget flags

* Migrate seven more windows to per-widget flags

* Migrate Cheats, MapGen and Footpath to per-widget flags

* Fix #26421: scenery tab highlight wraps when there are 64+ groups

* Migrate Ride window to per-widget flags

* Migrate ride and maze construction windows to per-widget flags

* Migrate six more windows to per-widget flags

* Migrate Banner, EditorScenarioOptions and RideList to per-widget flags

* Migrate SceneryScatter and LoadSave to per-widget flags

* Migrate EditorObjectSelection, GameBottomToolbar, Guest, Map, NewRide and Park to per-widget flags

* Migrate TopToolbar, TrackList, Research, Player and Options to per-widget flags

* Opt in remaining windows to per-widget flags

* Narrow getters and setters to per-widget flags

* Remove bitmask fields and useWidgetFlags switch

* Restore switch statements for tab/density pressed state

* Add makeHoldableSpinnerWidgets to drop per-page loops

* Update tests for per-widget flag storage

* Add changelog entry for #26421

* Reword narrative-tense comments from the migration

* Fix clang-format violations

* Remove dead holdable-widget tables from Park and Finances
2026-04-28 09:26:02 +02:00
Michał Janiszewski 0da634d6e7 Fix #26310: crash when multiple subscribers register for the same event (#26315)
The scripting engine's `ExecutePluginCall` by default frees its `JSValue` arguments.
When `HookEngine::Call` iterates over multiple subscribers, the first call would free
the argument, leaving subsequent subscribers with an invalid pointer (use-after-free).

This commit fixes the issue by duplicating the `JSValue` for each subscriber and
ensuring the original value is correctly managed based on the `keepArgsAlive` flag.

A new C++ headless test `ScriptingTests.cpp` is added to verify the fix and prevent
future regressions.
2026-04-05 19:57:00 +02:00
Eve Silfanus 52d7e1833b Build Performance Optimization (#26015)
* Build Performance Optimization

* Fixed include order formatting

* Reverted CMakeLists.txt

* Fixed pch implementation

* Removed cmake pch

* Update test/tests/CMakeLists.txt

---------

Co-authored-by: Michał Janiszewski <janisozaur@users.noreply.github.com>
2026-02-24 11:39:15 +01:00
frozensnowy 8ff9efa3a1 Fix #25963: Crash when loading corrupted saves with duplicate entity indices (#25980)
Corrupted RCT1/RCT2 save files may contain entities with duplicate or invalid EntityIndex values and when importing these saves, CreateEntityAt returns nullptr for duplicate indices, causing a null pointer dereference crash in ImportEntityCommonProperties, this sanitises each entity's (entities?) EntityIndex to match its array position, so that CreateEntityAt always succeeds. Added unit tests too for just this case, with a crashing save file.
2026-02-12 13:33:06 +00:00
Aaron van Geffen 1cc7006127 Reorganise game actions into folders (#25987) 2026-02-10 08:57:40 +01:00
Aaron van Geffen 773ba479cd Create separate unit for GameActionRunner 2026-02-09 16:06:56 +01:00
frozensnowy b3217703fe Fix #25910: Folders starting with numbers sort incorrectly (#25914)
Commit 43f7d2d91 introduced a regression where logicalCmp compared digit starting strings lexicographically instead of numerically, causing folders to sort as "1, 10, 11, 2..." instead of "1, 2... 10, 11". This commit removes the broken special case,  the main loop already handles
numeric comparison correctly
2026-02-05 21:50:21 +01:00
matheusvb3 e7246eb2f1 Remove redundant negation in a few expressions (#25940) 2026-02-03 20:51:12 +01:00
matheusvb3 c7efa777f7 Remove deprecated C headers (#25921) 2026-02-02 12:41:50 +01:00
matheusvb3 dcba4cb099 Remove redundant namespaces qualifiers (#25837) 2026-01-23 21:46:08 +00:00
matheusvb3 42d69af5b5 Add missing include guards
These were being used in multiple files all throughout the codebase!
2026-01-16 12:43:59 -03:00
matheusvb3 f6cbfb91f8 Remove stray semicolons after declarations 2026-01-16 12:43:59 -03:00
matheusvb3 6ce7379d9b Remove redundant namespace qualifiers from tests project 2026-01-07 21:04:15 -03:00
matheusvb3 e209a3d733 Remove superfluous includes from /test/tests folder (#25766) 2026-01-07 14:47:52 +01:00
Aaron van Geffen b5cd780b3e Rework drawing header includes (#25744)
* Move Csg unit into OpenRCT2 namespace

* Move G1Element into its own header file

* Clean up SpriteCommands.h

* Add trailing namespace comment to Csg.cpp

* Remove Drawing.h dependency from Graph.h

* Add <memory> include to G1Element.h

* Remove Drawing.h include from ImageTable.h (used by all objects!)

* Drop Drawing.h dependency from OpenGLFramebuffer.h

* Drop Drawing.h dependency from TextureCache.h

* Drop Drawing.h include from TitleScene.h

* Drop Drawing.h dependency from Widget.h

* Add <optional> include to SpriteFile.h

* Add Drawing.h to PlayTests, S6ImportExportTests

* Include <cstdint> in TitleScene.h for SIZE_MAX
2026-01-05 19:09:34 +00:00
Gymnasiast e6fa262b9e Rename G1Element members, add unions for palette entries 2025-12-27 16:56:54 +01:00
Michael Steenbeek 355bb5d58d Refactor GAME_COMMAND_FLAG_* to enum+FlagHolder 2025-12-11 00:12:21 +01:00
Kirill Gusev b1103708ea Show error message when issuing replay_start with a nonexistent file 2025-12-09 08:56:08 +01:00
Gymnasiast 0451c8775b Update expected ride ratings in test data for LIM Launched changes 2025-11-09 13:41:51 +01:00
Gymnasiast 57e65f5888 Rename members of RCT2LanguageId 2025-10-07 20:46:11 +02:00
Gymnasiast 890b8137ba Rename members of FormatToken 2025-10-07 20:27:03 +02:00
Gymnasiast 8457be26e9 Rename members of CurrencyType 2025-10-07 20:24:44 +02:00
Gymnasiast daa4fe8ac3 Rename field of all config categories 2025-10-07 20:21:32 +02:00
Gymnasiast 159dc7aab0 Rename members of PeepState 2025-10-05 14:46:12 +02:00
ζeh Matt 518a75f30d Parsing floats/doubles currently unsupported 2025-09-29 13:12:24 +03:00
ζeh Matt 9eeaf9a001 Rename parse to tryParse, add throwing version, return views for split 2025-09-28 23:07:29 +03:00
ζeh Matt 725b3782bd Add tests for String::parse 2025-09-28 22:35:11 +03:00
ζeh Matt 43f7d2d912 Fix logicalCmp not sorting in natural order, refactor the entire thing 2025-09-27 20:21:30 +03:00
Michael Steenbeek a73bf7a2c7 Split CLI commands into their own files (#25241) 2025-09-24 15:43:25 +02:00
Aaron van Geffen 531cb68727 RideManager: use explicit game state rather than using implicit global 2025-09-11 13:42:18 +02:00
Aaron van Geffen 832a1d1f74 Move localisation units into OpenRCT2 namespace 2025-09-11 22:11:12 +02:00
Aaron van Geffen 4446ff9f6f Pass game state ref as parameter to game actions (#25065) 2025-09-08 16:21:29 +02:00
Aaron van Geffen 12ab9195b6 Rework EntityRegistry into class 2025-08-31 14:29:36 +02:00
Aaron van Geffen 0e2f9fbc03 Move RideSetStatus, RideSetVehicle into GameActions namespace 2025-08-27 11:03:08 +02:00
Aaron van Geffen 1bcee698a9 Move RideSetName/Price/Setting actions into GameActions namespace 2025-08-27 10:47:34 +02:00
Aaron van Geffen a052437d12 Move Park game actions to GameActions namespace 2025-08-26 20:52:46 +02:00
Gymnasiast 9c810d9e32 Update ParkData fields to new code style 2025-08-21 22:12:41 +02:00
Tulio Leao 67b8b09244 Move RatingTuple into namespace 2025-08-17 06:27:07 -03:00
Tulio Leao ad375907b1 Move RideRatingsUpdateRide into namespace 2025-08-17 06:18:15 -03:00
LRFLEW 52e3c774bc Use ZStandard for Park and Replay Files (#24734) 2025-08-06 21:50:18 +02:00
Gymnasiast 26a0856154 Update test suite for Sawyer coding changes 2025-07-04 23:20:37 +02:00
LRFLEW 4101fb65a9 Refactor Compression and Streams, and Add IStream Direct Interface 2025-07-04 18:55:17 +02:00
mix 78c2b85b1d Rename MapAnimation namespace to MapAnimations 2025-06-13 21:13:33 +01:00
mix 7df1a8602c Rename MapAnimation::CreateAll to MarkAllTiles 2025-06-13 21:13:32 +01:00
mix 57148e137a Load temporary map animations from S4 files 2025-06-13 21:13:32 +01:00
ζeh Matt 769a85afb7 Refactor how map animations are created and stored 2025-06-13 21:13:32 +01:00
Matt 42df41efdb Remove the use of shared_ptr for the Context (#24404)
* Replace shared_ptr with unique_ptr for Context systems, return refs

* Fix all the users

* clang-format fix

* Fix linux builds
2025-05-15 22:46:06 +03:00
ζeh Matt 1e2d94fc95 Add project for dependencies, restructure targets and cleanup unused 2025-04-23 01:46:12 +03:00
Duncan add17b14ae Use aliases in cmake to prevent mistakes. Fix g2 dependency mistake (#24213)
Move libopenrct2 cmake to libopenrct2

Revert using aliases for install
2025-04-14 09:45:37 +01:00
Gymnasiast b26a2953d7 Rename IMAGE_FORMAT and its members 2025-03-26 11:59:12 +01:00