diff --git a/src/ride/track_design.c b/src/ride/track_design.c index 2c134ceb14..b8ef17a695 100644 --- a/src/ride/track_design.c +++ b/src/ride/track_design.c @@ -683,12 +683,12 @@ static int track_design_place_scenery(rct_td6_scenery_element *scenery_start, ui if (!find_object_in_entry_group(&scenery->scenery_object, &entry_type, &entry_index)){ entry_type = scenery->scenery_object.flags & 0xF; if (entry_type != OBJECT_TYPE_PATHS){ - byte_F4414E |= 1 << 1; + byte_F4414E |= BYTE_F4414E_SCENERY_UNAVAILABLE; continue; } - if (gScreenFlags&SCREEN_FLAGS_TRACK_DESIGNER){ - byte_F4414E |= 1 << 1; + if (gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER){ + byte_F4414E |= BYTE_F4414E_SCENERY_UNAVAILABLE; continue; } @@ -699,12 +699,12 @@ static int track_design_place_scenery(rct_td6_scenery_element *scenery_start, ui if (path == (rct_footpath_entry*)-1) continue; - if (path->flags & (1 << 2)) + if (path->flags & FOOTPATH_ENTRY_FLAG_SHOW_ONLY_IN_SCENARIO_EDITOR) continue; } if (entry_index == object_entry_group_counts[OBJECT_TYPE_PATHS]){ - byte_F4414E |= 1 << 1; + byte_F4414E |= BYTE_F4414E_SCENERY_UNAVAILABLE; continue; } } @@ -847,7 +847,7 @@ static int track_design_place_scenery(rct_td6_scenery_element *scenery_start, ui } break; default: - byte_F4414E |= 1 << 1; + byte_F4414E |= BYTE_F4414E_SCENERY_UNAVAILABLE; continue; break; } @@ -1350,9 +1350,9 @@ static bool sub_6D2189(rct_track_td6 *td6, money32 *cost, uint8 *rideId, uint8 * z += 16 - word_F44129; int operation = PTD_OPERATION_GET_COST; - if (byte_F4414E & 2) { + if (byte_F4414E & BYTE_F4414E_SCENERY_UNAVAILABLE) { operation |= 0x80; - *flags |= 1; + *flags |= TRACK_DESIGN_FLAG_SCENERY_UNAVAILABLE; } money32 resultCost = sub_6D01B3(td6, operation, rideIndex, mapSize, mapSize, z); @@ -1360,7 +1360,7 @@ static bool sub_6D2189(rct_track_td6 *td6, money32 *cost, uint8 *rideId, uint8 * if (resultCost != MONEY32_UNDEFINED) { if (!find_object_in_entry_group(&td6->vehicle_object, &entry_type, &entry_index)){ - *flags |= 4; + *flags |= TRACK_DESIGN_FLAG_VEHICLE_UNAVAILABLE; } _currentTrackPieceDirection = backup_rotation; @@ -1422,7 +1422,7 @@ static money32 place_track_design(sint16 x, sint16 y, sint16 z, uint8 flags, uin if (!(flags & GAME_COMMAND_FLAG_APPLY)) { byte_F44150 = 0; cost = sub_6D01B3(td6, PTD_OPERATION_1, rideIndex, x, y, z); - if (byte_F4414E & (1 << 1)) { + if (byte_F4414E & BYTE_F4414E_SCENERY_UNAVAILABLE) { byte_F44150 |= 1 << 7; cost = sub_6D01B3(td6, 0x80 | PTD_OPERATION_1, rideIndex, x, y, z); } diff --git a/src/ride/track_design.h b/src/ride/track_design.h index 5d2d928bb9..638c118afc 100644 --- a/src/ride/track_design.h +++ b/src/ride/track_design.h @@ -166,6 +166,15 @@ enum { TDPF_PLACE_SCENERY = 1 << 0, }; +enum { + TRACK_DESIGN_FLAG_SCENERY_UNAVAILABLE = (1 << 0), + TRACK_DESIGN_FLAG_VEHICLE_UNAVAILABLE = (1 << 2), +}; + +enum { + BYTE_F4414E_SCENERY_UNAVAILABLE = (1 << 1), +}; + enum { PTD_OPERATION_DRAW_OUTLINES, PTD_OPERATION_1, diff --git a/src/windows/footpath.c b/src/windows/footpath.c index 1b7e2d0ea5..2d4e9bdcaf 100644 --- a/src/windows/footpath.c +++ b/src/windows/footpath.c @@ -590,7 +590,7 @@ static void window_footpath_show_footpath_types_dialog(rct_window *w, rct_widget rct_footpath_entry *pathType; numPathTypes = 0; - flags = 4; + flags = FOOTPATH_ENTRY_FLAG_SHOW_ONLY_IN_SCENARIO_EDITOR; // If the game is in sandbox mode, also show paths that are normally restricted to the scenario editor, but not their queues (since these usually shouldn't have one) if ((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || (gCheatsSandboxMode && !showQueues)) flags = 0; diff --git a/src/windows/track_list.c b/src/windows/track_list.c index da3d765fda..6927b7076a 100644 --- a/src/windows/track_list.c +++ b/src/windows/track_list.c @@ -429,13 +429,13 @@ static void window_track_list_paint(rct_window *w, rct_drawpixelinfo *dpi) RCT2_GLOBAL(0x00F44153, uint8) = 0; // Warnings - if ((td6->track_flags & 4) && !(gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER)) { + if ((td6->track_flags & TRACK_DESIGN_FLAG_VEHICLE_UNAVAILABLE) && !(gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER)) { // Vehicle design not available gfx_draw_string_centred_clipped(dpi, STR_VEHICLE_DESIGN_UNAVAILABLE, NULL, 0, x, y, 368); y -= 10; } - if (td6->track_flags & 1) { + if (td6->track_flags & TRACK_DESIGN_FLAG_SCENERY_UNAVAILABLE) { RCT2_GLOBAL(0x00F44153, uint8) = 1; if (!gTrackDesignSceneryToggle) { // Scenery not available diff --git a/src/world/footpath.h b/src/world/footpath.h index 198aeac6fc..37fdb13c26 100644 --- a/src/world/footpath.h +++ b/src/world/footpath.h @@ -39,6 +39,10 @@ typedef struct rct_footpath_entry { assert_struct_size(rct_footpath_entry, 13); #pragma pack(pop) +enum { + FOOTPATH_ENTRY_FLAG_SHOW_ONLY_IN_SCENARIO_EDITOR = (1 << 2), +}; + enum { FOOTPATH_SEARCH_SUCCESS, FOOTPATH_SEARCH_NOT_FOUND,