Fixed log prints in release mode and some better fail handling.
This commit is contained in:
parent
b219c76e81
commit
fcf1f24547
11
src/main.c
11
src/main.c
|
@ -339,9 +339,12 @@ resetGame(void)
|
|||
static bool
|
||||
init(void)
|
||||
{
|
||||
bool result = true;
|
||||
result = result && initSDL();
|
||||
result = result && initGame();
|
||||
if (!initSDL()) {
|
||||
return false;
|
||||
} else if (!initGame()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
settings_init();
|
||||
initMainMenu();
|
||||
|
||||
|
@ -349,7 +352,7 @@ init(void)
|
|||
|
||||
gGameState = MENU;
|
||||
|
||||
return result;
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool
|
||||
|
|
11
src/util.c
11
src/util.c
|
@ -96,6 +96,7 @@ log_print(FILE *out,
|
|||
char tstamp[10];
|
||||
|
||||
timestamp(tstamp, 10);
|
||||
#ifdef DEBUG
|
||||
#ifndef _WIN32
|
||||
if (out == stdout || out == stderr) {
|
||||
fprintf(out, "\033[34m[%s]", tstamp);
|
||||
|
@ -111,9 +112,15 @@ log_print(FILE *out,
|
|||
} else {
|
||||
fprintf(out, "[%s][%5s][%20s:%-3d][%20s()] ", tstamp, prefix, file, line, function);
|
||||
}
|
||||
#else
|
||||
#else // _WIN32
|
||||
fprintf(out, "[%s][%5s][%20s:%-3d][%20s()] ", tstamp, prefix, file, line, function);
|
||||
#endif
|
||||
#endif // _WIN32
|
||||
#else // DEBUG
|
||||
UNUSED(prefix);
|
||||
UNUSED(file);
|
||||
UNUSED(line);
|
||||
UNUSED(function);
|
||||
#endif // DEBUG
|
||||
va_start(args, fmt);
|
||||
vfprintf(out, fmt, args);
|
||||
va_end(args);
|
||||
|
|
Loading…
Reference in New Issue