|
Lines 66-71
ALenum(*EAXGet) (const struct _GUID* pro
Link Here
|
| 66 |
ALenum(*EAXSet) (const struct _GUID* propertySetID, ALuint prop, ALuint source, ALvoid* value, ALuint size); |
66 |
ALenum(*EAXSet) (const struct _GUID* propertySetID, ALuint prop, ALuint source, ALvoid* value, ALuint size); |
| 67 |
#endif |
67 |
#endif |
| 68 |
|
68 |
|
|
|
69 |
extern "C" { |
| 69 |
int DS_Init(void); |
70 |
int DS_Init(void); |
| 70 |
void DS_Shutdown(void); |
71 |
void DS_Shutdown(void); |
| 71 |
void DS_Event(int type); |
72 |
void DS_Event(int type); |
|
Lines 83-88
void DS_SFX_Setv(sfxbuffer_t* buf, int p
Link Here
|
| 83 |
void DS_SFX_Listener(int prop, float value); |
84 |
void DS_SFX_Listener(int prop, float value); |
| 84 |
void DS_SFX_Listenerv(int prop, float* values); |
85 |
void DS_SFX_Listenerv(int prop, float* values); |
| 85 |
int DS_SFX_Getv(int prop, void* values); |
86 |
int DS_SFX_Getv(int prop, void* values); |
|
|
87 |
} |
| 86 |
|
88 |
|
| 87 |
#ifdef WIN32 |
89 |
#ifdef WIN32 |
| 88 |
// EAX 2.0 GUIDs |
90 |
// EAX 2.0 GUIDs |
|
Lines 134-147
static void loadExtensions(void)
Link Here
|
| 134 |
#endif |
136 |
#endif |
| 135 |
} |
137 |
} |
| 136 |
|
138 |
|
| 137 |
int DS_Init(void) |
139 |
extern "C" int DS_Init(void) |
| 138 |
{ |
140 |
{ |
| 139 |
// Already initialized? |
141 |
// Already initialized? |
| 140 |
if(initOk) return true; |
142 |
if(initOk) return true; |
| 141 |
|
143 |
|
| 142 |
// Open a playback device. |
144 |
// Open a playback device. |
| 143 |
/// @todo Shouldn't we use the system default device? |
145 |
/// @todo Shouldn't we use the system default device? |
| 144 |
device = alcOpenDevice((ALCchar*) "DirectSound3D"); |
146 |
device = alcOpenDevice((ALCchar*) NULL); |
| 145 |
if(!device) |
147 |
if(!device) |
| 146 |
{ |
148 |
{ |
| 147 |
Con_Message("OpenAL init failed (device: DirectSound3D).\n"); |
149 |
Con_Message("OpenAL init failed (device: DirectSound3D).\n"); |
|
Lines 167-173
int DS_Init(void)
Link Here
|
| 167 |
return true; |
169 |
return true; |
| 168 |
} |
170 |
} |
| 169 |
|
171 |
|
| 170 |
void DS_Shutdown(void) |
172 |
extern "C" void DS_Shutdown(void) |
| 171 |
{ |
173 |
{ |
| 172 |
if(!initOk) return; |
174 |
if(!initOk) return; |
| 173 |
|
175 |
|
|
Lines 185-196
void DS_Event(int /*type*/)
Link Here
|
| 185 |
// Not supported. |
187 |
// Not supported. |
| 186 |
} |
188 |
} |
| 187 |
|
189 |
|
| 188 |
int DS_SFX_Init(void) |
190 |
extern "C" int DS_SFX_Init(void) |
| 189 |
{ |
191 |
{ |
| 190 |
return true; |
192 |
return true; |
| 191 |
} |
193 |
} |
| 192 |
|
194 |
|
| 193 |
sfxbuffer_t* DS_SFX_CreateBuffer(int flags, int bits, int rate) |
195 |
extern "C" sfxbuffer_t* DS_SFX_CreateBuffer(int flags, int bits, int rate) |
| 194 |
{ |
196 |
{ |
| 195 |
sfxbuffer_t* buf; |
197 |
sfxbuffer_t* buf; |
| 196 |
ALuint bufName, srcName; |
198 |
ALuint bufName, srcName; |
|
Lines 236-242
sfxbuffer_t* DS_SFX_CreateBuffer(int fla
Link Here
|
| 236 |
return buf; |
238 |
return buf; |
| 237 |
} |
239 |
} |
| 238 |
|
240 |
|
| 239 |
void DS_SFX_DestroyBuffer(sfxbuffer_t* buf) |
241 |
extern "C" void DS_SFX_DestroyBuffer(sfxbuffer_t* buf) |
| 240 |
{ |
242 |
{ |
| 241 |
ALuint srcName, bufName; |
243 |
ALuint srcName, bufName; |
| 242 |
|
244 |
|
|
Lines 251-257
void DS_SFX_DestroyBuffer(sfxbuffer_t* b
Link Here
|
| 251 |
Z_Free(buf); |
253 |
Z_Free(buf); |
| 252 |
} |
254 |
} |
| 253 |
|
255 |
|
| 254 |
void DS_SFX_Load(sfxbuffer_t* buf, struct sfxsample_s* sample) |
256 |
extern "C" void DS_SFX_Load(sfxbuffer_t* buf, struct sfxsample_s* sample) |
| 255 |
{ |
257 |
{ |
| 256 |
if(!buf || !sample) return; |
258 |
if(!buf || !sample) return; |
| 257 |
|
259 |
|
|
Lines 277-283
void DS_SFX_Load(sfxbuffer_t* buf, struc
Link Here
|
| 277 |
/** |
279 |
/** |
| 278 |
* Stops the buffer and makes it forget about its sample. |
280 |
* Stops the buffer and makes it forget about its sample. |
| 279 |
*/ |
281 |
*/ |
| 280 |
void DS_SFX_Reset(sfxbuffer_t* buf) |
282 |
extern "C" void DS_SFX_Reset(sfxbuffer_t* buf) |
| 281 |
{ |
283 |
{ |
| 282 |
if(!buf) return; |
284 |
if(!buf) return; |
| 283 |
|
285 |
|
|
Lines 285-291
void DS_SFX_Reset(sfxbuffer_t* buf)
Link Here
|
| 285 |
buf->sample = NULL; |
287 |
buf->sample = NULL; |
| 286 |
} |
288 |
} |
| 287 |
|
289 |
|
| 288 |
void DS_SFX_Play(sfxbuffer_t* buf) |
290 |
extern "C" void DS_SFX_Play(sfxbuffer_t* buf) |
| 289 |
{ |
291 |
{ |
| 290 |
ALuint source; |
292 |
ALuint source; |
| 291 |
|
293 |
|
|
Lines 310-316
void DS_SFX_Play(sfxbuffer_t* buf)
Link Here
|
| 310 |
buf->flags |= SFXBF_PLAYING; |
312 |
buf->flags |= SFXBF_PLAYING; |
| 311 |
} |
313 |
} |
| 312 |
|
314 |
|
| 313 |
void DS_SFX_Stop(sfxbuffer_t* buf) |
315 |
extern "C" void DS_SFX_Stop(sfxbuffer_t* buf) |
| 314 |
{ |
316 |
{ |
| 315 |
if(!buf || !buf->sample) return; |
317 |
if(!buf || !buf->sample) return; |
| 316 |
|
318 |
|
|
Lines 318-324
void DS_SFX_Stop(sfxbuffer_t* buf)
Link Here
|
| 318 |
buf->flags &= ~SFXBF_PLAYING; |
320 |
buf->flags &= ~SFXBF_PLAYING; |
| 319 |
} |
321 |
} |
| 320 |
|
322 |
|
| 321 |
void DS_SFX_Refresh(sfxbuffer_t* buf) |
323 |
extern "C" void DS_SFX_Refresh(sfxbuffer_t* buf) |
| 322 |
{ |
324 |
{ |
| 323 |
ALint state; |
325 |
ALint state; |
| 324 |
|
326 |
|
|
Lines 368-374
static void setPan(ALuint source, float
Link Here
|
| 368 |
alSourcefv(source, AL_POSITION, pos); |
370 |
alSourcefv(source, AL_POSITION, pos); |
| 369 |
} |
371 |
} |
| 370 |
|
372 |
|
| 371 |
void DS_SFX_Set(sfxbuffer_t* buf, int prop, float value) |
373 |
extern "C" void DS_SFX_Set(sfxbuffer_t* buf, int prop, float value) |
| 372 |
{ |
374 |
{ |
| 373 |
ALuint source; |
375 |
ALuint source; |
| 374 |
|
376 |
|
|
Lines 411-417
void DS_SFX_Set(sfxbuffer_t* buf, int pr
Link Here
|
| 411 |
} |
413 |
} |
| 412 |
} |
414 |
} |
| 413 |
|
415 |
|
| 414 |
void DS_SFX_Setv(sfxbuffer_t* buf, int prop, float* values) |
416 |
extern "C" void DS_SFX_Setv(sfxbuffer_t* buf, int prop, float* values) |
| 415 |
{ |
417 |
{ |
| 416 |
ALuint source; |
418 |
ALuint source; |
| 417 |
|
419 |
|
|
Lines 435-441
void DS_SFX_Setv(sfxbuffer_t* buf, int p
Link Here
|
| 435 |
} |
437 |
} |
| 436 |
} |
438 |
} |
| 437 |
|
439 |
|
| 438 |
void DS_SFX_Listener(int prop, float value) |
440 |
extern "C" void DS_SFX_Listener(int prop, float value) |
| 439 |
{ |
441 |
{ |
| 440 |
switch(prop) |
442 |
switch(prop) |
| 441 |
{ |
443 |
{ |
|
Lines 451-457
void DS_SFX_Listener(int prop, float val
Link Here
|
| 451 |
} |
453 |
} |
| 452 |
} |
454 |
} |
| 453 |
|
455 |
|
| 454 |
void DS_SFX_Listenerv(int prop, float* values) |
456 |
extern "C" void DS_SFX_Listenerv(int prop, float* values) |
| 455 |
{ |
457 |
{ |
| 456 |
float ori[6]; |
458 |
float ori[6]; |
| 457 |
|
459 |
|
|
Lines 489-495
void DS_SFX_Listenerv(int prop, float* v
Link Here
|
| 489 |
} |
491 |
} |
| 490 |
} |
492 |
} |
| 491 |
|
493 |
|
| 492 |
int DS_SFX_Getv(int /*prop*/, void* /*values*/) |
494 |
extern "C" int DS_SFX_Getv(int /*prop*/, void* /*values*/) |
| 493 |
{ |
495 |
{ |
| 494 |
// Stub. |
496 |
// Stub. |
| 495 |
return 0; |
497 |
return 0; |