diff --git a/scumm/actor.cpp b/scumm/actor.cpp index d04dfc495ba..99a6ae056a9 100644 --- a/scumm/actor.cpp +++ b/scumm/actor.cpp @@ -41,6 +41,7 @@ void Actor::initActor(int mode) y = 0; facing = 180; newDirection = 180; + talkFrequency = 256; } else if (mode == 2) { facing = 180; newDirection = 180; diff --git a/scumm/actor.h b/scumm/actor.h index e8669840170..9efef85b054 100644 --- a/scumm/actor.h +++ b/scumm/actor.h @@ -77,6 +77,7 @@ public: uint16 costume; byte room; byte talkColor; + int talkFrequency; byte scalex, scaley; byte charset; int16 newDirection; diff --git a/scumm/saveload.cpp b/scumm/saveload.cpp index db9a7dc2d44..d120106f95b 100644 --- a/scumm/saveload.cpp +++ b/scumm/saveload.cpp @@ -247,6 +247,7 @@ void Scumm::saveOrLoad(Serializer *s, uint32 savegameVersion) MKLINE(Actor, costume, sleUint16, VER_V8), MKLINE(Actor, room, sleByte, VER_V8), MKLINE(Actor, talkColor, sleByte, VER_V8), + MKLINE(Actor, talkFrequency, sleInt16, VER_V16), MKLINE(Actor, scalex, sleByte, VER_V8), MKLINE(Actor, scaley, sleByte, VER_V8), MKLINE(Actor, charset, sleByte, VER_V8), diff --git a/scumm/saveload.h b/scumm/saveload.h index 93e7d628937..0b5d7bb1f37 100644 --- a/scumm/saveload.h +++ b/scumm/saveload.h @@ -34,10 +34,11 @@ enum { VER_V12, VER_V13, VER_V14, - VER_V15 + VER_V15, + VER_V16 }; -#define CURRENT_VER VER_V15 +#define CURRENT_VER VER_V16 // To work around a warning in GCC 3.2 (and 3.1 ?) regarding non-POD types, diff --git a/scumm/script_v8.cpp b/scumm/script_v8.cpp index 13f8a11070c..d0cd604bab4 100644 --- a/scumm/script_v8.cpp +++ b/scumm/script_v8.cpp @@ -1187,10 +1187,7 @@ void Scumm_v8::o8_actorOps() warning("o8_actorOps: setActorVolume(%d) not implemented", i); break; case 0x88: // SO_ACTOR_FREQUENCY Set frequency of actor speech - // TODO - implement this! - i = pop(); - if (i != 256) // De-verbosed: 256 is the default frequency so don't warn on it - warning("o8_actorOps: setActorFrequency(%d) not implemented", i); + a->talkFrequency = pop(); break; case 0x89: // SO_ACTOR_PAN // TODO - implement this! diff --git a/scumm/sound.cpp b/scumm/sound.cpp index 185774cdd10..4223c5623d5 100644 --- a/scumm/sound.cpp +++ b/scumm/sound.cpp @@ -1226,6 +1226,13 @@ int Sound::playBundleSound(char *sound) { byte * final = (byte *)malloc(size); memcpy(final, ptr, size); + + if (_scumm->_actorToPrintStrFor != 0xFF && _scumm->_actorToPrintStrFor != 0) { + Actor *a = _scumm->derefActorSafe(_scumm->_actorToPrintStrFor, "playBundleSound"); + if (a) + rate = (rate * a->talkFrequency) / 256; + } + if (bits == 8) { return _scumm->_mixer->playRaw(NULL, final, size, rate, SoundMixer::FLAG_UNSIGNED | SoundMixer::FLAG_AUTOFREE); } else if (bits == 16){