(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.
This commit is contained in:
16
main_gui.c
16
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);
|
||||
|
Reference in New Issue
Block a user