aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--games/lianliankan/Makefile5
-rw-r--r--games/lianliankan/files/patch-src_main.c90
-rw-r--r--games/lianliankan/files/patch-src_pak_pak.c24
3 files changed, 112 insertions, 7 deletions
diff --git a/games/lianliankan/Makefile b/games/lianliankan/Makefile
index d08932e2e2a2..2c393e3fa5bd 100644
--- a/games/lianliankan/Makefile
+++ b/games/lianliankan/Makefile
@@ -16,6 +16,7 @@ MAINTAINER= liu_yinghong@yahoo.com.cn
COMMENT= A scarce recreation game
USE_GNOME= gtk20 esound
+USE_GETTEXT= yes
GNU_CONFIGURE= yes
USE_GMAKE= yes
USE_X_PREFIX= yes
@@ -25,10 +26,6 @@ CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include" \
.include <bsd.port.pre.mk>
-.if ${OSVERSION} < 500000
-BROKEN= does not compile
-.endif
-
post-install:
${MKDIR} ${PREFIX}/share/applications
${INSTALL_DATA} ${FILESDIR}/lianliankan.desktop ${PREFIX}/share/applications
diff --git a/games/lianliankan/files/patch-src_main.c b/games/lianliankan/files/patch-src_main.c
new file mode 100644
index 000000000000..547a80f70d65
--- /dev/null
+++ b/games/lianliankan/files/patch-src_main.c
@@ -0,0 +1,90 @@
+--- src/main.c.orig Wed Dec 7 05:15:14 2005
++++ src/main.c Thu May 25 00:52:58 2006
+@@ -727,9 +727,9 @@
+ /* get and set next card back, and get and set next background picture */
+ ui_pixbuf.cardback_choice = ui_pixbuf.cardback_choice>=5?0:ui_pixbuf.cardback_choice+1;
+ if(pak_info.back_num > 0){
++ gchar bgfilename[30];
+ ui_pixbuf.randomback_choice = ui_pixbuf.randomback_choice>pak_info.back_num-1?1:ui_pixbuf.randomback_choice+1;
+ /* Extract the bg picture and read it to ui_pixbuf.randomback */
+- gchar bgfilename[30];
+ sprintf(bgfilename,"back%d.jpg",ui_pixbuf.randomback_choice-1);
+ if(!ExtractSingleFile(bgfilename)){g_print(_("Failed to extract file:%s.\n"),bgfilename);}
+ sprintf(bgfilename,"/tmp/llk_back%d.jpg",ui_pixbuf.randomback_choice-1);
+@@ -1200,12 +1200,13 @@
+ struct passwd *user;
+ int result;
+ char path[MAX_PATH_LENGTH];
+- *message = (gchar *)g_malloc(sizeof(gchar)*100);
+ gchar *return_str;
+ GSList *radio_item_group=NULL;
+ GtkWidget *menu,*menuitem;
+ gint i;
+
++ *message = (gchar *)g_malloc(sizeof(gchar)*100);
++
+ /* load ini file,if it do not exist, make a new one */
+ user = getpwuid(getuid());
+ /*user home directory: user->pw_dir*/
+@@ -1352,9 +1353,9 @@
+ ui_pixbuf.mainback = gdk_pixbuf_new_from_file("/tmp/llk_mainback.jpg",NULL);
+ ui_pixbuf.cardback_choice = g_rand_int_range(ui_rand,0,6); /*begin to end-1*/
+ if(pak_info.back_num > 0){
++ gchar bgfilename[30];
+ ui_pixbuf.randomback_choice = g_rand_int_range(ui_rand,1,pak_info.back_num+1);
+ /* Extract the bg picture and read it to ui_pixbuf.randomback */
+- gchar bgfilename[30];
+ sprintf(bgfilename,"back%d.jpg",ui_pixbuf.randomback_choice-1);
+ if(!ExtractSingleFile(bgfilename)){g_print(_("Failed to extract file:%s.\n"),bgfilename);}
+ sprintf(bgfilename,"/tmp/llk_back%d.jpg",ui_pixbuf.randomback_choice-1);
+@@ -1474,9 +1475,9 @@
+ ui_pixbuf.mainback = gdk_pixbuf_new_from_file("/tmp/llk_mainback.jpg",NULL);
+ /* ui_pixbuf.cardback_choice = g_rand_int_range(ui_rand,0,6);*//*Do not change card back choice when change theme*/
+ if(pak_info.back_num > 0){
++ gchar bgfilename[30];
+ ui_pixbuf.randomback_choice = g_rand_int_range(ui_rand,1,pak_info.back_num+1);
+ /* Extract the bg picture and read it to ui_pixbuf.randomback */
+- gchar bgfilename[30];
+ sprintf(bgfilename,"back%d.jpg",ui_pixbuf.randomback_choice-1);
+ if(!ExtractSingleFile(bgfilename)){g_print(_("Failed to extract file:%s.\n"),bgfilename);}
+ sprintf(bgfilename,"/tmp/llk_back%d.jpg",ui_pixbuf.randomback_choice-1);
+@@ -1640,6 +1641,12 @@
+ gchar path[MAX_PATH_LENGTH];
+ struct ScoreItem *score_list=NULL,*score_item_end=NULL,*score_item_tmp;
+ gint item_num=0;
++
++ GtkWidget *dialog,*tree_view,*button;
++ GtkCellRenderer *renderer;
++ GtkListStore *store;
++ GtkTreeIter iter;
++
+ /* load ini file,if it do not exist, make a new one */
+ user = getpwuid(getuid());
+ /*user home directory: user->pw_dir*/
+@@ -1676,6 +1683,7 @@
+ if(!view) /* If not just view the score,then this function must be called by ui_game_over,so add the current player's score
+ into the list,and then write to file if the list is modified,and at last,show the score list on a new window */
+ {
++ time_t t;
+ gint insert_pos=1;
+ for(score_item_tmp = score_list;score_item_tmp!=NULL;score_item_tmp=score_item_tmp->next)
+ {
+@@ -1748,7 +1756,6 @@
+ break;
+ }
+ sprintf(score_item_tmp->level,"%d",algorithm_game.level);
+- time_t t;
+ time(&t);
+ sprintf(score_item_tmp->time,"%s",asctime(gmtime(&t)));
+ ui_input_string(score_item_tmp->name,score_item_tmp->nick,50);
+@@ -1775,10 +1782,6 @@
+ }
+ }
+ /* Create a new window to show scores. */
+- GtkWidget *dialog,*tree_view,*button;
+- GtkCellRenderer *renderer;
+- GtkListStore *store;
+- GtkTreeIter iter;
+ dialog = gtk_dialog_new();
+ gtk_window_set_title(GTK_WINDOW(dialog),_("Top 10 Heros"));
+ gtk_container_border_width(GTK_CONTAINER(dialog),5);
diff --git a/games/lianliankan/files/patch-src_pak_pak.c b/games/lianliankan/files/patch-src_pak_pak.c
index ad2491d4c86f..ef79dd622215 100644
--- a/games/lianliankan/files/patch-src_pak_pak.c
+++ b/games/lianliankan/files/patch-src_pak_pak.c
@@ -1,5 +1,5 @@
---- src/pak/pak.c.orig Mon Apr 3 21:41:15 2006
-+++ src/pak/pak.c Mon Apr 3 21:45:37 2006
+--- src/pak/pak.c.orig Sun Oct 23 04:36:59 2005
++++ src/pak/pak.c Thu May 25 00:54:16 2006
@@ -249,11 +249,7 @@
/* Set the position in the PAK file for this file to be written at */
@@ -26,7 +26,25 @@
fsetpos( ReadStream, &Pos );
/* Loop through the file by it's size and read from the PAK
-@@ -488,11 +480,7 @@
+@@ -453,6 +445,9 @@
+ fpos_t Pos; /* Offset in to file */
+ guchar Buffer = 0; /* A read buffer */
+ guint32 Count;
++
++ gchar tmpstr[40];
++
+ /* Declare a temporary file table node to work from */
+ struct sFileTableEntry* Current;
+
+@@ -476,7 +471,6 @@
+ if( !ReadStream )
+ return FALSE;
+ /* Attempt to open the write stream for creating the file */
+- gchar tmpstr[40];
+ sprintf(tmpstr,"/tmp/llk_%s",Current->szFileName);
+ WriteStream = fopen( tmpstr, "wb" );
+ if( !WriteStream )
+@@ -488,11 +482,7 @@
/* Set the offset in PAK to the beginning of this particular file
to be extracted */
/* If not GNU system,this should be Pos = Current->dwOffset */