diff options
author | Paul Gilbert | 2007-09-16 08:03:18 +0000 |
---|---|---|
committer | Paul Gilbert | 2007-09-16 08:03:18 +0000 |
commit | e4c51dfe7527f05a169e9df0af036a865336a726 (patch) | |
tree | abdaf506011e68d8314c48b0465f47b3f90943f9 /engines | |
parent | 0a7a1f42838117defd6062ab8aa251a4ba80eab2 (diff) | |
download | scummvm-rg350-e4c51dfe7527f05a169e9df0af036a865336a726.tar.gz scummvm-rg350-e4c51dfe7527f05a169e9df0af036a865336a726.tar.bz2 scummvm-rg350-e4c51dfe7527f05a169e9df0af036a865336a726.zip |
Fix to make characters face upwards initially, and to stand straight when not actively moving
svn-id: r28920
Diffstat (limited to 'engines')
-rw-r--r-- | engines/lure/hotspots.cpp | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/engines/lure/hotspots.cpp b/engines/lure/hotspots.cpp index 65f20ca671..93860bbd3e 100644 --- a/engines/lure/hotspots.cpp +++ b/engines/lure/hotspots.cpp @@ -77,6 +77,12 @@ Hotspot::Hotspot(HotspotData *res): _pathFinder(this) { _tickHandler = HotspotTickHandlers::getHandler(_data->tickProcOffset); _nameBuffer[0] = '\0'; + if (_hotspotId < FIRST_NONCHARACTER_ID) { + // Default characters to facing upwards until they start moving + _direction = UP; + setFrameNumber(_anim->upFrame); + } + _frameCtr = 0; _skipFlag = false; _charRectY = 0; @@ -693,6 +699,8 @@ void Hotspot::updateMovement() { setOccupied(true); } } + + resetDirection(); } void Hotspot::updateMovement2(CharacterMode value) { @@ -1091,6 +1099,29 @@ bool Hotspot::doorCloseCheck(uint16 doorId) { return true; } +void Hotspot::resetDirection() { + uint16 newFrameNumber; + switch (_direction) { + case UP: + newFrameNumber = _anim->upFrame; + break; + case DOWN: + newFrameNumber = _anim->downFrame; + break; + case LEFT: + newFrameNumber = _anim->leftFrame; + break; + case RIGHT: + newFrameNumber = _anim->rightFrame; + break; + default: + // No need to change + return; + } + + setFrameNumber(newFrameNumber); +} + /*-------------------------------------------------------------------------*/ typedef void (Hotspot::*ActionProcPtr)(HotspotData *hotspot); @@ -2389,7 +2420,7 @@ void HotspotTickHandlers::standardCharacterAnimHandler(Hotspot &h) { switch (action) { case NO_ACTION: - h.setCharacterMode(CHARMODE_IDLE); + h.updateMovement2(CHARMODE_IDLE); break; case DISPATCH_ACTION: |