diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-06-07 22:33:10 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-06-07 22:33:10 +0300 |
commit | 5f478df06f4c04bdef94874860a1b40e8d0d62fe (patch) | |
tree | ab7c0d03637d8d94e13b6e35466289a1445495e5 /src/graphicsmanager.cpp | |
parent | 6adc2a5654e55f4a0e817cd5731753cdc3bc5ff4 (diff) | |
download | manaplus-5f478df06f4c04bdef94874860a1b40e8d0d62fe.tar.gz manaplus-5f478df06f4c04bdef94874860a1b40e8d0d62fe.tar.bz2 manaplus-5f478df06f4c04bdef94874860a1b40e8d0d62fe.tar.xz manaplus-5f478df06f4c04bdef94874860a1b40e8d0d62fe.zip |
Improve a bit video mode initialisation code.
Diffstat (limited to 'src/graphicsmanager.cpp')
-rw-r--r-- | src/graphicsmanager.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/graphicsmanager.cpp b/src/graphicsmanager.cpp index 870f52bb9..25c083124 100644 --- a/src/graphicsmanager.cpp +++ b/src/graphicsmanager.cpp @@ -40,6 +40,7 @@ #include "configuration.h" #include "logger.h" +#include "settings.h" #include "render/graphics.h" #include "render/mgl.h" @@ -245,10 +246,10 @@ int GraphicsManager::detectGraphics() | (1024 * textureSampler) | (2048 * compressTextures); } -void GraphicsManager::createRenderers(const bool noOpenGL) +void GraphicsManager::createRenderers() { RenderType useOpenGL = RENDER_SOFTWARE; - if (!noOpenGL) + if (!settings.options.noOpenGL) useOpenGL = intToRenderType(config.getIntValue("opengl")); // Setup image loading for the right image format @@ -311,10 +312,10 @@ void GraphicsManager::createRenderers(const bool noOpenGL) #else // USE_OPENGL -void GraphicsManager::createRenderers(const bool noOpenGL) +void GraphicsManager::createRenderers() { RenderType useOpenGL = RENDER_SOFTWARE; - if (!noOpenGL) + if (!settings.options.noOpenGL) useOpenGL = intToRenderType(config.getIntValue("opengl")); // Setup image loading for the right image format @@ -421,7 +422,7 @@ void GraphicsManager::setVideoMode() } } -void GraphicsManager::initGraphics(const bool noOpenGL) +void GraphicsManager::initGraphics() { openGLMode = intToRenderType(config.getIntValue("opengl")); #ifdef USE_OPENGL @@ -435,8 +436,9 @@ void GraphicsManager::initGraphics(const bool noOpenGL) config.getBoolValue("alphaCache")); ImageHelper::setEnableAlpha(config.getFloatValue("guialpha") != 1.0F); #endif - createRenderers(noOpenGL); + createRenderers(); detectPixelSize(); + setVideoMode(); } #ifdef USE_SDL2 |