aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2007-08-12 11:15:36 +0000
committerPaul Gilbert2007-08-12 11:15:36 +0000
commit4cf99284a7bee82fe9d945aa21592ad93a4d0c73 (patch)
tree60530e6c253af58e55130e51c4e289c828ff6ec2
parent81fa23f0918d239ae25064d8a71e46bdb564526c (diff)
downloadscummvm-rg350-4cf99284a7bee82fe9d945aa21592ad93a4d0c73.tar.gz
scummvm-rg350-4cf99284a7bee82fe9d945aa21592ad93a4d0c73.tar.bz2
scummvm-rg350-4cf99284a7bee82fe9d945aa21592ad93a4d0c73.zip
Added missing calls to the sound system
svn-id: r28549
-rw-r--r--engines/lure/scripts.cpp22
1 files changed, 15 insertions, 7 deletions
diff --git a/engines/lure/scripts.cpp b/engines/lure/scripts.cpp
index 3ce1b916b3..f9b579b778 100644
--- a/engines/lure/scripts.cpp
+++ b/engines/lure/scripts.cpp
@@ -714,17 +714,20 @@ void Script::randomToGeneral(uint16 maxVal, uint16 minVal, uint16 v3) {
// 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 @@ int16 HotspotScript::nextVal(MemoryBlock *data, uint16 &offset) {
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 @@ bool HotspotScript::execute(Hotspot *h)
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: