implement strechblt for all 8bpp this code are not optimze.

tested with winquake 8bpp to 16/32bpp. 
/* FIXME :  MaskOrigin, BrushOrigin, ClipRegion, Mode ? */
/* This is a reference implementation, it hasn't been optimized for speed */

svn path=/trunk/; revision=15697
This commit is contained in:
Magnus Olsen 2005-05-31 14:11:02 +00:00
parent 48af34a807
commit e79b3bf80c
6 changed files with 1073 additions and 28 deletions

View file

@ -617,21 +617,176 @@ BOOLEAN DIB_16BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
CLIPOBJ *ClipRegion, XLATEOBJ *ColorTranslation, CLIPOBJ *ClipRegion, XLATEOBJ *ColorTranslation,
ULONG Mode) ULONG Mode)
{ {
int SrcSizeY;
int SrcSizeX;
int DesSizeY;
int DesSizeX;
int sx;
int sy;
int DesX;
int DesY;
int color;
DPRINT("DIB_16BPP_StretchBlt: Source BPP: %u, srcRect: (%d,%d)-(%d,%d), dstRect: (%d,%d)-(%d,%d)\n", DPRINT("DIB_16BPP_StretchBlt: Source BPP: %u, srcRect: (%d,%d)-(%d,%d), dstRect: (%d,%d)-(%d,%d)\n",
BitsPerFormat(SourceSurf->iBitmapFormat), SourceRect->left, SourceRect->top, SourceRect->right, SourceRect->bottom, BitsPerFormat(SourceSurf->iBitmapFormat), SourceRect->left, SourceRect->top, SourceRect->right, SourceRect->bottom,
DestRect->left, DestRect->top, DestRect->right, DestRect->bottom); DestRect->left, DestRect->top, DestRect->right, DestRect->bottom);
SrcSizeY = SourceRect->bottom;
SrcSizeX = SourceRect->right;
DesSizeY = DestRect->bottom;
DesSizeX = DestRect->right;
switch(SourceSurf->iBitmapFormat) switch(SourceSurf->iBitmapFormat)
{ {
case BMF_1BPP: case BMF_1BPP:
case BMF_4BPP: /* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */
case BMF_8BPP: /* This is a reference implementation, it hasn't been optimized for speed */
case BMF_24BPP:
case BMF_32BPP: for (DesY=0; DesY<DestRect->bottom; DesY++)
/* Not implemented yet. */ {
return FALSE; if (DesSizeY>SrcSizeY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
for (DesX=0; DesX<DestRect->right; DesX++)
{
if (DesSizeY>SrcSizeY)
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
else
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
if(DIB_1BPP_GetPixel(SourceSurf, sx, sy) == 0)
{
DIB_16BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, 0));
} else {
DIB_16BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, 1));
}
}
}
break; break;
case BMF_4BPP:
/* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */
/* This is a reference implementation, it hasn't been optimized for speed */
for (DesY=0; DesY<DestRect->bottom; DesY++)
{
if (DesSizeY>SrcSizeY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
for (DesX=0; DesX<DestRect->right; DesX++)
{
if (DesSizeY>SrcSizeY)
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
else
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = DIB_4BPP_GetPixel(SourceSurf, sx, sy);
DIB_16BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
}
}
break;
case BMF_8BPP:
/* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */
/* This is a reference implementation, it hasn't been optimized for speed */
for (DesY=0; DesY<DestRect->bottom; DesY++)
{
if (DesSizeY>SrcSizeY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
for (DesX=0; DesX<DestRect->right; DesX++)
{
if (DesSizeY>SrcSizeY)
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
else
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = DIB_8BPP_GetPixel(SourceSurf, sx, sy);
DIB_16BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
}
}
break;
case BMF_24BPP:
/* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */
/* This is a reference implementation, it hasn't been optimized for speed */
for (DesY=0; DesY<DestRect->bottom; DesY++)
{
if (DesSizeY>SrcSizeY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
for (DesX=0; DesX<DestRect->right; DesX++)
{
if (DesSizeY>SrcSizeY)
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
else
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = DIB_24BPP_GetPixel(SourceSurf, sx, sy);
DIB_16BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
}
}
break;
case BMF_32BPP:
/* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */
/* This is a reference implementation, it hasn't been optimized for speed */
for (DesY=0; DesY<DestRect->bottom; DesY++)
{
if (DesSizeY>SrcSizeY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
for (DesX=0; DesX<DestRect->right; DesX++)
{
if (DesSizeY>SrcSizeY)
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
else
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = DIB_16BPP_GetPixel(SourceSurf, sx, sy);
DIB_32BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
}
}
break;
case BMF_16BPP: case BMF_16BPP:
return ScaleRectAvg16(DestSurf, SourceSurf, DestRect, SourceRect, MaskOrigin, BrushOrigin, return ScaleRectAvg16(DestSurf, SourceSurf, DestRect, SourceRect, MaskOrigin, BrushOrigin,
ClipRegion, ColorTranslation, Mode); ClipRegion, ColorTranslation, Mode);

View file

@ -478,16 +478,208 @@ DIB_1BPP_BitBlt(PBLTINFO BltInfo)
return TRUE; return TRUE;
} }
BOOLEAN //NOTE: If you change something here, please do the same in other dibXXbpp.c files!
DIB_1BPP_StretchBlt ( BOOLEAN DIB_1BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
SURFOBJ *DestSurf, SURFOBJ *SourceSurf, RECTL* DestRect, RECTL *SourceRect,
RECTL* DestRect, RECTL *SourceRect, POINTL* MaskOrigin, POINTL BrushOrigin,
POINTL* MaskOrigin, POINTL BrushOrigin, CLIPOBJ *ClipRegion, XLATEOBJ *ColorTranslation,
CLIPOBJ *ClipRegion, XLATEOBJ *ColorTranslation, ULONG Mode)
ULONG Mode)
{ {
DbgPrint("DIB_1BPP_StretchBlt: Source BPP: %u\n", BitsPerFormat(SourceSurf->iBitmapFormat)); int SrcSizeY;
return FALSE; int SrcSizeX;
int DesSizeY;
int DesSizeX;
int sx;
int sy;
int DesX;
int DesY;
int color;
SrcSizeY = SourceRect->bottom;
SrcSizeX = SourceRect->right;
DesSizeY = DestRect->bottom;
DesSizeX = DestRect->right;
switch(SourceSurf->iBitmapFormat)
{
case BMF_1BPP:
/* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */
/* This is a reference implementation, it hasn't been optimized for speed */
for (DesY=0; DesY<DestRect->bottom; DesY++)
{
if (DesSizeY>SrcSizeY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
for (DesX=0; DesX<DestRect->right; DesX++)
{
if (DesSizeY>SrcSizeY)
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
else
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = DIB_1BPP_GetPixel(SourceSurf, sx, sy);
DIB_1BPP_PutPixel(DestSurf, DesX, DesY, color);
}
}
break;
case BMF_4BPP:
/* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */
/* This is a reference implementation, it hasn't been optimized for speed */
for (DesY=0; DesY<DestRect->bottom; DesY++)
{
if (DesSizeY>SrcSizeY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
for (DesX=0; DesX<DestRect->right; DesX++)
{
if (DesSizeY>SrcSizeY)
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
else
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = DIB_4BPP_GetPixel(SourceSurf, sx, sy);
DIB_1BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
}
}
break;
case BMF_8BPP:
/* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */
/* This is a reference implementation, it hasn't been optimized for speed */
for (DesY=0; DesY<DestRect->bottom; DesY++)
{
if (DesSizeY>SrcSizeY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
for (DesX=0; DesX<DestRect->right; DesX++)
{
if (DesSizeY>SrcSizeY)
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
else
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = DIB_8BPP_GetPixel(SourceSurf, sx, sy);
DIB_1BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
}
}
break;
case BMF_16BPP:
/* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */
/* This is a reference implementation, it hasn't been optimized for speed */
for (DesY=0; DesY<DestRect->bottom; DesY++)
{
if (DesSizeY>SrcSizeY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
for (DesX=0; DesX<DestRect->right; DesX++)
{
if (DesSizeY>SrcSizeY)
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
else
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = DIB_16BPP_GetPixel(SourceSurf, sx, sy);
DIB_1BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
}
}
break;
case BMF_24BPP:
/* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */
/* This is a reference implementation, it hasn't been optimized for speed */
for (DesY=0; DesY<DestRect->bottom; DesY++)
{
if (DesSizeY>SrcSizeY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
for (DesX=0; DesX<DestRect->right; DesX++)
{
if (DesSizeY>SrcSizeY)
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
else
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = DIB_24BPP_GetPixel(SourceSurf, sx, sy);
DIB_1BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
}
}
break;
case BMF_32BPP:
/* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */
/* This is a reference implementation, it hasn't been optimized for speed */
for (DesY=0; DesY<DestRect->bottom; DesY++)
{
if (DesSizeY>SrcSizeY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
for (DesX=0; DesX<DestRect->right; DesX++)
{
if (DesSizeY>SrcSizeY)
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
else
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = DIB_32BPP_GetPixel(SourceSurf, sx, sy);
DIB_1BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
}
}
break;
default:
//DPRINT1("DIB_4BPP_StretchBlt: Unhandled Source BPP: %u\n", BitsPerFormat(SourceSurf->iBitmapFormat));
return FALSE;
}
return TRUE;
} }
BOOLEAN BOOLEAN

View file

@ -302,14 +302,211 @@ DIB_24BPP_BitBlt(PBLTINFO BltInfo)
return TRUE; return TRUE;
} }
//NOTE: If you change something here, please do the same in other dibXXbpp.c files!
BOOLEAN DIB_24BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, BOOLEAN DIB_24BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
RECTL* DestRect, RECTL *SourceRect, RECTL* DestRect, RECTL *SourceRect,
POINTL* MaskOrigin, POINTL BrushOrigin, POINTL* MaskOrigin, POINTL BrushOrigin,
CLIPOBJ *ClipRegion, XLATEOBJ *ColorTranslation, CLIPOBJ *ClipRegion, XLATEOBJ *ColorTranslation,
ULONG Mode) ULONG Mode)
{ {
DbgPrint("DIB_24BPP_StretchBlt: Source BPP: %u\n", BitsPerFormat(SourceSurf->iBitmapFormat)); int SrcSizeY;
return FALSE; int SrcSizeX;
int DesSizeY;
int DesSizeX;
int sx;
int sy;
int DesX;
int DesY;
int color;
SrcSizeY = SourceRect->bottom;
SrcSizeX = SourceRect->right;
DesSizeY = DestRect->bottom;
DesSizeX = DestRect->right;
switch(SourceSurf->iBitmapFormat)
{
case BMF_1BPP:
/* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */
/* This is a reference implementation, it hasn't been optimized for speed */
for (DesY=0; DesY<DestRect->bottom; DesY++)
{
if (DesSizeY>SrcSizeY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
for (DesX=0; DesX<DestRect->right; DesX++)
{
if (DesSizeY>SrcSizeY)
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
else
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
if(DIB_1BPP_GetPixel(SourceSurf, sx, sy) == 0)
{
DIB_24BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, 0));
} else {
DIB_24BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, 1));
}
}
}
break;
case BMF_4BPP:
/* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */
/* This is a reference implementation, it hasn't been optimized for speed */
for (DesY=0; DesY<DestRect->bottom; DesY++)
{
if (DesSizeY>SrcSizeY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
for (DesX=0; DesX<DestRect->right; DesX++)
{
if (DesSizeY>SrcSizeY)
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
else
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = DIB_4BPP_GetPixel(SourceSurf, sx, sy);
DIB_24BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
}
}
break;
case BMF_8BPP:
/* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */
/* This is a reference implementation, it hasn't been optimized for speed */
for (DesY=0; DesY<DestRect->bottom; DesY++)
{
if (DesSizeY>SrcSizeY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
for (DesX=0; DesX<DestRect->right; DesX++)
{
if (DesSizeY>SrcSizeY)
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
else
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = DIB_8BPP_GetPixel(SourceSurf, sx, sy);
DIB_24BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
}
}
break;
case BMF_16BPP:
/* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */
/* This is a reference implementation, it hasn't been optimized for speed */
for (DesY=0; DesY<DestRect->bottom; DesY++)
{
if (DesSizeY>SrcSizeY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
for (DesX=0; DesX<DestRect->right; DesX++)
{
if (DesSizeY>SrcSizeY)
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
else
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = DIB_16BPP_GetPixel(SourceSurf, sx, sy);
DIB_24BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
}
}
break;
case BMF_24BPP:
/* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */
/* This is a reference implementation, it hasn't been optimized for speed */
for (DesY=0; DesY<DestRect->bottom; DesY++)
{
if (DesSizeY>SrcSizeY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
for (DesX=0; DesX<DestRect->right; DesX++)
{
if (DesSizeY>SrcSizeY)
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
else
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = DIB_24BPP_GetPixel(SourceSurf, sx, sy);
DIB_24BPP_PutPixel(DestSurf, DesX, DesY, color);
}
}
break;
case BMF_32BPP:
/* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */
/* This is a reference implementation, it hasn't been optimized for speed */
for (DesY=0; DesY<DestRect->bottom; DesY++)
{
if (DesSizeY>SrcSizeY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
for (DesX=0; DesX<DestRect->right; DesX++)
{
if (DesSizeY>SrcSizeY)
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
else
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = DIB_32BPP_GetPixel(SourceSurf, sx, sy);
DIB_24BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
}
}
break;
default:
//DPRINT1("DIB_24BPP_StretchBlt: Unhandled Source BPP: %u\n", BitsPerFormat(SourceSurf->iBitmapFormat));
return FALSE;
}
return TRUE;
} }
BOOLEAN BOOLEAN

View file

@ -79,6 +79,7 @@ DIB_32BPP_BitBltSrcCopy(PBLTINFO BltInfo)
switch(BltInfo->SourceSurface->iBitmapFormat) switch(BltInfo->SourceSurface->iBitmapFormat)
{ {
case BMF_1BPP: case BMF_1BPP:
sx = BltInfo->SourcePoint.x; sx = BltInfo->SourcePoint.x;
sy = BltInfo->SourcePoint.y; sy = BltInfo->SourcePoint.y;
@ -541,6 +542,7 @@ BOOLEAN ScaleRectAvg32(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
return TRUE; return TRUE;
} }
//NOTE: If you change something here, please do the same in other dibXXbpp.c files! //NOTE: If you change something here, please do the same in other dibXXbpp.c files!
BOOLEAN DIB_32BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, BOOLEAN DIB_32BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
RECTL* DestRect, RECTL *SourceRect, RECTL* DestRect, RECTL *SourceRect,
@ -548,19 +550,173 @@ BOOLEAN DIB_32BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
CLIPOBJ *ClipRegion, XLATEOBJ *ColorTranslation, CLIPOBJ *ClipRegion, XLATEOBJ *ColorTranslation,
ULONG Mode) ULONG Mode)
{ {
DPRINT("DIB_32BPP_StretchBlt: Source BPP: %u, srcRect: (%d,%d)-(%d,%d), dstRect: (%d,%d)-(%d,%d)\n",
int SrcSizeY;
int SrcSizeX;
int DesSizeY;
int DesSizeX;
int sx;
int sy;
int DesX;
int DesY;
int color;
DPRINT("DIB_32BPP_StretchBlt: Source BPP: %u, srcRect: (%d,%d)-(%d,%d), dstRect: (%d,%d)-(%d,%d)\n",
BitsPerFormat(SourceSurf->iBitmapFormat), SourceRect->left, SourceRect->top, SourceRect->right, SourceRect->bottom, BitsPerFormat(SourceSurf->iBitmapFormat), SourceRect->left, SourceRect->top, SourceRect->right, SourceRect->bottom,
DestRect->left, DestRect->top, DestRect->right, DestRect->bottom); DestRect->left, DestRect->top, DestRect->right, DestRect->bottom);
SrcSizeY = SourceRect->bottom;
SrcSizeX = SourceRect->right;
DesSizeY = DestRect->bottom;
DesSizeX = DestRect->right;
switch(SourceSurf->iBitmapFormat) switch(SourceSurf->iBitmapFormat)
{ {
case BMF_1BPP: case BMF_1BPP:
/* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */
/* This is a reference implementation, it hasn't been optimized for speed */
for (DesY=0; DesY<DestRect->bottom; DesY++)
{
if (DesSizeY>SrcSizeY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
for (DesX=0; DesX<DestRect->right; DesX++)
{
if (DesSizeY>SrcSizeY)
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
else
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
if(DIB_1BPP_GetPixel(SourceSurf, sx, sy) == 0)
{
DIB_32BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, 0));
} else {
DIB_32BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, 1));
}
}
}
break;
case BMF_4BPP: case BMF_4BPP:
case BMF_8BPP: /* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */
/* This is a reference implementation, it hasn't been optimized for speed */
for (DesY=0; DesY<DestRect->bottom; DesY++)
{
if (DesSizeY>SrcSizeY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
for (DesX=0; DesX<DestRect->right; DesX++)
{
if (DesSizeY>SrcSizeY)
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
else
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = DIB_4BPP_GetPixel(SourceSurf, sx, sy);
DIB_32BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
}
}
break;
case BMF_8BPP:
/* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */
/* This is a reference implementation, it hasn't been optimized for speed */
for (DesY=0; DesY<DestRect->bottom; DesY++)
{
if (DesSizeY>SrcSizeY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
for (DesX=0; DesX<DestRect->right; DesX++)
{
if (DesSizeY>SrcSizeY)
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
else
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = DIB_8BPP_GetPixel(SourceSurf, sx, sy);
DIB_32BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
}
}
break;
case BMF_16BPP: case BMF_16BPP:
/* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */
/* This is a reference implementation, it hasn't been optimized for speed */
for (DesY=0; DesY<DestRect->bottom; DesY++)
{
if (DesSizeY>SrcSizeY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
for (DesX=0; DesX<DestRect->right; DesX++)
{
if (DesSizeY>SrcSizeY)
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
else
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = DIB_16BPP_GetPixel(SourceSurf, sx, sy);
DIB_32BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
}
}
break;
case BMF_24BPP: case BMF_24BPP:
/* Not implemented yet. */ /* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */
return FALSE; /* This is a reference implementation, it hasn't been optimized for speed */
for (DesY=0; DesY<DestRect->bottom; DesY++)
{
if (DesSizeY>SrcSizeY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
for (DesX=0; DesX<DestRect->right; DesX++)
{
if (DesSizeY>SrcSizeY)
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
else
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = DIB_24BPP_GetPixel(SourceSurf, sx, sy);
DIB_32BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
}
}
break; break;
case BMF_32BPP: case BMF_32BPP:

View file

@ -356,14 +356,211 @@ DIB_4BPP_BitBlt(PBLTINFO BltInfo)
return TRUE; return TRUE;
} }
//NOTE: If you change something here, please do the same in other dibXXbpp.c files!
BOOLEAN DIB_4BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, BOOLEAN DIB_4BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
RECTL* DestRect, RECTL *SourceRect, RECTL* DestRect, RECTL *SourceRect,
POINTL* MaskOrigin, POINTL BrushOrigin, POINTL* MaskOrigin, POINTL BrushOrigin,
CLIPOBJ *ClipRegion, XLATEOBJ *ColorTranslation, CLIPOBJ *ClipRegion, XLATEOBJ *ColorTranslation,
ULONG Mode) ULONG Mode)
{ {
DbgPrint("DIB_4BPP_StretchBlt: Source BPP: %u\n", BitsPerFormat(SourceSurf->iBitmapFormat)); int SrcSizeY;
return FALSE; int SrcSizeX;
int DesSizeY;
int DesSizeX;
int sx;
int sy;
int DesX;
int DesY;
int color;
SrcSizeY = SourceRect->bottom;
SrcSizeX = SourceRect->right;
DesSizeY = DestRect->bottom;
DesSizeX = DestRect->right;
switch(SourceSurf->iBitmapFormat)
{
case BMF_1BPP:
/* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */
/* This is a reference implementation, it hasn't been optimized for speed */
for (DesY=0; DesY<DestRect->bottom; DesY++)
{
if (DesSizeY>SrcSizeY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
for (DesX=0; DesX<DestRect->right; DesX++)
{
if (DesSizeY>SrcSizeY)
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
else
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
if(DIB_1BPP_GetPixel(SourceSurf, sx, sy) == 0)
{
DIB_4BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, 0));
} else {
DIB_4BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, 1));
}
}
}
break;
case BMF_4BPP:
/* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */
/* This is a reference implementation, it hasn't been optimized for speed */
for (DesY=0; DesY<DestRect->bottom; DesY++)
{
if (DesSizeY>SrcSizeY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
for (DesX=0; DesX<DestRect->right; DesX++)
{
if (DesSizeY>SrcSizeY)
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
else
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = DIB_4BPP_GetPixel(SourceSurf, sx, sy);
DIB_4BPP_PutPixel(DestSurf, DesX, DesY, color);
}
}
break;
case BMF_8BPP:
/* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */
/* This is a reference implementation, it hasn't been optimized for speed */
for (DesY=0; DesY<DestRect->bottom; DesY++)
{
if (DesSizeY>SrcSizeY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
for (DesX=0; DesX<DestRect->right; DesX++)
{
if (DesSizeY>SrcSizeY)
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
else
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = DIB_8BPP_GetPixel(SourceSurf, sx, sy);
DIB_4BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
}
}
break;
case BMF_16BPP:
/* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */
/* This is a reference implementation, it hasn't been optimized for speed */
for (DesY=0; DesY<DestRect->bottom; DesY++)
{
if (DesSizeY>SrcSizeY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
for (DesX=0; DesX<DestRect->right; DesX++)
{
if (DesSizeY>SrcSizeY)
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
else
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = DIB_16BPP_GetPixel(SourceSurf, sx, sy);
DIB_4BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
}
}
break;
case BMF_24BPP:
/* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */
/* This is a reference implementation, it hasn't been optimized for speed */
for (DesY=0; DesY<DestRect->bottom; DesY++)
{
if (DesSizeY>SrcSizeY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
for (DesX=0; DesX<DestRect->right; DesX++)
{
if (DesSizeY>SrcSizeY)
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
else
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = DIB_24BPP_GetPixel(SourceSurf, sx, sy);
DIB_4BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
}
}
break;
case BMF_32BPP:
/* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */
/* This is a reference implementation, it hasn't been optimized for speed */
for (DesY=0; DesY<DestRect->bottom; DesY++)
{
if (DesSizeY>SrcSizeY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
for (DesX=0; DesX<DestRect->right; DesX++)
{
if (DesSizeY>SrcSizeY)
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
else
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = DIB_32BPP_GetPixel(SourceSurf, sx, sy);
DIB_4BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
}
}
break;
default:
//DPRINT1("DIB_4BPP_StretchBlt: Unhandled Source BPP: %u\n", BitsPerFormat(SourceSurf->iBitmapFormat));
return FALSE;
}
return TRUE;
} }
BOOLEAN BOOLEAN

View file

@ -534,25 +534,173 @@ BOOLEAN ScaleRectAvg8(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
return TRUE; return TRUE;
} }
//NOTE: If you change something here, please do the same in other dibXXbpp.c files!
BOOLEAN DIB_8BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf, BOOLEAN DIB_8BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
RECTL* DestRect, RECTL *SourceRect, RECTL* DestRect, RECTL *SourceRect,
POINTL* MaskOrigin, POINTL BrushOrigin, POINTL* MaskOrigin, POINTL BrushOrigin,
CLIPOBJ *ClipRegion, XLATEOBJ *ColorTranslation, CLIPOBJ *ClipRegion, XLATEOBJ *ColorTranslation,
ULONG Mode) ULONG Mode)
{ {
int SrcSizeY;
int SrcSizeX;
int DesSizeY;
int DesSizeX;
int sx;
int sy;
int DesX;
int DesY;
int color;
DPRINT("DIB_8BPP_StretchBlt: Source BPP: %u, srcRect: (%d,%d)-(%d,%d), dstRect: (%d,%d)-(%d,%d)\n", DPRINT("DIB_8BPP_StretchBlt: Source BPP: %u, srcRect: (%d,%d)-(%d,%d), dstRect: (%d,%d)-(%d,%d)\n",
BitsPerFormat(SourceSurf->iBitmapFormat), SourceRect->left, SourceRect->top, SourceRect->right, SourceRect->bottom, BitsPerFormat(SourceSurf->iBitmapFormat), SourceRect->left, SourceRect->top, SourceRect->right, SourceRect->bottom,
DestRect->left, DestRect->top, DestRect->right, DestRect->bottom); DestRect->left, DestRect->top, DestRect->right, DestRect->bottom);
switch(SourceSurf->iBitmapFormat) switch(SourceSurf->iBitmapFormat)
{ {
case BMF_1BPP: case BMF_1BPP:
/* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */
/* This is a reference implementation, it hasn't been optimized for speed */
for (DesY=0; DesY<DestRect->bottom; DesY++)
{
if (DesSizeY>SrcSizeY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
for (DesX=0; DesX<DestRect->right; DesX++)
{
if (DesSizeY>SrcSizeY)
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
else
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
if(DIB_1BPP_GetPixel(SourceSurf, sx, sy) == 0)
{
DIB_8BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, 0));
} else {
DIB_8BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, 1));
}
}
}
break;
case BMF_4BPP: case BMF_4BPP:
/* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */
/* This is a reference implementation, it hasn't been optimized for speed */
for (DesY=0; DesY<DestRect->bottom; DesY++)
{
if (DesSizeY>SrcSizeY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
for (DesX=0; DesX<DestRect->right; DesX++)
{
if (DesSizeY>SrcSizeY)
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
else
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = DIB_4BPP_GetPixel(SourceSurf, sx, sy);
DIB_8BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
}
}
break;
case BMF_16BPP: case BMF_16BPP:
/* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */
/* This is a reference implementation, it hasn't been optimized for speed */
for (DesY=0; DesY<DestRect->bottom; DesY++)
{
if (DesSizeY>SrcSizeY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
for (DesX=0; DesX<DestRect->right; DesX++)
{
if (DesSizeY>SrcSizeY)
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
else
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = DIB_16BPP_GetPixel(SourceSurf, sx, sy);
DIB_8BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
}
}
break;
case BMF_24BPP: case BMF_24BPP:
/* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */
/* This is a reference implementation, it hasn't been optimized for speed */
for (DesY=0; DesY<DestRect->bottom; DesY++)
{
if (DesSizeY>SrcSizeY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
for (DesX=0; DesX<DestRect->right; DesX++)
{
if (DesSizeY>SrcSizeY)
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
else
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = DIB_24BPP_GetPixel(SourceSurf, sx, sy);
DIB_8BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
}
}
break;
case BMF_32BPP: case BMF_32BPP:
/* Not implemented yet. */ /* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */
return FALSE; /* This is a reference implementation, it hasn't been optimized for speed */
for (DesY=0; DesY<DestRect->bottom; DesY++)
{
if (DesSizeY>SrcSizeY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
for (DesX=0; DesX<DestRect->right; DesX++)
{
if (DesSizeY>SrcSizeY)
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
else
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = DIB_32BPP_GetPixel(SourceSurf, sx, sy);
DIB_8BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
}
}
break; break;
case BMF_8BPP: case BMF_8BPP: