diff options
author | KikooDX <kikoodx@paranoici.org> | 2022-08-31 16:00:29 +0200 |
---|---|---|
committer | KikooDX <kikoodx@paranoici.org> | 2022-08-31 16:00:33 +0200 |
commit | db39a7927d08ef15741fc22af15f1644e4c680ad (patch) | |
tree | 756b4d31fda5f6e0d50a731d21f1a3e8de30e8d3 | |
parent | 8370726562342ba72efe32986e2ad9dff8472ca2 (diff) | |
download | scr16-db39a7927d08ef15741fc22af15f1644e4c680ad.tar.gz |
build with emscripten
-rw-r--r-- | Tupfile | 2 | ||||
-rw-r--r-- | Tupfile.emcc | 8 | ||||
-rw-r--r-- | screenshot.c | 2 | ||||
-rw-r--r-- | sfd.c | 2 |
4 files changed, 13 insertions, 1 deletions
@@ -1,6 +1,6 @@ CC = gcc CFLAGS = -Os -std=c99 `sdl2-config --cflags` -LIBS = -lm -ldx `sdl2-config --libs` -lSDL2_image +LIBS = -lm `sdl2-config --libs` -lSDL2_image .gitignore : beep.wav |> cembed -s -t beep_info -o %o %f |> beep.c diff --git a/Tupfile.emcc b/Tupfile.emcc new file mode 100644 index 0000000..8df6ebf --- /dev/null +++ b/Tupfile.emcc @@ -0,0 +1,8 @@ +CC = emcc +CFLAGS = -s USE_SDL=2 -s USE_SDL_IMAGE=2 -DEMCC -Os -std=c99 `sdl2-config --cflags` +LIBS = -lm `sdl2-config --libs` -lSDL2_image + +.gitignore +: beep.wav |> cembed -s -t beep_info -o %o %f |> beep.c +: foreach *.c |> $(CC) $(CFLAGS) -c -o %o %f |> %B.o +: *.o |> $(CC) -o scr16.html %f $(LIBS) |> scr16.html scr16.wasm scr16.js diff --git a/screenshot.c b/screenshot.c index 85b58ef..987ad8e 100644 --- a/screenshot.c +++ b/screenshot.c @@ -6,6 +6,7 @@ void screenshot(void) { +#ifndef EMCC sfd_Options opt = { .title = "Save Screenshot", .filter_name = "Image File", @@ -16,4 +17,5 @@ void screenshot(void) dx_log_warn("save canceled"); else r_screenshot(filename); +#endif } @@ -1,3 +1,4 @@ +#ifndef EMCC /* * Copyright (c) 2017 rxi * @@ -254,3 +255,4 @@ const char *sfd_save_dialog(sfd_Options *opt) } #endif +#endif |