- Fixed: The high level sound code must not rely on FMod immediately returning

the sound channel data when a sound is being stopped. This caused
  an endless loop when changing levels with Strife's Flamethrower active.

SVN r1275 (trunk)
This commit is contained in:
Christoph Oelckers 2008-10-24 14:49:17 +00:00
parent b455227342
commit 4c6b7f6752
2 changed files with 16 additions and 8 deletions

View file

@ -1,7 +1,7 @@
October 21, 2008 (Changes by Graf Zahl) October 23, 2008 (Changes by Graf Zahl)
- Added a proper function parser to the expression evaluator and converted - Fixed: The high level sound code must not rely on FMod immediately returning
sin/cos and action specials to use it. The old evaluator is gone now. the sound channel data when a sound is being stopped. This caused
- fixed some GCC problems with autosegs. an endless loop when changing levels with Strife's Flamethrower active.
October 20, 2008 October 20, 2008
- Game time is now frozen during screen wipes. This obsoletes the DEM_WIPEON - Game time is now frozen during screen wipes. This obsoletes the DEM_WIPEON

View file

@ -318,10 +318,14 @@ void S_Shutdown ()
{ {
FSoundChan *chan, *next; FSoundChan *chan, *next;
while (Channels != NULL) chan = Channels;
while (chan != NULL)
{ {
S_StopChannel(Channels); next = chan->NextChan;
S_StopChannel(chan);
chan = next;
} }
GSnd->UpdateSounds(); GSnd->UpdateSounds();
for (chan = FreeChannels; chan != NULL; chan = next) for (chan = FreeChannels; chan != NULL; chan = next)
{ {
@ -1441,9 +1445,13 @@ void S_StopSound (const FPolyObj *poly, int channel)
void S_StopAllChannels () void S_StopAllChannels ()
{ {
SN_StopAllSequences(); SN_StopAllSequences();
while (Channels != NULL)
FSoundChan *chan = Channels;
while (chan != NULL)
{ {
S_StopChannel(Channels); FSoundChan *next = chan->NextChan;
S_StopChannel(chan);
chan = next;
} }
GSnd->UpdateSounds(); GSnd->UpdateSounds();
} }