mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 09:43:04 +00:00
More bitmap format translation bugs
svn path=/trunk/; revision=5951
This commit is contained in:
parent
f62b36b0f1
commit
cbd7a663c8
2 changed files with 51 additions and 20 deletions
|
@ -42,18 +42,12 @@ BOOL
|
||||||
DIBtoVGA(SURFOBJ *Dest, SURFOBJ *Source, XLATEOBJ *ColorTranslation,
|
DIBtoVGA(SURFOBJ *Dest, SURFOBJ *Source, XLATEOBJ *ColorTranslation,
|
||||||
RECTL *DestRect, POINTL *SourcePoint)
|
RECTL *DestRect, POINTL *SourcePoint)
|
||||||
{
|
{
|
||||||
LONG i, j, dx, dy, alterx, altery, idxColor, RGBulong = 0, c8;
|
LONG dx, dy;
|
||||||
BYTE *GDIpos, *initial, *tMask, *lMask;
|
|
||||||
|
|
||||||
GDIpos = Source->pvScan0;
|
|
||||||
|
|
||||||
dx = DestRect->right - DestRect->left;
|
dx = DestRect->right - DestRect->left;
|
||||||
dy = DestRect->bottom - DestRect->top;
|
dy = DestRect->bottom - DestRect->top;
|
||||||
|
|
||||||
alterx = abs(SourcePoint->x - DestRect->left);
|
if (NULL == ColorTranslation || 0 != (ColorTranslation->flXlate & XO_TRIVIAL))
|
||||||
altery = abs(SourcePoint->y - DestRect->top);
|
|
||||||
|
|
||||||
if (NULL == ColorTranslation)
|
|
||||||
{
|
{
|
||||||
DIB_BltToVGA(DestRect->left, DestRect->top, dx, dy,
|
DIB_BltToVGA(DestRect->left, DestRect->top, dx, dy,
|
||||||
Source->pvScan0 + SourcePoint->y * Source->lDelta + (SourcePoint->x >> 1),
|
Source->pvScan0 + SourcePoint->y * Source->lDelta + (SourcePoint->x >> 1),
|
||||||
|
@ -62,18 +56,9 @@ DIBtoVGA(SURFOBJ *Dest, SURFOBJ *Source, XLATEOBJ *ColorTranslation,
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Perform color translation */
|
/* Perform color translation */
|
||||||
for (j = SourcePoint->y; j < SourcePoint->y+dy; j++)
|
DIB_BltToVGAWithXlate(DestRect->left, DestRect->top, dx, dy,
|
||||||
{
|
Source->pvScan0 + SourcePoint->y * Source->lDelta + (SourcePoint->x >> 1),
|
||||||
initial = GDIpos;
|
Source->lDelta, ColorTranslation);
|
||||||
|
|
||||||
for (i=SourcePoint->x; i<SourcePoint->x+dx; i++)
|
|
||||||
{
|
|
||||||
idxColor = XLATEOBJ_iXlate(ColorTranslation, *GDIpos);
|
|
||||||
vgaPutPixel(i+alterx, j+altery, idxColor);
|
|
||||||
GDIpos+=1;
|
|
||||||
}
|
|
||||||
GDIpos = initial + Source->lDelta;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -573,6 +573,52 @@ void DIB_BltToVGA(int x, int y, int w, int h, void *b, int Source_lDelta)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* DIB blt to the VGA. */
|
||||||
|
void DIB_BltToVGAWithXlate(int x, int y, int w, int h, void *b, int Source_lDelta, PXLATEOBJ Xlate)
|
||||||
|
{
|
||||||
|
PBYTE pb, opb = b;
|
||||||
|
ULONG i, j;
|
||||||
|
ULONG x2 = x + w;
|
||||||
|
ULONG y2 = y + h;
|
||||||
|
ULONG offset;
|
||||||
|
UCHAR a;
|
||||||
|
|
||||||
|
for (i = x; i < x2; i++)
|
||||||
|
{
|
||||||
|
pb = opb;
|
||||||
|
offset = xconv[i] + y80[y];
|
||||||
|
|
||||||
|
WRITE_PORT_UCHAR((PUCHAR)GRA_I, 0x08); // set the mask
|
||||||
|
WRITE_PORT_UCHAR((PUCHAR)GRA_D, maskbit[i]);
|
||||||
|
|
||||||
|
if (0 == ((i - x) % 2))
|
||||||
|
{
|
||||||
|
for (j = y; j < y2; j++)
|
||||||
|
{
|
||||||
|
a = READ_REGISTER_UCHAR(vidmem + offset);
|
||||||
|
WRITE_REGISTER_UCHAR(vidmem + offset, XLATEOBJ_iXlate(Xlate, (*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, XLATEOBJ_iXlate(Xlate, *pb & 0x0f));
|
||||||
|
offset += 80;
|
||||||
|
pb += Source_lDelta;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (0 != ((i - x) % 2))
|
||||||
|
{
|
||||||
|
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)
|
||||||
|
|
||||||
// DIB blt to the VGA.
|
// DIB blt to the VGA.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue