From c91fdd6dfc30f62865137e551144558c7fbde9cf Mon Sep 17 00:00:00 2001 From: Justin Marshall Date: Wed, 5 Aug 2020 17:23:37 -0700 Subject: [PATCH] Fixed a bug were shapes that were partially off screen would get clipped. --- code/redalert/newblit.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/redalert/newblit.cpp b/code/redalert/newblit.cpp index 27a0046..34c0036 100644 --- a/code/redalert/newblit.cpp +++ b/code/redalert/newblit.cpp @@ -81,11 +81,11 @@ void GL_RenderLine(int x1, int y1, int x2, int y2, int r, int g, int b, float th void GL_RenderImage(Image_t* image, int x, int y, int width, int height, int colorRemap, int shapeId, bool ignoreOutOfScreenPixels, bool flipUV) { if (!ignoreOutOfScreenPixels) { - if (x < 0 || y < 0) { + if (x + width < 0 || y + height < 0) { return; } - if (x >= ScreenWidth || y >= ScreenHeight) { + if (x - width >= ScreenWidth || y - height >= ScreenHeight) { return; } }