[Scummvm-cvs-logs] SF.net SVN: scummvm: [28549] scummvm/trunk/engines/lure/scripts.cpp

dreammaster at users.sourceforge.net dreammaster at users.sourceforge.net
Sun Aug 12 13:15:37 CEST 2007


Revision: 28549
          http://scummvm.svn.sourceforge.net/scummvm/?rev=28549&view=rev
Author:   dreammaster
Date:     2007-08-12 04:15:36 -0700 (Sun, 12 Aug 2007)

Log Message:
-----------
Added missing calls to the sound system

Modified Paths:
--------------
    scummvm/trunk/engines/lure/scripts.cpp

Modified: scummvm/trunk/engines/lure/scripts.cpp
===================================================================
--- scummvm/trunk/engines/lure/scripts.cpp	2007-08-12 11:15:06 UTC (rev 28548)
+++ scummvm/trunk/engines/lure/scripts.cpp	2007-08-12 11:15:36 UTC (rev 28549)
@@ -714,17 +714,20 @@
 // Checks the status of the cell door, and starts music depending on it's state
 
 void Script::checkCellDoor(uint16 v1, uint16 v2, uint16 v3) {
-	// In the original game, this method checks to see if the cell door
-	// is currently open, if it is, starts a music sequence. 
-	// TODO: Implement starting music if cell door is open
+	Resources &res = Resources::getReference();
+	RoomExitJoinData *joinRec = res.getExitJoin(CELL_DOOR_HOTSPOT_ID);
+
+	if ((joinRec->blocked == 0) && (res.fieldList().getField(TORCH_HIDE) != 0))
+		Sound.addSound(0x15);
 }
 
 // Checks if a sound is running
 
-void Script::checkSound(uint16 hotspotId, uint16 actions, uint16 v3) {
+void Script::checkSound(uint16 hotspotId, uint16 v2, uint16 v3) {
 	// For now, simply set the general value field so that the Skorl schedule
 	// will work properly
 	Resources::getReference().fieldList().setField(GENERAL, 0);
+	// TODO: Check whether active sound can be found or not
 }
 
 typedef void(*SequenceMethodPtr)(uint16, uint16, uint16);
@@ -1155,6 +1158,7 @@
 bool HotspotScript::execute(Hotspot *h)
 {
 	Resources &r = Resources::getReference();
+	Room &room = Room::getReference();
 	MemoryBlock *scriptData = r.hotspotScriptData();
 	uint16 offset = h->hotspotScript();
 	int16 opcode = 0;
@@ -1225,14 +1229,18 @@
 		case S2_OPCODE_PLAY_SOUND:
 			param1 = nextVal(scriptData, offset);
 			param2 = nextVal(scriptData, offset);
-			debugC(ERROR_DETAILED, kLureDebugScripts, "PLAY_SOUND(%d,%d)", param1, param2);
-//			warning("UNKNOWN_247 stub called");
+error("XYZZY Params=%d,%d", param1, param2);
+
+			if ((param2 == 0) || (room.roomNumber() == param2)) {
+				debugC(ERROR_DETAILED, kLureDebugScripts, "PLAY_SOUND(%d,%d)", param1, param2);
+				Sound.addSound2((uint8)param1);
+			}
 			break;
 
 		case S2_OPCODE_STOP_SOUND:
 			param1 = nextVal(scriptData, offset);
 			debugC(ERROR_DETAILED, kLureDebugScripts, "STOP_SOUND()");
-//			warning("UNKNOWN_258 stub called");
+			Sound.stopSound((uint8)param1);
 			break;
 
 		case S2_OPCODE_ACTIONS:


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