summaryrefslogtreecommitdiff
path: root/src/render/surfacegraphics.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/render/surfacegraphics.cpp')
-rw-r--r--src/render/surfacegraphics.cpp18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/render/surfacegraphics.cpp b/src/render/surfacegraphics.cpp
index 543f2add1..52d0db57f 100644
--- a/src/render/surfacegraphics.cpp
+++ b/src/render/surfacegraphics.cpp
@@ -48,8 +48,12 @@ void SurfaceGraphics::drawImage(const Image *restrict const image,
{
FUNC_BLOCK("Graphics::drawImage", 1)
// Check that preconditions for blitting are met.
- if (!mTarget || !image || !image->mSDLSurface)
+ if (mTarget == nullptr ||
+ image == nullptr ||
+ image->mSDLSurface == nullptr)
+ {
return;
+ }
const SDL_Rect &imageRect = image->mBounds;
SDL_Rect dstRect;
@@ -82,8 +86,12 @@ void SurfaceGraphics::copyImage(const Image *restrict const image,
{
FUNC_BLOCK("Graphics::drawImage", 1)
// Check that preconditions for blitting are met.
- if (!mTarget || !image || !image->mSDLSurface)
+ if (mTarget == nullptr ||
+ image == nullptr ||
+ image->mSDLSurface == nullptr)
+ {
return;
+ }
const SDL_Rect &imageRect = image->mBounds;
SDL_Rect dstRect;
@@ -109,8 +117,12 @@ void SurfaceGraphics::drawImageCached(const Image *restrict const image,
{
FUNC_BLOCK("Graphics::drawImageCached", 1)
// Check that preconditions for blitting are met.
- if (!mTarget || !image || !image->mSDLSurface)
+ if (mTarget == nullptr ||
+ image == nullptr ||
+ image->mSDLSurface == nullptr)
+ {
return;
+ }
const SDL_Rect &rect = image->mBounds;