From 18a36298b497491a3ad25effa2064605e42bb9ff Mon Sep 17 00:00:00 2001 From: Marijn van der Werf Date: Sun, 17 Apr 2016 09:42:34 +0200 Subject: [PATCH] Update method signature --- src/drawing/supports.c | 8 +- src/interface/viewport.c | 195 ++++++++++++++++++++++----------------- src/interface/viewport.h | 8 +- src/ride/track_paint.c | 120 ++++++++---------------- 4 files changed, 156 insertions(+), 175 deletions(-) diff --git a/src/drawing/supports.c b/src/drawing/supports.c index 8507fc4c96..8f75f3f3f0 100644 --- a/src/drawing/supports.c +++ b/src/drawing/supports.c @@ -200,9 +200,9 @@ bool wooden_a_supports_paint_setup(int supportType, int special, int height, uin } else { imageId += word_97B3C4[slope & 0x1F]; imageId |= imageColourFlags; - sub_98197C(imageId, 0, 0, 32, 32, 11, z, rotation, 0, 0, z + 2); + sub_98197C(imageId, 0, 0, 32, 32, 11, z, 0, 0, z + 2, rotation); - sub_98197C(imageId + 4, 0, 0, 32, 32, 11, z + 16, rotation, 0, 0, z + 16 + 2); + sub_98197C(imageId + 4, 0, 0, 32, 32, 11, z + 16, 0, 0, z + 16 + 2, rotation); hasSupports = true; } @@ -278,11 +278,11 @@ bool wooden_a_supports_paint_setup(int supportType, int special, int height, uin uint16 lengthX = byte_97B23C[special].var_4; uint8 ah = byte_97B23C[special].var_5; if (byte_97B23C[special].var_6 == 0 || RCT2_GLOBAL(0x009DEA58, uint32) == 0) { - sub_98197C(imageId, 0, 0, lengthX, lengthY, ah, z, rotation, word_9DEA52, word_9DEA54, word_9DEA56); + sub_98197C(imageId, 0, 0, lengthX, lengthY, ah, z, word_9DEA52, word_9DEA54, word_9DEA56, rotation); hasSupports = true; } else { hasSupports = true; - if (!sub_98198C(imageId, 0, 0, lengthX, lengthY, ah, z, rotation, word_9DEA52, word_9DEA54, word_9DEA56)) { + if (!sub_98198C(imageId, 0, 0, lengthX, lengthY, ah, z, word_9DEA52, word_9DEA54, word_9DEA56, rotation)) { int edi = RCT2_GLOBAL(0x009DEA58, uint32); RCT2_GLOBAL(edi + 0x20, uint32) = imageColourFlags; } diff --git a/src/interface/viewport.c b/src/interface/viewport.c index 3665855878..03e82c7aa4 100644 --- a/src/interface/viewport.c +++ b/src/interface/viewport.c @@ -863,28 +863,35 @@ void sub_688485(){ * @param image_id (ebx) * @param x_offset (al) * @param y_offset (cl) - * @param length_x (di) - * @param length_y (si) - * @param z_offset (ah) - * @param height (edx) - * @param rotation - * @param word_52 (0x009DEA52) - * @param word_54 (0x009DEA54) - * @param word_56 (0x009DEA56) + * @param bound_box_length_x (di) + * @param bound_box_length_y (si) + * @param bound_box_length_z (ah) + * @param z_offset (edx) + * @param bound_box_offset_x (0x009DEA52) + * @param bound_box_offset_y (0x009DEA54) + * @param bound_box_offset_z (0x009DEA56) + * @param rotation (ebp) * @return ?? */ -int sub_98199C(int image_id, sint8 x_offset, sint8 y_offset, sint16 length_x, sint16 length_y, sint8 z_offset, int height, uint32 rotation, uint16 word_52, uint16 word_54, uint16 word_56) { - RCT2_GLOBAL(0x009DEA52, uint16) = word_52; - RCT2_GLOBAL(0x009DEA54, uint16) = word_54; - RCT2_GLOBAL(0x009DEA56, uint16) = word_56; +int sub_98199C( + int image_id, + sint8 x_offset, sint8 y_offset, + sint16 bound_box_length_x, sint16 bound_box_length_y, sint8 bound_box_length_z, + int z_offset, + uint16 bound_box_offset_x, uint16 bound_box_offset_y, uint16 bound_box_offset_z, + uint32 rotation +) { + RCT2_GLOBAL(0x009DEA52, uint16) = bound_box_offset_x; + RCT2_GLOBAL(0x009DEA54, uint16) = bound_box_offset_y; + RCT2_GLOBAL(0x009DEA56, uint16) = bound_box_offset_z; RCT2_CALLPROC_X(RCT2_ADDRESS(0x98199C, uint32_t)[get_current_rotation()], - x_offset | (z_offset << 8), + x_offset | (bound_box_length_z << 8), image_id, y_offset, - height, - length_y, - length_x, + z_offset, + bound_box_length_y, + bound_box_length_x, rotation); return 1; } @@ -895,22 +902,27 @@ int sub_98199C(int image_id, sint8 x_offset, sint8 y_offset, sint16 length_x, si * @param image_id (ebx) * @param x_offset (al) * @param y_offset (cl) - * @param length_x (di) - * @param length_y (si) - * @param z_offset (ah) - * @param height (edx) - * @param rotation + * @param bound_box_length_x (di) + * @param bound_box_length_y (si) + * @param bound_box_length_z (ah) + * @param z_offset (edx) + * @param rotation (ebp) * @return ?? */ -int sub_98196C(int image_id, sint8 x_offset, sint8 y_offset, sint16 length_x, sint16 length_y, sint8 z_offset, int height, uint32 rotation) -{ +int sub_98196C( + int image_id, + sint8 x_offset, sint8 y_offset, + sint16 bound_box_length_x, sint16 bound_box_length_y, sint8 bound_box_length_z, + int z_offset, + uint32 rotation +) { RCT2_CALLPROC_X(RCT2_ADDRESS(0x0098196C, uint32)[get_current_rotation()], - x_offset | (z_offset << 8), + x_offset | (bound_box_length_z << 8), image_id, y_offset, - height, - length_y, - length_x, + z_offset, + bound_box_length_y, + bound_box_length_x, rotation ); return 1; @@ -922,17 +934,24 @@ int sub_98196C(int image_id, sint8 x_offset, sint8 y_offset, sint16 length_x, si * @param image_id (ebx) * @param x_offset (al) * @param y_offset (cl) - * @param length_x (di) - * @param length_y (si) - * @param z_offset (ah) - * @param height (edx) - * @param rotation - * @param word_52 (0x009DEA52) - * @param word_54 (0x009DEA54) - * @param word_56 (0x009DEA56) + * @param bound_box_length_x (di) + * @param bound_box_length_y (si) + * @param bound_box_length_z (ah) + * @param z_offset (edx) + * @param bound_box_offset_x (0x009DEA52) + * @param bound_box_offset_y (0x009DEA54) + * @param bound_box_offset_z (0x009DEA56) + * @param rotation (ebp) */ -int sub_98197C(int image_id, sint8 x_offset, sint8 y_offset, sint16 length_x, sint16 length_y, sint8 z_offset, int height, uint32 rotation, sint16 s_unk_x, sint16 s_unk_y, sint16 word_56) { - int ebp = z_offset + word_56; +int sub_98197C( + int image_id, + sint8 x_offset, sint8 y_offset, + sint16 bound_box_length_x, sint16 bound_box_length_y, sint8 bound_box_length_z, + int z_offset, + sint16 bound_box_offset_x, sint16 bound_box_offset_y, sint16 bound_box_offset_z, + uint32 rotation +) { + int ebp = bound_box_length_z + bound_box_offset_z; RCT2_GLOBAL(0xF1AD28, paint_struct*) = 0; RCT2_GLOBAL(0xF1AD2C, uint32) = 0; @@ -950,7 +969,7 @@ int sub_98197C(int image_id, sint8 x_offset, sint8 y_offset, sint16 length_x, si rct_xyz16 coord_3d = { .x = x_offset, .y = y_offset, - .z = height + .z = z_offset }; switch (rotation) { @@ -992,13 +1011,13 @@ int sub_98197C(int image_id, sint8 x_offset, sint8 y_offset, sint16 length_x, si if (bottom > dpi->y + dpi->height)return 1; rct_xy16 boundBox = { - .x = length_x, - .y = length_y + .x = bound_box_length_x, + .y = bound_box_length_y }; - rct_xy16 s_unk = { - .x = s_unk_x, - .y = s_unk_y + rct_xy16 boundBoxOffset = { + .x = bound_box_offset_x, + .y = bound_box_offset_y }; // Unsure why rots 1 and 3 need to swap @@ -1006,32 +1025,32 @@ int sub_98197C(int image_id, sint8 x_offset, sint8 y_offset, sint16 length_x, si case 0: boundBox.x--; boundBox.y--; - rotate_map_coordinates(&s_unk.x, &s_unk.y, 0); + rotate_map_coordinates(&boundBoxOffset.x, &boundBoxOffset.y, 0); rotate_map_coordinates(&boundBox.x, &boundBox.y, 0); break; case 1: boundBox.x--; - rotate_map_coordinates(&s_unk.x, &s_unk.y, 3); + rotate_map_coordinates(&boundBoxOffset.x, &boundBoxOffset.y, 3); rotate_map_coordinates(&boundBox.x, &boundBox.y, 3); break; case 2: rotate_map_coordinates(&boundBox.x, &boundBox.y, 2); - rotate_map_coordinates(&s_unk.x, &s_unk.y, 2); + rotate_map_coordinates(&boundBoxOffset.x, &boundBoxOffset.y, 2); break; case 3: boundBox.y--; rotate_map_coordinates(&boundBox.x, &boundBox.y, 1); - rotate_map_coordinates(&s_unk.x, &s_unk.y, 1); + rotate_map_coordinates(&boundBoxOffset.x, &boundBoxOffset.y, 1); break; } - ps->other_x = boundBox.x + s_unk.x + RCT2_GLOBAL(0x9DE568, sint16); - ps->some_x = word_56; + ps->other_x = boundBox.x + boundBoxOffset.x + RCT2_GLOBAL(0x9DE568, sint16); + ps->some_x = bound_box_offset_z; ps->some_y = ebp; - ps->other_y = boundBox.y + s_unk.y + RCT2_GLOBAL(0x009DE56C, sint16); + ps->other_y = boundBox.y + boundBoxOffset.y + RCT2_GLOBAL(0x009DE56C, sint16); ps->var_1A = 0; - ps->attached_x = s_unk.x + RCT2_GLOBAL(0x9DE568, sint16); - ps->attached_y = s_unk.y + RCT2_GLOBAL(0x009DE56C, sint16); + ps->attached_x = boundBoxOffset.x + RCT2_GLOBAL(0x9DE568, sint16); + ps->attached_y = boundBoxOffset.y + RCT2_GLOBAL(0x009DE56C, sint16); ps->attached_ps = NULL; ps->var_20 = NULL; ps->sprite_type = RCT2_GLOBAL(RCT2_ADDRESS_PAINT_SETUP_CURRENT_TYPE, uint8); @@ -1093,29 +1112,35 @@ int sub_98197C(int image_id, sint8 x_offset, sint8 y_offset, sint16 length_x, si * @param image_id (ebx) * @param x_offset (al) * @param y_offset (cl) - * @param length_x (di) - * @param length_y (si) - * @param z_offset (ah) - * @param height (edx) + * @param bound_box_length_x (di) + * @param bound_box_length_y (si) + * @param bound_box_length_z (ah) + * @param z_offset (edx) + * @param bound_box_offset_x (0x009DEA52) + * @param bound_box_offset_y (0x009DEA54) + * @param bound_box_offset_z (0x009DEA56) * @param rotation - * @param word_52 (0x009DEA52) - * @param word_54 (0x009DEA54) - * @param word_56 (0x009DEA56) * @return ?? */ -int sub_98198C(int image_id, sint8 x_offset, sint8 y_offset, sint16 length_x, sint16 length_y, sint8 z_offset, int height, uint32 rotation, uint16 word_52, uint16 word_54, uint16 word_56) -{ - RCT2_GLOBAL(0x009DEA52, uint16) = word_52; - RCT2_GLOBAL(0x009DEA54, uint16) = word_54; - RCT2_GLOBAL(0x009DEA56, uint16) = word_56; +int sub_98198C( + int image_id, + sint8 x_offset, sint8 y_offset, + sint16 bound_box_length_x, sint16 bound_box_length_y, sint8 bound_box_length_z, + int z_offset, + uint16 bound_box_offset_x, uint16 bound_box_offset_y, uint16 bound_box_offset_z, + uint32 rotation +) { + RCT2_GLOBAL(0x009DEA52, uint16) = bound_box_offset_x; + RCT2_GLOBAL(0x009DEA54, uint16) = bound_box_offset_y; + RCT2_GLOBAL(0x009DEA56, uint16) = bound_box_offset_z; RCT2_CALLPROC_X(RCT2_ADDRESS(0x0098198C, uint32)[get_current_rotation()], - x_offset | (z_offset << 8), + x_offset | (bound_box_length_z << 8), image_id, y_offset, - height, - length_y, - length_x, + z_offset, + bound_box_length_y, + bound_box_length_x, rotation ); return 1; @@ -1136,7 +1161,7 @@ void viewport_vehicle_paint_setup(rct_vehicle *vehicle, int imageDirection) if (vehicle->flags & SPRITE_FLAGS_IS_CRASHED_VEHICLE_SPRITE) { uint32 ebx = 22965 + vehicle->var_C5; - sub_98197C(ebx, 0, 0, 1, 1, 0, z, get_current_rotation(), 0, 0, z + 2); + sub_98197C(ebx, 0, 0, 1, 1, 0, z, 0, 0, z + 2, get_current_rotation()); return; } @@ -1211,7 +1236,7 @@ void viewport_litter_paint_setup(rct_litter *litter, int imageDirection) uint32 image_id = imageDirection + RCT2_ADDRESS(0x97EF6C, uint32)[litter->type * 2]; - sub_98197C(image_id, 0, 0, 4, 4, 0xFF, litter->z, get_current_rotation(), 0xFFFC, 0xFFFC, litter->z + 2); + sub_98197C(image_id, 0, 0, 4, 4, 0xFF, litter->z, 0xFFFC, 0xFFFC, litter->z + 2, get_current_rotation()); } @@ -1334,7 +1359,7 @@ void viewport_ride_entrance_exit_paint_setup(uint8 direction, int height, rct_ma sint16 lengthY = (direction & 1) ? 28 : 2; sint16 lengthX = (direction & 1) ? 2 : 28; - sub_98197C(image_id, 0, 0, lengthX, lengthY, ah, height, get_current_rotation(), 2, 2, height); + sub_98197C(image_id, 0, 0, lengthX, lengthY, ah, height, 2, 2, height, get_current_rotation()); if (transparant_image_id){ if (is_exit){ @@ -1344,16 +1369,16 @@ void viewport_ride_entrance_exit_paint_setup(uint8 direction, int height, rct_ma transparant_image_id |= style->sprite_index + direction + 16; } - sub_98199C(transparant_image_id, 0, 0, lengthX, lengthY, ah, height, 0, 2, 2, height); + sub_98199C(transparant_image_id, 0, 0, lengthX, lengthY, ah, height, 2, 2, height, 0); } image_id += 4; - sub_98197C(image_id, 0, 0, lengthX, lengthY, ah, height, get_current_rotation(), (direction & 1) ? 28 : 2, (direction & 1) ? 2 : 28, height); + sub_98197C(image_id, 0, 0, lengthX, lengthY, ah, height, (direction & 1) ? 28 : 2, (direction & 1) ? 2 : 28, height, get_current_rotation()); if (transparant_image_id){ transparant_image_id += 4; - sub_98199C(transparant_image_id, 0, 0, lengthX, lengthY, ah, height, 0, (direction & 1) ? 28 : 2, (direction & 1) ? 2 : 28, height); + sub_98199C(transparant_image_id, 0, 0, lengthX, lengthY, ah, height, (direction & 1) ? 28 : 2, (direction & 1) ? 2 : 28, height, 0); } uint32 eax = 0xFFFF0600 | ((height / 16) & 0xFF); @@ -1396,7 +1421,7 @@ void viewport_ride_entrance_exit_paint_setup(uint8 direction, int height, rct_ma uint16 string_width = gfx_get_string_width(entrance_string); uint16 scroll = (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_TICKS, uint32) / 2) % string_width; - sub_98199C(scrolling_text_setup(string_id, scroll, style->scrolling_mode), 0, 0, 0x1C, 0x1C, 0x33, height + style->height, 0, 2, 2, height + style->height); + sub_98199C(scrolling_text_setup(string_id, scroll, style->scrolling_mode), 0, 0, 0x1C, 0x1C, 0x33, height + style->height, 2, 2, height + style->height, 0); } image_id = RCT2_GLOBAL(0x009E32BC, uint32); @@ -1450,11 +1475,11 @@ void viewport_park_entrance_paint_setup(uint8 direction, int height, rct_map_ele switch (part_index){ case 0: image_id = (path_entry->image + 5 * (1 + (direction & 1))) | ghost_id; - sub_98197C(image_id, 0, 0, 32, 0x1C, 0, height, get_current_rotation(), 0, 2, height); + sub_98197C(image_id, 0, 0, 32, 0x1C, 0, height, 0, 2, height, get_current_rotation()); entrance = (rct_entrance_type*)object_entry_groups[OBJECT_TYPE_PARK_ENTRANCE].chunks[0]; image_id = (entrance->image_id + direction * 3) | ghost_id; - sub_98197C(image_id, 0, 0, 0x1C, 0x1C, 0x2F, height, get_current_rotation(), 2, 2, height + 32); + sub_98197C(image_id, 0, 0, 0x1C, 0x1C, 0x2F, height, 2, 2, height + 32, get_current_rotation()); if ((direction + 1) & (1 << 1)) break; @@ -1486,13 +1511,13 @@ void viewport_park_entrance_paint_setup(uint8 direction, int height, rct_map_ele if (entrance->scrolling_mode == 0xFF) break; - sub_98199C(scrolling_text_setup(park_text_id, scroll, entrance->scrolling_mode + direction / 2), 0, 0, 0x1C, 0x1C, 0x2F, height + entrance->text_height, 0, 2, 2, height + entrance->text_height); + sub_98199C(scrolling_text_setup(park_text_id, scroll, entrance->scrolling_mode + direction / 2), 0, 0, 0x1C, 0x1C, 0x2F, height + entrance->text_height, 2, 2, height + entrance->text_height, 0); break; case 1: case 2: entrance = (rct_entrance_type*)object_entry_groups[OBJECT_TYPE_PARK_ENTRANCE].chunks[0]; image_id = (entrance->image_id + part_index + direction * 3) | ghost_id; - sub_98197C(image_id, 0, 0, 0x1A, di, 0x4F, height, get_current_rotation(), 3, 3, height); + sub_98197C(image_id, 0, 0, 0x1A, di, 0x4F, height, 3, 3, height, get_current_rotation()); break; } @@ -1555,7 +1580,7 @@ void viewport_track_paint_setup(uint8 direction, int height, rct_map_element *ma uint32 ebx = 0x20381689 + (height + 8) / 16; ebx += RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_HEIGHT_MARKERS, uint16); ebx -= RCT2_GLOBAL(0x01359208, uint16); - sub_98197C(ebx, 16, 16, 1, 1, 0, height + ax + 3, get_current_rotation(), 1000, 1000, 2047); + sub_98197C(ebx, 16, 16, 1, 1, 0, height + ax + 3, 1000, 1000, 2047, get_current_rotation()); } } @@ -1634,7 +1659,7 @@ void viewport_entrance_paint_setup(uint8 direction, int height, rct_map_element* image_id -= RCT2_GLOBAL(0x01359208, sint16); - sub_98197C(image_id, 16, 16, 1, 1, 0, height, get_current_rotation(), 31, 31, z + 64); + sub_98197C(image_id, 16, 16, 1, 1, 0, height, 31, 31, z + 64, get_current_rotation()); } } @@ -1687,12 +1712,12 @@ void viewport_banner_paint_setup(uint8 direction, int height, rct_map_element* m 0x20000000; } - sub_98197C(image_id, 0, 0, 1, 1, 0x15, height, get_current_rotation(), word_9DEA52, word_9DEA54, word_9DEA56); + sub_98197C(image_id, 0, 0, 1, 1, 0x15, height, word_9DEA52, word_9DEA54, word_9DEA56, get_current_rotation()); word_9DEA52 = RCT2_ADDRESS(0x98D888, uint16)[direction * 2]; word_9DEA54 = RCT2_ADDRESS(0x98D888 + 2, uint16)[direction * 2]; image_id++; - sub_98197C(image_id, 0, 0, 1, 1, 0x15, height, get_current_rotation(), word_9DEA52, word_9DEA54, word_9DEA56); + sub_98197C(image_id, 0, 0, 1, 1, 0x15, height, word_9DEA52, word_9DEA54, word_9DEA56, get_current_rotation()); // Opposite direction direction ^= 2; @@ -1723,7 +1748,7 @@ void viewport_banner_paint_setup(uint8 direction, int height, rct_map_element* m uint16 string_width = gfx_get_string_width(RCT2_ADDRESS(RCT2_ADDRESS_COMMON_STRING_FORMAT_BUFFER, char)); uint16 scroll = (RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_TICKS, uint32) / 2) % string_width; - sub_98199C(scrolling_text_setup(string_id, scroll, scrollingMode), 0, 0, 1, 1, 0x15, height + 22, 0, word_9DEA52, word_9DEA54, word_9DEA56); + sub_98199C(scrolling_text_setup(string_id, scroll, scrollingMode), 0, 0, 1, 1, 0x15, height + 22, word_9DEA52, word_9DEA54, word_9DEA56, 0); } /** @@ -1784,7 +1809,7 @@ static void sub_68B3FB(int x, int y) RCT2_GLOBAL(0x9DE56C, sint16) = y; RCT2_GLOBAL(RCT2_ADDRESS_PAINT_SETUP_CURRENT_TYPE, uint8) = VIEWPORT_INTERACTION_ITEM_NONE; - sub_98197C(imageId, 0, 0, 32, 32, 0xFF, arrowZ, rotation, 0, 0, arrowZ + 18); + sub_98197C(imageId, 0, 0, 32, 32, 0xFF, arrowZ, 0, 0, arrowZ + 18, rotation); } int bx = dx + 52; diff --git a/src/interface/viewport.h b/src/interface/viewport.h index d2cccd0477..ce9321cb36 100644 --- a/src/interface/viewport.h +++ b/src/interface/viewport.h @@ -131,10 +131,10 @@ void painter_setup(); void sub_688485(); void sub_688217(); -int sub_98196C(int image_id, sint8 x_offset, sint8 y_offset, sint16 length_x, sint16 length_y, sint8 z_offset, int height, uint32 rotation); -int sub_98197C(int image_id, sint8 x_offset, sint8 y_offset, sint16 length_x, sint16 length_y, sint8 z_offset, int height, uint32 rotation, sint16 s_unk_x, sint16 s_unk_y, sint16 word_56); -int sub_98198C(int image_id, sint8 x_offset, sint8 y_offset, sint16 length_x, sint16 length_y, sint8 z_offset, int height, uint32 rotation, uint16 word_52, uint16 word_54, uint16 word_56); -int sub_98199C(int image_id, sint8 x_offset, sint8 y_offset, sint16 length_x, sint16 length_y, sint8 z_offset, int height, uint32 rotation, uint16 word_52, uint16 word_54, uint16 word_56); +int sub_98196C(int image_id, sint8 x_offset, sint8 y_offset, sint16 bound_box_length_x, sint16 bound_box_length_y, sint8 bound_box_length_z, int z_offset, uint32 rotation); +int sub_98197C(int image_id, sint8 x_offset, sint8 y_offset, sint16 bound_box_length_x, sint16 bound_box_length_y, sint8 bound_box_length_z, int z_offset, sint16 bound_box_offset_x, sint16 bound_box_offset_y, sint16 bound_box_offset_z, uint32 rotation); +int sub_98198C(int image_id, sint8 x_offset, sint8 y_offset, sint16 bound_box_length_x, sint16 bound_box_length_y, sint8 bound_box_length_z, int z_offset, uint16 bound_box_offset_x, uint16 bound_box_offset_y, uint16 bound_box_offset_z, uint32 rotation); +int sub_98199C(int image_id, sint8 x_offset, sint8 y_offset, sint16 bound_box_length_x, sint16 bound_box_length_y, sint8 bound_box_length_z, int z_offset, uint16 bound_box_offset_x, uint16 bound_box_offset_y, uint16 bound_box_offset_z, uint32 rotation); void viewport_invalidate(rct_viewport *viewport, int left, int top, int right, int bottom); diff --git a/src/ride/track_paint.c b/src/ride/track_paint.c index e88e957b76..bf1c4614e5 100644 --- a/src/ride/track_paint.c +++ b/src/ride/track_paint.c @@ -41,7 +41,7 @@ static void top_spin_paint_tile_0(uint8 rideIndex, uint8 trackSequence, uint8 di wooden_a_supports_paint_setup(direction & 1, 0, height, image_id, NULL); image_id = 22137 | RCT2_GLOBAL(0x00F44198, uint32); - sub_98197C(image_id, 0, 0, 32, 32, 1, height, get_current_rotation(), 0, 0, height); + sub_98197C(image_id, 0, 0, 32, 32, 1, height, 0, 0, height, get_current_rotation()); RCT2_GLOBAL(0x141E9B4, uint16) = 0xFFFF; RCT2_GLOBAL(0x141E9B8, uint16) = 0xFFFF; @@ -140,7 +140,7 @@ static void top_spin_paint_vehicle(sint8 al, sint8 cl, uint8 rideIndex, uint8 di image_id += rideEntry->vehicles[0].base_image_id; // Left back bottom support image_id += 572; - sub_98197C(image_id, al, cl, lengthX, lengthY, 90, height, get_current_rotation(), word_9DEA52, word_9DEA54, word_9DEA56); + sub_98197C(image_id, al, cl, lengthX, lengthY, 90, height, word_9DEA52, word_9DEA54, word_9DEA56, get_current_rotation()); image_id = RCT2_GLOBAL(0x00F441A0, uint32); if (image_id == 0x20000000) { @@ -162,18 +162,7 @@ static void top_spin_paint_vehicle(sint8 al, sint8 cl, uint8 rideIndex, uint8 di // Left hand arm image_id += 380; - sub_98199C( - image_id, - al, - cl, - lengthX, - lengthY, - 90, - height, - 0, - word_9DEA52, - word_9DEA54, - word_9DEA56); + sub_98199C(image_id, al, cl, lengthX, lengthY, 90, height, word_9DEA52, word_9DEA54, word_9DEA56, 0); uint32 seatImageId; @@ -229,18 +218,7 @@ static void top_spin_paint_vehicle(sint8 al, sint8 cl, uint8 rideIndex, uint8 di RCT2_GLOBAL(0x014280B9, sint8) = (sint8)seatCoords.y; RCT2_GLOBAL(0x014280BA, sint16) = seatCoords.z; - sub_98199C( - image_id, - (sint8)seatCoords.x, - (sint8)seatCoords.y, - lengthX, - lengthY, - 90, - seatCoords.z, - 0, - word_9DEA52, - word_9DEA54, - word_9DEA56); + sub_98199C(image_id, (sint8) seatCoords.x, (sint8) seatCoords.y, lengthX, lengthY, 90, seatCoords.z, word_9DEA52, word_9DEA54, word_9DEA56, 0); rct_drawpixelinfo* dpi = RCT2_GLOBAL(0x140E9A8, rct_drawpixelinfo*); if (dpi->zoom_level < 2 && vehicle != NULL && vehicle->num_peeps != 0) { @@ -251,7 +229,7 @@ static void top_spin_paint_vehicle(sint8 al, sint8 cl, uint8 rideIndex, uint8 di image_id += 0xA0000000; image_id += 76; - sub_98199C(image_id, (sint8) seatCoords.x, (sint8) seatCoords.y, lengthX, lengthY, 90, seatCoords.z, 0, word_9DEA52, word_9DEA54, word_9DEA56); + sub_98199C(image_id, (sint8) seatCoords.x, (sint8) seatCoords.y, lengthX, lengthY, 90, seatCoords.z, word_9DEA52, word_9DEA54, word_9DEA56, 0); if (vehicle->num_peeps > 2) { image_id = @@ -261,7 +239,7 @@ static void top_spin_paint_vehicle(sint8 al, sint8 cl, uint8 rideIndex, uint8 di image_id += 0xA0000000; image_id += 152; - sub_98199C(image_id, (sint8) seatCoords.x, (sint8) seatCoords.y, lengthX, lengthY, 90, seatCoords.z, 0, word_9DEA52, word_9DEA54, word_9DEA56); + sub_98199C(image_id, (sint8) seatCoords.x, (sint8) seatCoords.y, lengthX, lengthY, 90, seatCoords.z, word_9DEA52, word_9DEA54, word_9DEA56, 0); } if (vehicle->num_peeps > 4) { @@ -272,7 +250,7 @@ static void top_spin_paint_vehicle(sint8 al, sint8 cl, uint8 rideIndex, uint8 di image_id += 0xA0000000; image_id += 228; - sub_98199C(image_id, (sint8) seatCoords.x, (sint8) seatCoords.y, lengthX, lengthY, 90, seatCoords.z, 0, word_9DEA52, word_9DEA54, word_9DEA56); + sub_98199C(image_id, (sint8) seatCoords.x, (sint8) seatCoords.y, lengthX, lengthY, 90, seatCoords.z, word_9DEA52, word_9DEA54, word_9DEA56, 0); } if (vehicle->num_peeps > 6) { @@ -283,7 +261,7 @@ static void top_spin_paint_vehicle(sint8 al, sint8 cl, uint8 rideIndex, uint8 di image_id += 0xA0000000; image_id += 304; - sub_98199C(image_id, (sint8) seatCoords.x, (sint8) seatCoords.y, lengthX, lengthY, 90, seatCoords.z, 0, word_9DEA52, word_9DEA54, word_9DEA56); + sub_98199C(image_id, (sint8) seatCoords.x, (sint8) seatCoords.y, lengthX, lengthY, 90, seatCoords.z, word_9DEA52, word_9DEA54, word_9DEA56, 0); } } @@ -301,18 +279,7 @@ static void top_spin_paint_vehicle(sint8 al, sint8 cl, uint8 rideIndex, uint8 di // Right hand arm image_id += 476; - sub_98199C( - image_id, - al, - cl, - lengthX, - lengthY, - 90, - height, - 0, - word_9DEA52, - word_9DEA54, - word_9DEA56); + sub_98199C(image_id, al, cl, lengthX, lengthY, 90, height, word_9DEA52, word_9DEA54, word_9DEA56, 0); image_id = RCT2_GLOBAL(0x00F441A0, uint32); if (image_id == 0x20000000) { @@ -327,18 +294,7 @@ static void top_spin_paint_vehicle(sint8 al, sint8 cl, uint8 rideIndex, uint8 di // Right back bottom support image_id += 573; - sub_98199C( - image_id, - al, - cl, - lengthX, - lengthY, - 90, - height, - 0, - word_9DEA52, - word_9DEA54, - word_9DEA56); + sub_98199C(image_id, al, cl, lengthX, lengthY, 90, height, word_9DEA52, word_9DEA54, word_9DEA56, 0); RCT2_GLOBAL(0x009DE578, rct_map_element*) = curMapElement; RCT2_GLOBAL(RCT2_ADDRESS_PAINT_SETUP_CURRENT_TYPE, uint8) = VIEWPORT_INTERACTION_ITEM_RIDE; @@ -353,7 +309,7 @@ static void top_spin_paint_tile_1(uint8 rideIndex, uint8 trackSequence, uint8 di wooden_a_supports_paint_setup(direction & 1, 0, height, image_id, NULL); image_id = 22137 | RCT2_GLOBAL(0x00F44198, uint32); - sub_98197C(image_id, 0, 0, 32, 32, 1, height, get_current_rotation(), 0, 0, height); + 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 = @@ -365,7 +321,7 @@ static void top_spin_paint_tile_1(uint8 rideIndex, uint8 trackSequence, uint8 di if (ride->entrances[entranceId] != entranceLoc && ride->exits[entranceId] != entranceLoc) { image_id = 22141 | RCT2_GLOBAL(0x00F441A0, uint32); - sub_98199C(image_id, 0, 0, 32, 1, 7, height, 0, 0, 2, height + 2); + sub_98199C(image_id, 0, 0, 32, 1, 7, height, 0, 2, height + 2, 0); } entranceLoc = @@ -374,7 +330,7 @@ static void top_spin_paint_tile_1(uint8 rideIndex, uint8 trackSequence, uint8 di if (ride->entrances[entranceId] != entranceLoc && ride->exits[entranceId] != entranceLoc) { image_id = 22138 | RCT2_GLOBAL(0x00F441A0, uint32); - sub_98199C(image_id, 0, 0, 1, 32, 7, height, 0, 0, 2, height + 2); + sub_98199C(image_id, 0, 0, 1, 32, 7, height, 0, 2, height + 2, 0); } top_spin_paint_vehicle(32, 32, rideIndex, direction, height, mapElement); @@ -408,7 +364,7 @@ static void top_spin_paint_tile_2(uint8 rideIndex, uint8 trackSequence, uint8 di wooden_a_supports_paint_setup(direction & 1, 0, height, image_id, NULL); image_id = 22137 | RCT2_GLOBAL(0x00F44198, uint32); - sub_98197C(image_id, 0, 0, 32, 32, 1, height, get_current_rotation(), 0, 0, height); + 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 = @@ -420,7 +376,7 @@ static void top_spin_paint_tile_2(uint8 rideIndex, uint8 trackSequence, uint8 di if (ride->entrances[entranceId] != entranceLoc && ride->exits[entranceId] != entranceLoc) { image_id = 22138 | RCT2_GLOBAL(0x00F441A0, uint32); - sub_98199C(image_id, 0, 0, 1, 32, 7, height, 0, 2, 0, height + 2); + sub_98199C(image_id, 0, 0, 1, 32, 7, height, 2, 0, height + 2, 0); } RCT2_GLOBAL(0x141E9B4, uint16) = 0xFFFF; @@ -449,7 +405,7 @@ static void top_spin_paint_tile_4(uint8 rideIndex, uint8 trackSequence, uint8 di wooden_a_supports_paint_setup(direction & 1, 0, height, image_id, NULL); image_id = 22137 | RCT2_GLOBAL(0x00F44198, uint32); - sub_98197C(image_id, 0, 0, 32, 32, 1, height, get_current_rotation(), 0, 0, height); + 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 = @@ -461,7 +417,7 @@ static void top_spin_paint_tile_4(uint8 rideIndex, uint8 trackSequence, uint8 di if (ride->entrances[entranceId] != entranceLoc && ride->exits[entranceId] != entranceLoc) { image_id = 22141 | RCT2_GLOBAL(0x00F441A0, uint32); - sub_98199C(image_id, 0, 0, 32, 1, 7, height, 0, 0, 2, height + 2); + sub_98199C(image_id, 0, 0, 32, 1, 7, height, 0, 2, height + 2, 0); } RCT2_GLOBAL(0x141E9B4, uint16) = 0xFFFF; @@ -490,7 +446,7 @@ static void top_spin_paint_tile_3(uint8 rideIndex, uint8 trackSequence, uint8 di wooden_a_supports_paint_setup(direction & 1, 0, height, image_id, NULL); image_id = 22136 | RCT2_GLOBAL(0x00F44198, uint32); - sub_98197C(image_id, 0, 0, 32, 32, 1, height, get_current_rotation(), 0, 0, height); + 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 = @@ -502,7 +458,7 @@ static void top_spin_paint_tile_3(uint8 rideIndex, uint8 trackSequence, uint8 di if (ride->entrances[entranceId] != entranceLoc && ride->exits[entranceId] != entranceLoc) { image_id = 22138 | RCT2_GLOBAL(0x00F441A0, uint32); - sub_98199C(image_id, 0, 0, 1, 32, 7, height, 0, 2, 0, height + 2); + sub_98199C(image_id, 0, 0, 1, 32, 7, height, 2, 0, height + 2, 0); } entranceLoc = @@ -512,7 +468,7 @@ static void top_spin_paint_tile_3(uint8 rideIndex, uint8 trackSequence, uint8 di if (ride->entrances[entranceId] != entranceLoc && ride->exits[entranceId] != entranceLoc) { image_id = 22139 | RCT2_GLOBAL(0x00F441A0, uint32); - sub_98197C(image_id, 0, 0, 32, 1, 7, height, get_current_rotation(), 0, 30, height + 2); + sub_98197C(image_id, 0, 0, 32, 1, 7, height, 0, 30, height + 2, get_current_rotation()); } top_spin_paint_vehicle(32, -32, rideIndex, direction, height, mapElement); @@ -546,7 +502,7 @@ static void top_spin_paint_tile_5(uint8 rideIndex, uint8 trackSequence, uint8 di wooden_a_supports_paint_setup(direction & 1, 0, height, image_id, NULL); image_id = 22136 | RCT2_GLOBAL(0x00F44198, uint32); - sub_98197C(image_id, 0, 0, 32, 32, 1, height, get_current_rotation(), 0, 0, height); + 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); uint8 entranceId = (mapElement->properties.track.sequence & 0x70) >> 4; @@ -558,7 +514,7 @@ static void top_spin_paint_tile_5(uint8 rideIndex, uint8 trackSequence, uint8 di if (ride->entrances[entranceId] != entranceLoc && ride->exits[entranceId] != entranceLoc) { image_id = 22139 | RCT2_GLOBAL(0x00F441A0, uint32); - sub_98197C(image_id, 0, 0, 32, 1, 7, height, get_current_rotation(), 0, 30, height + 2); + sub_98197C(image_id, 0, 0, 32, 1, 7, height, 0, 30, height + 2, get_current_rotation()); } top_spin_paint_vehicle(0, -32, rideIndex, direction, height, mapElement); @@ -589,7 +545,7 @@ static void top_spin_paint_tile_6(uint8 rideIndex, uint8 trackSequence, uint8 di wooden_a_supports_paint_setup(direction & 1, 0, height, image_id, NULL); image_id = 22135 | RCT2_GLOBAL(0x00F44198, uint32); - sub_98197C(image_id, 0, 0, 32, 32, 1, height, get_current_rotation(), 0, 0, height); + 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 = @@ -601,7 +557,7 @@ static void top_spin_paint_tile_6(uint8 rideIndex, uint8 trackSequence, uint8 di if (ride->entrances[entranceId] != entranceLoc && ride->exits[entranceId] != entranceLoc) { image_id = 22141 | RCT2_GLOBAL(0x00F441A0, uint32); - sub_98199C(image_id, 0, 0, 32, 1, 7, height, 0, 0, 2, height + 2); + sub_98199C(image_id, 0, 0, 32, 1, 7, height, 0, 2, height + 2, 0); } entranceLoc = @@ -611,7 +567,7 @@ static void top_spin_paint_tile_6(uint8 rideIndex, uint8 trackSequence, uint8 di if (ride->entrances[entranceId] != entranceLoc && ride->exits[entranceId] != entranceLoc) { image_id = 22140 | RCT2_GLOBAL(0x00F441A0, uint32); - sub_98197C(image_id, 0, 0, 1, 32, 7, height, get_current_rotation(), 30, 2, height + 2); + sub_98197C(image_id, 0, 0, 1, 32, 7, height, 30, 2, height + 2, get_current_rotation()); } top_spin_paint_vehicle(-32, 32, rideIndex, direction, height, mapElement); @@ -645,7 +601,7 @@ static void top_spin_paint_tile_7(uint8 rideIndex, uint8 trackSequence, uint8 di wooden_a_supports_paint_setup(direction & 1, 0, height, image_id, NULL); image_id = 22134 | RCT2_GLOBAL(0x00F44198, uint32); - sub_98197C(image_id, 0, 0, 32, 32, 1, height, get_current_rotation(), 0, 0, height); + 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); uint8 entranceId = (mapElement->properties.track.sequence & 0x70) >> 4; @@ -658,7 +614,7 @@ static void top_spin_paint_tile_7(uint8 rideIndex, uint8 trackSequence, uint8 di if (ride->entrances[entranceId] != entranceLoc && ride->exits[entranceId] != entranceLoc) { image_id = 22140 | RCT2_GLOBAL(0x00F441A0, uint32); - sub_98197C(image_id, 0, 0, 1, 28, 7, height, get_current_rotation(), 29, 0, height + 3); + sub_98197C(image_id, 0, 0, 1, 28, 7, height, 29, 0, height + 3, get_current_rotation()); } entranceLoc = @@ -668,7 +624,7 @@ static void top_spin_paint_tile_7(uint8 rideIndex, uint8 trackSequence, uint8 di if (ride->entrances[entranceId] != entranceLoc && ride->exits[entranceId] != entranceLoc) { image_id = 22139 | RCT2_GLOBAL(0x00F441A0, uint32); - sub_98197C(image_id, 0, 0, 28, 1, 7, height, get_current_rotation(), 0, 29, height + 3); + sub_98197C(image_id, 0, 0, 28, 1, 7, height, 0, 29, height + 3, get_current_rotation()); } top_spin_paint_vehicle(-32, -32, rideIndex, direction, height, mapElement); @@ -702,7 +658,7 @@ static void top_spin_paint_tile_8(uint8 rideIndex, uint8 trackSequence, uint8 di wooden_a_supports_paint_setup(direction & 1, 0, height, image_id, NULL); image_id = 22135 | RCT2_GLOBAL(0x00F44198, uint32); - sub_98197C(image_id, 0, 0, 32, 32, 1, height, get_current_rotation(), 0, 0, height); + 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); uint8 entranceId = (mapElement->properties.track.sequence & 0x70) >> 4; @@ -715,7 +671,7 @@ static void top_spin_paint_tile_8(uint8 rideIndex, uint8 trackSequence, uint8 di if (ride->entrances[entranceId] != entranceLoc && ride->exits[entranceId] != entranceLoc) { image_id = 22140 | RCT2_GLOBAL(0x00F441A0, uint32); - sub_98197C(image_id, 0, 0, 1, 32, 7, height, get_current_rotation(), 30, 0, height + 2); + sub_98197C(image_id, 0, 0, 1, 32, 7, height, 30, 0, height + 2, get_current_rotation()); } top_spin_paint_vehicle(-32, 0, rideIndex, direction, height, mapElement); @@ -941,11 +897,11 @@ static void shop_paint_setup(uint8 rideIndex, uint8 trackSequence, uint8 directi if (hasSupports) { uint32 foundationImageId = RCT2_GLOBAL(0x00F441A4, uint32); foundationImageId |= 3395; - sub_98197C(foundationImageId, 0, 0, 28, 28, 45, height, rotation, 2, 2, height16); + sub_98197C(foundationImageId, 0, 0, 28, 28, 45, height, 2, 2, height16, rotation); - sub_98199C(imageId, 0, 0, 28, 28, 45, height, rotation, 2, 2, height16); + sub_98199C(imageId, 0, 0, 28, 28, 45, height, 2, 2, height16, rotation); } else { - sub_98197C(imageId, 0, 0, 28, 28, 45, height, rotation, 2, 2, height16); + sub_98197C(imageId, 0, 0, 28, 28, 45, height, 2, 2, height16, rotation); } height16 += 48; @@ -1001,22 +957,22 @@ static void facility_paint_setup(uint8 rideIndex, uint8 trackSequence, uint8 dir if (hasSupports) { uint32 foundationImageId = RCT2_GLOBAL(0x00F441A4, uint32); foundationImageId |= 3395; - sub_98197C(foundationImageId, 0, 0, lengthX, lengthY, 29, height, rotation, direction == 3 ? 28 : 2, direction == 0 ? 28 : 2, height16); + sub_98197C(foundationImageId, 0, 0, lengthX, lengthY, 29, height, direction == 3 ? 28 : 2, direction == 0 ? 28 : 2, height16, rotation); // Door image or base - sub_98199C(imageId, 0, 0, lengthX, lengthY, 29, height, rotation, direction == 3 ? 28 : 2, direction == 0 ? 28 : 2, height16); + sub_98199C(imageId, 0, 0, lengthX, lengthY, 29, height, direction == 3 ? 28 : 2, direction == 0 ? 28 : 2, height16, rotation); } else { // Door image or base - sub_98197C(imageId, 0, 0, lengthX, lengthY, 29, height, rotation, direction == 3 ? 28 : 2, direction == 0 ? 28 : 2, height16); + sub_98197C(imageId, 0, 0, lengthX, lengthY, 29, height, direction == 3 ? 28 : 2, direction == 0 ? 28 : 2, height16, rotation); } // Base image if door was drawn if (direction == 1) { imageId += 2; - sub_98197C(imageId, 0, 0, 2, 28, 29, height, rotation, 28, 2, height16); + sub_98197C(imageId, 0, 0, 2, 28, 29, height, 28, 2, height16, rotation); } else if (direction == 2) { imageId += 4; - sub_98197C(imageId, 0, 0, 28, 2, 29, height, rotation, 2, 28, height16); + sub_98197C(imageId, 0, 0, 28, 2, 29, height, 2, 28, height16, rotation); } height16 += 32;