function name cleanup. the sound mixer stuff (snd_dma.c, snd_mix.c, etc) use the SND_ prefix now, and drivers (snd_oss.c) use SNDDMA_ as before.

This commit is contained in:
Adam Olsen 2001-06-10 15:48:24 +00:00
parent 2195a9296c
commit 9e19da13de
12 changed files with 411 additions and 410 deletions

View file

@ -82,23 +82,23 @@ general_funcs_t plugin_info_general_funcs;
sound_data_t plugin_info_sound_data; sound_data_t plugin_info_sound_data;
sound_funcs_t plugin_info_sound_funcs; sound_funcs_t plugin_info_sound_funcs;
void I_S_Init (void); void SND_Init (void);
void I_S_Shutdown (void); void SND_Shutdown (void);
void I_S_AmbientOff (void); void SND_AmbientOff (void);
void I_S_AmbientOn (void); void SND_AmbientOn (void);
void I_S_TouchSound (char *sample); void SND_TouchSound (char *sample);
void I_S_ClearBuffer (void); void SND_ClearBuffer (void);
void I_S_StaticSound (sfx_t *sfx, vec3_t origin, float vol, float attenuation); void SND_StaticSound (sfx_t *sfx, vec3_t origin, float vol, float attenuation);
void I_S_StartSound (int entnum, int entchannel, sfx_t *sfx, vec3_t origin, float fvol, float attenuation); void SND_StartSound (int entnum, int entchannel, sfx_t *sfx, vec3_t origin, float fvol, float attenuation);
void I_S_StopSound (int entnum, int entchannel); void SND_StopSound (int entnum, int entchannel);
sfx_t *I_S_PrecacheSound (char *sample); sfx_t *SND_PrecacheSound (char *sample);
void I_S_ClearPrecache (void); void SND_ClearPrecache (void);
void I_S_Update (vec3_t origin, vec3_t v_forward, vec3_t v_right, vec3_t v_up); void SND_Update (vec3_t origin, vec3_t v_forward, vec3_t v_right, vec3_t v_up);
void I_S_StopAllSounds (qboolean clear); void SND_StopAllSounds (qboolean clear);
void I_S_BeginPrecaching (void); void SND_BeginPrecaching (void);
void I_S_EndPrecaching (void); void SND_EndPrecaching (void);
void I_S_ExtraUpdate (void); void SND_ExtraUpdate (void);
void I_S_LocalSound (char *s); void SND_LocalSound (char *s);
int int
check_card (int card) check_card (int card)
@ -404,24 +404,24 @@ PluginInfo (void) {
plugin_info_funcs.input = NULL; plugin_info_funcs.input = NULL;
plugin_info_funcs.sound = &plugin_info_sound_funcs; plugin_info_funcs.sound = &plugin_info_sound_funcs;
plugin_info_general_funcs.p_Init = I_S_Init; plugin_info_general_funcs.p_Init = SND_Init;
plugin_info_general_funcs.p_Shutdown = I_S_Shutdown; plugin_info_general_funcs.p_Shutdown = SND_Shutdown;
plugin_info_sound_funcs.pS_AmbientOff = I_S_AmbientOff; plugin_info_sound_funcs.pS_AmbientOff = SND_AmbientOff;
plugin_info_sound_funcs.pS_AmbientOn = I_S_AmbientOn; plugin_info_sound_funcs.pS_AmbientOn = SND_AmbientOn;
plugin_info_sound_funcs.pS_TouchSound = I_S_TouchSound; plugin_info_sound_funcs.pS_TouchSound = SND_TouchSound;
plugin_info_sound_funcs.pS_ClearBuffer = I_S_ClearBuffer; plugin_info_sound_funcs.pS_ClearBuffer = SND_ClearBuffer;
plugin_info_sound_funcs.pS_StaticSound = I_S_StaticSound; plugin_info_sound_funcs.pS_StaticSound = SND_StaticSound;
plugin_info_sound_funcs.pS_StartSound = I_S_StartSound; plugin_info_sound_funcs.pS_StartSound = SND_StartSound;
plugin_info_sound_funcs.pS_StopSound = I_S_StopSound; plugin_info_sound_funcs.pS_StopSound = SND_StopSound;
plugin_info_sound_funcs.pS_PrecacheSound = I_S_PrecacheSound; plugin_info_sound_funcs.pS_PrecacheSound = SND_PrecacheSound;
plugin_info_sound_funcs.pS_ClearPrecache = I_S_ClearPrecache; plugin_info_sound_funcs.pS_ClearPrecache = SND_ClearPrecache;
plugin_info_sound_funcs.pS_Update = I_S_Update; plugin_info_sound_funcs.pS_Update = SND_Update;
plugin_info_sound_funcs.pS_StopAllSounds = I_S_StopAllSounds; plugin_info_sound_funcs.pS_StopAllSounds = SND_StopAllSounds;
plugin_info_sound_funcs.pS_BeginPrecaching = I_S_BeginPrecaching; plugin_info_sound_funcs.pS_BeginPrecaching = SND_BeginPrecaching;
plugin_info_sound_funcs.pS_EndPrecaching = I_S_EndPrecaching; plugin_info_sound_funcs.pS_EndPrecaching = SND_EndPrecaching;
plugin_info_sound_funcs.pS_ExtraUpdate = I_S_ExtraUpdate; plugin_info_sound_funcs.pS_ExtraUpdate = SND_ExtraUpdate;
plugin_info_sound_funcs.pS_LocalSound = I_S_LocalSound; plugin_info_sound_funcs.pS_LocalSound = SND_LocalSound;
return &plugin_info; return &plugin_info;
} }

View file

@ -56,23 +56,23 @@ general_funcs_t plugin_info_general_funcs;
sound_data_t plugin_info_sound_data; sound_data_t plugin_info_sound_data;
sound_funcs_t plugin_info_sound_funcs; sound_funcs_t plugin_info_sound_funcs;
void I_S_Init (void); void SND_Init (void);
void I_S_Shutdown (void); void SND_Shutdown (void);
void I_S_AmbientOff (void); void SND_AmbientOff (void);
void I_S_AmbientOn (void); void SND_AmbientOn (void);
void I_S_TouchSound (char *sample); void SND_TouchSound (char *sample);
void I_S_ClearBuffer (void); void SND_ClearBuffer (void);
void I_S_StaticSound (sfx_t *sfx, vec3_t origin, float vol, float attenuation); void SND_StaticSound (sfx_t *sfx, vec3_t origin, float vol, float attenuation);
void I_S_StartSound (int entnum, int entchannel, sfx_t *sfx, vec3_t origin, float fvol, float attenuation); void SND_StartSound (int entnum, int entchannel, sfx_t *sfx, vec3_t origin, float fvol, float attenuation);
void I_S_StopSound (int entnum, int entchannel); void SND_StopSound (int entnum, int entchannel);
sfx_t *I_S_PrecacheSound (char *sample); sfx_t *SND_PrecacheSound (char *sample);
void I_S_ClearPrecache (void); void SND_ClearPrecache (void);
void I_S_Update (vec3_t origin, vec3_t v_forward, vec3_t v_right, vec3_t v_up); void SND_Update (vec3_t origin, vec3_t v_forward, vec3_t v_right, vec3_t v_up);
void I_S_StopAllSounds (qboolean clear); void SND_StopAllSounds (qboolean clear);
void I_S_BeginPrecaching (void); void SND_BeginPrecaching (void);
void I_S_EndPrecaching (void); void SND_EndPrecaching (void);
void I_S_ExtraUpdate (void); void SND_ExtraUpdate (void);
void I_S_LocalSound (char *s); void SND_LocalSound (char *s);
qboolean qboolean
@ -334,24 +334,24 @@ PluginInfo (void)
plugin_info_funcs.input = NULL; plugin_info_funcs.input = NULL;
plugin_info_funcs.sound = &plugin_info_sound_funcs; plugin_info_funcs.sound = &plugin_info_sound_funcs;
plugin_info_general_funcs.p_Init = I_S_Init; plugin_info_general_funcs.p_Init = SND_Init;
plugin_info_general_funcs.p_Shutdown = I_S_Shutdown; plugin_info_general_funcs.p_Shutdown = SND_Shutdown;
plugin_info_sound_funcs.pS_AmbientOff = I_S_AmbientOff; plugin_info_sound_funcs.pS_AmbientOff = SND_AmbientOff;
plugin_info_sound_funcs.pS_AmbientOn = I_S_AmbientOn; plugin_info_sound_funcs.pS_AmbientOn = SND_AmbientOn;
plugin_info_sound_funcs.pS_TouchSound = I_S_TouchSound; plugin_info_sound_funcs.pS_TouchSound = SND_TouchSound;
plugin_info_sound_funcs.pS_ClearBuffer = I_S_ClearBuffer; plugin_info_sound_funcs.pS_ClearBuffer = SND_ClearBuffer;
plugin_info_sound_funcs.pS_StaticSound = I_S_StaticSound; plugin_info_sound_funcs.pS_StaticSound = SND_StaticSound;
plugin_info_sound_funcs.pS_StartSound = I_S_StartSound; plugin_info_sound_funcs.pS_StartSound = SND_StartSound;
plugin_info_sound_funcs.pS_StopSound = I_S_StopSound; plugin_info_sound_funcs.pS_StopSound = SND_StopSound;
plugin_info_sound_funcs.pS_PrecacheSound = I_S_PrecacheSound; plugin_info_sound_funcs.pS_PrecacheSound = SND_PrecacheSound;
plugin_info_sound_funcs.pS_ClearPrecache = I_S_ClearPrecache; plugin_info_sound_funcs.pS_ClearPrecache = SND_ClearPrecache;
plugin_info_sound_funcs.pS_Update = I_S_Update; plugin_info_sound_funcs.pS_Update = SND_Update;
plugin_info_sound_funcs.pS_StopAllSounds = I_S_StopAllSounds; plugin_info_sound_funcs.pS_StopAllSounds = SND_StopAllSounds;
plugin_info_sound_funcs.pS_BeginPrecaching = I_S_BeginPrecaching; plugin_info_sound_funcs.pS_BeginPrecaching = SND_BeginPrecaching;
plugin_info_sound_funcs.pS_EndPrecaching = I_S_EndPrecaching; plugin_info_sound_funcs.pS_EndPrecaching = SND_EndPrecaching;
plugin_info_sound_funcs.pS_ExtraUpdate = I_S_ExtraUpdate; plugin_info_sound_funcs.pS_ExtraUpdate = SND_ExtraUpdate;
plugin_info_sound_funcs.pS_LocalSound = I_S_LocalSound; plugin_info_sound_funcs.pS_LocalSound = SND_LocalSound;
return &plugin_info; return &plugin_info;
} }

View file

@ -56,23 +56,23 @@ general_funcs_t plugin_info_general_funcs;
sound_data_t plugin_info_sound_data; sound_data_t plugin_info_sound_data;
sound_funcs_t plugin_info_sound_funcs; sound_funcs_t plugin_info_sound_funcs;
void I_S_Init (void); void SND_Init (void);
void I_S_Shutdown (void); void SND_Shutdown (void);
void I_S_AmbientOff (void); void SND_AmbientOff (void);
void I_S_AmbientOn (void); void SND_AmbientOn (void);
void I_S_TouchSound (char *sample); void SND_TouchSound (char *sample);
void I_S_ClearBuffer (void); void SND_ClearBuffer (void);
void I_S_StaticSound (sfx_t *sfx, vec3_t origin, float vol, float attenuation); void SND_StaticSound (sfx_t *sfx, vec3_t origin, float vol, float attenuation);
void I_S_StartSound (int entnum, int entchannel, sfx_t *sfx, vec3_t origin, float fvol, float attenuation); void SND_StartSound (int entnum, int entchannel, sfx_t *sfx, vec3_t origin, float fvol, float attenuation);
void I_S_StopSound (int entnum, int entchannel); void SND_StopSound (int entnum, int entchannel);
sfx_t *I_S_PrecacheSound (char *sample); sfx_t *SND_PrecacheSound (char *sample);
void I_S_ClearPrecache (void); void SND_ClearPrecache (void);
void I_S_Update (vec3_t origin, vec3_t v_forward, vec3_t v_right, vec3_t v_up); void SND_Update (vec3_t origin, vec3_t v_forward, vec3_t v_right, vec3_t v_up);
void I_S_StopAllSounds (qboolean clear); void SND_StopAllSounds (qboolean clear);
void I_S_BeginPrecaching (void); void SND_BeginPrecaching (void);
void I_S_EndPrecaching (void); void SND_EndPrecaching (void);
void I_S_ExtraUpdate (void); void SND_ExtraUpdate (void);
void I_S_LocalSound (char *s); void SND_LocalSound (char *s);
qboolean qboolean
SNDDMA_Init (void) SNDDMA_Init (void)
@ -154,24 +154,24 @@ PluginInfo (void) {
plugin_info_funcs.input = NULL; plugin_info_funcs.input = NULL;
plugin_info_funcs.sound = &plugin_info_sound_funcs; plugin_info_funcs.sound = &plugin_info_sound_funcs;
plugin_info_general_funcs.p_Init = I_S_Init; plugin_info_general_funcs.p_Init = SND_Init;
plugin_info_general_funcs.p_Shutdown = I_S_Shutdown; plugin_info_general_funcs.p_Shutdown = SND_Shutdown;
plugin_info_sound_funcs.pS_AmbientOff = I_S_AmbientOff; plugin_info_sound_funcs.pS_AmbientOff = SND_AmbientOff;
plugin_info_sound_funcs.pS_AmbientOn = I_S_AmbientOn; plugin_info_sound_funcs.pS_AmbientOn = SND_AmbientOn;
plugin_info_sound_funcs.pS_TouchSound = I_S_TouchSound; plugin_info_sound_funcs.pS_TouchSound = SND_TouchSound;
plugin_info_sound_funcs.pS_ClearBuffer = I_S_ClearBuffer; plugin_info_sound_funcs.pS_ClearBuffer = SND_ClearBuffer;
plugin_info_sound_funcs.pS_StaticSound = I_S_StaticSound; plugin_info_sound_funcs.pS_StaticSound = SND_StaticSound;
plugin_info_sound_funcs.pS_StartSound = I_S_StartSound; plugin_info_sound_funcs.pS_StartSound = SND_StartSound;
plugin_info_sound_funcs.pS_StopSound = I_S_StopSound; plugin_info_sound_funcs.pS_StopSound = SND_StopSound;
plugin_info_sound_funcs.pS_PrecacheSound = I_S_PrecacheSound; plugin_info_sound_funcs.pS_PrecacheSound = SND_PrecacheSound;
plugin_info_sound_funcs.pS_ClearPrecache = I_S_ClearPrecache; plugin_info_sound_funcs.pS_ClearPrecache = SND_ClearPrecache;
plugin_info_sound_funcs.pS_Update = I_S_Update; plugin_info_sound_funcs.pS_Update = SND_Update;
plugin_info_sound_funcs.pS_StopAllSounds = I_S_StopAllSounds; plugin_info_sound_funcs.pS_StopAllSounds = SND_StopAllSounds;
plugin_info_sound_funcs.pS_BeginPrecaching = I_S_BeginPrecaching; plugin_info_sound_funcs.pS_BeginPrecaching = SND_BeginPrecaching;
plugin_info_sound_funcs.pS_EndPrecaching = I_S_EndPrecaching; plugin_info_sound_funcs.pS_EndPrecaching = SND_EndPrecaching;
plugin_info_sound_funcs.pS_ExtraUpdate = I_S_ExtraUpdate; plugin_info_sound_funcs.pS_ExtraUpdate = SND_ExtraUpdate;
plugin_info_sound_funcs.pS_LocalSound = I_S_LocalSound; plugin_info_sound_funcs.pS_LocalSound = SND_LocalSound;
return &plugin_info; return &plugin_info;
} }

View file

@ -51,19 +51,19 @@
#include "QF/sound.h" #include "QF/sound.h"
#include "QF/plugin.h" #include "QF/plugin.h"
void I_S_Play (void); void SND_Play (void);
void I_S_PlayVol (void); void SND_PlayVol (void);
void I_S_SoundList (void); void SND_SoundList (void);
void I_S_Update_ (void); void SND_Update_ (void);
void I_S_StopAllSounds (qboolean clear); void SND_StopAllSounds (qboolean clear);
void I_S_StopAllSoundsC (void); void SND_StopAllSoundsC (void);
sfx_t *I_S_PrecacheSound (char *name); sfx_t *SND_PrecacheSound (char *name);
sfxcache_t *I_S_LoadSound (sfx_t *s); sfxcache_t *SND_LoadSound (sfx_t *s);
void I_S_ClearBuffer (void); void SND_ClearBuffer (void);
void I_S_PaintChannels (int endtime); void SND_PaintChannels (int endtime);
void I_S_Init_Cvars (); void SND_Init_Cvars ();
// QuakeWorld hack... // QuakeWorld hack...
//#define viewentity playernum+1 //#define viewentity playernum+1
@ -125,7 +125,7 @@ cvar_t *_snd_mixahead;
// Fake dma is a synchronous faking of the DMA progress used for // Fake dma is a synchronous faking of the DMA progress used for
// isolating performance in the renderer. The fakedma_updates is // isolating performance in the renderer. The fakedma_updates is
// number of times I_S_Update() is called per second. // number of times SND_Update() is called per second.
qboolean fakedma = false; qboolean fakedma = false;
int fakedma_updates = 15; int fakedma_updates = 15;
@ -136,21 +136,21 @@ extern sound_data_t plugin_info_sound_data;
void void
I_S_AmbientOff (void) SND_AmbientOff (void)
{ {
snd_ambient = false; snd_ambient = false;
} }
void void
I_S_AmbientOn (void) SND_AmbientOn (void)
{ {
snd_ambient = true; snd_ambient = true;
} }
void void
I_S_SoundInfo_f (void) SND_SoundInfo_f (void)
{ {
if (!sound_started || !shm) { if (!sound_started || !shm) {
Con_Printf ("sound system not started\n"); Con_Printf ("sound system not started\n");
@ -169,7 +169,7 @@ I_S_SoundInfo_f (void)
void void
I_S_Startup (void) SND_Startup (void)
{ {
int rc; int rc;
@ -193,23 +193,23 @@ I_S_Startup (void)
void void
I_S_Init (void) SND_Init (void)
{ {
Con_Printf ("\nSound Initialization\n"); Con_Printf ("\nSound Initialization\n");
Cmd_AddCommand ("play", I_S_Play, Cmd_AddCommand ("play", SND_Play,
"Play selected sound effect (play pathto/sound.wav)"); "Play selected sound effect (play pathto/sound.wav)");
Cmd_AddCommand ("playvol", I_S_PlayVol, "Play selected sound effect at " Cmd_AddCommand ("playvol", SND_PlayVol, "Play selected sound effect at "
"selected volume (playvol pathto/sound.wav num"); "selected volume (playvol pathto/sound.wav num");
Cmd_AddCommand ("stopsound", I_S_StopAllSoundsC, Cmd_AddCommand ("stopsound", SND_StopAllSoundsC,
"Stops all sounds currently being played"); "Stops all sounds currently being played");
Cmd_AddCommand ("soundlist", I_S_SoundList, Cmd_AddCommand ("soundlist", SND_SoundList,
"Reports a list of sounds in the cache"); "Reports a list of sounds in the cache");
Cmd_AddCommand ("soundinfo", I_S_SoundInfo_f, Cmd_AddCommand ("soundinfo", SND_SoundInfo_f,
"Report information on the sound system"); "Report information on the sound system");
I_S_Init_Cvars (); SND_Init_Cvars ();
if (COM_CheckParm ("-nosound")) if (COM_CheckParm ("-nosound"))
return; return;
@ -226,7 +226,7 @@ I_S_Init (void)
snd_initialized = true; snd_initialized = true;
I_S_Startup (); SND_Startup ();
if (sound_started == 0) // sound startup failed? Bail out. if (sound_started == 0) // sound startup failed? Bail out.
return; return;
@ -258,15 +258,15 @@ I_S_Init (void)
// if (shm->buffer) // if (shm->buffer)
// shm->buffer[4] = shm->buffer[5] = 0x7f; // force a pop for debugging // shm->buffer[4] = shm->buffer[5] = 0x7f; // force a pop for debugging
ambient_sfx[AMBIENT_WATER] = I_S_PrecacheSound ("ambience/water1.wav"); ambient_sfx[AMBIENT_WATER] = SND_PrecacheSound ("ambience/water1.wav");
ambient_sfx[AMBIENT_SKY] = I_S_PrecacheSound ("ambience/wind2.wav"); ambient_sfx[AMBIENT_SKY] = SND_PrecacheSound ("ambience/wind2.wav");
I_S_StopAllSounds (true); SND_StopAllSounds (true);
} }
void void
I_S_Init_Cvars (void) SND_Init_Cvars (void)
{ {
snd_device = Cvar_Get ("snd_device", "", CVAR_ROM, NULL, snd_device = Cvar_Get ("snd_device", "", CVAR_ROM, NULL,
"sound device. \"\" is system default"); "sound device. \"\" is system default");
@ -310,7 +310,7 @@ I_S_Init_Cvars (void)
// Shutdown sound engine ====================================================== // Shutdown sound engine ======================================================
void void
I_S_Shutdown (void) SND_Shutdown (void)
{ {
if (!sound_started) if (!sound_started)
@ -331,7 +331,7 @@ I_S_Shutdown (void)
// Load a sound =============================================================== // Load a sound ===============================================================
sfx_t * sfx_t *
I_S_FindName (char *name) SND_FindName (char *name)
{ {
int i; int i;
sfx_t *sfx; sfx_t *sfx;
@ -361,31 +361,31 @@ I_S_FindName (char *name)
void void
I_S_TouchSound (char *name) SND_TouchSound (char *name)
{ {
sfx_t *sfx; sfx_t *sfx;
if (!sound_started) if (!sound_started)
return; return;
sfx = I_S_FindName (name); sfx = SND_FindName (name);
Cache_Check (&sfx->cache); Cache_Check (&sfx->cache);
} }
sfx_t * sfx_t *
I_S_PrecacheSound (char *name) SND_PrecacheSound (char *name)
{ {
sfx_t *sfx; sfx_t *sfx;
if (!sound_started || nosound->int_val) if (!sound_started || nosound->int_val)
return NULL; return NULL;
sfx = I_S_FindName (name); sfx = SND_FindName (name);
// cache it in // cache it in
if (precache->int_val) if (precache->int_val)
I_S_LoadSound (sfx); SND_LoadSound (sfx);
return sfx; return sfx;
} }
@ -488,7 +488,7 @@ SND_Spatialize (channel_t *ch)
// Start a sound effect ======================================================= // Start a sound effect =======================================================
void void
I_S_StartSound (int entnum, int entchannel, sfx_t *sfx, vec3_t origin, float fvol, SND_StartSound (int entnum, int entchannel, sfx_t *sfx, vec3_t origin, float fvol,
float attenuation) float attenuation)
{ {
channel_t *target_chan, *check; channel_t *target_chan, *check;
@ -526,7 +526,7 @@ I_S_StartSound (int entnum, int entchannel, sfx_t *sfx, vec3_t origin, float fvo
return; // not audible at all return; // not audible at all
// new channel // new channel
sc = I_S_LoadSound (sfx); sc = SND_LoadSound (sfx);
if (!sc) { if (!sc) {
target_chan->sfx = NULL; target_chan->sfx = NULL;
return; // couldn't load the sound's data return; // couldn't load the sound's data
@ -557,7 +557,7 @@ I_S_StartSound (int entnum, int entchannel, sfx_t *sfx, vec3_t origin, float fvo
void void
I_S_StopSound (int entnum, int entchannel) SND_StopSound (int entnum, int entchannel)
{ {
int i; int i;
@ -573,7 +573,7 @@ I_S_StopSound (int entnum, int entchannel)
void void
I_S_StopAllSounds (qboolean clear) SND_StopAllSounds (qboolean clear)
{ {
int i; int i;
@ -589,19 +589,19 @@ I_S_StopAllSounds (qboolean clear)
memset (channels, 0, MAX_CHANNELS * sizeof (channel_t)); memset (channels, 0, MAX_CHANNELS * sizeof (channel_t));
if (clear) if (clear)
I_S_ClearBuffer (); SND_ClearBuffer ();
} }
void void
I_S_StopAllSoundsC (void) SND_StopAllSoundsC (void)
{ {
I_S_StopAllSounds (true); SND_StopAllSounds (true);
} }
void void
I_S_ClearBuffer (void) SND_ClearBuffer (void)
{ {
int clear; int clear;
@ -629,7 +629,7 @@ I_S_ClearBuffer (void)
void void
I_S_StaticSound (sfx_t *sfx, vec3_t origin, float vol, float attenuation) SND_StaticSound (sfx_t *sfx, vec3_t origin, float vol, float attenuation)
{ {
channel_t *ss; channel_t *ss;
sfxcache_t *sc; sfxcache_t *sc;
@ -645,7 +645,7 @@ I_S_StaticSound (sfx_t *sfx, vec3_t origin, float vol, float attenuation)
ss = &channels[total_channels]; ss = &channels[total_channels];
total_channels++; total_channels++;
sc = I_S_LoadSound (sfx); sc = SND_LoadSound (sfx);
if (!sc) if (!sc)
return; return;
@ -669,7 +669,7 @@ I_S_StaticSound (sfx_t *sfx, vec3_t origin, float vol, float attenuation)
void void
I_S_UpdateAmbientSounds (void) SND_UpdateAmbientSounds (void)
{ {
mleaf_t *l; mleaf_t *l;
float vol; float vol;
@ -718,12 +718,12 @@ I_S_UpdateAmbientSounds (void)
/* /*
I_S_Update SND_Update
Called once each time through the main loop Called once each time through the main loop
*/ */
void void
I_S_Update (vec3_t origin, vec3_t forward, vec3_t right, vec3_t up) SND_Update (vec3_t origin, vec3_t forward, vec3_t right, vec3_t up)
{ {
int i, j; int i, j;
int total; int total;
@ -739,7 +739,7 @@ I_S_Update (vec3_t origin, vec3_t forward, vec3_t right, vec3_t up)
VectorCopy (up, listener_up); VectorCopy (up, listener_up);
// update general area ambient sound sources // update general area ambient sound sources
I_S_UpdateAmbientSounds (); SND_UpdateAmbientSounds ();
combine = NULL; combine = NULL;
@ -800,12 +800,12 @@ I_S_Update (vec3_t origin, vec3_t forward, vec3_t right, vec3_t up)
} }
// mix some sound // mix some sound
I_S_Update_ (); SND_Update_ ();
} }
void void
GetSoundtime (void) SND_GetSoundtime (void)
{ {
int samplepos; int samplepos;
static int buffers; static int buffers;
@ -815,7 +815,7 @@ GetSoundtime (void)
fullsamples = shm->samples / shm->channels; fullsamples = shm->samples / shm->channels;
// it is possible to miscount buffers if it has wrapped twice between // it is possible to miscount buffers if it has wrapped twice between
// calls to I_S_Update. Oh well. // calls to SND_Update. Oh well.
samplepos = SNDDMA_GetDMAPos (); samplepos = SNDDMA_GetDMAPos ();
if (samplepos < oldsamplepos) { if (samplepos < oldsamplepos) {
@ -825,7 +825,7 @@ GetSoundtime (void)
// 32 bit limits // 32 bit limits
buffers = 0; buffers = 0;
paintedtime = fullsamples; paintedtime = fullsamples;
I_S_StopAllSounds (true); SND_StopAllSounds (true);
} }
} }
oldsamplepos = samplepos; oldsamplepos = samplepos;
@ -835,16 +835,16 @@ GetSoundtime (void)
void void
I_S_ExtraUpdate (void) SND_ExtraUpdate (void)
{ {
if (snd_noextraupdate->int_val) if (snd_noextraupdate->int_val)
return; // don't pollute timings return; // don't pollute timings
I_S_Update_ (); SND_Update_ ();
} }
void void
I_S_Update_ (void) SND_Update_ (void)
{ {
unsigned int endtime; unsigned int endtime;
int samps; int samps;
@ -853,7 +853,7 @@ I_S_Update_ (void)
return; return;
// Updates DMA time // Updates DMA time
GetSoundtime (); SND_GetSoundtime ();
// check to make sure that we haven't overshot // check to make sure that we haven't overshot
if (paintedtime < soundtime) { if (paintedtime < soundtime) {
@ -871,7 +871,7 @@ I_S_Update_ (void)
DSOUND_Restore (); DSOUND_Restore ();
#endif #endif
I_S_PaintChannels (endtime); SND_PaintChannels (endtime);
SNDDMA_Submit (); SNDDMA_Submit ();
} }
@ -883,7 +883,7 @@ I_S_Update_ (void)
void void
I_S_Play (void) SND_Play (void)
{ {
static int hash = 345; static int hash = 345;
int i; int i;
@ -897,15 +897,15 @@ I_S_Play (void)
strncat (name, ".wav", sizeof (name) - strlen (name)); strncat (name, ".wav", sizeof (name) - strlen (name));
} else } else
strcpy (name, Cmd_Argv (i)); strcpy (name, Cmd_Argv (i));
sfx = I_S_PrecacheSound (name); sfx = SND_PrecacheSound (name);
I_S_StartSound (hash++, 0, sfx, listener_origin, 1.0, 1.0); SND_StartSound (hash++, 0, sfx, listener_origin, 1.0, 1.0);
i++; i++;
} }
} }
void void
I_S_PlayVol (void) SND_PlayVol (void)
{ {
static int hash = 543; static int hash = 543;
int i; int i;
@ -920,16 +920,16 @@ I_S_PlayVol (void)
strncat (name, ".wav", sizeof (name) - strlen (name)); strncat (name, ".wav", sizeof (name) - strlen (name));
} else } else
strcpy (name, Cmd_Argv (i)); strcpy (name, Cmd_Argv (i));
sfx = I_S_PrecacheSound (name); sfx = SND_PrecacheSound (name);
vol = atof (Cmd_Argv (i + 1)); vol = atof (Cmd_Argv (i + 1));
I_S_StartSound (hash++, 0, sfx, listener_origin, vol, 1.0); SND_StartSound (hash++, 0, sfx, listener_origin, vol, 1.0);
i += 2; i += 2;
} }
} }
void void
I_S_SoundList (void) SND_SoundList (void)
{ {
int i; int i;
sfx_t *sfx; sfx_t *sfx;
@ -954,7 +954,7 @@ I_S_SoundList (void)
void void
I_S_LocalSound (char *sound) SND_LocalSound (char *sound)
{ {
sfx_t *sfx; sfx_t *sfx;
@ -963,28 +963,28 @@ I_S_LocalSound (char *sound)
if (!sound_started) if (!sound_started)
return; return;
sfx = I_S_PrecacheSound (sound); sfx = SND_PrecacheSound (sound);
if (!sfx) { if (!sfx) {
Con_Printf ("S_LocalSound: can't cache %s\n", sound); Con_Printf ("S_LocalSound: can't cache %s\n", sound);
return; return;
} }
I_S_StartSound (*plugin_info_sound_data.viewentity, -1, sfx, vec3_origin, 1, 1); SND_StartSound (*plugin_info_sound_data.viewentity, -1, sfx, vec3_origin, 1, 1);
} }
void void
I_S_ClearPrecache (void) SND_ClearPrecache (void)
{ {
} }
void void
I_S_BeginPrecaching (void) SND_BeginPrecaching (void)
{ {
} }
void void
I_S_EndPrecaching (void) SND_EndPrecaching (void)
{ {
} }

View file

@ -45,13 +45,14 @@
int cache_full_cycle; int cache_full_cycle;
byte *I_S_Alloc (int size); byte *SND_Alloc (int size);
wavinfo_t SND_GetWavinfo (char *name, byte * wav, int wavlength);
/* /*
ResampleSfx SND_ResampleSfx
*/ */
void void
ResampleSfx (sfx_t *sfx, int inrate, int inwidth, byte * data) SND_ResampleSfx (sfx_t *sfx, int inrate, int inwidth, byte * data)
{ {
int outcount; int outcount;
int srcsample; int srcsample;
@ -164,10 +165,10 @@ ResampleSfx (sfx_t *sfx, int inrate, int inwidth, byte * data)
//============================================================================= //=============================================================================
/* /*
I_S_LoadSound SND_LoadSound
*/ */
sfxcache_t * sfxcache_t *
I_S_LoadSound (sfx_t *s) SND_LoadSound (sfx_t *s)
{ {
char namebuffer[256]; char namebuffer[256];
byte *data; byte *data;
@ -196,7 +197,7 @@ I_S_LoadSound (sfx_t *s)
return NULL; return NULL;
} }
info = GetWavinfo (s->name, data, com_filesize); info = SND_GetWavinfo (s->name, data, com_filesize);
if (info.channels != 1) { if (info.channels != 1) {
Con_Printf ("%s is a stereo sample\n", s->name); Con_Printf ("%s is a stereo sample\n", s->name);
return NULL; return NULL;
@ -222,7 +223,7 @@ I_S_LoadSound (sfx_t *s)
sc->width = info.width; sc->width = info.width;
sc->stereo = info.channels; sc->stereo = info.channels;
ResampleSfx (s, sc->speed, sc->width, data + info.dataofs); SND_ResampleSfx (s, sc->speed, sc->width, data + info.dataofs);
return sc; return sc;
} }
@ -242,7 +243,7 @@ int iff_chunk_len;
short short
GetLittleShort (void) SND_GetLittleShort (void)
{ {
short val = 0; short val = 0;
@ -253,7 +254,7 @@ GetLittleShort (void)
} }
int int
GetLittleLong (void) SND_GetLittleLong (void)
{ {
int val = 0; int val = 0;
@ -266,7 +267,7 @@ GetLittleLong (void)
} }
void void
FindNextChunk (char *name) SND_FindNexctChunk (char *name)
{ {
while (1) { while (1) {
data_p = last_chunk; data_p = last_chunk;
@ -277,13 +278,13 @@ FindNextChunk (char *name)
} }
data_p += 4; data_p += 4;
iff_chunk_len = GetLittleLong (); iff_chunk_len = SND_GetLittleLong ();
if (iff_chunk_len < 0) { if (iff_chunk_len < 0) {
data_p = NULL; data_p = NULL;
return; return;
} }
// if (iff_chunk_len > 1024*1024) // if (iff_chunk_len > 1024*1024)
// Sys_Error ("FindNextChunk: %i length is past the 1 meg sanity limit", iff_chunk_len); // Sys_Error ("SND_FindNexctChunk: %i length is past the 1 meg sanity limit", iff_chunk_len);
data_p -= 8; data_p -= 8;
last_chunk = data_p + 8 + ((iff_chunk_len + 1) & ~1); last_chunk = data_p + 8 + ((iff_chunk_len + 1) & ~1);
if (!strncmp (data_p, name, 4)) if (!strncmp (data_p, name, 4))
@ -292,15 +293,15 @@ FindNextChunk (char *name)
} }
void void
FindChunk (char *name) SND_FindChunk (char *name)
{ {
last_chunk = iff_data; last_chunk = iff_data;
FindNextChunk (name); SND_FindNexctChunk (name);
} }
void void
DumpChunks (void) SND_DumpChunks (void)
{ {
char str[5]; char str[5];
@ -309,17 +310,17 @@ DumpChunks (void)
do { do {
memcpy (str, data_p, 4); memcpy (str, data_p, 4);
data_p += 4; data_p += 4;
iff_chunk_len = GetLittleLong (); iff_chunk_len = SND_GetLittleLong ();
Con_Printf ("0x%x : %s (%d)\n", (int) (data_p - 4), str, iff_chunk_len); Con_Printf ("0x%x : %s (%d)\n", (int) (data_p - 4), str, iff_chunk_len);
data_p += (iff_chunk_len + 1) & ~1; data_p += (iff_chunk_len + 1) & ~1;
} while (data_p < iff_end); } while (data_p < iff_end);
} }
/* /*
GetWavinfo SND_GetWavinfo
*/ */
wavinfo_t wavinfo_t
GetWavinfo (char *name, byte * wav, int wavlength) SND_GetWavinfo (char *name, byte * wav, int wavlength)
{ {
wavinfo_t info; wavinfo_t info;
int i; int i;
@ -335,48 +336,48 @@ GetWavinfo (char *name, byte * wav, int wavlength)
iff_end = wav + wavlength; iff_end = wav + wavlength;
// find "RIFF" chunk // find "RIFF" chunk
FindChunk ("RIFF"); SND_FindChunk ("RIFF");
if (!(data_p && !strncmp (data_p + 8, "WAVE", 4))) { if (!(data_p && !strncmp (data_p + 8, "WAVE", 4))) {
Con_Printf ("Missing RIFF/WAVE chunks\n"); Con_Printf ("Missing RIFF/WAVE chunks\n");
return info; return info;
} }
// get "fmt " chunk // get "fmt " chunk
iff_data = data_p + 12; iff_data = data_p + 12;
// DumpChunks (); // SND_DumpChunks ();
FindChunk ("fmt "); SND_FindChunk ("fmt ");
if (!data_p) { if (!data_p) {
Con_Printf ("Missing fmt chunk\n"); Con_Printf ("Missing fmt chunk\n");
return info; return info;
} }
data_p += 8; data_p += 8;
format = GetLittleShort (); format = SND_GetLittleShort ();
if (format != 1) { if (format != 1) {
Con_Printf ("Microsoft PCM format only\n"); Con_Printf ("Microsoft PCM format only\n");
return info; return info;
} }
info.channels = GetLittleShort (); info.channels = SND_GetLittleShort ();
info.rate = GetLittleLong (); info.rate = SND_GetLittleLong ();
data_p += 4 + 2; data_p += 4 + 2;
info.width = GetLittleShort () / 8; info.width = SND_GetLittleShort () / 8;
// get cue chunk // get cue chunk
FindChunk ("cue "); SND_FindChunk ("cue ");
if (data_p) { if (data_p) {
data_p += 32; data_p += 32;
info.loopstart = GetLittleLong (); info.loopstart = SND_GetLittleLong ();
// Con_Printf("loopstart=%d\n", sfx->loopstart); // Con_Printf("loopstart=%d\n", sfx->loopstart);
// if the next chunk is a LIST chunk, look for a cue length marker // if the next chunk is a LIST chunk, look for a cue length marker
FindNextChunk ("LIST"); SND_FindNexctChunk ("LIST");
if (data_p) { if (data_p) {
if (!strncmp (data_p + 28, "mark", 4)) { // this is not a if (!strncmp (data_p + 28, "mark", 4)) { // this is not a
// proper parse, but // proper parse, but
// it works with // it works with
// cooledit... // cooledit...
data_p += 24; data_p += 24;
i = GetLittleLong (); // samples in loop i = SND_GetLittleLong (); // samples in loop
info.samples = info.loopstart + i; info.samples = info.loopstart + i;
// Con_Printf("looped length: %i\n", i); // Con_Printf("looped length: %i\n", i);
} }
@ -385,14 +386,14 @@ GetWavinfo (char *name, byte * wav, int wavlength)
info.loopstart = -1; info.loopstart = -1;
// find data chunk // find data chunk
FindChunk ("data"); SND_FindChunk ("data");
if (!data_p) { if (!data_p) {
Con_Printf ("Missing data chunk\n"); Con_Printf ("Missing data chunk\n");
return info; return info;
} }
data_p += 4; data_p += 4;
samples = GetLittleLong () / info.width; samples = SND_GetLittleLong () / info.width;
if (info.samples) { if (info.samples) {
if (samples < info.samples) if (samples < info.samples)

View file

@ -56,12 +56,12 @@ int snd_scaletable[32][256];
int *snd_p, snd_linear_count, snd_vol; int *snd_p, snd_linear_count, snd_vol;
short *snd_out; short *snd_out;
void Snd_WriteLinearBlastStereo16 (void); void SND_WriteLinearBlastStereo16 (void);
sfxcache_t *I_S_LoadSound (sfx_t *s); sfxcache_t *SND_LoadSound (sfx_t *s);
#ifndef USE_INTEL_ASM #ifndef USE_INTEL_ASM
void void
Snd_WriteLinearBlastStereo16 (void) SND_WriteLinearBlastStereo16 (void)
{ {
int i; int i;
int val; int val;
@ -87,7 +87,7 @@ Snd_WriteLinearBlastStereo16 (void)
#endif #endif
void void
I_S_TransferStereo16 (int endtime) SND_TransferStereo16 (int endtime)
{ {
int lpos; int lpos;
int lpaintedtime; int lpaintedtime;
@ -124,7 +124,7 @@ I_S_TransferStereo16 (int endtime)
snd_linear_count <<= 1; snd_linear_count <<= 1;
// write a linear blast of samples // write a linear blast of samples
Snd_WriteLinearBlastStereo16 (); SND_WriteLinearBlastStereo16 ();
snd_p += snd_linear_count; snd_p += snd_linear_count;
lpaintedtime += (snd_linear_count >> 1); lpaintedtime += (snd_linear_count >> 1);
@ -137,7 +137,7 @@ I_S_TransferStereo16 (int endtime)
} }
void void
I_S_TransferPaintBuffer (int endtime) SND_TransferPaintBuffer (int endtime)
{ {
int out_idx; int out_idx;
int count; int count;
@ -149,7 +149,7 @@ I_S_TransferPaintBuffer (int endtime)
DWORD *pbuf; DWORD *pbuf;
if (shm->samplebits == 16 && shm->channels == 2) { if (shm->samplebits == 16 && shm->channels == 2) {
I_S_TransferStereo16 (endtime); SND_TransferStereo16 (endtime);
return; return;
} }
@ -215,7 +215,7 @@ void SND_PaintChannelFrom8 (channel_t *ch, sfxcache_t *sc, int endtime);
void SND_PaintChannelFrom16 (channel_t *ch, sfxcache_t *sc, int endtime); void SND_PaintChannelFrom16 (channel_t *ch, sfxcache_t *sc, int endtime);
void void
I_S_PaintChannels (int endtime) SND_PaintChannels (int endtime)
{ {
int i; int i;
int end; int end;
@ -241,7 +241,7 @@ I_S_PaintChannels (int endtime)
continue; continue;
if (!ch->leftvol && !ch->rightvol) if (!ch->leftvol && !ch->rightvol)
continue; continue;
sc = I_S_LoadSound (ch->sfx); sc = SND_LoadSound (ch->sfx);
if (!sc) if (!sc)
continue; continue;
@ -276,7 +276,7 @@ I_S_PaintChannels (int endtime)
} }
// transfer out according to DMA format // transfer out according to DMA format
I_S_TransferPaintBuffer (end); SND_TransferPaintBuffer (end);
memmove (paintbuffer, paintbuffer + end - paintedtime, memmove (paintbuffer, paintbuffer + end - paintedtime,
max_overpaint * sizeof (paintbuffer[0])); max_overpaint * sizeof (paintbuffer[0]));

View file

@ -182,11 +182,11 @@ LDone:
// Transfer of stereo buffer to 16-bit DMA buffer code // Transfer of stereo buffer to 16-bit DMA buffer code
//---------------------------------------------------------------------- //----------------------------------------------------------------------
.globl C(Snd_WriteLinearBlastStereo16) .globl C(SND_WriteLinearBlastStereo16)
#ifdef PIC #ifdef PIC
.type C(Snd_WriteLinearBlastStereo16),@function .type C(SND_WriteLinearBlastStereo16),@function
#endif #endif
C(Snd_WriteLinearBlastStereo16): C(SND_WriteLinearBlastStereo16):
pushl %esi // preserve register variables pushl %esi // preserve register variables
pushl %edi pushl %edi
pushl %ebx pushl %ebx
@ -273,7 +273,7 @@ LClampDone2:
ret ret
#ifdef PIC #ifdef PIC
.Lfe2: .Lfe2:
.size C(Snd_WriteLinearBlastStereo16),.Lfe2-C(Snd_WriteLinearBlastStereo16) .size C(SND_WriteLinearBlastStereo16),.Lfe2-C(SND_WriteLinearBlastStereo16)
#endif #endif

View file

@ -56,34 +56,34 @@ general_funcs_t plugin_info_general_funcs;
sound_data_t plugin_info_sound_data; sound_data_t plugin_info_sound_data;
sound_funcs_t plugin_info_sound_funcs; sound_funcs_t plugin_info_sound_funcs;
void I_S_Init (void); void SND_Init (void);
void I_S_Shutdown (void); void SND_Shutdown (void);
void I_S_AmbientOff (void); void SND_AmbientOff (void);
void I_S_AmbientOn (void); void SND_AmbientOn (void);
void I_S_TouchSound (char *sample); void SND_TouchSound (char *sample);
void I_S_ClearBuffer (void); void SND_ClearBuffer (void);
void I_S_StaticSound (sfx_t *sfx, vec3_t origin, float vol, float attenuation); void SND_StaticSound (sfx_t *sfx, vec3_t origin, float vol, float attenuation);
void I_S_StartSound (int entnum, int entchannel, sfx_t *sfx, vec3_t origin, float fvol, float attenuation); void SND_StartSound (int entnum, int entchannel, sfx_t *sfx, vec3_t origin, float fvol, float attenuation);
void I_S_StopSound (int entnum, int entchannel); void SND_StopSound (int entnum, int entchannel);
sfx_t *I_S_PrecacheSound (char *sample); sfx_t *SND_PrecacheSound (char *sample);
void I_S_ClearPrecache (void); void SND_ClearPrecache (void);
void I_S_Update (vec3_t origin, vec3_t v_forward, vec3_t v_right, vec3_t v_up); void SND_Update (vec3_t origin, vec3_t v_forward, vec3_t v_right, vec3_t v_up);
void I_S_StopAllSounds (qboolean clear); void SND_StopAllSounds (qboolean clear);
void I_S_BeginPrecaching (void); void SND_BeginPrecaching (void);
void I_S_EndPrecaching (void); void SND_EndPrecaching (void);
void I_S_ExtraUpdate (void); void SND_ExtraUpdate (void);
void I_S_LocalSound (char *s); void SND_LocalSound (char *s);
void I_S_Init_Cvars (void); void SND_Init_Cvars (void);
void void
I_S_Init (void) SND_Init (void)
{ {
I_S_Init_Cvars (); SND_Init_Cvars ();
} }
void void
I_S_Init_Cvars (void) SND_Init_Cvars (void)
{ {
volume = Cvar_Get ("volume", "0.7", CVAR_ARCHIVE, NULL, volume = Cvar_Get ("volume", "0.7", CVAR_ARCHIVE, NULL,
"Volume level of sounds"); "Volume level of sounds");
@ -96,84 +96,84 @@ I_S_Init_Cvars (void)
} }
void void
I_S_AmbientOff (void) SND_AmbientOff (void)
{ {
} }
void void
I_S_AmbientOn (void) SND_AmbientOn (void)
{ {
} }
void void
I_S_Shutdown (void) SND_Shutdown (void)
{ {
} }
void void
I_S_TouchSound (char *sample) SND_TouchSound (char *sample)
{ {
} }
void void
I_S_ClearBuffer (void) SND_ClearBuffer (void)
{ {
} }
void void
I_S_StaticSound (sfx_t *sfx, vec3_t origin, float vol, float attenuation) SND_StaticSound (sfx_t *sfx, vec3_t origin, float vol, float attenuation)
{ {
} }
void void
I_S_StartSound (int entnum, int entchannel, sfx_t *sfx, vec3_t origin, float fvol, SND_StartSound (int entnum, int entchannel, sfx_t *sfx, vec3_t origin, float fvol,
float attenuation) float attenuation)
{ {
} }
void void
I_S_StopSound (int entnum, int entchannel) SND_StopSound (int entnum, int entchannel)
{ {
} }
sfx_t * sfx_t *
I_S_PrecacheSound (char *sample) SND_PrecacheSound (char *sample)
{ {
return NULL; return NULL;
} }
void void
I_S_ClearPrecache (void) SND_ClearPrecache (void)
{ {
} }
void void
I_S_Update (vec3_t origin, vec3_t v_forward, vec3_t v_right, vec3_t v_up) SND_Update (vec3_t origin, vec3_t v_forward, vec3_t v_right, vec3_t v_up)
{ {
} }
void void
I_S_StopAllSounds (qboolean clear) SND_StopAllSounds (qboolean clear)
{ {
} }
void void
I_S_BeginPrecaching (void) SND_BeginPrecaching (void)
{ {
} }
void void
I_S_EndPrecaching (void) SND_EndPrecaching (void)
{ {
} }
void void
I_S_ExtraUpdate (void) SND_ExtraUpdate (void)
{ {
} }
void void
I_S_LocalSound (char *s) SND_LocalSound (char *s)
{ {
} }
@ -197,24 +197,24 @@ PluginInfo (void) {
plugin_info_funcs.input = NULL; plugin_info_funcs.input = NULL;
plugin_info_funcs.sound = &plugin_info_sound_funcs; plugin_info_funcs.sound = &plugin_info_sound_funcs;
plugin_info_general_funcs.p_Init = I_S_Init; plugin_info_general_funcs.p_Init = SND_Init;
plugin_info_general_funcs.p_Shutdown = I_S_Shutdown; plugin_info_general_funcs.p_Shutdown = SND_Shutdown;
plugin_info_sound_funcs.pS_AmbientOff = I_S_AmbientOff; plugin_info_sound_funcs.pS_AmbientOff = SND_AmbientOff;
plugin_info_sound_funcs.pS_AmbientOn = I_S_AmbientOn; plugin_info_sound_funcs.pS_AmbientOn = SND_AmbientOn;
plugin_info_sound_funcs.pS_TouchSound = I_S_TouchSound; plugin_info_sound_funcs.pS_TouchSound = SND_TouchSound;
plugin_info_sound_funcs.pS_ClearBuffer = I_S_ClearBuffer; plugin_info_sound_funcs.pS_ClearBuffer = SND_ClearBuffer;
plugin_info_sound_funcs.pS_StaticSound = I_S_StaticSound; plugin_info_sound_funcs.pS_StaticSound = SND_StaticSound;
plugin_info_sound_funcs.pS_StartSound = I_S_StartSound; plugin_info_sound_funcs.pS_StartSound = SND_StartSound;
plugin_info_sound_funcs.pS_StopSound = I_S_StopSound; plugin_info_sound_funcs.pS_StopSound = SND_StopSound;
plugin_info_sound_funcs.pS_PrecacheSound = I_S_PrecacheSound; plugin_info_sound_funcs.pS_PrecacheSound = SND_PrecacheSound;
plugin_info_sound_funcs.pS_ClearPrecache = I_S_ClearPrecache; plugin_info_sound_funcs.pS_ClearPrecache = SND_ClearPrecache;
plugin_info_sound_funcs.pS_Update = I_S_Update; plugin_info_sound_funcs.pS_Update = SND_Update;
plugin_info_sound_funcs.pS_StopAllSounds = I_S_StopAllSounds; plugin_info_sound_funcs.pS_StopAllSounds = SND_StopAllSounds;
plugin_info_sound_funcs.pS_BeginPrecaching = I_S_BeginPrecaching; plugin_info_sound_funcs.pS_BeginPrecaching = SND_BeginPrecaching;
plugin_info_sound_funcs.pS_EndPrecaching = I_S_EndPrecaching; plugin_info_sound_funcs.pS_EndPrecaching = SND_EndPrecaching;
plugin_info_sound_funcs.pS_ExtraUpdate = I_S_ExtraUpdate; plugin_info_sound_funcs.pS_ExtraUpdate = SND_ExtraUpdate;
plugin_info_sound_funcs.pS_LocalSound = I_S_LocalSound; plugin_info_sound_funcs.pS_LocalSound = SND_LocalSound;
return &plugin_info; return &plugin_info;
} }

View file

@ -80,23 +80,23 @@ general_funcs_t plugin_info_general_funcs;
sound_data_t plugin_info_sound_data; sound_data_t plugin_info_sound_data;
sound_funcs_t plugin_info_sound_funcs; sound_funcs_t plugin_info_sound_funcs;
void I_S_Init (void); void SND_Init (void);
void I_S_Shutdown (void); void SND_Shutdown (void);
void I_S_AmbientOff (void); void SND_AmbientOff (void);
void I_S_AmbientOn (void); void SND_AmbientOn (void);
void I_S_TouchSound (char *sample); void SND_TouchSound (char *sample);
void I_S_ClearBuffer (void); void SND_ClearBuffer (void);
void I_S_StaticSound (sfx_t *sfx, vec3_t origin, float vol, float attenuation); void SND_StaticSound (sfx_t *sfx, vec3_t origin, float vol, float attenuation);
void I_S_StartSound (int entnum, int entchannel, sfx_t *sfx, vec3_t origin, float fvol, float attenuation); void SND_StartSound (int entnum, int entchannel, sfx_t *sfx, vec3_t origin, float fvol, float attenuation);
void I_S_StopSound (int entnum, int entchannel); void SND_StopSound (int entnum, int entchannel);
sfx_t *I_S_PrecacheSound (char *sample); sfx_t *SND_PrecacheSound (char *sample);
void I_S_ClearPrecache (void); void SND_ClearPrecache (void);
void I_S_Update (vec3_t origin, vec3_t v_forward, vec3_t v_right, vec3_t v_up); void SND_Update (vec3_t origin, vec3_t v_forward, vec3_t v_right, vec3_t v_up);
void I_S_StopAllSounds (qboolean clear); void SND_StopAllSounds (qboolean clear);
void I_S_BeginPrecaching (void); void SND_BeginPrecaching (void);
void I_S_EndPrecaching (void); void SND_EndPrecaching (void);
void I_S_ExtraUpdate (void); void SND_ExtraUpdate (void);
void I_S_LocalSound (char *s); void SND_LocalSound (char *s);
qboolean qboolean
SNDDMA_Init (void) SNDDMA_Init (void)
@ -342,24 +342,24 @@ PluginInfo (void) {
plugin_info_funcs.input = NULL; plugin_info_funcs.input = NULL;
plugin_info_funcs.sound = &plugin_info_sound_funcs; plugin_info_funcs.sound = &plugin_info_sound_funcs;
plugin_info_general_funcs.p_Init = I_S_Init; plugin_info_general_funcs.p_Init = SND_Init;
plugin_info_general_funcs.p_Shutdown = I_S_Shutdown; plugin_info_general_funcs.p_Shutdown = SND_Shutdown;
plugin_info_sound_funcs.pS_AmbientOff = I_S_AmbientOff; plugin_info_sound_funcs.pS_AmbientOff = SND_AmbientOff;
plugin_info_sound_funcs.pS_AmbientOn = I_S_AmbientOn; plugin_info_sound_funcs.pS_AmbientOn = SND_AmbientOn;
plugin_info_sound_funcs.pS_TouchSound = I_S_TouchSound; plugin_info_sound_funcs.pS_TouchSound = SND_TouchSound;
plugin_info_sound_funcs.pS_ClearBuffer = I_S_ClearBuffer; plugin_info_sound_funcs.pS_ClearBuffer = SND_ClearBuffer;
plugin_info_sound_funcs.pS_StaticSound = I_S_StaticSound; plugin_info_sound_funcs.pS_StaticSound = SND_StaticSound;
plugin_info_sound_funcs.pS_StartSound = I_S_StartSound; plugin_info_sound_funcs.pS_StartSound = SND_StartSound;
plugin_info_sound_funcs.pS_StopSound = I_S_StopSound; plugin_info_sound_funcs.pS_StopSound = SND_StopSound;
plugin_info_sound_funcs.pS_PrecacheSound = I_S_PrecacheSound; plugin_info_sound_funcs.pS_PrecacheSound = SND_PrecacheSound;
plugin_info_sound_funcs.pS_ClearPrecache = I_S_ClearPrecache; plugin_info_sound_funcs.pS_ClearPrecache = SND_ClearPrecache;
plugin_info_sound_funcs.pS_Update = I_S_Update; plugin_info_sound_funcs.pS_Update = SND_Update;
plugin_info_sound_funcs.pS_StopAllSounds = I_S_StopAllSounds; plugin_info_sound_funcs.pS_StopAllSounds = SND_StopAllSounds;
plugin_info_sound_funcs.pS_BeginPrecaching = I_S_BeginPrecaching; plugin_info_sound_funcs.pS_BeginPrecaching = SND_BeginPrecaching;
plugin_info_sound_funcs.pS_EndPrecaching = I_S_EndPrecaching; plugin_info_sound_funcs.pS_EndPrecaching = SND_EndPrecaching;
plugin_info_sound_funcs.pS_ExtraUpdate = I_S_ExtraUpdate; plugin_info_sound_funcs.pS_ExtraUpdate = SND_ExtraUpdate;
plugin_info_sound_funcs.pS_LocalSound = I_S_LocalSound; plugin_info_sound_funcs.pS_LocalSound = SND_LocalSound;
return &plugin_info; return &plugin_info;
} }

View file

@ -55,25 +55,25 @@ general_funcs_t plugin_info_general_funcs;
sound_data_t plugin_info_sound_data; sound_data_t plugin_info_sound_data;
sound_funcs_t plugin_info_sound_funcs; sound_funcs_t plugin_info_sound_funcs;
void I_S_Init (void); void SND_Init (void);
void I_S_Shutdown (void); void SND_Shutdown (void);
void I_S_AmbientOff (void); void SND_AmbientOff (void);
void I_S_AmbientOn (void); void SND_AmbientOn (void);
void I_S_TouchSound (char *sample); void SND_TouchSound (char *sample);
void I_S_ClearBuffer (void); void SND_ClearBuffer (void);
void I_S_StaticSound (sfx_t *sfx, vec3_t origin, float vol, float attenuation); void SND_StaticSound (sfx_t *sfx, vec3_t origin, float vol, float attenuation);
void I_S_StartSound (int entnum, int entchannel, sfx_t *sfx, vec3_t origin, float fvol, float attenuation); void SND_StartSound (int entnum, int entchannel, sfx_t *sfx, vec3_t origin, float fvol, float attenuation);
void I_S_StopSound (int entnum, int entchannel); void SND_StopSound (int entnum, int entchannel);
sfx_t *I_S_PrecacheSound (char *sample); sfx_t *SND_PrecacheSound (char *sample);
void I_S_ClearPrecache (void); void SND_ClearPrecache (void);
void I_S_Update (vec3_t origin, vec3_t v_forward, vec3_t v_right, vec3_t v_up); void SND_Update (vec3_t origin, vec3_t v_forward, vec3_t v_right, vec3_t v_up);
void I_S_StopAllSounds (qboolean clear); void SND_StopAllSounds (qboolean clear);
void I_S_BeginPrecaching (void); void SND_BeginPrecaching (void);
void I_S_EndPrecaching (void); void SND_EndPrecaching (void);
void I_S_ExtraUpdate (void); void SND_ExtraUpdate (void);
void I_S_LocalSound (char *s); void SND_LocalSound (char *s);
void I_S_PaintChannels (int endtime); void SND_PaintChannels (int endtime);
static void static void
paint_audio (void *unused, Uint8 * stream, int len) paint_audio (void *unused, Uint8 * stream, int len)
@ -90,7 +90,7 @@ paint_audio (void *unused, Uint8 * stream, int len)
shm->samplepos += streamsamples; shm->samplepos += streamsamples;
while (shm->samplepos >= shm->samples) while (shm->samplepos >= shm->samples)
shm->samplepos -= shm->samples; shm->samplepos -= shm->samples;
I_S_PaintChannels (soundtime + streamsamples); SND_PaintChannels (soundtime + streamsamples);
if (shm->samplepos + streamsamples <= shm->samples) if (shm->samplepos + streamsamples <= shm->samples)
memcpy (stream, shm->buffer + sampleposbytes, len); memcpy (stream, shm->buffer + sampleposbytes, len);
@ -233,24 +233,24 @@ PluginInfo (void) {
plugin_info_funcs.input = NULL; plugin_info_funcs.input = NULL;
plugin_info_funcs.sound = &plugin_info_sound_funcs; plugin_info_funcs.sound = &plugin_info_sound_funcs;
plugin_info_general_funcs.p_Init = I_S_Init; plugin_info_general_funcs.p_Init = SND_Init;
plugin_info_general_funcs.p_Shutdown = I_S_Shutdown; plugin_info_general_funcs.p_Shutdown = SND_Shutdown;
plugin_info_sound_funcs.pS_AmbientOff = I_S_AmbientOff; plugin_info_sound_funcs.pS_AmbientOff = SND_AmbientOff;
plugin_info_sound_funcs.pS_AmbientOn = I_S_AmbientOn; plugin_info_sound_funcs.pS_AmbientOn = SND_AmbientOn;
plugin_info_sound_funcs.pS_TouchSound = I_S_TouchSound; plugin_info_sound_funcs.pS_TouchSound = SND_TouchSound;
plugin_info_sound_funcs.pS_ClearBuffer = I_S_ClearBuffer; plugin_info_sound_funcs.pS_ClearBuffer = SND_ClearBuffer;
plugin_info_sound_funcs.pS_StaticSound = I_S_StaticSound; plugin_info_sound_funcs.pS_StaticSound = SND_StaticSound;
plugin_info_sound_funcs.pS_StartSound = I_S_StartSound; plugin_info_sound_funcs.pS_StartSound = SND_StartSound;
plugin_info_sound_funcs.pS_StopSound = I_S_StopSound; plugin_info_sound_funcs.pS_StopSound = SND_StopSound;
plugin_info_sound_funcs.pS_PrecacheSound = I_S_PrecacheSound; plugin_info_sound_funcs.pS_PrecacheSound = SND_PrecacheSound;
plugin_info_sound_funcs.pS_ClearPrecache = I_S_ClearPrecache; plugin_info_sound_funcs.pS_ClearPrecache = SND_ClearPrecache;
plugin_info_sound_funcs.pS_Update = I_S_Update; plugin_info_sound_funcs.pS_Update = SND_Update;
plugin_info_sound_funcs.pS_StopAllSounds = I_S_StopAllSounds; plugin_info_sound_funcs.pS_StopAllSounds = SND_StopAllSounds;
plugin_info_sound_funcs.pS_BeginPrecaching = I_S_BeginPrecaching; plugin_info_sound_funcs.pS_BeginPrecaching = SND_BeginPrecaching;
plugin_info_sound_funcs.pS_EndPrecaching = I_S_EndPrecaching; plugin_info_sound_funcs.pS_EndPrecaching = SND_EndPrecaching;
plugin_info_sound_funcs.pS_ExtraUpdate = I_S_ExtraUpdate; plugin_info_sound_funcs.pS_ExtraUpdate = SND_ExtraUpdate;
plugin_info_sound_funcs.pS_LocalSound = I_S_LocalSound; plugin_info_sound_funcs.pS_LocalSound = SND_LocalSound;
return &plugin_info; return &plugin_info;
} }

View file

@ -58,23 +58,23 @@ general_funcs_t plugin_info_general_funcs;
sound_data_t plugin_info_sound_data; sound_data_t plugin_info_sound_data;
sound_funcs_t plugin_info_sound_funcs; sound_funcs_t plugin_info_sound_funcs;
void I_S_Init (void); void SND_Init (void);
void I_S_Shutdown (void); void SND_Shutdown (void);
void I_S_AmbientOff (void); void SND_AmbientOff (void);
void I_S_AmbientOn (void); void SND_AmbientOn (void);
void I_S_TouchSound (char *sample); void SND_TouchSound (char *sample);
void I_S_ClearBuffer (void); void SND_ClearBuffer (void);
void I_S_StaticSound (sfx_t *sfx, vec3_t origin, float vol, float attenuation); void SND_StaticSound (sfx_t *sfx, vec3_t origin, float vol, float attenuation);
void I_S_StartSound (int entnum, int entchannel, sfx_t *sfx, vec3_t origin, float fvol, float attenuation); void SND_StartSound (int entnum, int entchannel, sfx_t *sfx, vec3_t origin, float fvol, float attenuation);
void I_S_StopSound (int entnum, int entchannel); void SND_StopSound (int entnum, int entchannel);
sfx_t *I_S_PrecacheSound (char *sample); sfx_t *SND_PrecacheSound (char *sample);
void I_S_ClearPrecache (void); void SND_ClearPrecache (void);
void I_S_Update (vec3_t origin, vec3_t v_forward, vec3_t v_right, vec3_t v_up); void SND_Update (vec3_t origin, vec3_t v_forward, vec3_t v_right, vec3_t v_up);
void I_S_StopAllSounds (qboolean clear); void SND_StopAllSounds (qboolean clear);
void I_S_BeginPrecaching (void); void SND_BeginPrecaching (void);
void I_S_EndPrecaching (void); void SND_EndPrecaching (void);
void I_S_ExtraUpdate (void); void SND_ExtraUpdate (void);
void I_S_LocalSound (char *s); void SND_LocalSound (char *s);
qboolean qboolean
@ -359,24 +359,24 @@ PluginInfo (void) {
plugin_info_funcs.input = NULL; plugin_info_funcs.input = NULL;
plugin_info_funcs.sound = &plugin_info_sound_funcs; plugin_info_funcs.sound = &plugin_info_sound_funcs;
plugin_info_general_funcs.p_Init = I_S_Init; plugin_info_general_funcs.p_Init = SND_Init;
plugin_info_general_funcs.p_Shutdown = I_S_Shutdown; plugin_info_general_funcs.p_Shutdown = SND_Shutdown;
plugin_info_sound_funcs.pS_AmbientOff = I_S_AmbientOff; plugin_info_sound_funcs.pS_AmbientOff = SND_AmbientOff;
plugin_info_sound_funcs.pS_AmbientOn = I_S_AmbientOn; plugin_info_sound_funcs.pS_AmbientOn = SND_AmbientOn;
plugin_info_sound_funcs.pS_TouchSound = I_S_TouchSound; plugin_info_sound_funcs.pS_TouchSound = SND_TouchSound;
plugin_info_sound_funcs.pS_ClearBuffer = I_S_ClearBuffer; plugin_info_sound_funcs.pS_ClearBuffer = SND_ClearBuffer;
plugin_info_sound_funcs.pS_StaticSound = I_S_StaticSound; plugin_info_sound_funcs.pS_StaticSound = SND_StaticSound;
plugin_info_sound_funcs.pS_StartSound = I_S_StartSound; plugin_info_sound_funcs.pS_StartSound = SND_StartSound;
plugin_info_sound_funcs.pS_StopSound = I_S_StopSound; plugin_info_sound_funcs.pS_StopSound = SND_StopSound;
plugin_info_sound_funcs.pS_PrecacheSound = I_S_PrecacheSound; plugin_info_sound_funcs.pS_PrecacheSound = SND_PrecacheSound;
plugin_info_sound_funcs.pS_ClearPrecache = I_S_ClearPrecache; plugin_info_sound_funcs.pS_ClearPrecache = SND_ClearPrecache;
plugin_info_sound_funcs.pS_Update = I_S_Update; plugin_info_sound_funcs.pS_Update = SND_Update;
plugin_info_sound_funcs.pS_StopAllSounds = I_S_StopAllSounds; plugin_info_sound_funcs.pS_StopAllSounds = SND_StopAllSounds;
plugin_info_sound_funcs.pS_BeginPrecaching = I_S_BeginPrecaching; plugin_info_sound_funcs.pS_BeginPrecaching = SND_BeginPrecaching;
plugin_info_sound_funcs.pS_EndPrecaching = I_S_EndPrecaching; plugin_info_sound_funcs.pS_EndPrecaching = SND_EndPrecaching;
plugin_info_sound_funcs.pS_ExtraUpdate = I_S_ExtraUpdate; plugin_info_sound_funcs.pS_ExtraUpdate = SND_ExtraUpdate;
plugin_info_sound_funcs.pS_LocalSound = I_S_LocalSound; plugin_info_sound_funcs.pS_LocalSound = SND_LocalSound;
return &plugin_info; return &plugin_info;
} }

View file

@ -72,23 +72,23 @@ general_funcs_t plugin_info_general_funcs;
sound_data_t plugin_info_sound_data; sound_data_t plugin_info_sound_data;
sound_funcs_t plugin_info_sound_funcs; sound_funcs_t plugin_info_sound_funcs;
void I_S_Init (void); void SND_Init (void);
void I_S_Shutdown (void); void SND_Shutdown (void);
void I_S_AmbientOff (void); void SND_AmbientOff (void);
void I_S_AmbientOn (void); void SND_AmbientOn (void);
void I_S_TouchSound (char *sample); void SND_TouchSound (char *sample);
void I_S_ClearBuffer (void); void SND_ClearBuffer (void);
void I_S_StaticSound (sfx_t *sfx, vec3_t origin, float vol, float attenuation); void SND_StaticSound (sfx_t *sfx, vec3_t origin, float vol, float attenuation);
void I_S_StartSound (int entnum, int entchannel, sfx_t *sfx, vec3_t origin, float fvol, float attenuation); void SND_StartSound (int entnum, int entchannel, sfx_t *sfx, vec3_t origin, float fvol, float attenuation);
void I_S_StopSound (int entnum, int entchannel); void SND_StopSound (int entnum, int entchannel);
sfx_t *I_S_PrecacheSound (char *sample); sfx_t *SND_PrecacheSound (char *sample);
void I_S_ClearPrecache (void); void SND_ClearPrecache (void);
void I_S_Update (vec3_t origin, vec3_t v_forward, vec3_t v_right, vec3_t v_up); void SND_Update (vec3_t origin, vec3_t v_forward, vec3_t v_right, vec3_t v_up);
void I_S_StopAllSounds (qboolean clear); void SND_StopAllSounds (qboolean clear);
void I_S_BeginPrecaching (void); void SND_BeginPrecaching (void);
void I_S_EndPrecaching (void); void SND_EndPrecaching (void);
void I_S_ExtraUpdate (void); void SND_ExtraUpdate (void);
void I_S_LocalSound (char *s); void SND_LocalSound (char *s);
qboolean qboolean
SNDDMA_Init (void) SNDDMA_Init (void)
@ -273,24 +273,24 @@ PluginInfo (void) {
plugin_info_funcs.input = NULL; plugin_info_funcs.input = NULL;
plugin_info_funcs.sound = &plugin_info_sound_funcs; plugin_info_funcs.sound = &plugin_info_sound_funcs;
plugin_info_general_funcs.p_Init = I_S_Init; plugin_info_general_funcs.p_Init = SND_Init;
plugin_info_general_funcs.p_Shutdown = I_S_Shutdown; plugin_info_general_funcs.p_Shutdown = SND_Shutdown;
plugin_info_sound_funcs.pS_AmbientOff = I_S_AmbientOff; plugin_info_sound_funcs.pS_AmbientOff = SND_AmbientOff;
plugin_info_sound_funcs.pS_AmbientOn = I_S_AmbientOn; plugin_info_sound_funcs.pS_AmbientOn = SND_AmbientOn;
plugin_info_sound_funcs.pS_TouchSound = I_S_TouchSound; plugin_info_sound_funcs.pS_TouchSound = SND_TouchSound;
plugin_info_sound_funcs.pS_ClearBuffer = I_S_ClearBuffer; plugin_info_sound_funcs.pS_ClearBuffer = SND_ClearBuffer;
plugin_info_sound_funcs.pS_StaticSound = I_S_StaticSound; plugin_info_sound_funcs.pS_StaticSound = SND_StaticSound;
plugin_info_sound_funcs.pS_StartSound = I_S_StartSound; plugin_info_sound_funcs.pS_StartSound = SND_StartSound;
plugin_info_sound_funcs.pS_StopSound = I_S_StopSound; plugin_info_sound_funcs.pS_StopSound = SND_StopSound;
plugin_info_sound_funcs.pS_PrecacheSound = I_S_PrecacheSound; plugin_info_sound_funcs.pS_PrecacheSound = SND_PrecacheSound;
plugin_info_sound_funcs.pS_ClearPrecache = I_S_ClearPrecache; plugin_info_sound_funcs.pS_ClearPrecache = SND_ClearPrecache;
plugin_info_sound_funcs.pS_Update = I_S_Update; plugin_info_sound_funcs.pS_Update = SND_Update;
plugin_info_sound_funcs.pS_StopAllSounds = I_S_StopAllSounds; plugin_info_sound_funcs.pS_StopAllSounds = SND_StopAllSounds;
plugin_info_sound_funcs.pS_BeginPrecaching = I_S_BeginPrecaching; plugin_info_sound_funcs.pS_BeginPrecaching = SND_BeginPrecaching;
plugin_info_sound_funcs.pS_EndPrecaching = I_S_EndPrecaching; plugin_info_sound_funcs.pS_EndPrecaching = SND_EndPrecaching;
plugin_info_sound_funcs.pS_ExtraUpdate = I_S_ExtraUpdate; plugin_info_sound_funcs.pS_ExtraUpdate = SND_ExtraUpdate;
plugin_info_sound_funcs.pS_LocalSound = I_S_LocalSound; plugin_info_sound_funcs.pS_LocalSound = SND_LocalSound;
return &plugin_info; return &plugin_info;
} }