[Scummvm-cvs-logs] CVS: scummvm/scumm actor.cpp,1.270,1.271
Max Horn
fingolfin at users.sourceforge.net
Sun Aug 22 01:55:01 CEST 2004
Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5978
Modified Files:
actor.cpp
Log Message:
Oops, I didn't mean to check in those actor.cpp changes (thangs Kirben!)
Index: actor.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/actor.cpp,v
retrieving revision 1.270
retrieving revision 1.271
diff -u -d -r1.270 -r1.271
--- actor.cpp 21 Aug 2004 22:33:22 -0000 1.270
+++ actor.cpp 22 Aug 2004 08:53:53 -0000 1.271
@@ -148,12 +148,6 @@
speedx = newSpeedX;
speedy = newSpeedY;
-if (newSpeedX == 10 && newSpeedY == 5) {
- speedx = 5;
- speedy = 5;
-}
-
-
if (moving) {
calcMovementFactor(walkdata.next);
}
@@ -177,15 +171,17 @@
}
int Actor::calcMovementFactor(Common::Point next) {
- int deltaXFactor, deltaYFactor;
+ Common::Point actorPos(_pos);
+ int diffX, diffY;
+ int32 deltaXFactor, deltaYFactor;
- if (_pos == next)
+ if (actorPos == next)
return 0;
- const int diffX = next.x - _pos.x;
- const int diffY = next.y - _pos.y;
-
+ diffX = next.x - actorPos.x;
+ diffY = next.y - actorPos.y;
deltaYFactor = speedy << 16;
+
if (diffY < 0)
deltaYFactor = -deltaYFactor;
@@ -196,7 +192,7 @@
deltaYFactor = 0;
}
- if ((uint) abs(deltaXFactor >> 16) > speedx) {
+ if ((uint) abs((int)(deltaXFactor >> 16)) > speedx) {
deltaXFactor = speedx << 16;
if (diffX < 0)
deltaXFactor = -deltaXFactor;
@@ -209,7 +205,7 @@
}
}
- walkdata.cur = _pos;
+ walkdata.cur = actorPos;
walkdata.next = next;
walkdata.deltaXFactor = deltaXFactor;
walkdata.deltaYFactor = deltaYFactor;
@@ -383,11 +379,8 @@
distX = abs(walkdata.next.x - walkdata.cur.x);
distY = abs(walkdata.next.y - walkdata.cur.y);
-if (number == 6) printf("actorWalkStep: actor %d at (%d,%d); ", number, actorPos.x, actorPos.y);
if (abs(actorPos.x - walkdata.cur.x) >= distX && abs(actorPos.y - walkdata.cur.y) >= distY) {
moving &= ~MF_IN_LEG;
-if (number == 6) printf("MF_IN_LEG: walkdata.cur=(%d,%d), walkdata.next=(%d,%d)\n",
- walkdata.cur.x, walkdata.cur.y, walkdata.next.x, walkdata.next.y);
return 0;
}
@@ -407,11 +400,6 @@
actorPos.y = walkdata.next.y;
}
-if (number == 6) printf("new pos (%d,%d): delta=(%d,%d), delta>>8=(%d,%d)\n",
- actorPos.x, actorPos.y,
- walkdata.deltaXFactor, walkdata.deltaYFactor,
- (walkdata.deltaXFactor >> 8), (walkdata.deltaYFactor >> 8));
-
_pos = actorPos;
return 1;
}
More information about the Scummvm-git-logs
mailing list