aboutsummaryrefslogtreecommitdiff
path: root/scumm/script_v7he.cpp
diff options
context:
space:
mode:
authorTravis Howell2005-03-28 10:02:22 +0000
committerTravis Howell2005-03-28 10:02:22 +0000
commit11e1e246cc4022f088a9e68bcd4d44f7d6574932 (patch)
treec3cd310936a0d650401849c5230fd9190fa0d83d /scumm/script_v7he.cpp
parent26f41248737a056b5cf9efbaf7aae1873bb24166 (diff)
downloadscummvm-rg350-11e1e246cc4022f088a9e68bcd4d44f7d6574932.tar.gz
scummvm-rg350-11e1e246cc4022f088a9e68bcd4d44f7d6574932.tar.bz2
scummvm-rg350-11e1e246cc4022f088a9e68bcd4d44f7d6574932.zip
findObject in HE72+ only checks object bounds
findObject in He70/71 only needs additional polygon check svn-id: r17270
Diffstat (limited to 'scumm/script_v7he.cpp')
-rw-r--r--scumm/script_v7he.cpp65
1 files changed, 1 insertions, 64 deletions
diff --git a/scumm/script_v7he.cpp b/scumm/script_v7he.cpp
index 488c204ec6..a2210ae399 100644
--- a/scumm/script_v7he.cpp
+++ b/scumm/script_v7he.cpp
@@ -242,7 +242,7 @@ void ScummEngine_v70he::setupOpcodes() {
OPCODE(o6_verbOps),
OPCODE(o6_getActorFromXY),
/* A0 */
- OPCODE(o70_findObject),
+ OPCODE(o6_findObject),
OPCODE(o6_pseudoRoom),
OPCODE(o6_getActorElevation),
OPCODE(o6_getVerbEntrypoint),
@@ -425,62 +425,6 @@ void ScummEngine_v70he::appendSubstring(int dst, int src, int srcOffs, int len)
writeArray(0, 0, dstOffs + i, 0);
}
-int ScummEngine_v70he::findObject(int x, int y, int num, int *args) {
- int i, b, result;
- int cond, cls, tmp;
- byte a;
- const int mask = 0xF;
-
- for (i = 1; i < _numLocalObjects; i++) {
- result = 0;
- if ((_objs[i].obj_nr < 1) || getClass(_objs[i].obj_nr, kObjectClassUntouchable))
- continue;
-
- // Check polygon bounds
- if (_wiz.polygonDefined(_objs[i].obj_nr)) {
- if (_wiz.polygonHit(_objs[i].obj_nr, x, y) != 0)
- result = _objs[i].obj_nr;
- else if (VAR_POLYGONS_ONLY != 0xFF && VAR(VAR_POLYGONS_ONLY))
- continue;
- }
-
- if (!result) {
- // Check object bounds
- b = i;
- do {
- a = _objs[b].parentstate;
- b = _objs[b].parent;
- if (b == 0) {
- if (_objs[i].x_pos <= x && _objs[i].width + _objs[i].x_pos > x &&
- _objs[i].y_pos <= y && _objs[i].height + _objs[i].y_pos > y)
- result = _objs[i].obj_nr;
- break;
- }
- } while ((_objs[b].state & mask) == a);
- }
-
- if (result) {
- if (!num)
- return result;
-
- // Check object class
- 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)
- return result;
- }
- }
-
- return 0;
-}
-
void ScummEngine_v70he::o70_startSound() {
byte subOp = fetchScriptByte();
@@ -697,13 +641,6 @@ void ScummEngine_v70he::o70_resourceRoutines() {
}
}
-void ScummEngine_v70he::o70_findObject() {
- int y = pop();
- int x = pop();
- int r = findObject(x, y, 0, 0);
- push(r);
-}
-
void ScummEngine_v70he::o70_quitPauseRestart() {
byte subOp = fetchScriptByte();
int par1;