aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2003-05-30 00:55:21 +0000
committerMax Horn2003-05-30 00:55:21 +0000
commit691e1f390aae2c797cd0f5ed04ff1136cf8c8f19 (patch)
treef824502b55a8160e5b8cbc657769390ca3b6362e
parent5ea6cbe51d09435d4eb17b33bdb618903f09e2b6 (diff)
downloadscummvm-rg350-691e1f390aae2c797cd0f5ed04ff1136cf8c8f19.tar.gz
scummvm-rg350-691e1f390aae2c797cd0f5ed04ff1136cf8c8f19.tar.bz2
scummvm-rg350-691e1f390aae2c797cd0f5ed04ff1136cf8c8f19.zip
rewrote Actor::needBgReset related code (this could cause regressions...)
svn-id: r8126
-rw-r--r--scumm/actor.cpp20
-rw-r--r--scumm/actor.h3
-rw-r--r--scumm/script_v5.cpp2
-rw-r--r--scumm/script_v6.cpp6
-rw-r--r--scumm/script_v8.cpp2
-rw-r--r--scumm/scumm.h2
-rw-r--r--scumm/scummvm.cpp4
7 files changed, 11 insertions, 28 deletions
diff --git a/scumm/actor.cpp b/scumm/actor.cpp
index dd54cc171a..74578c979b 100644
--- a/scumm/actor.cpp
+++ b/scumm/actor.cpp
@@ -326,7 +326,6 @@ int Actor::actorWalkStep() {
int direction;
needRedraw = true;
- needBgReset = true;
direction = updateActorDirection(true);
if (!(moving & MF_IN_LEG) || facing != direction) {
@@ -452,7 +451,6 @@ void Actor::startAnimActor(int f) {
if (costume != 0) {
animProgress = 0;
needRedraw = true;
- needBgReset = true;
if (f == initFrame)
cost.reset();
_vm->akos_decodeData(this, f, (uint) - 1);
@@ -488,8 +486,6 @@ void Actor::startAnimActor(int f) {
cost.reset();
_vm->cost_decodeData(this, f, (uint) - 1);
}
-
- needBgReset = true;
}
}
@@ -559,7 +555,6 @@ void Actor::setDirection(int direction) {
}
needRedraw = true;
- needBgReset = true;
}
void Actor::putActor(int dstX, int dstY, byte newRoom) {
@@ -571,7 +566,6 @@ void Actor::putActor(int dstX, int dstY, byte newRoom) {
y = dstY;
room = newRoom;
needRedraw = true;
- needBgReset = true;
if (_vm->VAR(_vm->VAR_EGO) == number) {
_vm->_egoPositioned = true;
@@ -947,7 +941,6 @@ void Actor::drawActorCostume() {
// games, either. So maybe this code isn't the correct way to do what
// it does (which is to fix actor draw problems, see also patch #699980).
// Would be nice to figure out what the original code does...
- needBgReset = true;
needRedraw = true;
}
@@ -975,14 +968,12 @@ void Actor::animateCostume() {
assert(akos);
if (_vm->akos_increaseAnims(akos, this)) {
needRedraw = true;
- needBgReset = true;
}
} else {
LoadedCostume lc(_vm);
lc.loadCostume(costume);
if (lc.increaseAnims(this)) {
needRedraw = true;
- needBgReset = true;
}
}
}
@@ -1023,13 +1014,12 @@ void Actor::animateLimb(int limb, int f) {
}
}
-void Scumm::setActorRedrawFlags(bool fg, bool bg) {
+void Scumm::setActorRedrawFlags() {
int i, j;
if (_fullRedraw) {
for (j = 1; j < _numActors; j++) {
- _actors[j].needRedraw |= fg;
- _actors[j].needBgReset |= bg;
+ _actors[j].needRedraw = true;
}
} else {
for (i = 0; i < gdi._numStrips; i++) {
@@ -1037,8 +1027,7 @@ void Scumm::setActorRedrawFlags(bool fg, bool bg) {
if (testGfxAnyUsageBits(strip)) {
for (j = 1; j < _numActors; j++) {
if (testGfxUsageBit(strip, j) && testGfxOtherUsageBits(strip, j)) {
- _actors[j].needRedraw |= fg;
- _actors[j].needBgReset |= bg;
+ _actors[j].needRedraw = true;
}
}
}
@@ -1489,7 +1478,8 @@ void Scumm::resetActorBgs() {
for (i = 0; i < gdi._numStrips; i++) {
int strip = _screenStartStrip + i;
for (j = 1; j < _numActors; j++) {
- if (testGfxUsageBit(strip, j) && _actors[j].top != 0xFF && _actors[j].needBgReset) {
+ if (testGfxUsageBit(strip, j) &&
+ ((_actors[j].top != 0xFF || _actors[j].needRedraw) || _actors[j].needBgReset)) {
clearGfxUsageBit(strip, j);
if ((_actors[j].bottom - _actors[j].top) >= 0)
gdi.resetBackground(_actors[j].top, _actors[j].bottom, i);
diff --git a/scumm/actor.h b/scumm/actor.h
index 3e29d41ec6..dff77df71a 100644
--- a/scumm/actor.h
+++ b/scumm/actor.h
@@ -93,7 +93,7 @@ public:
bool ignoreBoxes;
byte forceClip;
byte initFrame, walkFrame, standFrame, talkStartFrame, talkStopFrame;
- bool needRedraw, needBgReset, costumeNeedsInit, visible;
+ bool needRedraw, needBgReset, visible;
byte shadow_mode;
bool flip;
uint speedx, speedy;
@@ -108,6 +108,7 @@ public:
CostumeData cost;
byte palette[256];
protected:
+ bool costumeNeedsInit;
ActorWalkData walkdata;
int16 animVariable[16];
diff --git a/scumm/script_v5.cpp b/scumm/script_v5.cpp
index a4e292613c..8a94ada9a3 100644
--- a/scumm/script_v5.cpp
+++ b/scumm/script_v5.cpp
@@ -454,7 +454,6 @@ void Scumm_v5::o5_actorSet() {
case 9: /* elevation */
a->elevation = getVarOrDirectWord(0x80);
a->needRedraw = true;
- a->needBgReset = true;
break;
case 10: /* defaultanims */
a->initFrame = 1;
@@ -505,7 +504,6 @@ void Scumm_v5::o5_actorSet() {
}
a->needRedraw = true;
- a->needBgReset = true;
break;
case 18: /* neverzclip */
a->forceClip = 0;
diff --git a/scumm/script_v6.cpp b/scumm/script_v6.cpp
index c2d1236d76..a0dfe10d10 100644
--- a/scumm/script_v6.cpp
+++ b/scumm/script_v6.cpp
@@ -1655,7 +1655,6 @@ void Scumm_v6::o6_actorOps() {
case 84: /* actor-elevation */
a->elevation = pop();
a->needRedraw = true;
- a->needBgReset = true;
break;
case 85: /* actor-defaultanims */
a->initFrame = 1;
@@ -1686,7 +1685,6 @@ void Scumm_v6::o6_actorOps() {
case 92:
a->scalex = a->scaley = pop();
a->needRedraw = true;
- a->needBgReset = true;
break;
case 93:
a->forceClip = 0;
@@ -2530,7 +2528,6 @@ void Scumm_v6::o6_kernelSetFunctions() {
case 107:
a = derefActor(args[1], "o6_kernelSetFunctions: 107");
a->scalex = (unsigned char)args[2];
- a->needBgReset = true;
a->needRedraw = true;
break;
case 108:
@@ -2572,7 +2569,7 @@ void Scumm_v6::o6_kernelSetFunctions() {
case 6:
_fullRedraw = 1;
redrawBGAreas();
- setActorRedrawFlags(true, false);
+ setActorRedrawFlags();
processActors();
fadeIn(args[1]);
break;
@@ -2588,7 +2585,6 @@ void Scumm_v6::o6_kernelSetFunctions() {
case 107: /* set actor scale */
a = derefActor(args[1], "o6_kernelSetFunctions: 107");
a->scalex = (unsigned char)args[2];
- a->needBgReset = true;
a->needRedraw = true;
break;
case 108: /* create proc_special_palette */
diff --git a/scumm/script_v8.cpp b/scumm/script_v8.cpp
index e6d6e6d24f..fda688c9ed 100644
--- a/scumm/script_v8.cpp
+++ b/scumm/script_v8.cpp
@@ -1069,7 +1069,6 @@ void Scumm_v8::o8_actorOps() {
case 0x6E: // SO_ACTOR_ELEVATION
a->elevation = pop();
a->needRedraw = true;
- a->needBgReset = true;
break;
case 0x6F: // SO_ACTOR_PALETTE Set actor palette
j = pop();
@@ -1090,7 +1089,6 @@ void Scumm_v8::o8_actorOps() {
case 0x73: // SO_ACTOR_SCALE Set scaling of actor
a->scalex = a->scaley = pop();
a->needRedraw = true;
- a->needBgReset = true;
break;
case 0x74: // SO_ACTOR_NEVER_ZCLIP ?
a->forceClip = 0;
diff --git a/scumm/scumm.h b/scumm/scumm.h
index fda5c68b2d..5c87126916 100644
--- a/scumm/scumm.h
+++ b/scumm/scumm.h
@@ -730,7 +730,7 @@ public:
protected:
void walkActors();
void playActorSounds();
- void setActorRedrawFlags(bool fg, bool bg);
+ void setActorRedrawFlags();
void showActors();
void resetActorBgs();
void processActors();
diff --git a/scumm/scummvm.cpp b/scumm/scummvm.cpp
index 739eb8dba5..c3f5497ea3 100644
--- a/scumm/scummvm.cpp
+++ b/scumm/scummvm.cpp
@@ -1041,14 +1041,14 @@ load_game:
redrawVerbs();
}
- setActorRedrawFlags(true, true);
+ setActorRedrawFlags();
resetActorBgs();
if (!(_features & GF_AFTER_V7) &&
!(VAR(VAR_CURRENT_LIGHTS) & LIGHTMODE_screen) &&
VAR(VAR_CURRENT_LIGHTS) & LIGHTMODE_flashlight) {
drawFlashlight();
- setActorRedrawFlags(true, false);
+ setActorRedrawFlags();
}
processActors();