summaryrefslogtreecommitdiff
path: root/src/utils/sdlpixel.h
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-06-25 22:31:50 +0300
committerAndrei Karas <akaras@inbox.ru>2015-06-25 23:31:02 +0300
commit7ee1d89a656c05b62fa3104b59504afed0037b69 (patch)
tree7a20e371ba1035fc43135f069407b51d81d15527 /src/utils/sdlpixel.h
parentd49a520d19f28c613c68b574686b182a9c0621be (diff)
downloadmanaplus-7ee1d89a656c05b62fa3104b59504afed0037b69.tar.gz
manaplus-7ee1d89a656c05b62fa3104b59504afed0037b69.tar.bz2
manaplus-7ee1d89a656c05b62fa3104b59504afed0037b69.tar.xz
manaplus-7ee1d89a656c05b62fa3104b59504afed0037b69.zip
Add missing checks into db directory.
Diffstat (limited to 'src/utils/sdlpixel.h')
-rw-r--r--src/utils/sdlpixel.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/utils/sdlpixel.h b/src/utils/sdlpixel.h
index 4fb7cd774..6e78c184b 100644
--- a/src/utils/sdlpixel.h
+++ b/src/utils/sdlpixel.h
@@ -145,6 +145,11 @@ inline unsigned int SDLAlpha32(const unsigned int src,
return (b & 0xff) | (g & 0xff00) | (r & 0xff0000);
}
+inline unsigned short SDLAlpha16(const unsigned short src,
+ const unsigned short dst,
+ const unsigned char a,
+ const SDL_PixelFormat *const f) A_NONNULL(4);
+
/**
* Blends two 16 bit colors together.
*
@@ -178,6 +183,8 @@ inline unsigned short SDLAlpha16(const unsigned short src,
inline void SDLputPixelAlpha(SDL_Surface* surface, int x, int y,
const Color& color)
{
+ if (!surface)
+ return;
const int bpp = surface->format->BytesPerPixel;
SDL_LockSurface(surface);