[Scummvm-cvs-logs] CVS: scummvm actor.cpp,1.44,1.45
Ludvig Strigeus
strigeus at users.sourceforge.net
Thu Apr 11 07:25:49 CEST 2002
Update of /cvsroot/scummvm/scummvm
In directory usw-pr-cvs1:/tmp/cvs-serv5081
Modified Files:
actor.cpp
Log Message:
moved the dig angle calculation into getAngleFromPos
Index: actor.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/actor.cpp,v
retrieving revision 1.44
retrieving revision 1.45
diff -C2 -d -r1.44 -r1.45
*** actor.cpp 6 Apr 2002 03:43:53 -0000 1.44
--- actor.cpp 11 Apr 2002 14:13:53 -0000 1.45
***************
*** 115,126 ****
int Scumm::getAngleFromPos(int x, int y) {
! if (abs(y)*2 < abs(x)) {
! if (x>0)
! return 90;
! return 270;
} else {
! if (y>0)
! return 180;
! return 0;
}
}
--- 115,131 ----
int Scumm::getAngleFromPos(int x, int y) {
! if (_gameId==GID_DIG) {
! double temp = atan2 (x, -y);
! return normalizeAngle((int)(temp * 1.8e2 / 3.14));
} else {
! if (abs(y)*2 < abs(x)) {
! if (x>0)
! return 90;
! return 270;
! } else {
! if (y>0)
! return 180;
! return 0;
! }
}
}
***************
*** 173,183 ****
a->walkdata.yfrac = 0;
! if(_gameId==GID_DIG) {
! double temp;
! temp = atan2 (XYFactor, -YXFactor);
! a->newDirection = normalizeAngle((int)(temp * 1.8e2 / 3.14));
! } else {
! a->newDirection = getAngleFromPos(XYFactor, YXFactor);
! }
return actorWalkStep(a);
--- 178,182 ----
a->walkdata.yfrac = 0;
! a->newDirection = getAngleFromPos(XYFactor, YXFactor);
return actorWalkStep(a);
***************
*** 499,508 ****
threshold = 30;
! if ((_features & GF_SMALL_HEADER) && (_classData[a->number] & 0x200000))
! return abr;
while(1) {
iterations++;
! if (iterations > 1000) return abr; /* Safety net */
box = getNumBoxes() - 1;
if (box == 0)
--- 498,507 ----
threshold = 30;
! if ((_features & GF_SMALL_HEADER) && (_classData[a->number] & 0x200000))
! return abr;
while(1) {
iterations++;
! if (iterations > 1000) return abr; /* Safety net */
box = getNumBoxes() - 1;
if (box == 0)
***************
*** 512,517 ****
b = 0;
! if(((_features & GF_SMALL_HEADER) && box) || !(_features & GF_SMALL_HEADER))
! for (j=box;j>=firstValidBox;j--) {
flags = getBoxFlags(j);
if (flags&0x80 && (!(flags&0x20) || getClass(a->number, 0x1F)) )
--- 511,516 ----
b = 0;
! if(((_features & GF_SMALL_HEADER) && box) || !(_features & GF_SMALL_HEADER))
! for (j=box;j>=firstValidBox;j--) {
flags = getBoxFlags(j);
if (flags&0x80 && (!(flags&0x20) || getClass(a->number, 0x1F)) )
More information about the Scummvm-git-logs
mailing list