Mercurial > hg > openttd
changeset 3024:b2a201ca6188 draft
(svn r3604) Remove two unnecessary local variables
author | tron <tron@openttd.org> |
---|---|
date | Tue, 14 Feb 2006 07:32:45 +0000 |
parents | 02ee568e0a3c |
children | e2a53206bc6e |
files | openttd.c |
diffstat | 1 files changed, 27 insertions(+), 27 deletions(-) [+] |
line wrap: on
line diff
--- a/openttd.c +++ b/openttd.c @@ -675,22 +675,22 @@ bool SafeSaveOrLoad(const char *filename, int mode, int newgm) { byte ogm = _game_mode; - int r; _game_mode = newgm; - r = SaveOrLoad(filename, mode); - if (r == SL_REINIT) { - switch (ogm) { - case GM_MENU: LoadIntroGame(); break; - case GM_EDITOR: MakeNewEditorWorld(); break; - default: MakeNewGame(); break; - } - return false; - } else if (r != SL_OK) { - _game_mode = ogm; - return false; - } else { - return true; + switch (SaveOrLoad(filename, mode)) { + case SL_OK: return true; + + case SL_REINIT: + switch (ogm) { + case GM_MENU: LoadIntroGame(); break; + case GM_EDITOR: MakeNewEditorWorld(); break; + default: MakeNewGame(); break; + } + return false; + + default: + _game_mode = ogm; + return false; } } @@ -916,7 +916,6 @@ void GameLoop(void) { - int m; ThreadMsg message; if ((message = OTTD_PollThreadEvent()) != 0) ProcessSentMessage(message); @@ -932,23 +931,24 @@ if (_dirkeys) HandleKeyScrolling(); // make a screenshot? - if ((m=_make_screenshot) != 0) { + if (_make_screenshot != 0) { + switch (_make_screenshot) { + case 1: // make small screenshot + UndrawMouseCursor(); + ShowScreenshotResult(MakeScreenshot()); + break; + + case 2: // make large screenshot + ShowScreenshotResult(MakeWorldScreenshot(-(int)MapMaxX() * TILE_PIXELS, 0, (MapMaxX() + MapMaxY()) * TILE_PIXELS, (MapMaxX() + MapMaxY()) * TILE_PIXELS >> 1, 0)); + break; + } _make_screenshot = 0; - switch(m) { - case 1: // make small screenshot - UndrawMouseCursor(); - ShowScreenshotResult(MakeScreenshot()); - break; - case 2: // make large screenshot - ShowScreenshotResult(MakeWorldScreenshot(-(int)MapMaxX() * TILE_PIXELS, 0, (MapMaxX() + MapMaxY()) * TILE_PIXELS, (MapMaxX() + MapMaxY()) * TILE_PIXELS >> 1, 0)); - break; - } } // switch game mode? - if ((m=_switch_mode) != SM_NONE) { + if (_switch_mode != SM_NONE) { + SwitchMode(_switch_mode); _switch_mode = SM_NONE; - SwitchMode(m); } IncreaseSpriteLRU();