[Scummvm-cvs-logs] scummvm master -> e5533401dc5c10609072794b596a87a0be2c3786

fuzzie fuzzie at fuzzie.org
Thu Mar 31 00:20:05 CEST 2011


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
e5533401dc MOHAWK: Nicer names/info for some LB data.


Commit: e5533401dc5c10609072794b596a87a0be2c3786
    https://github.com/scummvm/scummvm/commit/e5533401dc5c10609072794b596a87a0be2c3786
Author: Alyssa Milburn (fuzzie at fuzzie.org)
Date: 2011-03-30T15:18:00-07:00

Commit Message:
MOHAWK: Nicer names/info for some LB data.

Changed paths:
    engines/mohawk/livingbooks.cpp
    engines/mohawk/livingbooks.h



diff --git a/engines/mohawk/livingbooks.cpp b/engines/mohawk/livingbooks.cpp
index 20bedf8..de87c7f 100644
--- a/engines/mohawk/livingbooks.cpp
+++ b/engines/mohawk/livingbooks.cpp
@@ -2077,22 +2077,22 @@ void LBItem::readData(uint16 type, uint16 size, Common::SeekableSubReadStreamEnd
 		debug(2, "kLBSetPlayPhase: %d", _phase);
 		break;
 
-	case kLBUnknown6F:
+	case kLBSetKeyNotify:
 		{
+		// FIXME: variable-size notifies, targets
 		if (size != 18)
 			error("0x6f had wrong size (%d)", size);
-		uint u1 = stream->readUint16();
-		uint u2 = stream->readUint16();
 		uint event = stream->readUint16();
+		LBKey key;
+		stream->read(&key, 4);
 		uint opcode = stream->readUint16();
 		uint param = stream->readUint16();
 		uint u6 = stream->readUint16();
 		uint u7 = stream->readUint16();
 		uint u8 = stream->readUint16();
 		uint u9 = stream->readUint16();
-		// FIXME: this is scripting stuff
-		warning("0x6f: unknown: item %s, unknowns: %04x, %04x, event %04x, opcode %04x, param %04x, unknowns %04x, %04x, %04x, %04x",
-			_desc.c_str(), u1, u2, event, opcode, param, u6, u7, u8, u9);
+		warning("ignoring kLBSetKeyNotify: item %s, key code %02x (modifier mask %d, char %d, repeat %d), event %04x, opcode %04x, param %04x, unknowns %04x, %04x, %04x, %04x",
+			_desc.c_str(), key.code, key.modifiers, key.char_, key.repeats, event, opcode, param, u6, u7, u8, u9);
 		}
 		break;
 
@@ -2126,27 +2126,27 @@ void LBItem::readData(uint16 type, uint16 size, Common::SeekableSubReadStreamEnd
 		_isAmbient = true;
 		break;
 
-	case kLBUnknown7D:
+	case kLBSetKeyEvent:
 		{
+		// FIXME: targets
 		if (size != 10)
-			error("0x7d had wrong size (%d)", size);
-		uint u1 = stream->readUint16();
-		uint key = stream->readUint16();
+			error("kLBSetKeyEvent had wrong size (%d)", size);
 		uint u3 = stream->readUint16();
+		LBKey key;
+		stream->read(&key, 4);
 		uint target = stream->readUint16();
-		byte event = stream->readByte();
-		byte u4 = stream->readByte();
+		uint16 event = stream->readUint16();
 		// FIXME: this is scripting stuff: what to run when key is pressed
-		warning("0x7d: unknown: item %s, unknown %04x, key %04x, unknown %04x, target %d, event %02x, unknown %02x",
-			_desc.c_str(), u1, key, u3, target, event, u4);
+		warning("ignoring kLBSetKeyEvent: item %s, key code %02x (modifier mask %d, char %d, repeat %d) unknown %04x, target %d, event %04x",
+			_desc.c_str(), key.code, key.modifiers, key.char_, key.repeats, u3, target, event);
 		}
 		break;
 
-	case kLBUnknown80:
+	case kLBSetHitTest:
 		{
 		assert(size == 2);
 		uint id = stream->readUint16();
-		warning("0x80: unknown: item %s, id %04x", _desc.c_str(), id);
+		warning("kLBSetHitTest: unknown: item %s, value %04x", _desc.c_str(), id);
 		// FIXME
 		}
 		break;
diff --git a/engines/mohawk/livingbooks.h b/engines/mohawk/livingbooks.h
index 9e4a5e0..8eb6f7e 100644
--- a/engines/mohawk/livingbooks.h
+++ b/engines/mohawk/livingbooks.h
@@ -42,6 +42,17 @@
 
 namespace Mohawk {
 
+#define LBKEY_MOD_CTRL 1
+#define LBKEY_MOD_ALT 2
+#define LBKEY_MOD_SHIFT 4
+
+struct LBKey {
+	byte code;
+	byte modifiers;
+	byte char_;
+	byte repeats;
+};
+
 enum NodeState {
 	kLBNodeDone = 0,
 	kLBNodeRunning = 1,
@@ -152,7 +163,7 @@ enum {
 	kLBSetOneShot = 0x6d,    // unused?
 	kLBSetPlayPhase = 0x6e,
 	// from here, 2.x+
-	kLBUnknown6F = 0x6f,
+	kLBSetKeyNotify = 0x6f,
 	kLBCommand = 0x70,
 	kLBPaletteAData = 0x71,  // unused?
 	kLBPaletteXData = 0x72,
@@ -166,10 +177,10 @@ enum {
 	kLBGlobalSetVisible = 0x7a, // unused?
 	kLBSetAmbient = 0x7b,
 	kLBUnknown7C = 0x7c,     // unused?
-	kLBUnknown7D = 0x7d,
+	kLBSetKeyEvent = 0x7d,
 	kLBUnknown7E = 0x7e,     // unused? (rect flag)
 	kLBSetParent = 0x7f,     // unused?
-	kLBUnknown80 = 0x80,      // unused? TODO: sets +36
+	kLBSetHitTest = 0x80,
 	// from here, rugrats
 	kLBUnknown194 = 0x194
 };






More information about the Scummvm-git-logs mailing list