diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-06-10 16:54:18 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-06-10 17:25:07 +0300 |
commit | 3a28edfb7ac991ad70a7baf76f48218d9db89bcb (patch) | |
tree | 918e56537dd2f7c2ce94e97a297a83a55d6f6ea6 /src/graphicsmanager.cpp | |
parent | f199b9ba7da47cb6f9aa95f843c0628621899aa9 (diff) | |
download | plus-3a28edfb7ac991ad70a7baf76f48218d9db89bcb.tar.gz plus-3a28edfb7ac991ad70a7baf76f48218d9db89bcb.tar.bz2 plus-3a28edfb7ac991ad70a7baf76f48218d9db89bcb.tar.xz plus-3a28edfb7ac991ad70a7baf76f48218d9db89bcb.zip |
Split ImageHelper to ImageHelper, SDLImageHelper, OpenGLImageHelper.
Diffstat (limited to 'src/graphicsmanager.cpp')
-rw-r--r-- | src/graphicsmanager.cpp | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/src/graphicsmanager.cpp b/src/graphicsmanager.cpp index 61e157353..e32cf24ef 100644 --- a/src/graphicsmanager.cpp +++ b/src/graphicsmanager.cpp @@ -26,6 +26,8 @@ #include "logger.h" #include "resources/imagehelper.h" +#include "resources/openglimagehelper.h" +#include "resources/sdlimagehelper.h" #include "utils/paths.h" #include "utils/stringutils.h" @@ -153,26 +155,30 @@ void GraphicsManager::initGraphics(bool noOpenGL) useOpenGL = config.getIntValue("opengl"); // Setup image loading for the right image format - ImageHelper::setLoadAsOpenGL(useOpenGL); + OpenGLImageHelper::setLoadAsOpenGL(useOpenGL); GraphicsVertexes::setLoadAsOpenGL(useOpenGL); // Create the graphics context switch (useOpenGL) { case 0: + imageHelper = new SDLImageHelper; mainGraphics = new Graphics; break; case 1: default: + imageHelper = new OpenGLImageHelper; mainGraphics = new OpenGLGraphics; break; case 2: + imageHelper = new OpenGLImageHelper; mainGraphics = new OpenGL1Graphics; break; }; #else // Create the graphics context + imageHelper = new SDLImageHelper; mainGraphics = new Graphics; #endif } @@ -210,7 +216,7 @@ void GraphicsManager::updateTextureFormat() if (formats[f] == GL_COMPRESSED_RGBA_S3TC_DXT5_EXT) { delete []formats; - ImageHelper::setInternalTextureType( + OpenGLImageHelper::setInternalTextureType( GL_COMPRESSED_RGBA_S3TC_DXT5_EXT); logger->log1("using s3tc texture compression"); return; @@ -218,19 +224,21 @@ void GraphicsManager::updateTextureFormat() else if (formats[f] == GL_COMPRESSED_RGBA_FXT1_3DFX) { delete []formats; - ImageHelper::setInternalTextureType( + OpenGLImageHelper::setInternalTextureType( GL_COMPRESSED_RGBA_FXT1_3DFX); logger->log1("using fxt1 texture compression"); return; } } - ImageHelper::setInternalTextureType(GL_COMPRESSED_RGBA_ARB); + OpenGLImageHelper::setInternalTextureType( + GL_COMPRESSED_RGBA_ARB); logger->log1("using texture compression"); return; } else { - ImageHelper::setInternalTextureType(GL_COMPRESSED_RGBA_ARB); + OpenGLImageHelper::setInternalTextureType( + GL_COMPRESSED_RGBA_ARB); logger->log1("using texture compression"); return; } @@ -240,12 +248,12 @@ void GraphicsManager::updateTextureFormat() // using default formats if (config.getBoolValue("newtextures")) { - ImageHelper::setInternalTextureType(GL_RGBA); + OpenGLImageHelper::setInternalTextureType(GL_RGBA); logger->log1("using RGBA texture format"); } else { - ImageHelper::setInternalTextureType(4); + OpenGLImageHelper::setInternalTextureType(4); logger->log1("using 4 texture format"); } #endif |