mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-13 00:24:12 +00:00
whitespace...
This commit is contained in:
parent
8826182522
commit
e7c2ed82db
28 changed files with 539 additions and 1145 deletions
|
@ -39,16 +39,12 @@ static auxvert_t av[8];
|
|||
|
||||
void R_AliasProjectFinalVert (finalvert_t *fv, auxvert_t *av);
|
||||
void R_Alias_clip_top (finalvert_t *pfv0, finalvert_t *pfv1,
|
||||
|
||||
finalvert_t *out);
|
||||
void R_Alias_clip_bottom (finalvert_t *pfv0, finalvert_t *pfv1,
|
||||
|
||||
finalvert_t *out);
|
||||
void R_Alias_clip_left (finalvert_t *pfv0, finalvert_t *pfv1,
|
||||
|
||||
finalvert_t *out);
|
||||
void R_Alias_clip_right (finalvert_t *pfv0, finalvert_t *pfv1,
|
||||
|
||||
finalvert_t *out);
|
||||
|
||||
|
||||
|
@ -228,9 +224,6 @@ R_AliasClip (finalvert_t *in, finalvert_t *out, int flag, int count,
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_AliasClipTriangle
|
||||
*/
|
||||
void
|
||||
R_AliasClipTriangle (mtriangle_t *ptri)
|
||||
{
|
||||
|
|
|
@ -37,8 +37,8 @@
|
|||
#include "r_local.h"
|
||||
|
||||
#define LIGHT_MIN 5 // lowest light value we'll allow, to
|
||||
// avoid the
|
||||
// need for inner-loop light clamping
|
||||
// avoid the need for inner-loop light
|
||||
// clamping
|
||||
|
||||
mtriangle_t *ptriangles;
|
||||
affinetridesc_t r_affinetridesc;
|
||||
|
@ -86,7 +86,6 @@ float r_avertexnormals[NUMVERTEXNORMALS][3] = {
|
|||
};
|
||||
|
||||
void R_AliasTransformAndProjectFinalVerts (finalvert_t *fv,
|
||||
|
||||
stvert_t *pstverts);
|
||||
void R_AliasSetUpTransform (int trivial_accept);
|
||||
void R_AliasTransformVector (vec3_t in, vec3_t out);
|
||||
|
@ -95,9 +94,6 @@ void R_AliasTransformFinalVert (finalvert_t *fv, auxvert_t *av,
|
|||
void R_AliasProjectFinalVert (finalvert_t *fv, auxvert_t *av);
|
||||
|
||||
|
||||
/*
|
||||
R_AliasCheckBBox
|
||||
*/
|
||||
qboolean
|
||||
R_AliasCheckBBox (void)
|
||||
{
|
||||
|
@ -112,7 +108,6 @@ R_AliasCheckBBox (void)
|
|||
int minz;
|
||||
|
||||
// expand, rotate, and translate points into worldspace
|
||||
|
||||
currententity->trivial_accept = 0;
|
||||
pmodel = currententity->model;
|
||||
pahdr = Mod_Extradata (pmodel);
|
||||
|
@ -176,8 +171,7 @@ R_AliasCheckBBox (void)
|
|||
|
||||
if (zclipped) {
|
||||
// organize points by edges, use edges to get new points (possible
|
||||
// trivial
|
||||
// reject)
|
||||
// trivial reject)
|
||||
for (i = 0; i < 12; i++) {
|
||||
// edge endpoints
|
||||
pv0 = &viewpts[aedges[i].index0];
|
||||
|
@ -245,9 +239,6 @@ R_AliasCheckBBox (void)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_AliasTransformVector
|
||||
*/
|
||||
void
|
||||
R_AliasTransformVector (vec3_t in, vec3_t out)
|
||||
{
|
||||
|
@ -295,9 +286,7 @@ R_AliasPreparePoints (void)
|
|||
}
|
||||
}
|
||||
|
||||
//
|
||||
// clip and draw all triangles
|
||||
//
|
||||
r_affinetridesc.numtriangles = 1;
|
||||
|
||||
ptri = (mtriangle_t *) ((byte *) paliashdr + paliashdr->triangles);
|
||||
|
@ -322,9 +311,6 @@ R_AliasPreparePoints (void)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_AliasSetUpTransform
|
||||
*/
|
||||
void
|
||||
R_AliasSetUpTransform (int trivial_accept)
|
||||
{
|
||||
|
@ -396,9 +382,6 @@ R_AliasSetUpTransform (int trivial_accept)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_AliasTransformFinalVert
|
||||
*/
|
||||
void
|
||||
R_AliasTransformFinalVert (finalvert_t *fv, auxvert_t *av,
|
||||
trivertx_t *pverts, stvert_t *pstverts)
|
||||
|
@ -427,8 +410,7 @@ R_AliasTransformFinalVert (finalvert_t *fv, auxvert_t *av,
|
|||
temp += (int) (r_shadelight * lightcos);
|
||||
|
||||
// clamp; because we limited the minimum ambient and shading light,
|
||||
// we
|
||||
// don't have to clamp low light, just bright
|
||||
// we don't have to clamp low light, just bright
|
||||
if (temp < 0)
|
||||
temp = 0;
|
||||
}
|
||||
|
@ -438,10 +420,6 @@ R_AliasTransformFinalVert (finalvert_t *fv, auxvert_t *av,
|
|||
|
||||
|
||||
#ifndef USE_INTEL_ASM
|
||||
|
||||
/*
|
||||
R_AliasTransformAndProjectFinalVerts
|
||||
*/
|
||||
void
|
||||
R_AliasTransformAndProjectFinalVerts (finalvert_t *fv, stvert_t *pstverts)
|
||||
{
|
||||
|
@ -489,13 +467,9 @@ R_AliasTransformAndProjectFinalVerts (finalvert_t *fv, stvert_t *pstverts)
|
|||
fv->v[4] = temp;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
R_AliasProjectFinalVert
|
||||
*/
|
||||
void
|
||||
R_AliasProjectFinalVert (finalvert_t *fv, auxvert_t *av)
|
||||
{
|
||||
|
@ -511,9 +485,6 @@ R_AliasProjectFinalVert (finalvert_t *fv, auxvert_t *av)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_AliasPrepareUnclippedPoints
|
||||
*/
|
||||
void
|
||||
R_AliasPrepareUnclippedPoints (void)
|
||||
{
|
||||
|
@ -538,9 +509,7 @@ R_AliasPrepareUnclippedPoints (void)
|
|||
D_PolysetDraw ();
|
||||
}
|
||||
|
||||
/*
|
||||
R_AliasSetupSkin
|
||||
*/
|
||||
|
||||
void
|
||||
R_AliasSetupSkin (void)
|
||||
{
|
||||
|
@ -590,15 +559,12 @@ R_AliasSetupSkin (void)
|
|||
r_affinetridesc.skinheight = pmdl->skinheight;
|
||||
}
|
||||
|
||||
/*
|
||||
R_AliasSetupLighting
|
||||
*/
|
||||
|
||||
void
|
||||
R_AliasSetupLighting (alight_t *plighting)
|
||||
{
|
||||
|
||||
// guarantee that no vertex will ever be lit below LIGHT_MIN, so we don't have
|
||||
// to clamp off the bottom
|
||||
// guarantee that no vertex will ever be lit below LIGHT_MIN, so we don't
|
||||
// have to clamp off the bottom
|
||||
r_ambientlight = plighting->ambientlight;
|
||||
|
||||
if (r_ambientlight < LIGHT_MIN)
|
||||
|
@ -622,6 +588,7 @@ R_AliasSetupLighting (alight_t *plighting)
|
|||
r_plightvec[2] = DotProduct (plighting->plightvec, alias_up);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
R_AliasSetupFrame
|
||||
|
||||
|
@ -655,10 +622,8 @@ R_AliasSetupFrame (void)
|
|||
|
||||
time = cl.time + currententity->syncbase;
|
||||
|
||||
//
|
||||
// when loading in Mod_LoadAliasGroup, we guaranteed all interval values
|
||||
// are positive, so we don't have to worry about division by 0
|
||||
//
|
||||
targettime = time - ((int) (time / fullinterval)) * fullinterval;
|
||||
|
||||
for (i = 0; i < (numframes - 1); i++) {
|
||||
|
@ -671,9 +636,6 @@ R_AliasSetupFrame (void)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_AliasDrawModel
|
||||
*/
|
||||
void
|
||||
R_AliasDrawModel (alight_t *plighting)
|
||||
{
|
||||
|
|
|
@ -39,24 +39,16 @@
|
|||
#include "r_local.h"
|
||||
#include "render.h"
|
||||
|
||||
//
|
||||
// current entity info
|
||||
//
|
||||
qboolean insubmodel;
|
||||
entity_t *currententity;
|
||||
vec3_t modelorg, base_modelorg;
|
||||
|
||||
// modelorg is the viewpoint reletive to
|
||||
// the currently rendering entity
|
||||
vec3_t r_entorigin; // the currently rendering entity in
|
||||
|
||||
// world
|
||||
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;
|
||||
|
@ -73,11 +65,6 @@ static mvertex_t *pfrontenter, *pfrontexit;
|
|||
static qboolean makeclippededge;
|
||||
|
||||
|
||||
//===========================================================================
|
||||
|
||||
/*
|
||||
R_EntityRotate
|
||||
*/
|
||||
void
|
||||
R_EntityRotate (vec3_t vec)
|
||||
{
|
||||
|
@ -90,9 +77,6 @@ R_EntityRotate (vec3_t vec)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_RotateBmodel
|
||||
*/
|
||||
void
|
||||
R_RotateBmodel (void)
|
||||
{
|
||||
|
@ -119,7 +103,6 @@ R_RotateBmodel (void)
|
|||
temp1[2][1] = 0;
|
||||
temp1[2][2] = 1;
|
||||
|
||||
|
||||
// pitch
|
||||
angle = currententity->angles[PITCH];
|
||||
angle = angle * M_PI * 2 / 360;
|
||||
|
@ -156,9 +139,7 @@ R_RotateBmodel (void)
|
|||
|
||||
R_ConcatRotations (temp1, temp3, entity_rotation);
|
||||
|
||||
//
|
||||
// rotate modelorg and the transformation matrix
|
||||
//
|
||||
R_EntityRotate (modelorg);
|
||||
R_EntityRotate (vpn);
|
||||
R_EntityRotate (vright);
|
||||
|
@ -168,9 +149,6 @@ R_RotateBmodel (void)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_RecursiveClipBPoly
|
||||
*/
|
||||
void
|
||||
R_RecursiveClipBPoly (bedge_t *pedges, mnode_t *pnode, msurface_t *psurf)
|
||||
{
|
||||
|
@ -295,13 +273,11 @@ R_RecursiveClipBPoly (bedge_t *pedges, mnode_t *pnode, msurface_t *psurf)
|
|||
// draw or recurse further
|
||||
for (i = 0; i < 2; i++) {
|
||||
if (psideedges[i]) {
|
||||
// draw if we've reached a non-solid leaf, done if all that's
|
||||
// left is a
|
||||
// solid leaf, and continue down the tree if it's not a leaf
|
||||
// draw if we've reached a non-solid leaf, done if all that's left
|
||||
// is a solid leaf, and continue down the tree if it's not a leaf
|
||||
pn = pnode->children[i];
|
||||
|
||||
// we're done with this branch if the node or leaf isn't in the
|
||||
// PVS
|
||||
// we're done with this branch if the node or leaf isn't in the PVS
|
||||
if (pn->visframe == r_visframecount) {
|
||||
if (pn->contents < 0) {
|
||||
if (pn->contents != CONTENTS_SOLID) {
|
||||
|
@ -318,9 +294,6 @@ R_RecursiveClipBPoly (bedge_t *pedges, mnode_t *pnode, msurface_t *psurf)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_DrawSolidClippedSubmodelPolygons
|
||||
*/
|
||||
void
|
||||
R_DrawSolidClippedSubmodelPolygons (model_t *pmodel)
|
||||
{
|
||||
|
@ -349,11 +322,9 @@ 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
|
||||
// FIXME: if edges and vertices get caches, these assignments must move
|
||||
// outside the loop, and overflow checking must be done here
|
||||
pbverts = bverts;
|
||||
pbedges = bedges;
|
||||
|
@ -391,9 +362,6 @@ R_DrawSolidClippedSubmodelPolygons (model_t *pmodel)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_DrawSubmodelPolygons
|
||||
*/
|
||||
void
|
||||
R_DrawSubmodelPolygons (model_t *pmodel, int clipflags)
|
||||
{
|
||||
|
@ -426,9 +394,6 @@ R_DrawSubmodelPolygons (model_t *pmodel, int clipflags)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_RecursiveWorldNode
|
||||
*/
|
||||
void
|
||||
R_RecursiveWorldNode (mnode_t *node, int clipflags)
|
||||
{
|
||||
|
@ -455,8 +420,7 @@ R_RecursiveWorldNode (mnode_t *node, int clipflags)
|
|||
|
||||
// generate accept and reject points
|
||||
// FIXME: do with fast look-ups or integer tests based on the
|
||||
// sign bit
|
||||
// of the floating point values
|
||||
// sign bit of the floating point values
|
||||
|
||||
pindex = pfrustum_indexes[i];
|
||||
|
||||
|
@ -590,10 +554,6 @@ R_RecursiveWorldNode (mnode_t *node, int clipflags)
|
|||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
R_RenderWorld
|
||||
*/
|
||||
void
|
||||
R_RenderWorld (void)
|
||||
{
|
||||
|
@ -610,8 +570,8 @@ R_RenderWorld (void)
|
|||
|
||||
R_RecursiveWorldNode (clmodel->nodes, 15);
|
||||
|
||||
// if the driver wants the polygons back to front, play the visible ones back
|
||||
// in that order
|
||||
// if the driver wants the polygons back to front, play the visible ones
|
||||
// back in that order
|
||||
if (r_worldpolysbacktofront) {
|
||||
for (i = numbtofpolys - 1; i >= 0; i--) {
|
||||
R_RenderPoly (btofpolys[i].psurf, btofpolys[i].clipflags);
|
||||
|
|
|
@ -47,8 +47,6 @@ zpointdesc_t r_zpointdesc;
|
|||
|
||||
polydesc_t r_polydesc;
|
||||
|
||||
|
||||
|
||||
clipplane_t *entity_clipplanes;
|
||||
clipplane_t view_clipplanes[4];
|
||||
clipplane_t world_clipplanes[16];
|
||||
|
@ -80,9 +78,6 @@ qboolean r_lastvertvalid;
|
|||
|
||||
#ifndef USE_INTEL_ASM
|
||||
|
||||
/*
|
||||
R_EmitEdge
|
||||
*/
|
||||
void
|
||||
R_EmitEdge (mvertex_t *pv0, mvertex_t *pv1)
|
||||
{
|
||||
|
@ -169,7 +164,6 @@ R_EmitEdge (mvertex_t *pv0, mvertex_t *pv1)
|
|||
|
||||
r_ceilv1 = (int) ceil (r_v1);
|
||||
|
||||
|
||||
// create the edge
|
||||
if (ceilv0 == r_ceilv1) {
|
||||
// we cache unclipped horizontal edges as fully clipped
|
||||
|
@ -215,18 +209,16 @@ R_EmitEdge (mvertex_t *pv0, mvertex_t *pv1)
|
|||
edge->u = u * 0x100000 + 0xFFFFF;
|
||||
|
||||
// we need to do this to avoid stepping off the edges if a very nearly
|
||||
// horizontal edge is less than epsilon above a scan, and numeric error causes
|
||||
// it to incorrectly extend to the scan, and the extension of the line goes off
|
||||
// the edge of the screen
|
||||
// horizontal edge is less than epsilon above a scan, and numeric error
|
||||
// causes it to incorrectly extend to the scan, and the extension of the
|
||||
// line goes off the edge of the screen
|
||||
// FIXME: is this actually needed?
|
||||
if (edge->u < r_refdef.vrect_x_adj_shift20)
|
||||
edge->u = r_refdef.vrect_x_adj_shift20;
|
||||
if (edge->u > r_refdef.vrectright_adj_shift20)
|
||||
edge->u = r_refdef.vrectright_adj_shift20;
|
||||
|
||||
//
|
||||
// sort the edge in normally
|
||||
//
|
||||
u_check = edge->u;
|
||||
if (edge->surfs[0])
|
||||
u_check++; // sort trailers after leaders
|
||||
|
@ -247,9 +239,6 @@ R_EmitEdge (mvertex_t *pv0, mvertex_t *pv1)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_ClipEdge
|
||||
*/
|
||||
void
|
||||
R_ClipEdge (mvertex_t *pv0, mvertex_t *pv1, clipplane_t *clip)
|
||||
{
|
||||
|
@ -334,9 +323,6 @@ R_ClipEdge (mvertex_t *pv0, mvertex_t *pv1, clipplane_t *clip)
|
|||
#endif // !USE_INTEL_ASM
|
||||
|
||||
|
||||
/*
|
||||
R_EmitCachedEdge
|
||||
*/
|
||||
void
|
||||
R_EmitCachedEdge (void)
|
||||
{
|
||||
|
@ -356,9 +342,6 @@ R_EmitCachedEdge (void)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_RenderFace
|
||||
*/
|
||||
void
|
||||
R_RenderFace (msurface_t *fa, int clipflags)
|
||||
{
|
||||
|
@ -525,9 +508,6 @@ R_RenderFace (msurface_t *fa, int clipflags)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_RenderBmodelFace
|
||||
*/
|
||||
void
|
||||
R_RenderBmodelFace (bedge_t *pedges, msurface_t *psurf)
|
||||
{
|
||||
|
@ -628,9 +608,6 @@ R_RenderBmodelFace (bedge_t *pedges, msurface_t *psurf)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_RenderPoly
|
||||
*/
|
||||
void
|
||||
R_RenderPoly (msurface_t *fa, int clipflags)
|
||||
{
|
||||
|
@ -786,8 +763,8 @@ R_RenderPoly (msurface_t *fa, int clipflags)
|
|||
pverts[i].t = verts[vertpage][i].position[t_axis];
|
||||
}
|
||||
|
||||
// build the polygon descriptor, including fa, r_nearzi, and u, v, s, t, and z
|
||||
// for each vertex
|
||||
// build the polygon descriptor, including fa, r_nearzi, and u, v, s, t,
|
||||
// and z for each vertex
|
||||
r_polydesc.numverts = lnumverts;
|
||||
r_polydesc.nearzi = r_nearzi;
|
||||
r_polydesc.pcurrentface = fa;
|
||||
|
@ -798,9 +775,6 @@ R_RenderPoly (msurface_t *fa, int clipflags)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_ZDrawSubmodelPolys
|
||||
*/
|
||||
void
|
||||
R_ZDrawSubmodelPolys (model_t *pmodel)
|
||||
{
|
||||
|
|
|
@ -36,11 +36,10 @@
|
|||
|
||||
#if 0
|
||||
// FIXME
|
||||
the complex cases add new polys on most lines,
|
||||
so dont optimize for keeping them the same have multiple free span lists to
|
||||
try to get better coherence ? low depth complexity-- 1 to 3 or so this
|
||||
breaks spans at every edge, even hidden
|
||||
ones (bad)
|
||||
the complex cases add new polys on most lines, so dont optimize for
|
||||
keeping them the same have multiple free span lists to try to get better
|
||||
coherence ? low depth complexity-- 1 to 3 or so this breaks spans at every
|
||||
edge, even hidden ones (bad)
|
||||
|
||||
have a sentinal at both ends ?
|
||||
#endif
|
||||
|
@ -75,25 +74,14 @@ edge_t edge_sentinel;
|
|||
|
||||
float fv;
|
||||
|
||||
void
|
||||
R_GenerateSpans (void);
|
||||
void
|
||||
R_GenerateSpansBackward (void);
|
||||
void R_GenerateSpans (void);
|
||||
void R_GenerateSpansBackward (void);
|
||||
|
||||
void
|
||||
R_LeadingEdge (edge_t *edge);
|
||||
void
|
||||
R_LeadingEdgeBackwards (edge_t *edge);
|
||||
void
|
||||
R_TrailingEdge (surf_t *surf, edge_t *edge);
|
||||
void R_LeadingEdge (edge_t *edge);
|
||||
void R_LeadingEdgeBackwards (edge_t *edge);
|
||||
void R_TrailingEdge (surf_t *surf, edge_t *edge);
|
||||
|
||||
|
||||
//=============================================================================
|
||||
|
||||
|
||||
/*
|
||||
R_DrawCulledPolys
|
||||
*/
|
||||
void
|
||||
R_DrawCulledPolys (void)
|
||||
{
|
||||
|
@ -126,9 +114,6 @@ R_DrawCulledPolys (void)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_BeginEdgeFrame
|
||||
*/
|
||||
void
|
||||
R_BeginEdgeFrame (void)
|
||||
{
|
||||
|
@ -203,9 +188,6 @@ R_InsertNewEdges (edge_t *edgestoadd, edge_t *edgelist)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_RemoveEdges
|
||||
*/
|
||||
void
|
||||
R_RemoveEdges (edge_t *pedge)
|
||||
{
|
||||
|
@ -217,9 +199,6 @@ R_RemoveEdges (edge_t *pedge)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_StepActiveU
|
||||
*/
|
||||
void
|
||||
R_StepActiveU (edge_t *pedge)
|
||||
{
|
||||
|
@ -282,9 +261,6 @@ R_StepActiveU (edge_t *pedge)
|
|||
#endif // !USE_INTEL_ASM
|
||||
|
||||
|
||||
/*
|
||||
R_CleanupSpan
|
||||
*/
|
||||
void
|
||||
R_CleanupSpan (void)
|
||||
{
|
||||
|
@ -312,9 +288,6 @@ R_CleanupSpan (void)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_LeadingEdgeBackwards
|
||||
*/
|
||||
void
|
||||
R_LeadingEdgeBackwards (edge_t *edge)
|
||||
{
|
||||
|
@ -338,8 +311,7 @@ R_LeadingEdgeBackwards (edge_t *edge)
|
|||
// active is in front, so keep going unless it's a bmodel
|
||||
if (surf->insubmodel && (surf->key == surf2->key)) {
|
||||
// must be two bmodels in the same leaf; don't care, because
|
||||
// they'll
|
||||
// never be farthest anyway
|
||||
// they'll never be farthest anyway
|
||||
goto newtop;
|
||||
}
|
||||
|
||||
|
@ -355,8 +327,7 @@ R_LeadingEdgeBackwards (edge_t *edge)
|
|||
if (!surf->insubmodel)
|
||||
goto continue_search;
|
||||
|
||||
// must be two bmodels in the same leaf; don't care which is
|
||||
// really
|
||||
// must be two bmodels in the same leaf; don't care which is really
|
||||
// in front, because they'll never be farthest anyway
|
||||
}
|
||||
|
||||
|
@ -387,18 +358,14 @@ R_LeadingEdgeBackwards (edge_t *edge)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_TrailingEdge
|
||||
*/
|
||||
void
|
||||
R_TrailingEdge (surf_t *surf, edge_t *edge)
|
||||
{
|
||||
espan_t *span;
|
||||
int iu;
|
||||
|
||||
// don't generate a span if this is an inverted span, with the end
|
||||
// edge preceding the start edge (that is, we haven't seen the
|
||||
// start edge yet)
|
||||
// don't generate a span if this is an inverted span, with the end edge
|
||||
// preceding the start edge (that is, we haven't seen the start edge yet)
|
||||
if (--surf->spanstate == 0) {
|
||||
if (surf->insubmodel)
|
||||
r_bmodelactive--;
|
||||
|
@ -426,9 +393,6 @@ R_TrailingEdge (surf_t *surf, edge_t *edge)
|
|||
|
||||
#ifndef USE_INTEL_ASM
|
||||
|
||||
/*
|
||||
R_LeadingEdge
|
||||
*/
|
||||
void
|
||||
R_LeadingEdge (edge_t *edge)
|
||||
{
|
||||
|
@ -441,9 +405,8 @@ R_LeadingEdge (edge_t *edge)
|
|||
// it's adding a new surface in, so find the correct place
|
||||
surf = &surfaces[edge->surfs[1]];
|
||||
|
||||
// don't start a span if this is an inverted span, with the end
|
||||
// edge preceding the start edge (that is, we've already seen the
|
||||
// end edge)
|
||||
// don't start a span if this is an inverted span, with the end edge
|
||||
// preceding the start edge (that is, we've already seen the end edge)
|
||||
if (++surf->spanstate == 1) {
|
||||
if (surf->insubmodel)
|
||||
r_bmodelactive++;
|
||||
|
@ -541,9 +504,6 @@ R_LeadingEdge (edge_t *edge)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_GenerateSpans
|
||||
*/
|
||||
void
|
||||
R_GenerateSpans (void)
|
||||
{
|
||||
|
@ -559,8 +519,7 @@ R_GenerateSpans (void)
|
|||
// generate spans
|
||||
for (edge = edge_head.next; edge != &edge_tail; edge = edge->next) {
|
||||
if (edge->surfs[0]) {
|
||||
// it has a left surface, so a surface is going away for this
|
||||
// span
|
||||
// it has a left surface, so a surface is going away for this span
|
||||
surf = &surfaces[edge->surfs[0]];
|
||||
|
||||
R_TrailingEdge (surf, edge);
|
||||
|
@ -578,9 +537,6 @@ R_GenerateSpans (void)
|
|||
#endif // !USE_INTEL_ASM
|
||||
|
||||
|
||||
/*
|
||||
R_GenerateSpansBackward
|
||||
*/
|
||||
void
|
||||
R_GenerateSpansBackward (void)
|
||||
{
|
||||
|
@ -656,9 +612,7 @@ R_ScanEdges (void)
|
|||
edge_sentinel.u = 2000 << 24; // make sure nothing sorts past this
|
||||
edge_sentinel.prev = &edge_aftertail;
|
||||
|
||||
//
|
||||
// process all scan lines
|
||||
//
|
||||
bottom = r_refdef.vrectbottom - 1;
|
||||
|
||||
for (iv = r_refdef.vrect.y; iv < bottom; iv++) {
|
||||
|
@ -675,8 +629,7 @@ R_ScanEdges (void)
|
|||
(*pdrawfunc) ();
|
||||
|
||||
// flush the span list if we can't be sure we have enough spans left
|
||||
// for
|
||||
// the next scan
|
||||
// for the next scan
|
||||
if (span_p >= max_span_p) {
|
||||
VID_UnlockBuffer ();
|
||||
S_ExtraUpdate (); // don't let sound get messed up if
|
||||
|
@ -703,7 +656,6 @@ R_ScanEdges (void)
|
|||
}
|
||||
|
||||
// do the last scan (no need to step or sort or remove on the last scan)
|
||||
|
||||
current_iv = iv;
|
||||
fv = (float) iv;
|
||||
|
||||
|
|
|
@ -36,15 +36,11 @@
|
|||
int r_dlightframecount;
|
||||
|
||||
|
||||
/*
|
||||
R_AnimateLight
|
||||
*/
|
||||
void
|
||||
R_AnimateLight (void)
|
||||
{
|
||||
int i, j, k;
|
||||
|
||||
//
|
||||
// light animations
|
||||
// 'm' is normal light, 'a' is no light, 'z' is double bright
|
||||
i = (int) (cl.time * 10);
|
||||
|
@ -65,9 +61,7 @@ R_AnimateLight (void)
|
|||
DYNAMIC LIGHTS
|
||||
*/
|
||||
|
||||
/*
|
||||
R_MarkLights
|
||||
*/
|
||||
|
||||
void
|
||||
R_MarkLights (vec3_t lightorigin, dlight_t *light, int bit, mnode_t *node)
|
||||
{
|
||||
|
@ -105,9 +99,6 @@ R_MarkLights (vec3_t lightorigin, dlight_t *light, int bit, mnode_t *node)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_PushDlights
|
||||
*/
|
||||
void
|
||||
R_PushDlights (vec3_t entorigin)
|
||||
{
|
||||
|
@ -132,6 +123,7 @@ R_PushDlights (vec3_t entorigin)
|
|||
LIGHT SAMPLING
|
||||
*/
|
||||
|
||||
|
||||
int
|
||||
RecursiveLightPoint (mnode_t *node, vec3_t start, vec3_t end)
|
||||
{
|
||||
|
@ -152,7 +144,6 @@ RecursiveLightPoint (mnode_t *node, vec3_t start, vec3_t end)
|
|||
return -1; // didn't hit anything
|
||||
|
||||
// calculate mid point
|
||||
|
||||
// FIXME: optimize for axial
|
||||
plane = node->plane;
|
||||
front = DotProduct (start, plane->normal) - plane->dist;
|
||||
|
@ -226,6 +217,7 @@ RecursiveLightPoint (mnode_t *node, vec3_t start, vec3_t end)
|
|||
return RecursiveLightPoint (node->children[!side], mid, end);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
R_LightPoint (vec3_t p)
|
||||
{
|
||||
|
|
|
@ -85,17 +85,13 @@ byte *r_stack_start;
|
|||
|
||||
qboolean r_fov_greater_than_90;
|
||||
|
||||
//
|
||||
// view origin
|
||||
//
|
||||
vec3_t vup, base_vup;
|
||||
vec3_t vpn, base_vpn;
|
||||
vec3_t vright, base_vright;
|
||||
vec3_t r_origin;
|
||||
|
||||
//
|
||||
// screen size info
|
||||
//
|
||||
refdef_t r_refdef;
|
||||
float xcenter, ycenter;
|
||||
float xscale, yscale;
|
||||
|
@ -112,11 +108,8 @@ float xOrigin, yOrigin;
|
|||
|
||||
mplane_t screenedge[4];
|
||||
|
||||
//
|
||||
// refresh flags
|
||||
//
|
||||
int r_framecount = 1; // so frame counts initialized to 0
|
||||
|
||||
// don't match
|
||||
int r_visframecount;
|
||||
int d_spanpixcount;
|
||||
|
@ -132,10 +125,8 @@ int *pfrustum_indexes[4];
|
|||
int r_frustum_indexes[4 * 6];
|
||||
|
||||
int reinit_surfcache = 1; // if 1, surface cache is currently
|
||||
|
||||
// empty and
|
||||
// must be reinitialized for current cache
|
||||
// size
|
||||
// empty and must be reinitialized
|
||||
// for current cache size
|
||||
|
||||
mleaf_t *r_viewleaf, *r_oldviewleaf;
|
||||
|
||||
|
@ -155,9 +146,6 @@ extern cvar_t *scr_fov;
|
|||
void R_NetGraph (void);
|
||||
void R_ZGraph (void);
|
||||
|
||||
/*
|
||||
R_Textures_Init
|
||||
*/
|
||||
void
|
||||
R_Textures_Init (void)
|
||||
{
|
||||
|
@ -188,11 +176,9 @@ R_Textures_Init (void)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
void R_LoadSky_f (void);
|
||||
|
||||
/*
|
||||
R_Init
|
||||
*/
|
||||
void
|
||||
R_Init (void)
|
||||
{
|
||||
|
@ -203,8 +189,10 @@ R_Init (void)
|
|||
|
||||
R_InitTurb ();
|
||||
|
||||
Cmd_AddCommand ("timerefresh", R_TimeRefresh_f, "Tests the current refresh rate for the current location");
|
||||
Cmd_AddCommand ("pointfile", R_ReadPointFile_f, "Load a pointfile to determine map leaks");
|
||||
Cmd_AddCommand ("timerefresh", R_TimeRefresh_f, "Tests the current "
|
||||
"refresh rate for the current location");
|
||||
Cmd_AddCommand ("pointfile", R_ReadPointFile_f, "Load a pointfile to "
|
||||
"determine map leaks");
|
||||
Cmd_AddCommand ("loadsky", R_LoadSky_f, "Load a skybox");
|
||||
|
||||
Cvar_SetValue (r_maxedges, (float) NUMSTACKEDGES);
|
||||
|
@ -231,9 +219,7 @@ R_Init (void)
|
|||
D_Init ();
|
||||
}
|
||||
|
||||
/*
|
||||
R_NewMap
|
||||
*/
|
||||
|
||||
void
|
||||
R_NewMap (void)
|
||||
{
|
||||
|
@ -286,9 +272,6 @@ R_NewMap (void)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_SetVrect
|
||||
*/
|
||||
void
|
||||
R_SetVrect (vrect_t *pvrectin, vrect_t *pvrect, int lineadj)
|
||||
{
|
||||
|
@ -477,9 +460,6 @@ R_ViewChanged (vrect_t *pvrect, int lineadj, float aspect)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_MarkLeaves
|
||||
*/
|
||||
void
|
||||
R_MarkLeaves (void)
|
||||
{
|
||||
|
@ -508,11 +488,7 @@ R_MarkLeaves (void)
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
=============
|
||||
R_ShowNearestLoc
|
||||
=============
|
||||
*/
|
||||
|
||||
static void
|
||||
R_ShowNearestLoc (void)
|
||||
{
|
||||
|
@ -535,9 +511,7 @@ R_ShowNearestLoc (void)
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
R_DrawEntitiesOnList
|
||||
*/
|
||||
|
||||
void
|
||||
R_DrawEntitiesOnList (void)
|
||||
{
|
||||
|
@ -577,8 +551,7 @@ R_DrawEntitiesOnList (void)
|
|||
VectorSubtract (r_origin, r_entorigin, modelorg);
|
||||
|
||||
// see if the bounding box lets us trivially reject, also
|
||||
// sets
|
||||
// trivial accept status
|
||||
// sets trivial accept status
|
||||
if (R_AliasCheckBBox ()) {
|
||||
j = R_LightPoint (currententity->origin);
|
||||
|
||||
|
@ -615,9 +588,7 @@ R_DrawEntitiesOnList (void)
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
R_DrawViewModel
|
||||
*/
|
||||
|
||||
void
|
||||
R_DrawViewModel (void)
|
||||
{
|
||||
|
@ -687,9 +658,6 @@ R_DrawViewModel (void)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_BmodelCheckBBox
|
||||
*/
|
||||
int
|
||||
R_BmodelCheckBBox (model_t *clmodel, float *minmaxs)
|
||||
{
|
||||
|
@ -715,8 +683,7 @@ R_BmodelCheckBBox (model_t *clmodel, float *minmaxs)
|
|||
for (i = 0; i < 4; i++) {
|
||||
// generate accept and reject points
|
||||
// FIXME: do with fast look-ups or integer tests based on the
|
||||
// sign bit
|
||||
// of the floating point values
|
||||
// sign bit of the floating point values
|
||||
|
||||
pindex = pfrustum_indexes[i];
|
||||
|
||||
|
@ -746,9 +713,6 @@ R_BmodelCheckBBox (model_t *clmodel, float *minmaxs)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_DrawBEntitiesOnList
|
||||
*/
|
||||
void
|
||||
R_DrawBEntitiesOnList (void)
|
||||
{
|
||||
|
@ -773,8 +737,7 @@ R_DrawBEntitiesOnList (void)
|
|||
clmodel = currententity->model;
|
||||
|
||||
// see if the bounding box lets us trivially reject, also
|
||||
// sets
|
||||
// trivial accept status
|
||||
// sets trivial accept status
|
||||
for (j = 0; j < 3; j++) {
|
||||
minmaxs[j] = currententity->origin[j] + clmodel->mins[j];
|
||||
minmaxs[3 + j] = currententity->origin[j] +
|
||||
|
@ -811,10 +774,8 @@ R_DrawBEntitiesOnList (void)
|
|||
}
|
||||
}
|
||||
// if the driver wants polygons, deliver those.
|
||||
// Z-buffering is on
|
||||
// at this point, so no clipping to the world tree is
|
||||
// needed, just
|
||||
// frustum clipping
|
||||
// Z-buffering is on at this point, so no clipping to the
|
||||
// world tree is needed, just frustum clipping
|
||||
if (r_drawpolys | r_drawculledpolys) {
|
||||
R_ZDrawSubmodelPolys (clmodel);
|
||||
} else {
|
||||
|
@ -837,10 +798,8 @@ R_DrawBEntitiesOnList (void)
|
|||
R_DrawSolidClippedSubmodelPolygons (clmodel);
|
||||
} else {
|
||||
// falls entirely in one leaf, so we just put
|
||||
// all the
|
||||
// edges in the edge list and let 1/z sorting
|
||||
// handle
|
||||
// drawing order
|
||||
// all the edges in the edge list and let 1/z
|
||||
// sorting handle drawing order
|
||||
R_DrawSubmodelPolygons (clmodel, clipflags);
|
||||
}
|
||||
|
||||
|
@ -869,17 +828,12 @@ R_DrawBEntitiesOnList (void)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_EdgeDrawing
|
||||
*/
|
||||
void
|
||||
R_EdgeDrawing (void)
|
||||
{
|
||||
edge_t ledges[NUMSTACKEDGES +
|
||||
|
||||
((CACHE_SIZE - 1) / sizeof (edge_t)) + 1];
|
||||
surf_t lsurfs[NUMSTACKSURFACES +
|
||||
|
||||
((CACHE_SIZE - 1) / sizeof (surf_t)) + 1];
|
||||
|
||||
if (auxedges) {
|
||||
|
@ -910,8 +864,8 @@ R_EdgeDrawing (void)
|
|||
if (r_drawculledpolys)
|
||||
R_ScanEdges ();
|
||||
|
||||
// only the world can be drawn back to front with no z reads or compares, just
|
||||
// z writes, so have the driver turn z compares on now
|
||||
// only the world can be drawn back to front with no z reads or compares,
|
||||
// just z writes, so have the driver turn z compares on now
|
||||
D_TurnZOn ();
|
||||
|
||||
if (r_dspeeds->int_val) {
|
||||
|
@ -928,8 +882,7 @@ R_EdgeDrawing (void)
|
|||
|
||||
if (!r_dspeeds->int_val) {
|
||||
VID_UnlockBuffer ();
|
||||
S_ExtraUpdate (); // don't let sound get messed up if
|
||||
// going slow
|
||||
S_ExtraUpdate (); // don't let sound get messed up if going slow
|
||||
VID_LockBuffer ();
|
||||
}
|
||||
|
||||
|
@ -957,8 +910,7 @@ R_RenderView_ (void)
|
|||
|
||||
R_SetupFrame ();
|
||||
|
||||
R_MarkLeaves (); // done here so we know if we're in
|
||||
// water
|
||||
R_MarkLeaves (); // done here so we know if we're in water
|
||||
|
||||
// make FDIV fast. This reduces timing precision after we've been running for a
|
||||
// while, so we don't do it globally. This also sets chop mode, and we do it
|
||||
|
@ -971,8 +923,7 @@ R_RenderView_ (void)
|
|||
|
||||
if (!r_dspeeds->int_val) {
|
||||
VID_UnlockBuffer ();
|
||||
S_ExtraUpdate (); // don't let sound get messed up if
|
||||
// going slow
|
||||
S_ExtraUpdate (); // don't let sound get messed up if going slow
|
||||
VID_LockBuffer ();
|
||||
}
|
||||
|
||||
|
@ -980,8 +931,7 @@ R_RenderView_ (void)
|
|||
|
||||
if (!r_dspeeds->int_val) {
|
||||
VID_UnlockBuffer ();
|
||||
S_ExtraUpdate (); // don't let sound get messed up if
|
||||
// going slow
|
||||
S_ExtraUpdate (); // don't let sound get messed up if going slow
|
||||
VID_LockBuffer ();
|
||||
}
|
||||
|
||||
|
@ -1036,6 +986,7 @@ R_RenderView_ (void)
|
|||
Sys_HighFPPrecision ();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
R_RenderView (void)
|
||||
{
|
||||
|
@ -1058,9 +1009,7 @@ R_RenderView (void)
|
|||
R_RenderView_ ();
|
||||
}
|
||||
|
||||
/*
|
||||
R_InitTurb
|
||||
*/
|
||||
|
||||
void
|
||||
R_InitTurb (void)
|
||||
{
|
||||
|
|
|
@ -43,9 +43,7 @@
|
|||
#include "server.h"
|
||||
#include "view.h"
|
||||
|
||||
qboolean allowskybox; // whether or not to allow skyboxes
|
||||
|
||||
// --KB
|
||||
qboolean allowskybox; // whether or not to allow skyboxes --KB
|
||||
|
||||
|
||||
void
|
||||
|
@ -176,14 +174,16 @@ R_LineGraph (int x, int y, int h)
|
|||
#endif
|
||||
}
|
||||
|
||||
|
||||
#define MAX_TIMINGS 100
|
||||
extern float mouse_x, mouse_y;
|
||||
int graphval;
|
||||
|
||||
/*
|
||||
R_TimeGraph
|
||||
|
||||
Performance monitoring tool
|
||||
*/
|
||||
#define MAX_TIMINGS 100
|
||||
extern float mouse_x, mouse_y;
|
||||
int graphval;
|
||||
void
|
||||
R_TimeGraph (void)
|
||||
{
|
||||
|
@ -215,8 +215,7 @@ R_TimeGraph (void)
|
|||
do {
|
||||
R_LineGraph (x, r_refdef.vrect.height - 2, r_timings[a]);
|
||||
if (x == 0)
|
||||
break; // screen too small to hold entire
|
||||
// thing
|
||||
break; // screen too small to hold entire thing
|
||||
x--;
|
||||
a--;
|
||||
if (a == -1)
|
||||
|
@ -376,7 +375,6 @@ R_TransformFrustum (void)
|
|||
|
||||
|
||||
#ifndef USE_INTEL_ASM
|
||||
|
||||
void
|
||||
TransformVector (vec3_t in, vec3_t out)
|
||||
{
|
||||
|
@ -384,7 +382,6 @@ TransformVector (vec3_t in, vec3_t out)
|
|||
out[1] = DotProduct (in, vup);
|
||||
out[2] = DotProduct (in, vpn);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -458,8 +455,7 @@ R_SetupFrame (void)
|
|||
r_refdef.ambientlight = max (r_ambient->value, 0);
|
||||
|
||||
if (!sv.active)
|
||||
Cvar_SetValue (r_draworder, 0); // don't let cheaters look behind
|
||||
// walls
|
||||
Cvar_SetValue (r_draworder, 0); // don't let cheaters look behind walls
|
||||
|
||||
R_CheckVariables ();
|
||||
|
||||
|
@ -566,6 +562,7 @@ R_SetupFrame (void)
|
|||
D_SetupFrame ();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
R_TranslatePlayerSkin (int playernum)
|
||||
{
|
||||
|
|
|
@ -53,14 +53,17 @@ int r_numparticles;
|
|||
|
||||
vec3_t r_pright, r_pup, r_ppn;
|
||||
|
||||
|
||||
/*
|
||||
R_MaxParticlesCheck
|
||||
Misty-chan: EXTREME heavy lifting and bugfixing thanks goes out to taniwha - I built this, and he got it working :)
|
||||
|
||||
Misty-chan: EXTREME heavy lifting and bugfixing thanks goes out to taniwha
|
||||
- I built this, and he got it working :)
|
||||
*/
|
||||
void
|
||||
R_MaxParticlesCheck (cvar_t *var)
|
||||
{
|
||||
// Do not use 0 in this! sw doesn't grok 0 and it's going to segfault if we do!
|
||||
// Do not use 0 in this! sw doesn't grok 0 and it'll segfault if we do!
|
||||
r_numparticles = max(var->int_val, 1);
|
||||
|
||||
/*
|
||||
|
|
|
@ -50,12 +50,10 @@ int r_skydirect; // not used?
|
|||
|
||||
byte bottomsky[128 * 131];
|
||||
byte bottommask[128 * 131];
|
||||
byte newsky[128 * 256]; // newsky and topsky both pack in
|
||||
|
||||
// here, 128 bytes
|
||||
// of newsky on the left of each scan, 128 bytes
|
||||
// of topsky on the right, because the low-level
|
||||
// drawers need 256-byte scan widths
|
||||
byte newsky[128 * 256]; // newsky and topsky both pack in here, 128
|
||||
// bytes of newsky on the left of each scan,
|
||||
// 128 bytes of topsky on the right, because
|
||||
// the low-level drawers need 256-byte widths
|
||||
|
||||
|
||||
/*
|
||||
|
@ -93,9 +91,6 @@ R_InitSky (texture_t *mt)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_MakeSky
|
||||
*/
|
||||
void
|
||||
R_MakeSky (void)
|
||||
{
|
||||
|
@ -121,7 +116,6 @@ R_MakeSky (void)
|
|||
|
||||
// FIXME: clean this up
|
||||
#if UNALIGNED_OK
|
||||
|
||||
for (x = 0; x < SKYSIZE; x += 4) {
|
||||
ofs = baseofs + ((x + xshift) & SKYMASK);
|
||||
|
||||
|
@ -133,9 +127,7 @@ R_MakeSky (void)
|
|||
|
||||
pnewsky++;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
for (x = 0; x < SKYSIZE; x++) {
|
||||
ofs = baseofs + ((x + xshift) & SKYMASK);
|
||||
|
||||
|
@ -144,7 +136,6 @@ R_MakeSky (void)
|
|||
*(byte *) & bottomsky[ofs];
|
||||
pnewsky = (unsigned int *) ((byte *) pnewsky + 1);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
pnewsky += 128 / sizeof (unsigned int);
|
||||
|
@ -154,9 +145,6 @@ R_MakeSky (void)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_GenSkyTile
|
||||
*/
|
||||
void
|
||||
R_GenSkyTile (void *pdest)
|
||||
{
|
||||
|
@ -177,7 +165,6 @@ R_GenSkyTile (void *pdest)
|
|||
|
||||
// FIXME: clean this up
|
||||
#if UNALIGNED_OK
|
||||
|
||||
for (x = 0; x < SKYSIZE; x += 4) {
|
||||
ofs = baseofs + ((x + xshift) & SKYMASK);
|
||||
|
||||
|
@ -190,9 +177,7 @@ R_GenSkyTile (void *pdest)
|
|||
pnewsky++;
|
||||
pd++;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
for (x = 0; x < SKYSIZE; x++) {
|
||||
ofs = baseofs + ((x + xshift) & SKYMASK);
|
||||
|
||||
|
@ -202,7 +187,6 @@ R_GenSkyTile (void *pdest)
|
|||
pnewsky = (unsigned int *) ((byte *) pnewsky + 1);
|
||||
pd = (unsigned int *) ((byte *) pd + 1);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
pnewsky += 128 / sizeof (unsigned int);
|
||||
|
@ -210,9 +194,6 @@ R_GenSkyTile (void *pdest)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_GenSkyTile16
|
||||
*/
|
||||
void
|
||||
R_GenSkyTile16 (void *pdest)
|
||||
{
|
||||
|
@ -248,9 +229,6 @@ R_GenSkyTile16 (void *pdest)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_SetSkyFrame
|
||||
*/
|
||||
void
|
||||
R_SetSkyFrame (void)
|
||||
{
|
||||
|
|
|
@ -51,9 +51,6 @@ static int sprite_width, sprite_height;
|
|||
spritedesc_t r_spritedesc;
|
||||
|
||||
|
||||
/*
|
||||
R_RotateSprite
|
||||
*/
|
||||
void
|
||||
R_RotateSprite (float beamlength)
|
||||
{
|
||||
|
@ -105,7 +102,6 @@ R_ClipSpriteFace (int nump, clipplane_t *pclipplane)
|
|||
dists[nump] = dists[0];
|
||||
memcpy (instep, in, sizeof (vec5_t));
|
||||
|
||||
|
||||
// clip the winding
|
||||
instep = in;
|
||||
outcount = 0;
|
||||
|
@ -114,7 +110,6 @@ R_ClipSpriteFace (int nump, clipplane_t *pclipplane)
|
|||
if (dists[i] >= 0) {
|
||||
memcpy (outstep, instep, sizeof (vec5_t));
|
||||
outstep += sizeof (vec5_t) / sizeof (float);
|
||||
|
||||
outcount++;
|
||||
}
|
||||
|
||||
|
@ -144,9 +139,6 @@ R_ClipSpriteFace (int nump, clipplane_t *pclipplane)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_SetupAndDrawSprite
|
||||
*/
|
||||
void
|
||||
R_SetupAndDrawSprite (void)
|
||||
{
|
||||
|
@ -241,9 +233,6 @@ R_SetupAndDrawSprite (void)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_GetSpriteframe
|
||||
*/
|
||||
mspriteframe_t *
|
||||
R_GetSpriteframe (msprite_t *psprite)
|
||||
{
|
||||
|
@ -270,8 +259,7 @@ R_GetSpriteframe (msprite_t *psprite)
|
|||
time = cl.time + currententity->syncbase;
|
||||
|
||||
// when loading in Mod_LoadSpriteGroup, we guaranteed all interval
|
||||
// values
|
||||
// are positive, so we don't have to worry about division by 0
|
||||
// values are positive, so we don't have to worry about division by 0
|
||||
targettime = time - ((int) (time / fullinterval)) * fullinterval;
|
||||
|
||||
for (i = 0; i < (numframes - 1); i++) {
|
||||
|
@ -286,9 +274,6 @@ R_GetSpriteframe (msprite_t *psprite)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_DrawSprite
|
||||
*/
|
||||
void
|
||||
R_DrawSprite (void)
|
||||
{
|
||||
|
@ -306,16 +291,12 @@ R_DrawSprite (void)
|
|||
|
||||
// TODO: make this caller-selectable
|
||||
if (psprite->type == SPR_FACING_UPRIGHT) {
|
||||
// generate the sprite's axes, with vup straight up in worldspace,
|
||||
// and
|
||||
// generate the sprite's axes, with vup straight up in worldspace, and
|
||||
// r_spritedesc.vright perpendicular to modelorg.
|
||||
// This will not work if the view direction is very close to straight
|
||||
// up or
|
||||
// down, because the cross product will be between two nearly
|
||||
// parallel
|
||||
// vectors and starts to approach an undefined state, so we don't
|
||||
// draw if
|
||||
// the two vectors are less than 1 degree apart
|
||||
// up or down, because the cross product will be between two nearly
|
||||
// parallel vectors and starts to approach an undefined state, so we
|
||||
// don't draw if the two vectors are less than 1 degree apart
|
||||
tvec[0] = -modelorg[0];
|
||||
tvec[1] = -modelorg[1];
|
||||
tvec[2] = -modelorg[2];
|
||||
|
@ -342,26 +323,20 @@ R_DrawSprite (void)
|
|||
// r_spritedesc.vpn)
|
||||
} else if (psprite->type == SPR_VP_PARALLEL) {
|
||||
// generate the sprite's axes, completely parallel to the viewplane.
|
||||
// There
|
||||
// are no problem situations, because the sprite is always in the
|
||||
// same
|
||||
// position relative to the viewer
|
||||
// There are no problem situations, because the sprite is always in the
|
||||
// same position relative to the viewer
|
||||
for (i = 0; i < 3; i++) {
|
||||
r_spritedesc.vup[i] = vup[i];
|
||||
r_spritedesc.vright[i] = vright[i];
|
||||
r_spritedesc.vpn[i] = vpn[i];
|
||||
}
|
||||
} else if (psprite->type == SPR_VP_PARALLEL_UPRIGHT) {
|
||||
// generate the sprite's axes, with vup straight up in worldspace,
|
||||
// and
|
||||
// generate the sprite's axes, with vup straight up in worldspace, and
|
||||
// r_spritedesc.vright parallel to the viewplane.
|
||||
// This will not work if the view direction is very close to straight
|
||||
// up or
|
||||
// down, because the cross product will be between two nearly
|
||||
// parallel
|
||||
// vectors and starts to approach an undefined state, so we don't
|
||||
// draw if
|
||||
// the two vectors are less than 1 degree apart
|
||||
// up or down, because the cross product will be between two nearly
|
||||
// parallel vectors and starts to approach an undefined state, so we
|
||||
// don't draw if the two vectors are less than 1 degree apart
|
||||
dot = vpn[2]; // same as DotProduct (vpn,
|
||||
// r_spritedesc.vup) because
|
||||
// r_spritedesc.vup is 0, 0, 1
|
||||
|
@ -388,9 +363,8 @@ R_DrawSprite (void)
|
|||
r_spritedesc.vright, r_spritedesc.vup);
|
||||
} else if (psprite->type == SPR_VP_PARALLEL_ORIENTED) {
|
||||
// generate the sprite's axes, parallel to the viewplane, but rotated
|
||||
// in
|
||||
// that plane around the center according to the sprite entity's roll
|
||||
// angle. So vpn stays the same, but vright and vup rotate
|
||||
// in that plane around the center according to the sprite entity's
|
||||
// roll angle. So vpn stays the same, but vright and vup rotate
|
||||
angle = currententity->angles[ROLL] * (M_PI * 2 / 360);
|
||||
sr = sin (angle);
|
||||
cr = cos (angle);
|
||||
|
|
|
@ -60,13 +60,9 @@ static void (*surfmiptable[4]) (void) = {
|
|||
R_DrawSurfaceBlock8_mip1,
|
||||
R_DrawSurfaceBlock8_mip2, R_DrawSurfaceBlock8_mip3};
|
||||
|
||||
|
||||
|
||||
unsigned int blocklights[18 * 18];
|
||||
|
||||
/*
|
||||
R_AddDynamicLights
|
||||
*/
|
||||
|
||||
void
|
||||
R_AddDynamicLights (void)
|
||||
{
|
||||
|
@ -128,6 +124,7 @@ R_AddDynamicLights (void)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
R_BuildLightMap
|
||||
|
||||
|
@ -160,7 +157,6 @@ R_BuildLightMap (void)
|
|||
for (i = 0; i < size; i++)
|
||||
blocklights[i] = r_refdef.ambientlight << 8;
|
||||
|
||||
|
||||
// add all the lightmaps
|
||||
if (lightmap)
|
||||
for (maps = 0; maps < MAXLIGHTMAPS && surf->styles[maps] != 255; maps++) {
|
||||
|
@ -219,9 +215,6 @@ R_TextureAnimation (texture_t *base)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_DrawSurface
|
||||
*/
|
||||
void
|
||||
R_DrawSurface (void)
|
||||
{
|
||||
|
@ -243,8 +236,8 @@ R_DrawSurface (void)
|
|||
|
||||
r_source = (byte *) mt + mt->offsets[r_drawsurf.surfmip];
|
||||
|
||||
// the fractional light values should range from 0 to (VID_GRADES - 1) << 16
|
||||
// from a source range of 0 - 255
|
||||
// the fractional light values should range from 0 to
|
||||
// (VID_GRADES - 1) << 16 from a source range of 0 - 255
|
||||
|
||||
texwidth = mt->width >> r_drawsurf.surfmip;
|
||||
|
||||
|
@ -305,13 +298,8 @@ R_DrawSurface (void)
|
|||
}
|
||||
|
||||
|
||||
//=============================================================================
|
||||
|
||||
#ifndef USE_INTEL_ASM
|
||||
|
||||
/*
|
||||
R_DrawSurfaceBlock8_mip0
|
||||
*/
|
||||
void
|
||||
R_DrawSurfaceBlock8_mip0 (void)
|
||||
{
|
||||
|
@ -355,9 +343,6 @@ R_DrawSurfaceBlock8_mip0 (void)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_DrawSurfaceBlock8_mip1
|
||||
*/
|
||||
void
|
||||
R_DrawSurfaceBlock8_mip1 (void)
|
||||
{
|
||||
|
@ -401,9 +386,6 @@ R_DrawSurfaceBlock8_mip1 (void)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_DrawSurfaceBlock8_mip2
|
||||
*/
|
||||
void
|
||||
R_DrawSurfaceBlock8_mip2 (void)
|
||||
{
|
||||
|
@ -447,9 +429,6 @@ R_DrawSurfaceBlock8_mip2 (void)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_DrawSurfaceBlock8_mip3
|
||||
*/
|
||||
void
|
||||
R_DrawSurfaceBlock8_mip3 (void)
|
||||
{
|
||||
|
@ -540,11 +519,6 @@ R_DrawSurfaceBlock16 (void)
|
|||
#endif
|
||||
|
||||
|
||||
//============================================================================
|
||||
|
||||
/*
|
||||
R_GenTurbTile
|
||||
*/
|
||||
void
|
||||
R_GenTurbTile (pixel_t *pbasetex, void *pdest)
|
||||
{
|
||||
|
@ -565,9 +539,6 @@ R_GenTurbTile (pixel_t *pbasetex, void *pdest)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_GenTurbTile16
|
||||
*/
|
||||
void
|
||||
R_GenTurbTile16 (pixel_t *pbasetex, void *pdest)
|
||||
{
|
||||
|
@ -588,9 +559,6 @@ R_GenTurbTile16 (pixel_t *pbasetex, void *pdest)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_GenTile
|
||||
*/
|
||||
void
|
||||
R_GenTile (msurface_t *psurf, void *pdest)
|
||||
{
|
||||
|
@ -617,6 +585,7 @@ R_GenTile (msurface_t *psurf, void *pdest)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
R_ForceLightUpdate (void)
|
||||
{
|
||||
|
|
|
@ -35,9 +35,7 @@
|
|||
// all global and static refresh variables are collected in a contiguous block
|
||||
// to avoid cache conflicts.
|
||||
|
||||
//-------------------------------------------------------
|
||||
// global refresh variables
|
||||
//-------------------------------------------------------
|
||||
// global refresh variables -----------------------------
|
||||
|
||||
// FIXME: make into one big structure, like cl or sv
|
||||
// FIXME: do separately for refresh engine and driver
|
||||
|
|
|
@ -43,6 +43,7 @@ extern byte gammatable[256];
|
|||
|
||||
qboolean V_CheckGamma (void);
|
||||
|
||||
|
||||
void
|
||||
V_CalcPowerupCshift (void)
|
||||
{
|
||||
|
|
|
@ -39,16 +39,12 @@ static auxvert_t av[8];
|
|||
|
||||
void R_AliasProjectFinalVert (finalvert_t *fv, auxvert_t *av);
|
||||
void R_Alias_clip_top (finalvert_t *pfv0, finalvert_t *pfv1,
|
||||
|
||||
finalvert_t *out);
|
||||
void R_Alias_clip_bottom (finalvert_t *pfv0, finalvert_t *pfv1,
|
||||
|
||||
finalvert_t *out);
|
||||
void R_Alias_clip_left (finalvert_t *pfv0, finalvert_t *pfv1,
|
||||
|
||||
finalvert_t *out);
|
||||
void R_Alias_clip_right (finalvert_t *pfv0, finalvert_t *pfv1,
|
||||
|
||||
finalvert_t *out);
|
||||
|
||||
|
||||
|
@ -228,9 +224,6 @@ R_AliasClip (finalvert_t *in, finalvert_t *out, int flag, int count,
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_AliasClipTriangle
|
||||
*/
|
||||
void
|
||||
R_AliasClipTriangle (mtriangle_t *ptri)
|
||||
{
|
||||
|
|
|
@ -41,8 +41,7 @@
|
|||
#include "render.h"
|
||||
|
||||
#define LIGHT_MIN 5 // lowest light value we'll allow, to
|
||||
// avoid the
|
||||
// need for inner-loop light clamping
|
||||
// avoid the need for inner-loop light clamping
|
||||
|
||||
mtriangle_t *ptriangles;
|
||||
affinetridesc_t r_affinetridesc;
|
||||
|
@ -90,7 +89,6 @@ float r_avertexnormals[NUMVERTEXNORMALS][3] = {
|
|||
};
|
||||
|
||||
void R_AliasTransformAndProjectFinalVerts (finalvert_t *fv,
|
||||
|
||||
stvert_t *pstverts);
|
||||
void R_AliasSetUpTransform (int trivial_accept);
|
||||
void R_AliasTransformVector (vec3_t in, vec3_t out);
|
||||
|
@ -99,9 +97,6 @@ void R_AliasTransformFinalVert (finalvert_t *fv, auxvert_t *av,
|
|||
void R_AliasProjectFinalVert (finalvert_t *fv, auxvert_t *av);
|
||||
|
||||
|
||||
/*
|
||||
R_AliasCheckBBox
|
||||
*/
|
||||
qboolean
|
||||
R_AliasCheckBBox (void)
|
||||
{
|
||||
|
@ -116,7 +111,6 @@ R_AliasCheckBBox (void)
|
|||
int minz;
|
||||
|
||||
// expand, rotate, and translate points into worldspace
|
||||
|
||||
currententity->trivial_accept = 0;
|
||||
pmodel = currententity->model;
|
||||
pahdr = Mod_Extradata (pmodel);
|
||||
|
@ -171,7 +165,6 @@ R_AliasCheckBBox (void)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
if (zfullyclipped) {
|
||||
return false; // everything was near-z-clipped
|
||||
}
|
||||
|
@ -180,8 +173,7 @@ R_AliasCheckBBox (void)
|
|||
|
||||
if (zclipped) {
|
||||
// organize points by edges, use edges to get new points (possible
|
||||
// trivial
|
||||
// reject)
|
||||
// trivial reject)
|
||||
for (i = 0; i < 12; i++) {
|
||||
// edge endpoints
|
||||
pv0 = &viewpts[aedges[i].index0];
|
||||
|
@ -249,9 +241,6 @@ R_AliasCheckBBox (void)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_AliasTransformVector
|
||||
*/
|
||||
void
|
||||
R_AliasTransformVector (vec3_t in, vec3_t out)
|
||||
{
|
||||
|
@ -299,9 +288,7 @@ R_AliasPreparePoints (void)
|
|||
}
|
||||
}
|
||||
|
||||
//
|
||||
// clip and draw all triangles
|
||||
//
|
||||
r_affinetridesc.numtriangles = 1;
|
||||
|
||||
ptri = (mtriangle_t *) ((byte *) paliashdr + paliashdr->triangles);
|
||||
|
@ -326,9 +313,6 @@ R_AliasPreparePoints (void)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_AliasSetUpTransform
|
||||
*/
|
||||
void
|
||||
R_AliasSetUpTransform (int trivial_accept)
|
||||
{
|
||||
|
@ -400,9 +384,6 @@ R_AliasSetUpTransform (int trivial_accept)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_AliasTransformFinalVert
|
||||
*/
|
||||
void
|
||||
R_AliasTransformFinalVert (finalvert_t *fv, auxvert_t *av,
|
||||
trivertx_t *pverts, stvert_t *pstverts)
|
||||
|
@ -431,8 +412,7 @@ R_AliasTransformFinalVert (finalvert_t *fv, auxvert_t *av,
|
|||
temp += (int) (r_shadelight * lightcos);
|
||||
|
||||
// clamp; because we limited the minimum ambient and shading light,
|
||||
// we
|
||||
// don't have to clamp low light, just bright
|
||||
// we don't have to clamp low light, just bright
|
||||
if (temp < 0)
|
||||
temp = 0;
|
||||
}
|
||||
|
@ -442,10 +422,6 @@ R_AliasTransformFinalVert (finalvert_t *fv, auxvert_t *av,
|
|||
|
||||
|
||||
#ifndef USE_INTEL_ASM
|
||||
|
||||
/*
|
||||
R_AliasTransformAndProjectFinalVerts
|
||||
*/
|
||||
void
|
||||
R_AliasTransformAndProjectFinalVerts (finalvert_t *fv, stvert_t *pstverts)
|
||||
{
|
||||
|
@ -462,8 +438,7 @@ R_AliasTransformAndProjectFinalVerts (finalvert_t *fv, stvert_t *pstverts)
|
|||
|
||||
// x, y, and z are scaled down by 1/2**31 in the transform, so 1/z is
|
||||
// scaled up by 1/2**31, and the scaling cancels out for x and y in
|
||||
// the
|
||||
// projection
|
||||
// the projection
|
||||
fv->v[5] = zi;
|
||||
|
||||
fv->v[0] = ((DotProduct (pverts->v, aliastransform[0]) +
|
||||
|
@ -493,13 +468,9 @@ R_AliasTransformAndProjectFinalVerts (finalvert_t *fv, stvert_t *pstverts)
|
|||
fv->v[4] = temp;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
R_AliasProjectFinalVert
|
||||
*/
|
||||
void
|
||||
R_AliasProjectFinalVert (finalvert_t *fv, auxvert_t *av)
|
||||
{
|
||||
|
@ -515,9 +486,6 @@ R_AliasProjectFinalVert (finalvert_t *fv, auxvert_t *av)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_AliasPrepareUnclippedPoints
|
||||
*/
|
||||
void
|
||||
R_AliasPrepareUnclippedPoints (void)
|
||||
{
|
||||
|
@ -542,9 +510,7 @@ R_AliasPrepareUnclippedPoints (void)
|
|||
D_PolysetDraw ();
|
||||
}
|
||||
|
||||
/*
|
||||
R_AliasSetupSkin
|
||||
*/
|
||||
|
||||
void
|
||||
R_AliasSetupSkin (void)
|
||||
{
|
||||
|
@ -607,15 +573,13 @@ R_AliasSetupSkin (void)
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
R_AliasSetupLighting
|
||||
*/
|
||||
|
||||
void
|
||||
R_AliasSetupLighting (alight_t *plighting)
|
||||
{
|
||||
|
||||
// guarantee that no vertex will ever be lit below LIGHT_MIN, so we don't have
|
||||
// to clamp off the bottom
|
||||
// guarantee that no vertex will ever be lit below LIGHT_MIN, so we don't
|
||||
// have to clamp off the bottom
|
||||
r_ambientlight = plighting->ambientlight;
|
||||
|
||||
if (r_ambientlight < LIGHT_MIN)
|
||||
|
@ -639,6 +603,7 @@ R_AliasSetupLighting (alight_t *plighting)
|
|||
r_plightvec[2] = DotProduct (plighting->plightvec, alias_up);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
R_AliasSetupFrame
|
||||
|
||||
|
@ -672,10 +637,8 @@ R_AliasSetupFrame (void)
|
|||
|
||||
time = cl.time + currententity->syncbase;
|
||||
|
||||
//
|
||||
// when loading in Mod_LoadAliasGroup, we guaranteed all interval values
|
||||
// are positive, so we don't have to worry about division by 0
|
||||
//
|
||||
targettime = time - ((int) (time / fullinterval)) * fullinterval;
|
||||
|
||||
for (i = 0; i < (numframes - 1); i++) {
|
||||
|
@ -688,9 +651,6 @@ R_AliasSetupFrame (void)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_AliasDrawModel
|
||||
*/
|
||||
void
|
||||
R_AliasDrawModel (alight_t *plighting)
|
||||
{
|
||||
|
|
|
@ -39,18 +39,13 @@
|
|||
#include "r_local.h"
|
||||
#include "render.h"
|
||||
|
||||
//
|
||||
// current entity info
|
||||
//
|
||||
qboolean insubmodel;
|
||||
entity_t *currententity;
|
||||
vec3_t modelorg, base_modelorg;
|
||||
|
||||
// modelorg is the viewpoint reletive to
|
||||
// the currently rendering entity
|
||||
vec3_t r_entorigin; // the currently rendering entity in
|
||||
|
||||
// world
|
||||
vec3_t r_entorigin; // the currently rendering entity in world
|
||||
// coordinates
|
||||
|
||||
float entity_rotation[3][3];
|
||||
|
@ -73,11 +68,6 @@ static mvertex_t *pfrontenter, *pfrontexit;
|
|||
static qboolean makeclippededge;
|
||||
|
||||
|
||||
//===========================================================================
|
||||
|
||||
/*
|
||||
R_EntityRotate
|
||||
*/
|
||||
void
|
||||
R_EntityRotate (vec3_t vec)
|
||||
{
|
||||
|
@ -90,9 +80,6 @@ R_EntityRotate (vec3_t vec)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_RotateBmodel
|
||||
*/
|
||||
void
|
||||
R_RotateBmodel (void)
|
||||
{
|
||||
|
@ -119,7 +106,6 @@ R_RotateBmodel (void)
|
|||
temp1[2][1] = 0;
|
||||
temp1[2][2] = 1;
|
||||
|
||||
|
||||
// pitch
|
||||
angle = currententity->angles[PITCH];
|
||||
angle = angle * M_PI * 2 / 360;
|
||||
|
@ -156,9 +142,7 @@ R_RotateBmodel (void)
|
|||
|
||||
R_ConcatRotations (temp1, temp3, entity_rotation);
|
||||
|
||||
//
|
||||
// rotate modelorg and the transformation matrix
|
||||
//
|
||||
R_EntityRotate (modelorg);
|
||||
R_EntityRotate (vpn);
|
||||
R_EntityRotate (vright);
|
||||
|
@ -168,9 +152,6 @@ R_RotateBmodel (void)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_RecursiveClipBPoly
|
||||
*/
|
||||
void
|
||||
R_RecursiveClipBPoly (bedge_t *pedges, mnode_t *pnode, msurface_t *psurf)
|
||||
{
|
||||
|
@ -295,13 +276,11 @@ R_RecursiveClipBPoly (bedge_t *pedges, mnode_t *pnode, msurface_t *psurf)
|
|||
// draw or recurse further
|
||||
for (i = 0; i < 2; i++) {
|
||||
if (psideedges[i]) {
|
||||
// draw if we've reached a non-solid leaf, done if all that's
|
||||
// left is a
|
||||
// solid leaf, and continue down the tree if it's not a leaf
|
||||
// draw if we've reached a non-solid leaf, done if all that's left
|
||||
// is a solid leaf, and continue down the tree if it's not a leaf
|
||||
pn = pnode->children[i];
|
||||
|
||||
// we're done with this branch if the node or leaf isn't in the
|
||||
// PVS
|
||||
// we're done with this branch if the node or leaf isn't in the PVS
|
||||
if (pn->visframe == r_visframecount) {
|
||||
if (pn->contents < 0) {
|
||||
if (pn->contents != CONTENTS_SOLID) {
|
||||
|
@ -318,9 +297,6 @@ R_RecursiveClipBPoly (bedge_t *pedges, mnode_t *pnode, msurface_t *psurf)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_DrawSolidClippedSubmodelPolygons
|
||||
*/
|
||||
void
|
||||
R_DrawSolidClippedSubmodelPolygons (model_t *pmodel)
|
||||
{
|
||||
|
@ -352,8 +328,7 @@ R_DrawSolidClippedSubmodelPolygons (model_t *pmodel)
|
|||
|
||||
// copy the edges to bedges, flipping if necessary so always
|
||||
// clockwise winding
|
||||
// FIXME: if edges and vertices get caches, these assignments
|
||||
// must move
|
||||
// FIXME: if edges and vertices get caches, these assignments must move
|
||||
// outside the loop, and overflow checking must be done here
|
||||
pbverts = bverts;
|
||||
pbedges = bedges;
|
||||
|
@ -391,9 +366,6 @@ R_DrawSolidClippedSubmodelPolygons (model_t *pmodel)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_DrawSubmodelPolygons
|
||||
*/
|
||||
void
|
||||
R_DrawSubmodelPolygons (model_t *pmodel, int clipflags)
|
||||
{
|
||||
|
@ -426,9 +398,6 @@ R_DrawSubmodelPolygons (model_t *pmodel, int clipflags)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_RecursiveWorldNode
|
||||
*/
|
||||
void
|
||||
R_RecursiveWorldNode (mnode_t *node, int clipflags)
|
||||
{
|
||||
|
@ -454,8 +423,7 @@ 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
|
||||
// FIXME: do with fast look-ups or integer tests based on the sign bit
|
||||
// of the floating point values
|
||||
|
||||
pindex = pfrustum_indexes[i];
|
||||
|
@ -590,10 +558,6 @@ R_RecursiveWorldNode (mnode_t *node, int clipflags)
|
|||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
R_RenderWorld
|
||||
*/
|
||||
void
|
||||
R_RenderWorld (void)
|
||||
{
|
||||
|
@ -610,8 +574,8 @@ R_RenderWorld (void)
|
|||
|
||||
R_RecursiveWorldNode (clmodel->nodes, 15);
|
||||
|
||||
// if the driver wants the polygons back to front, play the visible ones back
|
||||
// in that order
|
||||
// if the driver wants the polygons back to front, play the visible ones
|
||||
// back in that order
|
||||
if (r_worldpolysbacktofront) {
|
||||
for (i = numbtofpolys - 1; i >= 0; i--) {
|
||||
R_RenderPoly (btofpolys[i].psurf, btofpolys[i].clipflags);
|
||||
|
|
|
@ -47,8 +47,6 @@ zpointdesc_t r_zpointdesc;
|
|||
|
||||
polydesc_t r_polydesc;
|
||||
|
||||
|
||||
|
||||
clipplane_t *entity_clipplanes;
|
||||
clipplane_t view_clipplanes[4];
|
||||
clipplane_t world_clipplanes[16];
|
||||
|
@ -80,9 +78,6 @@ qboolean r_lastvertvalid;
|
|||
|
||||
#ifndef USE_INTEL_ASM
|
||||
|
||||
/*
|
||||
R_EmitEdge
|
||||
*/
|
||||
void
|
||||
R_EmitEdge (mvertex_t *pv0, mvertex_t *pv1)
|
||||
{
|
||||
|
@ -169,7 +164,6 @@ R_EmitEdge (mvertex_t *pv0, mvertex_t *pv1)
|
|||
|
||||
r_ceilv1 = (int) ceil (r_v1);
|
||||
|
||||
|
||||
// create the edge
|
||||
if (ceilv0 == r_ceilv1) {
|
||||
// we cache unclipped horizontal edges as fully clipped
|
||||
|
@ -215,18 +209,16 @@ R_EmitEdge (mvertex_t *pv0, mvertex_t *pv1)
|
|||
edge->u = u * 0x100000 + 0xFFFFF;
|
||||
|
||||
// we need to do this to avoid stepping off the edges if a very nearly
|
||||
// horizontal edge is less than epsilon above a scan, and numeric error causes
|
||||
// it to incorrectly extend to the scan, and the extension of the line goes off
|
||||
// the edge of the screen
|
||||
// horizontal edge is less than epsilon above a scan, and numeric error
|
||||
// causes it to incorrectly extend to the scan, and the extension of the
|
||||
// line goes off the edge of the screen
|
||||
// FIXME: is this actually needed?
|
||||
if (edge->u < r_refdef.vrect_x_adj_shift20)
|
||||
edge->u = r_refdef.vrect_x_adj_shift20;
|
||||
if (edge->u > r_refdef.vrectright_adj_shift20)
|
||||
edge->u = r_refdef.vrectright_adj_shift20;
|
||||
|
||||
//
|
||||
// sort the edge in normally
|
||||
//
|
||||
u_check = edge->u;
|
||||
if (edge->surfs[0])
|
||||
u_check++; // sort trailers after leaders
|
||||
|
@ -247,9 +239,6 @@ R_EmitEdge (mvertex_t *pv0, mvertex_t *pv1)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_ClipEdge
|
||||
*/
|
||||
void
|
||||
R_ClipEdge (mvertex_t *pv0, mvertex_t *pv1, clipplane_t *clip)
|
||||
{
|
||||
|
@ -334,9 +323,6 @@ R_ClipEdge (mvertex_t *pv0, mvertex_t *pv1, clipplane_t *clip)
|
|||
#endif // !USE_INTEL_ASM
|
||||
|
||||
|
||||
/*
|
||||
R_EmitCachedEdge
|
||||
*/
|
||||
void
|
||||
R_EmitCachedEdge (void)
|
||||
{
|
||||
|
@ -356,9 +342,6 @@ R_EmitCachedEdge (void)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_RenderFace
|
||||
*/
|
||||
void
|
||||
R_RenderFace (msurface_t *fa, int clipflags)
|
||||
{
|
||||
|
@ -525,9 +508,6 @@ R_RenderFace (msurface_t *fa, int clipflags)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_RenderBmodelFace
|
||||
*/
|
||||
void
|
||||
R_RenderBmodelFace (bedge_t *pedges, msurface_t *psurf)
|
||||
{
|
||||
|
@ -628,9 +608,6 @@ R_RenderBmodelFace (bedge_t *pedges, msurface_t *psurf)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_RenderPoly
|
||||
*/
|
||||
void
|
||||
R_RenderPoly (msurface_t *fa, int clipflags)
|
||||
{
|
||||
|
@ -786,8 +763,8 @@ R_RenderPoly (msurface_t *fa, int clipflags)
|
|||
pverts[i].t = verts[vertpage][i].position[t_axis];
|
||||
}
|
||||
|
||||
// build the polygon descriptor, including fa, r_nearzi, and u, v, s, t, and z
|
||||
// for each vertex
|
||||
// build the polygon descriptor, including fa, r_nearzi, and u, v, s, t,
|
||||
// and z for each vertex
|
||||
r_polydesc.numverts = lnumverts;
|
||||
r_polydesc.nearzi = r_nearzi;
|
||||
r_polydesc.pcurrentface = fa;
|
||||
|
@ -798,9 +775,6 @@ R_RenderPoly (msurface_t *fa, int clipflags)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_ZDrawSubmodelPolys
|
||||
*/
|
||||
void
|
||||
R_ZDrawSubmodelPolys (model_t *pmodel)
|
||||
{
|
||||
|
|
|
@ -37,15 +37,15 @@
|
|||
#include "render.h"
|
||||
|
||||
#if 0
|
||||
// FIXME
|
||||
FIXME
|
||||
the complex cases add new polys on most lines,
|
||||
so dont optimize for keeping them the same have multiple free span lists to
|
||||
try to get better coherence ? low depth complexity-- 1 to 3 or so this
|
||||
breaks spans at every edge, even hidden
|
||||
ones (bad)
|
||||
breaks spans at every edge, even hidden ones (bad)
|
||||
|
||||
have a sentinal at both ends ?
|
||||
#endif
|
||||
|
||||
edge_t *auxedges;
|
||||
edge_t *r_edges, *edge_p, *edge_max;
|
||||
|
||||
|
@ -77,25 +77,13 @@ edge_t edge_sentinel;
|
|||
|
||||
float fv;
|
||||
|
||||
void
|
||||
R_GenerateSpans (void);
|
||||
void
|
||||
R_GenerateSpansBackward (void);
|
||||
|
||||
void
|
||||
R_LeadingEdge (edge_t *edge);
|
||||
void
|
||||
R_LeadingEdgeBackwards (edge_t *edge);
|
||||
void
|
||||
R_TrailingEdge (surf_t *surf, edge_t *edge);
|
||||
void R_GenerateSpans (void);
|
||||
void R_GenerateSpansBackward (void);
|
||||
void R_LeadingEdge (edge_t *edge);
|
||||
void R_LeadingEdgeBackwards (edge_t *edge);
|
||||
void R_TrailingEdge (surf_t *surf, edge_t *edge);
|
||||
|
||||
|
||||
//=============================================================================
|
||||
|
||||
|
||||
/*
|
||||
R_DrawCulledPolys
|
||||
*/
|
||||
void
|
||||
R_DrawCulledPolys (void)
|
||||
{
|
||||
|
@ -128,9 +116,6 @@ R_DrawCulledPolys (void)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_BeginEdgeFrame
|
||||
*/
|
||||
void
|
||||
R_BeginEdgeFrame (void)
|
||||
{
|
||||
|
@ -205,9 +190,6 @@ R_InsertNewEdges (edge_t *edgestoadd, edge_t *edgelist)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_RemoveEdges
|
||||
*/
|
||||
void
|
||||
R_RemoveEdges (edge_t *pedge)
|
||||
{
|
||||
|
@ -219,9 +201,6 @@ R_RemoveEdges (edge_t *pedge)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_StepActiveU
|
||||
*/
|
||||
void
|
||||
R_StepActiveU (edge_t *pedge)
|
||||
{
|
||||
|
@ -284,9 +263,6 @@ R_StepActiveU (edge_t *pedge)
|
|||
#endif // !USE_INTEL_ASM
|
||||
|
||||
|
||||
/*
|
||||
R_CleanupSpan
|
||||
*/
|
||||
void
|
||||
R_CleanupSpan (void)
|
||||
{
|
||||
|
@ -314,9 +290,6 @@ R_CleanupSpan (void)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_LeadingEdgeBackwards
|
||||
*/
|
||||
void
|
||||
R_LeadingEdgeBackwards (edge_t *edge)
|
||||
{
|
||||
|
@ -340,8 +313,7 @@ R_LeadingEdgeBackwards (edge_t *edge)
|
|||
// active is in front, so keep going unless it's a bmodel
|
||||
if (surf->insubmodel && (surf->key == surf2->key)) {
|
||||
// must be two bmodels in the same leaf; don't care, because
|
||||
// they'll
|
||||
// never be farthest anyway
|
||||
// they'll never be farthest anyway
|
||||
goto newtop;
|
||||
}
|
||||
|
||||
|
@ -358,8 +330,7 @@ R_LeadingEdgeBackwards (edge_t *edge)
|
|||
goto continue_search;
|
||||
|
||||
// must be two bmodels in the same leaf; don't care which is
|
||||
// really
|
||||
// in front, because they'll never be farthest anyway
|
||||
// really in front, because they'll never be farthest anyway
|
||||
}
|
||||
|
||||
goto gotposition;
|
||||
|
@ -389,18 +360,14 @@ R_LeadingEdgeBackwards (edge_t *edge)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_TrailingEdge
|
||||
*/
|
||||
void
|
||||
R_TrailingEdge (surf_t *surf, edge_t *edge)
|
||||
{
|
||||
espan_t *span;
|
||||
int iu;
|
||||
|
||||
// don't generate a span if this is an inverted span, with the end
|
||||
// edge preceding the start edge (that is, we haven't seen the
|
||||
// start edge yet)
|
||||
// don't generate a span if this is an inverted span, with the end edge
|
||||
// preceding the start edge (that is, we haven't seen the start edge yet)
|
||||
if (--surf->spanstate == 0) {
|
||||
if (surf->insubmodel)
|
||||
r_bmodelactive--;
|
||||
|
@ -428,9 +395,6 @@ R_TrailingEdge (surf_t *surf, edge_t *edge)
|
|||
|
||||
#ifndef USE_INTEL_ASM
|
||||
|
||||
/*
|
||||
R_LeadingEdge
|
||||
*/
|
||||
void
|
||||
R_LeadingEdge (edge_t *edge)
|
||||
{
|
||||
|
@ -487,8 +451,8 @@ R_LeadingEdge (edge_t *edge)
|
|||
|
||||
if (surf->key == surf2->key) {
|
||||
// if it's two surfaces on the same plane, the one that's
|
||||
// already
|
||||
// active is in front, so keep going unless it's a bmodel
|
||||
// already active is in front, so keep going unless it's a
|
||||
// bmodel
|
||||
if (!surf->insubmodel)
|
||||
goto continue_search;
|
||||
|
||||
|
@ -561,8 +525,7 @@ R_GenerateSpans (void)
|
|||
// generate spans
|
||||
for (edge = edge_head.next; edge != &edge_tail; edge = edge->next) {
|
||||
if (edge->surfs[0]) {
|
||||
// it has a left surface, so a surface is going away for this
|
||||
// span
|
||||
// it has a left surface, so a surface is going away for this span
|
||||
surf = &surfaces[edge->surfs[0]];
|
||||
|
||||
R_TrailingEdge (surf, edge);
|
||||
|
@ -580,9 +543,6 @@ R_GenerateSpans (void)
|
|||
#endif // !USE_INTEL_ASM
|
||||
|
||||
|
||||
/*
|
||||
R_GenerateSpansBackward
|
||||
*/
|
||||
void
|
||||
R_GenerateSpansBackward (void)
|
||||
{
|
||||
|
@ -658,9 +618,7 @@ R_ScanEdges (void)
|
|||
edge_sentinel.u = 2000 << 24; // make sure nothing sorts past this
|
||||
edge_sentinel.prev = &edge_aftertail;
|
||||
|
||||
//
|
||||
// process all scan lines
|
||||
//
|
||||
bottom = r_refdef.vrectbottom - 1;
|
||||
|
||||
for (iv = r_refdef.vrect.y; iv < bottom; iv++) {
|
||||
|
@ -677,12 +635,10 @@ R_ScanEdges (void)
|
|||
(*pdrawfunc) ();
|
||||
|
||||
// flush the span list if we can't be sure we have enough spans left
|
||||
// for
|
||||
// the next scan
|
||||
// for the next scan
|
||||
if (span_p > max_span_p) {
|
||||
VID_UnlockBuffer ();
|
||||
S_ExtraUpdate (); // don't let sound get messed up if
|
||||
// going slow
|
||||
S_ExtraUpdate (); // don't let sound get messed up if going slow
|
||||
VID_LockBuffer ();
|
||||
|
||||
if (r_drawculledpolys)
|
||||
|
@ -705,7 +661,6 @@ R_ScanEdges (void)
|
|||
}
|
||||
|
||||
// do the last scan (no need to step or sort or remove on the last scan)
|
||||
|
||||
current_iv = iv;
|
||||
fv = (float) iv;
|
||||
|
||||
|
|
|
@ -36,15 +36,11 @@
|
|||
int r_dlightframecount;
|
||||
|
||||
|
||||
/*
|
||||
R_AnimateLight
|
||||
*/
|
||||
void
|
||||
R_AnimateLight (void)
|
||||
{
|
||||
int i, j, k;
|
||||
|
||||
//
|
||||
// light animations
|
||||
// 'm' is normal light, 'a' is no light, 'z' is double bright
|
||||
i = (int) (cl.time * 10);
|
||||
|
@ -65,9 +61,7 @@ R_AnimateLight (void)
|
|||
DYNAMIC LIGHTS
|
||||
*/
|
||||
|
||||
/*
|
||||
R_MarkLights
|
||||
*/
|
||||
|
||||
void
|
||||
R_MarkLights (vec3_t lightorigin, dlight_t *light, int bit, mnode_t *node)
|
||||
{
|
||||
|
@ -105,9 +99,6 @@ R_MarkLights (vec3_t lightorigin, dlight_t *light, int bit, mnode_t *node)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_PushDlights
|
||||
*/
|
||||
void
|
||||
R_PushDlights (vec3_t entorigin)
|
||||
{
|
||||
|
@ -132,6 +123,7 @@ R_PushDlights (vec3_t entorigin)
|
|||
LIGHT SAMPLING
|
||||
*/
|
||||
|
||||
|
||||
int
|
||||
RecursiveLightPoint (mnode_t *node, vec3_t start, vec3_t end)
|
||||
{
|
||||
|
@ -152,7 +144,6 @@ RecursiveLightPoint (mnode_t *node, vec3_t start, vec3_t end)
|
|||
return -1; // didn't hit anything
|
||||
|
||||
// calculate mid point
|
||||
|
||||
// FIXME: optimize for axial
|
||||
plane = node->plane;
|
||||
front = DotProduct (start, plane->normal) - plane->dist;
|
||||
|
@ -176,7 +167,6 @@ 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;
|
||||
for (i = 0; i < node->numsurfaces; i++, surf++) {
|
||||
if (surf->flags & SURF_DRAWTILED)
|
||||
|
@ -226,6 +216,7 @@ RecursiveLightPoint (mnode_t *node, vec3_t start, vec3_t end)
|
|||
return RecursiveLightPoint (node->children[!side], mid, end);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
R_LightPoint (vec3_t p)
|
||||
{
|
||||
|
|
|
@ -88,17 +88,13 @@ qboolean r_fov_greater_than_90;
|
|||
|
||||
entity_t r_worldentity;
|
||||
|
||||
//
|
||||
// view origin
|
||||
//
|
||||
vec3_t vup, base_vup;
|
||||
vec3_t vpn, base_vpn;
|
||||
vec3_t vright, base_vright;
|
||||
vec3_t r_origin;
|
||||
|
||||
//
|
||||
// screen size info
|
||||
//
|
||||
refdef_t r_refdef;
|
||||
float xcenter, ycenter;
|
||||
float xscale, yscale;
|
||||
|
@ -115,12 +111,8 @@ float xOrigin, yOrigin;
|
|||
|
||||
mplane_t screenedge[4];
|
||||
|
||||
//
|
||||
// refresh flags
|
||||
//
|
||||
int r_framecount = 1; // so frame counts initialized to 0
|
||||
|
||||
// don't match
|
||||
int r_framecount = 1; // so frame counts initialized to 0 don't match
|
||||
int r_visframecount;
|
||||
int d_spanpixcount;
|
||||
int r_polycount;
|
||||
|
@ -130,11 +122,9 @@ int r_wholepolycount;
|
|||
int *pfrustum_indexes[4];
|
||||
int r_frustum_indexes[4 * 6];
|
||||
|
||||
int reinit_surfcache = 1; // if 1, surface cache is currently
|
||||
|
||||
// empty and
|
||||
// must be reinitialized for current cache
|
||||
// size
|
||||
int reinit_surfcache = 1; // if 1, surface cache is currently empty
|
||||
// and must be reinitialized for current
|
||||
// cache size
|
||||
|
||||
mleaf_t *r_viewleaf, *r_oldviewleaf;
|
||||
|
||||
|
@ -152,9 +142,7 @@ extern cvar_t *scr_fov;
|
|||
void R_NetGraph (void);
|
||||
void R_ZGraph (void);
|
||||
|
||||
/*
|
||||
R_Textures_Init
|
||||
*/
|
||||
|
||||
void
|
||||
R_Textures_Init (void)
|
||||
{
|
||||
|
@ -185,11 +173,10 @@ R_Textures_Init (void)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
void R_LoadSky_f (void);
|
||||
|
||||
/*
|
||||
R_Init
|
||||
*/
|
||||
|
||||
void
|
||||
R_Init (void)
|
||||
{
|
||||
|
@ -202,8 +189,10 @@ R_Init (void)
|
|||
|
||||
R_InitTurb ();
|
||||
|
||||
Cmd_AddCommand ("timerefresh", R_TimeRefresh_f, "Tests the current refresh rate for the current location");
|
||||
Cmd_AddCommand ("pointfile", R_ReadPointFile_f, "Load a pointfile to determine map leaks");
|
||||
Cmd_AddCommand ("timerefresh", R_TimeRefresh_f, "Tests the current "
|
||||
"refresh rate for the current location");
|
||||
Cmd_AddCommand ("pointfile", R_ReadPointFile_f, "Load a pointfile to "
|
||||
"determine map leaks");
|
||||
Cmd_AddCommand ("loadsky", R_LoadSky_f, "Load a skybox");
|
||||
|
||||
Cvar_SetValue (r_maxedges, (float) NUMSTACKEDGES);
|
||||
|
@ -224,13 +213,10 @@ R_Init (void)
|
|||
Sys_MakeCodeWriteable ((long) R_EdgeCodeStart,
|
||||
(long) R_EdgeCodeEnd - (long) R_EdgeCodeStart);
|
||||
#endif // USE_INTEL_ASM
|
||||
|
||||
D_Init ();
|
||||
}
|
||||
|
||||
/*
|
||||
R_NewMap
|
||||
*/
|
||||
|
||||
void
|
||||
R_NewMap (void)
|
||||
{
|
||||
|
@ -286,9 +272,6 @@ R_NewMap (void)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_SetVrect
|
||||
*/
|
||||
void
|
||||
R_SetVrect (vrect_t *pvrectin, vrect_t *pvrect, int lineadj)
|
||||
{
|
||||
|
@ -477,9 +460,6 @@ R_ViewChanged (vrect_t *pvrect, int lineadj, float aspect)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_MarkLeaves
|
||||
*/
|
||||
void
|
||||
R_MarkLeaves (void)
|
||||
{
|
||||
|
@ -508,11 +488,7 @@ R_MarkLeaves (void)
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
=============
|
||||
R_ShowNearestLoc
|
||||
=============
|
||||
*/
|
||||
|
||||
static void
|
||||
R_ShowNearestLoc (void)
|
||||
{
|
||||
|
@ -535,9 +511,7 @@ R_ShowNearestLoc (void)
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
R_DrawEntitiesOnList
|
||||
*/
|
||||
|
||||
void
|
||||
R_DrawEntitiesOnList (void)
|
||||
{
|
||||
|
@ -608,9 +582,7 @@ R_DrawEntitiesOnList (void)
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
R_DrawViewModel
|
||||
*/
|
||||
|
||||
void
|
||||
R_DrawViewModel (void)
|
||||
{
|
||||
|
@ -678,9 +650,6 @@ R_DrawViewModel (void)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_BmodelCheckBBox
|
||||
*/
|
||||
int
|
||||
R_BmodelCheckBBox (model_t *clmodel, float *minmaxs)
|
||||
{
|
||||
|
@ -706,8 +675,7 @@ R_BmodelCheckBBox (model_t *clmodel, float *minmaxs)
|
|||
for (i = 0; i < 4; i++) {
|
||||
// generate accept and reject points
|
||||
// FIXME: do with fast look-ups or integer tests based on the
|
||||
// sign bit
|
||||
// of the floating point values
|
||||
// sign bit of the floating point values
|
||||
|
||||
pindex = pfrustum_indexes[i];
|
||||
|
||||
|
@ -737,9 +705,6 @@ R_BmodelCheckBBox (model_t *clmodel, float *minmaxs)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_DrawBEntitiesOnList
|
||||
*/
|
||||
void
|
||||
R_DrawBEntitiesOnList (void)
|
||||
{
|
||||
|
@ -764,8 +729,7 @@ R_DrawBEntitiesOnList (void)
|
|||
clmodel = currententity->model;
|
||||
|
||||
// see if the bounding box lets us trivially reject, also
|
||||
// sets
|
||||
// trivial accept status
|
||||
// sets trivial accept status
|
||||
for (j = 0; j < 3; j++) {
|
||||
minmaxs[j] = currententity->origin[j] + clmodel->mins[j];
|
||||
minmaxs[3 + j] = currententity->origin[j] +
|
||||
|
@ -802,10 +766,8 @@ R_DrawBEntitiesOnList (void)
|
|||
}
|
||||
}
|
||||
// if the driver wants polygons, deliver those.
|
||||
// Z-buffering is on
|
||||
// at this point, so no clipping to the world tree is
|
||||
// needed, just
|
||||
// frustum clipping
|
||||
// Z-buffering is on at this point, so no clipping to the
|
||||
// world tree is needed, just frustum clipping
|
||||
if (r_drawpolys | r_drawculledpolys) {
|
||||
R_ZDrawSubmodelPolys (clmodel);
|
||||
} else {
|
||||
|
@ -828,10 +790,8 @@ R_DrawBEntitiesOnList (void)
|
|||
R_DrawSolidClippedSubmodelPolygons (clmodel);
|
||||
} else {
|
||||
// falls entirely in one leaf, so we just put
|
||||
// all the
|
||||
// edges in the edge list and let 1/z sorting
|
||||
// handle
|
||||
// drawing order
|
||||
// all the edges in the edge list and let 1/z
|
||||
// sorting handle drawing order
|
||||
R_DrawSubmodelPolygons (clmodel, clipflags);
|
||||
}
|
||||
|
||||
|
@ -860,17 +820,12 @@ R_DrawBEntitiesOnList (void)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_EdgeDrawing
|
||||
*/
|
||||
void
|
||||
R_EdgeDrawing (void)
|
||||
{
|
||||
edge_t ledges[NUMSTACKEDGES +
|
||||
|
||||
((CACHE_SIZE - 1) / sizeof (edge_t)) + 1];
|
||||
surf_t lsurfs[NUMSTACKSURFACES +
|
||||
|
||||
((CACHE_SIZE - 1) / sizeof (surf_t)) + 1];
|
||||
|
||||
if (auxedges) {
|
||||
|
@ -901,8 +856,8 @@ R_EdgeDrawing (void)
|
|||
if (r_drawculledpolys)
|
||||
R_ScanEdges ();
|
||||
|
||||
// only the world can be drawn back to front with no z reads or compares, just
|
||||
// z writes, so have the driver turn z compares on now
|
||||
// only the world can be drawn back to front with no z reads or compares,
|
||||
// just z writes, so have the driver turn z compares on now
|
||||
D_TurnZOn ();
|
||||
|
||||
if (r_dspeeds->int_val) {
|
||||
|
@ -948,8 +903,7 @@ R_RenderView_ (void)
|
|||
|
||||
R_SetupFrame ();
|
||||
|
||||
R_MarkLeaves (); // done here so we know if we're in
|
||||
// water
|
||||
R_MarkLeaves (); // done here so we know if we're in water
|
||||
|
||||
// make FDIV fast. This reduces timing precision after we've been running for a
|
||||
// while, so we don't do it globally. This also sets chop mode, and we do it
|
||||
|
@ -962,8 +916,7 @@ R_RenderView_ (void)
|
|||
|
||||
if (!r_dspeeds->int_val) {
|
||||
VID_UnlockBuffer ();
|
||||
S_ExtraUpdate (); // don't let sound get messed up if
|
||||
// going slow
|
||||
S_ExtraUpdate (); // don't let sound get messed up if going slow
|
||||
VID_LockBuffer ();
|
||||
}
|
||||
|
||||
|
@ -971,8 +924,7 @@ R_RenderView_ (void)
|
|||
|
||||
if (!r_dspeeds->int_val) {
|
||||
VID_UnlockBuffer ();
|
||||
S_ExtraUpdate (); // don't let sound get messed up if
|
||||
// going slow
|
||||
S_ExtraUpdate (); // don't let sound get messed up if going slow
|
||||
VID_LockBuffer ();
|
||||
}
|
||||
|
||||
|
@ -1033,6 +985,7 @@ R_RenderView_ (void)
|
|||
Sys_HighFPPrecision ();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
R_RenderView (void)
|
||||
{
|
||||
|
@ -1055,9 +1008,7 @@ R_RenderView (void)
|
|||
R_RenderView_ ();
|
||||
}
|
||||
|
||||
/*
|
||||
R_InitTurb
|
||||
*/
|
||||
|
||||
void
|
||||
R_InitTurb (void)
|
||||
{
|
||||
|
|
|
@ -43,9 +43,7 @@
|
|||
#include "render.h"
|
||||
#include "sbar.h"
|
||||
|
||||
qboolean allowskybox; // whether or not to allow skyboxes
|
||||
|
||||
// --KB
|
||||
qboolean allowskybox; // whether or not to allow skyboxes --KB
|
||||
|
||||
|
||||
void
|
||||
|
@ -170,14 +168,16 @@ R_LineGraph (int x, int y, int h)
|
|||
#endif
|
||||
}
|
||||
|
||||
|
||||
#define MAX_TIMINGS 100
|
||||
extern float mouse_x, mouse_y;
|
||||
int graphval;
|
||||
|
||||
/*
|
||||
R_TimeGraph
|
||||
|
||||
Performance monitoring tool
|
||||
*/
|
||||
#define MAX_TIMINGS 100
|
||||
extern float mouse_x, mouse_y;
|
||||
int graphval;
|
||||
void
|
||||
R_TimeGraph (void)
|
||||
{
|
||||
|
@ -368,7 +368,6 @@ R_TransformFrustum (void)
|
|||
|
||||
|
||||
#ifndef USE_INTEL_ASM
|
||||
|
||||
void
|
||||
TransformVector (vec3_t in, vec3_t out)
|
||||
{
|
||||
|
@ -376,7 +375,6 @@ TransformVector (vec3_t in, vec3_t out)
|
|||
out[1] = DotProduct (in, vup);
|
||||
out[2] = DotProduct (in, vpn);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
|
|
@ -54,14 +54,17 @@ int r_numparticles;
|
|||
vec3_t r_pright, r_pup, r_ppn;
|
||||
cvar_t *r_particles;
|
||||
|
||||
|
||||
/*
|
||||
R_MaxParticlesCheck
|
||||
Misty-chan: EXTREME heavy lifting and bugfixing thanks goes out to taniwha - I built this, and he got it working :)
|
||||
|
||||
Misty-chan: EXTREME heavy lifting and bugfixing thanks goes out to taniwha
|
||||
- I built this, and he got it working :)
|
||||
*/
|
||||
void
|
||||
R_MaxParticlesCheck (cvar_t *var)
|
||||
{
|
||||
// Do not use 0 in this! sw doesn't grok 0 and it's going to segfault if we do!
|
||||
// Do not use 0 in this! sw doesn't grok 0 and it'll segfault if we do!
|
||||
r_numparticles = max(var->int_val, 1);
|
||||
|
||||
/*
|
||||
|
@ -78,21 +81,17 @@ R_MaxParticlesCheck (cvar_t *var)
|
|||
R_ClearParticles ();
|
||||
}
|
||||
|
||||
/*
|
||||
R_Particles_Init_Cvars
|
||||
*/
|
||||
|
||||
void
|
||||
R_Particles_Init_Cvars (void)
|
||||
{
|
||||
// Does a callback to R_MaxParticleCheck when the cvar changes. Neat trick.
|
||||
Cvar_Get ("cl_max_particles", "2048", CVAR_ARCHIVE, R_MaxParticlesCheck,
|
||||
"Maximum amount of particles to display. No maximum, minimum is 1.");
|
||||
"Maximum amount of particles to display. No maximum, minimum "
|
||||
"is 1.");
|
||||
}
|
||||
|
||||
/*
|
||||
R_ClearParticles
|
||||
*/
|
||||
|
||||
void
|
||||
R_ClearParticles (void)
|
||||
{
|
||||
|
@ -156,6 +155,7 @@ R_ReadPointFile_f (void)
|
|||
Con_Printf ("%i points read\n", c);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
R_RunSpikeEffect (vec3_t pos, byte type)
|
||||
{
|
||||
|
@ -175,6 +175,7 @@ R_RunSpikeEffect (vec3_t pos, byte type)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
R_RunPuffEffect (vec3_t pos, byte type, byte cnt)
|
||||
{
|
||||
|
@ -194,9 +195,7 @@ R_RunPuffEffect (vec3_t pos, byte type, byte cnt)
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
R_ParticleExplosion
|
||||
*/
|
||||
|
||||
void
|
||||
R_ParticleExplosion (vec3_t org)
|
||||
{
|
||||
|
@ -233,9 +232,7 @@ R_ParticleExplosion (vec3_t org)
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
R_BlobExplosion
|
||||
*/
|
||||
|
||||
void
|
||||
R_BlobExplosion (vec3_t org)
|
||||
{
|
||||
|
@ -273,9 +270,7 @@ R_BlobExplosion (vec3_t org)
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
R_RunParticleEffect
|
||||
*/
|
||||
|
||||
void
|
||||
R_RunParticleEffect (vec3_t org, int color, int count)
|
||||
{
|
||||
|
@ -312,9 +307,6 @@ R_RunParticleEffect (vec3_t org, int color, int count)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_LavaSplash
|
||||
*/
|
||||
void
|
||||
R_LavaSplash (vec3_t org)
|
||||
{
|
||||
|
@ -354,9 +346,7 @@ R_LavaSplash (vec3_t org)
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
R_TeleportSplash
|
||||
*/
|
||||
|
||||
void
|
||||
R_TeleportSplash (vec3_t org)
|
||||
{
|
||||
|
@ -396,6 +386,7 @@ R_TeleportSplash (vec3_t org)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
R_RocketTrail (int type, entity_t *ent)
|
||||
{
|
||||
|
@ -479,9 +470,6 @@ R_RocketTrail (int type, entity_t *ent)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_DrawParticles
|
||||
*/
|
||||
void
|
||||
R_DrawParticles (void)
|
||||
{
|
||||
|
|
|
@ -50,12 +50,10 @@ int r_skydirect; // not used?
|
|||
|
||||
byte bottomsky[128 * 131];
|
||||
byte bottommask[128 * 131];
|
||||
byte newsky[128 * 256]; // newsky and topsky both pack in
|
||||
|
||||
// here, 128 bytes
|
||||
// of newsky on the left of each scan, 128 bytes
|
||||
// of topsky on the right, because the low-level
|
||||
// drawers need 256-byte scan widths
|
||||
byte newsky[128 * 256]; // newsky and topsky both pack in here, 128
|
||||
// bytes of newsky on the left of each scan,
|
||||
// 128 bytes of topsky on the right, because
|
||||
// the low-level drawers need 256-byte widths
|
||||
|
||||
|
||||
/*
|
||||
|
@ -93,9 +91,6 @@ R_InitSky (texture_t *mt)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_MakeSky
|
||||
*/
|
||||
void
|
||||
R_MakeSky (void)
|
||||
{
|
||||
|
@ -121,7 +116,6 @@ R_MakeSky (void)
|
|||
|
||||
// FIXME: clean this up
|
||||
#if UNALIGNED_OK
|
||||
|
||||
for (x = 0; x < SKYSIZE; x += 4) {
|
||||
ofs = baseofs + ((x + xshift) & SKYMASK);
|
||||
|
||||
|
@ -133,9 +127,7 @@ R_MakeSky (void)
|
|||
|
||||
pnewsky++;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
for (x = 0; x < SKYSIZE; x++) {
|
||||
ofs = baseofs + ((x + xshift) & SKYMASK);
|
||||
|
||||
|
@ -144,9 +136,7 @@ R_MakeSky (void)
|
|||
*(byte *) & bottomsky[ofs];
|
||||
pnewsky = (unsigned int *) ((byte *) pnewsky + 1);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
pnewsky += 128 / sizeof (unsigned int);
|
||||
}
|
||||
|
||||
|
@ -154,9 +144,6 @@ R_MakeSky (void)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_GenSkyTile
|
||||
*/
|
||||
void
|
||||
R_GenSkyTile (void *pdest)
|
||||
{
|
||||
|
@ -177,7 +164,6 @@ R_GenSkyTile (void *pdest)
|
|||
|
||||
// FIXME: clean this up
|
||||
#if UNALIGNED_OK
|
||||
|
||||
for (x = 0; x < SKYSIZE; x += 4) {
|
||||
ofs = baseofs + ((x + xshift) & SKYMASK);
|
||||
|
||||
|
@ -190,9 +176,7 @@ R_GenSkyTile (void *pdest)
|
|||
pnewsky++;
|
||||
pd++;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
for (x = 0; x < SKYSIZE; x++) {
|
||||
ofs = baseofs + ((x + xshift) & SKYMASK);
|
||||
|
||||
|
@ -202,17 +186,12 @@ R_GenSkyTile (void *pdest)
|
|||
pnewsky = (unsigned int *) ((byte *) pnewsky + 1);
|
||||
pd = (unsigned int *) ((byte *) pd + 1);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
pnewsky += 128 / sizeof (unsigned int);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
R_GenSkyTile16
|
||||
*/
|
||||
void
|
||||
R_GenSkyTile16 (void *pdest)
|
||||
{
|
||||
|
@ -248,9 +227,6 @@ R_GenSkyTile16 (void *pdest)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_SetSkyFrame
|
||||
*/
|
||||
void
|
||||
R_SetSkyFrame (void)
|
||||
{
|
||||
|
@ -267,7 +243,6 @@ R_SetSkyFrame (void)
|
|||
|
||||
skytime = cl.time - ((int) (cl.time / temp) * temp);
|
||||
|
||||
|
||||
r_skymade = 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -51,9 +51,6 @@ static int sprite_width, sprite_height;
|
|||
spritedesc_t r_spritedesc;
|
||||
|
||||
|
||||
/*
|
||||
R_RotateSprite
|
||||
*/
|
||||
void
|
||||
R_RotateSprite (float beamlength)
|
||||
{
|
||||
|
@ -105,7 +102,6 @@ R_ClipSpriteFace (int nump, clipplane_t *pclipplane)
|
|||
dists[nump] = dists[0];
|
||||
memcpy (instep, in, sizeof (vec5_t));
|
||||
|
||||
|
||||
// clip the winding
|
||||
instep = in;
|
||||
outcount = 0;
|
||||
|
@ -144,9 +140,6 @@ R_ClipSpriteFace (int nump, clipplane_t *pclipplane)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_SetupAndDrawSprite
|
||||
*/
|
||||
void
|
||||
R_SetupAndDrawSprite (void)
|
||||
{
|
||||
|
@ -241,9 +234,6 @@ R_SetupAndDrawSprite (void)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_GetSpriteframe
|
||||
*/
|
||||
mspriteframe_t *
|
||||
R_GetSpriteframe (msprite_t *psprite)
|
||||
{
|
||||
|
@ -270,8 +260,7 @@ R_GetSpriteframe (msprite_t *psprite)
|
|||
time = cl.time + currententity->syncbase;
|
||||
|
||||
// when loading in Mod_LoadSpriteGroup, we guaranteed all interval
|
||||
// values
|
||||
// are positive, so we don't have to worry about division by 0
|
||||
// values are positive, so we don't have to worry about division by 0
|
||||
targettime = time - ((int) (time / fullinterval)) * fullinterval;
|
||||
|
||||
for (i = 0; i < (numframes - 1); i++) {
|
||||
|
@ -286,9 +275,6 @@ R_GetSpriteframe (msprite_t *psprite)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_DrawSprite
|
||||
*/
|
||||
void
|
||||
R_DrawSprite (void)
|
||||
{
|
||||
|
@ -306,16 +292,12 @@ R_DrawSprite (void)
|
|||
|
||||
// TODO: make this caller-selectable
|
||||
if (psprite->type == SPR_FACING_UPRIGHT) {
|
||||
// generate the sprite's axes, with vup straight up in worldspace,
|
||||
// and
|
||||
// generate the sprite's axes, with vup straight up in worldspace, and
|
||||
// r_spritedesc.vright perpendicular to modelorg.
|
||||
// This will not work if the view direction is very close to straight
|
||||
// up or
|
||||
// down, because the cross product will be between two nearly
|
||||
// parallel
|
||||
// vectors and starts to approach an undefined state, so we don't
|
||||
// draw if
|
||||
// the two vectors are less than 1 degree apart
|
||||
// up or down, because the cross product will be between two nearly
|
||||
// parallel vectors and starts to approach an undefined state, so we
|
||||
// don't draw if the two vectors are less than 1 degree apart
|
||||
tvec[0] = -modelorg[0];
|
||||
tvec[1] = -modelorg[1];
|
||||
tvec[2] = -modelorg[2];
|
||||
|
@ -338,30 +320,23 @@ R_DrawSprite (void)
|
|||
r_spritedesc.vpn[0] = -r_spritedesc.vright[1];
|
||||
r_spritedesc.vpn[1] = r_spritedesc.vright[0];
|
||||
r_spritedesc.vpn[2] = 0;
|
||||
// CrossProduct (r_spritedesc.vright, r_spritedesc.vup,
|
||||
// r_spritedesc.vpn)
|
||||
// CrossProduct (r_spritedesc.vright, r_spritedesc.vup, r_spritedesc.vpn)
|
||||
} else if (psprite->type == SPR_VP_PARALLEL) {
|
||||
// generate the sprite's axes, completely parallel to the viewplane.
|
||||
// There
|
||||
// are no problem situations, because the sprite is always in the
|
||||
// same
|
||||
// position relative to the viewer
|
||||
// There are no problem situations, because the sprite is always in the
|
||||
// same position relative to the viewer
|
||||
for (i = 0; i < 3; i++) {
|
||||
r_spritedesc.vup[i] = vup[i];
|
||||
r_spritedesc.vright[i] = vright[i];
|
||||
r_spritedesc.vpn[i] = vpn[i];
|
||||
}
|
||||
} else if (psprite->type == SPR_VP_PARALLEL_UPRIGHT) {
|
||||
// generate the sprite's axes, with vup straight up in worldspace,
|
||||
// and
|
||||
// generate the sprite's axes, with vup straight up in worldspace, and
|
||||
// r_spritedesc.vright parallel to the viewplane.
|
||||
// This will not work if the view direction is very close to straight
|
||||
// up or
|
||||
// down, because the cross product will be between two nearly
|
||||
// parallel
|
||||
// vectors and starts to approach an undefined state, so we don't
|
||||
// draw if
|
||||
// the two vectors are less than 1 degree apart
|
||||
// up or down, because the cross product will be between two nearly
|
||||
// parallel vectors and starts to approach an undefined state, so we
|
||||
// don't draw if the two vectors are less than 1 degree apart
|
||||
dot = vpn[2]; // same as DotProduct (vpn,
|
||||
// r_spritedesc.vup) because
|
||||
// r_spritedesc.vup is 0, 0, 1
|
||||
|
@ -379,8 +354,7 @@ R_DrawSprite (void)
|
|||
r_spritedesc.vpn[0] = -r_spritedesc.vright[1];
|
||||
r_spritedesc.vpn[1] = r_spritedesc.vright[0];
|
||||
r_spritedesc.vpn[2] = 0;
|
||||
// CrossProduct (r_spritedesc.vright, r_spritedesc.vup,
|
||||
// r_spritedesc.vpn)
|
||||
// CrossProduct (r_spritedesc.vright, r_spritedesc.vup, r_spritedesc.vpn)
|
||||
} else if (psprite->type == SPR_ORIENTED) {
|
||||
// generate the sprite's axes, according to the sprite's world
|
||||
// orientation
|
||||
|
@ -388,9 +362,8 @@ R_DrawSprite (void)
|
|||
r_spritedesc.vright, r_spritedesc.vup);
|
||||
} else if (psprite->type == SPR_VP_PARALLEL_ORIENTED) {
|
||||
// generate the sprite's axes, parallel to the viewplane, but rotated
|
||||
// in
|
||||
// that plane around the center according to the sprite entity's roll
|
||||
// angle. So vpn stays the same, but vright and vup rotate
|
||||
// in that plane around the center according to the sprite entity's
|
||||
// roll angle. So vpn stays the same, but vright and vup rotate
|
||||
angle = currententity->angles[ROLL] * (M_PI * 2 / 360);
|
||||
sr = sin (angle);
|
||||
cr = cos (angle);
|
||||
|
|
|
@ -56,17 +56,12 @@ void R_DrawSurfaceBlock8_mip2 (void);
|
|||
void R_DrawSurfaceBlock8_mip3 (void);
|
||||
|
||||
static void (*surfmiptable[4]) (void) = {
|
||||
R_DrawSurfaceBlock8_mip0,
|
||||
R_DrawSurfaceBlock8_mip1,
|
||||
R_DrawSurfaceBlock8_mip0, R_DrawSurfaceBlock8_mip1,
|
||||
R_DrawSurfaceBlock8_mip2, R_DrawSurfaceBlock8_mip3};
|
||||
|
||||
|
||||
|
||||
unsigned int blocklights[18 * 18];
|
||||
|
||||
/*
|
||||
R_AddDynamicLights
|
||||
*/
|
||||
|
||||
void
|
||||
R_AddDynamicLights (void)
|
||||
{
|
||||
|
@ -128,6 +123,7 @@ R_AddDynamicLights (void)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
R_BuildLightMap
|
||||
|
||||
|
@ -160,7 +156,6 @@ R_BuildLightMap (void)
|
|||
for (i = 0; i < size; i++)
|
||||
blocklights[i] = r_refdef.ambientlight << 8;
|
||||
|
||||
|
||||
// add all the lightmaps
|
||||
if (lightmap)
|
||||
for (maps = 0; maps < MAXLIGHTMAPS && surf->styles[maps] != 255; maps++) {
|
||||
|
@ -219,9 +214,6 @@ R_TextureAnimation (texture_t *base)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_DrawSurface
|
||||
*/
|
||||
void
|
||||
R_DrawSurface (void)
|
||||
{
|
||||
|
@ -243,8 +235,8 @@ R_DrawSurface (void)
|
|||
|
||||
r_source = (byte *) mt + mt->offsets[r_drawsurf.surfmip];
|
||||
|
||||
// the fractional light values should range from 0 to (VID_GRADES - 1) << 16
|
||||
// from a source range of 0 - 255
|
||||
// the fractional light values should range from 0 to
|
||||
// (VID_GRADES - 1) << 16 from a source range of 0 - 255
|
||||
|
||||
texwidth = mt->width >> r_drawsurf.surfmip;
|
||||
|
||||
|
@ -305,13 +297,8 @@ R_DrawSurface (void)
|
|||
}
|
||||
|
||||
|
||||
//=============================================================================
|
||||
|
||||
#ifndef USE_INTEL_ASM
|
||||
|
||||
/*
|
||||
R_DrawSurfaceBlock8_mip0
|
||||
*/
|
||||
void
|
||||
R_DrawSurfaceBlock8_mip0 (void)
|
||||
{
|
||||
|
@ -355,9 +342,6 @@ R_DrawSurfaceBlock8_mip0 (void)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_DrawSurfaceBlock8_mip1
|
||||
*/
|
||||
void
|
||||
R_DrawSurfaceBlock8_mip1 (void)
|
||||
{
|
||||
|
@ -368,7 +352,7 @@ R_DrawSurfaceBlock8_mip1 (void)
|
|||
prowdest = prowdestbase;
|
||||
|
||||
for (v = 0; v < r_numvblocks; v++) {
|
||||
// FIXME: make these locals?
|
||||
./ FIXME: make these locals?
|
||||
// FIXME: use delta rather than both right and left, like ASM?
|
||||
lightleft = r_lightptr[0];
|
||||
lightright = r_lightptr[1];
|
||||
|
@ -401,9 +385,6 @@ R_DrawSurfaceBlock8_mip1 (void)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_DrawSurfaceBlock8_mip2
|
||||
*/
|
||||
void
|
||||
R_DrawSurfaceBlock8_mip2 (void)
|
||||
{
|
||||
|
@ -447,9 +428,6 @@ R_DrawSurfaceBlock8_mip2 (void)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_DrawSurfaceBlock8_mip3
|
||||
*/
|
||||
void
|
||||
R_DrawSurfaceBlock8_mip3 (void)
|
||||
{
|
||||
|
@ -540,11 +518,6 @@ R_DrawSurfaceBlock16 (void)
|
|||
#endif
|
||||
|
||||
|
||||
//============================================================================
|
||||
|
||||
/*
|
||||
R_GenTurbTile
|
||||
*/
|
||||
void
|
||||
R_GenTurbTile (pixel_t *pbasetex, void *pdest)
|
||||
{
|
||||
|
@ -565,9 +538,6 @@ R_GenTurbTile (pixel_t *pbasetex, void *pdest)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_GenTurbTile16
|
||||
*/
|
||||
void
|
||||
R_GenTurbTile16 (pixel_t *pbasetex, void *pdest)
|
||||
{
|
||||
|
@ -588,9 +558,6 @@ R_GenTurbTile16 (pixel_t *pbasetex, void *pdest)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
R_GenTile
|
||||
*/
|
||||
void
|
||||
R_GenTile (msurface_t *psurf, void *pdest)
|
||||
{
|
||||
|
@ -617,6 +584,7 @@ R_GenTile (msurface_t *psurf, void *pdest)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
R_ForceLightUpdate (void)
|
||||
{
|
||||
|
|
|
@ -35,9 +35,7 @@
|
|||
// all global and static refresh variables are collected in a contiguous block
|
||||
// to avoid cache conflicts.
|
||||
|
||||
//-------------------------------------------------------
|
||||
// global refresh variables
|
||||
//-------------------------------------------------------
|
||||
// global refresh variables -----------------------------
|
||||
|
||||
// FIXME: make into one big structure, like cl or sv
|
||||
// FIXME: do separately for refresh engine and driver
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
cl_trans.c
|
||||
sw_skin.c
|
||||
|
||||
(description)
|
||||
|
||||
|
@ -41,6 +41,7 @@
|
|||
|
||||
#include "render.h"
|
||||
|
||||
|
||||
void
|
||||
Skin_Set_Translate (int top, int bottom, byte *dest)
|
||||
{
|
||||
|
@ -69,16 +70,19 @@ Skin_Set_Translate (int top, int bottom, byte *dest)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
Skin_Do_Translation (skin_t *player_skin, int slot)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
Skin_Init_Translation (void)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
Skin_Process (skin_t *skin, struct tex_s *tex)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue