mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-02-17 01:11:45 +00:00
cl_entities[0] is no longer referred to in the sw renderer. insted,
r_worldentity is used.
This commit is contained in:
parent
3e2a92af1c
commit
e75a2b96e9
5 changed files with 15 additions and 8 deletions
|
@ -122,6 +122,7 @@ extern vec3_t r_origin, vpn, vright, vup;
|
|||
|
||||
extern struct texture_s *r_notexture_mip;
|
||||
|
||||
extern entity_t r_worldentity;
|
||||
|
||||
void R_Init (void);
|
||||
void R_InitEfrags (void);
|
||||
|
|
|
@ -47,8 +47,11 @@ vec3_t modelorg, base_modelorg;
|
|||
// the currently rendering entity
|
||||
vec3_t r_entorigin; // the currently rendering entity in world
|
||||
// coordinates
|
||||
|
||||
float entity_rotation[3][3];
|
||||
|
||||
vec3_t r_worldmodelorg;
|
||||
|
||||
int r_currentbkey;
|
||||
|
||||
typedef enum { touchessolid, drawnode, nodrawnode } solidstate_t;
|
||||
|
@ -419,8 +422,8 @@ R_RecursiveWorldNode (mnode_t *node, int clipflags)
|
|||
continue; // don't need to clip against it
|
||||
|
||||
// generate accept and reject points
|
||||
// FIXME: do with fast look-ups or integer tests based on the
|
||||
// sign bit of the floating point values
|
||||
// FIXME: do with fast look-ups or integer tests based on the sign bit
|
||||
// of the floating point values
|
||||
|
||||
pindex = pfrustum_indexes[i];
|
||||
|
||||
|
@ -563,7 +566,7 @@ R_RenderWorld (void)
|
|||
|
||||
pbtofpolys = btofpolys;
|
||||
|
||||
currententity = &cl_entities[0];
|
||||
currententity = &r_worldentity;
|
||||
VectorCopy (r_origin, modelorg);
|
||||
clmodel = currententity->model;
|
||||
r_pcurrentvertbase = clmodel->vertexes;
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
|
||||
#include "QF/sound.h"
|
||||
|
||||
#include "client.h" //XXX goes with cl_entities
|
||||
#include "d_ifacea.h"
|
||||
#include "r_local.h"
|
||||
#include "render.h"
|
||||
|
@ -91,7 +90,7 @@ R_DrawCulledPolys (void)
|
|||
surf_t *s;
|
||||
msurface_t *pface;
|
||||
|
||||
currententity = &cl_entities[0];
|
||||
currententity = &r_worldentity;
|
||||
|
||||
if (r_worldpolysbacktofront) {
|
||||
for (s = surface_p - 1; s > &surfaces[1]; s--) {
|
||||
|
|
|
@ -85,6 +85,8 @@ byte *r_stack_start;
|
|||
|
||||
qboolean r_fov_greater_than_90;
|
||||
|
||||
entity_t r_worldentity;
|
||||
|
||||
// view origin
|
||||
vec3_t vup, base_vup;
|
||||
vec3_t vpn, base_vpn;
|
||||
|
@ -187,6 +189,9 @@ R_NewMap (void)
|
|||
{
|
||||
int i;
|
||||
|
||||
memset (&r_worldentity, 0, sizeof (r_worldentity));
|
||||
r_worldentity.model = cl.worldmodel;
|
||||
|
||||
// clear out efrags in case the level hasn't been reloaded
|
||||
// FIXME: is this one short?
|
||||
for (i = 0; i < cl.worldmodel->numleafs; i++)
|
||||
|
@ -880,7 +885,7 @@ R_RenderView_ (void)
|
|||
// done in screen.c
|
||||
Sys_LowFPPrecision ();
|
||||
|
||||
if (!cl_entities[0].model || !cl.worldmodel)
|
||||
if (!r_worldentity.model || !cl.worldmodel)
|
||||
Sys_Error ("R_RenderView: NULL worldmodel");
|
||||
|
||||
if (!r_dspeeds->int_val) {
|
||||
|
|
|
@ -325,7 +325,6 @@ R_DrawSolidClippedSubmodelPolygons (model_t *pmodel)
|
|||
if (((psurf->flags & SURF_PLANEBACK) && (dot < -BACKFACE_EPSILON)) ||
|
||||
(!(psurf->flags & SURF_PLANEBACK) && (dot > BACKFACE_EPSILON))) {
|
||||
// FIXME: use bounding-box-based frustum clipping info?
|
||||
|
||||
// copy the edges to bedges, flipping if necessary so always
|
||||
// clockwise winding
|
||||
// FIXME: if edges and vertices get caches, these assignments must move
|
||||
|
@ -391,7 +390,7 @@ R_DrawSubmodelPolygons (model_t *pmodel, int clipflags)
|
|||
(!(psurf->flags & SURF_PLANEBACK) && (dot > BACKFACE_EPSILON))) {
|
||||
r_currentkey = ((mleaf_t *) currententity->topnode)->key;
|
||||
|
||||
// FIXME: use bounding-box-based frustum clipping info?
|
||||
// FIXME: use bounding-box-based frustum clipping info?
|
||||
R_RenderFace (psurf, clipflags);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue