Clean up paint setup rotation (#3343)

* Use passed rotation
* Replace fixed 0 rotations
This commit is contained in:
Marijn van der Werf 2016-04-20 13:33:42 +02:00 committed by Ted John
parent 3dc2651742
commit 8fc897522b
2 changed files with 22 additions and 22 deletions

View File

@ -878,7 +878,7 @@ int sub_98199C(
RCT2_GLOBAL(RCT2_ADDRESS_PAINT_BOUNDBOX_OFFSET_Y, uint16) = bound_box_offset_y;
RCT2_GLOBAL(RCT2_ADDRESS_PAINT_BOUNDBOX_OFFSET_Z, uint16) = bound_box_offset_z;
RCT2_CALLPROC_X(RCT2_ADDRESS(0x98199C, uint32_t)[get_current_rotation()],
RCT2_CALLPROC_X(RCT2_ADDRESS(0x98199C, uint32_t)[rotation],
x_offset | (bound_box_length_z << 8),
image_id,
y_offset,
@ -909,7 +909,7 @@ int sub_98196C(
int z_offset,
uint32 rotation
) {
RCT2_CALLPROC_X(RCT2_ADDRESS(0x0098196C, uint32)[get_current_rotation()],
RCT2_CALLPROC_X(RCT2_ADDRESS(0x0098196C, uint32)[rotation],
x_offset | (bound_box_length_z << 8),
image_id,
y_offset,
@ -1127,7 +1127,7 @@ int sub_98198C(
RCT2_GLOBAL(RCT2_ADDRESS_PAINT_BOUNDBOX_OFFSET_Y, uint16) = bound_box_offset_y;
RCT2_GLOBAL(RCT2_ADDRESS_PAINT_BOUNDBOX_OFFSET_Z, uint16) = bound_box_offset_z;
RCT2_CALLPROC_X(RCT2_ADDRESS(0x0098198C, uint32)[get_current_rotation()],
RCT2_CALLPROC_X(RCT2_ADDRESS(0x0098198C, uint32)[rotation],
x_offset | (bound_box_length_z << 8),
image_id,
y_offset,
@ -1362,7 +1362,7 @@ 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, 2, 2, height, 0);
sub_98199C(transparant_image_id, 0, 0, lengthX, lengthY, ah, height, 2, 2, height, get_current_rotation());
}
image_id += 4;
@ -1371,7 +1371,7 @@ void viewport_ride_entrance_exit_paint_setup(uint8 direction, int height, rct_ma
if (transparant_image_id){
transparant_image_id += 4;
sub_98199C(transparant_image_id, 0, 0, lengthX, lengthY, ah, height, (direction & 1) ? 28 : 2, (direction & 1) ? 2 : 28, height, 0);
sub_98199C(transparant_image_id, 0, 0, lengthX, lengthY, ah, height, (direction & 1) ? 28 : 2, (direction & 1) ? 2 : 28, height, get_current_rotation());
}
uint32 eax = 0xFFFF0600 | ((height / 16) & 0xFF);
@ -1414,7 +1414,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, 2, 2, height + style->height, 0);
sub_98199C(scrolling_text_setup(string_id, scroll, style->scrolling_mode), 0, 0, 0x1C, 0x1C, 0x33, height + style->height, 2, 2, height + style->height, get_current_rotation());
}
image_id = RCT2_GLOBAL(0x009E32BC, uint32);
@ -1504,7 +1504,7 @@ 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, 2, 2, height + entrance->text_height, 0);
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, get_current_rotation());
break;
case 1:
case 2:
@ -1741,7 +1741,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, boundBoxOffsetX, boundBoxOffsetY, boundBoxOffsetZ, 0);
sub_98199C(scrolling_text_setup(string_id, scroll, scrollingMode), 0, 0, 1, 1, 0x15, height + 22, boundBoxOffsetX, boundBoxOffsetY, boundBoxOffsetZ, get_current_rotation());
}
/**

View File

@ -162,7 +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, boundBoxOffsetX, boundBoxOffsetY, boundBoxOffsetZ, 0);
sub_98199C(image_id, al, cl, lengthX, lengthY, 90, height, boundBoxOffsetX, boundBoxOffsetY, boundBoxOffsetZ, get_current_rotation());
uint32 seatImageId;
@ -218,7 +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, boundBoxOffsetX, boundBoxOffsetY, boundBoxOffsetZ, 0);
sub_98199C(image_id, (sint8) seatCoords.x, (sint8) seatCoords.y, lengthX, lengthY, 90, seatCoords.z, boundBoxOffsetX, boundBoxOffsetY, boundBoxOffsetZ, get_current_rotation());
rct_drawpixelinfo* dpi = RCT2_GLOBAL(0x140E9A8, rct_drawpixelinfo*);
if (dpi->zoom_level < 2 && vehicle != NULL && vehicle->num_peeps != 0) {
@ -229,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, boundBoxOffsetX, boundBoxOffsetY, boundBoxOffsetZ, 0);
sub_98199C(image_id, (sint8) seatCoords.x, (sint8) seatCoords.y, lengthX, lengthY, 90, seatCoords.z, boundBoxOffsetX, boundBoxOffsetY, boundBoxOffsetZ, get_current_rotation());
if (vehicle->num_peeps > 2) {
image_id =
@ -239,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, boundBoxOffsetX, boundBoxOffsetY, boundBoxOffsetZ, 0);
sub_98199C(image_id, (sint8) seatCoords.x, (sint8) seatCoords.y, lengthX, lengthY, 90, seatCoords.z, boundBoxOffsetX, boundBoxOffsetY, boundBoxOffsetZ, get_current_rotation());
}
if (vehicle->num_peeps > 4) {
@ -250,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, boundBoxOffsetX, boundBoxOffsetY, boundBoxOffsetZ, 0);
sub_98199C(image_id, (sint8) seatCoords.x, (sint8) seatCoords.y, lengthX, lengthY, 90, seatCoords.z, boundBoxOffsetX, boundBoxOffsetY, boundBoxOffsetZ, get_current_rotation());
}
if (vehicle->num_peeps > 6) {
@ -261,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, boundBoxOffsetX, boundBoxOffsetY, boundBoxOffsetZ, 0);
sub_98199C(image_id, (sint8) seatCoords.x, (sint8) seatCoords.y, lengthX, lengthY, 90, seatCoords.z, boundBoxOffsetX, boundBoxOffsetY, boundBoxOffsetZ, get_current_rotation());
}
}
@ -279,7 +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, boundBoxOffsetX, boundBoxOffsetY, boundBoxOffsetZ, 0);
sub_98199C(image_id, al, cl, lengthX, lengthY, 90, height, boundBoxOffsetX, boundBoxOffsetY, boundBoxOffsetZ, get_current_rotation());
image_id = RCT2_GLOBAL(0x00F441A0, uint32);
if (image_id == 0x20000000) {
@ -294,7 +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, boundBoxOffsetX, boundBoxOffsetY, boundBoxOffsetZ, 0);
sub_98199C(image_id, al, cl, lengthX, lengthY, 90, height, boundBoxOffsetX, boundBoxOffsetY, boundBoxOffsetZ, get_current_rotation());
RCT2_GLOBAL(0x009DE578, rct_map_element*) = curMapElement;
RCT2_GLOBAL(RCT2_ADDRESS_PAINT_SETUP_CURRENT_TYPE, uint8) = VIEWPORT_INTERACTION_ITEM_RIDE;
@ -321,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, 2, height + 2, 0);
sub_98199C(image_id, 0, 0, 32, 1, 7, height, 0, 2, height + 2, get_current_rotation());
}
entranceLoc =
@ -330,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, 2, height + 2, 0);
sub_98199C(image_id, 0, 0, 1, 32, 7, height, 0, 2, height + 2, get_current_rotation());
}
top_spin_paint_vehicle(32, 32, rideIndex, direction, height, mapElement);
@ -376,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, 2, 0, height + 2, 0);
sub_98199C(image_id, 0, 0, 1, 32, 7, height, 2, 0, height + 2, get_current_rotation());
}
RCT2_GLOBAL(0x141E9B4, uint16) = 0xFFFF;
@ -417,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, 2, height + 2, 0);
sub_98199C(image_id, 0, 0, 32, 1, 7, height, 0, 2, height + 2, get_current_rotation());
}
RCT2_GLOBAL(0x141E9B4, uint16) = 0xFFFF;
@ -458,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, 2, 0, height + 2, 0);
sub_98199C(image_id, 0, 0, 1, 32, 7, height, 2, 0, height + 2, get_current_rotation());
}
entranceLoc =
@ -557,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, 2, height + 2, 0);
sub_98199C(image_id, 0, 0, 32, 1, 7, height, 0, 2, height + 2, get_current_rotation());
}
entranceLoc =