From c25672bd63cce049e931030f70629eb689cf43eb Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 29 Apr 2012 16:28:15 +0300 Subject: Add graphicsmanager class and move some code to it. --- src/client.cpp | 30 ++---------------------------- 1 file changed, 2 insertions(+), 28 deletions(-) (limited to 'src/client.cpp') diff --git a/src/client.cpp b/src/client.cpp index d85251390..d3a11b369 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -32,6 +32,7 @@ #include "game.h" #include "guild.h" #include "guildmanager.h" +#include "graphicsmanager.h" #include "graphicsvertexes.h" #include "itemshortcut.h" #include "joystick.h" @@ -509,34 +510,7 @@ void Client::gameInit() } #endif -#ifdef USE_OPENGL - int useOpenGL = 0; - if (!mOptions.noOpenGL) - useOpenGL = config.getIntValue("opengl"); - - // Setup image loading for the right image format - Image::setLoadAsOpenGL(useOpenGL); - GraphicsVertexes::setLoadAsOpenGL(useOpenGL); - - // Create the graphics context - switch (useOpenGL) - { - case 0: - mainGraphics = new Graphics; - break; - case 1: - default: - mainGraphics = new OpenGLGraphics; - break; - case 2: - mainGraphics = new OpenGL1Graphics; - break; - }; - -#else - // Create the graphics context - mainGraphics = new Graphics; -#endif + graphicsManager.initGraphics(mOptions.noOpenGL); runCounters = config.getBoolValue("packetcounters"); -- cgit v1.2.3-70-g09d2