Open enderandrew opened 8 months ago
Hi! Thanks for this report .. see comment: https://github.com/davidjoffe/dave_gnukem/issues/160#issuecomment-2063995700
Okay, I've managed to fix compiler errors and get game running at ~18 FPS.
Could not get it run at more FPS, because game update logic is tightly linked to FPS right now.
Feel free to pick relevant changes from my fork https://github.com/midzer/dave_gnukem/tree/emscripten
This may be because the project has moved to SDL2.
If I try to run:
make -f Makefile.em I get:
If I had the flag of -sUSE_SDL like this:
FLAGS=-s WASM=1 -s USE_SDL=1 -s USE_SDL_MIXER=1 --preload-file ./data -s ALLOW_MEMORY_GROWTH=1 --use-preload-plugins -s STB_IMAGE=1
I now get errors with it somehow pulling in both SDL 1 and 2 headers. Trying to change the flags to USE_SDL=2 and USE_SDL2_MIXER also combines SDL 1 and SDL 2 headers.
In file included from /mnt/d/Development/emsdk/upstream/emscripten/cache/sysroot/include/SDL2/SDL_mixer.h:32: /mnt/d/Development/emsdk/upstream/emscripten/cache/sysroot/include/SDL2/SDL_stdinc.h:182:5: error: redefinition of enumerator 'SDL_FALSE' 182 | SDL_FALSE = 0, | ^ /mnt/d/Development/emsdk/upstream/emscripten/cache/sysroot/include/SDL/SDL_stdinc.h:117:5: note: previous definition is here 117 | SDL_FALSE = 0,