aboutsummaryrefslogtreecommitdiff
path: root/engines/agi/view.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/agi/view.cpp')
-rw-r--r--engines/agi/view.cpp16
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;