whitespace...

This commit is contained in:
Ragnvald Maartmann-Moe IV 2001-05-15 21:13:07 +00:00
parent 8826182522
commit e7c2ed82db
28 changed files with 539 additions and 1145 deletions

View file

@ -39,16 +39,12 @@ static auxvert_t av[8];
void R_AliasProjectFinalVert (finalvert_t *fv, auxvert_t *av); void R_AliasProjectFinalVert (finalvert_t *fv, auxvert_t *av);
void R_Alias_clip_top (finalvert_t *pfv0, finalvert_t *pfv1, void R_Alias_clip_top (finalvert_t *pfv0, finalvert_t *pfv1,
finalvert_t *out); finalvert_t *out);
void R_Alias_clip_bottom (finalvert_t *pfv0, finalvert_t *pfv1, void R_Alias_clip_bottom (finalvert_t *pfv0, finalvert_t *pfv1,
finalvert_t *out); finalvert_t *out);
void R_Alias_clip_left (finalvert_t *pfv0, finalvert_t *pfv1, void R_Alias_clip_left (finalvert_t *pfv0, finalvert_t *pfv1,
finalvert_t *out); finalvert_t *out);
void R_Alias_clip_right (finalvert_t *pfv0, finalvert_t *pfv1, void R_Alias_clip_right (finalvert_t *pfv0, finalvert_t *pfv1,
finalvert_t *out); finalvert_t *out);
@ -228,9 +224,6 @@ R_AliasClip (finalvert_t *in, finalvert_t *out, int flag, int count,
} }
/*
R_AliasClipTriangle
*/
void void
R_AliasClipTriangle (mtriangle_t *ptri) R_AliasClipTriangle (mtriangle_t *ptri)
{ {

View file

@ -37,8 +37,8 @@
#include "r_local.h" #include "r_local.h"
#define LIGHT_MIN 5 // lowest light value we'll allow, to #define LIGHT_MIN 5 // lowest light value we'll allow, to
// avoid the // avoid the need for inner-loop light
// need for inner-loop light clamping // clamping
mtriangle_t *ptriangles; mtriangle_t *ptriangles;
affinetridesc_t r_affinetridesc; affinetridesc_t r_affinetridesc;
@ -86,7 +86,6 @@ float r_avertexnormals[NUMVERTEXNORMALS][3] = {
}; };
void R_AliasTransformAndProjectFinalVerts (finalvert_t *fv, void R_AliasTransformAndProjectFinalVerts (finalvert_t *fv,
stvert_t *pstverts); stvert_t *pstverts);
void R_AliasSetUpTransform (int trivial_accept); void R_AliasSetUpTransform (int trivial_accept);
void R_AliasTransformVector (vec3_t in, vec3_t out); 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); void R_AliasProjectFinalVert (finalvert_t *fv, auxvert_t *av);
/*
R_AliasCheckBBox
*/
qboolean qboolean
R_AliasCheckBBox (void) R_AliasCheckBBox (void)
{ {
@ -112,7 +108,6 @@ R_AliasCheckBBox (void)
int minz; int minz;
// expand, rotate, and translate points into worldspace // expand, rotate, and translate points into worldspace
currententity->trivial_accept = 0; currententity->trivial_accept = 0;
pmodel = currententity->model; pmodel = currententity->model;
pahdr = Mod_Extradata (pmodel); pahdr = Mod_Extradata (pmodel);
@ -176,8 +171,7 @@ R_AliasCheckBBox (void)
if (zclipped) { if (zclipped) {
// organize points by edges, use edges to get new points (possible // organize points by edges, use edges to get new points (possible
// trivial // trivial reject)
// reject)
for (i = 0; i < 12; i++) { for (i = 0; i < 12; i++) {
// edge endpoints // edge endpoints
pv0 = &viewpts[aedges[i].index0]; pv0 = &viewpts[aedges[i].index0];
@ -245,9 +239,6 @@ R_AliasCheckBBox (void)
} }
/*
R_AliasTransformVector
*/
void void
R_AliasTransformVector (vec3_t in, vec3_t out) R_AliasTransformVector (vec3_t in, vec3_t out)
{ {
@ -295,9 +286,7 @@ R_AliasPreparePoints (void)
} }
} }
//
// clip and draw all triangles // clip and draw all triangles
//
r_affinetridesc.numtriangles = 1; r_affinetridesc.numtriangles = 1;
ptri = (mtriangle_t *) ((byte *) paliashdr + paliashdr->triangles); ptri = (mtriangle_t *) ((byte *) paliashdr + paliashdr->triangles);
@ -322,9 +311,6 @@ R_AliasPreparePoints (void)
} }
/*
R_AliasSetUpTransform
*/
void void
R_AliasSetUpTransform (int trivial_accept) R_AliasSetUpTransform (int trivial_accept)
{ {
@ -396,9 +382,6 @@ R_AliasSetUpTransform (int trivial_accept)
} }
/*
R_AliasTransformFinalVert
*/
void void
R_AliasTransformFinalVert (finalvert_t *fv, auxvert_t *av, R_AliasTransformFinalVert (finalvert_t *fv, auxvert_t *av,
trivertx_t *pverts, stvert_t *pstverts) trivertx_t *pverts, stvert_t *pstverts)
@ -427,8 +410,7 @@ R_AliasTransformFinalVert (finalvert_t *fv, auxvert_t *av,
temp += (int) (r_shadelight * lightcos); temp += (int) (r_shadelight * lightcos);
// clamp; because we limited the minimum ambient and shading light, // clamp; because we limited the minimum ambient and shading light,
// we // we don't have to clamp low light, just bright
// don't have to clamp low light, just bright
if (temp < 0) if (temp < 0)
temp = 0; temp = 0;
} }
@ -438,10 +420,6 @@ R_AliasTransformFinalVert (finalvert_t *fv, auxvert_t *av,
#ifndef USE_INTEL_ASM #ifndef USE_INTEL_ASM
/*
R_AliasTransformAndProjectFinalVerts
*/
void void
R_AliasTransformAndProjectFinalVerts (finalvert_t *fv, stvert_t *pstverts) R_AliasTransformAndProjectFinalVerts (finalvert_t *fv, stvert_t *pstverts)
{ {
@ -489,13 +467,9 @@ R_AliasTransformAndProjectFinalVerts (finalvert_t *fv, stvert_t *pstverts)
fv->v[4] = temp; fv->v[4] = temp;
} }
} }
#endif #endif
/*
R_AliasProjectFinalVert
*/
void void
R_AliasProjectFinalVert (finalvert_t *fv, auxvert_t *av) R_AliasProjectFinalVert (finalvert_t *fv, auxvert_t *av)
{ {
@ -511,9 +485,6 @@ R_AliasProjectFinalVert (finalvert_t *fv, auxvert_t *av)
} }
/*
R_AliasPrepareUnclippedPoints
*/
void void
R_AliasPrepareUnclippedPoints (void) R_AliasPrepareUnclippedPoints (void)
{ {
@ -538,9 +509,7 @@ R_AliasPrepareUnclippedPoints (void)
D_PolysetDraw (); D_PolysetDraw ();
} }
/*
R_AliasSetupSkin
*/
void void
R_AliasSetupSkin (void) R_AliasSetupSkin (void)
{ {
@ -590,15 +559,12 @@ R_AliasSetupSkin (void)
r_affinetridesc.skinheight = pmdl->skinheight; r_affinetridesc.skinheight = pmdl->skinheight;
} }
/*
R_AliasSetupLighting
*/
void void
R_AliasSetupLighting (alight_t *plighting) R_AliasSetupLighting (alight_t *plighting)
{ {
// guarantee that no vertex will ever be lit below LIGHT_MIN, so we don't
// guarantee that no vertex will ever be lit below LIGHT_MIN, so we don't have // have to clamp off the bottom
// to clamp off the bottom
r_ambientlight = plighting->ambientlight; r_ambientlight = plighting->ambientlight;
if (r_ambientlight < LIGHT_MIN) if (r_ambientlight < LIGHT_MIN)
@ -622,6 +588,7 @@ R_AliasSetupLighting (alight_t *plighting)
r_plightvec[2] = DotProduct (plighting->plightvec, alias_up); r_plightvec[2] = DotProduct (plighting->plightvec, alias_up);
} }
/* /*
R_AliasSetupFrame R_AliasSetupFrame
@ -655,10 +622,8 @@ R_AliasSetupFrame (void)
time = cl.time + currententity->syncbase; time = cl.time + currententity->syncbase;
//
// when loading in Mod_LoadAliasGroup, we guaranteed all interval values // when loading in Mod_LoadAliasGroup, we guaranteed all interval values
// are positive, so we don't have to worry about division by 0 // are positive, so we don't have to worry about division by 0
//
targettime = time - ((int) (time / fullinterval)) * fullinterval; targettime = time - ((int) (time / fullinterval)) * fullinterval;
for (i = 0; i < (numframes - 1); i++) { for (i = 0; i < (numframes - 1); i++) {
@ -671,9 +636,6 @@ R_AliasSetupFrame (void)
} }
/*
R_AliasDrawModel
*/
void void
R_AliasDrawModel (alight_t *plighting) R_AliasDrawModel (alight_t *plighting)
{ {

View file

@ -39,24 +39,16 @@
#include "r_local.h" #include "r_local.h"
#include "render.h" #include "render.h"
//
// current entity info // current entity info
//
qboolean insubmodel; qboolean insubmodel;
entity_t *currententity; entity_t *currententity;
vec3_t modelorg, base_modelorg; vec3_t modelorg, base_modelorg;
// modelorg is the viewpoint reletive to // modelorg is the viewpoint reletive to
// the currently rendering entity // the currently rendering entity
vec3_t r_entorigin; // the currently rendering entity in vec3_t r_entorigin; // the currently rendering entity in world
// world
// coordinates // coordinates
float entity_rotation[3][3]; float entity_rotation[3][3];
vec3_t r_worldmodelorg; vec3_t r_worldmodelorg;
int r_currentbkey; int r_currentbkey;
typedef enum { touchessolid, drawnode, nodrawnode } solidstate_t; typedef enum { touchessolid, drawnode, nodrawnode } solidstate_t;
@ -73,11 +65,6 @@ static mvertex_t *pfrontenter, *pfrontexit;
static qboolean makeclippededge; static qboolean makeclippededge;
//===========================================================================
/*
R_EntityRotate
*/
void void
R_EntityRotate (vec3_t vec) R_EntityRotate (vec3_t vec)
{ {
@ -90,9 +77,6 @@ R_EntityRotate (vec3_t vec)
} }
/*
R_RotateBmodel
*/
void void
R_RotateBmodel (void) R_RotateBmodel (void)
{ {
@ -119,7 +103,6 @@ R_RotateBmodel (void)
temp1[2][1] = 0; temp1[2][1] = 0;
temp1[2][2] = 1; temp1[2][2] = 1;
// pitch // pitch
angle = currententity->angles[PITCH]; angle = currententity->angles[PITCH];
angle = angle * M_PI * 2 / 360; angle = angle * M_PI * 2 / 360;
@ -156,9 +139,7 @@ R_RotateBmodel (void)
R_ConcatRotations (temp1, temp3, entity_rotation); R_ConcatRotations (temp1, temp3, entity_rotation);
//
// rotate modelorg and the transformation matrix // rotate modelorg and the transformation matrix
//
R_EntityRotate (modelorg); R_EntityRotate (modelorg);
R_EntityRotate (vpn); R_EntityRotate (vpn);
R_EntityRotate (vright); R_EntityRotate (vright);
@ -168,9 +149,6 @@ R_RotateBmodel (void)
} }
/*
R_RecursiveClipBPoly
*/
void void
R_RecursiveClipBPoly (bedge_t *pedges, mnode_t *pnode, msurface_t *psurf) 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 // draw or recurse further
for (i = 0; i < 2; i++) { for (i = 0; i < 2; i++) {
if (psideedges[i]) { if (psideedges[i]) {
// draw if we've reached a non-solid leaf, done if all that's // draw if we've reached a non-solid leaf, done if all that's left
// left is a // is a solid leaf, and continue down the tree if it's not a leaf
// solid leaf, and continue down the tree if it's not a leaf
pn = pnode->children[i]; pn = pnode->children[i];
// we're done with this branch if the node or leaf isn't in the // we're done with this branch if the node or leaf isn't in the PVS
// PVS
if (pn->visframe == r_visframecount) { if (pn->visframe == r_visframecount) {
if (pn->contents < 0) { if (pn->contents < 0) {
if (pn->contents != CONTENTS_SOLID) { if (pn->contents != CONTENTS_SOLID) {
@ -318,9 +294,6 @@ R_RecursiveClipBPoly (bedge_t *pedges, mnode_t *pnode, msurface_t *psurf)
} }
/*
R_DrawSolidClippedSubmodelPolygons
*/
void void
R_DrawSolidClippedSubmodelPolygons (model_t *pmodel) R_DrawSolidClippedSubmodelPolygons (model_t *pmodel)
{ {
@ -349,11 +322,9 @@ R_DrawSolidClippedSubmodelPolygons (model_t *pmodel)
if (((psurf->flags & SURF_PLANEBACK) && (dot < -BACKFACE_EPSILON)) || if (((psurf->flags & SURF_PLANEBACK) && (dot < -BACKFACE_EPSILON)) ||
(!(psurf->flags & SURF_PLANEBACK) && (dot > BACKFACE_EPSILON))) { (!(psurf->flags & SURF_PLANEBACK) && (dot > BACKFACE_EPSILON))) {
// FIXME: use bounding-box-based frustum clipping info? // FIXME: use bounding-box-based frustum clipping info?
// copy the edges to bedges, flipping if necessary so always // copy the edges to bedges, flipping if necessary so always
// clockwise winding // clockwise winding
// FIXME: if edges and vertices get caches, these assignments // FIXME: if edges and vertices get caches, these assignments must move
// must move
// outside the loop, and overflow checking must be done here // outside the loop, and overflow checking must be done here
pbverts = bverts; pbverts = bverts;
pbedges = bedges; pbedges = bedges;
@ -391,9 +362,6 @@ R_DrawSolidClippedSubmodelPolygons (model_t *pmodel)
} }
/*
R_DrawSubmodelPolygons
*/
void void
R_DrawSubmodelPolygons (model_t *pmodel, int clipflags) R_DrawSubmodelPolygons (model_t *pmodel, int clipflags)
{ {
@ -426,9 +394,6 @@ R_DrawSubmodelPolygons (model_t *pmodel, int clipflags)
} }
/*
R_RecursiveWorldNode
*/
void void
R_RecursiveWorldNode (mnode_t *node, int clipflags) R_RecursiveWorldNode (mnode_t *node, int clipflags)
{ {
@ -455,8 +420,7 @@ R_RecursiveWorldNode (mnode_t *node, int clipflags)
// generate accept and reject points // generate accept and reject points
// FIXME: do with fast look-ups or integer tests based on the // FIXME: do with fast look-ups or integer tests based on the
// sign bit // sign bit of the floating point values
// of the floating point values
pindex = pfrustum_indexes[i]; pindex = pfrustum_indexes[i];
@ -590,10 +554,6 @@ R_RecursiveWorldNode (mnode_t *node, int clipflags)
} }
/*
R_RenderWorld
*/
void void
R_RenderWorld (void) R_RenderWorld (void)
{ {
@ -610,8 +570,8 @@ R_RenderWorld (void)
R_RecursiveWorldNode (clmodel->nodes, 15); R_RecursiveWorldNode (clmodel->nodes, 15);
// if the driver wants the polygons back to front, play the visible ones back // if the driver wants the polygons back to front, play the visible ones
// in that order // back in that order
if (r_worldpolysbacktofront) { if (r_worldpolysbacktofront) {
for (i = numbtofpolys - 1; i >= 0; i--) { for (i = numbtofpolys - 1; i >= 0; i--) {
R_RenderPoly (btofpolys[i].psurf, btofpolys[i].clipflags); R_RenderPoly (btofpolys[i].psurf, btofpolys[i].clipflags);

View file

@ -47,8 +47,6 @@ zpointdesc_t r_zpointdesc;
polydesc_t r_polydesc; polydesc_t r_polydesc;
clipplane_t *entity_clipplanes; clipplane_t *entity_clipplanes;
clipplane_t view_clipplanes[4]; clipplane_t view_clipplanes[4];
clipplane_t world_clipplanes[16]; clipplane_t world_clipplanes[16];
@ -80,9 +78,6 @@ qboolean r_lastvertvalid;
#ifndef USE_INTEL_ASM #ifndef USE_INTEL_ASM
/*
R_EmitEdge
*/
void void
R_EmitEdge (mvertex_t *pv0, mvertex_t *pv1) 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); r_ceilv1 = (int) ceil (r_v1);
// create the edge // create the edge
if (ceilv0 == r_ceilv1) { if (ceilv0 == r_ceilv1) {
// we cache unclipped horizontal edges as fully clipped // 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; edge->u = u * 0x100000 + 0xFFFFF;
// we need to do this to avoid stepping off the edges if a very nearly // 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 // horizontal edge is less than epsilon above a scan, and numeric error
// it to incorrectly extend to the scan, and the extension of the line goes off // causes it to incorrectly extend to the scan, and the extension of the
// the edge of the screen // line goes off the edge of the screen
// FIXME: is this actually needed? // FIXME: is this actually needed?
if (edge->u < r_refdef.vrect_x_adj_shift20) if (edge->u < r_refdef.vrect_x_adj_shift20)
edge->u = r_refdef.vrect_x_adj_shift20; edge->u = r_refdef.vrect_x_adj_shift20;
if (edge->u > r_refdef.vrectright_adj_shift20) if (edge->u > r_refdef.vrectright_adj_shift20)
edge->u = r_refdef.vrectright_adj_shift20; edge->u = r_refdef.vrectright_adj_shift20;
//
// sort the edge in normally // sort the edge in normally
//
u_check = edge->u; u_check = edge->u;
if (edge->surfs[0]) if (edge->surfs[0])
u_check++; // sort trailers after leaders u_check++; // sort trailers after leaders
@ -247,9 +239,6 @@ R_EmitEdge (mvertex_t *pv0, mvertex_t *pv1)
} }
/*
R_ClipEdge
*/
void void
R_ClipEdge (mvertex_t *pv0, mvertex_t *pv1, clipplane_t *clip) 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 #endif // !USE_INTEL_ASM
/*
R_EmitCachedEdge
*/
void void
R_EmitCachedEdge (void) R_EmitCachedEdge (void)
{ {
@ -356,9 +342,6 @@ R_EmitCachedEdge (void)
} }
/*
R_RenderFace
*/
void void
R_RenderFace (msurface_t *fa, int clipflags) R_RenderFace (msurface_t *fa, int clipflags)
{ {
@ -525,9 +508,6 @@ R_RenderFace (msurface_t *fa, int clipflags)
} }
/*
R_RenderBmodelFace
*/
void void
R_RenderBmodelFace (bedge_t *pedges, msurface_t *psurf) R_RenderBmodelFace (bedge_t *pedges, msurface_t *psurf)
{ {
@ -628,9 +608,6 @@ R_RenderBmodelFace (bedge_t *pedges, msurface_t *psurf)
} }
/*
R_RenderPoly
*/
void void
R_RenderPoly (msurface_t *fa, int clipflags) 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]; pverts[i].t = verts[vertpage][i].position[t_axis];
} }
// build the polygon descriptor, including fa, r_nearzi, and u, v, s, t, and z // build the polygon descriptor, including fa, r_nearzi, and u, v, s, t,
// for each vertex // and z for each vertex
r_polydesc.numverts = lnumverts; r_polydesc.numverts = lnumverts;
r_polydesc.nearzi = r_nearzi; r_polydesc.nearzi = r_nearzi;
r_polydesc.pcurrentface = fa; r_polydesc.pcurrentface = fa;
@ -798,9 +775,6 @@ R_RenderPoly (msurface_t *fa, int clipflags)
} }
/*
R_ZDrawSubmodelPolys
*/
void void
R_ZDrawSubmodelPolys (model_t *pmodel) R_ZDrawSubmodelPolys (model_t *pmodel)
{ {

View file

@ -36,11 +36,10 @@
#if 0 #if 0
// FIXME // FIXME
the complex cases add new polys on most lines, the complex cases add new polys on most lines, so dont optimize for
so dont optimize for keeping them the same have multiple free span lists to keeping them the same have multiple free span lists to try to get better
try to get better coherence ? low depth complexity-- 1 to 3 or so this coherence ? low depth complexity-- 1 to 3 or so this breaks spans at every
breaks spans at every edge, even hidden edge, even hidden ones (bad)
ones (bad)
have a sentinal at both ends ? have a sentinal at both ends ?
#endif #endif
@ -75,25 +74,14 @@ edge_t edge_sentinel;
float fv; float fv;
void void R_GenerateSpans (void);
R_GenerateSpans (void); void R_GenerateSpansBackward (void);
void
R_GenerateSpansBackward (void);
void void R_LeadingEdge (edge_t *edge);
R_LeadingEdge (edge_t *edge); void R_LeadingEdgeBackwards (edge_t *edge);
void void R_TrailingEdge (surf_t *surf, edge_t *edge);
R_LeadingEdgeBackwards (edge_t *edge);
void
R_TrailingEdge (surf_t *surf, edge_t *edge);
//=============================================================================
/*
R_DrawCulledPolys
*/
void void
R_DrawCulledPolys (void) R_DrawCulledPolys (void)
{ {
@ -126,9 +114,6 @@ R_DrawCulledPolys (void)
} }
/*
R_BeginEdgeFrame
*/
void void
R_BeginEdgeFrame (void) R_BeginEdgeFrame (void)
{ {
@ -203,9 +188,6 @@ R_InsertNewEdges (edge_t *edgestoadd, edge_t *edgelist)
} }
/*
R_RemoveEdges
*/
void void
R_RemoveEdges (edge_t *pedge) R_RemoveEdges (edge_t *pedge)
{ {
@ -217,9 +199,6 @@ R_RemoveEdges (edge_t *pedge)
} }
/*
R_StepActiveU
*/
void void
R_StepActiveU (edge_t *pedge) R_StepActiveU (edge_t *pedge)
{ {
@ -282,9 +261,6 @@ R_StepActiveU (edge_t *pedge)
#endif // !USE_INTEL_ASM #endif // !USE_INTEL_ASM
/*
R_CleanupSpan
*/
void void
R_CleanupSpan (void) R_CleanupSpan (void)
{ {
@ -312,9 +288,6 @@ R_CleanupSpan (void)
} }
/*
R_LeadingEdgeBackwards
*/
void void
R_LeadingEdgeBackwards (edge_t *edge) 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 // active is in front, so keep going unless it's a bmodel
if (surf->insubmodel && (surf->key == surf2->key)) { if (surf->insubmodel && (surf->key == surf2->key)) {
// must be two bmodels in the same leaf; don't care, because // must be two bmodels in the same leaf; don't care, because
// they'll // they'll never be farthest anyway
// never be farthest anyway
goto newtop; goto newtop;
} }
@ -355,8 +327,7 @@ R_LeadingEdgeBackwards (edge_t *edge)
if (!surf->insubmodel) if (!surf->insubmodel)
goto continue_search; goto continue_search;
// must be two bmodels in the same leaf; don't care which is // must be two bmodels in the same leaf; don't care which is really
// really
// in front, because they'll never be farthest anyway // in front, because they'll never be farthest anyway
} }
@ -387,18 +358,14 @@ R_LeadingEdgeBackwards (edge_t *edge)
} }
/*
R_TrailingEdge
*/
void void
R_TrailingEdge (surf_t *surf, edge_t *edge) R_TrailingEdge (surf_t *surf, edge_t *edge)
{ {
espan_t *span; espan_t *span;
int iu; int iu;
// don't generate a span if this is an inverted span, with the end // don't generate a span if this is an inverted span, with the end edge
// edge preceding the start edge (that is, we haven't seen the // preceding the start edge (that is, we haven't seen the start edge yet)
// start edge yet)
if (--surf->spanstate == 0) { if (--surf->spanstate == 0) {
if (surf->insubmodel) if (surf->insubmodel)
r_bmodelactive--; r_bmodelactive--;
@ -426,9 +393,6 @@ R_TrailingEdge (surf_t *surf, edge_t *edge)
#ifndef USE_INTEL_ASM #ifndef USE_INTEL_ASM
/*
R_LeadingEdge
*/
void void
R_LeadingEdge (edge_t *edge) 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 // it's adding a new surface in, so find the correct place
surf = &surfaces[edge->surfs[1]]; surf = &surfaces[edge->surfs[1]];
// don't start a span if this is an inverted span, with the end // don't start a span if this is an inverted span, with the end edge
// edge preceding the start edge (that is, we've already seen the // preceding the start edge (that is, we've already seen the end edge)
// end edge)
if (++surf->spanstate == 1) { if (++surf->spanstate == 1) {
if (surf->insubmodel) if (surf->insubmodel)
r_bmodelactive++; r_bmodelactive++;
@ -541,9 +504,6 @@ R_LeadingEdge (edge_t *edge)
} }
/*
R_GenerateSpans
*/
void void
R_GenerateSpans (void) R_GenerateSpans (void)
{ {
@ -559,8 +519,7 @@ R_GenerateSpans (void)
// generate spans // generate spans
for (edge = edge_head.next; edge != &edge_tail; edge = edge->next) { for (edge = edge_head.next; edge != &edge_tail; edge = edge->next) {
if (edge->surfs[0]) { if (edge->surfs[0]) {
// it has a left surface, so a surface is going away for this // it has a left surface, so a surface is going away for this span
// span
surf = &surfaces[edge->surfs[0]]; surf = &surfaces[edge->surfs[0]];
R_TrailingEdge (surf, edge); R_TrailingEdge (surf, edge);
@ -578,9 +537,6 @@ R_GenerateSpans (void)
#endif // !USE_INTEL_ASM #endif // !USE_INTEL_ASM
/*
R_GenerateSpansBackward
*/
void void
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.u = 2000 << 24; // make sure nothing sorts past this
edge_sentinel.prev = &edge_aftertail; edge_sentinel.prev = &edge_aftertail;
//
// process all scan lines // process all scan lines
//
bottom = r_refdef.vrectbottom - 1; bottom = r_refdef.vrectbottom - 1;
for (iv = r_refdef.vrect.y; iv < bottom; iv++) { for (iv = r_refdef.vrect.y; iv < bottom; iv++) {
@ -675,8 +629,7 @@ R_ScanEdges (void)
(*pdrawfunc) (); (*pdrawfunc) ();
// flush the span list if we can't be sure we have enough spans left // flush the span list if we can't be sure we have enough spans left
// for // for the next scan
// the next scan
if (span_p >= max_span_p) { if (span_p >= max_span_p) {
VID_UnlockBuffer (); VID_UnlockBuffer ();
S_ExtraUpdate (); // don't let sound get messed up if 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) // do the last scan (no need to step or sort or remove on the last scan)
current_iv = iv; current_iv = iv;
fv = (float) iv; fv = (float) iv;

View file

@ -36,15 +36,11 @@
int r_dlightframecount; int r_dlightframecount;
/*
R_AnimateLight
*/
void void
R_AnimateLight (void) R_AnimateLight (void)
{ {
int i, j, k; int i, j, k;
//
// light animations // light animations
// 'm' is normal light, 'a' is no light, 'z' is double bright // 'm' is normal light, 'a' is no light, 'z' is double bright
i = (int) (cl.time * 10); i = (int) (cl.time * 10);
@ -65,9 +61,7 @@ R_AnimateLight (void)
DYNAMIC LIGHTS DYNAMIC LIGHTS
*/ */
/*
R_MarkLights
*/
void void
R_MarkLights (vec3_t lightorigin, dlight_t *light, int bit, mnode_t *node) 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 void
R_PushDlights (vec3_t entorigin) R_PushDlights (vec3_t entorigin)
{ {
@ -132,6 +123,7 @@ R_PushDlights (vec3_t entorigin)
LIGHT SAMPLING LIGHT SAMPLING
*/ */
int int
RecursiveLightPoint (mnode_t *node, vec3_t start, vec3_t end) 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 return -1; // didn't hit anything
// calculate mid point // calculate mid point
// FIXME: optimize for axial // FIXME: optimize for axial
plane = node->plane; plane = node->plane;
front = DotProduct (start, plane->normal) - plane->dist; 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); return RecursiveLightPoint (node->children[!side], mid, end);
} }
int int
R_LightPoint (vec3_t p) R_LightPoint (vec3_t p)
{ {

View file

@ -85,17 +85,13 @@ byte *r_stack_start;
qboolean r_fov_greater_than_90; qboolean r_fov_greater_than_90;
//
// view origin // view origin
//
vec3_t vup, base_vup; vec3_t vup, base_vup;
vec3_t vpn, base_vpn; vec3_t vpn, base_vpn;
vec3_t vright, base_vright; vec3_t vright, base_vright;
vec3_t r_origin; vec3_t r_origin;
//
// screen size info // screen size info
//
refdef_t r_refdef; refdef_t r_refdef;
float xcenter, ycenter; float xcenter, ycenter;
float xscale, yscale; float xscale, yscale;
@ -112,11 +108,8 @@ float xOrigin, yOrigin;
mplane_t screenedge[4]; mplane_t screenedge[4];
//
// refresh flags // refresh flags
//
int r_framecount = 1; // so frame counts initialized to 0 int r_framecount = 1; // so frame counts initialized to 0
// don't match // don't match
int r_visframecount; int r_visframecount;
int d_spanpixcount; int d_spanpixcount;
@ -132,10 +125,8 @@ int *pfrustum_indexes[4];
int r_frustum_indexes[4 * 6]; int r_frustum_indexes[4 * 6];
int reinit_surfcache = 1; // if 1, surface cache is currently int reinit_surfcache = 1; // if 1, surface cache is currently
// empty and must be reinitialized
// empty and // for current cache size
// must be reinitialized for current cache
// size
mleaf_t *r_viewleaf, *r_oldviewleaf; mleaf_t *r_viewleaf, *r_oldviewleaf;
@ -155,9 +146,6 @@ extern cvar_t *scr_fov;
void R_NetGraph (void); void R_NetGraph (void);
void R_ZGraph (void); void R_ZGraph (void);
/*
R_Textures_Init
*/
void void
R_Textures_Init (void) R_Textures_Init (void)
{ {
@ -188,11 +176,9 @@ R_Textures_Init (void)
} }
} }
void R_LoadSky_f (void); void R_LoadSky_f (void);
/*
R_Init
*/
void void
R_Init (void) R_Init (void)
{ {
@ -203,8 +189,10 @@ R_Init (void)
R_InitTurb (); R_InitTurb ();
Cmd_AddCommand ("timerefresh", R_TimeRefresh_f, "Tests the current refresh rate for the current location"); Cmd_AddCommand ("timerefresh", R_TimeRefresh_f, "Tests the current "
Cmd_AddCommand ("pointfile", R_ReadPointFile_f, "Load a pointfile to determine map leaks"); "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"); Cmd_AddCommand ("loadsky", R_LoadSky_f, "Load a skybox");
Cvar_SetValue (r_maxedges, (float) NUMSTACKEDGES); Cvar_SetValue (r_maxedges, (float) NUMSTACKEDGES);
@ -231,9 +219,7 @@ R_Init (void)
D_Init (); D_Init ();
} }
/*
R_NewMap
*/
void void
R_NewMap (void) R_NewMap (void)
{ {
@ -286,9 +272,6 @@ R_NewMap (void)
} }
/*
R_SetVrect
*/
void void
R_SetVrect (vrect_t *pvrectin, vrect_t *pvrect, int lineadj) 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 void
R_MarkLeaves (void) R_MarkLeaves (void)
{ {
@ -508,11 +488,7 @@ R_MarkLeaves (void)
} }
} }
/*
=============
R_ShowNearestLoc
=============
*/
static void static void
R_ShowNearestLoc (void) R_ShowNearestLoc (void)
{ {
@ -535,9 +511,7 @@ R_ShowNearestLoc (void)
} }
} }
/*
R_DrawEntitiesOnList
*/
void void
R_DrawEntitiesOnList (void) R_DrawEntitiesOnList (void)
{ {
@ -577,8 +551,7 @@ R_DrawEntitiesOnList (void)
VectorSubtract (r_origin, r_entorigin, modelorg); VectorSubtract (r_origin, r_entorigin, modelorg);
// see if the bounding box lets us trivially reject, also // see if the bounding box lets us trivially reject, also
// sets // sets trivial accept status
// trivial accept status
if (R_AliasCheckBBox ()) { if (R_AliasCheckBBox ()) {
j = R_LightPoint (currententity->origin); j = R_LightPoint (currententity->origin);
@ -615,9 +588,7 @@ R_DrawEntitiesOnList (void)
} }
} }
/*
R_DrawViewModel
*/
void void
R_DrawViewModel (void) R_DrawViewModel (void)
{ {
@ -687,9 +658,6 @@ R_DrawViewModel (void)
} }
/*
R_BmodelCheckBBox
*/
int int
R_BmodelCheckBBox (model_t *clmodel, float *minmaxs) R_BmodelCheckBBox (model_t *clmodel, float *minmaxs)
{ {
@ -715,8 +683,7 @@ R_BmodelCheckBBox (model_t *clmodel, float *minmaxs)
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
// generate accept and reject points // generate accept and reject points
// FIXME: do with fast look-ups or integer tests based on the // FIXME: do with fast look-ups or integer tests based on the
// sign bit // sign bit of the floating point values
// of the floating point values
pindex = pfrustum_indexes[i]; pindex = pfrustum_indexes[i];
@ -746,9 +713,6 @@ R_BmodelCheckBBox (model_t *clmodel, float *minmaxs)
} }
/*
R_DrawBEntitiesOnList
*/
void void
R_DrawBEntitiesOnList (void) R_DrawBEntitiesOnList (void)
{ {
@ -773,8 +737,7 @@ R_DrawBEntitiesOnList (void)
clmodel = currententity->model; clmodel = currententity->model;
// see if the bounding box lets us trivially reject, also // see if the bounding box lets us trivially reject, also
// sets // sets trivial accept status
// trivial accept status
for (j = 0; j < 3; j++) { for (j = 0; j < 3; j++) {
minmaxs[j] = currententity->origin[j] + clmodel->mins[j]; minmaxs[j] = currententity->origin[j] + clmodel->mins[j];
minmaxs[3 + j] = currententity->origin[j] + minmaxs[3 + j] = currententity->origin[j] +
@ -811,10 +774,8 @@ R_DrawBEntitiesOnList (void)
} }
} }
// if the driver wants polygons, deliver those. // if the driver wants polygons, deliver those.
// Z-buffering is on // Z-buffering is on at this point, so no clipping to the
// at this point, so no clipping to the world tree is // world tree is needed, just frustum clipping
// needed, just
// frustum clipping
if (r_drawpolys | r_drawculledpolys) { if (r_drawpolys | r_drawculledpolys) {
R_ZDrawSubmodelPolys (clmodel); R_ZDrawSubmodelPolys (clmodel);
} else { } else {
@ -837,10 +798,8 @@ R_DrawBEntitiesOnList (void)
R_DrawSolidClippedSubmodelPolygons (clmodel); R_DrawSolidClippedSubmodelPolygons (clmodel);
} else { } else {
// falls entirely in one leaf, so we just put // falls entirely in one leaf, so we just put
// all the // all the edges in the edge list and let 1/z
// edges in the edge list and let 1/z sorting // sorting handle drawing order
// handle
// drawing order
R_DrawSubmodelPolygons (clmodel, clipflags); R_DrawSubmodelPolygons (clmodel, clipflags);
} }
@ -869,17 +828,12 @@ R_DrawBEntitiesOnList (void)
} }
/*
R_EdgeDrawing
*/
void void
R_EdgeDrawing (void) R_EdgeDrawing (void)
{ {
edge_t ledges[NUMSTACKEDGES + edge_t ledges[NUMSTACKEDGES +
((CACHE_SIZE - 1) / sizeof (edge_t)) + 1]; ((CACHE_SIZE - 1) / sizeof (edge_t)) + 1];
surf_t lsurfs[NUMSTACKSURFACES + surf_t lsurfs[NUMSTACKSURFACES +
((CACHE_SIZE - 1) / sizeof (surf_t)) + 1]; ((CACHE_SIZE - 1) / sizeof (surf_t)) + 1];
if (auxedges) { if (auxedges) {
@ -910,8 +864,8 @@ R_EdgeDrawing (void)
if (r_drawculledpolys) if (r_drawculledpolys)
R_ScanEdges (); R_ScanEdges ();
// only the world can be drawn back to front with no z reads or compares, just // only the world can be drawn back to front with no z reads or compares,
// z writes, so have the driver turn z compares on now // just z writes, so have the driver turn z compares on now
D_TurnZOn (); D_TurnZOn ();
if (r_dspeeds->int_val) { if (r_dspeeds->int_val) {
@ -928,8 +882,7 @@ R_EdgeDrawing (void)
if (!r_dspeeds->int_val) { if (!r_dspeeds->int_val) {
VID_UnlockBuffer (); VID_UnlockBuffer ();
S_ExtraUpdate (); // don't let sound get messed up if S_ExtraUpdate (); // don't let sound get messed up if going slow
// going slow
VID_LockBuffer (); VID_LockBuffer ();
} }
@ -957,8 +910,7 @@ R_RenderView_ (void)
R_SetupFrame (); R_SetupFrame ();
R_MarkLeaves (); // done here so we know if we're in R_MarkLeaves (); // done here so we know if we're in water
// water
// make FDIV fast. This reduces timing precision after we've been running for a // 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 // 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) { if (!r_dspeeds->int_val) {
VID_UnlockBuffer (); VID_UnlockBuffer ();
S_ExtraUpdate (); // don't let sound get messed up if S_ExtraUpdate (); // don't let sound get messed up if going slow
// going slow
VID_LockBuffer (); VID_LockBuffer ();
} }
@ -980,8 +931,7 @@ R_RenderView_ (void)
if (!r_dspeeds->int_val) { if (!r_dspeeds->int_val) {
VID_UnlockBuffer (); VID_UnlockBuffer ();
S_ExtraUpdate (); // don't let sound get messed up if S_ExtraUpdate (); // don't let sound get messed up if going slow
// going slow
VID_LockBuffer (); VID_LockBuffer ();
} }
@ -1036,6 +986,7 @@ R_RenderView_ (void)
Sys_HighFPPrecision (); Sys_HighFPPrecision ();
} }
void void
R_RenderView (void) R_RenderView (void)
{ {
@ -1058,9 +1009,7 @@ R_RenderView (void)
R_RenderView_ (); R_RenderView_ ();
} }
/*
R_InitTurb
*/
void void
R_InitTurb (void) R_InitTurb (void)
{ {

View file

@ -43,9 +43,7 @@
#include "server.h" #include "server.h"
#include "view.h" #include "view.h"
qboolean allowskybox; // whether or not to allow skyboxes qboolean allowskybox; // whether or not to allow skyboxes --KB
// --KB
void void
@ -176,14 +174,16 @@ R_LineGraph (int x, int y, int h)
#endif #endif
} }
#define MAX_TIMINGS 100
extern float mouse_x, mouse_y;
int graphval;
/* /*
R_TimeGraph R_TimeGraph
Performance monitoring tool Performance monitoring tool
*/ */
#define MAX_TIMINGS 100
extern float mouse_x, mouse_y;
int graphval;
void void
R_TimeGraph (void) R_TimeGraph (void)
{ {
@ -215,8 +215,7 @@ R_TimeGraph (void)
do { do {
R_LineGraph (x, r_refdef.vrect.height - 2, r_timings[a]); R_LineGraph (x, r_refdef.vrect.height - 2, r_timings[a]);
if (x == 0) if (x == 0)
break; // screen too small to hold entire break; // screen too small to hold entire thing
// thing
x--; x--;
a--; a--;
if (a == -1) if (a == -1)
@ -376,7 +375,6 @@ R_TransformFrustum (void)
#ifndef USE_INTEL_ASM #ifndef USE_INTEL_ASM
void void
TransformVector (vec3_t in, vec3_t out) TransformVector (vec3_t in, vec3_t out)
{ {
@ -384,7 +382,6 @@ TransformVector (vec3_t in, vec3_t out)
out[1] = DotProduct (in, vup); out[1] = DotProduct (in, vup);
out[2] = DotProduct (in, vpn); out[2] = DotProduct (in, vpn);
} }
#endif #endif
@ -458,8 +455,7 @@ R_SetupFrame (void)
r_refdef.ambientlight = max (r_ambient->value, 0); r_refdef.ambientlight = max (r_ambient->value, 0);
if (!sv.active) if (!sv.active)
Cvar_SetValue (r_draworder, 0); // don't let cheaters look behind Cvar_SetValue (r_draworder, 0); // don't let cheaters look behind walls
// walls
R_CheckVariables (); R_CheckVariables ();
@ -566,6 +562,7 @@ R_SetupFrame (void)
D_SetupFrame (); D_SetupFrame ();
} }
void void
R_TranslatePlayerSkin (int playernum) R_TranslatePlayerSkin (int playernum)
{ {

View file

@ -53,14 +53,17 @@ int r_numparticles;
vec3_t r_pright, r_pup, r_ppn; vec3_t r_pright, r_pup, r_ppn;
/* /*
R_MaxParticlesCheck 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 void
R_MaxParticlesCheck (cvar_t *var) 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); r_numparticles = max(var->int_val, 1);
/* /*

View file

@ -50,12 +50,10 @@ int r_skydirect; // not used?
byte bottomsky[128 * 131]; byte bottomsky[128 * 131];
byte bottommask[128 * 131]; byte bottommask[128 * 131];
byte newsky[128 * 256]; // newsky and topsky both pack in byte newsky[128 * 256]; // newsky and topsky both pack in here, 128
// bytes of newsky on the left of each scan,
// here, 128 bytes // 128 bytes of topsky on the right, because
// of newsky on the left of each scan, 128 bytes // the low-level drawers need 256-byte widths
// of topsky on the right, because the low-level
// drawers need 256-byte scan widths
/* /*
@ -93,9 +91,6 @@ R_InitSky (texture_t *mt)
} }
/*
R_MakeSky
*/
void void
R_MakeSky (void) R_MakeSky (void)
{ {
@ -121,7 +116,6 @@ R_MakeSky (void)
// FIXME: clean this up // FIXME: clean this up
#if UNALIGNED_OK #if UNALIGNED_OK
for (x = 0; x < SKYSIZE; x += 4) { for (x = 0; x < SKYSIZE; x += 4) {
ofs = baseofs + ((x + xshift) & SKYMASK); ofs = baseofs + ((x + xshift) & SKYMASK);
@ -133,9 +127,7 @@ R_MakeSky (void)
pnewsky++; pnewsky++;
} }
#else #else
for (x = 0; x < SKYSIZE; x++) { for (x = 0; x < SKYSIZE; x++) {
ofs = baseofs + ((x + xshift) & SKYMASK); ofs = baseofs + ((x + xshift) & SKYMASK);
@ -144,7 +136,6 @@ R_MakeSky (void)
*(byte *) & bottomsky[ofs]; *(byte *) & bottomsky[ofs];
pnewsky = (unsigned int *) ((byte *) pnewsky + 1); pnewsky = (unsigned int *) ((byte *) pnewsky + 1);
} }
#endif #endif
pnewsky += 128 / sizeof (unsigned int); pnewsky += 128 / sizeof (unsigned int);
@ -154,9 +145,6 @@ R_MakeSky (void)
} }
/*
R_GenSkyTile
*/
void void
R_GenSkyTile (void *pdest) R_GenSkyTile (void *pdest)
{ {
@ -177,7 +165,6 @@ R_GenSkyTile (void *pdest)
// FIXME: clean this up // FIXME: clean this up
#if UNALIGNED_OK #if UNALIGNED_OK
for (x = 0; x < SKYSIZE; x += 4) { for (x = 0; x < SKYSIZE; x += 4) {
ofs = baseofs + ((x + xshift) & SKYMASK); ofs = baseofs + ((x + xshift) & SKYMASK);
@ -190,9 +177,7 @@ R_GenSkyTile (void *pdest)
pnewsky++; pnewsky++;
pd++; pd++;
} }
#else #else
for (x = 0; x < SKYSIZE; x++) { for (x = 0; x < SKYSIZE; x++) {
ofs = baseofs + ((x + xshift) & SKYMASK); ofs = baseofs + ((x + xshift) & SKYMASK);
@ -202,7 +187,6 @@ R_GenSkyTile (void *pdest)
pnewsky = (unsigned int *) ((byte *) pnewsky + 1); pnewsky = (unsigned int *) ((byte *) pnewsky + 1);
pd = (unsigned int *) ((byte *) pd + 1); pd = (unsigned int *) ((byte *) pd + 1);
} }
#endif #endif
pnewsky += 128 / sizeof (unsigned int); pnewsky += 128 / sizeof (unsigned int);
@ -210,9 +194,6 @@ R_GenSkyTile (void *pdest)
} }
/*
R_GenSkyTile16
*/
void void
R_GenSkyTile16 (void *pdest) R_GenSkyTile16 (void *pdest)
{ {
@ -248,9 +229,6 @@ R_GenSkyTile16 (void *pdest)
} }
/*
R_SetSkyFrame
*/
void void
R_SetSkyFrame (void) R_SetSkyFrame (void)
{ {

View file

@ -51,9 +51,6 @@ static int sprite_width, sprite_height;
spritedesc_t r_spritedesc; spritedesc_t r_spritedesc;
/*
R_RotateSprite
*/
void void
R_RotateSprite (float beamlength) R_RotateSprite (float beamlength)
{ {
@ -105,7 +102,6 @@ R_ClipSpriteFace (int nump, clipplane_t *pclipplane)
dists[nump] = dists[0]; dists[nump] = dists[0];
memcpy (instep, in, sizeof (vec5_t)); memcpy (instep, in, sizeof (vec5_t));
// clip the winding // clip the winding
instep = in; instep = in;
outcount = 0; outcount = 0;
@ -114,7 +110,6 @@ R_ClipSpriteFace (int nump, clipplane_t *pclipplane)
if (dists[i] >= 0) { if (dists[i] >= 0) {
memcpy (outstep, instep, sizeof (vec5_t)); memcpy (outstep, instep, sizeof (vec5_t));
outstep += sizeof (vec5_t) / sizeof (float); outstep += sizeof (vec5_t) / sizeof (float);
outcount++; outcount++;
} }
@ -144,9 +139,6 @@ R_ClipSpriteFace (int nump, clipplane_t *pclipplane)
} }
/*
R_SetupAndDrawSprite
*/
void void
R_SetupAndDrawSprite (void) R_SetupAndDrawSprite (void)
{ {
@ -241,9 +233,6 @@ R_SetupAndDrawSprite (void)
} }
/*
R_GetSpriteframe
*/
mspriteframe_t * mspriteframe_t *
R_GetSpriteframe (msprite_t *psprite) R_GetSpriteframe (msprite_t *psprite)
{ {
@ -270,8 +259,7 @@ R_GetSpriteframe (msprite_t *psprite)
time = cl.time + currententity->syncbase; time = cl.time + currententity->syncbase;
// when loading in Mod_LoadSpriteGroup, we guaranteed all interval // when loading in Mod_LoadSpriteGroup, we guaranteed all interval
// values // values are positive, so we don't have to worry about division by 0
// are positive, so we don't have to worry about division by 0
targettime = time - ((int) (time / fullinterval)) * fullinterval; targettime = time - ((int) (time / fullinterval)) * fullinterval;
for (i = 0; i < (numframes - 1); i++) { for (i = 0; i < (numframes - 1); i++) {
@ -286,9 +274,6 @@ R_GetSpriteframe (msprite_t *psprite)
} }
/*
R_DrawSprite
*/
void void
R_DrawSprite (void) R_DrawSprite (void)
{ {
@ -306,16 +291,12 @@ R_DrawSprite (void)
// TODO: make this caller-selectable // TODO: make this caller-selectable
if (psprite->type == SPR_FACING_UPRIGHT) { if (psprite->type == SPR_FACING_UPRIGHT) {
// generate the sprite's axes, with vup straight up in worldspace, // generate the sprite's axes, with vup straight up in worldspace, and
// and
// r_spritedesc.vright perpendicular to modelorg. // r_spritedesc.vright perpendicular to modelorg.
// This will not work if the view direction is very close to straight // This will not work if the view direction is very close to straight
// up or // up or down, because the cross product will be between two nearly
// down, because the cross product will be between two nearly // parallel vectors and starts to approach an undefined state, so we
// parallel // don't draw if the two vectors are less than 1 degree apart
// 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[0] = -modelorg[0];
tvec[1] = -modelorg[1]; tvec[1] = -modelorg[1];
tvec[2] = -modelorg[2]; tvec[2] = -modelorg[2];
@ -342,26 +323,20 @@ R_DrawSprite (void)
// r_spritedesc.vpn) // r_spritedesc.vpn)
} else if (psprite->type == SPR_VP_PARALLEL) { } else if (psprite->type == SPR_VP_PARALLEL) {
// generate the sprite's axes, completely parallel to the viewplane. // generate the sprite's axes, completely parallel to the viewplane.
// There // There are no problem situations, because the sprite is always in the
// are no problem situations, because the sprite is always in the // same position relative to the viewer
// same
// position relative to the viewer
for (i = 0; i < 3; i++) { for (i = 0; i < 3; i++) {
r_spritedesc.vup[i] = vup[i]; r_spritedesc.vup[i] = vup[i];
r_spritedesc.vright[i] = vright[i]; r_spritedesc.vright[i] = vright[i];
r_spritedesc.vpn[i] = vpn[i]; r_spritedesc.vpn[i] = vpn[i];
} }
} else if (psprite->type == SPR_VP_PARALLEL_UPRIGHT) { } else if (psprite->type == SPR_VP_PARALLEL_UPRIGHT) {
// generate the sprite's axes, with vup straight up in worldspace, // generate the sprite's axes, with vup straight up in worldspace, and
// and
// r_spritedesc.vright parallel to the viewplane. // r_spritedesc.vright parallel to the viewplane.
// This will not work if the view direction is very close to straight // This will not work if the view direction is very close to straight
// up or // up or down, because the cross product will be between two nearly
// down, because the cross product will be between two nearly // parallel vectors and starts to approach an undefined state, so we
// parallel // don't draw if the two vectors are less than 1 degree apart
// 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, dot = vpn[2]; // same as DotProduct (vpn,
// r_spritedesc.vup) because // r_spritedesc.vup) because
// r_spritedesc.vup is 0, 0, 1 // r_spritedesc.vup is 0, 0, 1
@ -388,9 +363,8 @@ R_DrawSprite (void)
r_spritedesc.vright, r_spritedesc.vup); r_spritedesc.vright, r_spritedesc.vup);
} else if (psprite->type == SPR_VP_PARALLEL_ORIENTED) { } else if (psprite->type == SPR_VP_PARALLEL_ORIENTED) {
// generate the sprite's axes, parallel to the viewplane, but rotated // generate the sprite's axes, parallel to the viewplane, but rotated
// in // in that plane around the center according to the sprite entity's
// that plane around the center according to the sprite entity's roll // roll angle. So vpn stays the same, but vright and vup rotate
// angle. So vpn stays the same, but vright and vup rotate
angle = currententity->angles[ROLL] * (M_PI * 2 / 360); angle = currententity->angles[ROLL] * (M_PI * 2 / 360);
sr = sin (angle); sr = sin (angle);
cr = cos (angle); cr = cos (angle);

View file

@ -60,13 +60,9 @@ static void (*surfmiptable[4]) (void) = {
R_DrawSurfaceBlock8_mip1, R_DrawSurfaceBlock8_mip1,
R_DrawSurfaceBlock8_mip2, R_DrawSurfaceBlock8_mip3}; R_DrawSurfaceBlock8_mip2, R_DrawSurfaceBlock8_mip3};
unsigned int blocklights[18 * 18]; unsigned int blocklights[18 * 18];
/*
R_AddDynamicLights
*/
void void
R_AddDynamicLights (void) R_AddDynamicLights (void)
{ {
@ -128,6 +124,7 @@ R_AddDynamicLights (void)
} }
} }
/* /*
R_BuildLightMap R_BuildLightMap
@ -160,7 +157,6 @@ R_BuildLightMap (void)
for (i = 0; i < size; i++) for (i = 0; i < size; i++)
blocklights[i] = r_refdef.ambientlight << 8; blocklights[i] = r_refdef.ambientlight << 8;
// add all the lightmaps // add all the lightmaps
if (lightmap) if (lightmap)
for (maps = 0; maps < MAXLIGHTMAPS && surf->styles[maps] != 255; maps++) { for (maps = 0; maps < MAXLIGHTMAPS && surf->styles[maps] != 255; maps++) {
@ -219,9 +215,6 @@ R_TextureAnimation (texture_t *base)
} }
/*
R_DrawSurface
*/
void void
R_DrawSurface (void) R_DrawSurface (void)
{ {
@ -243,8 +236,8 @@ R_DrawSurface (void)
r_source = (byte *) mt + mt->offsets[r_drawsurf.surfmip]; r_source = (byte *) mt + mt->offsets[r_drawsurf.surfmip];
// the fractional light values should range from 0 to (VID_GRADES - 1) << 16 // the fractional light values should range from 0 to
// from a source range of 0 - 255 // (VID_GRADES - 1) << 16 from a source range of 0 - 255
texwidth = mt->width >> r_drawsurf.surfmip; texwidth = mt->width >> r_drawsurf.surfmip;
@ -305,13 +298,8 @@ R_DrawSurface (void)
} }
//=============================================================================
#ifndef USE_INTEL_ASM #ifndef USE_INTEL_ASM
/*
R_DrawSurfaceBlock8_mip0
*/
void void
R_DrawSurfaceBlock8_mip0 (void) R_DrawSurfaceBlock8_mip0 (void)
{ {
@ -355,9 +343,6 @@ R_DrawSurfaceBlock8_mip0 (void)
} }
/*
R_DrawSurfaceBlock8_mip1
*/
void void
R_DrawSurfaceBlock8_mip1 (void) R_DrawSurfaceBlock8_mip1 (void)
{ {
@ -401,9 +386,6 @@ R_DrawSurfaceBlock8_mip1 (void)
} }
/*
R_DrawSurfaceBlock8_mip2
*/
void void
R_DrawSurfaceBlock8_mip2 (void) R_DrawSurfaceBlock8_mip2 (void)
{ {
@ -447,9 +429,6 @@ R_DrawSurfaceBlock8_mip2 (void)
} }
/*
R_DrawSurfaceBlock8_mip3
*/
void void
R_DrawSurfaceBlock8_mip3 (void) R_DrawSurfaceBlock8_mip3 (void)
{ {
@ -540,11 +519,6 @@ R_DrawSurfaceBlock16 (void)
#endif #endif
//============================================================================
/*
R_GenTurbTile
*/
void void
R_GenTurbTile (pixel_t *pbasetex, void *pdest) R_GenTurbTile (pixel_t *pbasetex, void *pdest)
{ {
@ -565,9 +539,6 @@ R_GenTurbTile (pixel_t *pbasetex, void *pdest)
} }
/*
R_GenTurbTile16
*/
void void
R_GenTurbTile16 (pixel_t *pbasetex, void *pdest) R_GenTurbTile16 (pixel_t *pbasetex, void *pdest)
{ {
@ -588,9 +559,6 @@ R_GenTurbTile16 (pixel_t *pbasetex, void *pdest)
} }
/*
R_GenTile
*/
void void
R_GenTile (msurface_t *psurf, void *pdest) R_GenTile (msurface_t *psurf, void *pdest)
{ {
@ -617,6 +585,7 @@ R_GenTile (msurface_t *psurf, void *pdest)
} }
} }
void void
R_ForceLightUpdate (void) R_ForceLightUpdate (void)
{ {

View file

@ -35,9 +35,7 @@
// all global and static refresh variables are collected in a contiguous block // all global and static refresh variables are collected in a contiguous block
// to avoid cache conflicts. // to avoid cache conflicts.
//------------------------------------------------------- // global refresh variables -----------------------------
// global refresh variables
//-------------------------------------------------------
// FIXME: make into one big structure, like cl or sv // FIXME: make into one big structure, like cl or sv
// FIXME: do separately for refresh engine and driver // FIXME: do separately for refresh engine and driver

View file

@ -43,6 +43,7 @@ extern byte gammatable[256];
qboolean V_CheckGamma (void); qboolean V_CheckGamma (void);
void void
V_CalcPowerupCshift (void) V_CalcPowerupCshift (void)
{ {

View file

@ -39,16 +39,12 @@ static auxvert_t av[8];
void R_AliasProjectFinalVert (finalvert_t *fv, auxvert_t *av); void R_AliasProjectFinalVert (finalvert_t *fv, auxvert_t *av);
void R_Alias_clip_top (finalvert_t *pfv0, finalvert_t *pfv1, void R_Alias_clip_top (finalvert_t *pfv0, finalvert_t *pfv1,
finalvert_t *out); finalvert_t *out);
void R_Alias_clip_bottom (finalvert_t *pfv0, finalvert_t *pfv1, void R_Alias_clip_bottom (finalvert_t *pfv0, finalvert_t *pfv1,
finalvert_t *out); finalvert_t *out);
void R_Alias_clip_left (finalvert_t *pfv0, finalvert_t *pfv1, void R_Alias_clip_left (finalvert_t *pfv0, finalvert_t *pfv1,
finalvert_t *out); finalvert_t *out);
void R_Alias_clip_right (finalvert_t *pfv0, finalvert_t *pfv1, void R_Alias_clip_right (finalvert_t *pfv0, finalvert_t *pfv1,
finalvert_t *out); finalvert_t *out);
@ -228,9 +224,6 @@ R_AliasClip (finalvert_t *in, finalvert_t *out, int flag, int count,
} }
/*
R_AliasClipTriangle
*/
void void
R_AliasClipTriangle (mtriangle_t *ptri) R_AliasClipTriangle (mtriangle_t *ptri)
{ {

View file

@ -41,8 +41,7 @@
#include "render.h" #include "render.h"
#define LIGHT_MIN 5 // lowest light value we'll allow, to #define LIGHT_MIN 5 // lowest light value we'll allow, to
// avoid the // avoid the need for inner-loop light clamping
// need for inner-loop light clamping
mtriangle_t *ptriangles; mtriangle_t *ptriangles;
affinetridesc_t r_affinetridesc; affinetridesc_t r_affinetridesc;
@ -90,7 +89,6 @@ float r_avertexnormals[NUMVERTEXNORMALS][3] = {
}; };
void R_AliasTransformAndProjectFinalVerts (finalvert_t *fv, void R_AliasTransformAndProjectFinalVerts (finalvert_t *fv,
stvert_t *pstverts); stvert_t *pstverts);
void R_AliasSetUpTransform (int trivial_accept); void R_AliasSetUpTransform (int trivial_accept);
void R_AliasTransformVector (vec3_t in, vec3_t out); 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); void R_AliasProjectFinalVert (finalvert_t *fv, auxvert_t *av);
/*
R_AliasCheckBBox
*/
qboolean qboolean
R_AliasCheckBBox (void) R_AliasCheckBBox (void)
{ {
@ -116,7 +111,6 @@ R_AliasCheckBBox (void)
int minz; int minz;
// expand, rotate, and translate points into worldspace // expand, rotate, and translate points into worldspace
currententity->trivial_accept = 0; currententity->trivial_accept = 0;
pmodel = currententity->model; pmodel = currententity->model;
pahdr = Mod_Extradata (pmodel); pahdr = Mod_Extradata (pmodel);
@ -171,7 +165,6 @@ R_AliasCheckBBox (void)
} }
} }
if (zfullyclipped) { if (zfullyclipped) {
return false; // everything was near-z-clipped return false; // everything was near-z-clipped
} }
@ -180,8 +173,7 @@ R_AliasCheckBBox (void)
if (zclipped) { if (zclipped) {
// organize points by edges, use edges to get new points (possible // organize points by edges, use edges to get new points (possible
// trivial // trivial reject)
// reject)
for (i = 0; i < 12; i++) { for (i = 0; i < 12; i++) {
// edge endpoints // edge endpoints
pv0 = &viewpts[aedges[i].index0]; pv0 = &viewpts[aedges[i].index0];
@ -249,9 +241,6 @@ R_AliasCheckBBox (void)
} }
/*
R_AliasTransformVector
*/
void void
R_AliasTransformVector (vec3_t in, vec3_t out) R_AliasTransformVector (vec3_t in, vec3_t out)
{ {
@ -299,9 +288,7 @@ R_AliasPreparePoints (void)
} }
} }
//
// clip and draw all triangles // clip and draw all triangles
//
r_affinetridesc.numtriangles = 1; r_affinetridesc.numtriangles = 1;
ptri = (mtriangle_t *) ((byte *) paliashdr + paliashdr->triangles); ptri = (mtriangle_t *) ((byte *) paliashdr + paliashdr->triangles);
@ -326,9 +313,6 @@ R_AliasPreparePoints (void)
} }
/*
R_AliasSetUpTransform
*/
void void
R_AliasSetUpTransform (int trivial_accept) R_AliasSetUpTransform (int trivial_accept)
{ {
@ -400,9 +384,6 @@ R_AliasSetUpTransform (int trivial_accept)
} }
/*
R_AliasTransformFinalVert
*/
void void
R_AliasTransformFinalVert (finalvert_t *fv, auxvert_t *av, R_AliasTransformFinalVert (finalvert_t *fv, auxvert_t *av,
trivertx_t *pverts, stvert_t *pstverts) trivertx_t *pverts, stvert_t *pstverts)
@ -431,8 +412,7 @@ R_AliasTransformFinalVert (finalvert_t *fv, auxvert_t *av,
temp += (int) (r_shadelight * lightcos); temp += (int) (r_shadelight * lightcos);
// clamp; because we limited the minimum ambient and shading light, // clamp; because we limited the minimum ambient and shading light,
// we // we don't have to clamp low light, just bright
// don't have to clamp low light, just bright
if (temp < 0) if (temp < 0)
temp = 0; temp = 0;
} }
@ -442,10 +422,6 @@ R_AliasTransformFinalVert (finalvert_t *fv, auxvert_t *av,
#ifndef USE_INTEL_ASM #ifndef USE_INTEL_ASM
/*
R_AliasTransformAndProjectFinalVerts
*/
void void
R_AliasTransformAndProjectFinalVerts (finalvert_t *fv, stvert_t *pstverts) 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 // 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 // scaled up by 1/2**31, and the scaling cancels out for x and y in
// the // the projection
// projection
fv->v[5] = zi; fv->v[5] = zi;
fv->v[0] = ((DotProduct (pverts->v, aliastransform[0]) + fv->v[0] = ((DotProduct (pverts->v, aliastransform[0]) +
@ -493,13 +468,9 @@ R_AliasTransformAndProjectFinalVerts (finalvert_t *fv, stvert_t *pstverts)
fv->v[4] = temp; fv->v[4] = temp;
} }
} }
#endif #endif
/*
R_AliasProjectFinalVert
*/
void void
R_AliasProjectFinalVert (finalvert_t *fv, auxvert_t *av) R_AliasProjectFinalVert (finalvert_t *fv, auxvert_t *av)
{ {
@ -515,9 +486,6 @@ R_AliasProjectFinalVert (finalvert_t *fv, auxvert_t *av)
} }
/*
R_AliasPrepareUnclippedPoints
*/
void void
R_AliasPrepareUnclippedPoints (void) R_AliasPrepareUnclippedPoints (void)
{ {
@ -542,9 +510,7 @@ R_AliasPrepareUnclippedPoints (void)
D_PolysetDraw (); D_PolysetDraw ();
} }
/*
R_AliasSetupSkin
*/
void void
R_AliasSetupSkin (void) R_AliasSetupSkin (void)
{ {
@ -607,15 +573,13 @@ R_AliasSetupSkin (void)
} }
} }
/*
R_AliasSetupLighting
*/
void void
R_AliasSetupLighting (alight_t *plighting) R_AliasSetupLighting (alight_t *plighting)
{ {
// guarantee that no vertex will ever be lit below LIGHT_MIN, so we don't have // guarantee that no vertex will ever be lit below LIGHT_MIN, so we don't
// to clamp off the bottom // have to clamp off the bottom
r_ambientlight = plighting->ambientlight; r_ambientlight = plighting->ambientlight;
if (r_ambientlight < LIGHT_MIN) if (r_ambientlight < LIGHT_MIN)
@ -639,6 +603,7 @@ R_AliasSetupLighting (alight_t *plighting)
r_plightvec[2] = DotProduct (plighting->plightvec, alias_up); r_plightvec[2] = DotProduct (plighting->plightvec, alias_up);
} }
/* /*
R_AliasSetupFrame R_AliasSetupFrame
@ -672,10 +637,8 @@ R_AliasSetupFrame (void)
time = cl.time + currententity->syncbase; time = cl.time + currententity->syncbase;
//
// when loading in Mod_LoadAliasGroup, we guaranteed all interval values // when loading in Mod_LoadAliasGroup, we guaranteed all interval values
// are positive, so we don't have to worry about division by 0 // are positive, so we don't have to worry about division by 0
//
targettime = time - ((int) (time / fullinterval)) * fullinterval; targettime = time - ((int) (time / fullinterval)) * fullinterval;
for (i = 0; i < (numframes - 1); i++) { for (i = 0; i < (numframes - 1); i++) {
@ -688,9 +651,6 @@ R_AliasSetupFrame (void)
} }
/*
R_AliasDrawModel
*/
void void
R_AliasDrawModel (alight_t *plighting) R_AliasDrawModel (alight_t *plighting)
{ {

View file

@ -39,18 +39,13 @@
#include "r_local.h" #include "r_local.h"
#include "render.h" #include "render.h"
//
// current entity info // current entity info
//
qboolean insubmodel; qboolean insubmodel;
entity_t *currententity; entity_t *currententity;
vec3_t modelorg, base_modelorg; vec3_t modelorg, base_modelorg;
// modelorg is the viewpoint reletive to // modelorg is the viewpoint reletive to
// the currently rendering entity // the currently rendering entity
vec3_t r_entorigin; // the currently rendering entity in vec3_t r_entorigin; // the currently rendering entity in world
// world
// coordinates // coordinates
float entity_rotation[3][3]; float entity_rotation[3][3];
@ -73,11 +68,6 @@ static mvertex_t *pfrontenter, *pfrontexit;
static qboolean makeclippededge; static qboolean makeclippededge;
//===========================================================================
/*
R_EntityRotate
*/
void void
R_EntityRotate (vec3_t vec) R_EntityRotate (vec3_t vec)
{ {
@ -90,9 +80,6 @@ R_EntityRotate (vec3_t vec)
} }
/*
R_RotateBmodel
*/
void void
R_RotateBmodel (void) R_RotateBmodel (void)
{ {
@ -119,7 +106,6 @@ R_RotateBmodel (void)
temp1[2][1] = 0; temp1[2][1] = 0;
temp1[2][2] = 1; temp1[2][2] = 1;
// pitch // pitch
angle = currententity->angles[PITCH]; angle = currententity->angles[PITCH];
angle = angle * M_PI * 2 / 360; angle = angle * M_PI * 2 / 360;
@ -156,9 +142,7 @@ R_RotateBmodel (void)
R_ConcatRotations (temp1, temp3, entity_rotation); R_ConcatRotations (temp1, temp3, entity_rotation);
//
// rotate modelorg and the transformation matrix // rotate modelorg and the transformation matrix
//
R_EntityRotate (modelorg); R_EntityRotate (modelorg);
R_EntityRotate (vpn); R_EntityRotate (vpn);
R_EntityRotate (vright); R_EntityRotate (vright);
@ -168,9 +152,6 @@ R_RotateBmodel (void)
} }
/*
R_RecursiveClipBPoly
*/
void void
R_RecursiveClipBPoly (bedge_t *pedges, mnode_t *pnode, msurface_t *psurf) 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 // draw or recurse further
for (i = 0; i < 2; i++) { for (i = 0; i < 2; i++) {
if (psideedges[i]) { if (psideedges[i]) {
// draw if we've reached a non-solid leaf, done if all that's // draw if we've reached a non-solid leaf, done if all that's left
// left is a // is a solid leaf, and continue down the tree if it's not a leaf
// solid leaf, and continue down the tree if it's not a leaf
pn = pnode->children[i]; pn = pnode->children[i];
// we're done with this branch if the node or leaf isn't in the // we're done with this branch if the node or leaf isn't in the PVS
// PVS
if (pn->visframe == r_visframecount) { if (pn->visframe == r_visframecount) {
if (pn->contents < 0) { if (pn->contents < 0) {
if (pn->contents != CONTENTS_SOLID) { if (pn->contents != CONTENTS_SOLID) {
@ -318,9 +297,6 @@ R_RecursiveClipBPoly (bedge_t *pedges, mnode_t *pnode, msurface_t *psurf)
} }
/*
R_DrawSolidClippedSubmodelPolygons
*/
void void
R_DrawSolidClippedSubmodelPolygons (model_t *pmodel) R_DrawSolidClippedSubmodelPolygons (model_t *pmodel)
{ {
@ -352,8 +328,7 @@ R_DrawSolidClippedSubmodelPolygons (model_t *pmodel)
// copy the edges to bedges, flipping if necessary so always // copy the edges to bedges, flipping if necessary so always
// clockwise winding // clockwise winding
// FIXME: if edges and vertices get caches, these assignments // FIXME: if edges and vertices get caches, these assignments must move
// must move
// outside the loop, and overflow checking must be done here // outside the loop, and overflow checking must be done here
pbverts = bverts; pbverts = bverts;
pbedges = bedges; pbedges = bedges;
@ -391,9 +366,6 @@ R_DrawSolidClippedSubmodelPolygons (model_t *pmodel)
} }
/*
R_DrawSubmodelPolygons
*/
void void
R_DrawSubmodelPolygons (model_t *pmodel, int clipflags) R_DrawSubmodelPolygons (model_t *pmodel, int clipflags)
{ {
@ -426,9 +398,6 @@ R_DrawSubmodelPolygons (model_t *pmodel, int clipflags)
} }
/*
R_RecursiveWorldNode
*/
void void
R_RecursiveWorldNode (mnode_t *node, int clipflags) 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 continue; // don't need to clip against it
// generate accept and reject points // generate accept and reject points
// FIXME: do with fast look-ups or integer tests based on the // FIXME: do with fast look-ups or integer tests based on the sign bit
// sign bit
// of the floating point values // of the floating point values
pindex = pfrustum_indexes[i]; pindex = pfrustum_indexes[i];
@ -590,10 +558,6 @@ R_RecursiveWorldNode (mnode_t *node, int clipflags)
} }
/*
R_RenderWorld
*/
void void
R_RenderWorld (void) R_RenderWorld (void)
{ {
@ -610,8 +574,8 @@ R_RenderWorld (void)
R_RecursiveWorldNode (clmodel->nodes, 15); R_RecursiveWorldNode (clmodel->nodes, 15);
// if the driver wants the polygons back to front, play the visible ones back // if the driver wants the polygons back to front, play the visible ones
// in that order // back in that order
if (r_worldpolysbacktofront) { if (r_worldpolysbacktofront) {
for (i = numbtofpolys - 1; i >= 0; i--) { for (i = numbtofpolys - 1; i >= 0; i--) {
R_RenderPoly (btofpolys[i].psurf, btofpolys[i].clipflags); R_RenderPoly (btofpolys[i].psurf, btofpolys[i].clipflags);

View file

@ -47,8 +47,6 @@ zpointdesc_t r_zpointdesc;
polydesc_t r_polydesc; polydesc_t r_polydesc;
clipplane_t *entity_clipplanes; clipplane_t *entity_clipplanes;
clipplane_t view_clipplanes[4]; clipplane_t view_clipplanes[4];
clipplane_t world_clipplanes[16]; clipplane_t world_clipplanes[16];
@ -80,9 +78,6 @@ qboolean r_lastvertvalid;
#ifndef USE_INTEL_ASM #ifndef USE_INTEL_ASM
/*
R_EmitEdge
*/
void void
R_EmitEdge (mvertex_t *pv0, mvertex_t *pv1) 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); r_ceilv1 = (int) ceil (r_v1);
// create the edge // create the edge
if (ceilv0 == r_ceilv1) { if (ceilv0 == r_ceilv1) {
// we cache unclipped horizontal edges as fully clipped // 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; edge->u = u * 0x100000 + 0xFFFFF;
// we need to do this to avoid stepping off the edges if a very nearly // 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 // horizontal edge is less than epsilon above a scan, and numeric error
// it to incorrectly extend to the scan, and the extension of the line goes off // causes it to incorrectly extend to the scan, and the extension of the
// the edge of the screen // line goes off the edge of the screen
// FIXME: is this actually needed? // FIXME: is this actually needed?
if (edge->u < r_refdef.vrect_x_adj_shift20) if (edge->u < r_refdef.vrect_x_adj_shift20)
edge->u = r_refdef.vrect_x_adj_shift20; edge->u = r_refdef.vrect_x_adj_shift20;
if (edge->u > r_refdef.vrectright_adj_shift20) if (edge->u > r_refdef.vrectright_adj_shift20)
edge->u = r_refdef.vrectright_adj_shift20; edge->u = r_refdef.vrectright_adj_shift20;
//
// sort the edge in normally // sort the edge in normally
//
u_check = edge->u; u_check = edge->u;
if (edge->surfs[0]) if (edge->surfs[0])
u_check++; // sort trailers after leaders u_check++; // sort trailers after leaders
@ -247,9 +239,6 @@ R_EmitEdge (mvertex_t *pv0, mvertex_t *pv1)
} }
/*
R_ClipEdge
*/
void void
R_ClipEdge (mvertex_t *pv0, mvertex_t *pv1, clipplane_t *clip) 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 #endif // !USE_INTEL_ASM
/*
R_EmitCachedEdge
*/
void void
R_EmitCachedEdge (void) R_EmitCachedEdge (void)
{ {
@ -356,9 +342,6 @@ R_EmitCachedEdge (void)
} }
/*
R_RenderFace
*/
void void
R_RenderFace (msurface_t *fa, int clipflags) R_RenderFace (msurface_t *fa, int clipflags)
{ {
@ -525,9 +508,6 @@ R_RenderFace (msurface_t *fa, int clipflags)
} }
/*
R_RenderBmodelFace
*/
void void
R_RenderBmodelFace (bedge_t *pedges, msurface_t *psurf) R_RenderBmodelFace (bedge_t *pedges, msurface_t *psurf)
{ {
@ -628,9 +608,6 @@ R_RenderBmodelFace (bedge_t *pedges, msurface_t *psurf)
} }
/*
R_RenderPoly
*/
void void
R_RenderPoly (msurface_t *fa, int clipflags) 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]; pverts[i].t = verts[vertpage][i].position[t_axis];
} }
// build the polygon descriptor, including fa, r_nearzi, and u, v, s, t, and z // build the polygon descriptor, including fa, r_nearzi, and u, v, s, t,
// for each vertex // and z for each vertex
r_polydesc.numverts = lnumverts; r_polydesc.numverts = lnumverts;
r_polydesc.nearzi = r_nearzi; r_polydesc.nearzi = r_nearzi;
r_polydesc.pcurrentface = fa; r_polydesc.pcurrentface = fa;
@ -798,9 +775,6 @@ R_RenderPoly (msurface_t *fa, int clipflags)
} }
/*
R_ZDrawSubmodelPolys
*/
void void
R_ZDrawSubmodelPolys (model_t *pmodel) R_ZDrawSubmodelPolys (model_t *pmodel)
{ {

View file

@ -37,15 +37,15 @@
#include "render.h" #include "render.h"
#if 0 #if 0
// FIXME FIXME
the complex cases add new polys on most lines, the complex cases add new polys on most lines,
so dont optimize for keeping them the same have multiple free span lists to 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 try to get better coherence ? low depth complexity-- 1 to 3 or so this
breaks spans at every edge, even hidden breaks spans at every edge, even hidden ones (bad)
ones (bad)
have a sentinal at both ends ? have a sentinal at both ends ?
#endif #endif
edge_t *auxedges; edge_t *auxedges;
edge_t *r_edges, *edge_p, *edge_max; edge_t *r_edges, *edge_p, *edge_max;
@ -77,25 +77,13 @@ edge_t edge_sentinel;
float fv; float fv;
void void R_GenerateSpans (void);
R_GenerateSpans (void); void R_GenerateSpansBackward (void);
void void R_LeadingEdge (edge_t *edge);
R_GenerateSpansBackward (void); 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 void
R_DrawCulledPolys (void) R_DrawCulledPolys (void)
{ {
@ -128,9 +116,6 @@ R_DrawCulledPolys (void)
} }
/*
R_BeginEdgeFrame
*/
void void
R_BeginEdgeFrame (void) R_BeginEdgeFrame (void)
{ {
@ -205,9 +190,6 @@ R_InsertNewEdges (edge_t *edgestoadd, edge_t *edgelist)
} }
/*
R_RemoveEdges
*/
void void
R_RemoveEdges (edge_t *pedge) R_RemoveEdges (edge_t *pedge)
{ {
@ -219,9 +201,6 @@ R_RemoveEdges (edge_t *pedge)
} }
/*
R_StepActiveU
*/
void void
R_StepActiveU (edge_t *pedge) R_StepActiveU (edge_t *pedge)
{ {
@ -284,9 +263,6 @@ R_StepActiveU (edge_t *pedge)
#endif // !USE_INTEL_ASM #endif // !USE_INTEL_ASM
/*
R_CleanupSpan
*/
void void
R_CleanupSpan (void) R_CleanupSpan (void)
{ {
@ -314,9 +290,6 @@ R_CleanupSpan (void)
} }
/*
R_LeadingEdgeBackwards
*/
void void
R_LeadingEdgeBackwards (edge_t *edge) 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 // active is in front, so keep going unless it's a bmodel
if (surf->insubmodel && (surf->key == surf2->key)) { if (surf->insubmodel && (surf->key == surf2->key)) {
// must be two bmodels in the same leaf; don't care, because // must be two bmodels in the same leaf; don't care, because
// they'll // they'll never be farthest anyway
// never be farthest anyway
goto newtop; goto newtop;
} }
@ -358,8 +330,7 @@ R_LeadingEdgeBackwards (edge_t *edge)
goto continue_search; goto continue_search;
// must be two bmodels in the same leaf; don't care which is // must be two bmodels in the same leaf; don't care which is
// really // really in front, because they'll never be farthest anyway
// in front, because they'll never be farthest anyway
} }
goto gotposition; goto gotposition;
@ -389,18 +360,14 @@ R_LeadingEdgeBackwards (edge_t *edge)
} }
/*
R_TrailingEdge
*/
void void
R_TrailingEdge (surf_t *surf, edge_t *edge) R_TrailingEdge (surf_t *surf, edge_t *edge)
{ {
espan_t *span; espan_t *span;
int iu; int iu;
// don't generate a span if this is an inverted span, with the end // don't generate a span if this is an inverted span, with the end edge
// edge preceding the start edge (that is, we haven't seen the // preceding the start edge (that is, we haven't seen the start edge yet)
// start edge yet)
if (--surf->spanstate == 0) { if (--surf->spanstate == 0) {
if (surf->insubmodel) if (surf->insubmodel)
r_bmodelactive--; r_bmodelactive--;
@ -428,9 +395,6 @@ R_TrailingEdge (surf_t *surf, edge_t *edge)
#ifndef USE_INTEL_ASM #ifndef USE_INTEL_ASM
/*
R_LeadingEdge
*/
void void
R_LeadingEdge (edge_t *edge) R_LeadingEdge (edge_t *edge)
{ {
@ -487,8 +451,8 @@ R_LeadingEdge (edge_t *edge)
if (surf->key == surf2->key) { if (surf->key == surf2->key) {
// if it's two surfaces on the same plane, the one that's // if it's two surfaces on the same plane, the one that's
// already // already active is in front, so keep going unless it's a
// active is in front, so keep going unless it's a bmodel // bmodel
if (!surf->insubmodel) if (!surf->insubmodel)
goto continue_search; goto continue_search;
@ -561,8 +525,7 @@ R_GenerateSpans (void)
// generate spans // generate spans
for (edge = edge_head.next; edge != &edge_tail; edge = edge->next) { for (edge = edge_head.next; edge != &edge_tail; edge = edge->next) {
if (edge->surfs[0]) { if (edge->surfs[0]) {
// it has a left surface, so a surface is going away for this // it has a left surface, so a surface is going away for this span
// span
surf = &surfaces[edge->surfs[0]]; surf = &surfaces[edge->surfs[0]];
R_TrailingEdge (surf, edge); R_TrailingEdge (surf, edge);
@ -580,9 +543,6 @@ R_GenerateSpans (void)
#endif // !USE_INTEL_ASM #endif // !USE_INTEL_ASM
/*
R_GenerateSpansBackward
*/
void void
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.u = 2000 << 24; // make sure nothing sorts past this
edge_sentinel.prev = &edge_aftertail; edge_sentinel.prev = &edge_aftertail;
//
// process all scan lines // process all scan lines
//
bottom = r_refdef.vrectbottom - 1; bottom = r_refdef.vrectbottom - 1;
for (iv = r_refdef.vrect.y; iv < bottom; iv++) { for (iv = r_refdef.vrect.y; iv < bottom; iv++) {
@ -677,12 +635,10 @@ R_ScanEdges (void)
(*pdrawfunc) (); (*pdrawfunc) ();
// flush the span list if we can't be sure we have enough spans left // flush the span list if we can't be sure we have enough spans left
// for // for the next scan
// the next scan
if (span_p > max_span_p) { if (span_p > max_span_p) {
VID_UnlockBuffer (); VID_UnlockBuffer ();
S_ExtraUpdate (); // don't let sound get messed up if S_ExtraUpdate (); // don't let sound get messed up if going slow
// going slow
VID_LockBuffer (); VID_LockBuffer ();
if (r_drawculledpolys) 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) // do the last scan (no need to step or sort or remove on the last scan)
current_iv = iv; current_iv = iv;
fv = (float) iv; fv = (float) iv;

View file

@ -36,15 +36,11 @@
int r_dlightframecount; int r_dlightframecount;
/*
R_AnimateLight
*/
void void
R_AnimateLight (void) R_AnimateLight (void)
{ {
int i, j, k; int i, j, k;
//
// light animations // light animations
// 'm' is normal light, 'a' is no light, 'z' is double bright // 'm' is normal light, 'a' is no light, 'z' is double bright
i = (int) (cl.time * 10); i = (int) (cl.time * 10);
@ -65,9 +61,7 @@ R_AnimateLight (void)
DYNAMIC LIGHTS DYNAMIC LIGHTS
*/ */
/*
R_MarkLights
*/
void void
R_MarkLights (vec3_t lightorigin, dlight_t *light, int bit, mnode_t *node) 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 void
R_PushDlights (vec3_t entorigin) R_PushDlights (vec3_t entorigin)
{ {
@ -132,6 +123,7 @@ R_PushDlights (vec3_t entorigin)
LIGHT SAMPLING LIGHT SAMPLING
*/ */
int int
RecursiveLightPoint (mnode_t *node, vec3_t start, vec3_t end) 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 return -1; // didn't hit anything
// calculate mid point // calculate mid point
// FIXME: optimize for axial // FIXME: optimize for axial
plane = node->plane; plane = node->plane;
front = DotProduct (start, plane->normal) - plane->dist; 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 return -1; // didn't hit anything
// check for impact on this node // check for impact on this node
surf = cl.worldmodel->surfaces + node->firstsurface; surf = cl.worldmodel->surfaces + node->firstsurface;
for (i = 0; i < node->numsurfaces; i++, surf++) { for (i = 0; i < node->numsurfaces; i++, surf++) {
if (surf->flags & SURF_DRAWTILED) 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); return RecursiveLightPoint (node->children[!side], mid, end);
} }
int int
R_LightPoint (vec3_t p) R_LightPoint (vec3_t p)
{ {

View file

@ -88,17 +88,13 @@ qboolean r_fov_greater_than_90;
entity_t r_worldentity; entity_t r_worldentity;
//
// view origin // view origin
//
vec3_t vup, base_vup; vec3_t vup, base_vup;
vec3_t vpn, base_vpn; vec3_t vpn, base_vpn;
vec3_t vright, base_vright; vec3_t vright, base_vright;
vec3_t r_origin; vec3_t r_origin;
//
// screen size info // screen size info
//
refdef_t r_refdef; refdef_t r_refdef;
float xcenter, ycenter; float xcenter, ycenter;
float xscale, yscale; float xscale, yscale;
@ -115,12 +111,8 @@ float xOrigin, yOrigin;
mplane_t screenedge[4]; mplane_t screenedge[4];
//
// refresh flags // 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 r_visframecount;
int d_spanpixcount; int d_spanpixcount;
int r_polycount; int r_polycount;
@ -130,11 +122,9 @@ int r_wholepolycount;
int *pfrustum_indexes[4]; int *pfrustum_indexes[4];
int r_frustum_indexes[4 * 6]; int r_frustum_indexes[4 * 6];
int reinit_surfcache = 1; // if 1, surface cache is currently int reinit_surfcache = 1; // if 1, surface cache is currently empty
// and must be reinitialized for current
// empty and // cache size
// must be reinitialized for current cache
// size
mleaf_t *r_viewleaf, *r_oldviewleaf; mleaf_t *r_viewleaf, *r_oldviewleaf;
@ -152,9 +142,7 @@ extern cvar_t *scr_fov;
void R_NetGraph (void); void R_NetGraph (void);
void R_ZGraph (void); void R_ZGraph (void);
/*
R_Textures_Init
*/
void void
R_Textures_Init (void) R_Textures_Init (void)
{ {
@ -185,11 +173,10 @@ R_Textures_Init (void)
} }
} }
void R_LoadSky_f (void); void R_LoadSky_f (void);
/*
R_Init
*/
void void
R_Init (void) R_Init (void)
{ {
@ -202,8 +189,10 @@ R_Init (void)
R_InitTurb (); R_InitTurb ();
Cmd_AddCommand ("timerefresh", R_TimeRefresh_f, "Tests the current refresh rate for the current location"); Cmd_AddCommand ("timerefresh", R_TimeRefresh_f, "Tests the current "
Cmd_AddCommand ("pointfile", R_ReadPointFile_f, "Load a pointfile to determine map leaks"); "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"); Cmd_AddCommand ("loadsky", R_LoadSky_f, "Load a skybox");
Cvar_SetValue (r_maxedges, (float) NUMSTACKEDGES); Cvar_SetValue (r_maxedges, (float) NUMSTACKEDGES);
@ -224,13 +213,10 @@ R_Init (void)
Sys_MakeCodeWriteable ((long) R_EdgeCodeStart, Sys_MakeCodeWriteable ((long) R_EdgeCodeStart,
(long) R_EdgeCodeEnd - (long) R_EdgeCodeStart); (long) R_EdgeCodeEnd - (long) R_EdgeCodeStart);
#endif // USE_INTEL_ASM #endif // USE_INTEL_ASM
D_Init (); D_Init ();
} }
/*
R_NewMap
*/
void void
R_NewMap (void) R_NewMap (void)
{ {
@ -286,9 +272,6 @@ R_NewMap (void)
} }
/*
R_SetVrect
*/
void void
R_SetVrect (vrect_t *pvrectin, vrect_t *pvrect, int lineadj) 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 void
R_MarkLeaves (void) R_MarkLeaves (void)
{ {
@ -508,11 +488,7 @@ R_MarkLeaves (void)
} }
} }
/*
=============
R_ShowNearestLoc
=============
*/
static void static void
R_ShowNearestLoc (void) R_ShowNearestLoc (void)
{ {
@ -535,9 +511,7 @@ R_ShowNearestLoc (void)
} }
} }
/*
R_DrawEntitiesOnList
*/
void void
R_DrawEntitiesOnList (void) R_DrawEntitiesOnList (void)
{ {
@ -608,9 +582,7 @@ R_DrawEntitiesOnList (void)
} }
} }
/*
R_DrawViewModel
*/
void void
R_DrawViewModel (void) R_DrawViewModel (void)
{ {
@ -678,9 +650,6 @@ R_DrawViewModel (void)
} }
/*
R_BmodelCheckBBox
*/
int int
R_BmodelCheckBBox (model_t *clmodel, float *minmaxs) R_BmodelCheckBBox (model_t *clmodel, float *minmaxs)
{ {
@ -706,8 +675,7 @@ R_BmodelCheckBBox (model_t *clmodel, float *minmaxs)
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
// generate accept and reject points // generate accept and reject points
// FIXME: do with fast look-ups or integer tests based on the // FIXME: do with fast look-ups or integer tests based on the
// sign bit // sign bit of the floating point values
// of the floating point values
pindex = pfrustum_indexes[i]; pindex = pfrustum_indexes[i];
@ -737,9 +705,6 @@ R_BmodelCheckBBox (model_t *clmodel, float *minmaxs)
} }
/*
R_DrawBEntitiesOnList
*/
void void
R_DrawBEntitiesOnList (void) R_DrawBEntitiesOnList (void)
{ {
@ -764,8 +729,7 @@ R_DrawBEntitiesOnList (void)
clmodel = currententity->model; clmodel = currententity->model;
// see if the bounding box lets us trivially reject, also // see if the bounding box lets us trivially reject, also
// sets // sets trivial accept status
// trivial accept status
for (j = 0; j < 3; j++) { for (j = 0; j < 3; j++) {
minmaxs[j] = currententity->origin[j] + clmodel->mins[j]; minmaxs[j] = currententity->origin[j] + clmodel->mins[j];
minmaxs[3 + j] = currententity->origin[j] + minmaxs[3 + j] = currententity->origin[j] +
@ -802,10 +766,8 @@ R_DrawBEntitiesOnList (void)
} }
} }
// if the driver wants polygons, deliver those. // if the driver wants polygons, deliver those.
// Z-buffering is on // Z-buffering is on at this point, so no clipping to the
// at this point, so no clipping to the world tree is // world tree is needed, just frustum clipping
// needed, just
// frustum clipping
if (r_drawpolys | r_drawculledpolys) { if (r_drawpolys | r_drawculledpolys) {
R_ZDrawSubmodelPolys (clmodel); R_ZDrawSubmodelPolys (clmodel);
} else { } else {
@ -828,10 +790,8 @@ R_DrawBEntitiesOnList (void)
R_DrawSolidClippedSubmodelPolygons (clmodel); R_DrawSolidClippedSubmodelPolygons (clmodel);
} else { } else {
// falls entirely in one leaf, so we just put // falls entirely in one leaf, so we just put
// all the // all the edges in the edge list and let 1/z
// edges in the edge list and let 1/z sorting // sorting handle drawing order
// handle
// drawing order
R_DrawSubmodelPolygons (clmodel, clipflags); R_DrawSubmodelPolygons (clmodel, clipflags);
} }
@ -860,17 +820,12 @@ R_DrawBEntitiesOnList (void)
} }
/*
R_EdgeDrawing
*/
void void
R_EdgeDrawing (void) R_EdgeDrawing (void)
{ {
edge_t ledges[NUMSTACKEDGES + edge_t ledges[NUMSTACKEDGES +
((CACHE_SIZE - 1) / sizeof (edge_t)) + 1]; ((CACHE_SIZE - 1) / sizeof (edge_t)) + 1];
surf_t lsurfs[NUMSTACKSURFACES + surf_t lsurfs[NUMSTACKSURFACES +
((CACHE_SIZE - 1) / sizeof (surf_t)) + 1]; ((CACHE_SIZE - 1) / sizeof (surf_t)) + 1];
if (auxedges) { if (auxedges) {
@ -901,8 +856,8 @@ R_EdgeDrawing (void)
if (r_drawculledpolys) if (r_drawculledpolys)
R_ScanEdges (); R_ScanEdges ();
// only the world can be drawn back to front with no z reads or compares, just // only the world can be drawn back to front with no z reads or compares,
// z writes, so have the driver turn z compares on now // just z writes, so have the driver turn z compares on now
D_TurnZOn (); D_TurnZOn ();
if (r_dspeeds->int_val) { if (r_dspeeds->int_val) {
@ -948,8 +903,7 @@ R_RenderView_ (void)
R_SetupFrame (); R_SetupFrame ();
R_MarkLeaves (); // done here so we know if we're in R_MarkLeaves (); // done here so we know if we're in water
// water
// make FDIV fast. This reduces timing precision after we've been running for a // 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 // 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) { if (!r_dspeeds->int_val) {
VID_UnlockBuffer (); VID_UnlockBuffer ();
S_ExtraUpdate (); // don't let sound get messed up if S_ExtraUpdate (); // don't let sound get messed up if going slow
// going slow
VID_LockBuffer (); VID_LockBuffer ();
} }
@ -971,8 +924,7 @@ R_RenderView_ (void)
if (!r_dspeeds->int_val) { if (!r_dspeeds->int_val) {
VID_UnlockBuffer (); VID_UnlockBuffer ();
S_ExtraUpdate (); // don't let sound get messed up if S_ExtraUpdate (); // don't let sound get messed up if going slow
// going slow
VID_LockBuffer (); VID_LockBuffer ();
} }
@ -1033,6 +985,7 @@ R_RenderView_ (void)
Sys_HighFPPrecision (); Sys_HighFPPrecision ();
} }
void void
R_RenderView (void) R_RenderView (void)
{ {
@ -1055,9 +1008,7 @@ R_RenderView (void)
R_RenderView_ (); R_RenderView_ ();
} }
/*
R_InitTurb
*/
void void
R_InitTurb (void) R_InitTurb (void)
{ {

View file

@ -43,9 +43,7 @@
#include "render.h" #include "render.h"
#include "sbar.h" #include "sbar.h"
qboolean allowskybox; // whether or not to allow skyboxes qboolean allowskybox; // whether or not to allow skyboxes --KB
// --KB
void void
@ -170,14 +168,16 @@ R_LineGraph (int x, int y, int h)
#endif #endif
} }
#define MAX_TIMINGS 100
extern float mouse_x, mouse_y;
int graphval;
/* /*
R_TimeGraph R_TimeGraph
Performance monitoring tool Performance monitoring tool
*/ */
#define MAX_TIMINGS 100
extern float mouse_x, mouse_y;
int graphval;
void void
R_TimeGraph (void) R_TimeGraph (void)
{ {
@ -368,7 +368,6 @@ R_TransformFrustum (void)
#ifndef USE_INTEL_ASM #ifndef USE_INTEL_ASM
void void
TransformVector (vec3_t in, vec3_t out) TransformVector (vec3_t in, vec3_t out)
{ {
@ -376,7 +375,6 @@ TransformVector (vec3_t in, vec3_t out)
out[1] = DotProduct (in, vup); out[1] = DotProduct (in, vup);
out[2] = DotProduct (in, vpn); out[2] = DotProduct (in, vpn);
} }
#endif #endif

View file

@ -54,14 +54,17 @@ int r_numparticles;
vec3_t r_pright, r_pup, r_ppn; vec3_t r_pright, r_pup, r_ppn;
cvar_t *r_particles; cvar_t *r_particles;
/* /*
R_MaxParticlesCheck 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 void
R_MaxParticlesCheck (cvar_t *var) 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); r_numparticles = max(var->int_val, 1);
/* /*
@ -78,21 +81,17 @@ R_MaxParticlesCheck (cvar_t *var)
R_ClearParticles (); R_ClearParticles ();
} }
/*
R_Particles_Init_Cvars
*/
void void
R_Particles_Init_Cvars (void) R_Particles_Init_Cvars (void)
{ {
// Does a callback to R_MaxParticleCheck when the cvar changes. Neat trick. // Does a callback to R_MaxParticleCheck when the cvar changes. Neat trick.
Cvar_Get ("cl_max_particles", "2048", CVAR_ARCHIVE, R_MaxParticlesCheck, 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 void
R_ClearParticles (void) R_ClearParticles (void)
{ {
@ -156,6 +155,7 @@ R_ReadPointFile_f (void)
Con_Printf ("%i points read\n", c); Con_Printf ("%i points read\n", c);
} }
void void
R_RunSpikeEffect (vec3_t pos, byte type) R_RunSpikeEffect (vec3_t pos, byte type)
{ {
@ -175,6 +175,7 @@ R_RunSpikeEffect (vec3_t pos, byte type)
} }
} }
void void
R_RunPuffEffect (vec3_t pos, byte type, byte cnt) 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 void
R_ParticleExplosion (vec3_t org) R_ParticleExplosion (vec3_t org)
{ {
@ -233,9 +232,7 @@ R_ParticleExplosion (vec3_t org)
} }
} }
/*
R_BlobExplosion
*/
void void
R_BlobExplosion (vec3_t org) R_BlobExplosion (vec3_t org)
{ {
@ -273,9 +270,7 @@ R_BlobExplosion (vec3_t org)
} }
} }
/*
R_RunParticleEffect
*/
void void
R_RunParticleEffect (vec3_t org, int color, int count) 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 void
R_LavaSplash (vec3_t org) R_LavaSplash (vec3_t org)
{ {
@ -354,9 +346,7 @@ R_LavaSplash (vec3_t org)
} }
} }
/*
R_TeleportSplash
*/
void void
R_TeleportSplash (vec3_t org) R_TeleportSplash (vec3_t org)
{ {
@ -396,6 +386,7 @@ R_TeleportSplash (vec3_t org)
} }
} }
void void
R_RocketTrail (int type, entity_t *ent) R_RocketTrail (int type, entity_t *ent)
{ {
@ -479,9 +470,6 @@ R_RocketTrail (int type, entity_t *ent)
} }
/*
R_DrawParticles
*/
void void
R_DrawParticles (void) R_DrawParticles (void)
{ {

View file

@ -50,12 +50,10 @@ int r_skydirect; // not used?
byte bottomsky[128 * 131]; byte bottomsky[128 * 131];
byte bottommask[128 * 131]; byte bottommask[128 * 131];
byte newsky[128 * 256]; // newsky and topsky both pack in byte newsky[128 * 256]; // newsky and topsky both pack in here, 128
// bytes of newsky on the left of each scan,
// here, 128 bytes // 128 bytes of topsky on the right, because
// of newsky on the left of each scan, 128 bytes // the low-level drawers need 256-byte widths
// of topsky on the right, because the low-level
// drawers need 256-byte scan widths
/* /*
@ -93,9 +91,6 @@ R_InitSky (texture_t *mt)
} }
/*
R_MakeSky
*/
void void
R_MakeSky (void) R_MakeSky (void)
{ {
@ -121,7 +116,6 @@ R_MakeSky (void)
// FIXME: clean this up // FIXME: clean this up
#if UNALIGNED_OK #if UNALIGNED_OK
for (x = 0; x < SKYSIZE; x += 4) { for (x = 0; x < SKYSIZE; x += 4) {
ofs = baseofs + ((x + xshift) & SKYMASK); ofs = baseofs + ((x + xshift) & SKYMASK);
@ -133,9 +127,7 @@ R_MakeSky (void)
pnewsky++; pnewsky++;
} }
#else #else
for (x = 0; x < SKYSIZE; x++) { for (x = 0; x < SKYSIZE; x++) {
ofs = baseofs + ((x + xshift) & SKYMASK); ofs = baseofs + ((x + xshift) & SKYMASK);
@ -144,9 +136,7 @@ R_MakeSky (void)
*(byte *) & bottomsky[ofs]; *(byte *) & bottomsky[ofs];
pnewsky = (unsigned int *) ((byte *) pnewsky + 1); pnewsky = (unsigned int *) ((byte *) pnewsky + 1);
} }
#endif #endif
pnewsky += 128 / sizeof (unsigned int); pnewsky += 128 / sizeof (unsigned int);
} }
@ -154,9 +144,6 @@ R_MakeSky (void)
} }
/*
R_GenSkyTile
*/
void void
R_GenSkyTile (void *pdest) R_GenSkyTile (void *pdest)
{ {
@ -177,7 +164,6 @@ R_GenSkyTile (void *pdest)
// FIXME: clean this up // FIXME: clean this up
#if UNALIGNED_OK #if UNALIGNED_OK
for (x = 0; x < SKYSIZE; x += 4) { for (x = 0; x < SKYSIZE; x += 4) {
ofs = baseofs + ((x + xshift) & SKYMASK); ofs = baseofs + ((x + xshift) & SKYMASK);
@ -190,9 +176,7 @@ R_GenSkyTile (void *pdest)
pnewsky++; pnewsky++;
pd++; pd++;
} }
#else #else
for (x = 0; x < SKYSIZE; x++) { for (x = 0; x < SKYSIZE; x++) {
ofs = baseofs + ((x + xshift) & SKYMASK); ofs = baseofs + ((x + xshift) & SKYMASK);
@ -202,17 +186,12 @@ R_GenSkyTile (void *pdest)
pnewsky = (unsigned int *) ((byte *) pnewsky + 1); pnewsky = (unsigned int *) ((byte *) pnewsky + 1);
pd = (unsigned int *) ((byte *) pd + 1); pd = (unsigned int *) ((byte *) pd + 1);
} }
#endif #endif
pnewsky += 128 / sizeof (unsigned int); pnewsky += 128 / sizeof (unsigned int);
} }
} }
/*
R_GenSkyTile16
*/
void void
R_GenSkyTile16 (void *pdest) R_GenSkyTile16 (void *pdest)
{ {
@ -248,9 +227,6 @@ R_GenSkyTile16 (void *pdest)
} }
/*
R_SetSkyFrame
*/
void void
R_SetSkyFrame (void) R_SetSkyFrame (void)
{ {
@ -267,7 +243,6 @@ R_SetSkyFrame (void)
skytime = cl.time - ((int) (cl.time / temp) * temp); skytime = cl.time - ((int) (cl.time / temp) * temp);
r_skymade = 0; r_skymade = 0;
} }

View file

@ -51,9 +51,6 @@ static int sprite_width, sprite_height;
spritedesc_t r_spritedesc; spritedesc_t r_spritedesc;
/*
R_RotateSprite
*/
void void
R_RotateSprite (float beamlength) R_RotateSprite (float beamlength)
{ {
@ -105,7 +102,6 @@ R_ClipSpriteFace (int nump, clipplane_t *pclipplane)
dists[nump] = dists[0]; dists[nump] = dists[0];
memcpy (instep, in, sizeof (vec5_t)); memcpy (instep, in, sizeof (vec5_t));
// clip the winding // clip the winding
instep = in; instep = in;
outcount = 0; outcount = 0;
@ -144,9 +140,6 @@ R_ClipSpriteFace (int nump, clipplane_t *pclipplane)
} }
/*
R_SetupAndDrawSprite
*/
void void
R_SetupAndDrawSprite (void) R_SetupAndDrawSprite (void)
{ {
@ -241,9 +234,6 @@ R_SetupAndDrawSprite (void)
} }
/*
R_GetSpriteframe
*/
mspriteframe_t * mspriteframe_t *
R_GetSpriteframe (msprite_t *psprite) R_GetSpriteframe (msprite_t *psprite)
{ {
@ -270,8 +260,7 @@ R_GetSpriteframe (msprite_t *psprite)
time = cl.time + currententity->syncbase; time = cl.time + currententity->syncbase;
// when loading in Mod_LoadSpriteGroup, we guaranteed all interval // when loading in Mod_LoadSpriteGroup, we guaranteed all interval
// values // values are positive, so we don't have to worry about division by 0
// are positive, so we don't have to worry about division by 0
targettime = time - ((int) (time / fullinterval)) * fullinterval; targettime = time - ((int) (time / fullinterval)) * fullinterval;
for (i = 0; i < (numframes - 1); i++) { for (i = 0; i < (numframes - 1); i++) {
@ -286,9 +275,6 @@ R_GetSpriteframe (msprite_t *psprite)
} }
/*
R_DrawSprite
*/
void void
R_DrawSprite (void) R_DrawSprite (void)
{ {
@ -306,16 +292,12 @@ R_DrawSprite (void)
// TODO: make this caller-selectable // TODO: make this caller-selectable
if (psprite->type == SPR_FACING_UPRIGHT) { if (psprite->type == SPR_FACING_UPRIGHT) {
// generate the sprite's axes, with vup straight up in worldspace, // generate the sprite's axes, with vup straight up in worldspace, and
// and
// r_spritedesc.vright perpendicular to modelorg. // r_spritedesc.vright perpendicular to modelorg.
// This will not work if the view direction is very close to straight // This will not work if the view direction is very close to straight
// up or // up or down, because the cross product will be between two nearly
// down, because the cross product will be between two nearly // parallel vectors and starts to approach an undefined state, so we
// parallel // don't draw if the two vectors are less than 1 degree apart
// 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[0] = -modelorg[0];
tvec[1] = -modelorg[1]; tvec[1] = -modelorg[1];
tvec[2] = -modelorg[2]; tvec[2] = -modelorg[2];
@ -338,30 +320,23 @@ R_DrawSprite (void)
r_spritedesc.vpn[0] = -r_spritedesc.vright[1]; r_spritedesc.vpn[0] = -r_spritedesc.vright[1];
r_spritedesc.vpn[1] = r_spritedesc.vright[0]; r_spritedesc.vpn[1] = r_spritedesc.vright[0];
r_spritedesc.vpn[2] = 0; r_spritedesc.vpn[2] = 0;
// CrossProduct (r_spritedesc.vright, r_spritedesc.vup, // CrossProduct (r_spritedesc.vright, r_spritedesc.vup, r_spritedesc.vpn)
// r_spritedesc.vpn)
} else if (psprite->type == SPR_VP_PARALLEL) { } else if (psprite->type == SPR_VP_PARALLEL) {
// generate the sprite's axes, completely parallel to the viewplane. // generate the sprite's axes, completely parallel to the viewplane.
// There // There are no problem situations, because the sprite is always in the
// are no problem situations, because the sprite is always in the // same position relative to the viewer
// same
// position relative to the viewer
for (i = 0; i < 3; i++) { for (i = 0; i < 3; i++) {
r_spritedesc.vup[i] = vup[i]; r_spritedesc.vup[i] = vup[i];
r_spritedesc.vright[i] = vright[i]; r_spritedesc.vright[i] = vright[i];
r_spritedesc.vpn[i] = vpn[i]; r_spritedesc.vpn[i] = vpn[i];
} }
} else if (psprite->type == SPR_VP_PARALLEL_UPRIGHT) { } else if (psprite->type == SPR_VP_PARALLEL_UPRIGHT) {
// generate the sprite's axes, with vup straight up in worldspace, // generate the sprite's axes, with vup straight up in worldspace, and
// and
// r_spritedesc.vright parallel to the viewplane. // r_spritedesc.vright parallel to the viewplane.
// This will not work if the view direction is very close to straight // This will not work if the view direction is very close to straight
// up or // up or down, because the cross product will be between two nearly
// down, because the cross product will be between two nearly // parallel vectors and starts to approach an undefined state, so we
// parallel // don't draw if the two vectors are less than 1 degree apart
// 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, dot = vpn[2]; // same as DotProduct (vpn,
// r_spritedesc.vup) because // r_spritedesc.vup) because
// r_spritedesc.vup is 0, 0, 1 // 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[0] = -r_spritedesc.vright[1];
r_spritedesc.vpn[1] = r_spritedesc.vright[0]; r_spritedesc.vpn[1] = r_spritedesc.vright[0];
r_spritedesc.vpn[2] = 0; r_spritedesc.vpn[2] = 0;
// CrossProduct (r_spritedesc.vright, r_spritedesc.vup, // CrossProduct (r_spritedesc.vright, r_spritedesc.vup, r_spritedesc.vpn)
// r_spritedesc.vpn)
} else if (psprite->type == SPR_ORIENTED) { } else if (psprite->type == SPR_ORIENTED) {
// generate the sprite's axes, according to the sprite's world // generate the sprite's axes, according to the sprite's world
// orientation // orientation
@ -388,9 +362,8 @@ R_DrawSprite (void)
r_spritedesc.vright, r_spritedesc.vup); r_spritedesc.vright, r_spritedesc.vup);
} else if (psprite->type == SPR_VP_PARALLEL_ORIENTED) { } else if (psprite->type == SPR_VP_PARALLEL_ORIENTED) {
// generate the sprite's axes, parallel to the viewplane, but rotated // generate the sprite's axes, parallel to the viewplane, but rotated
// in // in that plane around the center according to the sprite entity's
// that plane around the center according to the sprite entity's roll // roll angle. So vpn stays the same, but vright and vup rotate
// angle. So vpn stays the same, but vright and vup rotate
angle = currententity->angles[ROLL] * (M_PI * 2 / 360); angle = currententity->angles[ROLL] * (M_PI * 2 / 360);
sr = sin (angle); sr = sin (angle);
cr = cos (angle); cr = cos (angle);

View file

@ -56,17 +56,12 @@ void R_DrawSurfaceBlock8_mip2 (void);
void R_DrawSurfaceBlock8_mip3 (void); void R_DrawSurfaceBlock8_mip3 (void);
static void (*surfmiptable[4]) (void) = { static void (*surfmiptable[4]) (void) = {
R_DrawSurfaceBlock8_mip0, R_DrawSurfaceBlock8_mip0, R_DrawSurfaceBlock8_mip1,
R_DrawSurfaceBlock8_mip1,
R_DrawSurfaceBlock8_mip2, R_DrawSurfaceBlock8_mip3}; R_DrawSurfaceBlock8_mip2, R_DrawSurfaceBlock8_mip3};
unsigned int blocklights[18 * 18]; unsigned int blocklights[18 * 18];
/*
R_AddDynamicLights
*/
void void
R_AddDynamicLights (void) R_AddDynamicLights (void)
{ {
@ -128,6 +123,7 @@ R_AddDynamicLights (void)
} }
} }
/* /*
R_BuildLightMap R_BuildLightMap
@ -160,7 +156,6 @@ R_BuildLightMap (void)
for (i = 0; i < size; i++) for (i = 0; i < size; i++)
blocklights[i] = r_refdef.ambientlight << 8; blocklights[i] = r_refdef.ambientlight << 8;
// add all the lightmaps // add all the lightmaps
if (lightmap) if (lightmap)
for (maps = 0; maps < MAXLIGHTMAPS && surf->styles[maps] != 255; maps++) { for (maps = 0; maps < MAXLIGHTMAPS && surf->styles[maps] != 255; maps++) {
@ -219,9 +214,6 @@ R_TextureAnimation (texture_t *base)
} }
/*
R_DrawSurface
*/
void void
R_DrawSurface (void) R_DrawSurface (void)
{ {
@ -243,8 +235,8 @@ R_DrawSurface (void)
r_source = (byte *) mt + mt->offsets[r_drawsurf.surfmip]; r_source = (byte *) mt + mt->offsets[r_drawsurf.surfmip];
// the fractional light values should range from 0 to (VID_GRADES - 1) << 16 // the fractional light values should range from 0 to
// from a source range of 0 - 255 // (VID_GRADES - 1) << 16 from a source range of 0 - 255
texwidth = mt->width >> r_drawsurf.surfmip; texwidth = mt->width >> r_drawsurf.surfmip;
@ -305,13 +297,8 @@ R_DrawSurface (void)
} }
//=============================================================================
#ifndef USE_INTEL_ASM #ifndef USE_INTEL_ASM
/*
R_DrawSurfaceBlock8_mip0
*/
void void
R_DrawSurfaceBlock8_mip0 (void) R_DrawSurfaceBlock8_mip0 (void)
{ {
@ -355,9 +342,6 @@ R_DrawSurfaceBlock8_mip0 (void)
} }
/*
R_DrawSurfaceBlock8_mip1
*/
void void
R_DrawSurfaceBlock8_mip1 (void) R_DrawSurfaceBlock8_mip1 (void)
{ {
@ -368,7 +352,7 @@ R_DrawSurfaceBlock8_mip1 (void)
prowdest = prowdestbase; prowdest = prowdestbase;
for (v = 0; v < r_numvblocks; v++) { 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? // FIXME: use delta rather than both right and left, like ASM?
lightleft = r_lightptr[0]; lightleft = r_lightptr[0];
lightright = r_lightptr[1]; lightright = r_lightptr[1];
@ -401,9 +385,6 @@ R_DrawSurfaceBlock8_mip1 (void)
} }
/*
R_DrawSurfaceBlock8_mip2
*/
void void
R_DrawSurfaceBlock8_mip2 (void) R_DrawSurfaceBlock8_mip2 (void)
{ {
@ -447,9 +428,6 @@ R_DrawSurfaceBlock8_mip2 (void)
} }
/*
R_DrawSurfaceBlock8_mip3
*/
void void
R_DrawSurfaceBlock8_mip3 (void) R_DrawSurfaceBlock8_mip3 (void)
{ {
@ -540,11 +518,6 @@ R_DrawSurfaceBlock16 (void)
#endif #endif
//============================================================================
/*
R_GenTurbTile
*/
void void
R_GenTurbTile (pixel_t *pbasetex, void *pdest) R_GenTurbTile (pixel_t *pbasetex, void *pdest)
{ {
@ -565,9 +538,6 @@ R_GenTurbTile (pixel_t *pbasetex, void *pdest)
} }
/*
R_GenTurbTile16
*/
void void
R_GenTurbTile16 (pixel_t *pbasetex, void *pdest) R_GenTurbTile16 (pixel_t *pbasetex, void *pdest)
{ {
@ -588,9 +558,6 @@ R_GenTurbTile16 (pixel_t *pbasetex, void *pdest)
} }
/*
R_GenTile
*/
void void
R_GenTile (msurface_t *psurf, void *pdest) R_GenTile (msurface_t *psurf, void *pdest)
{ {
@ -617,6 +584,7 @@ R_GenTile (msurface_t *psurf, void *pdest)
} }
} }
void void
R_ForceLightUpdate (void) R_ForceLightUpdate (void)
{ {

View file

@ -35,9 +35,7 @@
// all global and static refresh variables are collected in a contiguous block // all global and static refresh variables are collected in a contiguous block
// to avoid cache conflicts. // to avoid cache conflicts.
//------------------------------------------------------- // global refresh variables -----------------------------
// global refresh variables
//-------------------------------------------------------
// FIXME: make into one big structure, like cl or sv // FIXME: make into one big structure, like cl or sv
// FIXME: do separately for refresh engine and driver // FIXME: do separately for refresh engine and driver

View file

@ -1,5 +1,5 @@
/* /*
cl_trans.c sw_skin.c
(description) (description)
@ -41,6 +41,7 @@
#include "render.h" #include "render.h"
void void
Skin_Set_Translate (int top, int bottom, byte *dest) Skin_Set_Translate (int top, int bottom, byte *dest)
{ {
@ -69,16 +70,19 @@ Skin_Set_Translate (int top, int bottom, byte *dest)
} }
} }
void void
Skin_Do_Translation (skin_t *player_skin, int slot) Skin_Do_Translation (skin_t *player_skin, int slot)
{ {
} }
void void
Skin_Init_Translation (void) Skin_Init_Translation (void)
{ {
} }
void void
Skin_Process (skin_t *skin, struct tex_s *tex) Skin_Process (skin_t *skin, struct tex_s *tex)
{ {