diff options
author | Yohann Ferreira <bertram@cegetel.net> | 2005-01-30 14:09:10 +0000 |
---|---|---|
committer | Yohann Ferreira <bertram@cegetel.net> | 2005-01-30 14:09:10 +0000 |
commit | d977794bffbd94ab49d08eb06e691151a83bbdb3 (patch) | |
tree | e253e37227f256e8a9a49ffcb6716a4e3b9230d1 /src/gui | |
parent | 1785efcb1a75f5247fe71d340a4f905b3c340711 (diff) | |
download | mana-d977794bffbd94ab49d08eb06e691151a83bbdb3.tar.gz mana-d977794bffbd94ab49d08eb06e691151a83bbdb3.tar.bz2 mana-d977794bffbd94ab49d08eb06e691151a83bbdb3.tar.xz mana-d977794bffbd94ab49d08eb06e691151a83bbdb3.zip |
Corrected Toggle fullscreen code, still need to handle resolution
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/setup.cpp | 36 |
1 files changed, 32 insertions, 4 deletions
diff --git a/src/gui/setup.cpp b/src/gui/setup.cpp index 330315dc..6f7feb8f 100644 --- a/src/gui/setup.cpp +++ b/src/gui/setup.cpp @@ -139,18 +139,46 @@ void Setup::action(const std::string& eventId) sel = modeList->getSelected(); // Display settings - if (fsCheckBox->isMarked() && config.getValue("screen", 0) == 2) + if (fsCheckBox->isMarked() && config.getValue("screen", 0) == 0) { config.setValue("screen", 1); - SDL_WM_ToggleFullScreen(SDL_GetVideoSurface()); + #if __USE_UNIX98 + SDL_WM_ToggleFullScreen(screen); + + #else + int displayFlags = 0; + displayFlags |= SDL_FULLSCREEN; + if ((int)config.getValue("hwaccel", 0)) { + displayFlags |= SDL_HWSURFACE | SDL_DOUBLEBUF; + } + else { + displayFlags |= SDL_SWSURFACE; + } + screen = SDL_SetVideoMode(800, 600, 32, displayFlags); + #endif + + // FIXME : Need to handle resolution //set_gfx_mode(GFX_AUTODETECT_FULLSCREEN, // modes[sel].height, modes[sel].width, 0, 0); } else if (!fsCheckBox->isMarked() && config.getValue("screen", 0) == 1) { - config.setValue("screen", 2); - SDL_WM_ToggleFullScreen(SDL_GetVideoSurface()); + config.setValue("screen", 0); + #if __USE_UNIX98 + SDL_WM_ToggleFullScreen(screen); + + #else + int displayFlags = 0; + if ((int)config.getValue("hwaccel", 0)) { + displayFlags |= SDL_HWSURFACE | SDL_DOUBLEBUF; + } + else { + displayFlags |= SDL_SWSURFACE; + } + screen = SDL_SetVideoMode(800, 600, 32, displayFlags); + #endif + // FIXME : Need to handle resolution //set_gfx_mode(GFX_AUTODETECT_WINDOWED, // modes[sel].height, modes[sel].width, 0, 0); } |