summaryrefslogtreecommitdiff
path: root/src/gui/setup.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2005-07-16 19:26:59 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2005-07-16 19:26:59 +0000
commita6db4d8004da5ad985a5ff26c0c01976a5618449 (patch)
tree5ed3dea6a28222de87840a4d1966338098123993 /src/gui/setup.cpp
parentf4aedad02e8994f89a4137d175dba2666a7005bc (diff)
downloadMana-a6db4d8004da5ad985a5ff26c0c01976a5618449.tar.gz
Mana-a6db4d8004da5ad985a5ff26c0c01976a5618449.tar.bz2
Mana-a6db4d8004da5ad985a5ff26c0c01976a5618449.tar.xz
Mana-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.cpp11
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