diff --git a/engines/cine/cine.h b/engines/cine/cine.h index b7b9aa8db25..eaba2b5654e 100644 --- a/engines/cine/cine.h +++ b/engines/cine/cine.h @@ -87,6 +87,11 @@ enum { kCineDebugScript = 1 << 0 }; +enum { + kCmpEQ = (1 << 0), + kCmpGT = (1 << 1), + kCmpLT = (1 << 2) +}; extern Common::SaveFileManager *g_saveFileMan; // TEMP diff --git a/engines/cine/object.cpp b/engines/cine/object.cpp index 17b303399b8..47fee00b258 100644 --- a/engines/cine/object.cpp +++ b/engines/cine/object.cpp @@ -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; diff --git a/engines/cine/script.cpp b/engines/cine/script.cpp index 4232e832c3b..f1f82709d82 100644 --- a/engines/cine/script.cpp +++ b/engines/cine/script.cpp @@ -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);