aboutsummaryrefslogtreecommitdiff
path: root/scumm
diff options
context:
space:
mode:
authorJonathan Gray2003-06-12 16:38:43 +0000
committerJonathan Gray2003-06-12 16:38:43 +0000
commitaabfc254c1ad35b796b2780e76280508882df98c (patch)
tree112c9043bf801fe44bfc2a99906b6fca3b8b8a2e /scumm
parent01cb6e2ab9aa8270b7116782898a386f13b67036 (diff)
downloadscummvm-rg350-aabfc254c1ad35b796b2780e76280508882df98c.tar.gz
scummvm-rg350-aabfc254c1ad35b796b2780e76280508882df98c.tar.bz2
scummvm-rg350-aabfc254c1ad35b796b2780e76280508882df98c.zip
rework loom subtitle option handing
svn-id: r8448
Diffstat (limited to 'scumm')
-rw-r--r--scumm/script.cpp8
-rw-r--r--scumm/scumm.h2
-rw-r--r--scumm/scummvm.cpp6
-rw-r--r--scumm/vars.cpp2
4 files changed, 11 insertions, 7 deletions
diff --git a/scumm/script.cpp b/scumm/script.cpp
index eb62fc03a7..705fde679e 100644
--- a/scumm/script.cpp
+++ b/scumm/script.cpp
@@ -475,6 +475,10 @@ int Scumm::readVar(uint var) {
var = 266;
}
#endif
+ if (_gameId == GID_LOOM256 && var == VAR_NOSUBTITLES) {
+ return _noSubtitles;
+ }
+
checkRange(_numVariables - 1, 0, var, "Variable %d out of range(r)");
return _scummVars[var];
}
@@ -529,6 +533,10 @@ void Scumm::writeVar(uint var, int value) {
else
_scummVars[var] = value;
+ // stay in sync with loom cd subtitle var
+ if (_gameId == GID_LOOM256 && var == VAR_NOSUBTITLES && (value == 0 || value == 1))
+ _noSubtitles = value;
+
if ((_varwatch == (int)var) || (_varwatch == 0)) {
if (vm.slot[_currentScript].number < 100)
debug(1, "vars[%d] = %d (via script-%d)", var, value, vm.slot[_currentScript].number);
diff --git a/scumm/scumm.h b/scumm/scumm.h
index 7bde14b1a0..bd36c94966 100644
--- a/scumm/scumm.h
+++ b/scumm/scumm.h
@@ -1144,7 +1144,7 @@ public:
byte VAR_SOUNDRESULT;
byte VAR_TALKSTOP_KEY;
byte VAR_59;
- byte VAR_SUBTITLES;
+ byte VAR_NOSUBTITLES;
byte VAR_SOUNDPARAM;
byte VAR_SOUNDPARAM2;
diff --git a/scumm/scummvm.cpp b/scumm/scummvm.cpp
index 05a027547a..eed7c76e93 100644
--- a/scumm/scummvm.cpp
+++ b/scumm/scummvm.cpp
@@ -480,7 +480,7 @@ Scumm::Scumm (GameDetector *detector, OSystem *syst)
VAR_SOUNDRESULT = 0xFF;
VAR_TALKSTOP_KEY = 0xFF;
VAR_59 = 0xFF;
- VAR_SUBTITLES = 0xFF;
+ VAR_NOSUBTITLES = 0xFF;
VAR_SOUNDPARAM = 0xFF;
VAR_SOUNDPARAM2 = 0xFF;
@@ -2007,10 +2007,6 @@ void Scumm::processKbd() {
VAR(VAR_CHARINC) = _defaultTalkDelay / 20;
} else if (_lastKeyHit == '~' || _lastKeyHit == '#') { // Debug console
g_debugger->attach(this, NULL);
- // F9 toggles subtitles for loomcd
- } else if (_gameId == GID_LOOM256 && _lastKeyHit == 323) {
- _noSubtitles = !_noSubtitles;
- VAR(VAR_SUBTITLES) = !_noSubtitles;
}
_mouseButStat = _lastKeyHit;
diff --git a/scumm/vars.cpp b/scumm/vars.cpp
index 3ab059285e..1aeedad179 100644
--- a/scumm/vars.cpp
+++ b/scumm/vars.cpp
@@ -83,7 +83,7 @@ void Scumm::setupScummVars() {
VAR_SOUNDRESULT = 56;
VAR_TALKSTOP_KEY = 57;
VAR_59 = 59;
- VAR_SUBTITLES = 60; // for loomcd
+ VAR_NOSUBTITLES = 60; // for loomcd
VAR_SOUNDPARAM = 64;
VAR_SOUNDPARAM2 = 65;