aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/fullpipe/fullpipe.cpp12
-rw-r--r--engines/fullpipe/fullpipe.h11
-rw-r--r--engines/fullpipe/sound.cpp56
3 files changed, 79 insertions, 0 deletions
diff --git a/engines/fullpipe/fullpipe.cpp b/engines/fullpipe/fullpipe.cpp
index 246510e227..5369c05de7 100644
--- a/engines/fullpipe/fullpipe.cpp
+++ b/engines/fullpipe/fullpipe.cpp
@@ -104,6 +104,18 @@ FullpipeEngine::FullpipeEngine(OSystem *syst, const ADGameDescription *gameDesc)
_musicAllowed = -1;
_musicGameVar = 0;
+ _musicMinDelay = 0;
+ _musicMaxDelay = 0;
+ _musicLocal = 0;
+ _trackStartDelay = 0;
+
+ memset(_sceneTracks, 0, sizeof(_sceneTracks));
+ memset(_trackName, 0, sizeof(_trackName));
+ memset(_sceneTracksCurrentTrack, 0, sizeof(_sceneTracksCurrentTrack));
+
+ _numSceneTracks = 0;
+ _sceneTrackHasSequence = false;
+ _sceneTrackIsPlaying = false;
_aniMan = 0;
_aniMan2 = 0;
diff --git a/engines/fullpipe/fullpipe.h b/engines/fullpipe/fullpipe.h
index 5718b16ab3..989971eaab 100644
--- a/engines/fullpipe/fullpipe.h
+++ b/engines/fullpipe/fullpipe.h
@@ -151,6 +151,16 @@ public:
int _currSoundListCount;
bool _soundEnabled;
bool _flgSoundList;
+ char _sceneTracks[10][260];
+ int _numSceneTracks;
+ bool _sceneTrackHasSequence;
+ int _musicMinDelay;
+ int _musicMaxDelay;
+ int _musicLocal;
+ char _trackName[2600];
+ int _trackStartDelay;
+ char _sceneTracksCurrentTrack[260];
+ bool _sceneTrackIsPlaying;
void stopAllSounds();
void toggleMute();
@@ -300,6 +310,7 @@ public:
GameVar *_musicGameVar;
Audio::SoundHandle _sceneTrackHandle;
+
public:
bool _isSaveAllowed;
diff --git a/engines/fullpipe/sound.cpp b/engines/fullpipe/sound.cpp
index 774c687d54..10d020b494 100644
--- a/engines/fullpipe/sound.cpp
+++ b/engines/fullpipe/sound.cpp
@@ -182,6 +182,62 @@ void FullpipeEngine::playSound(int id, int flag) {
void FullpipeEngine::playTrack(GameVar *sceneVar, const char *name, bool delayed) {
warning("STUB: FullpipeEngine::playTrack(var, %s, %d)", name, delayed);
+#if 0
+ stopSoundStream2();
+
+ if (soundStream3)
+ FSOUND_Stream_Stop(soundStream4);
+#endif
+
+ if (g_fp->_musicLocal)
+ stopAllSoundStreams();
+
+ GameVar *var = sceneVar->getSubVarByName(name);
+
+ memset(g_fp->_sceneTracks, 0, sizeof(g_fp->_sceneTracks));
+
+ g_fp->_numSceneTracks = 0;
+ g_fp->_sceneTrackHasSequence = false;
+
+ if (!var)
+ return;
+
+ g_fp->_musicGameVar = var;
+
+ GameVar *tr = var->getSubVarByName("TRACKS");
+ if (tr) {
+ GameVar *sub = tr->_subVars;
+
+ while (sub) {
+ if (g_fp->_musicAllowed & sub->_value.intValue) {
+ strcpy(g_fp->_sceneTracks[g_fp->_numSceneTracks], sub->_varName);
+
+ g_fp->_numSceneTracks++;
+ }
+
+ sub = sub->_nextVarObj;
+ }
+ }
+
+ g_fp->_musicMinDelay = var->getSubVarAsInt("MINDELAY");
+ g_fp->_musicMaxDelay = var->getSubVarAsInt("MAXDELAY");
+ g_fp->_musicLocal = var->getSubVarAsInt("LOCAL");
+
+ GameVar *seq = var->getSubVarByName("SEQUENCE");
+ if (seq) {
+ g_fp->_sceneTrackHasSequence = true;
+
+ strcpy(g_fp->_trackName, seq->_value.stringValue);
+ }
+
+ if (delayed) {
+ if (g_fp->_sceneTrackIsPlaying && g_fp->_numSceneTracks == 1) {
+ if (strcmp(g_fp->_sceneTracksCurrentTrack, g_fp->_sceneTracks[0]))
+ stopAllSoundStreams();
+ }
+
+ g_fp->_trackStartDelay = var->getSubVarAsInt("STARTDELAY");
+ }
}
void global_messageHandler_handleSound(ExCommand *cmd) {