Use boolean for r_outof*

This commit is contained in:
Denis Pauk 2019-02-12 22:41:10 +02:00
parent 5e7082e72d
commit 0ab41ee0df
6 changed files with 21 additions and 21 deletions

View file

@ -516,10 +516,10 @@ extern int r_aliasblendcolor;
extern float aliasxscale, aliasyscale, aliasxcenter, aliasycenter;
extern int r_outofsurfaces;
extern int r_outofedges;
extern int r_outofverts;
extern int r_outoftriangles;
extern qboolean r_outofsurfaces;
extern qboolean r_outofedges;
extern qboolean r_outofverts;
extern qboolean r_outoftriangles;
extern mvertex_t *r_pcurrentvertbase;

View file

@ -232,7 +232,7 @@ R_AliasPreparePoints (const entity_t *currententity, finalvert_t *verts, const f
if ((verts + s_pmdl->num_xyz) >= verts_max)
{
r_outofverts += s_pmdl->num_xyz - (verts_max - verts);
r_outofverts = true;
return;
}

View file

@ -68,10 +68,10 @@ int r_numallocatededges;
int r_numallocatedverts;
int r_numallocatedtriangles;
float r_aliasuvscale = 1.0;
int r_outofsurfaces;
int r_outofedges;
int r_outofverts;
int r_outoftriangles;
qboolean r_outofsurfaces;
qboolean r_outofedges;
qboolean r_outofverts;
qboolean r_outoftriangles;
qboolean r_dowarp;
@ -379,6 +379,7 @@ R_ReallocateMapBuffers (void)
if (r_outofsurfaces)
{
r_cnumsurfs *= 2;
r_outofsurfaces = false;
}
if (r_cnumsurfs < NUMSTACKSURFACES)
@ -413,6 +414,7 @@ R_ReallocateMapBuffers (void)
if (r_outofedges)
{
r_numallocatededges *= 2;
r_outofedges = false;
}
if (r_numallocatededges < NUMSTACKEDGES)
@ -443,6 +445,7 @@ R_ReallocateMapBuffers (void)
if (r_outofverts)
{
r_numallocatedverts *= 2;
r_outofverts = false;
}
if (r_numallocatedverts < MAXALIASVERTS)
@ -470,6 +473,7 @@ R_ReallocateMapBuffers (void)
if (r_outoftriangles)
{
r_numallocatedtriangles *= 2;
r_outoftriangles = false;
}
if (r_numallocatedtriangles < vid.height)
@ -1809,7 +1813,7 @@ SWimp_CreateRender(void)
edge_basespans = malloc((vid.width*2) * sizeof(espan_t));
// count of "out of items"
r_outofsurfaces = r_outofedges = r_outofverts = r_outoftriangles = 0;
r_outofsurfaces = r_outofedges = r_outofverts = r_outoftriangles = false;
// pointers to allocated buffers
finalverts = NULL;
r_edges = NULL;

View file

@ -385,10 +385,6 @@ R_SetupFrame (void)
r_polycount = 0;
r_drawnpolycount = 0;
r_amodels_drawn = 0;
r_outofsurfaces = 0;
r_outofverts = 0;
r_outofedges = 0;
r_outoftriangles = 0;
// d_setup
d_minmip = sw_mipcap->value;

View file

@ -220,7 +220,7 @@ R_PushEdgesSpan(int u, int v, int count,
if (d_pedgespanpackage >= triangles_max)
{
// no space any more
r_outoftriangles++;
r_outoftriangles = true;
return;
}
@ -891,7 +891,7 @@ R_RasterizeAliasPolySmooth(const entity_t *currententity)
if ((triangle_spans + initialrightheight) >= triangles_max)
{
// we dont have enough triangles for save full height
r_outoftriangles++;
r_outoftriangles = true;
return;
}
originalcount = triangle_spans[initialrightheight].count;
@ -920,7 +920,7 @@ R_RasterizeAliasPolySmooth(const entity_t *currententity)
if ((triangle_spans + initialrightheight + height) >= triangles_max)
{
// we dont have enough triangles for save full height
r_outoftriangles++;
r_outoftriangles = true;
return;
}
triangle_spans[initialrightheight + height].count = INT_MIN; // mark end of the spanpackages

View file

@ -548,14 +548,14 @@ R_RenderFace (entity_t *currententity, const model_t *currentmodel, msurface_t *
// skip out if no more surfs
if ((surface_p) >= surf_max)
{
r_outofsurfaces++;
r_outofsurfaces = true;
return;
}
// ditto if not enough edges left, or switch to auxedges if possible
if ((edge_p + fa->numedges + 4) >= edge_max)
{
r_outofedges += fa->numedges;
r_outofedges = true;
return;
}
@ -755,14 +755,14 @@ R_RenderBmodelFace(entity_t *currententity, bedge_t *pedges, msurface_t *psurf)
// skip out if no more surfs
if (surface_p >= surf_max)
{
r_outofsurfaces++;
r_outofsurfaces = true;
return;
}
// ditto if not enough edges left, or switch to auxedges if possible
if ((edge_p + psurf->numedges + 4) >= edge_max)
{
r_outofedges += psurf->numedges;
r_outofedges = true;
return;
}