aboutsummaryrefslogtreecommitdiff
path: root/engines/cine/script.cpp
diff options
context:
space:
mode:
authorGregory Montoir2006-03-09 22:37:19 +0000
committerGregory Montoir2006-03-09 22:37:19 +0000
commit2cf5859404fe91e19c2d18d57c1955d314c5da06 (patch)
treecea410cf373e690ba2c94fd68bf3c390af5c023f /engines/cine/script.cpp
parentf0106cd59c90d22799bb1517575a2d92a9027abe (diff)
downloadscummvm-rg350-2cf5859404fe91e19c2d18d57c1955d314c5da06.tar.gz
scummvm-rg350-2cf5859404fe91e19c2d18d57c1955d314c5da06.tar.bz2
scummvm-rg350-2cf5859404fe91e19c2d18d57c1955d314c5da06.zip
oo'ified sound code and added basic support for OS adlib music.
svn-id: r21186
Diffstat (limited to 'engines/cine/script.cpp')
-rw-r--r--engines/cine/script.cpp31
1 files changed, 17 insertions, 14 deletions
diff --git a/engines/cine/script.cpp b/engines/cine/script.cpp
index 628876ece7..2bd8318d86 100644
--- a/engines/cine/script.cpp
+++ b/engines/cine/script.cpp
@@ -1784,27 +1784,26 @@ void executeScript(prcLinkedListStruct *scriptElement, uint16 params) {
case 0x6D:
{
DEBUG_SCRIPT(currentLine, "loadMusic(%s)", currentScriptPtr + currentPosition);
- snd_loadSong((char *)(currentScriptPtr + currentPosition));
-
- currentPosition += strlen((char *)(currentScriptPtr + currentPosition)) + 1;
+ g_sfxPlayer->load((const char *)(currentScriptPtr + currentPosition));
+ currentPosition += strlen((const char *)(currentScriptPtr + currentPosition)) + 1;
break;
}
case 0x6E:
{
DEBUG_SCRIPT(currentLine, "playMusic()");
- snd_playSong();
+ g_sfxPlayer->play();
break;
}
case 0x6F:
{
DEBUG_SCRIPT(currentLine, "fadeOutMusic()");
- snd_fadeOutSong();
+ g_sfxPlayer->fadeOut();
break;
}
case 0x70:
{
DEBUG_SCRIPT(currentLine, "stopSample()");
- snd_stopSong();
+ g_sfxPlayer->stop();
break;
}
case 0x77:
@@ -1840,16 +1839,20 @@ void executeScript(prcLinkedListStruct *scriptElement, uint16 params) {
volume = 63;
if (animDataTable[anim].ptr1) {
- if (channel >= 10)
+ if (channel >= 10) {
channel -= 10;
- if (volume < 50)
+ }
+ if (volume < 50) {
volume = 50;
- if (snd_songIsPlaying)
- snd_stopSong();
- if (flag == 0xFFFF)
- (*snd_driver.playSound)(animDataTable[anim].ptr1, channel, volume);
- else
- snd_resetChannel(channel);
+ }
+
+ g_sfxPlayer->stop();
+
+ if (flag == 0xFFFF) {
+ g_soundDriver->playSound(animDataTable[anim].ptr1, channel, volume);
+ } else {
+ g_soundDriver->resetChannel(channel);
+ }
}
break;
}