mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-23 12:52:46 +00:00
cl.worldmodel is only remfereced once in the renderer (and that will be
going away shortly)
This commit is contained in:
parent
daca64ed04
commit
a41af75e56
18 changed files with 94 additions and 96 deletions
|
@ -225,7 +225,7 @@ loc0:
|
|||
}
|
||||
|
||||
// mark the polygons
|
||||
surf = cl.worldmodel->surfaces + node->firstsurface;
|
||||
surf = r_worldentity.model->surfaces + node->firstsurface;
|
||||
for (i = 0; i < node->numsurfaces; i++, surf++) {
|
||||
int s, t;
|
||||
float l, dist, dist2;
|
||||
|
@ -297,7 +297,7 @@ R_PushDlights (vec3_t entorigin)
|
|||
if (l->die < r_realtime || !l->radius)
|
||||
continue;
|
||||
VectorSubtract (l->origin, entorigin, lightorigin);
|
||||
R_MarkLights (lightorigin, l, 1 << i, cl.worldmodel->nodes);
|
||||
R_MarkLights (lightorigin, l, 1 << i, r_worldentity.model->nodes);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -356,7 +356,7 @@ RecursiveLightPoint (mnode_t *node, vec3_t start, vec3_t end)
|
|||
VectorCopy (mid, lightspot);
|
||||
lightplane = plane;
|
||||
|
||||
surf = cl.worldmodel->surfaces + node->firstsurface;
|
||||
surf = r_worldentity.model->surfaces + node->firstsurface;
|
||||
for (i = 0; i < node->numsurfaces; i++, surf++) {
|
||||
if (surf->flags & SURF_DRAWTILED)
|
||||
continue; // no lightmaps
|
||||
|
@ -412,14 +412,14 @@ R_LightPoint (vec3_t p)
|
|||
vec3_t end;
|
||||
int r;
|
||||
|
||||
if (!cl.worldmodel->lightdata)
|
||||
if (!r_worldentity.model->lightdata)
|
||||
return 255;
|
||||
|
||||
end[0] = p[0];
|
||||
end[1] = p[1];
|
||||
end[2] = p[2] - 2048;
|
||||
|
||||
r = RecursiveLightPoint (cl.worldmodel->nodes, p, end);
|
||||
r = RecursiveLightPoint (r_worldentity.model->nodes, p, end);
|
||||
|
||||
if (r == -1)
|
||||
r = 0;
|
||||
|
|
|
@ -937,7 +937,7 @@ R_SetupFrame (void)
|
|||
|
||||
// current viewleaf
|
||||
r_oldviewleaf = r_viewleaf;
|
||||
r_viewleaf = Mod_PointInLeaf (r_origin, cl.worldmodel);
|
||||
r_viewleaf = Mod_PointInLeaf (r_origin, r_worldentity.model);
|
||||
|
||||
V_SetContentsColor (r_viewleaf->contents);
|
||||
V_CalcBlend ();
|
||||
|
@ -1135,10 +1135,10 @@ R_Mirror (void)
|
|||
glLoadMatrixf (r_base_world_matrix);
|
||||
|
||||
glColor4f (1, 1, 1, r_mirroralpha->value);
|
||||
s = cl.worldmodel->textures[mirrortexturenum]->texturechain;
|
||||
s = r_worldentity.model->textures[mirrortexturenum]->texturechain;
|
||||
for (; s; s = s->texturechain)
|
||||
R_RenderBrushPoly (s);
|
||||
cl.worldmodel->textures[mirrortexturenum]->texturechain = NULL;
|
||||
r_worldentity.model->textures[mirrortexturenum]->texturechain = NULL;
|
||||
glColor4f (1, 1, 1, 1);
|
||||
}
|
||||
|
||||
|
@ -1154,7 +1154,7 @@ R_RenderView (void)
|
|||
if (r_norefresh->int_val)
|
||||
return;
|
||||
|
||||
if (!r_worldentity.model || !cl.worldmodel)
|
||||
if (!r_worldentity.model)
|
||||
Sys_Error ("R_RenderView: NULL worldmodel");
|
||||
|
||||
// glFinish ();
|
||||
|
|
|
@ -187,8 +187,8 @@ R_NewMap (void)
|
|||
r_worldentity.model = cl.worldmodel;
|
||||
|
||||
// clear out efrags in case the level hasn't been reloaded
|
||||
for (i = 0; i < cl.worldmodel->numleafs; i++)
|
||||
cl.worldmodel->leafs[i].efrags = NULL;
|
||||
for (i = 0; i < r_worldentity.model->numleafs; i++)
|
||||
r_worldentity.model->leafs[i].efrags = NULL;
|
||||
|
||||
r_viewleaf = NULL;
|
||||
R_ClearParticles ();
|
||||
|
@ -198,14 +198,14 @@ R_NewMap (void)
|
|||
// identify sky texture
|
||||
skytexturenum = -1;
|
||||
mirrortexturenum = -1;
|
||||
for (i = 0; i < cl.worldmodel->numtextures; i++) {
|
||||
if (!cl.worldmodel->textures[i])
|
||||
for (i = 0; i < r_worldentity.model->numtextures; i++) {
|
||||
if (!r_worldentity.model->textures[i])
|
||||
continue;
|
||||
if (!strncmp (cl.worldmodel->textures[i]->name, "sky", 3))
|
||||
if (!strncmp (r_worldentity.model->textures[i]->name, "sky", 3))
|
||||
skytexturenum = i;
|
||||
if (!strncmp (cl.worldmodel->textures[i]->name, "window02_1", 10))
|
||||
if (!strncmp (r_worldentity.model->textures[i]->name, "window02_1", 10))
|
||||
mirrortexturenum = i;
|
||||
cl.worldmodel->textures[i]->texturechain = NULL;
|
||||
r_worldentity.model->textures[i]->texturechain = NULL;
|
||||
}
|
||||
r_skyname = Cvar_FindVar ("r_skyname");
|
||||
if (r_skyname != NULL)
|
||||
|
|
|
@ -108,7 +108,7 @@ R_RecursiveLightUpdate (mnode_t *node)
|
|||
if (node->children[1]->contents >= 0)
|
||||
R_RecursiveLightUpdate (node->children[1]);
|
||||
if ((c = node->numsurfaces))
|
||||
for (surf = cl.worldmodel->surfaces + node->firstsurface; c;
|
||||
for (surf = r_worldentity.model->surfaces + node->firstsurface; c;
|
||||
c--, surf++) surf->cached_dlight = true;
|
||||
}
|
||||
|
||||
|
@ -117,9 +117,9 @@ R_RecursiveLightUpdate (mnode_t *node)
|
|||
void
|
||||
R_ForceLightUpdate (void)
|
||||
{
|
||||
if (cl.worldmodel && cl.worldmodel->nodes
|
||||
&& cl.worldmodel->nodes->contents >= 0)
|
||||
R_RecursiveLightUpdate (cl.worldmodel->nodes);
|
||||
if (r_worldentity.model && r_worldentity.model->nodes
|
||||
&& r_worldentity.model->nodes->contents >= 0)
|
||||
R_RecursiveLightUpdate (r_worldentity.model->nodes);
|
||||
}
|
||||
|
||||
|
||||
|
@ -239,7 +239,7 @@ R_BuildLightMap (msurface_t *surf, byte * dest, int stride)
|
|||
lightmap = surf->samples;
|
||||
|
||||
// set to full bright if no light data
|
||||
if (!cl.worldmodel->lightdata) {
|
||||
if (!r_worldentity.model->lightdata) {
|
||||
memset (&blocklights[0], 65280, 3 * size * sizeof(int));
|
||||
goto store;
|
||||
}
|
||||
|
@ -653,13 +653,13 @@ DrawTextureChains (void)
|
|||
|
||||
glDisable (GL_BLEND);
|
||||
|
||||
for (i = 0; i < cl.worldmodel->numtextures; i++) {
|
||||
if (!cl.worldmodel->textures[i])
|
||||
for (i = 0; i < r_worldentity.model->numtextures; i++) {
|
||||
if (!r_worldentity.model->textures[i])
|
||||
continue;
|
||||
for (s = cl.worldmodel->textures[i]->texturechain; s;
|
||||
for (s = r_worldentity.model->textures[i]->texturechain; s;
|
||||
s = s->texturechain) R_RenderBrushPoly (s);
|
||||
|
||||
cl.worldmodel->textures[i]->texturechain = NULL;
|
||||
r_worldentity.model->textures[i]->texturechain = NULL;
|
||||
}
|
||||
|
||||
glEnable (GL_BLEND);
|
||||
|
@ -848,7 +848,7 @@ R_RecursiveWorldNode (mnode_t *node)
|
|||
|
||||
// draw stuff
|
||||
if ((c = node->numsurfaces)) {
|
||||
surf = cl.worldmodel->surfaces + node->firstsurface;
|
||||
surf = r_worldentity.model->surfaces + node->firstsurface;
|
||||
|
||||
if (dot < -BACKFACE_EPSILON)
|
||||
side = SURF_PLANEBACK;
|
||||
|
@ -894,7 +894,7 @@ R_DrawWorld (void)
|
|||
entity_t ent;
|
||||
|
||||
memset (&ent, 0, sizeof (ent));
|
||||
ent.model = cl.worldmodel;
|
||||
ent.model = r_worldentity.model;
|
||||
|
||||
VectorCopy (r_refdef.vieworg, modelorg);
|
||||
|
||||
|
@ -909,7 +909,7 @@ R_DrawWorld (void)
|
|||
R_DrawSky ();
|
||||
}
|
||||
|
||||
R_RecursiveWorldNode (cl.worldmodel->nodes);
|
||||
R_RecursiveWorldNode (r_worldentity.model->nodes);
|
||||
|
||||
DrawTextureChains ();
|
||||
|
||||
|
@ -940,13 +940,13 @@ R_MarkLeaves (void)
|
|||
|
||||
if (r_novis->int_val) {
|
||||
vis = solid;
|
||||
memset (solid, 0xff, (cl.worldmodel->numleafs + 7) >> 3);
|
||||
memset (solid, 0xff, (r_worldentity.model->numleafs + 7) >> 3);
|
||||
} else
|
||||
vis = Mod_LeafPVS (r_viewleaf, cl.worldmodel);
|
||||
vis = Mod_LeafPVS (r_viewleaf, r_worldentity.model);
|
||||
|
||||
for (i = 0; i < cl.worldmodel->numleafs; i++) {
|
||||
for (i = 0; i < r_worldentity.model->numleafs; i++) {
|
||||
if (vis[i >> 3] & (1 << (i & 7))) {
|
||||
node = (mnode_t *) &cl.worldmodel->leafs[i + 1];
|
||||
node = (mnode_t *) &r_worldentity.model->leafs[i + 1];
|
||||
do {
|
||||
if (node->visframe == r_visframecount)
|
||||
break;
|
||||
|
|
|
@ -35,7 +35,6 @@
|
|||
#include "QF/console.h"
|
||||
#include "QF/sys.h"
|
||||
|
||||
#include "client.h"
|
||||
#include "r_local.h"
|
||||
#include "QF/render.h"
|
||||
|
||||
|
@ -501,7 +500,7 @@ R_RecursiveWorldNode (mnode_t *node, int clipflags)
|
|||
c = node->numsurfaces;
|
||||
|
||||
if (c) {
|
||||
surf = cl.worldmodel->surfaces + node->firstsurface;
|
||||
surf = r_worldentity.model->surfaces + node->firstsurface;
|
||||
|
||||
if (dot < -BACKFACE_EPSILON) {
|
||||
do {
|
||||
|
|
|
@ -85,7 +85,7 @@ R_MarkLights (vec3_t lightorigin, dlight_t *light, int bit, mnode_t *node)
|
|||
return;
|
||||
}
|
||||
// mark the polygons
|
||||
surf = cl.worldmodel->surfaces + node->firstsurface;
|
||||
surf = r_worldentity.model->surfaces + node->firstsurface;
|
||||
for (i = 0; i < node->numsurfaces; i++, surf++) {
|
||||
if (surf->dlightframe != r_dlightframecount) {
|
||||
surf->dlightbits = 0;
|
||||
|
@ -114,7 +114,7 @@ R_PushDlights (vec3_t entorigin)
|
|||
if (l->die < r_realtime || !l->radius)
|
||||
continue;
|
||||
VectorSubtract (l->origin, entorigin, lightorigin);
|
||||
R_MarkLights (lightorigin, l, 1 << i, cl.worldmodel->nodes);
|
||||
R_MarkLights (lightorigin, l, 1 << i, r_worldentity.model->nodes);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -167,7 +167,7 @@ RecursiveLightPoint (mnode_t *node, vec3_t start, vec3_t end)
|
|||
return -1; // didn't hit anything
|
||||
|
||||
// check for impact on this node
|
||||
surf = cl.worldmodel->surfaces + node->firstsurface;
|
||||
surf = r_worldentity.model->surfaces + node->firstsurface;
|
||||
for (i = 0; i < node->numsurfaces; i++, surf++) {
|
||||
if (surf->flags & SURF_DRAWTILED)
|
||||
continue; // no lightmaps
|
||||
|
@ -223,14 +223,14 @@ R_LightPoint (vec3_t p)
|
|||
vec3_t end;
|
||||
int r;
|
||||
|
||||
if (!cl.worldmodel->lightdata)
|
||||
if (!r_worldentity.model->lightdata)
|
||||
return 255;
|
||||
|
||||
end[0] = p[0];
|
||||
end[1] = p[1];
|
||||
end[2] = p[2] - 2048;
|
||||
|
||||
r = RecursiveLightPoint (cl.worldmodel->nodes, p, end);
|
||||
r = RecursiveLightPoint (r_worldentity.model->nodes, p, end);
|
||||
|
||||
if (r == -1)
|
||||
r = 0;
|
||||
|
|
|
@ -192,8 +192,8 @@ R_NewMap (void)
|
|||
|
||||
// clear out efrags in case the level hasn't been reloaded
|
||||
// FIXME: is this one short?
|
||||
for (i = 0; i < cl.worldmodel->numleafs; i++)
|
||||
cl.worldmodel->leafs[i].efrags = NULL;
|
||||
for (i = 0; i < r_worldentity.model->numleafs; i++)
|
||||
r_worldentity.model->leafs[i].efrags = NULL;
|
||||
|
||||
r_viewleaf = NULL;
|
||||
R_ClearParticles ();
|
||||
|
@ -438,11 +438,11 @@ R_MarkLeaves (void)
|
|||
r_visframecount++;
|
||||
r_oldviewleaf = r_viewleaf;
|
||||
|
||||
vis = Mod_LeafPVS (r_viewleaf, cl.worldmodel);
|
||||
vis = Mod_LeafPVS (r_viewleaf, r_worldentity.model);
|
||||
|
||||
for (i = 0; i < cl.worldmodel->numleafs; i++) {
|
||||
for (i = 0; i < r_worldentity.model->numleafs; i++) {
|
||||
if (vis[i >> 3] & (1 << (i & 7))) {
|
||||
node = (mnode_t *) &cl.worldmodel->leafs[i + 1];
|
||||
node = (mnode_t *) &r_worldentity.model->leafs[i + 1];
|
||||
do {
|
||||
if (node->visframe == r_visframecount)
|
||||
break;
|
||||
|
@ -751,7 +751,7 @@ R_DrawBEntitiesOnList (void)
|
|||
r_emaxs[j] = minmaxs[3 + j];
|
||||
}
|
||||
|
||||
R_SplitEntityOnNode2 (cl.worldmodel->nodes);
|
||||
R_SplitEntityOnNode2 (r_worldentity.model->nodes);
|
||||
|
||||
if (r_pefragtopnode) {
|
||||
currententity->topnode = r_pefragtopnode;
|
||||
|
@ -883,7 +883,7 @@ R_RenderView_ (void)
|
|||
// done in screen.c
|
||||
Sys_LowFPPrecision ();
|
||||
|
||||
if (!r_worldentity.model || !cl.worldmodel)
|
||||
if (!r_worldentity.model)
|
||||
Sys_Error ("R_RenderView: NULL worldmodel");
|
||||
|
||||
if (!r_dspeeds->int_val) {
|
||||
|
|
|
@ -470,7 +470,7 @@ R_SetupFrame (void)
|
|||
|
||||
// current viewleaf
|
||||
r_oldviewleaf = r_viewleaf;
|
||||
r_viewleaf = Mod_PointInLeaf (r_origin, cl.worldmodel);
|
||||
r_viewleaf = Mod_PointInLeaf (r_origin, r_worldentity.model);
|
||||
|
||||
r_dowarpold = r_dowarp;
|
||||
r_dowarp = r_waterwarp->int_val && (r_viewleaf->contents <= CONTENTS_WATER);
|
||||
|
|
|
@ -147,7 +147,7 @@ R_BuildLightMap (void)
|
|||
size = smax * tmax;
|
||||
lightmap = surf->samples;
|
||||
|
||||
if (!cl.worldmodel->lightdata) {
|
||||
if (!r_worldentity.model->lightdata) {
|
||||
for (i = 0; i < size; i++)
|
||||
blocklights[i] = 0;
|
||||
return;
|
||||
|
|
|
@ -225,7 +225,7 @@ loc0:
|
|||
}
|
||||
|
||||
// mark the polygons
|
||||
surf = cl.worldmodel->surfaces + node->firstsurface;
|
||||
surf = r_worldentity.model->surfaces + node->firstsurface;
|
||||
for (i = 0; i < node->numsurfaces; i++, surf++) {
|
||||
int s, t;
|
||||
float l, dist, dist2;
|
||||
|
@ -297,7 +297,7 @@ R_PushDlights (vec3_t entorigin)
|
|||
if (l->die < r_realtime || !l->radius)
|
||||
continue;
|
||||
VectorSubtract (l->origin, entorigin, lightorigin);
|
||||
R_MarkLights (lightorigin, l, 1 << i, cl.worldmodel->nodes);
|
||||
R_MarkLights (lightorigin, l, 1 << i, r_worldentity.model->nodes);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -356,7 +356,7 @@ RecursiveLightPoint (mnode_t *node, vec3_t start, vec3_t end)
|
|||
VectorCopy (mid, lightspot);
|
||||
lightplane = plane;
|
||||
|
||||
surf = cl.worldmodel->surfaces + node->firstsurface;
|
||||
surf = r_worldentity.model->surfaces + node->firstsurface;
|
||||
for (i = 0; i < node->numsurfaces; i++, surf++) {
|
||||
if (surf->flags & SURF_DRAWTILED)
|
||||
continue; // no lightmaps
|
||||
|
@ -412,14 +412,14 @@ R_LightPoint (vec3_t p)
|
|||
vec3_t end;
|
||||
int r;
|
||||
|
||||
if (!cl.worldmodel->lightdata)
|
||||
if (!r_worldentity.model->lightdata)
|
||||
return 255;
|
||||
|
||||
end[0] = p[0];
|
||||
end[1] = p[1];
|
||||
end[2] = p[2] - 2048;
|
||||
|
||||
r = RecursiveLightPoint (cl.worldmodel->nodes, p, end);
|
||||
r = RecursiveLightPoint (r_worldentity.model->nodes, p, end);
|
||||
|
||||
if (r == -1)
|
||||
r = 0;
|
||||
|
|
|
@ -952,7 +952,7 @@ R_SetupFrame (void)
|
|||
|
||||
// current viewleaf
|
||||
r_oldviewleaf = r_viewleaf;
|
||||
r_viewleaf = Mod_PointInLeaf (r_origin, cl.worldmodel);
|
||||
r_viewleaf = Mod_PointInLeaf (r_origin, r_worldentity.model);
|
||||
|
||||
V_SetContentsColor (r_viewleaf->contents);
|
||||
V_CalcBlend ();
|
||||
|
@ -1135,10 +1135,10 @@ R_Mirror (void)
|
|||
glLoadMatrixf (r_base_world_matrix);
|
||||
|
||||
glColor4f (1, 1, 1, r_mirroralpha->value);
|
||||
s = cl.worldmodel->textures[mirrortexturenum]->texturechain;
|
||||
s = r_worldentity.model->textures[mirrortexturenum]->texturechain;
|
||||
for (; s; s = s->texturechain)
|
||||
R_RenderBrushPoly (s);
|
||||
cl.worldmodel->textures[mirrortexturenum]->texturechain = NULL;
|
||||
r_worldentity.model->textures[mirrortexturenum]->texturechain = NULL;
|
||||
glColor4f (1, 1, 1, 1);
|
||||
#endif
|
||||
}
|
||||
|
@ -1155,7 +1155,7 @@ R_RenderView (void)
|
|||
if (r_norefresh->int_val)
|
||||
return;
|
||||
|
||||
if (!r_worldentity.model || !cl.worldmodel)
|
||||
if (!r_worldentity.model)
|
||||
Sys_Error ("R_RenderView: NULL worldmodel");
|
||||
|
||||
// glFinish ();
|
||||
|
|
|
@ -187,8 +187,8 @@ R_NewMap (void)
|
|||
r_worldentity.model = cl.worldmodel;
|
||||
|
||||
// clear out efrags in case the level hasn't been reloaded
|
||||
for (i = 0; i < cl.worldmodel->numleafs; i++)
|
||||
cl.worldmodel->leafs[i].efrags = NULL;
|
||||
for (i = 0; i < r_worldentity.model->numleafs; i++)
|
||||
r_worldentity.model->leafs[i].efrags = NULL;
|
||||
|
||||
r_viewleaf = NULL;
|
||||
R_ClearParticles ();
|
||||
|
@ -198,14 +198,14 @@ R_NewMap (void)
|
|||
// identify sky texture
|
||||
skytexturenum = -1;
|
||||
mirrortexturenum = -1;
|
||||
for (i = 0; i < cl.worldmodel->numtextures; i++) {
|
||||
if (!cl.worldmodel->textures[i])
|
||||
for (i = 0; i < r_worldentity.model->numtextures; i++) {
|
||||
if (!r_worldentity.model->textures[i])
|
||||
continue;
|
||||
if (!strncmp (cl.worldmodel->textures[i]->name, "sky", 3))
|
||||
if (!strncmp (r_worldentity.model->textures[i]->name, "sky", 3))
|
||||
skytexturenum = i;
|
||||
if (!strncmp (cl.worldmodel->textures[i]->name, "window02_1", 10))
|
||||
if (!strncmp (r_worldentity.model->textures[i]->name, "window02_1", 10))
|
||||
mirrortexturenum = i;
|
||||
cl.worldmodel->textures[i]->texturechain = NULL;
|
||||
r_worldentity.model->textures[i]->texturechain = NULL;
|
||||
}
|
||||
r_skyname = Cvar_FindVar ("r_skyname");
|
||||
if (r_skyname != NULL)
|
||||
|
|
|
@ -108,7 +108,7 @@ R_RecursiveLightUpdate (mnode_t *node)
|
|||
if (node->children[1]->contents >= 0)
|
||||
R_RecursiveLightUpdate (node->children[1]);
|
||||
if ((c = node->numsurfaces))
|
||||
for (surf = cl.worldmodel->surfaces + node->firstsurface; c;
|
||||
for (surf = r_worldentity.model->surfaces + node->firstsurface; c;
|
||||
c--, surf++) surf->cached_dlight = true;
|
||||
}
|
||||
|
||||
|
@ -117,9 +117,9 @@ R_RecursiveLightUpdate (mnode_t *node)
|
|||
void
|
||||
R_ForceLightUpdate (void)
|
||||
{
|
||||
if (cl.worldmodel && cl.worldmodel->nodes
|
||||
&& cl.worldmodel->nodes->contents >= 0)
|
||||
R_RecursiveLightUpdate (cl.worldmodel->nodes);
|
||||
if (r_worldentity.model && r_worldentity.model->nodes
|
||||
&& r_worldentity.model->nodes->contents >= 0)
|
||||
R_RecursiveLightUpdate (r_worldentity.model->nodes);
|
||||
}
|
||||
|
||||
|
||||
|
@ -239,7 +239,7 @@ R_BuildLightMap (msurface_t *surf, byte * dest, int stride)
|
|||
lightmap = surf->samples;
|
||||
|
||||
// set to full bright if no light data
|
||||
if (!cl.worldmodel->lightdata) {
|
||||
if (!r_worldentity.model->lightdata) {
|
||||
memset (&blocklights[0], 65280, 3 * size * sizeof(int));
|
||||
goto store;
|
||||
}
|
||||
|
@ -653,13 +653,13 @@ DrawTextureChains (void)
|
|||
|
||||
glDisable (GL_BLEND);
|
||||
|
||||
for (i = 0; i < cl.worldmodel->numtextures; i++) {
|
||||
if (!cl.worldmodel->textures[i])
|
||||
for (i = 0; i < r_worldentity.model->numtextures; i++) {
|
||||
if (!r_worldentity.model->textures[i])
|
||||
continue;
|
||||
for (s = cl.worldmodel->textures[i]->texturechain; s;
|
||||
for (s = r_worldentity.model->textures[i]->texturechain; s;
|
||||
s = s->texturechain) R_RenderBrushPoly (s);
|
||||
|
||||
cl.worldmodel->textures[i]->texturechain = NULL;
|
||||
r_worldentity.model->textures[i]->texturechain = NULL;
|
||||
}
|
||||
|
||||
glEnable (GL_BLEND);
|
||||
|
@ -848,7 +848,7 @@ R_RecursiveWorldNode (mnode_t *node)
|
|||
|
||||
// draw stuff
|
||||
if ((c = node->numsurfaces)) {
|
||||
surf = cl.worldmodel->surfaces + node->firstsurface;
|
||||
surf = r_worldentity.model->surfaces + node->firstsurface;
|
||||
|
||||
if (dot < -BACKFACE_EPSILON)
|
||||
side = SURF_PLANEBACK;
|
||||
|
@ -894,7 +894,7 @@ R_DrawWorld (void)
|
|||
entity_t ent;
|
||||
|
||||
memset (&ent, 0, sizeof (ent));
|
||||
ent.model = cl.worldmodel;
|
||||
ent.model = r_worldentity.model;
|
||||
|
||||
VectorCopy (r_refdef.vieworg, modelorg);
|
||||
|
||||
|
@ -909,7 +909,7 @@ R_DrawWorld (void)
|
|||
R_DrawSky ();
|
||||
}
|
||||
|
||||
R_RecursiveWorldNode (cl.worldmodel->nodes);
|
||||
R_RecursiveWorldNode (r_worldentity.model->nodes);
|
||||
|
||||
DrawTextureChains ();
|
||||
|
||||
|
@ -940,13 +940,13 @@ R_MarkLeaves (void)
|
|||
|
||||
if (r_novis->int_val) {
|
||||
vis = solid;
|
||||
memset (solid, 0xff, (cl.worldmodel->numleafs + 7) >> 3);
|
||||
memset (solid, 0xff, (r_worldentity.model->numleafs + 7) >> 3);
|
||||
} else
|
||||
vis = Mod_LeafPVS (r_viewleaf, cl.worldmodel);
|
||||
vis = Mod_LeafPVS (r_viewleaf, r_worldentity.model);
|
||||
|
||||
for (i = 0; i < cl.worldmodel->numleafs; i++) {
|
||||
for (i = 0; i < r_worldentity.model->numleafs; i++) {
|
||||
if (vis[i >> 3] & (1 << (i & 7))) {
|
||||
node = (mnode_t *) &cl.worldmodel->leafs[i + 1];
|
||||
node = (mnode_t *) &r_worldentity.model->leafs[i + 1];
|
||||
do {
|
||||
if (node->visframe == r_visframecount)
|
||||
break;
|
||||
|
|
|
@ -35,7 +35,6 @@
|
|||
#include "QF/console.h"
|
||||
#include "QF/sys.h"
|
||||
|
||||
#include "client.h"
|
||||
#include "r_local.h"
|
||||
#include "QF/render.h"
|
||||
|
||||
|
@ -501,7 +500,7 @@ R_RecursiveWorldNode (mnode_t *node, int clipflags)
|
|||
c = node->numsurfaces;
|
||||
|
||||
if (c) {
|
||||
surf = cl.worldmodel->surfaces + node->firstsurface;
|
||||
surf = r_worldentity.model->surfaces + node->firstsurface;
|
||||
|
||||
if (dot < -BACKFACE_EPSILON) {
|
||||
do {
|
||||
|
|
|
@ -85,7 +85,7 @@ R_MarkLights (vec3_t lightorigin, dlight_t *light, int bit, mnode_t *node)
|
|||
return;
|
||||
}
|
||||
// mark the polygons
|
||||
surf = cl.worldmodel->surfaces + node->firstsurface;
|
||||
surf = r_worldentity.model->surfaces + node->firstsurface;
|
||||
for (i = 0; i < node->numsurfaces; i++, surf++) {
|
||||
if (surf->dlightframe != r_dlightframecount) {
|
||||
surf->dlightbits = 0;
|
||||
|
@ -114,7 +114,7 @@ R_PushDlights (vec3_t entorigin)
|
|||
if (l->die < r_realtime || !l->radius)
|
||||
continue;
|
||||
VectorSubtract (l->origin, entorigin, lightorigin);
|
||||
R_MarkLights (lightorigin, l, 1 << i, cl.worldmodel->nodes);
|
||||
R_MarkLights (lightorigin, l, 1 << i, r_worldentity.model->nodes);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -167,7 +167,7 @@ RecursiveLightPoint (mnode_t *node, vec3_t start, vec3_t end)
|
|||
return -1; // didn't hit anything
|
||||
|
||||
// check for impact on this node
|
||||
surf = cl.worldmodel->surfaces + node->firstsurface;
|
||||
surf = r_worldentity.model->surfaces + node->firstsurface;
|
||||
for (i = 0; i < node->numsurfaces; i++, surf++) {
|
||||
if (surf->flags & SURF_DRAWTILED)
|
||||
continue; // no lightmaps
|
||||
|
@ -223,14 +223,14 @@ R_LightPoint (vec3_t p)
|
|||
vec3_t end;
|
||||
int r;
|
||||
|
||||
if (!cl.worldmodel->lightdata)
|
||||
if (!r_worldentity.model->lightdata)
|
||||
return 255;
|
||||
|
||||
end[0] = p[0];
|
||||
end[1] = p[1];
|
||||
end[2] = p[2] - 2048;
|
||||
|
||||
r = RecursiveLightPoint (cl.worldmodel->nodes, p, end);
|
||||
r = RecursiveLightPoint (r_worldentity.model->nodes, p, end);
|
||||
|
||||
if (r == -1)
|
||||
r = 0;
|
||||
|
|
|
@ -193,8 +193,8 @@ R_NewMap (void)
|
|||
|
||||
// clear out efrags in case the level hasn't been reloaded
|
||||
// FIXME: is this one short?
|
||||
for (i = 0; i < cl.worldmodel->numleafs; i++)
|
||||
cl.worldmodel->leafs[i].efrags = NULL;
|
||||
for (i = 0; i < r_worldentity.model->numleafs; i++)
|
||||
r_worldentity.model->leafs[i].efrags = NULL;
|
||||
|
||||
r_viewleaf = NULL;
|
||||
R_ClearParticles ();
|
||||
|
@ -439,11 +439,11 @@ R_MarkLeaves (void)
|
|||
r_visframecount++;
|
||||
r_oldviewleaf = r_viewleaf;
|
||||
|
||||
vis = Mod_LeafPVS (r_viewleaf, cl.worldmodel);
|
||||
vis = Mod_LeafPVS (r_viewleaf, r_worldentity.model);
|
||||
|
||||
for (i = 0; i < cl.worldmodel->numleafs; i++) {
|
||||
for (i = 0; i < r_worldentity.model->numleafs; i++) {
|
||||
if (vis[i >> 3] & (1 << (i & 7))) {
|
||||
node = (mnode_t *) &cl.worldmodel->leafs[i + 1];
|
||||
node = (mnode_t *) &r_worldentity.model->leafs[i + 1];
|
||||
do {
|
||||
if (node->visframe == r_visframecount)
|
||||
break;
|
||||
|
@ -743,7 +743,7 @@ R_DrawBEntitiesOnList (void)
|
|||
r_emaxs[j] = minmaxs[3 + j];
|
||||
}
|
||||
|
||||
R_SplitEntityOnNode2 (cl.worldmodel->nodes);
|
||||
R_SplitEntityOnNode2 (r_worldentity.model->nodes);
|
||||
|
||||
if (r_pefragtopnode) {
|
||||
currententity->topnode = r_pefragtopnode;
|
||||
|
@ -875,7 +875,7 @@ R_RenderView_ (void)
|
|||
// done in screen.c
|
||||
Sys_LowFPPrecision ();
|
||||
|
||||
if (!r_worldentity.model || !cl.worldmodel)
|
||||
if (!r_worldentity.model)
|
||||
Sys_Error ("R_RenderView: NULL worldmodel");
|
||||
|
||||
if (!r_dspeeds->int_val) {
|
||||
|
|
|
@ -468,7 +468,7 @@ R_SetupFrame (void)
|
|||
|
||||
// current viewleaf
|
||||
r_oldviewleaf = r_viewleaf;
|
||||
r_viewleaf = Mod_PointInLeaf (r_origin, cl.worldmodel);
|
||||
r_viewleaf = Mod_PointInLeaf (r_origin, r_worldentity.model);
|
||||
|
||||
r_dowarpold = r_dowarp;
|
||||
r_dowarp = r_waterwarp->int_val && (r_viewleaf->contents <= CONTENTS_WATER);
|
||||
|
|
|
@ -147,7 +147,7 @@ R_BuildLightMap (void)
|
|||
size = smax * tmax;
|
||||
lightmap = surf->samples;
|
||||
|
||||
if (!cl.worldmodel->lightdata) {
|
||||
if (!r_worldentity.model->lightdata) {
|
||||
for (i = 0; i < size; i++)
|
||||
blocklights[i] = 0;
|
||||
return;
|
||||
|
|
Loading…
Reference in a new issue