From 6334125d1c0264278f2907d13cff8e6ba418bcc8 Mon Sep 17 00:00:00 2001 From: Nicola Mettifogo Date: Tue, 24 Feb 2009 11:20:45 +0000 Subject: Implemented follower support, except that: * follower is forgotten when location changes (see freeLocation) * the final walking frame is screwed svn-id: r38838 --- engines/parallaction/parallaction_br.cpp | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) (limited to 'engines/parallaction/parallaction_br.cpp') 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; -- cgit v1.2.3