SCUMM: Change _defaultTalkDelay to _defaultTextSpeed
From now on we're reasoning in terms of text speed, just like the interpreter does, which means: delay == 9 - speed. This allows us to sync the internal GUI and the ScummVM GUI more easily, and allows for a better correspondence to the original interpreters.
This commit is contained in:
parent
457bcb67db
commit
2417448791
6 changed files with 31 additions and 32 deletions
|
@ -1156,9 +1156,9 @@ bool ScummEngine::executeMainMenuOperation(int op, int mouseX) {
|
||||||
ScummEngine::drawDirtyScreenParts();
|
ScummEngine::drawDirtyScreenParts();
|
||||||
break;
|
break;
|
||||||
case GUI_CTRL_TEXT_SPEED_SLIDER:
|
case GUI_CTRL_TEXT_SPEED_SLIDER:
|
||||||
_defaultTalkDelay = CLIP<int>(9 - (mouseX - 108) / 9, 0, 9);
|
_defaultTextSpeed = CLIP<int>((mouseX - 108) / 9, 0, 9);
|
||||||
ConfMan.setInt("original_gui_text_speed", _defaultTalkDelay);
|
ConfMan.setInt("original_gui_text_speed", _defaultTextSpeed);
|
||||||
setTalkSpeed(9 - _defaultTalkDelay);
|
setTalkSpeed(_defaultTextSpeed);
|
||||||
syncSoundSettings();
|
syncSoundSettings();
|
||||||
ConfMan.flushToDisk();
|
ConfMan.flushToDisk();
|
||||||
updateMainMenuControls();
|
updateMainMenuControls();
|
||||||
|
|
|
@ -563,6 +563,10 @@ void ScummEngine_v7::processKeyboard(Common::KeyState lastKeyHit) {
|
||||||
VAR(VAR_CHARINC) = 9;
|
VAR(VAR_CHARINC) = 9;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_defaultTextSpeed = 9 - VAR(VAR_CHARINC);
|
||||||
|
ConfMan.setInt("original_gui_text_speed", _defaultTextSpeed);
|
||||||
|
setTalkSpeed(_defaultTextSpeed);
|
||||||
|
|
||||||
getSliderString(gsTextSpeedSlider, VAR(VAR_CHARINC), sliderString, sizeof(sliderString));
|
getSliderString(gsTextSpeedSlider, VAR(VAR_CHARINC), sliderString, sizeof(sliderString));
|
||||||
showBannerAndPause(0, 0, sliderString);
|
showBannerAndPause(0, 0, sliderString);
|
||||||
ks = Common::KEYCODE_INVALID;
|
ks = Common::KEYCODE_INVALID;
|
||||||
|
@ -949,20 +953,20 @@ void ScummEngine::processKeyboard(Common::KeyState lastKeyHit) {
|
||||||
syncSoundSettings();
|
syncSoundSettings();
|
||||||
|
|
||||||
} else if (optionKeysEnabled && (lastKeyHit.ascii == '-' || lastKeyHit.ascii == '+')) { // Change text speed
|
} else if (optionKeysEnabled && (lastKeyHit.ascii == '-' || lastKeyHit.ascii == '+')) { // Change text speed
|
||||||
if (lastKeyHit.ascii == '+' && _defaultTalkDelay > 0)
|
if (lastKeyHit.ascii == '-' && _defaultTextSpeed > 0)
|
||||||
_defaultTalkDelay--;
|
_defaultTextSpeed--;
|
||||||
else if (lastKeyHit.ascii == '-' && _defaultTalkDelay < 9)
|
else if (lastKeyHit.ascii == '+' && _defaultTextSpeed < 9)
|
||||||
_defaultTalkDelay++;
|
_defaultTextSpeed++;
|
||||||
|
|
||||||
// Display the talk speed
|
// Display the talk speed
|
||||||
ValueDisplayDialog dlg(_("Subtitle speed: "), 0, 9, 9 - _defaultTalkDelay, '+', '-');
|
ValueDisplayDialog dlg(_("Subtitle speed: "), 0, 9, _defaultTextSpeed, '+', '-');
|
||||||
_defaultTalkDelay = 9 - runDialog(dlg);
|
_defaultTextSpeed = runDialog(dlg);
|
||||||
|
|
||||||
// Save the new talkspeed value to ConfMan
|
// Save the new talkspeed value to ConfMan
|
||||||
setTalkSpeed(_defaultTalkDelay);
|
setTalkSpeed(_defaultTextSpeed);
|
||||||
|
|
||||||
if (VAR_CHARINC != 0xFF)
|
if (VAR_CHARINC != 0xFF)
|
||||||
VAR(VAR_CHARINC) = _defaultTalkDelay;
|
VAR(VAR_CHARINC) = 9 - _defaultTextSpeed;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
|
|
@ -789,7 +789,7 @@ bool ScummEngine::loadState(int slot, bool compat, Common::String &filename) {
|
||||||
if (_game.version == 8)
|
if (_game.version == 8)
|
||||||
_scummVars[VAR_CHARINC] = (_game.features & GF_DEMO) ? 3 : 1;
|
_scummVars[VAR_CHARINC] = (_game.features & GF_DEMO) ? 3 : 1;
|
||||||
// Needed due to subtitle speed changes
|
// Needed due to subtitle speed changes
|
||||||
_defaultTalkDelay /= 20;
|
_defaultTextSpeed /= 20;
|
||||||
}
|
}
|
||||||
|
|
||||||
// For a long time, we used incorrect locations for some camera related
|
// For a long time, we used incorrect locations for some camera related
|
||||||
|
@ -1325,7 +1325,7 @@ void ScummEngine::saveLoadWithSerializer(Common::Serializer &s) {
|
||||||
s.syncAsByte(_useTalkAnims, VER(8));
|
s.syncAsByte(_useTalkAnims, VER(8));
|
||||||
|
|
||||||
s.syncAsSint16LE(_talkDelay, VER(8));
|
s.syncAsSint16LE(_talkDelay, VER(8));
|
||||||
s.syncAsSint16LE(_defaultTalkDelay, VER(8));
|
s.syncAsSint16LE(_defaultTextSpeed, VER(8));
|
||||||
s.skip(2, VER(8), VER(27)); // _numInMsgStack
|
s.skip(2, VER(8), VER(27)); // _numInMsgStack
|
||||||
s.syncAsByte(_sentenceNum, VER(8));
|
s.syncAsByte(_sentenceNum, VER(8));
|
||||||
|
|
||||||
|
|
|
@ -1240,6 +1240,11 @@ Common::Error ScummEngine::init() {
|
||||||
ConfMan.setBool("subtitles", true);
|
ConfMan.setBool("subtitles", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// While most games set their own default talkspeed at start-up,
|
||||||
|
// some don't, so let's preventively set a default one.
|
||||||
|
if (!ConfMan.hasKey("talkspeed", _targetName))
|
||||||
|
setTalkSpeed(_defaultTextSpeed);
|
||||||
|
|
||||||
syncSoundSettings();
|
syncSoundSettings();
|
||||||
|
|
||||||
return Common::kNoError;
|
return Common::kNoError;
|
||||||
|
@ -1674,7 +1679,7 @@ void ScummEngine::resetScumm() {
|
||||||
_varwatch = -1;
|
_varwatch = -1;
|
||||||
_screenStartStrip = 0;
|
_screenStartStrip = 0;
|
||||||
|
|
||||||
_defaultTalkDelay = 3;
|
_defaultTextSpeed = 6;
|
||||||
_talkDelay = 0;
|
_talkDelay = 0;
|
||||||
_keepText = false;
|
_keepText = false;
|
||||||
_nextLeft = 0;
|
_nextLeft = 0;
|
||||||
|
@ -2116,16 +2121,10 @@ void ScummEngine::syncSoundSettings() {
|
||||||
ConfMan.setInt("original_gui_text_speed", getTalkSpeed());
|
ConfMan.setInt("original_gui_text_speed", getTalkSpeed());
|
||||||
}
|
}
|
||||||
|
|
||||||
_defaultTalkDelay = ConfMan.getInt("original_gui_text_speed");
|
_defaultTextSpeed = ConfMan.getInt("original_gui_text_speed");
|
||||||
|
|
||||||
// In the original games the talk delay is represented as text speed,
|
|
||||||
// so we have to invert the value:
|
|
||||||
// - 9 is the highest text speed possible;
|
|
||||||
// - 0 is the lowest text speed possible.
|
|
||||||
if (VAR_CHARINC != 0xFF)
|
if (VAR_CHARINC != 0xFF)
|
||||||
VAR(VAR_CHARINC) = 9 - _defaultTalkDelay;
|
VAR(VAR_CHARINC) = 9 - _defaultTextSpeed;
|
||||||
} else if (_game.version != 8) {
|
|
||||||
ConfMan.setInt("original_gui_text_speed", getTalkSpeed());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_game.version >= 7 && _imuseDigital) {
|
if (_game.version >= 7 && _imuseDigital) {
|
||||||
|
@ -2168,14 +2167,10 @@ void ScummEngine::syncSoundSettings() {
|
||||||
VAR(VAR_VOICE_MODE) = _voiceMode;
|
VAR(VAR_VOICE_MODE) = _voiceMode;
|
||||||
|
|
||||||
if (ConfMan.hasKey("talkspeed", _targetName)) {
|
if (ConfMan.hasKey("talkspeed", _targetName)) {
|
||||||
_defaultTalkDelay = getTalkSpeed();
|
_defaultTextSpeed = getTalkSpeed();
|
||||||
|
|
||||||
// In the original games the talk delay is represented as text speed,
|
|
||||||
// so we have to invert the value:
|
|
||||||
// - 9 is the highest text speed possible;
|
|
||||||
// - 0 is the lowest text speed possible.
|
|
||||||
if (VAR_CHARINC != 0xFF)
|
if (VAR_CHARINC != 0xFF)
|
||||||
VAR(VAR_CHARINC) = 9 - _defaultTalkDelay;
|
VAR(VAR_CHARINC) = 9 - _defaultTextSpeed;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Backyard Baseball 2003 uses a unique subtitle variable,
|
// Backyard Baseball 2003 uses a unique subtitle variable,
|
||||||
|
|
|
@ -1345,7 +1345,7 @@ protected:
|
||||||
|
|
||||||
bool _haveActorSpeechMsg = false;
|
bool _haveActorSpeechMsg = false;
|
||||||
bool _useTalkAnims = false;
|
bool _useTalkAnims = false;
|
||||||
uint16 _defaultTalkDelay = 0;
|
uint16 _defaultTextSpeed = 0;
|
||||||
int _saveSound = 0;
|
int _saveSound = 0;
|
||||||
bool _native_mt32 = false;
|
bool _native_mt32 = false;
|
||||||
bool _enable_gs = false;
|
bool _enable_gs = false;
|
||||||
|
|
|
@ -790,7 +790,7 @@ void ScummEngine::CHARSET_1() {
|
||||||
restoreCharsetBg();
|
restoreCharsetBg();
|
||||||
_msgCount = 0;
|
_msgCount = 0;
|
||||||
} else if (_game.version <= 2) {
|
} else if (_game.version <= 2) {
|
||||||
_talkDelay += _msgCount * _defaultTalkDelay;
|
_talkDelay += _msgCount * _defaultTextSpeed;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_game.version > 3) {
|
if (_game.version > 3) {
|
||||||
|
@ -892,7 +892,7 @@ void ScummEngine::CHARSET_1() {
|
||||||
mac_drawIndy3TextBox();
|
mac_drawIndy3TextBox();
|
||||||
|
|
||||||
if (_game.version <= 2) {
|
if (_game.version <= 2) {
|
||||||
_talkDelay += _defaultTalkDelay;
|
_talkDelay += _defaultTextSpeed;
|
||||||
VAR(VAR_CHARCOUNT)++;
|
VAR(VAR_CHARCOUNT)++;
|
||||||
} else {
|
} else {
|
||||||
_talkDelay += (int)VAR(VAR_CHARINC);
|
_talkDelay += (int)VAR(VAR_CHARINC);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue