aboutsummaryrefslogtreecommitdiff
path: root/engines/fullpipe/scenes
diff options
context:
space:
mode:
authorEugene Sandulenko2016-11-29 19:39:04 +0100
committerEugene Sandulenko2016-11-29 19:39:04 +0100
commitd712d2bcff54b7dedcc4f74a22ea6dde8b952256 (patch)
treedebfe6d531b916f1466346b775499404d9326093 /engines/fullpipe/scenes
parentafe8a2bb3187d6f041c992f2bde1817a55c3db29 (diff)
downloadscummvm-rg350-d712d2bcff54b7dedcc4f74a22ea6dde8b952256.tar.gz
scummvm-rg350-d712d2bcff54b7dedcc4f74a22ea6dde8b952256.tar.bz2
scummvm-rg350-d712d2bcff54b7dedcc4f74a22ea6dde8b952256.zip
FULLPIPE: Initial code for scene04 music
Diffstat (limited to 'engines/fullpipe/scenes')
-rw-r--r--engines/fullpipe/scenes/scene04.cpp39
-rw-r--r--engines/fullpipe/scenes/sceneFinal.cpp4
2 files changed, 36 insertions, 7 deletions
diff --git a/engines/fullpipe/scenes/scene04.cpp b/engines/fullpipe/scenes/scene04.cpp
index 05bb01154f..b8f80e8d50 100644
--- a/engines/fullpipe/scenes/scene04.cpp
+++ b/engines/fullpipe/scenes/scene04.cpp
@@ -35,6 +35,8 @@
#include "fullpipe/gameloader.h"
#include "fullpipe/behavior.h"
+#include "audio/mixer.h"
+
namespace Fullpipe {
static const int scene04_speakerPhases[] = {
@@ -214,6 +216,8 @@ void scene04_initScene(Scene *sc) {
g_vars->scene04_speakerVariant = 0;
g_vars->scene04_speakerPhase = 0;
+ g_vars->scene04_musicStage = 0;
+
g_fp->initArcadeKeys("SC_4");
}
@@ -1071,13 +1075,36 @@ void sceneHandler04_liftBottle() {
}
void sceneHandler04_startSounds(const char *snd1, const char *snd2, const char *snd3) {
- warning("STUB: sceneHandler04_startSounds()");
-
- // playFile(snd1);
- // playFile(snd2);
- // playFile(snd3);
+ g_fp->playOggSound(snd1, g_fp->_soundStream2);
g_fp->_stream2playing = true;
+
+ g_vars->scene04_musicStage = 1;
+}
+
+void updateSound() {
+ switch (g_vars->scene04_musicStage) {
+ case 0:
+ return;
+
+ case 1:
+ if (!g_fp->_mixer->isSoundHandleActive(*g_fp->_soundStream2)) {
+ g_fp->playOggSound("sc4_loop.ogg", g_fp->_soundStream3);
+ g_vars->scene04_musicStage = 2;
+ }
+ break;
+ case 2:
+ if (!g_fp->_mixer->isSoundHandleActive(*g_fp->_soundStream3)) {
+ g_fp->playOggSound("sc4_stop2.ogg", g_fp->_soundStream4);
+ g_vars->scene04_musicStage = 3;
+ }
+ break;
+ case 3:
+ if (!g_fp->_mixer->isSoundHandleActive(*g_fp->_soundStream4)) {
+ g_vars->scene04_musicStage = 0;
+ }
+ break;
+ }
}
void sceneHandler04_goClock() {
@@ -1606,6 +1633,8 @@ int sceneHandler04(ExCommand *ex) {
break;
}
+ updateSound();
+
return 0;
}
diff --git a/engines/fullpipe/scenes/sceneFinal.cpp b/engines/fullpipe/scenes/sceneFinal.cpp
index f569306cbe..30ca31b7b0 100644
--- a/engines/fullpipe/scenes/sceneFinal.cpp
+++ b/engines/fullpipe/scenes/sceneFinal.cpp
@@ -123,7 +123,7 @@ void sceneHandlerFinal_fallCoin() {
}
}
-void checkMusic() {
+void updateMusic() {
if (g_vars->sceneFinal_trackHasStarted && !g_fp->_mixer->isSoundHandleActive(*g_fp->_soundStream1)) { // loop music
sceneHandlerFinal_startMusic("track16.ogg");
}
@@ -177,7 +177,7 @@ int sceneHandlerFinal(ExCommand *cmd) {
break;
}
- checkMusic();
+ updateMusic();
return 0;
}