(svn r3604) Remove two unnecessary local variables

This commit is contained in:
tron 2006-02-14 07:32:45 +00:00
parent b5b4491471
commit a2acfb51ed

View File

@ -675,22 +675,22 @@ static void StartScenario(void)
bool SafeSaveOrLoad(const char *filename, int mode, int newgm) bool SafeSaveOrLoad(const char *filename, int mode, int newgm)
{ {
byte ogm = _game_mode; byte ogm = _game_mode;
int r;
_game_mode = newgm; _game_mode = newgm;
r = SaveOrLoad(filename, mode); switch (SaveOrLoad(filename, mode)) {
if (r == SL_REINIT) { case SL_OK: return true;
switch (ogm) {
case GM_MENU: LoadIntroGame(); break; case SL_REINIT:
case GM_EDITOR: MakeNewEditorWorld(); break; switch (ogm) {
default: MakeNewGame(); break; case GM_MENU: LoadIntroGame(); break;
} case GM_EDITOR: MakeNewEditorWorld(); break;
return false; default: MakeNewGame(); break;
} else if (r != SL_OK) { }
_game_mode = ogm; return false;
return false;
} else { default:
return true; _game_mode = ogm;
return false;
} }
} }
@ -916,7 +916,6 @@ static void HandleKeyScrolling(void)
void GameLoop(void) void GameLoop(void)
{ {
int m;
ThreadMsg message; ThreadMsg message;
if ((message = OTTD_PollThreadEvent()) != 0) ProcessSentMessage(message); if ((message = OTTD_PollThreadEvent()) != 0) ProcessSentMessage(message);
@ -932,23 +931,24 @@ void GameLoop(void)
if (_dirkeys) HandleKeyScrolling(); if (_dirkeys) HandleKeyScrolling();
// make a screenshot? // make a screenshot?
if ((m=_make_screenshot) != 0) { if (_make_screenshot != 0) {
_make_screenshot = 0; switch (_make_screenshot) {
switch(m) { case 1: // make small screenshot
case 1: // make small screenshot UndrawMouseCursor();
UndrawMouseCursor(); ShowScreenshotResult(MakeScreenshot());
ShowScreenshotResult(MakeScreenshot()); break;
break;
case 2: // make large screenshot case 2: // make large screenshot
ShowScreenshotResult(MakeWorldScreenshot(-(int)MapMaxX() * TILE_PIXELS, 0, (MapMaxX() + MapMaxY()) * TILE_PIXELS, (MapMaxX() + MapMaxY()) * TILE_PIXELS >> 1, 0)); ShowScreenshotResult(MakeWorldScreenshot(-(int)MapMaxX() * TILE_PIXELS, 0, (MapMaxX() + MapMaxY()) * TILE_PIXELS, (MapMaxX() + MapMaxY()) * TILE_PIXELS >> 1, 0));
break; break;
} }
_make_screenshot = 0;
} }
// switch game mode? // switch game mode?
if ((m=_switch_mode) != SM_NONE) { if (_switch_mode != SM_NONE) {
SwitchMode(_switch_mode);
_switch_mode = SM_NONE; _switch_mode = SM_NONE;
SwitchMode(m);
} }
IncreaseSpriteLRU(); IncreaseSpriteLRU();