diff options
author | rubidium <rubidium@openttd.org> | 2006-09-04 17:30:30 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2006-09-04 17:30:30 +0000 |
commit | ca9ec81fd109941fcb7163c73acefb1f9a4f04de (patch) | |
tree | 6cd5046c6a647012a61f5f97b8c5794446df92c5 /video/sdl_v.c | |
parent | 2ca590ab75659a2282a90c722426f25e6e65f960 (diff) | |
download | openttd-ca9ec81fd109941fcb7163c73acefb1f9a4f04de.tar.xz |
(svn r6380) -Codechange: unify all ways to quit OTTD.
This means that in the intro menu the 'Quit' button immediatelly quits
and the 'Quit' in the menu of the normal game and scenario editor
immediatelly quits when the 'autosave_on_exit' patch is turned on.
This is the same way as the OS/window manager initiated quits, like
alt-F4 and the 'x' in the (OS/window manager drawn) title bar of OTTD.
Diffstat (limited to 'video/sdl_v.c')
-rw-r--r-- | video/sdl_v.c | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/video/sdl_v.c b/video/sdl_v.c index 57c81c556..b8b79b86b 100644 --- a/video/sdl_v.c +++ b/video/sdl_v.c @@ -303,8 +303,6 @@ static uint32 ConvertSdlKeyIntoMy(SDL_keysym *sym) return (key << 16) + sym->unicode; } -extern void DoExitSave(void); - static int PollEvent(void) { SDL_Event ev; @@ -376,21 +374,9 @@ static int PollEvent(void) } break; - case SDL_QUIT: - // do not ask to quit on the main screen - if (_game_mode != GM_MENU) { - if (_patches.autosave_on_exit) { - DoExitSave(); - return 0; - } else { - AskExitGame(); - } - } else { - return 0; - } - break; + case SDL_QUIT: HandleExitGameRequest(); break; - case SDL_KEYDOWN: /* Toggle full-screen on ALT + ENTER/F */ + case SDL_KEYDOWN: /* Toggle full-screen on ALT + ENTER/F */ if ((ev.key.keysym.mod & (KMOD_ALT | KMOD_META)) && (ev.key.keysym.sym == SDLK_RETURN || ev.key.keysym.sym == SDLK_f)) { ToggleFullScreen(!_fullscreen); @@ -448,8 +434,6 @@ static void SdlVideoMainLoop(void) InteractiveRandom(); // randomness while ((i = PollEvent()) == -1) {} - if (i >= 0) return; - if (_exit_game) return; mod = SDL_CALL SDL_GetModState(); |