summaryrefslogtreecommitdiff
path: root/src/resources/openglimagehelper.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-08-26 16:09:58 +0300
committerAndrei Karas <akaras@inbox.ru>2013-08-26 16:52:08 +0300
commit929aeb1591e739588cd8cf629e7d7ac5a95261b1 (patch)
tree2b61b477d0e0ffed31a90ba2d6c019da926282aa /src/resources/openglimagehelper.cpp
parentb661524e8b7b41cec237492ecd52fdda7b9be394 (diff)
downloadplus-929aeb1591e739588cd8cf629e7d7ac5a95261b1.tar.gz
plus-929aeb1591e739588cd8cf629e7d7ac5a95261b1.tar.bz2
plus-929aeb1591e739588cd8cf629e7d7ac5a95261b1.tar.xz
plus-929aeb1591e739588cd8cf629e7d7ac5a95261b1.zip
add surface allocation debug code.
Diffstat (limited to 'src/resources/openglimagehelper.cpp')
-rw-r--r--src/resources/openglimagehelper.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/resources/openglimagehelper.cpp b/src/resources/openglimagehelper.cpp
index 0debbe988..6e60cc647 100644
--- a/src/resources/openglimagehelper.cpp
+++ b/src/resources/openglimagehelper.cpp
@@ -37,6 +37,7 @@
#include "resources/image.h"
#include "resources/resourcemanager.h"
+#include "utils/sdlcheckutils.h"
#include "utils/stringutils.h"
#include <SDL_image.h>
@@ -60,7 +61,7 @@ Image *OpenGLImageHelper::load(SDL_RWops *const rw, Dye const &dye) const
}
SDL_Surface *const surf = convertTo32Bit(tmpImage);
- SDL_FreeSurface(tmpImage);
+ MSDL_FreeSurface(tmpImage);
uint32_t *pixels = static_cast<uint32_t *>(surf->pixels);
const int type = dye.getType();
@@ -90,7 +91,7 @@ Image *OpenGLImageHelper::load(SDL_RWops *const rw, Dye const &dye) const
}
Image *const image = load(surf);
- SDL_FreeSurface(surf);
+ MSDL_FreeSurface(surf);
return image;
}
@@ -182,7 +183,7 @@ Image *OpenGLImageHelper::glLoad(SDL_Surface *tmpImage,
#ifdef USE_SDL2
SDL_SetSurfaceBlendMode (oldImage, SDL_BLENDMODE_NONE);
#endif
- tmpImage = SDL_CreateRGBSurface(SDL_SWSURFACE, realWidth, realHeight,
+ tmpImage = MSDL_CreateRGBSurface(SDL_SWSURFACE, realWidth, realHeight,
32, rmask, gmask, bmask, amask);
if (!tmpImage)
@@ -260,7 +261,7 @@ Image *OpenGLImageHelper::glLoad(SDL_Surface *tmpImage,
SDL_UnlockSurface(tmpImage);
if (oldImage)
- SDL_FreeSurface(tmpImage);
+ MSDL_FreeSurface(tmpImage);
GLenum error = glGetError();
if (error)
@@ -315,7 +316,7 @@ SDL_Surface *OpenGLImageHelper::create32BitSurface(int width, int height) const
width = powerOfTwo(width);
height = powerOfTwo(height);
- return SDL_CreateRGBSurface(SDL_SWSURFACE,
+ return MSDL_CreateRGBSurface(SDL_SWSURFACE,
width, height, 32, rmask, gmask, bmask, amask);
}