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

dreammaster at users.sourceforge.net dreammaster at users.sourceforge.net
Sat Aug 25 08:03:24 CEST 2007


Revision: 28712
          http://scummvm.svn.sourceforge.net/scummvm/?rev=28712&view=rev
Author:   dreammaster
Date:     2007-08-24 23:03:24 -0700 (Fri, 24 Aug 2007)

Log Message:
-----------
Fixed up several sound system script methods

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

Modified: scummvm/trunk/engines/lure/scripts.cpp
===================================================================
--- scummvm/trunk/engines/lure/scripts.cpp	2007-08-24 20:14:51 UTC (rev 28711)
+++ scummvm/trunk/engines/lure/scripts.cpp	2007-08-25 06:03:24 UTC (rev 28712)
@@ -75,8 +75,8 @@
 	}
 }
 
-void Script::addSound2(uint16 soundId, uint16 v2, uint16 v3) {
-	// TODO: Not yet implemented
+void Script::addSound2(uint16 soundIndex, uint16 v2, uint16 v3) {
+	Sound.addSound2(soundIndex);
 }
 
 // Sets the bitmask indicating what group of rooms/hotspots to display when the
@@ -132,8 +132,7 @@
 		hs->layer = 0xff;
 }
 
-// Sets the offset for the table of action sequence offsets for the given
-// hotspot
+// Sets the offset for the table of action sequence offsets for the given hotspot
 
 void Script::setDesc(uint16 hotspotId, uint16 descId, uint16 v3) {
 	Resources &res = Resources::getReference();
@@ -151,8 +150,8 @@
 
 // Stops the specified sound
 
-void Script::killSound(uint16 soundId, uint16 v2, uint16 v3) {
-	// TODO
+void Script::killSound(uint16 soundNumber, uint16 v2, uint16 v3) {
+	Sound.musicInterface_Stop(soundNumber);
 }
 
 // Checks whether the given character is in the specified room, and stores
@@ -179,8 +178,8 @@
 
 // Unsure about this method, but at the moment I think it plays a sound
 
-void Script::addSound(uint16 v1, uint16 v2, uint16 v3) {
-	// TODO: No implementation currently	
+void Script::addSound(uint16 soundIndex, uint16 v2, uint16 v3) {
+	Sound.addSound(soundIndex);
 }
 
 void Script::endgameSequence(uint16 v1, uint16 v2, uint16 v3) {
@@ -251,10 +250,10 @@
 	charHotspot->converse(NOONE_ID, stringId, false);
 }
 
+// Stops playing the specified sound index
 
-void Script::playMusic(uint16 musicNum, uint16 v2, uint16 v3) {
-	// TODO: Play a given music
-	warning("TODO: Play music #%d", musicNum);
+void Script::stopSound(uint16 soundIndex, uint16 v2, uint16 v3) {
+	Sound.stopSound(soundIndex);
 }
 
 // Gets the current blocked state for the given door and stores it in the
@@ -724,9 +723,12 @@
 // Checks if a sound is running
 
 void Script::checkSound(uint16 hotspotId, uint16 v2, uint16 v3) {
+	Sound.tidySounds();
+
 	// 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
 }
 
@@ -759,7 +761,7 @@
 	{18, Script::remoteRoomViewSetup},
 	{19, Script::startSpeakingToNoone},
 	{20, Script::checkCellDoor},
-	{21, Script::playMusic},
+	{21, Script::stopSound},
 	{22, Script::getDoorBlocked},
 	{23, Script::isSkorlInCell},
 	{24, Script::ratpouchPushBricks},
@@ -1231,7 +1233,7 @@
 			param2 = nextVal(scriptData, offset);
 
 			if ((param2 == 0) || (room.roomNumber() == param2)) {
-				debugC(ERROR_DETAILED, kLureDebugScripts, "PLAY_SOUND(%d,%d)", param1, param2);
+				debugC(ERROR_DETAILED, kLureDebugScripts, "PLAY_SOUND(%d,%d)", param2, param1);
 				Sound.addSound2((uint8)param1);
 			}
 			break;

Modified: scummvm/trunk/engines/lure/scripts.h
===================================================================
--- scummvm/trunk/engines/lure/scripts.h	2007-08-24 20:14:51 UTC (rev 28711)
+++ scummvm/trunk/engines/lure/scripts.h	2007-08-25 06:03:24 UTC (rev 28712)
@@ -79,25 +79,25 @@
 
 	static void activateHotspot(uint16 hotspotId, uint16 v2, uint16 v3);
 	static void setHotspotScript(uint16 hotspotId, uint16 scriptIndex, uint16 v3);
-	static void addSound2(uint16 v1, uint16 v2, uint16 v3);
+	static void addSound2(uint16 soundIndex, uint16 v2, uint16 v3);
 	static void setHotspotFlagMask(uint16 maskVal, uint16 v2, uint16 v3);
 	static void clearSequenceDelayList(uint16 v1, uint16 scriptIndex, uint16 v3);
 	static void deactivateHotspotSet(uint16 listIndex, uint16 v2, uint16 v3);
 	static void deactivateHotspot(uint16 hotspotId, uint16 v2, uint16 v3);
 	static void resetPathfinder(uint16 v1, uint16 v2, uint16 v3);
 	static void addDelayedSequence(uint16 seqOffset, uint16 delay, uint16 canClear);
-	static void killSound(uint16 soundId, uint16 v2, uint16 v3);
+	static void killSound(uint16 soundNumber, uint16 v2, uint16 v3);
 	static void characterInRoom(uint16 characterId, uint16 roomNumber, uint16 v3);
 	static void setDesc(uint16 hotspotId, uint16 descId, uint16 v3);
 	static void setHotspotName(uint16 hotspotId, uint16 nameId, uint16 v3);
-	static void addSound(uint16 soundId, uint16 v2, uint16 v3);
+	static void addSound(uint16 soundIndex, uint16 v2, uint16 v3);
 	static void endgameSequence(uint16 v1, uint16 v2, uint16 v3);
 	static void setupPigFight(uint16 v1, uint16 v2, uint16 v3);
 	static void displayDialog(uint16 stringId, uint16 v2, uint16 v3);
 	static void setupSkorlFight(uint16 v1, uint16 v2, uint16 v3);
 	static void remoteRoomViewSetup(uint16 v1, uint16 v2, uint16 v3);
 	static void startSpeakingToNoone(uint16 characterId, uint16 stringId, uint16 v3);
-	static void playMusic(uint16 musicNum, uint16 v2, uint16 v3);
+	static void stopSound(uint16 soundIndex, uint16 v2, uint16 v3);
 	static void getDoorBlocked(uint16 hotspotId, uint16 v2, uint16 v3);
 	static void isSkorlInCell(uint16 v1, uint16 v2, uint16 v3);
 	static void ratpouchPushBricks(uint16 v1, uint16 v2, uint16 v3);


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