summaryrefslogtreecommitdiff
path: root/src/client.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-04-29 16:28:15 +0300
committerAndrei Karas <akaras@inbox.ru>2012-04-29 17:14:01 +0300
commitc25672bd63cce049e931030f70629eb689cf43eb (patch)
treed39d163d02f1c02d5c6cf87ebf98be86493eb45f /src/client.cpp
parent47329e695c95031491161cf45e1fbd118a8797e6 (diff)
downloadplus-c25672bd63cce049e931030f70629eb689cf43eb.tar.gz
plus-c25672bd63cce049e931030f70629eb689cf43eb.tar.bz2
plus-c25672bd63cce049e931030f70629eb689cf43eb.tar.xz
plus-c25672bd63cce049e931030f70629eb689cf43eb.zip
Add graphicsmanager class and move some code to it.
Diffstat (limited to 'src/client.cpp')
-rw-r--r--src/client.cpp30
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");