From 4d8cc0db680184d9a38d13d35d89e26dc02beabc Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Fri, 25 Nov 2016 10:43:39 +0100 Subject: FULLPIPE: Correctly restart scene audio tracks --- engines/fullpipe/sound.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'engines') diff --git a/engines/fullpipe/sound.cpp b/engines/fullpipe/sound.cpp index cd6647177e..4ec8dd05ca 100644 --- a/engines/fullpipe/sound.cpp +++ b/engines/fullpipe/sound.cpp @@ -306,6 +306,13 @@ void FullpipeEngine::setSceneMusicParameters(GameVar *gvar) { } void FullpipeEngine::startSceneTrack() { + if (_sceneTrackIsPlaying) { + if (!_mixer->isSoundHandleActive(*_sceneTrackHandle)) { // Simulate end of sound callback + _sceneTrackIsPlaying = false; + _trackStartDelay = _musicMinDelay + (_musicMaxDelay - _musicMinDelay) * (_updateTicks % 10) / 9; + } + } + if (!_sceneTrackIsPlaying && _numSceneTracks > 0) { if (_trackStartDelay > 0) { _trackStartDelay--; -- cgit v1.2.3