r6604 - packages/trunk/biniax2/debian/patches

Miriam Ruiz baby-guest at alioth.debian.org
Thu Apr 17 12:00:38 UTC 2008


Author: baby-guest
Date: 2008-04-17 12:00:37 +0000 (Thu, 17 Apr 2008)
New Revision: 6604

Added:
   packages/trunk/biniax2/debian/patches/fixes.patch
Removed:
   packages/trunk/biniax2/debian/patches/sound.patch
Modified:
   packages/trunk/biniax2/debian/patches/series
Log:
Renamed patch



Copied: packages/trunk/biniax2/debian/patches/fixes.patch (from rev 6603, packages/trunk/biniax2/debian/patches/sound.patch)
===================================================================
--- packages/trunk/biniax2/debian/patches/fixes.patch	                        (rev 0)
+++ packages/trunk/biniax2/debian/patches/fixes.patch	2008-04-17 12:00:37 UTC (rev 6604)
@@ -0,0 +1,239 @@
+# Copyright (C) 2008 by Miriam Ruiz <little_miry at yahoo.es>
+# Distributed under the same license as the game. See debian/copyright
+
+Index: biniax2/biniax.c
+===================================================================
+--- biniax2.orig/biniax.c	2008-04-17 11:57:46.000000000 +0000
++++ biniax2/biniax.c	2008-04-17 11:57:46.000000000 +0000
+@@ -100,13 +100,27 @@
+ 	cfgInit();
+ 	hofInit();
+ 	if ( gfxInit() == BNX_FALSE )
++	{
++		fprintf(stderr, "Error in Graphics Initialization\n");
+ 		return -1;
++	}
+ 	if ( sysInit() == BNX_FALSE )
++	{
++		fprintf(stderr, "Error in System Initialization\n");
+ 		return -2;
++	}
+ 	if ( inpInit() == BNX_FALSE )
++	{
++		fprintf(stderr, "Error in Input Initialization\n");
+ 		return -3;
++	}
+ 	if ( sndInit() == BNX_FALSE )
+-		return -4;
++	{
++		fprintf(stderr, "Error in Sound Initialization\n");
++		cfgSetSound(BNX_FALSE);
++		cfgSetMusic(BNX_FALSE);
++		/* return -4; */
++	}
+ 	
+ 	/******************************************************************
+ 	SHOW INITIAL WELCOME SCREEN                                                
+Index: biniax2/desktop/cfg.c
+===================================================================
+--- biniax2.orig/desktop/cfg.c	2008-04-17 11:57:46.000000000 +0000
++++ biniax2/desktop/cfg.c	2008-04-17 11:59:09.000000000 +0000
+@@ -30,6 +30,17 @@
+ 
+ #include "inc.h"
+ 
++#ifndef _WIN32
++#include <stdlib.h>
++#include <stdio.h>
++#include <string.h>
++#include <unistd.h>
++#include <limits.h>
++#include <pwd.h>
++#include <fcntl.h>
++#include <sys/stat.h>
++#include <sys/types.h>
++#endif
+ 
+ /******************************************************************************
+ FUNCTIONS
+@@ -52,13 +63,40 @@
+ 	char	buffer[ _Cfg_Buffer ];
+ 	int		nTemp;
+ 
++#ifndef _WIN32
++	char filename[PATH_MAX];
++	char *home;	
++	struct passwd *passwd;
++	if (!getuid() || !(home = getenv("HOME")))
++	{
++		passwd = getpwuid (getuid());
++		home=passwd->pw_dir;
++		if (!home)
++		{
++			fprintf(stderr, "$HOME is not defined.n");
++			return BNX_FALSE;
++		}
++	}
++	if (strlen(home) > PATH_MAX - sizeof("/.biniax2/config"))
++	{
++		fprintf(stderr, "$HOME is excessively long.n");
++		return BNX_FALSE;
++	}
++	snprintf(filename, sizeof(filename), "%s/.biniax2", home);
++	mkdir(filename, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
++	strncat(filename, "/config", sizeof(filename)-1);
++#else
++	char filename[] = "./config.bnx2";
++#endif
++	
+ 	_Cfg.sound = BNX_TRUE;
+ 	_Cfg.music = BNX_TRUE;
+ 	_Cfg.fullscreen = BNX_FALSE;
+ 
+-	f = fopen( "config.bnx2", "rt" );
++	f = fopen( filename, "rt" );
+ 	if ( f == 0 )
+ 	{
++		fprintf( stderr,"Configuration file \"%s\" not found\n", filename );
+ 		return BNX_FALSE;
+ 	}
+ 
+@@ -76,6 +114,10 @@
+ 
+ 	fclose( f );
+ 
++	fprintf( stderr, _Cfg.sound ? "Sound On\n" : "Sound Off\n" );
++	fprintf( stderr, _Cfg.music ? "Music On\n" : "Music Off\n" );
++	fprintf( stderr, _Cfg.fullscreen ? "Fullscreen On\n" : "Fullscreen Off\n" );
++
+ 	return BNX_TRUE;
+ }
+ 
+@@ -84,12 +126,28 @@
+ 	return _Cfg.sound;
+ }
+ 
++void cfgSetSound(BNX_BOOL b)
++{
++	_Cfg.sound = b;
++}
++
++
+ BNX_BOOL cfgGetMusic()
+ {
+ 	return _Cfg.music;
+ }
+ 
++void cfgSetMusic(BNX_BOOL b)
++{
++	_Cfg.music = b;
++}
++
+ BNX_BOOL cfgGetFullscreen()
+ {
+ 	return _Cfg.fullscreen;
+ }
++
++void cfgSetFullscreen(BNX_BOOL b)
++{
++	_Cfg.fullscreen = b;
++}
+Index: biniax2/desktop/cfg.h
+===================================================================
+--- biniax2.orig/desktop/cfg.h	2008-04-17 11:57:46.000000000 +0000
++++ biniax2/desktop/cfg.h	2008-04-17 11:57:46.000000000 +0000
+@@ -43,4 +43,8 @@
+ BNX_BOOL cfgGetMusic();
+ BNX_BOOL cfgGetFullscreen();
+ 
++void cfgSetSound(BNX_BOOL);
++void cfgSetMusic(BNX_BOOL);
++void cfgSetFullscreen(BNX_BOOL);
++                                             
+ #endif
+Index: biniax2/hof.c
+===================================================================
+--- biniax2.orig/hof.c	2008-04-17 11:57:46.000000000 +0000
++++ biniax2/hof.c	2008-04-17 11:59:17.000000000 +0000
+@@ -31,6 +31,18 @@
+ 
+ #include "inc.h"
+ 
++#ifndef _WIN32
++#include <stdlib.h>
++#include <stdio.h>
++#include <string.h>
++#include <unistd.h>
++#include <limits.h>
++#include <pwd.h>
++#include <fcntl.h>
++#include <sys/stat.h>
++#include <sys/types.h>
++#endif
++
+ #define chCursor '_'
+ #define chSpace ' '
+ 
+@@ -82,6 +94,37 @@
+ 	}
+ }
+ 
++static const char *hofFileName()
++{
++#ifndef _WIN32
++	static char filename[PATH_MAX] = "";
++	char *home;
++	struct passwd *passwd;
++	if (*filename)
++		return filename;
++	if (!getuid() || !(home = getenv("HOME")))
++	{
++		passwd = getpwuid (getuid());
++		home=passwd->pw_dir;
++		if (!home)
++		{
++			fprintf(stderr, "$HOME is not defined.n");
++			return BNX_FALSE;
++		}
++	}
++	if (strlen(home) > PATH_MAX - sizeof("/.biniax2/config"))
++	{
++		fprintf(stderr, "$HOME is excessively long.n");
++		return BNX_FALSE;
++	}
++	snprintf(filename, sizeof(filename), "%s/.biniax2", home);
++	mkdir(filename, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
++	strncat(filename, "/hof", sizeof(filename)-1);
++	return filename;
++#else
++	return "./hof.bnx2";
++#endif
++}
+ 
+ BNX_BOOL hofInit()
+ {
+@@ -98,7 +141,7 @@
+ 		Hof.tactic[ i ].score = (cHofEntries - i) * cHofInitScore;
+ 	}
+ 
+-	file = fopen( "hof.bnx2", "rb" );
++	file = fopen( hofFileName(), "rb" );
+ 
+ 	if ( file == (FILE *) NULL )
+ 		return BNX_FALSE;
+@@ -114,7 +157,7 @@
+ {
+ 	FILE		*file;
+ 
+-	file = fopen( "hof.bnx2", "wb" );
++	file = fopen( hofFileName(), "wb" );
+ 
+ 	if ( file == (FILE *) NULL )
+ 		return BNX_FALSE;
+@@ -246,4 +289,4 @@
+ BNX_HALL *hofGet()
+ {
+ 	return (BNX_HALL *) &Hof;
+-}
+\ No newline at end of file
++}

Modified: packages/trunk/biniax2/debian/patches/series
===================================================================
--- packages/trunk/biniax2/debian/patches/series	2008-04-17 12:00:00 UTC (rev 6603)
+++ packages/trunk/biniax2/debian/patches/series	2008-04-17 12:00:37 UTC (rev 6604)
@@ -1,2 +1,2 @@
 datadir.patch
-sound.patch
+fixes.patch

Deleted: packages/trunk/biniax2/debian/patches/sound.patch
===================================================================
--- packages/trunk/biniax2/debian/patches/sound.patch	2008-04-17 12:00:00 UTC (rev 6603)
+++ packages/trunk/biniax2/debian/patches/sound.patch	2008-04-17 12:00:37 UTC (rev 6604)
@@ -1,239 +0,0 @@
-# Copyright (C) 2008 by Miriam Ruiz <little_miry at yahoo.es>
-# Distributed under the same license as the game. See debian/copyright
-
-Index: biniax2/biniax.c
-===================================================================
---- biniax2.orig/biniax.c	2008-04-17 11:57:46.000000000 +0000
-+++ biniax2/biniax.c	2008-04-17 11:57:46.000000000 +0000
-@@ -100,13 +100,27 @@
- 	cfgInit();
- 	hofInit();
- 	if ( gfxInit() == BNX_FALSE )
-+	{
-+		fprintf(stderr, "Error in Graphics Initialization\n");
- 		return -1;
-+	}
- 	if ( sysInit() == BNX_FALSE )
-+	{
-+		fprintf(stderr, "Error in System Initialization\n");
- 		return -2;
-+	}
- 	if ( inpInit() == BNX_FALSE )
-+	{
-+		fprintf(stderr, "Error in Input Initialization\n");
- 		return -3;
-+	}
- 	if ( sndInit() == BNX_FALSE )
--		return -4;
-+	{
-+		fprintf(stderr, "Error in Sound Initialization\n");
-+		cfgSetSound(BNX_FALSE);
-+		cfgSetMusic(BNX_FALSE);
-+		/* return -4; */
-+	}
- 	
- 	/******************************************************************
- 	SHOW INITIAL WELCOME SCREEN                                                
-Index: biniax2/desktop/cfg.c
-===================================================================
---- biniax2.orig/desktop/cfg.c	2008-04-17 11:57:46.000000000 +0000
-+++ biniax2/desktop/cfg.c	2008-04-17 11:59:09.000000000 +0000
-@@ -30,6 +30,17 @@
- 
- #include "inc.h"
- 
-+#ifndef _WIN32
-+#include <stdlib.h>
-+#include <stdio.h>
-+#include <string.h>
-+#include <unistd.h>
-+#include <limits.h>
-+#include <pwd.h>
-+#include <fcntl.h>
-+#include <sys/stat.h>
-+#include <sys/types.h>
-+#endif
- 
- /******************************************************************************
- FUNCTIONS
-@@ -52,13 +63,40 @@
- 	char	buffer[ _Cfg_Buffer ];
- 	int		nTemp;
- 
-+#ifndef _WIN32
-+	char filename[PATH_MAX];
-+	char *home;	
-+	struct passwd *passwd;
-+	if (!getuid() || !(home = getenv("HOME")))
-+	{
-+		passwd = getpwuid (getuid());
-+		home=passwd->pw_dir;
-+		if (!home)
-+		{
-+			fprintf(stderr, "$HOME is not defined.n");
-+			return BNX_FALSE;
-+		}
-+	}
-+	if (strlen(home) > PATH_MAX - sizeof("/.biniax2/config"))
-+	{
-+		fprintf(stderr, "$HOME is excessively long.n");
-+		return BNX_FALSE;
-+	}
-+	snprintf(filename, sizeof(filename), "%s/.biniax2", home);
-+	mkdir(filename, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
-+	strncat(filename, "/config", sizeof(filename)-1);
-+#else
-+	char filename[] = "./config.bnx2";
-+#endif
-+	
- 	_Cfg.sound = BNX_TRUE;
- 	_Cfg.music = BNX_TRUE;
- 	_Cfg.fullscreen = BNX_FALSE;
- 
--	f = fopen( "config.bnx2", "rt" );
-+	f = fopen( filename, "rt" );
- 	if ( f == 0 )
- 	{
-+		fprintf( stderr,"Configuration file \"%s\" not found\n", filename );
- 		return BNX_FALSE;
- 	}
- 
-@@ -76,6 +114,10 @@
- 
- 	fclose( f );
- 
-+	fprintf( stderr, _Cfg.sound ? "Sound On\n" : "Sound Off\n" );
-+	fprintf( stderr, _Cfg.music ? "Music On\n" : "Music Off\n" );
-+	fprintf( stderr, _Cfg.fullscreen ? "Fullscreen On\n" : "Fullscreen Off\n" );
-+
- 	return BNX_TRUE;
- }
- 
-@@ -84,12 +126,28 @@
- 	return _Cfg.sound;
- }
- 
-+void cfgSetSound(BNX_BOOL b)
-+{
-+	_Cfg.sound = b;
-+}
-+
-+
- BNX_BOOL cfgGetMusic()
- {
- 	return _Cfg.music;
- }
- 
-+void cfgSetMusic(BNX_BOOL b)
-+{
-+	_Cfg.music = b;
-+}
-+
- BNX_BOOL cfgGetFullscreen()
- {
- 	return _Cfg.fullscreen;
- }
-+
-+void cfgSetFullscreen(BNX_BOOL b)
-+{
-+	_Cfg.fullscreen = b;
-+}
-Index: biniax2/desktop/cfg.h
-===================================================================
---- biniax2.orig/desktop/cfg.h	2008-04-17 11:57:46.000000000 +0000
-+++ biniax2/desktop/cfg.h	2008-04-17 11:57:46.000000000 +0000
-@@ -43,4 +43,8 @@
- BNX_BOOL cfgGetMusic();
- BNX_BOOL cfgGetFullscreen();
- 
-+void cfgSetSound(BNX_BOOL);
-+void cfgSetMusic(BNX_BOOL);
-+void cfgSetFullscreen(BNX_BOOL);
-+                                             
- #endif
-Index: biniax2/hof.c
-===================================================================
---- biniax2.orig/hof.c	2008-04-17 11:57:46.000000000 +0000
-+++ biniax2/hof.c	2008-04-17 11:59:17.000000000 +0000
-@@ -31,6 +31,18 @@
- 
- #include "inc.h"
- 
-+#ifndef _WIN32
-+#include <stdlib.h>
-+#include <stdio.h>
-+#include <string.h>
-+#include <unistd.h>
-+#include <limits.h>
-+#include <pwd.h>
-+#include <fcntl.h>
-+#include <sys/stat.h>
-+#include <sys/types.h>
-+#endif
-+
- #define chCursor '_'
- #define chSpace ' '
- 
-@@ -82,6 +94,37 @@
- 	}
- }
- 
-+static const char *hofFileName()
-+{
-+#ifndef _WIN32
-+	static char filename[PATH_MAX] = "";
-+	char *home;
-+	struct passwd *passwd;
-+	if (*filename)
-+		return filename;
-+	if (!getuid() || !(home = getenv("HOME")))
-+	{
-+		passwd = getpwuid (getuid());
-+		home=passwd->pw_dir;
-+		if (!home)
-+		{
-+			fprintf(stderr, "$HOME is not defined.n");
-+			return BNX_FALSE;
-+		}
-+	}
-+	if (strlen(home) > PATH_MAX - sizeof("/.biniax2/config"))
-+	{
-+		fprintf(stderr, "$HOME is excessively long.n");
-+		return BNX_FALSE;
-+	}
-+	snprintf(filename, sizeof(filename), "%s/.biniax2", home);
-+	mkdir(filename, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
-+	strncat(filename, "/hof", sizeof(filename)-1);
-+	return filename;
-+#else
-+	return "./hof.bnx2";
-+#endif
-+}
- 
- BNX_BOOL hofInit()
- {
-@@ -98,7 +141,7 @@
- 		Hof.tactic[ i ].score = (cHofEntries - i) * cHofInitScore;
- 	}
- 
--	file = fopen( "hof.bnx2", "rb" );
-+	file = fopen( hofFileName(), "rb" );
- 
- 	if ( file == (FILE *) NULL )
- 		return BNX_FALSE;
-@@ -114,7 +157,7 @@
- {
- 	FILE		*file;
- 
--	file = fopen( "hof.bnx2", "wb" );
-+	file = fopen( hofFileName(), "wb" );
- 
- 	if ( file == (FILE *) NULL )
- 		return BNX_FALSE;
-@@ -246,4 +289,4 @@
- BNX_HALL *hofGet()
- {
- 	return (BNX_HALL *) &Hof;
--}
-\ No newline at end of file
-+}




More information about the Pkg-games-commits mailing list