summaryrefslogtreecommitdiff
path: root/img
diff options
context:
space:
mode:
authorubq323 <ubq323@ubq323.website>2022-08-05 16:21:47 +0100
committerubq323 <ubq323@ubq323.website>2022-08-05 16:21:47 +0100
commita99572774a06ede867de8e2cb9020215c909d4ae (patch)
tree3690f3fbb3d41b94cc58c035da84f36f8fcc032c /img
parent26abc601db61a18a02adb387f9f0958dca2f2c4f (diff)
resetment
Diffstat (limited to 'img')
-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}