LibreSprite / LibreSprite-proposals

Have a request? Let us know here!
6 stars 1 forks source link

Interest in a semi-working wasm build? #74

Open gfodor opened 9 months ago

gfodor commented 9 months ago

Hello, I have a partially working wasm build of LibreSprite working but don't have the bandwidth to really get it into a fully feature complete state. The program runs, can be used, files can be saved and loaded from within the browser using native file picker. The bits that I don't have working are foreground windows that have return values, like alerts, because emscripten requires that everything be relocated into a central loop. It would also be nice to get preferences saving to local storage and some kind of scripting support from the native javascript context. Foreground windows that don't return values work fine - I've refactored a subset of these but the rest would need to be refactored to use my new callback based approach to meet the emscripten control flow needs.

I didn't want to open a PR because it might imply I have the bandwidth to keep working on this but right now I do not. The code is here: https://github.com/gfodor/LibreSprite/tree/popup-wasm

gfodor commented 9 months ago

One note to save some time, to build this you first need to compile it natively (I have done so on mac) simply because you need a working bin/gen for the wasm build to run. From there, once bin/gen exists, nuke CMakeCache.txt and run emcmake cmake -DEMSCRIPTEN=TRUE -G Ninja .. ; ninja libresprite with the latest emscripten SDK activated.

gfodor commented 9 months ago

I actually started working on the scripting now, it is starting to work. Progress is on the js-script branch.