From 8800de59fa704cfe60ac980db079b44042639684 Mon Sep 17 00:00:00 2001 From: jussi Date: Tue, 22 Feb 2022 02:49:15 +0200 Subject: Web build. --- src/lua_core.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/lua_core.c b/src/lua_core.c index 1ee21de..54be454 100644 --- a/src/lua_core.c +++ b/src/lua_core.c @@ -213,12 +213,16 @@ bool luaCallMain() { char path[ STRING_LEN ] = { '\0' }; +/* If web, set path to resources folder. */ +#ifdef EMSCRIPTEN + sprintf( path, "resources/main.lua" ); +#else sprintf( path, "%smain.lua", state->exePath ); - /* Alternatively look for main. Could be precompiled binary file. */ if ( !FileExists( path ) ) { sprintf( path, "%smain", state->exePath ); } +#endif luaL_dofile( L, path ); -- cgit v1.2.3