From 23d062682ab83a75dac1bf0697562bd9af8ff944 Mon Sep 17 00:00:00 2001 From: Alessandro Proto Date: Fri, 10 Feb 2023 14:13:44 +0100 Subject: [PATCH] Add size mismatch error to drawBuffer --- Capy64/Runtime/Libraries/GPU.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Capy64/Runtime/Libraries/GPU.cs b/Capy64/Runtime/Libraries/GPU.cs index 12b8bf7..97a5524 100644 --- a/Capy64/Runtime/Libraries/GPU.cs +++ b/Capy64/Runtime/Libraries/GPU.cs @@ -446,6 +446,11 @@ public class GPU : IPlugin var w = (int)L.CheckInteger(4); var h = (int)L.CheckInteger(5); + if(w * h != buffer.Length) + { + L.Error("width and height do not match buffer size"); + } + _game.Drawing.DrawBuffer(buffer, new() { X = x,