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

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Sun Nov 7 02:03:58 CET 2010


Revision: 54108
          http://scummvm.svn.sourceforge.net/scummvm/?rev=54108&view=rev
Author:   fingolfin
Date:     2010-11-07 01:03:58 +0000 (Sun, 07 Nov 2010)

Log Message:
-----------
LURE: Convert printf to debug/warning

Exception: The "decompiler" code still uses fopen/fprintf etc.
but it is disabled by default, hence I am ignoring it for now.

Modified Paths:
--------------
    scummvm/trunk/engines/cruise/cruise_main.cpp
    scummvm/trunk/engines/cruise/decompiler.cpp
    scummvm/trunk/engines/cruise/function.cpp
    scummvm/trunk/engines/cruise/overlay.cpp
    scummvm/trunk/engines/cruise/saveload.cpp
    scummvm/trunk/engines/cruise/script.cpp

Modified: scummvm/trunk/engines/cruise/cruise_main.cpp
===================================================================
--- scummvm/trunk/engines/cruise/cruise_main.cpp	2010-11-07 01:03:29 UTC (rev 54107)
+++ scummvm/trunk/engines/cruise/cruise_main.cpp	2010-11-07 01:03:58 UTC (rev 54108)
@@ -44,11 +44,11 @@
 
 void MemoryList() {
 	if (!_vm->_memList.empty()) {
-		printf("Current list of un-freed memory blocks:\n");
+		debug("Current list of un-freed memory blocks:");
 		Common::List<byte *>::iterator i;
 		for (i = _vm->_memList.begin(); i != _vm->_memList.end(); ++i) {
 			byte *v = *i;
-			printf("%s - %d\n", (const char *)(v - 68), *((int32 *)(v - 72)));
+			debug("%s - %d", (const char *)(v - 68), *((int32 *)(v - 72)));
 		}
 	}
 }

Modified: scummvm/trunk/engines/cruise/decompiler.cpp
===================================================================
--- scummvm/trunk/engines/cruise/decompiler.cpp	2010-11-07 01:03:29 UTC (rev 54107)
+++ scummvm/trunk/engines/cruise/decompiler.cpp	2010-11-07 01:03:58 UTC (rev 54108)
@@ -62,7 +62,7 @@
 
 unsigned long int dumpIdx = 0;
 
-FILE *fHandle = NULL;
+FILE *fHandle = NULL;	// FIXME: Use Common::DumpFile instead of FILE
 
 #define DECOMPILER_STACK_DEPTH 100
 #define DECOMPILER_STACK_ENTRY_SIZE 5000
@@ -409,7 +409,7 @@
 		return (0);
 	}
 	default: {
-		printf("Unsupported type %d in opcodeType0\n",
+		debug("Unsupported type %d in opcodeType0",
 		       currentScriptOpcodeType);
 		failed = 1;
 	}
@@ -483,7 +483,7 @@
 		break;
 	}
 	default: {
-		printf("Unsupported type %d in opcodeType1\n",
+		debug("Unsupported type %d in opcodeType1",
 		       currentScriptOpcodeType);
 		failed = 1;
 	}
@@ -521,14 +521,14 @@
 			pushDecomp("freeString[%d][%s]", short1,
 			           decompSaveOpcodeVar);
 		} else {
-			printf("Unsupported type %d in opcodeType2\n",
+			debug("Unsupported type %d in opcodeType2",
 			       byte1 & 7);
 			failed = 1;
 		}
 		break;
 	}
 	default: {
-		printf("Unsupported type %d in opcodeType2\n",
+		debug("Unsupported type %d in opcodeType2",
 		       currentScriptOpcodeType);
 		failed = 1;
 	}
@@ -1264,7 +1264,7 @@
 	}
 	default: {
 		addDecomp("OP_%X", currentScriptOpcodeType);
-		printf("OPCODE: %X\n", currentScriptOpcodeType);
+		debug("OPCODE: %X", currentScriptOpcodeType);
 		failed = 1;
 		break;
 	}
@@ -1354,7 +1354,7 @@
 
 	resolveVarName("0", 0x20, temp, scriptName);
 
-	printf("decompiling script %d - %s\n", idx, scriptName);
+	debug("decompiling script %d - %s", idx, scriptName);
 
 	// return;
 
@@ -1394,17 +1394,17 @@
 		currentScriptOpcodeType = opcodeType & 7;
 
 		if (!decompOpcodeTypeTable[(opcodeType & 0xFB) >> 3]) {
-			printf("Unsupported opcode type %d in decomp\n",
+			debug("Unsupported opcode type %d in decomp",
 			       (opcodeType & 0xFB) >> 3);
 			return;
 		}
 
-		//printf("Optype: %d\n",(opcodeType&0xFB)>>3);
+		//debug("Optype: %d",(opcodeType&0xFB)>>3);
 
 		decompOpcodeTypeTable[(opcodeType & 0xFB) >> 3]();
 
 		if (failed) {
-			printf("Aborting decompilation..\n");
+			debug("Aborting decompilation..");
 			fclose(fHandle);
 			return;
 		}

Modified: scummvm/trunk/engines/cruise/function.cpp
===================================================================
--- scummvm/trunk/engines/cruise/function.cpp	2010-11-07 01:03:29 UTC (rev 54107)
+++ scummvm/trunk/engines/cruise/function.cpp	2010-11-07 01:03:58 UTC (rev 54108)
@@ -67,8 +67,6 @@
 	char *ptr1 = (char *)popPtr();
 	char *ptr2 = (char *)popPtr();
 
-	//printf("strcpy %s\n",ptr1);
-
 	while (*ptr1) {
 		*ptr2 = *ptr1;
 
@@ -1994,7 +1992,6 @@
 		return (-21);
 
 	if (opcode < ARRAYSIZE(opcodeTablePtr) && opcodeTablePtr[opcode]) {
-		//	printf("Function: %d\n",opcode);
 		pushVar(opcodeTablePtr[opcode]());
 		return (0);
 	} else {

Modified: scummvm/trunk/engines/cruise/overlay.cpp
===================================================================
--- scummvm/trunk/engines/cruise/overlay.cpp	2010-11-07 01:03:29 UTC (rev 54107)
+++ scummvm/trunk/engines/cruise/overlay.cpp	2010-11-07 01:03:58 UTC (rev 54108)
@@ -662,6 +662,7 @@
 #endif
 #ifdef DUMP_OBJECT
 	{
+		// TODO: Rewrite this to use Common::DumpFile
 		int i;
 		FILE *fHandle;
 		char nameBundle[100];

Modified: scummvm/trunk/engines/cruise/saveload.cpp
===================================================================
--- scummvm/trunk/engines/cruise/saveload.cpp	2010-11-07 01:03:29 UTC (rev 54107)
+++ scummvm/trunk/engines/cruise/saveload.cpp	2010-11-07 01:03:58 UTC (rev 54108)
@@ -901,8 +901,7 @@
 			}
 
 			/*if (j < 2) {
-				printf("Unsupported mono file load!\n");
-				ASSERT(0);
+				error("Unsupported mono file load");
 				//loadFileMode1(filesDatabase[j].subData.name,filesDatabase[j].subData.var4);
 			} else */
 			if (strlen(filesDatabase[i].subData.name) > 0) {

Modified: scummvm/trunk/engines/cruise/script.cpp
===================================================================
--- scummvm/trunk/engines/cruise/script.cpp	2010-11-07 01:03:29 UTC (rev 54107)
+++ scummvm/trunk/engines/cruise/script.cpp	2010-11-07 01:03:58 UTC (rev 54108)
@@ -449,7 +449,7 @@
 }
 
 int32 opcodeType9() {		// stop script
-	//printf("Stop a script of overlay %s\n",overlayTable[currentScriptPtr->overlayNumber].overlayName);
+	//debug("Stop a script of overlay %s", overlayTable[currentScriptPtr->overlayNumber].overlayName);
 	currentScriptPtr->scriptNumber = -1;
 	return (1);
 }
@@ -501,7 +501,7 @@
 	int var_C;
 	scriptInstanceStruct *oldTail;
 
-	//printf("Starting script %d of overlay %s\n",param,overlayTable[overlayNumber].overlayName);
+	//debug("Starting script %d of overlay %s", param,overlayTable[overlayNumber].overlayName);
 
 	if (scriptType < 0) {
 		useArg3Neg = 1;


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