summaryrefslogtreecommitdiff
path: root/window.c
diff options
context:
space:
mode:
authorDarkvater <Darkvater@openttd.org>2005-05-28 17:01:26 +0000
committerDarkvater <Darkvater@openttd.org>2005-05-28 17:01:26 +0000
commitc9b23c057177c87ccf646bcb2caabd7a821817d0 (patch)
treef3b972060496301b6e5c5bee442f91fa85b34d9e /window.c
parentad30c7a2c1f8c0aa92493d1525182163ebcd4589 (diff)
downloadopenttd-c9b23c057177c87ccf646bcb2caabd7a821817d0.tar.xz
(svn r2373) - CodeChange: don't redraw the window upon a user-based dirty request if the requested widget is invisible or otherwise not visible (type WWT_EMPTY)
Diffstat (limited to 'window.c')
-rw-r--r--window.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/window.c b/window.c
index 021269455..eaaeafab1 100644
--- a/window.c
+++ b/window.c
@@ -1541,13 +1541,11 @@ void InvalidateWindow(byte cls, WindowNumber number)
void InvalidateWidget(Window *w, byte widget_index)
{
const Widget *wi = &w->widget[widget_index];
-// if (wi->left != -2) {
- SetDirtyBlocks(
- w->left + wi->left,
- w->top + wi->top,
- w->left + wi->right + 1,
- w->top + wi->bottom + 1);
-// }
+
+ /* Don't redraw the window if the widget is invisible or of no-type */
+ if (wi->type == WWT_EMPTY || HASBIT(w->hidden_state, widget_index)) return;
+
+ SetDirtyBlocks(w->left + wi->left, w->top + wi->top, w->left + wi->right + 1, w->top + wi->bottom + 1);
}
void InvalidateWindowWidget(byte cls, WindowNumber number, byte widget_index)