summaryrefslogtreecommitdiff
path: root/img/driver.lua
blob: 7a8aa538322c2635efdf75c0302d23fc4a08a07a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
package.path = "/?;/?.lua;"..package.path

local load_pnm = require("load_pnm").load
local shitty_disp = require("shitty_disp")
local perr = require("util").perr

local file,err = io.open(arg[1],"rb")
perr(err,"io.open")
local ff = file:read("a")
local img = load_pnm(ff)
term.clear()
shitty_disp.disp(term.current(),img,1,1)
os.pullEvent("key")
shitty_disp.reset_palette(term.current())