mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 20:35:43 +00:00
Fix border case and improve speed
svn path=/trunk/; revision=5483
This commit is contained in:
parent
f4de5cad85
commit
f223051440
1 changed files with 40 additions and 38 deletions
|
@ -518,7 +518,7 @@ void DIB_BltFromVGA(int x, int y, int w, int h, void *b, int Dest_lDelta)
|
||||||
if(edgePixel == TRUE)
|
if(edgePixel == TRUE)
|
||||||
{
|
{
|
||||||
b1 = vgaGetPixel(x2, j);
|
b1 = vgaGetPixel(x2, j);
|
||||||
*pb = b1;
|
*pb = b1 << 4;
|
||||||
pb++;
|
pb++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -528,48 +528,50 @@ void DIB_BltFromVGA(int x, int y, int w, int h, void *b, int Dest_lDelta)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* DIB blt to the VGA. */
|
||||||
void DIB_BltToVGA(int x, int y, int w, int h, void *b, int Source_lDelta)
|
void DIB_BltToVGA(int x, int y, int w, int h, void *b, int Source_lDelta)
|
||||||
|
|
||||||
// DIB blt to the VGA.
|
|
||||||
// For now we just do slow writes -- pixel by pixel, packing each one into the correct 4BPP format.
|
|
||||||
{
|
{
|
||||||
PBYTE pb = b, opb = b;
|
PBYTE pb, opb = b;
|
||||||
BOOLEAN edgePixel = FALSE;
|
ULONG i, j;
|
||||||
ULONG i, j;
|
ULONG x2 = x + w;
|
||||||
ULONG x2 = x + w;
|
ULONG y2 = y + h;
|
||||||
ULONG y2 = y + h;
|
ULONG offset;
|
||||||
BYTE b1, b2;
|
UCHAR a;
|
||||||
|
|
||||||
// Check if the width is odd
|
for (i = x; i < x2; i++)
|
||||||
if(mod(w, 2)>0)
|
|
||||||
{
|
|
||||||
edgePixel = TRUE;
|
|
||||||
x2 -= 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (j=y; j<y2; j++)
|
|
||||||
{
|
|
||||||
for (i=x; i<x2; i+=2)
|
|
||||||
{
|
{
|
||||||
b1 = (*pb & 0xf0) >> 4;
|
pb = opb;
|
||||||
b2 = *pb & 0x0f;
|
offset = xconv[i] + y80[y];
|
||||||
vgaPutPixel(i, j, b1);
|
|
||||||
vgaPutPixel(i+1, j, b2);
|
WRITE_PORT_UCHAR((PUCHAR)0x3ce, 0x08); // set the mask
|
||||||
pb++;
|
WRITE_PORT_UCHAR((PUCHAR)0x3cf, maskbit[i]);
|
||||||
|
|
||||||
|
if (0 == ((i - x) % 2))
|
||||||
|
{
|
||||||
|
for (j = y; j < y2; j++)
|
||||||
|
{
|
||||||
|
a = READ_REGISTER_UCHAR(vidmem + offset);
|
||||||
|
WRITE_REGISTER_UCHAR(vidmem + offset, (*pb & 0xf0) >> 4);
|
||||||
|
offset += 80;
|
||||||
|
pb += Source_lDelta;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for (j = y; j < y2; j++)
|
||||||
|
{
|
||||||
|
a = READ_REGISTER_UCHAR(vidmem + offset);
|
||||||
|
WRITE_REGISTER_UCHAR(vidmem + offset, *pb & 0x0f);
|
||||||
|
offset += 80;
|
||||||
|
pb += Source_lDelta;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (0 != ((i - x) % 2))
|
||||||
|
{
|
||||||
|
opb++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(edgePixel == TRUE)
|
|
||||||
{
|
|
||||||
b1 = *pb;
|
|
||||||
vgaPutPixel(x2, j, b1);
|
|
||||||
pb++;
|
|
||||||
}
|
|
||||||
|
|
||||||
opb += Source_lDelta;
|
|
||||||
|
|
||||||
pb = opb;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void DIB_TransparentBltToVGA(int x, int y, int w, int h, void *b, int Source_lDelta, ULONG trans)
|
void DIB_TransparentBltToVGA(int x, int y, int w, int h, void *b, int Source_lDelta, ULONG trans)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue