From ec88a5269f9cfeef1e28cc94f86c6cc4a870f22f Mon Sep 17 00:00:00 2001 From: terminx Date: Fri, 4 Mar 2011 18:47:06 +0000 Subject: [PATCH] Add the svn revision to the version string in Mapster32 git-svn-id: https://svn.eduke32.com/eduke32@1824 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/include/editor.h | 2 +- polymer/eduke32/build/src/build.c | 5 ++++- polymer/eduke32/source/astub.c | 23 +++++++++++++++-------- 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/polymer/eduke32/build/include/editor.h b/polymer/eduke32/build/include/editor.h index d81bac2be..e7cef41ef 100644 --- a/polymer/eduke32/build/include/editor.h +++ b/polymer/eduke32/build/include/editor.h @@ -11,7 +11,7 @@ extern "C" { #endif -#define VERSION " 2.0.0devel" +#define VERSION "2.0.0devel" // Build keys #define BK_MOVEFORWARD 0 diff --git a/polymer/eduke32/build/src/build.c b/polymer/eduke32/build/src/build.c index e57ddc185..40f003f72 100644 --- a/polymer/eduke32/build/src/build.c +++ b/polymer/eduke32/build/src/build.c @@ -25,6 +25,7 @@ static int32_t crctable[256]; static char kensig[64]; +extern const char *ExtGetVer(void); extern int32_t ExtInit(void); extern int32_t ExtPreInit(int32_t argc,const char **argv); extern void ExtUnInit(void); @@ -5728,7 +5729,8 @@ void clearmidstatbar16(void) static void clearministatbar16(void) { int32_t i, col = whitecol - 21; - static const char *tempbuf = "Mapster32" VERSION; +// static const char *tempbuf = "Mapster32" " " VERSION; + char tempbuf[16]; begindrawing(); @@ -5743,6 +5745,7 @@ static void clearministatbar16(void) CLEARLINES2D(i, ydim-i, 0); + Bsprintf(tempbuf, "Mapster32 %s", ExtGetVer()); printext16(xdim2d-(Bstrlen(tempbuf)<<3)-3, ydim2d-STATUS2DSIZ2+10, editorcolors[4],-1, tempbuf, 0); printext16(xdim2d-(Bstrlen(tempbuf)<<3)-2, ydim2d-STATUS2DSIZ2+9, editorcolors[12],-1, tempbuf, 0); diff --git a/polymer/eduke32/source/astub.c b/polymer/eduke32/source/astub.c index 23953d6d7..e391a8cab 100644 --- a/polymer/eduke32/source/astub.c +++ b/polymer/eduke32/source/astub.c @@ -46,6 +46,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "m32script.h" #include "m32def.h" +#include "rev.h" + #ifdef _WIN32 #define WIN32_LEAN_AND_MEAN #include @@ -54,8 +56,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include -#define BUILDDATE " 20100521" - static int32_t floor_over_floor; // static char *startwin_labeltext = "Starting Mapster32..."; @@ -585,6 +585,11 @@ static int32_t getfilenames(const char *path, const char *kind) return(0); } +const char *ExtGetVer(void) +{ + return s_buildRev; +} + void ExtLoadMap(const char *mapname) { int32_t i; @@ -2500,14 +2505,14 @@ static void ReadPaletteTable() // initprintf("success.\n"); }// end ReadPaletteTable -static void ReadGamePalette() +static void ReadGamePalette(void) { int32_t fp; if ((fp=kopen4load("palette.dat",0)) == -1) if ((fp=kopen4load("palette.dat",1)) == -1) { initprintf("!!! PALETTE.DAT NOT FOUND !!!\n"); - Bstrcpy(tempbuf, "Mapster32"VERSION BUILDDATE); + Bsprintf(tempbuf, "Mapster32 %s %s", VERSION, s_buildRev); wm_msgbox(tempbuf,"palette.dat not found"); exit(0); } @@ -7316,7 +7321,8 @@ static void G_ShowParameterHelp(void) #endif "\n-?, -help, --help\tDisplay this help message and exit" ; - wm_msgbox("Mapster32"VERSION BUILDDATE,"%s",s); + Bsprintf(tempbuf, "Mapster32 %s %s", VERSION, s_buildRev); + wm_msgbox(tempbuf, "%s", s); } static void AddGamePath(const char *buffer) @@ -7602,8 +7608,9 @@ int32_t ExtPreInit(int32_t argc,const char **argv) #endif OSD_SetLogFile("mapster32.log"); - OSD_SetVersion("Mapster32"VERSION,0,2); - initprintf("Mapster32"VERSION BUILDDATE"\n"); + OSD_SetVersion("Mapster32" " " VERSION,0,2); + initprintf("Mapster32 %s %s\n", VERSION, s_buildRev); + initprintf("Compiled %s\n", __DATE__" "__TIME__); // initprintf("Copyright (c) 2008 EDuke32 team\n"); G_CheckCommandLine(argc,argv); @@ -9189,7 +9196,7 @@ int32_t ExtInit(void) getmessageleng = 0; getmessagetimeoff = 0; - Bstrcpy(apptitle, "Mapster32"VERSION BUILDDATE); + Bsprintf(apptitle, "Mapster32 %s %s", VERSION, s_buildRev); autosavetimer = totalclock+120*autosave; #if defined(DUKEOSD)