diff options
author | Paul Gilbert | 2007-08-25 06:03:24 +0000 |
---|---|---|
committer | Paul Gilbert | 2007-08-25 06:03:24 +0000 |
commit | 234c2a5770a78e5044b8fe2fb86d42fe0dee3c83 (patch) | |
tree | 89fe3e70c0feb30f04586ec13eca18ab1803e753 | |
parent | 37cdd1c69ad4a1750c3041d5cceeed676da9061f (diff) | |
download | scummvm-rg350-234c2a5770a78e5044b8fe2fb86d42fe0dee3c83.tar.gz scummvm-rg350-234c2a5770a78e5044b8fe2fb86d42fe0dee3c83.tar.bz2 scummvm-rg350-234c2a5770a78e5044b8fe2fb86d42fe0dee3c83.zip |
Fixed up several sound system script methods
svn-id: r28712
-rw-r--r-- | engines/lure/scripts.cpp | 28 | ||||
-rw-r--r-- | engines/lure/scripts.h | 8 |
2 files changed, 19 insertions, 17 deletions
diff --git a/engines/lure/scripts.cpp b/engines/lure/scripts.cpp index 6e34162074..68714da526 100644 --- a/engines/lure/scripts.cpp +++ b/engines/lure/scripts.cpp @@ -75,8 +75,8 @@ void Script::setHotspotScript(uint16 hotspotId, uint16 scriptIndex, uint16 v3) { } } -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 @@ void Script::deactivateHotspot(uint16 hotspotId, uint16 v2, uint16 v3) { 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 @@ void Script::addDelayedSequence(uint16 seqOffset, uint16 delay, uint16 canClear) // 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 @@ void Script::setHotspotName(uint16 hotspotId, uint16 nameId, uint16 v3) { // 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 @@ void Script::startSpeakingToNoone(uint16 characterId, uint16 stringId, uint16 v3 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 @@ void Script::checkCellDoor(uint16 v1, uint16 v2, uint16 v3) { // 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 @@ SequenceMethodRecord scriptMethods[] = { {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 @@ bool HotspotScript::execute(Hotspot *h) 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; diff --git a/engines/lure/scripts.h b/engines/lure/scripts.h index 1191017d11..bcc9147896 100644 --- a/engines/lure/scripts.h +++ b/engines/lure/scripts.h @@ -79,25 +79,25 @@ public: 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); |