summaryrefslogtreecommitdiff
blob: 6d20da0c607444b08c7a7ad752b1411d6da43358 (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
53
54
55
56
--- configure
+++ configure
@@ -6908,7 +6908,7 @@
 echo "$as_me:$LINENO: result: $ac_cv_lib_openal_alGetError" >&5
 echo "${ECHO_T}$ac_cv_lib_openal_alGetError" >&6
 if test $ac_cv_lib_openal_alGetError = yes; then
-  soundlibs="-lopenal $soundlibs";cat >>confdefs.h <<\_ACEOF
+  soundlibs="-lopenal -lalut $soundlibs";cat >>confdefs.h <<\_ACEOF
 #define HAVE_LIBOPENAL 1
 _ACEOF
 
--- ultimatestunts/sndsample.cpp
+++ ultimatestunts/sndsample.cpp
@@ -96,10 +96,7 @@
 	//data (and default values)
 	void *wave = NULL;
 	ALsizei
-		format = AL_FORMAT_MONO16,
-		size = 0,
-		bits = 0,
-		freq = 44100;
+		size = 0;
 
 	CString extension = realfile.mid(realfile.length() - 4);
 	extension.toLower();
@@ -108,7 +105,7 @@
 	{
 		//the loading proc
 		ALboolean (*alutLoadVorbis)(ALuint, ALvoid *, ALint) =
-			(ALboolean (*)(ALuint, ALvoid *, ALint))alGetProcAddress((ALubyte *) VORBISFUNC);
+			(ALboolean (*)(ALuint, ALvoid *, ALint))alGetProcAddress(VORBISFUNC);
 
 		if(alutLoadVorbis == NULL)
 		{
@@ -134,7 +131,7 @@
 	{
 		//the loading proc
 		ALboolean (*alutLoadMP3)(ALuint, ALvoid *, ALint) =
-			(ALboolean (*)(ALuint, ALvoid *, ALint))alGetProcAddress((ALubyte *) MP3FUNC);
+			(ALboolean (*)(ALuint, ALvoid *, ALint))alGetProcAddress(MP3FUNC);
 
 		if(alutLoadMP3 == NULL)
 		{
@@ -158,9 +155,9 @@
 	}
 	else //default: load as wave file
 	{
-		alGenBuffers(1, &m_Buffer);
-		alutLoadWAV(realfile.c_str(), &wave, &format, &size, &bits, &freq);
-		alBufferData(m_Buffer, format, wave, size, freq);
+		m_Buffer = alutCreateBufferFromFile(realfile.c_str());
+		if(m_Buffer == AL_NONE)
+			printf("alutCreateBufferFromFile failed\n");
 	}
 
 	free(wave);