aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTravis Howell2009-11-26 00:45:06 +0000
committerTravis Howell2009-11-26 00:45:06 +0000
commit34b781199c22bb38731ed12810af92e74924246c (patch)
tree5c91af4a83002dc3c1273296d52badcb6a210401
parentef5d0226c13bb9a5366a5ef94c069691dbd3aba6 (diff)
downloadscummvm-rg350-34b781199c22bb38731ed12810af92e74924246c.tar.gz
scummvm-rg350-34b781199c22bb38731ed12810af92e74924246c.tar.bz2
scummvm-rg350-34b781199c22bb38731ed12810af92e74924246c.zip
Add patch #2853844 - MM C64: walksounds.
svn-id: r46146
-rw-r--r--engines/scumm/actor.cpp44
-rw-r--r--engines/scumm/actor.h1
-rw-r--r--engines/scumm/costume.cpp6
3 files changed, 47 insertions, 4 deletions
diff --git a/engines/scumm/actor.cpp b/engines/scumm/actor.cpp
index 443c66034e..4b7e45c00c 100644
--- a/engines/scumm/actor.cpp
+++ b/engines/scumm/actor.cpp
@@ -1164,6 +1164,7 @@ void Actor::adjustActorPos() {
stopActorMoving();
_cost.soundCounter = 0;
+ _cost.soundPos = 0;
if (_walkbox != kInvalidBox) {
byte flags = _vm->getBoxFlags(_walkbox);
@@ -1223,6 +1224,7 @@ void Actor::hideActor() {
}
_visible = false;
_cost.soundCounter = 0;
+ _cost.soundPos = 0;
_needRedraw = false;
_needBgReset = true;
}
@@ -1269,16 +1271,50 @@ void ScummEngine::showActors() {
}
}
+// bits 0..5: sound, bit 6: ???
+static const byte v0ActorSounds[24] = {
+ 0x06, // Syd
+ 0x06, // Razor
+ 0x06, // Dave
+ 0x06, // Michael
+ 0x06, // Bernard
+ 0x06, // Wendy
+ 0x00, // Jeff
+ 0x46, // ???
+ 0x06, // Dr Fred
+ 0x06, // Nurse Edna
+ 0x06, // Weird Ed
+ 0x06, // Dead Cousin Ted
+ 0xFF, // Purple Tentacle
+ 0xFF, // Green Tentacle
+ 0x06, // Meteor
+ 0xC0, // Plant
+ 0x06, // ???
+ 0x06, // ???
+ 0x00, // ???
+ 0xC0, // ???
+ 0xC0, // ???
+ 0x00, // ???
+ 0x06, // Sandy
+ 0x06, // ???
+};
+
/* Used in Scumm v5 only. Play sounds associated with actors */
void ScummEngine::playActorSounds() {
- int i;
+ int i, j;
+ int sound;
for (i = 1; i < _numActors; i++) {
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.soundCounter = 0;
+ if (_game.version == 0) {
+ sound = v0ActorSounds[i - 1] & 0x3F;
+ } else {
+ sound = _actors[i]->_sound[0];
+ }
+ _sound->addSoundToQueue(sound);
+ for (j = 1; j < _numActors; j++) {
+ _actors[j]->_cost.soundCounter = 0;
}
return;
}
diff --git a/engines/scumm/actor.h b/engines/scumm/actor.h
index c3edd24a39..88ba9902b4 100644
--- a/engines/scumm/actor.h
+++ b/engines/scumm/actor.h
@@ -55,6 +55,7 @@ struct CostumeData {
byte active[16];
uint16 animCounter;
byte soundCounter;
+ byte soundPos;
uint16 stopped;
uint16 curpos[16];
uint16 start[16];
diff --git a/engines/scumm/costume.cpp b/engines/scumm/costume.cpp
index 41bceb8e5d..9bf4ee0cdc 100644
--- a/engines/scumm/costume.cpp
+++ b/engines/scumm/costume.cpp
@@ -1423,6 +1423,12 @@ byte C64CostumeLoader::increaseAnims(Actor *a) {
frameUpdate(A, cmd);
}
+ if (A->_moving && _vm->_currentRoom != 1 && _vm->_currentRoom != 44) {
+ if (a->_cost.soundPos == 0)
+ a->_cost.soundCounter++;
+ a->_cost.soundPos = (a->_cost.soundPos + 1) % 3;
+ }
+
// increase each frame pos
for (int limb = 0; limb < 8; ++limb) {
if (a->_cost.curpos[limb] < a->_cost.end[limb])