mirror of
https://github.com/reactos/reactos.git
synced 2025-04-04 04:26:32 +00:00
[USETUP] Speed up CONSOLE_SetStatusTextXV +17% (#5086)
Get more speed by omitting erasing and overwriting whole line. CORE-18838
This commit is contained in:
parent
f1de615b9c
commit
acd3148c1a
1 changed files with 6 additions and 12 deletions
|
@ -429,32 +429,26 @@ CONSOLE_SetStatusTextXV(
|
|||
IN LPCSTR fmt,
|
||||
IN va_list args)
|
||||
{
|
||||
INT nLength;
|
||||
COORD coPos;
|
||||
DWORD Written;
|
||||
CHAR Buffer[128];
|
||||
|
||||
vsprintf(Buffer, fmt, args);
|
||||
memset(Buffer, ' ', min(sizeof(Buffer), xScreen));
|
||||
nLength = vsprintf(&Buffer[x], fmt, args);
|
||||
ASSERT(x + nLength < sizeof(Buffer));
|
||||
Buffer[x + nLength] = ' ';
|
||||
|
||||
coPos.X = 0;
|
||||
coPos.Y = yScreen - 1;
|
||||
|
||||
FillConsoleOutputAttribute(StdOutput,
|
||||
BACKGROUND_WHITE,
|
||||
xScreen,
|
||||
coPos,
|
||||
&Written);
|
||||
|
||||
FillConsoleOutputCharacterA(StdOutput,
|
||||
' ',
|
||||
xScreen,
|
||||
coPos,
|
||||
&Written);
|
||||
|
||||
coPos.X = x;
|
||||
|
||||
WriteConsoleOutputCharacterA(StdOutput,
|
||||
Buffer,
|
||||
(ULONG)strlen(Buffer),
|
||||
min(sizeof(Buffer), xScreen),
|
||||
coPos,
|
||||
&Written);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue