aboutsummaryrefslogtreecommitdiff
path: root/queen
diff options
context:
space:
mode:
authorGregory Montoir2004-12-19 12:19:21 +0000
committerGregory Montoir2004-12-19 12:19:21 +0000
commitec2099a9020e341d9cc23cb2a9cb8c14e8bc8703 (patch)
treec5b0bf253aab5ea57ed5c70ddd80a5e236bba4e3 /queen
parent739828391e1d6944ff97473e585de4c0550372d2 (diff)
downloadscummvm-rg350-ec2099a9020e341d9cc23cb2a9cb8c14e8bc8703.tar.gz
scummvm-rg350-ec2099a9020e341d9cc23cb2a9cb8c14e8bc8703.tar.bz2
scummvm-rg350-ec2099a9020e341d9cc23cb2a9cb8c14e8bc8703.zip
Fixed regression in queen floppy version. Before doing any speech/texts synchronization, we check the voice sfx exists. See also patch #1087870
svn-id: r16131
Diffstat (limited to 'queen')
-rw-r--r--queen/cutaway.cpp4
-rw-r--r--queen/journal.cpp5
-rw-r--r--queen/queen.cpp9
-rw-r--r--queen/sound.cpp48
-rw-r--r--queen/sound.h3
-rw-r--r--queen/talk.cpp6
6 files changed, 41 insertions, 34 deletions
diff --git a/queen/cutaway.cpp b/queen/cutaway.cpp
index e27c3d63b7..bb704b096e 100644
--- a/queen/cutaway.cpp
+++ b/queen/cutaway.cpp
@@ -960,7 +960,7 @@ void Cutaway::run(char *nextFilename) {
// if the cutaway has been cancelled, we must stop the speech and the sfx as well
if (_vm->input()->cutawayQuit()) {
- if (_vm->sound()->speechOn())
+ if (_vm->sound()->isSpeechActive())
_vm->sound()->stopSpeech();
_vm->sound()->stopSfx();
}
@@ -1262,7 +1262,7 @@ void Cutaway::handleText(
break;
}
- if ((OBJECT_TYPE_TEXT_SPEAK == type || OBJECT_TYPE_TEXT_DISPLAY_AND_SPEAK == type) && _vm->sound()->speechOn()) {
+ if ((OBJECT_TYPE_TEXT_SPEAK == type || OBJECT_TYPE_TEXT_DISPLAY_AND_SPEAK == type) && _vm->sound()->speechOn() && _vm->sound()->speechSfxExists()) {
if (!_vm->sound()->isSpeechActive()) {
break;
}
diff --git a/queen/journal.cpp b/queen/journal.cpp
index 314e37a67a..2846db02d6 100644
--- a/queen/journal.cpp
+++ b/queen/journal.cpp
@@ -247,10 +247,7 @@ void Journal::handleNormalMode(int16 zoneNum, int x) {
}
drawConfigPanel();
} else if (zoneNum == ZN_VOICE_TOGGLE) {
- if (_vm->resource()->isCD())
- _vm->sound()->toggleSpeech();
- else
- _vm->sound()->speechToggle(false);
+ _vm->sound()->toggleSpeech();
drawConfigPanel();
} else if (zoneNum == ZN_TEXT_TOGGLE) {
_vm->subtitles(!_vm->subtitles());
diff --git a/queen/queen.cpp b/queen/queen.cpp
index 1d48550163..2e1de0a0d2 100644
--- a/queen/queen.cpp
+++ b/queen/queen.cpp
@@ -110,7 +110,7 @@ void QueenEngine::registerDefaultSettings() {
ConfMan.registerDefault("music_mute", false);
ConfMan.registerDefault("sfx_mute", false);
ConfMan.registerDefault("talkspeed", Logic::DEFAULT_TALK_SPEED);
- ConfMan.registerDefault("speech_mute", !_resource->isCD());
+ ConfMan.registerDefault("speech_mute", _resource->isDemo() || _resource->isInterview());
ConfMan.registerDefault("subtitles", true);
}
@@ -126,6 +126,11 @@ void QueenEngine::checkOptionSettings() {
if (!_sound->speechOn()) {
_subtitles = true;
}
+
+ // demo and interview versions don't have speech at all
+ if (_sound->speechOn() && (_resource->isDemo() || _resource->isInterview())) {
+ _sound->speechToggle(false);
+ }
}
void QueenEngine::readOptionSettings() {
@@ -133,7 +138,7 @@ void QueenEngine::readOptionSettings() {
_sound->musicToggle(!ConfMan.getBool("music_mute"));
_sound->sfxToggle(!ConfMan.getBool("sfx_mute"));
_talkSpeed = ConfMan.getInt("talkspeed");
- _sound->speechToggle(_resource->isCD() ? !ConfMan.getBool("speech_mute"): false);
+ _sound->speechToggle(!ConfMan.getBool("speech_mute"));
_subtitles = ConfMan.getBool("subtitles");
checkOptionSettings();
}
diff --git a/queen/sound.cpp b/queen/sound.cpp
index 68e64efbe9..d551564bbd 100644
--- a/queen/sound.cpp
+++ b/queen/sound.cpp
@@ -92,7 +92,7 @@ void Sound::waitFinished(bool isSpeech) {
void Sound::playSfx(uint16 sfx, bool isSpeech) {
if (isSpeech && !speechOn()) return;
- else if (!sfxOn()) return;
+ else if (!sfxOn()) return;
if (sfx != 0) {
char name[13];
@@ -103,7 +103,12 @@ void Sound::playSfx(uint16 sfx, bool isSpeech) {
#endif
strcat(name, ".SB");
waitFinished(isSpeech);
- sfxPlay(name, isSpeech);
+ if (_vm->resource()->fileExists(name)) {
+ sfxPlay(name, isSpeech);
+ _speechSfxExists = isSpeech;
+ } else {
+ _speechSfxExists = false;
+ }
}
}
@@ -120,7 +125,12 @@ void Sound::playSfx(const char *base, bool isSpeech) {
}
strcat(name, ".SB");
waitFinished(isSpeech);
- sfxPlay(name, isSpeech);
+ if (_vm->resource()->fileExists(name)) {
+ sfxPlay(name, isSpeech);
+ _speechSfxExists = isSpeech;
+ } else {
+ _speechSfxExists = false;
+ }
}
void Sound::playSong(int16 songNum) {
@@ -182,40 +192,32 @@ void SBSound::playSound(byte *sound, uint32 size, bool isSpeech) {
}
void SBSound::sfxPlay(const char *name, bool isSpeech) {
- if (_vm->resource()->fileExists(name)) {
- uint32 size;
- uint8 *buf = _vm->resource()->loadFile(name, SB_HEADER_SIZE, &size, true);
- playSound(buf, size, isSpeech);
- }
+ uint32 size;
+ uint8 *buf = _vm->resource()->loadFile(name, SB_HEADER_SIZE, &size, true);
+ playSound(buf, size, isSpeech);
}
#ifdef USE_MAD
void MP3Sound::sfxPlay(const char *name, bool isSpeech) {
- if (_vm->resource()->fileExists(name)) {
- uint32 size;
- File *f = _vm->resource()->giveCompressedSound(name, &size);
- _mixer->playInputStream(isSpeech ? &_speechHandle : &_sfxHandle, makeMP3Stream(f, size), false);
- }
+ uint32 size;
+ File *f = _vm->resource()->giveCompressedSound(name, &size);
+ _mixer->playInputStream(isSpeech ? &_speechHandle : &_sfxHandle, makeMP3Stream(f, size), false);
}
#endif
#ifdef USE_VORBIS
void OGGSound::sfxPlay(const char *name, bool isSpeech) {
- if (_vm->resource()->fileExists(name)) {
- uint32 size;
- File *f = _vm->resource()->giveCompressedSound(name, &size);
- _mixer->playInputStream(isSpeech ? &_speechHandle : &_sfxHandle, makeVorbisStream(f, size), false);
- }
+ uint32 size;
+ File *f = _vm->resource()->giveCompressedSound(name, &size);
+ _mixer->playInputStream(isSpeech ? &_speechHandle : &_sfxHandle, makeVorbisStream(f, size), false);
}
#endif
#ifdef USE_FLAC
void FLACSound::sfxPlay(const char *name, bool isSpeech) {
- if (_vm->resource()->fileExists(name)) {
- uint32 size;
- File *f = _vm->resource()->giveCompressedSound(name, &size);
- _mixer->playInputStream(isSpeech ? &_speechHandle : &_sfxHandle, makeFlacStream(f, size), false);
- }
+ uint32 size;
+ File *f = _vm->resource()->giveCompressedSound(name, &size);
+ _mixer->playInputStream(isSpeech ? &_speechHandle : &_sfxHandle, makeFlacStream(f, size), false);
}
#endif
diff --git a/queen/sound.h b/queen/sound.h
index 57b49d7a43..68229e583c 100644
--- a/queen/sound.h
+++ b/queen/sound.h
@@ -77,6 +77,8 @@ public:
bool isSpeechActive() const { return _speechHandle.isActive(); }
bool isSfxActive() const { return _sfxHandle.isActive(); }
+ bool speechSfxExists() const { return _speechSfxExists; }
+
int16 lastOverride() const { return _lastOverride; }
void saveState(byte *&ptr);
@@ -107,6 +109,7 @@ protected:
bool _sfxToggle;
bool _speechToggle;
bool _musicToggle;
+ bool _speechSfxExists;
int16 _lastOverride;
PlayingSoundHandle _sfxHandle;
diff --git a/queen/talk.cpp b/queen/talk.cpp
index fe412eafde..75e8f9672d 100644
--- a/queen/talk.cpp
+++ b/queen/talk.cpp
@@ -757,7 +757,7 @@ void Talk::defaultAnimation(
break;
}
- if (_vm->sound()->speechOn()) {
+ if (_vm->sound()->speechOn() && _vm->sound()->speechSfxExists()) {
// sfx is finished, stop the speak animation
if (!_vm->sound()->isSpeechActive()) {
break;
@@ -772,7 +772,7 @@ void Talk::defaultAnimation(
}
}
- // Make sure that Person closes their mouths
+ // Make sure that Person closes their mouth
if (!isJoe && parameters->ff > 0)
_vm->bankMan()->overpack(parameters->ff, startFrame, bankNum);
}
@@ -834,7 +834,7 @@ void Talk::speakSegment(
if (!isJoe) {
if (SPEAK_AMAL_ON == command) {
// It's the oracle!
- // Dont turn AMAL animation off, and dont manually anim person
+ // Don't turn AMAL animation off, and don't manually anim person
command = SPEAK_ORACLE;
oracle = true;
uint16 frameNum = _vm->graphics()->personFrames(bobNum);