summaryrefslogtreecommitdiff
path: root/src/window_gui.h
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-01-06 22:37:42 +0000
committerrubidium <rubidium@openttd.org>2009-01-06 22:37:42 +0000
commitaa6c7e8574bf54306cf33692515de1662d5e4884 (patch)
treed95cb0751c055d7052bc2f0af8a848c6476c6125 /src/window_gui.h
parent8f5354f2df238108566466b45dd3c56e4c290fa2 (diff)
downloadopenttd-aa6c7e8574bf54306cf33692515de1662d5e4884.tar.xz
(svn r14880) -Codechange: make it clear which way the FOR_ALL_WINDOWS goes (from back to front or vice versa) and make it iterate over the Window* instead of Window**.
Diffstat (limited to 'src/window_gui.h')
-rw-r--r--src/window_gui.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/window_gui.h b/src/window_gui.h
index 1dff3b971..81d3f5062 100644
--- a/src/window_gui.h
+++ b/src/window_gui.h
@@ -541,7 +541,8 @@ extern Window *_z_windows[];
extern Window **_last_z_window;
/** Iterate over all windows */
-#define FOR_ALL_WINDOWS(wz) for (wz = _z_windows; wz != _last_z_window; wz++)
+#define FOR_ALL_WINDOWS_FROM_BACK(w) for (Window **wz = _z_windows; wz != _last_z_window && (w = *wz) != NULL; wz++)
+#define FOR_ALL_WINDOWS_FROM_FRONT(w) for (Window **wz = _last_z_window; wz != _z_windows && (w = *--wz) != NULL;)
/**
* Disable scrolling of the main viewport when an input-window is active.