summaryrefslogtreecommitdiff
path: root/src/resources/openglimagehelper.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-08-11 21:37:02 +0300
committerAndrei Karas <akaras@inbox.ru>2016-08-11 21:40:17 +0300
commitfacd5ec45b0c75eef9e97983a00c19ff2ecf1fe7 (patch)
tree3668b1fc4be470d2edb4b385de9729d250c300f6 /src/resources/openglimagehelper.cpp
parent27946f189154cc6a4079d68e895aaf0bbd8172f5 (diff)
downloadplus-facd5ec45b0c75eef9e97983a00c19ff2ecf1fe7.tar.gz
plus-facd5ec45b0c75eef9e97983a00c19ff2ecf1fe7.tar.bz2
plus-facd5ec45b0c75eef9e97983a00c19ff2ecf1fe7.tar.xz
plus-facd5ec45b0c75eef9e97983a00c19ff2ecf1fe7.zip
Add asserts into imagehelpers.
Diffstat (limited to 'src/resources/openglimagehelper.cpp')
-rw-r--r--src/resources/openglimagehelper.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/resources/openglimagehelper.cpp b/src/resources/openglimagehelper.cpp
index e63295c8c..c67ec8a1c 100644
--- a/src/resources/openglimagehelper.cpp
+++ b/src/resources/openglimagehelper.cpp
@@ -43,6 +43,7 @@
#include "resources/image/image.h"
+#include "utils/checkutils.h"
#include "utils/sdlcheckutils.h"
#include <SDL_image.h>
@@ -70,7 +71,7 @@ Image *OpenGLImageHelper::load(SDL_RWops *const rw, Dye const &dye)
SDL_Surface *const tmpImage = loadPng(rw);
if (!tmpImage)
{
- logger->log("Error, image load failed: %s", IMG_GetError());
+ reportAlways("Error, image load failed: %s", IMG_GetError());
return nullptr;
}
@@ -156,8 +157,8 @@ SDL_Surface *OpenGLImageHelper::convertSurfaceNormalize(SDL_Surface *tmpImage,
if (realWidth < width || realHeight < height)
{
- logger->log("Warning: image too large, cropping to %dx%d texture!",
- tmpImage->w, tmpImage->h);
+ reportAlways("Warning: image too large, cropping to %dx%d texture!",
+ tmpImage->w, tmpImage->h);
}
#ifdef USE_SDL2
@@ -196,7 +197,7 @@ SDL_Surface *OpenGLImageHelper::convertSurfaceNormalize(SDL_Surface *tmpImage,
if (!tmpImage)
{
- logger->log("Error, image convert failed: out of memory");
+ reportAlways("Error, image convert failed: out of memory");
return nullptr;
}
SDL_BlitSurface(oldImage, nullptr, tmpImage, nullptr);
@@ -245,7 +246,7 @@ SDL_Surface *OpenGLImageHelper::convertSurface(SDL_Surface *tmpImage,
if (!tmpImage)
{
- logger->log("Error, image convert failed: out of memory");
+ reportAlways("Error, image convert failed: out of memory");
return nullptr;
}
SDL_BlitSurface(oldImage, nullptr, tmpImage, nullptr);
@@ -299,7 +300,7 @@ void OpenGLImageHelper::bindTexture(const GLuint texture)
case RENDER_NULL:
case RENDER_LAST:
default:
- logger->log("Unknown OpenGL backend: %d", mUseOpenGL);
+ reportAlways("Unknown OpenGL backend: %d", mUseOpenGL);
break;
}
}
@@ -394,7 +395,7 @@ Image *OpenGLImageHelper::glLoad(SDL_Surface *tmpImage,
if (error)
{
std::string errmsg = GraphicsManager::errorToString(error);
- logger->log("Error: Image GL import failed: %s (%u)",
+ reportAlways("Error: Image GL import failed: %s (%u)",
errmsg.c_str(), error);
// return nullptr;
}