Codechange: Replace window related FOR_ALL with range-based for loops

(cherry picked from commit 14e92bd8e2)
This commit is contained in:
glx22
2021-04-28 21:24:24 +02:00
committed by Jonathan G Rennison
parent c7cac34025
commit dfe616bef4
11 changed files with 130 additions and 156 deletions

View File

@@ -1561,8 +1561,7 @@ void DrawDirtyBlocks()
if (_whole_screen_dirty) {
RedrawScreenRect(0, 0, _screen.width, _screen.height);
Window *w;
FOR_ALL_WINDOWS_FROM_BACK(w) {
for (Window *w : Window::IterateFromBack()) {
w->flags &= ~(WF_DIRTY | WF_WIDGETS_DIRTY | WF_DRAG_DIRTIED);
}
_whole_screen_dirty = false;
@@ -1579,8 +1578,7 @@ void DrawDirtyBlocks()
DrawPixelInfo bk;
_cur_dpi = &bk;
Window *w;
FOR_ALL_WINDOWS_FROM_BACK(w) {
for (Window *w : Window::IterateFromBack()) {
w->flags &= ~WF_DRAG_DIRTIED;
if (!MayBeShown(w)) continue;
@@ -1640,8 +1638,7 @@ void DrawDirtyBlocks()
int right = vp->left + vp->width;
int bottom = vp->top + vp->height;
_dirty_viewport_occlusions.clear();
const Window *v;
FOR_ALL_WINDOWS_FROM_BACK_FROM(v, w->z_front) {
for (const Window *v : Window::IterateFromBack(w->z_front)) {
if (MayBeShown(v) &&
right > v->left &&
bottom > v->top &&