aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2003-06-01 18:20:38 +0000
committerMax Horn2003-06-01 18:20:38 +0000
commit3d77f7230e66438ace5a302d2154865acc3bd38d (patch)
tree2d7d021b7573372edfd78f4b13312e3460295a6c
parent393e749785ffe11c6d5cbac3a74568950bcc07a1 (diff)
downloadscummvm-rg350-3d77f7230e66438ace5a302d2154865acc3bd38d.tar.gz
scummvm-rg350-3d77f7230e66438ace5a302d2154865acc3bd38d.tar.bz2
scummvm-rg350-3d77f7230e66438ace5a302d2154865acc3bd38d.zip
Enabled walk sounds in Indy3EGA/ZakEGA; cleanup (bug #747068)
svn-id: r8249
-rw-r--r--scumm/actor.cpp14
-rw-r--r--scumm/actor.h4
-rw-r--r--scumm/costume.cpp11
-rw-r--r--scumm/script_v5.cpp2
-rw-r--r--scumm/script_v6.cpp2
5 files changed, 19 insertions, 14 deletions
diff --git a/scumm/actor.cpp b/scumm/actor.cpp
index fa31dcf350..347f5b912b 100644
--- a/scumm/actor.cpp
+++ b/scumm/actor.cpp
@@ -480,7 +480,7 @@ void Actor::startAnimActor(int f) {
if (isInCurrentRoom() && costume != 0) {
animProgress = 0;
- cost.animCounter1 = 0;
+ cost.animCounter = 0;
needRedraw = true;
if (f == initFrame)
cost.reset();
@@ -689,7 +689,7 @@ void Actor::adjustActorPos() {
walkdata.destx = -1;
moving = 0;
- cost.animCounter2 = 0;
+ cost.soundCounter = 0;
if (_vm->_features & GF_NEW_COSTUMES) {
stopActorMoving();
@@ -737,7 +737,7 @@ void Actor::hideActor() {
moving = 0;
}
visible = false;
- cost.animCounter2 = 0;
+ cost.soundCounter = 0;
needRedraw = false;
needBgReset = true;
}
@@ -789,11 +789,11 @@ void Scumm::playActorSounds() {
int i;
for (i = 1; i < _numActors; i++) {
- if (_actors[i].cost.animCounter2 && _actors[i].isInCurrentRoom() && _actors[i].sound) {
+ if (_actors[i].cost.soundCounter && _actors[i].isInCurrentRoom() && _actors[i].sound) {
_currentScript = 0xFF;
_sound->addSoundToQueue(_actors[i].sound[0]);
for (i = 1; i < _numActors; i++) {
- _actors[i].cost.animCounter2 = 0;
+ _actors[i].cost.soundCounter = 0;
}
return;
}
@@ -1530,8 +1530,8 @@ const SaveLoadEntry *Actor::getSaveLoadEntries() {
MKLINE(Actor, talkStopFrame, sleByte, VER_V8),
MKLINE(Actor, speedx, sleUint16, VER_V8),
MKLINE(Actor, speedy, sleUint16, VER_V8),
- MKLINE(Actor, cost.animCounter1, sleUint16, VER_V8),
- MKLINE(Actor, cost.animCounter2, sleByte, VER_V8),
+ MKLINE(Actor, cost.animCounter, sleUint16, VER_V8),
+ MKLINE(Actor, cost.soundCounter, sleByte, VER_V8),
// Actor palette grew from 64 to 256 bytes
MKARRAY_OLD(Actor, palette[0], sleByte, 64, VER_V8, VER_V9),
diff --git a/scumm/actor.h b/scumm/actor.h
index 1c47484f18..f9715ca87c 100644
--- a/scumm/actor.h
+++ b/scumm/actor.h
@@ -50,8 +50,8 @@ struct ActorWalkData {
struct CostumeData {
byte active[16];
- uint16 animCounter1;
- byte animCounter2;
+ uint16 animCounter;
+ byte soundCounter;
uint16 stopped;
uint16 curpos[16];
uint16 start[16];
diff --git a/scumm/costume.cpp b/scumm/costume.cpp
index 8df7a9e7ae..042822dcfd 100644
--- a/scumm/costume.cpp
+++ b/scumm/costume.cpp
@@ -617,7 +617,12 @@ byte LoadedCostume::increaseAnim(Actor *a, int slot) {
i = a->cost.curpos[slot] & 0x7FFF;
end = a->cost.end[slot];
code = _dataptr[i] & 0x7F;
-
+
+ if (_vm->_features & GF_AFTER_V2 || _vm->_features & GF_AFTER_V3) {
+ if (_dataptr[i] & 0x80)
+ a->cost.soundCounter++;
+ }
+
do {
if (!highflag) {
if (i++ >= end)
@@ -629,7 +634,7 @@ byte LoadedCostume::increaseAnim(Actor *a, int slot) {
nc = _dataptr[i];
if (nc == 0x7C) {
- a->cost.animCounter1++;
+ a->cost.animCounter++;
if (a->cost.start[slot] != end)
continue;
} else {
@@ -641,7 +646,7 @@ byte LoadedCostume::increaseAnim(Actor *a, int slot) {
}
} else {
if (nc == 0x78) {
- a->cost.animCounter2++;
+ a->cost.soundCounter++;
if (a->cost.start[slot] != end)
continue;
}
diff --git a/scumm/script_v5.cpp b/scumm/script_v5.cpp
index 207c4920ce..55c96be729 100644
--- a/scumm/script_v5.cpp
+++ b/scumm/script_v5.cpp
@@ -1025,7 +1025,7 @@ void Scumm_v5::o5_getAnimCounter() {
getResultPos();
int act = getVarOrDirectByte(0x80);
Actor *a = derefActor(act, "o5_getAnimCounter");
- setResult(a->cost.animCounter1);
+ setResult(a->cost.animCounter);
}
void Scumm_v5::o5_getClosestObjActor() {
diff --git a/scumm/script_v6.cpp b/scumm/script_v6.cpp
index feb88a4ee9..255165a48f 100644
--- a/scumm/script_v6.cpp
+++ b/scumm/script_v6.cpp
@@ -1250,7 +1250,7 @@ void Scumm_v6::o6_getActorScaleX() {
void Scumm_v6::o6_getActorAnimCounter1() {
Actor *a = derefActor(pop(), "o6_getActorAnimCounter");
- push(a->cost.animCounter1);
+ push(a->cost.animCounter);
}
void Scumm_v6::o6_getAnimateVariable() {