diff options
author | Filippos Karapetis | 2015-10-24 14:43:36 +0300 |
---|---|---|
committer | Filippos Karapetis | 2015-10-24 14:43:36 +0300 |
commit | 86722cc41f17608cd0272496e01239684bc2899f (patch) | |
tree | 5ba9ea25b0988c04466da06ddd787fb6a0675743 /engines/mads | |
parent | 6fc4d504433281f6f378235031378bb4bdf4af00 (diff) | |
download | scummvm-rg350-86722cc41f17608cd0272496e01239684bc2899f.tar.gz scummvm-rg350-86722cc41f17608cd0272496e01239684bc2899f.tar.bz2 scummvm-rg350-86722cc41f17608cd0272496e01239684bc2899f.zip |
MADS: Phantom: Initial implementation of Player::setWalkTrigger()
Diffstat (limited to 'engines/mads')
-rw-r--r-- | engines/mads/player.cpp | 24 | ||||
-rw-r--r-- | engines/mads/player.h | 3 |
2 files changed, 23 insertions, 4 deletions
diff --git a/engines/mads/player.cpp b/engines/mads/player.cpp index 1e9ce7eada..638cc6956d 100644 --- a/engines/mads/player.cpp +++ b/engines/mads/player.cpp @@ -82,7 +82,8 @@ Player::Player(MADSEngine *vm) _forcePrefix = false; _commandsAllowed = false; _enableAtTarget = false; - + _walkTrigger = 0; + Common::fill(&_stopWalkerList[0], &_stopWalkerList[12], 0); Common::fill(&_stopWalkerTrigger[0], &_stopWalkerTrigger[12], 0); Common::fill(&_spriteSetsPresent[0], &_spriteSetsPresent[PLAYER_SPRITES_FILE_COUNT], false); @@ -188,8 +189,10 @@ void Player::changeFacing() { (Facing)_directionListIndexes[_facing + 10]; selectSeries(); - if ((_facing == _turnToFacing) && !_moving) + if ((_facing == _turnToFacing) && !_moving) { updateFrame(); + activateTrigger(); + } _priorTimer += 1; } @@ -280,6 +283,16 @@ void Player::updateFrame() { _forceRefresh = true; } +void Player::activateTrigger() { + // TODO: Finish this! + // TODO: Also sync _walkTrigger, if necessary + + if (_walkTrigger) { + _vm->_game->_trigger = _walkTrigger; + _walkTrigger = 0; + } +} + void Player::update() { Scene &scene = _vm->_game->_scene; @@ -443,10 +456,12 @@ void Player::move() { if (newFacing && _moving) startMovement(); - if (_turnToFacing != _facing) + if (_turnToFacing != _facing) { changeFacing(); - else if (!_moving) + } else if (!_moving) { updateFrame(); + activateTrigger(); + } int velocity = _velocity; if (_scalingVelocity && (_totalDistance > 0)) { @@ -811,6 +826,7 @@ void Player::firstWalk(Common::Point fromPos, Facing fromFacing, Common::Point d } void Player::setWalkTrigger(int val) { + _walkTrigger = val; warning("TODO: Player::setWalkTrigger"); } diff --git a/engines/mads/player.h b/engines/mads/player.h index 96d5aa8256..55000047fb 100644 --- a/engines/mads/player.h +++ b/engines/mads/player.h @@ -95,6 +95,8 @@ private: void startMovement(); void changeFacing(); + + void activateTrigger(); public: MADSAction *_action; @@ -141,6 +143,7 @@ public: int _currentDepth; int _currentScale; Common::String _spritesPrefix; + int _walkTrigger; public: Player(MADSEngine *vm); |