MCPcopy Create free account
hub / github.com/GameTechDev/PresentMon / VPrint

Function VPrint

PresentMon/Console.cpp:64–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62}
63
64static uint32_t VPrint(wchar_t* buffer, uint32_t bufferCount, wchar_t const* format, va_list val)
65{
66 assert(bufferCount > 0);
67
68 int r = _vsnwprintf_s(buffer, bufferCount, _TRUNCATE, format, val);
69
70 uint32_t numChars;
71 if (r >= 0) {
72 numChars = (uint32_t) r;
73 } else {
74 numChars = bufferCount - 1;
75
76 if (numChars > 0) {
77 uint32_t i = numChars;
78 auto formatLen = wcslen(format);
79 if (formatLen > 0 && format[formatLen - 1] == L'\n') {
80 buffer[--i] = L'\n';
81 }
82
83 for (uint32_t j = 0; j < std::min(i, 3u); ++j) {
84 buffer[--i] = L'.';
85 }
86 }
87 }
88
89 return numChars;
90}
91
92static void VConsolePrint(wchar_t const* format, va_list val, bool newLine)
93{

Callers 2

VConsolePrintFunction · 0.85
PrintColorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected