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

Function WindowDrawCore

src/openrct2/interface/Window.cpp:552–576  ·  view source on GitHub ↗

* Draws the given window and any other overlapping transparent windows. */

Source from the content-addressed store, hash-verified

550 * Draws the given window and any other overlapping transparent windows.
551 */
552 static void WindowDrawCore(
553 Drawing::RenderTarget& rt, WindowBase& w, int32_t left, int32_t top, int32_t right, int32_t bottom)
554 {
555 // Clamp region
556 left = std::max<int32_t>(left, w.windowPos.x);
557 top = std::max<int32_t>(top, w.windowPos.y);
558 right = std::min<int32_t>(right, w.windowPos.x + w.width);
559 bottom = std::min<int32_t>(bottom, w.windowPos.y + w.height);
560 if (left >= right)
561 return;
562 if (top >= bottom)
563 return;
564
565 // Draw the window and any other overlapping transparent windows
566 for (auto it = WindowGetIterator(&w); it != gWindowList.end(); it++)
567 {
568 auto* v = it->get();
569 if (v->flags.has(WindowFlag::dead))
570 continue;
571 if ((&w == v || v->flags.has(WindowFlag::transparent)) && v->isVisible)
572 {
573 WindowDrawSingle(rt, *v, left, top, right, bottom);
574 }
575 }
576 }
577
578 static void WindowDrawSingle(
579 Drawing::RenderTarget& rt, WindowBase& w, int32_t left, int32_t top, int32_t right, int32_t bottom)

Callers 1

WindowDrawFunction · 0.85

Calls 5

WindowGetIteratorFunction · 0.85
WindowDrawSingleFunction · 0.85
endMethod · 0.65
getMethod · 0.65
hasMethod · 0.65

Tested by

no test coverage detected