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: \
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();
/* 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