diff options
| author | James Brown | 2003-01-26 10:54:34 +0000 | 
|---|---|---|
| committer | James Brown | 2003-01-26 10:54:34 +0000 | 
| commit | 8d9b84b98eb92abbf4d932d6c6e10a10e0fe576b (patch) | |
| tree | f61414cf51a4da9841a1febd5cd80a3ccaac66cd | |
| parent | 3dc0535a6be1bbb84c397a7656f5222a646d3d59 (diff) | |
| download | scummvm-rg350-8d9b84b98eb92abbf4d932d6c6e10a10e0fe576b.tar.gz scummvm-rg350-8d9b84b98eb92abbf4d932d6c6e10a10e0fe576b.tar.bz2 scummvm-rg350-8d9b84b98eb92abbf4d932d6c6e10a10e0fe576b.zip | |
Patch 671701: SO_TALK_FREQUENCY
svn-id: r6547
| -rw-r--r-- | scumm/actor.cpp | 1 | ||||
| -rw-r--r-- | scumm/actor.h | 1 | ||||
| -rw-r--r-- | scumm/saveload.cpp | 1 | ||||
| -rw-r--r-- | scumm/saveload.h | 5 | ||||
| -rw-r--r-- | scumm/script_v8.cpp | 5 | ||||
| -rw-r--r-- | scumm/sound.cpp | 7 | 
6 files changed, 14 insertions, 6 deletions
| diff --git a/scumm/actor.cpp b/scumm/actor.cpp index d04dfc495b..99a6ae056a 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 e866984017..9efef85b05 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 db9a7dc2d4..d120106f95 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 93e7d62893..0b5d7bb1f3 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 13f8a11070..d0cd604bab 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 185774cdd1..4223c5623d 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){ | 
