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) { if (sampleLength < 0) {
_activeSpeech.playingTime = stringLength * 1000 / 22; _activeSpeech.playingTime = stringLength * 1000 / 22;
switch (_vm->_readingSpeed) { switch (_vm->_readingSpeed) {
case 1: case 2:
_activeSpeech.playingTime *= 2; _activeSpeech.playingTime *= 2;
break; break;
case 2: case 1:
_activeSpeech.playingTime *= 4; _activeSpeech.playingTime *= 4;
break; break;
case 3: case 0:
_activeSpeech.playingTime = 0x7fffff; _activeSpeech.playingTime = 0x7fffff;
break; break;
} }

View file

@ -1367,7 +1367,7 @@ void Interface::setOption(PanelButton *panelButton) {
ConfMan.setBool("subtitles", _vm->_subtitlesEnabled); ConfMan.setBool("subtitles", _vm->_subtitlesEnabled);
} else { } else {
_vm->_readingSpeed = (_vm->_readingSpeed + 1) % 4; _vm->_readingSpeed = (_vm->_readingSpeed + 1) % 4;
ConfMan.setInt("talkspeed", _vm->_readingSpeed); _vm->setTalkspeed(_vm->_readingSpeed);
} }
break; break;
case kTextMusic: case kTextMusic:
@ -1893,7 +1893,7 @@ void Interface::drawButtonBox(Surface *ds, const Rect& rect, ButtonKind kind, bo
ds->fillRect(fill, solidColor); 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) { void Interface::drawPanelButtonText(Surface *ds, InterfacePanel *panel, PanelButton *panelButton) {
const char *text; const char *text;

View file

@ -150,7 +150,7 @@ int SagaEngine::init() {
_soundVolume = ConfMan.getInt("sfx_volume") / 25; _soundVolume = ConfMan.getInt("sfx_volume") / 25;
_musicVolume = ConfMan.getInt("music_volume") / 25; _musicVolume = ConfMan.getInt("music_volume") / 25;
_subtitlesEnabled = ConfMan.getBool("subtitles"); _subtitlesEnabled = ConfMan.getBool("subtitles");
_readingSpeed = ConfMan.getInt("talkspeed"); _readingSpeed = getTalkspeed();
_copyProtection = ConfMan.getBool("copy_protection"); _copyProtection = ConfMan.getBool("copy_protection");
if (_readingSpeed > 3) if (_readingSpeed > 3)
@ -457,5 +457,12 @@ ColorId SagaEngine::KnownColor2ColorId(KnownColor knownColor) {
return colorId; 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 } // End of namespace Saga

View file

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