mirror of
https://github.com/reactos/reactos.git
synced 2024-11-04 22:00:55 +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 LPCSTR fmt,
|
||||||
IN va_list args)
|
IN va_list args)
|
||||||
{
|
{
|
||||||
|
INT nLength;
|
||||||
COORD coPos;
|
COORD coPos;
|
||||||
DWORD Written;
|
DWORD Written;
|
||||||
CHAR Buffer[128];
|
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.X = 0;
|
||||||
coPos.Y = yScreen - 1;
|
coPos.Y = yScreen - 1;
|
||||||
|
|
||||||
FillConsoleOutputAttribute(StdOutput,
|
FillConsoleOutputAttribute(StdOutput,
|
||||||
BACKGROUND_WHITE,
|
BACKGROUND_WHITE,
|
||||||
xScreen,
|
xScreen,
|
||||||
coPos,
|
coPos,
|
||||||
&Written);
|
&Written);
|
||||||
|
|
||||||
FillConsoleOutputCharacterA(StdOutput,
|
|
||||||
' ',
|
|
||||||
xScreen,
|
|
||||||
coPos,
|
|
||||||
&Written);
|
|
||||||
|
|
||||||
coPos.X = x;
|
|
||||||
|
|
||||||
WriteConsoleOutputCharacterA(StdOutput,
|
WriteConsoleOutputCharacterA(StdOutput,
|
||||||
Buffer,
|
Buffer,
|
||||||
(ULONG)strlen(Buffer),
|
min(sizeof(Buffer), xScreen),
|
||||||
coPos,
|
coPos,
|
||||||
&Written);
|
&Written);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue