MCPcopy Create free account
hub / github.com/OpenLoco/OpenLoco / paintSupport

Function paintSupport

src/OpenLoco/src/Paint/PaintTrack.cpp:70–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68 namespace Style1
69 {
70 static void paintSupport(PaintSession& session, const TrackAdditionSupport& tppaSupport, const uint8_t rotation, const ImageId baseImageId, int16_t height)
71 {
72 const auto seg = Numerics::bitScanForward(enumValue(tppaSupport.segments[rotation]));
73 assert(seg != -1);
74 TrackRoadAdditionSupports support{};
75 support.height = height + tppaSupport.height;
76 support.occupiedSegments = session.getOccupiedAdditionSupportSegments();
77 support.segmentFrequency[seg] = tppaSupport.frequencies[rotation];
78 support.segmentImages[seg] = baseImageId.withIndexOffset(tppaSupport.imageIds[rotation][0]).toUInt32();
79 support.segmentInteractionItem[seg] = session.getCurrentItem();
80 support.segmentInteractionType[seg] = session.getItemType();
81 session.setAdditionSupport(support);
82 }
83
84 static void paintTrackAdditionPPMergeable(PaintSession& session, const World::TrackElement& elTrack, const uint8_t rotation, const ImageId baseImageId, const TrackPaintAdditionPiece& tppa)
85 {

Callers 2

Calls 8

bitScanForwardFunction · 0.85
enumValueFunction · 0.85
toUInt32Method · 0.80
withIndexOffsetMethod · 0.80
getCurrentItemMethod · 0.80
getItemTypeMethod · 0.80
setAdditionSupportMethod · 0.80

Tested by

no test coverage detected