From 80347931930cb8977473bc43cf84a2f981a745a9 Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Thu, 17 Aug 2017 23:14:02 +0200 Subject: [PATCH] - Wrap midtex support --- src/polyrenderer/scene/poly_wall.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/polyrenderer/scene/poly_wall.cpp b/src/polyrenderer/scene/poly_wall.cpp index 411a7f571..af350418e 100644 --- a/src/polyrenderer/scene/poly_wall.cpp +++ b/src/polyrenderer/scene/poly_wall.cpp @@ -273,8 +273,12 @@ void RenderPolyWall::Render(const TriMatrix &worldToClip, const PolyClipPlane &c // Masked walls clamp to the 0-1 range (no texture repeat) if (Masked) { - ClampHeight(vertices[0], vertices[3]); - ClampHeight(vertices[1], vertices[2]); + bool wrap = (Line->flags & ML_WRAP_MIDTEX) || (Side->Flags & WALLF_WRAP_MIDTEX); + if (!wrap) + { + ClampHeight(vertices[0], vertices[3]); + ClampHeight(vertices[1], vertices[2]); + } } PolyDrawArgs args;