[SCM] cute multiplayer platform game with bunnies branch, master, updated. ca1b6ba3cdaf8b9656d49b7b04fa630cc7eaae5f

Ansgar Burchardt ansgar at 2008.43-1.org
Mon Mar 2 22:16:36 UTC 2009


The following commit has been merged in the master branch:
commit ca1b6ba3cdaf8b9656d49b7b04fa630cc7eaae5f
Author: Ansgar Burchardt <ansgar at 2008.43-1.org>
Date:   Mon Mar 2 23:02:55 2009 +0100

    Use quilt for patch management, move some files to debian/

diff --git a/Makefile b/Makefile
index f90af4d..cef00ca 100644
--- a/Makefile
+++ b/Makefile
@@ -2,7 +2,7 @@ SDL_CFLAGS = `sdl-config --cflags`
 SDL_LIBS = `sdl-config --libs`
 CFLAGS = -Wall -O2 -ffast-math -funroll-loops -Dstricmp=strcasecmp \
 	-Dstrnicmp=strncasecmp -DUSE_SDL -DNDEBUG -I. $(SDL_CFLAGS) -DUSE_NET
-LIBS = $(SDL_LIBS) -lSDL_mixer -lSDL_net
+LIBS = -lm $(SDL_LIBS) -lSDL_mixer -lSDL_net
 SDL_TARGET = sdl.a
 MODIFY_TARGET = gobpack jnbpack jnbunpack
 OBJS = fireworks.o main.o menu.o filter.o
diff --git a/README b/README
index aa272b5..c19723d 100644
--- a/README
+++ b/README
@@ -24,6 +24,15 @@ Thanks to ben for making patches to run it on mac os x.
 Thanks to ivo for doing debian packages.
 
 f10 change between windowed/fullscreen mode
+(see the XF86Config-4, copy n paste the modeline 400x256
+then add the mode "400x256" to whatever bpp you have by default, restart x)
+example: add following line in Section "Monitor" of your 
+/etc/X11/XF86Config (or XF86Config-4)
+Modeline "400x256"     22.00  400 416 480 504  256 259 262 269 doublescan
+then in Section "Screen" if your DefaultDepth is 24 do be sure you have
+something like:
+Modes           "1024x768" "640x480" "512x384" "400x256" "320x240"
+esc/f12 exit
 
 For compilation you will need:
 do following on a debian gnu/linux system (www.debian.org)
@@ -35,8 +44,19 @@ which you can start with: jumpnbump -dat levelname.dat
 there's a screensaver mode as well:
 jumpnbump -fireworks -fullscreen
 
+Network play works like this, oh well here's an example
+Player 1: jumpnbump -port 7777 -net 0 ip_or_hostname_of_player2 port_of_player2
+Player 2: jumpnbump -port 7777 -net 1 ip_or_hostname_of_player1 port_of_player1
+just take port 7777 for all ports and hope it's open and you aren't
+firewalled (it's all udp!)
+You can add -net 3 and -net 4 for 3rd and 4th player, and be sure.
+All the players use the same -dat level.dat
+(the scoreboards is different on each player and strange things like
+that, but longislandman is working on it (isn't it? longislandman? you alive?))
+
 You can find the original dos game (which runs in dos/win9x (dosextender!))
 at http://www.brainchilddesign.com/games/jumpnbump/index.html
 
 If you like the game or have any ideas don't hesitate to contact me
 gurkan at linuks.mine.nu
+
diff --git a/FAQ b/debian/FAQ
similarity index 100%
rename from FAQ
rename to debian/FAQ
diff --git a/jumpnbump_menu/AUTHOR b/debian/contrib/jumpnbump_menu/AUTHOR
similarity index 100%
rename from jumpnbump_menu/AUTHOR
rename to debian/contrib/jumpnbump_menu/AUTHOR
diff --git a/jumpnbump_menu/Makefile b/debian/contrib/jumpnbump_menu/Makefile
similarity index 100%
rename from jumpnbump_menu/Makefile
rename to debian/contrib/jumpnbump_menu/Makefile
diff --git a/jumpnbump_menu/NEWS b/debian/contrib/jumpnbump_menu/NEWS
similarity index 100%
rename from jumpnbump_menu/NEWS
rename to debian/contrib/jumpnbump_menu/NEWS
diff --git a/jumpnbump_menu/README b/debian/contrib/jumpnbump_menu/README
similarity index 100%
rename from jumpnbump_menu/README
rename to debian/contrib/jumpnbump_menu/README
diff --git a/jumpnbump_menu/TODO b/debian/contrib/jumpnbump_menu/TODO
similarity index 100%
rename from jumpnbump_menu/TODO
rename to debian/contrib/jumpnbump_menu/TODO
diff --git a/jumpnbump_menu/jumpnbump_menu.glade b/debian/contrib/jumpnbump_menu/jumpnbump_menu.glade
similarity index 100%
rename from jumpnbump_menu/jumpnbump_menu.glade
rename to debian/contrib/jumpnbump_menu/jumpnbump_menu.glade
diff --git a/jumpnbump_menu/jumpnbump_menu.py b/debian/contrib/jumpnbump_menu/jumpnbump_menu.py
similarity index 100%
rename from jumpnbump_menu/jumpnbump_menu.py
rename to debian/contrib/jumpnbump_menu/jumpnbump_menu.py
diff --git a/debian/control b/debian/control
index 5b8c21c..18acf9e 100644
--- a/debian/control
+++ b/debian/control
@@ -3,7 +3,7 @@ Section: games
 Priority: optional
 Maintainer: Debian Games Team <pkg-games-devel at lists.alioth.debian.org>
 Uploaders: Ansgar Burchardt <ansgar at 43-1.org>
-Build-Depends: debhelper (>= 6), libsdl1.2-dev (>= 1.2.2-3.1), libsdl-mixer1.2-dev (>= 1.2.0-1.1), libsdl-net1.2-dev (>= 1.2.0-5.1)
+Build-Depends: debhelper (>= 6), quilt, libsdl1.2-dev (>= 1.2.2-3.1), libsdl-mixer1.2-dev (>= 1.2.0-1.1), libsdl-net1.2-dev (>= 1.2.0-5.1)
 Standards-Version: 3.8.0
 Homepage: http://jumpbump.mine.nu/
 Vcs-Git: git://git.debian.org/git/pkg-games/jumpnbump.git
diff --git a/debian/docs b/debian/docs
index c311035..896fc80 100644
--- a/debian/docs
+++ b/debian/docs
@@ -1,4 +1,4 @@
-FAQ
+debian/FAQ
 README
 gob.txt
 LINKS
diff --git a/debian/patches/do-not-link-libm.patch b/debian/patches/do-not-link-libm.patch
new file mode 100644
index 0000000..97a3839
--- /dev/null
+++ b/debian/patches/do-not-link-libm.patch
@@ -0,0 +1,13 @@
+Subject: Do not link libm
+
+--- jumpnbump.orig/Makefile
++++ jumpnbump/Makefile
+@@ -2,7 +2,7 @@
+ SDL_LIBS = `sdl-config --libs`
+ CFLAGS = -Wall -O2 -ffast-math -funroll-loops -Dstricmp=strcasecmp \
+ 	-Dstrnicmp=strncasecmp -DUSE_SDL -DNDEBUG -I. $(SDL_CFLAGS) -DUSE_NET
+-LIBS = -lm $(SDL_LIBS) -lSDL_mixer -lSDL_net
++LIBS = $(SDL_LIBS) -lSDL_mixer -lSDL_net
+ SDL_TARGET = sdl.a
+ MODIFY_TARGET = gobpack jnbpack jnbunpack
+ OBJS = fireworks.o main.o menu.o filter.o
diff --git a/debian/patches/exit-fullscreen.patch b/debian/patches/exit-fullscreen.patch
new file mode 100644
index 0000000..3339e49
--- /dev/null
+++ b/debian/patches/exit-fullscreen.patch
@@ -0,0 +1,42 @@
+Subject: Exit fullscreen mode on quit
+From: Dan Carpenter <error27 at gmail.com>
+Date: Tue, 17 Jan 2006 08:37:51 -0800
+
+See http://bugs.debian.org/338705
+
+--- jumpnbump.orig/globals.pre
++++ jumpnbump/globals.pre
+@@ -344,6 +344,7 @@
+ #ifdef USE_SDL
+ /* long filelength(int handle); */
+ void fs_toggle();
++void exit_fullscreen();
+ int intr_sysupdate();
+ #endif
+ 
+--- jumpnbump.orig/main.c
++++ jumpnbump/main.c
+@@ -3338,6 +3338,7 @@
+ 		free(mask_pic);
+ 
+ 	remove_keyb_handler();
++	exit_fullscreen();
+ 
+ #ifdef DOS
+ 	regs.x.ax = 0x3;
+--- jumpnbump.orig/sdl/gfx.c
++++ jumpnbump/sdl/gfx.c
+@@ -227,6 +227,13 @@
+ }
+ 
+ 
++void exit_fullscreen()
++{
++       if (fullscreen)
++               fs_toggle();
++}
++
++
+ void wait_vrt(int mix)
+ {
+ 	return;
diff --git a/debian/patches/remove-XF86Config-information.patch b/debian/patches/remove-XF86Config-information.patch
new file mode 100644
index 0000000..e1563d3
--- /dev/null
+++ b/debian/patches/remove-XF86Config-information.patch
@@ -0,0 +1,17 @@
+--- jumpnbump.orig/README
++++ jumpnbump/README
+@@ -24,14 +24,6 @@
+ Thanks to ivo for doing debian packages.
+ 
+ f10 change between windowed/fullscreen mode
+-(see the XF86Config-4, copy n paste the modeline 400x256
+-then add the mode "400x256" to whatever bpp you have by default, restart x)
+-example: add following line in Section "Monitor" of your 
+-/etc/X11/XF86Config (or XF86Config-4)
+-Modeline "400x256"     22.00  400 416 480 504  256 259 262 269 doublescan
+-then in Section "Screen" if your DefaultDepth is 24 do be sure you have
+-something like:
+-Modes           "1024x768" "640x480" "512x384" "400x256" "320x240"
+ esc/f12 exit
+ 
+ For compilation you will need:
diff --git a/debian/patches/remove-outdated-network-info.patch b/debian/patches/remove-outdated-network-info.patch
new file mode 100644
index 0000000..28251b8
--- /dev/null
+++ b/debian/patches/remove-outdated-network-info.patch
@@ -0,0 +1,25 @@
+Subject: Remove outdated network information from README
+From: Francois Marier <francois at debian.org>
+Date: Sun, 26 Jun 2005 13:02:29 -0400
+
+See http://bugs.debian.org/314221.
+
+--- jumpnbump.orig/README
++++ jumpnbump/README
+@@ -44,16 +44,6 @@
+ there's a screensaver mode as well:
+ jumpnbump -fireworks -fullscreen
+ 
+-Network play works like this, oh well here's an example
+-Player 1: jumpnbump -port 7777 -net 0 ip_or_hostname_of_player2 port_of_player2
+-Player 2: jumpnbump -port 7777 -net 1 ip_or_hostname_of_player1 port_of_player1
+-just take port 7777 for all ports and hope it's open and you aren't
+-firewalled (it's all udp!)
+-You can add -net 3 and -net 4 for 3rd and 4th player, and be sure.
+-All the players use the same -dat level.dat
+-(the scoreboards is different on each player and strange things like
+-that, but longislandman is working on it (isn't it? longislandman? you alive?))
+-
+ You can find the original dos game (which runs in dos/win9x (dosextender!))
+ at http://www.brainchilddesign.com/games/jumpnbump/index.html
+ 
diff --git a/debian/patches/safe-temporary-files.patch b/debian/patches/safe-temporary-files.patch
new file mode 100644
index 0000000..096c0d6
--- /dev/null
+++ b/debian/patches/safe-temporary-files.patch
@@ -0,0 +1,86 @@
+Subject: Handle temporary files in a safe way
+From: Ansgar Burchardt <ansgar at 43-1.org>
+Date: Mon, 29 Sep 2008 22:01:59 +0200
+
+See http://bugs.debian.org/500611.
+
+--- jumpnbump.orig/modify/jnbunpack.c
++++ jumpnbump/modify/jnbunpack.c
+@@ -23,6 +23,7 @@
+  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+  */
+ 
++#include <errno.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <fcntl.h>
+@@ -83,8 +84,13 @@
+ 	memset(filename, 0, sizeof(filename));
+ 	strncpy(filename, datafile[i].filename, 12);
+ 	printf("Extracting %s ", filename);
++	fflush(stdout);
+ 
+-	outfd = open(filename, O_RDWR | O_CREAT | O_BINARY, 0644);
++	if (unlink(filename) == -1 && errno != ENOENT) {
++	    perror("cannot unlink file");
++	    exit(1);
++	}
++	outfd = open(filename, O_RDWR | O_CREAT | O_EXCL | O_BINARY, 0644);
+ 	if (!outfd) {
+ 	    perror("cant open file");
+ 	    exit(1);
+--- jumpnbump.orig/sdl/sound.c
++++ jumpnbump/sdl/sound.c
+@@ -23,6 +23,8 @@
+  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+  */
+ 
++#include <stdlib.h>
++#include <string.h>
+ #include "globals.h"
+ #include <limits.h>
+ #ifndef _MSC_VER
+@@ -463,11 +465,8 @@
+ {
+ #ifndef NO_SDL_MIXER
+ 	FILE *tmp;
+-# if ((defined _MSC_VER) || (defined __MINGW32__))
+-	char filename[] = "jnb.tmpmusic.mod";
+-# else
+-	char filename[] = "/tmp/jnb.tmpmusic.mod";
+-# endif
++	int tmp_fd;
++	char* filename;
+ 	unsigned char *fp;
+ 	int len;
+ 
+@@ -506,15 +505,24 @@
+ 		return 0;
+ 	}
+ 
+-	tmp = fopen(filename, "wb");
+-	if (tmp) {
+-        fwrite(fp, len, 1, tmp);
+-		fflush(tmp);
+-		fclose(tmp);
++	filename = strdup("/tmp/jumpnbump.mod.XXXXXX");
++	tmp_fd = mkstemp(filename);
++	if (tmp_fd == -1) {
++		free(filename);
++		return 0;
++	}
++	tmp = fdopen(tmp_fd, "wb");
++	if (!tmp) {
++		free(filename);
++		return 0;
+ 	}
++	fwrite(fp, len, 1, tmp);
++	fflush(tmp);
++	fclose(tmp);
+ 
+ 	current_music = Mix_LoadMUS(filename);
+ 	unlink(filename);
++	free(filename);
+ 	if (current_music == NULL) {
+ 		fprintf(stderr, "Couldn't load music: %s\n", SDL_GetError());
+ 		return 0;
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..942e4be
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,6 @@
+exit-fullscreen.patch
+safe-temporary-files.patch
+use-usr-share-games.patch
+do-not-link-libm.patch
+remove-outdated-network-info.patch
+remove-XF86Config-information.patch
diff --git a/debian/patches/use-usr-share-games.patch b/debian/patches/use-usr-share-games.patch
new file mode 100644
index 0000000..dd70538
--- /dev/null
+++ b/debian/patches/use-usr-share-games.patch
@@ -0,0 +1,18 @@
+Subject: Use /usr/share/games/jumpnbump
+From: Ivo Timmermans <ivo at debian.org>
+Date: Wed,  9 Oct 2002 21:01:32 +0200
+
+Make jumpnbump use /usr/share/games/jumpnbump instead of
+/usr/local/share/jumpnbump.
+
+--- jumpnbump.orig/globals.pre
++++ jumpnbump/globals.pre
+@@ -168,7 +168,7 @@
+ #elif _WIN32
+ #define	DATA_PATH "data/jumpbump.dat"
+ #else
+-#define	DATA_PATH "%%PREFIX%%/share/jumpnbump/jumpbump.dat"
++#define	DATA_PATH "%%PREFIX%%/share/games/jumpnbump/jumpbump.dat"
+ #endif
+ #endif
+ 
diff --git a/debian/rules b/debian/rules
index 84e53fe..02b73c3 100755
--- a/debian/rules
+++ b/debian/rules
@@ -5,6 +5,8 @@
 # Uncomment this to turn on verbose mode.
 #export DH_VERBOSE=1
 
+include /usr/share/quilt/quilt.make
+
 configure: configure-stamp
 configure-stamp:
 	dh_testdir
@@ -12,14 +14,14 @@ configure-stamp:
 	touch configure-stamp
 
 build: configure-stamp build-stamp
-build-stamp:
+build-stamp: $(QUILT_STAMPFN)
 	dh_testdir
 
 	$(MAKE) PREFIX=/usr all data
 
 	touch build-stamp
 
-clean:
+clean: unpatch
 	dh_testdir
 	dh_testroot
 	rm -f build-stamp configure-stamp
@@ -44,10 +46,10 @@ install: build
 	install -o root -g root -m 755 -d $(CURDIR)/debian/jumpnbump/usr/share/games/jumpnbump
 	install -o root -g root -m 644 debian/jumpnbump.xpm $(CURDIR)/debian/jumpnbump/usr/share/pixmaps/jumpnbump.xpm
 	install -o root -g root -m 644 debian/jumpnbump.desktop $(CURDIR)/debian/jumpnbump/usr/share/applications/jumpnbump.desktop
-	install -o root -g root -m 644 jumpnbump_menu/jumpnbump_menu.glade $(CURDIR)/debian/jumpnbump/usr/share/games/jumpnbump/
+	install -o root -g root -m 644 debian/contrib/jumpnbump_menu/jumpnbump_menu.glade $(CURDIR)/debian/jumpnbump/usr/share/games/jumpnbump/
 	install -o root -g root -m 644 data/jumpbump.dat $(CURDIR)/debian/jumpnbump/usr/share/games/jumpnbump/
 	install -o root -g root -m 755 -d $(CURDIR)/debian/jumpnbump/usr/share/man/man6
-	install -o root -g root -m 755 jumpnbump_menu/jumpnbump_menu.py $(CURDIR)/debian/jumpnbump/usr/games/jumpnbump-menu
+	install -o root -g root -m 755 debian/contrib/jumpnbump_menu/jumpnbump_menu.py $(CURDIR)/debian/jumpnbump/usr/games/jumpnbump-menu
 
 	# Man page links
 	ln -s jumpnbump.6.gz $(CURDIR)/debian/jumpnbump/usr/share/man/man6/jumpnbump.svgalib.6.gz
diff --git a/globals.pre b/globals.pre
index 842eaee..87c5506 100644
--- a/globals.pre
+++ b/globals.pre
@@ -168,7 +168,7 @@ extern int ai[JNB_MAX_PLAYERS];
 #elif _WIN32
 #define	DATA_PATH "data/jumpbump.dat"
 #else
-#define	DATA_PATH "%%PREFIX%%/share/games/jumpnbump/jumpbump.dat"
+#define	DATA_PATH "%%PREFIX%%/share/jumpnbump/jumpbump.dat"
 #endif
 #endif
 
@@ -344,7 +344,6 @@ void register_mask(void *pixels);
 #ifdef USE_SDL
 /* long filelength(int handle); */
 void fs_toggle();
-void exit_fullscreen();
 int intr_sysupdate();
 #endif
 
diff --git a/main.c b/main.c
index 900b810..6efdd04 100644
--- a/main.c
+++ b/main.c
@@ -3338,7 +3338,6 @@ void deinit_program(void)
 		free(mask_pic);
 
 	remove_keyb_handler();
-	exit_fullscreen();
 
 #ifdef DOS
 	regs.x.ax = 0x3;
@@ -3353,6 +3352,7 @@ void deinit_program(void)
 		exit(1);
 	} else
 		exit(0);
+
 }
 
 
diff --git a/modify/jnbunpack.c b/modify/jnbunpack.c
index aa55d79..de7c851 100644
--- a/modify/jnbunpack.c
+++ b/modify/jnbunpack.c
@@ -23,7 +23,6 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <fcntl.h>
@@ -84,13 +83,8 @@ int main(int argc, char **argv)
 	memset(filename, 0, sizeof(filename));
 	strncpy(filename, datafile[i].filename, 12);
 	printf("Extracting %s ", filename);
-	fflush(stdout);
 
-	if (unlink(filename) == -1 && errno != ENOENT) {
-	    perror("cannot unlink file");
-	    exit(1);
-	}
-	outfd = open(filename, O_RDWR | O_CREAT | O_EXCL | O_BINARY, 0644);
+	outfd = open(filename, O_RDWR | O_CREAT | O_BINARY, 0644);
 	if (!outfd) {
 	    perror("cant open file");
 	    exit(1);
diff --git a/sdl/gfx.c b/sdl/gfx.c
index 4cea7e5..9585632 100644
--- a/sdl/gfx.c
+++ b/sdl/gfx.c
@@ -226,11 +226,6 @@ void fs_toggle()
 		fullscreen ^= 1;
 }
 
-void exit_fullscreen()
-{
-	if (fullscreen)
-		fs_toggle();
-}
 
 void wait_vrt(int mix)
 {
diff --git a/sdl/sound.c b/sdl/sound.c
index 0e6a81e..886d4b0 100644
--- a/sdl/sound.c
+++ b/sdl/sound.c
@@ -23,11 +23,6 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#define _BSD_SOURCE
-#define _POSIX_C_SOURCE
-
-#include <stdlib.h>
-#include <string.h>
 #include "globals.h"
 #include <limits.h>
 #ifndef _MSC_VER
@@ -468,8 +463,11 @@ char dj_ready_mod(char mod_num)
 {
 #ifndef NO_SDL_MIXER
 	FILE *tmp;
-	int tmp_fd;
-	char* filename;
+# if ((defined _MSC_VER) || (defined __MINGW32__))
+	char filename[] = "jnb.tmpmusic.mod";
+# else
+	char filename[] = "/tmp/jnb.tmpmusic.mod";
+# endif
 	unsigned char *fp;
 	int len;
 
@@ -508,24 +506,15 @@ char dj_ready_mod(char mod_num)
 		return 0;
 	}
 
-	filename = strdup("/tmp/jumpnbump.mod.XXXXXX");
-	tmp_fd = mkstemp(filename);
-	if (tmp_fd == -1) {
-		free(filename);
-		return 0;
-	}
-	tmp = fdopen(tmp_fd, "wb");
-	if (!tmp) {
-		free(filename);
-		return 0;
+	tmp = fopen(filename, "wb");
+	if (tmp) {
+        fwrite(fp, len, 1, tmp);
+		fflush(tmp);
+		fclose(tmp);
 	}
-	fwrite(fp, len, 1, tmp);
-	fflush(tmp);
-	fclose(tmp);
 
 	current_music = Mix_LoadMUS(filename);
 	unlink(filename);
-	free(filename);
 	if (current_music == NULL) {
 		fprintf(stderr, "Couldn't load music: %s\n", SDL_GetError());
 		return 0;

-- 
cute multiplayer platform game with bunnies



More information about the Pkg-games-commits mailing list