From 737214b71be8fe5fdf51155ad50bb064b3156bd3 Mon Sep 17 00:00:00 2001 From: Indrajith K L Date: Mon, 3 Nov 2025 17:48:56 +0530 Subject: Add embedded assets, splash screens, and asset loading support Features added: - Embedded main.lua and Lua files support (EMBED_MAIN option) - Embedded assets support (EMBED_ASSETS option) - Splash screens with dual logo display (always embedded) - Asset loading progress tracking API (BeginAssetLoading, UpdateAssetLoading, EndAssetLoading) - Custom font embedding for splash/loading screens - --log flag for Windows console control - --no-logo flag to skip splash screens in development - Python scripts for embedding (embed_lua.py, embed_assets.py, embed_logo.py, embed_font.py) - Documentation (EMBEDDING.md, ASSET_LOADING.md, SPLASH_SCREENS.md) This allows building single-executable releases with all Lua code and assets embedded. --- include/core.h | 3 +++ include/lua_core.h | 2 +- include/splash.h | 6 ++++++ 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 include/splash.h (limited to 'include') diff --git a/include/core.h b/include/core.h index ab115ae..d608d0a 100644 --- a/include/core.h +++ b/include/core.h @@ -140,6 +140,9 @@ int lcoreGetDirectoryPath( lua_State* L ); int lcoreGetPrevDirectoryPath( lua_State* L ); int lcoreGetWorkingDirectory( lua_State* L ); int lcoreGetApplicationDirectory( lua_State* L ); +int lcoreBeginAssetLoading( lua_State* L ); +int lcoreUpdateAssetLoading( lua_State* L ); +int lcoreEndAssetLoading( lua_State* L ); int lcoreMakeDirectory( lua_State* L ); int lcoreChangeDirectory( lua_State* L ); int lcoreIsPathFile( lua_State* L ); diff --git a/include/lua_core.h b/include/lua_core.h index 8204b49..acbae3f 100644 --- a/include/lua_core.h +++ b/include/lua_core.h @@ -50,7 +50,7 @@ void assingGlobalFunction( const char* name, int ( *functionPtr )( lua_State* ) bool luaInit( int argn, const char** argc ); int luaTraceback( lua_State* L ); -void luaCallMain(); +bool luaCallMain(); void luaCallInit(); void luaCallUpdate(); void luaCallDraw(); diff --git a/include/splash.h b/include/splash.h new file mode 100644 index 0000000..da5e762 --- /dev/null +++ b/include/splash.h @@ -0,0 +1,6 @@ +#pragma once + +void splashInit(); +bool splashUpdate( float delta ); +void splashDraw(); +void splashCleanup(); -- cgit v1.2.3 From f185f2c31a611c985dbdb5e1b40a0c4c2a1dc3b1 Mon Sep 17 00:00:00 2001 From: Indrajith K L Date: Mon, 3 Nov 2025 18:04:54 +0530 Subject: Fix SEGV crash: Initialize window and font in stateInit() - Move window initialization and font loading to stateInit() - Window now opens before splash screens (required for rendering) - Custom font loaded in stateInit for splash screen use - Remove RL.config() call from luaCallMain() (window already initialized) - Remove stateContextInit() call (initialization now done in stateInit) - Add hasWindow, customFontLoaded, resolution fields to State - Fix memory management for custom font in stateFree() This matches the ReiLua-JamVersion architecture where the window is opened early so splash screens can render properly. --- include/state.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/state.h b/include/state.h index 24679c6..3e7836d 100644 --- a/include/state.h +++ b/include/state.h @@ -7,7 +7,10 @@ typedef struct { char* basePath; bool run; + bool hasWindow; bool gcUnload; + bool customFontLoaded; + Vector2 resolution; int lineSpacing; /* We need to store copy here since raylib has it in static. */ Vector2 mouseOffset; Vector2 mouseScale; -- cgit v1.2.3