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:
Filip Navara 2003-09-26 18:38:47 +00:00
parent 95d5d55bff
commit afd54f8f9c
3 changed files with 48 additions and 44 deletions

View file

@ -38,6 +38,8 @@ static BOOL FASTCALL VGADDI_IntersectRect(PRECTL prcDst, PRECTL prcSrc1, PRECTL
return(FALSE);
}
void DIB_BltToVGA_Fixed(int x, int y, int w, int h, void *b, int Source_lDelta, int mod);
BOOL
DIBtoVGA(SURFOBJ *Dest, SURFOBJ *Source, XLATEOBJ *ColorTranslation,
RECTL *DestRect, POINTL *SourcePoint)
@ -51,7 +53,7 @@ DIBtoVGA(SURFOBJ *Dest, SURFOBJ *Source, XLATEOBJ *ColorTranslation,
{
DIB_BltToVGA(DestRect->left, DestRect->top, dx, dy,
Source->pvScan0 + SourcePoint->y * Source->lDelta + (SourcePoint->x >> 1),
Source->lDelta);
Source->lDelta, SourcePoint->x % 2);
}
else
{
@ -390,7 +392,7 @@ DrvBitBlt(SURFOBJ *Dest,
unsigned i;
POINTL Pt;
ULONG Direction;
switch (rop4)
{
case BLACKNESS:

View file

@ -1,39 +1,40 @@
#include "../vgaddi.h"
#include "../vgavideo/vgavideo.h"
#define DBG
#include <debug.h>
BOOL STDCALL
DrvCopyBits(OUT PSURFOBJ DestObj,
IN PSURFOBJ SourceObj,
IN PCLIPOBJ ClipObj,
IN PXLATEOBJ XLateObj,
IN PRECTL DestRectL,
IN PPOINTL SrcPointL)
{
BOOL Done = FALSE;
if (STYPE_BITMAP == DestObj->iType && BMF_4BPP == DestObj->iBitmapFormat &&
STYPE_DEVICE == SourceObj->iType)
{
/* Screen to 4 BPP DIB */
DIB_BltFromVGA(SrcPointL->x, SrcPointL->y,
DestRectL->right - DestRectL->left,
DestRectL->bottom - DestRectL->top,
DestObj->pvScan0, DestObj->lDelta);
Done = TRUE;
}
else if (STYPE_DEVICE == DestObj->iType &&
STYPE_BITMAP == SourceObj->iType && BMF_4BPP == SourceObj->iBitmapFormat)
{
/* 4 BPP DIB to Screen */
DIB_BltToVGA(DestRectL->left, DestRectL->top,
DestRectL->right - DestRectL->left,
DestRectL->bottom - DestRectL->top,
SourceObj->pvScan0, SourceObj->lDelta);
Done = TRUE;
}
return Done;
}
#include "../vgaddi.h"
#include "../vgavideo/vgavideo.h"
#define DBG
#include <debug.h>
BOOL STDCALL
DrvCopyBits(OUT PSURFOBJ DestObj,
IN PSURFOBJ SourceObj,
IN PCLIPOBJ ClipObj,
IN PXLATEOBJ XLateObj,
IN PRECTL DestRectL,
IN PPOINTL SrcPointL)
{
BOOL Done = FALSE;
if (STYPE_BITMAP == DestObj->iType && BMF_4BPP == DestObj->iBitmapFormat &&
STYPE_DEVICE == SourceObj->iType)
{
/* Screen to 4 BPP DIB */
DIB_BltFromVGA(SrcPointL->x, SrcPointL->y,
DestRectL->right - DestRectL->left,
DestRectL->bottom - DestRectL->top,
DestObj->pvScan0, DestObj->lDelta);
Done = TRUE;
}
else if (STYPE_DEVICE == DestObj->iType &&
STYPE_BITMAP == SourceObj->iType && BMF_4BPP == SourceObj->iBitmapFormat)
{
/* 4 BPP DIB to Screen */
DIB_BltToVGA(DestRectL->left, DestRectL->top,
DestRectL->right - DestRectL->left,
DestRectL->bottom - DestRectL->top,
SourceObj->pvScan0, SourceObj->lDelta,
0);
Done = TRUE;
}
return Done;
}

View file

@ -528,7 +528,7 @@ void DIB_BltFromVGA(int x, int y, int w, int h, void *b, int Dest_lDelta)
#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, int StartMod)
{
PBYTE pb, opb = b;
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_D, maskbit[i]);
if (0 == ((i - x) % 2))
if (StartMod == ((i - x) % 2))
{
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++;
}
}
}
/* DIB blt to the VGA. */
void DIB_BltToVGAWithXlate(int x, int y, int w, int h, void *b, int Source_lDelta, PXLATEOBJ Xlate)
{