Skip to content

Commit

Permalink
TSAGE: Fix sounds not getting registered in Globals::_sounds
Browse files Browse the repository at this point in the history
This fixes a problem in Scene 20 where the scene wasn't ending after a sound fade
  • Loading branch information
dreammaster committed Jun 22, 2011
1 parent 7ef6bea commit f67f069
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
10 changes: 9 additions & 1 deletion engines/tsage/sound.cpp
Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down
1 change: 1 addition & 0 deletions engines/tsage/sound.h
Expand Up @@ -361,6 +361,7 @@ class ASound: public EventHandler {
int _cueValue;

ASound();
~ASound();
virtual void synchronize(Serializer &s);
virtual void dispatch();

Expand Down

0 comments on commit f67f069

Please sign in to comment.