[Scummvm-cvs-logs] SF.net SVN: scummvm:[53336] scummvm/trunk/engines/sword25/gfx/opengl/ glimage.cpp
sev at users.sourceforge.net
sev at users.sourceforge.net
Wed Oct 13 01:43:24 CEST 2010
Revision: 53336
http://scummvm.svn.sourceforge.net/scummvm/?rev=53336&view=rev
Author: sev
Date: 2010-10-12 23:43:24 +0000 (Tue, 12 Oct 2010)
Log Message:
-----------
SWORD25: Implement transparent bg color for images
Modified Paths:
--------------
scummvm/trunk/engines/sword25/gfx/opengl/glimage.cpp
Modified: scummvm/trunk/engines/sword25/gfx/opengl/glimage.cpp
===================================================================
--- scummvm/trunk/engines/sword25/gfx/opengl/glimage.cpp 2010-10-12 23:43:03 UTC (rev 53335)
+++ scummvm/trunk/engines/sword25/gfx/opengl/glimage.cpp 2010-10-12 23:43:24 UTC (rev 53336)
@@ -213,13 +213,21 @@
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;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list