aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorTorbjörn Andersson2006-04-05 13:06:03 +0000
committerTorbjörn Andersson2006-04-05 13:06:03 +0000
commit48c46eed6b573e7f131795dccc990eafb42d86a2 (patch)
tree3c142ad9f5254d9c8809cba2193f4d4e1b1468d7 /engines
parent58c7f8d6b1f6092e92bd82cf11af28b59d9ee5c2 (diff)
downloadscummvm-rg350-48c46eed6b573e7f131795dccc990eafb42d86a2.tar.gz
scummvm-rg350-48c46eed6b573e7f131795dccc990eafb42d86a2.tar.bz2
scummvm-rg350-48c46eed6b573e7f131795dccc990eafb42d86a2.zip
I don't think assert(0) is a particularly helpful error message...
svn-id: r21630
Diffstat (limited to 'engines')
-rw-r--r--engines/cine/anim.cpp8
-rw-r--r--engines/cine/script.cpp10
-rw-r--r--engines/cine/various.cpp22
3 files changed, 17 insertions, 23 deletions
diff --git a/engines/cine/anim.cpp b/engines/cine/anim.cpp
index 149794d6d2..3f90493a2f 100644
--- a/engines/cine/anim.cpp
+++ b/engines/cine/anim.cpp
@@ -676,7 +676,7 @@ void loadSet(const char *resourceName) {
} else if (header2.type == 5) {
convert8BBP(animDataTable[entry].ptr1, dataPtr, header2.width, header2.height);
} else if (header2.type == 4) {
- assert(0);
+ error("loadSet: header2.type == 4");
} else {
convert8BBP2(animDataTable[entry].ptr1, dataPtr, header2.width, header2.height);
}
@@ -759,7 +759,7 @@ void loadSetAbs(const char *resourceName, uint16 idx) {
} else if (header2.type == 5) {
convert8BBP(animDataTable[entry].ptr1, dataPtr, header2.width, header2.height);
} else if (header2.type == 4) {
- assert(0);
+ error("loadSetAbs: header2.type == 4");
} else {
convert8BBP2(animDataTable[entry].ptr1, dataPtr, header2.width, header2.height);
}
@@ -821,7 +821,7 @@ void loadResource(const char *resourceName) {
return;
}
- assert(0);
+ error("loadResource: Cannot determine type for '%s'", resourceName);
}
void loadAbs(const char *resourceName, uint16 idx) {
@@ -844,7 +844,7 @@ void loadAbs(const char *resourceName, uint16 idx) {
return;
}
- assert(0);
+ error("loadAbs: Cannot determine type for '%s'", resourceName);
}
void loadResourcesFromSave() {
diff --git a/engines/cine/script.cpp b/engines/cine/script.cpp
index 60def8e2e6..e88ef5ea10 100644
--- a/engines/cine/script.cpp
+++ b/engines/cine/script.cpp
@@ -881,7 +881,7 @@ void executeScript(prcLinkedListStruct *scriptElement, uint16 params) {
}
default:
{
- assert(0);
+ error("executeScript: OP_loadVar: Unknown variable type %d", varType);
}
}
} else {
@@ -2570,7 +2570,7 @@ void decompileScript(byte *scriptPtr, int16 *stackPtr, uint16 scriptSize, uint16
} else if (param2 == 5) {
sprintf(lineBuffer, "var[%d]=rand() mod %d\n", param1, param3);
} else {
- assert(0);
+ error("decompileScript: 0x09: param2 = %d", param2);
}
} else {
int16 param3;
@@ -2720,7 +2720,7 @@ void decompileScript(byte *scriptPtr, int16 *stackPtr, uint16 scriptSize, uint16
sprintf(compareString1, "var[%d]", param1);
sprintf(compareString2, "globalVar[%d]", param3);
} else {
- assert(0);
+ error("decompileScript: 0x0E: param2 = %d", param2);
}
} else {
int16 param3;
@@ -3138,7 +3138,7 @@ void decompileScript(byte *scriptPtr, int16 *stackPtr, uint16 scriptSize, uint16
} else if (param2 == 2) {
sprintf(lineBuffer, "globalVar[%d] = globalVar[%d]\n", param1, param3);
} else {
- assert(0);
+ error("decompileScript: 0x52: param2 = %d", param2);
}
} else {
int16 param3;
@@ -3174,7 +3174,7 @@ void decompileScript(byte *scriptPtr, int16 *stackPtr, uint16 scriptSize, uint16
sprintf(compareString1, "globalVar[%d]", param1);
sprintf(compareString2, "globalVar[%d]", param3);
} else {
- assert(0);
+ error("decompileScript: 0x53: param2 = %d", param2);
}
} else {
int16 param3;
diff --git a/engines/cine/various.cpp b/engines/cine/various.cpp
index 50e75c0b98..5b5691e70f 100644
--- a/engines/cine/various.cpp
+++ b/engines/cine/various.cpp
@@ -1446,9 +1446,7 @@ int16 makeMenuChoice(const commandeType commandList[], uint16 height, uint16 X,
} while (!var_A);
- if (needMouseSave) {
- assert(0);
- }
+ assert(!needMouseSave);
var_4 = button;
@@ -1680,9 +1678,7 @@ int16 makeMenuChoice2(const commandeType commandList[], uint16 height, uint16 X,
} while (!var_A);
- if (needMouseSave) {
- assert(0);
- }
+ assert(!needMouseSave);
var_4 = button;
@@ -2828,15 +2824,13 @@ void processSeqListElement(SeqListElement *element) {
param1 = ptr1[1];
param2 = ptr1[2];
- if (element->varC == 255) {
- if (globalVars[VAR_MOUSE_X_POS] || globalVars[VAR_MOUSE_Y_POS]) {
- computeMove1(element, ptr1[4] + x, ptr1[5] + y, param1, param2, globalVars[VAR_MOUSE_X_POS], globalVars[VAR_MOUSE_Y_POS]);
- } else {
- element->var16 = 0;
- element->var14 = 0;
- }
+ assert(element->varC == 255);
+
+ if (globalVars[VAR_MOUSE_X_POS] || globalVars[VAR_MOUSE_Y_POS]) {
+ computeMove1(element, ptr1[4] + x, ptr1[5] + y, param1, param2, globalVars[VAR_MOUSE_X_POS], globalVars[VAR_MOUSE_Y_POS]);
} else {
- assert(0);
+ element->var16 = 0;
+ element->var14 = 0;
}
var_10 = computeMove2(element);