From b7362200c82c2e549e3d58772ac5ae5844cea978 Mon Sep 17 00:00:00 2001 From: Ralty <78720179+Raltyro@users.noreply.github.com> Date: Sun, 24 Dec 2023 17:26:58 +0700 Subject: [PATCH 1/2] Fix deprecated love.graphics.stencil resetting stencilMode --- src/modules/graphics/wrap_Graphics.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/modules/graphics/wrap_Graphics.lua b/src/modules/graphics/wrap_Graphics.lua index 7815edebf..56595f300 100644 --- a/src/modules/graphics/wrap_Graphics.lua +++ b/src/modules/graphics/wrap_Graphics.lua @@ -61,15 +61,16 @@ function graphics.stencil(func, action, value, keepvalues) if value == nil then value = 1 end - graphics.setStencilMode(action, "always", value) - + local action2, mode2, value2, readmask2, writemask2 = graphics.getStencilMode() local mr, mg, mb, ma = graphics.getColorMask() + + graphics.setStencilMode(action, "always", value)s graphics.setColorMask(false) local success, err = pcall(func) + graphics.setStencilMode(action2, mode2, value2, readmask2, writemask2) graphics.setColorMask(mr, mg, mb, ma) - graphics.setStencilMode() if not success then error(err, 2) From 1f8e3551aa46962ced08d7a8034c490c85f4047c Mon Sep 17 00:00:00 2001 From: Ralty <78720179+Raltyro@users.noreply.github.com> Date: Sun, 24 Dec 2023 17:28:27 +0700 Subject: [PATCH 2/2] Update wrap_Graphics.lua --- src/modules/graphics/wrap_Graphics.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/graphics/wrap_Graphics.lua b/src/modules/graphics/wrap_Graphics.lua index 56595f300..6448f048f 100644 --- a/src/modules/graphics/wrap_Graphics.lua +++ b/src/modules/graphics/wrap_Graphics.lua @@ -64,7 +64,7 @@ function graphics.stencil(func, action, value, keepvalues) local action2, mode2, value2, readmask2, writemask2 = graphics.getStencilMode() local mr, mg, mb, ma = graphics.getColorMask() - graphics.setStencilMode(action, "always", value)s + graphics.setStencilMode(action, "always", value) graphics.setColorMask(false) local success, err = pcall(func)