aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2006-06-11 20:30:43 +0000
committerEugene Sandulenko2006-06-11 20:30:43 +0000
commitde95d463a8c091ea55a8ae8166fb447a9f56a195 (patch)
tree4a2d0e93f714439be7846b094b9f38afa252966e
parentfd7e9847fcfa79fe8a76f97b720956a59b91d8c2 (diff)
downloadscummvm-rg350-de95d463a8c091ea55a8ae8166fb447a9f56a195.tar.gz
scummvm-rg350-de95d463a8c091ea55a8ae8166fb447a9f56a195.tar.bz2
scummvm-rg350-de95d463a8c091ea55a8ae8166fb447a9f56a195.zip
Support of new subtitles code. Patch from salty-horse.
svn-id: r23031
-rw-r--r--engines/saga/actor.cpp6
-rw-r--r--engines/saga/interface.cpp4
-rw-r--r--engines/saga/saga.cpp9
-rw-r--r--engines/saga/saga.h3
4 files changed, 15 insertions, 7 deletions
diff --git a/engines/saga/actor.cpp b/engines/saga/actor.cpp
index f87958ef53..0f7e40f480 100644
--- a/engines/saga/actor.cpp
+++ b/engines/saga/actor.cpp
@@ -1148,13 +1148,13 @@ void Actor::handleSpeech(int msec) {
if (sampleLength < 0) {
_activeSpeech.playingTime = stringLength * 1000 / 22;
switch (_vm->_readingSpeed) {
- case 1:
+ case 2:
_activeSpeech.playingTime *= 2;
break;
- case 2:
+ case 1:
_activeSpeech.playingTime *= 4;
break;
- case 3:
+ case 0:
_activeSpeech.playingTime = 0x7fffff;
break;
}
diff --git a/engines/saga/interface.cpp b/engines/saga/interface.cpp
index 3fa81514d4..0a4a58e871 100644
--- a/engines/saga/interface.cpp
+++ b/engines/saga/interface.cpp
@@ -1367,7 +1367,7 @@ void Interface::setOption(PanelButton *panelButton) {
ConfMan.setBool("subtitles", _vm->_subtitlesEnabled);
} else {
_vm->_readingSpeed = (_vm->_readingSpeed + 1) % 4;
- ConfMan.setInt("talkspeed", _vm->_readingSpeed);
+ _vm->setTalkspeed(_vm->_readingSpeed);
}
break;
case kTextMusic:
@@ -1893,7 +1893,7 @@ void Interface::drawButtonBox(Surface *ds, const Rect& rect, ButtonKind kind, bo
ds->fillRect(fill, solidColor);
}
-static const int readingSpeeds[] = { kTextFast, kTextMid, kTextSlow, kTextClick };
+static const int readingSpeeds[] = { kTextClick, kTextSlow, kTextMid, kTextFast };
void Interface::drawPanelButtonText(Surface *ds, InterfacePanel *panel, PanelButton *panelButton) {
const char *text;
diff --git a/engines/saga/saga.cpp b/engines/saga/saga.cpp
index 2bb81e3841..f952cdb60b 100644
--- a/engines/saga/saga.cpp
+++ b/engines/saga/saga.cpp
@@ -150,7 +150,7 @@ int SagaEngine::init() {
_soundVolume = ConfMan.getInt("sfx_volume") / 25;
_musicVolume = ConfMan.getInt("music_volume") / 25;
_subtitlesEnabled = ConfMan.getBool("subtitles");
- _readingSpeed = ConfMan.getInt("talkspeed");
+ _readingSpeed = getTalkspeed();
_copyProtection = ConfMan.getBool("copy_protection");
if (_readingSpeed > 3)
@@ -457,5 +457,12 @@ ColorId SagaEngine::KnownColor2ColorId(KnownColor knownColor) {
return colorId;
}
+void SagaEngine::setTalkspeed(int talkspeed) {
+ ConfMan.setInt("talkspeed", (talkspeed * 255 + 3 / 2) / 3);
+}
+
+int SagaEngine::getTalkspeed() {
+ return (ConfMan.getInt("talkspeed") * 3 + 255 / 2) / 255;
+}
} // End of namespace Saga
diff --git a/engines/saga/saga.h b/engines/saga/saga.h
index 3c91f0d88d..c9edbe9d46 100644
--- a/engines/saga/saga.h
+++ b/engines/saga/saga.h
@@ -409,9 +409,10 @@ private:
public:
ColorId KnownColor2ColorId(KnownColor knownColor);
+ void setTalkspeed(int talkspeed);
+ int getTalkspeed();
};
-
} // End of namespace Saga
#endif