1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-30 10:15:36 +01:00

Make rct_windowclass strong type WindowClass

This already revealed some places where implicit conversions were done, including some where its use was nonsense (MouseInput.cpp).
The changes to the Intent class were necessary to keep things working, and this splits things up more neatly.
This commit is contained in:
Hielke Morsink
2022-08-21 18:38:25 +02:00
committed by GitHub
parent ebe38a91ce
commit 7f29e4e39c
145 changed files with 1331 additions and 1235 deletions

View File

@@ -1338,14 +1338,14 @@ void map_remove_provisional_elements()
footpath_provisional_remove();
gProvisionalFootpath.Flags |= PROVISIONAL_PATH_FLAG_1;
}
if (window_find_by_class(WC_RIDE_CONSTRUCTION) != nullptr)
if (window_find_by_class(WindowClass::RideConstruction) != nullptr)
{
ride_remove_provisional_track_piece();
ride_entrance_exit_remove_ghost();
}
// This is in non performant so only make network games suffer for it
// non networked games do not need this as its to prevent desyncs.
if ((network_get_mode() != NETWORK_MODE_NONE) && window_find_by_class(WC_TRACK_DESIGN_PLACE) != nullptr)
if ((network_get_mode() != NETWORK_MODE_NONE) && window_find_by_class(WindowClass::TrackDesignPlace) != nullptr)
{
auto intent = Intent(INTENT_ACTION_TRACK_DESIGN_REMOVE_PROVISIONAL);
context_broadcast_intent(&intent);
@@ -1363,14 +1363,14 @@ void map_restore_provisional_elements()
gProvisionalFootpath.SurfaceIndex, gProvisionalFootpath.RailingsIndex, gProvisionalFootpath.Position,
gProvisionalFootpath.Slope, gProvisionalFootpath.ConstructFlags);
}
if (window_find_by_class(WC_RIDE_CONSTRUCTION) != nullptr)
if (window_find_by_class(WindowClass::RideConstruction) != nullptr)
{
ride_restore_provisional_track_piece();
ride_entrance_exit_place_provisional_ghost();
}
// This is in non performant so only make network games suffer for it
// non networked games do not need this as its to prevent desyncs.
if ((network_get_mode() != NETWORK_MODE_NONE) && window_find_by_class(WC_TRACK_DESIGN_PLACE) != nullptr)
if ((network_get_mode() != NETWORK_MODE_NONE) && window_find_by_class(WindowClass::TrackDesignPlace) != nullptr)
{
auto intent = Intent(INTENT_ACTION_TRACK_DESIGN_RESTORE_PROVISIONAL);
context_broadcast_intent(&intent);