diff --git a/.gitignore b/.gitignore index 09b2baa..6b54e37 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,8 @@ tiled/PixelDefense.tiled-session venv/ scripts/__pycache__/ +PixelDefense.zip + imgui.ini settings.ini game_data.ini diff --git a/CMakeLists.txt b/CMakeLists.txt index 13d6c6b..8603d4f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -50,7 +50,10 @@ add_executable(PixelDefense target_link_libraries(PixelDefense LINK_PRIVATE Breeze) if (EMSCRIPTEN) + #set_target_properties(PixelDefense + # PROPERTIES SUFFIX ".html" + # LINK_FLAGS "-lidbfs.js --shell-file ../index.html -sEXPORTED_FUNCTIONS=_loopPause,_loopResume,_main -sEXTRA_EXPORTED_RUNTIME_METHODS=ccall -sFORCE_FILESYSTEM=1 -sWASM=1 -sSTACK_OVERFLOW_CHECK=2 -sALLOW_MEMORY_GROWTH -sSTACK_SIZE=10MB -sASSERTIONS=2 -sMIN_WEBGL_VERSION=1 --preload-file ../assets -g2 -gseparate-dwarf -gsource-map -sUSE_GLFW=3") set_target_properties(PixelDefense PROPERTIES SUFFIX ".html" - LINK_FLAGS "-lidbfs.js -sEXPORTED_FUNCTIONS=_loopPause,_loopResume,_main -sEXTRA_EXPORTED_RUNTIME_METHODS=ccall -sFORCE_FILESYSTEM=1 -sWASM=1 -sSTACK_OVERFLOW_CHECK=2 -sALLOW_MEMORY_GROWTH -sSTACK_SIZE=10MB -sASSERTIONS=2 -sMIN_WEBGL_VERSION=1 --preload-file ../assets -g2 -gseparate-dwarf -gsource-map -sUSE_GLFW=3") + LINK_FLAGS "-lidbfs.js -O3 --shell-file ../index.html -sEXPORTED_FUNCTIONS=_loopPause,_loopResume,_main -sEXTRA_EXPORTED_RUNTIME_METHODS=ccall -sFORCE_FILESYSTEM=1 -sWASM=1 -sALLOW_MEMORY_GROWTH -sSTACK_SIZE=10MB -sASSERTIONS=0 -sMIN_WEBGL_VERSION=1 --preload-file ../assets -sUSE_GLFW=3") endif() diff --git a/build_web.sh b/build_web.sh new file mode 100755 index 0000000..b741f65 --- /dev/null +++ b/build_web.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +#rm -rf build_web +#mkdir build_web +pushd build_web || exit + +emcmake cmake .. -DPLATFORM=Web +emmake make + +mv PixelDefense.html index.html + +rm -f ../PixelDefense.zip +zip ../PixelDefense.zip index.html PixelDefense.* + +popd || exit diff --git a/game/main.c b/game/main.c index 0d26369..7e309b3 100644 --- a/game/main.c +++ b/game/main.c @@ -64,7 +64,7 @@ bool bzMain(BzAppDesc *appDesc, int argc, const char **argv) { appDesc->userData = NULL; - //SetConfigFlags(FLAG_WINDOW_RESIZABLE); + SetConfigFlags(FLAG_WINDOW_RESIZABLE); #ifdef EMSCRIPTEN EM_ASM( FS.mkdir('/game'); diff --git a/index.html b/index.html new file mode 100644 index 0000000..8e0b112 --- /dev/null +++ b/index.html @@ -0,0 +1,63 @@ + + + + + PixelDefense + + + + + + + + +
+ +
+ + + + +
+
+ + + + + + +{{{ SCRIPT }}} + + + + \ No newline at end of file