summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-02-14 07:32:45 +0000
committertron <tron@openttd.org>2006-02-14 07:32:45 +0000
commita2acfb51ed65598a38572ada38f6702ed977413a (patch)
tree19c5fe3aa522fefcef761abad29a9587fe6874ab
parentb5b449147118624149a356d2582d666e4a9d5a8f (diff)
downloadopenttd-a2acfb51ed65598a38572ada38f6702ed977413a.tar.xz
(svn r3604) Remove two unnecessary local variables
-rw-r--r--openttd.c54
1 files changed, 27 insertions, 27 deletions
diff --git a/openttd.c b/openttd.c
index 6a50ce66c..f0af79faf 100644
--- a/openttd.c
+++ b/openttd.c
@@ -675,22 +675,22 @@ static void StartScenario(void)
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 @@ static void HandleKeyScrolling(void)
void GameLoop(void)
{
- int m;
ThreadMsg message;
if ((message = OTTD_PollThreadEvent()) != 0) ProcessSentMessage(message);
@@ -932,23 +931,24 @@ void GameLoop(void)
if (_dirkeys) HandleKeyScrolling();
// make a screenshot?
- if ((m=_make_screenshot) != 0) {
- _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;
+ 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 game mode?
- if ((m=_switch_mode) != SM_NONE) {
+ if (_switch_mode != SM_NONE) {
+ SwitchMode(_switch_mode);
_switch_mode = SM_NONE;
- SwitchMode(m);
}
IncreaseSpriteLRU();