summaryrefslogtreecommitdiff
path: root/src/main.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/main.cpp
parentf4aedad02e8994f89a4137d175dba2666a7005bc (diff)
downloadmana-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/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)