If -verbose or -debug is set, write gamelog.txt unbuffered for a higher chance to get messages there in case of a crash; Totally supress messages in stdout/err.txt on _WIN32

This commit is contained in:
zicodxx 2010-11-26 13:15:56 +01:00
parent 4b62b03c6a
commit b43832c285
3 changed files with 9 additions and 6 deletions

View file

@ -3,6 +3,7 @@ D2X-Rebirth Changelog
20101126
--------
include/physfsx.h, main/inferno.c, misc/physfsx.c: Implemented PHYSFSX_checkSupportedArchiveTypes to check if essential archive types are supported. Print warnings if not and stop program if necessary. Also added PHYSFSX_listSearchPAthContent to print out search path contents (figures) each time the function is called. Doing this before main HOG inits as well after sucessfully adding archives. Made PHYSFSX_addArchiveContent a bit more verbose as well.
main/console.c, main/inferno.c: If -verbose or -debug is set, write gamelog.txt unbuffered for a higher chance to get messages there in case of a crash; Totally supress messages in stdout/err.txt on _WIN32
20101125
--------

View file

@ -209,6 +209,9 @@ void con_init(void)
{
memset(con_buffer,0,sizeof(con_buffer));
gamelog_fp = PHYSFSX_openWriteBuffered("gamelog.txt");
if (GameArg.DbgVerbose >= CON_VERBOSE)
gamelog_fp = PHYSFS_openWrite("gamelog.txt");
else
gamelog_fp = PHYSFSX_openWriteBuffered("gamelog.txt");
atexit(con_close);
}

View file

@ -328,6 +328,10 @@ int main(int argc, char *argv[])
con_init(); // Initialise the console
setbuf(stdout, NULL); // unbuffered output via printf
#ifdef _WIN32
freopen( "CON", "w", stdout );
freopen( "CON", "w", stderr );
#endif
if (GameArg.SysShowCmdHelp) {
print_commandline_help();
@ -390,11 +394,6 @@ int main(int argc, char *argv[])
arch_init();
#ifdef _WIN32
freopen( "CON", "w", stdout );
freopen( "CON", "w", stderr );
#endif
select_tmap(GameArg.DbgTexMap);
Lighting_on = 1;