From 0598fda2ce357a27a1645f075c86865526223ce1 Mon Sep 17 00:00:00 2001 From: sezero Date: Thu, 15 Sep 2011 07:51:11 +0000 Subject: [PATCH] gl_model.c: Added new external_ents cvar for Mod_LoadEntities() in parallel to the old QIP code. git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@484 af15c1b1-3010-417e-b628-4374ebc0bcbd --- quakespasm/Quake/gl_model.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/quakespasm/Quake/gl_model.c b/quakespasm/Quake/gl_model.c index d63486a9..c3181e2d 100644 --- a/quakespasm/Quake/gl_model.c +++ b/quakespasm/Quake/gl_model.c @@ -34,6 +34,8 @@ void Mod_LoadBrushModel (model_t *mod, void *buffer); void Mod_LoadAliasModel (model_t *mod, void *buffer); model_t *Mod_LoadModel (model_t *mod, qboolean crash); +cvar_t external_ents = {"external_ents", "1", true}; + byte mod_novis[MAX_MAP_LEAFS/8]; #define MAX_MOD_KNOWN 2048 //johnfitz -- was 512 @@ -50,6 +52,8 @@ Mod_Init */ void Mod_Init (void) { + Cvar_RegisterVariable (&external_ents, NULL); + memset (mod_novis, 0xff, sizeof(mod_novis)); //johnfitz -- create notexture miptex @@ -720,6 +724,9 @@ void Mod_LoadEntities (lump_t *l) int mark; unsigned int path_id; + if (! external_ents.value) + goto _load_embedded; + strcpy(entfilename, loadmodel->name); COM_StripExtension(entfilename, entfilename); strcat(entfilename, ".ent"); @@ -743,6 +750,7 @@ void Mod_LoadEntities (lump_t *l) } } +_load_embedded: if (!l->filelen) { loadmodel->entities = NULL;