[Scummvm-cvs-logs] SF.net SVN: scummvm: [24924] scummvm/trunk/engines/scumm

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Mon Dec 25 18:21:55 CET 2006


Revision: 24924
          http://scummvm.svn.sourceforge.net/scummvm/?rev=24924&view=rev
Author:   fingolfin
Date:     2006-12-25 09:21:54 -0800 (Mon, 25 Dec 2006)

Log Message:
-----------
Introduced ActorOldWalk subclass of Actor (for V1-V3 walk code)

Modified Paths:
--------------
    scummvm/trunk/engines/scumm/actor.cpp
    scummvm/trunk/engines/scumm/actor.h
    scummvm/trunk/engines/scumm/boxes.cpp
    scummvm/trunk/engines/scumm/scumm.cpp

Modified: scummvm/trunk/engines/scumm/actor.cpp
===================================================================
--- scummvm/trunk/engines/scumm/actor.cpp	2006-12-25 15:37:20 UTC (rev 24923)
+++ scummvm/trunk/engines/scumm/actor.cpp	2006-12-25 17:21:54 UTC (rev 24924)
@@ -207,14 +207,9 @@
 
 
 void ScummEngine::walkActors() {
-	int i;
-
-	for (i = 1; i < _numActors; i++) {
+	for (int i = 1; i < _numActors; ++i) {
 		if (_actors[i]->isInCurrentRoom())
-			if (_game.version <= 3)
-				_actors[i]->walkActorOld();
-			else
-				_actors[i]->walkActor();
+			_actors[i]->walkActor();
 	}
 }
 
@@ -576,7 +571,7 @@
 }
 */
 
-void Actor::walkActorOld() {
+void ActorOldWalk::walkActor() {
 	Common::Point p2, p3;	// Gate locations
 	int new_dir, next_box;
 

Modified: scummvm/trunk/engines/scumm/actor.h
===================================================================
--- scummvm/trunk/engines/scumm/actor.h	2006-12-25 15:37:20 UTC (rev 24923)
+++ scummvm/trunk/engines/scumm/actor.h	2006-12-25 17:21:54 UTC (rev 24924)
@@ -211,8 +211,7 @@
 	void setDirection(int direction);
 	void faceToObject(int obj);
 	void turnToDirection(int newdir);
-	void walkActor();
-	void walkActorOld();
+	virtual void walkActor();
 	void drawActorToBackBuf(int x, int y);
 	void drawActorCostume(bool hitTestMode = false);
 	void animateCostume();
@@ -315,16 +314,25 @@
 	bool isPlayer();
 
 	bool findPathTowards(byte box, byte box2, byte box3, Common::Point &foundPath);
+};
+
+class ActorOldWalk : public Actor {
+public:
+	ActorOldWalk(int id) : Actor(id) {}
+
+	virtual void walkActor();
+
+protected:
 	void findPathTowardsOld(byte box, byte box2, byte box3, Common::Point &p2, Common::Point &p3);
 };
 
-class ActorC64 : public Actor {
+class ActorC64 : public ActorOldWalk {
 public:
 	// FIXME: This flag is never saved, which might lead to broken save states.
 	byte _miscflags;
 
 public:
-	ActorC64(int id) : Actor(id) {}
+	ActorC64(int id) : ActorOldWalk(id) {}
 	virtual void initActor(int mode) {
 		if (mode == -1) {
 			_miscflags = 0;

Modified: scummvm/trunk/engines/scumm/boxes.cpp
===================================================================
--- scummvm/trunk/engines/scumm/boxes.cpp	2006-12-25 15:37:20 UTC (rev 24923)
+++ scummvm/trunk/engines/scumm/boxes.cpp	2006-12-25 17:21:54 UTC (rev 24924)
@@ -1135,7 +1135,7 @@
 	return false;
 }
 
-void Actor::findPathTowardsOld(byte box1, byte box2, byte finalBox, Common::Point &p2, Common::Point &p3) {
+void ActorOldWalk::findPathTowardsOld(byte box1, byte box2, byte finalBox, Common::Point &p2, Common::Point &p3) {
 	Common::Point pt;
 	Common::Point gateA[2];
 	Common::Point gateB[2];

Modified: scummvm/trunk/engines/scumm/scumm.cpp
===================================================================
--- scummvm/trunk/engines/scumm/scumm.cpp	2006-12-25 15:37:20 UTC (rev 24923)
+++ scummvm/trunk/engines/scumm/scumm.cpp	2006-12-25 17:21:54 UTC (rev 24924)
@@ -1248,6 +1248,8 @@
 	for (i = 0; i < _numActors; ++i) {
 		if (_game.version == 0)
 			_actors[i] = new ActorC64(i);
+		else if (_game.version <= 3)
+			_actors[i] = new ActorOldWalk(i);
 		else
 			_actors[i] = new Actor(i);
 		_actors[i]->initActor(1);


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