MCPcopy Create free account
hub / github.com/OpenRCT2/OpenRCT2 / onScrollDraw

Method onScrollDraw

src/openrct2-ui/windows/Map.cpp:579–606  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

577 }
578
579 void onScrollDraw(int32_t scrollIndex, RenderTarget& rt) override
580 {
581 GfxClear(rt, PaletteIndex::pi10);
582
583 // Ensure small maps are centred
584 auto screenOffset = ScreenCoordsXY(0, 0);
585 auto mapOffset = getMapOffset(width);
586 if (mapOffset > 0)
587 screenOffset += ScreenCoordsXY(mapOffset, mapOffset - kScrollBarWidth);
588
589 G1Element g1temp = {};
590 g1temp.offset = reinterpret_cast<uint8_t*>(_mapImageData.data());
591 g1temp.width = getMiniMapWidth();
592 g1temp.height = getMiniMapWidth();
593 GfxSetG1Element(SPR_TEMP_MAP, &g1temp);
594 DrawingEngineInvalidateImage(SPR_TEMP_MAP);
595 GfxDrawSprite(rt, ImageId(SPR_TEMP_MAP), screenOffset);
596
597 if (selectedTab == PAGE_PEEPS)
598 {
599 PaintPeepOverlay(rt, screenOffset);
600 }
601 else
602 {
603 PaintTrainOverlay(rt, screenOffset);
604 }
605 PaintHudRectangle(rt, screenOffset);
606 }
607
608 void onPrepareDraw() override
609 {

Callers 1

WidgetScrollDrawFunction · 0.45

Calls 9

GfxClearFunction · 0.85
getMapOffsetFunction · 0.85
getMiniMapWidthFunction · 0.85
GfxSetG1ElementFunction · 0.85
GfxDrawSpriteFunction · 0.85
ScreenCoordsXYClass · 0.50
ImageIdClass · 0.50
dataMethod · 0.45

Tested by

no test coverage detected