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

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Sat Mar 10 14:53:12 CET 2007


Revision: 26057
          http://scummvm.svn.sourceforge.net/scummvm/?rev=26057&view=rev
Author:   fingolfin
Date:     2007-03-10 05:53:11 -0800 (Sat, 10 Mar 2007)

Log Message:
-----------
SCUMM: Renamed ActorOldWalk to Actor_v3, added new subclass Actor_v2

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	2007-03-10 13:39:38 UTC (rev 26056)
+++ scummvm/trunk/engines/scumm/actor.cpp	2007-03-10 13:53:11 UTC (rev 26057)
@@ -87,13 +87,8 @@
 		_costumeNeedsInit = false;
 		_visible = false;
 		_flip = false;
-		if (_vm->_game.version <= 2) {
-			_speedx = 1;
-			_speedy = 1;
-		} else {
-			_speedx = 8;
-			_speedy = 2;
-		}
+		_speedx = 8;
+		_speedy = 2;
 		_frame = 0;
 		_walkbox = 0;
 		_animProgress = 0;
@@ -133,10 +128,7 @@
 
 	stopActorMoving();
 
-	if (_vm->_game.version <= 2)
-		setActorWalkSpeed(1, 1);
-	else
-		setActorWalkSpeed(8, 2);
+	setActorWalkSpeed(8, 2);
 
 	_animSpeed = 0;
 	if (_vm->_game.version >= 6)
@@ -153,19 +145,11 @@
 	_talkPan = 64;
 	_talkVolume = 127;
 
-	if (_vm->_game.version <= 2) {
-		_initFrame = 2;
-		_walkFrame = 0;
-		_standFrame = 1;
-		_talkStartFrame = 5;
-		_talkStopFrame = 4;
-	} else {
-		_initFrame = 1;
-		_walkFrame = 2;
-		_standFrame = 3;
-		_talkStartFrame = 4;
-		_talkStopFrame = 5;
-	}
+	_initFrame = 1;
+	_walkFrame = 2;
+	_standFrame = 3;
+	_talkStartFrame = 4;
+	_talkStopFrame = 5;
 
 	_walkScript = 0;
 	_talkScript = 0;
@@ -177,12 +161,30 @@
 	_vm->_classData[_number] = (_vm->_game.version >= 7) ? _vm->_classData[0] : 0;
 }
 
+void Actor_v2::initActor(int mode) {
+	Actor::initActor(mode);
+
+	if (mode == -1) {
+		_speedx = 1;
+		_speedy = 1;
+	}
+
+	setActorWalkSpeed(1, 1);
+
+	_initFrame = 2;
+	_walkFrame = 0;
+	_standFrame = 1;
+	_talkStartFrame = 5;
+	_talkStopFrame = 4;
+}
+
+
 void Actor::setBox(int box) {
 	_walkbox = box;
 	setupActorScale();
 }
 
-void ActorOldWalk::setupActorScale() {
+void Actor_v3::setupActorScale() {
 	// TODO: The following could probably be removed
 	_scalex = 0xFF;
 	_scaley = 0xFF;
@@ -574,7 +576,7 @@
 }
 */
 
-void ActorOldWalk::walkActor() {
+void Actor_v3::walkActor() {
 	Common::Point p2, p3;	// Gate locations
 	int new_dir, next_box;
 
@@ -2117,12 +2119,13 @@
 }
 
 bool Actor::isPlayer() {
-	if (_vm->_game.version <= 2)
-		return _vm->VAR(42) <= _number && _number <= _vm->VAR(43);
-	else
-		return isInClass(kObjectClassPlayer);
+	return isInClass(kObjectClassPlayer);
 }
 
+bool Actor_v2::isPlayer() {
+	return _vm->VAR(42) <= _number && _number <= _vm->VAR(43);
+}
+
 void Actor::setHEFlag(int bit, int set) {
 	// Note that condition is inverted
 	if (!set) {

Modified: scummvm/trunk/engines/scumm/actor.h
===================================================================
--- scummvm/trunk/engines/scumm/actor.h	2007-03-10 13:39:38 UTC (rev 26056)
+++ scummvm/trunk/engines/scumm/actor.h	2007-03-10 13:53:11 UTC (rev 26057)
@@ -327,14 +327,14 @@
 protected:
 	bool isInClass(int cls);
 
-	bool isPlayer();
+	virtual bool isPlayer();
 
 	bool findPathTowards(byte box, byte box2, byte box3, Common::Point &foundPath);
 };
 
-class ActorOldWalk : public Actor {
+class Actor_v3 : public Actor {
 public:
-	ActorOldWalk(int id) : Actor(id) {}
+	Actor_v3(int id) : Actor(id) {}
 
 	virtual void walkActor();
 
@@ -343,15 +343,26 @@
 	void findPathTowardsOld(byte box, byte box2, byte box3, Common::Point &p2, Common::Point &p3);
 };
 
-class ActorC64 : public ActorOldWalk {
+class Actor_v2 : public Actor_v3 {
 public:
+	Actor_v2(int id) : Actor_v3(id) {}
+
+	virtual void initActor(int mode);
+	//virtual void walkActor();
+
+protected:
+	virtual bool isPlayer();
+};
+
+class ActorC64 : public Actor_v2 {
+public:
 	// FIXME: This flag is never saved, which might lead to broken save states.
 	byte _miscflags;
 
 public:
-	ActorC64(int id) : ActorOldWalk(id) {}
+	ActorC64(int id) : Actor_v2(id) {}
 	virtual void initActor(int mode) {
-		ActorOldWalk::initActor(mode);
+		Actor_v2::initActor(mode);
 		if (mode == -1) {
 			_miscflags = 0;
 		}

Modified: scummvm/trunk/engines/scumm/boxes.cpp
===================================================================
--- scummvm/trunk/engines/scumm/boxes.cpp	2007-03-10 13:39:38 UTC (rev 26056)
+++ scummvm/trunk/engines/scumm/boxes.cpp	2007-03-10 13:53:11 UTC (rev 26057)
@@ -1134,7 +1134,7 @@
 	return false;
 }
 
-void ActorOldWalk::findPathTowardsOld(byte box1, byte box2, byte finalBox, Common::Point &p2, Common::Point &p3) {
+void Actor_v3::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	2007-03-10 13:39:38 UTC (rev 26056)
+++ scummvm/trunk/engines/scumm/scumm.cpp	2007-03-10 13:53:11 UTC (rev 26057)
@@ -1301,12 +1301,13 @@
 	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 if (_game.version <= 2)
+			_actors[i] = new Actor_v2(i);
+		else if (_game.version == 3)
+			_actors[i] = new Actor_v3(i);
 		else
 			_actors[i] = new Actor(i);
 		_actors[i]->initActor(-1);
-		_actors[i]->initActor(1);
 
 		// this is from IDB
 		if ((_game.version <= 1) || (_game.id == GID_MANIAC && (_game.features & GF_DEMO)))


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