|
@@ -8,7 +8,7 @@
|
8
|
8
|
* \author xythobuz
|
9
|
9
|
*/
|
10
|
10
|
|
11
|
|
-#ifdef HAVE_OPENAL
|
|
11
|
+#ifdef USING_OPENAL
|
12
|
12
|
#ifdef __APPLE__
|
13
|
13
|
#include <OpenAL/al.h>
|
14
|
14
|
#include <OpenAL/alc.h>
|
|
@@ -50,7 +50,7 @@ Sound::~Sound()
|
50
|
50
|
{
|
51
|
51
|
if (mInit)
|
52
|
52
|
{
|
53
|
|
-#ifdef HAVE_OPENAL
|
|
53
|
+#ifdef USING_OPENAL
|
54
|
54
|
alutExit();
|
55
|
55
|
#endif
|
56
|
56
|
}
|
|
@@ -73,7 +73,7 @@ int Sound::init()
|
73
|
73
|
close(fd);
|
74
|
74
|
#endif
|
75
|
75
|
|
76
|
|
-#ifdef HAVE_OPENAL
|
|
76
|
+#ifdef USING_OPENAL
|
77
|
77
|
alutInit(NULL, 0);
|
78
|
78
|
|
79
|
79
|
mInit = true;
|
|
@@ -91,7 +91,7 @@ void Sound::listenAt(float pos[3], float angle[3])
|
91
|
91
|
if (!mInit)
|
92
|
92
|
return;
|
93
|
93
|
|
94
|
|
-#ifdef HAVE_OPENAL
|
|
94
|
+#ifdef USING_OPENAL
|
95
|
95
|
alListenerfv(AL_POSITION, pos);
|
96
|
96
|
alListenerfv(AL_ORIENTATION, angle);
|
97
|
97
|
#endif
|
|
@@ -103,7 +103,7 @@ void Sound::sourceAt(int source, float pos[3])
|
103
|
103
|
if (!mInit || source < 0)
|
104
|
104
|
return;
|
105
|
105
|
|
106
|
|
-#ifdef HAVE_OPENAL
|
|
106
|
+#ifdef USING_OPENAL
|
107
|
107
|
alSourcefv(mSource[source-1], AL_POSITION, pos);
|
108
|
108
|
#endif
|
109
|
109
|
}
|
|
@@ -112,7 +112,7 @@ void Sound::sourceAt(int source, float pos[3])
|
112
|
112
|
//! \fixme Seperate sourcing and buffering, Mongoose 2002.01.04
|
113
|
113
|
int Sound::addFile(char *filename, int *source, unsigned int flags)
|
114
|
114
|
{
|
115
|
|
-#ifdef HAVE_OPENAL
|
|
115
|
+#ifdef USING_OPENAL
|
116
|
116
|
ALsizei size;
|
117
|
117
|
ALfloat freq;
|
118
|
118
|
ALenum format;
|
|
@@ -128,7 +128,7 @@ int Sound::addFile(char *filename, int *source, unsigned int flags)
|
128
|
128
|
|
129
|
129
|
*source = -1;
|
130
|
130
|
|
131
|
|
-#ifdef HAVE_OPENAL
|
|
131
|
+#ifdef USING_OPENAL
|
132
|
132
|
alGetError();
|
133
|
133
|
|
134
|
134
|
alGenBuffers(1, &mBuffer[mNextBuffer]);
|
|
@@ -181,7 +181,7 @@ int Sound::addFile(char *filename, int *source, unsigned int flags)
|
181
|
181
|
|
182
|
182
|
int Sound::addWave(unsigned char *wav, unsigned int length, int *source, unsigned int flags)
|
183
|
183
|
{
|
184
|
|
-#ifdef HAVE_OPENAL
|
|
184
|
+#ifdef USING_OPENAL
|
185
|
185
|
ALsizei size;
|
186
|
186
|
ALfloat freq;
|
187
|
187
|
ALenum format;
|
|
@@ -196,7 +196,7 @@ int Sound::addWave(unsigned char *wav, unsigned int length, int *source, unsigne
|
196
|
196
|
|
197
|
197
|
*source = -1;
|
198
|
198
|
|
199
|
|
-#ifdef HAVE_OPENAL
|
|
199
|
+#ifdef USING_OPENAL
|
200
|
200
|
data = wav;
|
201
|
201
|
|
202
|
202
|
alGetError();
|
|
@@ -268,7 +268,7 @@ void Sound::play(int source)
|
268
|
268
|
return;
|
269
|
269
|
}
|
270
|
270
|
|
271
|
|
-#ifdef HAVE_OPENAL
|
|
271
|
+#ifdef USING_OPENAL
|
272
|
272
|
alSourcePlay(mSource[source-1]);
|
273
|
273
|
#endif
|
274
|
274
|
}
|
|
@@ -282,7 +282,7 @@ void Sound::stop(int source)
|
282
|
282
|
return;
|
283
|
283
|
}
|
284
|
284
|
|
285
|
|
-#ifdef HAVE_OPENAL
|
|
285
|
+#ifdef USING_OPENAL
|
286
|
286
|
alSourceStop(mSource[source-1]);
|
287
|
287
|
#endif
|
288
|
288
|
}
|