diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-07-16 19:26:59 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-07-16 19:26:59 +0000 |
commit | a6db4d8004da5ad985a5ff26c0c01976a5618449 (patch) | |
tree | 5ed3dea6a28222de87840a4d1966338098123993 /src/gui/setup.cpp | |
parent | f4aedad02e8994f89a4137d175dba2666a7005bc (diff) | |
download | mana-client-a6db4d8004da5ad985a5ff26c0c01976a5618449.tar.gz mana-client-a6db4d8004da5ad985a5ff26c0c01976a5618449.tar.bz2 mana-client-a6db4d8004da5ad985a5ff26c0c01976a5618449.tar.xz mana-client-a6db4d8004da5ad985a5ff26c0c01976a5618449.zip |
Updated changelog, got rid of remaining extern SDL_Surface *screen cases,
fixed double free and cleaned up a bit.
Diffstat (limited to 'src/gui/setup.cpp')
-rw-r--r-- | src/gui/setup.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
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 |