diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-02-16 00:18:52 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-02-16 00:18:52 +0000 |
commit | 2b60c78c535fadcd5168d4829098d560f8a67eca (patch) | |
tree | 7575c0f4336a1b2323eeb49f3bd2a2f4b221551d /src/game.cpp | |
parent | a01b40aae0b738fc19e8305837d11acb47e6e47d (diff) | |
download | mana-client-2b60c78c535fadcd5168d4829098d560f8a67eca.tar.gz mana-client-2b60c78c535fadcd5168d4829098d560f8a67eca.tar.bz2 mana-client-2b60c78c535fadcd5168d4829098d560f8a67eca.tar.xz mana-client-2b60c78c535fadcd5168d4829098d560f8a67eca.zip |
"make dist" now produces distributions that compile and run, upped version to
0.0.10 for next release and some minor changes.
Diffstat (limited to 'src/game.cpp')
-rw-r--r-- | src/game.cpp | 53 |
1 files changed, 26 insertions, 27 deletions
diff --git a/src/game.cpp b/src/game.cpp index 9044a711..2d9c4cc7 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -120,7 +120,8 @@ void game() { close_session(); } -void do_init() { +void do_init() +{ if (!tiledMap.load(map_path)) { error("Could not find map file"); } @@ -130,8 +131,6 @@ void do_init() { // Initialize timers tick_time = 0; - - // The SDL way SDL_AddTimer(10, refresh_time, NULL); SDL_AddTimer(1000, second, NULL); @@ -242,31 +241,31 @@ void do_input() if (keysym.mod & KMOD_CTRL) { // Workaround for Win and else - #if __USE_UNIX98 - SDL_WM_ToggleFullScreen(screen); - if ((int)config.getValue("screen", 0) == 0) { - config.setValue("screen", 1); - } - else { - config.setValue("screen", 0); - } - #else - int displayFlags = 0; - if ((int)config.getValue("screen", 0) == 0) { +#if __USE_UNIX98 + SDL_WM_ToggleFullScreen(screen); + if ((int)config.getValue("screen", 0) == 0) { + config.setValue("screen", 1); + } + else { + config.setValue("screen", 0); + } +#else + int displayFlags = 0; + if ((int)config.getValue("screen", 0) == 0) { displayFlags |= SDL_FULLSCREEN; - config.setValue("screen", 1); - } - else { - config.setValue("screen", 0); - } - if ((int)config.getValue("hwaccel", 0)) { - displayFlags |= SDL_HWSURFACE | SDL_DOUBLEBUF; - } - else { - displayFlags |= SDL_SWSURFACE; - } - screen = SDL_SetVideoMode(800, 600, 32, displayFlags); - #endif + config.setValue("screen", 1); + } + else { + config.setValue("screen", 0); + } + if ((int)config.getValue("hwaccel", 0)) { + displayFlags |= SDL_HWSURFACE | SDL_DOUBLEBUF; + } + else { + displayFlags |= SDL_SWSURFACE; + } + screen = SDL_SetVideoMode(800, 600, 32, displayFlags); +#endif } } } // End key down |