From e94740c9a4cf94a100a1e6bf6ecce361cb10a668 Mon Sep 17 00:00:00 2001 From: ubq323 Date: Mon, 1 Apr 2024 04:34:21 +0100 Subject: launch john --- framebuf.lua | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'framebuf.lua') diff --git a/framebuf.lua b/framebuf.lua index 77f17e6..614f48b 100644 --- a/framebuf.lua +++ b/framebuf.lua @@ -53,6 +53,10 @@ function M:rect(x1, y1, x2, y2, r, g, b) end end +function M:get_size() + return #self, #(self[1] or {}) +end + function M:ppm(data, x, y) if type(data) ~= "string" then local f = data @@ -178,7 +182,7 @@ function M:present(mon, offsx, offsy) local pw, ph = M.resolution(mon) local cols = {} local chars = {} - print("","1") + -- print("","1") for y = offsy + 1, offsy + ph, 3 do for x = offsx + 1, offsx + pw, 2 do local char, fg, bg = get_char(self, x, y) @@ -189,12 +193,12 @@ function M:present(mon, offsx, offsy) end end end - print("","2") + -- print("","2") local palette, map = median_cut(cols, 16) for i, color in ipairs(palette) do mon.setPaletteColor(2^(i - 1), color) end - print("","3") + -- print("","3") for i = 1, w * h, w do mon.setCursorPos(1, (i - 1) / w) local blit_char, blit_fg, blit_bg = {}, {}, {} -- cgit v1.2.3