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:
parent
4b62b03c6a
commit
b43832c285
|
@ -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
|
||||
--------
|
||||
|
|
|
@ -209,6 +209,9 @@ void con_init(void)
|
|||
{
|
||||
memset(con_buffer,0,sizeof(con_buffer));
|
||||
|
||||
if (GameArg.DbgVerbose >= CON_VERBOSE)
|
||||
gamelog_fp = PHYSFS_openWrite("gamelog.txt");
|
||||
else
|
||||
gamelog_fp = PHYSFSX_openWriteBuffered("gamelog.txt");
|
||||
atexit(con_close);
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue