Author: miriam Date: 2009-05-16 01:03:20 +0000 (Sat, 16 May 2009) New Revision: 9743
Modified: packages/trunk/biniax2/debian/patches/datadir.patch packages/trunk/biniax2/debian/patches/endianess.patch packages/trunk/biniax2/debian/patches/fixes.patch packages/trunk/biniax2/debian/patches/warnings.patch Log: Refreshed patches Modified: packages/trunk/biniax2/debian/patches/datadir.patch =================================================================== --- packages/trunk/biniax2/debian/patches/datadir.patch 2009-05-16 00:53:52 UTC (rev 9742) +++ packages/trunk/biniax2/debian/patches/datadir.patch 2009-05-16 01:03:20 UTC (rev 9743) @@ -1,66 +1,66 @@ # Copyright (C) 2008 by Miriam Ruiz <[email protected]> # Distributed under the same license as the game. See debian/copyright -Index: biniax2/desktop/gfx.c -=================================================================== ---- biniax2.orig/desktop/gfx.c 2008-04-18 13:40:19.000000000 +0000 -+++ biniax2/desktop/gfx.c 2008-04-18 13:44:57.000000000 +0000 -@@ -789,39 +789,39 @@ +--- biniax2.orig/desktop/gfx.c ++++ biniax2/desktop/gfx.c +@@ -809,40 +809,40 @@ BNX_BOOL bLoad = BNX_TRUE; /* Load GUI related graphics data */ -- bLoad |= gfxLoadImage( "data/graphics/background0.png", &_Gfx.background[ cModeRealtime ]); -- bLoad |= gfxLoadImage( "data/graphics/background1.png", &_Gfx.background[ cModeTurn ]); -- bLoad |= gfxLoadImage( "data/graphics/background2.png", &_Gfx.background[ cModeMultiplayer ] ); +- bLoad &= gfxLoadImage( "data/graphics/background0.png", &_Gfx.background[ cModeRealtime ]); +- bLoad &= gfxLoadImage( "data/graphics/background1.png", &_Gfx.background[ cModeTurn ]); +- bLoad &= gfxLoadImage( "data/graphics/background2.png", &_Gfx.background[ cModeMultiplayer ] ); - -- bLoad |= gfxLoadImage( "data/graphics/window.png", &_Gfx.window ); -- bLoad |= gfxLoadImage( "data/graphics/splash.png", &_Gfx.splash ); -- bLoad |= gfxLoadImage( "data/graphics/logo.png", &_Gfx.logo ); -- bLoad |= gfxLoadImage( "data/graphics/help.png", &_Gfx.help ); -- bLoad |= gfxLoadImage( "data/graphics/font.png", &_Gfx.font ); -- bLoad |= gfxLoadImage( "data/graphics/roadmap.png", &_Gfx.roadmap ); -+ bLoad |= gfxLoadImage( DATADIR "/graphics/background0.png", &_Gfx.background[ cModeRealtime ]); -+ bLoad |= gfxLoadImage( DATADIR "/graphics/background1.png", &_Gfx.background[ cModeTurn ]); -+ bLoad |= gfxLoadImage( DATADIR "/graphics/background2.png", &_Gfx.background[ cModeMultiplayer ] ); +- bLoad &= gfxLoadImage( "data/graphics/window.png", &_Gfx.window ); +- bLoad &= gfxLoadImage( "data/graphics/splash.png", &_Gfx.splash ); +- bLoad &= gfxLoadImage( "data/graphics/logo.png", &_Gfx.logo ); +- bLoad &= gfxLoadImage( "data/graphics/help.png", &_Gfx.help ); +- bLoad &= gfxLoadImage( "data/graphics/font.png", &_Gfx.font ); +- bLoad &= gfxLoadImage( "data/graphics/roadmap.png", &_Gfx.roadmap ); ++ bLoad &= gfxLoadImage( DATADIR "/graphics/background0.png", &_Gfx.background[ cModeRealtime ]); ++ bLoad &= gfxLoadImage( DATADIR "/graphics/background1.png", &_Gfx.background[ cModeTurn ]); ++ bLoad &= gfxLoadImage( DATADIR "/graphics/background2.png", &_Gfx.background[ cModeMultiplayer ] ); + -+ bLoad |= gfxLoadImage( DATADIR "/graphics/window.png", &_Gfx.window ); -+ bLoad |= gfxLoadImage( DATADIR "/graphics/splash.png", &_Gfx.splash ); -+ bLoad |= gfxLoadImage( DATADIR "/graphics/logo.png", &_Gfx.logo ); -+ bLoad |= gfxLoadImage( DATADIR "/graphics/help.png", &_Gfx.help ); -+ bLoad |= gfxLoadImage( DATADIR "/graphics/font.png", &_Gfx.font ); -+ bLoad |= gfxLoadImage( DATADIR "/graphics/roadmap.png", &_Gfx.roadmap ); ++ bLoad &= gfxLoadImage( DATADIR "/graphics/window.png", &_Gfx.window ); ++ bLoad &= gfxLoadImage( DATADIR "/graphics/splash.png", &_Gfx.splash ); ++ bLoad &= gfxLoadImage( DATADIR "/graphics/logo.png", &_Gfx.logo ); ++ bLoad &= gfxLoadImage( DATADIR "/graphics/help.png", &_Gfx.help ); ++ bLoad &= gfxLoadImage( DATADIR "/graphics/font.png", &_Gfx.font ); ++ bLoad &= gfxLoadImage( DATADIR "/graphics/roadmap.png", &_Gfx.roadmap ); // Loading Game Elements -- bLoad |= gfxLoadImage( "data/graphics/element0.png", &_Gfx.elements[ 0 ] ); -- bLoad |= gfxLoadImage( "data/graphics/element1.png", &_Gfx.elements[ 1 ] ); -- bLoad |= gfxLoadImage( "data/graphics/element2.png", &_Gfx.elements[ 2 ] ); -- bLoad |= gfxLoadImage( "data/graphics/element3.png", &_Gfx.elements[ 3 ] ); -- bLoad |= gfxLoadImage( "data/graphics/elementB.png", &_Gfx.elements[ 4 ] ); +- bLoad &= gfxLoadImage( "data/graphics/element0.png", &_Gfx.elements[ 0 ] ); +- bLoad &= gfxLoadImage( "data/graphics/element1.png", &_Gfx.elements[ 1 ] ); +- bLoad &= gfxLoadImage( "data/graphics/element2.png", &_Gfx.elements[ 2 ] ); +- bLoad &= gfxLoadImage( "data/graphics/element3.png", &_Gfx.elements[ 3 ] ); +- bLoad &= gfxLoadImage( "data/graphics/elementB.png", &_Gfx.elements[ 4 ] ); - -- bLoad |= gfxLoadImage( "data/graphics/movecount.png", &_Gfx.movecount ); -- bLoad |= gfxLoadImage( "data/graphics/cursor0.png", &_Gfx.cursors[ 0 ] ); -- bLoad |= gfxLoadImage( "data/graphics/cursor1.png", &_Gfx.cursors[ 1 ] ); -- bLoad |= gfxLoadImage( "data/graphics/marker0.png", &_Gfx.markers[ 0 ] ); -- bLoad |= gfxLoadImage( "data/graphics/marker1.png", &_Gfx.markers[ 1 ] ); +- bLoad &= gfxLoadImage( "data/graphics/movecount.png", &_Gfx.movecount ); +- bLoad &= gfxLoadImage( "data/graphics/keyboard.png", &_Gfx.keyboard ); +- bLoad &= gfxLoadImage( "data/graphics/cursor0.png", &_Gfx.cursors[ 0 ] ); +- bLoad &= gfxLoadImage( "data/graphics/cursor1.png", &_Gfx.cursors[ 1 ] ); +- bLoad &= gfxLoadImage( "data/graphics/marker0.png", &_Gfx.markers[ 0 ] ); +- bLoad &= gfxLoadImage( "data/graphics/marker1.png", &_Gfx.markers[ 1 ] ); - -- bLoad |= gfxLoadImage( "data/graphics/particle0.png", &_Gfx.part[ 0 ] ); -- bLoad |= gfxLoadImage( "data/graphics/particle1.png", &_Gfx.part[ 1 ] ); -- bLoad |= gfxLoadImage( "data/graphics/particle2.png", &_Gfx.part[ 2 ] ); -+ bLoad |= gfxLoadImage( DATADIR "/graphics/element0.png", &_Gfx.elements[ 0 ] ); -+ bLoad |= gfxLoadImage( DATADIR "/graphics/element1.png", &_Gfx.elements[ 1 ] ); -+ bLoad |= gfxLoadImage( DATADIR "/graphics/element2.png", &_Gfx.elements[ 2 ] ); -+ bLoad |= gfxLoadImage( DATADIR "/graphics/element3.png", &_Gfx.elements[ 3 ] ); -+ bLoad |= gfxLoadImage( DATADIR "/graphics/elementB.png", &_Gfx.elements[ 4 ] ); +- bLoad &= gfxLoadImage( "data/graphics/particle0.png", &_Gfx.part[ 0 ] ); +- bLoad &= gfxLoadImage( "data/graphics/particle1.png", &_Gfx.part[ 1 ] ); +- bLoad &= gfxLoadImage( "data/graphics/particle2.png", &_Gfx.part[ 2 ] ); ++ bLoad &= gfxLoadImage( DATADIR "/graphics/element0.png", &_Gfx.elements[ 0 ] ); ++ bLoad &= gfxLoadImage( DATADIR "/graphics/element1.png", &_Gfx.elements[ 1 ] ); ++ bLoad &= gfxLoadImage( DATADIR "/graphics/element2.png", &_Gfx.elements[ 2 ] ); ++ bLoad &= gfxLoadImage( DATADIR "/graphics/element3.png", &_Gfx.elements[ 3 ] ); ++ bLoad &= gfxLoadImage( DATADIR "/graphics/elementB.png", &_Gfx.elements[ 4 ] ); + -+ bLoad |= gfxLoadImage( DATADIR "/graphics/movecount.png", &_Gfx.movecount ); -+ bLoad |= gfxLoadImage( DATADIR "/graphics/cursor0.png", &_Gfx.cursors[ 0 ] ); -+ bLoad |= gfxLoadImage( DATADIR "/graphics/cursor1.png", &_Gfx.cursors[ 1 ] ); -+ bLoad |= gfxLoadImage( DATADIR "/graphics/marker0.png", &_Gfx.markers[ 0 ] ); -+ bLoad |= gfxLoadImage( DATADIR "/graphics/marker1.png", &_Gfx.markers[ 1 ] ); ++ bLoad &= gfxLoadImage( DATADIR "/graphics/movecount.png", &_Gfx.movecount ); ++ bLoad &= gfxLoadImage( DATADIR "/graphics/keyboard.png", &_Gfx.keyboard ); ++ bLoad &= gfxLoadImage( DATADIR "/graphics/cursor0.png", &_Gfx.cursors[ 0 ] ); ++ bLoad &= gfxLoadImage( DATADIR "/graphics/cursor1.png", &_Gfx.cursors[ 1 ] ); ++ bLoad &= gfxLoadImage( DATADIR "/graphics/marker0.png", &_Gfx.markers[ 0 ] ); ++ bLoad &= gfxLoadImage( DATADIR "/graphics/marker1.png", &_Gfx.markers[ 1 ] ); + -+ bLoad |= gfxLoadImage( DATADIR "/graphics/particle0.png", &_Gfx.part[ 0 ] ); -+ bLoad |= gfxLoadImage( DATADIR "/graphics/particle1.png", &_Gfx.part[ 1 ] ); -+ bLoad |= gfxLoadImage( DATADIR "/graphics/particle2.png", &_Gfx.part[ 2 ] ); ++ bLoad &= gfxLoadImage( DATADIR "/graphics/particle0.png", &_Gfx.part[ 0 ] ); ++ bLoad &= gfxLoadImage( DATADIR "/graphics/particle1.png", &_Gfx.part[ 1 ] ); ++ bLoad &= gfxLoadImage( DATADIR "/graphics/particle2.png", &_Gfx.part[ 2 ] ); // Set alpha SDL_SetAlpha( _Gfx.window, SDL_SRCALPHA | SDL_RLEACCEL, cGfxWinBlending ); @@ -71,11 +71,9 @@ return bLoad; } -Index: biniax2/desktop/snd.c -=================================================================== ---- biniax2.orig/desktop/snd.c 2008-04-18 13:40:19.000000000 +0000 -+++ biniax2/desktop/snd.c 2008-04-18 13:40:20.000000000 +0000 -@@ -60,20 +60,20 @@ +--- biniax2.orig/desktop/snd.c ++++ biniax2/desktop/snd.c +@@ -63,20 +63,20 @@ Mix_VolumeMusic( MIX_MAX_VOLUME >> 1 ); @@ -108,12 +106,10 @@ + _Snd.music[ 6 ] = Mix_LoadMUS( DATADIR "/music/biniax_common06.it" ); + _Snd.music[ 7 ] = Mix_LoadMUS( DATADIR "/music/biniax_common07.it" ); - return BNX_TRUE; + return loaded; } -Index: biniax2/makefile -=================================================================== ---- biniax2.orig/makefile 2008-04-18 13:40:19.000000000 +0000 -+++ biniax2/makefile 2008-04-18 13:40:20.000000000 +0000 +--- biniax2.orig/makefile ++++ biniax2/makefile @@ -8,8 +8,9 @@ FILES=biniax.c hof.c desktop/cfg.c desktop/gfx.c desktop/snd.c desktop/inp.c desktop/sys.c INCLUDES=-I . -I desktop Modified: packages/trunk/biniax2/debian/patches/endianess.patch =================================================================== --- packages/trunk/biniax2/debian/patches/endianess.patch 2009-05-16 00:53:52 UTC (rev 9742) +++ packages/trunk/biniax2/debian/patches/endianess.patch 2009-05-16 01:03:20 UTC (rev 9743) @@ -1,10 +1,8 @@ # Copyright (C) 2008 by Miriam Ruiz <[email protected]> # Distributed under the same license as the game. See debian/copyright -Index: biniax2/biniax.c -=================================================================== ---- biniax2.orig/biniax.c 2008-04-18 13:40:20.000000000 +0000 -+++ biniax2/biniax.c 2008-04-18 13:44:57.000000000 +0000 +--- biniax2.orig/biniax.c ++++ biniax2/biniax.c @@ -61,8 +61,12 @@ #include <fcntl.h> #include <sys/stat.h> @@ -29,7 +27,7 @@ enterState = cStateMainMenu; } else -@@ -1219,6 +1227,157 @@ +@@ -1259,6 +1267,157 @@ #endif } @@ -187,7 +185,7 @@ BNX_BOOL saveGame( BNX_GAME *game ) { FILE *file; -@@ -1250,6 +1409,7 @@ +@@ -1378,6 +1537,7 @@ return BNX_TRUE; } @@ -195,15 +193,13 @@ BNX_BOOL loadHiScore( BNX_GAME *game ) { -@@ -1257,4 +1417,3 @@ +@@ -1385,4 +1545,3 @@ game->best[ cModeTurn ] = hofGet()->tactic[ 0 ].score; return BNX_TRUE; } - -Index: biniax2/hof.c -=================================================================== ---- biniax2.orig/hof.c 2008-04-18 13:40:20.000000000 +0000 -+++ biniax2/hof.c 2008-04-18 13:40:20.000000000 +0000 +--- biniax2.orig/hof.c ++++ biniax2/hof.c @@ -43,6 +43,9 @@ #include <sys/types.h> #endif @@ -211,10 +207,10 @@ +#include <errno.h> +#include <string.h> + - #define chCursor '_' - #define chSpace ' ' + #define chCursor '_' /* Cursor ON */ + #define chSpace ' ' /* Cursor OFF*/ -@@ -126,6 +129,117 @@ +@@ -151,6 +154,136 @@ #endif } @@ -224,13 +220,31 @@ + FILE *file = NULL; + int i; + uint16_t id, me, ml; ++ const char *filename = NULL; ++ char alt_filename[PATH_MAX+3]; + -+ file = fopen( hofFileName(), "rb" ); ++ file = fopen( (filename = hofFileName()), "rb" ); + ++ if ( file == (FILE *) NULL ) // Bug in previous version, see if data can be reached ++ { ++ char *ptr; ++ strncpy(alt_filename, filename, PATH_MAX); ++ ptr = strrchr(alt_filename, '/'); ++ if (ptr != NULL) ++ { ++ ptr++; ++ filename = alt_filename; ++ strcpy(ptr, "config"); ++ file = fopen( filename, "rb" ); ++ } ++ } ++ + if ( file == (FILE *) NULL ) ++ { + goto error; ++ } + -+ fprintf(stderr, "Loading Hall of Fame data from \"%s\"\n", hofFileName()); ++ fprintf(stderr, "Loading Hall of Fame data from \"%s\"\n", filename); + + errno = 0; + @@ -268,12 +282,12 @@ + +error: + if (errno) -+ fprintf(stderr, "Could not load Hall of Fame data from \"%s\": %s\n", hofFileName(), strerror(errno)); ++ fprintf(stderr, "Could not load Hall of Fame data from \"%s\": %s\n", filename, strerror(errno)); + else -+ fprintf(stderr, "Could not load Hall of Fame data from \"%s\"", hofFileName()); ++ fprintf(stderr, "Could not load Hall of Fame data from \"%s\"", filename); + + if (file) -+ fclose( file ); ++ fclose( file ); + + for ( i = 0; i < cHofEntries; ++i ) + { @@ -284,30 +298,31 @@ + Hof.tactic[ i ].score = (cHofEntries - i - 1) * cHofInitScore; + } + -+ return BNX_FALSE; ++ return BNX_FALSE; +} + +BNX_BOOL hofSave() +{ + FILE *file; + int i; ++ const char *filename = NULL; + -+ file = fopen( hofFileName(), "wb" ); ++ file = fopen( (filename=hofFileName()), "wb" ); + + if ( file == (FILE *) NULL ) + { + if (errno) -+ fprintf(stderr, "Could not save Hall of Fame data in \"%s\": %s\n", hofFileName(), strerror(errno)); ++ fprintf(stderr, "Could not save Hall of Fame data in \"%s\": %s\n", filename, strerror(errno)); + else -+ fprintf(stderr, "Could not save Hall of Fame data in \"%s\"\n", hofFileName()); ++ fprintf(stderr, "Could not save Hall of Fame data in \"%s\"\n", filename); + return BNX_FALSE; + } + -+ fprintf(stderr, "Saving Hall of Fame data in \"%s\"\n", hofFileName()); ++ fprintf(stderr, "Saving Hall of Fame data in \"%s\"\n", filename); + -+ PutInt16( 0xB2F1 , file ); -+ PutInt16( cHofNameLen , file ); -+ PutInt16( cHofEntries , file ); ++ PutInt16( 0xB2F1 , file ); ++ PutInt16( cHofNameLen , file ); ++ PutInt16( cHofEntries , file ); + + for ( i = 0; i < cHofEntries; ++i ) + { @@ -332,25 +347,16 @@ BNX_BOOL hofInit() { FILE *file; -@@ -141,7 +255,7 @@ - Hof.tactic[ i ].score = (cHofEntries - i) * cHofInitScore; - } - -- file = fopen( hofFileName(), "rb" ); -+ file = fopen( "hof.bnx2", "rb" ); - - if ( file == (FILE *) NULL ) - return BNX_FALSE; -@@ -157,7 +271,7 @@ - { +@@ -210,7 +343,7 @@ FILE *file; + int i, j; - file = fopen( hofFileName(), "wb" ); + file = fopen( "hof.bnx2", "wb" ); if ( file == (FILE *) NULL ) return BNX_FALSE; -@@ -168,6 +282,7 @@ +@@ -239,6 +372,7 @@ return BNX_TRUE; } @@ -358,10 +364,8 @@ BNX_BOOL hofEnter( BNX_GAME *game ) { -Index: biniax2/inc.h -=================================================================== ---- biniax2.orig/inc.h 2008-04-18 13:40:19.000000000 +0000 -+++ biniax2/inc.h 2008-04-18 13:40:20.000000000 +0000 +--- biniax2.orig/inc.h ++++ biniax2/inc.h @@ -68,5 +68,13 @@ #include "symbian/sys.h" #endif Modified: packages/trunk/biniax2/debian/patches/fixes.patch =================================================================== --- packages/trunk/biniax2/debian/patches/fixes.patch 2009-05-16 00:53:52 UTC (rev 9742) +++ packages/trunk/biniax2/debian/patches/fixes.patch 2009-05-16 01:03:20 UTC (rev 9743) @@ -1,10 +1,8 @@ # Copyright (C) 2008 by Miriam Ruiz <[email protected]> # Distributed under the same license as the game. See debian/copyright -Index: biniax2-0.0.20080409/biniax.c -=================================================================== ---- biniax2-0.0.20080409.orig/biniax.c 2008-05-19 14:32:53.000000000 +0000 -+++ biniax2-0.0.20080409/biniax.c 2008-05-19 15:03:38.000000000 +0000 +--- biniax2.orig/biniax.c ++++ biniax2/biniax.c @@ -51,6 +51,18 @@ #include "lev.h" #include "inc.h" @@ -50,10 +48,10 @@ + cfgSetMusic(BNX_FALSE); + /* return -4; */ + } - + /****************************************************************** - SHOW INITIAL WELCOME SCREEN -@@ -1161,11 +1187,66 @@ + SHOW INITIAL WELCOME SCREEN +@@ -1178,13 +1204,68 @@ GAME AND HISCORE SAVE / RESTORE ******************************************************************************/ @@ -61,12 +59,12 @@ +{ +#ifndef _WIN32 + char filename[PATH_MAX]; -+ char *home; ++ char *home; + struct passwd *passwd; + if (!getuid()) + { + fprintf(stderr, "No access to data files for root.\n"); -+ return BNX_FALSE; ++ return BNX_FALSE; + } else { + if ((home = getenv("XDG_DATA_HOME"))) + { /* See http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html */ @@ -76,7 +74,7 @@ + return BNX_FALSE; + } + snprintf(filename, sizeof(filename), "%s/biniax2", home); -+ mkdir(filename, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH); ++ mkdir(filename, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH); + } + else if ((home = getenv("HOME"))) + { @@ -105,37 +103,43 @@ + return BNX_FALSE; + } + } -+ strncat(filename, "/autosave", sizeof(filename)-1); -+ return filename; ++ strncat(filename, "/autosave", sizeof(filename)-1); ++ return filename; +#else -+ return "./autosave.bnx2"; ++ return "./autosave.bnx2"; +#endif +} + BNX_BOOL saveGame( BNX_GAME *game ) { FILE *file; + BNX_INT32 i; + BNX_INT32 j; -- file = fopen( "autosave.bnx2", "wb" ); +- file = fopen( sysGetFullFileName( csSaveGameName ), "wb" ); + file = fopen( saveFileName(), "wb" ); if ( file == (FILE *) NULL ) return BNX_FALSE; -@@ -1181,7 +1262,7 @@ - { - FILE *file; +@@ -1242,9 +1323,12 @@ + BNX_INT32 i; + BNX_INT32 j; -- file = fopen( "autosave.bnx2", "rb" ); +- if ( sysGetFileLen( sysGetFullFileName( csSaveGameName ) ) != cSaveFileSize ) ++ if ( sysGetFileLen( saveFileName() ) != cSaveFileSize ) ++ { ++ fprintf( stderr, "Wrong file size for Game Configuration (should be %d bytes)\n", cSaveFileSize ); + return BNX_FALSE; +- file = fopen( sysGetFullFileName( csSaveGameName ), "rb" ); ++ } + file = fopen( saveFileName(), "rb" ); - if ( file == (FILE *) NULL ) return BNX_FALSE; -Index: biniax2-0.0.20080409/desktop/cfg.c -=================================================================== ---- biniax2-0.0.20080409.orig/desktop/cfg.c 2008-05-19 14:32:53.000000000 +0000 -+++ biniax2-0.0.20080409/desktop/cfg.c 2008-05-19 15:03:30.000000000 +0000 -@@ -30,6 +30,17 @@ +--- biniax2.orig/desktop/cfg.c ++++ biniax2/desktop/cfg.c +@@ -30,13 +30,23 @@ + #include "inc.h" +#ifndef _WIN32 @@ -152,10 +156,17 @@ /****************************************************************************** FUNCTIONS -@@ -52,13 +63,63 @@ + ******************************************************************************/ + + #define _Cfg_Buffer 255 +-#define csConfigName "config.bnx2" + + struct BNX_SETUP + { +@@ -53,15 +63,64 @@ + FILE *f; char buffer[ _Cfg_Buffer ]; int nTemp; - +#ifndef _WIN32 + char filename[PATH_MAX]; + char *home; @@ -163,7 +174,7 @@ + if (!getuid()) + { + fprintf(stderr, "No access to config files for root.\n"); -+ return BNX_FALSE; ++ return BNX_FALSE; + } else { + if ((home = getenv("XDG_CONFIG_HOME"))) + { /* See http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html */ @@ -173,7 +184,7 @@ + return BNX_FALSE; + } + snprintf(filename, sizeof(filename), "%s/biniax2", home); -+ mkdir(filename, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH); ++ mkdir(filename, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH); + } + else if ((home = getenv("HOME"))) + { @@ -204,12 +215,13 @@ +#else + char filename[] = "./config.bnx2"; +#endif -+ + _Cfg.sound = BNX_TRUE; _Cfg.music = BNX_TRUE; _Cfg.fullscreen = BNX_FALSE; + _Cfg.touch = BNX_FALSE; -- f = fopen( "config.bnx2", "rt" ); +- f = fopen( sysGetFullFileName( csConfigName ), "rt" ); + f = fopen( filename, "rt" ); if ( f == 0 ) { @@ -217,7 +229,7 @@ return BNX_FALSE; } -@@ -76,6 +137,10 @@ +@@ -83,6 +142,10 @@ fclose( f ); @@ -228,53 +240,20 @@ return BNX_TRUE; } -@@ -84,12 +149,28 @@ - return _Cfg.sound; - } +--- biniax2.orig/desktop/cfg.h ++++ biniax2/desktop/cfg.h +@@ -49,4 +49,8 @@ + void cfgSetFullscreen( BNX_BOOL v ); + void cfgSetTouch( BNX_BOOL v ); -+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-0.0.20080409/desktop/cfg.h -=================================================================== ---- biniax2-0.0.20080409.orig/desktop/cfg.h 2008-05-19 14:32:53.000000000 +0000 -+++ biniax2-0.0.20080409/desktop/cfg.h 2008-05-19 14:32:59.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-0.0.20080409/hof.c -=================================================================== ---- biniax2-0.0.20080409.orig/hof.c 2008-05-19 14:32:53.000000000 +0000 -+++ biniax2-0.0.20080409/hof.c 2008-05-19 15:03:34.000000000 +0000 -@@ -31,6 +31,18 @@ +--- biniax2.orig/hof.c ++++ biniax2/hof.c +@@ -31,10 +31,21 @@ #include "inc.h" @@ -290,10 +269,14 @@ +#include <sys/types.h> +#endif + - #define chCursor '_' - #define chSpace ' ' + #define chCursor '_' /* Cursor ON */ + #define chSpace ' ' /* Cursor OFF*/ -@@ -82,6 +94,60 @@ +-#define csHOFName "hof.bnx2" /* File name */ + #define cHOFFileSize 504 /* File size */ + + BNX_HALL Hof; +@@ -85,6 +96,60 @@ } } @@ -301,12 +284,12 @@ +{ +#ifndef _WIN32 + char filename[PATH_MAX]; -+ char *home; ++ char *home; + struct passwd *passwd; + if (!getuid()) + { + fprintf(stderr, "No access to data files for root.\n"); -+ return BNX_FALSE; ++ return BNX_FALSE; + } else { + if ((home = getenv("XDG_DATA_HOME"))) + { /* See http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html */ @@ -316,7 +299,7 @@ + return BNX_FALSE; + } + snprintf(filename, sizeof(filename), "%s/biniax2", home); -+ mkdir(filename, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH); ++ mkdir(filename, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH); + } + else if ((home = getenv("HOME"))) + { @@ -354,28 +337,61 @@ BNX_BOOL hofInit() { -@@ -98,7 +164,7 @@ +@@ -94,18 +159,26 @@ + + for ( i = 0; i < cHofEntries; ++i ) + { +- strcpy( Hof.arcade[ i ].name, "JORDAN " ); ++ strcpy( Hof.arcade[ i ].name, "DEBIAN " ); + Hof.arcade[ i ].score = (cHofEntries - i) * cHofInitScore; + +- strcpy( Hof.tactic[ i ].name, "JORDAN " ); ++ strcpy( Hof.tactic[ i ].name, "DEBIAN " ); Hof.tactic[ i ].score = (cHofEntries - i) * cHofInitScore; } -- file = fopen( "hof.bnx2", "rb" ); +- if ( sysGetFileLen( sysGetFullFileName( csHOFName ) ) != cHOFFileSize ) ++ if ( sysGetFileLen( hofFileName() ) != cHOFFileSize ) ++ { ++ fprintf( stderr, "Wrong file size for Hall of Fame Configuration (should be %d bytes)\n", cHOFFileSize ); + return BNX_FALSE; +- file = fopen( sysGetFullFileName( csHOFName ), "rb" ); ++ } + file = fopen( hofFileName(), "rb" ); - if ( file == (FILE *) NULL ) ++ { ++ fprintf(stderr, "Error loading Hall of Fame data from \"%s\"\n", hofFileName()); return BNX_FALSE; -@@ -114,7 +180,7 @@ - { ++ } ++ ++ fprintf(stderr, "Loading Hall of Fame data from \"%s\"\n", hofFileName()); + + for ( i = 0; i < cHofEntries; ++i ) + { +@@ -137,7 +210,7 @@ FILE *file; + int i, j; -- file = fopen( "hof.bnx2", "wb" ); +- file = fopen( sysGetFullFileName( csHOFName ), "wb" ); + file = fopen( hofFileName(), "wb" ); if ( file == (FILE *) NULL ) return BNX_FALSE; -@@ -246,4 +312,4 @@ +@@ -292,4 +365,4 @@ BNX_HALL *hofGet() { return (BNX_HALL *) &Hof; -} \ No newline at end of file +} +--- biniax2.orig/game.h ++++ biniax2/game.h +@@ -37,8 +37,6 @@ + DEFINITIONS + ******************************************************************************/ + +-#define csSaveGameName "autosave.bnx2" +- + /****************************************************************************** + CONSTANTS + ******************************************************************************/ Modified: packages/trunk/biniax2/debian/patches/warnings.patch =================================================================== --- packages/trunk/biniax2/debian/patches/warnings.patch 2009-05-16 00:53:52 UTC (rev 9742) +++ packages/trunk/biniax2/debian/patches/warnings.patch 2009-05-16 01:03:20 UTC (rev 9743) @@ -1,11 +1,9 @@ # Copyright (C) 2008 by Miriam Ruiz <[email protected]> # Distributed under the same license as the game. See debian/copyright -Index: biniax2/desktop/inp.c -=================================================================== ---- biniax2.orig/desktop/inp.c 2008-04-18 13:43:10.000000000 +0000 -+++ biniax2/desktop/inp.c 2008-04-18 13:44:51.000000000 +0000 -@@ -118,6 +118,8 @@ +--- biniax2.orig/desktop/inp.c ++++ biniax2/desktop/inp.c +@@ -124,6 +124,8 @@ case SDLK_PAGEDOWN : _Inp.keyPageDown= BNX_TRUE; break; @@ -14,10 +12,8 @@ } if ( event.key.keysym.sym >= SDLK_a && event.key.keysym.sym <= SDLK_z ) { -Index: biniax2/desktop/gfx.c -=================================================================== ---- biniax2.orig/desktop/gfx.c 2008-04-18 13:43:10.000000000 +0000 -+++ biniax2/desktop/gfx.c 2008-04-18 13:44:51.000000000 +0000 +--- biniax2.orig/desktop/gfx.c ++++ biniax2/desktop/gfx.c @@ -194,7 +194,7 @@ pos.y = cGfxZeroY + game->player[ cPlayer1 ].y * cGfxPairPlusY; if ( pos.y <= cGfxZeroY ) @@ -54,10 +50,8 @@ if ( game->score[ cPlayer2 ] != prevScore[ cPlayer2 ] ) { gfxNewParticle( pos.x + (cGfxNextPlusX >> 1), pos.y ); -Index: biniax2/biniax.c -=================================================================== ---- biniax2.orig/biniax.c 2008-04-18 13:43:10.000000000 +0000 -+++ biniax2/biniax.c 2008-04-18 13:44:51.000000000 +0000 +--- biniax2.orig/biniax.c ++++ biniax2/biniax.c @@ -108,7 +108,6 @@ BNX_BOOL bquit = BNX_FALSE; BNX_INT16 enterState = cStateMainMenu; _______________________________________________ Pkg-games-commits mailing list [email protected] http://lists.alioth.debian.org/mailman/listinfo/pkg-games-commits

