diff options
author | Darkvater <darkvater@openttd.org> | 2006-03-02 09:57:28 +0000 |
---|---|---|
committer | Darkvater <darkvater@openttd.org> | 2006-03-02 09:57:28 +0000 |
commit | 9bbe6876ba22fa21a2ca664dc92faa4f78efd6c6 (patch) | |
tree | 1b72a7116b211a8e76565a0f3977df563afa7dd6 /settings_gui.c | |
parent | 9d54e51ef995d2f2d65b12f74ce31cbcbf8848a1 (diff) | |
download | openttd-9bbe6876ba22fa21a2ca664dc92faa4f78efd6c6.tar.xz |
(svn r3732) - Fix two warnings. Stupid MSVC didn't even complain :s (Thank Tron and peter1138)
- NOTE! There are a few warnings left in settings_gui because tha callback functions are disabled. I still need a good place for them.
Diffstat (limited to 'settings_gui.c')
-rw-r--r-- | settings_gui.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/settings_gui.c b/settings_gui.c index a452c26b4..49d22600e 100644 --- a/settings_gui.c +++ b/settings_gui.c @@ -711,13 +711,11 @@ static void PatchesSelectionWndProc(Window *w, WindowEvent *e) if ((sdb->flags & SGF_NETWORK_ONLY) && !_networking) editable = false; if (sdb->cmd == SDT_BOOLX) { - static const _bool_ctabs[4] = {9, 7, 4, 6}; + static const int _bool_ctabs[2][2] = {{9, 4}, {7, 6}}; /* Draw checkbox for boolean-value either on/off */ bool on = (*(bool*)var); - byte ctab = !!on + (!!editable * 2); - assert(ctab < lengthof(_bool_ctabs)); - DrawFrameRect(x, y, x + 19, y + 8, _bool_ctabs[ctab], on ? FR_LOWERED : 0); + DrawFrameRect(x, y, x + 19, y + 8, _bool_ctabs[!!on][!!editable], on ? FR_LOWERED : 0); SetDParam(0, on ? STR_CONFIG_PATCHES_ON : STR_CONFIG_PATCHES_OFF); } else { int32 value; |