aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorBenjamin Haisch2009-06-16 10:56:12 +0000
committerWillem Jan Palenstijn2011-11-20 22:43:07 +0100
commitaf7e1c16833c2fb3df5c6079262d1e18d7959365 (patch)
tree2b10357fba6e99db2df19a07c00f6d81b217115b /engines
parenteab360f3e7e1d4757ec3f8d64724863b61bb0b82 (diff)
downloadscummvm-rg350-af7e1c16833c2fb3df5c6079262d1e18d7959365.tar.gz
scummvm-rg350-af7e1c16833c2fb3df5c6079262d1e18d7959365.tar.bz2
scummvm-rg350-af7e1c16833c2fb3df5c6079262d1e18d7959365.zip
TOLTECS: - Fixed sound playing
- Renaming
Diffstat (limited to 'engines')
-rw-r--r--engines/toltecs/script.cpp40
-rw-r--r--engines/toltecs/script.h4
-rw-r--r--engines/toltecs/sound.cpp4
3 files changed, 37 insertions, 11 deletions
diff --git a/engines/toltecs/script.cpp b/engines/toltecs/script.cpp
index 6d4976d75a..188cb82f7f 100644
--- a/engines/toltecs/script.cpp
+++ b/engines/toltecs/script.cpp
@@ -127,8 +127,8 @@ void ScriptInterpreter::setupScriptFunctions() {
RegisterScriptFunction(sfStopShakeScreen);
RegisterScriptFunction(sfStartSequence);
RegisterScriptFunction(sfEndSequence);
- RegisterScriptFunction(sfSequenceVolumeStuff);
- RegisterScriptFunction(sfPlaySound1);
+ RegisterScriptFunction(sfSetSequenceVolume);
+ RegisterScriptFunction(sfPlayPositionalSound);
RegisterScriptFunction(sfPlaySound2);
RegisterScriptFunction(sfClearScreen);
RegisterScriptFunction(sfNop);
@@ -143,9 +143,6 @@ void ScriptInterpreter::setupScriptFunctions() {
RegisterScriptFunction(sfPlayMovie);
RegisterScriptFunction(sfNop);
-
-
-
}
void ScriptInterpreter::loadScript(uint resIndex, uint slotIndex) {
@@ -1045,18 +1042,20 @@ void ScriptInterpreter::sfStopShakeScreen() {
void ScriptInterpreter::sfStartSequence() {
// TODO
+ //_vm->_arc->dump(arg16(3));
}
void ScriptInterpreter::sfEndSequence() {
// TODO
}
-void ScriptInterpreter::sfSequenceVolumeStuff() {
+void ScriptInterpreter::sfSetSequenceVolume() {
// TODO
}
-void ScriptInterpreter::sfPlaySound1() {
+void ScriptInterpreter::sfPlayPositionalSound() {
// TODO
+ debug("ScriptInterpreter::sfPlayPositionalSound()");
}
void ScriptInterpreter::sfPlaySound2() {
@@ -1078,15 +1077,42 @@ void ScriptInterpreter::sfRunOptionsScreen() {
}
void ScriptInterpreter::sfPrecacheSprites() {
+#if 0
+ // DEBUG
+ int16 *resArray = (int16*)localPtr(arg16(3));
+ while (*resArray != -1) {
+ debug("ScriptInterpreter::sfPrecacheSprites() index = %d", *resArray);
+ _vm->_arc->dump(*resArray, "pc1");
+ resArray++;
+ }
+#endif
}
void ScriptInterpreter::sfPrecacheSounds1() {
+#if 0
+ // DEBUG
+ int16 *resArray = (int16*)localPtr(arg16(3));
+ while (*resArray != -1) {
+ debug("ScriptInterpreter::sfPrecacheSounds1() index = %d", *resArray);
+ _vm->_arc->dump(*resArray, "pc2");
+ resArray++;
+ }
+#endif
}
void ScriptInterpreter::sfDeleteAllPbfFilesByExternalArray() {
}
void ScriptInterpreter::sfPrecacheSounds2() {
+#if 0
+ // DEBUG
+ int16 *resArray = (int16*)localPtr(arg16(3));
+ while (*resArray != -1) {
+ debug("ScriptInterpreter::sfPrecacheSounds2() index = %d", *resArray);
+ _vm->_arc->dump(*resArray, "pc3");
+ resArray++;
+ }
+#endif
}
void ScriptInterpreter::sfRestoreStackPtr() {
diff --git a/engines/toltecs/script.h b/engines/toltecs/script.h
index c35a2e4184..746a2fca6f 100644
--- a/engines/toltecs/script.h
+++ b/engines/toltecs/script.h
@@ -176,8 +176,8 @@ protected:
void sfStopShakeScreen();
void sfStartSequence();
void sfEndSequence();
- void sfSequenceVolumeStuff();
- void sfPlaySound1();
+ void sfSetSequenceVolume();
+ void sfPlayPositionalSound();
void sfPlaySound2();
void sfClearScreen();
void sfHandleInput();
diff --git a/engines/toltecs/sound.cpp b/engines/toltecs/sound.cpp
index 3f1be4be89..08df1ceec2 100644
--- a/engines/toltecs/sound.cpp
+++ b/engines/toltecs/sound.cpp
@@ -116,7 +116,7 @@ void Sound::internalPlaySound(int16 resIndex, int16 type, int16 volume, int16 pa
}
} else {
- if (type == kChannelTypeSpeech) {
+ if (type == -2) {
// Stop speech and play new sound
stopSpeech();
}
@@ -124,7 +124,7 @@ void Sound::internalPlaySound(int16 resIndex, int16 type, int16 volume, int16 pa
// Play new sound in empty channel
int freeChannel = -1;
for (int i = 0; i < 4; i++) {
- if (channels[i].type == kChannelTypeEmpty) {
+ if (channels[i].type == kChannelTypeEmpty || !_vm->_mixer->isSoundHandleActive(channels[i].handle)) {
freeChannel = i;
break;
}