z4trg2xyr.lua 1004 B

1234567891011121314151617181920212223242526272829303132
  1. cellsiz=16
  2. function INT(a)
  3. return(a-a%1)
  4. end
  5. function HLINERGB(tx1,ty1,tx2,tr1,tg1,tb1)
  6. for tx3=tx1,tx2,1 do
  7. set_rgb(tx3,ty1,tr1,tg1,tb1)
  8. end
  9. end
  10. function VLINERGB(tx1,ty1,ty2,tr1,tg1,tb1)
  11. for ty3=ty1,ty2,1 do
  12. set_rgb(tx1,ty3,tr1,tg1,tb1)
  13. end
  14. end
  15. for y1=0,height-1,cellsiz*.5 do
  16. for x1=0,width-1,cellsiz do
  17. r0,g0,b0=get_rgb(x1+cellsiz*.5, y1+cellsiz*.12)
  18. r1,g1,b1=get_rgb(x1+cellsiz*.75,y1+cellsiz*.25)
  19. r2,g2,b2=get_rgb(x1+cellsiz*.5, y1+cellsiz*.62) -- .38,.62
  20. r3,g3,b3=get_rgb(x1+cellsiz*.25,y1+cellsiz*.25)
  21. for con=0,(cellsiz*.5)-1,1 do
  22. HLINERGB(x1+con, y1+(con*.5), x1+cellsiz-con-1, r0,g0,b0)
  23. VLINERGB(x1+cellsiz-con-1,y1+(con*.5), y1+((cellsiz-con)*.5)-1,r1,g1,b1)
  24. HLINERGB(x1+con, y1+((cellsiz-con)*.5)-1,x1+cellsiz-con-1, r2,g2,b2)
  25. VLINERGB(x1+con, y1+(con*.5), y1+((cellsiz-con)*.5)-1,r3,g3,b3)
  26. end
  27. end
  28. progress(y/height)
  29. end
  30. flush()