aboutsummaryrefslogtreecommitdiff
path: root/engines/draci/script.cpp
diff options
context:
space:
mode:
authorRobert Špalek2009-10-13 05:38:45 +0000
committerRobert Špalek2009-10-13 05:38:45 +0000
commitbaec8c2421c30ebee00c0e0e97de8beba3a9fc2a (patch)
treed53d3c7e094a941af1ab685d671c97fccf278db0 /engines/draci/script.cpp
parent7c311057c10f876cbe5053fac1943917766ae0f0 (diff)
downloadscummvm-rg350-baec8c2421c30ebee00c0e0e97de8beba3a9fc2a.tar.gz
scummvm-rg350-baec8c2421c30ebee00c0e0e97de8beba3a9fc2a.tar.bz2
scummvm-rg350-baec8c2421c30ebee00c0e0e97de8beba3a9fc2a.zip
Set all sound/subtitle-related parameters from ConfMan.
Made it intelligent so that when, for example, the dubbing file doesn't exist, we don't fail, but instead always show subtitles even if the GUI settings says dubbing only, etc. svn-id: r45002
Diffstat (limited to 'engines/draci/script.cpp')
-rw-r--r--engines/draci/script.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/engines/draci/script.cpp b/engines/draci/script.cpp
index fdc6774e25..5f4edf07b5 100644
--- a/engines/draci/script.cpp
+++ b/engines/draci/script.cpp
@@ -697,9 +697,17 @@ void Script::talk(Common::Queue<int> &params) {
// Fetch person info
const Person *person = _vm->_game->getPerson(personID);
+ // Fetch the dubbing
+ SoundSample *sample = _vm->_sound->isMutedVoice()
+ ? NULL : _vm->_dubbingArchive->getSample(sentenceID, 0);
+
// Set the string and text colour
surface->markDirtyRect(speechFrame->getRect());
- speechFrame->setText(Common::String((const char *)f->_data+1, f->_length-1));
+ if (_vm->_sound->showSubtitles() || !sample) {
+ speechFrame->setText(Common::String((const char *)f->_data+1, f->_length-1));
+ } else {
+ speechFrame->setText("");
+ }
speechFrame->setColour(person->_fontColour);
// HACK: Some strings in the English data files are too long to fit the screen
@@ -714,7 +722,6 @@ void Script::talk(Common::Queue<int> &params) {
_vm->_game->setLoopSubstatus(kSubstatusTalk);
// Speak the dubbing if possible
- SoundSample *sample = _vm->_dubbingArchive->getSample(sentenceID, 0);
uint dubbingDuration = 0;
if (sample) {
dubbingDuration = (uint) (1000.0 * sample->_length / sample->_frequency + 500.0);
@@ -724,11 +731,9 @@ void Script::talk(Common::Queue<int> &params) {
}
// Record time
- const uint subtitleDuration = kBaseSpeechDuration +
- speechFrame->getLength() * kSpeechTimeUnit /
- (128 / 16 + 1);
- const uint duration = subtitleDuration >= dubbingDuration ?
- subtitleDuration : dubbingDuration;
+ uint subtitleDuration = (kBaseSpeechDuration + speechFrame->getLength() * kSpeechTimeUnit)
+ / _vm->_sound->talkSpeed();
+ const uint duration = MAX(subtitleDuration, dubbingDuration);
_vm->_game->setSpeechTiming(_vm->_system->getMillis(), duration);
// TODO: Implement inventory part