diff -ruN a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt 2026-11-06 00:00:04.054053541 -0300 +++ b/CMakeLists.txt 2026-11-06 00:00:04.606851538 -0300 @@ -159,7 +159,6 @@ # runs the finishing step below, so the output folder never keeps an old copy. # CONFIGURE_DEPENDS makes a new or deleted file rerun CMake too. file(GLOB_RECURSE LS_WEB_SHELL_FILES CONFIGURE_DEPENDS "${LS_WEB_DIR}/*") - list(APPEND LS_WEB_SHELL_FILES "${CMAKE_SOURCE_DIR}/tools/generate-icons.mjs") set_target_properties(laststand PROPERTIES OUTPUT_NAME "index" LINK_DEPENDS "${LS_WEB_SHELL_FILES}") # Copies the page shell next to the build output and writes the real @@ -168,7 +167,6 @@ COMMAND ${CMAKE_COMMAND} -DOUT_DIR=$ -DWEB_DIR=${LS_WEB_DIR} - -DTOOLS_DIR=${CMAKE_SOURCE_DIR}/tools -P "${CMAKE_SOURCE_DIR}/web/FinishWebBuild.cmake" ) endif() diff -ruN a/web/FinishWebBuild.cmake b/web/FinishWebBuild.cmake --- a/web/FinishWebBuild.cmake +++ b/web/FinishWebBuild.cmake @@ -1,60 +1,12 @@ -# Runs after the browser build links. It completes the site in the output folder: -# the page shell components, the manifest, generated icons, the offline worker, -# and a list of every file that belongs on the web host. +# Runs after the browser build links (FredyGames version). It copies the page shell components next +# to the build output and writes the real .wasm size into the page, so the loading bar can show true +# progress. There are no icons, no manifest and no offline worker in this build. # -# Inputs: OUT_DIR (build output), WEB_DIR (the web folder), TOOLS_DIR (the tools folder). - -# The old copies are removed first. COPY never deletes, so a component that was removed -# from web/ would otherwise stay in the output and in the file list below. -file(REMOVE_RECURSE "${OUT_DIR}/components" "${OUT_DIR}/icons") +# Inputs: OUT_DIR (build output), WEB_DIR (the web folder). +file(REMOVE_RECURSE "${OUT_DIR}/components") file(COPY "${WEB_DIR}/components" DESTINATION "${OUT_DIR}") -file(COPY "${WEB_DIR}/manifest.webmanifest" DESTINATION "${OUT_DIR}") - -# Icons are drawn by a script at build time, so no image is ever committed. -find_program(LS_NODE node) -if(NOT LS_NODE) - message(FATAL_ERROR "node was not found on PATH. It is needed to generate the app icons.") -endif() -execute_process( - COMMAND "${LS_NODE}" "${TOOLS_DIR}/generate-icons.mjs" "${OUT_DIR}/icons" - RESULT_VARIABLE LS_ICONS_RESULT) -if(NOT LS_ICONS_RESULT EQUAL 0) - message(FATAL_ERROR "Generating the app icons failed.") -endif() -# The loading bar needs the real .wasm size. file(SIZE "${OUT_DIR}/index.wasm" LS_WASM_BYTES) file(READ "${OUT_DIR}/index.html" LS_PAGE) string(REPLACE "__LS_WASM_BYTES__" "${LS_WASM_BYTES}" LS_PAGE "${LS_PAGE}") file(WRITE "${OUT_DIR}/index.html" "${LS_PAGE}") - -# Every file the game needs, relative to the output folder. The offline worker -# caches exactly this list and the deploy step copies exactly this list, so -# build system files (CMakeFiles, build.ninja, ...) never reach the host. -file(GLOB_RECURSE LS_NESTED RELATIVE "${OUT_DIR}" "${OUT_DIR}/components/*" "${OUT_DIR}/icons/*") -list(SORT LS_NESTED) -set(LS_SITE_FILES index.html index.js index.wasm manifest.webmanifest ${LS_NESTED}) - -# The build id is a hash of all those files plus the worker itself: the same -# content always gives the same id, and any change gives a new offline cache. -# The worker also gets each file's own hash as [file, hash] pairs, and checks every file -# it downloads against them, so a host serving files from two different builds can't -# get a mixed set cached. -file(READ "${WEB_DIR}/sw.js" LS_WORKER) -set(LS_HASHES "${LS_WORKER}") -set(LS_PRECACHE "") -foreach(item IN LISTS LS_SITE_FILES) - file(SHA256 "${OUT_DIR}/${item}" LS_FILE_HASH) - string(APPEND LS_HASHES "${item}=${LS_FILE_HASH};") - string(APPEND LS_PRECACHE "[\"${item}\",\"${LS_FILE_HASH}\"],") -endforeach() -string(SHA256 LS_BUILD_ID "${LS_HASHES}") -string(SUBSTRING "${LS_BUILD_ID}" 0 12 LS_BUILD_ID) -string(REGEX REPLACE ",$" "" LS_PRECACHE "${LS_PRECACHE}") -string(REPLACE "__LS_BUILD_ID__" "${LS_BUILD_ID}" LS_WORKER "${LS_WORKER}") -string(REPLACE "__LS_PRECACHE__" "[${LS_PRECACHE}]" LS_WORKER "${LS_WORKER}") -file(WRITE "${OUT_DIR}/sw.js" "${LS_WORKER}") - -# One file per line, for the deploy step. The worker is listed too. -string(REPLACE ";" "\n" LS_SITE_LIST "${LS_SITE_FILES};sw.js") -file(WRITE "${OUT_DIR}/site-files.txt" "${LS_SITE_LIST}\n") diff -ruN a/web/index.html b/web/index.html --- a/web/index.html 2026-11-06 00:00:04.055105487 -0300 +++ b/web/index.html 2026-11-06 00:00:04.542693430 -0300 @@ -5,19 +5,9 @@ Last Stand - - - - - - - - - - - + + - @@ -33,16 +23,10 @@

The game needs WebGL 2, which is off or unavailable here.

Try the latest Chrome, Edge, Firefox or Safari, and check that hardware acceleration is on.

- - - {{{ SCRIPT }}}