Print dmap output in console and Visual Studio

This commit is contained in:
Robert Beckebans 2024-06-18 17:26:33 +02:00
parent 68bd54af9c
commit aab5a4844f
2 changed files with 36 additions and 12 deletions

View file

@ -276,7 +276,7 @@ void Dmap( const idCmdArgs& args )
{
dmapGlobals.asciiTree = true;
}
else if( !idStr::Icmp( s, "v" ) )
else if( !idStr::Icmp( s, "v" ) || !idStr::Icmp( s, "verbose" ) )
{
common->Printf( "verbose = true\n" );
dmapGlobals.verbose = true;

View file

@ -35,21 +35,25 @@ If you have questions concerning this license or the applicable additional terms
#include <io.h>
idEventLoop* eventLoop;
//idDeclManager* declManager;
idSys* sys = NULL;
#define MAXPRINTMSG 4096
#define STDIO_PRINT( pre, post ) \
char msg[MAXPRINTMSG]; \
va_list argptr; \
va_start( argptr, fmt ); \
printf( pre ); \
vprintf( fmt, argptr ); \
printf( post ); \
OutputDebugStringA(post); \
va_end( argptr )
idStr::vsnPrintf( msg, MAXPRINTMSG - 1, fmt, argptr ); \
msg[ sizeof( msg ) - 1 ] = '\0'; \
va_end( argptr ); \
Sys_DebugPrintf( "%s%s%s", pre, msg, post ); \
//idCVar com_developer( "developer", "0", CVAR_BOOL|CVAR_SYSTEM, "developer mode" );
idCVar com_productionMode( "com_productionMode", "0", CVAR_SYSTEM | CVAR_BOOL, "0 - no special behavior, 1 - building a production build, 2 - running a production build" );
/*
==============================================================
@ -59,6 +63,28 @@ idCVar com_productionMode( "com_productionMode", "0", CVAR_SYSTEM | CVAR_BOOL, "
*/
/*
==============
Sys_DebugPrintf
==============
*/
void Sys_DebugPrintf( const char* fmt, ... )
{
char msg[MAXPRINTMSG];
va_list argptr;
va_start( argptr, fmt );
idStr::vsnPrintf( msg, MAXPRINTMSG - 1, fmt, argptr );
msg[ sizeof( msg ) - 1 ] = '\0';
va_end( argptr );
printf( msg );
OutputDebugString( msg );
}
/*
==============
Sys_Mkdir
@ -331,7 +357,7 @@ public:
}
virtual void DPrintf( const char* fmt, ... )
{
/*STDIO_PRINT( "", "" );*/
STDIO_PRINT( "", "" );
}
virtual void Warning( const char* fmt, ... )
{
@ -339,7 +365,7 @@ public:
}
virtual void DWarning( const char* fmt, ... )
{
/*STDIO_PRINT( "WARNING: ", "\n" );*/
STDIO_PRINT( "WARNING: ", "\n" );
}
// Prints all queued warnings.
@ -514,8 +540,6 @@ public:
void LoadPacifierBinarizeProgressIncrement( int step ) { };
};
//idCVar com_developer( "developer", "0", CVAR_BOOL|CVAR_SYSTEM, "developer mode" );
idCommonLocal commonLocal;
idCommon* common = &commonLocal;