From 2e16f3d77e146b379e4a3eff999cafaf963923fc Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 9 Apr 2016 20:49:27 +0200 Subject: [PATCH] - made some adjustment for the DrawTexture changes. --- src/gl/renderer/gl_renderer.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gl/renderer/gl_renderer.cpp b/src/gl/renderer/gl_renderer.cpp index b9311ce4fc..0fa34845ef 100644 --- a/src/gl/renderer/gl_renderer.cpp +++ b/src/gl/renderer/gl_renderer.cpp @@ -359,11 +359,12 @@ void FGLRenderer::DrawTexture(FTexture *img, DrawParms &parms) if (parms.windowleft > 0 || parms.windowright < parms.texwidth) { + double wi = MIN(parms.windowright, parms.texwidth); x += parms.windowleft * xscale; - w -= (parms.texwidth - parms.windowright + parms.windowleft) * xscale; + w -= (parms.texwidth - wi + parms.windowleft) * xscale; u1 = float(u1 + parms.windowleft / parms.texwidth); - u2 = float(u2 - (parms.texwidth - parms.windowright) / parms.texwidth); + u2 = float(u2 - (parms.texwidth - wi) / parms.texwidth); } PalEntry color;