diff --git a/src/paint/paint.c b/src/paint/paint.c index e054232a4e..13e3e677d2 100644 --- a/src/paint/paint.c +++ b/src/paint/paint.c @@ -298,7 +298,7 @@ paint_struct * sub_98196C( RCT2_GLOBAL(0x00F1AD10, uint32) = edi; } - RCT2_GLOBAL(0xEE7888, uint32) += 0x34; + RCT2_GLOBAL(0xEE7888, paint_struct*) ++; return ps; } @@ -469,7 +469,7 @@ paint_struct * sub_98199C( z_offset, bound_box_offset_x, bound_box_offset_y, bound_box_offset_z, rotation - ) == 1; + ); } rct_xyz16 offset = {.x = x_offset, .y = y_offset, .z = z_offset}; @@ -596,7 +596,7 @@ void sub_685EBC(money32 amount, uint16 string_id, sint16 y, sint16 z, sint8 y_of ps->x = coord.x + offset_x; ps->y = coord.y; - RCT2_GLOBAL(0xEE7888, uint32) += 0x1E; + RCT2_GLOBAL(0xEE7888, paint_string_struct*)++; paint_string_struct * oldPs = RCT2_GLOBAL(0xF1AD24, paint_string_struct*); diff --git a/src/paint/supports.c b/src/paint/supports.c index 1ff7e04c4a..3459fd771b 100644 --- a/src/paint/supports.c +++ b/src/paint/supports.c @@ -295,9 +295,10 @@ bool wooden_a_supports_paint_setup(int supportType, int special, int height, uin hasSupports = true; } else { hasSupports = true; - if (sub_98198C(imageId, 0, 0, bBox.length.x, bBox.length.y, bBox.length.z, z, bBox.offset.x, bBox.offset.y, bBox.offset.z + z, rotation)) { - int edi = RCT2_GLOBAL(0x009DEA58, uint32); - RCT2_GLOBAL(edi + 0x20, uint32) = imageColourFlags; + paint_struct* ps = sub_98198C(imageId, 0, 0, bBox.length.x, bBox.length.y, bBox.length.z, z, bBox.offset.x, bBox.offset.y, bBox.offset.z + z, rotation); + if (ps != NULL) { + paint_struct* edi = RCT2_GLOBAL(0x009DEA58, paint_struct*); + edi->var_20 = ps; } } } diff --git a/src/ride/gentle/observation_tower.c b/src/ride/gentle/observation_tower.c index 7b0b34489a..60e74715de 100644 --- a/src/ride/gentle/observation_tower.c +++ b/src/ride/gentle/observation_tower.c @@ -43,14 +43,15 @@ void vehicle_visual_observation_tower(int x, int imageDirection, int y, int z, r } image_id = baseImage_id | (vehicle->colours.body_colour << 19) | (vehicle->colours.trim_colour << 24) | 0x80000000; - if (sub_98197C(image_id, 0, 0, 2, 2, 41, z, -11, -11, z + 1, get_current_rotation())) { - paint_struct* ps = RCT2_GLOBAL(0xEE7888, paint_struct*) - 1; // sub_98197C increments this but need original + paint_struct* ps = sub_98197C(image_id, 0, 0, 2, 2, 41, z, -11, -11, z + 1, get_current_rotation()); + if (ps != NULL) { ps->tertiary_colour = vehicle->colours_extended; } image_id++; - if (sub_98197C(image_id, 0, 0, 16, 16, 41, z, -5, -5, z + 1, get_current_rotation())) { - paint_struct* ps = RCT2_GLOBAL(0xEE7888, paint_struct*) - 1; // sub_98197C increments this but need original + + ps = sub_98197C(image_id, 0, 0, 16, 16, 41, z, -5, -5, z + 1, get_current_rotation()); + if (ps != NULL) { ps->tertiary_colour = vehicle->colours_extended; } diff --git a/src/ride/vehicle_paint.c b/src/ride/vehicle_paint.c index 3c7a7204f5..1fe49eee2c 100644 --- a/src/ride/vehicle_paint.c +++ b/src/ride/vehicle_paint.c @@ -900,8 +900,8 @@ void vehicle_sprite_paint(rct_vehicle *vehicle, int ebx, int ecx, int z, const r baseImage_id += vehicle->var_C5; } int image_id = baseImage_id | (vehicle->colours.body_colour << 19) | (vehicle->colours.trim_colour << 24) | 0x80000000; - if (sub_98197C(image_id, 0, 0, bb.length_x, bb.length_y, bb.length_z, z, bb.offset_x, bb.offset_y, bb.offset_z + z, get_current_rotation())) { - paint_struct* ps = RCT2_GLOBAL(0xEE7888, paint_struct*) - 1; // sub_98197C increments this but need original + paint_struct* ps = sub_98197C(image_id, 0, 0, bb.length_x, bb.length_y, bb.length_z, z, bb.offset_x, bb.offset_y, bb.offset_z + z, get_current_rotation()); + if (ps != NULL) { ps->tertiary_colour = vehicle->colours_extended; } rct_drawpixelinfo* dpi = RCT2_GLOBAL(0x0140E9A8, rct_drawpixelinfo*); diff --git a/src/ride/water/submarine_ride.c b/src/ride/water/submarine_ride.c index 7a22b05780..0eb50a4f2f 100644 --- a/src/ride/water/submarine_ride.c +++ b/src/ride/water/submarine_ride.c @@ -51,14 +51,14 @@ void vehicle_visual_submarine(int x, int imageDirection, int y, int z, rct_vehic vehicle_boundbox bb = VehicleBoundboxes[vehicleEntry->draw_order][imageDirection / 2]; image_id = baseImage_id | (vehicle->colours.body_colour << 19) | (vehicle->colours.trim_colour << 24) | 0x80000000; - if (sub_98197C(image_id, 0, 0, bb.length_x, bb.length_y, bb.length_z, z, bb.offset_x, bb.offset_y, bb.offset_z + z, get_current_rotation())) { - paint_struct* ps = RCT2_GLOBAL(0xEE7888, paint_struct*) - 1; // sub_98197C increments this but need original + paint_struct* ps = sub_98197C(image_id, 0, 0, bb.length_x, bb.length_y, bb.length_z, z, bb.offset_x, bb.offset_y, bb.offset_z + z, get_current_rotation()); + if (ps != NULL) { ps->tertiary_colour = vehicle->colours_extended; } image_id = (baseImage_id + 1) | (vehicle->colours.body_colour << 19) | (vehicle->colours.trim_colour << 24) | 0x80000000; - if (sub_98197C(image_id, 0, 0, bb.length_x, bb.length_y, 2, z, bb.offset_x, bb.offset_y, bb.offset_z + z - 10, get_current_rotation())) { - paint_struct* ps = RCT2_GLOBAL(0xEE7888, paint_struct*) - 1; // sub_98197C increments this but need original + ps = sub_98197C(image_id, 0, 0, bb.length_x, bb.length_y, 2, z, bb.offset_x, bb.offset_y, bb.offset_z + z - 10, get_current_rotation()); + if (ps != NULL) { ps->tertiary_colour = vehicle->colours_extended; }