[audio] Clean up a few minor style issues

This commit is contained in:
Bill Currie 2021-06-25 16:52:09 +09:00
parent 580464d6be
commit a1a89bdb7e
5 changed files with 15 additions and 21 deletions

View File

@ -36,7 +36,7 @@ typedef struct snd_render_funcs_s {
void (*ambient_off) (void); void (*ambient_off) (void);
void (*ambient_on) (void); void (*ambient_on) (void);
void (*static_sound) (struct sfx_s *sfx, const vec3_t origin, float vol, float attenuation); void (*static_sound) (struct sfx_s *sfx, const vec3_t origin, float vol, float attenuation);
void (*start_sound) (int entnum, int entchannel, struct sfx_s *sfx, const vec3_t origin, float fvol, float attenuation); void (*start_sound) (int entnum, int entchannel, struct sfx_s *sfx, const vec3_t origin, float vol, float attenuation);
void (*local_sound) (const char *s); void (*local_sound) (const char *s);
void (*stop_sound) (int entnum, int entchannel); void (*stop_sound) (int entnum, int entchannel);

View File

@ -103,11 +103,11 @@ void S_Shutdown (void);
- 4 body - 4 body
\param sfx sound to play \param sfx sound to play
\param origin 3d coords of where the sound originates \param origin 3d coords of where the sound originates
\param fvol absolute volume of the sound \param vol absolute volume of the sound
\param attenuation rate of volume dropoff vs distance \param attenuation rate of volume dropoff vs distance
*/ */
void S_StartSound (int entnum, int entchannel, sfx_t *sfx, const vec3_t origin, void S_StartSound (int entnum, int entchannel, sfx_t *sfx, const vec3_t origin,
float fvol, float attenuation); float vol, float attenuation);
/** Create a sound generated by the world. /** Create a sound generated by the world.
\param sfx sound to play \param sfx sound to play

View File

@ -61,7 +61,8 @@ static cvar_t *wildmidi_volume;
static cvar_t *wildmidi_config; static cvar_t *wildmidi_config;
static int static int
midi_init (snd_t *snd) { midi_init (snd_t *snd)
{
wildmidi_volume = Cvar_Get ("wildmidi_volume", "100", CVAR_ARCHIVE, NULL, wildmidi_volume = Cvar_Get ("wildmidi_volume", "100", CVAR_ARCHIVE, NULL,
"Set the Master Volume"); "Set the Master Volume");
wildmidi_config = Cvar_Get ("wildmidi_config", "/etc/timidity.cfg", wildmidi_config = Cvar_Get ("wildmidi_config", "/etc/timidity.cfg",
@ -75,7 +76,8 @@ midi_init (snd_t *snd) {
} }
static wavinfo_t static wavinfo_t
midi_get_info (snd_t *snd, void *handle) { midi_get_info (snd_t *snd, void *handle)
{
wavinfo_t info; wavinfo_t info;
struct _WM_Info *wm_info; struct _WM_Info *wm_info;

View File

@ -395,12 +395,12 @@ s_static_sound (sfx_t *sfx, const vec3_t origin, float vol,
static void static void
s_start_sound (int entnum, int entchannel, sfx_t *sfx, const vec3_t origin, s_start_sound (int entnum, int entchannel, sfx_t *sfx, const vec3_t origin,
float fvol, float attenuation) float vol, float attenuation)
{ {
if (!sound_started) if (!sound_started)
return; return;
if (!snd_shutdown) if (!snd_shutdown)
SND_StartSound (&snd, entnum, entchannel, sfx, origin, fvol, SND_StartSound (&snd, entnum, entchannel, sfx, origin, vol,
attenuation); attenuation);
} }
@ -482,21 +482,13 @@ static snd_render_funcs_t plugin_info_render_funcs = {
}; };
static plugin_funcs_t plugin_info_funcs = { static plugin_funcs_t plugin_info_funcs = {
&plugin_info_general_funcs, .general = &plugin_info_general_funcs,
0, .snd_render = &plugin_info_render_funcs,
0,
0,
0,
&plugin_info_render_funcs,
}; };
static plugin_data_t plugin_info_data = { static plugin_data_t plugin_info_data = {
&plugin_info_general_data, .general = &plugin_info_general_data,
0, .snd_render = &snd_render_data,
0,
0,
0,
&snd_render_data,
}; };
static plugin_t plugin_info = { static plugin_t plugin_info = {

View File

@ -144,10 +144,10 @@ S_StaticSound (sfx_t *sfx, const vec3_t origin, float vol, float attenuation)
VISIBLE void VISIBLE void
S_StartSound (int entnum, int entchannel, sfx_t *sfx, const vec3_t origin, S_StartSound (int entnum, int entchannel, sfx_t *sfx, const vec3_t origin,
float fvol, float attenuation) float vol, float attenuation)
{ {
if (snd_render_funcs) if (snd_render_funcs)
snd_render_funcs->start_sound (entnum, entchannel, sfx, origin, fvol, snd_render_funcs->start_sound (entnum, entchannel, sfx, origin, vol,
attenuation); attenuation);
} }