diff options
| -rw-r--r-- | engines/agi/agi.h | 2 | ||||
| -rw-r--r-- | engines/agi/checks.cpp | 2 | ||||
| -rw-r--r-- | engines/agi/cycle.cpp | 10 | ||||
| -rw-r--r-- | engines/agi/motion.cpp | 8 | ||||
| -rw-r--r-- | engines/agi/op_cmd.cpp | 4 | 
5 files changed, 13 insertions, 13 deletions
diff --git a/engines/agi/agi.h b/engines/agi/agi.h index f82e6ae53a..54dcd574d1 100644 --- a/engines/agi/agi.h +++ b/engines/agi/agi.h @@ -441,7 +441,7 @@ struct AgiGame {  	Common::Array<ScriptPos> execStack;  	// internal flags -	int playerControl;		/**< player is in control */ +	bool playerControl;		/**< player is in control */  	int clockEnabled;		/**< clock is on/off */  	int exitAllLogics;	/**< break cycle after new.room */  	bool pictureShown;		/**< show.pic has been issued */ diff --git a/engines/agi/checks.cpp b/engines/agi/checks.cpp index 1fb437b7f4..1734517163 100644 --- a/engines/agi/checks.cpp +++ b/engines/agi/checks.cpp @@ -276,7 +276,7 @@ void AgiEngine::updatePosition() {  				_game.vars[VM_VAR_BORDER_CODE] = screenObj->objectNr;  				_game.vars[VM_VAR_BORDER_TOUCH_OBJECT] = border;  			} -			if (screenObj->motionType == kMotionMoveObj) { // ANGEPASST +			if (screenObj->motionType == kMotionMoveObj) {  				motionMoveObjStop(screenObj);  			}  		} diff --git a/engines/agi/cycle.cpp b/engines/agi/cycle.cpp index 060dcd356c..6b70019082 100644 --- a/engines/agi/cycle.cpp +++ b/engines/agi/cycle.cpp @@ -104,7 +104,7 @@ void AgiEngine::newRoom(int16 newRoomNr) {  			// this was only done in AGI3  			if (screenObjEgo->motionType == kMotionEgo) {  				screenObjEgo->motionType = kMotionNormal; -				_game.vars[VM_VAR_EGO_DIRECTION] = 0; +				setVar(VM_VAR_EGO_DIRECTION, 0);  			}  		} @@ -130,10 +130,10 @@ void AgiEngine::interpretCycle() {  	ScreenObjEntry *screenObjEgo = &_game.screenObjTable[SCREENOBJECTS_EGO_ENTRY];  	int oldSound, oldScore; -	if (_game.playerControl) -		_game.vars[VM_VAR_EGO_DIRECTION] = screenObjEgo->direction; +	if (!_game.playerControl) +		setVar(VM_VAR_EGO_DIRECTION, screenObjEgo->direction);  	else -		screenObjEgo->direction = _game.vars[VM_VAR_EGO_DIRECTION]; +		screenObjEgo->direction = getVar(VM_VAR_EGO_DIRECTION);  	checkAllMotions(); @@ -154,7 +154,7 @@ void AgiEngine::interpretCycle() {  	nonBlockingText_CycleDone();  	resetControllers(); -	screenObjEgo->direction = _game.vars[VM_VAR_EGO_DIRECTION]; +	screenObjEgo->direction = getVar(VM_VAR_EGO_DIRECTION);  	if (_game.vars[VM_VAR_SCORE] != oldScore || getflag(VM_FLAG_SOUND_ON) != oldSound)  		_game._vm->_text->statusDraw(); diff --git a/engines/agi/motion.cpp b/engines/agi/motion.cpp index 3f85059b56..4af8a48518 100644 --- a/engines/agi/motion.cpp +++ b/engines/agi/motion.cpp @@ -58,7 +58,7 @@ void AgiEngine::changePos(ScreenObjEntry *screenObj) {  		screenObj->flags |= fMotion;  		screenObj->direction = 0;  		if (isEgoView(screenObj)) -			_game.vars[VM_VAR_EGO_DIRECTION] = 0; +			setVar(VM_VAR_EGO_DIRECTION, 0);  	}  } @@ -70,7 +70,7 @@ void AgiEngine::motionWander(ScreenObjEntry *screenObj) {  		screenObj->direction = _rnd->getRandomNumber(8);  		if (isEgoView(screenObj)) { -			_game.vars[VM_VAR_EGO_DIRECTION] = screenObj->direction; +			setVar(VM_VAR_EGO_DIRECTION, screenObj->direction);  		}  		while (screenObj->wander_count < 6) { @@ -147,7 +147,7 @@ void AgiEngine::motionMoveObj(ScreenObjEntry *screenObj) {  	// Update V6 if ego  	if (isEgoView(screenObj)) -		_game.vars[VM_VAR_EGO_DIRECTION] = screenObj->direction; +		setVar(VM_VAR_EGO_DIRECTION, screenObj->direction);  	if (screenObj->direction == 0)  		motionMoveObjStop(screenObj); @@ -216,7 +216,7 @@ void AgiEngine::motionMoveObjStop(ScreenObjEntry *screenObj) {  	screenObj->motionType = kMotionNormal;  	if (isEgoView(screenObj)) {  		_game.playerControl = true; -		_game.vars[VM_VAR_EGO_DIRECTION] = 0; +		setVar(VM_VAR_EGO_DIRECTION, 0);  	}  } diff --git a/engines/agi/op_cmd.cpp b/engines/agi/op_cmd.cpp index 00b8dbf8ba..fbabfd3328 100644 --- a/engines/agi/op_cmd.cpp +++ b/engines/agi/op_cmd.cpp @@ -1477,7 +1477,7 @@ void cmdStopMotion(AgiGame *state, uint8 *parameter) {  	screenObj->direction = 0;  	screenObj->motionType = kMotionNormal;  	if (objectNr == 0) {		// ego only -		state->vars[VM_VAR_EGO_DIRECTION] = 0; +		state->_vm->setVar(VM_VAR_EGO_DIRECTION, 0);  		state->playerControl = false;  	}  } @@ -1495,7 +1495,7 @@ void cmdStartMotion(AgiGame *state, uint8 *parameter) {  	screenObj->motionType = kMotionNormal;  	if (objectNr == 0) {		// ego only -		state->vars[VM_VAR_EGO_DIRECTION] = 0; +		state->_vm->setVar(VM_VAR_EGO_DIRECTION, 0);  		state->playerControl = true;  	}  }  | 
