From 454b4b759345ce1fed0d2ee61733975fe3d84017 Mon Sep 17 00:00:00 2001 From: Eugenio Favalli Date: Tue, 5 Apr 2005 21:27:49 +0000 Subject: Cleaning and fixing setup window --- src/gui/setup.cpp | 59 +++++++++++++++++-------------------------------------- 1 file changed, 18 insertions(+), 41 deletions(-) (limited to 'src/gui') diff --git a/src/gui/setup.cpp b/src/gui/setup.cpp index 85aa900d..a8c4721e 100644 --- a/src/gui/setup.cpp +++ b/src/gui/setup.cpp @@ -190,53 +190,30 @@ void Setup::action(const std::string &eventId) else if (eventId == "apply") { setVisible(false); - - // Select video mode - sel = modeList->getSelected(); - - if (sel != last_sel) { - last_sel = sel; - screen = SDL_SetVideoMode(modes[sel]->w, modes[sel]->h, 32, - SDL_FULLSCREEN | SDL_HWSURFACE); - } - - // Display settings - if (fsCheckBox->isMarked() && config.getValue("screen", 0) == 0) - { + + /*screenW = modes[sel]->w; + screenH = modes[sel]->h;*/ + + if (fsCheckBox->isMarked()) { // Fullscreen config.setValue("screen", 1); -#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(modes[sel]->w, modes[sel]->h, 32, - displayFlags); -#endif - } - else if (!fsCheckBox->isMarked() && config.getValue("screen", 0) == 1) - { + else { // Windowed config.setValue("screen", 0); -#if __USE_UNIX98 - SDL_WM_ToggleFullScreen(screen); + displayFlags &= ~SDL_FULLSCREEN; + } + + screen = SDL_SetVideoMode(screenW, screenH, bitDepth, displayFlags); + +/* if (displayFlags & SDL_FULLSCREEN) { +#ifdef WIN32 + displayFlags ^= SDL_FULLSCREEN; + screen = SDL_SetVideoMode(screenW, screenH, bitDepth, displayFlags); #else - int displayFlags = 0; - if ((int)config.getValue("hwaccel", 0)) { - displayFlags |= SDL_HWSURFACE | SDL_DOUBLEBUF; - } - else { - displayFlags |= SDL_SWSURFACE; - } - screen = SDL_SetVideoMode(modes[sel]->w, modes[sel]->h, 32, - displayFlags); + SDL_WM_ToggleFullScreen(screen); #endif - } + }*/ + // Sound settings if (soundCheckBox->isMarked()) { -- cgit v1.2.3-70-g09d2