Support of new subtitles code. Patch from salty-horse.

svn-id: r23031
This commit is contained in:
Eugene Sandulenko 2006-06-11 20:30:43 +00:00
parent fd7e9847fc
commit de95d463a8
4 changed files with 15 additions and 7 deletions

View File

@ -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;
}

View File

@ -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;

View File

@ -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

View File

@ -409,9 +409,10 @@ private:
public:
ColorId KnownColor2ColorId(KnownColor knownColor);
void setTalkspeed(int talkspeed);
int getTalkspeed();
};
} // End of namespace Saga
#endif