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/resources/image.cpp | |
parent | f199b9ba7da47cb6f9aa95f843c0628621899aa9 (diff) | |
download | mv-3a28edfb7ac991ad70a7baf76f48218d9db89bcb.tar.gz mv-3a28edfb7ac991ad70a7baf76f48218d9db89bcb.tar.bz2 mv-3a28edfb7ac991ad70a7baf76f48218d9db89bcb.tar.xz mv-3a28edfb7ac991ad70a7baf76f48218d9db89bcb.zip |
Split ImageHelper to ImageHelper, SDLImageHelper, OpenGLImageHelper.
Diffstat (limited to 'src/resources/image.cpp')
-rw-r--r-- | src/resources/image.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/resources/image.cpp b/src/resources/image.cpp index 5496a10d8..b060be6f4 100644 --- a/src/resources/image.cpp +++ b/src/resources/image.cpp @@ -37,6 +37,8 @@ #include "utils/stringutils.h" #include "resources/imagehelper.h" +#include "resources/openglimagehelper.h" +#include "resources/sdlimagehelper.h" #include "resources/subimage.h" #include <SDL_image.h> @@ -56,7 +58,7 @@ Image::Image(SDL_Surface *image, bool hasAlphaChannel0, Uint8 *alphaChannel): mGLImage = 0; #endif - mUseAlphaCache = ImageHelper::mEnableAlphaCache; + mUseAlphaCache = SDLImageHelper::mEnableAlphaCache; mBounds.x = 0; mBounds.y = 0; @@ -165,7 +167,7 @@ bool Image::hasAlphaChannel() return mHasAlphaChannel; #ifdef USE_OPENGL - if (ImageHelper::mUseOpenGL) + if (OpenGLImageHelper::mUseOpenGL) return true; #endif @@ -232,7 +234,7 @@ void Image::setAlpha(float alpha) } else { - mSDLSurface = ImageHelper::SDLDuplicateSurface(mSDLSurface); + mSDLSurface = SDLImageHelper::SDLDuplicateSurface(mSDLSurface); } // logger->log("miss"); } @@ -310,7 +312,7 @@ Image* Image::SDLgetScaledImage(int width, int height) // and about freeing the given SDL_surface*. if (scaledSurface) { - scaledImage = ImageHelper::load(scaledSurface); + scaledImage = imageHelper->load(scaledSurface); SDL_FreeSurface(scaledSurface); } } @@ -321,7 +323,7 @@ Image *Image::getSubImage(int x, int y, int width, int height) { // Create a new clipped sub-image #ifdef USE_OPENGL - if (ImageHelper::mUseOpenGL) + if (OpenGLImageHelper::mUseOpenGL) { return new SubImage(this, mGLImage, x, y, width, height, mTexWidth, mTexHeight); |