mplane_t frustum[4];
-int c_brush_polys, c_alias_polys;
+int c_brush_polys, c_alias_polys, c_light_polys, c_nodes, c_leafs;
qboolean envmap; // true during envmap command capture
//cvar_t gl_cull = {"gl_cull","1"};
//cvar_t gl_affinemodels = {"gl_affinemodels","0"};
//cvar_t gl_polyblend = {"gl_polyblend","1"};
-//cvar_t gl_flashblend = {"gl_flashblend","0"};
cvar_t gl_playermip = {"gl_playermip","0"};
//cvar_t gl_nocolors = {"gl_nocolors","0"};
//cvar_t gl_keeptjunctions = {"gl_keeptjunctions","1"};
glDepthMask(1);
}
+int modeldlightbits[8];
+extern int r_dlightframecount;
+
/*
=================
R_DrawAliasModel
VectorCopy (currententity->origin, r_entorigin);
VectorSubtract (r_origin, r_entorigin, modelorg);
+ {
+ mleaf_t *leaf = Mod_PointInLeaf (currententity->origin, cl.worldmodel);
+ if (leaf->dlightframe == r_dlightframecount)
+ for (i = 0;i < 8;i++)
+ modeldlightbits[i] = leaf->dlightbits[i];
+ else
+ for (i = 0;i < 8;i++)
+ modeldlightbits[i] = 0;
+ }
+
// get lighting information
if (currententity->model->flags & EF_FULLBRIGHT || currententity->effects & EF_FULLBRIGHT)
{
// don't allow cheats in multiplayer
if (cl.maxclients > 1)
+ {
Cvar_Set ("r_fullbright", "0");
+ Cvar_Set ("r_ambient", "0");
+ }
R_AnimateLight ();
c_brush_polys = 0;
c_alias_polys = 0;
+ c_light_polys = 0;
+ c_nodes = 0;
+ c_leafs = 0;
}
r_refdef must be set before the first call
================
*/
+extern qboolean intimerefresh;
+extern qboolean skyisvisible;
+extern void R_Sky();
+extern void UploadLightmaps();
void R_RenderView (void)
{
// double currtime, temptime;
lighthalf = gl_lightmode.value;
FOG_framebegin();
+ skypolyclear();
+ wallpolyclear();
transpolyclear();
+ skyisvisible = false;
// if (r_speeds2.value)
// {
R_SetupGL ();
R_MarkLeaves (); // done here so we know if we're in water
R_DrawWorld (); // adds static entities to the list
- S_ExtraUpdate (); // don't let sound get messed up if going slow
- wallpolyclear();
+ if (!intimerefresh)
+ S_ExtraUpdate (); // don't let sound get messed up if going slow
R_DrawEntitiesOnList1 (); // BSP models
- wallpolyrender();
+
+ skypolyrender(); // fogged sky polys, affects depth
+ if (skyname[0] && skyisvisible && !fogenabled)
+ R_Sky(); // does not affect depth, draws over the sky polys
+
R_DrawEntitiesOnList2 (); // other models
// R_RenderDlights ();
R_DrawViewModel ();
R_DrawParticles ();
+
+ UploadLightmaps();
+ wallpolyrender();
transpolyrender();
FOG_frameend();