From 8c9367f3689aee05d33fc1cae8a5d1aa6d2b5fb8 Mon Sep 17 00:00:00 2001 From: Indrajith K L Date: Sun, 9 Nov 2025 16:12:20 +0530 Subject: Add game folder workflow, custom executable names, cross-platform tasks, and logging controls --- src/state.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src/state.c') diff --git a/src/state.c b/src/state.c index 4fdc729..2e946ea 100644 --- a/src/state.c +++ b/src/state.c @@ -10,7 +10,7 @@ State* state; -bool stateInit( int argn, const char** argc, const char* basePath ) { +bool stateInit( int argn, const char** argc, const char* basePath, bool enable_logging ) { state = malloc( sizeof( State ) ); state->basePath = malloc( STRING_LEN * sizeof( char ) ); @@ -36,6 +36,20 @@ bool stateInit( int argn, const char** argc, const char* basePath ) { state->mouseScale = (Vector2){ 1, 1 }; state->customFontLoaded = false; + /* Set log level based on build type and --log flag */ +#ifdef NDEBUG + /* Release build - only show warnings/errors unless --log is specified */ + if ( enable_logging ) { + SetTraceLogLevel( LOG_INFO ); + } + else { + SetTraceLogLevel( LOG_WARNING ); + } +#else + /* Debug/Dev build - always show all logs */ + SetTraceLogLevel( LOG_INFO ); +#endif + InitWindow( state->resolution.x, state->resolution.y, "ReiLua" ); if ( !IsWindowReady() ) { -- cgit v1.2.3