2021-08-29 02:04:54 +00:00
|
|
|
(local {: pal : gs-to-rgb} (require :editor.tiledraw.iigs))
|
2021-09-12 04:18:21 +00:00
|
|
|
(local lume (require :lib.lume))
|
2021-08-29 02:04:54 +00:00
|
|
|
|
2021-11-14 19:55:41 +00:00
|
|
|
{:map-bitxy (fn [self x y w h] (values (+ (* y w) x) 0 0xff))
|
2021-09-12 04:18:21 +00:00
|
|
|
:pixel-color (fn [self b] (match b 0xf0 (values [128 128 128] [64 64 64])
|
|
|
|
_ (gs-to-rgb (. pal (+ b 1)))))
|
|
|
|
:draw-bits #(if (= $1.icolor 17) 0xf0 (- $1.icolor 1))
|
|
|
|
:palette #(lume.concat (icollect [_ color (ipairs pal)] (gs-to-rgb color)) [[255 0 255]])
|
|
|
|
:pixel-storage-divisor #1
|
2021-11-14 19:55:41 +00:00
|
|
|
:blank-tile-byte #"\xf0"
|
|
|
|
:preview-locations (fn [self]
|
|
|
|
(match self.style
|
|
|
|
:iso [[12 0] [0 6] [24 6] [12 12]]
|
|
|
|
_ [[0 0] [12 0] [0 12] [12 12]]))
|
2021-08-29 02:04:54 +00:00
|
|
|
}
|
|
|
|
|