code clean up

This commit is contained in:
Denis Pauk 2018-07-24 23:38:31 +03:00
parent e1a9e7e4e2
commit 125d6db8b6
5 changed files with 16 additions and 22 deletions

View File

@ -230,13 +230,6 @@ R_AliasPreparePoints (finalvert_t *verts, finalvert_t *verts_max)
dtriangle_t *ptri;
finalvert_t *pfv[3];
// not fully initialized buffers?
if (!verts)
{
R_Printf(PRINT_ALL, "%s: verts are empty.\n", __func__);
return;
}
if ((verts + s_pmdl->num_xyz) >= verts_max)
{
r_outofverts += s_pmdl->num_xyz - (verts_max - verts);

View File

@ -197,7 +197,7 @@ R_StepActiveU (edge_t *pedge)
// find out where the edge goes in the edge list
pwedge = pedge->prev->prev;
while (pwedge && (pwedge->u > pedge->u))
while (pwedge->u > pedge->u)
{
pwedge = pwedge->prev;
}
@ -297,8 +297,6 @@ R_LeadingEdgeBackwards (edge_t *edge)
// end edge)
if (++surf->spanstate == 1)
{
shift20_t iu;
surf2 = surfaces[1].next;
// if it's two surfaces on the same plane, the one that's already
@ -306,6 +304,8 @@ R_LeadingEdgeBackwards (edge_t *edge)
// must be two bmodels in the same leaf; don't care, because they'll
// never be farthest anyway
if (surf->key > surf2->key || (surf->insubmodel && (surf->key == surf2->key))) {
shift20_t iu;
// emit a span (obscures current top)
iu = edge->u >> shift_size;
@ -407,10 +407,12 @@ R_LeadingEdgeSearch
static surf_t*
R_LeadingEdgeSearch (edge_t *edge, surf_t *surf, surf_t *surf2)
{
float fu, newzi, testzi, newzitop, newzibottom;
float testzi, newzitop;
do
{
float fu, newzi, newzibottom;
surf2 = D_SurfSearchForward(surf, surf2);
if (surf->key != surf2->key)

View File

@ -160,9 +160,6 @@ RecursiveLightPoint (mnode_t *node, vec3_t start, vec3_t end)
if (r >= 0)
return r; // hit something
if ((back < 0) == side)
return -1; // didn't hit anything
// check for impact on this node
VectorCopy (mid, lightspot);

View File

@ -426,8 +426,8 @@ R_ReallocateMapBuffers (void)
if (r_outofsurfaces)
{
R_Printf(PRINT_ALL, "%s: not enough %d(+%d) surfaces\n",
__func__, r_cnumsurfs, r_outofsurfaces);
//R_Printf(PRINT_ALL, "%s: not enough %d(+%d) surfaces\n",
// __func__, r_cnumsurfs, r_outofsurfaces);
r_cnumsurfs *= 2;
}
@ -465,8 +465,8 @@ R_ReallocateMapBuffers (void)
if (r_outofedges)
{
R_Printf(PRINT_ALL, "%s: not enough %d(+%d) edges\n",
__func__, r_numallocatededges, r_outofedges * 2 / 3);
//R_Printf(PRINT_ALL, "%s: not enough %d(+%d) edges\n",
// __func__, r_numallocatededges, r_outofedges * 2 / 3);
r_numallocatededges *= 2;
}
@ -497,8 +497,8 @@ R_ReallocateMapBuffers (void)
if (r_outofverts)
{
R_Printf(PRINT_ALL, "%s: not enough %d(+%d) finalverts\n",
__func__, r_numallocatedverts, r_outofverts);
//R_Printf(PRINT_ALL, "%s: not enough %d(+%d) finalverts\n",
// __func__, r_numallocatedverts, r_outofverts);
r_numallocatedverts *= 2;
}
@ -1269,7 +1269,6 @@ static void
RE_SetPalette(const unsigned char *palette)
{
byte palette32[1024];
int i;
// clear screen to black to avoid any palette flash
memset(vid_buffer, 0, vid.height * vid.width * sizeof(pixel_t));
@ -1279,6 +1278,8 @@ RE_SetPalette(const unsigned char *palette)
if (palette)
{
int i;
for ( i = 0; i < 256; i++ )
{
palette32[i*4+0] = palette[i*3+0];

View File

@ -595,7 +595,6 @@ R_ClipPolyFace (int nump, clipplane_t *pclipplane)
static void
R_PolygonDrawSpans(espan_t *pspan, int iswater )
{
int count;
int snext, tnext;
float sdivz, tdivz, zi, z, du, dv, spancountminus1;
float sdivzspanletstepu, tdivzspanletstepu, zispanletstepu;
@ -621,6 +620,8 @@ R_PolygonDrawSpans(espan_t *pspan, int iswater )
do
{
int count;
s_spanletvars.pdest = d_viewbuffer + (r_screenwidth * pspan->v) + pspan->u;
s_spanletvars.pz = d_pzbuffer + (d_zwidth * pspan->v) + pspan->u;
s_spanletvars.u = pspan->u;