diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2021-07-26 01:33:48 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2021-07-26 01:33:48 -0700 |
commit | 6b57715502cf7460f89a09200c5db158283a7091 (patch) | |
tree | 6ae7ba3afffe8e8e2cf2259f4b418611e3147542 /shell | |
parent | 438c00fd1fadf5ac1240f33b809afa9a5c9af9bf (diff) | |
download | mu-6b57715502cf7460f89a09200c5db158283a7091.tar.gz |
palette operations now a bit faster
Diffstat (limited to 'shell')
-rw-r--r-- | shell/data.limg | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/shell/data.limg b/shell/data.limg index 8578d95a..a0dc33c7 100644 --- a/shell/data.limg +++ b/shell/data.limg @@ -146,20 +146,22 @@ for r r0 (r < r0+w) ++r (circle screen cx cy r clr)]) (Greys . [define Greys - (map1 (fn(n) n+15) - (seq 16))]) - (Pinks . [define Pinks '(84 85 59 60 61 - 13 36 37 5 108)]) + ret p (populate 16 ()) + for i 0 (< i 16) ++i + iset p i i+16]) + (Pinks . [define Pinks (array + 84 85 59 60 61 + 13 36 37 5 108)]) (palette . [def (palette p i) - (nth (i % (len p)) p)]) + (index p (i % (len p)))]) (pat . [def (pat screen) with (w (width screen) h (height screen)) for y 0 (y < h) ++y for x 0 (x < w) ++x - (pixel screen x y x*y)]) + (pixel screen x y (palette Greys x*y))]) (main . [def (main screen keyboard) (pat screen)]) )) - (sandbox . [circle screen 35 35 14 3]) + (sandbox . [pat screen]) ) |