[trigger-rally] 23/103: also fix up audio file loading (uses now physfs again, so loading from zip's is possible). split up the patch 10_fix_build_with_openal.patch: - 10_fix_build_with_openal contains only modification against the build system - 15_fixup_physfs_alut_interaction containes changes against the sourcecode.

Bertrand Marc bbk-guest at moszumanska.debian.org
Sun May 22 12:21:20 UTC 2016


This is an automated email from the git hooks/post-receive script.

bbk-guest pushed a commit to branch master
in repository trigger-rally.

commit 4bfd145d7c813cffe1ee1df1764bfed08f46c6bd
Author: Stefan Potyra <sistpoty at ubuntu.com>
Date:   Sun Jul 23 16:33:21 2006 +0000

    also fix up audio file loading (uses now physfs again, so loading
    from zip's is possible).
    split up the patch 10_fix_build_with_openal.patch:
    - 10_fix_build_with_openal contains only modification against the
    build system
    - 15_fixup_physfs_alut_interaction containes changes against the
    sourcecode.
---
 trigger/debian/changelog                           |  8 +-
 .../debian/patches/10_fix_build_with_openal.patch  | 83 +-------------------
 .../patches/15_fixup_physfs_alut_interaction.patch | 90 ++++++++++++++++++++++
 3 files changed, 97 insertions(+), 84 deletions(-)

diff --git a/trigger/debian/changelog b/trigger/debian/changelog
index 201b094..a1b1d46 100644
--- a/trigger/debian/changelog
+++ b/trigger/debian/changelog
@@ -9,9 +9,13 @@ trigger (0.5.2-2) UNRELEASED; urgency=low
   * Add a patch to src/pengine/physfs_rw.cpp to fix seeking.
     Thus any data or plugin can be loaded from zip files again
     (closes: #379372).
-  * Add a note how to install plugins in README.Debian. 
+  * Add a note how to install plugins in README.Debian.
+  * Properly patch the interaction between freealut and physfs, thus
+    sound files can also be loaded from zip plugins again.
+  * debian/patches: split up patches against the build system from
+    patches against the sourcecode.
 
- -- Stefan Potyra <sistpoty at ubuntu.com>  Sun, 23 Jul 2006 17:28:59 +0200
+ -- Stefan Potyra <sistpoty at ubuntu.com>  Sun, 23 Jul 2006 18:17:18 +0200
 
 trigger (0.5.2-1) unstable; urgency=low
 
diff --git a/trigger/debian/patches/10_fix_build_with_openal.patch b/trigger/debian/patches/10_fix_build_with_openal.patch
index 804660c..f3e7dc2 100644
--- a/trigger/debian/patches/10_fix_build_with_openal.patch
+++ b/trigger/debian/patches/10_fix_build_with_openal.patch
@@ -489,85 +489,4 @@ diff -ruN trigger-0.5.2.orig/src/glew/Jamfile trigger-0.5.2/src/glew/Jamfile
  
  ExternalLibs glew : SDL SDLIMAGE SDLTTF AUDIOLIB GL PHYSFS ;
  
-diff -ruN trigger-0.5.2.orig/src/pengine/audio.cpp trigger-0.5.2/src/pengine/audio.cpp
---- trigger-0.5.2.orig/src/pengine/audio.cpp	2006-07-18 23:57:35.000000000 +0200
-+++ trigger-0.5.2/src/pengine/audio.cpp	2006-07-18 23:59:12.000000000 +0200
-@@ -158,7 +158,10 @@
- {
- 	PUtil::outLog() << "Initialising audio subsystem [OpenAL]" << std::endl;
- 	
--	alutInit(0, null);
-+	if (alutInit(0, null) != AL_TRUE) {
-+		throw MakePException("ALUT: alutInit() error: " 
-+				+ alutGetErrorString(alutGetError()));
-+	}
- }
- 
- PSSAudio::~PSSAudio()
-@@ -171,6 +174,8 @@
- }
- 
- 
-+/** load the audiosample with name \param filename into member buffer
-+ */
- PAudioSample::PAudioSample (const std::string &filename, bool positional3D)
- {
- 	buffer = 0;
-@@ -180,7 +185,8 @@
- 		PUtil::outLog() << "Loading sample \"" << filename << "\"" << std::endl;
- 	
- 	unload();
--	
-+	/* not needed any longer with newer alut */
-+#if 0
- 	name = filename;
- 	
- 	PHYSFS_file *pfile = PHYSFS_openRead(filename.c_str());
-@@ -215,6 +221,20 @@
- 	alBufferData(buffer, format, data, size, freq);
- 	
- 	alutUnloadWAV(format, data, size, freq);
-+#endif
-+	// find out the directory prefix of the file
-+	const char *prefix = PHYSFS_getRealDir(filename.c_str());
-+	// append the filename to it
-+	std::string realname = std::string(prefix) + filename;
-+	// load it into buffer
-+	this->buffer = alutCreateBufferFromFile(realname.c_str());
-+	
-+	// check for errors
-+	if (this->buffer == AL_NONE) {
-+		throw MakePException("Sample load failed: "
-+				+ alutGetErrorString(alutGetError()));
-+	}
-+	
- }
- 
- void PAudioSample::unload()
-diff -ruN trigger-0.5.2.orig/src/pengine/audio.h trigger-0.5.2/src/pengine/audio.h
---- trigger-0.5.2.orig/src/pengine/audio.h	2006-07-18 23:57:35.000000000 +0200
-+++ trigger-0.5.2/src/pengine/audio.h	2006-07-18 23:59:12.000000000 +0200
-@@ -4,7 +4,9 @@
- // Copyright 2004-2006 Jasmine Langridge, jaz at positro.net
- // License: GPL version 2 (see included gpl.txt)
- 
--
-+#ifdef USE_OPEANAL
-+#include <AL/al.h>
-+#endif
- 
- class PSSAudio : public PSubsystem {
- private:
-@@ -22,7 +24,12 @@
- class PAudioSample : public PResource {
- private:
-     //uint32 buffer;
-+
-+#ifdef USE_OPEANAL 
-+    ALuint buffer; // the buffer of the waveform.
-+#else
-     unsigned int buffer; // not sure, maybe this will aid x86_64 portability
-+#endif
- 
- public:
-     PAudioSample(const std::string &filename, bool positional3D = false);
+
diff --git a/trigger/debian/patches/15_fixup_physfs_alut_interaction.patch b/trigger/debian/patches/15_fixup_physfs_alut_interaction.patch
new file mode 100644
index 0000000..011eeef
--- /dev/null
+++ b/trigger/debian/patches/15_fixup_physfs_alut_interaction.patch
@@ -0,0 +1,90 @@
+--- trigger-0.5.2.orig/src/pengine/audio.cpp	2006-01-14 11:09:19.000000000 +0100
++++ trigger-0.5.2/src/pengine/audio.cpp	2006-07-23 17:58:00.000000000 +0200
+@@ -158,7 +158,10 @@
+ {
+ 	PUtil::outLog() << "Initialising audio subsystem [OpenAL]" << std::endl;
+ 	
+-	alutInit(0, null);
++	if (alutInit(0, null) != AL_TRUE) {
++		throw MakePException("ALUT:alutInit() error: " 
++                                  +  alutGetErrorString(alutGetError()));
++	}
+ }
+ 
+ PSSAudio::~PSSAudio()
+@@ -180,9 +183,8 @@
+ 		PUtil::outLog() << "Loading sample \"" << filename << "\"" << std::endl;
+ 	
+ 	unload();
+-	
++	/* load contents from file into memory using physfs functions */
+ 	name = filename;
+-	
+ 	PHYSFS_file *pfile = PHYSFS_openRead(filename.c_str());
+ 	
+ 	if (!pfile) {
+@@ -195,26 +197,20 @@
+ 	
+ 	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);
+-	
++
++	/* create the alut buffer from memory contents */
++	this->buffer = alutCreateBufferFromFileImage(
++				 reinterpret_cast<const ALvoid *>(wavbuffer),
++				 filesize);
++
++	/* clean up */
+ 	delete [] wavbuffer;
+-	
+-	if (!data) {
+-		unload();
+-		throw MakePException ("Sample load failed");
++
++	/* check if loading was successful */
++	if (AL_NONE == this->buffer) {
++		throw MakePException("Sample load failed:" 
++			           + alutGetErrorString(alutGetError()));
+ 	}
+-	
+-	alGenBuffers(1, &buffer);
+-	
+-	alBufferData(buffer, format, data, size, freq);
+-	
+-	alutUnloadWAV(format, data, size, freq);
+ }
+ 
+ void PAudioSample::unload()
+--- trigger-0.5.2.orig/src/pengine/audio.h	2006-01-14 11:09:19.000000000 +0100
++++ trigger-0.5.2/src/pengine/audio.h	2006-07-23 17:59:13.000000000 +0200
+@@ -4,7 +4,9 @@
+ // Copyright 2004-2006 Jasmine Langridge, jaz at positro.net
+ // License: GPL version 2 (see included gpl.txt)
+ 
+-
++#ifdef USE_OPEANAL
++#include <AL/al.h>
++#endif
+ 
+ class PSSAudio : public PSubsystem {
+ private:
+@@ -22,7 +24,12 @@
+ class PAudioSample : public PResource {
+ private:
+     //uint32 buffer;
++
++#ifdef USE_OPEANAL 
++    ALuint buffer; // the buffer of the waveform.
++#else
+     unsigned int buffer; // not sure, maybe this will aid x86_64 portability
++#endif
+ 
+ public:
+     PAudioSample(const std::string &filename, bool positional3D = false);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/trigger-rally.git



More information about the Pkg-games-commits mailing list