h
This commit is contained in:
1 parent
7fc80bb338
commit
4a8611bd0c
2 files changed
+38
-49
No files matched your search
+17
-27
@@ -182,12 +182,10 @@ static void SplitPoly (fdivline_t *bsp, //splitting parametric line
|
||||
// the front side of the bsp partition line
|
||||
INT32 psonline = 0, peonline = 0;
|
||||
|
||||
const INT32 numpts = poly->numpts;
|
||||
|
||||
for (i = 0; i < numpts; i++)
|
||||
for (i = 0; i < poly->numpts; i++)
|
||||
{
|
||||
j = i + 1;
|
||||
if (j == numpts)
|
||||
if (j == poly->numpts)
|
||||
j = 0;
|
||||
|
||||
// start & end points
|
||||
@@ -281,7 +279,7 @@ static void SplitPoly (fdivline_t *bsp, //splitting parametric line
|
||||
// number of points on each side, _not_ counting those
|
||||
// that may lie just one the line
|
||||
nptback = pe - ps - peonline;
|
||||
nptfront = numpts - peonline - psonline - nptback;
|
||||
nptfront = poly->numpts - peonline - psonline - nptback;
|
||||
|
||||
if (nptback > 0)
|
||||
*backpoly = HWR_AllocPoly(2 + nptback);
|
||||
@@ -303,7 +301,7 @@ static void SplitPoly (fdivline_t *bsp, //splitting parametric line
|
||||
|
||||
do
|
||||
{
|
||||
if (++i == numpts)
|
||||
if (++i == poly->numpts)
|
||||
i = 0;
|
||||
|
||||
*pv++ = poly->pts[i];
|
||||
@@ -320,7 +318,7 @@ static void SplitPoly (fdivline_t *bsp, //splitting parametric line
|
||||
|
||||
do
|
||||
{
|
||||
if (++i == numpts)
|
||||
if (++i == poly->numpts)
|
||||
i = 0;
|
||||
|
||||
*pv++ = poly->pts[i];
|
||||
@@ -337,7 +335,7 @@ static void SplitPoly (fdivline_t *bsp, //splitting parametric line
|
||||
*frontpoly = swappoly;
|
||||
}
|
||||
|
||||
HWR_FreePoly(poly);
|
||||
HWR_FreePoly (poly);
|
||||
}
|
||||
|
||||
|
||||
@@ -405,12 +403,10 @@ static poly_t *CutOutSubsecPoly(seg_t *lseg, INT32 count, poly_t *poly)
|
||||
ps = -1;
|
||||
pe = -1;
|
||||
|
||||
const INT32 numpts = poly->numpts;
|
||||
|
||||
for (i = 0; i < numpts; i++)
|
||||
for (i = 0; i < poly->numpts; i++)
|
||||
{
|
||||
j = i + 1;
|
||||
if (j == numpts)
|
||||
if (j == poly->numpts)
|
||||
j = 0;
|
||||
|
||||
pv = fracdivline(&cutseg, &poly->pts[i], &poly->pts[j]);
|
||||
@@ -428,7 +424,7 @@ static poly_t *CutOutSubsecPoly(seg_t *lseg, INT32 count, poly_t *poly)
|
||||
{
|
||||
//frac 1 on previous segment,
|
||||
// 0 on the next,
|
||||
// the split line goes through one of the convex poly
|
||||
//the split line goes through one of the convex poly
|
||||
// vertices, happens quite often since the convex
|
||||
// poly is already adjacent to the subsector segs
|
||||
// on most borders
|
||||
@@ -437,7 +433,7 @@ static poly_t *CutOutSubsecPoly(seg_t *lseg, INT32 count, poly_t *poly)
|
||||
|
||||
if (fracs <= bspfrac)
|
||||
{
|
||||
nump = 2 + numpts - (i-ps);
|
||||
nump = 2 + poly->numpts - (i-ps);
|
||||
pe = ps;
|
||||
ps = i;
|
||||
ve = *pv;
|
||||
@@ -470,7 +466,7 @@ static poly_t *CutOutSubsecPoly(seg_t *lseg, INT32 count, poly_t *poly)
|
||||
|
||||
do
|
||||
{
|
||||
if (++ps == numpts)
|
||||
if (++ps == poly->numpts)
|
||||
ps = 0;
|
||||
*pv++ = poly->pts[ps];
|
||||
} while (ps != pe);
|
||||
@@ -511,7 +507,7 @@ static inline void HWR_SubsecPoly(INT32 num, poly_t *poly)
|
||||
|
||||
if (poly)
|
||||
{
|
||||
poly = CutOutSubsecPoly(lseg, count, poly);
|
||||
poly = CutOutSubsecPoly(lseg,count,poly);
|
||||
#ifdef DEBUG_HWBSP
|
||||
totalsubsecpolys++;
|
||||
#endif
|
||||
@@ -614,9 +610,7 @@ static void WalkBSPNode(INT32 bspnum, poly_t *poly, UINT16 *leafnode, fixed_t *b
|
||||
M_ClearBox(bbox);
|
||||
poly = extrasubsectors[bspnum & ~NF_SUBSECTOR].planepoly;
|
||||
|
||||
const INT32 numpts = poly->numpts;
|
||||
|
||||
for (i = 0, pt = poly->pts; i < numpts; i++,pt++)
|
||||
for (i = 0, pt = poly->pts; i < poly->numpts; i++,pt++)
|
||||
M_AddToBox(bbox, FLOAT_TO_FIXED(pt->x), FLOAT_TO_FIXED(pt->y));
|
||||
|
||||
return;
|
||||
@@ -762,7 +756,7 @@ static INT32 numsplitpoly;
|
||||
static void SearchSegInBSP(INT32 bspnum,polyvertex_t *p,poly_t *poly)
|
||||
{
|
||||
poly_t *q;
|
||||
INT32 j, k;
|
||||
INT32 j,k;
|
||||
|
||||
if (bspnum & NF_SUBSECTOR)
|
||||
{
|
||||
@@ -794,9 +788,7 @@ static void SearchSegInBSP(INT32 bspnum,polyvertex_t *p,poly_t *poly)
|
||||
|
||||
newpoly->pts[k] = *p;
|
||||
|
||||
const INT32 newnumpts = newpoly->numpts;
|
||||
|
||||
for (n = k+1; n < newnumpts; n++)
|
||||
for (n = k+1; n < newpoly->numpts; n++)
|
||||
newpoly->pts[n] = q->pts[n-1];
|
||||
|
||||
numsplitpoly++;
|
||||
@@ -895,9 +887,7 @@ static void AdjustSegs(void)
|
||||
if (lseg->polyseg)
|
||||
continue;
|
||||
|
||||
const INT32 numpts = p->numpts;
|
||||
|
||||
for (j = 0; j < numpts; j++)
|
||||
for (j = 0; j < p->numpts; j++)
|
||||
{
|
||||
distv1 = p->pts[j].x - FIXED_TO_FLOAT(lseg->v1->x);
|
||||
tmp = p->pts[j].y - FIXED_TO_FLOAT(lseg->v1->y);
|
||||
@@ -984,7 +974,7 @@ void HWR_CreatePlanePolygons(INT32 bspnum)
|
||||
I_FinishUpdate(); // page flip or blit buffer
|
||||
#endif
|
||||
|
||||
// reset the portal && horizonline flag
|
||||
// reset the portal and horizonline flag
|
||||
gl_maphasportals = gl_maphashorizonlines = 0;
|
||||
|
||||
// find min/max boundaries of map
|
||||
|
||||
+21
-22
@@ -28,13 +28,12 @@ extern "C" {
|
||||
extern UINT8 *renderscreen;
|
||||
extern INT32 linesize;
|
||||
|
||||
# define RENDER_FASTCALL __attribute__((hot))
|
||||
|
||||
FUNCINLINE static ATTRINLINE RENDER_FASTCALL UINT8 *R_Address(INT32 px, INT32 py)
|
||||
FUNCINLINE static ATTRINLINE UINT8 *R_Address(INT32 px, INT32 py)
|
||||
{
|
||||
return renderscreen + (py + viewwindowy) * linesize + (viewwindowx + px);
|
||||
}
|
||||
|
||||
|
||||
typedef struct {
|
||||
float x, y, z;
|
||||
} floatv3_t;
|
||||
@@ -239,36 +238,36 @@ void R_DrawViewBorder(void);
|
||||
// -----------------
|
||||
|
||||
// column drawers
|
||||
void R_DrawColumn(drawcolumndata_t* dc) RENDER_FASTCALL;
|
||||
void R_DrawColumnShadowed(drawcolumndata_t* dc) RENDER_FASTCALL;
|
||||
void R_DrawColumn(drawcolumndata_t* dc);
|
||||
void R_DrawColumnShadowed(drawcolumndata_t* dc);
|
||||
|
||||
void R_DrawTranslucentColumn(drawcolumndata_t* dc) RENDER_FASTCALL;
|
||||
void R_DrawTranslucentColumn(drawcolumndata_t* dc);
|
||||
|
||||
void R_DrawTranslatedColumn(drawcolumndata_t* dc) RENDER_FASTCALL;
|
||||
void R_DrawTranslatedTranslucentColumn(drawcolumndata_t* dc) RENDER_FASTCALL;
|
||||
void R_DrawTranslatedColumn(drawcolumndata_t* dc);
|
||||
void R_DrawTranslatedTranslucentColumn(drawcolumndata_t* dc);
|
||||
|
||||
void R_Draw2sMultiPatchColumn(drawcolumndata_t* dc) RENDER_FASTCALL;
|
||||
void R_Draw2sMultiPatchTranslucentColumn(drawcolumndata_t* dc) RENDER_FASTCALL;
|
||||
void R_Draw2sMultiPatchColumn(drawcolumndata_t* dc);
|
||||
void R_Draw2sMultiPatchTranslucentColumn(drawcolumndata_t* dc);
|
||||
|
||||
void R_DrawFogColumn(drawcolumndata_t* dc) RENDER_FASTCALL;
|
||||
void R_DrawFogColumn(drawcolumndata_t* dc);
|
||||
|
||||
// span drawers
|
||||
void R_DrawSpan(drawspandata_t* ds) RENDER_FASTCALL;
|
||||
void R_DrawSpan(drawspandata_t* ds);
|
||||
|
||||
void R_DrawSpan_Tilted(drawspandata_t* ds) RENDER_FASTCALL;
|
||||
void R_DrawTranslucentSpan_Tilted(drawspandata_t* ds) RENDER_FASTCALL;
|
||||
void R_DrawTranslucentWaterSpan_Tilted(drawspandata_t* ds) RENDER_FASTCALL;
|
||||
void R_DrawSpan_Tilted(drawspandata_t* ds);
|
||||
void R_DrawTranslucentSpan_Tilted(drawspandata_t* ds);
|
||||
void R_DrawTranslucentWaterSpan_Tilted(drawspandata_t* ds);
|
||||
|
||||
void R_DrawTranslucentSpan(drawspandata_t* ds) RENDER_FASTCALL;
|
||||
void R_DrawTranslucentWaterSpan(drawspandata_t* ds) RENDER_FASTCALL;
|
||||
void R_DrawTranslucentSpan(drawspandata_t* ds);
|
||||
void R_DrawTranslucentWaterSpan(drawspandata_t* ds);
|
||||
|
||||
void R_DrawFogSpan(drawspandata_t* ds) RENDER_FASTCALL;
|
||||
void R_DrawFogSpan(drawspandata_t* ds);
|
||||
void R_DrawFogSpan_Tilted(drawspandata_t* ds);
|
||||
|
||||
void R_DrawSplat_Tilted(drawspandata_t* ds) RENDER_FASTCALL;
|
||||
void R_DrawSplat(drawspandata_t* ds) RENDER_FASTCALL;
|
||||
void R_DrawTranslucentSplat(drawspandata_t* ds) RENDER_FASTCALL;
|
||||
void R_DrawTranslucentSplat_Tilted(drawspandata_t* ds) RENDER_FASTCALL;
|
||||
void R_DrawSplat_Tilted(drawspandata_t* ds);
|
||||
void R_DrawSplat(drawspandata_t* ds);
|
||||
void R_DrawTranslucentSplat(drawspandata_t* ds);
|
||||
void R_DrawTranslucentSplat_Tilted(drawspandata_t* ds);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
|
||||
Reference in new issue
Block a user