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

Function drawStationNames

src/OpenLoco/src/Viewport.cpp:59–86  ·  view source on GitHub ↗

0x0048DE97

Source from the content-addressed store, hash-verified

57
58 // 0x0048DE97
59 static void drawStationNames(Gfx::DrawingContext& drawingCtx)
60 {
61 const auto& rt = drawingCtx.currentRenderTarget();
62
63 Gfx::RenderTarget unZoomedRt = rt;
64 unZoomedRt.zoomLevel = 0;
65 unZoomedRt.x >>= rt.zoomLevel;
66 unZoomedRt.y >>= rt.zoomLevel;
67 unZoomedRt.width >>= rt.zoomLevel;
68 unZoomedRt.height >>= rt.zoomLevel;
69
70 drawingCtx.pushRenderTarget(unZoomedRt);
71
72 for (const auto& station : StationManager::stations())
73 {
74 if ((station.flags & StationFlags::flag_5) != StationFlags::none)
75 {
76 continue;
77 }
78
79 bool isHovered = (World::hasMapSelectionFlag(World::MapSelectionFlags::hoveringOverStation))
80 && (station.id() == Input::getHoveredStationId());
81
82 drawStationName(drawingCtx, station, rt.zoomLevel, isHovered);
83 }
84
85 drawingCtx.popRenderTarget();
86 }
87
88 // 0x004977E5
89 static void drawTownNames(Gfx::DrawingContext& drawingCtx)

Callers 1

paintMethod · 0.85

Calls 7

stationsFunction · 0.85
hasMapSelectionFlagFunction · 0.85
getHoveredStationIdFunction · 0.85
drawStationNameFunction · 0.85
pushRenderTargetMethod · 0.80
popRenderTargetMethod · 0.80
idMethod · 0.45

Tested by

no test coverage detected