diff options
author | Darkvater <darkvater@openttd.org> | 2006-12-29 13:59:48 +0000 |
---|---|---|
committer | Darkvater <darkvater@openttd.org> | 2006-12-29 13:59:48 +0000 |
commit | 649b25bd11434a9631d6f3a29f2d9fb36b2880de (patch) | |
tree | fe64ccf24044b6f9be0f7d19f02e41bbde9dac4a /main_gui.c | |
parent | 5bb559a978712b872873b78b2c5e75ded06f3913 (diff) | |
download | openttd-649b25bd11434a9631d6f3a29f2d9fb36b2880de.tar.xz |
(svn r7616) -Cleanup:
-(re)set _rename_[id/what] to -1 to catch invalid calls (main_gui.c)
-Only invalidate widget of pause/ff instead of whole window (main_gui.c)
-Remove numbering from WE_ and WC_ as it's not needed, also remove
non-existing windowclasses (window.h, openttd.h)
-Give names to some of the enums (window.h)
-In UninitWindowSystem not only free malloc'd widgets, but also reset the z-array (window.c)
-Some coding style, comments, etc.
Diffstat (limited to 'main_gui.c')
-rw-r--r-- | main_gui.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/main_gui.c b/main_gui.c index 845295035..ad28e506b 100644 --- a/main_gui.c +++ b/main_gui.c @@ -43,8 +43,8 @@ #include "network_gui.h" #include "industry.h" -static int _rename_id; -static int _rename_what; +static int _rename_id = 1; +static int _rename_what = -1; static byte _terraform_size = 1; RailType _last_built_railtype; @@ -90,10 +90,12 @@ void HandleOnEditText(WindowEvent *e) } else { NetworkServer_HandleChat(NETWORK_ACTION_GIVE_MONEY, DESTTYPE_TEAM, id, msg, NETWORK_SERVER_INDEX); } - break; - } + } break; #endif /* ENABLE_NETWORK */ + default: NOT_REACHED(); } + + _rename_id = _rename_what = -1; } /** @@ -1840,12 +1842,12 @@ static void MainToolbarWndProc(Window *w, WindowEvent *e) case WE_MOUSELOOP: if (IsWindowWidgetLowered(w, 0) != !!_pause) { ToggleWidgetLoweredState(w, 0); - SetWindowDirty(w); + InvalidateWidget(w, 0); } if (IsWindowWidgetLowered(w, 1) != !!_fast_forward) { ToggleWidgetLoweredState(w, 1); - SetWindowDirty(w); + InvalidateWidget(w, 1); } break; @@ -2371,7 +2373,7 @@ void SetupColorsAndInitialWindow(void) { uint i; Window *w; - int width,height; + int width, height; for (i = 0; i != 16; i++) { const byte *b = GetNonSprite(PALETTE_RECOLOR_START + i); |