[Scummvm-cvs-logs] SF.net SVN: scummvm:[38837] scummvm/trunk/engines/parallaction

peres001 at users.sourceforge.net peres001 at users.sourceforge.net
Tue Feb 24 10:18:21 CET 2009


Revision: 38837
          http://scummvm.svn.sourceforge.net/scummvm/?rev=38837&view=rev
Author:   peres001
Date:     2009-02-24 09:18:20 +0000 (Tue, 24 Feb 2009)

Log Message:
-----------
Added preliminary code for following walker support in BRA.

Modified Paths:
--------------
    scummvm/trunk/engines/parallaction/exec_br.cpp
    scummvm/trunk/engines/parallaction/exec_ns.cpp
    scummvm/trunk/engines/parallaction/input.cpp
    scummvm/trunk/engines/parallaction/parallaction.h
    scummvm/trunk/engines/parallaction/parallaction_br.cpp
    scummvm/trunk/engines/parallaction/parallaction_ns.cpp

Modified: scummvm/trunk/engines/parallaction/exec_br.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/exec_br.cpp	2009-02-24 08:42:46 UTC (rev 38836)
+++ scummvm/trunk/engines/parallaction/exec_br.cpp	2009-02-24 09:18:20 UTC (rev 38837)
@@ -154,7 +154,7 @@
 
 
 DECLARE_COMMAND_OPCODE(move) {
-	_vm->scheduleWalk(_ctxt.cmd->u._move.x, _ctxt.cmd->u._move.y);
+	_vm->scheduleWalk(_ctxt.cmd->u._move.x, _ctxt.cmd->u._move.y, false);
 	suspend();
 }
 
@@ -174,7 +174,11 @@
 
 
 DECLARE_COMMAND_OPCODE(followme) {
-	warning("Parallaction_br::cmdOp_followme not yet implemented");
+	Common::String s(_ctxt.cmd->u._string);
+	if (!s.compareToIgnoreCase("NULL")) {
+		s.clear();
+	}
+	_vm->setFollower(s);
 }
 
 

Modified: scummvm/trunk/engines/parallaction/exec_ns.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/exec_ns.cpp	2009-02-24 08:42:46 UTC (rev 38836)
+++ scummvm/trunk/engines/parallaction/exec_ns.cpp	2009-02-24 09:18:20 UTC (rev 38837)
@@ -175,7 +175,7 @@
 	int16 x = inst->_opA.getValue();
 	int16 y = inst->_opB.getValue();
 
-	_vm->scheduleWalk(x, y);
+	_vm->scheduleWalk(x, y, false);
 }
 
 DECLARE_INSTRUCTION_OPCODE(endscript) {
@@ -286,7 +286,7 @@
 
 
 DECLARE_COMMAND_OPCODE(move) {
-	_vm->scheduleWalk(_ctxt.cmd->u._move.x, _ctxt.cmd->u._move.y);
+	_vm->scheduleWalk(_ctxt.cmd->u._move.x, _ctxt.cmd->u._move.y, false);
 }
 
 

Modified: scummvm/trunk/engines/parallaction/input.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/input.cpp	2009-02-24 08:42:46 UTC (rev 38836)
+++ scummvm/trunk/engines/parallaction/input.cpp	2009-02-24 09:18:20 UTC (rev 38837)
@@ -269,7 +269,7 @@
 void Input::walkTo(const Common::Point &dest) {
 	stopHovering();
 	setArrowCursor();
-	_vm->scheduleWalk(dest.x, dest.y);
+	_vm->scheduleWalk(dest.x, dest.y, true);
 }
 
 bool Input::translateGameInput() {

Modified: scummvm/trunk/engines/parallaction/parallaction.h
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction.h	2009-02-24 08:42:46 UTC (rev 38836)
+++ scummvm/trunk/engines/parallaction/parallaction.h	2009-02-24 09:18:20 UTC (rev 38837)
@@ -367,7 +367,7 @@
 	virtual void runPendingZones() = 0;
 	virtual void cleanupGame() = 0;
 	virtual void updateWalkers() = 0;
-	virtual void scheduleWalk(int16 x, int16 y) = 0;
+	virtual void scheduleWalk(int16 x, int16 y, bool fromUser) = 0;
 	virtual DialogueManager *createDialogueManager(ZonePtr z) = 0;
 };
 
@@ -391,7 +391,7 @@
 	virtual void runPendingZones();
 	virtual void cleanupGame();
 	virtual void updateWalkers();
-	virtual void scheduleWalk(int16 x, int16 y);
+	virtual void scheduleWalk(int16 x, int16 y, bool fromUser);
 
 	virtual DialogueManager *createDialogueManager(ZonePtr z);
 
@@ -490,8 +490,7 @@
 	virtual void runPendingZones();
 	virtual void cleanupGame();
 	virtual void updateWalkers();
-	virtual void scheduleWalk(int16 x, int16 y);
-
+	virtual void scheduleWalk(int16 x, int16 y, bool fromUser);
 	virtual DialogueManager *createDialogueManager(ZonePtr z);
 
 	void setupSubtitles(char *s, char *s2, int y);
@@ -504,6 +503,8 @@
 	int		getCounterValue(const Common::String &name);
 	void	setCounterValue(const Common::String &name, int value);
 
+	void	setFollower(const Common::String &name);
+
 	const char **_audioCommandsNamesRes;
 	static const char *_partNames[];
 	int			_part;
@@ -537,6 +538,8 @@
 	const Callable *_callables;
 	static const Callable _dosCallables[6];
 
+	Common::String		_followerName;
+	AnimationPtr		_follower;
 	PathWalker_BR		*_walker;
 
 	// dos callables

Modified: scummvm/trunk/engines/parallaction/parallaction_br.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction_br.cpp	2009-02-24 08:42:46 UTC (rev 38836)
+++ scummvm/trunk/engines/parallaction/parallaction_br.cpp	2009-02-24 09:18:20 UTC (rev 38837)
@@ -261,6 +261,8 @@
 	// load new location
 	parseLocation(location);
 
+	setFollower(_followerName);
+
 	if (_location._startPosition.x != -1000) {
 		_char.setFoot(_location._startPosition);
 		_char._ani->setF(_location._startFrame);
@@ -401,7 +403,7 @@
 	_walker->walk();
 }
 
-void Parallaction_br::scheduleWalk(int16 x, int16 y) {
+void Parallaction_br::scheduleWalk(int16 x, int16 y, bool fromUser) {
 	AnimationPtr a = _char._ani;
 
 	if ((a->_flags & kFlagsRemove) || (a->_flags & kFlagsActive) == 0) {
@@ -409,13 +411,26 @@
 	}
 
 	_walker->setCharacterPath(a, x, y);
-#if 0
-	if (_follower && _userEvent) {
-		_walker->setFollowerPath(_follower, x, y);
+
+	if (!fromUser) {
+		_walker->stopFollower();
+	} else {
+		if (_follower) {
+			_walker->setFollowerPath(_follower, x, y);
+		}
 	}
-#endif
+
 	_engineFlags |= kEngineWalking;
 }
 
+void Parallaction_br::setFollower(const Common::String &name) {
+	if (name.empty()) {
+		_followerName.clear();
+		_follower.reset();
+	} else {
+		_followerName = name;
+		_follower = _location.findAnimation(name.c_str());
+	}
+}
 
 } // namespace Parallaction

Modified: scummvm/trunk/engines/parallaction/parallaction_ns.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction_ns.cpp	2009-02-24 08:42:46 UTC (rev 38836)
+++ scummvm/trunk/engines/parallaction/parallaction_ns.cpp	2009-02-24 09:18:20 UTC (rev 38837)
@@ -497,7 +497,7 @@
 }
 
 
-void Parallaction_ns::scheduleWalk(int16 x, int16 y) {
+void Parallaction_ns::scheduleWalk(int16 x, int16 y, bool fromUser) {
 	AnimationPtr a = _char._ani;
 
 	if ((a->_flags & kFlagsRemove) || (a->_flags & kFlagsActive) == 0) {


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list