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

svn-id: r24924
This commit is contained in:
Max Horn 2006-12-25 17:21:54 +00:00
parent ba991e3b3a
commit ae4ea4d989
4 changed files with 18 additions and 13 deletions

View file

@ -207,13 +207,8 @@ 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();
}
}
@ -576,7 +571,7 @@ void Actor::walkActorV12() {
}
*/
void Actor::walkActorOld() {
void ActorOldWalk::walkActor() {
Common::Point p2, p3; // Gate locations
int new_dir, next_box;

View file

@ -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;

View file

@ -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];

View file

@ -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);