[Scummvm-git-logs] scummvm master -> 2c601ad06ab0308fab89fce2d999c76891708a64
AndywinXp
noreply at scummvm.org
Sun Apr 28 19:22:06 UTC 2024
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
2c601ad06a SCUMM: HE: SPYFOX3: Fix #4767
Commit: 2c601ad06ab0308fab89fce2d999c76891708a64
https://github.com/scummvm/scummvm/commit/2c601ad06ab0308fab89fce2d999c76891708a64
Author: AndywinXp (andywinxp at gmail.com)
Date: 2024-04-28T21:22:01+02:00
Commit Message:
SCUMM: HE: SPYFOX3: Fix #4767
Indeed, we were missing some code from the original
which handled overlapping actors in which some moved
and some did not, which caused the latter to be erased.
Thanks eriktorbjorn for the great pointers on this.
Changed paths:
engines/scumm/actor.cpp
engines/scumm/actor_he.h
engines/scumm/he/script_v100he.cpp
engines/scumm/he/script_v72he.cpp
engines/scumm/scumm.h
engines/scumm/vars.cpp
diff --git a/engines/scumm/actor.cpp b/engines/scumm/actor.cpp
index 62818444023..eb88550f6e6 100644
--- a/engines/scumm/actor.cpp
+++ b/engines/scumm/actor.cpp
@@ -132,7 +132,7 @@ void ActorHE::initActor(int mode) {
_heShadow = 0;
_hePaletteNum = 0;
- _heFlags = 0;
+ _generalFlags = 0;
_heTalking = false;
if (_vm->_game.heversion >= 61)
@@ -2347,6 +2347,25 @@ void ScummEngine::processActors() {
} else {
a->drawActorCostume();
a->animateCostume();
+
+ if (_game.heversion >= 80) {
+ if (VAR_ALWAYS_REDRAW_ACTORS != 0xFF && VAR(VAR_ALWAYS_REDRAW_ACTORS) != 0)
+ continue;
+ }
+
+ if (_game.heversion >= 71) {
+ // Check if this new actor eclipsed another one...
+ for (int i = 0; i < _gdi->_numStrips; i++) {
+ int strip = _screenStartStrip + i;
+ if (testGfxAnyUsageBits(strip)) {
+ for (int j = 1; j < _numActors; j++) {
+ if (testGfxUsageBit(strip, j) && testGfxOtherUsageBits(strip, j)) {
+ _actors[j]->_needRedraw = true;
+ }
+ }
+ }
+ }
+ }
}
}
}
@@ -2840,7 +2859,7 @@ void ScummEngine::setActorRedrawFlags() {
// Redraw all actors if a full redraw was requested.
// Also redraw all actors in COMI (see bug #1825 for details).
- if (_fullRedraw || _game.version == 8 || (VAR_REDRAW_ALL_ACTORS != 0xFF && VAR(VAR_REDRAW_ALL_ACTORS) != 0)) {
+ if (_fullRedraw || _game.version == 8 || (VAR_ALWAYS_REDRAW_ACTORS != 0xFF && VAR(VAR_ALWAYS_REDRAW_ACTORS) != 0)) {
for (j = 1; j < _numActors; j++) {
_actors[j]->_needRedraw = true;
}
@@ -2873,7 +2892,7 @@ void ScummEngine::resetActorBgs() {
clearGfxUsageBit(strip, USAGE_BIT_DIRTY);
clearGfxUsageBit(strip, USAGE_BIT_RESTORED);
for (j = 1; j < _numActors; j++) {
- if (_game.heversion != 0 && ((ActorHE *)_actors[j])->_heFlags & 1)
+ if (_game.heversion != 0 && (((ActorHE *)_actors[j])->_generalFlags & ACTOR_GENERAL_FLAG_IGNORE_ERASE) != 0)
continue;
if (testGfxUsageBit(strip, j) &&
@@ -3473,12 +3492,16 @@ bool Actor_v2::isPlayer() {
return (_vm->_game.id == GID_MANIAC && _vm->_game.version == 1) ? (_number == _vm->VAR(_vm->VAR_EGO)) : (_vm->VAR(42) <= _number && _number <= _vm->VAR(43));
}
-void ActorHE::setHEFlag(int bit, int set) {
- // Note that condition is inverted
- if (!set) {
- _heFlags |= bit;
+void ActorHE::setActorEraseType(int eraseValue) {
+ if (eraseValue) {
+ _generalFlags &= ~ACTOR_GENERAL_FLAG_IGNORE_ERASE;
} else {
- _heFlags &= ~bit;
+ _generalFlags |= ACTOR_GENERAL_FLAG_IGNORE_ERASE;
+ }
+
+ if (_vm->_game.heversion > 99 || _vm->_isHE995) {
+ _needBgReset = true;
+ _needRedraw = true;
}
}
diff --git a/engines/scumm/actor_he.h b/engines/scumm/actor_he.h
index 81a985befc5..88169eaa548 100644
--- a/engines/scumm/actor_he.h
+++ b/engines/scumm/actor_he.h
@@ -27,6 +27,8 @@
namespace Scumm {
+#define ACTOR_GENERAL_FLAG_IGNORE_ERASE 0x00000001
+
struct HEEraseAuxEntry {
int actor;
int32 x1, y1, x2, y2;
@@ -62,7 +64,7 @@ public:
void drawActorToBackBuf(int x, int y);
- void setHEFlag(int bit, int set);
+ void setActorEraseType(int eraseValue);
void setCondition(int slot, int set);
bool isConditionSet(int slot) const;
@@ -79,7 +81,7 @@ public:
bool _heNoTalkAnimation;
bool _heTalking;
- byte _heFlags;
+ byte _generalFlags;
int _auxActor;
int32 _auxEraseX1, _auxEraseY1, _auxEraseX2, _auxEraseY2;
diff --git a/engines/scumm/he/script_v100he.cpp b/engines/scumm/he/script_v100he.cpp
index 5df1e25ef31..2e63a9c09fc 100644
--- a/engines/scumm/he/script_v100he.cpp
+++ b/engines/scumm/he/script_v100he.cpp
@@ -404,8 +404,7 @@ void ScummEngine_v100he::o100_actorOps() {
a->initActor(0);
break;
case SO_ERASE:
- k = pop();
- a->setHEFlag(1, k);
+ a->setActorEraseType(pop());
break;
case SO_NAME:
copyScriptString(string, sizeof(string));
diff --git a/engines/scumm/he/script_v72he.cpp b/engines/scumm/he/script_v72he.cpp
index aeb9b7fc6fa..1ef37b88ced 100644
--- a/engines/scumm/he/script_v72he.cpp
+++ b/engines/scumm/he/script_v72he.cpp
@@ -861,8 +861,7 @@ void ScummEngine_v72he::o72_actorOps() {
break;
}
case SO_ERASE: // // (HE 90+)
- k = pop();
- a->setHEFlag(1, k);
+ a->setActorEraseType(pop());
break;
case SO_COSTUME:
a->setActorCostume(pop());
diff --git a/engines/scumm/scumm.h b/engines/scumm/scumm.h
index f94a3cb0c5a..b44a16b2f14 100644
--- a/engines/scumm/scumm.h
+++ b/engines/scumm/scumm.h
@@ -1823,7 +1823,7 @@ public:
byte VAR_ACTIVE_OBJECT2 = 0xFF;
// HE specific variables
- byte VAR_REDRAW_ALL_ACTORS = 0xFF; // Used in setActorRedrawFlags()
+ byte VAR_ALWAYS_REDRAW_ACTORS = 0xFF; // Used in setActorRedrawFlags()
byte VAR_SKIP_RESET_TALK_ACTOR = 0xFF; // Used in setActorCostume()
byte VAR_SOUND_CHANNEL = 0xFF; // Used in o_startSound()
diff --git a/engines/scumm/vars.cpp b/engines/scumm/vars.cpp
index 7879bcef0bc..75e4372bf6e 100644
--- a/engines/scumm/vars.cpp
+++ b/engines/scumm/vars.cpp
@@ -322,7 +322,7 @@ void ScummEngine_v80he::setupScummVars() {
VAR_NUM_SOUND_CHANNELS = 88;
VAR_COLOR_DEPTH = 89;
VAR_COLOR_BLACK = 93;
- VAR_REDRAW_ALL_ACTORS = 95;
+ VAR_ALWAYS_REDRAW_ACTORS = 95;
}
void ScummEngine_v90he::setupScummVars() {
More information about the Scummvm-git-logs
mailing list