mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-31 16:03:24 +00:00
TSAGE: Wait for fading sounds to completely fade when changing scenes
This commit is contained in:
parent
10033ca976
commit
8f70ee9afc
@ -173,6 +173,11 @@ void SceneManager::changeScene(int newSceneNumber) {
|
||||
// Blank out the screen
|
||||
_globals->_screenSurface.fillRect(_globals->_screenSurface.getBounds(), 0);
|
||||
|
||||
// If there are any fading sounds, wait until fading is complete
|
||||
while (_globals->_soundManager.isFading()) {
|
||||
g_system->delayMillis(10);
|
||||
}
|
||||
|
||||
// Set the new scene to be loaded
|
||||
setNewScene(newSceneNumber);
|
||||
}
|
||||
|
@ -451,6 +451,22 @@ void SoundManager::_sfProcessFading() {
|
||||
}
|
||||
}
|
||||
|
||||
bool SoundManager::isFading() {
|
||||
Common::StackLock slock(sfManager()._serverSuspendedMutex);
|
||||
|
||||
// Loop through any active sounds to see if any are being actively faded
|
||||
Common::List<Sound *>::iterator i = sfManager()._playList.begin();
|
||||
while (i != sfManager()._playList.end()) {
|
||||
Sound *s = *i;
|
||||
++i;
|
||||
|
||||
if (s->_fadeDest != -1)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void SoundManager::_sfUpdateVoiceStructs() {
|
||||
for (int voiceIndex = 0; voiceIndex < SOUND_ARR_SIZE; ++voiceIndex) {
|
||||
VoiceTypeStruct *vs = sfManager()._voiceTypeStructPtrs[voiceIndex];
|
||||
|
@ -225,6 +225,7 @@ public:
|
||||
int getMasterVol() const;
|
||||
void loadSound(int soundNum, bool showErrors);
|
||||
void unloadSound(int soundNum);
|
||||
bool isFading();
|
||||
|
||||
// _sf methods
|
||||
static SoundManager &sfManager();
|
||||
|
Loading…
x
Reference in New Issue
Block a user