summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkdx <kikoodx@paranoici.org>2024-01-03 03:02:44 +0100
committerkdx <kikoodx@paranoici.org>2024-01-03 03:02:44 +0100
commitad6daeb303591ceb66cfc91a9800bf21a6bd3932 (patch)
tree068047129d0c43ecaad226061a922996beabe420
parent26f90b303631f8a7bffe54267701019bdb62e33f (diff)
download007-main.tar.gz
web buildHEADmain
-rwxr-xr-xemcc.sh11
-rw-r--r--src/index.html49
-rw-r--r--vendors/TZR.c3
-rw-r--r--vendors/TZR.h2
4 files changed, 62 insertions, 3 deletions
diff --git a/emcc.sh b/emcc.sh
new file mode 100755
index 0000000..5b8d13b
--- /dev/null
+++ b/emcc.sh
@@ -0,0 +1,11 @@
+#!/bin/sh
+tup || exit 1
+rm -f build/index.*
+cp src/index.html build || exit 1
+cd build || exit 1
+cp -r ../res . || exit 1
+emcc -sUSE_SDL=2 -sUSE_SDL_MIXER=2 -sALLOW_MEMORY_GROWTH \
+ -O3 -s -std=c2x -Wno-initializer-overrides \
+ ../src/*.c ../vendors/*.c \
+ -I../inc -I../vendors -include../vendors/_.h \
+ -o index.js --preload-file res
diff --git a/src/index.html b/src/index.html
new file mode 100644
index 0000000..e48f3af
--- /dev/null
+++ b/src/index.html
@@ -0,0 +1,49 @@
+<!DOCTYPE html>
+<html>
+
+<head>
+ <meta charset="utf-8">
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <script type='text/javascript'>
+ window.onload = function () { window.focus(); }
+ window.onclick = function () { window.focus(); }
+ </script>
+ <style>
+ html, body
+ {
+ height: 100%;
+ margin: 0;
+ }
+ body
+ {
+ display: flex;
+ display: -webkit-flex;
+ -webkit-justify-content: center;
+ justify-content: center;
+ -webkit-align-items: center;
+ align-items: center;
+ }
+ canvas
+ {
+ display: block;
+ outline: none;
+ height: 100%;
+ max-height: 100%;
+ width: 100%;
+ max-width: 100%;
+ }
+ </style>
+</head>
+
+<body>
+ <canvas id="canvas" oncontextmenu="event.preventDefault()"></canvas>
+ <script type='text/javascript'>
+ var Module = {
+ canvas: (function() { return document.getElementById('canvas'); })()
+ };
+ </script>
+ <script src="index.js"></script>
+
+</body>
+
+</html>
diff --git a/vendors/TZR.c b/vendors/TZR.c
index e28348f..ac34f5a 100644
--- a/vendors/TZR.c
+++ b/vendors/TZR.c
@@ -23,7 +23,6 @@
#include <SDL2/SDL_rwops.h>
#include <SDL2/SDL_scancode.h>
#include <SDL2/SDL_timer.h>
-#include <SDL2/SDL_ttf.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
@@ -1416,4 +1415,4 @@ TZR_ToggleFullscreen(void)
** FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
** IN THE SOFTWARE.
*/
-/* commit hash: 221a7d0618b4f8b6af19b089f49818806fe1e1b3 */
+/* commit hash: 3855a2ebd550fb89c8c70caa3776bef532ec87e7 */
diff --git a/vendors/TZR.h b/vendors/TZR.h
index a06ea3b..47169a8 100644
--- a/vendors/TZR.h
+++ b/vendors/TZR.h
@@ -499,4 +499,4 @@ int TZR_SetViewportSize(int width, int height);
** FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
** IN THE SOFTWARE.
*/
-/* commit hash: 221a7d0618b4f8b6af19b089f49818806fe1e1b3 */
+/* commit hash: 3855a2ebd550fb89c8c70caa3776bef532ec87e7 */