mirror of https://github.com/OpenRCT2/OpenRCT2.git
Make 8c match 7c
This commit is contained in:
parent
e28d5e7d6b
commit
a595b1fa96
|
@ -161,6 +161,8 @@ bool sub_98196C(
|
||||||
ps->map_y = RCT2_GLOBAL(0x9DE576, uint16);
|
ps->map_y = RCT2_GLOBAL(0x9DE576, uint16);
|
||||||
ps->mapElement = RCT2_GLOBAL(0x9DE578, rct_map_element*);
|
ps->mapElement = RCT2_GLOBAL(0x9DE578, rct_map_element*);
|
||||||
|
|
||||||
|
RCT2_GLOBAL(0xF1AD28, paint_struct*) = ps;
|
||||||
|
|
||||||
sint32 edi;
|
sint32 edi;
|
||||||
switch (rotation) {
|
switch (rotation) {
|
||||||
case 0:
|
case 0:
|
||||||
|
@ -285,17 +287,19 @@ bool sub_98197C(
|
||||||
|
|
||||||
if (right <= dpi->x)return false;
|
if (right <= dpi->x)return false;
|
||||||
if (top <= dpi->y)return false;
|
if (top <= dpi->y)return false;
|
||||||
if (left > dpi->x + dpi->width)return false;
|
if (left >= dpi->x + dpi->width)return false;
|
||||||
if (bottom > dpi->y + dpi->height)return false;
|
if (bottom >= dpi->y + dpi->height)return false;
|
||||||
|
|
||||||
rct_xy16 boundBox = {
|
rct_xyz16 boundBox = {
|
||||||
.x = bound_box_length_x,
|
.x = bound_box_length_x,
|
||||||
.y = bound_box_length_y
|
.y = bound_box_length_y,
|
||||||
|
.z = bound_box_length_z
|
||||||
};
|
};
|
||||||
|
|
||||||
rct_xy16 boundBoxOffset = {
|
rct_xyz16 boundBoxOffset = {
|
||||||
.x = bound_box_offset_x,
|
.x = bound_box_offset_x,
|
||||||
.y = bound_box_offset_y
|
.y = bound_box_offset_y,
|
||||||
|
.z = bound_box_offset_z
|
||||||
};
|
};
|
||||||
|
|
||||||
// Unsure why rots 1 and 3 need to swap
|
// Unsure why rots 1 and 3 need to swap
|
||||||
|
@ -323,9 +327,8 @@ bool sub_98197C(
|
||||||
}
|
}
|
||||||
|
|
||||||
ps->bound_box_x_end = boundBox.x + boundBoxOffset.x + RCT2_GLOBAL(0x9DE568, sint16);
|
ps->bound_box_x_end = boundBox.x + boundBoxOffset.x + RCT2_GLOBAL(0x9DE568, sint16);
|
||||||
ps->bound_box_z = bound_box_offset_z;
|
ps->bound_box_z = boundBoxOffset.z;
|
||||||
int boundBoxZEnd = bound_box_length_z + bound_box_offset_z;
|
ps->bound_box_z_end = boundBoxOffset.z + boundBox.z;
|
||||||
ps->bound_box_z_end = boundBoxZEnd;
|
|
||||||
ps->bound_box_y_end = boundBox.y + boundBoxOffset.y + RCT2_GLOBAL(0x009DE56C, sint16);
|
ps->bound_box_y_end = boundBox.y + boundBoxOffset.y + RCT2_GLOBAL(0x009DE56C, sint16);
|
||||||
ps->flags = 0;
|
ps->flags = 0;
|
||||||
ps->bound_box_x = boundBoxOffset.x + RCT2_GLOBAL(0x9DE568, sint16);
|
ps->bound_box_x = boundBoxOffset.x + RCT2_GLOBAL(0x9DE568, sint16);
|
||||||
|
@ -398,7 +401,7 @@ bool sub_98197C(
|
||||||
* @param bound_box_offset_x (0x009DEA52)
|
* @param bound_box_offset_x (0x009DEA52)
|
||||||
* @param bound_box_offset_y (0x009DEA54)
|
* @param bound_box_offset_y (0x009DEA54)
|
||||||
* @param bound_box_offset_z (0x009DEA56)
|
* @param bound_box_offset_z (0x009DEA56)
|
||||||
* @param rotation
|
* @param rotation (ebp)
|
||||||
* @return (!CF) success
|
* @return (!CF) success
|
||||||
*/
|
*/
|
||||||
bool sub_98198C(
|
bool sub_98198C(
|
||||||
|
@ -406,21 +409,20 @@ bool sub_98198C(
|
||||||
sint8 x_offset, sint8 y_offset,
|
sint8 x_offset, sint8 y_offset,
|
||||||
sint16 bound_box_length_x, sint16 bound_box_length_y, sint8 bound_box_length_z,
|
sint16 bound_box_length_x, sint16 bound_box_length_y, sint8 bound_box_length_z,
|
||||||
uint16 z_offset,
|
uint16 z_offset,
|
||||||
sint16 bound_box_offset_x, uint16 bound_box_offset_y, sint16 bound_box_offset_z,
|
sint16 bound_box_offset_x, sint16 bound_box_offset_y, sint16 bound_box_offset_z,
|
||||||
uint32 rotation
|
uint32 rotation
|
||||||
) {
|
) {
|
||||||
assert((uint16) bound_box_length_x == (sint16) bound_box_length_x);
|
assert((uint16) bound_box_length_x == (sint16) bound_box_length_x);
|
||||||
assert((uint16) bound_box_length_y == (sint16) bound_box_length_y);
|
assert((uint16) bound_box_length_y == (sint16) bound_box_length_y);
|
||||||
assert((uint16) z_offset == (sint16) z_offset);
|
assert((uint16) z_offset == (sint16) z_offset);
|
||||||
|
|
||||||
RCT2_GLOBAL(0xF1AD28, uint32) = 0;
|
RCT2_GLOBAL(0xF1AD28, paint_struct*) = 0;
|
||||||
RCT2_GLOBAL(0xF1AD2C, uint32) = 0;
|
RCT2_GLOBAL(0xF1AD2C, uint32) = 0;
|
||||||
|
|
||||||
//Not a paint struct but something similar
|
//Not a paint struct but something similar
|
||||||
paint_struct* ps = RCT2_GLOBAL(0xEE7888, paint_struct*);
|
paint_struct* ps = RCT2_GLOBAL(0xEE7888, paint_struct*);
|
||||||
if ((uint32) ps >= RCT2_GLOBAL(0xEE7880, uint32)) {
|
|
||||||
return false;
|
if ((uint32)ps >= RCT2_GLOBAL(0xEE7880, uint32))return false;
|
||||||
}
|
|
||||||
|
|
||||||
ps->image_id = image_id;
|
ps->image_id = image_id;
|
||||||
|
|
||||||
|
@ -428,28 +430,25 @@ bool sub_98198C(
|
||||||
rct_g1_element *g1Element = gfx_get_g1_element(image_element);
|
rct_g1_element *g1Element = gfx_get_g1_element(image_element);
|
||||||
|
|
||||||
rct_xyz16 coord_3d = {
|
rct_xyz16 coord_3d = {
|
||||||
.x = x_offset, // ax
|
.x = x_offset,
|
||||||
.y = y_offset, // cx
|
.y = y_offset,
|
||||||
.z = z_offset
|
.z = z_offset
|
||||||
};
|
};
|
||||||
|
|
||||||
switch (rotation) {
|
switch (rotation) {
|
||||||
|
case 0:
|
||||||
|
rotate_map_coordinates(&coord_3d.x, &coord_3d.y, 0);
|
||||||
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
coord_3d.x = -y_offset;
|
rotate_map_coordinates(&coord_3d.x, &coord_3d.y, 3);
|
||||||
coord_3d.y = x_offset;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
coord_3d.x = -x_offset;
|
rotate_map_coordinates(&coord_3d.x, &coord_3d.y, 2);
|
||||||
coord_3d.y = -y_offset;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 3:
|
case 3:
|
||||||
coord_3d.x = y_offset;
|
rotate_map_coordinates(&coord_3d.x, &coord_3d.y, 1);
|
||||||
coord_3d.y = -x_offset;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
coord_3d.x += RCT2_GLOBAL(0x9DE568, sint16);
|
coord_3d.x += RCT2_GLOBAL(0x9DE568, sint16);
|
||||||
coord_3d.y += RCT2_GLOBAL(0x9DE56C, sint16);
|
coord_3d.y += RCT2_GLOBAL(0x9DE56C, sint16);
|
||||||
|
|
||||||
|
@ -471,14 +470,8 @@ bool sub_98198C(
|
||||||
|
|
||||||
if (right <= dpi->x)return false;
|
if (right <= dpi->x)return false;
|
||||||
if (top <= dpi->y)return false;
|
if (top <= dpi->y)return false;
|
||||||
if (left >= (dpi->x + dpi->width)) return false;
|
if (left >= dpi->x + dpi->width)return false;
|
||||||
if (bottom >= (dpi->y + dpi->height)) return false;
|
if (bottom >= dpi->y + dpi->height)return false;
|
||||||
|
|
||||||
rct_xyz16 boundBoxOffset = {
|
|
||||||
.x = bound_box_offset_x,
|
|
||||||
.y = bound_box_offset_y,
|
|
||||||
.z = bound_box_offset_z,
|
|
||||||
};
|
|
||||||
|
|
||||||
rct_xyz16 boundBox = {
|
rct_xyz16 boundBox = {
|
||||||
.x = bound_box_length_x,
|
.x = bound_box_length_x,
|
||||||
|
@ -486,64 +479,53 @@ bool sub_98198C(
|
||||||
.z = bound_box_length_z
|
.z = bound_box_length_z
|
||||||
};
|
};
|
||||||
|
|
||||||
sint16 temp;
|
rct_xyz16 boundBoxOffset = {
|
||||||
|
.x = bound_box_offset_x,
|
||||||
|
.y = bound_box_offset_y,
|
||||||
|
.z = bound_box_offset_z
|
||||||
|
};
|
||||||
|
|
||||||
|
// Unsure why rots 1 and 3 need to swap
|
||||||
switch (rotation) {
|
switch (rotation) {
|
||||||
case 0:
|
case 0:
|
||||||
boundBox.x--;
|
boundBox.x--;
|
||||||
boundBox.y--;
|
boundBox.y--;
|
||||||
|
rotate_map_coordinates(&boundBoxOffset.x, &boundBoxOffset.y, 0);
|
||||||
|
rotate_map_coordinates(&boundBox.x, &boundBox.y, 0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
boundBoxOffset.x = bound_box_offset_y;
|
|
||||||
boundBoxOffset.y = -bound_box_offset_x;
|
|
||||||
|
|
||||||
boundBox.x--;
|
boundBox.x--;
|
||||||
temp = boundBox.x;
|
rotate_map_coordinates(&boundBoxOffset.x, &boundBoxOffset.y, 3);
|
||||||
boundBox.x = boundBox.y;
|
rotate_map_coordinates(&boundBox.x, &boundBox.y, 3);
|
||||||
boundBox.y = temp;
|
|
||||||
boundBox.x = -boundBox.x;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
boundBoxOffset.x = -boundBoxOffset.x;
|
rotate_map_coordinates(&boundBox.x, &boundBox.y, 2);
|
||||||
boundBoxOffset.y = -boundBoxOffset.y;
|
rotate_map_coordinates(&boundBoxOffset.x, &boundBoxOffset.y, 2);
|
||||||
|
|
||||||
boundBox.x = -boundBox.x;
|
|
||||||
boundBox.y = -boundBox.y;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 3:
|
case 3:
|
||||||
boundBoxOffset.x = bound_box_offset_y;
|
|
||||||
boundBoxOffset.y = -bound_box_offset_x;
|
|
||||||
|
|
||||||
boundBox.y--;
|
boundBox.y--;
|
||||||
temp = boundBox.x;
|
rotate_map_coordinates(&boundBox.x, &boundBox.y, 1);
|
||||||
boundBox.x = boundBox.y;
|
rotate_map_coordinates(&boundBoxOffset.x, &boundBoxOffset.y, 1);
|
||||||
boundBox.y = temp;
|
|
||||||
boundBox.y = -boundBox.y;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
ps->bound_box_x_end = boundBox.x + boundBoxOffset.x + RCT2_GLOBAL(0x009DE568, sint16);
|
ps->bound_box_x_end = boundBox.x + boundBoxOffset.x + RCT2_GLOBAL(0x9DE568, sint16);
|
||||||
ps->bound_box_y_end = boundBox.y + boundBoxOffset.y + RCT2_GLOBAL(0x009DE56C, sint16);
|
|
||||||
|
|
||||||
// TODO: check whether this is right. edx is ((bound_box_length_z + bound_box_offset_z) << 16 | bound_box_offset_z)
|
|
||||||
ps->bound_box_z = boundBoxOffset.z;
|
ps->bound_box_z = boundBoxOffset.z;
|
||||||
ps->bound_box_z_end = boundBoxOffset.z + boundBox.z;
|
ps->bound_box_z_end = boundBoxOffset.z + boundBox.z;
|
||||||
|
ps->bound_box_y_end = boundBox.y + boundBoxOffset.y + RCT2_GLOBAL(0x009DE56C, sint16);
|
||||||
ps->flags = 0;
|
ps->flags = 0;
|
||||||
ps->bound_box_x = boundBoxOffset.x + RCT2_GLOBAL(0x009DE568, sint16);
|
ps->bound_box_x = boundBoxOffset.x + RCT2_GLOBAL(0x9DE568, sint16);
|
||||||
ps->bound_box_y = boundBoxOffset.y + RCT2_GLOBAL(0x009DE56C, sint16);
|
ps->bound_box_y = boundBoxOffset.y + RCT2_GLOBAL(0x009DE56C, sint16);
|
||||||
ps->attached_ps = NULL;
|
ps->attached_ps = NULL;
|
||||||
ps->var_20 = NULL;
|
ps->var_20 = NULL;
|
||||||
ps->sprite_type = RCT2_GLOBAL(RCT2_ADDRESS_PAINT_SETUP_CURRENT_TYPE, uint8);
|
ps->sprite_type = RCT2_GLOBAL(RCT2_ADDRESS_PAINT_SETUP_CURRENT_TYPE, uint8);
|
||||||
|
ps->var_29 = RCT2_GLOBAL(0x9DE571, uint8);
|
||||||
ps->map_x = RCT2_GLOBAL(0x9DE574, uint16);
|
ps->map_x = RCT2_GLOBAL(0x9DE574, uint16);
|
||||||
ps->map_y = RCT2_GLOBAL(0x9DE576, uint16);
|
ps->map_y = RCT2_GLOBAL(0x9DE576, uint16);
|
||||||
ps->mapElement = RCT2_GLOBAL(0x9DE578, rct_map_element*);
|
ps->mapElement = RCT2_GLOBAL(0x9DE578, rct_map_element*);
|
||||||
|
|
||||||
RCT2_GLOBAL(0xEE7888, paint_struct*) += 0x34;
|
|
||||||
RCT2_GLOBAL(0xF1AD28, paint_struct*) = ps;
|
RCT2_GLOBAL(0xF1AD28, paint_struct*) = ps;
|
||||||
|
RCT2_GLOBAL(0xEE7888, paint_struct*)++;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -89,7 +89,7 @@ void painter_setup();
|
||||||
|
|
||||||
bool sub_98196C(uint32 image_id, sint8 x_offset, sint8 y_offset, sint16 bound_box_length_x, sint16 bound_box_length_y, sint8 bound_box_length_z, uint16 z_offset, uint32 rotation);
|
bool sub_98196C(uint32 image_id, sint8 x_offset, sint8 y_offset, sint16 bound_box_length_x, sint16 bound_box_length_y, sint8 bound_box_length_z, uint16 z_offset, uint32 rotation);
|
||||||
bool sub_98197C(uint32 image_id, sint8 x_offset, sint8 y_offset, sint16 bound_box_length_x, sint16 bound_box_length_y, sint8 bound_box_length_z, uint16 z_offset, sint16 bound_box_offset_x, sint16 bound_box_offset_y, sint16 bound_box_offset_z, uint32 rotation);
|
bool sub_98197C(uint32 image_id, sint8 x_offset, sint8 y_offset, sint16 bound_box_length_x, sint16 bound_box_length_y, sint8 bound_box_length_z, uint16 z_offset, sint16 bound_box_offset_x, sint16 bound_box_offset_y, sint16 bound_box_offset_z, uint32 rotation);
|
||||||
bool sub_98198C(uint32 image_id, sint8 x_offset, sint8 y_offset, sint16 bound_box_length_x, sint16 bound_box_length_y, sint8 bound_box_length_z, uint16 z_offset, sint16 bound_box_offset_x, uint16 bound_box_offset_y, sint16 bound_box_offset_z, uint32 rotation);
|
bool sub_98198C(uint32 image_id, sint8 x_offset, sint8 y_offset, sint16 bound_box_length_x, sint16 bound_box_length_y, sint8 bound_box_length_z, uint16 z_offset, sint16 bound_box_offset_x, sint16 bound_box_offset_y, sint16 bound_box_offset_z, uint32 rotation);
|
||||||
bool sub_98199C(uint32 image_id, sint8 x_offset, sint8 y_offset, sint16 bound_box_length_x, sint16 bound_box_length_y, sint8 bound_box_length_z, uint16 z_offset, sint16 bound_box_offset_x, uint16 bound_box_offset_y, sint16 bound_box_offset_z, uint32 rotation);
|
bool sub_98199C(uint32 image_id, sint8 x_offset, sint8 y_offset, sint16 bound_box_length_x, sint16 bound_box_length_y, sint8 bound_box_length_z, uint16 z_offset, sint16 bound_box_offset_x, uint16 bound_box_offset_y, sint16 bound_box_offset_z, uint32 rotation);
|
||||||
|
|
||||||
bool paint_attach_to_previous_attach(uint32 image_id, uint16 x, uint16 y);
|
bool paint_attach_to_previous_attach(uint32 image_id, uint16 x, uint16 y);
|
||||||
|
|
Loading…
Reference in New Issue