TSAGE: Fix sounds not getting registered in Globals::_sounds

This fixes a problem in Scene 20 where the scene wasn't ending after a sound fade
This commit is contained in:
Paul Gilbert 2011-06-22 18:58:59 +10:00
parent 7ef6bea74e
commit f67f069e3f
2 changed files with 10 additions and 1 deletions

View File

@ -302,7 +302,8 @@ void SoundManager::addToPlayList(Sound *sound) {
}
void SoundManager::removeFromPlayList(Sound *sound) {
_sfRemoveFromPlayList(sound);
if (_soundManager)
_sfRemoveFromPlayList(sound);
}
bool SoundManager::isOnPlayList(Sound *sound) {
@ -2246,6 +2247,13 @@ int Sound::_soFindSound(VoiceTypeStruct *vtStruct, int channelNum) {
ASound::ASound(): EventHandler() {
_action = NULL;
_cueValue = -1;
if (_globals)
_globals->_sounds.push_back(this);
}
ASound::~ASound() {
if (_globals)
_globals->_sounds.remove(this);
}
void ASound::synchronize(Serializer &s) {

View File

@ -361,6 +361,7 @@ public:
int _cueValue;
ASound();
~ASound();
virtual void synchronize(Serializer &s);
virtual void dispatch();