mirror of
https://github.com/love2d/love.git
synced 2026-08-19 12:14:20 +02:00
Fix deprecated love.graphics.stencil resetting stencilMode
This commit is contained in:
@@ -61,15 +61,16 @@ function graphics.stencil(func, action, value, keepvalues)
|
|||||||
|
|
||||||
if value == nil then value = 1 end
|
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()
|
local mr, mg, mb, ma = graphics.getColorMask()
|
||||||
|
|
||||||
|
graphics.setStencilMode(action, "always", value)s
|
||||||
graphics.setColorMask(false)
|
graphics.setColorMask(false)
|
||||||
|
|
||||||
local success, err = pcall(func)
|
local success, err = pcall(func)
|
||||||
|
|
||||||
|
graphics.setStencilMode(action2, mode2, value2, readmask2, writemask2)
|
||||||
graphics.setColorMask(mr, mg, mb, ma)
|
graphics.setColorMask(mr, mg, mb, ma)
|
||||||
graphics.setStencilMode()
|
|
||||||
|
|
||||||
if not success then
|
if not success then
|
||||||
error(err, 2)
|
error(err, 2)
|
||||||
|
|||||||
Reference in New Issue
Block a user