implemented TransparentBlt() on 8bpp surfaces

svn path=/trunk/; revision=8995
This commit is contained in:
Thomas Bluemel 2004-04-06 23:05:36 +00:00
parent 6d0d4f988e
commit 6701beb03a
4 changed files with 76 additions and 13 deletions

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: dib16bpp.c,v 1.24 2004/04/06 21:53:48 weiden Exp $ */
/* $Id: dib16bpp.c,v 1.25 2004/04/06 23:05:36 weiden Exp $ */
#undef WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <stdlib.h>
@ -607,8 +607,7 @@ DIB_16BPP_TransparentBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
RECTL* DestRect, POINTL *SourcePoint,
XLATEOBJ *ColorTranslation, ULONG iTransColor)
{
ULONG X, Y, SourceX, SourceY, Source, wd, Dest;
LONG RoundedRight;
ULONG RoundedRight, X, Y, SourceX, SourceY, Source, wd, Dest;
ULONG *DestBits;
RoundedRight = DestRect->right - ((DestRect->right - DestRect->left) & 0x1);
@ -616,7 +615,7 @@ DIB_16BPP_TransparentBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
DestBits = (ULONG*)(DestSurf->pvScan0 +
(DestRect->left << 1) +
DestRect->top * DestSurf->lDelta);
wd = ((DestRect->right - DestRect->left) << 1) - DestSurf->lDelta;
wd = DestSurf->lDelta - ((DestRect->right - DestRect->left) << 1);
for(Y = DestRect->top; Y < DestRect->bottom; Y++)
{
@ -653,7 +652,7 @@ DIB_16BPP_TransparentBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
DestBits = (PULONG)((ULONG_PTR)DestBits + 2);
}
SourceY++;
DestBits = (ULONG*)((ULONG_PTR)DestBits - wd);
DestBits = (ULONG*)((ULONG_PTR)DestBits + wd);
}
return TRUE;

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: dib24bpp.c,v 1.20 2004/04/06 21:53:48 weiden Exp $ */
/* $Id: dib24bpp.c,v 1.21 2004/04/06 23:05:36 weiden Exp $ */
#undef WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <stdlib.h>
@ -374,7 +374,7 @@ DIB_24BPP_TransparentBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
DestBits = (BYTE*)(DestSurf->pvScan0 +
(DestRect->left << 2) +
DestRect->top * DestSurf->lDelta);
wd = ((DestRect->right - DestRect->left) << 2) - DestSurf->lDelta;
wd = DestSurf->lDelta - ((DestRect->right - DestRect->left) << 2);
for(Y = DestRect->top; Y < DestRect->bottom; Y++)
{
@ -391,7 +391,7 @@ DIB_24BPP_TransparentBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
}
SourceY++;
DestBits = (BYTE*)((ULONG_PTR)DestBits - wd);
DestBits = (BYTE*)((ULONG_PTR)DestBits + wd);
}
return TRUE;

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: dib32bpp.c,v 1.20 2004/04/06 21:53:48 weiden Exp $ */
/* $Id: dib32bpp.c,v 1.21 2004/04/06 23:05:36 weiden Exp $ */
#undef WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <stdlib.h>
@ -579,7 +579,7 @@ DIB_32BPP_TransparentBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
DestBits = (ULONG*)(DestSurf->pvScan0 +
(DestRect->left << 2) +
DestRect->top * DestSurf->lDelta);
wd = ((DestRect->right - DestRect->left) << 2) - DestSurf->lDelta;
wd = DestSurf->lDelta - ((DestRect->right - DestRect->left) << 2);
for(Y = DestRect->top; Y < DestRect->bottom; Y++)
{
@ -594,7 +594,7 @@ DIB_32BPP_TransparentBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
}
SourceY++;
DestBits = (ULONG*)((ULONG_PTR)DestBits - wd);
DestBits = (ULONG*)((ULONG_PTR)DestBits + wd);
}
return TRUE;

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: dib8bpp.c,v 1.18 2004/04/06 17:54:32 weiden Exp $ */
/* $Id: dib8bpp.c,v 1.19 2004/04/06 23:05:36 weiden Exp $ */
#undef WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <stdlib.h>
@ -568,7 +568,71 @@ DIB_8BPP_TransparentBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
RECTL* DestRect, POINTL *SourcePoint,
XLATEOBJ *ColorTranslation, ULONG iTransColor)
{
return FALSE;
ULONG RoundedRight, X, Y, SourceX, SourceY, Source, wd, Dest;
ULONG *DestBits;
RoundedRight = DestRect->right - ((DestRect->right - DestRect->left) & 0x3);
SourceY = SourcePoint->y;
DestBits = (ULONG*)(DestSurf->pvScan0 + DestRect->left +
(DestRect->top * DestSurf->lDelta));
wd = DestSurf->lDelta - (DestRect->right - DestRect->left);
for(Y = DestRect->top; Y < DestRect->bottom; Y++)
{
DestBits = (ULONG*)(DestSurf->pvScan0 + DestRect->left +
(Y * DestSurf->lDelta));
SourceX = SourcePoint->x;
for (X = DestRect->left; X < RoundedRight; X += 4, DestBits++)
{
Dest = *DestBits;
Source = DIB_GetSourceIndex(SourceSurf, SourceGDI, SourceX++, SourceY);
if(Source != iTransColor)
{
Dest &= 0xFFFFFF00;
Dest |= (XLATEOBJ_iXlate(ColorTranslation, Source) & 0xFF);
}
Source = DIB_GetSourceIndex(SourceSurf, SourceGDI, SourceX++, SourceY);
if(Source != iTransColor)
{
Dest &= 0xFFFF00FF;
Dest |= ((XLATEOBJ_iXlate(ColorTranslation, Source) << 8) & 0xFF00);
}
Source = DIB_GetSourceIndex(SourceSurf, SourceGDI, SourceX++, SourceY);
if(Source != iTransColor)
{
Dest &= 0xFF00FFFF;
Dest |= ((XLATEOBJ_iXlate(ColorTranslation, Source) << 16) & 0xFF0000);
}
Source = DIB_GetSourceIndex(SourceSurf, SourceGDI, SourceX++, SourceY);
if(Source != iTransColor)
{
Dest &= 0x00FFFFFF;
Dest |= ((XLATEOBJ_iXlate(ColorTranslation, Source) << 24) & 0xFF000000);
}
*DestBits = Dest;
}
if(X < DestRect->right)
{
for (; X < DestRect->right; X++)
{
Source = DIB_GetSourceIndex(SourceSurf, SourceGDI, SourceX++, SourceY);
if(Source != iTransColor)
{
*((BYTE*)DestBits) = (BYTE)(XLATEOBJ_iXlate(ColorTranslation, Source) & 0xFF);
}
DestBits = (PULONG)((ULONG_PTR)DestBits + 1);
}
}
SourceY++;
}
return TRUE;
}
/* EOF */