diff options
| author | Indrajith K L | 2025-11-09 16:12:20 +0530 |
|---|---|---|
| committer | Indrajith K L | 2025-11-09 16:12:20 +0530 |
| commit | 8c9367f3689aee05d33fc1cae8a5d1aa6d2b5fb8 (patch) | |
| tree | 94ab60d8a0dd939478f9b2838bdc6c1d693cb9a8 /src/state.c | |
| parent | 0fbc961bb8e7b9864c0982bb86b0de2e25d6f4aa (diff) | |
| download | reilua-enhanced-8c9367f3689aee05d33fc1cae8a5d1aa6d2b5fb8.tar.gz reilua-enhanced-8c9367f3689aee05d33fc1cae8a5d1aa6d2b5fb8.tar.bz2 reilua-enhanced-8c9367f3689aee05d33fc1cae8a5d1aa6d2b5fb8.zip | |
Add game folder workflow, custom executable names, cross-platform tasks, and logging controls
Diffstat (limited to 'src/state.c')
| -rw-r--r-- | src/state.c | 16 |
1 files changed, 15 insertions, 1 deletions
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() ) { |
