summaryrefslogtreecommitdiff
path: root/window.c
diff options
context:
space:
mode:
authorbjarni <bjarni@openttd.org>2006-10-07 14:30:13 +0000
committerbjarni <bjarni@openttd.org>2006-10-07 14:30:13 +0000
commit208e258f4ce57ade70145db297a9b62fba6964b3 (patch)
treeff7fa2247d12cb30d71d1ac2a8941d2af01165f8 /window.c
parentdb665677992de73be63e68ffed09c60907423f98 (diff)
downloadopenttd-208e258f4ce57ade70145db297a9b62fba6964b3.tar.xz
(svn r6680) -Codechange r6679: [train build window] only generate the list when the window data is invalidated or the window is generated, not on each redraw
Diffstat (limited to 'window.c')
-rw-r--r--window.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/window.c b/window.c
index 12b6057c4..363808188 100644
--- a/window.c
+++ b/window.c
@@ -1609,12 +1609,26 @@ void InvalidateWindowClasses(WindowClass cls)
}
}
+void InvalidateThisWindowData(Window *w)
+{
+ CallWindowEventNP(w, WE_INVALIDATE_DATA);
+}
+
void InvalidateWindowData(WindowClass cls, WindowNumber number)
{
Window *w;
for (w = _windows; w != _last_window; w++) {
- if (w->window_class == cls && w->window_number == number) CallWindowEventNP(w, WE_INVALIDATE_DATA);
+ if (w->window_class == cls && w->window_number == number) InvalidateThisWindowData(w);
+ }
+}
+
+void InvalidateWindowClassesData(WindowClass cls)
+{
+ Window *w;
+
+ for (w = _windows; w != _last_window; w++) {
+ if (w->window_class == cls) InvalidateThisWindowData(w);
}
}