[Scummvm-cvs-logs] CVS: scummvm/scumm intern.h,2.311,2.312 script_v100he.cpp,2.24,2.25 script_v72he.cpp,2.178,2.179 script_v7he.cpp,2.112,2.113 script_v80he.cpp,2.61,2.62 script_v90he.cpp,2.104,2.105
Travis Howell
kirben at users.sourceforge.net
Sun Oct 17 04:48:05 CEST 2004
Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31043/scumm
Modified Files:
intern.h script_v100he.cpp script_v72he.cpp script_v7he.cpp
script_v80he.cpp script_v90he.cpp
Log Message:
Polygons used by HE71 too.
Index: intern.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/intern.h,v
retrieving revision 2.311
retrieving revision 2.312
diff -u -d -r2.311 -r2.312
--- intern.h 17 Oct 2004 06:32:58 -0000 2.311
+++ intern.h 17 Oct 2004 11:47:12 -0000 2.312
@@ -626,6 +626,7 @@
void arrrays_unk2(int dst, int src, int len2, int len);
+ int findObject(int x, int y, int num, int *args);
void polygonErase(int fromId, int toId);
bool polygonContains(const WizPolygon &pol, int x, int y);
bool polygonDefined(int id);
@@ -638,6 +639,7 @@
void o70_pickupObject();
void o70_getActorRoom();
void o70_resourceRoutines();
+ void o70_findObject();
void o70_quitPauseRestart();
void o70_kernelSetFunctions();
void o70_unknownED();
@@ -720,7 +722,6 @@
void flushWizBuffer();
void captureWizImage(int restype, int resnum, const Common::Rect& r, bool frontBuffer, int compType);
- int findObject(int x, int y, int num, int *args);
virtual void decodeParseString(int a, int b);
void decodeScriptString(byte *dst, bool scriptString = false);
void copyScriptString(byte *dst);
@@ -748,7 +749,6 @@
void o72_roomOps();
void o72_actorOps();
void o72_verbOps();
- void o72_findObject();
void o72_arrayOps();
void o72_dimArray();
void o72_dim2dimArray();
Index: script_v100he.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v100he.cpp,v
retrieving revision 2.24
retrieving revision 2.25
diff -u -d -r2.24 -r2.25
--- script_v100he.cpp 17 Oct 2004 06:32:58 -0000 2.24
+++ script_v100he.cpp 17 Oct 2004 11:47:12 -0000 2.25
@@ -262,7 +262,7 @@
OPCODE(o90_findAllObjectsWithClassOf),
OPCODE(o6_invalid),
OPCODE(o6_findInventory),
- OPCODE(o72_findObject),
+ OPCODE(o70_findObject),
/* B0 */
OPCODE(o72_findObjectWithClassOf),
OPCODE(o70_polygonHit),
Index: script_v72he.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v72he.cpp,v
retrieving revision 2.178
retrieving revision 2.179
diff -u -d -r2.178 -r2.179
--- script_v72he.cpp 17 Oct 2004 06:07:45 -0000 2.178
+++ script_v72he.cpp 17 Oct 2004 11:47:12 -0000 2.179
@@ -245,7 +245,7 @@
OPCODE(o72_verbOps),
OPCODE(o6_getActorFromXY),
/* A0 */
- OPCODE(o72_findObject),
+ OPCODE(o70_findObject),
OPCODE(o6_pseudoRoom),
OPCODE(o6_getActorElevation),
OPCODE(o6_getVerbEntrypoint),
@@ -567,63 +567,6 @@
*dst = 0;
}
-int ScummEngine_v72he::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 (polygonDefined(_objs[i].obj_nr)) {
- if (polygonHit(_objs[i].obj_nr, x, y) != 0)
- result = _objs[i].obj_nr;
- else if (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;
-}
-
const byte *ScummEngine_v72he::findWrappedBlock(uint32 tag, const byte *ptr, int state, bool errorFlag) {
if (READ_UINT32(ptr) == MKID('MULT')) {
const byte *offs, *wrap;
@@ -1574,13 +1517,6 @@
}
}
-void ScummEngine_v72he::o72_findObject() {
- int y = pop();
- int x = pop();
- int r = findObject(x, y, 0, 0);
- push(r);
-}
-
void ScummEngine_v72he::o72_arrayOps() {
byte subOp = fetchScriptByte();
int array = fetchScriptWord();
Index: script_v7he.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v7he.cpp,v
retrieving revision 2.112
retrieving revision 2.113
diff -u -d -r2.112 -r2.113
--- script_v7he.cpp 17 Oct 2004 06:32:58 -0000 2.112
+++ script_v7he.cpp 17 Oct 2004 11:47:12 -0000 2.113
@@ -246,7 +246,7 @@
OPCODE(o6_verbOps),
OPCODE(o6_getActorFromXY),
/* A0 */
- OPCODE(o6_findObject),
+ OPCODE(o70_findObject),
OPCODE(o6_pseudoRoom),
OPCODE(o6_getActorElevation),
OPCODE(o6_getVerbEntrypoint),
@@ -404,6 +404,62 @@
writeArray(0, 0, edi + 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 (polygonDefined(_objs[i].obj_nr)) {
+ if (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();
@@ -617,6 +673,13 @@
}
}
+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;
Index: script_v80he.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v80he.cpp,v
retrieving revision 2.61
retrieving revision 2.62
diff -u -d -r2.61 -r2.62
--- script_v80he.cpp 17 Oct 2004 06:32:58 -0000 2.61
+++ script_v80he.cpp 17 Oct 2004 11:47:12 -0000 2.62
@@ -244,7 +244,7 @@
OPCODE(o6_invalid),
OPCODE(o6_getActorFromXY),
/* A0 */
- OPCODE(o72_findObject),
+ OPCODE(o70_findObject),
OPCODE(o6_pseudoRoom),
OPCODE(o6_getActorElevation),
OPCODE(o6_getVerbEntrypoint),
Index: script_v90he.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v90he.cpp,v
retrieving revision 2.104
retrieving revision 2.105
diff -u -d -r2.104 -r2.105
--- script_v90he.cpp 17 Oct 2004 09:29:52 -0000 2.104
+++ script_v90he.cpp 17 Oct 2004 11:47:12 -0000 2.105
@@ -244,7 +244,7 @@
OPCODE(o90_paletteOps),
OPCODE(o6_getActorFromXY),
/* A0 */
- OPCODE(o72_findObject),
+ OPCODE(o70_findObject),
OPCODE(o6_pseudoRoom),
OPCODE(o6_getActorElevation),
OPCODE(o6_getVerbEntrypoint),
More information about the Scummvm-git-logs
mailing list