1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-24 23:34:37 +01:00

Give names to _currentTrackSelectionFlags flags

This commit is contained in:
zsilencer
2016-10-26 16:19:56 -06:00
parent 1b47bdd180
commit 3d712ddc58
5 changed files with 38 additions and 31 deletions

View File

@@ -1348,7 +1348,7 @@ int sub_6C683D(int* x, int* y, int* z, int direction, int type, uint16 extra_par
void ride_restore_provisional_entrance_or_exit()
{
if (_currentTrackSelectionFlags & (1 << 2)) {
if (_currentTrackSelectionFlags & TRACK_SELECTION_FLAG_ENTRANCE_OR_EXIT) {
game_do_command(
_unkF440BF.x,
(GAME_COMMAND_FLAG_APPLY | GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED | GAME_COMMAND_FLAG_5 | GAME_COMMAND_FLAG_GHOST) | (_unkF440BF.direction << 8),
@@ -1363,7 +1363,7 @@ void ride_restore_provisional_entrance_or_exit()
void ride_remove_provisional_entrance_or_exit()
{
if (_currentTrackSelectionFlags & (1 << 2)) {
if (_currentTrackSelectionFlags & TRACK_SELECTION_FLAG_ENTRANCE_OR_EXIT) {
game_do_command(
_unkF440BF.x,
(GAME_COMMAND_FLAG_5 | GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED | GAME_COMMAND_FLAG_APPLY),
@@ -1378,7 +1378,7 @@ void ride_remove_provisional_entrance_or_exit()
void ride_restore_provisional_track_piece()
{
if (_currentTrackSelectionFlags & (1 << 1)) {
if (_currentTrackSelectionFlags & TRACK_SELECTION_FLAG_TRACK) {
int x, y, z, direction, type, rideIndex, edxRS16;
if (sub_6CA2DF(&type, &direction, &rideIndex, &edxRS16, &x, &y, &z, NULL)) {
sub_6C96C0();
@@ -1391,7 +1391,7 @@ void ride_restore_provisional_track_piece()
void ride_remove_provisional_track_piece()
{
if (!(_currentTrackSelectionFlags & (1 << 1))) {
if (!(_currentTrackSelectionFlags & TRACK_SELECTION_FLAG_TRACK)) {
return;
}
rct_ride *ride;
@@ -1438,13 +1438,13 @@ void ride_remove_provisional_track_piece()
void sub_6C96C0()
{
if (_currentTrackSelectionFlags & (1 << 2)) {
if (_currentTrackSelectionFlags & TRACK_SELECTION_FLAG_ENTRANCE_OR_EXIT) {
ride_remove_provisional_entrance_or_exit();
_currentTrackSelectionFlags &= ~(1 << 2);
_currentTrackSelectionFlags &= ~TRACK_SELECTION_FLAG_ENTRANCE_OR_EXIT;
}
if (_currentTrackSelectionFlags & (1 << 1)) {
if (_currentTrackSelectionFlags & TRACK_SELECTION_FLAG_TRACK) {
ride_remove_provisional_track_piece();
_currentTrackSelectionFlags &= ~(1 << 1);
_currentTrackSelectionFlags &= ~TRACK_SELECTION_FLAG_TRACK;
}
}
@@ -1471,7 +1471,7 @@ void sub_6C9627()
case RIDE_CONSTRUCTION_STATE_MAZE_BUILD:
case RIDE_CONSTRUCTION_STATE_MAZE_MOVE:
case RIDE_CONSTRUCTION_STATE_MAZE_FILL:
if (_currentTrackSelectionFlags & (1 << 0)) {
if (_currentTrackSelectionFlags & TRACK_SELECTION_FLAG_ARROW) {
map_invalidate_tile_full(
_currentTrackBeginX & 0xFFE0,
_currentTrackBeginY & 0xFFE0
@@ -1480,8 +1480,8 @@ void sub_6C9627()
}
break;
default:
if (_currentTrackSelectionFlags & (1 << 0)) {
_currentTrackSelectionFlags &= ~(1 << 0);
if (_currentTrackSelectionFlags & TRACK_SELECTION_FLAG_ARROW) {
_currentTrackSelectionFlags &= ~TRACK_SELECTION_FLAG_ARROW;
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW;
map_invalidate_tile_full(_currentTrackBeginX, _currentTrackBeginY);
}
@@ -7100,7 +7100,7 @@ money32 ride_get_entrance_or_exit_price(int rideIndex, int x, int y, int directi
0
);
if (result != MONEY32_UNDEFINED) {
_currentTrackSelectionFlags |= (1 << 2);
_currentTrackSelectionFlags |= TRACK_SELECTION_FLAG_ENTRANCE_OR_EXIT;
_unkF440BF.x = x;
_unkF440BF.y = y;
_unkF440BF.direction = direction;

View File

@@ -889,6 +889,13 @@ enum {
MAZE_WALL_TYPE_WOOD,
};
enum {
TRACK_SELECTION_FLAG_ARROW = 1 << 0,
TRACK_SELECTION_FLAG_TRACK = 1 << 1,
TRACK_SELECTION_FLAG_ENTRANCE_OR_EXIT = 1 << 2,
TRACK_SELECTION_FLAG_RECHECK = 1 << 3,
};
typedef struct rct_ride_properties {
uint32 flags;
uint8 min_value;

View File

@@ -2722,7 +2722,7 @@ money32 sub_6CA162(int rideIndex, int trackType, int trackDirection, int edxRS16
_unkF440C5.y = y;
_unkF440C5.z = z;
_unkF440C5.direction = trackDirection;
_currentTrackSelectionFlags |= (1 << 1);
_currentTrackSelectionFlags |= TRACK_SELECTION_FLAG_TRACK;
viewport_set_visibility(gTrackGroundFlags & TRACK_ELEMENT_LOCATION_IS_UNDERGROUND ? 1 : 3);
if (_currentTrackSlopeEnd != 0)
viewport_set_visibility(2);
@@ -2741,7 +2741,7 @@ money32 sub_6CA162(int rideIndex, int trackType, int trackDirection, int edxRS16
_unkF440C5.z = z;
_unkF440C5.direction = trackDirection;
_currentTrackSelectionFlags |= (1 << 1);
_currentTrackSelectionFlags |= TRACK_SELECTION_FLAG_TRACK;
viewport_set_visibility(gTrackGroundFlags & TRACK_ELEMENT_LOCATION_IS_UNDERGROUND ? 1 : 3);
if (_currentTrackSlopeEnd != 0)
viewport_set_visibility(2);
@@ -2760,15 +2760,15 @@ void sub_6C94D8()
// Recheck if area is fine for new track.
// Set by footpath placement
if (_currentTrackSelectionFlags & (1 << 3)) {
if (_currentTrackSelectionFlags & TRACK_SELECTION_FLAG_RECHECK) {
sub_6C9627();
_currentTrackSelectionFlags &= ~(1 << 3);
_currentTrackSelectionFlags &= ~TRACK_SELECTION_FLAG_RECHECK;
}
switch (_rideConstructionState) {
case RIDE_CONSTRUCTION_STATE_FRONT:
case RIDE_CONSTRUCTION_STATE_BACK:
if (!(_currentTrackSelectionFlags & (1 << 1))) {
if (!(_currentTrackSelectionFlags & TRACK_SELECTION_FLAG_TRACK)) {
if (sub_6CA2DF(&type, &direction, &rideIndex, &edxRS16, &x, &y, &z, NULL)) {
sub_6C96C0();
} else {
@@ -2781,7 +2781,7 @@ void sub_6C94D8()
break;
_rideConstructionArrowPulseTime = 5;
_currentTrackSelectionFlags ^= (1 << 0);
_currentTrackSelectionFlags ^= TRACK_SELECTION_FLAG_ARROW;
x = _currentTrackBeginX;
y = _currentTrackBeginY;
z = _currentTrackBeginZ;
@@ -2796,7 +2796,7 @@ void sub_6C94D8()
direction ^= 2;
gMapSelectArrowDirection = direction;
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW;
if (_currentTrackSelectionFlags & (1 << 0))
if (_currentTrackSelectionFlags & TRACK_SELECTION_FLAG_ARROW)
gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE_ARROW;
map_invalidate_tile_full(x, y);
break;
@@ -2806,13 +2806,13 @@ void sub_6C94D8()
break;
_rideConstructionArrowPulseTime = 5;
_currentTrackSelectionFlags ^= (1 << 0);
_currentTrackSelectionFlags ^= TRACK_SELECTION_FLAG_ARROW;
x = _currentTrackBeginX;
y = _currentTrackBeginY;
z = _currentTrackBeginZ;
direction = _currentTrackPieceDirection & 3;
type = _currentTrackPieceType;
if (sub_6C683D(&x, &y, &z, direction, type, 0, NULL, _currentTrackSelectionFlags & (1 << 0) ? 2 : 1)) {
if (sub_6C683D(&x, &y, &z, direction, type, 0, NULL, _currentTrackSelectionFlags & TRACK_SELECTION_FLAG_ARROW ? 2 : 1)) {
sub_6C96C0();
_rideConstructionState = RIDE_CONSTRUCTION_STATE_0;
}
@@ -2825,7 +2825,7 @@ void sub_6C94D8()
break;
_rideConstructionArrowPulseTime = 5;
_currentTrackSelectionFlags ^= (1 << 0);
_currentTrackSelectionFlags ^= TRACK_SELECTION_FLAG_ARROW;
x = _currentTrackBeginX & 0xFFE0;
y = _currentTrackBeginY & 0xFFE0;
z = _currentTrackBeginZ + 15;
@@ -2842,7 +2842,7 @@ void sub_6C94D8()
}
}
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW;
if (_currentTrackSelectionFlags & (1 << 0))
if (_currentTrackSelectionFlags & TRACK_SELECTION_FLAG_ARROW)
gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE_ARROW;
map_invalidate_tile_full(x, y);
break;
@@ -3653,7 +3653,7 @@ void ride_construction_toolupdate_construct(int screenX, int screenY)
_currentTrackBeginY = y;
_currentTrackBeginZ = z;
if (
(_currentTrackSelectionFlags & (1 << 1)) &&
(_currentTrackSelectionFlags & TRACK_SELECTION_FLAG_TRACK) &&
x == _previousTrackPieceX &&
y == _previousTrackPieceY &&
z == _previousTrackPieceZ
@@ -3746,7 +3746,7 @@ void ride_construction_toolupdate_entrance_exit(int screenX, int screenY)
direction = gRideEntranceExitPlaceDirection ^ 2;
unk = gRideEntranceExitPlaceStationIndex;
if (
!(_currentTrackSelectionFlags & (1 << 2)) ||
!(_currentTrackSelectionFlags & TRACK_SELECTION_FLAG_ENTRANCE_OR_EXIT) ||
x != _unkF440BF.x ||
y != _unkF440BF.y ||
direction != _unkF440BF.direction ||

View File

@@ -383,7 +383,7 @@ static money32 footpath_place_real(int type, int x, int y, int z, int slope, int
}
// Force ride construction to recheck area
_currentTrackSelectionFlags |= (1 << 3);
_currentTrackSelectionFlags |= TRACK_SELECTION_FLAG_RECHECK;
if (gGameCommandNestLevel == 1 && !(flags & GAME_COMMAND_FLAG_GHOST)) {
rct_xyz16 coord;

View File

@@ -1969,7 +1969,7 @@ static money32 raise_land(int flags, int x, int y, int z, int ax, int ay, int bx
}
// Force ride construction to recheck area
_currentTrackSelectionFlags |= (1 << 3);
_currentTrackSelectionFlags |= TRACK_SELECTION_FLAG_RECHECK;
gCommandExpenditureType = RCT_EXPENDITURE_TYPE_LANDSCAPING;
gCommandPosition.x = x;
@@ -2042,7 +2042,7 @@ static money32 lower_land(int flags, int x, int y, int z, int ax, int ay, int bx
}
// Force ride construction to recheck area
_currentTrackSelectionFlags |= (1 << 3);
_currentTrackSelectionFlags |= TRACK_SELECTION_FLAG_RECHECK;
gCommandExpenditureType = RCT_EXPENDITURE_TYPE_LANDSCAPING;
gCommandPosition.x = x;
@@ -2127,7 +2127,7 @@ money32 raise_water(sint16 x0, sint16 y0, sint16 x1, sint16 y1, uint8 flags)
}
// Force ride construction to recheck area
_currentTrackSelectionFlags |= (1 << 3);
_currentTrackSelectionFlags |= TRACK_SELECTION_FLAG_RECHECK;
return cost;
}
@@ -2203,7 +2203,7 @@ money32 lower_water(sint16 x0, sint16 y0, sint16 x1, sint16 y1, uint8 flags)
}
// Force ride construction to recheck area
_currentTrackSelectionFlags |= (1 << 3);
_currentTrackSelectionFlags |= TRACK_SELECTION_FLAG_RECHECK;
return cost;
}
@@ -3863,7 +3863,7 @@ void game_command_place_large_scenery(int* eax, int* ebx, int* ecx, int* edx, in
}
// Force ride construction to recheck area
_currentTrackSelectionFlags |= (1 << 3);
_currentTrackSelectionFlags |= TRACK_SELECTION_FLAG_RECHECK;
*ebx = (scenery_entry->large_scenery.price * 10) + supportsCost;
if(gParkFlags & PARK_FLAGS_NO_MONEY){