aboutsummaryrefslogtreecommitdiff
path: root/engines/mohawk/myst_scripts.cpp
diff options
context:
space:
mode:
authorMatthew Hoops2011-01-03 20:40:07 +0000
committerMatthew Hoops2011-01-03 20:40:07 +0000
commit8a77f49a59fd9e4f1444072fe67f27c7a86d97b1 (patch)
tree0c4469165277e7b22b3dcd4d061321753f8c48dc /engines/mohawk/myst_scripts.cpp
parentcdb5e55f75652f218549508838c68a6906f0489a (diff)
downloadscummvm-rg350-8a77f49a59fd9e4f1444072fe67f27c7a86d97b1.tar.gz
scummvm-rg350-8a77f49a59fd9e4f1444072fe67f27c7a86d97b1.tar.bz2
scummvm-rg350-8a77f49a59fd9e4f1444072fe67f27c7a86d97b1.zip
MOHAWK: Cleanup some spacing, formatting, and naming
svn-id: r55109
Diffstat (limited to 'engines/mohawk/myst_scripts.cpp')
-rw-r--r--engines/mohawk/myst_scripts.cpp18
1 files changed, 10 insertions, 8 deletions
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);