From 6302acf5236fa4f9cb3b195ac79e21161e728163 Mon Sep 17 00:00:00 2001 From: Travis Howell Date: Thu, 17 May 2007 09:02:01 +0000 Subject: Completely revert last changes in icon code. svn-id: r26859 --- engines/agos/icons.cpp | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'engines') 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; -- cgit v1.2.3