mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-16 01:11:44 +00:00
Patch from Nuke.YKT to work around precision-based inaccuracy problems in Polymost TROR
git-svn-id: https://svn.eduke32.com/eduke32@7846 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
1d14991acc
commit
f3e4dd4463
1 changed files with 31 additions and 1 deletions
|
@ -3147,7 +3147,7 @@ skip: ;
|
|||
|
||||
do
|
||||
{
|
||||
if ((vsp[i].cy[0] >= vsp[i].fy[0]) && (vsp[i].cy[1] >= vsp[i].fy[1]))
|
||||
if ((vsp[i].cy[0]+DOMOST_OFFSET*2 >= vsp[i].fy[0]) && (vsp[i].cy[1]+DOMOST_OFFSET*2 >= vsp[i].fy[1]))
|
||||
vsp[i].ctag = vsp[i].ftag = -1;
|
||||
|
||||
int const ni = vsp[i].n;
|
||||
|
@ -5338,6 +5338,36 @@ void polymost_drawrooms()
|
|||
polymost_domost(yax_vsp[yax_globalbunch*2+1][i].x, yax_vsp[yax_globalbunch*2+1][i].cy[0]+DOMOST_OFFSET, yax_vsp[yax_globalbunch*2+1][newi].x, yax_vsp[yax_globalbunch*2+1][i].cy[1]+DOMOST_OFFSET);
|
||||
}
|
||||
g_nodraw = nodrawbak;
|
||||
|
||||
#ifdef COMBINE_STRIPS
|
||||
i = vsp[0].n;
|
||||
|
||||
do
|
||||
{
|
||||
int const ni = vsp[i].n;
|
||||
|
||||
//POGO: specially treat the viewport nodes so that we will never end up in a situation where we accidentally access the sentinel node
|
||||
if (ni >= viewportNodeCount)
|
||||
{
|
||||
if (Bfabsf(vsp[i].cy[1]-vsp[ni].cy[0]) < 0.1f && Bfabsf(vsp[i].fy[1]-vsp[ni].fy[0]) < 0.1f)
|
||||
{
|
||||
float const dx = 1.f/(vsp[ni].x-vsp[i].x);
|
||||
float const dx2 = 1.f/(vsp[vsp[ni].n].x-vsp[i].x);
|
||||
float const cslop[2] = { vsp[i].cy[1]-vsp[i].cy[0], vsp[ni].cy[1]-vsp[i].cy[0] };
|
||||
float const fslop[2] = { vsp[i].fy[1]-vsp[i].fy[0], vsp[ni].fy[1]-vsp[i].fy[0] };
|
||||
|
||||
if (Bfabsf(cslop[0]*dx-cslop[1]*dx2) < 0.001f && Bfabsf(fslop[0]*dx-fslop[1]*dx2) < 0.001f)
|
||||
{
|
||||
MERGE_NODES(i, ni);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
i = ni;
|
||||
}
|
||||
while (i);
|
||||
#undef MERGE_NODES
|
||||
#endif
|
||||
}
|
||||
//else if (!g_nodraw) { videoEndDrawing(); return; }
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue