summaryrefslogtreecommitdiff
path: root/src/gui
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/gui
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/gui')
-rw-r--r--src/gui/minimap.cpp5
-rw-r--r--src/gui/sdlfont.cpp18
2 files changed, 13 insertions, 10 deletions
diff --git a/src/gui/minimap.cpp b/src/gui/minimap.cpp
index 8b2ddef5e..641f9f9f9 100644
--- a/src/gui/minimap.cpp
+++ b/src/gui/minimap.cpp
@@ -37,6 +37,7 @@
#include "resources/resourcemanager.h"
#include "utils/gettext.h"
+#include "utils/sdlcheckutils.h"
#include <guichan/font.hpp>
@@ -124,7 +125,7 @@ void Minimap::setMap(const Map *const map)
{
if (config.getBoolValue("showExtMinimaps"))
{
- SDL_Surface *const surface = SDL_CreateRGBSurface(SDL_SWSURFACE,
+ SDL_Surface *const surface = MSDL_CreateRGBSurface(SDL_SWSURFACE,
map->getWidth(), map->getHeight(), 32,
0x00ff0000, 0x0000ff00, 0x000000ff, 0x00000000);
if (!surface)
@@ -155,7 +156,7 @@ void Minimap::setMap(const Map *const map)
mMapImage = imageHelper->load(surface);
mMapImage->setAlpha(client->getGuiAlpha());
mCustomMapImage = true;
- SDL_FreeSurface(surface);
+ MSDL_FreeSurface(surface);
}
else
{
diff --git a/src/gui/sdlfont.cpp b/src/gui/sdlfont.cpp
index b6e0b8986..c0ca34bbb 100644
--- a/src/gui/sdlfont.cpp
+++ b/src/gui/sdlfont.cpp
@@ -27,13 +27,15 @@
#include "logger.h"
#include "main.h"
#include "sdlgraphics.h"
-#include "utils/paths.h"
#include "resources/image.h"
#include "resources/imagehelper.h"
#include "resources/resourcemanager.h"
#include "resources/surfaceimagehelper.h"
+#include "utils/paths.h"
+#include "utils/sdlcheckutils.h"
+
#include <guichan/exception.hpp>
#include "debug.h"
@@ -146,7 +148,7 @@ void SDLTextChunk::generate(TTF_Font *const font, const float alpha)
getSafeUtf8String(text, strBuf);
- SDL_Surface *surface = TTF_RenderUTF8_Blended(
+ SDL_Surface *surface = MTTF_RenderUTF8_Blended(
font, strBuf, sdlCol);
if (!surface)
@@ -168,7 +170,7 @@ void SDLTextChunk::generate(TTF_Font *const font, const float alpha)
if (!background)
{
img = nullptr;
- SDL_FreeSurface(surface);
+ MSDL_FreeSurface(surface);
BLOCK_END("SDLTextChunk::generate")
return;
}
@@ -180,12 +182,12 @@ void SDLTextChunk::generate(TTF_Font *const font, const float alpha)
#else
sdlCol2.unused = 0;
#endif
- SDL_Surface *const surface2 = TTF_RenderUTF8_Blended(
+ SDL_Surface *const surface2 = MTTF_RenderUTF8_Blended(
font, strBuf, sdlCol2);
if (!surface2)
{
img = nullptr;
- SDL_FreeSurface(surface);
+ MSDL_FreeSurface(surface);
BLOCK_END("SDLTextChunk::generate")
return;
}
@@ -212,13 +214,13 @@ void SDLTextChunk::generate(TTF_Font *const font, const float alpha)
rect.y = 0;
SurfaceImageHelper::combineSurface(surface, nullptr,
background, &rect);
- SDL_FreeSurface(surface);
- SDL_FreeSurface(surface2);
+ MSDL_FreeSurface(surface);
+ MSDL_FreeSurface(surface2);
surface = background;
}
img = imageHelper->createTextSurface(
surface, width, height, alpha);
- SDL_FreeSurface(surface);
+ MSDL_FreeSurface(surface);
BLOCK_END("SDLTextChunk::generate")
}