Log messages for subsectors

This commit is contained in:
mazmazz 2018-12-10 08:35:31 -05:00
parent 1029463741
commit 612e024287
2 changed files with 31 additions and 3 deletions

View file

@ -550,6 +550,9 @@ static poly_t *CutOutSubsecPoly(seg_t *lseg, INT32 count, poly_t *poly)
// I_Error("CutOutPoly: only one point for split line (%d %d) %d", ps, pe, debugpos);
}
}
CONS_Printf("X0 %.0f> Y0 %.0f> Z0 %.0f> X1 %.0f> Y1 %.0f> Z1 %.0f\n",
poly->pts[0].x, poly->pts[0].y, poly->pts[0].z,
poly->pts[1].x, poly->pts[1].y, poly->pts[1].z);
return poly;
}
@ -601,7 +604,7 @@ static void WalkBSPNode(INT32 bspnum, poly_t *poly, UINT16 *leafnode, fixed_t *b
fdivline_t fdivline;
polyvertex_t *pt;
INT32 i;
bsp = &nodes[bspnum];
// Found a subsector?
if (bspnum & NF_SUBSECTOR)
{
@ -630,6 +633,7 @@ static void WalkBSPNode(INT32 bspnum, poly_t *poly, UINT16 *leafnode, fixed_t *b
}
else
{
CONS_Printf("SS-%d> ", bspnum % NF_SUBSECTOR);
HWR_SubsecPoly(bspnum&(~NF_SUBSECTOR), poly);
//Hurdler: implement a loading status
@ -1014,12 +1018,29 @@ void HWR_CreatePlanePolygons(INT32 bspnum)
rootpv->y = FIXED_TO_FLOAT(rootbbox[BOXBOTTOM]); //ll
rootpv++;
CONS_Printf("\SUBSECTORS\n\n");
WalkBSPNode(bspnum, rootp, NULL,rootbbox);
i = SolveTProblem();
//CONS_Debug(DBG_RENDER, "%d point divides a polygon line\n",i);
AdjustSegs();
CONS_Printf("\nEXTRASUBSECTORS\n\n");
INT32 j = 0;
for (j = 0; j < bspnum; j++)
{
CONS_Printf("ESS-%d> ", j);
if (!extrasubsectors[j].planepoly)
{
CONS_Printf("\n");
continue;
}
CONS_Printf("X0 %.4f> Y0 %.4f> Z0 %.4f> X1 %.4f> Y1 %.4f> Z1 %.4f\n",
extrasubsectors[j].planepoly->pts[0].x, extrasubsectors[j].planepoly->pts[0].y, extrasubsectors[j].planepoly->pts[0].z,
extrasubsectors[j].planepoly->pts[1].x, extrasubsectors[j].planepoly->pts[1].y, extrasubsectors[j].planepoly->pts[1].z);
}
//debug debug..
//if (nobackpoly)
// CONS_Debug(DBG_RENDER, "no back polygon %u times\n",nobackpoly);

View file

@ -548,7 +548,10 @@ static void HWR_RenderPlane(sector_t *sector, extrasubsector_t *xsub, boolean is
// no convex poly were generated for this subsector
if (!xsub->planepoly)
{
CONS_Debug(DBG_RENDER, "%d> No convex poly were generated for this subsector\n", gametic);
return;
}
#ifdef ESLOPE
// Get the slope pointer to simplify future code
@ -578,11 +581,14 @@ static void HWR_RenderPlane(sector_t *sector, extrasubsector_t *xsub, boolean is
nrPlaneVerts = xsub->planepoly->numpts;
if (nrPlaneVerts < 3) //not even a triangle ?
{
CONS_Debug(DBG_RENDER, "%d> polygon size of %d is not a triangle\n", gametic, nrPlaneVerts);
return;
}
if (nrPlaneVerts > UINT16_MAX) // FIXME: exceeds plVerts size
{
CONS_Debug(DBG_RENDER, "polygon size of %d exceeds max value of %d vertices\n", nrPlaneVerts, UINT16_MAX);
CONS_Debug(DBG_RENDER, "%d> polygon size of %d exceeds max value of %d vertices\n", gametic, nrPlaneVerts, UINT16_MAX);
return;
}
@ -3516,8 +3522,9 @@ static void HWR_Subsector(size_t num)
{
if (sub->validcount != validcount)
{
extrasubsector_t *extrasubsector = &extrasubsectors[num];
HWR_GetFlat(levelflats[gr_frontsector->floorpic].lumpnum);
HWR_RenderPlane(gr_frontsector, &extrasubsectors[num], false,
HWR_RenderPlane(gr_frontsector, extrasubsector, false,
// Hack to make things continue to work around slopes.
locFloorHeight == cullFloorHeight ? locFloorHeight : gr_frontsector->floorheight,
// We now return you to your regularly scheduled rendering.