summaryrefslogtreecommitdiffstats
path: root/OpenAL32
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2008-01-11 17:19:08 -0800
committerChris Robinson <[email protected]>2008-01-11 17:19:08 -0800
commit3bbbf8a025c66367fdb19dce70c9a2b6505725f4 (patch)
tree4a1e7d433689989de8cd314b8796466a2f029192 /OpenAL32
parent312108a0d32190289a1e59a3797b7075d6d745d3 (diff)
parent978764cb6b84d78187badf9d8d5b7177d047654f (diff)
Merge branch 'master' into efx-experiment
Diffstat (limited to 'OpenAL32')
-rw-r--r--OpenAL32/Include/alMain.h28
-rw-r--r--OpenAL32/alBuffer.c1
2 files changed, 29 insertions, 0 deletions
diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h
index a1857c97..ce5c5be9 100644
--- a/OpenAL32/Include/alMain.h
+++ b/OpenAL32/Include/alMain.h
@@ -13,6 +13,9 @@
#include <assert.h>
#include <pthread.h>
+#include <sys/time.h>
+#include <time.h>
+#include <errno.h>
#define IsBadWritePtr(a,b) (0)
@@ -52,6 +55,30 @@ static inline void DeleteCriticalSection(CRITICAL_SECTION *cs)
assert(ret == 0);
}
+/* NOTE: This wrapper isn't quite accurate as it returns an ALuint, as opposed
+ * to the expected DWORD. Both are defined as unsigned 32-bit types, however.
+ * Additionally, Win32 is supposed to measure the time since Windows started,
+ * as opposed to the actual time. */
+static inline ALuint timeGetTime(void)
+{
+ struct timeval tv;
+ int ret;
+
+ ret = gettimeofday(&tv, NULL);
+ assert(ret == 0);
+
+ return tv.tv_usec/1000 + tv.tv_sec*1000;
+}
+
+static inline void Sleep(ALuint t)
+{
+ struct timespec tv, rem;
+ tv.tv_nsec = (t*1000000)%1000000000;
+ tv.tv_sec = t/1000;
+
+ while(nanosleep(&tv, &rem) == -1 && errno == EINTR)
+ tv = rem;
+}
#define min(x,y) (((x)<(y))?(x):(y))
#define max(x,y) (((x)>(y))?(x):(y))
#endif
@@ -123,6 +150,7 @@ void alc_alsa_init(BackendFuncs *func_list);
void alc_oss_init(BackendFuncs *func_list);
void alcDSoundInit(BackendFuncs *func_list);
void alcWinMMInit(BackendFuncs *FuncList);
+void alc_wave_init(BackendFuncs *func_list);
struct ALCdevice_struct
diff --git a/OpenAL32/alBuffer.c b/OpenAL32/alBuffer.c
index 2bcb6562..1ea54fce 100644
--- a/OpenAL32/alBuffer.c
+++ b/OpenAL32/alBuffer.c
@@ -22,6 +22,7 @@
#include <stdlib.h>
#include <stdio.h>
+#include <assert.h>
#include "alMain.h"
#include "AL/al.h"
#include "AL/alc.h"