forked from hkc/cc-stuff
Scale exists apparently
This commit is contained in:
parent
c3f54e301a
commit
e442a087f8
3
ccpi.lua
3
ccpi.lua
|
@ -30,6 +30,7 @@ local function load(path)
|
|||
end
|
||||
|
||||
image.w, image.h = string.byte(fp:read(1)), string.byte(fp:read(1))
|
||||
image.scale = 0.5 + string.byte(fp:read(1)) * 5 / 255
|
||||
for i = 1, 16 do
|
||||
image.palette[i] = bit32.lshift(string.byte(fp:read(1)), 16)
|
||||
image.palette[i] = bit32.bor(image.palette[i], bit32.lshift(string.byte(fp:read(1)), 8))
|
||||
|
@ -61,6 +62,8 @@ local function draw(img, ox, oy, monitor)
|
|||
t.setPaletteColor(colors_list[i], img.palette[i])
|
||||
end
|
||||
|
||||
t.setTextScale(image.scale)
|
||||
|
||||
for y = 1, img.h do
|
||||
t.setCursorPos(ox, oy + y - 1)
|
||||
t.blit(img.lines[y].s, img.lines[y].fg, img.lines[y].bg)
|
||||
|
|
Loading…
Reference in New Issue