retain _q3map2_version worldspawn tag when using -onlyents

git-svn-id: svn://svn.icculus.org/netradiant/trunk@184 61c419a2-8eb2-4b30-bcec-8cead039b335
This commit is contained in:
divverent 2009-02-10 06:30:50 +00:00
parent 93b1402964
commit 6e3846c8c3
3 changed files with 25 additions and 4 deletions

View File

@ -202,16 +202,18 @@ endif
endif
# VERSION!
RADIANT_VERSION = 1.5.0
RADIANT_VERSION = 1.5.0n
RADIANT_MAJOR_VERSION = 5
RADIANT_MINOR_VERSION = 0
Q3MAP_VERSION = 2.5.17n
SVN_VERSION := $(shell $(SVNVERSION) -n $(STDERR_TO_DEVNULL) | $(SED) 's/M$$//g; s/.*://g;')
ifneq ($(SVN_VERSION),)
RADIANT_VERSION := $(RADIANT_VERSION)-svn$(SVN_VERSION)
Q3MAP_VERSION := $(Q3MAP_VERSION)-svn$(SVN_VERSION)
endif
CPPFLAGS += -DRADIANT_VERSION="\"$(RADIANT_VERSION)\"" -DRADIANT_MAJOR_VERSION="\"$(RADIANT_MAJOR_VERSION)\"" -DRADIANT_MINOR_VERSION="\"$(RADIANT_MINOR_VERSION)\"" -DRADIANT_ABOUTMSG="\"$(RADIANT_ABOUTMSG)\""
CPPFLAGS += -DRADIANT_VERSION="\"$(RADIANT_VERSION)\"" -DRADIANT_MAJOR_VERSION="\"$(RADIANT_MAJOR_VERSION)\"" -DRADIANT_MINOR_VERSION="\"$(RADIANT_MINOR_VERSION)\"" -DRADIANT_ABOUTMSG="\"$(RADIANT_ABOUTMSG)\"" -DQ3MAP_VERSION="\"$(Q3MAP_VERSION)\""
.PHONY: all
all: \

View File

@ -613,13 +613,24 @@ this is probably broken unless teamed with a radiant version that preserves enti
void OnlyEnts( void )
{
char out[ 1024 ];
// TODO save and restore _q3map2_cmdline when doing this
char save_cmdline[1024], save_version[1024];
const char *p;
/* note it */
Sys_Printf( "--- OnlyEnts ---\n" );
sprintf( out, "%s.bsp", source );
LoadBSPFile( out );
ParseEntities();
p = ValueForKey(&entities[0], "_q3map2_cmdline");
strncpy(save_cmdline, p, sizeof(save_cmdline));
save_cmdline[sizeof(save_cmdline)-1] = 0;
p = ValueForKey(&entities[0], "_q3map2_version");
strncpy(save_version, p, sizeof(save_version));
save_version[sizeof(save_version)-1] = 0;
numEntities = 0;
LoadShaderInfo();
@ -627,6 +638,11 @@ void OnlyEnts( void )
SetModelNumbers();
SetLightStyles();
if(*save_cmdline)
SetKeyValue(&entities[0], "_q3map2_cmdline", save_cmdline);
if(*save_version)
SetKeyValue(&entities[0], "_q3map2_version", save_version);
numBSPEntities = numEntities;
UnparseEntities();

View File

@ -35,11 +35,14 @@ several games based on the Quake III Arena engine, in the form of "Q3Map2."
/* version */
#define Q3MAP_VERSION "2.5.17-div0"
#ifndef Q3MAP_VERSION
#error no Q3MAP_VERSION defined
#endif
#define Q3MAP_MOTD "Your map saw the pretty lights from q3map2's BFG"
/* -------------------------------------------------------------------------------
dependencies