From: David Griffith Date: Tue, 27 Mar 2018 10:51:08 +0000 (-0700) Subject: Change sfrotz over to using common/defines.h for version and build date info. X-Git-Url: https://scope-eye.net/git/?a=commitdiff_plain;h=988296aceba8dd739b0b96b8729d39c9dfaea3ad;p=liskon_frotz.git Change sfrotz over to using common/defines.h for version and build date info. --- diff --git a/Makefile b/Makefile index 973ed82..80ffb92 100644 --- a/Makefile +++ b/Makefile @@ -214,6 +214,8 @@ $(SRCDIR)/blorblib.a: $(BLORB_OBJECT) $(COMMON_DIR)/defines.h: @echo "Generating $@" @echo "#define VERSION \"$(VERSION)\"" > $@ + @echo "#define VERSION_MAJOR \"$(MAJOR)\"" >> $@ + @echo "#define VERSION_MINOR \"$(MINOR)\"" >> $@ @echo "#define BUILD_DATE_TIME \"$(BUILD_DATE_TIME)\"" >> $@ $(CURSES_DIR)/defines.h: diff --git a/src/sdl/sf_frotz.h b/src/sdl/sf_frotz.h index b6da1d4..dc404b5 100644 --- a/src/sdl/sf_frotz.h +++ b/src/sdl/sf_frotz.h @@ -4,10 +4,6 @@ #include "../common/frotz.h" #include "../blorb/blorb.h" -// version info -#define SFROTZ_MAJOR 0 -#define SFROTZ_MINOR 2 - // typedef unsigned char byte; // typedef unsigned short word; // typedef unsigned long ulong; diff --git a/src/sdl/sf_util.c b/src/sdl/sf_util.c index 86e8316..017129e 100644 --- a/src/sdl/sf_util.c +++ b/src/sdl/sf_util.c @@ -12,6 +12,7 @@ #include #endif +#include "../common/defines.h" #include "sf_frotz.h" f_setup_t f_setup; @@ -106,7 +107,7 @@ extern int option_scrollback_buffer; static char *info1 = "\n" - "SDL Frotz V%d.%02d build %s - interpreter for z-code games.\n" + "SDL Frotz V%s build %s - interpreter for z-code games.\n" "Complies with Standard 1.0; supports Blorb resources and Quetzal save files.\n" "Based on Frotz 2.40 by Stefan Jokisch and WindowsFrotz2000 by David Kinder.\n" "\n" @@ -138,17 +139,15 @@ static char *infos[] = { "-Z # error checking (see below)", NULL}; -static char *info2 = +static char *info2 = "\nError checking: 0 none, 1 first only (default), 2 all, 3 exit after any error.\n" "For more options and explanations, please read the HTML manual.\n"; -static char * getbuilddatetime( int tf); - #define WIDCOL 40 static void usage() { char **p = infos; int i=0,len=0; - printf(info1,SFROTZ_MAJOR,SFROTZ_MINOR,getbuilddatetime(1)); + printf(info1,VERSION,BUILD_DATE_TIME); while (*p) { if (i) @@ -971,24 +970,3 @@ static char * getexepath( char *buf){ #define _stat stat #endif -static char * getbuilddatetime( int tf){ - time_t t; struct tm *tm; - struct _stat sta; - static char buf[263]; - - getexepath(buf); - _stat(buf,&sta); - t = sta.st_mtime; - tm = localtime(&t); - buf[0] = 0; - sprintf(buf,"%04d%02d%02d", - tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday); - if (tf){ - strcat(buf,"."); - sprintf(buf+strlen(buf),"%02d%02d%02d", - tm->tm_hour, tm->tm_min, tm->tm_sec); - } - return buf; - } - - diff --git a/src/sdl/sf_video.c b/src/sdl/sf_video.c index 75f358e..dd7023b 100644 --- a/src/sdl/sf_video.c +++ b/src/sdl/sf_video.c @@ -9,6 +9,7 @@ #include "generic.h" +#include "../common/defines.h" #include "sf_frotz.h" static SDL_Rect blitrect = {0,0,0,0}; @@ -421,8 +422,8 @@ void sf_initvideo( int W, int H, int full) Uint32 initflags = SDL_INIT_VIDEO | SDL_INIT_NOPARACHUTE | SDL_INIT_TIMER | SDL_INIT_AUDIO; - sprintf(banner,"SDL Frotz v%d.%02d - %s (z%d)",SFROTZ_MAJOR,SFROTZ_MINOR, - stripped_story_name,h_version); + sprintf(banner,"SDL Frotz v%s - %s (z%d)",VERSION, + f_setup.story_name,h_version); desired_bpp = 32; video_flags = 0;