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

Function windowDraw

src/OpenLoco/src/Ui/WindowManager.cpp:1836–1878  ·  view source on GitHub ↗

* 0x004C5EA9 * * @param w * @param left @ * @param top @ * @param right @ * @param bottom @ */

Source from the content-addressed store, hash-verified

1834 * @param bottom @<bp>
1835 */
1836 static void windowDraw(Gfx::DrawingContext& ctx, Ui::Window* w, int32_t left, int32_t top, int32_t right, int32_t bottom)
1837 {
1838 if (!w->isVisible())
1839 {
1840 return;
1841 }
1842
1843 // Split window into only the regions that require drawing
1844 if (windowDrawSplit(ctx, w, left, top, right, bottom))
1845 {
1846 return;
1847 }
1848
1849 // Clamp region
1850 left = std::max(left, w->x);
1851 top = std::max(top, w->y);
1852 right = std::min(right, w->x + w->width);
1853 bottom = std::min(bottom, w->y + w->height);
1854 if (left >= right)
1855 {
1856 return;
1857 }
1858 if (top >= bottom)
1859 {
1860 return;
1861 }
1862
1863 // Draw the window in this region
1864 drawSingle(ctx, w, left, top, right, bottom);
1865
1866 for (auto index = indexOf(*w) + 1; index < count(); index++)
1867 {
1868 auto* v = get(index);
1869
1870 // Don't draw overlapping opaque windows, they won't have changed
1871 if (!v->isTranslucent())
1872 {
1873 continue;
1874 }
1875
1876 drawSingle(ctx, v, left, top, right, bottom);
1877 }
1878 }
1879
1880 static void windowDraw(Gfx::DrawingContext& ctx, Window* w, Rect rect)
1881 {

Callers 2

windowDrawSplitFunction · 0.85
renderFunction · 0.85

Calls 11

windowDrawSplitFunction · 0.85
drawSingleFunction · 0.85
indexOfFunction · 0.85
countFunction · 0.85
isVisibleMethod · 0.80
leftMethod · 0.80
topMethod · 0.80
rightMethod · 0.80
bottomMethod · 0.80
getFunction · 0.70
isTranslucentMethod · 0.45

Tested by

no test coverage detected