diff options
author | Max Horn | 2003-05-08 15:48:50 +0000 |
---|---|---|
committer | Max Horn | 2003-05-08 15:48:50 +0000 |
commit | 98881c3a6a513c27a06e596c29e0b40b355844f6 (patch) | |
tree | a6ddbd3a2e3aa483bae3d82e63fa2ccb6fc40f13 /scumm/string.cpp | |
parent | 6ab104cc3ca433b672318b3e9bde26f7e882940c (diff) | |
download | scummvm-rg350-98881c3a6a513c27a06e596c29e0b40b355844f6.tar.gz scummvm-rg350-98881c3a6a513c27a06e596c29e0b40b355844f6.tar.bz2 scummvm-rg350-98881c3a6a513c27a06e596c29e0b40b355844f6.zip |
init all VAR_* variables to 0xFF; replaced access to _vars in the form _vars[VAR_*] by VARS(VAR_*) which performs a validity checK; renamed _vars to _scummVars to make sure I updated all places; fixed two places where V6 and newer games would access V5 vars (but there are still some left, it seems); checked VAR access for now only generates a warning
svn-id: r7393
Diffstat (limited to 'scumm/string.cpp')
-rw-r--r-- | scumm/string.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/scumm/string.cpp b/scumm/string.cpp index 929468d27b..7c425ba6b7 100644 --- a/scumm/string.cpp +++ b/scumm/string.cpp @@ -49,7 +49,7 @@ void Scumm::unkMessage1() { // and setting VAR_V6_SOUNDMODE beforehand. See patch 609791. // FIXME: There are other VAR_V6_SOUNDMODE states, as // mentioned in the patch. FIXME after iMUSE is done. - if (_gameId != GID_SAMNMAX || (_vars[VAR_V6_SOUNDMODE] != 2)) + if (_gameId != GID_SAMNMAX || (VAR(VAR_V6_SOUNDMODE) != 2)) _sound->talkSound(a, b, 1, -1); } } @@ -66,7 +66,7 @@ void Scumm::unkMessage2() { InfoDialog* dialog = new InfoDialog(_newgui, this, (char*)buf); // FIXME: I know this is the right thing to do for MI1 and MI2. For // all other games it's just a guess. - _vars[VAR_KEYPRESS] = runDialog (dialog); + VAR(VAR_KEYPRESS) = runDialog (dialog); delete dialog; _messagePtr = tmp; @@ -89,24 +89,24 @@ void Scumm::CHARSET_1() { // 'secret room while walking' hang. It doesn't do the camera check // when the talk target isn't an actor. The question is, can we make // this a more general case? Does it really need to be Zak specific? - if (!(_features & GF_AFTER_V7) && !(_gameId==GID_ZAK256 && _vars[VAR_TALK_ACTOR] == 0xFF)) { + if (!(_features & GF_AFTER_V7) && !(_gameId==GID_ZAK256 && VAR(VAR_TALK_ACTOR) == 0xFF)) { if ((camera._dest.x >> 3) != (camera._cur.x >> 3) || camera._cur.x != camera._last.x) return; } a = NULL; - if (_vars[VAR_TALK_ACTOR] != 0xFF) - a = derefActorSafe(_vars[VAR_TALK_ACTOR], "CHARSET_1"); + if (VAR(VAR_TALK_ACTOR) != 0xFF) + a = derefActorSafe(VAR(VAR_TALK_ACTOR), "CHARSET_1"); if (a && _string[0].overhead != 0) { if (!(_features & GF_AFTER_V6)) { _string[0].xpos = a->x - camera._cur.x + (_realWidth / 2); - if (_vars[VAR_V5_TALK_STRING_Y] < 0) { - s = (a->scaley * (int)_vars[VAR_V5_TALK_STRING_Y]) / 0xFF; - _string[0].ypos = ((_vars[VAR_V5_TALK_STRING_Y] - s) >> 1) + s - a->elevation + a->y; + if (VAR(VAR_V5_TALK_STRING_Y) < 0) { + s = (a->scaley * (int)VAR(VAR_V5_TALK_STRING_Y)) / 0xFF; + _string[0].ypos = ((VAR(VAR_V5_TALK_STRING_Y) - s) >> 1) + s - a->elevation + a->y; } else { - _string[0].ypos = (int)_vars[VAR_V5_TALK_STRING_Y]; + _string[0].ypos = (int)VAR(VAR_V5_TALK_STRING_Y); } if (_string[0].ypos < 1) _string[0].ypos = 1; @@ -182,7 +182,7 @@ void Scumm::CHARSET_1() { if (_gameId == GID_LOOM256) { _defaultTalkDelay = 100; - _vars[VAR_CHARINC] = 5; + VAR(VAR_CHARINC) = 5; } _talkDelay = _defaultTalkDelay; @@ -264,7 +264,7 @@ void Scumm::CHARSET_1() { _charset->_nextLeft = _charset->_left; _charset->_nextTop = _charset->_top; - _talkDelay += (int)_vars[VAR_CHARINC]; + _talkDelay += (int)VAR(VAR_CHARINC); continue; } |