mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-24 21:11:52 +00:00
Exported DPrintf
Allows for custom debug message handling using the built-in
This commit is contained in:
parent
96ec9b9dbd
commit
1e96ed31aa
2 changed files with 21 additions and 0 deletions
|
@ -1162,6 +1162,17 @@ DEFINE_ACTION_FUNCTION(_Console, PrintfEx)
|
|||
return 0;
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(_Console, DebugPrintf)
|
||||
{
|
||||
PARAM_PROLOGUE;
|
||||
PARAM_INT(debugLevel);
|
||||
PARAM_VA_POINTER(va_reginfo);
|
||||
|
||||
FString s = FStringFormat(VM_ARGS_NAMES, 1);
|
||||
DPrintf(debugLevel, "%s\n", s.GetChars());
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void StopAllSounds()
|
||||
{
|
||||
soundEngine->StopAllChannels();
|
||||
|
|
|
@ -143,6 +143,15 @@ enum EPrintLevel
|
|||
PRINT_NOLOG = 2048, // Flag - do not print to log file
|
||||
};
|
||||
|
||||
enum EDebugLevel
|
||||
{
|
||||
DMSG_OFF, // no developer messages.
|
||||
DMSG_ERROR, // general notification messages
|
||||
DMSG_WARNING, // warnings
|
||||
DMSG_NOTIFY, // general notification messages
|
||||
DMSG_SPAMMY, // for those who want to see everything, regardless of its usefulness.
|
||||
};
|
||||
|
||||
enum EConsoleState
|
||||
{
|
||||
c_up = 0,
|
||||
|
@ -665,6 +674,7 @@ struct Console native
|
|||
native static void HideConsole();
|
||||
native static vararg void Printf(string fmt, ...);
|
||||
native static vararg void PrintfEx(int printlevel, string fmt, ...);
|
||||
native static vararg void DebugPrintf(int debuglevel, string fmt, ...);
|
||||
}
|
||||
|
||||
struct CVar native
|
||||
|
|
Loading…
Reference in a new issue