aboutsummaryrefslogtreecommitdiff
path: root/games/apricots
diff options
context:
space:
mode:
authorDmitry Marakasov <amdmi3@FreeBSD.org>2013-07-12 15:01:45 +0000
committerDmitry Marakasov <amdmi3@FreeBSD.org>2013-07-12 15:01:45 +0000
commitdaffe00d4a57c0ef6a21947a8121b8d233d8d3a5 (patch)
tree713942325bda393305edb21d46cd7f38d213aebc /games/apricots
parent51498efaebaad1106dcf0d3f70c8feaa14c411ee (diff)
downloadports-daffe00d4a57c0ef6a21947a8121b8d233d8d3a5.tar.gz
ports-daffe00d4a57c0ef6a21947a8121b8d233d8d3a5.zip
Notes
Diffstat (limited to 'games/apricots')
-rw-r--r--games/apricots/Makefile1
-rw-r--r--games/apricots/files/patch-apricots-sampleio.cpp82
2 files changed, 42 insertions, 41 deletions
diff --git a/games/apricots/Makefile b/games/apricots/Makefile
index 82d0dfd33766..1b28b77191a3 100644
--- a/games/apricots/Makefile
+++ b/games/apricots/Makefile
@@ -15,6 +15,7 @@ USE_AUTOTOOLS= libtool
GNU_CONFIGURE= yes
USE_GMAKE= yes
USE_SDL= sdl
+USE_DOS2UNIX= yes
MAKE_JOBS_SAFE= yes
CPPFLAGS+= -I${LOCALBASE}/include
diff --git a/games/apricots/files/patch-apricots-sampleio.cpp b/games/apricots/files/patch-apricots-sampleio.cpp
index 7f06df6a6655..b5fdc695941a 100644
--- a/games/apricots/files/patch-apricots-sampleio.cpp
+++ b/games/apricots/files/patch-apricots-sampleio.cpp
@@ -2,45 +2,45 @@ 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
+ 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
+ alSourcefv(sources[j], AL_ORIENTATION, back );
+ }
+
+- free(data);
+-
+ }
+
+ // Clearup routine