diff options
author | Dmitry Marakasov <amdmi3@FreeBSD.org> | 2010-04-12 15:23:33 +0000 |
---|---|---|
committer | Dmitry Marakasov <amdmi3@FreeBSD.org> | 2010-04-12 15:23:33 +0000 |
commit | 4fd34b33ab13056f30d054611996e4fb1deb628a (patch) | |
tree | 242ac4657cc739d2871c2b02a0e6858aba95b7c7 /games/apricots | |
parent | 625fa957b19f18869f7adf992acfe0cb7e609029 (diff) |
Notes
Diffstat (limited to 'games/apricots')
-rw-r--r-- | games/apricots/Makefile | 2 | ||||
-rw-r--r-- | games/apricots/files/patch-apricots-sampleio.cpp | 46 | ||||
-rw-r--r-- | games/apricots/files/patch-sampleio.cpp | 19 |
3 files changed, 46 insertions, 21 deletions
diff --git a/games/apricots/Makefile b/games/apricots/Makefile index 92fbf4f7908f..1f9c9f5902de 100644 --- a/games/apricots/Makefile +++ b/games/apricots/Makefile @@ -15,8 +15,6 @@ MASTER_SITES= http://www.fishies.org.uk/ \ MAINTAINER= amdmi3@FreeBSD.org COMMENT= Fly a little plane around and shoot things and drop bombs -BROKEN= does not compile - USE_AUTOTOOLS= libtool:22 GNU_CONFIGURE= yes USE_GMAKE= yes diff --git a/games/apricots/files/patch-apricots-sampleio.cpp b/games/apricots/files/patch-apricots-sampleio.cpp new file mode 100644 index 000000000000..7f06df6a6655 --- /dev/null +++ b/games/apricots/files/patch-apricots-sampleio.cpp @@ -0,0 +1,46 @@ +Patch to build with newer openal. Not sure whether it doesn't leak memory +--- apricots/sampleio.cpp.orig 2003-08-06 03:21:22.000000000 +0400 ++++ apricots/sampleio.cpp 2010-04-07 18:32:05.000000000 +0400 +@@ -74,28 +74,21 @@ + alListenerfv(AL_ORIENTATION, front );
+
+ // Load in samples
+- ALvoid* data = malloc(5 * (512 * 3) * 1024);
++ ALvoid* data;
+ alGenBuffers(numsamples, samples);
+
+ for (int i = 0; i < numsamples; i++){
+- ALsizei freq;
++ ALfloat freq;
+ ALboolean fileok;
+ // Evil OpenAL portability fix done here
+-#ifdef _WIN32
+ ALenum format;
+- ALboolean trash;
+- alutLoadWAVFile(filenames[i],&format,&data,&filelen,&freq,&trash);
+- fileok = (alGetError() == AL_NO_ERROR);
+-#else
+- ALsizei format;
+- ALsizei trash;
+- fileok = alutLoadWAV(filenames[i],&data,&format,&filelen,&trash,&freq);
+-#endif
+- if (!fileok){
++ data = alutLoadMemoryFromFile(filenames[i], &format, &filelen, &freq);
++ if (!data){
+ cerr << "sampleio: could not open " << filenames[i] << endl;
+ exit(1);
+ }
+ alBufferData(samples[i], format, data, filelen, freq);
++ free(data);
+ }
+
+ // Generate Sources
+@@ -107,8 +100,6 @@ + alSourcefv(sources[j], AL_ORIENTATION, back );
+ }
+
+- free(data);
+-
+ }
+
+ // Clearup routine
diff --git a/games/apricots/files/patch-sampleio.cpp b/games/apricots/files/patch-sampleio.cpp deleted file mode 100644 index fbe78cf0922b..000000000000 --- a/games/apricots/files/patch-sampleio.cpp +++ /dev/null @@ -1,19 +0,0 @@ ---- apricots/sampleio.cpp.orig 2003-08-06 03:21:22.000000000 +0400 -+++ apricots/sampleio.cpp 2008-01-08 02:12:27.000000000 +0300 -@@ -81,16 +81,10 @@ - ALsizei freq;
- ALboolean fileok;
- // Evil OpenAL portability fix done here
--#ifdef _WIN32
- ALenum format;
- ALboolean trash;
- alutLoadWAVFile(filenames[i],&format,&data,&filelen,&freq,&trash);
- fileok = (alGetError() == AL_NO_ERROR);
--#else
-- ALsizei format;
-- ALsizei trash;
-- fileok = alutLoadWAV(filenames[i],&data,&format,&filelen,&trash,&freq);
--#endif
- if (!fileok){
- cerr << "sampleio: could not open " << filenames[i] << endl;
- exit(1);
|