Commit Graph

3386 Commits

Author SHA1 Message Date
Michael Steenbeek 5edc561715
Close #11437: Migrate old platform methods 2022-02-18 21:57:00 +01:00
Michael Steenbeek 4c046024a3
Merge pull request #16640 from ZehMatt/refactor/entityid-16469
#16469: Introduce EntityId and refactor everything
2022-02-18 21:29:23 +01:00
Tulio Leao 1e58ab4c98
Merge pull request #16673 from IntelOrca/fix/16591-plugin-timeout 2022-02-18 09:38:19 -03:00
Sam Atkins 2b4579bd93
Use labels for OptionsWindow text
This lets us show tooltips for them. Most of the FooDraw() methods are
now empty and have been deleted.
2022-02-17 23:09:39 +01:00
Ted John 007a33404e Close plugin's windows gracefully when stopped
When a plugin is stopped, close all windows created by that plugin.
Ensure the close event on the window can not open a new window if the plugin is being stopped.
2022-02-17 20:18:30 +00:00
Duncan ad86544c83
Merge pull request #16668 from IntelOrca/fix/plugin-pressed-tab
Fix pressed tab for plugin windows
2022-02-17 16:13:41 +00:00
ζeh Matt 52047805db
Use correct type for EntityId and fix issues 2022-02-16 18:56:43 +02:00
ζeh Matt d7f5003943
Introduce EntityId and refactor everything 2022-02-16 18:56:39 +02:00
Ted John 6c3a417af3
Merge pull request #16259 from IntelOrca/refactor/rectangle-maps
Refactor map size to allow for rectangle maps.
2022-02-15 19:08:37 +00:00
Michael Steenbeek ffe67ff33e
Merge pull request #16642 from Gymnasiast/refactor/dropdown
Create Dropdown::Item and use it for gDropdownItems
2022-02-15 18:50:26 +01:00
Ted John b5127089e2 Fix pressed tab for plugin windows 2022-02-15 10:37:18 +00:00
Ted John 454bfb0a8f Refactor map size to allow for rectangle maps 2022-02-14 23:15:59 +00:00
Duncan b22ac0551c
Merge pull request #16592 from skdltmxn/fix-integer-overflow
Fix staff statistics overflow
2022-02-14 21:41:52 +00:00
skdltmxn 9cd502a9f7 Fix staff statistics overflow 2022-02-14 07:42:18 +00:00
Ted John b775832d01 Refactor window flags to be read with the helper methods 2022-02-13 23:09:42 +00:00
Ted John 05b589fb93 Remove custom window widget limit 2022-02-13 23:09:42 +00:00
Ted John da89a4e413
Remove rct_window::enabled_widgets (#16643)
`enabled_widgets` was used to enable input for widgets. However I do not recall anywhere this being used to specifically disable a widget which doesn't use the dedicated `disabled_widgets` flag. I don't think there is any purpose in keeping this, so I have removed all uses of it.
2022-02-13 23:06:19 +00:00
Silent 09897ede9e
Refactor last_*_directory and last_run_version to use u8string
Fixes a regression from #16631 causing a crash when
constructing u8string from a nullptr
2022-02-13 21:34:26 +01:00
Gymnasiast 4abbfcb32b
Create dropdown item flags 2022-02-13 00:14:33 +01:00
Gymnasiast 723867e0a0
Create Dropdown::Item and use it for gDropdownItems 2022-02-12 23:57:22 +01:00
Gymnasiast a17c4ad304
Rename Dropdown::Item to ItemExt 2022-02-12 23:42:59 +01:00
Gymnasiast 49ccc21d84
Fix #16576: Cannot select vehicle types with entry index >= 256 2022-02-12 20:43:45 +01:00
Gymnasiast 3ff8225bb9
Replace some uint8_t in Ride.cpp 2022-02-12 20:43:45 +01:00
ζeh Matt c0474d2d27
Merge pull request #16466 from ZehMatt/refactor/identifier-rideid
Use TIdentifier for RideId
2022-02-12 11:23:54 -08:00
Michael Steenbeek ee54603695
Rename value strings for spinners (#16637) 2022-02-12 20:17:37 +01:00
ζeh Matt f22142d2cf
Use RideId::GetNull over SELECTED_RIDE_UNDEFINED 2022-02-12 18:13:50 +02:00
ζeh Matt 06e430157f
Use RideId::GetNull and RideId::IsNull over constant 2022-02-12 18:11:18 +02:00
ζeh Matt 4554d6d883
Fix all uses of RideId 2022-02-12 18:11:18 +02:00
ζeh Matt a2470c0573
Rename ride_id_t to RideId 2022-02-12 18:11:18 +02:00
Michael Steenbeek 2e37f12365
Merge pull request #16631 from CookiePLMonster/fix-crashy-paths
Fix more crashes related to paths
2022-02-12 16:07:26 +01:00
Silent 5028ce3bf6
Turn GeneralConfiguration::rct1_path into an u8string
Fixes a crash when opening Advanced Options on the first launch
2022-02-12 16:07:04 +01:00
Silent 4621cc4264
Json: Fix wrong implicit path typecasts in ReadFromFile and WriteToFile
These functions accepted fs::path which meant passing a u8string to them
wrongly assumed an ANSI encoding and not UTF-8. This would be
a non-issue in C++20 where char8_t is separate, but until then it was an issue
causing incorrect character conversions, and thus an exception.
2022-02-12 14:36:37 +01:00
Silent 46deac8620
Fix a crash in WindowLoadsaveOpen when last_game_directory is empty
The variable path was left unitialized, which worked fine
in Release builds most of the time, but consistently crashed in Debug.
2022-02-12 00:53:26 +01:00
GalBr cb83d8ff05
Fix #14674: Recent Messages only shows at most 6 or 7 notifications 2022-02-11 21:47:08 +01:00
Michael Steenbeek 63ed6c99a5
Make StrDecompToPrecomp() take C++ strings 2022-02-07 18:56:04 +01:00
Duncan cdd3c28b2e
Use intents to control scenery window (#16562)
* Use intents to control scenery window
2022-02-03 21:10:21 +00:00
Johan Mattsson c00cc90b1f
Fix bounds checks and a nullptr check 2022-02-03 21:42:12 +01:00
Duncan 5157b57a15
OpenRCT2 Limits (#16088)
* Move over max rides to limits file

* Move max stations to limits file

* Move over max inversions, golf holes, helices, custhistsize

* Move over max trains per ride

* Bring over Max cars per train and max circuits per ride

* Port over NumColourSchemes and max vehicle colours

* Fix compilation

* Move over max awards

* Move over max peep spawns and park entrances

* Fix rebase issues

* Remove future work

* Switch style

* Update copyright
2022-02-01 20:59:48 +00:00
GalBr 111f6479df
Move currentDirection creation to after element selection
This move is to fix an issue where ride_select_backwards_from_front() or
ride_select_forwards_from_back() can change _currentTrackPieceDirection
and cause currentDirection to be wrong, causing an error when trying to
delete the element.
2022-01-31 23:02:17 +01:00
Ted John f84c2851be
Fix SHGetPathFromIDListLongPath (#16545)
The function did not truncate the string afterwards, so you ended up with a very long string containing null terminators on the end. This wouldn't have caused an issue when passing it as a char *, but due to it now being passed as string or string_view, this causes issues.

It also wouldn't have worked for paths greater than MAX_PATH, because it wasn't passing the buffer size to the function.
2022-01-31 21:35:48 +00:00
Silent 45debeeb3f
Fix IMalloc* leak in Win32 ShowDirectoryDialog 2022-01-30 12:32:00 +01:00
ζeh Matt 284fff8961
Merge pull request #16544 from ZehMatt/desync/gLastStationStyle
Refactor usage of gLastEntranceStyle
2022-01-29 16:54:08 -08:00
Sam Atkins 99d3d17092
Clean-up OptionsWindow (#16529)
* Rename OptionsWindow tab constants for clarity

The new WIDX_FIRST_TAB constant can be used by code that just wants the
first tab without worrying about which it is.

* Remove use of this-> in OptionsWindow

* Replace widget_invalidate with InvalidateWidget

* WidgetSetCheckboxValue -> SetCheckboxValue

* Move repeated per-tab code into common methods

Previously, each FooPrepareDraw() method would call
CommonPrepareDrawBefore() at the start, and CommonPrepareDrawAfter() at
the end. Let's reduce this duplication by having OnPrepareDraw() call
these instead. :^)

The same goes for a few other repeated code snippets.

* Use WindowFocusOrCreate for OptionsWindow

* Fix #16504: Display RCT1-path tooltip

When the OptionsWindow was first refactored into a Window class, the
AdvancedTooltip() method was created but never called. Hooking it up
fixes the crash and makes the path tooltip appear again. :^)

* Make MAIN_OPTIONS_ENABLED_WIDGETS a constexpr

* Move OptionsWindow constants into the class

* WindowInitScrollWidgets() -> InitScrollWidgets()
2022-01-29 21:52:33 +00:00
ζeh Matt 383412252c
Only modify gLastEntranceStyle for the callee of the game action 2022-01-29 16:42:27 +02:00
Gymnasiast 2f0e6389da
Use u8string in FileDialogDesc 2022-01-29 14:09:13 +01:00
Gymnasiast fd6b327adb
Use emplace_back() instead of push_back() 2022-01-29 14:07:21 +01:00
Gymnasiast 55591b1b2f
Merge old and new FileDialogDesc 2022-01-29 13:55:10 +01:00
Michael Steenbeek f43a4344ce
Remove platform_get_user_directory() (#16530) 2022-01-29 09:01:05 -03:00
Sam Atkins f4dfde39e7 Refactor NewsOptions as a Window subclass
Closes #13789.
2022-01-28 12:08:57 +00:00
Sam Atkins b2a1c72867 Add Window::InitScrollWidgets()
This is just a wrapper around WindowInitScrollWidgets(), but better
matches the code style.
2022-01-28 12:08:57 +00:00
Michael Steenbeek 2c8c940caa
Refactor get_file_extension_type() 2022-01-27 11:14:19 +00:00
Gymnasiast d7dcffbee8
Remove C string overload for Path::GetAbsolute() 2022-01-26 14:54:49 +01:00
Michael Steenbeek 9f74c7081b
Create definitions for u8string and u8string_view 2022-01-25 16:41:45 +01:00
Michael Steenbeek 28b10f6787
Merge pull request #16498 from Gymnasiast/remove/scaling-dropdown
Always use SNN for non-integer scaling
2022-01-25 10:55:17 +01:00
Michael Steenbeek c903d95512
Replace platform_open_directory_browser() with ShowDirectoryDialog() 2022-01-25 10:54:12 +01:00
Duncan 6eec7b8d48
Merge pull request #16472 from duncanspumpkin/editor
Refactor Editor Object Selection Flags
2022-01-25 07:43:39 +00:00
Michael Steenbeek 4192fc5cc8
Fix leftover references to SC6 2022-01-24 20:03:20 +01:00
Gymnasiast 9191a8f884
Fix positioning of Steam overlay option 2022-01-24 17:48:05 +01:00
Gymnasiast 98cd39a375
Always use SNN for non-integer scaling 2022-01-24 17:46:22 +01:00
duncanspumpkin eb58e498e4 Rename type to conform to coding style 2022-01-19 17:45:51 +00:00
duncanspumpkin 6f9283a7f6 Refactor to remove double usage of flag 2022-01-19 17:33:54 +00:00
Ted John 992ece4a4c
Fix #16449: Viewport doesn't close when switching tabs 2022-01-19 10:23:44 +01:00
GalBr df5c4dd91c
Fix #15947, #15960: Cannot remove rotated flat rides
Replace _currentTrackPieceDirection with local variable. This change
fixes a problem where when trying to remove a rotated ride,
_currentTrackPieceDirection would be reset back to 0 by calling
ride_initialise_construction_window, causing TrackRemoveAction to not
being able to find and remove the ride.
Using a local variable with the current direction, saved before resetting
the global variable, fixes this issue.
2022-01-16 14:04:00 +01:00
GalBr f2f47aa492
Fix TrackDesignPreviewDrawOutlines using a local struct
TrackDesignPreviewDrawOutlines created and modified a local
TrackDesignState struct, so the calculated information was lost.
Now the function receives a ref to a TrackDesignState struct.
2022-01-15 21:24:59 +01:00
Duncan 7e46427059
refactor ride track groups to use new bitset (#16172) 2022-01-15 07:50:00 +00:00
GalBr b69448d075
Refactor MazeConstruction window to class (#16307) 2022-01-15 07:41:24 +00:00
Hielke Morsink 1d5c0361b5
Consistently shift 8-byte constants by widget indices 2022-01-10 23:26:31 +01:00
Hielke Morsink 4494eb3949
Ensure parks are not paused in title sequence 2022-01-09 22:11:09 +01:00
Gymnasiast 6bcf848b2f
Use C++ filesystem for more file/path functions 2022-01-08 19:07:48 +01:00
Gymnasiast 10301507a9
Fix Android 2022-01-08 16:58:57 +01:00
Gymnasiast 919c73d030
C++-ify most path handling 2022-01-08 16:58:57 +01:00
Hielke Morsink b4f264fe4d
Fix #16292: .park files cannot be added to title sequence 2022-01-05 12:44:48 +01:00
Michael Steenbeek 2b0d4e6b3d
Merge pull request #16352 from Gymnasiast/fix/16061
Fix #16061: Incorrect colours in minimap
2022-01-03 14:40:10 +01:00
Michael Steenbeek 819495800c
Fix #15943: Crash accessing unset w->focus (#16364) 2022-01-03 10:11:34 +00:00
Michael Steenbeek d7f5995bfd
Remove unintended execute rights 2022-01-01 19:58:28 +01:00
Michael Steenbeek 65500461e1
Fix #16073: Crash in Sub6E1F34SmallScenery() 2022-01-01 19:56:12 +01:00
Gymnasiast de2b893d99
Fix #16061: Incorrect colours in minimap 2022-01-01 16:52:49 +01:00
Michael Steenbeek 875115ec33
Fix #16343: Crash in Ride::PopulateVehicleTypeDropdown() 2022-01-01 15:07:42 +01:00
Michael Steenbeek 678dd0f69f
Merge pull request #16195 from frutiemax/ForwardDeclareFormatter
Forward declare Formatter
2021-12-30 23:01:42 +01:00
Michael Steenbeek c7f87d3aa9
Merge pull request #16310 from frutiemax/ted_description
Add description field to TrackElementDescriptor
2021-12-30 22:26:08 +01:00
frutiemax adb692b74e Forward declare Formatter 2021-12-30 12:17:51 -05:00
Hielke Morsink 4daae678c3
Remove unused include from Banner.cpp 2021-12-30 17:25:04 +01:00
Hielke Morsink e7d213ded1
Remove unused include from TopToolbar.cpp 2021-12-30 17:21:15 +01:00
Vinícius Hashimoto 4155bf9ce0
Close #13748: Refactor About window to class (#16297) 2021-12-27 18:44:06 -03:00
frutiemax 36f0cce65b Add description field to TrackElementDescriptor 2021-12-25 09:55:03 -05:00
spacek531 52d55f5341 refactor ride track groups to use new bitset
remove erroneous value from dummy rtd

make comment more descriptive

remove comment
2021-12-23 02:17:57 -08:00
Michael Steenbeek f65e12fc78
Close #12243: Merge pull request #16295 from GalBr/use-coords-objects-in-maze-functions
Use Coords objects in maze functions
2021-12-22 19:16:34 +01:00
Gal B 343f9bbca0 Refactor maze_set_track to use const CoordsXYZD& 2021-12-22 18:48:37 +02:00
Duncan ee297e9ed3
Fix #16287: Incorrect sv6 extension using console or system browser 2021-12-22 16:19:02 +01:00
Michael Steenbeek 25cb49f8ce
Pass paint_session as reference 2021-12-19 14:48:00 +00:00
Gymnasiast ef6f2cceee
Create RideConstruction.h 2021-12-18 20:27:13 +01:00
Gymnasiast 449da0d6bd
Convert ride_get_station_object() to method 2021-12-18 18:48:52 +01:00
Ted John e165de7482
Refactor paint structs to use ImageId and extend size of image list (#16258)
* Move to image ID for paint struct

* Move image list to be past the end of legacy limit

* Extend image list size

* Introduce constants for image list size

* Use std::array to store internal paint struct
2021-12-18 07:40:10 +00:00
ζeh Matt 186d3efb59
Merge pull request #16092 from ZehMatt/refactor/timing
Refactor update/time related things
2021-12-17 10:08:42 -08:00
Duncan d6e13476ef
Merge pull request #16208 from bkolstad1/window-refactor
Close #13768: Refactor window to class: DemolishRidePrompt
2021-12-14 21:25:23 +00:00
GalBr 35e8bc7f69
Refactor Land Rights window to class (#16183) 2021-12-14 21:19:27 +00:00
Brian Kolstad 35a56c0810 Split demolish and refurbish into seperate windows 2021-12-14 14:03:22 -05:00
ζeh Matt fa737dc4ac
Merge pull request #16207 from ZehMatt/refactor/bitset
#16198: Implement custom BitSet and replace std::bitset
2021-12-13 14:49:16 -08:00
Ted John 6d7e2446db Fix #16204: Invisible entrance/exits render as tiny land sprites 2021-12-13 22:11:55 +00:00
ζeh Matt 94e20ba7fe
Rename some Update functions to Tick 2021-12-13 19:04:48 +02:00
ζeh Matt 20ef683744
Use Timer and cleanup some code in Context 2021-12-13 19:04:48 +02:00
Brian Kolstad bb6e265700 Refactor window to class: DemolishRidePrompt 2021-12-12 19:51:40 -05:00
ζeh Matt 16635b9192
Implement custom BitSet and replace std::bitset 2021-12-12 23:47:17 +02:00
Ted John 2f20dc029e
Fix drawing of disabled zoom buttons 2021-12-12 11:48:49 +01:00
Duncan 3deaa1af2e
Fix #16197: Park award time and type accidentally swapped 2021-12-12 11:20:17 +01:00
Michael Steenbeek 27cbb6c6ae
Merge pull request #16190 from Gymnasiast/refactor/normalised-tile-element-type-3
Part of #15485: normalise all OpenRCT2 tile element types
2021-12-12 09:53:09 +01:00
Michael Steenbeek b83f7c3859
Merge pull request #16150 from IntelOrca/refactor/imageid-ui
Refactor footpath, scenery, terrain and mapgen windows to use ImageId
2021-12-11 23:21:19 +01:00
ζeh Matt cec30e093d
Merge pull request #15991 from ZehMatt/refactor/bannerid
Use TIdentifier for BannerIndex
2021-12-11 08:08:27 -08:00
Duncan 6dc1efde82
Make awards a vector (#16134)
* Make awards a vector

* Fix compiler and use one less branch
2021-12-11 14:45:50 +00:00
Gymnasiast aa34f0f760
Drop the N postfix 2021-12-11 00:39:39 +01:00
Gymnasiast fc3ce3294c
Move over switches to normalised tile element types 2021-12-11 00:30:59 +01:00
Michael Steenbeek 4caeb797f8
Merge pull request #16127 from Gymnasiast/feature/rct1-image-fallback
Create fallback system for csg1 images
2021-12-10 23:25:04 +01:00
Michael Steenbeek 2d1af0ec42
Replace many GetType() calls with GetTypeN() 2021-12-10 22:43:17 +01:00
Gymnasiast fcd704ed47
Create fallback system for csg1 images 2021-12-08 16:18:33 +01:00
Ted John a324bfab63
Add image manager plugin API (#16144) 2021-12-07 20:55:27 +00:00
Ted John d427098e39 Refactor terrain and path to use ImageId 2021-12-07 20:46:15 +00:00
Ted John 9fb490aec0 Refactor ride window to use ImageId 2021-12-07 20:17:22 +00:00
Ted John 5fcc0f4499 Refactor scenery window to use ImageId 2021-12-07 20:17:22 +00:00
Ted John 2108322806 Use ImageId for picked up peep 2021-12-07 20:17:22 +00:00
Michael Steenbeek ea099c0d2d
Merge pull request #16129 from Gymnasiast/refactor/normalised-tile-element-type
Part of #15485: Use normalised tile element type enum for setting type
2021-12-07 11:50:54 +01:00
Gymnasiast 91635a5047
Replace SetType and old strong enum with normalised 2021-12-05 13:54:01 +01:00
Gal B 1a6fffb64a Replace strtol with Parse in CustomCurrency window 2021-12-04 19:20:39 +02:00
Gal B 8e1750b775 Refactor Custom Currency window to class 2021-12-04 18:53:11 +02:00
Olivier Wervers 459c0d67dd
Merge pull request #16104 from oli414/icons
Icons for new object selection tabs
2021-12-04 11:31:21 +00:00
Michael Steenbeek c48219e5bd
Merge pull request #16101 from ZehMatt/refactor/staff-ui-logic
Refactor some code into UI for Staff
2021-12-04 12:08:26 +01:00
ζeh Matt 7cfb5832c4
Fix #16075: Track designs save scenery in wrong location 2021-12-04 12:07:10 +01:00
oli414 2be6cb1408 Add object selector icons for new tabs 2021-12-03 20:36:46 +00:00
Ted John 5f9d03e9df
Refactor ImageId and use in more functions 2021-12-03 19:59:33 +01:00
ζeh Matt e9ccad157e
Remove unused return value 2021-12-03 20:47:48 +02:00
Hielke Morsink 98db974b49
Merge pull request #16085 2021-12-03 19:10:03 +01:00
ζeh Matt a79e2a375a
Move staff_set_name to Staff 2021-12-03 17:40:27 +02:00
ζeh Matt a6870a97d4
Move staff hiring logic into StaffList 2021-12-03 17:37:39 +02:00
Hielke Morsink 04ee748c0c
Add build-time verifications for shortcut keys 2021-12-03 00:28:43 +01:00
Hielke Morsink 9615dda192
Reimplement hotkey handler for toggling visibility 2021-12-03 00:24:56 +01:00
Hielke Morsink 325b986c56
Merge pull request #15489 2021-12-03 00:16:06 +01:00
Ian Polito d3ee7eded1
Fix #16007: Scenario Editor "Entry Price" appears in wrong place
Entry Price label was being drawn to the right of the entryPriceWidget which is
outside of the window. Changed to draw it to the right of the
payForParkOrRidesWidget widget instead.
2021-12-02 21:05:57 +01:00
Duncan 79b12d2953
Introduce DATLimits.h for RCT2 Dat file object limits (#16034) 2021-12-01 21:55:52 +00:00
Trey Kreis e4a314a160
Refactor Editor Object Selection Window to class (#16027)
* Refactor Editor Object Selection Window to class

Co-authored-by: duncanspumpkin <duncans_pumpkin@hotmail.co.uk>
2021-12-01 20:43:08 +00:00
ζeh Matt a1b2996178
Add GetBannerIndex helper in SignWindow 2021-12-01 14:41:59 +02:00
ζeh Matt 63a2e9d716
Refactor uses of old BannerIndex 2021-12-01 14:41:59 +02:00
Hielke Morsink 53d9bfa8b4
Update implicit zoom conversions 2021-12-01 00:08:35 +01:00
Hielke Morsink b6562082e9
Replace hardcoded max zoomlevel 2021-11-30 19:11:08 +01:00
Hielke Morsink f3735dc076
Use ZoomLevel for viewport and ride window 2021-11-30 19:11:08 +01:00
Hielke Morsink 68c7279f4f
Properly handle clicking below the list 2021-11-30 19:07:39 +01:00
Hielke Morsink 2592b3a4ab
Use ScreenRect::Contains to check for clicked area 2021-11-30 19:06:26 +01:00
Hielke Morsink 43537830c5
Replace visibility button with checkboxes per element 2021-11-30 00:06:39 +01:00
GalBr c2fa54057a
Remove vehicle_colour and replace references to VehicleColour (#16055)
This is done because we had two identical structs: vehicle_colour and
VehicleColour. We now only use VehicleColour.

See: #16028
2021-11-29 22:04:31 +00:00
Duncan cc22b584fd
Introduce RCT2 namespace (#16037)
* Introduce RCT2 namespace

* Drop RCT2:: prefix where possible

* Drop RCT2 from structure names

* Reduce header includes
2021-11-28 16:51:38 +00:00
Duncan eba42a9584
Introduce Limits headers. (#15329)
* Move RCT12 limits to seperate file and namespace

* Remove prefix from constants

* Add rct1 limits file

* Rename constants to remove prefix

* Add RCT2 limits file

* Remove RCT2 prefix from constants

* Move constant to correct header

* Fix rebase mistakes

* Drop prefix
2021-11-27 16:20:05 +00:00
ζeh Matt c4ad5fcd15
Adjust includes 2021-11-26 21:01:44 +02:00
ζeh Matt 9f23449ffb
Move Staff/Guest/Peep to entity 2021-11-26 18:26:19 +02:00
Duncan 275d565e52
Start splitting up ride.h (#16011)
* Start splitting up ride.h

* Use cstdint instead of common.h
2021-11-26 15:03:14 +00:00
Hielke Morsink 8b9bcf4adc
Fix #16008: Can select elements when no tile selected 2021-11-26 15:47:43 +01:00
Duncan 90d2be3ddd
Clang tidy Part 3: Ui Project Enum Names (#15986)
* Enum constant case

* Apply enum names clang tidy

* Rename scoped enum missed by clang-tidy
2021-11-26 14:25:34 +00:00
ζeh Matt 56e78d5733
Merge pull request #15985 from ZehMatt/refactor/entities2
Refactor Sprite to Entity
2021-11-25 12:53:50 -08:00
Duncan 2b4eaab5dc
Modify TrackPlaceAction to handle ride type parameter (#15980)
* Modify TrackPlaceAction to handle ride type parameter

* Update network and plugin version

* Update replays
2021-11-25 12:28:30 +00:00
Duncan fccd298d2f
Clang tidy Part 2: Ui Project Class Names (#15976)
* Apply clang-tidy on class names in the ui project

* Rename classes to more appropriate names

* Adjust name again
2021-11-24 16:16:52 +00:00
ζeh Matt 0024252328
Fix includes 2021-11-24 17:19:52 +02:00
ζeh Matt 03fb9b390f
Rename Sprite to EntityRegistry 2021-11-24 17:04:12 +02:00
ζeh Matt 7c726e2a0c
Fix includes 2021-11-24 16:48:33 +02:00
ζeh Matt c6242fd310
More renaming 2021-11-24 15:50:18 +02:00
ζeh Matt 83b911b193
#15634: Refactor passing GameActions::Result by copy (#15951)
* Refactor to result GameActions::Result as copy instead of unique_ptr

* Remove alias GameActions::Result::Ptr

* Remove MakeResult wrapper

* Remove type forwarder in TileInspector
2021-11-24 07:35:08 +00:00
Duncan 23491c8125
Close #13800: Refactor Scenery Scatter Window to class (#15559)
* Start scenery scatter window refactor

Implemented OnOpen

* Implement OnClose

* Implement OnMouseUp

* Implement OnMouseDown

* Implement OnTextInput

* Implement OnPrepareDraw

* Implement OnDraw

* Remove legacy C declarations

* Fix mistake with pointer

* Apply const where possible

* Apply review comments

* Use std::clamp

* Use from_chars

Unsure if all platforms support this

* Use String::Parse
2021-11-23 22:17:41 +00:00
Hielke Morsink b86dfeca4e
Fix clang-tidy renaming mistake from #15956 2021-11-23 16:12:07 +00:00
Duncan bb2c7dbaca
Clang tidy Part 1: Ui Project Function Names (#15956)
* Add NOLINT around STL using classes and vendor functions

* Apply clang-tidy to ui project function names

* Undo scripting clang-format

* Upper case OpenRCT2 and RCT2
2021-11-23 13:18:07 +00:00
duncanspumpkin ba6345e410
Use title case 2021-11-21 22:43:22 +01:00
IntelOrca 34128dc262
Add new .park save format
Co-authored-by: Gymnasiast <Gymnasiast@users.noreply.github.com>
Co-authored-by: duncanspumpkin <duncanspumpkin@users.noreply.github.com>
Co-authored-by: ZehMatt <Zehmatt@users.noreply.github.com>
Co-authored-by: Broxzier <Broxzier@users.noreply.github.com>
2021-11-21 22:43:22 +01:00
hjort96 072597f080
Close #12825: Show object rotation in Tile Inspector 2021-11-16 23:16:59 +01:00
Duncan 5d2a56525f
Refactor min max cars per train from nsf (#15911) 2021-11-14 20:58:44 +00:00
Duncan dd9bc86e75
Minor refactor from nsf (#15910) 2021-11-14 16:31:01 +00:00
Michael Steenbeek 9134bd4788
Update RCT1 path names + British spelling for ‘grey’ 2021-11-13 23:38:04 +01:00
Michael Steenbeek e1a1560fd2
Fix #15878: Crash when opening ride window for corrupted vehicle 2021-11-09 18:41:33 +00:00
chrhaase 4ff0022c58
Fix #15844: Tile Inspector inconsistent text colour
`COLOUR_WHITE` was being passed as the colour when drawing
any text. The Options window uses the `rct_window::colours`
array for resolving the correct theme colour.
Replacing all occurrences of `COLOUR_WHITE` with
`w->colours[1]` makes the text colours more consistent.
In the details section values are still painted in black
no matter the colour theme, which is consistent with e.g.
the park information window.
2021-11-09 09:11:48 +01:00
Michael Steenbeek 084b752fb8
Merge pull request #15816 from ZehMatt/refactor/15630
Close #15630: Refactor TrackDesign
2021-11-07 19:53:32 +01:00
Michael Steenbeek 36bbb01352
Merge pull request #12869 from Broxzier/feature/TI-widget-code-cleanup
Refactor Tile Inspector widget definitions
2021-11-07 19:35:49 +01:00
Gaven Rendell 463f49586c
Fix #15843; Tile Inspector resizes too small. (#15860) 2021-11-07 11:24:33 +00:00
hjort96 1ac7b9227b
Close #13797: Refactor window to class RideList (#15836)
Co-authored-by: hjort96 <jonathan.hjorth96@hotmail.com>
2021-11-07 08:05:14 -03:00
Hielke Morsink f03a13da82
Simplify object selection string filtering 2021-11-06 17:24:42 +01:00
Hielke Morsink 38ee1c0f93
Simplify track list filtering 2021-11-06 17:04:05 +01:00
Hielke Morsink 76b5479bbb
Fix undefined use of cctype functions 2021-11-06 16:27:54 +01:00
Michael Steenbeek e878f43148
Fix #15602: Cannot relocate shops properly 2021-11-04 00:10:12 +01:00
Hielke Morsink d6aeed76be
Introduce helper function for checkbox groups 2021-11-01 22:24:56 +01:00
Hielke Morsink f1ded8071c
Tweak column headers and scrollbar 2021-11-01 21:56:12 +01:00
Hielke Morsink 65056d3aed
Update and remove obsolete tile inspector macros 2021-11-01 21:34:52 +01:00
Hielke Morsink 4cdfeebd40
Make groupbox settings array static 2021-11-01 21:28:40 +01:00
Hielke Morsink 903c1535d4
Update surface page to use new widget system 2021-11-01 21:26:35 +01:00
Hielke Morsink 177d7a316a
Update path page to use new widget system 2021-11-01 21:25:44 +01:00
Hielke Morsink 8dafa2de75
Update track page to use new widget system 2021-11-01 21:14:07 +01:00
Hielke Morsink d46f981f03
Update scenery page to use new widget system 2021-11-01 21:05:55 +01:00
Hielke Morsink 15d4d2df41
Update entrance page to use new widget system 2021-11-01 20:31:10 +01:00
Hielke Morsink 0bff09ad4b
Update wall page to use new widget system
Also fixes setting of groupbox title properly and make the list static
2021-11-01 20:30:56 +01:00
Hielke Morsink 5bcbfaed0d
Fix incorrect WIDX ID comments 2021-11-01 19:45:43 +01:00
Michael Steenbeek af78bbb448
Fix Tracks Manager crash on closing the tracks list 2021-11-01 18:32:55 +01:00
Michael Steenbeek 2e063e6df8
Fix #15831: Track Manager crash after clicking “Select another ride” 2021-11-01 18:32:28 +01:00
Hielke Morsink 325fb128d7
Update large scenery page to use new widget system 2021-10-31 22:59:26 +01:00
Hielke Morsink c53532e0b9
Update banner page to use new widget system 2021-10-31 22:57:01 +01:00
Hielke Morsink a3b76747a8
Start use of constexpr functions for widget placement 2021-10-31 22:44:42 +01:00
ζeh Matt d1e5a5d977
Refactor last uses of place_virtual_track 2021-10-29 02:06:59 +03:00
ζeh Matt 5ef99ef549
Use TrackDesignPreviewRemoveGhosts over place_virtual_track 2021-10-29 02:06:59 +03:00
ζeh Matt 162b0ce321
Use TrackDesignPreviewDrawOutlines over place_virtual_track 2021-10-29 02:06:59 +03:00
ζeh Matt 4ab6a3721d
Use TrackDesignGetZPlacement over place_virtual_track 2021-10-29 02:06:59 +03:00
ζeh Matt 545b01e7e1
Rename track design functions to PascalCase 2021-10-29 02:06:59 +03:00
ζeh Matt cd7e35044a
Move statics into TrackDesignState and pass that to each function 2021-10-29 02:06:59 +03:00
Duncan 3f19d6f7d7
Split Peep header Guest into separate header (#15810)
* Move guest functions and classes to guest header

* Reduce includes of Peep.h
2021-10-28 21:38:23 +01:00
Duncan a8d2d5fd44
Staff patrol area 2 from NSF (#15600)
* Port over changes from NSF for staff

* Fix import and export

* Fix crash on export

* Fix import issue

* Fix patrol import issue

* Remove staff id field

* Increment network version

* Actually remove all instances of staff id

* Update replays
2021-10-27 21:19:10 +01:00
Michael Steenbeek ad2a77bfa5
Fix #12981: New vehicles do not appear in vehicle type dropdown 2021-10-27 11:30:55 +02:00
Michael Steenbeek 3997210bba
Fix #15585: Clear Tool issues 2021-10-27 08:08:11 +02:00
Tulio Leao 3e182e5b24
Merge pull request #15624 from vijfhoek/serverlist-screencoordsxy 2021-10-27 00:20:02 -03:00
Sijmen cec8447c6f
Refactor Viewport.cpp to use ScreenRect (#15790) 2021-10-27 00:13:38 -03:00
Sijmen 380b20f71d
Apply review suggestions 2021-10-23 18:20:45 +02:00
Hielke Morsink 0e8c4ec642
Use ScreenCoordsXY/ScreenSize for columns 2021-10-23 11:22:48 +02:00
Hielke Morsink 30506c7a35
Use ScreenCoordsXY and ScreenSize structs for main toolbar 2021-10-23 11:22:43 +02:00
Hielke Morsink 1a947c55d0
Update scroll and spinners 2021-10-22 19:52:17 +02:00
Sijmen dc532f6ac9
Rename showServerVersion to showVersionTooltip 2021-10-22 00:51:37 +02:00
Hielke Morsink 0d6a503e22
Move table header text to widget definitions 2021-10-21 23:41:50 +02:00
Hielke Morsink 41c1f447e5
Refactor define for shared widgets to use MakeWidget
This commis also fixes a few pixel-perfect alignment issues.
2021-10-21 23:34:27 +02:00
Sijmen f2c4952657
Fix server list network version tooltip logic
Moved the showing/hiding of the tooltip to scroll_mouseover, and
simplified the logic. Now, the tooltip will consistently show instead of
only when it felt like it :)
2021-10-21 21:01:40 +02:00
Sijmen c2b2e67c1f
Remove unused server_list_get_item_button function 2021-10-21 21:01:40 +02:00
Sijmen ebedf83176
Format ServerList.cpp (#15625) 2021-10-20 21:26:01 -03:00
Steve Blythe b15dc66acb
Part of #12098: Use ScreenRect in gfx_filter_rect() (#15603) 2021-10-20 19:43:32 -03:00
ζeh Matt 60422960a3
Merge pull request #15616 from ZehMatt/fix-15006
Fix #15006: Prevent allocating empty texture atlases
2021-10-20 10:46:57 -07:00
ζeh Matt ea0b8840ac
Merge pull request #15610 from ZehMatt/refactor/stringvariant
Replace StringVariant with std::variant
2021-10-20 10:46:42 -07:00
Michael Steenbeek 62a9096079
Fix #15466: Crash when opening dropdown with 0 rows 2021-10-20 18:50:21 +02:00
ζeh Matt 6a219b2481
Fix #15006: Prevent allocating empty texture atlases 2021-10-20 19:02:15 +03:00
ζeh Matt 7fc49fca39
Replace StringVariant with std::variant 2021-10-20 16:35:58 +03:00
ζeh Matt 8e06d84a09
Refactor result passing of TrackDesignAction 2021-10-20 16:08:21 +03:00
ζeh Matt e06f9c3ee7
Refactor result passing of TrackPlaceAction 2021-10-20 14:15:24 +02:00
Hielke Morsink 9dd20ec619
Improve array formatting
For most of these cases, adding a trailing comma to the array block makes clang-format put each item on a new line, and clang-format exception blocks could be reduced where clang-format does not handle them properly.
2021-10-17 18:21:45 +02:00
Duncan fe46a2cf09
Fix Custom Currency window (#15596)
* Fix custom currency window exchange rate

This was using the wrong size type for the money

* Change name of string id

This was being used by two windows and should be made generic
2021-10-17 14:56:11 +01:00
Hielke Morsink c01aedf32e
Merge pull request #15578 2021-10-16 23:28:02 +02:00
Hielke Morsink aff3b41feb
Refactor research status drawing code 2021-10-16 19:32:54 +02:00
Gymnasiast eb14c426fd
Rename research_remove() to ResearchRemove() 2021-10-15 17:01:04 +02:00
Gymnasiast 5cf4a53b66
Make research_remove take const ref 2021-10-15 16:21:14 +02:00
hjort96 eba2041aaa
Close #13791: Refactor window to class Options (#15558)
* Create class OptionsWindow. Moving functions to class.

* Move functions to class OptionsWindow

* Fix coding style

Co-authored-by: hjort96 <jonathan.hjorth96@hotmail.com>
2021-10-15 10:41:30 +01:00
Sijmen 83a3da0a28
Refactor window_dropdown_paint (Part of #12098) (#15574)
* Refactor window_dropdown_paint

- Use ScreenRect (#12098) and ScreenCoordsXY
- Move variables to a more local scope, with the appropriate types
- Reduce nesting in if statements

* Apply suggestions from code review

Co-authored-by: Tulio Leao <tupaschoal@gmail.com>

* Combine all screenCoords calculations in window_dropdown_paint

* Remove brackets from cellCoords calculation

Co-authored-by: Tulio Leao <tupaschoal@gmail.com>
2021-10-14 20:46:45 -03:00
Hielke Morsink c2d3ca5f85
Automatically deduce std::array types
This also improves formatting of some arrays with weird or no indention.
2021-10-14 23:27:28 +02:00
Duncan dc6a8a6235
Refactor ObjectLoadError to class (#15573)
* Move into class

* Refactor names and const

* Apply review comments
2021-10-14 16:53:48 +01:00
Makke94 780ebea3f0
Refactor TrackList Window into class (#13812) (#15533)
* Close #13812: Refactor window to class: TrackList

* Close #13812: Refactor window to class: TrackList

* Remove misplaced include

* Refactor to CamelCase

* Remove forward declaration

* Fix unsafe string_view operation

* Access local widgets insted of global

* Override correct function

Co-authored-by: Makke <markuswetterberg1@gmail.com>
2021-10-14 15:35:40 +01:00
ζeh Matt b4cd8e4628
Fix #15560: Memory leak due to OpenGL Renderer not releasing a texture 2021-10-11 21:01:11 +02:00
Michael Steenbeek 6ea0d8639d
Merge pull request #15552 from CookiePLMonster/fix-15227
Fix Object Selection not tearing down objects properly
2021-10-11 09:30:33 +02:00
Duncan 961d51eae4
Fix hovering on scenery window showing incorrect hover for 1 tick
The scenery window will periodically reset the hover selection so that when you move the cursor out of the window it correctly switches to the actual selection. This leads to the price and description resetting for a singular tick which looks a bit odd and unexpected. To fix this instead when it tries to reset it first checks to see if the cursor is still over the hover selection and if it is does not reset the selection.
2021-10-10 12:17:52 +02:00
Duncan 5ee78213b2
Port over research == operator from NSF 2021-10-10 12:09:26 +02:00
adam-bloom 793eba68d1 add additional comments on SDL resolution 2021-10-09 15:00:30 -06:00
adam-bloom 3efae5bff7 minor changes and point at alpha dependencies 2021-10-09 14:59:58 -06:00
Silent 3e64a227e5
Fix Object Selection not freeing the object when unhovering
Fixes a double-free on previews.
2021-10-09 21:48:43 +02:00
Michał Janiszewski 1b4875e528 Extract math-related functions from common.h to Math.hpp
Saves wide inclusion of <stdexcept> header, which pulls in <string>
2021-10-09 21:43:06 +02:00
Michael Steenbeek 15897c23a1
Merge pull request #15498 from duncanspumpkin/sceneryWindow
Backport scenery window from NSF
2021-10-09 17:13:36 +02:00
ζeh Matt 05e58cda11
Merge pull request #15538 from ZehMatt/feature/parallel-draw
Implement multithreaded drawing
2021-10-09 05:53:48 -07:00
seanmajorpayne e8b6e24498
Fix #15451: Guest List name filter remains after group selection 2021-10-09 12:49:26 +02:00
Gaven Rendell 86cf0dc916 Remove Windows check 2021-10-08 21:27:48 +01:00
Gaven Rendell 33fa31e6d0 Exclude Win/Mac from ignoring mod key 2021-10-08 21:25:36 +01:00
Gaven Rendell 7787bb46e0 Handle mod key edge-cases in tiling WMs
This commit ignores keypresses when the mod key is held.

The reasoning is that an odd interaction happens between SDL applications and
tiling window managers. Tiling window managers like Xmonad and i3 usually use
the mod ("windows") key and a number to change workspaces. When changing
workspaces, however, the WMs still send the number key through instead of
"eating" it. It's not clear why, exactly, but it seems universal.

Mod+1 -> Goes to workspace #1
Mod+2 -> Goes to workspace #2
...
Mod+9 -> Goes to workspace #9

Most applications don't even see the number key being sent, so if you move to
workspace 1, Firefox won't type "1" into the browser bar, Vim won't type "1"
into your file, etc. But SDL applications, for whatever reason, DO see this
keydown. Of course, they'll handle it like a regular key press. So if you move
to workspace 1, which contains OpenRCT, it inadvertently toggles x-ray mode.

I first found this bug in another SDL game, The Powder Toy. After some
discussion with the devs, they fixed it like this, by ignoring keydown events
when the mod key is pressed, since the mod key is reserved for the window
manager anyway. It works well and should be in the next release.

c7619387ac...93b920a57f

I did the same thing here.
2021-10-08 21:25:33 +01:00
Ted John 6b965074ec
Merge pull request #15527 from hjort96/refactor-window-ViewClipping
Close #13813 : Refactor window to class: ViewClipping
2021-10-08 13:57:25 +01:00
seanmajorpayne 25419bb4e3
Fix #15197: Cannot place flat ride after removing it in construction
Demolishing a flat ride (using the bulldozer icon in the construction menu) will now reopen the construction window to it's default state.
2021-10-08 00:13:04 +02:00
hjort96 dba34d2c17 Removed a line 2021-10-07 22:38:12 +02:00
Duncan fd18ac7f85
Modify StaffSetPatrolAreaAction to have three modes (#15494)
* Modify StaffSetPatrolAreaAction to have three modes

* Actually serialise mode

* Apply review comments

* Increment network version

* Apply review comment

* Update replay
2021-10-07 18:02:24 +01:00
hjort96 9d57e93df9 Add suggestions from review. 2021-10-07 16:21:19 +02:00
ζeh Matt a0e7752f26
Pass rct_drawpixelinfo explicit to avoid races 2021-10-06 23:48:07 +03:00
duncanspumpkin d7053784f2 Fix unresearched scenery groups showing 2021-10-06 17:11:08 +01:00
ζeh Matt c054967230
Merge pull request #15530 from ZehMatt/refactor/wallplaceaction-result
Refactor action result passing for WallPlaceAction
2021-10-06 08:50:57 -07:00
Bepso c44d1151c2
Close #13766 : Refactor Clear Scenery to class (#15481)
* Add CleanScenery class
2021-10-06 16:46:01 +01:00
duncanspumpkin 9e227c1e2f Add const where possible 2021-10-06 16:44:07 +01:00
duncanspumpkin fea69cc86c Backport scenery window from NSF
Co-authored-by: IntelOrca <IntelOrca@users.noreply.github.com>
Co-authored-by: Gymnasiast <Gymnasiast@users.noreply.github.com>
2021-10-06 16:44:05 +01:00
ζeh Matt 976d15ce10
Merge pull request #15529 from ZehMatt/refactor/smallsceneryplaceaction-result
Refactor action result passing for SmallSceneryPlaceAction
2021-10-06 08:32:16 -07:00
ζeh Matt d2ffeaa7b0
Refactor action result passing for WallPlaceAction 2021-10-06 18:31:09 +03:00
ζeh Matt 9cb26f7b02
Refactor action result passing for SmallSceneryPlaceAction 2021-10-06 16:12:37 +03:00
Hielke Morsink 782220b42b
Show "Update available" in all game-options dropdowns
Co-authored-by: Michael Steenbeek <m.o.steenbeek@gmail.com>
2021-10-06 15:02:35 +02:00
hjort96 763c31ce5b Fix clang-format 2021-10-05 20:06:17 +02:00
Jonathan Hjorth 9a2a12af98 Cleaning code 2021-10-05 11:09:37 +02:00
Jonathan Hjorth 0195ce45a2 Added OnToolUpdate, OnToolDrag, OnToolUp, OnPrepareDraw to new window 2021-10-05 10:54:15 +02:00
Jonathan Hjorth dbe07554c9 Added OnOpen() to ViewClippingWindow 2021-10-05 10:52:14 +02:00
Jonathan Hjorth 762005f25a Fixed crash caused by window not being properly initialized 2021-10-05 10:51:24 +02:00
Jonathan Hjorth 419201f476 Work on refactoring ViewClipping.cpp to the new window framework. 2021-10-05 10:50:47 +02:00
Michael Steenbeek 7530a03b8e
Merge pull request #15508 from Broxzier/refactor/widget-references
Use (const) references to widgets and scrolls where possible
2021-10-03 21:07:31 +02:00
ζeh Matt 24ec2e1b67
Merge pull request #15510 from ZehMatt/refactor/largescenerayplace-result
Refactor LargeSceneryPlaceAction result data passing
2021-10-03 07:54:59 -07:00
Hielke Morsink b246a4919d
Fix #15514: Two “quit to menu” menu items available in track designer 2021-10-03 15:20:45 +02:00
ζeh Matt 76c2f9db85
Refactor LargeSceneryPlaceAction result data passing 2021-10-02 00:56:59 +03:00
Hielke Morsink 1d62a902e7
Make scenery_small_entry_has_flag a member function (#15509) 2021-10-01 16:50:05 -03:00
Hielke Morsink 5b9b52c028
Use (const) references to scrolls where possible 2021-10-01 15:21:01 +02:00
Hielke Morsink 6de1868ad8
Use (const) references to widgets where possible
Note: The change from `w->widgets[WIDX_ENTRY_PRICE]` to `entryPriceWidget` is intended.
2021-10-01 15:21:00 +02:00
Michael Steenbeek 26d1186240
Merge pull request #15493 from Broxzier/refactor/minor-cleanups
Minor code cleanups
2021-09-30 15:03:33 +02:00
Hielke Morsink 94144bcd89
Remove some dead code
Reported by clang
clang-analyzer-deadcode.DeadStores
2021-09-30 10:40:32 +02:00
Michał Janiszewski ce1d3e9c83
Minor fixes (#15491) 2021-09-29 21:06:46 +00:00
Michael Steenbeek 987174e828
Merge pull request #15436 from duncanspumpkin/staff
Small Staff Refactor from NSF
2021-09-29 20:46:24 +02:00
frutiemax 2906cb8c89
Fix #14474: Map size can be synced in multiplayer (#15312)
* Fix #14474: Map size can be synced in multiplayer

* Bump up network version

Co-authored-by: ζeh Matt <5415177+ZehMatt@users.noreply.github.com>
2021-09-29 16:46:03 +01:00
Hielke Morsink 9dd9b27db4
Make WIDGETS_END constexpr 2021-09-26 11:11:42 +02:00
Michael Steenbeek 1feac16bed
Merge pull request #15414 from frutiemax/develop
#15367: Encode RideType in TrackElement
2021-09-25 12:02:08 +02:00
Hielke Morsink a8b84989eb
Check for nullptr explicitly in operct2-ui (#15460) 2021-09-25 08:45:06 +02:00
ζeh Matt e5de2adc4f
Merge pull request #15429 from ZehMatt/backport/ticks
Remove scenario ticks and adjust export/import
2021-09-23 12:08:16 -07:00
ζeh Matt 74e8988dd8
Remove scenario ticks and adjust export/import
Co-authored-by: Ted John <ted@brambles.org>
2021-09-23 21:49:09 +03:00
ζeh Matt 719a5a9d8e
Merge pull request #15369 from ZehMatt/refactor/tile-coords
Refactor overload map_get_first_element_at
2021-09-21 14:36:03 -07:00
Duncan a268350615
Fix #15439: Ride viewport is partially grey
The ride viewport does not work the same as other viewports due to the selection of views that it has. After refactoring the focus system to use a more streamlined approach the ride viewport lost its invalidation on resizing. If the ride window was to use the same viewport update code as say the guest window then the viewport focus still ends up incorrect due to it no longer centring the focus. Therefore the best approach was to lose the focus on resize and force a recalculation of it.

Also renamed Focus2 to Focus as Focus2 was meant to just be fill in whilst removing the original focus structs.
2021-09-21 11:06:04 +02:00
Gymnasiast 11607f525d
const auto& 2021-09-21 10:49:29 +02:00
Gymnasiast 1e17304e76
Show the appropriate ride type in the TI 2021-09-21 10:49:29 +02:00
frutiemax 355019f97f
#15367: Encode RideType in TrackElement 2021-09-21 10:49:28 +02:00
Hielke Morsink d3f7660a46
Use min/max water height defines in mapgen 2021-09-19 17:18:23 +02:00
duncanspumpkin ca689c3948 Introduce methods from NSF
These methods still call the same legacy functionality for now
2021-09-19 08:28:25 +01:00
Duncan 938792e6be
Use CoordsXYZ for ride view (#15434)
* Use CoordsXYZ for ride view

Part of the NSF but also took the time to refactor slightly to use the more appropriate types. Annoyingly there isn't a operator/ for CoordsXYZ otherwise this could have been further simplified.

* Fix missed minx/maxx occurrence

Co-authored-by: Michael Steenbeek <m.o.steenbeek@gmail.com>
2021-09-19 07:19:32 +01:00
Duncan fa57b6aea0
Remove focus union and replace with typed focus (#15426)
* Remove focus union and replace with typed focus

This if for the NSF to allow for CoordsXYZ

* Remove legacy structures

* Rework viewport_create to deduplicate logic

* Simplify yet further

* Apply review comments

* Remove intermediate
2021-09-18 20:34:38 +01:00
Duncan c05068e8d1
Replace sprite_left,t,r,b with SpriteRect (#15408)
* Replace sprite_left,t,r,b with SpriteRect

This is required for the NSF. I had to add a silly constructor to rct_sprite for now. Will eventually be removed one day...

* Fix compilation and memory leak

* Add some UB to prevent some other UB

* Make review change
2021-09-18 19:07:35 +01:00