From 88af2d395485f87827bc2e0769b6f2e2aecc1e8e Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Thu, 8 Mar 2018 14:33:09 +0100 Subject: [PATCH] Rename sub_6CA2DF() to window_ride_construction_update_state() --- src/openrct2-ui/windows/RideConstruction.cpp | 20 ++++++++++---------- src/openrct2/interface/Window.h | 2 +- src/openrct2/ride/Ride.cpp | 2 +- src/openrct2/windows/_legacy.cpp | 6 +++--- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/openrct2-ui/windows/RideConstruction.cpp b/src/openrct2-ui/windows/RideConstruction.cpp index e5f184773f..622d253da9 100644 --- a/src/openrct2-ui/windows/RideConstruction.cpp +++ b/src/openrct2-ui/windows/RideConstruction.cpp @@ -1229,12 +1229,12 @@ static void window_ride_construction_resize(rct_window *w) } if (_rideConstructionState == RIDE_CONSTRUCTION_STATE_FRONT) { disabledWidgets |= (1ULL << WIDX_NEXT_SECTION); - if (sub_6CA2DF(nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr)) { + if (window_ride_construction_update_state(nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr)) { disabledWidgets |= (1ULL << WIDX_CONSTRUCT); } } else if (_rideConstructionState == RIDE_CONSTRUCTION_STATE_BACK) { disabledWidgets |= (1ULL << WIDX_PREVIOUS_SECTION); - if (sub_6CA2DF(nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr)) { + if (window_ride_construction_update_state(nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr)) { disabledWidgets |= (1ULL << WIDX_CONSTRUCT); } } @@ -1650,7 +1650,7 @@ static void window_ride_construction_construct(rct_window *w) _currentTrackPrice = MONEY32_UNDEFINED; _trackPlaceCost = MONEY32_UNDEFINED; ride_construction_invalidate_current_track(); - if (sub_6CA2DF(&trackType, &trackDirection, &rideIndex, &liftHillAndAlternativeState, &x, &y, &z, &properties)) { + if (window_ride_construction_update_state(&trackType, &trackDirection, &rideIndex, &liftHillAndAlternativeState, &x, &y, &z, &properties)) { window_ride_construction_update_active_elements(); return; } @@ -2134,7 +2134,7 @@ static void window_ride_construction_paint(rct_window *w, rct_drawpixelinfo *dpi return; sint32 trackType, trackDirection, rideIndex, liftHillAndAlternativeState; - if (sub_6CA2DF(&trackType, &trackDirection, &rideIndex, &liftHillAndAlternativeState, nullptr, nullptr, nullptr, nullptr)) + if (window_ride_construction_update_state(&trackType, &trackDirection, &rideIndex, &liftHillAndAlternativeState, nullptr, nullptr, nullptr, nullptr)) return; // Draw track piece @@ -2447,7 +2447,7 @@ void sub_6C94D8() case RIDE_CONSTRUCTION_STATE_FRONT: case RIDE_CONSTRUCTION_STATE_BACK: if (!(_currentTrackSelectionFlags & TRACK_SELECTION_FLAG_TRACK)) { - if (sub_6CA2DF(&type, &direction, &rideIndex, &liftHillAndAlternativeState, &x, &y, &z, nullptr)) { + if (window_ride_construction_update_state(&type, &direction, &rideIndex, &liftHillAndAlternativeState, &x, &y, &z, nullptr)) { ride_construction_remove_ghosts(); } else { _currentTrackPrice = place_provisional_track_piece(rideIndex, type, direction, liftHillAndAlternativeState, x, y, z); @@ -2554,7 +2554,7 @@ static void window_ride_construction_update_map_selection() y = _currentTrackBeginY; break; default: - if (sub_6CA2DF(&trackType, &trackDirection, nullptr, nullptr, &x, &y, nullptr, nullptr)) { + if (window_ride_construction_update_state(&trackType, &trackDirection, nullptr, nullptr, &x, &y, nullptr, nullptr)) { trackDirection = _currentTrackPieceDirection; trackType = 0; x = _currentTrackBeginX; @@ -3323,7 +3323,7 @@ void ride_construction_toolupdate_construct(sint32 screenX, sint32 screenY) gMapSelectionTiles[1].y = -1; sint32 trackType, trackDirection, rideIndex, liftHillAndAlternativeState; - if (sub_6CA2DF(&trackType, &trackDirection, &rideIndex, &liftHillAndAlternativeState, nullptr, nullptr, nullptr, nullptr)) { + if (window_ride_construction_update_state(&trackType, &trackDirection, &rideIndex, &liftHillAndAlternativeState, nullptr, nullptr, nullptr, nullptr)) { ride_construction_invalidate_current_track(); map_invalidate_map_selection_tiles(); return; @@ -3383,7 +3383,7 @@ void ride_construction_toolupdate_construct(sint32 screenX, sint32 screenY) _previousTrackPieceZ = z; if (ride->type == RIDE_TYPE_MAZE) { for (;;) { - sub_6CA2DF(&trackType, &trackDirection, &rideIndex, &liftHillAndAlternativeState, &x, &y, &z, nullptr); + window_ride_construction_update_state(&trackType, &trackDirection, &rideIndex, &liftHillAndAlternativeState, &x, &y, &z, nullptr); _currentTrackPrice = place_provisional_track_piece(rideIndex, trackType, trackDirection, liftHillAndAlternativeState, x, y, z); if (_currentTrackPrice != MONEY32_UNDEFINED) break; @@ -3407,7 +3407,7 @@ void ride_construction_toolupdate_construct(sint32 screenX, sint32 screenY) } for (;;) { - sub_6CA2DF(&trackType, &trackDirection, &rideIndex, &liftHillAndAlternativeState, &x, &y, &z, nullptr); + window_ride_construction_update_state(&trackType, &trackDirection, &rideIndex, &liftHillAndAlternativeState, &x, &y, &z, nullptr); _currentTrackPrice = place_provisional_track_piece(rideIndex, trackType, trackDirection, liftHillAndAlternativeState, x, y, z); if (_currentTrackPrice != MONEY32_UNDEFINED) break; @@ -3489,7 +3489,7 @@ void ride_construction_tooldown_construct(sint32 screenX, sint32 screenY) map_invalidate_map_selection_tiles(); ride_construction_invalidate_current_track(); - if (sub_6CA2DF(&trackType, &trackDirection, &rideIndex, &liftHillAndAlternativeState, &x, &y, &z, &properties)) + if (window_ride_construction_update_state(&trackType, &trackDirection, &rideIndex, &liftHillAndAlternativeState, &x, &y, &z, &properties)) return; _currentTrackPieceType = trackType; diff --git a/src/openrct2/interface/Window.h b/src/openrct2/interface/Window.h index 80aff3225f..eab0a7bcd0 100644 --- a/src/openrct2/interface/Window.h +++ b/src/openrct2/interface/Window.h @@ -713,7 +713,7 @@ void window_ride_construction_keyboard_shortcut_demolish_current(); void window_follow_sprite(rct_window * w, size_t spriteIndex); void window_unfollow_sprite(rct_window * w); -bool sub_6CA2DF(sint32 *trackType, sint32 *trackDirection, sint32 *rideIndex, sint32 *_liftHillAndAlternativeState, sint32 *x, sint32 *y, sint32 *z, sint32 *properties); +bool window_ride_construction_update_state(sint32 *trackType, sint32 *trackDirection, sint32 *rideIndex, sint32 *_liftHillAndAlternativeState, sint32 *x, sint32 *y, sint32 *z, sint32 *properties); money32 place_provisional_track_piece(sint32 rideIndex, sint32 trackType, sint32 trackDirection, sint32 liftHillAndAlternativeState, sint32 x, sint32 y, sint32 z); extern uint64 _enabledRidePieces; diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index 3006581258..a610c34247 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -1354,7 +1354,7 @@ void ride_restore_provisional_track_piece() { if (_currentTrackSelectionFlags & TRACK_SELECTION_FLAG_TRACK) { sint32 x, y, z, direction, type, rideIndex, liftHillAndAlternativeState; - if (sub_6CA2DF(&type, &direction, &rideIndex, &liftHillAndAlternativeState, &x, &y, &z, nullptr)) { + if (window_ride_construction_update_state(&type, &direction, &rideIndex, &liftHillAndAlternativeState, &x, &y, &z, nullptr)) { ride_construction_remove_ghosts(); } else { _currentTrackPrice = place_provisional_track_piece(rideIndex, type, direction, liftHillAndAlternativeState, x, y, z); diff --git a/src/openrct2/windows/_legacy.cpp b/src/openrct2/windows/_legacy.cpp index eac0ff3735..d5ccd0b252 100644 --- a/src/openrct2/windows/_legacy.cpp +++ b/src/openrct2/windows/_legacy.cpp @@ -205,7 +205,7 @@ money32 place_provisional_track_piece(sint32 rideIndex, sint32 trackType, sint32 } } -static bool sub_6CA2DF_get_track_element(uint8 *trackElement) { +static bool window_ride_construction_update_state_get_track_element(uint8 *trackElement) { auto intent = Intent(INTENT_ACTION_RIDE_CONSTRUCTION_UPDATE_PIECES); context_broadcast_intent(&intent); @@ -304,11 +304,11 @@ static bool sub_6CA2DF_get_track_element(uint8 *trackElement) { * @param[out] _properties (edirs16) * @return (CF) */ -bool sub_6CA2DF(sint32 *_trackType, sint32 *_trackDirection, sint32 *_rideIndex, sint32 *_liftHillAndAlternativeState, sint32 *_x, sint32 *_y, sint32 *_z, sint32 *_properties) { +bool window_ride_construction_update_state(sint32 *_trackType, sint32 *_trackDirection, sint32 *_rideIndex, sint32 *_liftHillAndAlternativeState, sint32 *_x, sint32 *_y, sint32 *_z, sint32 *_properties) { uint8 trackType, trackDirection, rideIndex; uint16 z, x, y, liftHillAndAlternativeState, properties; - if (!sub_6CA2DF_get_track_element(&trackType)) { + if (!window_ride_construction_update_state_get_track_element(&trackType)) { return true; }