Commit a47a99b3 authored by nukeykt's avatar nukeykt

Engine: fix TROR rendering glitch in polymost when camera Z is outside of sector boundaries

parent 2609d8cb
......@@ -5415,6 +5415,20 @@ static void polymost_drawalls(int32_t const bunch)
}
#ifdef YAX_ENABLE
int32_t checkcf = 0;
int16_t bn[2] = {};
if (g_nodraw)
{
int32_t baselevp;
baselevp = (yax_globallev == YAX_MAXDRAWS);
yax_getbunches(sectnum, &bn[0], &bn[1]);
checkcf = (bn[0]>=0) + ((bn[1]>=0)<<1);
if (!baselevp)
checkcf &= (1<<yax_globalcf);
}
yax_holencf[YAX_FLOOR] = 0;
yax_drawcf = YAX_FLOOR;
#endif
......@@ -5446,6 +5460,10 @@ static void polymost_drawalls(int32_t const bunch)
int32_t fz = getflorzofslope(sectnum, globalposx, globalposy);
if (globalposz <= fz)
polymost_internal_nonparallaxed(n0, n1, ryp0, ryp1, x0, x1, fy0, fy1, sectnum | MAXSECTORS);
#ifdef YAX_ENABLE
else if (g_nodraw && (checkcf & 2) != 0)
polymost_domost(x0, fy0, x1, fy1);
#endif
}
else if ((nextsectnum < 0) || (!(sector[nextsectnum].floorstat&1)))
{
......@@ -5840,6 +5858,10 @@ static void polymost_drawalls(int32_t const bunch)
int32_t cz = getceilzofslope(sectnum, globalposx, globalposy);
if (globalposz >= cz)
polymost_internal_nonparallaxed(n0, n1, ryp0, ryp1, x0, x1, cy0, cy1, sectnum);
#ifdef YAX_ENABLE
else if (g_nodraw && (checkcf & 1) != 0)
polymost_domost(x1, cy1, x0, cy0);
#endif
}
else if ((nextsectnum < 0) || (!(sector[nextsectnum].ceilingstat&1)))
{
......@@ -6192,22 +6214,7 @@ static void polymost_drawalls(int32_t const bunch)
#ifdef YAX_ENABLE
if (g_nodraw)
{
int32_t baselevp, checkcf, i, j;
int16_t bn[2];
# if 0
int32_t obunchchk = (1 && yax_globalbunch>=0 &&
haveymost[yax_globalbunch>>3]&pow2char[yax_globalbunch&7]);
// if (obunchchk)
const int32_t x2 = yax_globalbunch*xdimen;
# endif
baselevp = (yax_globallev == YAX_MAXDRAWS);
yax_getbunches(sectnum, &bn[0], &bn[1]);
checkcf = (bn[0]>=0) + ((bn[1]>=0)<<1);
if (!baselevp)
checkcf &= (1<<yax_globalcf);
int32_t i, j;
for (i=0; i<2; i++)
if (checkcf&(1<<i))
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment