tweak the sky checks even more

apparently koda has a skybox, and checking like this makes it not trigger, lets hope this has no bad side effects Zzz...
This commit is contained in:
Alug committed 2025-06-13 00:08:50 +02:00
1 parent bd07085aaa
commit a696fb6e52
1 file changed
+8 -6
+8 -6
View File
@@ -2432,21 +2432,23 @@ void R_StoreWallRange(INT32 start, INT32 stop)
// untextured seg
if (!segtextured && !curline->polyseg)
{
const bool tophigh = (backsector && worldhigh <= worldtop && worldhighslope <= worldtopslope)
&& (worldhigh != worldtop || worldhighslope != worldtopslope);
const bool tophigh = (worldhigh <= worldtop && worldhighslope <= worldtopslope);
const bool topnothigh = (backsector && (worldhigh != worldtop || worldhighslope != worldtopslope));
// if we cant see the goddamn skyplane, well there wont be any skybox
// we could kill skyVisible instead, but i want to keep the performance improvemnts it yields
// so we do this absolute trash
if ((frontsector->floorpic != skyflatnum && frontsector->ceilingpic != skyflatnum) // try to guess if its a "window"
if ((tophigh
&& (frontsector->floorpic != skyflatnum && frontsector->ceilingpic != skyflatnum)) // try to guess if its a "window"
&& ((!backsector) // single sided
|| (tophigh && (backsector->floorheight > frontsector->ceilingheight || backsector->ceilingheight < frontsector->floorheight)))) // check if there is a "thok" sector behind it
|| (topnothigh && (backsector->floorheight > frontsector->ceilingheight || backsector->ceilingheight < frontsector->floorheight)))) // check if there is a "thok" sector behind it
skyVisible = true;
// this is an attempt to fix issues with textureless midtextures drawing nothing where they should just draw sky instead
if ((newview->sky // only do this for skyrender
if ((tophigh
&& newview->sky) // only do this for skyrender
&& ((!backsector && frontsector->ceilingpic == skyflatnum) // single sided line with sky ceiling
|| (tophigh && (backsector->ceilingpic == skyflatnum && frontsector->ceilingpic != skyflatnum))))) // double sided with back ceiling sky but not front ceiling sky
|| (topnothigh && (backsector->ceilingpic == skyflatnum && frontsector->ceilingpic != skyflatnum)))) // double sided with back ceiling sky but not front ceiling sky
{
topstep = -FixedMul (rw_scalestep, worldbottom);
topfrac = (centeryfrac>>4) - FixedMul (worldbottom, rw_scale);