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])
32 #define MIN_CHANNELS 16
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));
99 if (state == AL_STOPPED)
131 Com_DPrintf(
"Initializing OpenAL\n");
149 Com_Printf(
"ERROR: Couldn't get a single Source.\n");
163 Com_DPrintf(
"Got %d AL sources\n", i);
173 Com_Printf(
"OpenAL initialized.\n");
185 Com_Printf(
"Shutting down OpenAL.\n");
205 ALenum format =
s_info.
width == 2 ? AL_FORMAT_MONO16 : AL_FORMAT_MONO8;
209 s->
error = Q_ERR_TOO_FEW;
217 s->
error = Q_ERR_LIBRARY_ERROR;
275 Com_Printf(
"%s: %s\n", __func__, ch->
sfx->
name);
281 memset(ch, 0,
sizeof(*ch));
290 Com_Printf(
"%s: %s\n", __func__, ch->
sfx->
name);
295 qalSourcei(ch->srcnum, AL_BUFFER, sc->bufnum);
303 qalSourcef(ch->srcnum, AL_MAX_DISTANCE, 8192);
354 if (entnum && ch->
entnum != entnum)
367 int sounds[MAX_EDICTS];
433 qalSourcei(ch->srcnum, AL_SAMPLE_OFFSET, offset);
442 vec_t orientation[6];
475 if (
qalGetError() != AL_NO_ERROR || state == AL_STOPPED) {
506 byte *data,
float volume)
516 format = AL_FORMAT_MONO8;
520 format = AL_FORMAT_STEREO8;
527 format = AL_FORMAT_MONO16;
531 format = AL_FORMAT_STEREO16;