diff options
author | Kari Salminen | 2007-06-20 23:56:08 +0000 |
---|---|---|
committer | Kari Salminen | 2007-06-20 23:56:08 +0000 |
commit | c8bbb6140f05b14515f132481dbbe5af09bdd4aa (patch) | |
tree | 41909c39325cde453a697bbc996f9c7fe46904ff /engines/agi/view.cpp | |
parent | 0ebf986a1ff35b4a13ab37485421f9634c032700 (diff) | |
download | scummvm-rg350-c8bbb6140f05b14515f132481dbbe5af09bdd4aa.tar.gz scummvm-rg350-c8bbb6140f05b14515f132481dbbe5af09bdd4aa.tar.bz2 scummvm-rg350-c8bbb6140f05b14515f132481dbbe5af09bdd4aa.zip |
Add AGI256-2 support (On top of already present AGI256 support).
AGI256-2 means handling 256 color views/sprites (AGI256 means handling 256 color picture resources).
The code can now handle both 16 color and 256 color views/sprites in the same game.
FIXME: Background in AGI256-2 demo may be incorrect.
svn-id: r27572
Diffstat (limited to 'engines/agi/view.cpp')
-rw-r--r-- | engines/agi/view.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/engines/agi/view.cpp b/engines/agi/view.cpp index f80e4b6447..48e3ca5e3f 100644 --- a/engines/agi/view.cpp +++ b/engines/agi/view.cpp @@ -151,6 +151,7 @@ int AgiEngine::decodeView(int n) { assert(v != NULL); + _game.views[n].agi256_2 = (READ_LE_UINT16(v) == 0xf00f); // Detect AGI256-2 views by their header bytes _game.views[n].descr = READ_LE_UINT16(v + 3) ? (char *)(v + READ_LE_UINT16(v + 3)) : (char *)(v + 3); /* if no loops exist, return! */ @@ -187,9 +188,18 @@ int AgiEngine::decodeView(int n) { vc->width = *(v + cofs); vc->height = *(v + cofs + 1); - vc->transparency = *(v + cofs + 2) & 0xf; - vc->mirrorLoop = (*(v + cofs + 2) >> 4) & 0x7; - vc->mirror = (*(v + cofs + 2) >> 7) & 0x1; + + if (!_game.views[n].agi256_2) { + vc->transparency = *(v + cofs + 2) & 0xf; + vc->mirrorLoop = (*(v + cofs + 2) >> 4) & 0x7; + vc->mirror = (*(v + cofs + 2) >> 7) & 0x1; + } else { + // Mirroring is disabled for AGI256-2 views because + // AGI256-2 uses whole 8 bits for the transparency variable. + vc->transparency = *(v + cofs + 2); + vc->mirrorLoop = 0; + vc->mirror = 0; + } /* skip over width/height/trans|mirror data */ cofs += 3; |