added a zquake/fuhquake cvar: r_drawflame.. r_drawflame 0 will hide torches, even if you have gl_part_flame 1. fps gain

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2052 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Lance 2006-03-05 04:46:10 +00:00
parent 1ed370ac4a
commit 2d44c7b2c9
2 changed files with 42 additions and 26 deletions

View file

@ -82,6 +82,8 @@ cvar_t localid = SCVAR("localid", "");
cvar_t cl_antibunch = SCVAR("cl_antibunch", "0"); cvar_t cl_antibunch = SCVAR("cl_antibunch", "0");
cvar_t r_drawflame = SCVAR("r_drawflame", "1");
static qboolean allowremotecmd = true; static qboolean allowremotecmd = true;
// //
@ -2605,6 +2607,8 @@ void CL_Init (void)
Cvar_Register (&cl_nolerp, "Item effects"); Cvar_Register (&cl_nolerp, "Item effects");
Cvar_Register (&r_drawflame, "Item effects");
Cvar_Register (&allow_download_csprogs, cl_controlgroup); Cvar_Register (&allow_download_csprogs, cl_controlgroup);
// //

View file

@ -8,7 +8,7 @@ of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details. See the GNU General Public License for more details.
@ -56,9 +56,9 @@ Call when removing an object from the world or moving it to another position
void R_RemoveEfrags (entity_t *ent) void R_RemoveEfrags (entity_t *ent)
{ {
efrag_t *ef, *old, *walk, **prev; efrag_t *ef, *old, *walk, **prev;
ef = ent->efrag; ef = ent->efrag;
while (ef) while (ef)
{ {
prev = &ef->leaf->efrags; prev = &ef->leaf->efrags;
@ -75,16 +75,16 @@ void R_RemoveEfrags (entity_t *ent)
else else
prev = &walk->leafnext; prev = &walk->leafnext;
} }
old = ef; old = ef;
ef = ef->entnext; ef = ef->entnext;
// put it on the free list // put it on the free list
old->entnext = cl.free_efrags; old->entnext = cl.free_efrags;
cl.free_efrags = old; cl.free_efrags = old;
} }
ent->efrag = NULL; ent->efrag = NULL;
} }
/* /*
@ -98,7 +98,7 @@ void R_Q1Q2BSP_SplitEntityOnNode (mnode_t *node)
mplane_t *splitplane; mplane_t *splitplane;
mleaf_t *leaf; mleaf_t *leaf;
int sides; int sides;
if (cl.worldmodel->fromgame == fg_quake2 || cl.worldmodel->fromgame == fg_quake3) if (cl.worldmodel->fromgame == fg_quake2 || cl.worldmodel->fromgame == fg_quake3)
{ {
if (node->contents & Q2CONTENTS_SOLID) if (node->contents & Q2CONTENTS_SOLID)
@ -113,7 +113,7 @@ void R_Q1Q2BSP_SplitEntityOnNode (mnode_t *node)
return; return;
} }
} }
// add an efrag if the node is a leaf // add an efrag if the node is a leaf
if ( node->contents < 0) if ( node->contents < 0)
@ -133,25 +133,25 @@ void R_Q1Q2BSP_SplitEntityOnNode (mnode_t *node)
cl.free_efrags = cl.free_efrags->entnext; cl.free_efrags = cl.free_efrags->entnext;
ef->entity = r_addent; ef->entity = r_addent;
// add the entity link // add the entity link
*lastlink = ef; *lastlink = ef;
lastlink = &ef->entnext; lastlink = &ef->entnext;
ef->entnext = NULL; ef->entnext = NULL;
// set the leaf links // set the leaf links
ef->leaf = leaf; ef->leaf = leaf;
ef->leafnext = leaf->efrags; ef->leafnext = leaf->efrags;
leaf->efrags = ef; leaf->efrags = ef;
return; return;
} }
// NODE_MIXED // NODE_MIXED
splitplane = node->plane; splitplane = node->plane;
sides = BOX_ON_PLANE_SIDE(r_emins, r_emaxs, splitplane); sides = BOX_ON_PLANE_SIDE(r_emins, r_emaxs, splitplane);
if (sides == 3) if (sides == 3)
{ {
// split on this plane // split on this plane
@ -159,11 +159,11 @@ void R_Q1Q2BSP_SplitEntityOnNode (mnode_t *node)
if (!r_pefragtopnode) if (!r_pefragtopnode)
r_pefragtopnode = node; r_pefragtopnode = node;
} }
// recurse down the contacted sides // recurse down the contacted sides
if (sides & 1) if (sides & 1)
R_Q1Q2BSP_SplitEntityOnNode (node->children[0]); R_Q1Q2BSP_SplitEntityOnNode (node->children[0]);
if (sides & 2) if (sides & 2)
R_Q1Q2BSP_SplitEntityOnNode (node->children[1]); R_Q1Q2BSP_SplitEntityOnNode (node->children[1]);
} }
@ -181,7 +181,7 @@ void R_Q1BSP_SplitEntityOnNode2 (mnode_t *node)
if (node->visframe != r_visframecount) if (node->visframe != r_visframecount)
return; return;
if (node->contents < 0) if (node->contents < 0)
{ {
if (node->contents != Q1CONTENTS_SOLID) if (node->contents != Q1CONTENTS_SOLID)
@ -189,17 +189,17 @@ void R_Q1BSP_SplitEntityOnNode2 (mnode_t *node)
// visible and not BSP clipped // visible and not BSP clipped
return; return;
} }
splitplane = node->plane; splitplane = node->plane;
sides = BOX_ON_PLANE_SIDE(r_emins, r_emaxs, splitplane); sides = BOX_ON_PLANE_SIDE(r_emins, r_emaxs, splitplane);
if (sides == 3) if (sides == 3)
{ {
// remember first splitter // remember first splitter
r_pefragtopnode = node; r_pefragtopnode = node;
return; return;
} }
// not split yet; recurse down the contacted side // not split yet; recurse down the contacted side
if (sides & 1) if (sides & 1)
R_Q1BSP_SplitEntityOnNode2 (node->children[0]); R_Q1BSP_SplitEntityOnNode2 (node->children[0]);
@ -217,7 +217,7 @@ void R_AddEfrags (entity_t *ent)
{ {
model_t *entmodel; model_t *entmodel;
int i; int i;
if (!ent->model) if (!ent->model)
return; return;
@ -225,10 +225,10 @@ void R_AddEfrags (entity_t *ent)
return; // never add the world return; // never add the world
r_addent = ent; r_addent = ent;
lastlink = &ent->efrag; lastlink = &ent->efrag;
r_pefragtopnode = NULL; r_pefragtopnode = NULL;
entmodel = ent->model; entmodel = ent->model;
for (i=0 ; i<3 ; i++) for (i=0 ; i<3 ; i++)
@ -258,12 +258,24 @@ void R_StoreEfrags (efrag_t **ppefrag)
efrag_t *pefrag; efrag_t *pefrag;
extern cvar_t gl_part_flame; extern cvar_t gl_part_flame;
extern cvar_t r_drawflame;
while ((pefrag = *ppefrag) != NULL) while ((pefrag = *ppefrag) != NULL)
{ {
pent = pefrag->entity; pent = pefrag->entity;
clmodel = pent->model; clmodel = pent->model;
//if ( (!strcmp(clmodel->name, "progs/flame.mdl")) || (!strcmp(clmodel->name, "progs/flame2.mdl")) && (r_drawflame.value == 0) && (gl_part_flame.value == 0) )
//if ( strcmp(clmodel->name, "progs/flame.mdl") || strcmp(clmodel->name, "progs/flame2.mdl") && (r_drawflame.value == 0) && (gl_part_flame.value == 0) )
//{
// break;
//}
if ( (strcmp(clmodel->name, "progs/flame.mdl")) || (strcmp(clmodel->name, "progs/flame2.mdl")) && (!r_drawflame.value) )
{
return;
}
// switch (clmodel->type) // switch (clmodel->type)
// { // {
// case mod_alias: // case mod_alias:
@ -294,8 +306,8 @@ void R_StoreEfrags (efrag_t **ppefrag)
ppefrag = &pefrag->leafnext; ppefrag = &pefrag->leafnext;
// break; // break;
// default: // default:
// Sys_Error ("R_StoreEfrags: Bad entity type %d\n", clmodel->type); // Con_Printf ("R_StoreEfrags: Bad entity type %d\n", clmodel->type);
// } // }
} }
} }