From 01423ead908c3e6cded9f0b1b7fd72e55557a766 Mon Sep 17 00:00:00 2001 From: Sebastian Krzyszkowiak Date: Thu, 2 Nov 2023 07:42:49 +0100 Subject: [PATCH] emscripten: Add a custom HTML shell file --- cmake/libsuperderpy.cmake | 3 +- src/emscripten.html.in | 229 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 231 insertions(+), 1 deletion(-) create mode 100644 src/emscripten.html.in diff --git a/cmake/libsuperderpy.cmake b/cmake/libsuperderpy.cmake index f253d97..a6c94e2 100644 --- a/cmake/libsuperderpy.cmake +++ b/cmake/libsuperderpy.cmake @@ -433,6 +433,7 @@ if (NOT LIBSUPERDERPY_CONFIG_INCLUDED) if(LIBSUPERDERPY_GAMENAME) configure_file("${LIBSUPERDERPY_DIR}/src/defines.h.in" "${CMAKE_BINARY_DIR}/gen/defines.h") + configure_file("${LIBSUPERDERPY_DIR}/src/emscripten.html.in" "${CMAKE_BINARY_DIR}/gen/emscripten.html") include_directories("${CMAKE_BINARY_DIR}/gen") endif(LIBSUPERDERPY_GAMENAME) @@ -582,7 +583,7 @@ if (NOT LIBSUPERDERPY_CONFIG_INCLUDED) add_custom_target(${LIBSUPERDERPY_GAMENAME}_js DEPENDS ${LIBSUPERDERPY_GAMENAME}_install ${LIBSUPERDERPY_GAMENAME}_flac_to_lossy ${LIBSUPERDERPY_GAMENAME}_img_to_webp ${CMAKE_BINARY_DIR}/emscripten-imports.json WORKING_DIRECTORY "${CMAKE_INSTALL_PREFIX}/${LIBSUPERDERPY_GAMENAME}" - COMMAND "${CMAKE_C_COMPILER}" ${CFLAGS_LIST} ../${BIN_DIR}/${LIBSUPERDERPY_GAMENAME}${CMAKE_EXECUTABLE_SUFFIX} ../lib/libsuperderpy${CMAKE_SHARED_LIBRARY_SUFFIX} ../lib/lib${LIBSUPERDERPY_GAMENAME}${CMAKE_SHARED_LIBRARY_SUFFIX} ${Allegro5_LIBS} ${EMSCRIPTEN_FLAGS} -o ${LIBSUPERDERPY_GAMENAME}.html --pre-js ${LIBSUPERDERPY_DIR}/src/emscripten-pre-js.js --preload-file ../${SHARE_DIR}/${LIBSUPERDERPY_GAMENAME}/data@/data --preload-file gamestates@/ + COMMAND "${CMAKE_C_COMPILER}" ${CFLAGS_LIST} ../${BIN_DIR}/${LIBSUPERDERPY_GAMENAME}${CMAKE_EXECUTABLE_SUFFIX} ../lib/libsuperderpy${CMAKE_SHARED_LIBRARY_SUFFIX} ../lib/lib${LIBSUPERDERPY_GAMENAME}${CMAKE_SHARED_LIBRARY_SUFFIX} ${Allegro5_LIBS} ${EMSCRIPTEN_FLAGS} -o ${LIBSUPERDERPY_GAMENAME}.html --shell-file ${CMAKE_BINARY_DIR}/gen/emscripten.html --pre-js ${LIBSUPERDERPY_DIR}/src/emscripten-pre-js.js --preload-file ../${SHARE_DIR}/${LIBSUPERDERPY_GAMENAME}/data@/data --preload-file gamestates@/ USES_TERMINAL VERBATIM ) diff --git a/src/emscripten.html.in b/src/emscripten.html.in new file mode 100644 index 0000000..8cbea04 --- /dev/null +++ b/src/emscripten.html.in @@ -0,0 +1,229 @@ + + + + + ${LIBSUPERDERPY_GAMENAME_PRETTY} + + + +
+ +
+
+
+
+ + + +
+ + + + {{{ SCRIPT }}} + +