summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--img/driver.lua12
-rw-r--r--img/shitty_disp.lua2
2 files changed, 9 insertions, 5 deletions
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}