diff --git a/LuaScript/AviUtlScriptContext.cs b/LuaScript/AviUtlScriptContext.cs index 0a2dac4..e671441 100644 --- a/LuaScript/AviUtlScriptContext.cs +++ b/LuaScript/AviUtlScriptContext.cs @@ -91,6 +91,8 @@ namespace LuaScript internal void ClearEffects() => _effectRequests.Clear(); + internal IBufferCompositor Compositor { get; set; } = new SoftwareCompositor(); + private readonly List _drawCommands = []; public IReadOnlyList DrawCommands => _drawCommands; @@ -139,11 +141,7 @@ namespace LuaScript _buffers["t"] = temp; } - bool linear = command.Antialias != 0d; - if (command.Poly is { } poly) - SoftwareCompositor.DrawPolyInto(temp.Data, temp.Width, temp.Height, src, ImageWidth, ImageHeight, poly, command.Alpha, linear); - else - SoftwareCompositor.DrawInto(temp.Data, temp.Width, temp.Height, src, ImageWidth, ImageHeight, command.Ox, command.Oy, command.Zoom, command.Aspect, command.Alpha, linear); + Compositor.Compose(temp.Data, temp.Width, temp.Height, src, ImageWidth, ImageHeight, command); } private readonly Dictionary _buffers = new(StringComparer.Ordinal);