summaryrefslogtreecommitdiff
blob: f8b3b00cca1d4dd97e7f2202a3fd7b0471338fe3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
--- configure.ac
+++ configure.ac
@@ -98,11 +98,17 @@
 	*)
 	
 	AX_FINDLIB([AUDIOLIB], [OpenAL], [OpenAL],
-		AX_LANG_PROGRAM([#include <AL/alut.h>], [alutInit(0,0);]),
+		AX_LANG_PROGRAM([#include <AL/alc.h>], [alcOpenDevice(0);]),
 		[], [-lopenal],
 		[],
 		[AC_MSG_ERROR([Please install OpenAL])])
 	
+	AX_FINDLIB([AUDIOLIB], [ALUT], [ALUT],
+		AX_LANG_PROGRAM([#include <AL/alut.h>], [alutInit(0,0);]),
+		[], [-lalut],
+		[],
+		[AC_MSG_ERROR([Please install ALUT])])
+	
 	;;
 	
 esac

--- src/pengine/audio.cpp
+++ src/pengine/audio.cpp
@@ -196,25 +196,18 @@
 	PHYSFS_read(pfile, wavbuffer, filesize, 1);
 	PHYSFS_close(pfile);
 	
-	ALenum format;
-	ALvoid *data = null;
-	ALsizei size, freq;
-	ALboolean loop;
 	
-	alutLoadWAVMemory((ALbyte *)wavbuffer, &format, &data, &size, &freq, &loop);
+	buffer = alutCreateBufferFromFileImage(wavbuffer, filesize);
 	
 	delete [] wavbuffer;
 	
-	if (!data) {
+	if (buffer == AL_NONE) {
 		unload();
 		throw MakePException ("Sample load failed");
 	}
 	
-	alGenBuffers(1, &buffer);
 	
-	alBufferData(buffer, format, data, size, freq);
 	
-	alutUnloadWAV(format, data, size, freq);
 }
 
 void PAudioSample::unload()