From be7e56f51e0f9c1c8bf38cab8d451f148b46458b Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 22 May 2019 10:40:51 +0200 Subject: Move emscripten web shell to src --- examples/CMakeLists.txt | 2 +- examples/Makefile | 2 +- games/CMakeLists.txt | 2 +- games/cat_vs_roomba/Makefile | 2 +- games/drturtle/Makefile | 2 +- games/just_do/Makefile | 2 +- games/koala_seasons/Makefile | 2 +- games/light_my_ritual/Makefile | 2 +- games/skully_escape/Makefile | 2 +- games/transmission/Makefile | 2 +- games/wave_collector/Makefile | 2 +- projects/4coder/Makefile | 2 +- projects/VSCode/Makefile | 2 +- src/core.c | 2 +- src/shell.html | 269 +++++++++++++++++++++++++++++++++++++++ templates/advance_game/Makefile | 2 +- templates/simple_game/Makefile | 2 +- templates/standard_game/Makefile | 2 +- templates/web_shell/shell.html | 257 ------------------------------------- 19 files changed, 286 insertions(+), 274 deletions(-) create mode 100644 src/shell.html delete mode 100644 templates/web_shell/shell.html diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index f3457b04..6f9e4428 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -81,7 +81,7 @@ elseif(${PLATFORM} MATCHES "Web") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Os -s USE_GLFW=3 -s ASSERTIONS=1 -s WASM=1 -s EMTERPRETIFY=1 -s EMTERPRETIFY_ASYNC=1") # Since WASM is used, ALLOW_MEMORY_GROWTH has no extra overheads set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -s ALLOW_MEMORY_GROWTH=1 --no-heap-copy") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --shell-file ${CMAKE_SOURCE_DIR}/templates/web_shell/shell.html") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --shell-file ${CMAKE_SOURCE_DIR}/src/shell.html") set(OUTPUT_EXT ".html") diff --git a/examples/Makefile b/examples/Makefile index cb015fa7..e79bc364 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -240,7 +240,7 @@ ifeq ($(PLATFORM),PLATFORM_WEB) # logic to a self contained function: UpdateDrawFrame(), check core_basic_window_web.c for reference. # Define a custom shell .html and output extension - CFLAGS += --shell-file $(RAYLIB_PATH)\templates\web_shell\shell.html + CFLAGS += --shell-file $(RAYLIB_PATH)\src\shell.html EXT = .html endif diff --git a/games/CMakeLists.txt b/games/CMakeLists.txt index d3f9d9fc..3ec6cb29 100644 --- a/games/CMakeLists.txt +++ b/games/CMakeLists.txt @@ -8,7 +8,7 @@ set(OUTPUT_EXT) if(${PLATFORM} MATCHES "Web") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Os -s USE_GLFW=3 -s ASSERTIONS=1 -s WASM=1 -s EMTERPRETIFY=1 -s EMTERPRETIFY_ASYNC=1") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --shell-file ${CMAKE_SOURCE_DIR}/templates/web_shell/shell.html") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --shell-file ${CMAKE_SOURCE_DIR}/src/shell.html") set(OUTPUT_EXT ".html") endif() diff --git a/games/cat_vs_roomba/Makefile b/games/cat_vs_roomba/Makefile index 620df80f..87b052d2 100644 --- a/games/cat_vs_roomba/Makefile +++ b/games/cat_vs_roomba/Makefile @@ -236,7 +236,7 @@ ifeq ($(PLATFORM),PLATFORM_WEB) endif # Define a custom shell .html and output extension - CFLAGS += --shell-file $(RAYLIB_PATH)\templates\web_shell\shell.html + CFLAGS += --shell-file $(RAYLIB_PATH)\src\shell.html EXT = .html endif diff --git a/games/drturtle/Makefile b/games/drturtle/Makefile index 4bab3e36..8a7c6732 100644 --- a/games/drturtle/Makefile +++ b/games/drturtle/Makefile @@ -236,7 +236,7 @@ ifeq ($(PLATFORM),PLATFORM_WEB) endif # Define a custom shell .html and output extension - CFLAGS += --shell-file $(RAYLIB_PATH)\templates\web_shell\shell.html + CFLAGS += --shell-file $(RAYLIB_PATH)\src\shell.html EXT = .html endif diff --git a/games/just_do/Makefile b/games/just_do/Makefile index 9bd09dd4..7b2d4d5f 100644 --- a/games/just_do/Makefile +++ b/games/just_do/Makefile @@ -236,7 +236,7 @@ ifeq ($(PLATFORM),PLATFORM_WEB) endif # Define a custom shell .html and output extension - CFLAGS += --shell-file $(RAYLIB_PATH)\templates\web_shell\shell.html + CFLAGS += --shell-file $(RAYLIB_PATH)\src\shell.html EXT = .html endif diff --git a/games/koala_seasons/Makefile b/games/koala_seasons/Makefile index 4688f3ac..5f3493e3 100644 --- a/games/koala_seasons/Makefile +++ b/games/koala_seasons/Makefile @@ -236,7 +236,7 @@ ifeq ($(PLATFORM),PLATFORM_WEB) endif # Define a custom shell .html and output extension - CFLAGS += --shell-file $(RAYLIB_PATH)\templates\web_shell\shell.html + CFLAGS += --shell-file $(RAYLIB_PATH)\src\shell.html EXT = .html endif diff --git a/games/light_my_ritual/Makefile b/games/light_my_ritual/Makefile index 1a90642e..b1446831 100644 --- a/games/light_my_ritual/Makefile +++ b/games/light_my_ritual/Makefile @@ -236,7 +236,7 @@ ifeq ($(PLATFORM),PLATFORM_WEB) endif # Define a custom shell .html and output extension - CFLAGS += --shell-file $(RAYLIB_PATH)\templates\web_shell\shell.html + CFLAGS += --shell-file $(RAYLIB_PATH)\src\shell.html EXT = .html endif diff --git a/games/skully_escape/Makefile b/games/skully_escape/Makefile index d57075da..aa21763a 100644 --- a/games/skully_escape/Makefile +++ b/games/skully_escape/Makefile @@ -236,7 +236,7 @@ ifeq ($(PLATFORM),PLATFORM_WEB) endif # Define a custom shell .html and output extension - CFLAGS += --shell-file $(RAYLIB_PATH)\templates\web_shell\shell.html + CFLAGS += --shell-file $(RAYLIB_PATH)\src\shell.html EXT = .html endif diff --git a/games/transmission/Makefile b/games/transmission/Makefile index c78d7ef5..f4b30331 100644 --- a/games/transmission/Makefile +++ b/games/transmission/Makefile @@ -236,7 +236,7 @@ ifeq ($(PLATFORM),PLATFORM_WEB) endif # Define a custom shell .html and output extension - CFLAGS += --shell-file $(RAYLIB_PATH)\templates\web_shell\shell.html + CFLAGS += --shell-file $(RAYLIB_PATH)\src\shell.html EXT = .html endif diff --git a/games/wave_collector/Makefile b/games/wave_collector/Makefile index 7f9b94e6..e2c039b6 100644 --- a/games/wave_collector/Makefile +++ b/games/wave_collector/Makefile @@ -236,7 +236,7 @@ ifeq ($(PLATFORM),PLATFORM_WEB) endif # Define a custom shell .html and output extension - CFLAGS += --shell-file $(RAYLIB_PATH)\templates\web_shell\shell.html + CFLAGS += --shell-file $(RAYLIB_PATH)\src\shell.html EXT = .html endif diff --git a/projects/4coder/Makefile b/projects/4coder/Makefile index c7b9162a..63d093a2 100644 --- a/projects/4coder/Makefile +++ b/projects/4coder/Makefile @@ -236,7 +236,7 @@ ifeq ($(PLATFORM),PLATFORM_WEB) endif # Define a custom shell .html and output extension - CFLAGS += --shell-file $(RAYLIB_PATH)\templates\web_shell\shell.html + CFLAGS += --shell-file $(RAYLIB_PATH)\src\shell.html EXT = .html endif diff --git a/projects/VSCode/Makefile b/projects/VSCode/Makefile index c7b9162a..63d093a2 100644 --- a/projects/VSCode/Makefile +++ b/projects/VSCode/Makefile @@ -236,7 +236,7 @@ ifeq ($(PLATFORM),PLATFORM_WEB) endif # Define a custom shell .html and output extension - CFLAGS += --shell-file $(RAYLIB_PATH)\templates\web_shell\shell.html + CFLAGS += --shell-file $(RAYLIB_PATH)\src\shell.html EXT = .html endif diff --git a/src/core.c b/src/core.c index d8d85144..8dd1090b 100644 --- a/src/core.c +++ b/src/core.c @@ -1640,7 +1640,7 @@ void TakeScreenshot(const char *fileName) #if defined(PLATFORM_WEB) // Download file from MEMFS (emscripten memory filesystem) - // SaveFileFromMEMFSToDisk() function is defined in raylib/templates/web_shel/shell.html + // SaveFileFromMEMFSToDisk() function is defined in raylib/src/shell.html emscripten_run_script(TextFormat("SaveFileFromMEMFSToDisk('%s','%s')", GetFileName(path), GetFileName(path))); #endif diff --git a/src/shell.html b/src/shell.html new file mode 100644 index 00000000..5d8e7e91 --- /dev/null +++ b/src/shell.html @@ -0,0 +1,269 @@ + + + + + + + raylib HTML5 GAME + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + {{{ SCRIPT }}} + + \ No newline at end of file diff --git a/templates/advance_game/Makefile b/templates/advance_game/Makefile index 784c7dca..95fb6f6f 100644 --- a/templates/advance_game/Makefile +++ b/templates/advance_game/Makefile @@ -236,7 +236,7 @@ ifeq ($(PLATFORM),PLATFORM_WEB) endif # Define a custom shell .html and output extension - CFLAGS += --shell-file $(RAYLIB_PATH)\templates\web_shell\shell.html + CFLAGS += --shell-file $(RAYLIB_PATH)\src\shell.html EXT = .html endif diff --git a/templates/simple_game/Makefile b/templates/simple_game/Makefile index a1e65772..ea732c92 100644 --- a/templates/simple_game/Makefile +++ b/templates/simple_game/Makefile @@ -236,7 +236,7 @@ ifeq ($(PLATFORM),PLATFORM_WEB) endif # Define a custom shell .html and output extension - CFLAGS += --shell-file $(RAYLIB_PATH)\templates\web_shell\shell.html + CFLAGS += --shell-file $(RAYLIB_PATH)\src\shell.html EXT = .html endif diff --git a/templates/standard_game/Makefile b/templates/standard_game/Makefile index bd7906b8..56b76b42 100644 --- a/templates/standard_game/Makefile +++ b/templates/standard_game/Makefile @@ -230,7 +230,7 @@ ifeq ($(PLATFORM),PLATFORM_WEB) endif # Define a custom shell .html and output extension - CFLAGS += --shell-file $(RAYLIB_PATH)\templates\web_shell\shell.html + CFLAGS += --shell-file $(RAYLIB_PATH)\src\shell.html EXT = .html endif diff --git a/templates/web_shell/shell.html b/templates/web_shell/shell.html deleted file mode 100644 index 641cfc02..00000000 --- a/templates/web_shell/shell.html +++ /dev/null @@ -1,257 +0,0 @@ - - - - - - - raylib HTML5 GAME - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
-
Downloading...
- - - - - -
- -
-
- -
- -
- - - - - - - {{{ SCRIPT }}} - - \ No newline at end of file -- cgit v1.2.3