[trigger-rally] 18/103: add a patch that removes part of the physfs file handling routines and uses sdl ones instead. Now only the filename is taken from physfs; opening and reading files is handled by sdl.

Bertrand Marc bbk-guest at moszumanska.debian.org
Sun May 22 12:21:19 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 777d9c13f7d2cf50506c28d75c5cdaf1e1376c5d
Author: Stefan Potyra <sistpoty at ubuntu.com>
Date:   Thu Jul 20 14:17:47 2006 +0000

    add a patch that removes part of the physfs file handling routines
    and uses sdl ones instead. Now only the filename is taken from
    physfs; opening and reading files is handled by sdl.
---
 trigger/debian/changelog                           |  5 +++-
 trigger/debian/patches/30_fix_physfs_texture.patch | 33 ++++++++++++++++++++++
 2 files changed, 37 insertions(+), 1 deletion(-)

diff --git a/trigger/debian/changelog b/trigger/debian/changelog
index 5305fdf..66111f4 100644
--- a/trigger/debian/changelog
+++ b/trigger/debian/changelog
@@ -10,6 +10,9 @@ trigger (0.5.2-1) unstable; urgency=low
     for libalut-dev. Reran autotools to make it work.
   * Ported src/pengine/audio.{cpp|h} to new freealut semantics, as the
     compatibility functions won't work any longer.
+  * Patched src/pengine/texture.cpp to not use physfs's file structure
+    any longer, but rather only the filename from it, since it breaks
+    when loading images otherwise.
 
   [ Goneri Le Bouder ]
   * create the patches directory
@@ -24,4 +27,4 @@ trigger (0.5.2-1) unstable; urgency=low
   * adding myself to uploaders (to avoid this being an NMU)
   * fixing homepage semi-header in package description
 
- -- Alexander Schmehl <tolimar at debian.org>  Thu, 20 Jul 2006 11:10:26 +0200
+ -- Stefan Potyra <sistpoty at ubuntu.com>  Thu, 20 Jul 2006 16:10:00 +0200
diff --git a/trigger/debian/patches/30_fix_physfs_texture.patch b/trigger/debian/patches/30_fix_physfs_texture.patch
new file mode 100644
index 0000000..07ab892
--- /dev/null
+++ b/trigger/debian/patches/30_fix_physfs_texture.patch
@@ -0,0 +1,33 @@
+--- trigger-0.5.2.orig/src/pengine/texture.cpp
++++ trigger-0.5.2/src/pengine/texture.cpp
+@@ -66,16 +66,21 @@
+ 	if (PUtil::isDebugLevel(DEBUGLEVEL_TEST))
+ 		PUtil::outLog() << "Loading image \"" << filename << "\"" << std::endl;
+ 
+-	// PhysFS / SDL integration with SDL_rwops
+ 	
+-	PHYSFS_file *pfile = PHYSFS_openRead(filename.c_str());
+-	
+-	if (pfile == null) {
+-		throw MakePException (filename + ", PhysFS: " + PHYSFS_getLastError ());
++	// find out the directory prefix of the file
++	const char *prefix = PHYSFS_getRealDir(filename.c_str());
++	if (! prefix) {
++		throw MakePException(filename + ", PhysFS: " + PHYSFS_getLastError ());
++	}
++
++	// append the filename to it
++	std::string realname = std::string(prefix) + "/" + filename;
++	
++	SDL_RWops *rwops = SDL_RWFromFile(realname.c_str(), "r");
++	if (! rwops) {
++		throw MakePException("Error with " + filename + ": "
++				     + SDL_GetError());
+ 	}
+-	
+-	SDL_RWops *rwops = PUtil::allocPhysFSops(pfile);
+-	
+ 	SDL_Surface *img = IMG_Load_RW(rwops, 1); // this closes file and frees rwops
+ 	
+ 	if (!img) {
+

-- 
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