aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2006-12-25 17:21:54 +0000
committerMax Horn2006-12-25 17:21:54 +0000
commitae4ea4d98944b9add05fac5f0efb053657fe82c3 (patch)
treea0814b59c36a221cd445f925794f3c034cc8485c
parentba991e3b3ac520dad1d2eeed05c890bfe058c506 (diff)
downloadscummvm-rg350-ae4ea4d98944b9add05fac5f0efb053657fe82c3.tar.gz
scummvm-rg350-ae4ea4d98944b9add05fac5f0efb053657fe82c3.tar.bz2
scummvm-rg350-ae4ea4d98944b9add05fac5f0efb053657fe82c3.zip
Introduced ActorOldWalk subclass of Actor (for V1-V3 walk code)
svn-id: r24924
-rw-r--r--engines/scumm/actor.cpp11
-rw-r--r--engines/scumm/actor.h16
-rw-r--r--engines/scumm/boxes.cpp2
-rw-r--r--engines/scumm/scumm.cpp2
4 files changed, 18 insertions, 13 deletions
diff --git a/engines/scumm/actor.cpp b/engines/scumm/actor.cpp
index 1d3d92eece..f8e46b335d 100644
--- a/engines/scumm/actor.cpp
+++ b/engines/scumm/actor.cpp
@@ -207,14 +207,9 @@ void Actor::setupActorScale() {
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::walkActorV12() {
}
*/
-void Actor::walkActorOld() {
+void ActorOldWalk::walkActor() {
Common::Point p2, p3; // Gate locations
int new_dir, next_box;
diff --git a/engines/scumm/actor.h b/engines/scumm/actor.h
index 7576b9aa95..fb2e91f779 100644
--- a/engines/scumm/actor.h
+++ b/engines/scumm/actor.h
@@ -211,8 +211,7 @@ public:
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 @@ protected:
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;
diff --git a/engines/scumm/boxes.cpp b/engines/scumm/boxes.cpp
index 22882a82e8..d00e7a8bc0 100644
--- a/engines/scumm/boxes.cpp
+++ b/engines/scumm/boxes.cpp
@@ -1135,7 +1135,7 @@ bool ScummEngine::areBoxesNeighbours(int box1nr, int box2nr) {
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];
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index 672438b344..96675fa9f0 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -1248,6 +1248,8 @@ void ScummEngine::resetScumm() {
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);