diff options
author | Eugene Sandulenko | 2014-04-26 14:34:12 +0300 |
---|---|---|
committer | Eugene Sandulenko | 2014-04-26 14:34:12 +0300 |
commit | 81b24d0c4042cec0b11fff73c5594f386c06418e (patch) | |
tree | 8b99b05d08f308da7437d0eac6feaecca11c3bf3 | |
parent | d12d69631d9a01dcf06d06b5271034769117035a (diff) | |
download | scummvm-rg350-81b24d0c4042cec0b11fff73c5594f386c06418e.tar.gz scummvm-rg350-81b24d0c4042cec0b11fff73c5594f386c06418e.tar.bz2 scummvm-rg350-81b24d0c4042cec0b11fff73c5594f386c06418e.zip |
FULLPIPE: Proper implementation of FullpipeEngine::startSceneTrack()
-rw-r--r-- | engines/fullpipe/fullpipe.h | 2 | ||||
-rw-r--r-- | engines/fullpipe/sound.cpp | 37 |
2 files changed, 33 insertions, 6 deletions
diff --git a/engines/fullpipe/fullpipe.h b/engines/fullpipe/fullpipe.h index 989971eaab..27505252ab 100644 --- a/engines/fullpipe/fullpipe.h +++ b/engines/fullpipe/fullpipe.h @@ -166,7 +166,9 @@ public: void toggleMute(); void playSound(int id, int flag); void playTrack(GameVar *sceneVar, const char *name, bool delayed); + int getSceneTrack(); void startSceneTrack(); + void startSoundStream1(char *trackName); void stopSoundStream2(); void stopAllSoundStreams(); void stopAllSoundInstances(int id); diff --git a/engines/fullpipe/sound.cpp b/engines/fullpipe/sound.cpp index 10d020b494..8071129e5c 100644 --- a/engines/fullpipe/sound.cpp +++ b/engines/fullpipe/sound.cpp @@ -131,16 +131,41 @@ void FullpipeEngine::setSceneMusicParameters(GameVar *var) { } void FullpipeEngine::startSceneTrack() { - // TODO: Finish this + if (!g_fp->_sceneTrackIsPlaying && g_fp->_numSceneTracks > 0) { + if (g_fp->_trackStartDelay > 0) { + g_fp->_trackStartDelay--; + } else { + int trackNum = getSceneTrack(); + + if (trackNum == -1) { + strcpy(g_fp->_sceneTracksCurrentTrack, "silence"); + + g_fp->_trackStartDelay = 2880; + g_fp->_sceneTrackIsPlaying = 0; + } else { + strcpy(g_fp->_sceneTracksCurrentTrack, g_fp->_sceneTracks[trackNum]); + + startSoundStream1(g_fp->_sceneTracksCurrentTrack); + + g_fp->_sceneTrackIsPlaying = 1; + } + } + } +} + +int FullpipeEngine::getSceneTrack() { + warning("STUB: FullpipeEngine::getSceneTrack()"); + + return -1; +} + +void FullpipeEngine::startSoundStream1(char *trackName) { + stopAllSoundStreams(); + #ifdef USE_VORBIS if (g_fp->_mixer->isSoundHandleActive(_sceneTrackHandle)) return; - GameVar *musicTrackVar = _musicGameVar->getSubVarByName("MUSIC")->getSubVarByName("TRACKS")->_subVars; - if (!musicTrackVar) - return; - - char *trackName = musicTrackVar->_varName; Common::File *track = new Common::File(); if (!track->open(trackName)) { warning("Could not open %s", trackName); |