Use correct method for subtitle speed.

svn-id: r12949
This commit is contained in:
Travis Howell 2004-02-21 02:03:53 +00:00
parent e0b723a54c
commit dfe5828d4f
4 changed files with 14 additions and 25 deletions

View File

@ -543,9 +543,11 @@ void ScummEngine::writeVar(uint var, int value) {
checkRange(_numVariables - 1, 0, var, "Variable %d out of range(w)");
// FIXME: Find some better place to put this.
if (var == VAR_CHARINC)
VAR(VAR_CHARINC) = _defaultTalkDelay / 20;
else
if (var == VAR_CHARINC && ConfMan.hasKey("talkspeed")) {
int talkspeed = ConfMan.getInt("talkspeed") / 20;
if (talkspeed >= 0 && talkspeed <= 180)
VAR(VAR_CHARINC) = talkspeed;
} else
_scummVars[var] = value;
// stay in sync with loom cd subtitle var

View File

@ -422,8 +422,10 @@ void ScummEngine_v8::writeVar(uint var, int value) {
if (!(var & 0xF0000000)) {
checkRange(_numVariables - 1, 0, var, "Variable %d out of range(w)");
if (var == VAR_CHARINC) {
VAR(VAR_CHARINC) = _defaultTalkDelay / 20;
if (var == VAR_CHARINC && ConfMan.hasKey("talkspeed")) {
int talkspeed = ConfMan.getInt("talkspeed") / 20;
if (talkspeed >= 0 && talkspeed <= 180)
VAR(VAR_CHARINC) = talkspeed;
} else
_scummVars[var] = value;

View File

@ -642,7 +642,6 @@ ScummEngine::ScummEngine(GameDetector *detector, OSystem *syst, const ScummGameS
ConfMan.set("subtitles", !ConfMan.getBool("nosubtitles"));
}
_confirmExit = ConfMan.getBool("confirm_exit");
_defaultTalkDelay = ConfMan.getInt("talkspeed");
_native_mt32 = ConfMan.getBool("native_mt32");
// TODO: We shouldn't rely on the global Language values matching those COMI etc. expect.
// Rather we should explicitly translate them.
@ -1200,6 +1199,7 @@ void ScummEngine::initScummVars() {
VAR(VAR_CURRENT_LIGHTS) = LIGHTMODE_actor_base | LIGHTMODE_actor_color | LIGHTMODE_screen;
}
_defaultTalkDelay = 60;
VAR(VAR_CHARINC) = 4;
talkingActor(0);
}
@ -1884,17 +1884,11 @@ void ScummEngine::processKbd(bool smushMode) {
if (_imuse)
_imuse->set_music_volume (vol);
} else if (_lastKeyHit == '-') { // - text speed down
_defaultTalkDelay += 5;
if (_defaultTalkDelay > 90)
_defaultTalkDelay = 90;
VAR(VAR_CHARINC) = _defaultTalkDelay / 20;
if (VAR(VAR_CHARINC) < 9)
VAR(VAR_CHARINC) = + 1;
} else if (_lastKeyHit == '+') { // + text speed up
_defaultTalkDelay -= 5;
if (_defaultTalkDelay < 5)
_defaultTalkDelay = 5;
VAR(VAR_CHARINC) = _defaultTalkDelay / 20;
if (VAR(VAR_CHARINC) > 0)
VAR(VAR_CHARINC) -= 1;
} else if (_lastKeyHit == '~' || _lastKeyHit == '#') { // Debug console
_debugger->attach();
} else if (_version <= 2) {

View File

@ -177,15 +177,6 @@ void ScummEngine::CHARSET_1() {
_useTalkAnims = true;
}
// HACK: Most of the audio sync in Loom is handled by the "MI1
// timer", but some of it depends on text strings timing out at
// the right moment.
if (_gameId == GID_LOOM256) {
_defaultTalkDelay = 100;
VAR(VAR_CHARINC) = 5;
}
_talkDelay = _defaultTalkDelay;
if (!_keepText) {