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:44 +01:00
parent 365def54ed
commit e2730faa5b
3 changed files with 9 additions and 6 deletions

View file

@ -3,6 +3,7 @@ D1X-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
20101123
--------

View file

@ -209,7 +209,10 @@ 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

@ -300,6 +300,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();
@ -358,11 +362,6 @@ int main(int argc, char *argv[])
arch_init();
#ifdef _WIN32
freopen( "CON", "w", stdout );
freopen( "CON", "w", stderr );
#endif
select_tmap(GameArg.DbgTexMap);
#ifdef NETWORK