Got rid of ASSERT and ASSERT_PTR defines

svn-id: r21412
This commit is contained in:
Eugene Sandulenko 2006-03-23 03:17:47 +00:00
parent 36302c0921
commit fced8df162
11 changed files with 93 additions and 96 deletions

View File

@ -266,7 +266,7 @@ int16 allocFrame2(uint16 width, uint16 height, uint16 type) {
animDataTable[i].ptr1 = (uint8 *)malloc(frameSize);
ASSERT_PTR(animDataTable[i].ptr1);
assert(animDataTable[i].ptr1);
animDataTable[i].width = width;
@ -310,7 +310,7 @@ int16 reserveFrame(uint16 width, uint16 height, uint16 type, uint16 idx) {
animDataTable[i].ptr1 = (uint8 *)malloc(frameSize);
ASSERT_PTR(animDataTable[i].ptr1);
assert(animDataTable[i].ptr1);
animDataTable[i].width = width;
@ -382,7 +382,7 @@ void loadSpl(const char *resourceName) {
entry = allocFrame((uint16) partBuffer[foundFileIdx].unpackedSize, 1, -1);
ASSERT(entry != -1);
assert(entry != -1);
memcpy(animDataTable[entry].ptr1, dataPtr, (uint16) partBuffer[foundFileIdx].unpackedSize);
@ -413,7 +413,7 @@ void loadMsk(const char *resourceName) {
for (i = 0; i < animHeader.numFrames; i++) {
entry = allocFrame(animHeader.frameWidth * 2, animHeader.frameHeight, 1);
ASSERT(entry != -1);
assert(entry != -1);
convertMask(animDataTable[entry].ptr1, ptr, animHeader.frameWidth, animHeader.frameHeight);
ptr += animHeader.frameWidth * animHeader.frameHeight;
@ -454,7 +454,7 @@ void loadAni(const char *resourceName) {
entry = allocFrame(animHeader.frameWidth * 2, animHeader.frameHeight, 0);
ASSERT(entry != -1);
assert(entry != -1);
// special case transparency handling
if (!strcmp(resourceName, "L2202.ANI")) {
@ -616,7 +616,7 @@ void loadSet(const char *resourceName) {
foundFileIdx = findFileInBundle(resourceName);
dataPtr = readBundleFile(foundFileIdx);
ASSERT(!memcmp(dataPtr, "SET", 3));
assert(!memcmp(dataPtr, "SET", 3));
ptr = dataPtr + 4;
@ -659,7 +659,7 @@ void loadSet(const char *resourceName) {
}
}
ASSERT(entry != -1);
assert(entry != -1);
dataPtr = startOfDataPtr + header2.field_0;
@ -673,7 +673,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);
assert(0);
} else {
convert8BBP2(animDataTable[entry].ptr1, dataPtr, header2.width, header2.height);
}
@ -699,7 +699,7 @@ void loadSetAbs(const char *resourceName, uint16 idx) {
foundFileIdx = findFileInBundle(resourceName);
dataPtr = readBundleFile(foundFileIdx);
ASSERT(!memcmp(dataPtr, "SET", 3));
assert(!memcmp(dataPtr, "SET", 3));
ptr = dataPtr + 4;
@ -742,7 +742,7 @@ void loadSetAbs(const char *resourceName, uint16 idx) {
}
}
ASSERT(entry != -1);
assert(entry != -1);
dataPtr = startOfDataPtr + header2.field_0;
@ -756,7 +756,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);
assert(0);
} else {
convert8BBP2(animDataTable[entry].ptr1, dataPtr, header2.width, header2.height);
}
@ -818,7 +818,7 @@ void loadResource(const char *resourceName) {
return;
}
ASSERT(0);
assert(0);
}
void loadAbs(const char *resourceName, uint16 idx) {
@ -841,7 +841,7 @@ void loadAbs(const char *resourceName, uint16 idx) {
return;
}
ASSERT(0);
assert(0);
}
void loadResourcesFromSave() {
@ -934,7 +934,7 @@ void loadResourcesFromSave() {
currentPtr->fileIdx = foundFileIdx;
ASSERT(entry != -1);
assert(entry != -1);
if (isSpl) {
memcpy(animDataTable[entry].ptr1, ptr, fullSize);

View File

@ -53,7 +53,7 @@ uint8 loadCt(const char *ctName) {
} else {
loadRelatedPalette(ctName);
ASSERT(strstr(ctName, ".NEO"));
assert(strstr(ctName, ".NEO"));
memcpy(header, ptr, 32); ptr += 32;

View File

@ -73,9 +73,6 @@ public:
extern char *savePath;
#define ASSERT_PTR assert
#define ASSERT assert
#define BOOT_PRC_NAME "AUTO00.PRC"
enum {

View File

@ -44,7 +44,7 @@ void loadMsg(char *pMsgName) {
messageTable[i].len = 0;
if (messageTable[i].ptr) {
ASSERT_PTR(messageTable[i].ptr);
assert(messageTable[i].ptr);
free(messageTable[i].ptr);
}
@ -58,7 +58,7 @@ void loadMsg(char *pMsgName) {
messageCount = READ_BE_UINT16(ptr); ptr += 2;
ASSERT(messageCount <= NUM_MAX_MESSAGE);
assert(messageCount <= NUM_MAX_MESSAGE);
for (i = 0; i < messageCount; i++) {
messageTable[i].len = READ_BE_UINT16(ptr); ptr += 2;
@ -68,7 +68,7 @@ void loadMsg(char *pMsgName) {
if (messageTable[i].len) {
messageTable[i].ptr = (uint8 *) malloc(messageTable[i].len);
ASSERT_PTR(messageTable[i].ptr);
assert(messageTable[i].ptr);
memcpy(messageTable[i].ptr, ptr, messageTable[i].len);
ptr += messageTable[i].len;

View File

@ -73,7 +73,7 @@ void loadObject(char *pObjectName) {
entrySize = READ_BE_UINT16(ptr); ptr += 2;
ASSERT(numEntry <= NUM_MAX_OBJECT);
assert(numEntry <= NUM_MAX_OBJECT);
for (i = 0; i < numEntry; i++) {
@ -180,7 +180,7 @@ void loadOverlayElement(uint16 objIdx, uint16 param) {
pNewElement = (overlayHeadElement *)malloc(sizeof(overlayHeadElement));
ASSERT_PTR(pNewElement);
assert(pNewElement);
pNewElement->next = tempHead->next;
tempHead->next = pNewElement;
@ -210,7 +210,7 @@ void setupObject(uint8 objIdx, uint16 param1, uint16 param2, uint16 param3, uint
void subObjectParam(uint8 objIdx, uint8 paramIdx, int16 newValue) {
paramIdx--;
ASSERT(paramIdx <= 5);
assert(paramIdx <= 5);
switch (paramIdx) {
case 0:
@ -253,7 +253,7 @@ void subObjectParam(uint8 objIdx, uint8 paramIdx, int16 newValue) {
void addObjectParam(uint8 objIdx, uint8 paramIdx, int16 newValue) {
paramIdx--;
ASSERT(paramIdx <= 5);
assert(paramIdx <= 5);
switch (paramIdx) {
case 0:
@ -296,7 +296,7 @@ void addObjectParam(uint8 objIdx, uint8 paramIdx, int16 newValue) {
void modifyObjectParam(uint8 objIdx, uint8 paramIdx, int16 newValue) {
paramIdx--;
ASSERT(paramIdx <= 5);
assert(paramIdx <= 5);
switch (paramIdx) {
case 0:
@ -436,11 +436,11 @@ uint8 compareObjectParam(uint8 objIdx, uint8 param1, int16 param2) {
}
int16 getObjectParam(uint16 objIdx, uint16 paramIdx) {
ASSERT(objIdx <= NUM_MAX_OBJECT);
assert(objIdx <= NUM_MAX_OBJECT);
paramIdx--;
ASSERT(paramIdx <= 5);
assert(paramIdx <= 5);
switch (paramIdx) {
case 0:

View File

@ -59,13 +59,13 @@ void loadPal(const char *fileName) {
palFileHandle.open(buffer);
ASSERT(palFileHandle.isOpen());
assert(palFileHandle.isOpen());
palEntriesCount = palFileHandle.readUint16LE();
palFileHandle.readUint16LE(); // entry size
palPtr = (PalEntry *)malloc(palEntriesCount * sizeof(PalEntry));
ASSERT_PTR(palPtr);
assert(palPtr);
for (int i = 0; i < palEntriesCount; ++i) {
palFileHandle.read(palPtr[i].name, 10);
palFileHandle.read(palPtr[i].pal1, 16);

View File

@ -51,7 +51,7 @@ void loadPart(const char *partName) {
partFileHandle.open(partName);
ASSERT(partFileHandle.isOpen());
assert(partFileHandle.isOpen());
setMouseCursor(MOUSE_CURSOR_DISK);

View File

@ -46,7 +46,7 @@ void freePrcLinkedList(void) {
while (currentHead) {
prcLinkedListStruct *temp;
ASSERT_PTR(currentHead);
assert(currentHead);
temp = currentHead->next;
@ -63,11 +63,11 @@ void loadPrc(const char *pPrcName) {
uint16 numScripts;
const uint8 *scriptPtr;
ASSERT_PTR(pPrcName);
assert(pPrcName);
for (i = 0; i < NUM_MAX_SCRIPT; i++) {
if (scriptTable[i].ptr) {
ASSERT_PTR(scriptTable[i].ptr);
assert(scriptTable[i].ptr);
free(scriptTable[i].ptr);
scriptTable[i].ptr = NULL;
scriptTable[i].size = 0;
@ -82,13 +82,13 @@ void loadPrc(const char *pPrcName) {
scriptPtr = readFile(pPrcName);
} else {
scriptPtr = readBundleFile(findFileInBundle(pPrcName));
ASSERT_PTR(scriptPtr);
assert(scriptPtr);
}
setMouseCursor(MOUSE_CURSOR_DISK);
numScripts = READ_BE_UINT16(scriptPtr); scriptPtr += 2;
ASSERT(numScripts <= NUM_MAX_SCRIPT);
assert(numScripts <= NUM_MAX_SCRIPT);
for (i = 0; i < numScripts; i++) {
scriptTable[i].size = READ_BE_UINT16(scriptPtr); scriptPtr += 2;
@ -98,7 +98,7 @@ void loadPrc(const char *pPrcName) {
uint16 size = scriptTable[i].size;
if (size) {
scriptTable[i].ptr = (byte *) malloc(size);
ASSERT_PTR(scriptTable[i].ptr);
assert(scriptTable[i].ptr);
memcpy(scriptTable[i].ptr, scriptPtr, size);
scriptPtr += size;
computeScriptStack(scriptTable[i].ptr, scriptTable[i].stack, size);

View File

@ -40,7 +40,7 @@ void releaseObjectScripts(void) {
while (currentHead) {
prcLinkedListStruct *temp;
ASSERT_PTR(currentHead);
assert(currentHead);
temp = currentHead->next;
@ -73,7 +73,7 @@ void loadRel(char *pRelName) {
numEntry = READ_BE_UINT16(ptr); ptr += 2;
ASSERT(numEntry <= NUM_MAX_REL);
assert(numEntry <= NUM_MAX_REL);
for (i = 0; i < numEntry; i++) {
relTable[i].size = READ_BE_UINT16(ptr); ptr += 2;
@ -86,7 +86,7 @@ void loadRel(char *pRelName) {
if (relTable[i].size) {
relTable[i].data = (char *)malloc(relTable[i].size);
ASSERT_PTR(relTable[i].data);
assert(relTable[i].data);
memcpy(relTable[i].data, ptr, relTable[i].size);
ptr += relTable[i].size;

View File

@ -161,8 +161,8 @@ uint16 computeScriptStackSub(uint8 mode, byte *scriptPtr, int16 *stackPtr, uint1
uint16 position;
uint16 di;
ASSERT_PTR(scriptPtr);
ASSERT_PTR(stackPtr);
assert(scriptPtr);
assert(stackPtr);
if (mode == 1) {
for (i = 0; i < SCRIPT_STACK_SIZE; i++) {
@ -442,21 +442,21 @@ void addScriptToList0(uint16 idx) {
prcLinkedListStruct *currentHead = &globalScriptsHead;
prcLinkedListStruct *tempHead = currentHead;
ASSERT(idx <= NUM_MAX_SCRIPT);
assert(idx <= NUM_MAX_SCRIPT);
currentHead = tempHead->next;
while (currentHead) {
tempHead = currentHead;
ASSERT_PTR(tempHead);
assert(tempHead);
currentHead = tempHead->next;
}
pNewElement =(prcLinkedListStruct *)malloc(sizeof(prcLinkedListStruct));
ASSERT_PTR(pNewElement);
assert(pNewElement);
pNewElement->next = tempHead->next;
tempHead->next = pNewElement;
@ -497,7 +497,7 @@ int16 endScript0(uint16 scriptIdx) {
prcLinkedListStruct *currentHead = &globalScriptsHead;
prcLinkedListStruct *tempHead = currentHead;
//ASSERT(scriptIdx <= NUM_MAX_SCRIPT);
//assert(scriptIdx <= NUM_MAX_SCRIPT);
currentHead = tempHead->next;
@ -585,7 +585,7 @@ int16 checkCollision(int16 objIdx, int16 x, int16 y, int16 numZones, int16 zoneI
* idx = getZoneFromPosition(page3, lx + i, ly, 160);
* } */
ASSERT(idx >= 0 && idx <= NUM_MAX_ZONE);
assert(idx >= 0 && idx <= NUM_MAX_ZONE);
if (zoneData[idx] == zoneIdx) {
return 1;
@ -618,7 +618,7 @@ void executeScript(prcLinkedListStruct *scriptElement, uint16 params) {
uint16 closeScript;
uint16 currentPosition;
ASSERT_PTR(scriptElement);
assert(scriptElement);
if (scriptElement->scriptIdx == -1) {
return;
@ -626,7 +626,7 @@ void executeScript(prcLinkedListStruct *scriptElement, uint16 params) {
currentScriptPtr = scriptElement->scriptPtr;
ASSERT_PTR(currentScriptPtr);
assert(currentScriptPtr);
currentPosition = scriptElement->scriptPosition;
closeScript = 0;
@ -878,7 +878,7 @@ void executeScript(prcLinkedListStruct *scriptElement, uint16 params) {
}
default:
{
ASSERT(0);
assert(0);
}
}
} else {
@ -1047,14 +1047,14 @@ void executeScript(prcLinkedListStruct *scriptElement, uint16 params) {
if (varType == 1) {
DEBUG_SCRIPT(currentLine, "compare var[%d] and var[%d]", varIdx, value);
ASSERT(varIdx < 50);
ASSERT(value < 50);
assert(varIdx < 50);
assert(value < 50);
scriptElement->compareResult = compareVars(scriptElement->localVars[varIdx], scriptElement->localVars[value]);
} else if (varType == 2) {
DEBUG_SCRIPT(currentLine, "compare var[%d] and globalVar[%d]", varIdx, value);
ASSERT(varIdx < 50);
assert(varIdx < 50);
scriptElement->compareResult = compareVars(scriptElement->localVars[varIdx], globalVars[value]);
}
@ -1224,7 +1224,7 @@ void executeScript(prcLinkedListStruct *scriptElement, uint16 params) {
DEBUG_SCRIPT(currentLine, "goto label(%d)", labelIdx);
ASSERT(scriptElement->stack[labelIdx] != -1);
assert(scriptElement->stack[labelIdx] != -1);
currentPosition = scriptElement->stack[labelIdx];
break;
@ -1238,7 +1238,7 @@ void executeScript(prcLinkedListStruct *scriptElement, uint16 params) {
if ((scriptElement->compareResult & 2) && !(scriptElement->compareResult & 1)) {
DEBUG_SCRIPT(currentLine, "if(>) goto %d (true)", labelIdx);
ASSERT(scriptElement->stack[labelIdx] != -1);
assert(scriptElement->stack[labelIdx] != -1);
currentPosition = scriptElement->stack[labelIdx];
} else {
DEBUG_SCRIPT(currentLine, "if(>) goto %d (false)", labelIdx);
@ -1255,7 +1255,7 @@ void executeScript(prcLinkedListStruct *scriptElement, uint16 params) {
if (scriptElement->compareResult & 2 || scriptElement->compareResult & 1) {
DEBUG_SCRIPT(currentLine, "if(>=) goto %d (true)", labelIdx);
ASSERT(scriptElement->stack[labelIdx] != -1);
assert(scriptElement->stack[labelIdx] != -1);
currentPosition = scriptElement->stack[labelIdx];
} else {
DEBUG_SCRIPT(currentLine, "if(>=) goto %d (false)",
@ -1273,7 +1273,7 @@ void executeScript(prcLinkedListStruct *scriptElement, uint16 params) {
if ((scriptElement->compareResult & 4) && !(scriptElement->compareResult & 1)) {
DEBUG_SCRIPT(currentLine, "if(<) goto %d (true)", labelIdx);
ASSERT(scriptElement->stack[labelIdx] != -1);
assert(scriptElement->stack[labelIdx] != -1);
currentPosition = scriptElement->stack[labelIdx];
} else {
DEBUG_SCRIPT(currentLine, "if(<) goto %d (false)", labelIdx);
@ -1290,7 +1290,7 @@ void executeScript(prcLinkedListStruct *scriptElement, uint16 params) {
if ((scriptElement->compareResult & 4) || (scriptElement->compareResult & 1)) {
DEBUG_SCRIPT(currentLine, "if(<=) goto %d (true)", labelIdx);
ASSERT(scriptElement->stack[labelIdx] != -1);
assert(scriptElement->stack[labelIdx] != -1);
currentPosition = scriptElement->stack[labelIdx];
} else {
DEBUG_SCRIPT(currentLine, "if(<=) goto %d (false)", labelIdx);
@ -1307,7 +1307,7 @@ void executeScript(prcLinkedListStruct *scriptElement, uint16 params) {
if (scriptElement->compareResult & 1) {
DEBUG_SCRIPT(currentLine, "if(==) goto %d (true)", labelIdx);
ASSERT(scriptElement->stack[labelIdx] != -1);
assert(scriptElement->stack[labelIdx] != -1);
currentPosition = scriptElement->stack[labelIdx];
} else {
DEBUG_SCRIPT(currentLine, "if(==) goto %d (false)", labelIdx);
@ -1324,7 +1324,7 @@ void executeScript(prcLinkedListStruct *scriptElement, uint16 params) {
if (!(scriptElement->compareResult & 1)) {
DEBUG_SCRIPT(currentLine, "if(!=) goto %d (true)", labelIdx);
ASSERT(scriptElement->stack[labelIdx] != -1);
assert(scriptElement->stack[labelIdx] != -1);
currentPosition = scriptElement->stack[labelIdx];
} else {
DEBUG_SCRIPT(currentLine, "if(!=) goto %d (false)", labelIdx);
@ -1347,7 +1347,7 @@ void executeScript(prcLinkedListStruct *scriptElement, uint16 params) {
if (scriptElement->localVars[varIdx] >= 0) {
DEBUG_SCRIPT(currentLine, "loop(var[%]) goto %d (continue)", varIdx, labelIdx);
ASSERT(scriptElement->stack[labelIdx] != -1);
assert(scriptElement->stack[labelIdx] != -1);
currentPosition = scriptElement->stack[labelIdx];
} else {
DEBUG_SCRIPT(currentLine, "loop(var[%]) goto %d (stop)", varIdx, labelIdx);
@ -1362,7 +1362,7 @@ void executeScript(prcLinkedListStruct *scriptElement, uint16 params) {
param = *(currentScriptPtr + currentPosition);
currentPosition++;
ASSERT(param < NUM_MAX_SCRIPT);
assert(param < NUM_MAX_SCRIPT);
DEBUG_SCRIPT(currentLine, "startScript(%d)", param);
@ -1440,7 +1440,7 @@ void executeScript(prcLinkedListStruct *scriptElement, uint16 params) {
param = *(currentScriptPtr + currentPosition);
currentPosition++;
ASSERT(param <= 3);
assert(param <= 3);
switch (param) {
case 0:
@ -1701,7 +1701,7 @@ void executeScript(prcLinkedListStruct *scriptElement, uint16 params) {
numIdx = *(currentScriptPtr + currentPosition);
currentPosition++;
ASSERT(startIdx + numIdx <= NUM_MAX_ANIMDATA);
assert(startIdx + numIdx <= NUM_MAX_ANIMDATA);
DEBUG_SCRIPT(currentLine, "freePartRange(%d,%d)", startIdx, numIdx);
@ -1974,7 +1974,7 @@ void executeScript(prcLinkedListStruct *scriptElement, uint16 params) {
if ((scriptElement->compareResult & 2)
&& !(scriptElement->compareResult & 1)) {
DEBUG_SCRIPT(currentLine, "if(>) goto nearest %d (true)", labelIdx);
ASSERT(scriptElement->stack[labelIdx] != -1);
assert(scriptElement->stack[labelIdx] != -1);
currentPosition = computeScriptStackFromScript(scriptElement->scriptPtr, currentPosition, labelIdx,
scriptTable[scriptElement->scriptIdx].size);
} else {
@ -1992,7 +1992,7 @@ void executeScript(prcLinkedListStruct *scriptElement, uint16 params) {
if (scriptElement->compareResult & 2 || scriptElement->compareResult & 1) {
DEBUG_SCRIPT(currentLine, "if(>=) goto nearest %d (true)", labelIdx);
ASSERT(scriptElement->stack[labelIdx] != -1);
assert(scriptElement->stack[labelIdx] != -1);
currentPosition = computeScriptStackFromScript(scriptElement->scriptPtr, currentPosition, labelIdx,
scriptTable[scriptElement->scriptIdx].size);
} else {
@ -2010,7 +2010,7 @@ void executeScript(prcLinkedListStruct *scriptElement, uint16 params) {
if ((scriptElement->compareResult & 4) && !(scriptElement->compareResult & 1)) {
DEBUG_SCRIPT(currentLine, "if(<) goto nearest %d (true)", labelIdx);
ASSERT(scriptElement->stack[labelIdx] != -1);
assert(scriptElement->stack[labelIdx] != -1);
currentPosition = computeScriptStackFromScript(scriptElement->scriptPtr,
currentPosition, labelIdx, scriptTable[scriptElement->scriptIdx].size);
} else {
@ -2028,7 +2028,7 @@ void executeScript(prcLinkedListStruct *scriptElement, uint16 params) {
if ((scriptElement->compareResult & 4) || (scriptElement->compareResult & 1)) {
DEBUG_SCRIPT(currentLine, "if(<=) goto nearest %d (true)", labelIdx);
ASSERT(scriptElement->stack[labelIdx] != -1);
assert(scriptElement->stack[labelIdx] != -1);
currentPosition = computeScriptStackFromScript(scriptElement->scriptPtr,
currentPosition, labelIdx, scriptTable[scriptElement->scriptIdx].size);
} else {
@ -2046,7 +2046,7 @@ void executeScript(prcLinkedListStruct *scriptElement, uint16 params) {
if (scriptElement->compareResult & 1) {
DEBUG_SCRIPT(currentLine, "if(==) goto nearest %d (true)", labelIdx);
ASSERT(scriptElement->stack[labelIdx] != -1);
assert(scriptElement->stack[labelIdx] != -1);
currentPosition = computeScriptStackFromScript(scriptElement->scriptPtr,
currentPosition, labelIdx, scriptTable[scriptElement->scriptIdx].size);
} else {
@ -2064,7 +2064,7 @@ void executeScript(prcLinkedListStruct *scriptElement, uint16 params) {
if (!(scriptElement->compareResult & 1)) {
DEBUG_SCRIPT(currentLine, "if(!=) goto nearest %d (true)", labelIdx);
ASSERT(scriptElement->stack[labelIdx] != -1);
assert(scriptElement->stack[labelIdx] != -1);
currentPosition = computeScriptStackFromScript(scriptElement->scriptPtr,
currentPosition, labelIdx, scriptTable[scriptElement->scriptIdx].size);
} else {
@ -2112,7 +2112,7 @@ void executeScript(prcLinkedListStruct *scriptElement, uint16 params) {
DEBUG_SCRIPT(currentLine, "removeBackground(%d)", temp);
ASSERT(temp);
assert(temp);
if (additionalBgTable[temp]) {
free(additionalBgTable[temp]);
additionalBgTable[temp] = NULL;
@ -2150,7 +2150,7 @@ void executeScript(prcLinkedListStruct *scriptElement, uint16 params) {
DEBUG_SCRIPT(currentLine, "useBg(%d)", temp);
ASSERT(temp <= 8);
assert(temp <= 8);
if (additionalBgTable[temp]) {
currentAdditionalBgIdx = temp;
@ -2167,7 +2167,7 @@ void executeScript(prcLinkedListStruct *scriptElement, uint16 params) {
DEBUG_SCRIPT(currentLine, "useBgScroll(%d)", temp);
ASSERT(temp <= 8);
assert(temp <= 8);
if (additionalBgTable[temp]) {
currentAdditionalBgIdx2 = temp;
@ -2328,8 +2328,8 @@ void decompileScript(uint8 *scriptPtr, int16 *stackPtr, uint16 scriptSize, uint1
uint16 exitScript;
uint32 position = 0;
ASSERT_PTR(scriptPtr);
// ASSERT_PTR(stackPtr);
assert(scriptPtr);
// assert(stackPtr);
exitScript = 0;
@ -2567,7 +2567,7 @@ void decompileScript(uint8 *scriptPtr, int16 *stackPtr, uint16 scriptSize, uint1
} else if (param2 == 5) {
sprintf(lineBuffer, "var[%d]=rand() mod %d\n", param1, param3);
} else {
ASSERT(0);
assert(0);
}
} else {
int16 param3;
@ -2717,7 +2717,7 @@ void decompileScript(uint8 *scriptPtr, int16 *stackPtr, uint16 scriptSize, uint1
sprintf(compareString1, "var[%d]", param1);
sprintf(compareString2, "globalVar[%d]", param3);
} else {
ASSERT(0);
assert(0);
}
} else {
int16 param3;
@ -3135,7 +3135,7 @@ void decompileScript(uint8 *scriptPtr, int16 *stackPtr, uint16 scriptSize, uint1
} else if (param2 == 2) {
sprintf(lineBuffer, "globalVar[%d] = globalVar[%d]\n", param1, param3);
} else {
ASSERT(0);
assert(0);
}
} else {
int16 param3;
@ -3171,7 +3171,7 @@ void decompileScript(uint8 *scriptPtr, int16 *stackPtr, uint16 scriptSize, uint1
sprintf(compareString1, "globalVar[%d]", param1);
sprintf(compareString2, "globalVar[%d]", param3);
} else {
ASSERT(0);
assert(0);
}
} else {
int16 param3;

View File

@ -182,14 +182,14 @@ void runObjectScript(int16 entryIdx) {
while (currentHead) {
tempHead = currentHead;
ASSERT_PTR(tempHead);
assert(tempHead);
currentHead = tempHead->next;
}
pNewElement = (prcLinkedListStruct *)malloc(sizeof(prcLinkedListStruct));
ASSERT_PTR(pNewElement);
assert(pNewElement);
pNewElement->next = tempHead->next;
tempHead->next = pNewElement;
@ -850,7 +850,7 @@ void makeSave(char *saveFileName) {
// actual save
currentHead = overlayHead.next;
ASSERT(sizeof(overlayHeadElement) == 0x14);
assert(sizeof(overlayHeadElement) == 0x14);
while (currentHead) {
fHandle.writeUint32BE(0);
fHandle.writeUint32BE(0);
@ -1053,7 +1053,7 @@ int16 buildObjectListCommand(void) {
int16 i;
int16 j;
ASSERT(gameType == Cine::GID_FW);
assert(gameType == Cine::GID_FW);
for (i = 0; i < 20; i++) {
objectListCommand[i][0] = 0;
@ -1076,7 +1076,7 @@ int16 buildObjectListCommand2(int16 param) {
int16 i;
int16 j;
ASSERT(gameType == Cine::GID_OS);
assert(gameType == Cine::GID_OS);
for (i = 0; i < 20; i++) {
objectListCommand[i][0] = 0;
@ -1444,7 +1444,7 @@ int16 makeMenuChoice(const commandeType commandList[], uint16 height, uint16 X,
} while (!var_A);
if (needMouseSave) {
ASSERT(0);
assert(0);
}
var_4 = button;
@ -1678,7 +1678,7 @@ int16 makeMenuChoice2(const commandeType commandList[], uint16 height, uint16 X,
} while (!var_A);
if (needMouseSave) {
ASSERT(0);
assert(0);
}
var_4 = button;
@ -2345,7 +2345,7 @@ void drawOverlays(void) {
int16 x;
int16 y;
ASSERT(currentOverlay->objIdx <= NUM_MAX_OBJECT);
assert(currentOverlay->objIdx <= NUM_MAX_OBJECT);
objPtr = &objectTable[currentOverlay->objIdx];
@ -2371,7 +2371,7 @@ void drawOverlays(void) {
AnimData *pPart;
int16 part = objPtr->part;
ASSERT(part >= 0 && part <= NUM_MAX_ANIMDATA);
assert(part >= 0 && part <= NUM_MAX_ANIMDATA);
pPart = &animDataTable[objPtr->frame];
@ -2424,7 +2424,7 @@ void drawOverlays(void) {
int16 x;
int16 y;
ASSERT(currentOverlay->objIdx <= NUM_MAX_OBJECT);
assert(currentOverlay->objIdx <= NUM_MAX_OBJECT);
objPtr = &objectTable[currentOverlay->objIdx];
@ -2437,7 +2437,7 @@ void drawOverlays(void) {
AnimData *pPart;
int16 part = objPtr->part;
ASSERT(part >= 0 && part <= NUM_MAX_ANIMDATA);
assert(part >= 0 && part <= NUM_MAX_ANIMDATA);
pPart = &animDataTable[objPtr->frame];
@ -2458,7 +2458,7 @@ void drawOverlays(void) {
var5 = currentOverlay->x;
ASSERT(currentOverlay->objIdx <= NUM_MAX_OBJECT);
assert(currentOverlay->objIdx <= NUM_MAX_OBJECT);
objPtr = &objectTable[currentOverlay->objIdx];
@ -2763,15 +2763,15 @@ uint16 addAni(uint16 param1, uint16 param2, uint8 *ptr, SeqListElement *element,
uint8 *ptr2;
int16 di;
ASSERT_PTR(ptr);
ASSERT_PTR(element);
ASSERT_PTR(param4);
assert(ptr);
assert(element);
assert(param4);
dummyU16 = READ_BE_UINT16((currentPtr + param1 * 2) + 8);
ptrData = ptr + dummyU16;
ASSERT(*ptrData);
assert(*ptrData);
di = (objectTable[param2].costume + 1) % (*ptrData);
ptr2 = (ptrData + (di * 8)) + 1;
@ -2833,7 +2833,7 @@ void processSeqListElement(SeqListElement *element) {
element->var14 = 0;
}
} else {
ASSERT(0);
assert(0);
}
var_10 = computeMove2(element);