aboutsummaryrefslogtreecommitdiff
path: root/engines/mohawk/riven_scripts.cpp
diff options
context:
space:
mode:
authorMax Horn2010-11-07 01:03:29 +0000
committerMax Horn2010-11-07 01:03:29 +0000
commitb4787d94301e4ef1ba5b2f7135fbcb0b6d3de6b8 (patch)
tree6d5815aff1421bf297867beb67f474c4fda9d3d0 /engines/mohawk/riven_scripts.cpp
parent90b6cdfbdff3e75a034c748d6d8784a0df7f5db4 (diff)
downloadscummvm-rg350-b4787d94301e4ef1ba5b2f7135fbcb0b6d3de6b8.tar.gz
scummvm-rg350-b4787d94301e4ef1ba5b2f7135fbcb0b6d3de6b8.tar.bz2
scummvm-rg350-b4787d94301e4ef1ba5b2f7135fbcb0b6d3de6b8.zip
MOHAWK: Convert all printf to debugN calls
This involves some nasty decisions, like mixing debugN and DebugPrintf calls in the RivenConsole. I added FIXME comments about this. svn-id: r54107
Diffstat (limited to 'engines/mohawk/riven_scripts.cpp')
-rw-r--r--engines/mohawk/riven_scripts.cpp44
1 files changed, 22 insertions, 22 deletions
diff --git a/engines/mohawk/riven_scripts.cpp b/engines/mohawk/riven_scripts.cpp
index 30d1d727eb..49ab260fb9 100644
--- a/engines/mohawk/riven_scripts.cpp
+++ b/engines/mohawk/riven_scripts.cpp
@@ -157,14 +157,14 @@ void RivenScript::setupOpcodes() {
static void printTabs(byte tabs) {
for (byte i = 0; i < tabs; i++)
- printf ("\t");
+ debugN("\t");
}
void RivenScript::dumpScript(Common::StringArray varNames, Common::StringArray xNames, byte tabs) {
if (_stream->pos() != 0)
_stream->seek(0);
- printTabs(tabs); printf ("Stream Type %d:\n", _scriptType);
+ printTabs(tabs); debugN("Stream Type %d:\n", _scriptType);
dumpCommands(varNames, xNames, tabs + 1);
}
@@ -178,50 +178,50 @@ void RivenScript::dumpCommands(Common::StringArray varNames, Common::StringArray
if (_stream->readUint16BE() != 2)
warning ("if-then-else unknown value is not 2");
uint16 var = _stream->readUint16BE();
- printTabs(tabs); printf("switch (%s) {\n", varNames[var].c_str());
+ printTabs(tabs); debugN("switch (%s) {\n", varNames[var].c_str());
uint16 logicBlockCount = _stream->readUint16BE();
for (uint16 j = 0; j < logicBlockCount; j++) {
uint16 varCheck = _stream->readUint16BE();
printTabs(tabs + 1);
if (varCheck == 0xFFFF)
- printf("default:\n");
+ debugN("default:\n");
else
- printf("case %d:\n", varCheck);
+ debugN("case %d:\n", varCheck);
dumpCommands(varNames, xNames, tabs + 2);
- printTabs(tabs + 2); printf("break;\n");
+ printTabs(tabs + 2); debugN("break;\n");
}
- printTabs(tabs); printf("}\n");
+ printTabs(tabs); debugN("}\n");
} else if (command == 7) { // Use the variable name
_stream->readUint16BE(); // Skip the opcode var count
printTabs(tabs);
uint16 var = _stream->readUint16BE();
- printf("%s = %d;\n", varNames[var].c_str(), _stream->readUint16BE());
+ debugN("%s = %d;\n", varNames[var].c_str(), _stream->readUint16BE());
} else if (command == 17) { // Use the external command name
_stream->readUint16BE(); // Skip the opcode var count
printTabs(tabs);
- printf("%s(", xNames[_stream->readUint16BE()].c_str());
+ debugN("%s(", xNames[_stream->readUint16BE()].c_str());
uint16 varCount = _stream->readUint16BE();
for (uint16 j = 0; j < varCount; j++) {
- printf("%d", _stream->readUint16BE());
+ debugN("%d", _stream->readUint16BE());
if (j != varCount - 1)
- printf(", ");
+ debugN(", ");
}
- printf (");\n");
+ debugN(");\n");
} else if (command == 24) { // Use the variable name
_stream->readUint16BE(); // Skip the opcode var count
printTabs(tabs);
uint16 var = _stream->readUint16BE();
- printf ("%s += %d;\n", varNames[var].c_str(), _stream->readUint16BE());
+ debugN("%s += %d;\n", varNames[var].c_str(), _stream->readUint16BE());
} else {
printTabs(tabs);
uint16 varCount = _stream->readUint16BE();
- printf("%s(", _opcodes[command].desc);
+ debugN("%s(", _opcodes[command].desc);
for (uint16 j = 0; j < varCount; j++) {
- printf("%d", _stream->readUint16BE());
+ debugN("%d", _stream->readUint16BE());
if (j != varCount - 1)
- printf(", ");
+ debugN(", ");
}
- printf(");\n");
+ debugN(");\n");
}
}
}
@@ -513,14 +513,14 @@ void RivenScript::fadeAmbientSounds(uint16 op, uint16 argc, uint16 *argv) {
// Command 38: Play a movie with extra parameters (movie id, delay high, delay low, record type, record id)
void RivenScript::complexPlayMovie(uint16 op, uint16 argc, uint16 *argv) {
warning("STUB: complexPlayMovie");
- printf ("\tMovie ID = %d\n", argv[0]);
- printf ("\tDelay = %d\n", (argv[1] << 16) + argv[2]);
+ debugN("\tMovie ID = %d\n", argv[0]);
+ debugN("\tDelay = %d\n", (argv[1] << 16) + argv[2]);
if (argv[3] == 0) {
- printf ("\tDraw PLST %d\n", argv[4]);
+ debugN("\tDraw PLST %d\n", argv[4]);
} else if (argv[3] == 40) {
- printf ("\tPlay SLST %d\n", argv[4]);
+ debugN("\tPlay SLST %d\n", argv[4]);
} else {
- error ("Unknown complexPlayMovie record type %d", argv[3]);
+ error("Unknown complexPlayMovie record type %d", argv[3]);
}
}