mirror of
https://github.com/Fennix-Project/Kernel.git
synced 2025-05-30 00:08:03 +00:00
Optimize Scroll() function
This commit is contained in:
parent
5ae9cbf27b
commit
78e1748233
@ -125,16 +125,11 @@ namespace Video
|
|||||||
|
|
||||||
if (Lines > 0)
|
if (Lines > 0)
|
||||||
{
|
{
|
||||||
for (uint32_t i = 0; i < this->CurrentFont->GetInfo().Height; i++) // TODO: Make this more efficient.
|
uint32_t LineSize = this->Buffers[Index]->Width * (this->framebuffer.BitsPerPixel / 8);
|
||||||
{
|
uint32_t BytesToMove = LineSize * Lines * this->CurrentFont->GetInfo().Height;
|
||||||
memmove(this->Buffers[Index]->Buffer,
|
uint32_t BytesToClear = this->Buffers[Index]->Size - BytesToMove;
|
||||||
(uint8_t *)this->Buffers[Index]->Buffer + (this->Buffers[Index]->Width * (this->framebuffer.BitsPerPixel / 8) * Lines),
|
memmove(this->Buffers[Index]->Buffer, (uint8_t *)this->Buffers[Index]->Buffer + BytesToMove, BytesToClear);
|
||||||
this->Buffers[Index]->Size - (this->Buffers[Index]->Width * (this->framebuffer.BitsPerPixel / 8) * Lines));
|
memset((uint8_t *)this->Buffers[Index]->Buffer + BytesToClear, 0, BytesToMove);
|
||||||
|
|
||||||
memset((uint8_t *)this->Buffers[Index]->Buffer + (this->Buffers[Index]->Size - (this->Buffers[Index]->Width * (this->framebuffer.BitsPerPixel / 8) * Lines)),
|
|
||||||
0,
|
|
||||||
this->Buffers[Index]->Width * (this->framebuffer.BitsPerPixel / 8) * Lines);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user