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/client.cpp | |
parent | f199b9ba7da47cb6f9aa95f843c0628621899aa9 (diff) | |
download | manaplus-3a28edfb7ac991ad70a7baf76f48218d9db89bcb.tar.gz manaplus-3a28edfb7ac991ad70a7baf76f48218d9db89bcb.tar.bz2 manaplus-3a28edfb7ac991ad70a7baf76f48218d9db89bcb.tar.xz manaplus-3a28edfb7ac991ad70a7baf76f48218d9db89bcb.zip |
Split ImageHelper to ImageHelper, SDLImageHelper, OpenGLImageHelper.
Diffstat (limited to 'src/client.cpp')
-rw-r--r-- | src/client.cpp | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/src/client.cpp b/src/client.cpp index 35658f0f9..b782ce3a1 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -86,6 +86,8 @@ #include "resources/emotedb.h" #include "resources/image.h" #include "resources/imagehelper.h" +#include "resources/openglimagehelper.h" +#include "resources/sdlimagehelper.h" #include "resources/itemdb.h" #include "resources/mapdb.h" #include "resources/monsterdb.h" @@ -397,16 +399,6 @@ void Client::gameInit() "Exiting.", mLocalDataDir.c_str())); } -#if defined USE_OPENGL - ImageHelper::setBlur(config.getBoolValue("blur")); - ImageHelper::SDLSetEnableAlphaCache(config.getBoolValue("alphaCache") - && !config.getIntValue("opengl")); - ImageHelper::setEnableAlpha(config.getFloatValue("guialpha") != 1.0f - || config.getIntValue("opengl")); -#else - ImageHelper::SDLSetEnableAlphaCache(config.getBoolValue("alphaCache")); - ImageHelper::setEnableAlpha(config.getFloatValue("guialpha") != 1.0f); -#endif resman->addToSearchPath(PKG_DATADIR "data/perserver/default", false); @@ -518,6 +510,18 @@ void Client::gameInit() config.setValue("videodetected", true); } #endif + +#if defined USE_OPENGL + OpenGLImageHelper::setBlur(config.getBoolValue("blur")); + SDLImageHelper::SDLSetEnableAlphaCache(config.getBoolValue("alphaCache") + && !config.getIntValue("opengl")); + ImageHelper::setEnableAlpha(config.getFloatValue("guialpha") != 1.0f + || config.getIntValue("opengl")); +#else + SDLImageHelper::SDLSetEnableAlphaCache(config.getBoolValue("alphaCache")); + ImageHelper::setEnableAlpha(config.getFloatValue("guialpha") != 1.0f); +#endif + graphicsManager.initGraphics(mOptions.noOpenGL); runCounters = config.getBoolValue("packetcounters"); @@ -716,6 +720,9 @@ void Client::gameClear() delete mainGraphics; mainGraphics = nullptr; + delete imageHelper; + imageHelper = nullptr; + if (logger) logger->log1("Quitting4"); |