diff options
author | Alex Auvolat <alex@adnab.me> | 2017-04-21 18:53:18 +0200 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2017-04-21 18:53:18 +0200 |
commit | 575b140a57e2bb86f05b8d18f01a9f2cea1f5034 (patch) | |
tree | bfa9e13cb68d0d9510453cfdd4cd75eece826aa1 /src/sysapp/login | |
parent | ed153e6a5b9f001bbe49128e6bc53053f55dd37b (diff) | |
download | kogata-575b140a57e2bb86f05b8d18f01a9f2cea1f5034.tar.gz kogata-575b140a57e2bb86f05b8d18f01a9f2cea1f5034.zip |
more glitch art :)
Diffstat (limited to 'src/sysapp/login')
-rw-r--r-- | src/sysapp/login/main.lua | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/src/sysapp/login/main.lua b/src/sysapp/login/main.lua index 50ecd20..0c54769 100644 --- a/src/sysapp/login/main.lua +++ b/src/sysapp/login/main.lua @@ -18,15 +18,35 @@ for x = 0, 255 do end end +local fnt = draw.load_font('default') + local i = 1 while true do - surface:plot(i % (vesa_info.width-3), - i % (vesa_info.height-1), + surface:rect((i*3) % (vesa_info.width-3), + (i*3) % (vesa_info.height-5), + 3, 3, surface:rgb(i % 256, (i + 96) % 256, (i + 2*96) % 256)) i = i + 1 - if i % 100000 == 0 then print(i) end + if i % 10000 == 0 then + local x0 = math.random(vesa_info.width)-1 + local x1 = math.random(vesa_info.width)-1 + local y0 = math.random(vesa_info.height)-1 + local y1 = math.random(vesa_info.height)-1 + if x0 > x1 then x0, x1 = x1, x0 end + if y0 > y1 then y0, y1 = y1, y0 end + local c = surface:rgb(math.random(0, 255), math.random(0, 255), math.random(0, 255)) + surface:fillrect(x0, y0, x1-x0, y1-y0, c) + end + if i % 10000 == 0 then + print(i) + local txt = tostring(i) + surface:fillrect(0, 0, fnt:text_width(txt), + fnt:text_height(txt), + surface:rgb(0, 0, 0)) + surface:write(0, 0, txt, fnt, surface:rgb(255, 0, 0)) + end end os.exit() |