From mquinson at alioth.debian.org Tue May 18 11:56:18 2010 From: mquinson at alioth.debian.org (Martin Quinson) Date: Tue, 18 May 2010 11:56:18 +0000 Subject: [Xbubble-commits] xbubble-sdl/src game.c,1.9,1.10 Message-ID: Update of /cvsroot/xbubble/xbubble-sdl/src In directory alioth:/tmp/cvs-serv25311 Modified Files: game.c Log Message: Fix a compilation issue by renaming the variable round Index: game.c =================================================================== RCS file: /cvsroot/xbubble/xbubble-sdl/src/game.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- game.c 23 Oct 2006 14:44:31 -0000 1.9 +++ game.c 18 May 2010 11:56:15 -0000 1.10 @@ -71,7 +71,7 @@ int handicap[2]; int board_best_eval[2]; int board_best_angle[2]; - int round; + int round_xb; int need_restart_thinking; int computer_thinking_time[2]; int board_x[2]; @@ -138,7 +138,7 @@ theme_t *theme, int scale, int *colors, - int round, + int round_xb, int *score, enum e_opponent_level level ) { @@ -149,7 +149,7 @@ game->state = game_state_playing; game->mode = mode; game->score = score; - game->round = round; + game->round_xb = round_xb; game->lastanimated = SDL_GetTicks(); for ( i = 0; i < 2; i++ ) { game->computer_state[i] = opponent_idle; @@ -407,12 +407,12 @@ switch ( game->mode ) { case game_mode_single: - sprintf( msg, _("Stage %d"), game->round ); + sprintf( msg, _("Stage %d"), game->round_xb ); game_msg_show( game, 0, msg ); break; case game_mode_two: case game_mode_vs_computer: - sprintf( msg, _("Round %d"), game->round ); + sprintf( msg, _("Round %d"), game->round_xb ); game_msg_show( game, 0, msg ); game_msg_show( game, 1, msg ); break; @@ -427,7 +427,7 @@ switch ( game->result ) { case game_result_player1_won: if ( game->mode == game_mode_single ) { - sprintf( msg, _("Stage %d cleared !"), game->round ); + sprintf( msg, _("Stage %d cleared !"), game->round_xb ); game_msg_show( game, 0, msg ); } else game_msg_show( game, 0, _("Win") ); From mquinson at alioth.debian.org Tue May 18 14:16:53 2010 From: mquinson at alioth.debian.org (Martin Quinson) Date: Tue, 18 May 2010 14:16:53 +0000 Subject: [Xbubble-commits] xbubble-sdl/src utils.c,1.2,1.3 Message-ID: Update of /cvsroot/xbubble/xbubble-sdl/src In directory alioth:/tmp/cvs-serv27280 Modified Files: utils.c Log Message: When launching the game from the source tree, search data locally Index: utils.c =================================================================== RCS file: /cvsroot/xbubble/xbubble-sdl/src/utils.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- utils.c 18 May 2010 11:58:17 -0000 1.2 +++ utils.c 18 May 2010 14:16:46 -0000 1.3 @@ -26,6 +26,8 @@ #include #include /* pathconf */ #include +#include /* access */ +#include #include "config.h" #include "utils.h" @@ -264,6 +266,20 @@ strncpy( buffer + offset, name, 126); } + if (access(buffer,R_OK) && errno == ENOENT) { + /* file not found. Try to get it locally so that it works even if not installed yet */ + static char buff[1024]; + sprintf(buff,"../data/%s%s%s%s",theme?"themes/":"",theme?theme:"",theme?"/":"",name); + if (!access(buff,R_OK)) { /* great, we found it locally */ + printf("Load %s locally as %s\n",name,buff); + + return buff; + } else { + printf("Cannot open %s either\n",buff); + } + } + //printf("Load %s as %s\n",name,buffer); + return buffer; } From mquinson at alioth.debian.org Tue May 18 14:17:55 2010 From: mquinson at alioth.debian.org (Martin Quinson) Date: Tue, 18 May 2010 14:17:55 +0000 Subject: [Xbubble-commits] xbubble-sdl/src Makefile.in,1.2,NONE Message-ID: Update of /cvsroot/xbubble/xbubble-sdl/src In directory alioth:/tmp/cvs-serv28542 Removed Files: Makefile.in Log Message: Kill generated files away from the cvs --- Makefile.in DELETED ---