[Scummvm-cvs-logs] SF.net SVN: scummvm:[40588] scummvm/trunk/engines/cruise

dreammaster at users.sourceforge.net dreammaster at users.sourceforge.net
Fri May 15 06:35:47 CEST 2009


Revision: 40588
          http://scummvm.svn.sourceforge.net/scummvm/?rev=40588&view=rev
Author:   dreammaster
Date:     2009-05-15 04:35:47 +0000 (Fri, 15 May 2009)

Log Message:
-----------
Converted various printf statements to use debug, warning, and error.

Modified Paths:
--------------
    scummvm/trunk/engines/cruise/actor.cpp
    scummvm/trunk/engines/cruise/background.cpp
    scummvm/trunk/engines/cruise/cruise_main.cpp
    scummvm/trunk/engines/cruise/dataLoader.cpp
    scummvm/trunk/engines/cruise/function.cpp
    scummvm/trunk/engines/cruise/object.cpp
    scummvm/trunk/engines/cruise/overlay.cpp
    scummvm/trunk/engines/cruise/script.cpp
    scummvm/trunk/engines/cruise/volume.cpp

Modified: scummvm/trunk/engines/cruise/actor.cpp
===================================================================
--- scummvm/trunk/engines/cruise/actor.cpp	2009-05-15 04:07:10 UTC (rev 40587)
+++ scummvm/trunk/engines/cruise/actor.cpp	2009-05-15 04:35:47 UTC (rev 40588)
@@ -937,7 +937,7 @@
 					break;
 				}
 				default: {
-					printf("Unimplemented currentActor->phase=%d in processAnimation()\n", currentActor->phase);
+					warning("Unimplemented currentActor->phase=%d in processAnimation()", currentActor->phase);
 					// exit(1);
 				}
 				}

Modified: scummvm/trunk/engines/cruise/background.cpp
===================================================================
--- scummvm/trunk/engines/cruise/background.cpp	2009-05-15 04:07:10 UTC (rev 40587)
+++ scummvm/trunk/engines/cruise/background.cpp	2009-05-15 04:35:47 UTC (rev 40588)
@@ -90,7 +90,7 @@
 	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);

Modified: scummvm/trunk/engines/cruise/cruise_main.cpp
===================================================================
--- scummvm/trunk/engines/cruise/cruise_main.cpp	2009-05-15 04:07:10 UTC (rev 40587)
+++ scummvm/trunk/engines/cruise/cruise_main.cpp	2009-05-15 04:35:47 UTC (rev 40588)
@@ -298,8 +298,7 @@
 	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 @@
 Common::KeyCode keyboardCode = Common::KEYCODE_INVALID;
 
 void freeStuff2(void) {
-	printf("implement freeStuff2\n");
+	warning("implement freeStuff2");
 }
 
 void *allocAndZero(int size) {

Modified: scummvm/trunk/engines/cruise/dataLoader.cpp
===================================================================
--- scummvm/trunk/engines/cruise/dataLoader.cpp	2009-05-15 04:07:10 UTC (rev 40587)
+++ scummvm/trunk/engines/cruise/dataLoader.cpp	2009-05-15 04:35:47 UTC (rev 40588)
@@ -171,8 +171,7 @@
 	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 @@
 			break;
 		}
 		default: {
-			printf("Unsuported gfx loading type: %d\n", localBuffer.type);
+			warning("Unsuported gfx loading type: %d", localBuffer.type);
 			break;
 		}
 		}

Modified: scummvm/trunk/engines/cruise/function.cpp
===================================================================
--- scummvm/trunk/engines/cruise/function.cpp	2009-05-15 04:07:10 UTC (rev 40587)
+++ scummvm/trunk/engines/cruise/function.cpp	2009-05-15 04:35:47 UTC (rev 40588)
@@ -314,7 +314,7 @@
 
 int16 Op_FreePreload(void) {
 	// TODO: implement
-	printf("Op_FreePreload, implement\n");
+	debug(1, "Op_FreePreload not implemented");
 	return (0);
 }
 
@@ -371,7 +371,7 @@
 
 	var = (char *)popPtr();
 
-	printf("COMMENT: \"%s\"\n", var);
+	debug(1, "COMMENT: \"%s\"", var);
 
 	return (0);
 }
@@ -599,7 +599,7 @@
 		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_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 @@
 		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);
 	}

Modified: scummvm/trunk/engines/cruise/object.cpp
===================================================================
--- scummvm/trunk/engines/cruise/object.cpp	2009-05-15 04:07:10 UTC (rev 40587)
+++ scummvm/trunk/engines/cruise/object.cpp	2009-05-15 04:35:47 UTC (rev 40588)
@@ -94,8 +94,7 @@
 		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 @@
 		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 @@
 		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 @@
 		break;
 	}
 	default: {
-		printf("Unsupported case %d in getSingleObjectParam case 1\n", param3);
-		exit(1);
+		error("Unsupported case %d in getSingleObjectParam case 1", param3);
 	}
 	}
 

Modified: scummvm/trunk/engines/cruise/overlay.cpp
===================================================================
--- scummvm/trunk/engines/cruise/overlay.cpp	2009-05-15 04:07:10 UTC (rev 40587)
+++ scummvm/trunk/engines/cruise/overlay.cpp	2009-05-15 04:35:47 UTC (rev 40588)
@@ -55,7 +55,7 @@
 	byte *unpackedBuffer;
 	ovlDataStruct *ovlData;
 
-	printf("Load overlay: %s\n", scriptName);
+	debug(1, "Load overlay: %s", scriptName);
 
 	newNumberOfScript = numOfLoadedOverlay;
 
@@ -93,12 +93,12 @@
 
 	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 @@
 		loadPackedFileToMem(fileIdx, (uint8 *) unpackedBuffer);
 	}
 
-	printf("OVL loading done...\n");
+	debug(1, "OVL loading done...");
 
 	Common::MemoryReadStream s(unpackedBuffer, unpackedSize);
 
@@ -644,7 +644,7 @@
 	removeScript(overlayIdx, -1, &relHead);
 	removeScript(overlayIdx, -1, &relHead);
 
-	printf("releaseOverlay: finish !\n");
+	debug(1, "releaseOverlay: finish !");
 
 	return 0;
 }

Modified: scummvm/trunk/engines/cruise/script.cpp
===================================================================
--- scummvm/trunk/engines/cruise/script.cpp	2009-05-15 04:07:10 UTC (rev 40587)
+++ scummvm/trunk/engines/cruise/script.cpp	2009-05-15 04:35:47 UTC (rev 40588)
@@ -104,8 +104,7 @@
 			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,12 +128,9 @@
 
 		break;
 	}
-	default: {
-		printf("Unsupported type %d in opcodeType0\n",
-		       currentScriptOpcodeType);
-		exit(1);
+	default:
+		error("Unsupported type %d in opcodeType0", currentScriptOpcodeType);
 	}
-	}
 
 	return 0;
 }
@@ -200,11 +196,9 @@
 			*(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,12 +223,9 @@
 		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 @@
 		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]());
 

Modified: scummvm/trunk/engines/cruise/volume.cpp
===================================================================
--- scummvm/trunk/engines/cruise/volume.cpp	2009-05-15 04:07:10 UTC (rev 40587)
+++ scummvm/trunk/engines/cruise/volume.cpp	2009-05-15 04:35:47 UTC (rev 40588)
@@ -256,7 +256,7 @@
 	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 @@
 	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 @@
 		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);
 	}
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list