This should kinda works? Gonna test soon

This commit is contained in:
KikooDX 2020-04-23 14:36:47 +02:00
parent e00b853bf7
commit 30ba9ea488
6 changed files with 26 additions and 9 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
__pycache__/

5
buildubuntu.sh Executable file
View File

@ -0,0 +1,5 @@
rm -v test.py
echo "demo.lua -> 'test.py'"
../luajit demo.lua pn.png >> test.py
rm -v /media/user/disk/test.py
cp -v test.py /media/user/disk/

View File

@ -6,8 +6,7 @@ function int_hex(nb)
return [[\x]]..add..string.format("%x", nb)
end
io.write([[from casioplot import set_pixel as S
from casioplot import show_screen as R
io.write([[from draw import *
]])
do --open image
@ -35,9 +34,9 @@ for j = 1, image_infos.height, 1 do
end
--let's write the pallet
io.write("\"\npallet=(None")
io.write("\"\npallet=(")
for i, _ in pairs(pallet) do
io.write(",(", i, ")")
io.write("(", i, "),")
end
io.write(")\nR()")
io.write(")\ndraw(data,pallet,", image_infos.width, ")")

13
draw.py Normal file
View File

@ -0,0 +1,13 @@
from casioplot import set_pixel as S
from casioplot import show_screen as R
def draw(data, pallet, width):
x = 0
y = 0
for v in data:
S(x, y, pallet[v])
x += 1
if x == width:
x = 0
y += 1
R()

File diff suppressed because one or more lines are too long