aboutsummaryrefslogtreecommitdiff
path: root/engines/parallaction/parallaction_br.cpp
diff options
context:
space:
mode:
authorNicola Mettifogo2009-02-24 11:20:45 +0000
committerNicola Mettifogo2009-02-24 11:20:45 +0000
commit6334125d1c0264278f2907d13cff8e6ba418bcc8 (patch)
treeacc886a51380e9b035213456cf74a6ee8d996030 /engines/parallaction/parallaction_br.cpp
parent5dff53a2fa8d2f7314d23e229d3c79aa3c0fc3bc (diff)
downloadscummvm-rg350-6334125d1c0264278f2907d13cff8e6ba418bcc8.tar.gz
scummvm-rg350-6334125d1c0264278f2907d13cff8e6ba418bcc8.tar.bz2
scummvm-rg350-6334125d1c0264278f2907d13cff8e6ba418bcc8.zip
Implemented follower support, except that:
* follower is forgotten when location changes (see freeLocation) * the final walking frame is screwed svn-id: r38838
Diffstat (limited to 'engines/parallaction/parallaction_br.cpp')
-rw-r--r--engines/parallaction/parallaction_br.cpp24
1 files changed, 19 insertions, 5 deletions
diff --git a/engines/parallaction/parallaction_br.cpp b/engines/parallaction/parallaction_br.cpp
index 4cfada2bc7..cb81bf1646 100644
--- a/engines/parallaction/parallaction_br.cpp
+++ b/engines/parallaction/parallaction_br.cpp
@@ -202,6 +202,8 @@ void Parallaction_br::freeLocation(bool removeAll) {
_gfx->freeLocationObjects();
+ // TODO: avoid removing needed animations from 'common.slf'
+ // when cleaning up!!!
_location._animations.remove(_char._ani);
_location.cleanup(removeAll);
_location._animations.push_front(_char._ani);
@@ -261,15 +263,27 @@ void Parallaction_br::changeLocation(char *location) {
// load new location
parseLocation(location);
- setFollower(_followerName);
-
if (_location._startPosition.x != -1000) {
- _char.setFoot(_location._startPosition);
+ _char._ani->setFoot(_location._startPosition);
_char._ani->setF(_location._startFrame);
- _location._startPosition.y = -1000;
- _location._startPosition.x = -1000;
}
+ // re-link the follower animation
+ setFollower(_followerName);
+ if (_follower) {
+ Common::Point p = _location._followerStartPosition;
+ if (p.x == -1000) {
+ _char._ani->getFoot(p);
+ }
+ _follower->setFoot(p);
+ _follower->setF(_location._followerStartFrame);
+ }
+
+ _location._startPosition.x = -1000;
+ _location._startPosition.y = -1000;
+ _location._followerStartPosition.x = -1000;
+ _location._followerStartPosition.y = -1000;
+
// kFlagsRemove is cleared because the character is visible by default.
// Commands can hide the character, anyway.
_char._ani->_flags &= ~kFlagsRemove;