Rename sub_6CA2DF() to window_ride_construction_update_state()

This commit is contained in:
Michael Steenbeek 2018-03-08 14:33:09 +01:00
parent f0d75eb90e
commit 88af2d3954
4 changed files with 15 additions and 15 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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);

View File

@ -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;
}