[Scummvm-cvs-logs] SF.net SVN: scummvm:[53278] scummvm/trunk/engines/sword25/gfx/opengl/ glimage.cpp

sev at users.sourceforge.net sev at users.sourceforge.net
Wed Oct 13 01:13:45 CEST 2010


Revision: 53278
          http://scummvm.svn.sourceforge.net/scummvm/?rev=53278&view=rev
Author:   sev
Date:     2010-10-12 23:13:45 +0000 (Tue, 12 Oct 2010)

Log Message:
-----------
SWORD25: A bit better alpha blending. Still incorrect

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:13:24 UTC (rev 53277)
+++ scummvm/trunk/engines/sword25/gfx/opengl/glimage.cpp	2010-10-12 23:13:45 UTC (rev 53278)
@@ -214,28 +214,28 @@
 		out = outo;
 		in = ino;
 		for (int j = 0; j < w; j++) {
+			int b = *in++;
+			int g = *in++;
 			int r = *in++;
-			int g = *in++;
-			int b = *in++;
 			int a = *in++;
 			switch (a) {
 			case 0: // Full transparency
 				out += 4;
 				break;
 			case 255: // Full opacity
+				*out++ = b;
+				*out++ = g;
 				*out++ = r;
-				*out++ = g;
-				*out++ = b;
 				*out++ = a;
 				break;
 			default: // alpha blending
-				*out = (byte)((((int)(*out - r) * a + r) >> 8) & 0xff);
+				*out = (byte)(((b - *out) * a + *out) >> 8);
 				out++;
-				*out = (byte)((((int)(*out - g) * a + g) >> 8) & 0xff);
+				*out = (byte)(((g - *out) * a + *out) >> 8);
 				out++;
-				*out = (byte)((((int)(*out - b) * a + b) >> 8) & 0xff);
+				*out = (byte)(((r - *out) * a + *out) >> 8);
 				out++;
-				*out = 255;
+				*out = a;
 				out++;
 			}
 		}


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