diff options
author | Max Horn | 2010-11-07 01:03:58 +0000 |
---|---|---|
committer | Max Horn | 2010-11-07 01:03:58 +0000 |
commit | a905682cf8a0cd11041ac0b81508d363ae8cc0d2 (patch) | |
tree | 26c61d74d85e8ed9f904c9732baf47a9b8e65e14 /engines | |
parent | b4787d94301e4ef1ba5b2f7135fbcb0b6d3de6b8 (diff) | |
download | scummvm-rg350-a905682cf8a0cd11041ac0b81508d363ae8cc0d2.tar.gz scummvm-rg350-a905682cf8a0cd11041ac0b81508d363ae8cc0d2.tar.bz2 scummvm-rg350-a905682cf8a0cd11041ac0b81508d363ae8cc0d2.zip |
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.
svn-id: r54108
Diffstat (limited to 'engines')
-rw-r--r-- | engines/cruise/cruise_main.cpp | 4 | ||||
-rw-r--r-- | engines/cruise/decompiler.cpp | 20 | ||||
-rw-r--r-- | engines/cruise/function.cpp | 3 | ||||
-rw-r--r-- | engines/cruise/overlay.cpp | 1 | ||||
-rw-r--r-- | engines/cruise/saveload.cpp | 3 | ||||
-rw-r--r-- | engines/cruise/script.cpp | 4 |
6 files changed, 16 insertions, 19 deletions
diff --git a/engines/cruise/cruise_main.cpp b/engines/cruise/cruise_main.cpp index aa78f84e3d..ac814b3279 100644 --- a/engines/cruise/cruise_main.cpp +++ b/engines/cruise/cruise_main.cpp @@ -44,11 +44,11 @@ gfxEntryStruct* linkedMsgList = NULL; 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))); } } } diff --git a/engines/cruise/decompiler.cpp b/engines/cruise/decompiler.cpp index 31d9dcef9b..3298776d0e 100644 --- a/engines/cruise/decompiler.cpp +++ b/engines/cruise/decompiler.cpp @@ -62,7 +62,7 @@ unsigned long int currentOffset; 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 @@ int decompLoadVar() { return (0); } default: { - printf("Unsupported type %d in opcodeType0\n", + debug("Unsupported type %d in opcodeType0", currentScriptOpcodeType); failed = 1; } @@ -483,7 +483,7 @@ int decompSaveVar() { break; } default: { - printf("Unsupported type %d in opcodeType1\n", + debug("Unsupported type %d in opcodeType1", currentScriptOpcodeType); failed = 1; } @@ -521,14 +521,14 @@ int decompOpcodeType2() { 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 @@ int decompFunction() { } default: { addDecomp("OP_%X", currentScriptOpcodeType); - printf("OPCODE: %X\n", currentScriptOpcodeType); + debug("OPCODE: %X", currentScriptOpcodeType); failed = 1; break; } @@ -1354,7 +1354,7 @@ void dumpScript(uint8 *ovlName, ovlDataStruct *ovlData, int idx) { 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 @@ void dumpScript(uint8 *ovlName, ovlDataStruct *ovlData, int idx) { 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; } diff --git a/engines/cruise/function.cpp b/engines/cruise/function.cpp index c3d435bde6..0b25ee59c1 100644 --- a/engines/cruise/function.cpp +++ b/engines/cruise/function.cpp @@ -67,8 +67,6 @@ int16 Op_Strcpy() { char *ptr1 = (char *)popPtr(); char *ptr2 = (char *)popPtr(); - //printf("strcpy %s\n",ptr1); - while (*ptr1) { *ptr2 = *ptr1; @@ -1994,7 +1992,6 @@ int32 opcodeType8() { return (-21); if (opcode < ARRAYSIZE(opcodeTablePtr) && opcodeTablePtr[opcode]) { - // printf("Function: %d\n",opcode); pushVar(opcodeTablePtr[opcode]()); return (0); } else { diff --git a/engines/cruise/overlay.cpp b/engines/cruise/overlay.cpp index 729734d261..01920fa8f1 100644 --- a/engines/cruise/overlay.cpp +++ b/engines/cruise/overlay.cpp @@ -662,6 +662,7 @@ int loadOverlay(const char *scriptName) { #endif #ifdef DUMP_OBJECT { + // TODO: Rewrite this to use Common::DumpFile int i; FILE *fHandle; char nameBundle[100]; diff --git a/engines/cruise/saveload.cpp b/engines/cruise/saveload.cpp index 24ea2facfe..a1a306705e 100644 --- a/engines/cruise/saveload.cpp +++ b/engines/cruise/saveload.cpp @@ -901,8 +901,7 @@ Common::Error loadSavegameData(int saveGameIdx) { } /*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) { diff --git a/engines/cruise/script.cpp b/engines/cruise/script.cpp index 3d07575c16..317dcfbbe6 100644 --- a/engines/cruise/script.cpp +++ b/engines/cruise/script.cpp @@ -449,7 +449,7 @@ int32 opcodeType3() { // math } 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 @@ uint8 *attacheNewScriptToTail(scriptInstanceStruct *scriptHandlePtr, int16 overl 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; |