[Scummvm-cvs-logs] SF.net SVN: scummvm: [31595] scummvm/trunk/engines/kyra

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Sun Apr 20 14:34:17 CEST 2008


Revision: 31595
          http://scummvm.svn.sourceforge.net/scummvm/?rev=31595&view=rev
Author:   lordhoto
Date:     2008-04-20 05:34:16 -0700 (Sun, 20 Apr 2008)

Log Message:
-----------
Implemented opcodes:
 - 64: o3_checkInRect
 - 87: o3_stopMusic
 - 88: o3_playMusicTrack

Modified Paths:
--------------
    scummvm/trunk/engines/kyra/kyra_v3.cpp
    scummvm/trunk/engines/kyra/kyra_v3.h
    scummvm/trunk/engines/kyra/script_v3.cpp

Modified: scummvm/trunk/engines/kyra/kyra_v3.cpp
===================================================================
--- scummvm/trunk/engines/kyra/kyra_v3.cpp	2008-04-20 11:59:22 UTC (rev 31594)
+++ scummvm/trunk/engines/kyra/kyra_v3.cpp	2008-04-20 12:34:16 UTC (rev 31595)
@@ -464,9 +464,8 @@
 void KyraEngine_v3::preinit() {
 	debugC(9, kDebugLevelMain, "KyraEngine_v3::preinit()");
 	
-	_unkBuffer1040Bytes = new uint8[1040];
-	_itemBuffer1 = new uint8[72];
-	_itemBuffer2 = new uint8[144];
+	_itemBuffer1 = new int8[72];
+	_itemBuffer2 = new int8[144];
 	initMouseShapes();
 	initItems();
 

Modified: scummvm/trunk/engines/kyra/kyra_v3.h
===================================================================
--- scummvm/trunk/engines/kyra/kyra_v3.h	2008-04-20 11:59:22 UTC (rev 31594)
+++ scummvm/trunk/engines/kyra/kyra_v3.h	2008-04-20 12:34:16 UTC (rev 31595)
@@ -258,8 +258,8 @@
 	uint8 *getTableEntry(uint8 *buffer, int id);
 
 	// items
-	uint8 *_itemBuffer1;
-	uint8 *_itemBuffer2;
+	int8 *_itemBuffer1;
+	int8 *_itemBuffer2;
 	struct Item {
 		uint16 id;
 		uint16 sceneId;
@@ -505,7 +505,6 @@
 	int _newShapeDelay;
 
 	// unk
-	uint8 *_unkBuffer1040Bytes;
 	uint8 *_costPalBuffer;
 	uint8 *_screenBuffer;
 	uint8 *_gfxBackUpRect;
@@ -541,6 +540,9 @@
 	int o3_badConscienceChat(ScriptState *script);
 	int o3_delay(ScriptState *script);
 	int o3_setSceneFilename(ScriptState *script);
+	int o3_checkInRect(ScriptState *script);
+	int o3_stopMusic(ScriptState *script);
+	int o3_playMusicTrack(ScriptState *script);
 	int o3_playSoundEffect(ScriptState *script);
 	int o3_getRand(ScriptState *script);
 	int o3_defineRoomEntrance(ScriptState *script);

Modified: scummvm/trunk/engines/kyra/script_v3.cpp
===================================================================
--- scummvm/trunk/engines/kyra/script_v3.cpp	2008-04-20 11:59:22 UTC (rev 31594)
+++ scummvm/trunk/engines/kyra/script_v3.cpp	2008-04-20 12:34:16 UTC (rev 31595)
@@ -206,6 +206,43 @@
 	return 0;
 }
 
+int KyraEngine_v3::o3_checkInRect(ScriptState *script) {
+	debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_checkInRect(%p) (%d, %d, %d, %d, %d, %d)", (const void *)script,
+			stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5));
+	const int x1 = stackPos(0);
+	const int y1 = stackPos(1);
+	const int x2 = stackPos(2);
+	const int y2 = stackPos(3);
+	int x = stackPos(4), y = stackPos(5);
+	if (_itemInHand >= 0) {
+		const int8 *desc = &_itemBuffer2[_itemInHand*2];
+		x -= 12;
+		x += desc[0];
+		y -= 19;
+		y += desc[1];
+	}
+
+	if (x >= x1 && x <= x2 && y >= y1 && y <= y2) {
+		//XXX
+		return 1;
+	} else {
+		//XXX
+		return 0;
+	}
+}
+
+int KyraEngine_v3::o3_stopMusic(ScriptState *script) {
+	debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_stopMusic(%p) ()", (const void *)script);
+	stopMusicTrack();
+	return 0;
+}
+
+int KyraEngine_v3::o3_playMusicTrack(ScriptState *script) {
+	debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_playMusicTrack(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
+	playMusicTrack(stackPos(0), stackPos(1));
+	return 0;
+}
+
 int KyraEngine_v3::o3_playSoundEffect(ScriptState *script) {
 	debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v3::o3_playSoundEffect(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
 	playSoundEffect(stackPos(0), stackPos(1));
@@ -519,9 +556,9 @@
 		OpcodeUnImpl(),
 		OpcodeUnImpl(),
 		// 0x40
+		Opcode(o3_checkInRect),
 		OpcodeUnImpl(),
 		OpcodeUnImpl(),
-		OpcodeUnImpl(),
 		Opcode(o3_dummy),
 		// 0x44
 		Opcode(o3_dummy),
@@ -547,9 +584,9 @@
 		Opcode(o3_dummy),
 		Opcode(o3_dummy),
 		OpcodeUnImpl(),
-		OpcodeUnImpl(),
+		Opcode(o3_stopMusic),
 		// 0x58
-		OpcodeUnImpl(),
+		Opcode(o3_playMusicTrack),
 		Opcode(o3_playSoundEffect),
 		OpcodeUnImpl(),
 		OpcodeUnImpl(),


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