mirror of https://github.com/OpenRCT2/OpenRCT2.git
Implement ghost drawing for special vehicles
This commit is contained in:
parent
5f1f428bce
commit
5c8aa743f6
|
@ -196,10 +196,14 @@ void vehicle_visual_virginia_reel(
|
|||
|
||||
const vehicle_boundbox* bb = &_virginiaReelBoundbox[j];
|
||||
image_id = baseImage_id | SPRITE_ID_PALETTE_COLOUR_2(vehicle->colours.body_colour, vehicle->colours.trim_colour);
|
||||
if (vehicle->IsGhost())
|
||||
{
|
||||
image_id = (image_id & 0x7FFFF) | CONSTRUCTION_MARKER;
|
||||
}
|
||||
sub_98197C(
|
||||
session, image_id, 0, 0, bb->length_x, bb->length_y, bb->length_z, z, bb->offset_x, bb->offset_y, bb->offset_z + z);
|
||||
|
||||
if (session->DPI.zoom_level < 2 && vehicle->num_peeps > 0)
|
||||
if (session->DPI.zoom_level < 2 && vehicle->num_peeps > 0 && !vehicle->IsGhost())
|
||||
{
|
||||
uint8_t riding_peep_sprites[4] = { 0xFF, 0xFF, 0xFF, 0xFF };
|
||||
for (int32_t i = 0; i < vehicle->num_peeps; i++)
|
||||
|
|
|
@ -54,8 +54,11 @@ void vehicle_visual_observation_tower(
|
|||
baseImage_id = (vehicle->animation_frame * 2) + vehicleEntry->base_image_id + 8;
|
||||
}
|
||||
|
||||
image_id = baseImage_id | (vehicle->colours.body_colour << 19) | (vehicle->colours.trim_colour << 24)
|
||||
| IMAGE_TYPE_REMAP_2_PLUS;
|
||||
image_id = baseImage_id | SPRITE_ID_PALETTE_COLOUR_3(vehicle->colours.body_colour, vehicle->colours.trim_colour << 24);
|
||||
if (vehicle->IsGhost())
|
||||
{
|
||||
image_id = (image_id & 0x7FFFF) | CONSTRUCTION_MARKER;
|
||||
}
|
||||
paint_struct* ps = sub_98197C(session, image_id, 0, 0, 2, 2, 41, z, -11, -11, z + 1);
|
||||
if (ps != nullptr)
|
||||
{
|
||||
|
|
|
@ -35,21 +35,23 @@ void vehicle_visual_launched_freefall(
|
|||
paint_session* session, int32_t x, int32_t imageDirection, int32_t y, int32_t z, const rct_vehicle* vehicle,
|
||||
const rct_ride_entry_vehicle* vehicleEntry)
|
||||
{
|
||||
int32_t image_id;
|
||||
int32_t baseImage_id = vehicleEntry->base_image_id + ((vehicle->restraints_position / 64) * 2);
|
||||
auto imageFlags = SPRITE_ID_PALETTE_COLOUR_2(vehicle->colours.body_colour, vehicle->colours.trim_colour);
|
||||
if (vehicle->IsGhost())
|
||||
{
|
||||
imageFlags = CONSTRUCTION_MARKER;
|
||||
}
|
||||
|
||||
// Draw back:
|
||||
image_id = (baseImage_id + 2) | SPRITE_ID_PALETTE_COLOUR_2(vehicle->colours.body_colour, vehicle->colours.trim_colour);
|
||||
int32_t baseImage_id = vehicleEntry->base_image_id + ((vehicle->restraints_position / 64) * 2);
|
||||
auto image_id = (baseImage_id + 2) | imageFlags;
|
||||
sub_98197C(session, image_id, 0, 0, 2, 2, 41, z, -11, -11, z + 1);
|
||||
|
||||
// Draw front:
|
||||
image_id = (baseImage_id + 1) | SPRITE_ID_PALETTE_COLOUR_2(vehicle->colours.body_colour, vehicle->colours.trim_colour);
|
||||
image_id = (baseImage_id + 1) | imageFlags;
|
||||
sub_98197C(session, image_id, 0, 0, 16, 16, 41, z, -5, -5, z + 1);
|
||||
|
||||
// Draw peeps:
|
||||
if (session->DPI.zoom_level < 2)
|
||||
{
|
||||
if (vehicle->num_peeps > 0)
|
||||
if (session->DPI.zoom_level < 2 && vehicle->num_peeps > 0 && !vehicle->IsGhost())
|
||||
{
|
||||
baseImage_id = vehicleEntry->base_image_id + 9;
|
||||
if ((vehicle->restraints_position / 64) == 3)
|
||||
|
@ -78,7 +80,6 @@ void vehicle_visual_launched_freefall(
|
|||
sub_98199C(session, image_id, 0, 0, 16, 16, 41, z, -5, -5, z + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
assert(vehicleEntry->effect_visual == 1);
|
||||
}
|
||||
|
|
|
@ -35,6 +35,12 @@ void vehicle_visual_roto_drop(
|
|||
paint_session* session, int32_t x, int32_t imageDirection, int32_t y, int32_t z, const rct_vehicle* vehicle,
|
||||
const rct_ride_entry_vehicle* vehicleEntry)
|
||||
{
|
||||
auto imageFlags = SPRITE_ID_PALETTE_COLOUR_2(vehicle->colours.body_colour, vehicle->colours.trim_colour);
|
||||
if (vehicle->IsGhost())
|
||||
{
|
||||
imageFlags = CONSTRUCTION_MARKER;
|
||||
}
|
||||
|
||||
int32_t image_id;
|
||||
int32_t baseImage_id = (vehicleEntry->base_image_id + 4) + ((vehicle->animation_frame / 4) & 0x3);
|
||||
if (vehicle->restraints_position >= 64)
|
||||
|
@ -44,13 +50,15 @@ void vehicle_visual_roto_drop(
|
|||
}
|
||||
|
||||
// Draw back:
|
||||
image_id = baseImage_id | SPRITE_ID_PALETTE_COLOUR_2(vehicle->colours.body_colour, vehicle->colours.trim_colour);
|
||||
image_id = baseImage_id | imageFlags;
|
||||
sub_98197C(session, image_id, 0, 0, 2, 2, 41, z, -11, -11, z + 1);
|
||||
|
||||
// Draw front:
|
||||
image_id = (baseImage_id + 4) | SPRITE_ID_PALETTE_COLOUR_2(vehicle->colours.body_colour, vehicle->colours.trim_colour);
|
||||
image_id = (baseImage_id + 4) | imageFlags;
|
||||
sub_98197C(session, image_id, 0, 0, 16, 16, 41, z, -5, -5, z + 1);
|
||||
|
||||
if (vehicle->num_peeps > 0 && !vehicle->IsGhost())
|
||||
{
|
||||
uint8_t riding_peep_sprites[64];
|
||||
std::fill_n(riding_peep_sprites, sizeof(riding_peep_sprites), 0xFF);
|
||||
for (int32_t i = 0; i < vehicle->num_peeps; i++)
|
||||
|
@ -79,6 +87,7 @@ void vehicle_visual_roto_drop(
|
|||
sub_98199C(session, image_id, 0, 0, 16, 16, 41, z, -5, -5, z + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
assert(vehicleEntry->effect_visual == 1);
|
||||
// Although called in original code, effect_visual (splash effects) are not used for many rides and does not make sense so
|
||||
|
|
|
@ -223,10 +223,15 @@ void vehicle_visual_river_rapids(
|
|||
|
||||
const vehicle_boundbox* bb = &_riverRapidsBoundbox[j];
|
||||
image_id = baseImage_id | SPRITE_ID_PALETTE_COLOUR_2(vehicle->colours.body_colour, vehicle->colours.trim_colour);
|
||||
if (vehicle->IsGhost())
|
||||
{
|
||||
image_id &= 0x7FFFF;
|
||||
image_id |= CONSTRUCTION_MARKER;
|
||||
}
|
||||
sub_98197C(
|
||||
session, image_id, 0, 0, bb->length_x, bb->length_y, bb->length_z, z, bb->offset_x, bb->offset_y, bb->offset_z + z);
|
||||
|
||||
if (session->DPI.zoom_level < 2 && vehicle->num_peeps > 0)
|
||||
if (session->DPI.zoom_level < 2 && vehicle->num_peeps > 0 && !vehicle->IsGhost())
|
||||
{
|
||||
// Draw peeps: (this particular vehicle doesn't sort them back to front like others so the back ones sometimes clip, but
|
||||
// that's how the original does it...)
|
||||
|
|
|
@ -24,6 +24,12 @@ void vehicle_visual_submarine(
|
|||
paint_session* session, int32_t x, int32_t imageDirection, int32_t y, int32_t z, const rct_vehicle* vehicle,
|
||||
const rct_ride_entry_vehicle* vehicleEntry)
|
||||
{
|
||||
auto imageFlags = SPRITE_ID_PALETTE_COLOUR_3(vehicle->colours.body_colour, vehicle->colours.trim_colour);
|
||||
if (vehicle->IsGhost())
|
||||
{
|
||||
imageFlags = CONSTRUCTION_MARKER;
|
||||
}
|
||||
|
||||
int32_t baseImage_id = imageDirection;
|
||||
int32_t image_id;
|
||||
if (vehicle->restraints_position >= 64)
|
||||
|
@ -53,8 +59,7 @@ void vehicle_visual_submarine(
|
|||
|
||||
vehicle_boundbox bb = VehicleBoundboxes[vehicleEntry->draw_order][imageDirection / 2];
|
||||
|
||||
image_id = baseImage_id | (vehicle->colours.body_colour << 19) | (vehicle->colours.trim_colour << 24)
|
||||
| IMAGE_TYPE_REMAP_2_PLUS;
|
||||
image_id = baseImage_id | imageFlags;
|
||||
paint_struct* ps = sub_98197C(
|
||||
session, image_id, 0, 0, bb.length_x, bb.length_y, bb.length_z, z, bb.offset_x, bb.offset_y, bb.offset_z + z);
|
||||
if (ps != nullptr)
|
||||
|
@ -62,8 +67,7 @@ void vehicle_visual_submarine(
|
|||
ps->tertiary_colour = vehicle->colours_extended;
|
||||
}
|
||||
|
||||
image_id = (baseImage_id + 1) | (vehicle->colours.body_colour << 19) | (vehicle->colours.trim_colour << 24)
|
||||
| IMAGE_TYPE_REMAP_2_PLUS;
|
||||
image_id = (baseImage_id + 1) | imageFlags;
|
||||
ps = sub_98197C(session, image_id, 0, 0, bb.length_x, bb.length_y, 2, z, bb.offset_x, bb.offset_y, bb.offset_z + z - 10);
|
||||
if (ps != nullptr)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue