mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-23 14:54:30 +01:00
Fix #23484: Castle station styles are erroneously remappable
This commit is contained in:
committed by
GitHub
parent
82331a4f84
commit
d97ae02db2
@@ -141,8 +141,7 @@ static void PaintRideEntranceExit(PaintSession& session, uint8_t direction, int3
|
||||
|
||||
auto hasGlass = (stationObj->Flags & StationObjectFlags::isTransparent) != 0;
|
||||
auto colourPrimary = ride->trackColours[0].main;
|
||||
auto colourSecondary = ride->trackColours[0].additional;
|
||||
auto imageTemplate = ImageId(0, colourPrimary, colourSecondary);
|
||||
auto imageTemplate = ImageId(0);
|
||||
ImageId glassImageTemplate;
|
||||
if (hasGlass)
|
||||
{
|
||||
@@ -158,6 +157,18 @@ static void PaintRideEntranceExit(PaintSession& session, uint8_t direction, int3
|
||||
{
|
||||
imageTemplate = ImageId().WithRemap(FilterPaletteID::PaletteGhost);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (stationObj->Flags & StationObjectFlags::hasPrimaryColour)
|
||||
{
|
||||
imageTemplate = imageTemplate.WithPrimary(colourPrimary);
|
||||
}
|
||||
if (stationObj->Flags & StationObjectFlags::hasSecondaryColour)
|
||||
{
|
||||
auto colourSecondary = ride->trackColours[0].additional;
|
||||
imageTemplate = imageTemplate.WithSecondary(colourSecondary);
|
||||
}
|
||||
}
|
||||
|
||||
// Format modified to stop repeated code
|
||||
|
||||
|
||||
@@ -708,14 +708,22 @@ bool TrackPaintUtilDrawStationCovers2(
|
||||
imageOffset += SPR_STATION_COVER_OFFSET_TALL;
|
||||
}
|
||||
|
||||
auto imageTemplate = session.TrackColours;
|
||||
auto imageId = imageTemplate.WithIndex(baseImageIndex + imageOffset);
|
||||
auto imageId = session.TrackColours.WithIndex(baseImageIndex + imageOffset);
|
||||
if (!session.TrackColours.IsRemap())
|
||||
{
|
||||
imageId = ImageId(baseImageIndex + imageOffset);
|
||||
if (stationObject->Flags & StationObjectFlags::hasPrimaryColour)
|
||||
imageId = imageId.WithPrimary(session.TrackColours.GetPrimary());
|
||||
if (stationObject->Flags & StationObjectFlags::hasSecondaryColour)
|
||||
imageId = imageId.WithSecondary(session.TrackColours.GetSecondary());
|
||||
}
|
||||
|
||||
PaintAddImageAsParent(session, imageId, offset, boundBox);
|
||||
|
||||
// Glass
|
||||
if (colour == TrackStationColour && (stationObject->Flags & StationObjectFlags::isTransparent))
|
||||
{
|
||||
imageId = ImageId(baseImageIndex + imageOffset + 12).WithTransparency(imageTemplate.GetPrimary());
|
||||
imageId = ImageId(baseImageIndex + imageOffset + 12).WithTransparency(session.TrackColours.GetPrimary());
|
||||
PaintAddImageAsChild(session, imageId, offset, boundBox);
|
||||
}
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user