mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-27 20:28:27 +00:00
renamed fixActorDirection to setActorDirection; fixed a bug causing wrong actor directions
svn-id: r4260
This commit is contained in:
parent
dc0fef7cc9
commit
8dbcdc661f
15
actor.cpp
15
actor.cpp
@ -424,7 +424,7 @@ void Scumm::startAnimActor(Actor * a, int frame)
|
||||
}
|
||||
}
|
||||
|
||||
void Scumm::fixActorDirection(Actor * a, int direction)
|
||||
void Scumm::setActorDirection(Actor * a, int direction)
|
||||
{
|
||||
uint mask;
|
||||
int i;
|
||||
@ -433,7 +433,9 @@ void Scumm::fixActorDirection(Actor * a, int direction)
|
||||
if (a->facing == direction)
|
||||
return;
|
||||
|
||||
a->facing = direction;
|
||||
// Make sure the direction is between 0 and 359 degree.
|
||||
// We add 360 to be able to cope with negative directions.
|
||||
a->facing = (direction+360) % 360;
|
||||
|
||||
if (a->costume == 0)
|
||||
return;
|
||||
@ -740,12 +742,11 @@ void Scumm::startWalkAnim(Actor * a, int cmd, int angle)
|
||||
} else {
|
||||
switch (cmd) {
|
||||
case 1: /* start walk */
|
||||
//a->facing = angle;
|
||||
fixActorDirection(a, angle);
|
||||
setActorDirection(a, angle);
|
||||
startAnimActor(a, a->walkFrame);
|
||||
break;
|
||||
case 2: /* change dir only */
|
||||
fixActorDirection(a, angle);
|
||||
setActorDirection(a, angle);
|
||||
break;
|
||||
case 3: /* stop walk */
|
||||
turnToDirection(a, angle);
|
||||
@ -775,7 +776,7 @@ void Scumm::walkActor(Actor * a)
|
||||
if (a->moving & 4) {
|
||||
j = updateActorDirection(a);
|
||||
if (a->facing != j)
|
||||
fixActorDirection(a, j);
|
||||
setActorDirection(a, j);
|
||||
else
|
||||
a->moving = 0;
|
||||
return;
|
||||
@ -1361,7 +1362,7 @@ void Scumm::walkActorOld(Actor * a)
|
||||
if (a->moving & 4) {
|
||||
new_dir = updateActorDirection(a);
|
||||
if (a->facing != new_dir) {
|
||||
fixActorDirection(a, new_dir);
|
||||
setActorDirection(a, new_dir);
|
||||
return;
|
||||
}
|
||||
a->moving = 0;
|
||||
|
@ -910,7 +910,7 @@ void Scumm::animateActor(int act, int anim)
|
||||
break;
|
||||
case 3:
|
||||
a->moving &= ~4;
|
||||
fixActorDirection(a, dir);
|
||||
setActorDirection(a, dir);
|
||||
break;
|
||||
case 4:
|
||||
turnToDirection(a, dir);
|
||||
@ -936,7 +936,7 @@ void Scumm::animateActor(int act, int anim)
|
||||
break;
|
||||
case 0x3E:
|
||||
a->moving &= ~4;
|
||||
fixActorDirection(a, oldDirToNewDir(dir));
|
||||
setActorDirection(a, oldDirToNewDir(dir));
|
||||
break;
|
||||
case 0x3D:
|
||||
turnToDirection(a, oldDirToNewDir(dir));
|
||||
|
@ -2040,7 +2040,7 @@ void Scumm::o6_actorSet()
|
||||
break;
|
||||
case 230: /* set direction */
|
||||
a->moving &= ~4;
|
||||
fixActorDirection(a, pop());
|
||||
setActorDirection(a, pop());
|
||||
break;
|
||||
case 231: /* turn to direction */
|
||||
turnToDirection(a, pop());
|
||||
|
2
scumm.h
2
scumm.h
@ -1066,7 +1066,7 @@ public:
|
||||
void startAnimActorEx(Actor *a, int frame, int direction);
|
||||
int getProgrDirChange(Actor *a, int mode);
|
||||
void initActorCostumeData(Actor *a);
|
||||
void fixActorDirection(Actor *a, int direction);
|
||||
void setActorDirection(Actor *a, int direction);
|
||||
|
||||
int getActorXYPos(Actor *a);
|
||||
void adjustActorPos(Actor *a);
|
||||
|
@ -476,7 +476,7 @@ void Scumm::startScene(int room, Actor * a, int objectNr)
|
||||
_currentRoom);
|
||||
getObjectXYPos(objectNr);
|
||||
putActor(a, _xPos, _yPos, _currentRoom);
|
||||
fixActorDirection(a, _dir + 180);
|
||||
setActorDirection(a, _dir + 180);
|
||||
a->moving = 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user