From b045953256da9fe4b62c62c1c8d575e193b5d7f7 Mon Sep 17 00:00:00 2001 From: Marijn van der Werf Date: Thu, 24 Mar 2016 21:52:32 +0100 Subject: [PATCH 1/3] Implement Spiral Slide drawing --- src/ride/track_data.c | 4 +- src/ride/track_paint.c | 452 +++++++++++++++++++++++++++++++++++++++++ src/ride/track_paint.h | 1 + 3 files changed, 455 insertions(+), 2 deletions(-) diff --git a/src/ride/track_data.c b/src/ride/track_data.c index 2a7d6ecec6..8b3ff45fc3 100644 --- a/src/ride/track_data.c +++ b/src/ride/track_data.c @@ -5492,7 +5492,7 @@ const uint32 RideTypeTrackPaintFunctionsOld[91] = { 0x00743EC8, // RIDE_TYPE_CHAIRLIFT 0x008A7784, // RIDE_TYPE_CORKSCREW_ROLLER_COASTER 0x008A81E8, // RIDE_TYPE_MAZE - 0x0074840C, // RIDE_TYPE_SPIRAL_SLIDE + 0, // RIDE_TYPE_SPIRAL_SLIDE 0x0074A668, // RIDE_TYPE_GO_KARTS 0x0074DDEC, // RIDE_TYPE_LOG_FLUME 0x0075745C, // RIDE_TYPE_RIVER_RAPIDS @@ -5587,7 +5587,7 @@ const TRACK_PAINT_FUNCTION_GETTER RideTypeTrackPaintFunctions[91] = { 0, // RIDE_TYPE_CHAIRLIFT 0, // RIDE_TYPE_CORKSCREW_ROLLER_COASTER 0, // RIDE_TYPE_MAZE - 0, // RIDE_TYPE_SPIRAL_SLIDE + get_track_paint_function_spiral_slide, // RIDE_TYPE_SPIRAL_SLIDE 0, // RIDE_TYPE_GO_KARTS 0, // RIDE_TYPE_LOG_FLUME 0, // RIDE_TYPE_RIVER_RAPIDS diff --git a/src/ride/track_paint.c b/src/ride/track_paint.c index ca861e3867..81378a7c1e 100644 --- a/src/ride/track_paint.c +++ b/src/ride/track_paint.c @@ -76,6 +76,23 @@ static rct_xy16 loc_7667AC[] = { { .x = 0, .y = 1 }, }; +/* rct2: 0x007485D8 (same as loc_7667AC) */ +static rct_xy16 dword_7485D8[] = { + {.x = -1, .y = 0}, + {.x = 0, .y = -1}, + {.x = 1, .y = 0}, + {.x = 0, .y = 1}, +}; + +/* rct2: 0x007485D8 (same as loc_7667AC) */ +static rct_xy16 dword_7485da[] = { + {.x = 0, .y = -1}, + {.x = 1, .y = 0}, + {.x = 0, .y = 1}, + {.x = -1, .y = 0}, +}; + + /** * * rct2: 0x0142811C @@ -860,6 +877,441 @@ TRACK_PAINT_FUNCTION get_track_paint_function_topspin(int trackType, int directi return NULL; } +enum { + SPIRAL_SLIDE_LEFT_R0 = 20548, + SPIRAL_SLIDE_CENTER_R0 = 20549, + SPIRAL_SLIDE_RIGHT_R0 = 20550, + + SPIRAL_SLIDE_LEFT_R1 = 20551, + SPIRAL_SLIDE_CENTER_R1 = 20552, + SPIRAL_SLIDE_RIGHT_R1 = 20553, + + SPIRAL_SLIDE_LEFT_R2 = 20554, + SPIRAL_SLIDE_CENTER_R2 = 20555, + SPIRAL_SLIDE_RIGHT_R2 = 20556, + + SPIRAL_SLIDE_LEFT_R3 = 20557, + SPIRAL_SLIDE_CENTER_R3 = 20558, + SPIRAL_SLIDE_RIGHT_R3 = 20559, + + SPIRAL_SLIDE_INSIDE_R1 = 20560, + SPIRAL_SLIDE_INSIDE_R2 = 20561, + + SPIRAL_SLIDE_BASE_A = 20562, + SPIRAL_SLIDE_BASE_B = 20563, + + SPIRAL_SLIDE_FENCE_TOP_RIGHT = 20564, + SPIRAL_SLIDE_FENCE_BOTTOM_RIGHT = 20565, + SPIRAL_SLIDE_FENCE_BOTTOM_LEFT = 20566, + SPIRAL_SLIDE_FENCE_TOP_LEFT = 20567, + + SPIRAL_SLIDE_PEEP = 20568, // 46 sprites per direction +}; + +static void spiral_slide_paint_tile_back(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element *mapElement) { + uint32 image_id = RCT2_GLOBAL(0x00F441A0, uint32); + wooden_a_supports_paint_setup(direction & 1, 0, height, image_id, NULL); + + // Base + image_id = ((direction & 1) ? SPIRAL_SLIDE_BASE_B : SPIRAL_SLIDE_BASE_A) | RCT2_GLOBAL(0x00F4419C, uint32); + RCT2_GLOBAL(0x009DEA52, uint16) = 0; + RCT2_GLOBAL(0x009DEA54, uint16) = 0; + RCT2_GLOBAL(0x009DEA56, uint16) = height; + sub_98197C(image_id, 0, 0, 32, 32, 1, height, get_current_rotation()); + + sint16 x = RCT2_GLOBAL(0x009DE56A, sint16), y = RCT2_GLOBAL(0x009DE56E, sint16); + uint16 entranceLoc = + ((x / 32) + loc_7667AE[get_current_rotation()].x) | + (((y / 32) + loc_7667AE[get_current_rotation()].y) << 8); + + uint8 entranceId = (mapElement->properties.track.sequence & 0x70) >> 4; + rct_ride *ride = get_ride(rideIndex); + + if (ride->entrances[entranceId] != entranceLoc && ride->exits[entranceId] != entranceLoc) { + image_id = SPIRAL_SLIDE_FENCE_TOP_LEFT | RCT2_GLOBAL(0x00F44198, uint32); + RCT2_GLOBAL(0x009DEA52, uint16) = 0; + RCT2_GLOBAL(0x009DEA54, uint16) = 2; + RCT2_GLOBAL(0x009DEA56, uint16) = height + 2; + sub_98199C(image_id, 0, 0, 32, 1, 7, height, get_current_rotation()); + } + + entranceLoc = + ((x / 32) + loc_7667AC[get_current_rotation()].x) | + (((y / 32) + loc_7667AC[get_current_rotation()].y) << 8); + + if (ride->entrances[entranceId] != entranceLoc && ride->exits[entranceId] != entranceLoc) { + image_id = SPIRAL_SLIDE_FENCE_TOP_RIGHT | RCT2_GLOBAL(0x00F44198, uint32); + RCT2_GLOBAL(0x009DEA52, uint16) = 2; + RCT2_GLOBAL(0x009DEA54, uint16) = 0; + RCT2_GLOBAL(0x009DEA56, uint16) = height + 2; + sub_98199C(image_id, 0, 0, 1, 32, 7, height, get_current_rotation()); + } + + RCT2_GLOBAL(0x141E9B4, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9B8, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9BC, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9C0, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9C4, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9C8, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9CC, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9D0, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9D4, uint16) = 0xFFFF; + + height += 128; + if (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) < height) { + RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) = height; + RCT2_GLOBAL(0x141E9DA, uint8) = 32; + } +} + +static void spiral_slide_paint_tile_right(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element *mapElement) { + uint32 image_id = RCT2_GLOBAL(0x00F441A0, uint32); + wooden_a_supports_paint_setup(direction & 1, 0, height, image_id, NULL); + + // Base + image_id = ((direction & 1) ? SPIRAL_SLIDE_BASE_B : SPIRAL_SLIDE_BASE_A) | RCT2_GLOBAL(0x00F4419C, uint32); + RCT2_GLOBAL(0x009DEA52, uint16) = 0; + RCT2_GLOBAL(0x009DEA54, uint16) = 0; + RCT2_GLOBAL(0x009DEA56, uint16) = height; + sub_98197C(image_id, 0, 0, 32, 32, 1, height, get_current_rotation()); + + sint16 x = RCT2_GLOBAL(0x009DE56A, sint16), y = RCT2_GLOBAL(0x009DE56E, sint16); + uint16 entranceLoc = + ((x / 32) + dword_7485D8[get_current_rotation()].x) | + (((y / 32) + dword_7485D8[get_current_rotation()].y) << 8); + + uint8 entranceId = (mapElement->properties.track.sequence & 0x70) >> 4; + rct_ride *ride = get_ride(rideIndex); + + if (ride->entrances[entranceId] != entranceLoc && ride->exits[entranceId] != entranceLoc) { + image_id = SPIRAL_SLIDE_FENCE_TOP_RIGHT | RCT2_GLOBAL(0x00F44198, uint32); + RCT2_GLOBAL(0x009DEA52, uint16) = 2; + RCT2_GLOBAL(0x009DEA54, uint16) = 0; + RCT2_GLOBAL(0x009DEA56, uint16) = height + 2; + + sub_98199C(image_id, 0, 0, 1, 32, 7, height, 0); + } + + image_id = SPIRAL_SLIDE_FENCE_BOTTOM_RIGHT | RCT2_GLOBAL(0x00F44198, uint32); + RCT2_GLOBAL(0x009DEA52, uint16) = 0; + RCT2_GLOBAL(0x009DEA54, uint16) = 30; + RCT2_GLOBAL(0x009DEA56, uint16) = height + 2; + sub_98197C(image_id, 0, 0, 32, 1, 7, height, get_current_rotation()); //TODO 1, 32 + + if (direction == 0) image_id = SPIRAL_SLIDE_RIGHT_R0 | RCT2_GLOBAL(0x00F44198, uint32); + if (direction == 1) image_id = SPIRAL_SLIDE_RIGHT_R1 | RCT2_GLOBAL(0x00F44198, uint32); + if (direction == 2) image_id = SPIRAL_SLIDE_RIGHT_R2 | RCT2_GLOBAL(0x00F44198, uint32); + if (direction == 3) image_id = SPIRAL_SLIDE_RIGHT_R3 | RCT2_GLOBAL(0x00F44198, uint32); + + RCT2_GLOBAL(0x009DEA52, uint16) = 16; + RCT2_GLOBAL(0x009DEA54, uint16) = 0; + RCT2_GLOBAL(0x009DEA56, uint16) = height + 3; + sub_98197C(image_id, 16, 16, 16, 16, 108, height, get_current_rotation()); + + RCT2_GLOBAL(0x141E9B4, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9B8, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9BC, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9C0, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9C4, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9C8, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9CC, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9D0, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9D4, uint16) = 0xFFFF; + + height += 128; + if (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) < height) { + RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) = height; + RCT2_GLOBAL(0x141E9DA, uint8) = 32; + } +} + +static void spiral_slide_paint_tile_left(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element *mapElement) { + uint32 image_id = RCT2_GLOBAL(0x00F441A0, uint32); + wooden_a_supports_paint_setup(direction & 1, 0, height, image_id, NULL); + + // Base + image_id = ((direction & 1) ? SPIRAL_SLIDE_BASE_B : SPIRAL_SLIDE_BASE_A) | RCT2_GLOBAL(0x00F4419C, uint32); + RCT2_GLOBAL(0x009DEA52, uint16) = 0; + RCT2_GLOBAL(0x009DEA54, uint16) = 0; + RCT2_GLOBAL(0x009DEA56, uint16) = height; + sub_98197C(image_id, 0, 0, 32, 32, 1, height, get_current_rotation()); + + sint16 x = RCT2_GLOBAL(0x009DE56A, sint16), y = RCT2_GLOBAL(0x009DE56E, sint16); + uint16 entranceLoc = + ((x / 32) + dword_7485da[get_current_rotation()].x) | + (((y / 32) + dword_7485da[get_current_rotation()].y) << 8); + + uint8 entranceId = (mapElement->properties.track.sequence & 0x70) >> 4; + rct_ride *ride = get_ride(rideIndex); + + if (ride->entrances[entranceId] != entranceLoc && ride->exits[entranceId] != entranceLoc) { + image_id = SPIRAL_SLIDE_FENCE_TOP_LEFT | RCT2_GLOBAL(0x00F44198, uint32); + RCT2_GLOBAL(0x009DEA52, uint16) = 0; + RCT2_GLOBAL(0x009DEA54, uint16) = 2; + RCT2_GLOBAL(0x009DEA56, uint16) = height + 2; + + sub_98199C(image_id, 0, 0, 32, 1, 7, height, 0); + } + + // Fence + image_id = SPIRAL_SLIDE_FENCE_BOTTOM_LEFT | RCT2_GLOBAL(0x00F44198, uint32); + RCT2_GLOBAL(0x009DEA52, uint16) = 30; + RCT2_GLOBAL(0x009DEA54, uint16) = 0; + RCT2_GLOBAL(0x009DEA56, uint16) = height + 2; + sub_98197C(image_id, 0, 0, 1, 32, 7, height, get_current_rotation()); + + if (direction == 0) image_id = SPIRAL_SLIDE_LEFT_R0 | RCT2_GLOBAL(0x00F44198, uint32); + if (direction == 1) image_id = SPIRAL_SLIDE_LEFT_R1 | RCT2_GLOBAL(0x00F44198, uint32); + if (direction == 2) image_id = SPIRAL_SLIDE_LEFT_R2 | RCT2_GLOBAL(0x00F44198, uint32); + if (direction == 3) image_id = SPIRAL_SLIDE_LEFT_R3 | RCT2_GLOBAL(0x00F44198, uint32); + + RCT2_GLOBAL(0x009DEA52, uint16) = 0; + RCT2_GLOBAL(0x009DEA54, uint16) = 16; + RCT2_GLOBAL(0x009DEA56, uint16) = height + 3; + sub_98197C(image_id, 16, 16, 16, 16, 108, height, get_current_rotation()); + + RCT2_GLOBAL(0x141E9B4, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9B8, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9BC, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9C0, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9C4, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9C8, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9CC, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9D0, uint16) = 0xFFFF; + RCT2_GLOBAL(0x141E9D4, uint16) = 0xFFFF; + + height += 128; + if (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) < height) { + RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) = height; + RCT2_GLOBAL(0x141E9DA, uint8) = 32; + } +} + +static void spiral_slide_paint_tile_front(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element *mapElement) { + uint32 image_id = RCT2_GLOBAL(0x00F441A0, uint32); + wooden_a_supports_paint_setup(direction & 1, 0, height, image_id, NULL); + + // Base + image_id = ((direction & 1) ? SPIRAL_SLIDE_BASE_B : SPIRAL_SLIDE_BASE_A) | RCT2_GLOBAL(0x00F4419C, uint32); + RCT2_GLOBAL(0x009DEA52, uint16) = 0; + RCT2_GLOBAL(0x009DEA54, uint16) = 0; + RCT2_GLOBAL(0x009DEA56, uint16) = height; + sub_98197C(image_id, 0, 0, 32, 32, 1, height, get_current_rotation()); + + // Fence 1 + image_id = SPIRAL_SLIDE_FENCE_BOTTOM_LEFT | RCT2_GLOBAL(0x00F44198, uint32); + RCT2_GLOBAL(0x009DEA52, uint16) = 30; + RCT2_GLOBAL(0x009DEA54, uint16) = 0; + RCT2_GLOBAL(0x009DEA56, uint16) = height + 2; + sub_98197C(image_id, 0, 0, 1, 32, 7, height, get_current_rotation()); + + // Fence 2 + image_id = SPIRAL_SLIDE_FENCE_BOTTOM_RIGHT | RCT2_GLOBAL(0x00F44198, uint32); + RCT2_GLOBAL(0x009DEA52, uint16) = 0; + RCT2_GLOBAL(0x009DEA54, uint16) = 30; + RCT2_GLOBAL(0x009DEA56, uint16) = height + 2; + sub_98197C(image_id, 0, 0, 32, 1, 7, height, get_current_rotation()); + + if (direction == 1) { + image_id = SPIRAL_SLIDE_INSIDE_R1 | RCT2_GLOBAL(0x00F44198, uint32); + RCT2_GLOBAL(0x009DEA52, uint16) = 0xFFF4; + RCT2_GLOBAL(0x009DEA54, uint16) = 0; + RCT2_GLOBAL(0x009DEA56, uint16) = height + 3; + sub_98197C(image_id, 16, 16, 2, 16, 108, height, get_current_rotation()); + } else if (direction == 2) { + image_id = SPIRAL_SLIDE_INSIDE_R2 | RCT2_GLOBAL(0x00F44198, uint32); + RCT2_GLOBAL(0x009DEA52, uint16) = 0; + RCT2_GLOBAL(0x009DEA54, uint16) = 0xFFF4; + RCT2_GLOBAL(0x009DEA56, uint16) = height + 3; + sub_98197C(image_id, 16, 16, 16, 2, 108, height, get_current_rotation()); + } + + + RCT2_GLOBAL(0x009DEA56, uint16) = height + 3; + if (direction == 0) { + image_id = SPIRAL_SLIDE_CENTER_R0 | RCT2_GLOBAL(0x00F44198, uint32); + RCT2_GLOBAL(0x009DEA52, uint16) = 0; + RCT2_GLOBAL(0x009DEA54, uint16) = 8; + sub_98197C(image_id, 16, 16, 16, 8, 108, height, get_current_rotation()); + } else if (direction == 1) { + image_id = SPIRAL_SLIDE_CENTER_R1 | RCT2_GLOBAL(0x00F44198, uint32); + RCT2_GLOBAL(0x009DEA52, uint16) = 14; + RCT2_GLOBAL(0x009DEA54, uint16) = 0; + sub_98197C(image_id, 16, 16, 2, 16, 108, height, get_current_rotation()); + } else if (direction == 2) { + image_id = SPIRAL_SLIDE_CENTER_R2 | RCT2_GLOBAL(0x00F44198, uint32); + RCT2_GLOBAL(0x009DEA52, uint16) = 0; + RCT2_GLOBAL(0x009DEA54, uint16) = 14; + sub_98197C(image_id, 16, 16, 16, 2, 108, height, get_current_rotation()); + } else if (direction == 3) { + image_id = SPIRAL_SLIDE_CENTER_R3 | RCT2_GLOBAL(0x00F44198, uint32); + RCT2_GLOBAL(0x009DEA52, uint16) = 8; + RCT2_GLOBAL(0x009DEA54, uint16) = 0; + sub_98197C(image_id, 16, 16, 8, 16, 108, height, get_current_rotation()); + } + + rct_drawpixelinfo *dpi = RCT2_GLOBAL(0x140E9A8, rct_drawpixelinfo*); + rct_ride *ride = get_ride(rideIndex); + if (dpi->zoom_level == 0 && ride->slide_in_use != 0) { + uint8 slide_progress = ride->spiral_slide_progress; + if (slide_progress != 0) { + slide_progress--; + } + + if (slide_progress == 46) { + slide_progress--; + } + + if (slide_progress < 46) { + + int offset = SPIRAL_SLIDE_PEEP + 46 * direction; + int dea52, dea54, si, di; + if (direction == 0) { + dea52 = 0; + dea54 = 8; + si = 8; + di = 16; + } else if (direction == 1) { + dea52 = 14; + dea54 = 0; + si = 2; + di = 16; + } else if (direction == 2) { + dea52 = 0; + dea54 = 14; + si = 16; + di = 2; + } else if (direction == 3) { + dea52 = 8; + dea54 = 0; + si = 16; + di = 8; + } + + image_id = (offset + slide_progress) | (ride->slide_peep_t_shirt_colour << 19) | (1 << 29); + + RCT2_GLOBAL(0x009DEA52, uint16) = dea52; + RCT2_GLOBAL(0x009DEA54, uint16) = dea54; + RCT2_GLOBAL(0x009DEA56, uint16) = height + 3; + + sub_98199C(image_id, 16, 16, di, si, 108, height, get_current_rotation()); + } + } + + height += 128; + if (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) < height) { + RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_PAINT_TILE_MAX_HEIGHT, sint16) = height; + RCT2_GLOBAL(0x141E9DA, uint8) = 32; + } +} + + +/** + * rct: 0x007485E8 + */ +static void spiral_slide_paint_setup_rot_0(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element *mapElement) { + switch (trackSequence) { + case 0: + spiral_slide_paint_tile_back(rideIndex, trackSequence, direction, height, mapElement); + break; + + case 1: + spiral_slide_paint_tile_right(rideIndex, trackSequence, direction, height, mapElement); + break; + + case 2: + spiral_slide_paint_tile_left(rideIndex, trackSequence, direction, height, mapElement); + break; + + case 3: + spiral_slide_paint_tile_front(rideIndex, trackSequence, direction, height, mapElement); + break; + } +} + +/** + * rct: 0x00748DE4 + */ +static void spiral_slide_paint_setup_rot_1(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element *mapElement) { + + switch (trackSequence) { + case 0: + spiral_slide_paint_tile_right(rideIndex, trackSequence, direction, height, mapElement); + break; + case 1: + spiral_slide_paint_tile_front(rideIndex, trackSequence, direction, height, mapElement); + break; + case 2: + spiral_slide_paint_tile_back(rideIndex, trackSequence, direction, height, mapElement); + break; + case 3: + spiral_slide_paint_tile_left(rideIndex, trackSequence, direction, height, mapElement); + break; + } +} + +/** + * rct: 0x00749628 + */ +static void spiral_slide_paint_setup_rot_2(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element *mapElement) { + switch (trackSequence) { + case 0: + spiral_slide_paint_tile_front(rideIndex, trackSequence, direction, height, mapElement); + break; + case 1: + spiral_slide_paint_tile_left(rideIndex, trackSequence, direction, height, mapElement); + break; + case 2: + spiral_slide_paint_tile_right(rideIndex, trackSequence, direction, height, mapElement); + break; + case 3: + spiral_slide_paint_tile_back(rideIndex, trackSequence, direction, height, mapElement); + break; + } +} + +/** + * rct: 0x00749E6C + */ +static void spiral_slide_paint_setup_rot_3(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element *mapElement) { + switch (trackSequence) { + case 0: + spiral_slide_paint_tile_left(rideIndex, trackSequence, direction, height, mapElement); + break; + case 1: + spiral_slide_paint_tile_back(rideIndex, trackSequence, direction, height, mapElement); + break; + case 2: + spiral_slide_paint_tile_front(rideIndex, trackSequence, direction, height, mapElement); + break; + case 3: + spiral_slide_paint_tile_right(rideIndex, trackSequence, direction, height, mapElement); + break; + } +} + +/** + * rct2: 0x0074840C + */ +TRACK_PAINT_FUNCTION get_track_paint_function_spiral_slide(int trackType, int direction) { + if (trackType != 110) { + return NULL; + } + + switch (direction) { + case 0: + return spiral_slide_paint_setup_rot_0; + case 1: + return spiral_slide_paint_setup_rot_1; + case 2: + return spiral_slide_paint_setup_rot_2; + case 3: + return spiral_slide_paint_setup_rot_3; + } + + return NULL; +} + /** * * rct2: 0x00761378 diff --git a/src/ride/track_paint.h b/src/ride/track_paint.h index 410a85ce1d..2aba037c4b 100644 --- a/src/ride/track_paint.h +++ b/src/ride/track_paint.h @@ -6,6 +6,7 @@ typedef void (*TRACK_PAINT_FUNCTION)(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element* mapElement); typedef TRACK_PAINT_FUNCTION (*TRACK_PAINT_FUNCTION_GETTER)(int trackType, int direction); +TRACK_PAINT_FUNCTION get_track_paint_function_spiral_slide(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_topspin(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_shop(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_facility(int trackType, int direction); From b3f3651bd1907bcc245f7de5fc62fdd380fb4ae8 Mon Sep 17 00:00:00 2001 From: Marijn van der Werf Date: Fri, 25 Mar 2016 21:15:19 +0100 Subject: [PATCH 2/3] Compress switches --- src/ride/track_paint.c | 80 +++++++++++------------------------------- 1 file changed, 20 insertions(+), 60 deletions(-) diff --git a/src/ride/track_paint.c b/src/ride/track_paint.c index 81378a7c1e..1d8ff9d92c 100644 --- a/src/ride/track_paint.c +++ b/src/ride/track_paint.c @@ -1211,21 +1211,10 @@ static void spiral_slide_paint_tile_front(uint8 rideIndex, uint8 trackSequence, */ static void spiral_slide_paint_setup_rot_0(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element *mapElement) { switch (trackSequence) { - case 0: - spiral_slide_paint_tile_back(rideIndex, trackSequence, direction, height, mapElement); - break; - - case 1: - spiral_slide_paint_tile_right(rideIndex, trackSequence, direction, height, mapElement); - break; - - case 2: - spiral_slide_paint_tile_left(rideIndex, trackSequence, direction, height, mapElement); - break; - - case 3: - spiral_slide_paint_tile_front(rideIndex, trackSequence, direction, height, mapElement); - break; + case 0: spiral_slide_paint_tile_back(rideIndex, trackSequence, direction, height, mapElement); break; + case 1: spiral_slide_paint_tile_right(rideIndex, trackSequence, direction, height, mapElement); break; + case 2: spiral_slide_paint_tile_left(rideIndex, trackSequence, direction, height, mapElement); break; + case 3: spiral_slide_paint_tile_front(rideIndex, trackSequence, direction, height, mapElement); break; } } @@ -1233,20 +1222,11 @@ static void spiral_slide_paint_setup_rot_0(uint8 rideIndex, uint8 trackSequence, * rct: 0x00748DE4 */ static void spiral_slide_paint_setup_rot_1(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element *mapElement) { - switch (trackSequence) { - case 0: - spiral_slide_paint_tile_right(rideIndex, trackSequence, direction, height, mapElement); - break; - case 1: - spiral_slide_paint_tile_front(rideIndex, trackSequence, direction, height, mapElement); - break; - case 2: - spiral_slide_paint_tile_back(rideIndex, trackSequence, direction, height, mapElement); - break; - case 3: - spiral_slide_paint_tile_left(rideIndex, trackSequence, direction, height, mapElement); - break; + case 0: spiral_slide_paint_tile_right(rideIndex, trackSequence, direction, height, mapElement); break; + case 1: spiral_slide_paint_tile_front(rideIndex, trackSequence, direction, height, mapElement); break; + case 2: spiral_slide_paint_tile_back(rideIndex, trackSequence, direction, height, mapElement); break; + case 3: spiral_slide_paint_tile_left(rideIndex, trackSequence, direction, height, mapElement); break; } } @@ -1255,18 +1235,10 @@ static void spiral_slide_paint_setup_rot_1(uint8 rideIndex, uint8 trackSequence, */ static void spiral_slide_paint_setup_rot_2(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element *mapElement) { switch (trackSequence) { - case 0: - spiral_slide_paint_tile_front(rideIndex, trackSequence, direction, height, mapElement); - break; - case 1: - spiral_slide_paint_tile_left(rideIndex, trackSequence, direction, height, mapElement); - break; - case 2: - spiral_slide_paint_tile_right(rideIndex, trackSequence, direction, height, mapElement); - break; - case 3: - spiral_slide_paint_tile_back(rideIndex, trackSequence, direction, height, mapElement); - break; + case 0: spiral_slide_paint_tile_front(rideIndex, trackSequence, direction, height, mapElement); break; + case 1: spiral_slide_paint_tile_left(rideIndex, trackSequence, direction, height, mapElement); break; + case 2: spiral_slide_paint_tile_right(rideIndex, trackSequence, direction, height, mapElement); break; + case 3: spiral_slide_paint_tile_back(rideIndex, trackSequence, direction, height, mapElement); break; } } @@ -1275,18 +1247,10 @@ static void spiral_slide_paint_setup_rot_2(uint8 rideIndex, uint8 trackSequence, */ static void spiral_slide_paint_setup_rot_3(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element *mapElement) { switch (trackSequence) { - case 0: - spiral_slide_paint_tile_left(rideIndex, trackSequence, direction, height, mapElement); - break; - case 1: - spiral_slide_paint_tile_back(rideIndex, trackSequence, direction, height, mapElement); - break; - case 2: - spiral_slide_paint_tile_front(rideIndex, trackSequence, direction, height, mapElement); - break; - case 3: - spiral_slide_paint_tile_right(rideIndex, trackSequence, direction, height, mapElement); - break; + case 0: spiral_slide_paint_tile_left(rideIndex, trackSequence, direction, height, mapElement); break; + case 1: spiral_slide_paint_tile_back(rideIndex, trackSequence, direction, height, mapElement); break; + case 2: spiral_slide_paint_tile_front(rideIndex, trackSequence, direction, height, mapElement); break; + case 3: spiral_slide_paint_tile_right(rideIndex, trackSequence, direction, height, mapElement); break; } } @@ -1299,14 +1263,10 @@ TRACK_PAINT_FUNCTION get_track_paint_function_spiral_slide(int trackType, int di } switch (direction) { - case 0: - return spiral_slide_paint_setup_rot_0; - case 1: - return spiral_slide_paint_setup_rot_1; - case 2: - return spiral_slide_paint_setup_rot_2; - case 3: - return spiral_slide_paint_setup_rot_3; + case 0: return spiral_slide_paint_setup_rot_0; + case 1: return spiral_slide_paint_setup_rot_1; + case 2: return spiral_slide_paint_setup_rot_2; + case 3: return spiral_slide_paint_setup_rot_3; } return NULL; From d54f1f58ffdd54b72bee259898ef2b12b1d255ef Mon Sep 17 00:00:00 2001 From: Marijn van der Werf Date: Mon, 18 Apr 2016 18:23:05 +0200 Subject: [PATCH 3/3] Update to match new signature --- src/ride/track_paint.c | 144 +++++++++++++---------------------------- 1 file changed, 44 insertions(+), 100 deletions(-) diff --git a/src/ride/track_paint.c b/src/ride/track_paint.c index 1d8ff9d92c..87086b8da0 100644 --- a/src/ride/track_paint.c +++ b/src/ride/track_paint.c @@ -914,10 +914,7 @@ static void spiral_slide_paint_tile_back(uint8 rideIndex, uint8 trackSequence, u // Base image_id = ((direction & 1) ? SPIRAL_SLIDE_BASE_B : SPIRAL_SLIDE_BASE_A) | RCT2_GLOBAL(0x00F4419C, uint32); - RCT2_GLOBAL(0x009DEA52, uint16) = 0; - RCT2_GLOBAL(0x009DEA54, uint16) = 0; - RCT2_GLOBAL(0x009DEA56, uint16) = height; - sub_98197C(image_id, 0, 0, 32, 32, 1, height, get_current_rotation()); + sub_98197C(image_id, 0, 0, 32, 32, 1, height, 0, 0, height, get_current_rotation()); sint16 x = RCT2_GLOBAL(0x009DE56A, sint16), y = RCT2_GLOBAL(0x009DE56E, sint16); uint16 entranceLoc = @@ -929,10 +926,7 @@ static void spiral_slide_paint_tile_back(uint8 rideIndex, uint8 trackSequence, u if (ride->entrances[entranceId] != entranceLoc && ride->exits[entranceId] != entranceLoc) { image_id = SPIRAL_SLIDE_FENCE_TOP_LEFT | RCT2_GLOBAL(0x00F44198, uint32); - RCT2_GLOBAL(0x009DEA52, uint16) = 0; - RCT2_GLOBAL(0x009DEA54, uint16) = 2; - RCT2_GLOBAL(0x009DEA56, uint16) = height + 2; - sub_98199C(image_id, 0, 0, 32, 1, 7, height, get_current_rotation()); + sub_98199C(image_id, 0, 0, 32, 1, 7, height, 0, 2, height + 2, get_current_rotation()); } entranceLoc = @@ -941,10 +935,7 @@ static void spiral_slide_paint_tile_back(uint8 rideIndex, uint8 trackSequence, u if (ride->entrances[entranceId] != entranceLoc && ride->exits[entranceId] != entranceLoc) { image_id = SPIRAL_SLIDE_FENCE_TOP_RIGHT | RCT2_GLOBAL(0x00F44198, uint32); - RCT2_GLOBAL(0x009DEA52, uint16) = 2; - RCT2_GLOBAL(0x009DEA54, uint16) = 0; - RCT2_GLOBAL(0x009DEA56, uint16) = height + 2; - sub_98199C(image_id, 0, 0, 1, 32, 7, height, get_current_rotation()); + sub_98199C(image_id, 0, 0, 1, 32, 7, height, 2, 0, height + 2, get_current_rotation()); } RCT2_GLOBAL(0x141E9B4, uint16) = 0xFFFF; @@ -970,10 +961,7 @@ static void spiral_slide_paint_tile_right(uint8 rideIndex, uint8 trackSequence, // Base image_id = ((direction & 1) ? SPIRAL_SLIDE_BASE_B : SPIRAL_SLIDE_BASE_A) | RCT2_GLOBAL(0x00F4419C, uint32); - RCT2_GLOBAL(0x009DEA52, uint16) = 0; - RCT2_GLOBAL(0x009DEA54, uint16) = 0; - RCT2_GLOBAL(0x009DEA56, uint16) = height; - sub_98197C(image_id, 0, 0, 32, 32, 1, height, get_current_rotation()); + sub_98197C(image_id, 0, 0, 32, 32, 1, height, 0, 0, height, get_current_rotation()); sint16 x = RCT2_GLOBAL(0x009DE56A, sint16), y = RCT2_GLOBAL(0x009DE56E, sint16); uint16 entranceLoc = @@ -985,28 +973,18 @@ static void spiral_slide_paint_tile_right(uint8 rideIndex, uint8 trackSequence, if (ride->entrances[entranceId] != entranceLoc && ride->exits[entranceId] != entranceLoc) { image_id = SPIRAL_SLIDE_FENCE_TOP_RIGHT | RCT2_GLOBAL(0x00F44198, uint32); - RCT2_GLOBAL(0x009DEA52, uint16) = 2; - RCT2_GLOBAL(0x009DEA54, uint16) = 0; - RCT2_GLOBAL(0x009DEA56, uint16) = height + 2; - - sub_98199C(image_id, 0, 0, 1, 32, 7, height, 0); + sub_98199C(image_id, 0, 0, 1, 32, 7, height, 2, 0, height + 2, 0); } image_id = SPIRAL_SLIDE_FENCE_BOTTOM_RIGHT | RCT2_GLOBAL(0x00F44198, uint32); - RCT2_GLOBAL(0x009DEA52, uint16) = 0; - RCT2_GLOBAL(0x009DEA54, uint16) = 30; - RCT2_GLOBAL(0x009DEA56, uint16) = height + 2; - sub_98197C(image_id, 0, 0, 32, 1, 7, height, get_current_rotation()); //TODO 1, 32 + sub_98197C(image_id, 0, 0, 32, 1, 7, height, 0, 30, height + 2, get_current_rotation()); //TODO 1, 32 if (direction == 0) image_id = SPIRAL_SLIDE_RIGHT_R0 | RCT2_GLOBAL(0x00F44198, uint32); if (direction == 1) image_id = SPIRAL_SLIDE_RIGHT_R1 | RCT2_GLOBAL(0x00F44198, uint32); if (direction == 2) image_id = SPIRAL_SLIDE_RIGHT_R2 | RCT2_GLOBAL(0x00F44198, uint32); if (direction == 3) image_id = SPIRAL_SLIDE_RIGHT_R3 | RCT2_GLOBAL(0x00F44198, uint32); - RCT2_GLOBAL(0x009DEA52, uint16) = 16; - RCT2_GLOBAL(0x009DEA54, uint16) = 0; - RCT2_GLOBAL(0x009DEA56, uint16) = height + 3; - sub_98197C(image_id, 16, 16, 16, 16, 108, height, get_current_rotation()); + sub_98197C(image_id, 16, 16, 16, 16, 108, height, 16, 0, height + 3, get_current_rotation()); RCT2_GLOBAL(0x141E9B4, uint16) = 0xFFFF; RCT2_GLOBAL(0x141E9B8, uint16) = 0xFFFF; @@ -1031,10 +1009,7 @@ static void spiral_slide_paint_tile_left(uint8 rideIndex, uint8 trackSequence, u // Base image_id = ((direction & 1) ? SPIRAL_SLIDE_BASE_B : SPIRAL_SLIDE_BASE_A) | RCT2_GLOBAL(0x00F4419C, uint32); - RCT2_GLOBAL(0x009DEA52, uint16) = 0; - RCT2_GLOBAL(0x009DEA54, uint16) = 0; - RCT2_GLOBAL(0x009DEA56, uint16) = height; - sub_98197C(image_id, 0, 0, 32, 32, 1, height, get_current_rotation()); + sub_98197C(image_id, 0, 0, 32, 32, 1, height, 0, 0, height, get_current_rotation()); sint16 x = RCT2_GLOBAL(0x009DE56A, sint16), y = RCT2_GLOBAL(0x009DE56E, sint16); uint16 entranceLoc = @@ -1046,29 +1021,20 @@ static void spiral_slide_paint_tile_left(uint8 rideIndex, uint8 trackSequence, u if (ride->entrances[entranceId] != entranceLoc && ride->exits[entranceId] != entranceLoc) { image_id = SPIRAL_SLIDE_FENCE_TOP_LEFT | RCT2_GLOBAL(0x00F44198, uint32); - RCT2_GLOBAL(0x009DEA52, uint16) = 0; - RCT2_GLOBAL(0x009DEA54, uint16) = 2; - RCT2_GLOBAL(0x009DEA56, uint16) = height + 2; - sub_98199C(image_id, 0, 0, 32, 1, 7, height, 0); + sub_98199C(image_id, 0, 0, 32, 1, 7, height, 0, 2, height + 2, 0); } // Fence image_id = SPIRAL_SLIDE_FENCE_BOTTOM_LEFT | RCT2_GLOBAL(0x00F44198, uint32); - RCT2_GLOBAL(0x009DEA52, uint16) = 30; - RCT2_GLOBAL(0x009DEA54, uint16) = 0; - RCT2_GLOBAL(0x009DEA56, uint16) = height + 2; - sub_98197C(image_id, 0, 0, 1, 32, 7, height, get_current_rotation()); + sub_98197C(image_id, 0, 0, 1, 32, 7, height, 30, 0, height + 2, get_current_rotation()); if (direction == 0) image_id = SPIRAL_SLIDE_LEFT_R0 | RCT2_GLOBAL(0x00F44198, uint32); if (direction == 1) image_id = SPIRAL_SLIDE_LEFT_R1 | RCT2_GLOBAL(0x00F44198, uint32); if (direction == 2) image_id = SPIRAL_SLIDE_LEFT_R2 | RCT2_GLOBAL(0x00F44198, uint32); if (direction == 3) image_id = SPIRAL_SLIDE_LEFT_R3 | RCT2_GLOBAL(0x00F44198, uint32); - RCT2_GLOBAL(0x009DEA52, uint16) = 0; - RCT2_GLOBAL(0x009DEA54, uint16) = 16; - RCT2_GLOBAL(0x009DEA56, uint16) = height + 3; - sub_98197C(image_id, 16, 16, 16, 16, 108, height, get_current_rotation()); + sub_98197C(image_id, 16, 16, 16, 16, 108, height, 0, 16, height + 3, get_current_rotation()); RCT2_GLOBAL(0x141E9B4, uint16) = 0xFFFF; RCT2_GLOBAL(0x141E9B8, uint16) = 0xFFFF; @@ -1093,61 +1059,37 @@ static void spiral_slide_paint_tile_front(uint8 rideIndex, uint8 trackSequence, // Base image_id = ((direction & 1) ? SPIRAL_SLIDE_BASE_B : SPIRAL_SLIDE_BASE_A) | RCT2_GLOBAL(0x00F4419C, uint32); - RCT2_GLOBAL(0x009DEA52, uint16) = 0; - RCT2_GLOBAL(0x009DEA54, uint16) = 0; - RCT2_GLOBAL(0x009DEA56, uint16) = height; - sub_98197C(image_id, 0, 0, 32, 32, 1, height, get_current_rotation()); + sub_98197C(image_id, 0, 0, 32, 32, 1, height, 0, 0, height, get_current_rotation()); // Fence 1 image_id = SPIRAL_SLIDE_FENCE_BOTTOM_LEFT | RCT2_GLOBAL(0x00F44198, uint32); - RCT2_GLOBAL(0x009DEA52, uint16) = 30; - RCT2_GLOBAL(0x009DEA54, uint16) = 0; - RCT2_GLOBAL(0x009DEA56, uint16) = height + 2; - sub_98197C(image_id, 0, 0, 1, 32, 7, height, get_current_rotation()); + sub_98197C(image_id, 0, 0, 1, 32, 7, height, 30, 0, height + 2, get_current_rotation()); // Fence 2 image_id = SPIRAL_SLIDE_FENCE_BOTTOM_RIGHT | RCT2_GLOBAL(0x00F44198, uint32); - RCT2_GLOBAL(0x009DEA52, uint16) = 0; - RCT2_GLOBAL(0x009DEA54, uint16) = 30; - RCT2_GLOBAL(0x009DEA56, uint16) = height + 2; - sub_98197C(image_id, 0, 0, 32, 1, 7, height, get_current_rotation()); + sub_98197C(image_id, 0, 0, 32, 1, 7, height, 0, 30, height + 2, get_current_rotation()); if (direction == 1) { image_id = SPIRAL_SLIDE_INSIDE_R1 | RCT2_GLOBAL(0x00F44198, uint32); - RCT2_GLOBAL(0x009DEA52, uint16) = 0xFFF4; - RCT2_GLOBAL(0x009DEA54, uint16) = 0; - RCT2_GLOBAL(0x009DEA56, uint16) = height + 3; - sub_98197C(image_id, 16, 16, 2, 16, 108, height, get_current_rotation()); + sub_98197C(image_id, 16, 16, 2, 16, 108, height, -12, 0, height + 3, get_current_rotation()); } else if (direction == 2) { image_id = SPIRAL_SLIDE_INSIDE_R2 | RCT2_GLOBAL(0x00F44198, uint32); - RCT2_GLOBAL(0x009DEA52, uint16) = 0; - RCT2_GLOBAL(0x009DEA54, uint16) = 0xFFF4; - RCT2_GLOBAL(0x009DEA56, uint16) = height + 3; - sub_98197C(image_id, 16, 16, 16, 2, 108, height, get_current_rotation()); + sub_98197C(image_id, 16, 16, 16, 2, 108, height, 0, -12, height + 3, get_current_rotation()); } - RCT2_GLOBAL(0x009DEA56, uint16) = height + 3; if (direction == 0) { image_id = SPIRAL_SLIDE_CENTER_R0 | RCT2_GLOBAL(0x00F44198, uint32); - RCT2_GLOBAL(0x009DEA52, uint16) = 0; - RCT2_GLOBAL(0x009DEA54, uint16) = 8; - sub_98197C(image_id, 16, 16, 16, 8, 108, height, get_current_rotation()); + sub_98197C(image_id, 16, 16, 16, 8, 108, height, 0, 8, height + 3, get_current_rotation()); } else if (direction == 1) { image_id = SPIRAL_SLIDE_CENTER_R1 | RCT2_GLOBAL(0x00F44198, uint32); - RCT2_GLOBAL(0x009DEA52, uint16) = 14; - RCT2_GLOBAL(0x009DEA54, uint16) = 0; - sub_98197C(image_id, 16, 16, 2, 16, 108, height, get_current_rotation()); + sub_98197C(image_id, 16, 16, 2, 16, 108, height, 14, 0, height + 3, get_current_rotation()); } else if (direction == 2) { image_id = SPIRAL_SLIDE_CENTER_R2 | RCT2_GLOBAL(0x00F44198, uint32); - RCT2_GLOBAL(0x009DEA52, uint16) = 0; - RCT2_GLOBAL(0x009DEA54, uint16) = 14; - sub_98197C(image_id, 16, 16, 16, 2, 108, height, get_current_rotation()); + sub_98197C(image_id, 16, 16, 16, 2, 108, height, 0, 14, height + 3, get_current_rotation()); } else if (direction == 3) { image_id = SPIRAL_SLIDE_CENTER_R3 | RCT2_GLOBAL(0x00F44198, uint32); - RCT2_GLOBAL(0x009DEA52, uint16) = 8; - RCT2_GLOBAL(0x009DEA54, uint16) = 0; - sub_98197C(image_id, 16, 16, 8, 16, 108, height, get_current_rotation()); + sub_98197C(image_id, 16, 16, 8, 16, 108, height, 8, 0, height + 3, get_current_rotation()); } rct_drawpixelinfo *dpi = RCT2_GLOBAL(0x140E9A8, rct_drawpixelinfo*); @@ -1165,36 +1107,38 @@ static void spiral_slide_paint_tile_front(uint8 rideIndex, uint8 trackSequence, if (slide_progress < 46) { int offset = SPIRAL_SLIDE_PEEP + 46 * direction; - int dea52, dea54, si, di; + rct_xyz16 boundingBox = { + .z = 108 + }; + rct_xyz16 boundingBoxOffset = { + .z = height + 3 + }; + if (direction == 0) { - dea52 = 0; - dea54 = 8; - si = 8; - di = 16; + boundingBoxOffset.x = 0; + boundingBoxOffset.y = 8; + boundingBox.y = 8; + boundingBox.x = 16; } else if (direction == 1) { - dea52 = 14; - dea54 = 0; - si = 2; - di = 16; + boundingBoxOffset.x = 14; + boundingBoxOffset.y = 0; + boundingBox.y = 2; + boundingBox.x = 16; } else if (direction == 2) { - dea52 = 0; - dea54 = 14; - si = 16; - di = 2; + boundingBoxOffset.x = 0; + boundingBoxOffset.y = 14; + boundingBox.y = 16; + boundingBox.x = 2; } else if (direction == 3) { - dea52 = 8; - dea54 = 0; - si = 16; - di = 8; + boundingBoxOffset.x = 8; + boundingBoxOffset.y = 0; + boundingBox.y = 16; + boundingBox.x = 8; } image_id = (offset + slide_progress) | (ride->slide_peep_t_shirt_colour << 19) | (1 << 29); - RCT2_GLOBAL(0x009DEA52, uint16) = dea52; - RCT2_GLOBAL(0x009DEA54, uint16) = dea54; - RCT2_GLOBAL(0x009DEA56, uint16) = height + 3; - - sub_98199C(image_id, 16, 16, di, si, 108, height, get_current_rotation()); + sub_98199C(image_id, 16, 16, boundingBox.x, boundingBox.y, boundingBox.z, height, boundingBoxOffset.x, boundingBoxOffset.y, boundingBoxOffset.z, get_current_rotation()); } }