44 if (!
s_env.channels[
i].sample)
68 const int c = (
int)((ptrdiff_t)(ch -
s_env.channels));
79 angle = (
int)(450.0 - acos(dot) *
todeg) % 360;
83 Mix_SetPosition(c, (
int)angle, (
int)dist);
99 if (!
s_env.initialized)
124 const float volume =
snd_volume->value * relVolume * MIX_MAX_VOLUME;
136 if (!sample || !sample->
chunk)
142 if (
s_env.channels[
i].sample == sample) {
161 ch = &
s_env.channels[chIdx];
166 ch->
atten = attenuation;
169 float volume =
snd_volume->value * relVolume * MIX_MAX_VOLUME;
186 if (!
s_env.initialized)
int CL_Milliseconds(void)
Share stuff between the different cgame implementations.
void Com_DPrintf(int level, const char *fmt,...)
A Com_Printf that only shows up if the "developer" cvar is set.
void Com_Printf(const char *const fmt,...)
typedef int(ZCALLBACK *close_file_func) OF((voidpf opaque
vec_t VectorNormalize(vec3_t v)
Calculate unit vector for a given vec3_t.
vec_t VectorLength(const vec3_t v)
Calculate the length of a vector.
void VectorMix(const vec3_t v1, const vec3_t v2, float mix, vec3_t out)
Calculate a position on v1 v2 line.
QGL_EXTERN GLuint GLsizei GLsizei GLint GLenum GLchar * name
#define MAX_CHANNELS
the sound environment
cvar_t * snd_distance_scale
s_sample_t * S_LoadSample(const char *soundFile)
Loads and registers a sound file for later use.
void S_FreeChannel(int c)
Callback that is called when a channel finished playing.
void S_LoopSample(const vec3_t org, s_sample_t *sample, float relVolume, float attenuation)
Adds a loop sample for e.g. ambient sounds.
void S_StartLocalSample(const char *name, float relVolume)
Plays a sample without spatialization.
static int S_AllocChannel(void)
Searches a channel with no sample applied yet.
void S_PlaySample(const vec3_t origin, s_sample_t *sample, float atten, float relVolume)
Validates the parms and queues the sound up.
void S_SpatializeChannel(const s_channel_t *ch)
Set distance and stereo panning for the specified channel.
#define VectorSubtract(a, b, dest)
#define VectorCopy(src, dest)
#define DotProduct(x, y)
Returns the distance between two 3-dimensional vectors.