aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorEinar Johan Trøan Sømåen2012-08-13 02:24:15 +0200
committerEinar Johan Trøan Sømåen2012-08-13 02:24:15 +0200
commitddfa227b939d922f738f932997b70110453068cf (patch)
tree689a3d5e431edb937add641f071e4f7876730ea2 /engines
parent4168b50fc3951cb716597ed8bf559d883828ff1a (diff)
downloadscummvm-rg350-ddfa227b939d922f738f932997b70110453068cf.tar.gz
scummvm-rg350-ddfa227b939d922f738f932997b70110453068cf.tar.bz2
scummvm-rg350-ddfa227b939d922f738f932997b70110453068cf.zip
WINTERMUTE: Cleanup in TransparentSurface.
Diffstat (limited to 'engines')
-rw-r--r--engines/wintermute/graphics/transparent_surface.cpp21
-rw-r--r--engines/wintermute/graphics/transparent_surface.h1
2 files changed, 4 insertions, 18 deletions
diff --git a/engines/wintermute/graphics/transparent_surface.cpp b/engines/wintermute/graphics/transparent_surface.cpp
index 6bc324dd2b..982399976b 100644
--- a/engines/wintermute/graphics/transparent_surface.cpp
+++ b/engines/wintermute/graphics/transparent_surface.cpp
@@ -62,10 +62,8 @@ void doBlitOpaque(byte *ino, byte* outo, uint32 width, uint32 height, uint32 pit
for (uint32 i = 0; i < height; i++) {
out = outo;
in = ino;
+ memcpy(out, in, width * 4);
for (uint32 j = 0; j < width; j++) {
- uint32 pix = *(uint32 *)in;
- in += inStep;
- *(uint32*)out = pix;
out[aIndex] = 0xFF;
out += 4;
}
@@ -133,7 +131,7 @@ void TransparentSurface::doBlitAlpha(byte *ino, byte* outo, uint32 width, uint32
outg = g;
outr = r;
outa = a;
- //*(uint32 *)out = target.format.ARGBToColor(o_a, o_r, o_g, o_b);
+
out[aIndex] = outa;
out[bIndex] = outb;
out[gIndex] = outg;
@@ -143,23 +141,14 @@ void TransparentSurface::doBlitAlpha(byte *ino, byte* outo, uint32 width, uint32
default: // alpha blending
outa = 255;
-//#define USE_LOOKUP_TABLE_FOR_ALPHA
-#ifndef USE_LOOKUP_TABLE_FOR_ALPHA
- outb = (oPix >> bShiftTarget) & 0xff;
- outg = (oPix >> gShiftTarget) & 0xff;
- outr = (oPix >> rShiftTarget) & 0xff;
- outb += ((b - outb) * a) >> 8;
- outg += ((g - outg) * a) >> 8;
- outr += ((r - outr) * a) >> 8;
-#else
+
outb = _lookup[(((oPix >> bShiftTarget) & 0xff)) + ((255 - a) << 8)];
outg = _lookup[(((oPix >> gShiftTarget) & 0xff)) + ((255 - a) << 8)];
outr = _lookup[(((oPix >> rShiftTarget) & 0xff)) + ((255 - a) << 8)];
outb += _lookup[b + (a << 8)];
outg += _lookup[g + (a << 8)];
outr += _lookup[r + (a << 8)];
-#endif
- //*(uint32 *)out = target.format.ARGBToColor(o_a, o_r, o_g, o_b);
+
out[aIndex] = outa;
out[bIndex] = outb;
out[gIndex] = outg;
@@ -339,7 +328,6 @@ Common::Rect TransparentSurface::blit(Graphics::Surface &target, int posX, int p
else
outr = r;
outa = a;
- //*(uint32 *)out = target.format.ARGBToColor(o_a, o_r, o_g, o_b);
out[aIndex] = outa;
out[bIndex] = outb;
out[gIndex] = outg;
@@ -370,7 +358,6 @@ Common::Rect TransparentSurface::blit(Graphics::Surface &target, int posX, int p
outr += ((r - outr) * a * cr) >> 16;
else
outr += ((r - outr) * a) >> 8;
- //*(uint32 *)out = target.format.ARGBToColor(o_a, o_r, o_g, o_b);
out[aIndex] = outa;
out[bIndex] = outb;
out[gIndex] = outg;
diff --git a/engines/wintermute/graphics/transparent_surface.h b/engines/wintermute/graphics/transparent_surface.h
index 761b7ba196..d9fe00a6d9 100644
--- a/engines/wintermute/graphics/transparent_surface.h
+++ b/engines/wintermute/graphics/transparent_surface.h
@@ -110,7 +110,6 @@ struct TransparentSurface : public Graphics::Surface {
private:
static void doBlitAlpha(byte *ino, byte* outo, uint32 width, uint32 height, uint32 pitch, int32 inStep, int32 inoStep);
static void generateLookup();
- static int *scaleLine(int size, int srcSize);
};
/**