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

Function WindowUpdateVisibilities

src/openrct2/interface/Window.cpp:130–165  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

128 }
129
130 static void WindowUpdateVisibilities()
131 {
132 const auto itEnd = gWindowList.end();
133 for (auto it = gWindowList.begin(); it != itEnd; ++it)
134 {
135 auto& window = *(*it);
136 if (window.viewport == nullptr)
137 {
138 window.isVisible = true;
139 continue;
140 }
141 if (window.classification == WindowClass::mainWindow)
142 {
143 window.isVisible = true;
144 window.viewport->isVisible = true;
145 continue;
146 }
147 window.isVisible = true;
148 window.viewport->isVisible = true;
149 for (auto itOther = std::next(it); itOther != itEnd; ++itOther)
150 {
151 const auto& otherWindow = *(*itOther);
152 if (otherWindow.flags.has(WindowFlag::dead))
153 continue;
154
155 if (otherWindow.windowPos.x <= window.windowPos.x && otherWindow.windowPos.y <= window.windowPos.y
156 && otherWindow.windowPos.x + otherWindow.width >= window.windowPos.x + window.width
157 && otherWindow.windowPos.y + otherWindow.height >= window.windowPos.y + window.height)
158 {
159 window.isVisible = false;
160 window.viewport->isVisible = false;
161 break;
162 }
163 }
164 }
165 }
166
167 void WindowCullDead()
168 {

Callers 1

WindowUpdateAllFunction · 0.85

Calls 3

endMethod · 0.65
hasMethod · 0.65
beginMethod · 0.45

Tested by

no test coverage detected