summaryrefslogtreecommitdiff
path: root/src/graphicsmanager.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-08-25 13:19:23 +0300
committerAndrei Karas <akaras@inbox.ru>2013-08-25 14:03:36 +0300
commitba0815355ef7be8e5f46720be5a6911e466e1568 (patch)
treed464944cc5796535507461fa26b49f636e88a9bf /src/graphicsmanager.cpp
parent948d940d46240ff518ec9b1037503bebdb47196a (diff)
downloadManaVerse-ba0815355ef7be8e5f46720be5a6911e466e1568.tar.gz
ManaVerse-ba0815355ef7be8e5f46720be5a6911e466e1568.tar.bz2
ManaVerse-ba0815355ef7be8e5f46720be5a6911e466e1568.tar.xz
ManaVerse-ba0815355ef7be8e5f46720be5a6911e466e1568.zip
add SurfaceImageHelper for loading/processing surfaces for SDL2.
For SDL1.2 used SDLImageHelper.
Diffstat (limited to 'src/graphicsmanager.cpp')
-rw-r--r--src/graphicsmanager.cpp19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/graphicsmanager.cpp b/src/graphicsmanager.cpp
index 0dcfbb377..fb1ce3a32 100644
--- a/src/graphicsmanager.cpp
+++ b/src/graphicsmanager.cpp
@@ -47,6 +47,7 @@
#include "resources/imagehelper.h"
#include "resources/openglimagehelper.h"
#include "resources/sdlimagehelper.h"
+#include "resources/surfaceimagehelper.h"
#include "utils/paths.h"
#include "utils/sdlhelper.h"
@@ -229,7 +230,11 @@ void GraphicsManager::initGraphics(const bool noOpenGL)
{
case 0:
imageHelper = new SDLImageHelper;
- sdlImageHelper = imageHelper;
+#ifdef USE_SDL2
+ surfaceImageHelper = new SurfaceImageHelper;
+#else
+ surfaceImageHelper = imageHelper;
+#endif
mainGraphics = new SDLGraphics;
mUseTextureSampler = false;
break;
@@ -237,20 +242,20 @@ void GraphicsManager::initGraphics(const bool noOpenGL)
default:
#ifndef ANDROID
imageHelper = new OpenGLImageHelper;
- sdlImageHelper = new SDLImageHelper;
+ surfaceImageHelper = new SurfaceImageHelper;
mainGraphics = new NormalOpenGLGraphics;
mUseTextureSampler = true;
break;
case 2:
imageHelper = new OpenGLImageHelper;
- sdlImageHelper = new SDLImageHelper;
+ surfaceImageHelper = new SurfaceImageHelper;
mainGraphics = new SafeOpenGLGraphics;
mUseTextureSampler = false;
break;
#endif
case 3:
imageHelper = new OpenGLImageHelper;
- sdlImageHelper = new SDLImageHelper;
+ surfaceImageHelper = new SurfaceImageHelper;
mainGraphics = new MobileOpenGLGraphics;
mUseTextureSampler = false;
break;
@@ -262,7 +267,11 @@ void GraphicsManager::initGraphics(const bool noOpenGL A_UNUSED)
{
// Create the graphics context
imageHelper = new SDLImageHelper;
- sdlImageHelper = imageHelper;
+#ifdef USE_SDL2
+ surfaceImageHelper = new SurfaceImageHelper;
+#else
+ surfaceImageHelper = imageHelper;
+#endif
mainGraphics = new SDLGraphics;
#endif
}