aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/illusions/bbdou/illusions_bbdou.cpp5
-rw-r--r--engines/illusions/duckman/illusions_duckman.cpp7
-rw-r--r--engines/illusions/duckman/menusystem_duckman.cpp16
-rw-r--r--engines/illusions/illusions.cpp10
-rw-r--r--engines/illusions/illusions.h6
-rw-r--r--engines/illusions/sound.cpp24
-rw-r--r--engines/illusions/sound.h14
-rw-r--r--engines/illusions/threads/talkthread.cpp2
-rw-r--r--engines/illusions/threads/talkthread_duckman.cpp2
9 files changed, 52 insertions, 34 deletions
diff --git a/engines/illusions/bbdou/illusions_bbdou.cpp b/engines/illusions/bbdou/illusions_bbdou.cpp
index a642835623..f3845a69ee 100644
--- a/engines/illusions/bbdou/illusions_bbdou.cpp
+++ b/engines/illusions/bbdou/illusions_bbdou.cpp
@@ -185,8 +185,9 @@ Common::Error IllusionsEngine_BBDOU::run() {
_pauseCtr = 0;
_field8 = 1;
_fieldA = 0;
- _fieldE = 240;
-
+ ConfMan.registerDefault("talkspeed", 240);
+ _subtitleDuration = (uint16)ConfMan.getInt("talkspeed");
+
_globalSceneId = 0x00010003;
setDefaultTextCoords();
diff --git a/engines/illusions/duckman/illusions_duckman.cpp b/engines/illusions/duckman/illusions_duckman.cpp
index a93ec274b5..6ce29de8c6 100644
--- a/engines/illusions/duckman/illusions_duckman.cpp
+++ b/engines/illusions/duckman/illusions_duckman.cpp
@@ -142,8 +142,11 @@ Common::Error IllusionsEngine_Duckman::run() {
_doScriptThreadInit = false;
_field8 = 1;
_fieldA = 0;
- _fieldE = 240;
-
+
+ ConfMan.registerDefault("talkspeed", 240);
+ _subtitleDuration = (uint16)ConfMan.getInt("talkspeed");
+ debug(0, "talkspeed: %d", _subtitleDuration);
+
_globalSceneId = 0x00010003;
_savedInventoryActorIndex = 0;
diff --git a/engines/illusions/duckman/menusystem_duckman.cpp b/engines/illusions/duckman/menusystem_duckman.cpp
index b5af102bb9..f7f93ce0ea 100644
--- a/engines/illusions/duckman/menusystem_duckman.cpp
+++ b/engines/illusions/duckman/menusystem_duckman.cpp
@@ -111,10 +111,10 @@ MenuItem *DuckmanMenuSystem::createOptionsSliderMenuItem(MenuActionUpdateSlider
int sliderValue = 0;
Common::String sliderText = "{~~~~~~~~~~~~~~~~}";
switch (type) {
- case SFX : sliderValue = _vm->_soundMan->getSfxVolume()/(255/15); break;
- case MUSIC : sliderValue = _vm->_soundMan->getMusicVolume()/(255/15); break;
- case VOICE : sliderValue = _vm->_soundMan->getSpeechVolume()/(255/15); break;
- case TEXT_DURATION : sliderValue = 128/(255/15); break; // TODO wire up text duration config
+ case SFX : sliderValue = _vm->_soundMan->getSfxVolume()/(256/15); break;
+ case MUSIC : sliderValue = _vm->_soundMan->getMusicVolume()/(256/15); break;
+ case VOICE : sliderValue = _vm->_soundMan->getSpeechVolume()/(256/15); break;
+ case TEXT_DURATION : sliderValue = _vm->getSubtitleDuration()/(256/15); break;
default: break;
}
@@ -381,10 +381,10 @@ void MenuActionUpdateSlider::setSliderValue(uint8 newValue) {
_menuSystem->redrawMenuText(menu);
switch(_type) {
- case SFX : _vm->_soundMan->setSfxVolume(newValue * (255/15)); break;
- case MUSIC : _vm->_soundMan->setMusicVolume(newValue * (255/15)); break;
- case VOICE : _vm->_soundMan->setSpeechVolume(newValue * (255/15)); break;
- case TEXT_DURATION : break; // TODO
+ case SFX : _vm->_soundMan->setSfxVolume(newValue * (256/15)); break;
+ case MUSIC : _vm->_soundMan->setMusicVolume(newValue * (256/15)); break;
+ case VOICE : _vm->_soundMan->setSpeechVolume(newValue * (256/15)); break;
+ case TEXT_DURATION : _vm->setSubtitleDuration(newValue * (256/15)); break;
default: break;
}
}
diff --git a/engines/illusions/illusions.cpp b/engines/illusions/illusions.cpp
index 83881103a1..7c3e62b4a7 100644
--- a/engines/illusions/illusions.cpp
+++ b/engines/illusions/illusions.cpp
@@ -391,4 +391,14 @@ FramesList *IllusionsEngine::findActorSequenceFrames(Sequence *sequence) {
return _actorInstances->findSequenceFrames(sequence);
}
+void IllusionsEngine::setSubtitleDuration(uint16 duration) {
+ _subtitleDuration = duration;
+ ConfMan.setInt("talkspeed", _subtitleDuration);
+ ConfMan.flushToDisk();
+}
+
+uint16 IllusionsEngine::getSubtitleDuration() {
+ return (uint16)_subtitleDuration;
+}
+
} // End of namespace Illusions
diff --git a/engines/illusions/illusions.h b/engines/illusions/illusions.h
index 12bd2846a7..63983e158a 100644
--- a/engines/illusions/illusions.h
+++ b/engines/illusions/illusions.h
@@ -145,7 +145,8 @@ public:
uint32 _fontId;
int _field8;
- uint32 _fieldA, _fieldE;
+ uint32 _fieldA;
+ uint32 _subtitleDuration;
WidthHeight _defaultTextDimensions;
Common::Point _defaultTextPosition;
@@ -184,6 +185,9 @@ public:
void getDefaultTextPosition(Common::Point &position);
void setDefaultTextPosition(Common::Point &position);
+ uint16 getSubtitleDuration();
+ void setSubtitleDuration(uint16 duration);
+
FramesList *findActorSequenceFrames(Sequence *sequence);
virtual void setDefaultTextCoords() = 0;
diff --git a/engines/illusions/sound.cpp b/engines/illusions/sound.cpp
index 55bbf8661f..a40c43f129 100644
--- a/engines/illusions/sound.cpp
+++ b/engines/illusions/sound.cpp
@@ -365,37 +365,37 @@ void SoundMan::fadeMidiMusic(int16 finalVolume, int16 duration) {
_midiPlayer->fade(finalVolume, duration);
}
-void SoundMan::setMusicVolume(uint8 volume) {
+void SoundMan::setMusicVolume(uint16 volume) {
ConfMan.setInt("music_volume", volume);
_midiPlayer->syncVolume();
ConfMan.flushToDisk();
}
-void SoundMan::setSfxVolume(uint8 volume) {
+void SoundMan::setSfxVolume(uint16 volume) {
ConfMan.setInt("sfx_volume", volume);
ConfMan.flushToDisk();
}
-void SoundMan::setSpeechVolume(uint8 volume) {
+void SoundMan::setSpeechVolume(uint16 volume) {
ConfMan.setInt("speech_volume", volume);
ConfMan.flushToDisk();
}
-uint8 SoundMan::calcAdjustedVolume(const Common::String &volumeConfigKey, uint8 volume) {
- uint8 masterVolume = (uint8)ConfMan.getInt(volumeConfigKey);
- return (uint8)(((float)masterVolume/255) * (float)volume);
+uint16 SoundMan::calcAdjustedVolume(const Common::String &volumeConfigKey, uint16 volume) {
+ uint16 masterVolume = (uint16)ConfMan.getInt(volumeConfigKey);
+ return (uint16)(((float)masterVolume/256) * (float)volume);
}
-uint8 SoundMan::getMusicVolume() {
- return (uint8)ConfMan.getInt("music_volume");
+uint16 SoundMan::getMusicVolume() {
+ return (uint16)ConfMan.getInt("music_volume");
}
-uint8 SoundMan::getSfxVolume() {
- return (uint8)ConfMan.getInt("sfx_volume");
+uint16 SoundMan::getSfxVolume() {
+ return (uint16)ConfMan.getInt("sfx_volume");
}
-uint8 SoundMan::getSpeechVolume() {
- return (uint8)ConfMan.getInt("speech_volume");
+uint16 SoundMan::getSpeechVolume() {
+ return (uint16)ConfMan.getInt("speech_volume");
}
} // End of namespace Illusions
diff --git a/engines/illusions/sound.h b/engines/illusions/sound.h
index f0786b2e4d..75464e8bd5 100644
--- a/engines/illusions/sound.h
+++ b/engines/illusions/sound.h
@@ -117,13 +117,13 @@ public:
void stopMidiMusic();
void fadeMidiMusic(int16 finalVolume, int16 duration);
- uint8 getMusicVolume();
- uint8 getSfxVolume();
- uint8 getSpeechVolume();
+ uint16 getMusicVolume();
+ uint16 getSfxVolume();
+ uint16 getSpeechVolume();
- void setMusicVolume(uint8 volume);
- void setSfxVolume(uint8 volume);
- void setSpeechVolume(uint8 volume);
+ void setMusicVolume(uint16 volume);
+ void setSfxVolume(uint16 volume);
+ void setSpeechVolume(uint16 volume);
bool cueVoice(const char *voiceName);
void stopCueingVoice();
@@ -148,7 +148,7 @@ protected:
VoicePlayer *_voicePlayer;
SoundList _sounds;
Sound *getSound(uint32 soundEffectId);
- uint8 calcAdjustedVolume(const Common::String &volumeConfigKey, uint8 volume);
+ uint16 calcAdjustedVolume(const Common::String &volumeConfigKey, uint16 volume);
};
} // End of namespace Illusions
diff --git a/engines/illusions/threads/talkthread.cpp b/engines/illusions/threads/talkthread.cpp
index 5b54abc583..9e94ef64cc 100644
--- a/engines/illusions/threads/talkthread.cpp
+++ b/engines/illusions/threads/talkthread.cpp
@@ -60,7 +60,7 @@ TalkThread::TalkThread(IllusionsEngine *vm, uint32 threadId, uint32 callingThrea
_flags = 0x0E;
- _durationMult = _vm->clipTextDuration(_vm->_fieldE);
+ _durationMult = _vm->clipTextDuration(_vm->getSubtitleDuration());
_textDuration = _durationMult;
_defDurationMult = _vm->clipTextDuration(240);
_textStartTime = 0;
diff --git a/engines/illusions/threads/talkthread_duckman.cpp b/engines/illusions/threads/talkthread_duckman.cpp
index 2d6c455b1c..42d9747810 100644
--- a/engines/illusions/threads/talkthread_duckman.cpp
+++ b/engines/illusions/threads/talkthread_duckman.cpp
@@ -56,7 +56,7 @@ TalkThread_Duckman::TalkThread_Duckman(IllusionsEngine_Duckman *vm, uint32 threa
else
_status = 2;
- _durationMult = _vm->clipTextDuration(_vm->_fieldE);
+ _durationMult = _vm->clipTextDuration(_vm->_subtitleDuration);
_textDuration = _durationMult;
_defDurationMult = _vm->clipTextDuration(240);