From 8d015f37a9ac5b801223cae3c44c20dd278f8b3a Mon Sep 17 00:00:00 2001 From: zsilencer Date: Sun, 15 May 2016 06:11:09 -0600 Subject: [PATCH] Fix #3601: Assert in paint.c --- src/paint/paint.c | 11 ++++------- src/paint/paint.h | 8 ++++---- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/paint/paint.c b/src/paint/paint.c index 13e3e677d2..1fdb6a2058 100644 --- a/src/paint/paint.c +++ b/src/paint/paint.c @@ -151,12 +151,11 @@ paint_struct * 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, + sint16 z_offset, uint32 rotation ) { assert((uint16) bound_box_length_x == (sint16) bound_box_length_x); assert((uint16) bound_box_length_y == (sint16) bound_box_length_y); - assert((uint16) z_offset == (sint16) z_offset); RCT2_GLOBAL(0xF1AD28, paint_struct*) = 0; RCT2_GLOBAL(0xF1AD2C, uint32) = 0; @@ -323,7 +322,7 @@ paint_struct * 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 z_offset, sint16 bound_box_offset_x, sint16 bound_box_offset_y, sint16 bound_box_offset_z, uint32 rotation ) { @@ -407,13 +406,12 @@ paint_struct * 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 z_offset, sint16 bound_box_offset_x, sint16 bound_box_offset_y, sint16 bound_box_offset_z, uint32 rotation ) { assert((uint16) bound_box_length_x == (sint16) bound_box_length_x); assert((uint16) bound_box_length_y == (sint16) bound_box_length_y); - assert((uint16) z_offset == (sint16) z_offset); RCT2_GLOBAL(0xF1AD28, paint_struct*) = 0; RCT2_GLOBAL(0xF1AD2C, uint32) = 0; @@ -453,13 +451,12 @@ paint_struct * 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 z_offset, sint16 bound_box_offset_x, sint16 bound_box_offset_y, sint16 bound_box_offset_z, uint32 rotation ) { assert((uint16) bound_box_length_x == (sint16) bound_box_length_x); assert((uint16) bound_box_length_y == (sint16) bound_box_length_y); - assert((uint16) z_offset == (sint16) z_offset); if (RCT2_GLOBAL(0xF1AD28, uint32) == 0) { return sub_98197C( diff --git a/src/paint/paint.h b/src/paint/paint.h index 0d9778d361..8e5bff4fcf 100644 --- a/src/paint/paint.h +++ b/src/paint/paint.h @@ -87,10 +87,10 @@ enum PAINT_STRUCT_FLAGS { void painter_setup(); -paint_struct * 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); -paint_struct * 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); -paint_struct * 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); -paint_struct * 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, sint16 bound_box_offset_y, sint16 bound_box_offset_z, uint32 rotation); +paint_struct * 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, sint16 z_offset, uint32 rotation); +paint_struct * 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, sint16 z_offset, sint16 bound_box_offset_x, sint16 bound_box_offset_y, sint16 bound_box_offset_z, uint32 rotation); +paint_struct * 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, sint16 z_offset, sint16 bound_box_offset_x, sint16 bound_box_offset_y, sint16 bound_box_offset_z, uint32 rotation); +paint_struct * 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, sint16 z_offset, sint16 bound_box_offset_x, sint16 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_ps(uint32 image_id, uint16 x, uint16 y);