aboutsummaryrefslogtreecommitdiff
path: root/engines/sword25
diff options
context:
space:
mode:
authorEugene Sandulenko2010-08-22 10:34:37 +0000
committerEugene Sandulenko2010-10-12 23:13:45 +0000
commite7c9014b05995bfbc7b47e145a691b216328e537 (patch)
tree201f78736e1ba88ccea29c3287e8816b3444d92d /engines/sword25
parentb294e88f7e89a0b3d89b5d184e1b491eaddff70f (diff)
downloadscummvm-rg350-e7c9014b05995bfbc7b47e145a691b216328e537.tar.gz
scummvm-rg350-e7c9014b05995bfbc7b47e145a691b216328e537.tar.bz2
scummvm-rg350-e7c9014b05995bfbc7b47e145a691b216328e537.zip
SWORD25: A bit better alpha blending. Still incorrect
svn-id: r53278
Diffstat (limited to 'engines/sword25')
-rw-r--r--engines/sword25/gfx/opengl/glimage.cpp16
1 files changed, 8 insertions, 8 deletions
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++;
}
}