MCPcopy Create free account
hub / github.com/ZDoom/Raze / PrintString

Function PrintString

source/common/console/c_console.cpp:413–450  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

411extern bool gameisdead;
412
413int PrintString (int iprintlevel, const char *outline)
414{
415 if (gameisdead)
416 return 0;
417
418 if (!conbuffer) return 0; // when called too early
419 int printlevel = iprintlevel & PRINT_TYPES;
420 if (*outline == '\0')
421 {
422 return 0;
423 }
424 if (printlevel != PRINT_LOG || Logfile != nullptr)
425 {
426 // Convert everything coming through here to UTF-8 so that all console text is in a consistent format
427 int count;
428 outline = MakeUTF8(outline, &count);
429
430 if (printlevel != PRINT_LOG)
431 {
432 I_PrintStr(outline);
433
434 conbuffer->AddText(printlevel, outline);
435 if (vidactive && screen && !(iprintlevel & PRINT_NONOTIFY) && NotifyStrings)
436 {
437 if (printlevel >= msglevel)
438 {
439 NotifyStrings->AddString(iprintlevel, outline);
440 }
441 }
442 }
443 if (Logfile != nullptr && !(iprintlevel & PRINT_NOLOG))
444 {
445 WriteLineToLog(Logfile, outline);
446 }
447 return count;
448 }
449 return 0; // Don't waste time on calculating this if nothing at all was printed...
450}
451
452int VPrintf (int printlevel, const char *format, va_list parms)
453{

Callers 2

VPrintfFunction · 0.85
MessageVMethod · 0.85

Calls 5

MakeUTF8Function · 0.85
WriteLineToLogFunction · 0.85
I_PrintStrFunction · 0.50
AddTextMethod · 0.45
AddStringMethod · 0.45

Tested by

no test coverage detected