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

Function paintEdgeSection

src/OpenLoco/src/Paint/PaintSurface.cpp:1198–1209  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1196 constexpr std::array<uint8_t, 4> kCliffEdgeToTunnelEdge = { 2, 1, 3, 0 };
1197
1198 static void paintEdgeSection(PaintSession& session, uint32_t cliffEdgeImageBase, uint32_t factor, MicroZ height, uint8_t edge, uint32_t edgeSlopeMaskImageIndex)
1199 {
1200 const auto image = ImageId(cliffEdgeImageBase).withIndexOffset(factor + (height & 0xF));
1201 const World::Pos3 offset = kEdgeImageOffset[edge] + World::Pos3(0, 0, height * kMicroZStep);
1202 const World::Pos3 boundBoxSize = kEdgeBoundingBoxSize[edge];
1203 auto* ps = session.addToPlotListAsParent(image, offset, boundBoxSize);
1204 if (ps != nullptr)
1205 {
1206 ps->flags |= PaintStructFlags::hasMaskedImage;
1207 ps->maskedImageId = ImageId(edgeSlopeMaskImageIndex);
1208 }
1209 }
1210
1211 static void paintSurfaceCliffEdgeImpl(PaintSession& session, uint8_t edge, int16_t baseHeight, const EdgeHeight& edgeHeight, uint32_t cliffEdgeImageBase)
1212 {

Callers 1

Calls 3

ImageIdClass · 0.85
withIndexOffsetMethod · 0.80
addToPlotListAsParentMethod · 0.80

Tested by

no test coverage detected