From b554409b32d53953cb43794785914b182251360b Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Sat, 26 Jun 2021 01:35:20 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9B=E5=BB=BA=E7=94=BB=E5=B8=83=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=E5=90=8E=E4=BC=9A=E9=99=8D=E4=BD=8E=E5=B0=BA=E5=AF=B8?= =?UTF-8?q?=E4=B8=8A=E9=99=90=E7=84=B6=E5=90=8E=E9=87=8D=E8=AF=95=E8=80=8C?= =?UTF-8?q?=E4=B8=8D=E6=98=AF=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zframework/doGC.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Zframework/doGC.lua b/Zframework/doGC.lua index 9917333c..6d3d3372 100644 --- a/Zframework/doGC.lua +++ b/Zframework/doGC.lua @@ -40,7 +40,12 @@ local cmds={ local sizeLimit=gc.getSystemLimits().texturesize return function(L) gc.push() - local canvas=gc.newCanvas(math.min(L[1],sizeLimit),math.min(L[2],sizeLimit)) + ::REPEAT_tryAgain:: + local success,canvas=pcall(gc.newCanvas,math.min(L[1],sizeLimit),math.min(L[2],sizeLimit)) + if not success then + texturesize=math.floor(texturesize*.8) + goto REPEAT_tryAgain + end gc.setCanvas(canvas) gc.origin() gc.setColor(1,1,1)