Add drop grid cells in wasm

This commit is contained in:
alonso.torres 2025-06-27 15:56:45 +02:00 committed by Belén Albeza
parent 52a4fc6030
commit 8dcb376b18
12 changed files with 215 additions and 119 deletions

View file

@ -1045,6 +1045,18 @@
(h/call wasm/internal-module "_hide_grid")
(request-render "clear-grid"))
(defn get-grid-coords
[position]
(let [offset (h/call wasm/internal-module
"_get_grid_coords"
(get position :x)
(get position :y))
heapi32 (mem/get-heap-i32)
row (aget heapi32 (mem/ptr8->ptr32 (+ offset 0)))
column (aget heapi32 (mem/ptr8->ptr32 (+ offset 4)))]
(h/call wasm/internal-module "_free_bytes")
[row column]))
(defonce module
(delay
(if (exists? js/dynamicImport)