diff --git a/src/paint/map_element/map_element.c b/src/paint/map_element/map_element.c index a1c49c0ff7..e47d56c0d4 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 +rct_xy16 gPaintMapPosition; bool gDidPassSurface; rct_map_element * gSurfaceElement; tunnel_entry gLeftTunnels[65]; @@ -153,8 +154,8 @@ static void sub_68B3FB(int x, int y) RCT2_GLOBAL(0x9DE56A, uint16_t) = x; RCT2_GLOBAL(0x9DE56E, uint16_t) = y; - RCT2_GLOBAL(0x9DE574, uint16_t) = x; - RCT2_GLOBAL(0x9DE576, uint16_t) = y; + gPaintMapPosition.x = x; + gPaintMapPosition.y = y; rct_map_element* map_element = map_get_first_element_at(x >> 5, y >> 5); uint8 rotation = get_current_rotation(); @@ -235,7 +236,7 @@ static void sub_68B3FB(int x, int y) int direction = (map_element->type + rotation) & MAP_ELEMENT_DIRECTION_MASK; int height = map_element->base_height * 8; - uint32_t dword_9DE574 = RCT2_GLOBAL(0x9DE574, uint32_t); + rct_xy16 dword_9DE574 = gPaintMapPosition; g_currently_drawn_item = map_element; //setup the painting of for example: the underground, signs, rides, scenery, etc. switch (map_element_get_type(map_element)) @@ -274,7 +275,7 @@ static void sub_68B3FB(int x, int y) // An undefined map element is most likely a corrupt element inserted by 8 cars' MOM feature to skip drawing of all elements after it. return; } - RCT2_GLOBAL(0x9DE574, uint32_t) = dword_9DE574; + gPaintMapPosition = dword_9DE574; } while (!map_element_is_last_for_tile(map_element++)); if (!gShowSupportSegmentHeights) { diff --git a/src/paint/map_element/map_element.h b/src/paint/map_element/map_element.h index 6a4f96ccc6..1229bcb305 100644 --- a/src/paint/map_element/map_element.h +++ b/src/paint/map_element/map_element.h @@ -68,6 +68,7 @@ typedef struct tunnel_entry { } tunnel_entry; #ifdef NO_RCT2 +extern rct_xy16 gPaintMapPosition; extern bool gDidPassSurface; extern rct_map_element * gSurfaceElement; extern tunnel_entry gLeftTunnels[65]; @@ -76,6 +77,7 @@ extern tunnel_entry gRightTunnels[65]; extern uint8 gRightTunnelCount; extern uint8 gVerticalTunnelHeight; #else +#define gPaintMapPosition RCT2_GLOBAL(0x009DE574, rct_xy16) #define gDidPassSurface RCT2_GLOBAL(0x009DE57C, bool) #define gSurfaceElement RCT2_GLOBAL(0x009E3250, rct_map_element *) #define gLeftTunnels RCT2_ADDRESS(0x009E3138, tunnel_entry) diff --git a/src/paint/paint.c b/src/paint/paint.c index f7af917533..3bc23b9a19 100644 --- a/src/paint/paint.c +++ b/src/paint/paint.c @@ -167,8 +167,8 @@ static paint_struct * sub_9819_c(uint32 image_id, rct_xyz16 offset, rct_xyz16 bo ps->var_20 = NULL; ps->sprite_type = gPaintInteractionType; ps->var_29 = RCT2_GLOBAL(0x9DE571, uint8); - ps->map_x = RCT2_GLOBAL(0x9DE574, uint16); - ps->map_y = RCT2_GLOBAL(0x9DE576, uint16); + ps->map_x = gPaintMapPosition.x; + ps->map_y = gPaintMapPosition.y; ps->mapElement = g_currently_drawn_item; return ps; @@ -288,8 +288,8 @@ paint_struct * sub_98196C( ps->var_20 = NULL; ps->sprite_type = gPaintInteractionType; ps->var_29 = RCT2_GLOBAL(0x9DE571, uint8); - ps->map_x = RCT2_GLOBAL(0x9DE574, uint16); - ps->map_y = RCT2_GLOBAL(0x9DE576, uint16); + ps->map_x = gPaintMapPosition.x; + ps->map_y = gPaintMapPosition.y; ps->mapElement = g_currently_drawn_item; g_ps_F1AD28 = ps; diff --git a/src/ride/gentle/circus_show.c b/src/ride/gentle/circus_show.c index 5df600080f..8672ad2770 100644 --- a/src/ride/gentle/circus_show.c +++ b/src/ride/gentle/circus_show.c @@ -59,7 +59,7 @@ static void paint_circus_show(uint8 rideIndex, uint8 trackSequence, uint8 direct rct_ride * ride = get_ride(rideIndex); rct_xy16 position = {RCT2_GLOBAL(0x009DE56A, sint16), RCT2_GLOBAL(0x009DE56E, sint16)}; - wooden_a_supports_paint_setup((direction & 1), 0, height, RCT2_GLOBAL(0x00F441A0, uint32_t), NULL); + wooden_a_supports_paint_setup((direction & 1), 0, height, gTrackColours[SCHEME_MISC], NULL); track_paint_util_paint_floor(edges, gTrackColours[SCHEME_TRACK], height, floorSpritesCork, get_current_rotation()); diff --git a/src/ride/gentle/crooked_house.c b/src/ride/gentle/crooked_house.c index d3f817b40c..77ec72977f 100644 --- a/src/ride/gentle/crooked_house.c +++ b/src/ride/gentle/crooked_house.c @@ -74,7 +74,7 @@ static void paint_crooked_house(uint8 rideIndex, uint8 trackSequence, uint8 dire rct_ride * ride = get_ride(rideIndex); rct_xy16 position = {RCT2_GLOBAL(0x009DE56A, sint16), RCT2_GLOBAL(0x009DE56E, sint16)}; - wooden_a_supports_paint_setup((direction & 1), 0, height, RCT2_GLOBAL(0x00F441A0, uint32_t), NULL); + wooden_a_supports_paint_setup((direction & 1), 0, height, gTrackColours[SCHEME_MISC], NULL); track_paint_util_paint_floor(edges, gTrackColours[SCHEME_TRACK], height, floorSpritesCork, get_current_rotation());