diff options
author | Eugene Sandulenko | 2010-09-08 11:32:05 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2010-10-12 23:43:24 +0000 |
commit | cbe304c3aefd4b409fc01f4e7d393bf1878a0564 (patch) | |
tree | d4726bf330f4a97f0a05e21c85c6415cff84c8eb /engines/sword25/gfx | |
parent | 1f184fd5a9ad3e43c77b9c49dbf46bb97baa6bc6 (diff) | |
download | scummvm-rg350-cbe304c3aefd4b409fc01f4e7d393bf1878a0564.tar.gz scummvm-rg350-cbe304c3aefd4b409fc01f4e7d393bf1878a0564.tar.bz2 scummvm-rg350-cbe304c3aefd4b409fc01f4e7d393bf1878a0564.zip |
SWORD25: Implement transparent bg color for images
svn-id: r53336
Diffstat (limited to 'engines/sword25/gfx')
-rw-r--r-- | engines/sword25/gfx/opengl/glimage.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/engines/sword25/gfx/opengl/glimage.cpp b/engines/sword25/gfx/opengl/glimage.cpp index 9feeb4e380..31a52fbed7 100644 --- a/engines/sword25/gfx/opengl/glimage.cpp +++ b/engines/sword25/gfx/opengl/glimage.cpp @@ -213,13 +213,21 @@ bool GLImage::blit(int posX, int posY, int flipping, Common::Rect *pPartRect, ui img = &srcImage; } - if ((color & 0xff000000) != 0xff000000) { - warning("STUB: Image transparent bg color: %x", color); - } + int ca = (color >> 24) & 0xff; int cr = (color >> 16) & 0xff; int cg = (color >> 8) & 0xff; int cb = (color >> 0) & 0xff; + // Check if we need to draw anything at all + if (ca == 0) + return true; + + if (ca != 255) { + cr = cr * ca >> 8; + cg = cg * ca >> 8; + cb = cb * ca >> 8; + } + // Handle off-screen clipping if (posY < 0) { img->h -= -posY; |