- Fixed default.cbd and Makefile.mingw for current code state.
- New: Pausing the game (through any means, not just the pause key) now pauses sound effects as well as music. "PauseMusicInMenus" has been added as a MAPINFO flag to also pause the music when a menu or the console are open. SVN r134 (trunk)
This commit is contained in:
parent
f8bdceab38
commit
62b7dd3efc
19 changed files with 115 additions and 35 deletions
|
|
@ -75,6 +75,7 @@ struct AltSoundRenderer::Channel
|
|||
SDWORD LeftVolume;
|
||||
SDWORD RightVolume;
|
||||
bool Looping;
|
||||
bool Paused;
|
||||
CRITICAL_SECTION CriticalSection;
|
||||
};
|
||||
|
||||
|
|
@ -521,6 +522,7 @@ long AltSoundRenderer::StartSound (sfxinfo_t *sfx, int vol, int sep, int pitch,
|
|||
chan->LeftVolume = left;
|
||||
chan->RightVolume = right;
|
||||
chan->Looping = !!looping;
|
||||
chan->Paused = false;
|
||||
LeaveCriticalSection (&chan->CriticalSection);
|
||||
|
||||
return channel + 1;
|
||||
|
|
@ -541,6 +543,22 @@ void AltSoundRenderer::StopSound (long handle)
|
|||
chan->Sample = NULL;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// AltSoundRenderer :: SetSfxPaused
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
void AltSoundRenderer::SetSfxPaused (bool paused)
|
||||
{
|
||||
if (Channels == NULL) return;
|
||||
|
||||
for (int i = 0; i < NumChannels; ++i)
|
||||
{
|
||||
Channels[i].Paused = paused;
|
||||
}
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// AltSoundRenderer :: IsPlayingSound
|
||||
|
|
@ -857,7 +875,7 @@ void AltSoundRenderer::UpdateSound ()
|
|||
for (int i = 0; i < NumChannels; ++i)
|
||||
{
|
||||
EnterCriticalSection (&Channels[i].CriticalSection);
|
||||
if (Channels[i].Sample != NULL)
|
||||
if (Channels[i].Sample != NULL && !Channels[i].Paused)
|
||||
{
|
||||
if (Channels[i].Sample->b16bit)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue