From a60a33e66538878668d8688b6b0c6b976df21c1a Mon Sep 17 00:00:00 2001 From: Ted John Date: Sat, 2 Sep 2017 22:47:07 +0100 Subject: [PATCH] Pass paint session to track_paint --- src/openrct2/paint/map_element/map_element.c | 2 +- src/openrct2/paint/map_element/map_element.h | 2 +- src/openrct2/ride/track_paint.c | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/openrct2/paint/map_element/map_element.c b/src/openrct2/paint/map_element/map_element.c index 6f4fd15c63..e946076e52 100644 --- a/src/openrct2/paint/map_element/map_element.c +++ b/src/openrct2/paint/map_element/map_element.c @@ -253,7 +253,7 @@ static void sub_68B3FB(paint_session * session, sint32 x, sint32 y) path_paint(session, direction, height, map_element); break; case MAP_ELEMENT_TYPE_TRACK: - track_paint(direction, height, map_element); + track_paint(session, direction, height, map_element); break; case MAP_ELEMENT_TYPE_SCENERY: scenery_paint(session, direction, height, map_element); diff --git a/src/openrct2/paint/map_element/map_element.h b/src/openrct2/paint/map_element/map_element.h index 89e222293f..1676043209 100644 --- a/src/openrct2/paint/map_element/map_element.h +++ b/src/openrct2/paint/map_element/map_element.h @@ -103,6 +103,6 @@ void path_paint(paint_session * session, uint8 direction, uint16 height, rct_map void scenery_paint(paint_session * session, uint8 direction, sint32 height, rct_map_element* mapElement); void fence_paint(paint_session * session, uint8 direction, sint32 height, rct_map_element* mapElement); void scenery_multiple_paint(paint_session * session, uint8 direction, uint16 height, rct_map_element *mapElement); -void track_paint(uint8 direction, sint32 height, rct_map_element *mapElement); +void track_paint(paint_session * session, uint8 direction, sint32 height, rct_map_element *mapElement); #endif diff --git a/src/openrct2/ride/track_paint.c b/src/openrct2/ride/track_paint.c index a09148ff37..f266edba60 100644 --- a/src/openrct2/ride/track_paint.c +++ b/src/openrct2/ride/track_paint.c @@ -1733,7 +1733,7 @@ void track_paint_util_left_corkscrew_up_supports(uint8 direction, uint16 height) * * rct2: 0x006C4794 */ -void track_paint(uint8 direction, sint32 height, rct_map_element *mapElement) +void track_paint(paint_session * session, uint8 direction, sint32 height, rct_map_element *mapElement) { sint32 rideIndex = mapElement->properties.track.ride_index; rct_ride *ride = get_ride(rideIndex); @@ -1749,7 +1749,7 @@ void track_paint(uint8 direction, sint32 height, rct_map_element *mapElement) ride->entrance_style = RIDE_ENTRANCE_STYLE_PLAIN; } - rct_drawpixelinfo *dpi = gPaintSession.Unk140E9A8; + rct_drawpixelinfo *dpi = session->Unk140E9A8; if (!gTrackDesignSaveMode || rideIndex == gTrackDesignSaveRideIndex) { sint32 trackType = mapElement->properties.track.type; @@ -1757,7 +1757,7 @@ void track_paint(uint8 direction, sint32 height, rct_map_element *mapElement) sint32 trackColourScheme = mapElement->properties.track.colour & 3; if ((gCurrentViewportFlags & VIEWPORT_FLAG_TRACK_HEIGHTS) && dpi->zoom_level == 0) { - gPaintSession.InteractionType = VIEWPORT_INTERACTION_ITEM_NONE; + session->InteractionType = VIEWPORT_INTERACTION_ITEM_NONE; if (TrackHeightMarkerPositions[trackType] & (1 << trackSequence)) { uint16 ax = RideData5[ride->type].z_offset; uint32 ebx = 0x20381689 + (height + 8) / 16; @@ -1767,7 +1767,7 @@ void track_paint(uint8 direction, sint32 height, rct_map_element *mapElement) } } - gPaintSession.InteractionType = VIEWPORT_INTERACTION_ITEM_RIDE; + session->InteractionType = VIEWPORT_INTERACTION_ITEM_RIDE; gTrackColours[SCHEME_TRACK] = SPRITE_ID_PALETTE_COLOUR_2(ride->track_colour_main[trackColourScheme], ride->track_colour_additional[trackColourScheme]); gTrackColours[SCHEME_SUPPORTS] = SPRITE_ID_PALETTE_COLOUR_1(ride->track_colour_supports[trackColourScheme]); gTrackColours[SCHEME_MISC] = IMAGE_TYPE_REMAP; @@ -1780,7 +1780,7 @@ void track_paint(uint8 direction, sint32 height, rct_map_element *mapElement) } if (mapElement->flags & MAP_ELEMENT_FLAG_GHOST) { uint32 ghost_id = construction_markers[gConfigGeneral.construction_marker_colour]; - gPaintSession.InteractionType = VIEWPORT_INTERACTION_ITEM_NONE; + session->InteractionType = VIEWPORT_INTERACTION_ITEM_NONE; gTrackColours[SCHEME_TRACK] = ghost_id; gTrackColours[SCHEME_SUPPORTS] = ghost_id; gTrackColours[SCHEME_MISC] = ghost_id;