mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
Fixed DIB_BltToVGA and other functions calling it to handle situation where SourcePoint->x % 2 != 0.
svn path=/trunk/; revision=6147
This commit is contained in:
parent
95d5d55bff
commit
afd54f8f9c
3 changed files with 48 additions and 44 deletions
|
@ -38,6 +38,8 @@ static BOOL FASTCALL VGADDI_IntersectRect(PRECTL prcDst, PRECTL prcSrc1, PRECTL
|
||||||
return(FALSE);
|
return(FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DIB_BltToVGA_Fixed(int x, int y, int w, int h, void *b, int Source_lDelta, int mod);
|
||||||
|
|
||||||
BOOL
|
BOOL
|
||||||
DIBtoVGA(SURFOBJ *Dest, SURFOBJ *Source, XLATEOBJ *ColorTranslation,
|
DIBtoVGA(SURFOBJ *Dest, SURFOBJ *Source, XLATEOBJ *ColorTranslation,
|
||||||
RECTL *DestRect, POINTL *SourcePoint)
|
RECTL *DestRect, POINTL *SourcePoint)
|
||||||
|
@ -51,7 +53,7 @@ DIBtoVGA(SURFOBJ *Dest, SURFOBJ *Source, XLATEOBJ *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),
|
||||||
Source->lDelta);
|
Source->lDelta, SourcePoint->x % 2);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -390,7 +392,7 @@ DrvBitBlt(SURFOBJ *Dest,
|
||||||
unsigned i;
|
unsigned i;
|
||||||
POINTL Pt;
|
POINTL Pt;
|
||||||
ULONG Direction;
|
ULONG Direction;
|
||||||
|
|
||||||
switch (rop4)
|
switch (rop4)
|
||||||
{
|
{
|
||||||
case BLACKNESS:
|
case BLACKNESS:
|
||||||
|
|
|
@ -1,39 +1,40 @@
|
||||||
#include "../vgaddi.h"
|
#include "../vgaddi.h"
|
||||||
#include "../vgavideo/vgavideo.h"
|
#include "../vgavideo/vgavideo.h"
|
||||||
|
|
||||||
#define DBG
|
#define DBG
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
|
||||||
BOOL STDCALL
|
BOOL STDCALL
|
||||||
DrvCopyBits(OUT PSURFOBJ DestObj,
|
DrvCopyBits(OUT PSURFOBJ DestObj,
|
||||||
IN PSURFOBJ SourceObj,
|
IN PSURFOBJ SourceObj,
|
||||||
IN PCLIPOBJ ClipObj,
|
IN PCLIPOBJ ClipObj,
|
||||||
IN PXLATEOBJ XLateObj,
|
IN PXLATEOBJ XLateObj,
|
||||||
IN PRECTL DestRectL,
|
IN PRECTL DestRectL,
|
||||||
IN PPOINTL SrcPointL)
|
IN PPOINTL SrcPointL)
|
||||||
{
|
{
|
||||||
BOOL Done = FALSE;
|
BOOL Done = FALSE;
|
||||||
|
|
||||||
if (STYPE_BITMAP == DestObj->iType && BMF_4BPP == DestObj->iBitmapFormat &&
|
if (STYPE_BITMAP == DestObj->iType && BMF_4BPP == DestObj->iBitmapFormat &&
|
||||||
STYPE_DEVICE == SourceObj->iType)
|
STYPE_DEVICE == SourceObj->iType)
|
||||||
{
|
{
|
||||||
/* Screen to 4 BPP DIB */
|
/* Screen to 4 BPP DIB */
|
||||||
DIB_BltFromVGA(SrcPointL->x, SrcPointL->y,
|
DIB_BltFromVGA(SrcPointL->x, SrcPointL->y,
|
||||||
DestRectL->right - DestRectL->left,
|
DestRectL->right - DestRectL->left,
|
||||||
DestRectL->bottom - DestRectL->top,
|
DestRectL->bottom - DestRectL->top,
|
||||||
DestObj->pvScan0, DestObj->lDelta);
|
DestObj->pvScan0, DestObj->lDelta);
|
||||||
Done = TRUE;
|
Done = TRUE;
|
||||||
}
|
}
|
||||||
else if (STYPE_DEVICE == DestObj->iType &&
|
else if (STYPE_DEVICE == DestObj->iType &&
|
||||||
STYPE_BITMAP == SourceObj->iType && BMF_4BPP == SourceObj->iBitmapFormat)
|
STYPE_BITMAP == SourceObj->iType && BMF_4BPP == SourceObj->iBitmapFormat)
|
||||||
{
|
{
|
||||||
/* 4 BPP DIB to Screen */
|
/* 4 BPP DIB to Screen */
|
||||||
DIB_BltToVGA(DestRectL->left, DestRectL->top,
|
DIB_BltToVGA(DestRectL->left, DestRectL->top,
|
||||||
DestRectL->right - DestRectL->left,
|
DestRectL->right - DestRectL->left,
|
||||||
DestRectL->bottom - DestRectL->top,
|
DestRectL->bottom - DestRectL->top,
|
||||||
SourceObj->pvScan0, SourceObj->lDelta);
|
SourceObj->pvScan0, SourceObj->lDelta,
|
||||||
Done = TRUE;
|
0);
|
||||||
}
|
Done = TRUE;
|
||||||
|
}
|
||||||
return Done;
|
|
||||||
}
|
return Done;
|
||||||
|
}
|
||||||
|
|
|
@ -528,7 +528,7 @@ void DIB_BltFromVGA(int x, int y, int w, int h, void *b, int Dest_lDelta)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* DIB blt to the VGA. */
|
/* 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, int StartMod)
|
||||||
{
|
{
|
||||||
PBYTE pb, opb = b;
|
PBYTE pb, opb = b;
|
||||||
ULONG i, j;
|
ULONG i, j;
|
||||||
|
@ -545,7 +545,7 @@ void DIB_BltToVGA(int x, int y, int w, int h, void *b, int Source_lDelta)
|
||||||
WRITE_PORT_UCHAR((PUCHAR)GRA_I, 0x08); // set the mask
|
WRITE_PORT_UCHAR((PUCHAR)GRA_I, 0x08); // set the mask
|
||||||
WRITE_PORT_UCHAR((PUCHAR)GRA_D, maskbit[i]);
|
WRITE_PORT_UCHAR((PUCHAR)GRA_D, maskbit[i]);
|
||||||
|
|
||||||
if (0 == ((i - x) % 2))
|
if (StartMod == ((i - x) % 2))
|
||||||
{
|
{
|
||||||
for (j = y; j < y2; j++)
|
for (j = y; j < y2; j++)
|
||||||
{
|
{
|
||||||
|
@ -566,13 +566,14 @@ void DIB_BltToVGA(int x, int y, int w, int h, void *b, int Source_lDelta)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (0 != ((i - x) % 2))
|
if (StartMod != ((i - x) % 2))
|
||||||
{
|
{
|
||||||
opb++;
|
opb++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* DIB blt to the VGA. */
|
/* DIB blt to the VGA. */
|
||||||
void DIB_BltToVGAWithXlate(int x, int y, int w, int h, void *b, int Source_lDelta, PXLATEOBJ Xlate)
|
void DIB_BltToVGAWithXlate(int x, int y, int w, int h, void *b, int Source_lDelta, PXLATEOBJ Xlate)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue