Scale exists apparently

This commit is contained in:
Casey 2023-10-15 03:24:29 +03:00
parent c3f54e301a
commit e442a087f8
Signed by: hkc
GPG Key ID: F0F6CFE11CDB0960
1 changed files with 3 additions and 0 deletions

View File

@ -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)