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

Function paintTileElements

src/OpenLoco/src/Paint/PaintTile.cpp:295–374  ·  view source on GitHub ↗

0x00461CF8

Source from the content-addressed store, hash-verified

293
294 // 0x00461CF8
295 void paintTileElements(PaintSession& session, const World::Pos2& loc)
296 {
297 if (!World::drawableCoords(loc))
298 {
299 paintVoid(session, loc);
300 return;
301 }
302
303 const auto vpPos = paintTileElementsSetup(session, loc);
304 if (!vpPos)
305 {
306 return;
307 }
308
309 auto tile = TileManager::get(loc);
310 for (auto& el : tile)
311 {
312 session.setUnkVpY(vpPos->y - el.baseHeight());
313 session.setCurrentItem(&el);
314 switch (el.type())
315 {
316 case World::ElementType::surface:
317 {
318 auto& elSurface = el.get<World::SurfaceElement>();
319 paintSurface(session, elSurface);
320 break;
321 }
322 case World::ElementType::track:
323 {
324 auto& elTrack = el.get<World::TrackElement>();
325 paintTrack(session, elTrack);
326 break;
327 }
328 case World::ElementType::station:
329 {
330 auto& elStation = el.get<World::StationElement>();
331 paintStation(session, elStation);
332 break;
333 }
334 case World::ElementType::signal:
335 {
336 auto& elSignal = el.get<World::SignalElement>();
337 paintSignal(session, elSignal);
338 break;
339 }
340 case World::ElementType::building:
341 {
342 auto& elBuilding = el.get<World::BuildingElement>();
343 paintBuilding(session, elBuilding);
344
345 break;
346 }
347 case World::ElementType::tree:
348 {
349 auto& elTree = el.get<World::TreeElement>();
350 paintTree(session, elTree);
351 break;
352 }

Callers 3

drawTrackFunction · 0.85
drawRoadFunction · 0.85

Calls 15

drawableCoordsFunction · 0.85
paintVoidFunction · 0.85
paintTileElementsSetupFunction · 0.85
paintSurfaceFunction · 0.85
paintTrackFunction · 0.85
paintStationFunction · 0.85
paintSignalFunction · 0.85
paintBuildingFunction · 0.85
paintTreeFunction · 0.85
paintWallFunction · 0.85
paintRoadFunction · 0.85
paintIndustryFunction · 0.85

Tested by

no test coverage detected