svn-id: r21819
This commit is contained in:
Eugene Sandulenko 2006-04-12 03:12:56 +00:00
parent e02625db6a
commit 8679083991
3 changed files with 39 additions and 47 deletions

View File

@ -87,6 +87,11 @@ enum {
kCineDebugScript = 1 << 0
};
enum {
kCmpEQ = (1 << 0),
kCmpGT = (1 << 1),
kCmpLT = (1 << 2)
};
extern Common::SaveFileManager *g_saveFileMan; // TEMP

View File

@ -306,82 +306,82 @@ void modifyObjectParam(byte objIdx, byte paramIdx, int16 newValue) {
}
}
byte compareObjectParam(byte objIdx, byte param1, int16 param2) {
byte compareObjectParam(byte objIdx, byte type, int16 value) {
byte compareResult = 0;
switch (param1 - 1) {
switch (type - 1) {
case 0:
if (objectTable[objIdx].x == param2) {
compareResult |= 1;
if (objectTable[objIdx].x == value) {
compareResult |= kCmpEQ;
}
if (objectTable[objIdx].x > param2) {
compareResult |= 2;
if (objectTable[objIdx].x > value) {
compareResult |= kCmpGT;
}
if (objectTable[objIdx].x < param2) {
compareResult |= 4;
if (objectTable[objIdx].x < value) {
compareResult |= kCmpLT;
}
break;
case 1:
if (objectTable[objIdx].y == param2) {
compareResult |= 1;
if (objectTable[objIdx].y == value) {
compareResult |= kCmpEQ;
}
if (objectTable[objIdx].y > param2) {
compareResult |= 2;
if (objectTable[objIdx].y > value) {
compareResult |= kCmpGT;
}
if (objectTable[objIdx].y < param2) {
compareResult |= 4;
if (objectTable[objIdx].y < value) {
compareResult |= kCmpLT;
}
break;
case 2:
if (objectTable[objIdx].mask == param2) {
compareResult |= 1;
if (objectTable[objIdx].mask == value) {
compareResult |= kCmpEQ;
}
if (objectTable[objIdx].mask > param2) {
compareResult |= 2;
if (objectTable[objIdx].mask > value) {
compareResult |= kCmpGT;
}
if (objectTable[objIdx].mask < param2) {
compareResult |= 4;
if (objectTable[objIdx].mask < value) {
compareResult |= kCmpLT;
}
break;
case 3:
if (objectTable[objIdx].frame == param2) {
compareResult |= 1;
if (objectTable[objIdx].frame == value) {
compareResult |= kCmpEQ;
}
if (objectTable[objIdx].frame > param2) {
compareResult |= 2;
if (objectTable[objIdx].frame > value) {
compareResult |= kCmpGT;
}
if (objectTable[objIdx].frame < param2) {
compareResult |= 4;
if (objectTable[objIdx].frame < value) {
compareResult |= kCmpLT;
}
break;
case 4:
if (objectTable[objIdx].costume == param2) {
compareResult |= 1;
if (objectTable[objIdx].costume == value) {
compareResult |= kCmpEQ;
}
if (objectTable[objIdx].costume > param2) {
compareResult |= 2;
if (objectTable[objIdx].costume > value) {
compareResult |= kCmpGT;
}
if (objectTable[objIdx].costume < param2) {
compareResult |= 4;
if (objectTable[objIdx].costume < value) {
compareResult |= kCmpLT;
}
break;
default:
error("Unsupported compare type: %d in compareObjectParam", param1 - 1);
error("Unsupported compare type: %d in compareObjectParam", type - 1);
}
return compareResult;

View File

@ -34,12 +34,6 @@
namespace Cine {
enum {
kCmpEQ = (1 << 0),
kCmpGT = (1 << 1),
kCmpLT = (1 << 2)
};
prcLinkedListStruct *_currentScriptElement;
byte *_currentScriptPtr;
uint16 _currentScriptParams;
@ -982,14 +976,7 @@ int16 checkCollision(int16 objIdx, int16 x, int16 y, int16 numZones, int16 zoneI
for (i = 0; i < numZones; i++) {
int16 idx;
// if (gameType == GAME_OS)
{
idx = getZoneFromPositionRaw(page3Raw, lx + i, ly, 320);
}
/* else
* {
* idx = getZoneFromPosition(page3, lx + i, ly, 160);
* } */
idx = getZoneFromPositionRaw(page3Raw, lx + i, ly, 320);
assert(idx >= 0 && idx <= NUM_MAX_ZONE);