Quake II RTX doxygen  1.0 dev
al.c
Go to the documentation of this file.
1 /*
2 Copyright (C) 2010 Andrey Nazarov
3 
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
8 
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13 
14 You should have received a copy of the GNU General Public License along
15 with this program; if not, write to the Free Software Foundation, Inc.,
16 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17 */
18 
19 #include "sound.h"
20 
21 #if USE_FIXED_LIBAL
22 #include "qal/fixed.h"
23 #else
24 #include "qal/dynamic.h"
25 #endif
26 
27 // translates from AL coordinate system to quake
28 #define AL_UnpackVector(v) -v[1],v[2],-v[0]
29 #define AL_CopyVector(a,b) ((b)[0]=-(a)[1],(b)[1]=(a)[2],(b)[2]=-(a)[0])
30 
31 // OpenAL implementation should support at least this number of sources
32 #define MIN_CHANNELS 16
33 
35 qboolean streamPlaying = qfalse;
36 static ALuint s_srcnums[MAX_CHANNELS];
37 static ALuint streamSource = 0;
38 static int s_framecount;
39 
40 void AL_SoundInfo(void)
41 {
42  Com_Printf("AL_VENDOR: %s\n", qalGetString(AL_VENDOR));
43  Com_Printf("AL_RENDERER: %s\n", qalGetString(AL_RENDERER));
44  Com_Printf("AL_VERSION: %s\n", qalGetString(AL_VERSION));
45  Com_Printf("AL_EXTENSIONS: %s\n", qalGetString(AL_EXTENSIONS));
46  Com_Printf("Number of sources: %d\n", s_numchannels);
47 }
48 
49 /*
50 * Set up the stream sources
51 */
52 static void
54 {
55  qalSource3f(streamSource, AL_POSITION, 0.0, 0.0, 0.0);
56  qalSource3f(streamSource, AL_VELOCITY, 0.0, 0.0, 0.0);
57  qalSource3f(streamSource, AL_DIRECTION, 0.0, 0.0, 0.0);
58  qalSourcef(streamSource, AL_ROLLOFF_FACTOR, 0.0);
59  qalSourcei(streamSource, AL_BUFFER, 0);
60  qalSourcei(streamSource, AL_LOOPING, AL_FALSE);
61  qalSourcei(streamSource, AL_SOURCE_RELATIVE, AL_TRUE);
62 }
63 
64 /*
65 * Silence / stop all OpenAL streams
66 */
67 static void
69 {
70  int numBuffers;
71 
72  streamPlaying = qfalse;
74 
75  /* Un-queue any buffers, and delete them */
76  qalGetSourcei(streamSource, AL_BUFFERS_QUEUED, &numBuffers);
77 
78  while (numBuffers--)
79  {
80  ALuint buffer;
82  qalDeleteBuffers(1, &buffer);
84  }
85 }
86 
87 /*
88 * Updates stream sources by removing all played
89 * buffers and restarting playback if necessary.
90 */
91 static void
93 {
94  int numBuffers;
95  ALint state;
96 
97  qalGetSourcei(streamSource, AL_SOURCE_STATE, &state);
98 
99  if (state == AL_STOPPED)
100  {
101  streamPlaying = qfalse;
102  }
103  else
104  {
105  /* Un-queue any already played buffers and delete them */
106  qalGetSourcei(streamSource, AL_BUFFERS_PROCESSED, &numBuffers);
107 
108  while (numBuffers--)
109  {
110  ALuint buffer;
112  qalDeleteBuffers(1, &buffer);
113  active_buffers--;
114  }
115  }
116 
117  /* Start the streamSource playing if necessary */
118  qalGetSourcei(streamSource, AL_BUFFERS_QUEUED, &numBuffers);
119 
120  if (!streamPlaying && numBuffers)
121  {
123  streamPlaying = qtrue;
124  }
125 }
126 
127 qboolean AL_Init(void)
128 {
129  int i;
130 
131  Com_DPrintf("Initializing OpenAL\n");
132 
133  if (!QAL_Init()) {
134  goto fail0;
135  }
136 
137  // check for linear distance extension
138  if (!qalIsExtensionPresent("AL_EXT_LINEAR_DISTANCE")) {
139  Com_SetLastError("AL_EXT_LINEAR_DISTANCE extension is missing");
140  goto fail1;
141  }
142 
143  /* generate source names */
144  qalGetError();
146 
147  if (qalGetError() != AL_NO_ERROR)
148  {
149  Com_Printf("ERROR: Couldn't get a single Source.\n");
150  QAL_Shutdown();
151  return qfalse;
152  }
153  else
154  {
155  for (i = 0; i < MAX_CHANNELS; i++) {
156  qalGenSources(1, &s_srcnums[i]);
157  if (qalGetError() != AL_NO_ERROR) {
158  break;
159  }
160  }
161  }
162 
163  Com_DPrintf("Got %d AL sources\n", i);
164 
165  if (i < MIN_CHANNELS) {
166  Com_SetLastError("Insufficient number of AL sources");
167  goto fail1;
168  }
169 
170  s_numchannels = i;
172 
173  Com_Printf("OpenAL initialized.\n");
174  return qtrue;
175 
176 fail1:
177  QAL_Shutdown();
178 fail0:
179  Com_EPrintf("Failed to initialize OpenAL: %s\n", Com_GetLastError());
180  return qfalse;
181 }
182 
183 void AL_Shutdown(void)
184 {
185  Com_Printf("Shutting down OpenAL.\n");
186 
188 
190 
191  if (s_numchannels) {
192  // delete source names
194  memset(s_srcnums, 0, sizeof(s_srcnums));
195  s_numchannels = 0;
196  }
197 
198  QAL_Shutdown();
199 }
200 
202 {
203  sfxcache_t *sc;
204  ALsizei size = s_info.samples * s_info.width;
205  ALenum format = s_info.width == 2 ? AL_FORMAT_MONO16 : AL_FORMAT_MONO8;
206  ALuint name;
207 
208  if (!size) {
209  s->error = Q_ERR_TOO_FEW;
210  return NULL;
211  }
212 
213  qalGetError();
214  qalGenBuffers(1, &name);
215  qalBufferData(name, format, s_info.data, size, s_info.rate);
216  if (qalGetError() != AL_NO_ERROR) {
217  s->error = Q_ERR_LIBRARY_ERROR;
218  return NULL;
219  }
220 
221 #if 0
222  // specify OpenAL-Soft style loop points
223  if (s_info.loopstart > 0 && qalIsExtensionPresent("AL_SOFT_loop_points")) {
224  ALint points[2] = { s_info.loopstart, s_info.samples };
225  qalBufferiv(name, AL_LOOP_POINTS_SOFT, points);
226  }
227 #endif
228 
229  // allocate placeholder sfxcache
230  sc = s->cache = S_Malloc(sizeof(*sc));
231  sc->length = s_info.samples * 1000 / s_info.rate; // in msec
232  sc->loopstart = s_info.loopstart;
233  sc->width = s_info.width;
234  sc->size = size;
235  sc->bufnum = name;
236 
237  return sc;
238 }
239 
241 {
242  sfxcache_t *sc;
243  ALuint name;
244 
245  sc = s->cache;
246  if (!sc) {
247  return;
248  }
249 
250  name = sc->bufnum;
251  qalDeleteBuffers(1, &name);
252 }
253 
254 static void AL_Spatialize(channel_t *ch)
255 {
256  vec3_t origin;
257 
258  // anything coming from the view entity will always be full volume
259  // no attenuation = no spatialization
260  if (ch->entnum == -1 || ch->entnum == listener_entnum || !ch->dist_mult) {
261  VectorCopy(listener_origin, origin);
262  } else if (ch->fixed_origin) {
263  VectorCopy(ch->origin, origin);
264  } else {
266  }
267 
268  qalSource3f(ch->srcnum, AL_POSITION, AL_UnpackVector(origin));
269 }
270 
272 {
273 #ifdef _DEBUG
274  if (s_show->integer > 1)
275  Com_Printf("%s: %s\n", __func__, ch->sfx->name);
276 #endif
277 
278  // stop it
279  qalSourceStop(ch->srcnum);
280  qalSourcei(ch->srcnum, AL_BUFFER, AL_NONE);
281  memset(ch, 0, sizeof(*ch));
282 }
283 
285 {
286  sfxcache_t *sc = ch->sfx->cache;
287 
288 #ifdef _DEBUG
289  if (s_show->integer > 1)
290  Com_Printf("%s: %s\n", __func__, ch->sfx->name);
291 #endif
292 
293  ch->srcnum = s_srcnums[ch - channels];
294  qalGetError();
295  qalSourcei(ch->srcnum, AL_BUFFER, sc->bufnum);
296  if (ch->autosound /*|| sc->loopstart >= 0*/) {
297  qalSourcei(ch->srcnum, AL_LOOPING, AL_TRUE);
298  } else {
299  qalSourcei(ch->srcnum, AL_LOOPING, AL_FALSE);
300  }
301  qalSourcef(ch->srcnum, AL_GAIN, ch->master_vol);
302  qalSourcef(ch->srcnum, AL_REFERENCE_DISTANCE, SOUND_FULLVOLUME);
303  qalSourcef(ch->srcnum, AL_MAX_DISTANCE, 8192);
304  qalSourcef(ch->srcnum, AL_ROLLOFF_FACTOR, ch->dist_mult * (8192 - SOUND_FULLVOLUME));
305 
306  AL_Spatialize(ch);
307 
308  // play it
309  qalSourcePlay(ch->srcnum);
310  if (qalGetError() != AL_NO_ERROR) {
311  AL_StopChannel(ch);
312  }
313 }
314 
315 static void AL_IssuePlaysounds(void)
316 {
317  playsound_t *ps;
318 
319  // start any playsounds
320  while (1) {
321  ps = s_pendingplays.next;
322  if (ps == &s_pendingplays)
323  break; // no more pending sounds
324  if (ps->begin > paintedtime)
325  break;
326  S_IssuePlaysound(ps);
327  }
328 }
329 
331 {
332  int i;
333  channel_t *ch;
334 
335  ch = channels;
336  for (i = 0; i < s_numchannels; i++, ch++) {
337  if (!ch->sfx)
338  continue;
339  AL_StopChannel(ch);
340  }
341 }
342 
343 static channel_t *AL_FindLoopingSound(int entnum, sfx_t *sfx)
344 {
345  int i;
346  channel_t *ch;
347 
348  ch = channels;
349  for (i = 0; i < s_numchannels; i++, ch++) {
350  if (!ch->sfx)
351  continue;
352  if (!ch->autosound)
353  continue;
354  if (entnum && ch->entnum != entnum)
355  continue;
356  if (ch->sfx != sfx)
357  continue;
358  return ch;
359  }
360 
361  return NULL;
362 }
363 
364 static void AL_AddLoopSounds(void)
365 {
366  int i;
367  int sounds[MAX_EDICTS];
368  channel_t *ch, *ch2;
369  sfx_t *sfx;
370  sfxcache_t *sc;
371  int num;
372  entity_state_t *ent;
373  vec3_t origin;
374  float dist;
375 
376  if (cls.state != ca_active || sv_paused->integer || !s_ambient->integer) {
377  return;
378  }
379 
380  S_BuildSoundList(sounds);
381 
382  for (i = 0; i < cl.frame.numEntities; i++) {
383  if (!sounds[i])
384  continue;
385 
386  sfx = S_SfxForHandle(cl.sound_precache[sounds[i]]);
387  if (!sfx)
388  continue; // bad sound effect
389  sc = sfx->cache;
390  if (!sc)
391  continue;
392 
393  num = (cl.frame.firstEntity + i) & PARSE_ENTITIES_MASK;
394  ent = &cl.entityStates[num];
395 
396  ch = AL_FindLoopingSound(ent->number, sfx);
397  if (ch) {
398  ch->autoframe = s_framecount;
399  ch->end = paintedtime + sc->length;
400  continue;
401  }
402 
403  // check attenuation before playing the sound
404  CL_GetEntitySoundOrigin(ent->number, origin);
405  VectorSubtract(origin, listener_origin, origin);
406  dist = VectorNormalize(origin);
407  dist = (dist - SOUND_FULLVOLUME) * SOUND_LOOPATTENUATE;
408  if(dist >= 1.f)
409  continue; // completely attenuated
410 
411  // allocate a channel
412  ch = S_PickChannel(0, 0);
413  if (!ch)
414  continue;
415 
416  ch2 = AL_FindLoopingSound(0, sfx);
417 
418  ch->autosound = qtrue; // remove next frame
419  ch->autoframe = s_framecount;
420  ch->sfx = sfx;
421  ch->entnum = ent->number;
422  ch->master_vol = 1;
424  ch->end = paintedtime + sc->length;
425 
426  AL_PlayChannel(ch);
427 
428  // attempt to synchronize with existing sounds of the same type
429  if (ch2) {
430  ALint offset;
431 
432  qalGetSourcei(ch2->srcnum, AL_SAMPLE_OFFSET, &offset);
433  qalSourcei(ch->srcnum, AL_SAMPLE_OFFSET, offset);
434  }
435  }
436 }
437 
438 void AL_Update(void)
439 {
440  int i;
441  channel_t *ch;
442  vec_t orientation[6];
443 
444  if (!s_active) {
445  return;
446  }
447 
448  paintedtime = cl.time;
449 
450  // set listener parameters
452  AL_CopyVector(listener_forward, orientation);
453  AL_CopyVector(listener_up, orientation + 3);
454  qalListenerfv(AL_ORIENTATION, orientation);
455  qalListenerf(AL_GAIN, S_GetLinearVolume(s_volume->value));
456  qalDistanceModel(AL_LINEAR_DISTANCE_CLAMPED);
457 
458  // update spatialization for dynamic sounds
459  ch = channels;
460  for (i = 0; i < s_numchannels; i++, ch++) {
461  if (!ch->sfx)
462  continue;
463 
464  if (ch->autosound) {
465  // autosounds are regenerated fresh each frame
466  if (ch->autoframe != s_framecount) {
467  AL_StopChannel(ch);
468  continue;
469  }
470  } else {
471  ALenum state;
472 
473  qalGetError();
474  qalGetSourcei(ch->srcnum, AL_SOURCE_STATE, &state);
475  if (qalGetError() != AL_NO_ERROR || state == AL_STOPPED) {
476  AL_StopChannel(ch);
477  continue;
478  }
479  }
480 
481 #ifdef _DEBUG
482  if (s_show->integer) {
483  Com_Printf("%.1f %s\n", ch->master_vol, ch->sfx->name);
484  // total++;
485  }
486 #endif
487 
488  AL_Spatialize(ch); // respatialize channel
489  }
490 
491  s_framecount++;
492 
493  // add loopsounds
495 
496  AL_StreamUpdate();
498 }
499 
500 /*
501 * Queues raw samples for playback. Used
502 * by the background music an cinematics.
503 */
504 void
505 AL_RawSamples(int samples, int rate, int width, int channels,
506  byte *data, float volume)
507 {
508  ALuint buffer;
509  ALuint format = 0;
510 
511  /* Work out format */
512  if (width == 1)
513  {
514  if (channels == 1)
515  {
516  format = AL_FORMAT_MONO8;
517  }
518  else if (channels == 2)
519  {
520  format = AL_FORMAT_STEREO8;
521  }
522  }
523  else if (width == 2)
524  {
525  if (channels == 1)
526  {
527  format = AL_FORMAT_MONO16;
528  }
529  else if (channels == 2)
530  {
531  format = AL_FORMAT_STEREO16;
532  }
533  }
534 
535  /* Create a buffer, and stuff the data into it */
536  qalGenBuffers(1, &buffer);
537  qalBufferData(buffer, format, (ALvoid *)data,
538  (samples * width * channels), rate);
539  active_buffers++;
540 
541  /* set volume */
542  if (volume > 1.0f)
543  {
544  volume = 1.0f;
545  }
546 
547  qalSourcef(streamSource, AL_GAIN, volume);
548 
549  /* Shove the data onto the streamSource */
550  qalSourceQueueBuffers(streamSource, 1, &buffer);
551 
552  /* emulate behavior of S_RawSamples for s_rawend */
553  s_rawend += samples;
554 }
555 
556 /*
557 * Kills all raw samples still in flight.
558 * This is used to stop music playback
559 * when silence is triggered.
560 */
561 void
563 {
564  AL_StreamDie();
565 }
client_state_s::frame
server_frame_t frame
Definition: client.h:212
qalBufferData
#define qalBufferData
Definition: fixed.h:82
qalGetString
#define qalGetString
Definition: fixed.h:29
AL_PlayChannel
void AL_PlayChannel(channel_t *ch)
Definition: al.c:284
client_state_s::entityStates
entity_state_t entityStates[MAX_PARSE_ENTITIES]
Definition: client.h:204
listener_origin
vec3_t listener_origin
Definition: main.c:35
qalSourcePlay
#define qalSourcePlay
Definition: fixed.h:73
s_info
wavinfo_t s_info
Definition: mem.c:22
wavinfo_t::width
int width
Definition: sound.h:91
MAX_CHANNELS
#define MAX_CHANNELS
Definition: sound.h:141
AL_UploadSfx
sfxcache_t * AL_UploadSfx(sfx_t *s)
Definition: al.c:201
AL_LOOP_POINTS_SOFT
#define AL_LOOP_POINTS_SOFT
Definition: dynamic.h:24
AL_InitStreamSource
static void AL_InitStreamSource()
Definition: al.c:53
s_show
cvar_t * s_show
AL_StreamDie
static void AL_StreamDie(void)
Definition: al.c:68
playsound_s
Definition: sound.h:55
channel_s::dist_mult
vec_t dist_mult
Definition: sound.h:78
channels
channel_t channels[MAX_CHANNELS]
Definition: main.c:29
QAL_Shutdown
QAL_IMP void QAL_Shutdown(void)
Definition: dynamic.c:64
listener_up
vec3_t listener_up
Definition: main.c:38
AL_Init
qboolean AL_Init(void)
Definition: al.c:127
AL_FindLoopingSound
static channel_t * AL_FindLoopingSound(int entnum, sfx_t *sfx)
Definition: al.c:343
qalGenSources
#define qalGenSources
Definition: fixed.h:54
wavinfo_t::samples
int samples
Definition: sound.h:93
sfx_s
Definition: sound.h:44
CL_GetEntitySoundOrigin
void CL_GetEntitySoundOrigin(int ent, vec3_t org)
Definition: entities.c:1404
channel_s::origin
vec3_t origin
Definition: sound.h:77
ca_active
@ ca_active
Definition: client.h:340
qalSourceStop
#define qalSourceStop
Definition: fixed.h:74
client_static_s::state
connstate_t state
Definition: client.h:375
qalDeleteBuffers
#define qalDeleteBuffers
Definition: fixed.h:80
AL_IssuePlaysounds
static void AL_IssuePlaysounds(void)
Definition: al.c:315
streamSource
static ALuint streamSource
Definition: al.c:37
AL_CopyVector
#define AL_CopyVector(a, b)
Definition: al.c:29
sv_paused
cvar_t * sv_paused
Definition: common.c:96
fixed.h
channel_s::end
int end
Definition: sound.h:72
sfxcache_s::length
int length
Definition: sound.h:34
paintedtime
int paintedtime
Definition: main.c:43
AL_SoundInfo
void AL_SoundInfo(void)
Definition: al.c:40
qalGetSourcei
#define qalGetSourcei
Definition: fixed.h:66
AL_Shutdown
void AL_Shutdown(void)
Definition: al.c:183
client_state_s::sound_precache
qhandle_t sound_precache[MAX_SOUNDS]
Definition: client.h:305
qalDeleteSources
#define qalDeleteSources
Definition: fixed.h:55
playsound_s::begin
unsigned begin
Definition: sound.h:64
dynamic.h
sfx_s::error
qerror_t error
Definition: sound.h:49
width
static int width
Definition: physical_sky.c:38
sfx_s::cache
sfxcache_t * cache
Definition: sound.h:47
AL_UnqueueRawSamples
void AL_UnqueueRawSamples()
Definition: al.c:562
channel_s::entnum
int entnum
Definition: sound.h:75
wavinfo_t::data
byte * data
Definition: sound.h:94
AL_StopChannel
void AL_StopChannel(channel_t *ch)
Definition: al.c:271
s_active
qboolean s_active
Definition: main.c:33
playsound_s::next
struct playsound_s * next
Definition: sound.h:56
s_numchannels
int s_numchannels
Definition: main.c:30
S_IssuePlaysound
void S_IssuePlaysound(playsound_t *ps)
Definition: main.c:759
qalGenBuffers
#define qalGenBuffers
Definition: fixed.h:79
channel_s::autosound
qboolean autosound
Definition: sound.h:81
AL_DeleteSfx
void AL_DeleteSfx(sfx_t *s)
Definition: al.c:240
origin
static vec3_t origin
Definition: mesh.c:27
sfxcache_s::loopstart
int loopstart
Definition: sound.h:35
client_state_s::time
int time
Definition: client.h:244
channel_s::sfx
sfx_t * sfx
Definition: sound.h:69
listener_forward
vec3_t listener_forward
Definition: main.c:36
qalListenerf
#define qalListenerf
Definition: fixed.h:42
Com_GetLastError
char * Com_GetLastError(void)
Definition: common.c:391
wavinfo_t::rate
int rate
Definition: sound.h:90
sfxcache_s
Definition: sound.h:33
QAL_Init
qboolean QAL_Init(void)
Definition: dynamic.c:92
streamPlaying
qboolean streamPlaying
Definition: al.c:35
S_PickChannel
channel_t * S_PickChannel(int entnum, int entchannel)
Definition: main.c:579
qalBufferiv
#define qalBufferiv
Definition: fixed.h:88
s_volume
cvar_t * s_volume
Definition: main.c:58
cl
client_state_t cl
Definition: main.c:99
qalSourcei
#define qalSourcei
Definition: fixed.h:60
AL_Update
void AL_Update(void)
Definition: al.c:438
cls
client_static_t cls
Definition: main.c:98
s_pendingplays
playsound_t s_pendingplays
Definition: main.c:56
server_frame_t::numEntities
int numEntities
Definition: client.h:140
AL_RawSamples
void AL_RawSamples(int samples, int rate, int width, int channels, byte *data, float volume)
Definition: al.c:505
qalListenerfv
#define qalListenerfv
Definition: fixed.h:44
Com_SetLastError
void Com_SetLastError(const char *msg)
Definition: common.c:382
s_rawend
int s_rawend
Definition: mix.c:28
channel_s
Definition: sound.h:68
channel_s::fixed_origin
qboolean fixed_origin
Definition: sound.h:80
s_framecount
static int s_framecount
Definition: al.c:38
wavinfo_t::loopstart
int loopstart
Definition: sound.h:92
SOUND_LOOPATTENUATE
#define SOUND_LOOPATTENUATE
Definition: sound.h:137
AL_StopAllChannels
void AL_StopAllChannels(void)
Definition: al.c:330
qalSourceQueueBuffers
#define qalSourceQueueBuffers
Definition: fixed.h:77
SOUND_FULLVOLUME
#define SOUND_FULLVOLUME
Definition: sound.h:135
listener_entnum
int listener_entnum
Definition: main.c:39
samples
unsigned samples[LAG_WIDTH]
Definition: screen.c:528
S_GetLinearVolume
float S_GetLinearVolume(float perceptual)
Definition: main.c:1171
MIN_CHANNELS
#define MIN_CHANNELS
Definition: al.c:32
qalSourcef
#define qalSourcef
Definition: fixed.h:57
AL_StreamUpdate
static void AL_StreamUpdate(void)
Definition: al.c:92
s_srcnums
static ALuint s_srcnums[MAX_CHANNELS]
Definition: al.c:36
AL_AddLoopSounds
static void AL_AddLoopSounds(void)
Definition: al.c:364
S_SfxForHandle
sfx_t * S_SfxForHandle(qhandle_t hSfx)
Definition: main.c:312
sfxcache_s::width
int width
Definition: sound.h:36
qalIsExtensionPresent
#define qalIsExtensionPresent
Definition: fixed.h:39
qalListener3f
#define qalListener3f
Definition: fixed.h:43
AL_Spatialize
static void AL_Spatialize(channel_t *ch)
Definition: al.c:254
qalSource3f
#define qalSource3f
Definition: fixed.h:58
AL_UnpackVector
#define AL_UnpackVector(v)
Definition: al.c:28
channel_s::master_vol
float master_vol
Definition: sound.h:79
qalDistanceModel
#define qalDistanceModel
Definition: fixed.h:98
sound.h
VectorNormalize
vec_t VectorNormalize(vec3_t v)
Definition: shared.c:55
server_frame_t::firstEntity
int firstEntity
Definition: client.h:141
active_buffers
int active_buffers
Definition: al.c:34
qalGetError
#define qalGetError
Definition: fixed.h:38
s_ambient
cvar_t * s_ambient
Definition: main.c:59
sfx_s::name
char name[MAX_QPATH]
Definition: sound.h:45
S_Malloc
#define S_Malloc(x)
Definition: sound.h:168
S_BuildSoundList
void S_BuildSoundList(int *sounds)
Definition: main.c:969
qalSourceUnqueueBuffers
#define qalSourceUnqueueBuffers
Definition: fixed.h:78