Fix #22063: Incorrect colour on hybrid diag flat

This commit is contained in:
Michael Steenbeek authored and GitHub committed 2024-06-17 23:28:10 +02:00
1 parent bc86f6699a
commit 31035cd7aa
3 files changed
+14 -4

No files matched your search

+2 -2
View File
@@ -1165,7 +1165,7 @@ constexpr CoordsXY defaultDiagBoundLengths[4] = {
void TrackPaintUtilDiagTilesPaint(
PaintSession& session, int8_t thickness, int16_t height, Direction direction, uint8_t trackSequence,
const uint32_t sprites[4], const CoordsXY offsets[4], const CoordsXY boundsLengths[4], const CoordsXYZ boundsOffsets[4],
int8_t additionalBoundsHeight)
int8_t additionalBoundsHeight, const ImageId colourFlags)
{
auto shouldDraw = kDiagSpriteMap[direction][trackSequence];
if (!shouldDraw)
@@ -1173,7 +1173,7 @@ void TrackPaintUtilDiagTilesPaint(
return;
}
auto imageId = session.TrackColours.WithIndex(sprites[direction]);
auto imageId = colourFlags.WithIndex(sprites[direction]);
CoordsXY offset = (offsets == nullptr ? CoordsXY() : offsets[direction]);
CoordsXY boundsLength = boundsLengths[direction];
CoordsXYZ boundsOffset = (boundsOffsets == nullptr ? CoordsXYZ(offset, additionalBoundsHeight) : boundsOffsets[direction]);
+11 -1
View File
@@ -507,9 +507,19 @@ void TrackPaintUtilEighthToDiagTilesPaint(
const ImageId colourFlags, const uint32_t sprites[4][4], const CoordsXY offsets[4][4], const CoordsXY boundsLengths[4][4],
const CoordsXYZ boundsOffsets[4][4]);
void TrackPaintUtilDiagTilesPaint(
PaintSession& session, int8_t thickness, int16_t height, Direction direction, uint8_t trackSequence,
const uint32_t sprites[4], const CoordsXY offsets[4], const CoordsXY boundsLengths[4], const CoordsXYZ boundsOffsets[4],
int8_t additionalBoundsHeight, const ImageId colourFlags);
inline void TrackPaintUtilDiagTilesPaint(
PaintSession& session, int8_t thickness, int16_t height, Direction direction, uint8_t trackSequence,
const uint32_t sprites[4], const CoordsXY offsets[4], const CoordsXY boundsLengths[4],
const CoordsXYZ boundsOffsets[4] = nullptr, int8_t additionalBoundsHeight = 0);
const CoordsXYZ boundsOffsets[4] = nullptr, int8_t additionalBoundsHeight = 0)
{
TrackPaintUtilDiagTilesPaint(
session, thickness, height, direction, trackSequence, sprites, offsets, boundsLengths, boundsOffsets,
additionalBoundsHeight, session.TrackColours);
}
void TrackPaintUtilDiagTilesPaintExtra(
PaintSession& session, int8_t thickness, int16_t height, Direction direction, uint8_t trackSequence,
const uint32_t sprites[4], MetalSupportType supportType);
+1 -1
View File
@@ -1389,7 +1389,7 @@ namespace HybridRC
TrackPaintUtilDiagTilesPaint(
session, 3, height, direction, trackSequence, images[trackElement.HasChain()], defaultDiagTileOffsets,
defaultDiagBoundLengths, nullptr);
defaultDiagBoundLengths, nullptr, 0, GetTrackColour(session));
switch (trackSequence)
{