aboutsummaryrefslogtreecommitdiff
path: root/scumm/actor.cpp
diff options
context:
space:
mode:
authorMax Horn2003-05-08 15:48:50 +0000
committerMax Horn2003-05-08 15:48:50 +0000
commit98881c3a6a513c27a06e596c29e0b40b355844f6 (patch)
treea6ddbd3a2e3aa483bae3d82e63fa2ccb6fc40f13 /scumm/actor.cpp
parent6ab104cc3ca433b672318b3e9bde26f7e882940c (diff)
downloadscummvm-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/actor.cpp')
-rw-r--r--scumm/actor.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/scumm/actor.cpp b/scumm/actor.cpp
index 15027e3093..812bb5025e 100644
--- a/scumm/actor.cpp
+++ b/scumm/actor.cpp
@@ -549,7 +549,7 @@ void Actor::setDirection(int direction) {
}
void Actor::putActor(int dstX, int dstY, byte newRoom) {
- if (visible && _vm->_currentRoom != newRoom && _vm->_vars[_vm->VAR_TALK_ACTOR] == number) {
+ if (visible && _vm->_currentRoom != newRoom && _vm->VAR(_vm->VAR_TALK_ACTOR) == number) {
_vm->clearMsgQueue();
}
@@ -559,7 +559,7 @@ void Actor::putActor(int dstX, int dstY, byte newRoom) {
needRedraw = true;
needBgReset = true;
- if (_vm->_vars[_vm->VAR_EGO] == number) {
+ if (_vm->VAR(_vm->VAR_EGO) == number) {
_vm->_egoPositioned = true;
}
@@ -788,14 +788,14 @@ void Scumm::stopTalk() {
_haveMsg = 0;
_talkDelay = 0;
- act = _vars[VAR_TALK_ACTOR];
+ act = VAR(VAR_TALK_ACTOR);
if (act && act < 0x80) {
Actor *a = derefActorSafe(act, "stopTalk");
if ((a->isInCurrentRoom() && _useTalkAnims) || (_features & GF_NEW_COSTUMES)) {
a->startAnimActor(a->talkFrame2);
_useTalkAnims = false;
}
- _vars[VAR_TALK_ACTOR] = 0xFF;
+ VAR(VAR_TALK_ACTOR) = 0xFF;
}
_keepText = false;
restoreCharsetBg();
@@ -1159,7 +1159,7 @@ void Scumm::actorTalk() {
if (_actorToPrintStrFor == 0xFF) {
if (!_keepText)
stopTalk();
- _vars[VAR_TALK_ACTOR] = 0xFF;
+ VAR(VAR_TALK_ACTOR) = 0xFF;
oldact = 0;
} else {
a = derefActorSafe(_actorToPrintStrFor, "actorTalk");
@@ -1168,27 +1168,27 @@ void Scumm::actorTalk() {
} else {
if (!_keepText)
stopTalk();
- _vars[VAR_TALK_ACTOR] = a->number;
+ VAR(VAR_TALK_ACTOR) = a->number;
if (!_string[0].no_talk_anim) {
a->startAnimActor(a->talkFrame1);
_useTalkAnims = true;
}
- oldact = _vars[VAR_TALK_ACTOR];
+ oldact = VAR(VAR_TALK_ACTOR);
}
}
if (oldact >= 0x80)
return;
- if (_vars[VAR_TALK_ACTOR] > 0x7F) {
+ if (VAR(VAR_TALK_ACTOR) > 0x7F) {
_charsetColor = (byte)_string[0].color;
} else {
- a = derefActorSafe(_vars[VAR_TALK_ACTOR], "actorTalk(2)");
+ a = derefActorSafe(VAR(VAR_TALK_ACTOR), "actorTalk(2)");
_charsetColor = a->talkColor;
}
_charsetBufPos = 0;
_talkDelay = 0;
_haveMsg = 0xFF;
- _vars[VAR_HAVE_MSG] = 0xFF;
+ VAR(VAR_HAVE_MSG) = 0xFF;
CHARSET_1();
}