Skip to content

[Plugin] Fix missing invalidation on various plugin api setters for entities #24310

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

Basssiiie
Copy link
Member

Hello,

The awesome additions of the OpenGL invalidation in #20073 shined some light on various plugin api setters that were not properly invalidating the affected entity. The issues were likely already present in software rendering for much longer, but I wasn't aware of that until recently.

This PR aims to fix that by calling Invalidate() in the various setters that could affect what is shown on the screen, and did not yet invalidate the screen for it.

To test it, you can for example open the RideVehicleEditor, and try to change a vehicle's colour, type, or variant. On develop, it will update on the window's viewport, but not always on the main viewport. This is easiest noticeable if you spawn lots of trains, enable the "Synchronise" button, en select "All vehicles on all trains" from the target dropdown.

Thank you for your time. 🙂

@ZehMatt ZehMatt added this to the v0.4.22 milestone Apr 30, 2025
@Basssiiie Basssiiie force-pushed the fix-plugin-entity-invalidation branch from 1b193bf to 21beea9 Compare April 30, 2025 20:25
@ZehMatt ZehMatt added the changelog This issue/PR deserves a changelog entry. label Apr 30, 2025
@Basssiiie
Copy link
Member Author

@ZehMatt You're quick haha. Changelog entry is added now too. 😄

@ZehMatt
Copy link
Member

ZehMatt commented Apr 30, 2025

It makes sense so I didn't have to really give it much thought.

@AaronVanGeffen AaronVanGeffen enabled auto-merge (squash) April 30, 2025 20:42
@AaronVanGeffen AaronVanGeffen merged commit cae36aa into OpenRCT2:develop Apr 30, 2025
23 checks passed
AaronVanGeffen added a commit that referenced this pull request May 4, 2025
- Feature: [#24206] [Plugin] Add APIs for breaking down rides, reading the current breakdown, and for fixing broken down rides.
- Improved: [#20073] The OpenGL drawing engine now supports screen invalidation which avoids the redrawing of unchanged regions.
- Improved: [#21767] RCT Classic for macOS can now be used as the source game.
- Improved: [#23590] Title bars are now drawn bigger when “Enlarged UI” is enabled.
- Improved: [#23626] Add small, medium and large flat and sloped turns, S-bends and diagonal track to the Go-Karts.
- Improved: [#23982] The scenario objective window has been merged into the scenario options window.
- Improved: [#24233] RCT Classic+ from Apple Arcade can now be used as the source game, and is detected automatically.
- Improved: [#24260] Better performance on parks that have a lot of Guests and Entertainers.
- Improved: [#24319] RCT Classic installs via Steam are now detected automatically on Windows.
- Change: [#23803] Lightning strikes and thunder now happen at the same frequency independently of the game speed.
- Change: [#23857] Replace display options tab with custom sprites.
- Change: [#24069] [Plugin] Plugins are now available in the scenario editor and track designer.
- Change: [#24135] Compress Emscripten js/wasm files.
- Change: [#24194] The advanced options tab has been reworked to make it easier to find the RCT1 path setting.
- Change: [#24235] Small changes to RCT1 theme.
- Change: [#24236] Controls and Interface options now both have their own tabs in the Options window.
- Change: [#24308] “Software” and “Software (hardware display)” renderers have been merged into a single “Software” renderer.
- Change: [#24317] The scenery window now shows at least one row of scenery objects, even if there are multiple rows of tabs.
- Fix: [#18479] Tile elements ordered beneath water do not draw correctly.
- Fix: [#19782] Game stops counting inversions and golf holes after 31 (original bug).
- Fix: [#21207] Track List window gets positioned incorrectly.
- Fix: [#21919] Non-recolourable cars still show colour picker (original bug).
- Fix: [#22182] [Plugin] Crash when using map.getAllEntities("car").
- Fix: [#22634] Asset packs with sound effect overrides are not loaded correctly at startup.
- Fix: [#23108] Missing pieces on Hypercoaster and Hyper-Twister, even with the ‘all drawable track pieces’ cheat enabled.
- Fix: [#24013] Failure to load a scenario preview image (minimap) could lead to an uncaught exception error message.
- Fix: [#24045] [Plugin] Data storage is not cleared when converting save game to scenario.
- Fix: [#24121] Checkbox labels run beyond the edge of the window if they’re too long to fit.
- Fix: [#24142] [Plugin] Track origin is miscalculated on downward slopes.
- Fix: [#24220] Narrow station platforms have missing sides on certain rotations.
- Fix: [#24286] Steam installs of RCT1 and RCT2 are not autodetected on macOS.
- Fix: [#24310] [Plugin] Missing invalidation on various plugin api setters for entities.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog This issue/PR deserves a changelog entry.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants