From caf80e74c4ebf5324b5ab5c1a9a96c5f29bd4dcc Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 13 Apr 2016 23:09:45 +0200 Subject: [PATCH] - fixed multiplication/division mixup in TextureAdjustWidth. - fixed: For top textures an incorrect ceiling height was passed to DoTexture. --- src/gl/scene/gl_walls.cpp | 4 ++-- src/gl/textures/gl_material.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gl/scene/gl_walls.cpp b/src/gl/scene/gl_walls.cpp index 231503407..5d13a0720 100644 --- a/src/gl/scene/gl_walls.cpp +++ b/src/gl/scene/gl_walls.cpp @@ -1503,7 +1503,7 @@ void GLWall::Process(seg_t *seg, sector_t * frontsector, sector_t * backsector) if (gltexture) { DoTexture(RENDERWALL_TOP, seg, (seg->linedef->flags & (ML_DONTPEGTOP)) == 0, - frefz, realback->GetPlaneTexZF(sector_t::ceiling), + crefz, realback->GetPlaneTexZF(sector_t::ceiling), fch1, fch2, bch1a, bch2a, 0); } else if (!(seg->sidedef->Flags & WALLF_POLYOBJ)) @@ -1516,7 +1516,7 @@ void GLWall::Process(seg_t *seg, sector_t * frontsector, sector_t * backsector) if (gltexture) { DoTexture(RENDERWALL_TOP, seg, (seg->linedef->flags & (ML_DONTPEGTOP)) == 0, - frefz, realback->GetPlaneTexZF(sector_t::ceiling), + crefz, realback->GetPlaneTexZF(sector_t::ceiling), fch1, fch2, bch1a, bch2a, 0); } } diff --git a/src/gl/textures/gl_material.cpp b/src/gl/textures/gl_material.cpp index 60a53fda3..f5c8f90b3 100644 --- a/src/gl/textures/gl_material.cpp +++ b/src/gl/textures/gl_material.cpp @@ -372,7 +372,7 @@ float FTexCoordInfo::TextureAdjustWidth() const if (mWorldPanning) { if (mTempScale.X == 1.f) return mRenderWidth; - else return mWidth * mTempScale.X; + else return mWidth / mTempScale.X; } else return mWidth; }