diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-05-27 21:47:06 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-05-27 21:47:06 +0300 |
commit | 0c6cc36b806f1ef2cb75b650ed93210d446e3af6 (patch) | |
tree | c12988de642db84d6cf6108668310536390fdc5e /src/graphicsmanager.cpp | |
parent | a1b59326cb4cd70bb2347e9776965a2a0d4895fd (diff) | |
download | manaplus-0c6cc36b806f1ef2cb75b650ed93210d446e3af6.tar.gz manaplus-0c6cc36b806f1ef2cb75b650ed93210d446e3af6.tar.bz2 manaplus-0c6cc36b806f1ef2cb75b650ed93210d446e3af6.tar.xz manaplus-0c6cc36b806f1ef2cb75b650ed93210d446e3af6.zip |
Refactor a bit video system initialisation.
Diffstat (limited to 'src/graphicsmanager.cpp')
-rw-r--r-- | src/graphicsmanager.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/graphicsmanager.cpp b/src/graphicsmanager.cpp index 8dffafeb4..cb546e752 100644 --- a/src/graphicsmanager.cpp +++ b/src/graphicsmanager.cpp @@ -92,6 +92,8 @@ GraphicsManager graphicsManager; +RenderType openGLMode = RENDER_SOFTWARE; + const int densitySize = 6; const std::string densityNames[] = @@ -414,6 +416,24 @@ void GraphicsManager::setVideoMode() } } +void GraphicsManager::initGraphics(const bool noOpenGL) +{ + openGLMode = intToRenderType(config.getIntValue("opengl")); +#ifdef USE_OPENGL + OpenGLImageHelper::setBlur(config.getBoolValue("blur")); + SurfaceImageHelper::SDLSetEnableAlphaCache( + config.getBoolValue("alphaCache") && !openGLMode); + ImageHelper::setEnableAlpha(config.getFloatValue("guialpha") != 1.0F + || openGLMode); +#else + SurfaceImageHelper::SDLSetEnableAlphaCache( + config.getBoolValue("alphaCache")); + ImageHelper::setEnableAlpha(config.getFloatValue("guialpha") != 1.0F); +#endif + createRenderers(noOpenGL); + detectPixelSize(); +} + #ifdef USE_SDL2 SDL_Window *GraphicsManager::createWindow(const int w, const int h, const int bpp A_UNUSED, |