From 8a77f49a59fd9e4f1444072fe67f27c7a86d97b1 Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Mon, 3 Jan 2011 20:40:07 +0000 Subject: MOHAWK: Cleanup some spacing, formatting, and naming svn-id: r55109 --- engines/mohawk/myst_scripts.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'engines/mohawk/myst_scripts.cpp') diff --git a/engines/mohawk/myst_scripts.cpp b/engines/mohawk/myst_scripts.cpp index f463014e61..7e481c9c1a 100644 --- a/engines/mohawk/myst_scripts.cpp +++ b/engines/mohawk/myst_scripts.cpp @@ -289,12 +289,14 @@ void MystScriptParser::unknown(uint16 op, uint16 var, uint16 argc, uint16 *argv) warning("Unimplemented opcode 0x%02x (%d)", op, op); warning("\tUses var %d", var); warning("\tArg count = %d", argc); + if (argc) { Common::String str; str += Common::String::format("%d", argv[0]); - for (uint16 i = 1; i < argc; i++) { + + for (uint16 i = 1; i < argc; i++) str += Common::String::format(", %d", argv[i]); - } + warning("\tArgs: %s\n", str.c_str()); } } @@ -312,9 +314,8 @@ void MystScriptParser::o_toggleVar(uint16 op, uint16 var, uint16 argc, uint16 *a void MystScriptParser::o_setVar(uint16 op, uint16 var, uint16 argc, uint16 *argv) { debugC(kDebugScript, "Opcode %d: Set var %d: %d", op, var, argv[0]); - if (setVarValue(var, argv[0])) { + if (setVarValue(var, argv[0])) _vm->redrawArea(var); - } } void MystScriptParser::o_changeCardSwitch(uint16 op, uint16 var, uint16 argc, uint16 *argv) { @@ -376,9 +377,9 @@ void MystScriptParser::o_triggerMovie(uint16 op, uint16 var, uint16 argc, uint16 // TODO: If movie has sound, pause background music int16 direction = 1; - if (argc == 1) { + if (argc == 1) direction = argv[0]; - } + debugC(kDebugScript, "\tDirection: %d", direction); // Trigger resource 6 movie overriding play direction @@ -630,8 +631,8 @@ void MystScriptParser::o_copyImageToBackBuffer(uint16 op, uint16 var, uint16 arg // for use by this opcode and VIEW sound block. // TODO: Though the playSound and PlaySoundBlocking opcodes play sounds immediately, // this opcode changes the main background sound playing.. -// Current behaviour here and with VIEW sound block is not right as demonstrated -// by Channelwood Card 3280 (Tank Valve) and water flow sound behaviour in pipe +// Current behavior here and with VIEW sound block is not right as demonstrated +// by Channelwood Card 3280 (Tank Valve) and water flow sound behavior in pipe // on cards leading from shed... void MystScriptParser::o_changeBackgroundSound(uint16 op, uint16 var, uint16 argc, uint16 *argv) { varUnusedCheck(op, var); @@ -710,6 +711,7 @@ void MystScriptParser::o_soundPlaySwitch(uint16 op, uint16 var, uint16 argc, uin debugC(kDebugScript, "Opcode %d: Switch Choice of Play Sound", op); uint16 value = getVar(var); + if (value < argc) { uint16 soundId = argv[value]; debugC(kDebugScript, "\tvar: %d", var); -- cgit v1.2.3