aboutsummaryrefslogtreecommitdiff
path: root/engines/cruise
diff options
context:
space:
mode:
authorPaul Gilbert2009-05-15 04:35:47 +0000
committerPaul Gilbert2009-05-15 04:35:47 +0000
commitbb45be960d1762a480ec3523d97955754c7ce9f2 (patch)
treed00ec17373c22e123cfe9686bcbd988db9727212 /engines/cruise
parent03f5ad5cbbabc93fa0eda4366da5d77da0545014 (diff)
downloadscummvm-rg350-bb45be960d1762a480ec3523d97955754c7ce9f2.tar.gz
scummvm-rg350-bb45be960d1762a480ec3523d97955754c7ce9f2.tar.bz2
scummvm-rg350-bb45be960d1762a480ec3523d97955754c7ce9f2.zip
Converted various printf statements to use debug, warning, and error.
svn-id: r40588
Diffstat (limited to 'engines/cruise')
-rw-r--r--engines/cruise/actor.cpp2
-rw-r--r--engines/cruise/background.cpp2
-rw-r--r--engines/cruise/cruise_main.cpp5
-rw-r--r--engines/cruise/dataLoader.cpp5
-rw-r--r--engines/cruise/function.cpp10
-rw-r--r--engines/cruise/object.cpp11
-rw-r--r--engines/cruise/overlay.cpp10
-rw-r--r--engines/cruise/script.cpp27
-rw-r--r--engines/cruise/volume.cpp6
9 files changed, 31 insertions, 47 deletions
diff --git a/engines/cruise/actor.cpp b/engines/cruise/actor.cpp
index 2ee8d5309a..4d68773fec 100644
--- a/engines/cruise/actor.cpp
+++ b/engines/cruise/actor.cpp
@@ -937,7 +937,7 @@ void processAnimation(void) {
break;
}
default: {
- printf("Unimplemented currentActor->phase=%d in processAnimation()\n", currentActor->phase);
+ warning("Unimplemented currentActor->phase=%d in processAnimation()", currentActor->phase);
// exit(1);
}
}
diff --git a/engines/cruise/background.cpp b/engines/cruise/background.cpp
index 3c16388f74..6635a8d621 100644
--- a/engines/cruise/background.cpp
+++ b/engines/cruise/background.cpp
@@ -90,7 +90,7 @@ int loadBackground(const char *name, int idx) {
uint8 *ptr2;
uint8 *ptrToFree;
- printf("Loading BG: %s\n", name);
+ debug(1, "Loading BG: %s", name);
if (!backgroundScreens[idx]) {
backgroundScreens[idx] = (uint8 *)mallocAndZero(320 * 200);
diff --git a/engines/cruise/cruise_main.cpp b/engines/cruise/cruise_main.cpp
index 276ce79f06..1d6907ebf0 100644
--- a/engines/cruise/cruise_main.cpp
+++ b/engines/cruise/cruise_main.cpp
@@ -298,8 +298,7 @@ int loadFileSub1(uint8 **ptr, const char *name, uint8 *ptr2) {
for (i = 0; i < 64; i++) {
if (preloadData[i].ptr) {
if (!strcmp(preloadData[i].name, name)) {
- printf("Unsupported code in loadFIleSub1 !\n");
- exit(1);
+ error("Unsupported code in loadFIleSub1 !");
}
}
}
@@ -708,7 +707,7 @@ int findObject(int mouseX, int mouseY, int *outObjOvl, int *outObjIdx) {
Common::KeyCode keyboardCode = Common::KEYCODE_INVALID;
void freeStuff2(void) {
- printf("implement freeStuff2\n");
+ warning("implement freeStuff2");
}
void *allocAndZero(int size) {
diff --git a/engines/cruise/dataLoader.cpp b/engines/cruise/dataLoader.cpp
index a3ee46b383..be36df34d6 100644
--- a/engines/cruise/dataLoader.cpp
+++ b/engines/cruise/dataLoader.cpp
@@ -171,8 +171,7 @@ int createResFileEntry(int width, int height, int size, int resType) {
int entryNumber;
int div = 0;
- printf("Executing untested createResFileEntry!\n");
- exit(1);
+ error("Executing untested createResFileEntry!");
for (i = 0; i < NUM_FILE_ENTRIES; i++) {
if (!filesDatabase[i].subData.ptr)
@@ -496,7 +495,7 @@ int loadSetEntry(const char *name, uint8 *ptr, int currentEntryIdx, int currentD
break;
}
default: {
- printf("Unsuported gfx loading type: %d\n", localBuffer.type);
+ warning("Unsuported gfx loading type: %d", localBuffer.type);
break;
}
}
diff --git a/engines/cruise/function.cpp b/engines/cruise/function.cpp
index 3f65d61790..529cf0bb39 100644
--- a/engines/cruise/function.cpp
+++ b/engines/cruise/function.cpp
@@ -314,7 +314,7 @@ int16 Op_UnmergeBackgroundIncrust(void) {
int16 Op_FreePreload(void) {
// TODO: implement
- printf("Op_FreePreload, implement\n");
+ debug(1, "Op_FreePreload not implemented");
return (0);
}
@@ -371,7 +371,7 @@ int16 Op_comment(void) {
var = (char *)popPtr();
- printf("COMMENT: \"%s\"\n", var);
+ debug(1, "COMMENT: \"%s\"", var);
return (0);
}
@@ -599,7 +599,7 @@ int16 Op_InitializeState(void) {
ovlIdx = currentScriptPtr->overlayNumber;
#ifdef FUNCTION_DEBUG
- printf("Init %s state to %d\n", getObjectName(objIdx, overlayTable[ovlIdx].ovlData->arrayNameObj), param1);
+ debug(1, "Init %s state to %d", getObjectName(objIdx, overlayTable[ovlIdx].ovlData->arrayNameObj), param1);
#endif
objInit(ovlIdx, objIdx, param1);
@@ -1653,7 +1653,7 @@ int16 Op_SetVolume(void) {
int16 Op_SongExist(void) {
char* songName = (char*)popPtr();
- printf("Unimplemented \"Op_SongExist\": %s\n", songName);
+ warning("Unimplemented \"Op_SongExist\": %s", songName);
return 0;
}
@@ -1994,7 +1994,7 @@ int32 opcodeType8(void) {
pushVar(opcodeTablePtr[opcode]());
return (0);
} else {
- printf("Unsupported opcode %d in opcode type 8\n", opcode);
+ warning("Unsupported opcode %d in opcode type 8", opcode);
pushVar(0);
// exit(1);
}
diff --git a/engines/cruise/object.cpp b/engines/cruise/object.cpp
index 044f779f83..64b53d02fd 100644
--- a/engines/cruise/object.cpp
+++ b/engines/cruise/object.cpp
@@ -94,8 +94,7 @@ int16 getMultipleObjectParam(int16 overlayIdx, int16 objectIdx, objectParamsQuer
break;
}
default: {
- printf("Unsupported case %d in getMultipleObjectParam\n", ptr->_class);
- exit(1);
+ error("Unsupported case %d in getMultipleObjectParam", ptr->_class);
}
}
@@ -216,7 +215,7 @@ int16 objInit(int ovlIdx, int objIdx, int newState) {
break;
}
default: {
- printf("Unsupported param = %d in objInit\n", ptr->_class);
+ warning("Unsupported param = %d in objInit", ptr->_class);
// exit(1);
}
}
@@ -253,8 +252,7 @@ int16 getSingleObjectParam(int16 overlayIdx, int16 param2, int16 param3, int16 *
break;
}
default: {
- printf("Unsupported case %d in getSingleObjectParam\n", ptr->_class);
- exit(1);
+ error("Unsupported case %d in getSingleObjectParam", ptr->_class);
}
}
@@ -284,8 +282,7 @@ int16 getSingleObjectParam(int16 overlayIdx, int16 param2, int16 param3, int16 *
break;
}
default: {
- printf("Unsupported case %d in getSingleObjectParam case 1\n", param3);
- exit(1);
+ error("Unsupported case %d in getSingleObjectParam case 1", param3);
}
}
diff --git a/engines/cruise/overlay.cpp b/engines/cruise/overlay.cpp
index 03b64b0382..1bca03da1d 100644
--- a/engines/cruise/overlay.cpp
+++ b/engines/cruise/overlay.cpp
@@ -55,7 +55,7 @@ int loadOverlay(const char *scriptName) {
byte *unpackedBuffer;
ovlDataStruct *ovlData;
- printf("Load overlay: %s\n", scriptName);
+ debug(1, "Load overlay: %s", scriptName);
newNumberOfScript = numOfLoadedOverlay;
@@ -93,12 +93,12 @@ int loadOverlay(const char *scriptName) {
strcat(fileName, ".OVL");
- printf("Attempting to load overlay file %s...\n", fileName);
+ debug(1, "Attempting to load overlay file %s...", fileName);
fileIdx = findFileInDisks(fileName);
if (fileIdx < 0) {
- printf("Unable to load overlay %s !\n", scriptName);
+ warning("Unable to load overlay %s !", scriptName);
//releaseScript(scriptName);
return (-18);
}
@@ -126,7 +126,7 @@ int loadOverlay(const char *scriptName) {
loadPackedFileToMem(fileIdx, (uint8 *) unpackedBuffer);
}
- printf("OVL loading done...\n");
+ debug(1, "OVL loading done...");
Common::MemoryReadStream s(unpackedBuffer, unpackedSize);
@@ -644,7 +644,7 @@ int releaseOverlay(const char *name) {
removeScript(overlayIdx, -1, &relHead);
removeScript(overlayIdx, -1, &relHead);
- printf("releaseOverlay: finish !\n");
+ debug(1, "releaseOverlay: finish !");
return 0;
}
diff --git a/engines/cruise/script.cpp b/engines/cruise/script.cpp
index 4f62d22bd1..f060e379ad 100644
--- a/engines/cruise/script.cpp
+++ b/engines/cruise/script.cpp
@@ -104,8 +104,7 @@ int32 opcodeType0(void) {
pushVar(*address);
return (0);
} else {
- printf("Unsupported code in opcodeType0 case 1!\n");
- exit(1);
+ error("Unsupported code in opcodeType0 case 1!");
}
return (0);
@@ -129,11 +128,8 @@ int32 opcodeType0(void) {
break;
}
- default: {
- printf("Unsupported type %d in opcodeType0\n",
- currentScriptOpcodeType);
- exit(1);
- }
+ default:
+ error("Unsupported type %d in opcodeType0", currentScriptOpcodeType);
}
return 0;
@@ -200,10 +196,8 @@ int32 opcodeType1(void) {
*(ptr + var_A + offset) = var;
return (0);
}
- default: {
- printf("Unsupported code in opcodeType1 case 1!\n");
- exit(1);
- }
+ default:
+ error("Unsupported code in opcodeType1 case 1!");
}
break;
@@ -229,11 +223,8 @@ int32 opcodeType1(void) {
saveOpcodeVar = var;
break;
}
- default: {
- printf("Unsupported type %d in opcodeType1\n",
- currentScriptOpcodeType);
- exit(1);
- }
+ default:
+ error("Unsupported type %d in opcodeType1", currentScriptOpcodeType);
}
return (0);
@@ -647,9 +638,7 @@ int executeScripts(scriptInstanceStruct *ptr) {
currentScriptOpcodeType = opcodeType & 7;
if (!opcodeTypeTable[(opcodeType & 0xFB) >> 3]) {
- printf("Unsupported opcode type %d\n", (opcodeType & 0xFB) >> 3);
- exit(1);
- return (-21);
+ error("Unsupported opcode type %d", (opcodeType & 0xFB) >> 3);
}
} while (!opcodeTypeTable[(opcodeType & 0xFB) >> 3]());
diff --git a/engines/cruise/volume.cpp b/engines/cruise/volume.cpp
index bb4da8cc3f..6bda10b704 100644
--- a/engines/cruise/volume.cpp
+++ b/engines/cruise/volume.cpp
@@ -256,7 +256,7 @@ int16 findFileInDisks(const char *name) {
strToUpper(fileName);
if (!volumeDataLoaded) {
- printf("CNF wasn't loaded, reading now...\n");
+ debug(1, "CNF wasn't loaded, reading now...");
if (currentVolumeFile.isOpen()) {
askDisk(-1);
freeDisk();
@@ -281,7 +281,7 @@ int16 findFileInDisks(const char *name) {
if (disk >= 0) {
int temp;
- printf("File found on disk %d\n", disk);
+ debug(1, "File found on disk %d", disk);
if (currentVolumeFile.isOpen()) {
askDisk(-1);
@@ -369,7 +369,7 @@ int16 readVolCnf(void) {
fileHandle.read(&volumeData[i].size, 4);
flipShort(&volumeData[i].diskNumber);
- printf("Disk number: %d\n", volumeData[i].diskNumber);
+ debug(1, "Disk number: %d", volumeData[i].diskNumber);
flipLong(&volumeData[i].size);
}