summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-08-09 00:27:13 +0300
committerAndrei Karas <akaras@inbox.ru>2015-08-09 00:27:13 +0300
commitb4ec726fe28f65b15fd4cc7b0ef6fd72b7d24c02 (patch)
tree2f036904b433f9a1753b2bcbb6fbc99a5d0b643e
parent17a08b25c0df685e3f5c7edf1d4ab583f55ecaf9 (diff)
downloadmanaverse-b4ec726fe28f65b15fd4cc7b0ef6fd72b7d24c02.tar.gz
manaverse-b4ec726fe28f65b15fd4cc7b0ef6fd72b7d24c02.tar.bz2
manaverse-b4ec726fe28f65b15fd4cc7b0ef6fd72b7d24c02.tar.xz
manaverse-b4ec726fe28f65b15fd4cc7b0ef6fd72b7d24c02.zip
Add some missing checks to render found by paranucker.
-rw-r--r--src/render/graphics.cpp2
-rw-r--r--src/render/graphics.h2
-rw-r--r--src/render/modernopenglgraphics.h4
-rw-r--r--src/render/normalopenglgraphics.h12
-rw-r--r--src/render/nullopenglgraphics.h6
-rw-r--r--src/render/safeopenglgraphics.cpp2
6 files changed, 14 insertions, 14 deletions
diff --git a/src/render/graphics.cpp b/src/render/graphics.cpp
index 9ea8c7cad..463cac8f1 100644
--- a/src/render/graphics.cpp
+++ b/src/render/graphics.cpp
@@ -94,7 +94,7 @@
#endif
#endif
-Graphics *mainGraphics = nullptr;
+Graphics *mainGraphics A_NONNULLPOINTER = nullptr;
Graphics::Graphics() :
mWidth(0),
diff --git a/src/render/graphics.h b/src/render/graphics.h
index d6f74d854..3989f0b16 100644
--- a/src/render/graphics.h
+++ b/src/render/graphics.h
@@ -523,6 +523,6 @@ class Graphics notfinal
Color mColor;
};
-extern Graphics *mainGraphics;
+extern Graphics *mainGraphics A_NONNULLPOINTER;
#endif // RENDER_GRAPHICS_H
diff --git a/src/render/modernopenglgraphics.h b/src/render/modernopenglgraphics.h
index 1f55717a3..792c4224c 100644
--- a/src/render/modernopenglgraphics.h
+++ b/src/render/modernopenglgraphics.h
@@ -105,8 +105,8 @@ class ModernOpenGLGraphics final : public Graphics
inline void bindElementBuffer(const GLuint ebo);
- GLint *mIntArray;
- GLint *mIntArrayCached;
+ GLint *mIntArray A_NONNULLPOINTER;
+ GLint *mIntArrayCached A_NONNULLPOINTER;
ShaderProgram *mProgram;
float mAlphaCached;
int mVpCached;
diff --git a/src/render/normalopenglgraphics.h b/src/render/normalopenglgraphics.h
index a3fbdc1fb..54ab4df99 100644
--- a/src/render/normalopenglgraphics.h
+++ b/src/render/normalopenglgraphics.h
@@ -89,12 +89,12 @@ class NormalOpenGLGraphics final : public Graphics
#endif
private:
- GLfloat *mFloatTexArray;
- GLint *mIntTexArray;
- GLint *mIntVertArray;
- GLfloat *mFloatTexArrayCached;
- GLint *mIntTexArrayCached;
- GLint *mIntVertArrayCached;
+ GLfloat *mFloatTexArray A_NONNULLPOINTER;
+ GLint *mIntTexArray A_NONNULLPOINTER;
+ GLint *mIntVertArray A_NONNULLPOINTER;
+ GLfloat *mFloatTexArrayCached A_NONNULLPOINTER;
+ GLint *mIntTexArrayCached A_NONNULLPOINTER;
+ GLint *mIntVertArrayCached A_NONNULLPOINTER;
float mAlphaCached;
int mVpCached;
bool mTexture;
diff --git a/src/render/nullopenglgraphics.h b/src/render/nullopenglgraphics.h
index f159fc7de..10853adec 100644
--- a/src/render/nullopenglgraphics.h
+++ b/src/render/nullopenglgraphics.h
@@ -78,9 +78,9 @@ class NullOpenGLGraphics final : public Graphics
#include "render/openglgraphicsdefadvanced.hpp"
private:
- GLfloat *mFloatTexArray;
- GLint *mIntTexArray;
- GLint *mIntVertArray;
+ GLfloat *mFloatTexArray A_NONNULLPOINTER;
+ GLint *mIntTexArray A_NONNULLPOINTER;
+ GLint *mIntVertArray A_NONNULLPOINTER;
bool mTexture;
bool mIsByteColor;
diff --git a/src/render/safeopenglgraphics.cpp b/src/render/safeopenglgraphics.cpp
index eadd794b8..f7638c5a1 100644
--- a/src/render/safeopenglgraphics.cpp
+++ b/src/render/safeopenglgraphics.cpp
@@ -532,7 +532,7 @@ SDL_Surface* SafeOpenGLGraphics::getScreenshot()
SDL_Surface *const screenshot = MSDL_CreateRGBSurface(
SDL_SWSURFACE, w, h, 24, 0xff0000, 0x00ff00, 0x0000ff, 0x000000);
- if (!screenshot)
+ if (!screenshot || !screenshot->pixels)
return nullptr;
if (SDL_MUSTLOCK(screenshot))