Convert Classic Wooden RC track to shared track paint functions

This commit is contained in:
mix 2024-11-15 05:41:14 +00:00 committed by Gymnasiast
parent 273fa9a479
commit 836786a707
No known key found for this signature in database
GPG key ID: DBFFF47AB2CA3EDD
2 changed files with 570 additions and 1523 deletions

File diff suppressed because it is too large Load diff

View file

@ -26,7 +26,7 @@ static constexpr TunnelGroup kTunnelGroup = TunnelGroup::Square;
struct WoodenTrackSection
{
ImageIndex track;
ImageIndex handrail;
ImageIndex handrail = ImageIndexUndefined;
ImageIndex frontTrack = ImageIndexUndefined;
ImageIndex frontHandrail = ImageIndexUndefined;
};
@ -67,11 +67,20 @@ PaintStruct* WoodenRCTrackPaint(
PaintSession& session, uint8_t direction, ImageIndex imageIdTrack, ImageIndex imageIdRails, const CoordsXYZ& offset,
const BoundBoxXYZ& boundBox)
{
ImageId imageId = WoodenRCGetTrackColour<isClassic>(session).WithIndex(imageIdTrack);
ImageId railsImageId = WoodenRCGetRailsColour(session).WithIndex(imageIdRails);
if (isClassic)
{
const ImageId imageId = session.TrackColours.WithIndex(imageIdTrack);
PaintAddImageAsParentRotated(session, direction, imageId, offset, boundBox);
return PaintAddImageAsChildRotated(session, direction, railsImageId, offset, boundBox);
return PaintAddImageAsParentRotated(session, direction, imageId, offset, boundBox);
}
else
{
const ImageId imageId = session.SupportColours.WithIndex(imageIdTrack);
const ImageId railsImageId = WoodenRCGetRailsColour(session).WithIndex(imageIdRails);
PaintAddImageAsParentRotated(session, direction, imageId, offset, boundBox);
return PaintAddImageAsChildRotated(session, direction, railsImageId, offset, boundBox);
}
}
template<bool isClassic>