Fix #6118, #6245, #6366: Tracked animated vehicles not animating

This commit is contained in:
Olivier Wervers 2017-10-04 14:51:48 +02:00 committed by Michael Steenbeek
parent 811fabb2a9
commit d47f758b0e
3 changed files with 17 additions and 9 deletions

View file

@ -17,6 +17,7 @@
- Fix: [#5788] Empty scenario names cause invisible entries in scenario list.
- Fix: [#6101] Rides remain in ride list window briefly after demolition.
- Fix: [#6115] Random title screen music not random on launch.
- Fix: [#6118, #6245, #6366] Tracked animated vehicles not animating.
- Fix: [#6133] Construction rights not shown after selecting buy mode.
- Fix: [#6188] Viewports not being clipped properly when zoomed out in OpenGL mode.
- Fix: [#6193] All rings in Space Rings use the same secondary colour.

View file

@ -232,7 +232,7 @@ enum {
VEHICLE_ENTRY_FLAG_ENABLE_ADDITIONAL_COLOUR_2 = 1 << 9,
VEHICLE_ENTRY_FLAG_10 = 1 << 10,
VEHICLE_ENTRY_FLAG_11 = 1 << 11,
VEHICLE_ENTRY_FLAG_OVERRIDE_NUM_VERTICAL_FRAMES = 1 << 12, // Setting this will cause the game to set vehicleEntry->num_vertical_frames to vehicleEntry->num_vertical_frames_override, rather than determining it itself.
VEHICLE_ENTRY_FLAG_OVERRIDE_NUM_VERTICAL_FRAMES = 1 << 12, // Setting this will cause the game to set vehicleEntry->num_vertical_frames to vehicleEntry->num_vertical_frames_override, rather than determining it itself.
VEHICLE_ENTRY_FLAG_13 = 1 << 13,
VEHICLE_ENTRY_FLAG_14 = 1 << 14,
VEHICLE_ENTRY_FLAG_15 = 1 << 15,
@ -243,7 +243,7 @@ enum {
VEHICLE_ENTRY_FLAG_RIDERS_SCREAM = 1 << 20,
VEHICLE_ENTRY_FLAG_21 = 1 << 21,
VEHICLE_ENTRY_FLAG_22 = 1 << 22,
VEHICLE_ENTRY_FLAG_23 = 1 << 23,
VEHICLE_ENTRY_FLAG_23 = 1 << 23, // Set on animated vehicles like the Multi-dimension coaster trains, Miniature Railway locomotives and Helicycles.
VEHICLE_ENTRY_FLAG_24 = 1 << 24,
VEHICLE_ENTRY_FLAG_25 = 1 << 25,
VEHICLE_ENTRY_FLAG_26 = 1 << 26,

View file

@ -895,25 +895,32 @@ static void vehicle_sprite_paint(paint_session * session, rct_vehicle *vehicle,
sint32 baseImage_id = ebx;
vehicle_boundbox bb = VehicleBoundboxes[vehicleEntry->draw_order][ecx];
if (vehicleEntry->flags & VEHICLE_ENTRY_FLAG_14) {
if (vehicleEntry->flags & VEHICLE_ENTRY_FLAG_14)
{
baseImage_id += (vehicle->var_BA / 8) & 31;
}
if (vehicleEntry->flags & VEHICLE_ENTRY_FLAG_7) {
if (vehicleEntry->flags & VEHICLE_ENTRY_FLAG_23)
{
baseImage_id += vehicle->var_C5;
}
uint32 rotation = get_current_rotation();
sint32 image_id = baseImage_id | (vehicle->colours.body_colour << 19) | (vehicle->colours.trim_colour << 24) | IMAGE_TYPE_REMAP_2_PLUS;
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, rotation);
if (ps != NULL) {
if (ps != NULL)
{
ps->tertiary_colour = vehicle->colours_extended;
}
rct_drawpixelinfo* dpi = session->Unk140E9A8;
if (dpi->zoom_level < 2 && vehicle->num_peeps > 0 && vehicleEntry->no_seating_rows > 0) {
if (dpi->zoom_level < 2 && vehicle->num_peeps > 0 && vehicleEntry->no_seating_rows > 0)
{
baseImage_id += vehicleEntry->no_vehicle_images;
for (sint32 i = 0; i < 8; i++){
if (vehicle->num_peeps > (i * 2) && vehicleEntry->no_seating_rows > i) {
for (sint32 i = 0; i < 8; i++)
{
if (vehicle->num_peeps > (i * 2) && vehicleEntry->no_seating_rows > i)
{
image_id = baseImage_id | SPRITE_ID_PALETTE_COLOUR_2(vehicle->peep_tshirt_colours[i * 2], vehicle->peep_tshirt_colours[(i * 2) + 1]);
if (i == 0 && vehicleEntry->flags & VEHICLE_ENTRY_FLAG_24) {
if (i == 0 && vehicleEntry->flags & VEHICLE_ENTRY_FLAG_24)
{
image_id += (vehicleEntry->no_vehicle_images * vehicle->var_C5);
}
sub_98199C(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, rotation);