From a99572774a06ede867de8e2cb9020215c909d4ae Mon Sep 17 00:00:00 2001 From: ubq323 Date: Fri, 5 Aug 2022 16:21:47 +0100 Subject: resetment --- img/driver.lua | 12 ++++++++---- img/shitty_disp.lua | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) (limited to 'img') diff --git a/img/driver.lua b/img/driver.lua index 7459a99..1997559 100644 --- a/img/driver.lua +++ b/img/driver.lua @@ -1,12 +1,16 @@ package.path = "/?;/?.lua;"..package.path local load_pnm = require("load_pnm").load -local shitty_disp = require("shitty_disp").disp +local shitty_disp = require("shitty_disp") local perr = require("util").perr -local file,err = io.open("/img/walter.pnm") +local file,err = io.open("/img/walter.pnm","rb") perr(err,"io.open") local ff = file:read("a") local img = load_pnm(ff) -print(img) -shitty_disp(term.current(),img,1,1) +term.clear() +shitty_disp.disp(term.current(),img,1,1) +os.pullEvent() +shitty_disp.reset_palette(term.current()) + + diff --git a/img/shitty_disp.lua b/img/shitty_disp.lua index 625e646..1ba13c4 100644 --- a/img/shitty_disp.lua +++ b/img/shitty_disp.lua @@ -134,4 +134,4 @@ local function disp(R,img,scrx,scry,w,h,imgx,imgy) end end -return {disp=disp,color_dist=color_dist,closest_palette_color=closest_palette_color} +return {disp=disp,color_dist=color_dist,closest_palette_color=closest_palette_color,reset_palette=reset_palette} -- cgit v1.2.3