From e7c9014b05995bfbc7b47e145a691b216328e537 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sun, 22 Aug 2010 10:34:37 +0000 Subject: SWORD25: A bit better alpha blending. Still incorrect svn-id: r53278 --- engines/sword25/gfx/opengl/glimage.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'engines/sword25/gfx') diff --git a/engines/sword25/gfx/opengl/glimage.cpp b/engines/sword25/gfx/opengl/glimage.cpp index 97cd5be8a0..7a54c0b548 100644 --- a/engines/sword25/gfx/opengl/glimage.cpp +++ b/engines/sword25/gfx/opengl/glimage.cpp @@ -214,28 +214,28 @@ bool GLImage::Blit(int PosX, int PosY, int Flipping, Common::Rect *pPartRect, un out = outo; in = ino; for (int j = 0; j < w; j++) { - int r = *in++; - int g = *in++; int b = *in++; + int g = *in++; + int r = *in++; int a = *in++; switch (a) { case 0: // Full transparency out += 4; break; case 255: // Full opacity - *out++ = r; - *out++ = g; *out++ = b; + *out++ = g; + *out++ = r; *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++; } } -- cgit v1.2.3