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

Function paintRoadStreetlight

src/OpenLoco/src/Paint/PaintRoad.cpp:204–221  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

202 constexpr auto kStreetlightBoundingBoxSizes = World::Pos3{ 1, 1, 6 };
203
204 static void paintRoadStreetlight(PaintSession& session, const int16_t baseHeight, const uint8_t style, const int16_t streetlightHeight, const uint8_t rotation)
205 {
206 assert(style < static_cast<int32_t>(kStreetlightImageFromStyle.size()));
207 const auto imageIndexOffset = kStreetlightImageFromStyle[style][rotation];
208
209 const auto& streetlightObj = ObjectManager::get<StreetLightObject>();
210
211 const int16_t height = baseHeight + streetlightHeight;
212 const auto heightOffset = World::Pos3{ 0,
213 0,
214 height };
215
216 session.addToPlotListAsParent(
217 ImageId(streetlightObj->image).withIndexOffset(imageIndexOffset),
218 heightOffset + kStreetlightOffsets[rotation],
219 heightOffset + kStreetlightBoundingBoxOffsets[rotation],
220 kStreetlightBoundingBoxSizes);
221 }
222
223 static void paintRoadStreetlights(PaintSession& session, const World::RoadElement& elRoad, const std::array<int16_t, 4>& streetlightHeights)
224 {

Callers 2

paintRoadStreetlightsFunction · 0.85
finalisePaintRoadFunction · 0.85

Calls 4

ImageIdClass · 0.85
addToPlotListAsParentMethod · 0.80
withIndexOffsetMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected