diff options
author | Max Horn | 2003-05-20 16:13:34 +0000 |
---|---|---|
committer | Max Horn | 2003-05-20 16:13:34 +0000 |
commit | 3e3d6f1360332d9bed9fc28a1930b1d033f58138 (patch) | |
tree | 3b47d88a2b63c6ceb723a0208a1651cf3225c1af /scumm | |
parent | 93d29f2f9aa3c951aab75a0ce71af714aebbc54e (diff) | |
download | scummvm-rg350-3e3d6f1360332d9bed9fc28a1930b1d033f58138.tar.gz scummvm-rg350-3e3d6f1360332d9bed9fc28a1930b1d033f58138.tar.bz2 scummvm-rg350-3e3d6f1360332d9bed9fc28a1930b1d033f58138.zip |
renamed o2_matrixOps -> o2_setBoxFlags; V2 'objY' fixes; cleanup
svn-id: r7739
Diffstat (limited to 'scumm')
-rw-r--r-- | scumm/intern.h | 6 | ||||
-rw-r--r-- | scumm/object.cpp | 10 | ||||
-rw-r--r-- | scumm/script_v2.cpp | 27 | ||||
-rw-r--r-- | scumm/script_v5.cpp | 10 |
4 files changed, 28 insertions, 25 deletions
diff --git a/scumm/intern.h b/scumm/intern.h index b2c6ae1a34..b96f894133 100644 --- a/scumm/intern.h +++ b/scumm/intern.h @@ -238,7 +238,7 @@ protected: void o2_getActorX(); void o2_getActorY(); void o2_getBitVar(); - void o2_getObjY(); + void o2_getObjUnknown(); void o2_ifClassOfIs(); void o2_ifNotState01(); void o2_ifNotState02(); @@ -249,7 +249,7 @@ protected: void o2_ifState04(); void o2_ifState08(); void o2_loadRoomWithEgo(); - void o2_matrixOps(); + void o2_setBoxFlags(); void o2_panCameraTo(); void o2_pickupObject(); void o2_putActor(); @@ -262,7 +262,7 @@ protected: void o2_setBitVar(); void o2_setCameraAt(); void o2_setObjectName(); - void o2_setObjY(); + void o2_setObjUnknown(); void o2_setOwnerOf(); void o2_setState01(); void o2_setState02(); diff --git a/scumm/object.cpp b/scumm/object.cpp index d516e5b026..bbaa764cb2 100644 --- a/scumm/object.cpp +++ b/scumm/object.cpp @@ -203,6 +203,9 @@ void Scumm::getObjectXYPos(int object, int &x, int &y, int &dir) { x = od->x_pos + (int16)READ_LE_UINT16(&imhd->old.hotspot[state].x); y = od->y_pos + (int16)READ_LE_UINT16(&imhd->old.hotspot[state].y); } + } else if (_features & GF_AFTER_V2){ + x = od->walk_x * 8; + y = (od->walk_y & 0x1f) * 8; } else { x = od->walk_x; y = od->walk_y; @@ -656,8 +659,11 @@ void Scumm::setupRoomObject(ObjectData *od, byte *room, byte *searchptr) { od->parent = *(ptr + 12); if (_features & GF_AFTER_V2) { - od->walk_x = *(ptr + 13) * 8; - od->walk_y = *(ptr + 14) * 8; + od->walk_x = *(ptr + 13); + // V2 stores an as of now unknown value in the upper 3 bits of the Y coordinate. + // Maybe we shoudl add an entry for it to ObjectData. That would be cleaner, + // but requires us to inc the savegame format version. + od->walk_y = *(ptr + 14); od->actordir = (*(ptr + 15)) & 7; od->height = *(ptr + 15) & 0xf8; } else { diff --git a/scumm/script_v2.cpp b/scumm/script_v2.cpp index c8b5d9e71b..fae2680235 100644 --- a/scumm/script_v2.cpp +++ b/scumm/script_v2.cpp @@ -46,7 +46,7 @@ void Scumm_v2::setupOpcodes() { OPCODE(o5_isNotEqual), OPCODE(o5_faceActor), OPCODE(o2_assignVarWordIndirect), - OPCODE(o2_setObjY), + OPCODE(o2_setObjUnknown), /* 0C */ OPCODE(o2_resourceRoutines), OPCODE(o5_walkActorToActor), @@ -93,7 +93,7 @@ void Scumm_v2::setupOpcodes() { OPCODE(o2_delay), OPCODE(o2_ifNotState04), /* 30 */ - OPCODE(o2_matrixOps), + OPCODE(o2_setBoxFlags), OPCODE(o2_getBitVar), OPCODE(o2_setCameraAt), OPCODE(o2_roomOps), @@ -126,7 +126,7 @@ void Scumm_v2::setupOpcodes() { OPCODE(o5_isEqual), OPCODE(o5_faceActor), OPCODE(o2_chainScript), - OPCODE(o2_setObjY), + OPCODE(o2_setObjUnknown), /* 4C */ OPCODE(o2_waitForSentence), OPCODE(o5_walkActorToActor), @@ -168,7 +168,7 @@ void Scumm_v2::setupOpcodes() { OPCODE(o2_subIndirect), OPCODE(o2_dummy), /* 6C */ - OPCODE(o2_getObjY), + OPCODE(o2_getObjUnknown), OPCODE(o5_putActorInRoom), OPCODE(o2_dummy), OPCODE(o2_ifState04), @@ -206,7 +206,7 @@ void Scumm_v2::setupOpcodes() { OPCODE(o5_isNotEqual), OPCODE(o5_faceActor), OPCODE(o2_assignVarWordIndirect), - OPCODE(o2_setObjY), + OPCODE(o2_setObjUnknown), /* 8C */ OPCODE(o2_resourceRoutines), OPCODE(o5_walkActorToActor), @@ -253,7 +253,7 @@ void Scumm_v2::setupOpcodes() { OPCODE(o2_waitForMessage), OPCODE(o2_ifNotState04), /* B0 */ - OPCODE(o2_matrixOps), + OPCODE(o2_setBoxFlags), OPCODE(o2_getBitVar), OPCODE(o2_setCameraAt), OPCODE(o2_roomOps), @@ -286,7 +286,7 @@ void Scumm_v2::setupOpcodes() { OPCODE(o5_isEqual), OPCODE(o5_faceActor), OPCODE(o2_chainScript), - OPCODE(o2_setObjY), + OPCODE(o2_setObjUnknown), /* CC */ OPCODE(o5_pseudoRoom), OPCODE(o5_walkActorToActor), @@ -328,7 +328,7 @@ void Scumm_v2::setupOpcodes() { OPCODE(o2_subIndirect), OPCODE(o2_dummy), /* EC */ - OPCODE(o2_getObjY), + OPCODE(o2_getObjUnknown), OPCODE(o5_putActorInRoom), OPCODE(o2_dummy), OPCODE(o2_ifState04), @@ -506,17 +506,17 @@ void Scumm_v2::o2_assignVarByte() { setResult(fetchScriptByte()); } -void Scumm_v2::o2_setObjY() { +void Scumm_v2::o2_setObjUnknown() { int obj = getVarOrDirectWord(0x80); - int y = fetchScriptByte(); + int unk = fetchScriptByte(); if (whereIsObject(obj) != WIO_NOT_FOUND) { ObjectData *od = &_objs[getObjectIndex(obj)]; - od->walk_y = (y << 5) | (od->walk_y & 0x1F); + od->walk_y = (unk << 5) | (od->walk_y & 0x1F); } } -void Scumm_v2::o2_getObjY() { +void Scumm_v2::o2_getObjUnknown() { int obj = getVarOrDirectWord(0x80); getResultPos(); @@ -841,6 +841,7 @@ void Scumm_v2::o2_doSentence() { st->verb = a; st->objectA = getVarOrDirectWord(0x40); st->objectB = getVarOrDirectWord(0x20); + st->unk2 = (st->objectB != 0); st->freezeCount = 0; // TODO @@ -1092,7 +1093,7 @@ void Scumm_v2::o2_delay() { o5_breakHere(); } -void Scumm_v2::o2_matrixOps() { +void Scumm_v2::o2_setBoxFlags() { int a, b; a = getVarOrDirectByte(0x80); diff --git a/scumm/script_v5.cpp b/scumm/script_v5.cpp index cd8e8a1bff..3151a7c4d4 100644 --- a/scumm/script_v5.cpp +++ b/scumm/script_v5.cpp @@ -732,7 +732,7 @@ void Scumm_v5::o5_divide() { } void Scumm_v5::o5_doSentence() { - int a, b; + int a; SentenceTab *st; a = getVarOrDirectByte(0x80); @@ -747,12 +747,8 @@ void Scumm_v5::o5_doSentence() { st->verb = a; st->objectA = getVarOrDirectWord(0x40); - b = st->objectB = getVarOrDirectWord(0x20); - if (b == 0) { - st->unk2 = 0; - } else { - st->unk2 = 1; - } + st->objectB = getVarOrDirectWord(0x20); + st->unk2 = (st->objectB != 0); st->freezeCount = 0; } |