diff --git a/src/paint/map_element/map_element.c b/src/paint/map_element/map_element.c index e47d56c0d4..7483c0f69c 100644 --- a/src/paint/map_element/map_element.c +++ b/src/paint/map_element/map_element.c @@ -34,6 +34,7 @@ #include "../supports.h" #ifdef NO_RCT2 +uint8 g141E9DB; rct_xy16 gPaintMapPosition; bool gDidPassSurface; rct_map_element * gSurfaceElement; @@ -63,7 +64,7 @@ void map_element_paint_setup(int x, int y) ) { paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); paint_util_force_set_general_support_height(-1, 0); - RCT2_GLOBAL(0x0141E9DB, uint8) = 0; + g141E9DB = 0; RCT2_GLOBAL(0x0141E9DC, uint32) = 0xFFFF; sub_68B3FB(x, y); @@ -87,7 +88,7 @@ void sub_68B2B7(int x, int y) paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); paint_util_force_set_general_support_height(-1, 0); RCT2_GLOBAL(0x0141E9DC, uint32) = 0xFFFF; - RCT2_GLOBAL(0x0141E9DB, uint8) = 2; + g141E9DB = G141E9DB_FLAG_2; sub_68B3FB(x, y); } else { diff --git a/src/paint/map_element/map_element.h b/src/paint/map_element/map_element.h index 1229bcb305..9de31f4c24 100644 --- a/src/paint/map_element/map_element.h +++ b/src/paint/map_element/map_element.h @@ -67,7 +67,14 @@ typedef struct tunnel_entry { uint8 type; } tunnel_entry; +enum +{ + G141E9DB_FLAG_1 = 1, + G141E9DB_FLAG_2 = 2, +}; + #ifdef NO_RCT2 +extern uint8 g141E9DB; extern rct_xy16 gPaintMapPosition; extern bool gDidPassSurface; extern rct_map_element * gSurfaceElement; @@ -77,6 +84,7 @@ extern tunnel_entry gRightTunnels[65]; extern uint8 gRightTunnelCount; extern uint8 gVerticalTunnelHeight; #else +#define g141E9DB RCT2_GLOBAL(0x0141E9DB, uint8) #define gPaintMapPosition RCT2_GLOBAL(0x009DE574, rct_xy16) #define gDidPassSurface RCT2_GLOBAL(0x009DE57C, bool) #define gSurfaceElement RCT2_GLOBAL(0x009E3250, rct_map_element *) diff --git a/src/paint/map_element/surface.c b/src/paint/map_element/surface.c index 75a7c0ff1a..97e48005e1 100644 --- a/src/paint/map_element/surface.c +++ b/src/paint/map_element/surface.c @@ -1506,7 +1506,7 @@ void surface_paint(uint8 direction, uint16 height, rct_map_element * mapElement) } gPaintInteractionType = VIEWPORT_INTERACTION_ITEM_TERRAIN; - RCT2_GLOBAL(0x0141E9DB, uint8) |= 1; + g141E9DB |= G141E9DB_FLAG_1; switch (surfaceShape) { default: diff --git a/src/paint/supports.c b/src/paint/supports.c index 298dc96b51..1ebfa5b51e 100644 --- a/src/paint/supports.c +++ b/src/paint/supports.c @@ -18,6 +18,7 @@ #include "../interface/viewport.h" #include "../paint/paint.h" #include "supports.h" +#include "map_element/map_element.h" /** rct2: 0x0097AF20, 0x0097AF21 */ const rct_xy8 loc_97AF20[] = { @@ -345,7 +346,7 @@ bool wooden_a_supports_paint_setup(int supportType, int special, int height, uin return false; } - if (!(RCT2_GLOBAL(0x0141E9DB, uint8) & 1)) { + if (!(g141E9DB & G141E9DB_FLAG_1)) { return false; } @@ -496,7 +497,7 @@ bool metal_a_supports_paint_setup(int supportType, int segment, int special, int return false; } - if (!(RCT2_GLOBAL(0x0141E9DB, uint8) & 1)) { + if (!(g141E9DB & G141E9DB_FLAG_1)) { return false; } diff --git a/src/ride/track_paint.c b/src/ride/track_paint.c index be36ac2d0c..a5bea2a100 100644 --- a/src/ride/track_paint.c +++ b/src/ride/track_paint.c @@ -422,7 +422,7 @@ void track_paint_util_draw_station(uint8 rideIndex, uint8 trackSequence, uint8 d bool track_paint_util_draw_station_covers(enum edge edge, bool hasFence, const rct_ride_entrance_definition * entranceStyle, uint8 direction, uint16 height) { - if (!(RCT2_GLOBAL(0x0141E9DB, uint8) & 3)) { + if (!(g141E9DB & (G141E9DB_FLAG_1 | G141E9DB_FLAG_2))) { return false; }