diff options
author | Max Horn | 2002-05-11 14:55:03 +0000 |
---|---|---|
committer | Max Horn | 2002-05-11 14:55:03 +0000 |
commit | c2b26a45907040bdbd717e05b52d18d293db7f75 (patch) | |
tree | 8870bd098ca6c8882d7906d0ef08cb688f90304a | |
parent | 48f4d103e0fa8e3aeaf56a430e87fc82d3a1593a (diff) | |
download | scummvm-rg350-c2b26a45907040bdbd717e05b52d18d293db7f75.tar.gz scummvm-rg350-c2b26a45907040bdbd717e05b52d18d293db7f75.tar.bz2 scummvm-rg350-c2b26a45907040bdbd717e05b52d18d293db7f75.zip |
once more changed the face direction calculation; allows to remove MI2 bridge hack in script_v1.cpp
svn-id: r4277
-rw-r--r-- | actor.cpp | 29 | ||||
-rw-r--r-- | script_v1.cpp | 8 |
2 files changed, 20 insertions, 17 deletions
@@ -175,7 +175,8 @@ int Scumm::remapDirection(Actor * a, int dir) { int specdir; byte flags; - byte dirflag; + bool flipX; + bool flipY; if (!a->ignoreBoxes) { specdir = _extraBoxFlags[a->walkbox]; @@ -189,24 +190,32 @@ int Scumm::remapDirection(Actor * a, int dir) flags = getBoxFlags(a->walkbox); - dirflag = ((a->walkdata.XYFactor > 0) ? 1 : 0) | - ((a->walkdata.YXFactor > 0) ? 2 : 0); + flipX = (a->walkdata.XYFactor > 0); + flipY = (a->walkdata.YXFactor > 0); - if ((flags & 8) || getClass(a->number, 0x1E)) { + // Check for X-Flip + if ((flags & 0x08) || getClass(a->number, 0x1E)) { dir = 360 - dir; - dirflag ^= 1; + flipX = !flipX; } + // Check for Y-Flip if ((flags & 0x10) || getClass(a->number, 0x1D)) { dir = 180 - dir; - dirflag ^= 2; + flipY = !flipY; } switch (flags & 7) { case 1: - return (dirflag & 1) ? 90 : 270; + if (a->moving&~MF_TURN) // Actor is walking + return flipX ? 90 : 270; + else // Actor is standing/turning + return (dir == 90) ? 90 : 270; case 2: - return (dirflag & 2) ? 180 : 0; + if (a->moving&~MF_TURN) // Actor is walking + return flipY ? 180 : 0; + else // Actor is standing/turning + return (dir == 0) ? 0 : 180; case 3: return 270; case 4: @@ -253,7 +262,9 @@ int Scumm::updateActorDirection(Actor * a) } else from = to; - return fromSimpleDir(dirType, from & (num - 1)); + dir = fromSimpleDir(dirType, from & (num - 1)); + + return dir; } void Scumm::setActorBox(Actor * a, int box) diff --git a/script_v1.cpp b/script_v1.cpp index fdb2d3106c..90e26b8117 100644 --- a/script_v1.cpp +++ b/script_v1.cpp @@ -980,14 +980,6 @@ void Scumm::o5_cutscene() void Scumm::o5_endCutscene() { - // FIXME MI2: wrong direction/levitation of G. on the bridge - if ((_gameId == GID_MONKEY2) && (_currentRoom == 7) && - (vm.slot[_currentScript].number == 203)) { - Actor *a = derefActor(1); - if (a->x == 571) - a->facing = 90; - } - endCutscene(); } |