mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-14 16:41:13 +00:00
- moved a few CCMDs from i_sound.cpp to s_sound.cpp.
This commit is contained in:
parent
2440d72f40
commit
48f2105cd1
4 changed files with 43 additions and 31 deletions
|
@ -300,10 +300,7 @@ void I_InitSound ()
|
|||
void I_CloseSound ()
|
||||
{
|
||||
// Free all loaded samples
|
||||
for (unsigned i = 0; i < S_sfx.Size(); i++)
|
||||
{
|
||||
S_UnloadSound(&S_sfx[i]);
|
||||
}
|
||||
S_UnloadAllSounds();
|
||||
|
||||
delete GSnd;
|
||||
GSnd = NULL;
|
||||
|
@ -339,32 +336,6 @@ const char *GetChannelConfigName(enum ChannelConfig chan)
|
|||
return "(invalid channel config)";
|
||||
}
|
||||
|
||||
|
||||
CCMD (snd_status)
|
||||
{
|
||||
GSnd->PrintStatus ();
|
||||
}
|
||||
|
||||
CCMD (snd_reset)
|
||||
{
|
||||
I_ShutdownMusic();
|
||||
S_EvictAllChannels();
|
||||
I_CloseSound();
|
||||
I_InitSound();
|
||||
S_RestartMusic();
|
||||
S_RestoreEvictedChannels();
|
||||
}
|
||||
|
||||
CCMD (snd_listdrivers)
|
||||
{
|
||||
GSnd->PrintDriversList ();
|
||||
}
|
||||
|
||||
ADD_STAT (sound)
|
||||
{
|
||||
return GSnd->GatherStats ();
|
||||
}
|
||||
|
||||
SoundRenderer::SoundRenderer ()
|
||||
{
|
||||
}
|
||||
|
|
|
@ -2243,7 +2243,7 @@ void OpenALSoundRenderer::UpdateSounds()
|
|||
if(connected == ALC_FALSE)
|
||||
{
|
||||
Printf("Sound device disconnected; restarting...\n");
|
||||
AddCommandString("snd_reset");
|
||||
S_SoundReset();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -119,6 +119,7 @@ enum
|
|||
extern float S_GetMusicVolume (const char *music);
|
||||
|
||||
// PUBLIC FUNCTION PROTOTYPES ----------------------------------------------
|
||||
void I_CloseSound();
|
||||
|
||||
// PRIVATE FUNCTION PROTOTYPES ---------------------------------------------
|
||||
|
||||
|
@ -2592,3 +2593,41 @@ DEFINE_ACTION_FUNCTION(DObject, S_ResumeSound)
|
|||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void S_UnloadAllSounds()
|
||||
{
|
||||
for (unsigned i = 0; i < S_sfx.Size(); i++)
|
||||
{
|
||||
S_UnloadSound(&S_sfx[i]);
|
||||
}
|
||||
}
|
||||
|
||||
CCMD (snd_status)
|
||||
{
|
||||
GSnd->PrintStatus ();
|
||||
}
|
||||
|
||||
CCMD (snd_reset)
|
||||
{
|
||||
S_SoundReset();
|
||||
}
|
||||
|
||||
void S_SoundReset()
|
||||
{
|
||||
I_ShutdownMusic();
|
||||
S_EvictAllChannels();
|
||||
I_CloseSound();
|
||||
I_InitSound();
|
||||
S_RestartMusic();
|
||||
S_RestoreEvictedChannels();
|
||||
}
|
||||
|
||||
CCMD (snd_listdrivers)
|
||||
{
|
||||
GSnd->PrintDriversList ();
|
||||
}
|
||||
|
||||
ADD_STAT (sound)
|
||||
{
|
||||
return GSnd->GatherStats ();
|
||||
}
|
||||
|
|
|
@ -373,5 +373,7 @@ void S_SetEnvironment (const ReverbContainer *settings);
|
|||
ReverbContainer *S_FindEnvironment (const char *name);
|
||||
ReverbContainer *S_FindEnvironment (int id);
|
||||
void S_AddEnvironment (ReverbContainer *settings);
|
||||
void S_UnloadAllSounds();
|
||||
void S_SoundReset();
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue