icculus quake2 doxygen
1.0 dev
|
|
Go to the documentation of this file.
36 #define SOUND_FULLVOLUME 80
38 #define SOUND_LOOPATTENUATE 0.003
63 #define MAX_SFX (MAX_SOUNDS*2)
67 #define MAX_PLAYSOUNDS 128
120 Com_Printf(
"\n------- sound initialization -------\n");
122 cv =
Cvar_Get (
"s_initsound",
"1", 0);
156 Com_Printf(
"------------------------------------\n");
188 memset (sfx, 0,
sizeof(*sfx));
242 memset (sfx, 0,
sizeof(*sfx));
263 strcpy (s, truename);
278 memset (sfx, 0,
sizeof(*sfx));
279 strcpy (sfx->
name, aliasname);
343 memset (sfx, 0,
sizeof(*sfx));
387 life_left = 0x7fffffff;
391 &&
channels[ch_idx].entnum == entnum
392 &&
channels[ch_idx].entchannel == entchannel)
394 first_to_die = ch_idx;
405 first_to_die = ch_idx;
409 if (first_to_die == -1)
413 memset (ch, 0,
sizeof(*ch));
429 vec_t lscale, rscale, scale;
434 *left_vol = *right_vol = 255;
456 rscale = 0.5 * (1.0 + dot);
457 lscale = 0.5*(1.0 - dot);
461 scale = (1.0 - dist) * rscale;
462 *right_vol = (
int) (master_vol * scale);
466 scale = (1.0 - dist) * lscale;
467 *left_vol = (
int) (master_vol * scale);
607 p = strchr(model,
'/');
614 strcpy(model,
"male");
617 Com_sprintf (sexedFilename,
sizeof(sexedFilename),
"#players/%s/%s", model, base+1);
633 Com_sprintf (maleFilename,
sizeof(maleFilename),
"player/%s/%s",
"male", base+1);
668 if (sfx->
name[0] ==
'*')
748 Com_Printf (
"S_StartLocalSound: can't cache %s\n", sound);
778 unsigned char *ptr = (
unsigned char *)
dma.
buffer;
834 int left,
right, left_total, right_total;
874 &left_total, &right_total);
877 if (sounds[
j] != sounds[
i])
887 right_total +=
right;
890 if (left_total == 0 && right_total == 0)
898 if (left_total > 255)
900 if (right_total > 255)
956 for (
i=0 ;
i<samples ;
i++)
1007 ((
char *)data)[src*2] << 16;
1009 ((
char *)data)[src*2+1] << 16;
1022 (((
byte *)data)[src]-128) << 16;
1075 memset (ch, 0,
sizeof(*ch));
1081 memset (ch, 0,
sizeof(*ch));
1114 static int oldsamplepos;
1123 if (samplepos < oldsamplepos)
1134 oldsamplepos = samplepos;
1199 strcat(
name,
".wav");
1234 if (sfx->
name[0] ==
'*')
short LittleShort(short l)
CONST PIXELFORMATDESCRIPTOR int
channel_t * S_PickChannel(int entnum, int entchannel)
#define VectorSubtract(a, b, c)
sfx_t * S_AliasName(char *aliasname, char *truename)
void S_PaintChannels(int endtime)
playsound_t s_playsounds[MAX_PLAYSOUNDS]
void S_Spatialize(channel_t *ch)
struct sfx_s * sound_precache[MAX_SOUNDS]
cvar_t * Cvar_Get(char *var_name, char *var_value, int flags)
struct sfx_s * S_RegisterSexedSound(entity_state_t *ent, char *base)
int FS_FOpenFile(char *filename, FILE **file)
void S_SpatializeOrigin(vec3_t origin, float master_vol, float dist_mult, int *left_vol, int *right_vol)
void Cmd_RemoveCommand(char *cmd_name)
struct playsound_s * prev
sfxcache_t * S_LoadSound(sfx_t *s)
sfx_t * S_RegisterSound(char *name)
sfx_t * S_FindName(char *name, qboolean create)
struct playsound_s * next
void S_EndRegistration(void)
playsound_t * S_AllocPlaysound(void)
void Cmd_AddCommand(char *cmd_name, xcommand_t function)
vec_t VectorNormalize(vec3_t v)
void S_IssuePlaysound(playsound_t *ps)
channel_t channels[MAX_CHANNELS]
void Com_Error(int code, char *fmt,...)
void * Z_Malloc(int size)
void S_FreePlaysound(playsound_t *ps)
int SNDDMA_GetDMAPos(void)
void CL_GetEntitySoundOrigin(int ent, vec3_t org)
portable_samplepair_t s_rawsamples[MAX_RAW_SAMPLES]
void FS_FCloseFile(FILE *f)
#define MAX_PARSE_ENTITIES
#define SOUND_LOOPATTENUATE
entity_state_t cl_parse_entities[MAX_PARSE_ENTITIES]
void S_BeginRegistration(void)
void SNDDMA_BeginPainting(void)
void S_RawSamples(int samples, int rate, int width, int channels, byte *data)
int s_registration_sequence
void Com_PageInMemory(byte *buffer, int size)
void S_InitScaletable(void)
playsound_t s_pendingplays
char configstrings[MAX_CONFIGSTRINGS][MAX_QPATH]
void Com_DPrintf(char *fmt,...)
void S_StopAllSounds(void)
void S_StartLocalSound(char *sound)
void Com_Printf(char *fmt,...)
void S_AddLoopSounds(void)
void SNDDMA_Shutdown(void)
centity_t cl_entities[MAX_EDICTS]
void Com_sprintf(char *dest, int size, char *fmt,...)
void S_Update(vec3_t origin, vec3_t forward, vec3_t right, vec3_t up)
void S_StartSound(vec3_t origin, int entnum, int entchannel, sfx_t *sfx, float fvol, float attenuation, float timeofs)
int registration_sequence