From 20c2d84c78a3423beeef30d5d50a4a777b1b1dad Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Thu, 9 Jun 2016 20:37:36 +0100 Subject: [PATCH 1/3] Fix single side line midtexture skewing Red apparently left in code for single-sided linedefs to NOT skew their midtextures ...but it doesn't work because it doesn't stop the skewing code from running instead, regardless of whether Effect 1 is on or not. If it's decided single-sided line midtextures shouldn't do this though, the non-skew code could just as well be thrown out lol (or something else I guess?) --- src/r_segs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/r_segs.c b/src/r_segs.c index 11b4c8aef..a2487771b 100644 --- a/src/r_segs.c +++ b/src/r_segs.c @@ -1862,8 +1862,9 @@ void R_StoreWallRange(INT32 start, INT32 stop) if (linedef->flags & ML_DONTPEGBOTTOM) rw_midtexturemid = frontsector->floorheight + textureheight[sidedef->midtexture] - viewz; else - rw_midtexturemid = frontsector->ceilingheight; + rw_midtexturemid = frontsector->ceilingheight - viewz; } + else #endif if (linedef->flags & ML_DONTPEGBOTTOM) { From a04fcce3a998025b765a567791595b3129ae414d Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Thu, 9 Jun 2016 22:07:43 +0100 Subject: [PATCH 2/3] Hack to fix midtextures for polyobjects being mucked up "frontsector" in this part of the code isn't actually the polyobject's sector for back-side polyobject segs, it's the in-level sector the polyobject as a whole is being rendered in it turns out. --- src/r_segs.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/r_segs.c b/src/r_segs.c index a2487771b..07fe554c2 100644 --- a/src/r_segs.c +++ b/src/r_segs.c @@ -2483,6 +2483,15 @@ void R_StoreWallRange(INT32 start, INT32 stop) #ifdef ESLOPE maskedtextureheight = ds_p->maskedtextureheight; // note to red, this == &(ds_p->maskedtextureheight[0]) +#ifdef POLYOBJECTS + if (curline->polyseg) { // use REAL front and back floors please, so midtexture rendering isn't mucked up + rw_midtextureslide = rw_midtexturebackslide = 0; + if (!!(linedef->flags & ML_DONTPEGBOTTOM) ^ !!(linedef->flags & ML_EFFECT3)) + rw_midtexturemid = rw_midtextureback = max(curline->frontsector->floorheight, curline->backsector->floorheight) - viewz; + else + rw_midtexturemid = rw_midtextureback = min(curline->frontsector->ceilingheight, curline->backsector->ceilingheight) - viewz; + } else +#endif // Set midtexture starting height if (linedef->flags & ML_EFFECT2) { // Ignore slopes when texturing rw_midtextureslide = rw_midtexturebackslide = 0; From 305d32870f537c90c9035b75dc175ee00e148287 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sun, 12 Jun 2016 18:47:27 +0100 Subject: [PATCH 3/3] Effect 2 (No Midtexture Skew) now toggles off skewing for midtextures on single-sided lines, which was what was intended for them to begin with apparently. This means the current skewing-by-default effect isn't changed, and OpenGL's equivalent code doesn't have to be touched since apparently it was already like that. --- src/r_segs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/r_segs.c b/src/r_segs.c index 07fe554c2..1ee9777d0 100644 --- a/src/r_segs.c +++ b/src/r_segs.c @@ -1858,7 +1858,7 @@ void R_StoreWallRange(INT32 start, INT32 stop) // a single sided line is terminal, so it must mark ends markfloor = markceiling = true; #ifdef ESLOPE - if (!(linedef->flags & ML_EFFECT1)) { + if (linedef->flags & ML_EFFECT2) { if (linedef->flags & ML_DONTPEGBOTTOM) rw_midtexturemid = frontsector->floorheight + textureheight[sidedef->midtexture] - viewz; else