diff options
author | Travis Howell | 2007-05-07 13:40:29 +0000 |
---|---|---|
committer | Travis Howell | 2007-05-07 13:40:29 +0000 |
commit | 3a4c4fa181ef4a1cfe0cb0ef3ef0becd6db3f651 (patch) | |
tree | 65a3b79364fadcbaa4c7f6114fa21bd93b115491 | |
parent | d5504f0b66394eba8937339315dfc57d01733cdb (diff) | |
download | scummvm-rg350-3a4c4fa181ef4a1cfe0cb0ef3ef0becd6db3f651.tar.gz scummvm-rg350-3a4c4fa181ef4a1cfe0cb0ef3ef0becd6db3f651.tar.bz2 scummvm-rg350-3a4c4fa181ef4a1cfe0cb0ef3ef0becd6db3f651.zip |
Don't attempt to decode unknown icon data formats.
svn-id: r26781
-rw-r--r-- | engines/agos/icons.cpp | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/engines/agos/icons.cpp b/engines/agos/icons.cpp index 5fcf4f66a0..ba79f08508 100644 --- a/engines/agos/icons.cpp +++ b/engines/agos/icons.cpp @@ -63,7 +63,7 @@ void AGOSEngine::loadIconData() { // Thanks to Stuart Caie for providing the original // C conversion upon which this function is based. -static void decompressIconAmiga(byte *dst, byte *src, uint width, uint height, byte base, uint pitch, bool decompress = true) { +static void decompressIconPlanar(byte *dst, byte *src, uint width, uint height, byte base, uint pitch, bool decompress = true) { byte icon_pln[288]; byte *i, *o, *srcPtr, x, y; @@ -203,7 +203,7 @@ void AGOSEngine_Simon1::drawIcon(WindowBlock *window, uint icon, uint x, uint y) src = _iconFilePtr; src += READ_BE_UINT32(&((uint32 *)src)[icon]); uint8 color = (getFeatures() & GF_32COLOR) ? 16 : 240; - decompressIconAmiga(dst, src, 24, 24, color, _dxSurfacePitch); + decompressIconPlanar(dst, src, 24, 24, color, _dxSurfacePitch); } else { src = _iconFilePtr; src += READ_LE_UINT16(&((uint16 *)src)[icon]); @@ -225,9 +225,8 @@ void AGOSEngine_Waxworks::drawIcon(WindowBlock *window, uint icon, uint x, uint uint8 color = dst[0] & 0xF0; if (getPlatform() == Common::kPlatformAmiga) { - src = _iconFilePtr; - src += READ_BE_UINT32(&((uint32 *)src)[icon]); - decompressIconAmiga(dst, src, 24, 20, color, _dxSurfacePitch); + // TODO + return; } else { src = _iconFilePtr; src += READ_LE_UINT16(&((uint16 *)src)[icon]); @@ -248,15 +247,15 @@ void AGOSEngine_Elvira2::drawIcon(WindowBlock *window, uint icon, uint x, uint y dst += (y * 8 + window->y) * _dxSurfacePitch; uint color = dst[0] & 0xF0; - if (getPlatform() == Common::kPlatformAmiga) { + if (getFeatures() & GF_PLANAR) { src = _iconFilePtr; src += READ_BE_UINT32(&((uint32 *)src)[icon]); - decompressIconAmiga(dst, src, 24, 24, color, _dxSurfacePitch); + decompressIconPlanar(dst, src, 24, 24, color, _dxSurfacePitch); } else { src = _iconFilePtr; src += READ_LE_UINT16(&((uint16 *)src)[icon]); - decompressIcon(dst, src, 24, 12, color, _dxSurfacePitch); - } + decompressIcon(dst, src, 24, 12, color, _dxSurfacePitch); + } _lockWord &= ~0x8000; } @@ -271,9 +270,13 @@ void AGOSEngine::drawIcon(WindowBlock *window, uint icon, uint x, uint y) { dst += (x + window->x) * 8; dst += (y * 8 + window->y) * _dxSurfacePitch; - src = _iconFilePtr; - src += icon * 288; - decompressIconAmiga(dst, src, 24, 24, 16, _dxSurfacePitch, false); + if (getFeatures() & GF_PLANAR) { + // TODO + } else { + src = _iconFilePtr; + src += icon * 288; + decompressIconPlanar(dst, src, 24, 24, 16, _dxSurfacePitch, false); + } _lockWord &= ~0x8000; } |