[Scummvm-git-logs] scummvm master -> d712d2bcff54b7dedcc4f74a22ea6dde8b952256

sev- sev at scummvm.org
Tue Nov 29 19:40:00 CET 2016


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
d712d2bcff FULLPIPE: Initial code for scene04 music


Commit: d712d2bcff54b7dedcc4f74a22ea6dde8b952256
    https://github.com/scummvm/scummvm/commit/d712d2bcff54b7dedcc4f74a22ea6dde8b952256
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-11-29T19:39:04+01:00

Commit Message:
FULLPIPE: Initial code for scene04 music

Changed paths:
    engines/fullpipe/fullpipe.h
    engines/fullpipe/scenes.cpp
    engines/fullpipe/scenes.h
    engines/fullpipe/scenes/scene04.cpp
    engines/fullpipe/scenes/sceneFinal.cpp
    engines/fullpipe/sound.cpp


diff --git a/engines/fullpipe/fullpipe.h b/engines/fullpipe/fullpipe.h
index 6c98ae2..f6a8e00 100644
--- a/engines/fullpipe/fullpipe.h
+++ b/engines/fullpipe/fullpipe.h
@@ -185,6 +185,7 @@ public:
 	void updateTrackDelay();
 	void startSceneTrack();
 	void startSoundStream1(const char *trackName);
+	void playOggSound(const char *trackName, Audio::SoundHandle *stream);
 	void stopSoundStream2();
 	void stopAllSoundStreams();
 	void stopAllSoundInstances(int id);
diff --git a/engines/fullpipe/scenes.cpp b/engines/fullpipe/scenes.cpp
index b364908..4b50763 100644
--- a/engines/fullpipe/scenes.cpp
+++ b/engines/fullpipe/scenes.cpp
@@ -68,6 +68,7 @@ Vars::Vars() {
 	scene04_mamasha = 0;
 	scene04_boot = 0;
 	scene04_speaker = 0;
+	scene04_musicStage = 0;
 
 	scene04_ladder = 0;
 	scene04_coinPut = false;
diff --git a/engines/fullpipe/scenes.h b/engines/fullpipe/scenes.h
index 462edde..2d30f54 100644
--- a/engines/fullpipe/scenes.h
+++ b/engines/fullpipe/scenes.h
@@ -288,6 +288,8 @@ public:
 	int scene04_springOffset;
 	StaticANIObject *scene04_lastKozyawka;
 	int scene04_springDelay;
+	int scene04_musicStage;
+
 
 	StaticANIObject *scene05_handle;
 	StaticANIObject *scene05_wacko;
diff --git a/engines/fullpipe/scenes/scene04.cpp b/engines/fullpipe/scenes/scene04.cpp
index 05bb011..b8f80e8 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 f569306..30ca31b 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;
 }
diff --git a/engines/fullpipe/sound.cpp b/engines/fullpipe/sound.cpp
index d52d8dc..fd248f5 100644
--- a/engines/fullpipe/sound.cpp
+++ b/engines/fullpipe/sound.cpp
@@ -367,8 +367,12 @@ int FullpipeEngine::getSceneTrack() {
 void FullpipeEngine::startSoundStream1(const char *trackName) {
 	stopAllSoundStreams();
 
+	playOggSound(trackName, _soundStream1);
+}
+
+void FullpipeEngine::playOggSound(const char *trackName, Audio::SoundHandle *stream) {
 #ifdef USE_VORBIS
-	if (_mixer->isSoundHandleActive(*_soundStream1))
+	if (_mixer->isSoundHandleActive(*stream))
 		return;
 
 	Common::File *track = new Common::File();
@@ -378,7 +382,7 @@ void FullpipeEngine::startSoundStream1(const char *trackName) {
 		return;
 	}
 	Audio::RewindableAudioStream *ogg = Audio::makeVorbisStream(track, DisposeAfterUse::YES);
-	_mixer->playStream(Audio::Mixer::kMusicSoundType, _soundStream1, ogg);
+	_mixer->playStream(Audio::Mixer::kMusicSoundType, stream, ogg);
 #endif
 }
 





More information about the Scummvm-git-logs mailing list