mirror of
https://github.com/reactos/reactos.git
synced 2025-02-20 15:35:04 +00:00
[BOOTVID] Fix BitBlt behavior (#2936)
This commit is contained in:
parent
da9384b918
commit
5d40981efa
1 changed files with 21 additions and 17 deletions
|
@ -55,9 +55,9 @@ BitBlt(
|
|||
_In_ ULONG BitsPerPixel,
|
||||
_In_ ULONG Delta)
|
||||
{
|
||||
ULONG sx, dx, dy;
|
||||
UCHAR color;
|
||||
ULONG offset = 0;
|
||||
ULONG X, Y, Pixel;
|
||||
UCHAR Colors;
|
||||
PUCHAR InputBuffer;
|
||||
const ULONG Bottom = Top + Height;
|
||||
const ULONG Right = Left + Width;
|
||||
|
||||
|
@ -82,24 +82,28 @@ BitBlt(
|
|||
PrepareForSetPixel();
|
||||
|
||||
/* 4bpp blitting */
|
||||
for (dy = Top; dy < Bottom; ++dy)
|
||||
for (Y = Top; Y < Bottom; ++Y)
|
||||
{
|
||||
sx = 0;
|
||||
do
|
||||
InputBuffer = Buffer;
|
||||
|
||||
for (X = Left, Pixel = 0;
|
||||
X < Right;
|
||||
++X, ++Pixel)
|
||||
{
|
||||
/* Extract color */
|
||||
color = Buffer[offset + sx];
|
||||
if (Pixel % 2 == 0)
|
||||
{
|
||||
/* Extract colors at every two pixels */
|
||||
Colors = *InputBuffer++;
|
||||
|
||||
/* Calc destination x */
|
||||
dx = Left + (sx << 1);
|
||||
SetPixel(X, Y, Colors >> 4);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetPixel(X, Y, Colors & 0x0F);
|
||||
}
|
||||
}
|
||||
|
||||
/* Set two pixels */
|
||||
SetPixel(dx, dy, color >> 4);
|
||||
SetPixel(dx + 1, dy, color & 0x0F);
|
||||
|
||||
sx++;
|
||||
} while (dx < Right);
|
||||
offset += Delta;
|
||||
Buffer += Delta;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue