diff options
author | Johannes Schickel | 2008-04-06 14:58:02 +0000 |
---|---|---|
committer | Johannes Schickel | 2008-04-06 14:58:02 +0000 |
commit | a05b085a21d2bdeedd73100d53bc5c2382bcea50 (patch) | |
tree | 5cedab151b357d37ef39847c2d64a52227032715 /engines/kyra | |
parent | 22efb801d4713e53ea146132e02e5ddfe3089fc3 (diff) | |
download | scummvm-rg350-a05b085a21d2bdeedd73100d53bc5c2382bcea50.tar.gz scummvm-rg350-a05b085a21d2bdeedd73100d53bc5c2382bcea50.tar.bz2 scummvm-rg350-a05b085a21d2bdeedd73100d53bc5c2382bcea50.zip |
Fixed potentional crash.
svn-id: r31432
Diffstat (limited to 'engines/kyra')
-rw-r--r-- | engines/kyra/scene_v2.cpp | 2 | ||||
-rw-r--r-- | engines/kyra/sound.h | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/engines/kyra/scene_v2.cpp b/engines/kyra/scene_v2.cpp index ef9fde2eea..498ddc1c6b 100644 --- a/engines/kyra/scene_v2.cpp +++ b/engines/kyra/scene_v2.cpp @@ -115,7 +115,7 @@ void KyraEngine_v2::enterNewScene(uint16 newScene, int facing, int unk1, int unk if (newSoundFile) { if (_sound->getMusicType() == Sound::kAdlib) { - while (((SoundAdlibPC*)_sound)->isPlaying()) + while (_sound->isPlaying()) _system->delayMillis(10); } else { while (waitTime > _system->getMillis()) diff --git a/engines/kyra/sound.h b/engines/kyra/sound.h index 0c40dec323..0ffb1c73b5 100644 --- a/engines/kyra/sound.h +++ b/engines/kyra/sound.h @@ -138,6 +138,13 @@ public: virtual void playSoundEffect(uint8 track) = 0; /** + * Checks if the sound driver plays any sound + * + * @return true if playing, false otherwise + */ + virtual bool isPlaying() const { return false; } + + /** * Starts fading out the volume. * * This keeps fading out the output until @@ -465,6 +472,7 @@ public: void playTrack(uint8 track) { _music->playTrack(track); } void haltTrack() { _music->haltTrack(); } + bool isPlaying() const { return _music->isPlaying() | _sfx->isPlaying(); } void playSoundEffect(uint8 track) { _sfx->playSoundEffect(track); } |