From 1c38618bb88e2e2b6f2c110382737e8e03c54a86 Mon Sep 17 00:00:00 2001 From: Björn Steinbrink Date: Sun, 14 Aug 2005 23:17:58 +0000 Subject: Started to fade out the useOpenGL global variable. --- src/graphics.cpp | 5 ++--- src/graphics.h | 4 ++-- src/gui/browserbox.cpp | 3 ++- src/gui/gui.cpp | 1 + src/main.cpp | 2 +- src/main.h | 1 - src/resources/image.cpp | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/graphics.cpp b/src/graphics.cpp index a0e5d921..e71052df 100644 --- a/src/graphics.cpp +++ b/src/graphics.cpp @@ -28,7 +28,6 @@ #endif #include "log.h" -#include "main.h" #include "graphic/imagerect.h" @@ -37,8 +36,8 @@ extern volatile int framesToDraw; -Graphics::Graphics(): - mScreen(0) +Graphics::Graphics(bool useOpenGL): + mScreen(0), useOpenGL(useOpenGL) { } diff --git a/src/graphics.h b/src/graphics.h index 4b6bdd67..cdbc4104 100644 --- a/src/graphics.h +++ b/src/graphics.h @@ -48,7 +48,7 @@ public gcn::SDLGraphics { /** * Constructor. */ - Graphics(); + Graphics(bool useOpenGL); /** * Destructor. @@ -145,7 +145,7 @@ public gcn::SDLGraphics { private: SDL_Surface *mScreen; - bool mFullscreen, mHWAccel; + bool mFullscreen, mHWAccel, useOpenGL; }; #endif diff --git a/src/gui/browserbox.cpp b/src/gui/browserbox.cpp index e00494cd..5cae9fb7 100644 --- a/src/gui/browserbox.cpp +++ b/src/gui/browserbox.cpp @@ -23,7 +23,6 @@ #include -#include "../main.h" #ifdef USE_OPENGL #include "../resources/resourcemanager.h" #endif @@ -31,6 +30,8 @@ #include "linkhandler.h" #include "gui.h" +extern bool useOpenGL; + int BrowserBox::instances = 0; gcn::ImageFont* BrowserBox::browserFont; diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index f77ad0be..2eaa9d76 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -52,6 +52,7 @@ #include "../resources/resourcemanager.h" extern Being* autoTarget; +extern bool useOpenGL; // Guichan stuff Gui *gui; diff --git a/src/main.cpp b/src/main.cpp index bbddce5f..24f9cb76 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -236,7 +236,7 @@ void init_engine() hwaccel = ((int)config.getValue("hwaccel", 0) == 1); // Create the graphics context - graphics = new Graphics(); + graphics = new Graphics(useOpenGL); // Try to set the desired video mode if (!graphics->setVideoMode(width, height, bpp, fullscreen, hwaccel)) { diff --git a/src/main.h b/src/main.h index e4244fbc..2dd4f87a 100644 --- a/src/main.h +++ b/src/main.h @@ -64,6 +64,5 @@ extern int account_ID, session_ID1, session_ID2; extern char sex, n_server, n_character; extern unsigned char state; extern Sound sound; -extern bool useOpenGL; #endif diff --git a/src/resources/image.cpp b/src/resources/image.cpp index 854c65e8..4efe12e7 100644 --- a/src/resources/image.cpp +++ b/src/resources/image.cpp @@ -26,8 +26,8 @@ #include #include "../log.h" -#include "../main.h" +extern bool useOpenGL; Image::Image(SDL_Surface *image): image(image) -- cgit v1.2.3-70-g09d2