From 050791919bd9df44ebfa03002d2480ca66efcf21 Mon Sep 17 00:00:00 2001 From: Lactozilla Date: Fri, 2 Feb 2024 01:50:05 -0300 Subject: [PATCH] OpenGL: Fix possible situation where an extra texture may be either taller than intended, or crossing itself --- src/hardware/hw_main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index bafcbab1c..d23acdb18 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -1290,9 +1290,9 @@ static void HWR_GetExtraTextureCoords(unsigned which, side_t *side, sector_t *se if (IS_UPPER_EDGE_TEXTURE(which)) { polytop = frontcoords[0] + rowoffset; - polybottom = frontcoords[0] - midtexheight; + polybottom = polytop - midtexheight; polytopslope = frontcoords[1] + rowoffset; - polybottomslope = frontcoords[1] - midtexheight; + polybottomslope = polytopslope - midtexheight; } else { @@ -1307,9 +1307,9 @@ static void HWR_GetExtraTextureCoords(unsigned which, side_t *side, sector_t *se if (IS_UPPER_EDGE_TEXTURE(which)) { polytop = backcoords[2] + rowoffset; - polybottom = backcoords[2] - midtexheight; + polybottom = polytop - midtexheight; polytopslope = backcoords[3] + rowoffset; - polybottomslope = backcoords[3] - midtexheight; + polybottomslope = polytopslope - midtexheight; } else {