mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-11 15:21:51 +00:00
Make console to Windows debug output controlled by CVAR
DebugView can be used to view output without debugger attached
This commit is contained in:
parent
c743b19e6d
commit
37dde2e77d
1 changed files with 23 additions and 21 deletions
|
@ -137,6 +137,7 @@ extern bool ConWindowHidden;
|
||||||
// PUBLIC DATA DEFINITIONS -------------------------------------------------
|
// PUBLIC DATA DEFINITIONS -------------------------------------------------
|
||||||
|
|
||||||
CVAR (String, queryiwad_key, "shift", CVAR_GLOBALCONFIG|CVAR_ARCHIVE);
|
CVAR (String, queryiwad_key, "shift", CVAR_GLOBALCONFIG|CVAR_ARCHIVE);
|
||||||
|
CVAR (Bool, con_debugoutput, false, 0);
|
||||||
|
|
||||||
double PerfToSec, PerfToMillisec;
|
double PerfToSec, PerfToMillisec;
|
||||||
UINT TimerPeriod;
|
UINT TimerPeriod;
|
||||||
|
@ -1053,7 +1054,8 @@ static TArray<FString> bufferedConsoleStuff;
|
||||||
|
|
||||||
void I_PrintStr(const char *cp)
|
void I_PrintStr(const char *cp)
|
||||||
{
|
{
|
||||||
#ifdef _DEBUG
|
if (con_debugoutput)
|
||||||
|
{
|
||||||
// Strip out any color escape sequences before writing to debug output
|
// Strip out any color escape sequences before writing to debug output
|
||||||
char * copy = new char[strlen(cp)+1];
|
char * copy = new char[strlen(cp)+1];
|
||||||
const char * srcp = cp;
|
const char * srcp = cp;
|
||||||
|
@ -1075,7 +1077,7 @@ void I_PrintStr(const char *cp)
|
||||||
|
|
||||||
OutputDebugStringA(copy);
|
OutputDebugStringA(copy);
|
||||||
delete [] copy;
|
delete [] copy;
|
||||||
#endif // _DEBUG
|
}
|
||||||
|
|
||||||
if (ConWindowHidden)
|
if (ConWindowHidden)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue