[xiph-commits] r9678 - trunk/planarity
xiphmont at svn.xiph.org
xiphmont at svn.xiph.org
Sun Jul 31 00:51:41 PDT 2005
Author: xiphmont
Date: 2005-07-31 00:51:38 -0700 (Sun, 31 Jul 2005)
New Revision: 9678
Modified:
trunk/planarity/gamestate.c
trunk/planarity/gamestate.h
trunk/planarity/pause.c
trunk/planarity/version.h
Log:
Add versioning string to about box
Modified: trunk/planarity/gamestate.c
===================================================================
--- trunk/planarity/gamestate.c 2005-07-31 06:41:55 UTC (rev 9677)
+++ trunk/planarity/gamestate.c 2005-07-31 07:51:38 UTC (rev 9678)
@@ -8,6 +8,7 @@
#include "buttons.h"
#include "buttonbar.h"
#include "finish.h"
+#include "version.h"
Gameboard *gameboard;
@@ -23,6 +24,7 @@
static int paused=0;
static time_t begin_time_add=0;
static time_t begin_time;
+static char *version = "";
time_t get_elapsed(){
if(paused)
@@ -260,10 +262,30 @@
return "original-style";
}
+char *get_version_string(){
+ return version;
+}
+
int main(int argc, char *argv[]){
GtkWidget *window;
+
+ version=strstr(VERSION,"version.h");
+ if(version){
+ char *versionend=strchr(version,' ');
+ if(versionend)versionend=strchr(versionend+1,' ');
+ if(versionend)versionend=strchr(versionend+1,' ');
+ if(versionend)versionend=strchr(versionend+1,' ');
+ if(versionend){
+ int len=versionend-version-9;
+ version=strdup(version+10);
+ version[len-1]=0;
+ }
+ }else{
+ version="";
+ }
+
gtk_init (&argc, &argv);
-
+
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
g_signal_connect (G_OBJECT (window), "delete-event",
G_CALLBACK (gtk_main_quit), NULL);
Modified: trunk/planarity/gamestate.h
===================================================================
--- trunk/planarity/gamestate.h 2005-07-31 06:41:55 UTC (rev 9677)
+++ trunk/planarity/gamestate.h 2005-07-31 07:51:38 UTC (rev 9678)
@@ -24,3 +24,4 @@
extern void set_timer(time_t off);
extern int get_initial_intersections();
extern int get_raw_score();
+extern char *get_version_string();
Modified: trunk/planarity/pause.c
===================================================================
--- trunk/planarity/pause.c 2005-07-31 06:41:55 UTC (rev 9677)
+++ trunk/planarity/pause.c 2005-07-31 07:51:38 UTC (rev 9678)
@@ -280,6 +280,15 @@
render_text_centered(c,"Original game concept by Mary Radcliffe",w/2,y);y+=17;
+ y = h/2+ABOUTBOX_HEIGHT/2-SCOREHEIGHT/2;
+ cairo_select_font_face (c, "Arial",
+ CAIRO_FONT_SLANT_NORMAL,
+ CAIRO_FONT_WEIGHT_BOLD);
+
+ cairo_matrix_init_scale (&ma, 10.,11.);
+ cairo_set_font_matrix (c,&ma);
+ render_text_centered(c,get_version_string(), w/2,y);
+
}
cairo_destroy(c);
Modified: trunk/planarity/version.h
===================================================================
--- trunk/planarity/version.h 2005-07-31 06:41:55 UTC (rev 9677)
+++ trunk/planarity/version.h 2005-07-31 07:51:38 UTC (rev 9678)
@@ -1,2 +1,2 @@
#define VERSION "$Id$ "
-/* DO NOT EDIT: Automated versioning hack [Sun Jul 31 02:40:23 EDT 2005] */
+/* DO NOT EDIT: Automated versioning hack [Sun Jul 31 02:52:04 EDT 2005] */
More information about the commits
mailing list