diff options
author | Eugene Sandulenko | 2004-09-05 22:57:09 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2004-09-05 22:57:09 +0000 |
commit | d21525d7fe93b9b6d15c442a1263149e89eb70bc (patch) | |
tree | 720eb3a1de4c8d6475da1c20f5b88b1aca8749a7 /scumm | |
parent | 2c80f1c4d66eaf5ba0c9537265755fab4112ca3b (diff) | |
download | scummvm-rg350-d21525d7fe93b9b6d15c442a1263149e89eb70bc.tar.gz scummvm-rg350-d21525d7fe93b9b6d15c442a1263149e89eb70bc.tar.bz2 scummvm-rg350-d21525d7fe93b9b6d15c442a1263149e89eb70bc.zip |
Implement roomOp 234
svn-id: r14913
Diffstat (limited to 'scumm')
-rw-r--r-- | scumm/akos.cpp | 2 | ||||
-rw-r--r-- | scumm/intern.h | 1 | ||||
-rw-r--r-- | scumm/script_v6he.cpp | 28 |
3 files changed, 30 insertions, 1 deletions
diff --git a/scumm/akos.cpp b/scumm/akos.cpp index f99181957a..83c409ca90 100644 --- a/scumm/akos.cpp +++ b/scumm/akos.cpp @@ -323,6 +323,7 @@ byte AkosRenderer::drawLimb(const CostumeData &cost, int limb) { break; case 32: // TODO Add codec32 + warning("akos_drawLimb codec32"); result = 1; break; default: @@ -364,6 +365,7 @@ byte AkosRenderer::drawLimb(const CostumeData &cost, int limb) { break; case 32: // TODO Add codec32 + warning("akos_drawLimb: codec32 stub"); result = 1; break; default: diff --git a/scumm/intern.h b/scumm/intern.h index 06d016b1fa..1d5bded97f 100644 --- a/scumm/intern.h +++ b/scumm/intern.h @@ -573,6 +573,7 @@ protected: uint8 virtScreenLoadUnpack(vsUnpackCtx *ctx, byte *data); void seekFilePos(int slot, int offset, int mode); virtual void decodeParseString(int a, int b); + void swapObjects(int object1, int object2); /* Version 6 script opcodes */ void o6_setState(); diff --git a/scumm/script_v6he.cpp b/scumm/script_v6he.cpp index 1b53af05c1..5ff7d026f9 100644 --- a/scumm/script_v6he.cpp +++ b/scumm/script_v6he.cpp @@ -535,7 +535,7 @@ void ScummEngine_v6he::o6_roomOps() { case 234: // HE 7.2 b = pop(); a = pop(); - warning("o6_roomOps: case %d (%d, %d)", op, b, a); + swapObjects(a, b); break; case 236: // HE 7.2 b = pop(); @@ -547,6 +547,32 @@ void ScummEngine_v6he::o6_roomOps() { } } +void ScummEngine_v6he::swapObjects(int object1, int object2) { + int idx1 = -1, idx2 = -1; + + if (_numObjectsInRoom >= 0) { // how could it be negative? + for (int i = 0; i < _numObjectsInRoom; i++) { + if (_objs[i].obj_nr == object1) + idx1 = i; + + if (_objs[i].obj_nr == object2) + idx2 = i; + } + } + + if (idx1 == -1 || idx2 == -1 || idx1 >= idx2) + return; + + stopObjectScript(object1); + stopObjectScript(object2); + + struct ObjectData tmpOd; + + memcpy(&tmpOd, &_objs[idx1], sizeof(tmpOd)); + memcpy(&_objs[idx1], &_objs[idx2], sizeof(tmpOd)); + memcpy(&_objs[idx2], &tmpOd, sizeof(tmpOd)); +} + void ScummEngine_v6he::o6_actorOps() { Actor *a; int i, j, k; |