aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2003-03-02 15:51:56 +0000
committerMax Horn2003-03-02 15:51:56 +0000
commitf6bac973f86ea3cf9f756cef7602a1decfc80d6b (patch)
tree765915eba45e7ed1cbb9a96efcfda618b64a6121
parent73fa5d7b3ab79b450ecd30a19ef8d29b5ccaf617 (diff)
downloadscummvm-rg350-f6bac973f86ea3cf9f756cef7602a1decfc80d6b.tar.gz
scummvm-rg350-f6bac973f86ea3cf9f756cef7602a1decfc80d6b.tar.bz2
scummvm-rg350-f6bac973f86ea3cf9f756cef7602a1decfc80d6b.zip
patch #696030: CMI: More actor direction fixes
svn-id: r6662
-rw-r--r--scumm/actor.cpp2
-rw-r--r--scumm/object.cpp5
2 files changed, 4 insertions, 3 deletions
diff --git a/scumm/actor.cpp b/scumm/actor.cpp
index e2ab510cf3..3556019d5b 100644
--- a/scumm/actor.cpp
+++ b/scumm/actor.cpp
@@ -112,7 +112,7 @@ void Actor::setActorWalkSpeed(uint newSpeedX, uint newSpeedY)
int Scumm::getAngleFromPos(int x, int y)
{
- if (_gameId == GID_DIG) {
+ if (_gameId == GID_DIG || _gameId == GID_CMI) {
double temp = atan2((double)x, (double)-y);
return normalizeAngle((int)(temp * 180 / 3.1415926535));
} else {
diff --git a/scumm/object.cpp b/scumm/object.cpp
index 073f773372..d988b3209b 100644
--- a/scumm/object.cpp
+++ b/scumm/object.cpp
@@ -218,7 +218,7 @@ void Scumm::getObjectXYPos(int object, int &x, int &y, int &dir)
y = od->walk_y;
}
if (_features & GF_AFTER_V8)
- dir = od->actordir;
+ dir = fromSimpleDir(1, od->actordir);
else
dir = oldDirToNewDir(od->actordir & 3);
}
@@ -657,7 +657,8 @@ void Scumm::setupRoomObject(ObjectData *od, byte *room, byte *searchptr)
od->y_pos = (int)READ_LE_UINT32(&imhd->v8.y_pos);
od->width = (uint)READ_LE_UINT32(&imhd->v8.width);
od->height = (uint)READ_LE_UINT32(&imhd->v8.height);
- od->actordir = (byte)READ_LE_UINT32(&imhd->v8.actordir);
+ // HACK: This is done sinec an angle doesn't fit into a byte (360 > 256)
+ od->actordir = toSimpleDir(1, READ_LE_UINT32(&imhd->v8.actordir));
} else if (_features & GF_AFTER_V7) {
od->obj_nr = READ_LE_UINT16(&(cdhd->v7.obj_id));