From d7e6acf0c1a6dddb2034830f9144b024a5c5be23 Mon Sep 17 00:00:00 2001 From: NepDisk <16447892+NepDisk@users.noreply.github.com> Date: Wed, 11 Sep 2024 09:57:11 -0400 Subject: [PATCH 1/2] use fallback complast to fix compile issues --- comptime.bat | 1 + comptime.sh | 1 + 2 files changed, 2 insertions(+) diff --git a/comptime.bat b/comptime.bat index 0c7ea06d6..3a7be2ee1 100644 --- a/comptime.bat +++ b/comptime.bat @@ -30,3 +30,4 @@ echo // by the %0 batch file >> %1\comptime.h echo // >> %1\comptime.h echo const char* compbranch = "%BRA%"; >> %1\comptime.h echo const char* comprevision = "%REV%"; >> %1\comptime.h +echo const char* complast = "deez nuts"; >> %1\comptime.h diff --git a/comptime.sh b/comptime.sh index d5ef7271a..12fb71d54 100755 --- a/comptime.sh +++ b/comptime.sh @@ -39,6 +39,7 @@ versionfake() { // const char* compbranch = "Unknown"; const char* comprevision = "illegal"; +const char* complast = "deez nuts"; EOF } From a1e4b5d6baf13d0bda4f715af5930f334cb05a9d Mon Sep 17 00:00:00 2001 From: Alug Date: Wed, 11 Sep 2024 17:58:15 +0200 Subject: [PATCH 2/2] fix software skywalls this is a fucking mess thx --- src/r_bsp.c | 182 ++++++++++++++++++++++++++++++++++----------------- src/r_segs.c | 58 +++++++++------- 2 files changed, 158 insertions(+), 82 deletions(-) diff --git a/src/r_bsp.c b/src/r_bsp.c index ca1bcf596..61cf55a7a 100644 --- a/src/r_bsp.c +++ b/src/r_bsp.c @@ -510,20 +510,23 @@ static void R_AddLine(seg_t *line) doorclosed = 0; - if (backsector->ceilingpic == skyflatnum && frontsector->ceilingpic == skyflatnum) - bothceilingssky = true; - if (backsector->floorpic == skyflatnum && frontsector->floorpic == skyflatnum) - bothfloorssky = true; - - if (bothceilingssky && bothfloorssky) // everything's sky? let's save us a bit of time then + if (udmf) { - if (!line->polyseg && - !line->sidedef->midtexture - && ((!frontsector->ffloors && !backsector->ffloors) - || Tag_Compare(&frontsector->tags, &backsector->tags))) - return; // line is empty, don't even bother + if (backsector->ceilingpic == skyflatnum && frontsector->ceilingpic == skyflatnum) + bothceilingssky = true; + if (backsector->floorpic == skyflatnum && frontsector->floorpic == skyflatnum) + bothfloorssky = true; - goto clippass; // treat like wide open window instead + if (bothceilingssky && bothfloorssky) // everything's sky? let's save us a bit of time then + { + if (!line->polyseg && + !line->sidedef->midtexture + && ((!frontsector->ffloors && !backsector->ffloors) + || Tag_Compare(&frontsector->tags, &backsector->tags))) + return; // line is empty, don't even bother + + goto clippass; // treat like wide open window instead + } } // Closed door. @@ -540,70 +543,131 @@ static void R_AddLine(seg_t *line) SLOPEPARAMS( backsector->f_slope, backf1, backf2, backsector-> floorheight) SLOPEPARAMS( backsector->c_slope, backc1, backc2, backsector->ceilingheight) #undef SLOPEPARAMS - // if both ceilings are skies, consider it always "open" - // same for floors - if (!bothceilingssky && !bothfloorssky) + + if (udmf) { - if ((backc1 <= frontf1 && backc2 <= frontf2) - || (backf1 >= frontc1 && backf2 >= frontc2)) + // if both ceilings are skies, consider it always "open" + // same for floors + if (!bothceilingssky && !bothfloorssky) { - goto clipsolid; + if ((backc1 <= frontf1 && backc2 <= frontf2) + || (backf1 >= frontc1 && backf2 >= frontc2)) + { + goto clipsolid; + } + + // Check for automap fix. Store in doorclosed for r_segs.c + doorclosed = (backc1 <= backf1 && backc2 <= backf2 + && ((backc1 >= frontc1 && backc2 >= frontc2) || curline->sidedef->toptexture) + && ((backf1 <= frontf1 && backf2 >= frontf2) || curline->sidedef->bottomtexture)); + + if (doorclosed) + goto clipsolid; } - // Check for automap fix. Store in doorclosed for r_segs.c - doorclosed = (backc1 <= backf1 && backc2 <= backf2 - && ((backc1 >= frontc1 && backc2 >= frontc2) || curline->sidedef->toptexture) - && ((backf1 <= frontf1 && backf2 >= frontf2) || curline->sidedef->bottomtexture)); - - if (doorclosed) - goto clipsolid; + // Window. + if (!bothceilingssky) // ceilings are always the "same" when sky + if (backc1 != frontc1 || backc2 != frontc2) + goto clippass; + if (!bothfloorssky) // floors are always the "same" when sky + if (backf1 != frontf1 || backf2 != frontf2) + goto clippass; } + else + { + if (viewsector != backsector && viewsector != frontsector) + { + if ((backc1 <= frontf1 && backc2 <= frontf2) + || (backf1 >= frontc1 && backf2 >= frontc2)) + { + goto clipsolid; + } - // Window. - if (!bothceilingssky) // ceilings are always the "same" when sky - if (backc1 != frontc1 || backc2 != frontc2) - goto clippass; - if (!bothfloorssky) // floors are always the "same" when sky - if (backf1 != frontf1 || backf2 != frontf2) + // Check for automap fix. Store in doorclosed for r_segs.c + doorclosed = (backc1 <= backf1 && backc2 <= backf2 + && ((backc1 >= frontc1 && backc2 >= frontc2) || curline->sidedef->toptexture) + && ((backf1 <= frontf1 && backf2 >= frontf2) || curline->sidedef->bottomtexture) + && (backsector->ceilingpic != skyflatnum || frontsector->ceilingpic != skyflatnum)); + + if (doorclosed) + goto clipsolid; + } + + // Window. + if (backc1 != frontc1 || backc2 != frontc2 + || backf1 != frontf1 || backf2 != frontf2) + { goto clippass; + } + } } else { - // if both ceilings are skies, consider it always "open" - // same for floors - if (!bothceilingssky && !bothfloorssky) + if (udmf) { - if (backsector->ceilingheight <= frontsector->floorheight - || backsector->floorheight >= frontsector->ceilingheight) + // if both ceilings are skies, consider it always "open" + // same for floors + if (!bothceilingssky && !bothfloorssky) { - goto clipsolid; + if (backsector->ceilingheight <= frontsector->floorheight + || backsector->floorheight >= frontsector->ceilingheight) + { + goto clipsolid; + } + + // Check for automap fix. Store in doorclosed for r_segs.c + // + // This is used to fix the automap bug which + // showed lines behind closed doors simply because the door had a dropoff. + // + // It assumes that Doom has already ruled out a door being closed because + // of front-back closure (e.g. front floor is taller than back ceiling). + // + // if door is closed because back is shut: + doorclosed = backsector->ceilingheight <= backsector->floorheight + // preserve a kind of transparent door/lift special effect: + && (backsector->ceilingheight >= frontsector->ceilingheight || curline->sidedef->toptexture) + && (backsector->floorheight <= frontsector->floorheight || curline->sidedef->bottomtexture); + + if (doorclosed) + goto clipsolid; } - // Check for automap fix. Store in doorclosed for r_segs.c - // - // This is used to fix the automap bug which - // showed lines behind closed doors simply because the door had a dropoff. - // - // It assumes that Doom has already ruled out a door being closed because - // of front-back closure (e.g. front floor is taller than back ceiling). - // - // if door is closed because back is shut: - doorclosed = backsector->ceilingheight <= backsector->floorheight - // preserve a kind of transparent door/lift special effect: - && (backsector->ceilingheight >= frontsector->ceilingheight || curline->sidedef->toptexture) - && (backsector->floorheight <= frontsector->floorheight || curline->sidedef->bottomtexture); - - if (doorclosed) - goto clipsolid; + // Window. + if (!bothceilingssky) // ceilings are always the "same" when sky + if (backsector->ceilingheight != frontsector->ceilingheight) + goto clippass; + if (!bothfloorssky) // floors are always the "same" when sky + if (backsector->floorheight != frontsector->floorheight) + goto clippass; } + else + { + if (viewsector != backsector && viewsector != frontsector) + { + if (backsector->ceilingheight <= frontsector->floorheight + || backsector->floorheight >= frontsector->ceilingheight) + { + goto clipsolid; + } - // Window. - if (!bothceilingssky) // ceilings are always the "same" when sky - if (backsector->ceilingheight != frontsector->ceilingheight) - goto clippass; - if (!bothfloorssky) // floors are always the "same" when sky - if (backsector->floorheight != frontsector->floorheight) + // Check for automap fix. Store in doorclosed for r_segs.c + doorclosed = (backsector->ceilingheight <= backsector->floorheight + && (backsector->ceilingheight >= frontsector->ceilingheight || curline->sidedef->toptexture) + && (backsector->floorheight <= frontsector->floorheight || curline->sidedef->bottomtexture) + && (backsector->ceilingpic != skyflatnum || frontsector->ceilingpic != skyflatnum)); + + if (doorclosed) + goto clipsolid; + } + + // Window. + if (backsector->ceilingheight != frontsector->ceilingheight + || backsector->floorheight != frontsector->floorheight) + { goto clippass; + } + } } // Reject empty lines used for triggers and special events. diff --git a/src/r_segs.c b/src/r_segs.c index c9c6a7b4a..ccf5b1eea 100644 --- a/src/r_segs.c +++ b/src/r_segs.c @@ -2024,25 +2024,38 @@ void R_StoreWallRange(INT32 start, INT32 stop) worldlow -= viewz; worldlowslope -= viewz; - // hack to allow height changes in outdoor areas - // This is what gets rid of the upper textures if there should be sky - if (frontsector->ceilingpic == skyflatnum - && backsector->ceilingpic == skyflatnum) + if (udmf) // more mess yippie { - bothceilingssky = true; - } + // hack to allow height changes in outdoor areas + // This is what gets rid of the upper textures if there should be sky + if (frontsector->ceilingpic == skyflatnum + && backsector->ceilingpic == skyflatnum) + { + bothceilingssky = true; + } - // likewise, but for floors and upper textures - if (frontsector->floorpic == skyflatnum - && backsector->floorpic == skyflatnum) + // likewise, but for floors and upper textures + if (frontsector->floorpic == skyflatnum + && backsector->floorpic == skyflatnum) + { + bothfloorssky = true; + } + } + else { - bothfloorssky = true; + // hack to allow height changes in outdoor areas + if (frontsector->ceilingpic == skyflatnum + && backsector->ceilingpic == skyflatnum) + { + worldtopslope = worldhighslope = + worldtop = worldhigh; + } } ds_p->sprtopclip = ds_p->sprbottomclip = NULL; ds_p->silhouette = 0; - if (!bothfloorssky) + if (!bothfloorssky || !udmf) { if (worldbottomslope > worldlowslope || worldbottom > worldlow) { @@ -2060,7 +2073,7 @@ void R_StoreWallRange(INT32 start, INT32 stop) } } - if (!bothceilingssky) + if (!bothceilingssky || !udmf) { if (worldtopslope < worldhighslope || worldtop < worldhigh) { @@ -2078,7 +2091,7 @@ void R_StoreWallRange(INT32 start, INT32 stop) } } - if (!bothceilingssky && !bothfloorssky) + if (!bothceilingssky && !bothfloorssky || !udmf) { if (worldhigh <= worldbottom && worldhighslope <= worldbottomslope) { @@ -2098,7 +2111,7 @@ void R_StoreWallRange(INT32 start, INT32 stop) //SoM: 3/25/2000: This code fixes an automap bug that didn't check // frontsector->ceiling and backsector->floor to see if a door was closed. // Without the following code, sprites get displayed behind closed doors. - if (!bothceilingssky && !bothfloorssky) + if (!bothceilingssky && !bothfloorssky || !udmf) { if (doorclosed || (worldhigh <= worldbottom && worldhighslope <= worldbottomslope)) { @@ -2133,7 +2146,7 @@ void R_StoreWallRange(INT32 start, INT32 stop) } } - if (bothfloorssky) + if (!udmf && bothfloorssky) { // see double ceiling skies comment // this is the same but for upside down thok barriers where the floor is sky and the ceiling is normal @@ -2165,7 +2178,7 @@ void R_StoreWallRange(INT32 start, INT32 stop) markfloor = false; } - if (bothceilingssky) + if (!udmf && bothceilingssky) { // double ceiling skies are special // we don't want to lower the ceiling clipping, (no new plane is drawn anyway) @@ -2198,10 +2211,11 @@ void R_StoreWallRange(INT32 start, INT32 stop) markceiling = false; } - if (!bothceilingssky && !bothfloorssky) + if (!bothceilingssky && !bothfloorssky || !udmf) { - if ((worldhigh <= worldbottom && worldhighslope <= worldbottomslope) - || (worldlow >= worldtop && worldlowslope >= worldtopslope)) + if ((udmf && ((worldhigh <= worldbottom && worldhighslope <= worldbottomslope) + || (worldlow >= worldtop && worldlowslope >= worldtopslope))) || (! udmf && (backsector->ceilingheight <= frontsector->floorheight || + backsector->floorheight >= frontsector->ceilingheight))) { // closed door markceiling = markfloor = true; @@ -2209,8 +2223,7 @@ void R_StoreWallRange(INT32 start, INT32 stop) } // check TOP TEXTURE - if (!bothceilingssky // never draw the top texture if on - && (worldhigh < worldtop || worldhighslope < worldtopslope)) + if ((udmf && !bothceilingssky || !udmf) && (worldhigh < worldtop || worldhighslope < worldtopslope)) // never draw the top texture if on { fixed_t texheight; // top texture @@ -2240,8 +2253,7 @@ void R_StoreWallRange(INT32 start, INT32 stop) } } // check BOTTOM TEXTURE - if (!bothfloorssky // never draw the bottom texture if on - && (worldlow > worldbottom || worldlowslope > worldbottomslope)) // Only if VISIBLE!!! + if ((udmf && !bothfloorssky || !udmf) && (worldlow > worldbottom || worldlowslope > worldbottomslope)) // never draw the top texture if on { // bottom texture bottomtexture = R_GetTextureNum(sidedef->bottomtexture);