r858 - in trunk: . code/client

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Tue Aug 22 12:13:51 EDT 2006


Author: tjw
Date: 2006-08-22 12:13:51 -0400 (Tue, 22 Aug 2006)
New Revision: 858

Modified:
   trunk/Makefile
   trunk/code/client/cl_console.c
   trunk/code/client/client.h
Log:
* Add SVN version to the version string displayed in the client console
  if it can be detected


Modified: trunk/Makefile
===================================================================
--- trunk/Makefile	2006-08-21 19:36:16 UTC (rev 857)
+++ trunk/Makefile	2006-08-22 16:13:51 UTC (rev 858)
@@ -134,10 +134,15 @@
 VERSION=$(shell grep Q3_VERSION $(CMDIR)/q_shared.h | \
   sed -e 's/.*".* \([^ ]*\)"/\1/')
 
+USE_SVN=
 ifeq ($(wildcard .svn),.svn)
-  SVN_VERSION=$(VERSION)_SVN$(shell LANG=C svnversion .)
-else
-  SVN_VERSION=$(VERSION)
+  SVN_REV=$(shell LANG=C svnversion .)
+  ifneq ($(SVN_REV),)
+    SVN_VERSION=$(VERSION)_SVN$(SVN_REV)
+    USE_SVN=1
+  else
+    SVN_VERSION=$(VERSION)
+  endif
 endif
 
 
@@ -721,6 +726,10 @@
   endif
 endif
 
+ifneq ($(USE_SVN),)
+  BASE_CFLAGS += -DSVN_VERSION=\\\"$(SVN_VERSION)\\\"
+endif
+
 DO_CC=$(CC) $(NOTSHLIBCFLAGS) $(CFLAGS) -o $@ -c $<
 DO_SMP_CC=$(CC) $(NOTSHLIBCFLAGS) $(CFLAGS) -DSMP -o $@ -c $<
 DO_BOT_CC=$(CC) $(NOTSHLIBCFLAGS) $(CFLAGS) $(BOTCFLAGS) -DBOTLIB -o $@ -c $<   # $(SHLIBCFLAGS) # bk001212
@@ -1031,6 +1040,9 @@
 $(B)/client/cl_cgame.o : $(CDIR)/cl_cgame.c; $(DO_CC)
 $(B)/client/cl_cin.o : $(CDIR)/cl_cin.c; $(DO_CC)
 $(B)/client/cl_console.o : $(CDIR)/cl_console.c; $(DO_CC)
+ifneq ($(USE_SVN),)
+  $(B)/client/cl_console.o : .svn/entries
+endif
 $(B)/client/cl_input.o : $(CDIR)/cl_input.c; $(DO_CC)
 $(B)/client/cl_keys.o : $(CDIR)/cl_keys.c; $(DO_CC)
 $(B)/client/cl_main.o : $(CDIR)/cl_main.c; $(DO_CC)

Modified: trunk/code/client/cl_console.c
===================================================================
--- trunk/code/client/cl_console.c	2006-08-21 19:36:16 UTC (rev 857)
+++ trunk/code/client/cl_console.c	2006-08-22 16:13:51 UTC (rev 858)
@@ -619,13 +619,13 @@
 
 	re.SetColor( g_color_table[ColorIndex(COLOR_RED)] );
 
-	i = strlen( Q3_VERSION );
+	i = strlen( SVN_VERSION );
 
 	for (x=0 ; x<i ; x++) {
 
 		SCR_DrawSmallChar( cls.glconfig.vidWidth - ( i - x ) * SMALLCHAR_WIDTH, 
 
-			(lines-(SMALLCHAR_HEIGHT+SMALLCHAR_HEIGHT/2)), Q3_VERSION[x] );
+			(lines-(SMALLCHAR_HEIGHT+SMALLCHAR_HEIGHT/2)), SVN_VERSION[x] );
 
 	}
 

Modified: trunk/code/client/client.h
===================================================================
--- trunk/code/client/client.h	2006-08-21 19:36:16 UTC (rev 857)
+++ trunk/code/client/client.h	2006-08-22 16:13:51 UTC (rev 858)
@@ -35,6 +35,9 @@
 
 #define	RETRANSMIT_TIMEOUT	3000	// time between connection packet retransmits
 
+#ifndef SVN_VERSION
+  #define SVN_VERSION Q3_VERSION
+#endif
 
 // snapshots are a view of the server at a given time
 typedef struct {




More information about the quake3-commits mailing list