From a6db4d8004da5ad985a5ff26c0c01976a5618449 Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Sat, 16 Jul 2005 19:26:59 +0000 Subject: Updated changelog, got rid of remaining extern SDL_Surface *screen cases, fixed double free and cleaned up a bit. --- src/gui/setup.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/gui/setup.cpp') diff --git a/src/gui/setup.cpp b/src/gui/setup.cpp index eb9121bc..cda9ae31 100644 --- a/src/gui/setup.cpp +++ b/src/gui/setup.cpp @@ -22,6 +22,7 @@ */ #include "setup.h" +#include "gui.h" #include "button.h" #include "checkbox.h" #include "scrollarea.h" @@ -34,8 +35,6 @@ #define SETUP_WIDTH 240 -extern SDL_Surface *screen; - ModeListModel::ModeListModel() { SDL_Rect **modes; @@ -236,14 +235,18 @@ void Setup::action(const std::string &eventId) //displayFlags |= SDL_OPENGL; //SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); } - - screen = SDL_SetVideoMode(screenW, screenH, bitDepth, displayFlags); + + SDL_Surface *screen = + SDL_SetVideoMode(screenW, screenH, bitDepth, displayFlags); + if (screen == NULL) { std::cerr << "Couldn't set " << screenW << "x" << screenH << "x" << bitDepth << " video mode: " << SDL_GetError() << std::endl; exit(1); } + + guiGraphics->setScreen(screen); } // Sound settings -- cgit v1.2.3-70-g09d2