Added a -outputdebugstring option for dumping console to debugger's output window (because msvc is unable to see standard out).

git-svn-id: https://svn.code.sf.net/p/fteqw/code/branches/wip@3715 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2011-01-23 03:33:33 +00:00
parent 9b6ea1c114
commit 562f549357
2 changed files with 10 additions and 3 deletions

View File

@ -676,7 +676,6 @@ void VARGS Con_Printf (const char *fmt, ...)
#endif
// also echo to debugging console
// OutputDebugString(msg); //msvc debug output
Sys_Printf ("%s", msg); // also echo to debugging console
// log all messages to file

View File

@ -43,6 +43,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#if !defined(CLIENTONLY) && !defined(SERVERONLY)
qboolean isDedicated = false;
#endif
qboolean debugout;
HWND sys_parentwindow;
unsigned int sys_parentwidth; //valid if sys_parentwindow is set
@ -732,14 +733,19 @@ void VARGS Sys_Printf (char *fmt, ...)
char text[1024];
DWORD dummy;
if (!houtput)
if (!houtput && !debugout)
return;
va_start (argptr,fmt);
vsnprintf (text, sizeof(text), fmt, argptr);
va_end (argptr);
WriteFile (houtput, text, strlen(text), &dummy, NULL);
#ifdef _DEBUG
if (debugout)
OutputDebugString(text); //msvc debug output
#endif
if (houtput)
WriteFile (houtput, text, strlen(text), &dummy, NULL);
}
void Sys_Quit (void)
@ -1548,6 +1554,8 @@ int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLin
printf("version " DISTRIBUTION " " __TIME__ " " __DATE__ "\n");
return true;
}
if (COM_CheckParm("-outputdebugstring"))
debugout = true;
if (!GetCurrentDirectory (sizeof(cwd), cwd))
Sys_Error ("Couldn't determine current directory");