summaryrefslogtreecommitdiff
path: root/src/render/nullopenglgraphics.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-06-25 23:10:21 +0300
committerAndrei Karas <akaras@inbox.ru>2015-06-25 23:31:02 +0300
commitaf86a79f6ac5c11d1986be8a3d549fef03482789 (patch)
tree897f5ea665c01daf2bf01dbe1abd677bb8b2a68d /src/render/nullopenglgraphics.cpp
parent7ee1d89a656c05b62fa3104b59504afed0037b69 (diff)
downloadmanaplus-af86a79f6ac5c11d1986be8a3d549fef03482789.tar.gz
manaplus-af86a79f6ac5c11d1986be8a3d549fef03482789.tar.bz2
manaplus-af86a79f6ac5c11d1986be8a3d549fef03482789.tar.xz
manaplus-af86a79f6ac5c11d1986be8a3d549fef03482789.zip
Add missing checks into render directory.
Diffstat (limited to 'src/render/nullopenglgraphics.cpp')
-rw-r--r--src/render/nullopenglgraphics.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/render/nullopenglgraphics.cpp b/src/render/nullopenglgraphics.cpp
index dba15449a..27013f93b 100644
--- a/src/render/nullopenglgraphics.cpp
+++ b/src/render/nullopenglgraphics.cpp
@@ -110,6 +110,12 @@ static inline void drawQuad(const Image *const image A_UNUSED,
const int srcX A_UNUSED, const int srcY A_UNUSED,
const int dstX A_UNUSED, const int dstY A_UNUSED,
const int width A_UNUSED,
+ const int height A_UNUSED) A_NONNULL(1);
+
+static inline void drawQuad(const Image *const image A_UNUSED,
+ const int srcX A_UNUSED, const int srcY A_UNUSED,
+ const int dstX A_UNUSED, const int dstY A_UNUSED,
+ const int width A_UNUSED,
const int height A_UNUSED)
{
if (OpenGLImageHelper::mTextureType == GL_TEXTURE_2D)
@@ -706,6 +712,8 @@ void NullOpenGLGraphics::calcTileCollection(ImageCollection *const vertCol,
const Image *const image,
int x, int y)
{
+ if (!vertCol || !image)
+ return;
if (vertCol->currentGLImage != image->mGLImage)
{
ImageVertexes *const vert = new ImageVertexes();
@@ -724,6 +732,8 @@ void NullOpenGLGraphics::calcTileCollection(ImageCollection *const vertCol,
void NullOpenGLGraphics::drawTileCollection(const ImageCollection
*const vertCol)
{
+ if (!vertCol)
+ return;
const ImageVertexesVector &draws = vertCol->draws;
const ImageCollectionCIter it_end = draws.end();
for (ImageCollectionCIter it = draws.begin(); it != it_end; ++ it)
@@ -746,6 +756,8 @@ void NullOpenGLGraphics::calcPattern(ImageCollection* const vertCol,
const int x, const int y,
const int w, const int h) const
{
+ if (!vertCol || !image)
+ return;
ImageVertexes *vert = nullptr;
if (vertCol->currentGLImage != image->mGLImage)
{
@@ -903,6 +915,8 @@ void NullOpenGLGraphics::calcWindow(ImageCollection *const vertCol,
const int w, const int h,
const ImageRect &imgRect)
{
+ if (!vertCol)
+ return;
ImageVertexes *vert = nullptr;
Image *const image = imgRect.grid[4];
if (!image)