64-bit OpenGL holes
Splitting discussion from #38 (closed)
What I observed:
- By the time
HWR_RenderPlane()
is called, theextrasubsector[].polyplane->poly
coordinates are already fudged up -
HWR_SubsecPoly()
produces poly coordinates in 32-bit that are more consistent with subsector coordinates (but not always). However, in 64-bit, more often the poly coordinates do not match the subsector coordinates. But more importantly, the 64-bit output does not match the 32-bit output. - 32 and 64-bit are consistent in the values they process, until this code block in
CutOutSubsecPoly()
, below. Two more identical code blocks exist at the end ofSplitPoly()
I don't know if fixing this inconsistency would fix the holes, but it's rather glaring. I'm not completely educated on what this code is doing -- it's called from WalkBSPNode()
, a recursive function -- but I'll bang at it with a hammer later this week...
Coordinate printouts and test EXE with log messages. See 64-gl-log
branch for log messages.
For reference:
- Sapphire Falls' missing triangle is subsector 79
- GFZ2's missing triangle is subsector 1222
// there was a split
if (ps >= 0)
{
//need 2 points
if (pe >= 0)
{
// generate FRONT poly
temppoly = HWR_AllocPoly(nump);
pv = temppoly->pts;
*pv++ = vs;
*pv++ = ve;
do
{
if (++ps == poly->numpts)
ps = 0;
*pv++ = poly->pts[ps]; // <------------- FIRST INCONSISTENCY IN 64-BIT
} while (ps != pe);
HWR_FreePoly(poly);
poly = temppoly;
}
//hmmm... maybe we should NOT accept this, but this happens
// only when the cut is not needed it seems (when the cut
// line is aligned to one of the borders of the poly, and
// only some times..)
else
skipcut++;
// I_Error("CutOutPoly: only one point for split line (%d %d) %d", ps, pe, debugpos);
}
}
return poly; // <------------ THIS GETS FED INTO EXTRASUBSECTOR[], LATER