mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-24 07:14:31 +01:00
Refactor paint 3D cinema to use ImageId
This commit is contained in:
@@ -16,10 +16,7 @@
|
||||
#include "../Track.h"
|
||||
#include "../TrackPaint.h"
|
||||
|
||||
/**
|
||||
* rct2: 0x007664C2
|
||||
*/
|
||||
static void paint_3d_cinema_structure(
|
||||
static void Paint3dCinemaDome(
|
||||
paint_session* session, const Ride* ride, uint8_t direction, int8_t xOffset, int8_t yOffset, uint16_t height)
|
||||
{
|
||||
const TileElement* savedTileElement = static_cast<const TileElement*>(session->CurrentlyDrawnItem);
|
||||
@@ -37,13 +34,14 @@ static void paint_3d_cinema_structure(
|
||||
session->CurrentlyDrawnItem = GetEntity<Vehicle>(ride->vehicles[0]);
|
||||
}
|
||||
|
||||
uint32_t imageColourFlags = session->TrackColours[SCHEME_MISC];
|
||||
if (imageColourFlags == IMAGE_TYPE_REMAP)
|
||||
auto imageTemplate = ImageId(0, ride->vehicle_colours[0].Body, ride->vehicle_colours[0].Trim);
|
||||
auto imageFlags = session->TrackColours[SCHEME_MISC];
|
||||
if (imageFlags != IMAGE_TYPE_REMAP)
|
||||
{
|
||||
imageColourFlags = SPRITE_ID_PALETTE_COLOUR_2(ride->vehicle_colours[0].Body, ride->vehicle_colours[0].Trim);
|
||||
imageTemplate = ImageId::FromUInt32(imageFlags);
|
||||
}
|
||||
|
||||
uint32_t imageId = (rideEntry->vehicles[0].base_image_id + direction) | imageColourFlags;
|
||||
auto imageId = imageTemplate.WithIndex(rideEntry->vehicles[0].base_image_id + direction);
|
||||
PaintAddImageAsParent(
|
||||
session, imageId, { xOffset, yOffset, height + 3 }, { 24, 24, 47 }, { xOffset + 16, yOffset + 16, height + 3 });
|
||||
|
||||
@@ -54,7 +52,7 @@ static void paint_3d_cinema_structure(
|
||||
/**
|
||||
* rct2: 0x0076574C
|
||||
*/
|
||||
static void paint_3d_cinema(
|
||||
static void Paint3dCinema(
|
||||
paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height,
|
||||
const TrackElement& trackElement)
|
||||
{
|
||||
@@ -80,22 +78,22 @@ static void paint_3d_cinema(
|
||||
switch (trackSequence)
|
||||
{
|
||||
case 1:
|
||||
paint_3d_cinema_structure(session, ride, direction, 32, 32, height);
|
||||
Paint3dCinemaDome(session, ride, direction, 32, 32, height);
|
||||
break;
|
||||
case 3:
|
||||
paint_3d_cinema_structure(session, ride, direction, 32, -32, height);
|
||||
Paint3dCinemaDome(session, ride, direction, 32, -32, height);
|
||||
break;
|
||||
case 5:
|
||||
paint_3d_cinema_structure(session, ride, direction, 0, -32, height);
|
||||
Paint3dCinemaDome(session, ride, direction, 0, -32, height);
|
||||
break;
|
||||
case 6:
|
||||
paint_3d_cinema_structure(session, ride, direction, -32, 32, height);
|
||||
Paint3dCinemaDome(session, ride, direction, -32, 32, height);
|
||||
break;
|
||||
case 7:
|
||||
paint_3d_cinema_structure(session, ride, direction, -32, -32, height);
|
||||
Paint3dCinemaDome(session, ride, direction, -32, -32, height);
|
||||
break;
|
||||
case 8:
|
||||
paint_3d_cinema_structure(session, ride, direction, -32, 0, height);
|
||||
Paint3dCinemaDome(session, ride, direction, -32, 0, height);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -125,7 +123,6 @@ static void paint_3d_cinema(
|
||||
paint_util_set_general_support_height(session, height + 128, 0x20);
|
||||
}
|
||||
|
||||
/* 0x0076554C */
|
||||
TRACK_PAINT_FUNCTION get_track_paint_function_3d_cinema(int32_t trackType)
|
||||
{
|
||||
if (trackType != TrackElemType::FlatTrack3x3)
|
||||
@@ -133,5 +130,5 @@ TRACK_PAINT_FUNCTION get_track_paint_function_3d_cinema(int32_t trackType)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return paint_3d_cinema;
|
||||
return Paint3dCinema;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user