aboutsummaryrefslogtreecommitdiff
path: root/engines/cruise
diff options
context:
space:
mode:
authorJohannes Schickel2014-06-08 17:55:05 +0200
committerJohannes Schickel2014-06-08 17:57:02 +0200
commit9e4dfe556edcb0e12ccfdb440b4f7ded8614ae1e (patch)
tree2f652fa33c8f8627bf1cde2bc8d04cab14284b2a /engines/cruise
parent06b01b8920ec36b31fe9bb758a75bbaf9809686d (diff)
downloadscummvm-rg350-9e4dfe556edcb0e12ccfdb440b4f7ded8614ae1e.tar.gz
scummvm-rg350-9e4dfe556edcb0e12ccfdb440b4f7ded8614ae1e.tar.bz2
scummvm-rg350-9e4dfe556edcb0e12ccfdb440b4f7ded8614ae1e.zip
CRUISE: Directly use assert.
This fixes an ASSERT macro redefinition when compiling the Symbian port. See bug #6622 "SYMBIAN: CRUISE: warning: `ASSERT' redefined".
Diffstat (limited to 'engines/cruise')
-rw-r--r--engines/cruise/background.cpp2
-rw-r--r--engines/cruise/cruise_main.cpp10
-rw-r--r--engines/cruise/cruise_main.h3
-rw-r--r--engines/cruise/ctp.cpp14
-rw-r--r--engines/cruise/dataLoader.cpp2
-rw-r--r--engines/cruise/function.cpp4
-rw-r--r--engines/cruise/menu.cpp10
-rw-r--r--engines/cruise/object.cpp4
-rw-r--r--engines/cruise/overlay.cpp4
-rw-r--r--engines/cruise/perso.cpp2
-rw-r--r--engines/cruise/saveload.cpp6
-rw-r--r--engines/cruise/script.cpp4
-rw-r--r--engines/cruise/stack.cpp4
13 files changed, 33 insertions, 36 deletions
diff --git a/engines/cruise/background.cpp b/engines/cruise/background.cpp
index 921c621eba..4cf52f62e1 100644
--- a/engines/cruise/background.cpp
+++ b/engines/cruise/background.cpp
@@ -178,7 +178,7 @@ int loadBackground(const char *name, int idx) {
break;
default:
- ASSERT(0);
+ assert(0);
}
gfxModuleData_setPal256(palScreen[idx]);
diff --git a/engines/cruise/cruise_main.cpp b/engines/cruise/cruise_main.cpp
index d7f5871d39..c3b6cd01d6 100644
--- a/engines/cruise/cruise_main.cpp
+++ b/engines/cruise/cruise_main.cpp
@@ -427,7 +427,7 @@ void resetFileEntry(int32 entryNumber) {
}
uint8 *mainProc14(uint16 overlay, uint16 idx) {
- ASSERT(0);
+ assert(0);
return NULL;
}
@@ -1359,7 +1359,7 @@ void closeAllMenu() {
menuTable[1] = NULL;
}
if (linkedMsgList) {
- ASSERT(0);
+ assert(0);
// freeMsgList(linkedMsgList);
}
@@ -1514,7 +1514,7 @@ int CruiseEngine::processInput() {
menuTable[0] = NULL;
if (linkedMsgList) {
- ASSERT(0);
+ assert(0);
// freeMsgList(linkedMsgList);
}
@@ -1918,7 +1918,7 @@ void CruiseEngine::mainLoop() {
processAnimation();
if (remdo) {
- // ASSERT(0);
+ // assert(0);
/* main3 = 0;
* var24 = 0;
* var23 = 0;
@@ -1927,7 +1927,7 @@ void CruiseEngine::mainLoop() {
}
if (cmdLine[0]) {
- ASSERT(0);
+ assert(0);
/* redrawStrings(0,&cmdLine,8);
waitForPlayerInput();
diff --git a/engines/cruise/cruise_main.h b/engines/cruise/cruise_main.h
index caaaad2068..f9d0e2fc78 100644
--- a/engines/cruise/cruise_main.h
+++ b/engines/cruise/cruise_main.h
@@ -62,9 +62,6 @@ enum MouseButton {
/*#define DUMP_SCRIPT
#define DUMP_OBJECT*/
-#define ASSERT_PTR assert
-#define ASSERT assert
-
enum ResType {
OBJ_TYPE_LINE = 0,
OBJ_TYPE_MASK = 1,
diff --git a/engines/cruise/ctp.cpp b/engines/cruise/ctp.cpp
index 074132d9a2..9515b552e1 100644
--- a/engines/cruise/ctp.cpp
+++ b/engines/cruise/ctp.cpp
@@ -244,7 +244,7 @@ int initCt(const char *ctpName) {
}
// get the path-finding coordinates
- ASSERT((segementSizeTable[0] % 4) == 0);
+ assert((segementSizeTable[0] % 4) == 0);
for (int i = 0; i < segementSizeTable[0] / 4; i++) {
ctp_routeCoords[i][0] = (int16)READ_BE_UINT16(dataPointer);
dataPointer += 2;
@@ -253,7 +253,7 @@ int initCt(const char *ctpName) {
}
// get the path-finding line informations (indexing the routeCoords array)
- ASSERT((segementSizeTable[1] % 20) == 0);
+ assert((segementSizeTable[1] % 20) == 0);
for (int i = 0; i < segementSizeTable[1] / 20; i++) {
for (int j = 0; j < 10; j++) {
ctp_routes[i][j] = (int16)READ_BE_UINT16(dataPointer);
@@ -262,7 +262,7 @@ int initCt(const char *ctpName) {
}
// read polygons
- ASSERT((segementSizeTable[2] % 80) == 0);
+ assert((segementSizeTable[2] % 80) == 0);
for (int i = 0; i < segementSizeTable[2] / 80; i++) {
for (int j = 0; j < 40; j++) {
ctp_walkboxTable[i][j] = (int16)READ_BE_UINT16(dataPointer);
@@ -277,14 +277,14 @@ int initCt(const char *ctpName) {
} else {
// get the walkbox type
// Type: 0x00 - non walkable, 0x01 - walkable, 0x02 - exit zone
- ASSERT((segementSizeTable[3] % 2) == 0);
+ assert((segementSizeTable[3] % 2) == 0);
for (int i = 0; i < segementSizeTable[3] / 2; i++) {
walkboxColor[i] = (int16)READ_BE_UINT16(dataPointer);
dataPointer += 2;
}
// change indicator, walkbox type can change, i.e. blocked by object (values are either 0x00 or 0x01)
- ASSERT((segementSizeTable[4] % 2) == 0);
+ assert((segementSizeTable[4] % 2) == 0);
for (int i = 0; i < segementSizeTable[4] / 2; i++) {
walkboxState[i] = (int16)READ_BE_UINT16(dataPointer);
dataPointer += 2;
@@ -292,14 +292,14 @@ int initCt(const char *ctpName) {
}
//
- ASSERT((segementSizeTable[5] % 2) == 0);
+ assert((segementSizeTable[5] % 2) == 0);
for (int i = 0; i < segementSizeTable[5] / 2; i++) {
walkboxColorIndex[i] = (int16)READ_BE_UINT16(dataPointer);
dataPointer += 2;
}
//
- ASSERT((segementSizeTable[6] % 2) == 0);
+ assert((segementSizeTable[6] % 2) == 0);
for (int i = 0; i < segementSizeTable[6] / 2; i++) {
walkboxZoom[i] = (int16)READ_BE_UINT16(dataPointer);
dataPointer += 2;
diff --git a/engines/cruise/dataLoader.cpp b/engines/cruise/dataLoader.cpp
index c55818abc3..7a1258dbde 100644
--- a/engines/cruise/dataLoader.cpp
+++ b/engines/cruise/dataLoader.cpp
@@ -225,7 +225,7 @@ fileTypeEnum getFileType(const char *name) {
newFileType = type_FNT;
}
- ASSERT(newFileType != type_UNK);
+ assert(newFileType != type_UNK);
return newFileType;
}
diff --git a/engines/cruise/function.cpp b/engines/cruise/function.cpp
index 8833efc280..b9a074ba54 100644
--- a/engines/cruise/function.cpp
+++ b/engines/cruise/function.cpp
@@ -1608,7 +1608,7 @@ int16 Op_GetNodeX() {
int result = getNode(nodeInfo, node);
- ASSERT(result == 0);
+ assert(result == 0);
return nodeInfo[0];
}
@@ -1620,7 +1620,7 @@ int16 Op_GetNodeY() {
int result = getNode(nodeInfo, node);
- ASSERT(result == 0);
+ assert(result == 0);
return nodeInfo[1];
}
diff --git a/engines/cruise/menu.cpp b/engines/cruise/menu.cpp
index 0a497202e2..c72192fc1b 100644
--- a/engines/cruise/menu.cpp
+++ b/engines/cruise/menu.cpp
@@ -39,7 +39,7 @@ menuStruct *createMenu(int X, int Y, const char *menuName) {
menuStruct *entry;
entry = (menuStruct *) MemAlloc(sizeof(menuStruct));
- ASSERT(entry);
+ assert(entry);
entry->x = X - 160 / 2;
entry->y = Y;
@@ -69,7 +69,7 @@ void addSelectableMenuEntry(int ovlIdx, int headerIdx, menuStruct *pMenu, int pa
if (!strcmp(var_6->string, menuText)) {
pNewElement = var_6;
pSubStruct = (menuElementSubStruct *)allocAndZero(sizeof(menuElementSubStruct));
- ASSERT(pSubStruct);
+ assert(pSubStruct);
pSubStruct->pNext = NULL;
pSubStruct->ovlIdx = ovlIdx;
@@ -99,9 +99,9 @@ void addSelectableMenuEntry(int ovlIdx, int headerIdx, menuStruct *pMenu, int pa
}
pNewElement = (menuElementStruct *)allocAndZero(sizeof(menuElementStruct));
- ASSERT(pNewElement);
+ assert(pNewElement);
pSubStruct = (menuElementSubStruct *)allocAndZero(sizeof(menuElementSubStruct));
- ASSERT(pSubStruct);
+ assert(pSubStruct);
pNewElement->string = menuText;
pNewElement->next = NULL;
@@ -266,7 +266,7 @@ int playerMenu(int menuX, int menuY) {
freeDisk();
menuTable[0] = createMenu(menuX, menuY, _vm->langString(ID_PLAYER_MENU));
- ASSERT(menuTable[0]);
+ assert(menuTable[0]);
//addSelectableMenuEntry(0, 3, menuTable[0], 1, -1, "Save game disk");
if (userEnabled) {
diff --git a/engines/cruise/object.cpp b/engines/cruise/object.cpp
index 664627b9a4..845fc34d1f 100644
--- a/engines/cruise/object.cpp
+++ b/engines/cruise/object.cpp
@@ -163,14 +163,14 @@ void setObjectPosition(int16 ovlIdx, int16 objIdx, int16 param3, int16 param4) {
break;
}
default: {
- ASSERT(0);
+ assert(0);
}
}
break;
}
default: {
- ASSERT(0);
+ assert(0);
}
}
}
diff --git a/engines/cruise/overlay.cpp b/engines/cruise/overlay.cpp
index 386a11f7ef..f7df741892 100644
--- a/engines/cruise/overlay.cpp
+++ b/engines/cruise/overlay.cpp
@@ -295,7 +295,7 @@ int loadOverlay(const char *scriptName) {
}
if (ovlData->numMsgRelHeader) { // link data
- ASSERT(sizeof(linkDataStruct) == 0x22);
+ assert(sizeof(linkDataStruct) == 0x22);
ovlData->arrayMsgRelHeader = (linkDataStruct *) mallocAndZero(ovlData->numMsgRelHeader * sizeof(linkDataStruct));
@@ -626,7 +626,7 @@ int loadOverlay(const char *scriptName) {
sprintf(nameBundle, "%s-objs.txt", scriptName);
fHandle = fopen(nameBundle, "w+");
- ASSERT(fHandle);
+ assert(fHandle);
for (int i = 0; i < ovlData->numMsgRelHeader; i++) {
linkDataStruct *var_34;
diff --git a/engines/cruise/perso.cpp b/engines/cruise/perso.cpp
index 66c9718b95..ff33eca14b 100644
--- a/engines/cruise/perso.cpp
+++ b/engines/cruise/perso.cpp
@@ -237,7 +237,7 @@ void processActorWalk(MovementEntry &resx_y, int16 *inc_droite, int16 *inc_droit
void affiche_chemin(int16 persoIdx, MovementEntry &data) {
persoStruct *pPerso = persoTable[persoIdx];
- ASSERT(pPerso);
+ assert(pPerso);
processActorWalk(data, &pPerso->inc_droite, &pPerso->inc_droite0,
&pPerso->inc_chemin, pPerso->coordinates, pPerso->solution,
diff --git a/engines/cruise/saveload.cpp b/engines/cruise/saveload.cpp
index a9fc62241a..8d66e82d37 100644
--- a/engines/cruise/saveload.cpp
+++ b/engines/cruise/saveload.cpp
@@ -284,7 +284,7 @@ static void syncOverlays2(Common::Serializer &s) {
if (ovlRestoreData[i]._sBssSize) {
ovlRestoreData[i]._pBss = (uint8 *) mallocAndZero(ovlRestoreData[i]._sBssSize);
- ASSERT(ovlRestoreData[i]._pBss);
+ assert(ovlRestoreData[i]._pBss);
s.syncBytes(ovlRestoreData[i]._pBss, ovlRestoreData[i]._sBssSize);
}
@@ -293,7 +293,7 @@ static void syncOverlays2(Common::Serializer &s) {
if (ovlRestoreData[i]._sNumObj) {
ovlRestoreData[i]._pObj = (objectParams *) mallocAndZero(ovlRestoreData[i]._sNumObj * sizeof(objectParams));
- ASSERT(ovlRestoreData[i]._pObj);
+ assert(ovlRestoreData[i]._pObj);
for (int j = 0; j < ovlRestoreData[i]._sNumObj; j++) {
s.syncAsSint16LE(ovlRestoreData[i]._pObj[j].X);
@@ -915,7 +915,7 @@ Common::Error loadSavegameData(int saveGameIdx) {
while (currentcellHead) {
if (currentcellHead->type == 5) {
- ASSERT(0);
+ assert(0);
#if 0
uint8 *ptr = mainProc14(currentcellHead->overlay, currentcellHead->idx);
if (ptr)
diff --git a/engines/cruise/script.cpp b/engines/cruise/script.cpp
index eae20414ce..1f308714f7 100644
--- a/engines/cruise/script.cpp
+++ b/engines/cruise/script.cpp
@@ -170,7 +170,7 @@ int32 opcodeType1() {
if (var_6 == 5) {
ptr = overlayTable[byte2].ovlData->data4Ptr + var_C;
} else {
- ASSERT(0);
+ assert(0);
}
} else {
ptr = scriptDataPtrTable[var_6] + var_C;
@@ -249,7 +249,7 @@ int32 opcodeType2() {
if (!overlayTable[overlay].ovlData) {
return (-4);
}
- ASSERT(0);
+ assert(0);
}
adresse += offset;
diff --git a/engines/cruise/stack.cpp b/engines/cruise/stack.cpp
index e4ecf72133..52a7a84814 100644
--- a/engines/cruise/stack.cpp
+++ b/engines/cruise/stack.cpp
@@ -44,7 +44,7 @@ int16 popVar() {
positionInStack--;
- ASSERT(scriptStack[positionInStack].type == STACK_SHORT);
+ assert(scriptStack[positionInStack].type == STACK_SHORT);
return (scriptStack[positionInStack].data.shortVar);
}
@@ -66,7 +66,7 @@ void *popPtr() {
positionInStack--;
- ASSERT(scriptStack[positionInStack].type == STACK_PTR);
+ assert(scriptStack[positionInStack].type == STACK_PTR);
return (scriptStack[positionInStack].data.ptrVar);
}