[Scummvm-cvs-logs] SF.net SVN: scummvm:[54833] scummvm/trunk/engines/mohawk

fuzzie at users.sourceforge.net fuzzie at users.sourceforge.net
Wed Dec 8 16:45:40 CET 2010


Revision: 54833
          http://scummvm.svn.sourceforge.net/scummvm/?rev=54833&view=rev
Author:   fuzzie
Date:     2010-12-08 15:45:40 +0000 (Wed, 08 Dec 2010)

Log Message:
-----------
MOHAWK: Use named constants for LB opcodes, add warnings when unimplemented

Modified Paths:
--------------
    scummvm/trunk/engines/mohawk/livingbooks.cpp
    scummvm/trunk/engines/mohawk/livingbooks.h

Modified: scummvm/trunk/engines/mohawk/livingbooks.cpp
===================================================================
--- scummvm/trunk/engines/mohawk/livingbooks.cpp	2010-12-08 15:45:22 UTC (rev 54832)
+++ scummvm/trunk/engines/mohawk/livingbooks.cpp	2010-12-08 15:45:40 UTC (rev 54833)
@@ -2129,73 +2129,125 @@
 				}
 
 				switch (entry->opcode) {
-				case 0xffff:
-					runCommand(entry->command);
+				case kLBOpNone:
+					warning("ignoring kLBOpNone (event 0x%04x, param 0x%04x, target '%s')",
+						entry->event, entry->param, target->_desc.c_str());
 					break;
 
-				case 1:
+				case kLBOpXShow:
 					// TODO: should be setVisible(true) - not a delayed event -
 					// when we're doing the param 1/2/3 stuff above?
 					// and in modern LB this is perhaps just a direct target->setVisible(true)..
 					_vm->queueDelayedEvent(DelayedEvent(this, kLBDelayedEventSetNotVisible));
 					break;
 
-				case 2:
+				case kLBOpTogglePlay:
 					target->togglePlaying(false);
 					break;
 
-				case 3:
+				case kLBOpSetNotVisible:
 					target->setVisible(false);
 					break;
 
-				case 4:
+				case kLBOpSetVisible:
 					target->setVisible(true);
 					break;
 
-				case 5:
+				case kLBOpDestroy:
 					target->destroySelf();
 					break;
 
-				case 6:
-					target->seek(1);
+				case kLBOpRewind:
+					target->seek(0);
 					break;
 
-				case 7:
+				case kLBOpStop:
 					target->stop();
 					break;
 
-				case 8:
+				case kLBOpDisable:
 					target->setEnabled(false);
 					break;
 
-				case 9:
+				case kLBOpEnable:
 					target->setEnabled(true);
 					break;
 
-				case 0xb:
+				case kLBOpGlobalSetNotVisible:
 					target->setGlobalVisible(false);
 					break;
 
-				case 0xc:
+				case kLBOpGlobalSetVisible:
 					target->setGlobalVisible(true);
 					break;
 
-				case 0xd:
+				case kLBOpGlobalDisable:
 					target->setGlobalEnabled(false);
 					break;
 
-				case 0xe:
+				case kLBOpGlobalEnable:
 					target->setGlobalEnabled(true);
 					break;
 
-				case 0xf:
+				case kLBOpSeekToEnd:
 					target->seek(0xFFFF);
 					break;
 
+				case kLBOpMute:
+				case kLBOpUnmute:
+					// FIXME
+					warning("ignoring kLBOpMute/Unmute (event 0x%04x, param 0x%04x, target '%s')",
+						entry->event, entry->param, target->_desc.c_str());
+					break;
+
+				case kLBOpLoad:
+				case kLBOpPreload:
+				case kLBOpUnload:
+					// FIXME
+					warning("ignoring kLBOpLoad/Preload/Unload (event 0x%04x, param 0x%04x, target '%s')",
+						entry->event, entry->param, target->_desc.c_str());
+					break;
+
+				case kLBOpSeekToPrev:
+				case kLBOpSeekToNext:
+					// FIXME
+					warning("ignoring kLBOpSeekToPrev/Next (event 0x%04x, param 0x%04x, target '%s')",
+						entry->event, entry->param, target->_desc.c_str());
+					break;
+
+				case kLBOpDragBegin:
+				case kLBOpDragEnd:
+					// FIXME
+					warning("ignoring kLBOpDragBegin/End (event 0x%04x, param 0x%04x, target '%s')",
+						entry->event, entry->param, target->_desc.c_str());
+					break;
+
+				case kLBOpScriptDisable:
+				case kLBOpScriptEnable:
+					// FIXME
+					warning("ignoring kLBOpScriptDisable/Enable (event 0x%04x, param 0x%04x, target '%s')",
+						entry->event, entry->param, target->_desc.c_str());
+					break;
+
+				case kLBOpUnknown1C:
+					// FIXME
+					warning("ignoring kLBOpUnknown1C (event 0x%04x, param 0x%04x, target '%s')",
+						entry->event, entry->param, target->_desc.c_str());
+					break;
+
+				case kLBOpSendExpression:
+					// FIXME
+					warning("ignoring kLBOpSendExpression (event 0x%04x, param 0x%04x, target '%s')",
+						entry->event, entry->param, target->_desc.c_str());
+					break;
+
+				case kLBOpRunCommand:
+					runCommand(entry->command);
+					break;
+
 				default:
-					// TODO
-					warning("Ignoring script entry (type 0x%04x, event 0x%04x, opcode 0x%04x, param 0x%04x)",
-						entry->type, entry->event, entry->opcode, entry->param);
+					error("Unknown script opcode (type 0x%04x, event 0x%04x, opcode 0x%04x, param 0x%04x, target '%s')",
+						entry->type, entry->event, entry->opcode, entry->param, target->_desc.c_str());
 				}
 			}
 		}

Modified: scummvm/trunk/engines/mohawk/livingbooks.h
===================================================================
--- scummvm/trunk/engines/mohawk/livingbooks.h	2010-12-08 15:45:22 UTC (rev 54832)
+++ scummvm/trunk/engines/mohawk/livingbooks.h	2010-12-08 15:45:40 UTC (rev 54833)
@@ -146,6 +146,40 @@
 };
 
 enum {
+	kLBOpNone = 0x0,
+	kLBOpXShow = 0x1,
+	kLBOpTogglePlay = 0x2,
+	kLBOpSetNotVisible = 0x3,
+	kLBOpSetVisible = 0x4,
+	kLBOpDestroy = 0x5,
+	kLBOpRewind = 0x6,
+	kLBOpStop = 0x7,
+	kLBOpDisable = 0x8,
+	kLBOpEnable = 0x9,
+	// (no 0xa)
+	kLBOpGlobalSetNotVisible = 0xb,
+	kLBOpGlobalSetVisible = 0xc,
+	kLBOpGlobalDisable = 0xd,
+	kLBOpGlobalEnable = 0xe,
+	kLBOpSeekToEnd = 0xf,
+	// (no 0x10)
+	kLBOpMute = 0x11,
+	kLBOpUnmute = 0x12,
+	kLBOpLoad = 0x13,
+	kLBOpPreload = 0x14,
+	kLBOpUnload = 0x15,
+	kLBOpSeekToNext = 0x16,
+	kLBOpSeekToPrev = 0x17,
+	kLBOpDragBegin = 0x18,
+	kLBOpDragEnd = 0x19,
+	kLBOpScriptDisable = 0x1a,
+	kLBOpScriptEnable = 0x1b,
+	kLBOpUnknown1C = 0x1c,
+	kLBOpSendExpression = 0x1d,
+	kLBOpRunCommand = 0xffff
+};
+
+enum {
 	kLBNotifyGUIAction = 1,
 	kLBNotifyGoToControls = 2,
 	kLBNotifyChangePage = 3,


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