]> git.xonotic.org Git - xonotic/netradiant.git/commitdiff
retain _q3map2_version worldspawn tag when using -onlyents
authordivverent <divverent@61c419a2-8eb2-4b30-bcec-8cead039b335>
Tue, 10 Feb 2009 06:30:50 +0000 (06:30 +0000)
committerdivverent <divverent@61c419a2-8eb2-4b30-bcec-8cead039b335>
Tue, 10 Feb 2009 06:30:50 +0000 (06:30 +0000)
git-svn-id: svn://svn.icculus.org/netradiant/trunk@184 61c419a2-8eb2-4b30-bcec-8cead039b335

Makefile
tools/quake3/q3map2/bsp.c
tools/quake3/q3map2/q3map2.h

index c89da77733a70447cb7e96113bebf00b429e3565..19fbfafda9e78314a480bdbe0ec5de3e2f46e70d 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -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: \
index 9b695d02000e3af3390c1540b86e4d250f2960a1..b82eeec8c88bb05a681d80a7c347dc8125b894fb 100644 (file)
@@ -613,19 +613,35 @@ 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();
        LoadMapFile( name, qfalse );
        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();
index 8c97255490cad4036fd4fb45000d86d6c18d9455..2ff8e7130b4526b36dae3473a0382b880b4af6fa 100644 (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