From 41f2337e7a2f1677461afc4c7f8db8d84dd5bd3d Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Fri, 22 Jun 2012 04:07:53 +0000 Subject: [PATCH] - Fixed: Texture positioning for one-sided lines marked ML_DONTPEGBOTTOM was wrong. SVN r3707 (trunk) --- src/r_segs.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/r_segs.cpp b/src/r_segs.cpp index 26c76ad35..41632d240 100644 --- a/src/r_segs.cpp +++ b/src/r_segs.cpp @@ -1953,11 +1953,11 @@ void R_NewWall (bool needlights) yrepeat = FixedMul(midtexture->yScale, rw_midtexturescaley); if (linedef->flags & ML_DONTPEGBOTTOM) { // bottom of texture at bottom - rw_midtexturemid = frontsector->GetPlaneTexZ(sector_t::floor) + (midtexture->GetHeight() << FRACBITS); + rw_midtexturemid = MulScale16(frontsector->GetPlaneTexZ(sector_t::floor) - viewz, yrepeat) + (midtexture->GetHeight() << FRACBITS); } else { // top of texture at top - rw_midtexturemid = frontsector->GetPlaneTexZ(sector_t::ceiling); + rw_midtexturemid = MulScale16(frontsector->GetPlaneTexZ(sector_t::ceiling) - viewz, yrepeat); if (rowoffset < 0 && midtexture != NULL) { rowoffset += midtexture->GetHeight() << FRACBITS; @@ -1965,13 +1965,13 @@ void R_NewWall (bool needlights) } if (midtexture->bWorldPanning) { - rw_midtexturemid = MulScale16(rw_midtexturemid - viewz + rowoffset, yrepeat); + rw_midtexturemid = MulScale16(rowoffset, yrepeat); } else { // rowoffset is added outside the multiply so that it positions the texture // by texels instead of world units. - rw_midtexturemid = MulScale16(rw_midtexturemid - viewz, yrepeat) + rowoffset; + rw_midtexturemid += rowoffset; } } }