1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-24 00:03:11 +01:00

Update method signature

This commit is contained in:
Marijn van der Werf
2016-04-17 09:42:34 +02:00
parent cb9b31f873
commit 18a36298b4
4 changed files with 156 additions and 175 deletions

View File

@@ -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;