Pass 0x009DEA52-0x009DEA56 as parameters

This commit is contained in:
Marijn van der Werf 2016-04-14 11:07:41 +02:00
parent a6cbd392c6
commit 3bb2214235
4 changed files with 109 additions and 222 deletions

View File

@ -200,16 +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);
RCT2_GLOBAL(0x009DEA52, uint16) = 0;
RCT2_GLOBAL(0x009DEA54, uint16) = 0;
RCT2_GLOBAL(0x009DEA56, uint16) = z + 2;
sub_98197C(imageId, 0, 0, 32, 32, 11, z, rotation);
RCT2_GLOBAL(0x009DEA52, uint16) = 0;
RCT2_GLOBAL(0x009DEA54, uint16) = 0;
RCT2_GLOBAL(0x009DEA56, uint16) = z + 16 + 2;
sub_98197C(imageId + 4, 0, 0, 32, 32, 11, z + 16, rotation);
sub_98197C(imageId + 4, 0, 0, 32, 32, 11, z + 16, rotation, 0, 0, z + 16 + 2);
hasSupports = true;
}
@ -231,9 +224,10 @@ bool wooden_a_supports_paint_setup(int supportType, int special, int height, uin
imageId += word_97B3C4[slope & 0x1F];
imageId |= imageColourFlags;
RCT2_GLOBAL(0x009DEA52, uint16) = 0;
RCT2_GLOBAL(0x009DEA54, uint16) = 0;
RCT2_GLOBAL(0x009DEA56, uint16) = z + 2;
uint16 word_9DEA52 = 0;
uint16 word_9DEA54 = 0;
uint16 word_9DEA56 = z + 2;
// Todo: check whether this function call is correct
sub_98196C(imageId, 0, 0, 32, 32, 11, z, rotation);
hasSupports = true;
}
@ -277,18 +271,18 @@ bool wooden_a_supports_paint_setup(int supportType, int special, int height, uin
imageId += special;
imageId |= imageColourFlags;
RCT2_GLOBAL(0x009DEA52, uint16) = byte_97B23C[special].var_0;
RCT2_GLOBAL(0x009DEA54, uint16) = byte_97B23C[special].var_1;
RCT2_GLOBAL(0x009DEA56, uint16) = byte_97B23C[special].var_2 + z;
uint16 word_9DEA52 = byte_97B23C[special].var_0;
uint16 word_9DEA54 = byte_97B23C[special].var_1;
uint16 word_9DEA56 = byte_97B23C[special].var_2 + z;
uint16 lengthY = byte_97B23C[special].var_3;
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);
sub_98197C(imageId, 0, 0, lengthX, lengthY, ah, z, rotation, word_9DEA52, word_9DEA54, word_9DEA56);
hasSupports = true;
} else {
hasSupports = true;
if (!sub_98198C(imageId, 0, 0, lengthX, lengthY, ah, z, rotation, byte_97B23C[special].var_0, byte_97B23C[special].var_1, byte_97B23C[special].var_2 + z)) {
if (!sub_98198C(imageId, 0, 0, lengthX, lengthY, ah, z, rotation, word_9DEA52, word_9DEA54, word_9DEA56)) {
int edi = RCT2_GLOBAL(0x009DEA58, uint32);
RCT2_GLOBAL(edi + 0x20, uint32) = imageColourFlags;
}

View File

@ -927,10 +927,12 @@ int sub_98196C(int image_id, sint8 x_offset, sint8 y_offset, sint16 length_x, si
* @param z_offset (ah)
* @param height (edx)
* @param rotation
* @return ??
* @param word_52 (0x009DEA52)
* @param word_54 (0x009DEA54)
* @param word_56 (0x009DEA56)
*/
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){
int ebp = z_offset + RCT2_GLOBAL(0x9DEA56, sint16);
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;
RCT2_GLOBAL(0xF1AD28, paint_struct*) = 0;
RCT2_GLOBAL(0xF1AD2C, uint32) = 0;
@ -995,8 +997,8 @@ int sub_98197C(int image_id, sint8 x_offset, sint8 y_offset, sint16 length_x, si
};
rct_xy16 s_unk = {
.x = RCT2_GLOBAL(0x9DEA52, sint16),
.y = RCT2_GLOBAL(0x9DEA54, sint16)
.x = s_unk_x,
.y = s_unk_y
};
// Unsure why rots 1 and 3 need to swap
@ -1024,7 +1026,7 @@ int sub_98197C(int image_id, sint8 x_offset, sint8 y_offset, sint16 length_x, si
}
ps->other_x = boundBox.x + s_unk.x + RCT2_GLOBAL(0x9DE568, sint16);
ps->some_x = RCT2_GLOBAL(0x009DEA56, sint16);
ps->some_x = word_56;
ps->some_y = ebp;
ps->other_y = boundBox.y + s_unk.y + RCT2_GLOBAL(0x009DE56C, sint16);
ps->var_1A = 0;
@ -1134,10 +1136,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;
RCT2_GLOBAL(0x9DEA52, uint16) = 0;
RCT2_GLOBAL(0x9DEA54, uint16) = 0;
RCT2_GLOBAL(0x9DEA56, uint16) = z + 2;
sub_98197C(ebx, 0, 0, 1, 1, 0, z, get_current_rotation());
sub_98197C(ebx, 0, 0, 1, 1, 0, z, get_current_rotation(), 0, 0, z + 2);
return;
}
@ -1212,11 +1211,7 @@ void viewport_litter_paint_setup(rct_litter *litter, int imageDirection)
uint32 image_id = imageDirection + RCT2_ADDRESS(0x97EF6C, uint32)[litter->type * 2];
RCT2_GLOBAL(0x9DEA52, uint16) = 0xFFFC;
RCT2_GLOBAL(0x9DEA54, uint16) = 0xFFFC;
RCT2_GLOBAL(0x9DEA56, uint16) = litter->z + 2;
sub_98197C(image_id, 0, 0, 4, 4, 0xFF, litter->z, get_current_rotation());
sub_98197C(image_id, 0, 0, 4, 4, 0xFF, litter->z, get_current_rotation(), 0xFFFC, 0xFFFC, litter->z + 2);
}
@ -1334,16 +1329,16 @@ void viewport_ride_entrance_exit_paint_setup(uint8 direction, int height, rct_ma
// Each entrance is split into 2 images for drawing
// Certain entrance styles have another 2 images to draw for coloured windows
RCT2_GLOBAL(0x009DEA52, uint16) = 2;
RCT2_GLOBAL(0x009DEA54, uint16) = 2;
RCT2_GLOBAL(0x009DEA56, uint16) = height;
uint16 word_9DEA52 = 2;
uint16 word_9DEA54 = 2;
uint16 word_9DEA56 = height;
sint8 ah = is_exit ? 0x23 : 0x33;
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());
sub_98197C(image_id, 0, 0, lengthX, lengthY, ah, height, get_current_rotation(), word_9DEA52, word_9DEA54, word_9DEA56);
if (transparant_image_id){
if (is_exit){
@ -1352,28 +1347,22 @@ void viewport_ride_entrance_exit_paint_setup(uint8 direction, int height, rct_ma
else{
transparant_image_id |= style->sprite_index + direction + 16;
}
RCT2_GLOBAL(0x009DEA52, uint16) = 2;
RCT2_GLOBAL(0x009DEA54, uint16) = 2;
RCT2_GLOBAL(0x009DEA56, uint16) = height;
sub_98199C(transparant_image_id, 0, 0, lengthX, lengthY, ah, height, 0);
sub_98199C(transparant_image_id, 0, 0, lengthX, lengthY, ah, height, 0, 2, 2, height);
}
image_id += 4;
RCT2_GLOBAL(0x009DEA52, uint16) = (direction & 1) ? 28 : 2;
RCT2_GLOBAL(0x009DEA54, uint16) = (direction & 1) ? 2 : 28;
RCT2_GLOBAL(0x009DEA56, uint16) = height;
word_9DEA52 = (direction & 1) ? 28 : 2;
word_9DEA54 = (direction & 1) ? 2 : 28;
word_9DEA56 = height;
sub_98197C(image_id, 0, 0, lengthX, lengthY, ah, height, get_current_rotation());
sub_98197C(image_id, 0, 0, lengthX, lengthY, ah, height, get_current_rotation(), word_9DEA52, word_9DEA54, word_9DEA56);
if (transparant_image_id){
transparant_image_id += 4;
RCT2_GLOBAL(0x009DEA52, uint16) = (direction & 1) ? 28 : 2;
RCT2_GLOBAL(0x009DEA54, uint16) = (direction & 1) ? 2 : 28;
RCT2_GLOBAL(0x009DEA56, uint16) = height;
sub_98199C(transparant_image_id, 0, 0, lengthX, lengthY, ah, height, 0);
sub_98199C(transparant_image_id, 0, 0, lengthX, lengthY, ah, height, 0, (direction & 1) ? 28 : 2, (direction & 1) ? 2 : 28, height);
}
uint32 eax = 0xFFFF0600 | ((height / 16) & 0xFF);
@ -1416,10 +1405,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;
RCT2_GLOBAL(0x009DEA52, uint16) = 2;
RCT2_GLOBAL(0x009DEA54, uint16) = 2;
RCT2_GLOBAL(0x009DEA56, uint16) = height + style->height;
sub_98199C(scrolling_text_setup(string_id, scroll, style->scrolling_mode), 0, 0, 0x1C, 0x1C, 0x33, height + style->height, 0);
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);
}
image_id = RCT2_GLOBAL(0x009E32BC, uint32);
@ -1473,20 +1459,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;
RCT2_GLOBAL(0x009DEA52, uint16) = 0;
RCT2_GLOBAL(0x009DEA54, uint16) = 2;
RCT2_GLOBAL(0x009DEA56, sint16) = height;
sub_98197C(image_id, 0, 0, 32, 0x1C, 0, height, get_current_rotation());
sub_98197C(image_id, 0, 0, 32, 0x1C, 0, height, get_current_rotation(), 0, 2, height);
entrance = (rct_entrance_type*)object_entry_groups[OBJECT_TYPE_PARK_ENTRANCE].chunks[0];
image_id = (entrance->image_id + direction * 3) | ghost_id;
RCT2_GLOBAL(0x009DEA52, uint16) = 2;
RCT2_GLOBAL(0x009DEA54, uint16) = 2;
RCT2_GLOBAL(0x009DEA56, sint16) = height + 32;
sub_98197C(image_id, 0, 0, 0x1C, 0x1C, 0x2F, height, get_current_rotation());
sub_98197C(image_id, 0, 0, 0x1C, 0x1C, 0x2F, height, get_current_rotation(), 2, 2, height + 32);
if ((direction + 1) & (1 << 1))
break;
@ -1524,12 +1501,7 @@ void viewport_park_entrance_paint_setup(uint8 direction, int height, rct_map_ele
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;
RCT2_GLOBAL(0x009DEA52, uint16) = 3;
RCT2_GLOBAL(0x009DEA54, uint16) = 3;
RCT2_GLOBAL(0x009DEA56, sint16) = height;
sub_98197C(image_id, 0, 0, 0x1A, di, 0x4F, height, get_current_rotation());
sub_98197C(image_id, 0, 0, 0x1A, di, 0x4F, height, get_current_rotation(), 3, 3, height);
break;
}
@ -1592,10 +1564,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);
RCT2_GLOBAL(0x009DEA52, uint16) = 1000;
RCT2_GLOBAL(0x009DEA54, uint16) = 1000;
RCT2_GLOBAL(0x009DEA56, uint16) = 2047;
sub_98197C(ebx, 16, 16, 1, 1, 0, height + ax + 3, get_current_rotation());
sub_98197C(ebx, 16, 16, 1, 1, 0, height + ax + 3, get_current_rotation(), 1000, 1000, 2047);
}
}
@ -1674,12 +1643,7 @@ void viewport_entrance_paint_setup(uint8 direction, int height, rct_map_element*
image_id -= RCT2_GLOBAL(0x01359208, sint16);
RCT2_GLOBAL(0x009DEA52, uint16) = 31;
RCT2_GLOBAL(0x009DEA54, uint16) = 31;
RCT2_GLOBAL(0x009DEA56, sint16) = z;
RCT2_GLOBAL(0x009DEA56, uint16) += 64;
sub_98197C(image_id, 16, 16, 1, 1, 0, height, get_current_rotation());
sub_98197C(image_id, 16, 16, 1, 1, 0, height, get_current_rotation(), 31, 31, z + 64);
}
}
@ -1700,6 +1664,7 @@ void viewport_entrance_paint_setup(uint8 direction, int height, rct_map_element*
*/
void viewport_banner_paint_setup(uint8 direction, int height, rct_map_element* map_element)
{
uint16 word_9DEA52, word_9DEA54, word_9DEA56;
rct_drawpixelinfo* dpi = RCT2_GLOBAL(0x140E9A8, rct_drawpixelinfo*);
RCT2_GLOBAL(RCT2_ADDRESS_PAINT_SETUP_CURRENT_TYPE, uint8_t) = VIEWPORT_INTERACTION_ITEM_BANNER;
@ -1713,9 +1678,9 @@ void viewport_banner_paint_setup(uint8 direction, int height, rct_map_element* m
direction += map_element->properties.banner.position;
direction &= 3;
RCT2_GLOBAL(0x9DEA56, uint16_t) = height + 2;
RCT2_GLOBAL(0x9DEA52, uint32_t) = RCT2_ADDRESS(0x98D884, uint32)[direction * 2];
word_9DEA52 = RCT2_ADDRESS(0x98D884, uint16)[direction * 2];
word_9DEA54 = RCT2_ADDRESS(0x98D884 + 2, uint16)[direction * 2];
word_9DEA56 = height + 2;
uint32 base_id = (direction << 1) + banner_scenery->image;
uint32 image_id = base_id;
@ -1731,11 +1696,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());
RCT2_GLOBAL(0x9DEA52, uint32) = RCT2_ADDRESS(0x98D888, uint32)[direction * 2];
sub_98197C(image_id, 0, 0, 1, 1, 0x15, height, get_current_rotation(), word_9DEA52, word_9DEA54, word_9DEA56);
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());
sub_98197C(image_id, 0, 0, 1, 1, 0x15, height, get_current_rotation(), word_9DEA52, word_9DEA54, word_9DEA56);
// Opposite direction
direction ^= 2;
@ -1766,7 +1732,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);
sub_98199C(scrolling_text_setup(string_id, scroll, scrollingMode), 0, 0, 1, 1, 0x15, height + 22, 0, word_9DEA52, word_9DEA54, word_9DEA56);
}
/**
@ -1821,17 +1787,13 @@ static void sub_68B3FB(int x, int y)
arrowRotation +
(RCT2_GLOBAL(RCT2_ADDRESS_MAP_ARROW_DIRECTION, uint8) & 0xFC) +
0x20900C27;
int arrowZ = RCT2_GLOBAL(RCT2_ADDRESS_MAP_ARROW_Z, uint16);
RCT2_GLOBAL(0x9DE568, sint16) = x;
RCT2_GLOBAL(0x9DE56C, sint16) = y;
RCT2_GLOBAL(RCT2_ADDRESS_PAINT_SETUP_CURRENT_TYPE, uint8) = VIEWPORT_INTERACTION_ITEM_NONE;
RCT2_GLOBAL(0x9DEA52, uint16) = 0;
RCT2_GLOBAL(0x9DEA54, uint16) = 0;
RCT2_GLOBAL(0x9DEA56, uint16) = arrowZ + 18;
sub_98197C(imageId, 0, 0, 32, 32, 0xFF, arrowZ, rotation);
sub_98197C(imageId, 0, 0, 32, 32, 0xFF, arrowZ, rotation, 0, 0, arrowZ + 18);
}
int bx = dx + 52;

View File

@ -132,7 +132,7 @@ 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);
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);

View File

@ -41,11 +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);
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, get_current_rotation(), 0, 0, height);
RCT2_GLOBAL(0x141E9B4, uint16) = 0xFFFF;
RCT2_GLOBAL(0x141E9B8, uint16) = 0xFFFF;
@ -98,6 +94,7 @@ static sint8 TopSpinSeatPositionOffset[] = {
* rct2: 0x0076750D
*/
static void top_spin_paint_vehicle(sint8 al, sint8 cl, uint8 rideIndex, uint8 direction, int height, rct_map_element* mapElement) {
uint16 word_9DEA52, word_9DEA54, word_9DEA56;
// As we will be drawing a vehicle we need to backup the mapElement that
// is assigned to the drawings.
rct_map_element* curMapElement = RCT2_GLOBAL(0x009DE578, rct_map_element*);
@ -122,9 +119,9 @@ static void top_spin_paint_vehicle(sint8 al, sint8 cl, uint8 rideIndex, uint8 di
seatRotation = vehicle->bank_rotation;
}
RCT2_GLOBAL(0x009DEA52, sint16) = al + 16;
RCT2_GLOBAL(0x009DEA54, sint16) = cl + 16;
RCT2_GLOBAL(0x009DEA56, sint16) = height;
word_9DEA52 = al + 16;
word_9DEA54 = cl + 16;
word_9DEA56 = height;
//di
uint8 lengthX = 24;
@ -144,7 +141,7 @@ static void top_spin_paint_vehicle(sint8 al, sint8 cl, uint8 rideIndex, uint8 di
// Left back bottom support
image_id += 572;
sub_98197C(image_id, al, cl, lengthX, lengthY, 90, height, get_current_rotation());
sub_98197C(image_id, al, cl, lengthX, lengthY, 90, height, get_current_rotation(), word_9DEA52, word_9DEA54, word_9DEA56);
image_id = RCT2_GLOBAL(0x00F441A0, uint32);
if (image_id == 0x20000000) {
@ -174,7 +171,10 @@ static void top_spin_paint_vehicle(sint8 al, sint8 cl, uint8 rideIndex, uint8 di
lengthY,
90,
height,
0);
0,
word_9DEA52,
word_9DEA54,
word_9DEA56);
uint32 seatImageId;
@ -238,7 +238,10 @@ static void top_spin_paint_vehicle(sint8 al, sint8 cl, uint8 rideIndex, uint8 di
lengthY,
90,
seatCoords.z,
0);
0,
word_9DEA52,
word_9DEA54,
word_9DEA56);
rct_drawpixelinfo* dpi = RCT2_GLOBAL(0x140E9A8, rct_drawpixelinfo*);
if (dpi->zoom_level < 2 && vehicle != NULL && vehicle->num_peeps != 0) {
@ -249,7 +252,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);
sub_98199C(image_id, (sint8) seatCoords.x, (sint8) seatCoords.y, lengthX, lengthY, 90, seatCoords.z, 0, word_9DEA52, word_9DEA54, word_9DEA56);
if (vehicle->num_peeps > 2) {
image_id =
@ -259,7 +262,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);
sub_98199C(image_id, (sint8) seatCoords.x, (sint8) seatCoords.y, lengthX, lengthY, 90, seatCoords.z, 0, word_9DEA52, word_9DEA54, word_9DEA56);
}
if (vehicle->num_peeps > 4) {
@ -270,7 +273,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);
sub_98199C(image_id, (sint8) seatCoords.x, (sint8) seatCoords.y, lengthX, lengthY, 90, seatCoords.z, 0, word_9DEA52, word_9DEA54, word_9DEA56);
}
if (vehicle->num_peeps > 6) {
@ -281,7 +284,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);
sub_98199C(image_id, (sint8) seatCoords.x, (sint8) seatCoords.y, lengthX, lengthY, 90, seatCoords.z, 0, word_9DEA52, word_9DEA54, word_9DEA56);
}
}
@ -307,7 +310,10 @@ static void top_spin_paint_vehicle(sint8 al, sint8 cl, uint8 rideIndex, uint8 di
lengthY,
90,
height,
0);
0,
word_9DEA52,
word_9DEA54,
word_9DEA56);
image_id = RCT2_GLOBAL(0x00F441A0, uint32);
if (image_id == 0x20000000) {
@ -328,9 +334,12 @@ static void top_spin_paint_vehicle(sint8 al, sint8 cl, uint8 rideIndex, uint8 di
cl,
lengthX,
lengthY,
90,
90,
height,
0);
0,
word_9DEA52,
word_9DEA54,
word_9DEA56);
RCT2_GLOBAL(0x009DE578, rct_map_element*) = curMapElement;
RCT2_GLOBAL(RCT2_ADDRESS_PAINT_SETUP_CURRENT_TYPE, uint8) = VIEWPORT_INTERACTION_ITEM_RIDE;
@ -346,10 +355,7 @@ static void top_spin_paint_tile_1(uint8 rideIndex, uint8 trackSequence, uint8 di
image_id = 22137 | RCT2_GLOBAL(0x00F44198, 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, get_current_rotation(), 0, 0, height);
sint16 x = RCT2_GLOBAL(0x009DE56A, sint16), y = RCT2_GLOBAL(0x009DE56E, sint16);
uint16 entranceLoc =
@ -362,11 +368,8 @@ 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);
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, 0, 2, height + 2);
}
entranceLoc =
@ -376,11 +379,8 @@ 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);
RCT2_GLOBAL(0x009DEA52, uint16) = 0;
RCT2_GLOBAL(0x009DEA54, uint16) = 2;
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, 0, 0, 2, height + 2);
}
top_spin_paint_vehicle(32, 32, rideIndex, direction, height, mapElement);
@ -415,10 +415,7 @@ static void top_spin_paint_tile_2(uint8 rideIndex, uint8 trackSequence, uint8 di
image_id = 22137 | RCT2_GLOBAL(0x00F44198, 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, get_current_rotation(), 0, 0, height);
sint16 x = RCT2_GLOBAL(0x009DE56A, sint16), y = RCT2_GLOBAL(0x009DE56E, sint16);
uint16 entranceLoc =
@ -431,11 +428,8 @@ 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);
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, 0, 2, 0, height + 2);
}
RCT2_GLOBAL(0x141E9B4, uint16) = 0xFFFF;
@ -465,10 +459,7 @@ static void top_spin_paint_tile_4(uint8 rideIndex, uint8 trackSequence, uint8 di
image_id = 22137 | RCT2_GLOBAL(0x00F44198, 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, get_current_rotation(), 0, 0, height);
sint16 x = RCT2_GLOBAL(0x009DE56A, sint16), y = RCT2_GLOBAL(0x009DE56E, sint16);
uint16 entranceLoc =
@ -481,11 +472,8 @@ 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);
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, 0, 2, height + 2);
}
RCT2_GLOBAL(0x141E9B4, uint16) = 0xFFFF;
@ -515,10 +503,7 @@ static void top_spin_paint_tile_3(uint8 rideIndex, uint8 trackSequence, uint8 di
image_id = 22136 | RCT2_GLOBAL(0x00F44198, 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, get_current_rotation(), 0, 0, height);
sint16 x = RCT2_GLOBAL(0x009DE56A, sint16), y = RCT2_GLOBAL(0x009DE56E, sint16);
uint16 entranceLoc =
@ -531,11 +516,8 @@ 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);
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, 0, 2, 0, height + 2);
}
entranceLoc =
@ -546,10 +528,7 @@ static void top_spin_paint_tile_3(uint8 rideIndex, uint8 trackSequence, uint8 di
image_id = 22139 | RCT2_GLOBAL(0x00F441A0, 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, get_current_rotation(), 0, 30, height + 2);
}
top_spin_paint_vehicle(32, -32, rideIndex, direction, height, mapElement);
@ -584,10 +563,7 @@ static void top_spin_paint_tile_5(uint8 rideIndex, uint8 trackSequence, uint8 di
image_id = 22136 | RCT2_GLOBAL(0x00F44198, 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, get_current_rotation(), 0, 0, height);
sint16 x = RCT2_GLOBAL(0x009DE56A, sint16), y = RCT2_GLOBAL(0x009DE56E, sint16);
uint8 entranceId = (mapElement->properties.track.sequence & 0x70) >> 4;
@ -600,10 +576,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);
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, get_current_rotation(), 0, 30, height + 2);
}
top_spin_paint_vehicle(0, -32, rideIndex, direction, height, mapElement);
@ -635,10 +608,10 @@ static void top_spin_paint_tile_6(uint8 rideIndex, uint8 trackSequence, uint8 di
image_id = 22135 | RCT2_GLOBAL(0x00F44198, 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());
uint16 word_9DEA52 = 0;
uint16 word_9DEA54 = 0;
uint16 word_9DEA56 = height;
sub_98197C(image_id, 0, 0, 32, 32, 1, height, get_current_rotation(), word_9DEA52, word_9DEA54, word_9DEA56);
sint16 x = RCT2_GLOBAL(0x009DE56A, sint16), y = RCT2_GLOBAL(0x009DE56E, sint16);
uint16 entranceLoc =
@ -651,11 +624,8 @@ 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);
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, 0, 2, height + 2);
}
entranceLoc =
@ -665,11 +635,11 @@ 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);
RCT2_GLOBAL(0x009DEA52, uint16) = 30;
RCT2_GLOBAL(0x009DEA54, uint16) = 2;
RCT2_GLOBAL(0x009DEA56, uint16) = height + 2;
word_9DEA52 = 30;
word_9DEA54 = 2;
word_9DEA56 = 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, get_current_rotation(), word_9DEA52, word_9DEA54, word_9DEA56);
}
top_spin_paint_vehicle(-32, 32, rideIndex, direction, height, mapElement);
@ -704,10 +674,7 @@ static void top_spin_paint_tile_7(uint8 rideIndex, uint8 trackSequence, uint8 di
image_id = 22134 | RCT2_GLOBAL(0x00F44198, 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, get_current_rotation(), 0, 0, height);
sint16 x = RCT2_GLOBAL(0x009DE56A, sint16), y = RCT2_GLOBAL(0x009DE56E, sint16);
uint8 entranceId = (mapElement->properties.track.sequence & 0x70) >> 4;
@ -721,10 +688,7 @@ static void top_spin_paint_tile_7(uint8 rideIndex, uint8 trackSequence, uint8 di
image_id = 22140 | RCT2_GLOBAL(0x00F441A0, uint32);
RCT2_GLOBAL(0x009DEA52, uint16) = 29;
RCT2_GLOBAL(0x009DEA54, uint16) = 0;
RCT2_GLOBAL(0x009DEA56, uint16) = height + 3;
sub_98197C(image_id, 0, 0, 1, 28, 7, height, get_current_rotation());
sub_98197C(image_id, 0, 0, 1, 28, 7, height, get_current_rotation(), 29, 0, height + 3);
}
entranceLoc =
@ -735,10 +699,7 @@ static void top_spin_paint_tile_7(uint8 rideIndex, uint8 trackSequence, uint8 di
image_id = 22139 | RCT2_GLOBAL(0x00F441A0, uint32);
RCT2_GLOBAL(0x009DEA52, uint16) = 0;
RCT2_GLOBAL(0x009DEA54, uint16) = 29;
RCT2_GLOBAL(0x009DEA56, uint16) = height + 3;
sub_98197C(image_id, 0, 0, 28, 1, 7, height, get_current_rotation());
sub_98197C(image_id, 0, 0, 28, 1, 7, height, get_current_rotation(), 0, 29, height + 3);
}
top_spin_paint_vehicle(-32, -32, rideIndex, direction, height, mapElement);
@ -773,10 +734,7 @@ static void top_spin_paint_tile_8(uint8 rideIndex, uint8 trackSequence, uint8 di
image_id = 22135 | RCT2_GLOBAL(0x00F44198, 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, get_current_rotation(), 0, 0, height);
sint16 x = RCT2_GLOBAL(0x009DE56A, sint16), y = RCT2_GLOBAL(0x009DE56E, sint16);
uint8 entranceId = (mapElement->properties.track.sequence & 0x70) >> 4;
@ -789,11 +747,8 @@ 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);
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, get_current_rotation(), 30, 0, height + 2);
}
top_spin_paint_vehicle(-32, 0, rideIndex, direction, height, mapElement);
@ -1020,20 +975,11 @@ static void shop_paint_setup(uint8 rideIndex, uint8 trackSequence, uint8 directi
uint32 foundationImageId = RCT2_GLOBAL(0x00F441A4, uint32);
foundationImageId |= 3395;
RCT2_GLOBAL(0x009DEA52, uint16) = 2;
RCT2_GLOBAL(0x009DEA54, uint16) = 2;
RCT2_GLOBAL(0x009DEA56, sint16) = height16;
sub_98197C(foundationImageId, 0, 0, 28, 28, 45, height, rotation);
sub_98197C(foundationImageId, 0, 0, 28, 28, 45, height, rotation, 2, 2, height16);
RCT2_GLOBAL(0x009DEA52, uint16) = 2;
RCT2_GLOBAL(0x009DEA54, uint16) = 2;
RCT2_GLOBAL(0x009DEA56, sint16) = height16;
sub_98199C(imageId, 0, 0, 28, 28, 45, height, rotation);
sub_98199C(imageId, 0, 0, 28, 28, 45, height, rotation, 2, 2, height16);
} else {
RCT2_GLOBAL(0x009DEA52, uint16) = 2;
RCT2_GLOBAL(0x009DEA54, uint16) = 2;
RCT2_GLOBAL(0x009DEA56, sint16) = height16;
sub_98197C(imageId, 0, 0, 28, 28, 45, height, rotation);
sub_98197C(imageId, 0, 0, 28, 28, 45, height, rotation, 2, 2, height16);
}
height16 += 48;
@ -1090,38 +1036,23 @@ static void facility_paint_setup(uint8 rideIndex, uint8 trackSequence, uint8 dir
uint32 foundationImageId = RCT2_GLOBAL(0x00F441A4, uint32);
foundationImageId |= 3395;
RCT2_GLOBAL(0x009DEA52, uint16) = direction == 3 ? 28 : 2;
RCT2_GLOBAL(0x009DEA54, uint16) = direction == 0 ? 28 : 2;
RCT2_GLOBAL(0x009DEA56, sint16) = height16;
sub_98197C(foundationImageId, 0, 0, lengthX, lengthY, 29, height, rotation);
sub_98197C(foundationImageId, 0, 0, lengthX, lengthY, 29, height, rotation, direction == 3 ? 28 : 2, direction == 0 ? 28 : 2, height16);
// Door image or base
RCT2_GLOBAL(0x009DEA52, uint16) = direction == 3 ? 28 : 2;
RCT2_GLOBAL(0x009DEA54, uint16) = direction == 0 ? 28 : 2;
RCT2_GLOBAL(0x009DEA56, sint16) = height16;
sub_98199C(imageId, 0, 0, lengthX, lengthY, 29, height, rotation);
sub_98199C(imageId, 0, 0, lengthX, lengthY, 29, height, rotation, direction == 3 ? 28 : 2, direction == 0 ? 28 : 2, height16);
} else {
// Door image or base
RCT2_GLOBAL(0x009DEA52, uint16) = direction == 3 ? 28 : 2;
RCT2_GLOBAL(0x009DEA54, uint16) = direction == 0 ? 28 : 2;
RCT2_GLOBAL(0x009DEA56, sint16) = height16;
sub_98197C(imageId, 0, 0, lengthX, lengthY, 29, height, rotation);
sub_98197C(imageId, 0, 0, lengthX, lengthY, 29, height, rotation, direction == 3 ? 28 : 2, direction == 0 ? 28 : 2, height16);
}
// Base image if door was drawn
if (direction == 1) {
imageId += 2;
RCT2_GLOBAL(0x009DEA52, uint16) = 28;
RCT2_GLOBAL(0x009DEA54, uint16) = 2;
RCT2_GLOBAL(0x009DEA56, sint16) = height16;
sub_98197C(imageId, 0, 0, 2, 28, 29, height, rotation);
sub_98197C(imageId, 0, 0, 2, 28, 29, height, rotation, 28, 2, height16);
} else if (direction == 2) {
imageId += 4;
RCT2_GLOBAL(0x009DEA52, uint16) = 2;
RCT2_GLOBAL(0x009DEA54, uint16) = 28;
RCT2_GLOBAL(0x009DEA56, sint16) = height16;
sub_98197C(imageId, 0, 0, 28, 2, 29, height, rotation);
sub_98197C(imageId, 0, 0, 28, 2, 29, height, rotation, 2, 28, height16);
}
height16 += 32;