- Fixed: SetSoundPaused() still needs to call S_PauseSound() to pause music

that isn't piped through the digital sound system. (Was removed in r1004.)


SVN r1595 (trunk)
This commit is contained in:
Randy Heit 2009-05-20 02:52:07 +00:00
parent b7dab65754
commit 749de6c156
8 changed files with 28 additions and 16 deletions

View file

@ -1,4 +1,8 @@
May 16, 2009 May 19, 2009
- Fixed: SetSoundPaused() still needs to call S_PauseSound() to pause music
that isn't piped through the digital sound system. (Was removed in r1004.)
May 16, 2009
- Added input buffering to the Implode and Shrink routines for a marked - Added input buffering to the Implode and Shrink routines for a marked
speedup. speedup.
- Replaced the Shanno-Fano/Huffman reading routines from FZipExploder with - Replaced the Shanno-Fano/Huffman reading routines from FZipExploder with

View file

@ -2181,12 +2181,12 @@ void Net_DoCommand (int type, BYTE **stream, int player)
if (paused) if (paused)
{ {
paused = 0; paused = 0;
S_ResumeSound (); S_ResumeSound (false);
} }
else else
{ {
paused = player + 1; paused = player + 1;
S_PauseSound (false); S_PauseSound (false, false);
} }
BorderNeedRefresh = screen->GetPageCount (); BorderNeedRefresh = screen->GetPageCount ();
} }

View file

@ -391,7 +391,7 @@ void G_InitNew (const char *mapname, bool bTitleLevel)
if (paused) if (paused)
{ {
paused = 0; paused = 0;
S_ResumeSound (); S_ResumeSound (false);
} }
if (StatusBar != NULL) if (StatusBar != NULL)

View file

@ -1366,7 +1366,7 @@ void APowerTimeFreezer::InitEffect( )
return; return;
// When this powerup is in effect, pause the music. // When this powerup is in effect, pause the music.
S_PauseSound( false ); S_PauseSound( false, false );
// Give the player and his teammates the power to move when time is frozen. // Give the player and his teammates the power to move when time is frozen.
Owner->player->cheats |= CF_TIMEFREEZE; Owner->player->cheats |= CF_TIMEFREEZE;
@ -1441,7 +1441,7 @@ void APowerTimeFreezer::EndEffect( )
level.flags2 &= ~LEVEL2_FROZEN; level.flags2 &= ~LEVEL2_FROZEN;
// Also, turn the music back on. // Also, turn the music back on.
S_ResumeSound( ); S_ResumeSound( false );
// Nothing more to do if there's no owner. // Nothing more to do if there's no owner.
if (( Owner == NULL ) || ( Owner->player == NULL )) if (( Owner == NULL ) || ( Owner->player == NULL ))

View file

@ -57,7 +57,7 @@ bool P_CheckTickerPaused ()
&& players[consoleplayer].viewz != 1 && players[consoleplayer].viewz != 1
&& wipegamestate == gamestate) && wipegamestate == gamestate)
{ {
S_PauseSound (!(level.flags2 & LEVEL2_PAUSE_MUSIC_IN_MENUS)); S_PauseSound (!(level.flags2 & LEVEL2_PAUSE_MUSIC_IN_MENUS), false);
return true; return true;
} }
return false; return false;
@ -104,7 +104,7 @@ void P_Ticker (void)
} }
if ( i == MAXPLAYERS ) if ( i == MAXPLAYERS )
S_ResumeSound (); S_ResumeSound (false);
P_ResetSightCounters (false); P_ResetSightCounters (false);

View file

@ -1634,15 +1634,18 @@ bool S_IsActorPlayingSomething (AActor *actor, int channel, int sound_id)
// Stop music and sound effects, during game PAUSE. // Stop music and sound effects, during game PAUSE.
//========================================================================== //==========================================================================
void S_PauseSound (bool notmusic) void S_PauseSound (bool notmusic, bool notsfx)
{ {
if (!notmusic && mus_playing.handle && !MusicPaused) if (!notmusic && mus_playing.handle && !MusicPaused)
{ {
I_PauseSong (mus_playing.handle); I_PauseSong (mus_playing.handle);
MusicPaused = true; MusicPaused = true;
} }
if (!notsfx)
{
SoundPaused = true; SoundPaused = true;
GSnd->SetSfxPaused (true, 0); GSnd->SetSfxPaused (true, 0);
}
} }
//========================================================================== //==========================================================================
@ -1652,15 +1655,18 @@ void S_PauseSound (bool notmusic)
// Resume music and sound effects, after game PAUSE. // Resume music and sound effects, after game PAUSE.
//========================================================================== //==========================================================================
void S_ResumeSound () void S_ResumeSound (bool notsfx)
{ {
if (mus_playing.handle && MusicPaused) if (mus_playing.handle && MusicPaused)
{ {
I_ResumeSong (mus_playing.handle); I_ResumeSong (mus_playing.handle);
MusicPaused = false; MusicPaused = false;
} }
if (!notsfx)
{
SoundPaused = false; SoundPaused = false;
GSnd->SetSfxPaused (false, 0); GSnd->SetSfxPaused (false, 0);
}
} }
//========================================================================== //==========================================================================

View file

@ -316,8 +316,8 @@ int S_GetMusic (char **name);
void S_StopMusic (bool force); void S_StopMusic (bool force);
// Stop and resume music, during game PAUSE. // Stop and resume music, during game PAUSE.
void S_PauseSound (bool notmusic); void S_PauseSound (bool notmusic, bool notsfx);
void S_ResumeSound (); void S_ResumeSound (bool notsfx);
// //
// Updates music & sounds // Updates music & sounds

View file

@ -1562,6 +1562,7 @@ static void SetSoundPaused (int state)
{ {
if (paused <= 0) if (paused <= 0)
{ {
S_ResumeSound(true);
if (GSnd != NULL) if (GSnd != NULL)
{ {
GSnd->SetInactive(false); GSnd->SetInactive(false);
@ -1580,6 +1581,7 @@ static void SetSoundPaused (int state)
{ {
if (paused == 0) if (paused == 0)
{ {
S_PauseSound(false, true);
if (GSnd != NULL) if (GSnd != NULL)
{ {
GSnd->SetInactive(true); GSnd->SetInactive(true);