aboutsummaryrefslogtreecommitdiff
path: root/engines/agos
diff options
context:
space:
mode:
authorTravis Howell2007-05-17 09:02:01 +0000
committerTravis Howell2007-05-17 09:02:01 +0000
commit6302acf5236fa4f9cb3b195ac79e21161e728163 (patch)
treec9c3b3e0f05a6931da43a4b7f2790201189bd75c /engines/agos
parentd4191508f6a036169498037e00000e026d528632 (diff)
downloadscummvm-rg350-6302acf5236fa4f9cb3b195ac79e21161e728163.tar.gz
scummvm-rg350-6302acf5236fa4f9cb3b195ac79e21161e728163.tar.bz2
scummvm-rg350-6302acf5236fa4f9cb3b195ac79e21161e728163.zip
Completely revert last changes in icon code.
svn-id: r26859
Diffstat (limited to 'engines/agos')
-rw-r--r--engines/agos/icons.cpp22
1 files changed, 10 insertions, 12 deletions
diff --git a/engines/agos/icons.cpp b/engines/agos/icons.cpp
index 4ba0173a21..1e83420d8f 100644
--- a/engines/agos/icons.cpp
+++ b/engines/agos/icons.cpp
@@ -72,7 +72,7 @@ static void decompressIconPlanar(byte *dst, byte *src, uint width, uint height,
// Decode RLE planar icon data
i = src;
o = icon_pln;
- while (o < &icon_pln[width * height / 2]) {
+ while (o < &icon_pln[288]) {
x = *i++;
if (x < 128) {
do {
@@ -94,13 +94,13 @@ static void decompressIconPlanar(byte *dst, byte *src, uint width, uint height,
}
// Translate planar data to chunky (very slow method)
- for (y = 0; y < height; y++) {
- for (x = 0; x < width; x++) {
+ for (y = 0; y < 24; y++) {
+ for (x = 0; x < 24; x++) {
byte pixel =
- (srcPtr[((height * 0 + y) * 3) + (x >> 3)] & (1 << (7 - (x & 7))) ? 1 : 0)
- | (srcPtr[((height * 1 + y) * 3) + (x >> 3)] & (1 << (7 - (x & 7))) ? 2 : 0)
- | (srcPtr[((height * 2 + y) * 3) + (x >> 3)] & (1 << (7 - (x & 7))) ? 4 : 0)
- | (srcPtr[((height * 3 + y) * 3) + (x >> 3)] & (1 << (7 - (x & 7))) ? 8 : 0);
+ (srcPtr[(( y) * 3) + (x >> 3)] & (1 << (7 - (x & 7))) ? 1 : 0)
+ | (srcPtr[((24 + y) * 3) + (x >> 3)] & (1 << (7 - (x & 7))) ? 2 : 0)
+ | (srcPtr[((48 + y) * 3) + (x >> 3)] & (1 << (7 - (x & 7))) ? 4 : 0)
+ | (srcPtr[((72 + y) * 3) + (x >> 3)] & (1 << (7 - (x & 7))) ? 8 : 0);
if (pixel)
dst[x] = pixel | base;
}
@@ -207,7 +207,7 @@ void AGOSEngine_Simon1::drawIcon(WindowBlock *window, uint icon, uint x, uint y)
} else {
src = _iconFilePtr;
src += READ_LE_UINT16(&((uint16 *)src)[icon]);
- decompressIcon(dst, src, 24, 24, 224, _dxSurfacePitch);
+ decompressIcon(dst, src, 24, 12, 224, _dxSurfacePitch);
}
_lockWord &= ~0x8000;
@@ -226,9 +226,7 @@ void AGOSEngine_Waxworks::drawIcon(WindowBlock *window, uint icon, uint x, uint
uint8 color = dst[0] & 0xF0;
if (getPlatform() == Common::kPlatformAmiga) {
// TODO
- src = _iconFilePtr;
- src += READ_BE_UINT16(&((uint16 *)src)[icon]);
- //decompressIconPlanar(dst, src, 24, 10, color, _dxSurfacePitch);
+ return;
} else {
src = _iconFilePtr;
src += READ_LE_UINT16(&((uint16 *)src)[icon]);
@@ -256,7 +254,7 @@ void AGOSEngine_Elvira2::drawIcon(WindowBlock *window, uint icon, uint x, uint y
} else {
src = _iconFilePtr;
src += READ_LE_UINT16(&((uint16 *)src)[icon]);
- decompressIcon(dst, src, 24, 24, color, _dxSurfacePitch);
+ decompressIcon(dst, src, 24, 12, color, _dxSurfacePitch);
}
_lockWord &= ~0x8000;