diff options
author | Petar Petrov <ppetrov@paju.oulu.fi> | 2012-12-09 11:00:38 -0500 |
---|---|---|
committer | dsomero <xgizzmo@slackbuilds.org> | 2012-12-11 16:21:57 -0500 |
commit | d884fa6c2e5bbdda2ddb51fc1f1d03d5dcce6601 (patch) | |
tree | c4b4b4c96f749575d936ec4c7b1b7e68670d1674 /games/njam/patches | |
parent | 16abb0a3ab44a54125c3d2f5005b81eef5ae97d5 (diff) |
games/njam: Added (The most addictive free pacman-like game)
Signed-off-by: dsomero <xgizzmo@slackbuilds.org>
Diffstat (limited to 'games/njam/patches')
-rw-r--r-- | games/njam/patches/changed_hiscore_name.patch | 68 | ||||
-rw-r--r-- | games/njam/patches/drop_gda.patch | 103 | ||||
-rw-r--r-- | games/njam/patches/gcc_46.patch | 28 |
3 files changed, 199 insertions, 0 deletions
diff --git a/games/njam/patches/changed_hiscore_name.patch b/games/njam/patches/changed_hiscore_name.patch new file mode 100644 index 0000000000000..d6cd8b2313341 --- /dev/null +++ b/games/njam/patches/changed_hiscore_name.patch @@ -0,0 +1,68 @@ +#! /bin/sh -e +## changed_hiscore_name.dpatch by Anibal Avelar <aavelar@cofradia.org> +## +## DP: apply patch to change the hiscore name + +[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts +patch_opts="${patch_opts:--f --no-backup-if-mismatch}" + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch $patch_opts -p1 < $0;; + -unpatch) patch $patch_opts -p1 -R < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argum +ent" + exit 1;; +esac + +exit 0 +diff -bBdNrw -U5 njam-1.25/src/njam.cpp njam-1.25.modif/src/njam.cpp +--- njam-1.25/src/njam.cpp 2005-12-13 05:56:43.000000000 -0600 ++++ njam-1.25.modif/src/njam.cpp 2008-05-12 11:59:46.694847801 -0500 +@@ -235,11 +235,11 @@ + fprintf(fp, "I=%s\n", m_GameOptions.ServerIP); + fclose(fp); + } + + // format: NAME#POINTS#LEVEL# +- fp = fopen("hiscore.dat", "w+"); ++ fp = fopen("njam-hiscore.dat", "w+"); + if (fp) + { + for (int i=0; i<10; i++) + fprintf(fp, "%s#%d#%d#\n", TopTenScores[i].name, TopTenScores[i].points, TopTenScores[i].level); + fclose(fp); +@@ -647,11 +647,11 @@ + } + else + LogFile("Failed to open conf file.\n"); + + // create default hiscore +- LogFile("Creating default hiscore.\n"); ++ LogFile("Creating default njam-hiscore.\n"); + char DefaultNames[10][10] = { + "MILAN", "TANJA", + "DULIO", "DJORDJE", + "CLAUS", "ENZO", + "JOLAN", "JAAP", +@@ -663,14 +663,14 @@ + sprintf(TopTenScores[i].name, "%s\0", DefaultNames[i]); + } + + // load hiscore from file (if any) + // format: NAME#POINTS#LEVEL# +- fp = fopen("hiscore.dat", "r"); ++ fp = fopen("njam-hiscore.dat", "r"); + if (fp) + { +- LogFile("Reading hiscore.dat\n"); ++ LogFile("Reading njam-hiscore.dat\n"); + char buff[40]; + int number = 0; + while (!feof(fp) && number < 10) + { + fgets(buff, 40, fp); diff --git a/games/njam/patches/drop_gda.patch b/games/njam/patches/drop_gda.patch new file mode 100644 index 0000000000000..5973420b25a4f --- /dev/null +++ b/games/njam/patches/drop_gda.patch @@ -0,0 +1,103 @@ +#!/bin/sh /usr/share/dpatch/dpatch-run +Description: drop DGA support, fixing SDL_VIDEODRIVER parsing issues +Author: Hans de Goede <hdegoede@redhat.com> +Last-Update: 2011-12-13 + +Index: njam-1.25/src/njam.cpp +=================================================================== +--- njam-1.25.orig/src/njam.cpp 2012-07-04 16:46:32.000000000 +0000 ++++ njam-1.25/src/njam.cpp 2012-07-04 16:49:29.000000000 +0000 +@@ -52,7 +52,6 @@ + { + bool Fullscreen = true; + bool SWSurface = true; +- bool UseDGA = false; + if (argc > 1) + { + for (int i=1; i<argc; i++) +@@ -64,8 +63,6 @@ + Fullscreen = false; // use njam.exe -w windowed mode + else if (argv[i][1] == 'h') + SWSurface = false; // use -h for hardware surfaces +- else if (argv[i][1] == 'd') +- UseDGA = true; + else + ok = false; + } +@@ -77,7 +74,6 @@ + printf("Usage: njam -[w|d|h]\n\n"); + printf("-w start in Windowed mode (as opposed to fullscreen).\n");; + printf("-h use Hardware surfaces (faster, doesn't work well with all graphic cards).\n"); +- printf("-d use DGA driver on Linux, (much faster, but must run as root).\n"); + return 1; + } + } +@@ -106,7 +102,7 @@ + #endif + + NjamEngine Engine; +- if (!Engine.Init(Fullscreen, SWSurface, UseDGA)) ++ if (!Engine.Init(Fullscreen, SWSurface)) + { + LogFile("Failed.\n"); + return 1; +@@ -159,12 +155,6 @@ + //----------------------------------------------------------------------------- + NjamEngine::~NjamEngine() + { +-#ifdef __linux__ +- char bufsdl[30]; +- sprintf(bufsdl, "SDL_VIDEODRIVER=%s", linux_sdl_driver); +- putenv(bufsdl); +-#endif +- + if (script_file) + fclose(script_file); + +@@ -333,24 +323,8 @@ + } + } + //----------------------------------------------------------------------------- +-bool NjamEngine::Init(bool Fullscreen, bool SoftwareSurface, bool UseDGA) ++bool NjamEngine::Init(bool Fullscreen, bool SoftwareSurface) + { +-#ifdef __linux__ +- sprintf(linux_sdl_driver, "x11\0"); +- char *driver_name = getenv("SDL_VIDEODRIVER"); +- if (driver_name) +- sprintf(linux_sdl_driver, "%s\0", driver_name); +- +- if (UseDGA) +- { +- printf("You must be root to run DGA\nType ./njam -? for help\n"); +- putenv("SDL_VIDEODRIVER=dga"); +- } +-#else +- if (UseDGA) +- printf("Parameter -d is ignored for non-Linux platforms.\n"); +-#endif +- + LogFile("Initializing SDL: VIDEO & AUDIO...", true); + if ( SDL_Init(SDL_INIT_VIDEO|SDL_INIT_AUDIO|SDL_INIT_TIMER ) < 0 ) + { +Index: njam-1.25/src/njam.h +=================================================================== +--- njam-1.25.orig/src/njam.h 2005-12-13 11:56:43.000000000 +0000 ++++ njam-1.25/src/njam.h 2012-07-04 16:50:13.000000000 +0000 +@@ -111,7 +111,6 @@ + + bool m_SDL; // whether SDL is initialized or not + bool m_AudioAvailable; // so we know wheter to try to play music/sfx +- char linux_sdl_driver[10]; + SDL_Surface *m_Screen; + + tGameOptions m_GameOptions; +@@ -201,7 +200,7 @@ + public: + NjamEngine(); + ~NjamEngine(); +- bool Init(bool,bool,bool); // initialize everything except for networking ++ bool Init(bool,bool); // initialize everything except for networking + void Start(); // start the music and main menu loop + }; + //----------------------------------------------------------------------------- diff --git a/games/njam/patches/gcc_46.patch b/games/njam/patches/gcc_46.patch new file mode 100644 index 0000000000000..43601d1f36324 --- /dev/null +++ b/games/njam/patches/gcc_46.patch @@ -0,0 +1,28 @@ +#!/bin/sh /usr/share/dpatch/dpatch-run +Description: gcc4.5 and later are more restrictive with c++ function calls, + this trivial patch fixes build failures with -fpermissive +Author: Andreas Moog <amoog@ubuntu.com> +Last-Update: 2011-07-15 + +=== modified file 'src/njamedit.cpp' +--- a/src/njamedit.cpp 2006-07-27 23:15:50 +0000 ++++ b/src/njamedit.cpp 2011-07-15 20:01:54 +0000 +@@ -114,7 +114,7 @@ + key = SDLK_a; + else if (CheckForSave()) + { +- LogFile::LogFile("Saving maps"); ++ LogFile("Saving maps"); + m_Maps.Save(filename); + level_type_was = level_type; + changed = false; +@@ -131,7 +131,7 @@ + char types[2][5] = { "COOP", "DUEL" }; + sprintf(buf, "levels/%s.%s\0", filename, types[level_type]); + sprintf(filename, "%s\0", buf); +- LogFile::LogFile("Saving maps"); ++ LogFile("Saving maps"); + m_Maps.Save(filename); + level_type_was = level_type; + changed = false; + |