diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-06-25 23:10:21 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-06-25 23:31:02 +0300 |
commit | af86a79f6ac5c11d1986be8a3d549fef03482789 (patch) | |
tree | 897f5ea665c01daf2bf01dbe1abd677bb8b2a68d /src/render/sdl2graphics.cpp | |
parent | 7ee1d89a656c05b62fa3104b59504afed0037b69 (diff) | |
download | manaverse-af86a79f6ac5c11d1986be8a3d549fef03482789.tar.gz manaverse-af86a79f6ac5c11d1986be8a3d549fef03482789.tar.bz2 manaverse-af86a79f6ac5c11d1986be8a3d549fef03482789.tar.xz manaverse-af86a79f6ac5c11d1986be8a3d549fef03482789.zip |
Add missing checks into render directory.
Diffstat (limited to 'src/render/sdl2graphics.cpp')
-rw-r--r-- | src/render/sdl2graphics.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/render/sdl2graphics.cpp b/src/render/sdl2graphics.cpp index c9f661d30..3b631caa5 100644 --- a/src/render/sdl2graphics.cpp +++ b/src/render/sdl2graphics.cpp @@ -542,6 +542,8 @@ void SDLGraphics::calcTileCollection(ImageCollection *const vertCol, const Image *const image, int x, int y) { + if (!vertCol) + return; if (vertCol->currentImage != image) { ImageVertexes *const vert = new ImageVertexes(); @@ -560,6 +562,8 @@ void SDLGraphics::calcTileCollection(ImageCollection *const vertCol, void SDLGraphics::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) @@ -580,6 +584,8 @@ void SDLGraphics::drawTileCollection(const ImageCollection void SDLGraphics::drawTileVertexes(const ImageVertexes *const vert) { + if (!vert) + return; // vert and img must be != 0 const Image *const img = vert->image; const DoubleRects *const rects = &vert->sdl; |