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

Function paintTrackPPStandard

src/OpenLoco/src/Paint/PaintTrack.cpp:192–224  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

190 }
191
192 static void paintTrackPPStandard(PaintSession& session, const World::TrackElement& elTrack, const TrackPaintCommon& trackSession, const uint8_t rotation, const TrackPaintPiece& tpp)
193 {
194 const auto height = elTrack.baseHeight();
195 const auto heightOffset = World::Pos3{ 0,
196 0,
197 height };
198 if (elTrack.hasBridge())
199 {
200 auto newBridgeEntry = BridgeEntry(
201 height,
202 tpp.bridgeType[rotation],
203 tpp.bridgeEdges[rotation],
204 tpp.bridgeQuarters[rotation],
205 elTrack.bridge(),
206 trackSession.bridgeColoursBaseImageId);
207 // There may be other bridge edge/quarters due to merging so OR them together
208 newBridgeEntry.edgesQuarters |= session.getBridgeEntry().edgesQuarters;
209 session.setBridgeEntry(newBridgeEntry);
210 }
211
212 const auto baseImage = trackSession.trackBaseImageId;
213
214 session.addToPlotList4FD150(
215 baseImage.withIndexOffset(tpp.imageIndexOffsets[rotation][0]),
216 heightOffset,
217 tpp.boundingBoxOffsets[rotation] + heightOffset,
218 tpp.boundingBoxSizes[rotation]);
219
220 session.insertTunnels(tpp.tunnelHeights[rotation], height, trackSession.tunnelType);
221
222 session.set525CF8(session.get525CF8() | tpp.segments[rotation]);
223 session.setOccupiedAdditionSupportSegments(session.getOccupiedAdditionSupportSegments() | tpp.segments[rotation]);
224 }
225
226 static void paintTrackPP(PaintSession& session, const World::TrackElement& elTrack, const TrackPaintCommon& trackSession, const uint8_t rotation, const TrackPaintPiece& tpp)
227 {

Callers 1

paintTrackPPFunction · 0.85

Calls 12

BridgeEntryClass · 0.85
baseHeightMethod · 0.80
setBridgeEntryMethod · 0.80
addToPlotList4FD150Method · 0.80
withIndexOffsetMethod · 0.80
insertTunnelsMethod · 0.80
set525CF8Method · 0.80
get525CF8Method · 0.80
hasBridgeMethod · 0.45
bridgeMethod · 0.45

Tested by

no test coverage detected