RLE register
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
2026-03-23 16:05:30 +01:00
parent 87d4f5843b
commit 4f20614182
6 changed files with 71 additions and 36 deletions

View File

@@ -1,22 +0,0 @@
--- @section RLE
RLE = {}
--- Draws an RLE-encoded image.
--- @param runs table Array of run lengths.
--- @param values table Array of pixel values (colors).
function RLE.draw(img_values, img_runs)
local SCREEN_WIDTH=240
local SCREEN_HEIGHT=136
local val_i=0
local run=0
for y=0,SCREEN_HEIGHT-1 do
for x=0,SCREEN_WIDTH-1 do
if run==0 then
val_i=val_i+1
run=img_runs[val_i]
end
run=run-1
pix(x,y,img_values[val_i])
end
end
end