From 649b25bd11434a9631d6f3a29f2d9fb36b2880de Mon Sep 17 00:00:00 2001 From: Darkvater Date: Fri, 29 Dec 2006 13:59:48 +0000 Subject: (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. --- main_gui.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'main_gui.c') 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); -- cgit v1.2.3-70-g09d2