Commit Graph

197 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
Gymnasiast 49fa735600 Do not run drawText* through formatter if there are no arguments 2026-03-26 16:00:06 +01:00
Aaron van Geffen 8ed4b34907 Move includes out of Drawing.h and into their actual users 2026-03-26 12:55:37 +01:00
Gymnasiast a5c32ab60c Rename DrawText* to drawText* 2026-03-25 23:16:25 +01:00
Gymnasiast 2398d91fb2 Rename DrawTextBasic() to DrawText() 2026-03-25 23:15:49 +01:00
Michael Steenbeek f9756b988f Add TD7 format 2026-02-16 23:42:35 +01:00
frozensnowy 4c88430ebb Preview images from different windows overwrite each other when using OpenGL (#25986)
The Map, Track Design List, Track Design Placement, Install Track, and Park Preview windows all shared a single SPR_TEMP sprite ID for rendering dynamic preview images. In OpenGL mode, this caused them to overwrite each other's textures when multiple windows were open simultaneously. To fix it I added separate temp sprite IDs for each window that needs one, with an array of G1Elements to store each separetely
2026-02-10 19:42:32 +01:00
Michael Steenbeek 4878894a7e Use PaletteIndex in RenderTarget (#25948) 2026-02-07 23:41:40 +01:00
Gymnasiast b2fcecb79e Refactor RtdFlags into FlagHolder 2026-01-31 14:00:52 +01:00
Gymnasiast e46d2eba9e Move colour map to its own file 2026-01-17 18:46:54 +01:00
matheusvb3 bba937a03d Remove more redundant namespace qualifiers (#25828) 2026-01-16 08:38:20 +01:00
Gymnasiast 8861833292 Pass PaletteIndex to Rectangle::fill() and IDrawingContext::FillRect() 2026-01-07 12:48:01 +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
Aaron van Geffen 40aaf97c07 Update copyright years to 2026 (#25741) 2026-01-05 13:42:59 +00:00
Gymnasiast 7236631db5 Create strong enum+Flagholder for G1 flags 2025-12-27 20:25:59 +01:00
Aaron van Geffen 8a0a655025 Unwrangle Drawing.h and Paint.h (#25706)
* Drop Drawing.h include from Paint.h

* Split off RenderTarget to its own header/unit

* Move FilterPaletteID to its own header
2025-12-26 12:58:33 +01:00
Gymnasiast 124352c922 Update members of TextAlignment 2025-11-03 23:25:29 +01:00
Michael Steenbeek fcc915af1c Merge pull request #25390 from Gymnasiast/refactor/recentangle-drawing
Refactor rectangle drawing
2025-10-26 10:25:15 +01:00
Gymnasiast b30b49161b Refactor GetRideNaming(), add getTypeNaming() to Ride 2025-10-23 21:36:02 +02:00
Gymnasiast 7c51ccde1e Rename Rect namespace to Rectangle 2025-10-23 18:44:45 +02:00
Gymnasiast 93c3d99546 Move rectangle drawing into its own namespace 2025-10-23 18:41:08 +02:00
Gymnasiast 9e9b774266 Move rectangle drawing to Rect.{cpp,h} 2025-10-23 18:40:04 +02:00
Matt 0630cc6f71 Fix #20486: Multiplayer desync when placing track designs without any scenery. (#25337)
* Fix #20486: Placing track designs with scenery disabled desyncs

* Remove pointless error logging, too much log spam

* Don't entirely disable all scenery when one element is obstructed

* Update changelog.txt

* Bump up network version

* clang-format
2025-10-16 23:05:30 +02:00
Michael Steenbeek eb38b7227f Change WindowFlag to strong enum 2025-09-20 21:46:42 +02:00
Gymnasiast a662c5ef8e Change WindowClass members to use lowerCamelCase 2025-09-17 23:18:52 +02:00
Gymnasiast 3a803e13e2 Change window functions to use lowerCamelCase 2025-09-17 20:10:12 +02:00
Gymnasiast d4a0bca091 Rename Window fields 2025-09-17 20:10:12 +02:00
Michael Steenbeek 7b322d825a Refactor constants in window .cpp files 2025-06-16 23:10:47 +02:00
Gymnasiast 81e3181ebb Pass ScreenSize to makeWindowShim() 2025-06-10 23:21:15 +02:00
Gymnasiast bdba89f428 Pass ScreenSize to window creation functions 2025-06-10 23:20:28 +02:00
Gymnasiast 650fa3ae2e Rename WindowWidgetType to WidgetType and change for new code style 2025-06-10 19:55:12 +02:00
Gymnasiast 149468406b Update WindowColour enum for new code style 2025-06-10 19:53:12 +02:00
Gymnasiast 86e265f093 Make widget creation functions lowerCamelCase 2025-06-10 19:51:21 +02:00
Aaron van Geffen 0779b9f0ab Replace window shim and widget macros with constexpr functions (#24566) 2025-06-07 23:02:14 +02: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
Matt 6335c31336 Rename DrawPixelInfo to RenderTarget (#24339)
* Begin backend separation, rename type DrawingPixelInfo to RenderTarget

* Rename dpi variables to rt
2025-05-04 22:06:46 +00:00
Gymnasiast e398feb3b4 Replace manual centre calculation with WF_CENTRE_SCREEN flag 2025-04-19 14:49:34 +02:00
Aaron van Geffen 3f87e2b67a Centralise ResizeFrame in WindowBase and call when setting widgets or resizing 2025-04-11 20:37:54 +02:00
Aaron van Geffen 0b10bd463e InstallTrack: force the object selection window to close 2025-03-31 17:03:44 +02:00
Gymnasiast 14b881e22b Rename DIRID and its members 2025-03-25 23:39:27 +01:00
Gymnasiast 622a8dc525 Rename DIRBASE and its members 2025-03-25 22:47:09 +01:00
73 c7c703515e Rename audio.h to Audio.h (#23842) 2025-02-17 13:24:03 +01:00
73 b9b2c96c97 Rename sprites.h to SpriteIds.h (#23804) 2025-02-13 15:51:46 +00:00
Michael Steenbeek b0c99fcb6c Refactor more constants to kConstant notation 2025-01-22 16:16:55 +00:00
Aaron van Geffen a8773dd805 Move WindowClose family into WindowManager (#23646)
* Replace WindowClose() calls with Close method calls where possible

* Move WindowClose family into WindowManager

* Remove UpdateSceneryGroupIndexes hack
2025-01-19 18:49:18 +01:00
Michael Steenbeek be9f27e4f9 Mass rename constants (#23656) 2025-01-19 15:59:45 +00:00
Aaron van Geffen 5fbe8d0ae1 Centralise external window signatures in Windows.h (#23653) 2025-01-19 15:50:54 +01:00
Aaron van Geffen bed4d5bdca Move WindowCreate and WindowFocusOrCreate into WindowManager (#23643)
* Move WindowBringToFront into WindowManager

* Move WindowCreate and WindowFocusOrCreate into WindowManager

* Cut back on Context/UiContext includes
2025-01-19 06:58:28 -03:00
Matt b9f6b6f754 Refactor widgets state (#23621)
* Refactor windows to not share widget state

* First half of refactoring all the windows

* Refactor the remaining windows, compiles but has issues

* Fix drawing only every second widget

* Remove the need of an terminating widget

* Address WidgetIndex signedness issues; use kWidgetIndexNull more

* Address constexpr issue with Widget content union

* Fix tabs in scenery window

* Fix tabs in object selection window

* Adjust custom widget index for CustomTool events

* Use STR_NONE for default tooltip initialisation

* Adjustment for mingw compiler

* Fix bottom toolbar using the widget declaration not instance

* Remove pointless code in Guest window, handled by SetPage

* Prevent out of bounds crash

* Move scroll widgets initialization to SetPage in Cheats window

* Remove special logic in Options window

* Remove special logic in Park window

* Remove special logic for Player window

* Remove special logic for Research window

* Remove special logic for Ride window

* Remove special logic for Staff window

* Remove special logic for Finances window

* Remove special logic for MapGen window

* Remove special logic for editor objective options window

* Remove special logic for editor scenario options window

* Fix widgets not being set since page is initialized to 0

* Remove more redundant code

* Fix remaining access to widget declarations

* Remove unused variable

* Fix editor object selection tabs on successive windows

---------

Co-authored-by: Aaron van Geffen <aaron@aaronweb.net>
2025-01-18 13:45:17 +01:00
Aaron van Geffen fa06a49302 Update copyright year to 2025 (#23514) 2024-12-31 20:30:04 +01:00