aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scumm/actor.cpp18
-rw-r--r--scumm/actor.h1
-rw-r--r--scumm/akos.cpp10
-rw-r--r--scumm/resource.cpp6
-rw-r--r--scumm/script_v100he.cpp3
-rw-r--r--scumm/script_v72he.cpp3
6 files changed, 30 insertions, 11 deletions
diff --git a/scumm/actor.cpp b/scumm/actor.cpp
index dca15199e9..3fda0bf72e 100644
--- a/scumm/actor.cpp
+++ b/scumm/actor.cpp
@@ -107,6 +107,7 @@ void Actor::initActor(int mode) {
stopActorMoving();
+ _heXmapNum = 0;
_shadowMode = 0;
_layer = 0;
@@ -1104,12 +1105,23 @@ void Actor::drawActorCostume(bool hitTestMode) {
}
bcr->_shadow_mode = _shadowMode;
- if ((_vm->_features & GF_SMALL_HEADER) || _vm->_heversion >= 71)
+ if (_vm->_features & GF_SMALL_HEADER) {
bcr->_shadow_table = NULL;
- else if (_vm->_heversion == 70)
+ } else if (_vm->_heversion >= 95 && _heXmapNum) {
+ byte shadow_table[65536];
+ const uint8 *dataPtr = _vm->getResourceAddress(rtImage, _heXmapNum);
+ assert(dataPtr);
+ const uint8 *xmapPtr = _vm->findResourceData(MKID('XMAP'), dataPtr);
+ assert(xmapPtr);
+ int32 size = _vm->getResourceDataSize(xmapPtr);
+ assert(size == 65536);
+ memcpy(shadow_table, xmapPtr, size);
+ bcr->_shadow_table = shadow_table;
+ } else if (_vm->_heversion == 70) {
bcr->_shadow_table = _vm->_HEV7ActorPalette;
- else
+ } else {
bcr->_shadow_table = _vm->_shadowPalette;
+ }
bcr->setCostume(_costume);
bcr->setPalette(_palette);
diff --git a/scumm/actor.h b/scumm/actor.h
index c290adc948..d3af472e23 100644
--- a/scumm/actor.h
+++ b/scumm/actor.h
@@ -134,6 +134,7 @@ public:
CostumeData _cost;
/* HE specific */
+ int32 _heXmapNum;
byte _hePaletteNum;
bool _heNoTalkAnimation;
bool _heSkipLimbs;
diff --git a/scumm/akos.cpp b/scumm/akos.cpp
index c84d59b30c..b004f065da 100644
--- a/scumm/akos.cpp
+++ b/scumm/akos.cpp
@@ -458,6 +458,8 @@ byte AkosRenderer::drawLimb(const Actor *a, int limb) {
_ymove -= lastDy;
}
+ uint16 shadowMask = 0;
+
if (!useCondMask || !akct) {
decflag = 1;
} else {
@@ -468,7 +470,7 @@ byte AkosRenderer::drawLimb(const Actor *a, int limb) {
uint32 type = cond & 0xC0000000;
cond &= 0x3FFFFFFF;
if (_vm->_heversion >= 95) {
-// uint16 shadowMask = cond & 0xE000;
+ shadowMask = cond & 0xE000;
cond &= ~0xE000;
}
if (_vm->_heversion >= 95 && cond == 0) {
@@ -488,6 +490,10 @@ byte AkosRenderer::drawLimb(const Actor *a, int limb) {
if (decflag == 0)
continue;
+ if (_vm->_heversion >= 95) {
+ _shadow_mode = (shadowMask) ? 3: 0;
+ }
+
switch (codec) {
case 1:
result |= codec1(xmoveCur, ymoveCur);
@@ -559,7 +565,7 @@ void AkosRenderer::codec1_genericDecode(Codec1 &v1) {
} else if (_shadow_mode == 2) {
error("codec1_spec2"); // TODO
} else if (_shadow_mode == 3) {
- if (pcolor < 8) {
+ if (_vm->_heversion >= 95 || pcolor < 8) {
pcolor = (pcolor << 8) + *dst;
pcolor = _shadow_table[pcolor];
}
diff --git a/scumm/resource.cpp b/scumm/resource.cpp
index 367a437e18..fa7a5320df 100644
--- a/scumm/resource.cpp
+++ b/scumm/resource.cpp
@@ -1232,8 +1232,10 @@ void ScummEngine_v6::readMAXS(int blockSize) {
_objectRoomTable = (byte *)calloc(_numGlobalObjects, 1);
}
- _shadowPaletteSize = 256;
- _shadowPalette = (byte *)calloc(_shadowPaletteSize, 1);
+ if (_heversion <= 70) {
+ _shadowPaletteSize = 256;
+ _shadowPalette = (byte *)calloc(_shadowPaletteSize, 1);
+ }
}
void ScummEngine::readGlobalObjects() {
diff --git a/scumm/script_v100he.cpp b/scumm/script_v100he.cpp
index 588fe66274..0aba798cfe 100644
--- a/scumm/script_v100he.cpp
+++ b/scumm/script_v100he.cpp
@@ -469,9 +469,8 @@ void ScummEngine_v100he::o100_actorOps() {
a->setScale(i, i);
break;
case 70: // SO_SHADOW
- a->_shadowMode = pop();
+ a->_heXmapNum = pop();
a->_needRedraw = true;
- debug(0, "o100_actorOps: Set actor XMAP idx to %d", a->_shadowMode);
break;
case 74: // SO_STEP_DIST
j = pop();
diff --git a/scumm/script_v72he.cpp b/scumm/script_v72he.cpp
index e7e42d63f4..642405cbb7 100644
--- a/scumm/script_v72he.cpp
+++ b/scumm/script_v72he.cpp
@@ -1262,9 +1262,8 @@ void ScummEngine_v72he::o72_actorOps() {
a->setAnimSpeed(pop());
break;
case 98: // SO_SHADOW
- a->_shadowMode = pop();
+ a->_heXmapNum = pop();
a->_needRedraw = true;
- debug(1, "Set actor XMAP idx to %d", a->_shadowMode);
break;
case 99: // SO_TEXT_OFFSET
a->_talkPosY = pop();