diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-04-29 16:28:15 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-04-29 17:14:01 +0300 |
commit | c25672bd63cce049e931030f70629eb689cf43eb (patch) | |
tree | d39d163d02f1c02d5c6cf87ebf98be86493eb45f /src/client.cpp | |
parent | 47329e695c95031491161cf45e1fbd118a8797e6 (diff) | |
download | manaplus-c25672bd63cce049e931030f70629eb689cf43eb.tar.gz manaplus-c25672bd63cce049e931030f70629eb689cf43eb.tar.bz2 manaplus-c25672bd63cce049e931030f70629eb689cf43eb.tar.xz manaplus-c25672bd63cce049e931030f70629eb689cf43eb.zip |
Add graphicsmanager class and move some code to it.
Diffstat (limited to 'src/client.cpp')
-rw-r--r-- | src/client.cpp | 30 |
1 files changed, 2 insertions, 28 deletions
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"); |