From 227634e9f98138181e3bf68e52ecc4349b033b77 Mon Sep 17 00:00:00 2001 From: RaveYard <29225776+MrRaveYard@users.noreply.github.com> Date: Wed, 20 Sep 2023 21:30:49 +0200 Subject: [PATCH] Fix surface midtexture yscale --- src/rendering/hwrenderer/doom_levelmesh.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/rendering/hwrenderer/doom_levelmesh.cpp b/src/rendering/hwrenderer/doom_levelmesh.cpp index a0e406906b..cc3d687060 100644 --- a/src/rendering/hwrenderer/doom_levelmesh.cpp +++ b/src/rendering/hwrenderer/doom_levelmesh.cpp @@ -799,8 +799,8 @@ void DoomLevelMesh::CreateSideSurfaces(FLevelLocals &doomMap, side_t *side) auto gameTexture = TexMan.GetGameTexture(texture); - float mid1Top = gameTexture->GetDisplayHeight(); - float mid2Top = gameTexture->GetDisplayHeight(); + float mid1Top = gameTexture->GetDisplayHeight() / side->textures[side_t::mid].yScale; + float mid2Top = gameTexture->GetDisplayHeight() / side->textures[side_t::mid].yScale; float mid1Bottom = 0; float mid2Bottom = 0; @@ -812,7 +812,7 @@ void DoomLevelMesh::CreateSideSurfaces(FLevelLocals &doomMap, side_t *side) } else { - yTextureOffset += side->sector->planes[sector_t::ceiling].TexZ - gameTexture->GetDisplayHeight(); + yTextureOffset += side->sector->planes[sector_t::ceiling].TexZ - gameTexture->GetDisplayHeight() / side->textures[side_t::mid].yScale; } verts[0].Z = min(max(yTextureOffset + mid1Bottom, v1Bottom), v1Top);