diff options
-rw-r--r-- | scumm/intern.h | 2 | ||||
-rw-r--r-- | scumm/script_v90he.cpp | 28 |
2 files changed, 21 insertions, 9 deletions
diff --git a/scumm/intern.h b/scumm/intern.h index cedb918bb1..741980fcf6 100644 --- a/scumm/intern.h +++ b/scumm/intern.h @@ -879,7 +879,7 @@ protected: void o90_mod(); void o90_unknown31(); void o90_unknown32(); - void o90_unknown34(); + void o90_findAllObjectsWithClassOf(); void o90_unknown35(); void o90_unknown36(); void o90_unknown37(); diff --git a/scumm/script_v90he.cpp b/scumm/script_v90he.cpp index 51055bc9bd..b9b0a539c3 100644 --- a/scumm/script_v90he.cpp +++ b/scumm/script_v90he.cpp @@ -109,7 +109,7 @@ void ScummEngine_v90he::setupOpcodes() { OPCODE(o90_unknown32), OPCODE(o6_invalid), /* 34 */ - OPCODE(o90_unknown34), + OPCODE(o90_findAllObjectsWithClassOf), OPCODE(o90_unknown35), OPCODE(o90_unknown36), OPCODE(o90_unknown37), @@ -1065,24 +1065,36 @@ void ScummEngine_v90he::o90_mod() { push(pop() % a); } -void ScummEngine_v90he::o90_unknown34() { - // Incomplete +void ScummEngine_v90he::o90_findAllObjectsWithClassOf() { int args[16]; + int num, cls, tmp; + bool b; + int cond = 1; - getStackList(args, ARRAYSIZE(args)); + num = getStackList(args, ARRAYSIZE(args)); int room = pop(); int i = 1; if (room != _currentRoom) - warning("o72_findAllObjects: current room is not %d", room); + warning("o90_findAllObjectsWithClassOf: current room is not %d", room); writeVar(0, 0); defineArray(0, kDwordArray, 0, 0, 0, _numLocalObjects + 1); - writeArray(0, 0, 0, _numLocalObjects); - + while (i < _numLocalObjects) { - writeArray(0, 0, i, _objs[i].obj_nr); + cond = 1; + tmp = num; + while (--tmp >= 0) { + cls = args[tmp]; + b = getClass(i, cls); + if ((cls & 0x80 && !b) || (!(cls & 0x80) && b)) + cond = 0; + } + + if (cond) + writeArray(0, 0, i, _objs[i].obj_nr); i++; } + writeArray(0, 0, 0, i); push(readVar(0)); } |