diff --git a/src/interface/viewport.c b/src/interface/viewport.c index 589633c671..20d5a872f8 100644 --- a/src/interface/viewport.c +++ b/src/interface/viewport.c @@ -815,21 +815,21 @@ void sub_688485(){ } /* rct2: 0x006874B0, 0x00687618, 0x0068778C, 0x00687902, 0x0098199C */ -int sub_98199C(sint8 al, sint8 ah, int image_id, sint8 cl, int height, sint16 length_x, sint16 length_y, uint32 rotation){ +int sub_98199C(sint8 al, sint8 ah, int image_id, sint8 cl, int height, sint16 length_y, sint16 length_x, uint32 rotation){ RCT2_CALLPROC_X(RCT2_ADDRESS(0x98199C, uint32_t)[RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_ROTATION, uint32_t)], al | (ah << 8), image_id, cl, height, - length_x, length_y, + length_x, rotation); return 1; } /* rct2: 0x00686806, 0x006869B2, 0x00686B6F, 0x00686D31, 0x0098197C */ -int sub_98197C(sint8 al, sint8 ah, int image_id, sint8 cl, int height, sint16 length_x, sint16 length_y, uint32 rotation){ - int ebp = ah + RCT2_GLOBAL(0x9DEA56, uint16); +int sub_98197C(sint8 al, sint8 ah, int image_id, sint8 cl, int height, sint16 length_y, sint16 length_x, uint32 rotation){ + int ebp = ah + RCT2_GLOBAL(0x9DEA56, sint16); RCT2_GLOBAL(0xF1AD28, paint_struct*) = 0; RCT2_GLOBAL(0xF1AD2C, uint32) = 0; @@ -907,25 +907,25 @@ int sub_98197C(sint8 al, sint8 ah, int image_id, sint8 cl, int height, sint16 le // Unsure why rots 1 and 3 need to swap switch (rotation){ - case 0: - rotate_map_coordinates(&boundBox.x, &boundBox.y, 0); - rotate_map_coordinates(&s_unk.x, &s_unk.y, 0); + case 0: boundBox.x--; boundBox.y--; + rotate_map_coordinates(&s_unk.x, &s_unk.y, 0); + rotate_map_coordinates(&boundBox.x, &boundBox.y, 0); break; case 1: - rotate_map_coordinates(&boundBox.x, &boundBox.y, 3); + boundBox.x--; rotate_map_coordinates(&s_unk.x, &s_unk.y, 3); - boundBox.y--; + 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); break; case 3: + boundBox.y--; rotate_map_coordinates(&boundBox.x, &boundBox.y, 1); rotate_map_coordinates(&s_unk.x, &s_unk.y, 1); - boundBox.x--; break; } @@ -1227,7 +1227,10 @@ void viewport_ride_entrance_exit_paint_setup(uint8 direction, int height, rct_ma sint8 ah = is_exit ? 0x23 : 0x33; - sub_98197C(0, ah, image_id, 0, height, 2, 0x1C, RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_ROTATION, uint32_t)); + sint16 lengthY = (direction & 1) ? 28 : 2; + sint16 lengthX = (direction & 1) ? 2 : 28; + + sub_98197C(0, ah, image_id, 0, height, lengthY, lengthX, RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_ROTATION, uint32_t)); if (transparant_image_id){ if (is_exit){ @@ -1240,24 +1243,24 @@ void viewport_ride_entrance_exit_paint_setup(uint8 direction, int height, rct_ma RCT2_GLOBAL(0x009DEA54, uint16) = 2; RCT2_GLOBAL(0x009DEA56, uint16) = height; - sub_98199C(0, ah, transparant_image_id, 0, height, 2, 0x1C, 0); + sub_98199C(0, ah, transparant_image_id, 0, height, lengthY, lengthX, 0); } image_id += 4; - RCT2_GLOBAL(0x009DEA52, uint16) = 2; - RCT2_GLOBAL(0x009DEA54, uint16) = 28; + RCT2_GLOBAL(0x009DEA52, uint16) = (direction & 1) ? 28 : 2; + RCT2_GLOBAL(0x009DEA54, uint16) = (direction & 1) ? 2 : 28; RCT2_GLOBAL(0x009DEA56, uint16) = height; - sub_98197C(0, ah, image_id, 0, height, 2, 0x1C, RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_ROTATION, uint32_t)); + sub_98197C(0, ah, image_id, 0, height, lengthY, lengthX, RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_ROTATION, uint32_t)); if (transparant_image_id){ transparant_image_id += 4; - RCT2_GLOBAL(0x009DEA52, uint16) = 2; - RCT2_GLOBAL(0x009DEA54, uint16) = 28; + RCT2_GLOBAL(0x009DEA52, uint16) = (direction & 1) ? 28 : 2; + RCT2_GLOBAL(0x009DEA54, uint16) = (direction & 1) ? 2 : 28; RCT2_GLOBAL(0x009DEA56, uint16) = height; - sub_98199C(0, ah, transparant_image_id, 0, height, 2, 0x1C, 0); + sub_98199C(0, ah, transparant_image_id, 0, height, lengthY, lengthX, 0); } uint32 eax = 0xFFFF0600 | ((height / 16) & 0xFF); diff --git a/src/interface/viewport.h b/src/interface/viewport.h index d13305eb17..d416a96494 100644 --- a/src/interface/viewport.h +++ b/src/interface/viewport.h @@ -131,8 +131,8 @@ void painter_setup(); void sub_688485(); void sub_688217(); -int sub_98197C(sint8 al, sint8 ah, int image_id, sint8 cl, int height, sint16 length_x, sint16 length_y, uint32 rotation); -int sub_98199C(sint8 al, sint8 ah, int image_id, sint8 cl, int height, sint16 length_x, sint16 length_y, uint32 rotation); +int sub_98197C(sint8 al, sint8 ah, int image_id, sint8 cl, int height, sint16 length_y, sint16 length_x, uint32 rotation); +int sub_98199C(sint8 al, sint8 ah, int image_id, sint8 cl, int height, sint16 length_y, sint16 length_x, uint32 rotation); int sub_6629BC(int height, uint16 ax, uint32 image_id, int edi); 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 c923988399..5f6f0c2f2a 100644 --- a/src/ride/track_paint.c +++ b/src/ride/track_paint.c @@ -248,9 +248,9 @@ void top_spin_paint_vehicle(sint8 al, sint8 cl, uint8 rideIndex, uint8 direction RCT2_GLOBAL(0x009DEA56, sint16) = height; //di - uint8 lengthY = 24; - //si uint8 lengthX = 24; + //si + uint8 lengthY = 24; uint32 image_id = RCT2_GLOBAL(0x00F441A0, uint32); if (image_id == 0x20000000) { @@ -265,7 +265,7 @@ void top_spin_paint_vehicle(sint8 al, sint8 cl, uint8 rideIndex, uint8 direction // Left back bottom support image_id += 572; - sub_98197C(al, 90, image_id, cl, height, lengthX, lengthY, RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_ROTATION, uint32)); + sub_98197C(al, 90, image_id, cl, height, lengthY, lengthX, RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_ROTATION, uint32)); image_id = RCT2_GLOBAL(0x00F441A0, uint32); if (image_id == 0x20000000) { @@ -293,8 +293,8 @@ void top_spin_paint_vehicle(sint8 al, sint8 cl, uint8 rideIndex, uint8 direction image_id, cl, height, - lengthX, - lengthY, + lengthY, + lengthX, 0); uint32 seatImageId; @@ -356,8 +356,8 @@ void top_spin_paint_vehicle(sint8 al, sint8 cl, uint8 rideIndex, uint8 direction image_id, (sint8)seatCoords.y, seatCoords.z, - lengthX, - lengthY, + lengthY, + lengthX, 0); rct_drawpixelinfo* dpi = RCT2_GLOBAL(0x140E9A8, rct_drawpixelinfo*); @@ -369,7 +369,7 @@ void top_spin_paint_vehicle(sint8 al, sint8 cl, uint8 rideIndex, uint8 direction image_id += 0xA0000000; image_id += 76; - sub_98199C((sint8)seatCoords.x, 90, image_id, (sint8)seatCoords.y, seatCoords.z, lengthX, lengthY, 0); + sub_98199C((sint8)seatCoords.x, 90, image_id, (sint8)seatCoords.y, seatCoords.z, lengthY, lengthX, 0); if (vehicle->num_peeps > 2) { image_id = @@ -379,7 +379,7 @@ void top_spin_paint_vehicle(sint8 al, sint8 cl, uint8 rideIndex, uint8 direction image_id += 0xA0000000; image_id += 152; - sub_98199C((sint8)seatCoords.x, 90, image_id, (sint8)seatCoords.y, seatCoords.z, lengthX, lengthY, 0); + sub_98199C((sint8)seatCoords.x, 90, image_id, (sint8)seatCoords.y, seatCoords.z, lengthY, lengthX, 0); } if (vehicle->num_peeps > 4) { @@ -390,7 +390,7 @@ void top_spin_paint_vehicle(sint8 al, sint8 cl, uint8 rideIndex, uint8 direction image_id += 0xA0000000; image_id += 228; - sub_98199C((sint8)seatCoords.x, 90, image_id, (sint8)seatCoords.y, seatCoords.z, lengthX, lengthY, 0); + sub_98199C((sint8)seatCoords.x, 90, image_id, (sint8)seatCoords.y, seatCoords.z, lengthY, lengthX, 0); } if (vehicle->num_peeps > 6) { @@ -401,7 +401,7 @@ void top_spin_paint_vehicle(sint8 al, sint8 cl, uint8 rideIndex, uint8 direction image_id += 0xA0000000; image_id += 304; - sub_98199C((sint8)seatCoords.x, 90, image_id, (sint8)seatCoords.y, seatCoords.z, lengthX, lengthY, 0); + sub_98199C((sint8)seatCoords.x, 90, image_id, (sint8)seatCoords.y, seatCoords.z, lengthY, lengthX, 0); } } @@ -425,8 +425,8 @@ void top_spin_paint_vehicle(sint8 al, sint8 cl, uint8 rideIndex, uint8 direction image_id, cl, height, - lengthX, - lengthY, + lengthY, + lengthX, 0); image_id = RCT2_GLOBAL(0x00F441A0, uint32); @@ -448,8 +448,8 @@ void top_spin_paint_vehicle(sint8 al, sint8 cl, uint8 rideIndex, uint8 direction image_id, cl, height, - lengthX, - lengthY, + lengthY, + lengthX, 0); RCT2_GLOBAL(0x009DE578, rct_map_element*) = curMapElement;