From da88898a67d6819d99312b96e1bb94a756d09641 Mon Sep 17 00:00:00 2001 From: routersys Date: Wed, 1 Jul 2026 14:01:38 +0900 Subject: [PATCH] =?UTF-8?q?obj.draw=E3=82=92SubmitDraw=E3=81=B8=E5=9B=9E?= =?UTF-8?q?=E3=81=97drawtarget=E3=82=92=E3=82=B3=E3=83=B3=E3=83=86?= =?UTF-8?q?=E3=82=AD=E3=82=B9=E3=83=88=E3=81=B8=E6=A9=8B=E6=B8=A1=E3=81=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LuaScript/LuaScriptEngine.cs | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/LuaScript/LuaScriptEngine.cs b/LuaScript/LuaScriptEngine.cs index 098c652..2e1f846 100644 --- a/LuaScript/LuaScriptEngine.cs +++ b/LuaScript/LuaScriptEngine.cs @@ -587,7 +587,7 @@ namespace LuaScript double alpha = args.Count > 4 ? args[4].CastToNumber() ?? 1d : 1d; double aspect = args.Count > 5 ? args[5].CastToNumber() ?? 0d : 0d; - _activeContext.AddDraw(new DrawCommand(ox, oy, oz, zoom, alpha, aspect, null, CurrentAntialias(), CurrentBlend())); + _activeContext.SubmitDraw(new DrawCommand(ox, oy, oz, zoom, alpha, aspect, null, CurrentAntialias(), CurrentBlend())); return DynValue.Void; }); @@ -623,7 +623,7 @@ namespace LuaScript _ => 1d, }; - _activeContext.AddDraw(new DrawCommand(0d, 0d, 0d, 1d, poly[20], 0d, poly, CurrentAntialias(), CurrentBlend())); + _activeContext.SubmitDraw(new DrawCommand(0d, 0d, 0d, 1d, poly[20], 0d, poly, CurrentAntialias(), CurrentBlend())); return DynValue.Void; }); @@ -660,6 +660,20 @@ namespace LuaScript _activeContext.DrawStateOverride = value.Type == DataType.Boolean ? value.Boolean : (value.CastToNumber() ?? 0d) != 0d; + if (name == "drawtarget" && _activeContext is not null) + { + if (value.Type == DataType.String && value.String == "tempbuffer") + { + bool hasSize = args.Count > 3; + int w = hasSize ? (int)(args[2].CastToNumber() ?? 0d) : 0; + int h = hasSize ? (int)(args[3].CastToNumber() ?? 0d) : 0; + _activeContext.SetDrawTarget(true, w, h, hasSize); + } + else + { + _activeContext.SetDrawTarget(false, 0, 0, false); + } + } return DynValue.Void; });