Author: pabs Date: 2009-04-08 10:06:51 +0000 (Wed, 08 Apr 2009) New Revision: 9481
Added: packages/trunk/primrose/debian/patches/paths.patch Removed: packages/trunk/primrose/debian/patches/look-in-usr-share.patch Modified: packages/trunk/primrose/debian/patches/series Log: update the path patch to include settings Deleted: packages/trunk/primrose/debian/patches/look-in-usr-share.patch =================================================================== --- packages/trunk/primrose/debian/patches/look-in-usr-share.patch 2009-04-08 09:25:35 UTC (rev 9480) +++ packages/trunk/primrose/debian/patches/look-in-usr-share.patch 2009-04-08 10:06:51 UTC (rev 9481) @@ -1,15 +0,0 @@ -Patch: look-in-usr-share.patch -Author: Christoph Egger -Description: Allow Linux distros to specify an absolute path to the graphics -Forwarded: http://sf.net/support/tracker.php?aid=2740890 ---- a/tilePlacementGames/game1/gameSource/common.cpp -+++ b/tilePlacementGames/game1/gameSource/common.cpp -@@ -12,7 +12,7 @@ - - - Image *readTGA( char *inFileName ) { -- return readTGA( "graphics", inFileName ); -+ return readTGA( DATADIR"graphics", inFileName ); - } - - Copied: packages/trunk/primrose/debian/patches/paths.patch (from rev 9468, packages/trunk/primrose/debian/patches/look-in-usr-share.patch) =================================================================== --- packages/trunk/primrose/debian/patches/paths.patch (rev 0) +++ packages/trunk/primrose/debian/patches/paths.patch 2009-04-08 10:06:51 UTC (rev 9481) @@ -0,0 +1,48 @@ +Patch: paths.patch +Author: Paul Wise +Description: Allow Linux distros to specify an absolute path to the graphics and use ~/.primrose for settings. +Forwarded: partially to http://sf.net/support/tracker.php?aid=2740890 +--- a/tilePlacementGames/game1/gameSource/common.cpp ++++ b/tilePlacementGames/game1/gameSource/common.cpp +@@ -12,7 +12,7 @@ + + + Image *readTGA( char *inFileName ) { +- return readTGA( "graphics", inFileName ); ++ return readTGA( DATADIR"graphics", inFileName ); + } + + +--- a/tilePlacementGames/game1/gameSource/game.cpp ++++ b/tilePlacementGames/game1/gameSource/game.cpp +@@ -23,6 +23,10 @@ + + #include <GL/gl.h> + ++#include <string.h> ++#include <stdlib.h> ++#include <sys/stat.h> ++#include <sys/types.h> + + #include "minorGems/util/random/CustomRandomSource.h" + #include "minorGems/util/SettingsManager.h" +@@ -491,6 +495,19 @@ + #endif + + ++ #define SETTINGS "/.primrose" ++ char* home = getenv( "HOME" ); ++ size_t len = strlen( home ); ++ size_t len2 = sizeof( SETTINGS ); ++ char* dir = (char*)malloc( len + len2 ); ++ if( dir ){ ++ strcpy( dir, home ); ++ if( dir[len-1] == '/') strcpy( dir + len - 1, SETTINGS ); ++ else strcpy( dir + len, SETTINGS ); ++ mkdir( dir, 0xFFFF ); ++ SettingsManager::setDirectoryName( dir ); ++ } ++ + + + // don't use the same salt every time Property changes on: packages/trunk/primrose/debian/patches/paths.patch ___________________________________________________________________ Added: svn:mergeinfo + Modified: packages/trunk/primrose/debian/patches/series =================================================================== --- packages/trunk/primrose/debian/patches/series 2009-04-08 09:25:35 UTC (rev 9480) +++ packages/trunk/primrose/debian/patches/series 2009-04-08 10:06:51 UTC (rev 9481) @@ -1 +1 @@ -look-in-usr-share.patch +paths.patch _______________________________________________ Pkg-games-commits mailing list [email protected] http://lists.alioth.debian.org/mailman/listinfo/pkg-games-commits

