From cfaf8b836b21842b5d22ad774f93c2c364d33c0b Mon Sep 17 00:00:00 2001 From: Björn Steinbrink Date: Sun, 14 Aug 2005 23:57:06 +0000 Subject: Fully removed the useOpenGL global. --- src/main.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 24f9cb76..5d06cf97 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -76,7 +76,6 @@ short map_port; char map_name[16]; unsigned char state; unsigned char screen_mode; -bool useOpenGL = false; volatile int framesToDraw = 0; Sound sound; @@ -222,10 +221,6 @@ void init_engine() SDL_WM_SetCaption("The Mana World", NULL); SDL_WM_SetIcon(IMG_Load(TMW_DATADIR "data/icons/tmw-icon.png"), NULL); -#ifdef USE_OPENGL - useOpenGL = (config.getValue("opengl", 0) == 1); -#endif - int width, height, bpp; bool fullscreen, hwaccel; @@ -235,6 +230,13 @@ void init_engine() fullscreen = ((int)config.getValue("screen", 0) == 1); hwaccel = ((int)config.getValue("hwaccel", 0) == 1); + bool useOpenGL = (config.getValue("opengl", 0) == 1); + +#ifdef USE_OPENGL + // Setup image loading for the right image format + Image::setLoadAsOpenGL(useOpenGL); +#endif + // Create the graphics context graphics = new Graphics(useOpenGL); -- cgit v1.2.3-70-g09d2