summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 1f2ac73f..908be46a 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -58,9 +58,6 @@
#include <errno.h>
#endif
-// TODO Check if we can get rid of this
-extern SDL_Surface *screen;
-
// Account infos
int account_ID, session_ID1, session_ID2;
char sex, n_server, n_character;
@@ -252,7 +249,7 @@ void init_engine()
SDL_WM_SetIcon(IMG_Load(TMW_DATADIR "data/icons/tmw-icon.png"), NULL);
- screen = SDL_SetVideoMode(screenW, screenH, 0, displayFlags);
+ SDL_Surface *screen = SDL_SetVideoMode(screenW, screenH, 0, displayFlags);
if (screen == NULL) {
std::cerr << "Couldn't set " << screenW << "x" << screenH << "x" <<
bitDepth << " video mode: " << SDL_GetError() << std::endl;
@@ -296,7 +293,7 @@ void init_engine()
itemDb = new ItemManager();
// Create the graphics context
- graphics = new Graphics();
+ graphics = new Graphics(screen);
ResourceManager *resman = ResourceManager::getInstance();
@@ -330,7 +327,7 @@ void init_engine()
new OkDialog("Sound Engine", err, &initWarningListener);
logger->log("Warning: %s", err);
}
-
+
// Set frame counter when using fps limit
int fpsLimit = (int)config.getValue("fpslimit", 0);
if (fpsLimit)