1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-04 13:42:55 +01:00

Add secondary colour to supports scheme

The wooden roller coaster and air powered vertical coaster both
construct a paint scheme that incorporates the tertiary colour in the
primary slot and the secondary colour in the secondary slot.
Constructing the scheme requires at least one condition that can be
removed by constructing the scheme when populating the PaintSessionCore.
This commit is contained in:
Spacek531
2023-12-23 12:23:55 -08:00
parent a890844115
commit b6bcb8e106
3 changed files with 7 additions and 18 deletions

View File

@@ -2256,7 +2256,8 @@ void PaintTrack(PaintSession& session, Direction direction, int32_t height, cons
session.InteractionType = ViewportInteractionItem::Ride;
session.TrackColours = ImageId(
0, ride->track_colour[trackColourScheme].main, ride->track_colour[trackColourScheme].additional);
session.SupportColours = ImageId(0, ride->track_colour[trackColourScheme].supports);
session.SupportColours = ImageId(
0, ride->track_colour[trackColourScheme].supports, ride->track_colour[trackColourScheme].additional);
if (trackElement.IsHighlighted() || session.SelectedElement == reinterpret_cast<const TileElement*>(&trackElement))
{
session.TrackColours = HighlightMarker;

View File

@@ -164,17 +164,6 @@ enum
SPR_AIR_POWERED_VERTICAL_RC_BANKED_QUARTER_TURN_5_FRONT_SE_NE_PART_0 = 22333,
};
static ImageId AirPoweredVerticalRCGetSupportColour(PaintSession& session)
{
auto colourFlags = session.SupportColours;
auto trackColour = session.TrackColours;
if (trackColour.HasSecondary())
{
colourFlags = colourFlags.WithSecondary(trackColour.GetSecondary());
}
return colourFlags;
}
/** rct2: 0x008AFAD4 */
static void AirPoweredVerticalRCTrackFlat(
PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height,
@@ -645,7 +634,7 @@ static void AirPoweredVerticalRCTrackVerticalSlopeUp(
48, 64, 128, 176, 208, 240, 240,
};
auto supportsImageId = AirPoweredVerticalRCGetSupportColour(session).WithIndex(supportImageIds[trackSequence][direction]);
auto supportsImageId = session.SupportColours.WithIndex(supportImageIds[trackSequence][direction]);
auto trackImageId = session.TrackColours.WithIndex(trackImageIds[trackSequence][direction]);
int8_t bbHeight;
bool isDirection03 = (direction == 0 || direction == 3);
@@ -782,7 +771,7 @@ static void AirPoweredVerticalRCTrackVerticalUp(
switch (trackSequence)
{
case 0:
imageId = AirPoweredVerticalRCGetSupportColour(session).WithIndex(imageIds[direction][0]);
imageId = session.SupportColours.WithIndex(imageIds[direction][0]);
PaintAddImageAsParentRotated(session, direction, imageId, { 0, 0, height }, { { 3, 3, height }, { 26, 26, 79 } });
break;
case 1:
@@ -839,7 +828,7 @@ static void AirPoweredVerticalRCTrackVerticalTop(
switch (trackSequence)
{
case 0:
imageIdS = AirPoweredVerticalRCGetSupportColour(session).WithIndex(imageIds[direction][0]);
imageIdS = session.SupportColours.WithIndex(imageIds[direction][0]);
imageIdT = session.TrackColours.WithIndex(imageIds[direction][1]);
if (direction == 0)
{
@@ -885,7 +874,7 @@ static void AirPoweredVerticalRCTrackVerticalTop(
PaintUtilSetVerticalTunnel(session, height + 80);
break;
case 3:
imageIdS = AirPoweredVerticalRCGetSupportColour(session).WithIndex(imageIds[direction][4]);
imageIdS = session.SupportColours.WithIndex(imageIds[direction][4]);
imageIdT = session.TrackColours.WithIndex(imageIds[direction][5]);
if (direction == 0)
{

View File

@@ -38,8 +38,7 @@ template<bool isClassic> ImageId WoodenRCGetTrackColour(const PaintSession& sess
if (isClassic)
return session.TrackColours;
else
return session.TrackColours.IsRemap() ? session.TrackColours
: session.TrackColours.WithPrimary(session.SupportColours.GetPrimary());
return session.SupportColours;
}
ImageId WoodenRCGetRailsColour(PaintSession& session);