mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 08:25:03 +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 BitsPerPixel,
|
||||||
_In_ ULONG Delta)
|
_In_ ULONG Delta)
|
||||||
{
|
{
|
||||||
ULONG sx, dx, dy;
|
ULONG X, Y, Pixel;
|
||||||
UCHAR color;
|
UCHAR Colors;
|
||||||
ULONG offset = 0;
|
PUCHAR InputBuffer;
|
||||||
const ULONG Bottom = Top + Height;
|
const ULONG Bottom = Top + Height;
|
||||||
const ULONG Right = Left + Width;
|
const ULONG Right = Left + Width;
|
||||||
|
|
||||||
|
@ -82,24 +82,28 @@ BitBlt(
|
||||||
PrepareForSetPixel();
|
PrepareForSetPixel();
|
||||||
|
|
||||||
/* 4bpp blitting */
|
/* 4bpp blitting */
|
||||||
for (dy = Top; dy < Bottom; ++dy)
|
for (Y = Top; Y < Bottom; ++Y)
|
||||||
{
|
{
|
||||||
sx = 0;
|
InputBuffer = Buffer;
|
||||||
do
|
|
||||||
|
for (X = Left, Pixel = 0;
|
||||||
|
X < Right;
|
||||||
|
++X, ++Pixel)
|
||||||
{
|
{
|
||||||
/* Extract color */
|
if (Pixel % 2 == 0)
|
||||||
color = Buffer[offset + sx];
|
{
|
||||||
|
/* Extract colors at every two pixels */
|
||||||
|
Colors = *InputBuffer++;
|
||||||
|
|
||||||
/* Calc destination x */
|
SetPixel(X, Y, Colors >> 4);
|
||||||
dx = Left + (sx << 1);
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SetPixel(X, Y, Colors & 0x0F);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Set two pixels */
|
Buffer += Delta;
|
||||||
SetPixel(dx, dy, color >> 4);
|
|
||||||
SetPixel(dx + 1, dy, color & 0x0F);
|
|
||||||
|
|
||||||
sx++;
|
|
||||||
} while (dx < Right);
|
|
||||||
offset += Delta;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue