From a3bdbff0527a6a79b514e9c2361181dcc4f05a86 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 10 Feb 2015 21:30:52 +0100 Subject: [PATCH] - fixed: 3Dmidtex opening checks didn't take per-sidedef scaling into account. --- src/p_3dmidtex.cpp | 7 ++++--- src/textures/textures.h | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/p_3dmidtex.cpp b/src/p_3dmidtex.cpp index ac6d7aca7..7f934e2f5 100644 --- a/src/p_3dmidtex.cpp +++ b/src/p_3dmidtex.cpp @@ -223,11 +223,12 @@ bool P_GetMidTexturePosition(const line_t *line, int sideno, fixed_t *ptextop, f FTexture * tex= TexMan(texnum); if (!tex) return false; + fixed_t totalscale = FixedMul(side->GetTextureYScale(side_t::mid), tex->yScale); fixed_t y_offset = side->GetTextureYOffset(side_t::mid); - fixed_t textureheight = tex->GetScaledHeight() << FRACBITS; - if (tex->yScale != FRACUNIT && !tex->bWorldPanning) + fixed_t textureheight = tex->GetScaledHeight(totalscale) << FRACBITS; + if (totalscale != FRACUNIT && !tex->bWorldPanning) { - y_offset = FixedDiv(y_offset, tex->yScale); + y_offset = FixedDiv(y_offset, totalscale); } if(line->flags & ML_DONTPEGBOTTOM) diff --git a/src/textures/textures.h b/src/textures/textures.h index 9dbd85a55..cf3982fb3 100644 --- a/src/textures/textures.h +++ b/src/textures/textures.h @@ -233,6 +233,7 @@ public: int GetScaledWidth () { int foo = (Width << 17) / xScale; return (foo >> 1) + (foo & 1); } int GetScaledHeight () { int foo = (Height << 17) / yScale; return (foo >> 1) + (foo & 1); } + int GetScaledHeight(fixed_t scale) { int foo = (Height << 17) / scale; return (foo >> 1) + (foo & 1); } double GetScaledWidthDouble () { return (Width * 65536.) / xScale; } double GetScaledHeightDouble () { return (Height * 65536.) / yScale; }