aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2006-04-12 03:12:56 +0000
committerEugene Sandulenko2006-04-12 03:12:56 +0000
commit867908399103c884c4b06a4364a8e7105232fce6 (patch)
tree469386226268983175cf5b9f4dd9a24d59619643
parente02625db6aeb9a25cff653d71ecedd13e2c1bb11 (diff)
downloadscummvm-rg350-867908399103c884c4b06a4364a8e7105232fce6.tar.gz
scummvm-rg350-867908399103c884c4b06a4364a8e7105232fce6.tar.bz2
scummvm-rg350-867908399103c884c4b06a4364a8e7105232fce6.zip
cleanup
svn-id: r21819
-rw-r--r--engines/cine/cine.h5
-rw-r--r--engines/cine/object.cpp66
-rw-r--r--engines/cine/script.cpp15
3 files changed, 39 insertions, 47 deletions
diff --git a/engines/cine/cine.h b/engines/cine/cine.h
index b7b9aa8db2..eaba2b5654 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 17b303399b..47fee00b25 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 4232e832c3..f1f82709d8 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);