diff options
author | Travis Howell | 2005-05-09 02:38:58 +0000 |
---|---|---|
committer | Travis Howell | 2005-05-09 02:38:58 +0000 |
commit | 69d000d2d04bf55b2c13fc9f7cc5b201385fdb87 (patch) | |
tree | f7101a79cf18eff34779f97e596002a45bb5b0d7 /scumm | |
parent | 51b92411e2dade3bcc40b619032a058b25ae3120 (diff) | |
download | scummvm-rg350-69d000d2d04bf55b2c13fc9f7cc5b201385fdb87.tar.gz scummvm-rg350-69d000d2d04bf55b2c13fc9f7cc5b201385fdb87.tar.bz2 scummvm-rg350-69d000d2d04bf55b2c13fc9f7cc5b201385fdb87.zip |
All SCUMM6 games use VAR_SUBTITLES, not VAR_NOSUBTITLES.
Cleanup.
svn-id: r17989
Diffstat (limited to 'scumm')
-rw-r--r-- | scumm/script.cpp | 33 | ||||
-rw-r--r-- | scumm/scumm.cpp | 1 | ||||
-rw-r--r-- | scumm/scumm.h | 1 | ||||
-rw-r--r-- | scumm/vars.cpp | 20 |
4 files changed, 32 insertions, 23 deletions
diff --git a/scumm/script.cpp b/scumm/script.cpp index 809ecea2c4..03ad159690 100644 --- a/scumm/script.cpp +++ b/scumm/script.cpp @@ -505,12 +505,11 @@ int ScummEngine::readVar(uint var) { } } - if (var == VAR_NOSUBTITLES) { - if (_gameId == GID_LOOM256 || _heversion >= 60) - return !ConfMan.getBool("subtitles"); - else if (_gameId == GID_SAMNMAX) - // Used as VAR_SUBTITLES in Sam & Max during Conroy Bumpus song - return ConfMan.getBool("subtitles"); + if (VAR_SUBTITLES != 0xFF && var == VAR_SUBTITLES) { + return ConfMan.getBool("subtitles"); + } + if (VAR_SUBTITLES != 0xFF && var == VAR_NOSUBTITLES) { + return !ConfMan.getBool("subtitles"); } checkRange(_numVariables - 1, 0, var, "Variable %d out of range(r)"); @@ -574,20 +573,24 @@ void ScummEngine::writeVar(uint var, int value) { if (!(var & 0xF000)) { checkRange(_numVariables - 1, 0, var, "Variable %d out of range(w)"); + if (VAR_SUBTITLES != 0xFF && var == VAR_SUBTITLES) { + // Ignore default setting in HE60/61 games + if (_heversion <= 61 && vm.slot[_currentScript].number == 1) + return; + assert(value == 0 || value == 1); + ConfMan.set("subtitles", value); + } + if (VAR_NOSUBTITLES != 0xFF && var == VAR_NOSUBTITLES) { + assert(value == 0 || value == 1); + ConfMan.set("subtitles", !value); + } + if (var == VAR_CHARINC && ConfMan.hasKey("talkspeed")) { uint talkspeed = ConfMan.getInt("talkspeed"); if (talkspeed <= 9) VAR(VAR_CHARINC) = talkspeed; - } else + } else { _scummVars[var] = value; - - // stay in sync with loom cd subtitle var - if ((_gameId == GID_LOOM256 || _heversion >= 60) && var == VAR_NOSUBTITLES) { - assert(value == 0 || value == 1); - if (_heversion <= 61 && vm.slot[_currentScript].number == 1) - value = !ConfMan.getBool("subtitles"); - else - ConfMan.set("subtitles", (value == 0)); } if ((_varwatch == (int)var) || (_varwatch == 0)) { diff --git a/scumm/scumm.cpp b/scumm/scumm.cpp index 20af0cf4ad..ed4a16fa8a 100644 --- a/scumm/scumm.cpp +++ b/scumm/scumm.cpp @@ -1017,6 +1017,7 @@ ScummEngine::ScummEngine(GameDetector *detector, OSystem *syst, const ScummGameS VAR_ROOM_WIDTH = 0xFF; VAR_ROOM_HEIGHT = 0xFF; + VAR_SUBTITLES = 0xFF; VAR_V6_EMSSPACE = 0xFF; VAR_CAMERA_POS_Y = 0xFF; diff --git a/scumm/scumm.h b/scumm/scumm.h index 91fc9b5901..eecec914b8 100644 --- a/scumm/scumm.h +++ b/scumm/scumm.h @@ -1259,6 +1259,7 @@ public: // V6+ byte VAR_ROOM_WIDTH; byte VAR_ROOM_HEIGHT; + byte VAR_SUBTITLES; byte VAR_V6_EMSSPACE; // V7/V8 (=GF_NEW_CAMERA) specific variables diff --git a/scumm/vars.cpp b/scumm/vars.cpp index bf2d5d9692..8911a92e39 100644 --- a/scumm/vars.cpp +++ b/scumm/vars.cpp @@ -88,7 +88,6 @@ void ScummEngine::setupScummVars() { } if (_gameId == GID_LOOM256 || _version >= 5) { - VAR_NOSUBTITLES = 60; VAR_SOUNDPARAM = 64; VAR_SOUNDPARAM2 = 65; VAR_SOUNDPARAM3 = 66; @@ -149,17 +148,27 @@ void ScummEngine_v5::setupScummVars() { VAR_CURRENT_LIGHTS = 9; - if (_version >= 4) + if (_version >= 4) { VAR_V5_TALK_STRING_Y = 54; + } + if (_gameId == GID_LOOM256 || _version >= 5) { + VAR_NOSUBTITLES = 60; + } } void ScummEngine_v6::setupScummVars() { // Many vars are the same as in V5 & V6 games, so just call the inherited method first ScummEngine::setupScummVars(); + if (_heversion == 0) { + VAR_V6_SOUNDMODE = 9; + } + VAR_ROOM_WIDTH = 41; VAR_ROOM_HEIGHT = 54; + VAR_SUBTITLES = 60; + VAR_LEFTBTN_HOLD = 74; VAR_RIGHTBTN_HOLD = 75; @@ -171,10 +180,6 @@ void ScummEngine_v6::setupScummVars() { VAR_V6_EMSSPACE = 76; VAR_RANDOM_NR = 118; - if (_heversion < 70) { - VAR_V6_SOUNDMODE = 9; - } - VAR_TIMEDATE_YEAR = 119; VAR_TIMEDATE_MONTH = 129; VAR_TIMEDATE_DAY = 128; @@ -183,7 +188,6 @@ void ScummEngine_v6::setupScummVars() { // Sam & Max specific VAR_CHARSET_MASK = 123; - } void ScummEngine_v70he::setupScummVars() { @@ -238,7 +242,7 @@ void ScummEngine_v72he::setupScummVars() { VAR_CUTSCENEEXIT_KEY = 44; VAR_TALKSTOP_KEY = 45; VAR_HAVE_MSG = 46; - VAR_NOSUBTITLES = 47; + VAR_SUBTITLES = 47; VAR_CHARINC = 48; VAR_TALK_ACTOR = 49; VAR_LAST_SOUND = 50; |