aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm
diff options
context:
space:
mode:
authorTravis Howell2006-06-03 03:51:17 +0000
committerTravis Howell2006-06-03 03:51:17 +0000
commit93a91f9c6d7bbbd2247565cced3f9c7c7f6426dd (patch)
treeb05944c68647f7c2fc046dc6a687329789a34e9a /engines/scumm
parent1c07797c50ad93716bb0ce67cb85edadb1bff312 (diff)
downloadscummvm-rg350-93a91f9c6d7bbbd2247565cced3f9c7c7f6426dd.tar.gz
scummvm-rg350-93a91f9c6d7bbbd2247565cced3f9c7c7f6426dd.tar.bz2
scummvm-rg350-93a91f9c6d7bbbd2247565cced3f9c7c7f6426dd.zip
Update talkspeed config setting, when set by game scripts
svn-id: r22853
Diffstat (limited to 'engines/scumm')
-rw-r--r--engines/scumm/input.cpp2
-rw-r--r--engines/scumm/script.cpp10
-rw-r--r--engines/scumm/script_v8.cpp14
3 files changed, 18 insertions, 8 deletions
diff --git a/engines/scumm/input.cpp b/engines/scumm/input.cpp
index 397ac8bddb..7dfe6fa782 100644
--- a/engines/scumm/input.cpp
+++ b/engines/scumm/input.cpp
@@ -447,7 +447,7 @@ void ScummEngine::processKbd(bool smushMode) {
_defaultTalkDelay = 9 - runDialog(dlg);
// Save the new talkspeed value to ConfMan
- setTalkspeed(9 - _defaultTalkDelay);
+ setTalkspeed(_defaultTalkDelay);
if (VAR_CHARINC != 0xFF)
VAR(VAR_CHARINC) = _defaultTalkDelay;
diff --git a/engines/scumm/script.cpp b/engines/scumm/script.cpp
index 078f213a24..79f083e05e 100644
--- a/engines/scumm/script.cpp
+++ b/engines/scumm/script.cpp
@@ -616,9 +616,13 @@ void ScummEngine::writeVar(uint var, int value) {
ConfMan.setBool("subtitles", !value);
}
- if (var == VAR_CHARINC && ConfMan.hasKey("talkspeed")) {
- _defaultTalkDelay = getTalkspeed();
- VAR(VAR_CHARINC) = _defaultTalkDelay;
+ if (var == VAR_CHARINC) {
+ if (ConfMan.hasKey("talkspeed")) {
+ VAR(VAR_CHARINC) = getTalkspeed();
+ } else {
+ // Save the new talkspeed value to ConfMan
+ setTalkspeed(_defaultTalkDelay);
+ }
} else {
_scummVars[var] = value;
}
diff --git a/engines/scumm/script_v8.cpp b/engines/scumm/script_v8.cpp
index 14e59d42d6..8dae96397d 100644
--- a/engines/scumm/script_v8.cpp
+++ b/engines/scumm/script_v8.cpp
@@ -419,11 +419,17 @@ 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 && ConfMan.hasKey("talkspeed")) {
- _defaultTalkDelay = getTalkspeed();
- VAR(VAR_CHARINC) = _defaultTalkDelay;
- } else
+ if (var == VAR_CHARINC) {
+ if (ConfMan.hasKey("talkspeed")) {
+ _defaultTalkDelay = getTalkspeed();
+ VAR(VAR_CHARINC) = _defaultTalkDelay;
+ } else {
+ // Save the new talkspeed value to ConfMan
+ setTalkspeed(_defaultTalkDelay);
+ }
+ } else {
_scummVars[var] = value;
+ }
if ((_varwatch == (int)var) || (_varwatch == 0)) {
if (vm.slot[_currentScript].number < 100)