small optimze for StretchBlt

Thanks Alex for the idea with neg for statement
it is still a ref implemnet and have some limits


svn path=/trunk/; revision=15716
This commit is contained in:
Magnus Olsen 2005-06-01 18:11:26 +00:00
parent 0e6919a8c0
commit 1983bc6012
6 changed files with 4013 additions and 1036 deletions

View file

@ -629,6 +629,9 @@ BOOLEAN DIB_16BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
int zoomX;
int zoomY;
int count;
int saveX;
int saveY;
BOOLEAN DesIsBiggerY=FALSE;
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,
@ -646,202 +649,656 @@ BOOLEAN DIB_16BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
zoomY = DesSizeY / SrcSizeY;
if (zoomY==0) zoomY=1;
if (DesSizeY>SrcSizeY)
DesIsBiggerY = TRUE;
switch(SourceSurf->iBitmapFormat)
{
case BMF_1BPP:
/* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */
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+=zoomY)
{
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+=zoomX)
if (zoomX>1)
{
/* Draw one Hline on X - Led to the Des Zoom In*/
if (DesSizeX>SrcSizeX)
{
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesSizeX>SrcSizeX)
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
if(DIB_1BPP_GetPixel(SourceSurf, sx, sy) == 0)
{
for (count=DesY;count<DesY+zoomY;count++)
{
if (zoomX>1)
DIB_16BPP_HLine(DestSurf, DesX, DesX + zoomX, count, XLATEOBJ_iXlate(ColorTranslation, 0));
else
DIB_16BPP_PutPixel(DestSurf, DesX, count, XLATEOBJ_iXlate(ColorTranslation, 0));
}
} else {
for (count=DesY;count<DesY+zoomY;count++)
{
if (zoomX>1)
DIB_16BPP_HLine(DestSurf, DesX, DesX + zoomX, count, XLATEOBJ_iXlate(ColorTranslation, 1));
else
DIB_16BPP_PutPixel(DestSurf, DesX, count, 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+=zoomY)
{
if (DesSizeY>SrcSizeY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=0; DesX<DestRect->right; DesX+=zoomX)
{
if (DesSizeX>SrcSizeX)
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (sx > SourceRect->right) break;
saveX = DesX + zoomX;
if (DIB_1BPP_GetPixel(SourceSurf, sx, sy) == 0)
for (count=DesY;count<saveY;count++)
DIB_16BPP_HLine(DestSurf, DesX, saveX, count, 0);
else
for (count=DesY;count<saveY;count++)
DIB_16BPP_HLine(DestSurf, DesX, saveX, count, 1);
}
}
}
else
{
/* Draw one Hline on X - Led to the Des Zoom Out*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = DIB_4BPP_GetPixel(SourceSurf, sx, sy);
if (sx > SourceRect->right) break;
for (count=DesY;count<DesY+zoomY;count++)
{
if (zoomX>1)
DIB_16BPP_HLine(DestSurf, DesX, DesX + zoomX, count, XLATEOBJ_iXlate(ColorTranslation, color));
else
DIB_16BPP_PutPixel(DestSurf, DesX, count, XLATEOBJ_iXlate(ColorTranslation, color));
}
saveX = DesX + zoomX;
}
}
break;
if (DIB_1BPP_GetPixel(SourceSurf, sx, sy) == 0)
for (count=DesY;count<saveY;count++)
DIB_16BPP_HLine(DestSurf, DesX, saveX, count, 0);
else
for (count=DesY;count<saveY;count++)
DIB_16BPP_HLine(DestSurf, DesX, saveX, count, 1);
}
}
}
}
else
{
if (DesSizeX>SrcSizeX)
{
/* Draw one pixel on X - Led to the Des Zoom In*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (sx > SourceRect->right) break;
if (DIB_1BPP_GetPixel(SourceSurf, sx, sy) == 0)
for (count=DesY;count<saveY;count++)
DIB_16BPP_PutPixel(DestSurf, DesX, count, 0);
else
for (count=DesY;count<saveY;count++)
DIB_16BPP_PutPixel(DestSurf, DesX, count, 1);
}
}
}
else
{
/* Draw one pixel on X - Led to the Des Zoom Out*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
if (DIB_1BPP_GetPixel(SourceSurf, sx, sy) == 0)
for (count=DesY;count<saveY;count++)
DIB_16BPP_PutPixel(DestSurf, DesX, count, 0);
else
for (count=DesY;count<saveY;count++)
DIB_16BPP_PutPixel(DestSurf, DesX, count, 1);
}
}
}
}
break;
case BMF_4BPP:
/* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */
/* This is a reference implementation, it hasn't been optimized for speed */
if (zoomX>1)
{
/* Draw one Hline on X - Led to the Des Zoom In*/
if (DesSizeX>SrcSizeX)
{
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_4BPP_GetPixel(SourceSurf, sx, sy));
saveX = DesX + zoomX;
for (count=DesY;count<saveY;count++)
DIB_16BPP_HLine(DestSurf, DesX, saveX, count, color);
}
}
}
else
{
/* Draw one Hline on X - Led to the Des Zoom Out*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_4BPP_GetPixel(SourceSurf, sx, sy));
saveX = DesX + zoomX;
for (count=DesY;count<saveY;count++)
DIB_16BPP_HLine(DestSurf, DesX, saveX, count, color);
}
}
}
}
else
{
if (DesSizeX>SrcSizeX)
{
/* Draw one pixel on X - Led to the Des Zoom In*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_4BPP_GetPixel(SourceSurf, sx, sy));
for (count=DesY;count<saveY;count++)
DIB_16BPP_PutPixel(DestSurf, DesX, count, color);
}
}
}
else
{
/* Draw one pixel on X - Led to the Des Zoom Out*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_4BPP_GetPixel(SourceSurf, sx, sy));
for (count=DesY;count<saveY;count++)
DIB_16BPP_PutPixel(DestSurf, DesX, count, 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+=zoomY)
{
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+=zoomX)
if (zoomX>1)
{
/* Draw one Hline on X - Led to the Des Zoom In*/
if (DesSizeX>SrcSizeX)
{
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesSizeX>SrcSizeX)
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_8BPP_GetPixel(SourceSurf, sx, sy));
saveX = DesX + zoomX;
for (count=DesY;count<saveY;count++)
DIB_16BPP_HLine(DestSurf, DesX, saveX, count, color);
}
}
}
else
{
/* Draw one Hline on X - Led to the Des Zoom Out*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_8BPP_GetPixel(SourceSurf, sx, sy));
saveX = DesX + zoomX;
for (count=DesY;count<saveY;count++)
DIB_16BPP_HLine(DestSurf, DesX, saveX, count, color);
}
}
}
}
else
{
if (DesSizeX>SrcSizeX)
{
/* Draw one pixel on X - Led to the Des Zoom In*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
color = DIB_8BPP_GetPixel(SourceSurf, sx, sy);
saveY = DesY+zoomY;
for (count=DesY;count<DesY+zoomY;count++)
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_8BPP_GetPixel(SourceSurf, sx, sy));
for (count=DesY;count<saveY;count++)
DIB_16BPP_PutPixel(DestSurf, DesX, count, color);
}
}
}
else
{
/* Draw one pixel on X - Led to the Des Zoom Out*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
if (zoomX>1)
DIB_16BPP_HLine(DestSurf, DesX, DesX + zoomX, count, XLATEOBJ_iXlate(ColorTranslation, color));
else
DIB_16BPP_PutPixel(DestSurf, DesX, count, XLATEOBJ_iXlate(ColorTranslation, color));
}
}
}
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_8BPP_GetPixel(SourceSurf, sx, sy));
for (count=DesY;count<saveY;count++)
DIB_16BPP_PutPixel(DestSurf, DesX, count, 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+=zoomY)
{
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+=zoomX)
{
if (DesSizeX>SrcSizeX)
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);
for (count=DesY;count<DesY+zoomY;count++)
{
if (zoomX>1)
DIB_16BPP_HLine(DestSurf, DesX, DesX + zoomX, count, XLATEOBJ_iXlate(ColorTranslation, color));
else
DIB_16BPP_PutPixel(DestSurf, DesX, count, 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+=zoomY)
{
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+=zoomX)
{
if (DesSizeX>SrcSizeX)
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);
for (count=DesY;count<DesY+zoomY;count++)
{
if (zoomX>1)
DIB_16BPP_HLine(DestSurf, DesX, DesX + zoomX, count, XLATEOBJ_iXlate(ColorTranslation, color));
else
DIB_16BPP_PutPixel(DestSurf, DesX, count, XLATEOBJ_iXlate(ColorTranslation, color));
}
}
}
break;
case BMF_16BPP:
return ScaleRectAvg16(DestSurf, SourceSurf, DestRect, SourceRect, MaskOrigin, BrushOrigin,
ClipRegion, ColorTranslation, Mode);
break;
case BMF_24BPP:
/* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */
/* This is a reference implementation, it hasn't been optimized for speed */
if (zoomX>1)
{
/* Draw one Hline on X - Led to the Des Zoom In*/
if (DesSizeX>SrcSizeX)
{
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_24BPP_GetPixel(SourceSurf, sx, sy));
saveX = DesX + zoomX;
for (count=DesY;count<saveY;count++)
DIB_16BPP_HLine(DestSurf, DesX, saveX, count, color);
}
}
}
else
{
/* Draw one Hline on X - Led to the Des Zoom Out*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_24BPP_GetPixel(SourceSurf, sx, sy));
saveX = DesX + zoomX;
for (count=DesY;count<saveY;count++)
DIB_16BPP_HLine(DestSurf, DesX, saveX, count, color);
}
}
}
}
else
{
if (DesSizeX>SrcSizeX)
{
/* Draw one pixel on X - Led to the Des Zoom In*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_24BPP_GetPixel(SourceSurf, sx, sy));
for (count=DesY;count<saveY;count++)
DIB_16BPP_PutPixel(DestSurf, DesX, count, color);
}
}
}
else
{
/* Draw one pixel on X - Led to the Des Zoom Out*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_24BPP_GetPixel(SourceSurf, sx, sy));
for (count=DesY;count<saveY;count++)
DIB_16BPP_PutPixel(DestSurf, DesX, count, color);
}
}
}
}
break;
case BMF_32BPP:
/* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */
/* This is a reference implementation, it hasn't been optimized for speed */
if (zoomX>1)
{
/* Draw one Hline on X - Led to the Des Zoom In*/
if (DesSizeX>SrcSizeX)
{
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_32BPP_GetPixel(SourceSurf, sx, sy));
saveX = DesX + zoomX;
for (count=DesY;count<saveY;count++)
DIB_16BPP_HLine(DestSurf, DesX, saveX, count, color);
}
}
}
else
{
/* Draw one Hline on X - Led to the Des Zoom Out*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_32BPP_GetPixel(SourceSurf, sx, sy));
saveX = DesX + zoomX;
for (count=DesY;count<saveY;count++)
DIB_16BPP_HLine(DestSurf, DesX, saveX, count, color);
}
}
}
}
else
{
if (DesSizeX>SrcSizeX)
{
/* Draw one pixel on X - Led to the Des Zoom In*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_32BPP_GetPixel(SourceSurf, sx, sy));
for (count=DesY;count<saveY;count++)
DIB_16BPP_PutPixel(DestSurf, DesX, count, color);
}
}
}
else
{
/* Draw one pixel on X - Led to the Des Zoom Out*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_32BPP_GetPixel(SourceSurf, sx, sy));
for (count=DesY;count<saveY;count++)
DIB_16BPP_PutPixel(DestSurf, DesX, count, color);
}
}
}
}
break;
break;
default:
DPRINT1("DIB_16BPP_StretchBlt: Unhandled Source BPP: %u\n", BitsPerFormat(SourceSurf->iBitmapFormat));
return FALSE;

View file

@ -497,6 +497,9 @@ BOOLEAN DIB_1BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
int zoomX;
int zoomY;
int count;
int saveX;
int saveY;
BOOLEAN DesIsBiggerY=FALSE;
SrcSizeY = SourceRect->bottom;
SrcSizeX = SourceRect->right;
@ -510,225 +513,762 @@ BOOLEAN DIB_1BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
zoomY = DesSizeY / SrcSizeY;
if (zoomY==0) zoomY=1;
if (DesSizeY>SrcSizeY)
DesIsBiggerY = TRUE;
switch(SourceSurf->iBitmapFormat)
{
case BMF_1BPP:
/* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */
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+=zoomY)
{
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+=zoomX)
if (zoomX>1)
{
/* Draw one Hline on X - Led to the Des Zoom In*/
if (DesSizeX>SrcSizeX)
{
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesSizeX>SrcSizeX)
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (sx > SourceRect->right) break;
saveX = DesX + zoomX;
color = DIB_1BPP_GetPixel(SourceSurf, sx, sy);
for (count=DesY;count<saveY;count++)
DIB_1BPP_HLine(DestSurf, DesX, saveX, count, color);
}
}
}
else
{
/* Draw one Hline on X - Led to the Des Zoom Out*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = DIB_1BPP_GetPixel(SourceSurf, sx, sy);
if (sx > SourceRect->right) break;
for (count=DesY;count<DesY+zoomY;count++)
{
if (zoomX>1)
DIB_1BPP_HLine(DestSurf, DesX, DesX + zoomX, count, color);
else
DIB_1BPP_PutPixel(DestSurf, DesX, count, color);
}
saveX = DesX + zoomX;
color = DIB_1BPP_GetPixel(SourceSurf, sx, sy);
for (count=DesY;count<saveY;count++)
DIB_1BPP_HLine(DestSurf, DesX, saveX, count, 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+=zoomY)
{
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+=zoomX)
}
}
else
{
if (DesSizeX>SrcSizeX)
{
/* Draw one pixel on X - Led to the Des Zoom In*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesSizeX>SrcSizeX)
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (sx > SourceRect->right) break;
color = DIB_1BPP_GetPixel(SourceSurf, sx, sy);
for (count=DesY;count<saveY;count++)
DIB_1BPP_HLine(DestSurf, DesX, saveX, count, color);
}
}
}
else
{
/* Draw one pixel on X - Led to the Des Zoom Out*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = DIB_4BPP_GetPixel(SourceSurf, sx, sy);
if (sx > SourceRect->right) break;
for (count=DesY;count<DesY+zoomY;count++)
{
if (zoomX>1)
DIB_1BPP_HLine(DestSurf, DesX, DesX + zoomX, count, XLATEOBJ_iXlate(ColorTranslation, color));
else
DIB_1BPP_PutPixel(DestSurf, DesX, count, XLATEOBJ_iXlate(ColorTranslation, color));
}
color = DIB_1BPP_GetPixel(SourceSurf, sx, sy);
for (count=DesY;count<saveY;count++)
DIB_1BPP_HLine(DestSurf, DesX, saveX, count, color);
}
}
}
}
break;
case BMF_4BPP:
/* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */
/* This is a reference implementation, it hasn't been optimized for speed */
if (zoomX>1)
{
/* Draw one Hline on X - Led to the Des Zoom In*/
if (DesSizeX>SrcSizeX)
{
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_4BPP_GetPixel(SourceSurf, sx, sy));
saveX = DesX + zoomX;
for (count=DesY;count<saveY;count++)
DIB_1BPP_HLine(DestSurf, DesX, saveX, count, color);
}
}
}
break;
}
else
{
/* Draw one Hline on X - Led to the Des Zoom Out*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_4BPP_GetPixel(SourceSurf, sx, sy));
saveX = DesX + zoomX;
for (count=DesY;count<saveY;count++)
DIB_1BPP_HLine(DestSurf, DesX, saveX, count, color);
}
}
}
}
else
{
if (DesSizeX>SrcSizeX)
{
/* Draw one pixel on X - Led to the Des Zoom In*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_4BPP_GetPixel(SourceSurf, sx, sy));
for (count=DesY;count<saveY;count++)
DIB_1BPP_PutPixel(DestSurf, DesX, count, color);
}
}
}
else
{
/* Draw one pixel on X - Led to the Des Zoom Out*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_4BPP_GetPixel(SourceSurf, sx, sy));
for (count=DesY;count<saveY;count++)
DIB_1BPP_PutPixel(DestSurf, DesX, count, 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+=zoomY)
{
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+=zoomX)
if (zoomX>1)
{
/* Draw one Hline on X - Led to the Des Zoom In*/
if (DesSizeX>SrcSizeX)
{
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesSizeX>SrcSizeX)
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_8BPP_GetPixel(SourceSurf, sx, sy));
saveX = DesX + zoomX;
for (count=DesY;count<saveY;count++)
DIB_1BPP_HLine(DestSurf, DesX, saveX, count, color);
}
}
}
else
{
/* Draw one Hline on X - Led to the Des Zoom Out*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = DIB_8BPP_GetPixel(SourceSurf, sx, sy);
if (sx > SourceRect->right) break;
for (count=DesY;count<DesY+zoomY;count++)
{
if (zoomX>1)
DIB_1BPP_HLine(DestSurf, DesX, DesX + zoomX, count, XLATEOBJ_iXlate(ColorTranslation, color));
else
DIB_1BPP_PutPixel(DestSurf, DesX, count, XLATEOBJ_iXlate(ColorTranslation, color));
}
color = XLATEOBJ_iXlate(ColorTranslation, DIB_8BPP_GetPixel(SourceSurf, sx, sy));
saveX = DesX + zoomX;
for (count=DesY;count<saveY;count++)
DIB_1BPP_HLine(DestSurf, DesX, saveX, count, color);
}
}
}
}
}
else
{
if (DesSizeX>SrcSizeX)
{
/* Draw one pixel on X - Led to the Des Zoom In*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_8BPP_GetPixel(SourceSurf, sx, sy));
for (count=DesY;count<saveY;count++)
DIB_1BPP_PutPixel(DestSurf, DesX, count, color);
}
}
}
else
{
/* Draw one pixel on X - Led to the Des Zoom Out*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_8BPP_GetPixel(SourceSurf, sx, sy));
for (count=DesY;count<saveY;count++)
DIB_1BPP_PutPixel(DestSurf, DesX, count, 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+=zoomY)
{
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+=zoomX)
{
if (DesSizeX>SrcSizeX)
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);
for (count=DesY;count<DesY+zoomY;count++)
{
if (zoomX>1)
DIB_1BPP_HLine(DestSurf, DesX, DesX + zoomX, count, XLATEOBJ_iXlate(ColorTranslation, color));
else
DIB_1BPP_PutPixel(DestSurf, DesX, count, XLATEOBJ_iXlate(ColorTranslation, color));
}
}
}
break;
case BMF_24BPP:
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+=zoomY)
{
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+=zoomX)
if (zoomX>1)
{
/* Draw one Hline on X - Led to the Des Zoom In*/
if (DesSizeX>SrcSizeX)
{
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesSizeX>SrcSizeX)
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_16BPP_GetPixel(SourceSurf, sx, sy));
saveX = DesX + zoomX;
for (count=DesY;count<saveY;count++)
DIB_1BPP_HLine(DestSurf, DesX, saveX, count, color);
}
}
}
else
{
/* Draw one Hline on X - Led to the Des Zoom Out*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = DIB_24BPP_GetPixel(SourceSurf, sx, sy);
if (sx > SourceRect->right) break;
for (count=DesY;count<DesY+zoomY;count++)
{
if (zoomX>1)
DIB_1BPP_HLine(DestSurf, DesX, DesX + zoomX, count, XLATEOBJ_iXlate(ColorTranslation, color));
else
DIB_1BPP_PutPixel(DestSurf, DesX, count, XLATEOBJ_iXlate(ColorTranslation, color));
}
color = XLATEOBJ_iXlate(ColorTranslation, DIB_16BPP_GetPixel(SourceSurf, sx, sy));
saveX = DesX + zoomX;
for (count=DesY;count<saveY;count++)
DIB_1BPP_HLine(DestSurf, DesX, saveX, count, color);
}
}
}
break;
case BMF_32BPP:
}
}
else
{
if (DesSizeX>SrcSizeX)
{
/* Draw one pixel on X - Led to the Des Zoom In*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_16BPP_GetPixel(SourceSurf, sx, sy));
for (count=DesY;count<saveY;count++)
DIB_1BPP_PutPixel(DestSurf, DesX, count, color);
}
}
}
else
{
/* Draw one pixel on X - Led to the Des Zoom Out*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_16BPP_GetPixel(SourceSurf, sx, sy));
for (count=DesY;count<saveY;count++)
DIB_1BPP_PutPixel(DestSurf, DesX, count, 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+=zoomY)
{
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+=zoomX)
if (zoomX>1)
{
/* Draw one Hline on X - Led to the Des Zoom In*/
if (DesSizeX>SrcSizeX)
{
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesSizeX>SrcSizeX)
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_24BPP_GetPixel(SourceSurf, sx, sy));
saveX = DesX + zoomX;
for (count=DesY;count<saveY;count++)
DIB_1BPP_HLine(DestSurf, DesX, saveX, count, color);
}
}
}
else
{
/* Draw one Hline on X - Led to the Des Zoom Out*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_24BPP_GetPixel(SourceSurf, sx, sy));
saveX = DesX + zoomX;
for (count=DesY;count<saveY;count++)
DIB_1BPP_HLine(DestSurf, DesX, saveX, count, color);
}
}
}
}
else
{
if (DesSizeX>SrcSizeX)
{
/* Draw one pixel on X - Led to the Des Zoom In*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
color = DIB_32BPP_GetPixel(SourceSurf, sx, sy);
saveY = DesY+zoomY;
for (count=DesY;count<DesY+zoomY;count++)
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_24BPP_GetPixel(SourceSurf, sx, sy));
for (count=DesY;count<saveY;count++)
DIB_1BPP_PutPixel(DestSurf, DesX, count, color);
}
}
}
else
{
/* Draw one pixel on X - Led to the Des Zoom Out*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
if (zoomX>1)
DIB_1BPP_HLine(DestSurf, DesX, DesX + zoomX, count, XLATEOBJ_iXlate(ColorTranslation, color));
else
DIB_1BPP_PutPixel(DestSurf, DesX, count, XLATEOBJ_iXlate(ColorTranslation, color));
}
}
}
break;
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_24BPP_GetPixel(SourceSurf, sx, sy));
for (count=DesY;count<saveY;count++)
DIB_1BPP_PutPixel(DestSurf, DesX, count, color);
}
}
}
}
break;
case BMF_32BPP:
/* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */
/* This is a reference implementation, it hasn't been optimized for speed */
if (zoomX>1)
{
/* Draw one Hline on X - Led to the Des Zoom In*/
if (DesSizeX>SrcSizeX)
{
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_32BPP_GetPixel(SourceSurf, sx, sy));
saveX = DesX + zoomX;
for (count=DesY;count<saveY;count++)
DIB_1BPP_HLine(DestSurf, DesX, saveX, count, color);
}
}
}
else
{
/* Draw one Hline on X - Led to the Des Zoom Out*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_32BPP_GetPixel(SourceSurf, sx, sy));
saveX = DesX + zoomX;
for (count=DesY;count<saveY;count++)
DIB_1BPP_HLine(DestSurf, DesX, saveX, count, color);
}
}
}
}
else
{
if (DesSizeX>SrcSizeX)
{
/* Draw one pixel on X - Led to the Des Zoom In*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_32BPP_GetPixel(SourceSurf, sx, sy));
for (count=DesY;count<saveY;count++)
DIB_1BPP_PutPixel(DestSurf, DesX, count, color);
}
}
}
else
{
/* Draw one pixel on X - Led to the Des Zoom Out*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_32BPP_GetPixel(SourceSurf, sx, sy));
for (count=DesY;count<saveY;count++)
DIB_1BPP_PutPixel(DestSurf, DesX, count, color);
}
}
}
}
break;
default:
//DPRINT1("DIB_4BPP_StretchBlt: Unhandled Source BPP: %u\n", BitsPerFormat(SourceSurf->iBitmapFormat));

View file

@ -321,6 +321,9 @@ BOOLEAN DIB_24BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
int zoomX;
int zoomY;
int count;
int saveX;
int saveY;
BOOLEAN DesIsBiggerY=FALSE;
SrcSizeY = SourceRect->bottom;
SrcSizeX = SourceRect->right;
@ -334,229 +337,768 @@ BOOLEAN DIB_24BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
zoomY = DesSizeY / SrcSizeY;
if (zoomY==0) zoomY=1;
if (DesSizeY>SrcSizeY)
DesIsBiggerY = TRUE;
switch(SourceSurf->iBitmapFormat)
{
case BMF_1BPP:
/* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */
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+=zoomY)
{
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+=zoomX)
if (zoomX>1)
{
/* Draw one Hline on X - Led to the Des Zoom In*/
if (DesSizeX>SrcSizeX)
{
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesSizeX>SrcSizeX)
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if(DIB_1BPP_GetPixel(SourceSurf, sx, sy) == 0)
{
for (count=DesY;count<DesY+zoomY;count++)
{
if (zoomX>1)
DIB_24BPP_HLine(DestSurf, DesX, DesX + zoomX, count, XLATEOBJ_iXlate(ColorTranslation, 0));
else
DIB_24BPP_PutPixel(DestSurf, DesX, count, XLATEOBJ_iXlate(ColorTranslation, 0));
}
} else {
for (count=DesY;count<DesY+zoomY;count++)
{
if (zoomX>1)
DIB_24BPP_HLine(DestSurf, DesX, DesX + zoomX, count, XLATEOBJ_iXlate(ColorTranslation, 1));
else
DIB_24BPP_PutPixel(DestSurf, DesX, count, 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+=zoomY)
{
if (DesSizeY>SrcSizeY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
if (sy > SourceRect->bottom) break;
for (DesX=0; DesX<DestRect->right; DesX+=zoomX)
{
if (DesSizeX>SrcSizeX)
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (sx > SourceRect->right) break;
saveX = DesX + zoomX;
if (DIB_1BPP_GetPixel(SourceSurf, sx, sy) == 0)
for (count=DesY;count<saveY;count++)
DIB_24BPP_HLine(DestSurf, DesX, saveX, count, 0);
else
for (count=DesY;count<saveY;count++)
DIB_24BPP_HLine(DestSurf, DesX, saveX, count, 1);
}
}
}
else
{
/* Draw one Hline on X - Led to the Des Zoom Out*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
if (sx > SourceRect->right) break;
saveX = DesX + zoomX;
color = DIB_4BPP_GetPixel(SourceSurf, sx, sy);
for (count=DesY;count<DesY+zoomY;count++)
{
if (zoomX>1)
DIB_24BPP_HLine(DestSurf, DesX, DesX + zoomX, count, XLATEOBJ_iXlate(ColorTranslation, color));
else
DIB_24BPP_PutPixel(DestSurf, DesX, count, XLATEOBJ_iXlate(ColorTranslation, color));
}
if (DIB_1BPP_GetPixel(SourceSurf, sx, sy) == 0)
for (count=DesY;count<saveY;count++)
DIB_24BPP_HLine(DestSurf, DesX, saveX, count, 0);
else
for (count=DesY;count<saveY;count++)
DIB_24BPP_HLine(DestSurf, DesX, saveX, count, 1);
}
}
}
break;
}
}
else
{
if (DesSizeX>SrcSizeX)
{
/* Draw one pixel on X - Led to the Des Zoom In*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (sx > SourceRect->right) break;
if (DIB_1BPP_GetPixel(SourceSurf, sx, sy) == 0)
for (count=DesY;count<saveY;count++)
DIB_24BPP_PutPixel(DestSurf, DesX, count, 0);
else
for (count=DesY;count<saveY;count++)
DIB_24BPP_PutPixel(DestSurf, DesX, count, 1);
}
}
}
else
{
/* Draw one pixel on X - Led to the Des Zoom Out*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
if (DIB_1BPP_GetPixel(SourceSurf, sx, sy) == 0)
for (count=DesY;count<saveY;count++)
DIB_24BPP_PutPixel(DestSurf, DesX, count, 0);
else
for (count=DesY;count<saveY;count++)
DIB_24BPP_PutPixel(DestSurf, DesX, count, 1);
}
}
}
}
break;
case BMF_4BPP:
/* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */
/* This is a reference implementation, it hasn't been optimized for speed */
if (zoomX>1)
{
/* Draw one Hline on X - Led to the Des Zoom In*/
if (DesSizeX>SrcSizeX)
{
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_4BPP_GetPixel(SourceSurf, sx, sy));
saveX = DesX + zoomX;
for (count=DesY;count<saveY;count++)
DIB_24BPP_HLine(DestSurf, DesX, saveX, count, color);
}
}
}
else
{
/* Draw one Hline on X - Led to the Des Zoom Out*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_4BPP_GetPixel(SourceSurf, sx, sy));
saveX = DesX + zoomX;
for (count=DesY;count<saveY;count++)
DIB_24BPP_HLine(DestSurf, DesX, saveX, count, color);
}
}
}
}
else
{
if (DesSizeX>SrcSizeX)
{
/* Draw one pixel on X - Led to the Des Zoom In*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_4BPP_GetPixel(SourceSurf, sx, sy));
for (count=DesY;count<saveY;count++)
DIB_24BPP_PutPixel(DestSurf, DesX, count, color);
}
}
}
else
{
/* Draw one pixel on X - Led to the Des Zoom Out*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_4BPP_GetPixel(SourceSurf, sx, sy));
for (count=DesY;count<saveY;count++)
DIB_24BPP_PutPixel(DestSurf, DesX, count, 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+=zoomY)
{
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+=zoomX)
if (zoomX>1)
{
/* Draw one Hline on X - Led to the Des Zoom In*/
if (DesSizeX>SrcSizeX)
{
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesSizeX>SrcSizeX)
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_8BPP_GetPixel(SourceSurf, sx, sy));
saveX = DesX + zoomX;
for (count=DesY;count<saveY;count++)
DIB_24BPP_HLine(DestSurf, DesX, saveX, count, color);
}
}
}
else
{
/* Draw one Hline on X - Led to the Des Zoom Out*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_8BPP_GetPixel(SourceSurf, sx, sy));
saveX = DesX + zoomX;
for (count=DesY;count<saveY;count++)
DIB_24BPP_HLine(DestSurf, DesX, saveX, count, color);
}
}
}
}
else
{
if (DesSizeX>SrcSizeX)
{
/* Draw one pixel on X - Led to the Des Zoom In*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
color = DIB_8BPP_GetPixel(SourceSurf, sx, sy);
saveY = DesY+zoomY;
for (count=DesY;count<DesY+zoomY;count++)
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_8BPP_GetPixel(SourceSurf, sx, sy));
for (count=DesY;count<saveY;count++)
DIB_24BPP_PutPixel(DestSurf, DesX, count, color);
}
}
}
else
{
/* Draw one pixel on X - Led to the Des Zoom Out*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
if (zoomX>1)
DIB_24BPP_HLine(DestSurf, DesX, DesX + zoomX, count, XLATEOBJ_iXlate(ColorTranslation, color));
else
DIB_24BPP_PutPixel(DestSurf, DesX, count, XLATEOBJ_iXlate(ColorTranslation, color));
}
}
}
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_8BPP_GetPixel(SourceSurf, sx, sy));
for (count=DesY;count<saveY;count++)
DIB_24BPP_PutPixel(DestSurf, DesX, count, 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+=zoomY)
{
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+=zoomX)
{
if (DesSizeX>SrcSizeX)
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);
for (count=DesY;count<DesY+zoomY;count++)
{
if (zoomX>1)
DIB_24BPP_HLine(DestSurf, DesX, DesX + zoomX, count, XLATEOBJ_iXlate(ColorTranslation, color));
else
DIB_24BPP_PutPixel(DestSurf, DesX, count, XLATEOBJ_iXlate(ColorTranslation, color));
}
}
}
break;
case BMF_24BPP:
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+=zoomY)
{
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+=zoomX)
if (zoomX>1)
{
/* Draw one Hline on X - Led to the Des Zoom In*/
if (DesSizeX>SrcSizeX)
{
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesSizeX>SrcSizeX)
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (sx > SourceRect->right) break;
if (sx > SourceRect->right) break;
color = DIB_24BPP_GetPixel(SourceSurf, sx, sy);
for (count=DesY;count<DesY+zoomY;count++)
{
if (zoomX>1)
DIB_24BPP_HLine(DestSurf, DesX, DesX + zoomX, count, color);
else
DIB_24BPP_PutPixel(DestSurf, DesX, count, color);
}
color = XLATEOBJ_iXlate(ColorTranslation, DIB_16BPP_GetPixel(SourceSurf, sx, sy));
saveX = DesX + zoomX;
for (count=DesY;count<saveY;count++)
DIB_24BPP_HLine(DestSurf, DesX, saveX, count, color);
}
}
}
break;
}
else
{
/* Draw one Hline on X - Led to the Des Zoom Out*/
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+=zoomY)
{
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+=zoomX)
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesSizeX>SrcSizeX)
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = DIB_32BPP_GetPixel(SourceSurf, sx, sy);
if (sx > SourceRect->right) break;
for (count=DesY;count<DesY+zoomY;count++)
color = XLATEOBJ_iXlate(ColorTranslation, DIB_16BPP_GetPixel(SourceSurf, sx, sy));
saveX = DesX + zoomX;
for (count=DesY;count<saveY;count++)
DIB_24BPP_HLine(DestSurf, DesX, saveX, count, color);
}
}
}
}
else
{
if (DesSizeX>SrcSizeX)
{
/* Draw one pixel on X - Led to the Des Zoom In*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_16BPP_GetPixel(SourceSurf, sx, sy));
for (count=DesY;count<saveY;count++)
DIB_24BPP_PutPixel(DestSurf, DesX, count, color);
}
}
}
else
{
/* Draw one pixel on X - Led to the Des Zoom Out*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
if (zoomX>1)
DIB_24BPP_HLine(DestSurf, DesX, DesX + zoomX, count, XLATEOBJ_iXlate(ColorTranslation, color));
else
DIB_24BPP_PutPixel(DestSurf, DesX, count, XLATEOBJ_iXlate(ColorTranslation, color));
}
}
}
break;
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_16BPP_GetPixel(SourceSurf, sx, sy));
for (count=DesY;count<saveY;count++)
DIB_24BPP_PutPixel(DestSurf, DesX, count, color);
}
}
}
}
break;
case BMF_24BPP:
/* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */
/* This is a reference implementation, it hasn't been optimized for speed */
if (zoomX>1)
{
/* Draw one Hline on X - Led to the Des Zoom In*/
if (DesSizeX>SrcSizeX)
{
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (sx > SourceRect->right) break;
color = DIB_24BPP_GetPixel(SourceSurf, sx, sy);
saveX = DesX + zoomX;
for (count=DesY;count<saveY;count++)
DIB_24BPP_HLine(DestSurf, DesX, saveX, count, color);
}
}
}
else
{
/* Draw one Hline on X - Led to the Des Zoom Out*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = DIB_24BPP_GetPixel(SourceSurf, sx, sy);
saveX = DesX + zoomX;
for (count=DesY;count<saveY;count++)
DIB_24BPP_HLine(DestSurf, DesX, saveX, count, color);
}
}
}
}
else
{
if (DesSizeX>SrcSizeX)
{
/* Draw one pixel on X - Led to the Des Zoom In*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (sx > SourceRect->right) break;
color = DIB_24BPP_GetPixel(SourceSurf, sx, sy);
for (count=DesY;count<saveY;count++)
DIB_24BPP_PutPixel(DestSurf, DesX, count, color);
}
}
}
else
{
/* Draw one pixel on X - Led to the Des Zoom Out*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = DIB_24BPP_GetPixel(SourceSurf, sx, sy);
for (count=DesY;count<saveY;count++)
DIB_24BPP_PutPixel(DestSurf, DesX, count, color);
}
}
}
}
break;
case BMF_32BPP:
/* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */
/* This is a reference implementation, it hasn't been optimized for speed */
if (zoomX>1)
{
/* Draw one Hline on X - Led to the Des Zoom In*/
if (DesSizeX>SrcSizeX)
{
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_32BPP_GetPixel(SourceSurf, sx, sy));
saveX = DesX + zoomX;
for (count=DesY;count<saveY;count++)
DIB_24BPP_HLine(DestSurf, DesX, saveX, count, color);
}
}
}
else
{
/* Draw one Hline on X - Led to the Des Zoom Out*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_32BPP_GetPixel(SourceSurf, sx, sy));
saveX = DesX + zoomX;
for (count=DesY;count<saveY;count++)
DIB_24BPP_HLine(DestSurf, DesX, saveX, count, color);
}
}
}
}
else
{
if (DesSizeX>SrcSizeX)
{
/* Draw one pixel on X - Led to the Des Zoom In*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_32BPP_GetPixel(SourceSurf, sx, sy));
for (count=DesY;count<saveY;count++)
DIB_24BPP_PutPixel(DestSurf, DesX, count, color);
}
}
}
else
{
/* Draw one pixel on X - Led to the Des Zoom Out*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_32BPP_GetPixel(SourceSurf, sx, sy));
for (count=DesY;count<saveY;count++)
DIB_24BPP_PutPixel(DestSurf, DesX, count, color);
}
}
}
}
break;
default:
//DPRINT1("DIB_24BPP_StretchBlt: Unhandled Source BPP: %u\n", BitsPerFormat(SourceSurf->iBitmapFormat));

View file

@ -563,8 +563,10 @@ BOOLEAN DIB_32BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
int zoomX;
int zoomY;
int count;
int saveX;
int saveY;
BOOLEAN DesIsBiggerY=FALSE;
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,
DestRect->left, DestRect->top, DestRect->right, DestRect->bottom);
@ -581,200 +583,644 @@ BOOLEAN DIB_32BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
zoomY = DesSizeY / SrcSizeY;
if (zoomY==0) zoomY=1;
if (DesSizeY>SrcSizeY)
DesIsBiggerY = TRUE;
switch(SourceSurf->iBitmapFormat)
{
case BMF_1BPP:
/* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */
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+=zoomY)
{
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+=zoomX)
if (zoomX>1)
{
/* Draw one Hline on X - Led to the Des Zoom In*/
if (DesSizeX>SrcSizeX)
{
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesSizeX>SrcSizeX)
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
if(DIB_1BPP_GetPixel(SourceSurf, sx, sy) == 0)
{
for (count=DesY;count<DesY+zoomY;count++)
{
if (zoomX>1)
DIB_32BPP_HLine(DestSurf, DesX, DesX + zoomX, count, XLATEOBJ_iXlate(ColorTranslation, 0));
else
DIB_32BPP_PutPixel(DestSurf, DesX, count, XLATEOBJ_iXlate(ColorTranslation, 0));
}
} else {
for (count=DesY;count<DesY+zoomY;count++)
{
if (zoomX>1)
DIB_32BPP_HLine(DestSurf, DesX, DesX + zoomX, count, XLATEOBJ_iXlate(ColorTranslation, 1));
else
DIB_32BPP_PutPixel(DestSurf, DesX, count, 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+=zoomY)
{
if (DesSizeY>SrcSizeY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=0; DesX<DestRect->right; DesX+=zoomX)
{
if (DesSizeX>SrcSizeX)
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (sx > SourceRect->right) break;
saveX = DesX + zoomX;
if (DIB_1BPP_GetPixel(SourceSurf, sx, sy) == 0)
for (count=DesY;count<saveY;count++)
DIB_32BPP_HLine(DestSurf, DesX, saveX, count, 0);
else
for (count=DesY;count<saveY;count++)
DIB_32BPP_HLine(DestSurf, DesX, saveX, count, 1);
}
}
}
else
{
/* Draw one Hline on X - Led to the Des Zoom Out*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = DIB_4BPP_GetPixel(SourceSurf, sx, sy);
if (sx > SourceRect->right) break;
for (count=DesY;count<DesY+zoomY;count++)
{
if (zoomX>1)
DIB_32BPP_HLine(DestSurf, DesX, DesX + zoomX, count, XLATEOBJ_iXlate(ColorTranslation, color));
else
DIB_32BPP_PutPixel(DestSurf, DesX, count, XLATEOBJ_iXlate(ColorTranslation, color));
}
saveX = DesX + zoomX;
}
}
break;
if (DIB_1BPP_GetPixel(SourceSurf, sx, sy) == 0)
for (count=DesY;count<saveY;count++)
DIB_32BPP_HLine(DestSurf, DesX, saveX, count, 0);
else
for (count=DesY;count<saveY;count++)
DIB_32BPP_HLine(DestSurf, DesX, saveX, count, 1);
}
}
}
}
else
{
if (DesSizeX>SrcSizeX)
{
/* Draw one pixel on X - Led to the Des Zoom In*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (sx > SourceRect->right) break;
if (DIB_1BPP_GetPixel(SourceSurf, sx, sy) == 0)
for (count=DesY;count<saveY;count++)
DIB_32BPP_PutPixel(DestSurf, DesX, count, 0);
else
for (count=DesY;count<saveY;count++)
DIB_32BPP_PutPixel(DestSurf, DesX, count, 1);
}
}
}
else
{
/* Draw one pixel on X - Led to the Des Zoom Out*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
if (DIB_1BPP_GetPixel(SourceSurf, sx, sy) == 0)
for (count=DesY;count<saveY;count++)
DIB_32BPP_PutPixel(DestSurf, DesX, count, 0);
else
for (count=DesY;count<saveY;count++)
DIB_32BPP_PutPixel(DestSurf, DesX, count, 1);
}
}
}
}
break;
case BMF_4BPP:
/* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */
/* This is a reference implementation, it hasn't been optimized for speed */
if (zoomX>1)
{
/* Draw one Hline on X - Led to the Des Zoom In*/
if (DesSizeX>SrcSizeX)
{
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_4BPP_GetPixel(SourceSurf, sx, sy));
saveX = DesX + zoomX;
for (count=DesY;count<saveY;count++)
DIB_32BPP_HLine(DestSurf, DesX, saveX, count, color);
}
}
}
else
{
/* Draw one Hline on X - Led to the Des Zoom Out*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_4BPP_GetPixel(SourceSurf, sx, sy));
saveX = DesX + zoomX;
for (count=DesY;count<saveY;count++)
DIB_32BPP_HLine(DestSurf, DesX, saveX, count, color);
}
}
}
}
else
{
if (DesSizeX>SrcSizeX)
{
/* Draw one pixel on X - Led to the Des Zoom In*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_4BPP_GetPixel(SourceSurf, sx, sy));
for (count=DesY;count<saveY;count++)
DIB_32BPP_PutPixel(DestSurf, DesX, count, color);
}
}
}
else
{
/* Draw one pixel on X - Led to the Des Zoom Out*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_4BPP_GetPixel(SourceSurf, sx, sy));
for (count=DesY;count<saveY;count++)
DIB_32BPP_PutPixel(DestSurf, DesX, count, 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+=zoomY)
{
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+=zoomX)
if (zoomX>1)
{
/* Draw one Hline on X - Led to the Des Zoom In*/
if (DesSizeX>SrcSizeX)
{
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesSizeX>SrcSizeX)
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_8BPP_GetPixel(SourceSurf, sx, sy));
saveX = DesX + zoomX;
for (count=DesY;count<saveY;count++)
DIB_32BPP_HLine(DestSurf, DesX, saveX, count, color);
}
}
}
else
{
/* Draw one Hline on X - Led to the Des Zoom Out*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_8BPP_GetPixel(SourceSurf, sx, sy));
saveX = DesX + zoomX;
for (count=DesY;count<saveY;count++)
DIB_32BPP_HLine(DestSurf, DesX, saveX, count, color);
}
}
}
}
else
{
if (DesSizeX>SrcSizeX)
{
/* Draw one pixel on X - Led to the Des Zoom In*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
color = DIB_8BPP_GetPixel(SourceSurf, sx, sy);
saveY = DesY+zoomY;
for (count=DesY;count<DesY+zoomY;count++)
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_8BPP_GetPixel(SourceSurf, sx, sy));
for (count=DesY;count<saveY;count++)
DIB_32BPP_PutPixel(DestSurf, DesX, count, color);
}
}
}
else
{
/* Draw one pixel on X - Led to the Des Zoom Out*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
if (zoomX>1)
DIB_32BPP_HLine(DestSurf, DesX, DesX + zoomX, count, XLATEOBJ_iXlate(ColorTranslation, color));
else
DIB_32BPP_PutPixel(DestSurf, DesX, count, XLATEOBJ_iXlate(ColorTranslation, color));
}
}
}
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_8BPP_GetPixel(SourceSurf, sx, sy));
for (count=DesY;count<saveY;count++)
DIB_32BPP_PutPixel(DestSurf, DesX, count, 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+=zoomY)
{
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+=zoomX)
{
if (DesSizeX>SrcSizeX)
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);
for (count=DesY;count<DesY+zoomY;count++)
{
if (zoomX>1)
DIB_32BPP_HLine(DestSurf, DesX, DesX + zoomX, count, XLATEOBJ_iXlate(ColorTranslation, color));
else
DIB_32BPP_PutPixel(DestSurf, DesX, count, XLATEOBJ_iXlate(ColorTranslation, color));
}
}
}
break;
case BMF_24BPP:
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+=zoomY)
{
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+=zoomX)
if (zoomX>1)
{
/* Draw one Hline on X - Led to the Des Zoom In*/
if (DesSizeX>SrcSizeX)
{
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesSizeX>SrcSizeX)
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_16BPP_GetPixel(SourceSurf, sx, sy));
saveX = DesX + zoomX;
for (count=DesY;count<saveY;count++)
DIB_32BPP_HLine(DestSurf, DesX, saveX, count, color);
}
}
}
else
{
/* Draw one Hline on X - Led to the Des Zoom Out*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = DIB_24BPP_GetPixel(SourceSurf, sx, sy);
if (sx > SourceRect->right) break;
for (count=DesY;count<DesY+zoomY;count++)
{
if (zoomX>1)
DIB_32BPP_HLine(DestSurf, DesX, DesX + zoomX, count, XLATEOBJ_iXlate(ColorTranslation, color));
else
DIB_32BPP_PutPixel(DestSurf, DesX, count, XLATEOBJ_iXlate(ColorTranslation, color));
}
color = XLATEOBJ_iXlate(ColorTranslation, DIB_16BPP_GetPixel(SourceSurf, sx, sy));
saveX = DesX + zoomX;
for (count=DesY;count<saveY;count++)
DIB_32BPP_HLine(DestSurf, DesX, saveX, count, color);
}
}
}
break;
}
}
else
{
if (DesSizeX>SrcSizeX)
{
/* Draw one pixel on X - Led to the Des Zoom In*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_16BPP_GetPixel(SourceSurf, sx, sy));
for (count=DesY;count<saveY;count++)
DIB_32BPP_PutPixel(DestSurf, DesX, count, color);
}
}
}
else
{
/* Draw one pixel on X - Led to the Des Zoom Out*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_16BPP_GetPixel(SourceSurf, sx, sy));
for (count=DesY;count<saveY;count++)
DIB_32BPP_PutPixel(DestSurf, DesX, count, color);
}
}
}
}
break;
case BMF_24BPP:
/* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */
/* This is a reference implementation, it hasn't been optimized for speed */
if (zoomX>1)
{
/* Draw one Hline on X - Led to the Des Zoom In*/
if (DesSizeX>SrcSizeX)
{
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_24BPP_GetPixel(SourceSurf, sx, sy));
saveX = DesX + zoomX;
for (count=DesY;count<saveY;count++)
DIB_32BPP_HLine(DestSurf, DesX, saveX, count, color);
}
}
}
else
{
/* Draw one Hline on X - Led to the Des Zoom Out*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_24BPP_GetPixel(SourceSurf, sx, sy));
saveX = DesX + zoomX;
for (count=DesY;count<saveY;count++)
DIB_32BPP_HLine(DestSurf, DesX, saveX, count, color);
}
}
}
}
else
{
if (DesSizeX>SrcSizeX)
{
/* Draw one pixel on X - Led to the Des Zoom In*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_24BPP_GetPixel(SourceSurf, sx, sy));
for (count=DesY;count<saveY;count++)
DIB_32BPP_PutPixel(DestSurf, DesX, count, color);
}
}
}
else
{
/* Draw one pixel on X - Led to the Des Zoom Out*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_24BPP_GetPixel(SourceSurf, sx, sy));
for (count=DesY;count<saveY;count++)
DIB_32BPP_PutPixel(DestSurf, DesX, count, color);
}
}
}
}
break;
case BMF_32BPP:
return ScaleRectAvg32(DestSurf, SourceSurf, DestRect, SourceRect, MaskOrigin, BrushOrigin,

View file

@ -375,6 +375,9 @@ BOOLEAN DIB_4BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
int zoomX;
int zoomY;
int count;
int saveX;
int saveY;
BOOLEAN DesIsBiggerY=FALSE;
SrcSizeY = SourceRect->bottom;
@ -389,231 +392,769 @@ BOOLEAN DIB_4BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
zoomY = DesSizeY / SrcSizeY;
if (zoomY==0) zoomY=1;
if (DesSizeY>SrcSizeY)
DesIsBiggerY = TRUE;
switch(SourceSurf->iBitmapFormat)
{
case BMF_1BPP:
/* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */
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+=zoomY)
{
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+=zoomX)
if (zoomX>1)
{
/* Draw one Hline on X - Led to the Des Zoom In*/
if (DesSizeX>SrcSizeX)
{
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesSizeX>SrcSizeX)
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
if(DIB_1BPP_GetPixel(SourceSurf, sx, sy) == 0)
{
for (count=DesY;count<DesY+zoomY;count++)
{
if (zoomX>1)
DIB_4BPP_HLine(DestSurf, DesX, DesX + zoomX, count, XLATEOBJ_iXlate(ColorTranslation, 0));
else
DIB_4BPP_PutPixel(DestSurf, DesX, count, XLATEOBJ_iXlate(ColorTranslation, 0));
}
} else {
for (count=DesY;count<DesY+zoomY;count++)
{
if (zoomX>1)
DIB_4BPP_HLine(DestSurf, DesX, DesX + zoomX, count, XLATEOBJ_iXlate(ColorTranslation, 1));
else
DIB_4BPP_PutPixel(DestSurf, DesX, count, 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+=zoomY)
{
if (DesSizeY>SrcSizeY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=0; DesX<DestRect->right; DesX+=zoomX)
{
if (DesSizeX>SrcSizeX)
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (sx > SourceRect->right) break;
saveX = DesX + zoomX;
if (DIB_1BPP_GetPixel(SourceSurf, sx, sy) == 0)
for (count=DesY;count<saveY;count++)
DIB_4BPP_HLine(DestSurf, DesX, saveX, count, 0);
else
for (count=DesY;count<saveY;count++)
DIB_4BPP_HLine(DestSurf, DesX, saveX, count, 1);
}
}
}
else
{
/* Draw one Hline on X - Led to the Des Zoom Out*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = DIB_4BPP_GetPixel(SourceSurf, sx, sy);
if (sx > SourceRect->right) break;
for (count=DesY;count<DesY+zoomY;count++)
{
if (zoomX>1)
DIB_4BPP_HLine(DestSurf, DesX, DesX + zoomX, count, color);
else
DIB_4BPP_PutPixel(DestSurf, DesX, count, color);
}
saveX = DesX + zoomX;
if (DIB_1BPP_GetPixel(SourceSurf, sx, sy) == 0)
for (count=DesY;count<saveY;count++)
DIB_4BPP_HLine(DestSurf, DesX, saveX, count, 0);
else
for (count=DesY;count<saveY;count++)
DIB_4BPP_HLine(DestSurf, DesX, saveX, count, 1);
}
}
}
break;
}
}
else
{
if (DesSizeX>SrcSizeX)
{
/* Draw one pixel on X - Led to the Des Zoom In*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (sx > SourceRect->right) break;
if (DIB_1BPP_GetPixel(SourceSurf, sx, sy) == 0)
for (count=DesY;count<saveY;count++)
DIB_4BPP_PutPixel(DestSurf, DesX, count, 0);
else
for (count=DesY;count<saveY;count++)
DIB_4BPP_PutPixel(DestSurf, DesX, count, 1);
}
}
}
else
{
/* Draw one pixel on X - Led to the Des Zoom Out*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
if (DIB_1BPP_GetPixel(SourceSurf, sx, sy) == 0)
for (count=DesY;count<saveY;count++)
DIB_4BPP_PutPixel(DestSurf, DesX, count, 0);
else
for (count=DesY;count<saveY;count++)
DIB_4BPP_PutPixel(DestSurf, DesX, count, 1);
}
}
}
}
break;
case BMF_4BPP:
/* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */
/* This is a reference implementation, it hasn't been optimized for speed */
if (zoomX>1)
{
/* Draw one Hline on X - Led to the Des Zoom In*/
if (DesSizeX>SrcSizeX)
{
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (sx > SourceRect->right) break;
color = DIB_4BPP_GetPixel(SourceSurf, sx, sy);
saveX = DesX + zoomX;
for (count=DesY;count<saveY;count++)
DIB_4BPP_HLine(DestSurf, DesX, saveX, count, color);
}
}
}
else
{
/* Draw one Hline on X - Led to the Des Zoom Out*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = DIB_4BPP_GetPixel(SourceSurf, sx, sy);
saveX = DesX + zoomX;
for (count=DesY;count<saveY;count++)
DIB_4BPP_HLine(DestSurf, DesX, saveX, count, color);
}
}
}
}
else
{
if (DesSizeX>SrcSizeX)
{
/* Draw one pixel on X - Led to the Des Zoom In*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (sx > SourceRect->right) break;
color = DIB_4BPP_GetPixel(SourceSurf, sx, sy);
for (count=DesY;count<saveY;count++)
DIB_4BPP_PutPixel(DestSurf, DesX, count, color);
}
}
}
else
{
/* Draw one pixel on X - Led to the Des Zoom Out*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = DIB_4BPP_GetPixel(SourceSurf, sx, sy);
for (count=DesY;count<saveY;count++)
DIB_4BPP_PutPixel(DestSurf, DesX, count, 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+=zoomY)
{
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+=zoomX)
if (zoomX>1)
{
/* Draw one Hline on X - Led to the Des Zoom In*/
if (DesSizeX>SrcSizeX)
{
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesSizeX>SrcSizeX)
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_8BPP_GetPixel(SourceSurf, sx, sy));
saveX = DesX + zoomX;
for (count=DesY;count<saveY;count++)
DIB_4BPP_HLine(DestSurf, DesX, saveX, count, color);
}
}
}
else
{
/* Draw one Hline on X - Led to the Des Zoom Out*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = DIB_8BPP_GetPixel(SourceSurf, sx, sy);
if (sx > SourceRect->right) break;
if (zoomX>1)
DIB_4BPP_HLine(DestSurf, DesX, DesX + zoomX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
color = XLATEOBJ_iXlate(ColorTranslation, DIB_8BPP_GetPixel(SourceSurf, sx, sy));
saveX = DesX + zoomX;
for (count=DesY;count<saveY;count++)
DIB_4BPP_HLine(DestSurf, DesX, saveX, count, color);
}
}
}
}
else
{
if (DesSizeX>SrcSizeX)
{
/* Draw one pixel on X - Led to the Des Zoom In*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
DIB_4BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color));
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
}
}
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_8BPP_GetPixel(SourceSurf, sx, sy));
for (count=DesY;count<saveY;count++)
DIB_4BPP_PutPixel(DestSurf, DesX, count, color);
}
}
}
else
{
/* Draw one pixel on X - Led to the Des Zoom Out*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_8BPP_GetPixel(SourceSurf, sx, sy));
for (count=DesY;count<saveY;count++)
DIB_4BPP_PutPixel(DestSurf, DesX, count, 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+=zoomY)
{
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+=zoomX)
{
if (DesSizeX>SrcSizeX)
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);
for (count=DesY;count<DesY+zoomY;count++)
{
if (zoomX>1)
DIB_4BPP_HLine(DestSurf, DesX, DesX + zoomX, count, XLATEOBJ_iXlate(ColorTranslation, color));
else
DIB_4BPP_PutPixel(DestSurf, DesX, count, XLATEOBJ_iXlate(ColorTranslation, color));
}
}
}
break;
case BMF_24BPP:
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+=zoomY)
{
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+=zoomX)
if (zoomX>1)
{
/* Draw one Hline on X - Led to the Des Zoom In*/
if (DesSizeX>SrcSizeX)
{
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesSizeX>SrcSizeX)
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_16BPP_GetPixel(SourceSurf, sx, sy));
saveX = DesX + zoomX;
for (count=DesY;count<saveY;count++)
DIB_4BPP_HLine(DestSurf, DesX, saveX, count, color);
}
}
}
else
{
/* Draw one Hline on X - Led to the Des Zoom Out*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = DIB_24BPP_GetPixel(SourceSurf, sx, sy);
if (sx > SourceRect->right) break;
for (count=DesY;count<DesY+zoomY;count++)
{
if (zoomX>1)
DIB_4BPP_HLine(DestSurf, DesX, DesX + zoomX, count, XLATEOBJ_iXlate(ColorTranslation, color));
else
DIB_4BPP_PutPixel(DestSurf, DesX, count, XLATEOBJ_iXlate(ColorTranslation, color));
}
color = XLATEOBJ_iXlate(ColorTranslation, DIB_16BPP_GetPixel(SourceSurf, sx, sy));
saveX = DesX + zoomX;
for (count=DesY;count<saveY;count++)
DIB_4BPP_HLine(DestSurf, DesX, saveX, count, color);
}
}
}
break;
}
}
else
{
if (DesSizeX>SrcSizeX)
{
/* Draw one pixel on X - Led to the Des Zoom In*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
case BMF_32BPP:
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_16BPP_GetPixel(SourceSurf, sx, sy));
for (count=DesY;count<saveY;count++)
DIB_4BPP_PutPixel(DestSurf, DesX, count, color);
}
}
}
else
{
/* Draw one pixel on X - Led to the Des Zoom Out*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_16BPP_GetPixel(SourceSurf, sx, sy));
for (count=DesY;count<saveY;count++)
DIB_4BPP_PutPixel(DestSurf, DesX, count, 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+=zoomY)
{
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+=zoomX)
if (zoomX>1)
{
/* Draw one Hline on X - Led to the Des Zoom In*/
if (DesSizeX>SrcSizeX)
{
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesSizeX>SrcSizeX)
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_24BPP_GetPixel(SourceSurf, sx, sy));
saveX = DesX + zoomX;
for (count=DesY;count<saveY;count++)
DIB_4BPP_HLine(DestSurf, DesX, saveX, count, color);
}
}
}
else
{
/* Draw one Hline on X - Led to the Des Zoom Out*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = DIB_32BPP_GetPixel(SourceSurf, sx, sy);
if (sx > SourceRect->right) break;
for (count=DesY;count<DesY+zoomY;count++)
{
if (zoomX>1)
DIB_4BPP_HLine(DestSurf, DesX, DesX + zoomX, count, XLATEOBJ_iXlate(ColorTranslation, color));
else
DIB_4BPP_PutPixel(DestSurf, DesX, count, XLATEOBJ_iXlate(ColorTranslation, color));
}
color = XLATEOBJ_iXlate(ColorTranslation, DIB_24BPP_GetPixel(SourceSurf, sx, sy));
saveX = DesX + zoomX;
for (count=DesY;count<saveY;count++)
DIB_4BPP_HLine(DestSurf, DesX, saveX, count, color);
}
}
}
break;
}
}
else
{
if (DesSizeX>SrcSizeX)
{
/* Draw one pixel on X - Led to the Des Zoom In*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_24BPP_GetPixel(SourceSurf, sx, sy));
for (count=DesY;count<saveY;count++)
DIB_4BPP_PutPixel(DestSurf, DesX, count, color);
}
}
}
else
{
/* Draw one pixel on X - Led to the Des Zoom Out*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_24BPP_GetPixel(SourceSurf, sx, sy));
for (count=DesY;count<saveY;count++)
DIB_4BPP_PutPixel(DestSurf, DesX, count, color);
}
}
}
}
break;
case BMF_32BPP:
/* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */
/* This is a reference implementation, it hasn't been optimized for speed */
if (zoomX>1)
{
/* Draw one Hline on X - Led to the Des Zoom In*/
if (DesSizeX>SrcSizeX)
{
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_32BPP_GetPixel(SourceSurf, sx, sy));
saveX = DesX + zoomX;
for (count=DesY;count<saveY;count++)
DIB_4BPP_HLine(DestSurf, DesX, saveX, count, color);
}
}
}
else
{
/* Draw one Hline on X - Led to the Des Zoom Out*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_32BPP_GetPixel(SourceSurf, sx, sy));
saveX = DesX + zoomX;
for (count=DesY;count<saveY;count++)
DIB_4BPP_HLine(DestSurf, DesX, saveX, count, color);
}
}
}
}
else
{
if (DesSizeX>SrcSizeX)
{
/* Draw one pixel on X - Led to the Des Zoom In*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_32BPP_GetPixel(SourceSurf, sx, sy));
for (count=DesY;count<saveY;count++)
DIB_4BPP_PutPixel(DestSurf, DesX, count, color);
}
}
}
else
{
/* Draw one pixel on X - Led to the Des Zoom Out*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_32BPP_GetPixel(SourceSurf, sx, sy));
for (count=DesY;count<saveY;count++)
DIB_4BPP_PutPixel(DestSurf, DesX, count, color);
}
}
}
}
break;
default:
//DPRINT1("DIB_4BPP_StretchBlt: Unhandled Source BPP: %u\n", BitsPerFormat(SourceSurf->iBitmapFormat));

View file

@ -553,6 +553,9 @@ BOOLEAN DIB_8BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
int zoomX;
int zoomY;
int count;
int saveX;
int saveY;
BOOLEAN DesIsBiggerY=FALSE;
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,
@ -570,203 +573,651 @@ BOOLEAN DIB_8BPP_StretchBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
zoomY = DesSizeY / SrcSizeY;
if (zoomY==0) zoomY=1;
if (DesSizeY>SrcSizeY)
DesIsBiggerY = TRUE;
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+=zoomY)
{
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+=zoomX)
{
if (DesSizeX>SrcSizeX)
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)
{
for (count=DesY;count<DesY+zoomY;count++)
{
if (zoomX>1)
DIB_8BPP_HLine(DestSurf, DesX, DesX + zoomX, count, XLATEOBJ_iXlate(ColorTranslation, 0));
else
DIB_8BPP_PutPixel(DestSurf, DesX, count, XLATEOBJ_iXlate(ColorTranslation, 0));
}
} else {
for (count=DesY;count<DesY+zoomY;count++)
{
if (zoomX>1)
DIB_8BPP_HLine(DestSurf, DesX, DesX + zoomX, count, XLATEOBJ_iXlate(ColorTranslation, 1));
else
DIB_8BPP_PutPixel(DestSurf, DesX, count, 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+=zoomY)
{
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+=zoomX)
{
if (DesSizeX>SrcSizeX)
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);
for (count=DesY;count<DesY+zoomY;count++)
{
if (zoomX>1)
DIB_8BPP_HLine(DestSurf, DesX, DesX + zoomX, count, XLATEOBJ_iXlate(ColorTranslation, color));
else
DIB_8BPP_PutPixel(DestSurf, DesX, count, 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+=zoomY)
{
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+=zoomX)
{
if (DesSizeX>SrcSizeX)
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);
for (count=DesY;count<DesY+zoomY;count++)
{
if (zoomX>1)
DIB_8BPP_HLine(DestSurf, DesX, DesX + zoomX, count, XLATEOBJ_iXlate(ColorTranslation, color));
else
DIB_8BPP_PutPixel(DestSurf, DesX, count, XLATEOBJ_iXlate(ColorTranslation, color));
}
}
}
break;
case BMF_24BPP:
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+=zoomY)
{
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+=zoomX)
if (zoomX>1)
{
/* Draw one Hline on X - Led to the Des Zoom In*/
if (DesSizeX>SrcSizeX)
{
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesSizeX>SrcSizeX)
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (sx > SourceRect->right) break;
saveX = DesX + zoomX;
if (DIB_1BPP_GetPixel(SourceSurf, sx, sy) == 0)
for (count=DesY;count<saveY;count++)
DIB_8BPP_HLine(DestSurf, DesX, saveX, count, 0);
else
for (count=DesY;count<saveY;count++)
DIB_8BPP_HLine(DestSurf, DesX, saveX, count, 1);
}
}
}
else
{
/* Draw one Hline on X - Led to the Des Zoom Out*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = DIB_24BPP_GetPixel(SourceSurf, sx, sy);
if (sx > SourceRect->right) break;
for (count=DesY;count<DesY+zoomY;count++)
{
if (zoomX>1)
DIB_8BPP_HLine(DestSurf, DesX, DesX + zoomX, count, XLATEOBJ_iXlate(ColorTranslation, color));
else
DIB_8BPP_PutPixel(DestSurf, DesX, count, XLATEOBJ_iXlate(ColorTranslation, color));
}
}
}
break;
saveX = DesX + zoomX;
case BMF_32BPP:
if (DIB_1BPP_GetPixel(SourceSurf, sx, sy) == 0)
for (count=DesY;count<saveY;count++)
DIB_8BPP_HLine(DestSurf, DesX, saveX, count, 0);
else
for (count=DesY;count<saveY;count++)
DIB_8BPP_HLine(DestSurf, DesX, saveX, count, 1);
}
}
}
}
else
{
if (DesSizeX>SrcSizeX)
{
/* Draw one pixel on X - Led to the Des Zoom In*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (sx > SourceRect->right) break;
if (DIB_1BPP_GetPixel(SourceSurf, sx, sy) == 0)
for (count=DesY;count<saveY;count++)
DIB_8BPP_PutPixel(DestSurf, DesX, count, 0);
else
for (count=DesY;count<saveY;count++)
DIB_8BPP_PutPixel(DestSurf, DesX, count, 1);
}
}
}
else
{
/* Draw one pixel on X - Led to the Des Zoom Out*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
if (DIB_1BPP_GetPixel(SourceSurf, sx, sy) == 0)
for (count=DesY;count<saveY;count++)
DIB_8BPP_PutPixel(DestSurf, DesX, count, 0);
else
for (count=DesY;count<saveY;count++)
DIB_8BPP_PutPixel(DestSurf, DesX, count, 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+=zoomY)
{
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+=zoomX)
if (zoomX>1)
{
/* Draw one Hline on X - Led to the Des Zoom In*/
if (DesSizeX>SrcSizeX)
{
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesSizeX>SrcSizeX)
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_4BPP_GetPixel(SourceSurf, sx, sy));
saveX = DesX + zoomX;
for (count=DesY;count<saveY;count++)
DIB_8BPP_HLine(DestSurf, DesX, saveX, count, color);
}
}
}
else
{
/* Draw one Hline on X - Led to the Des Zoom Out*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = DIB_32BPP_GetPixel(SourceSurf, sx, sy);
for (count=DesY;count<DesY+zoomY;count++)
{
if (zoomX>1)
DIB_8BPP_HLine(DestSurf, DesX, DesX + zoomX, count, XLATEOBJ_iXlate(ColorTranslation, color));
else
DIB_8BPP_PutPixel(DestSurf, DesX, count, XLATEOBJ_iXlate(ColorTranslation, color));
}
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_4BPP_GetPixel(SourceSurf, sx, sy));
saveX = DesX + zoomX;
for (count=DesY;count<saveY;count++)
DIB_8BPP_HLine(DestSurf, DesX, saveX, count, color);
}
}
}
break;
}
}
else
{
if (DesSizeX>SrcSizeX)
{
/* Draw one pixel on X - Led to the Des Zoom In*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_4BPP_GetPixel(SourceSurf, sx, sy));
for (count=DesY;count<saveY;count++)
DIB_8BPP_PutPixel(DestSurf, DesX, count, color);
}
}
}
else
{
/* Draw one pixel on X - Led to the Des Zoom Out*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_4BPP_GetPixel(SourceSurf, sx, sy));
for (count=DesY;count<saveY;count++)
DIB_8BPP_PutPixel(DestSurf, DesX, count, color);
}
}
}
}
break;
case BMF_8BPP:
return ScaleRectAvg8(DestSurf, SourceSurf, DestRect, SourceRect, MaskOrigin, BrushOrigin,
ClipRegion, ColorTranslation, Mode);
break;
case BMF_16BPP:
/* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */
/* This is a reference implementation, it hasn't been optimized for speed */
if (zoomX>1)
{
/* Draw one Hline on X - Led to the Des Zoom In*/
if (DesSizeX>SrcSizeX)
{
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_16BPP_GetPixel(SourceSurf, sx, sy));
saveX = DesX + zoomX;
for (count=DesY;count<saveY;count++)
DIB_8BPP_HLine(DestSurf, DesX, saveX, count, color);
}
}
}
else
{
/* Draw one Hline on X - Led to the Des Zoom Out*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_16BPP_GetPixel(SourceSurf, sx, sy));
saveX = DesX + zoomX;
for (count=DesY;count<saveY;count++)
DIB_8BPP_HLine(DestSurf, DesX, saveX, count, color);
}
}
}
}
else
{
if (DesSizeX>SrcSizeX)
{
/* Draw one pixel on X - Led to the Des Zoom In*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_16BPP_GetPixel(SourceSurf, sx, sy));
for (count=DesY;count<saveY;count++)
DIB_8BPP_PutPixel(DestSurf, DesX, count, color);
}
}
}
else
{
/* Draw one pixel on X - Led to the Des Zoom Out*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_16BPP_GetPixel(SourceSurf, sx, sy));
for (count=DesY;count<saveY;count++)
DIB_8BPP_PutPixel(DestSurf, DesX, count, color);
}
}
}
}
break;
case BMF_24BPP:
/* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */
/* This is a reference implementation, it hasn't been optimized for speed */
if (zoomX>1)
{
/* Draw one Hline on X - Led to the Des Zoom In*/
if (DesSizeX>SrcSizeX)
{
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_24BPP_GetPixel(SourceSurf, sx, sy));
saveX = DesX + zoomX;
for (count=DesY;count<saveY;count++)
DIB_8BPP_HLine(DestSurf, DesX, saveX, count, color);
}
}
}
else
{
/* Draw one Hline on X - Led to the Des Zoom Out*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_24BPP_GetPixel(SourceSurf, sx, sy));
saveX = DesX + zoomX;
for (count=DesY;count<saveY;count++)
DIB_8BPP_HLine(DestSurf, DesX, saveX, count, color);
}
}
}
}
else
{
if (DesSizeX>SrcSizeX)
{
/* Draw one pixel on X - Led to the Des Zoom In*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_24BPP_GetPixel(SourceSurf, sx, sy));
for (count=DesY;count<saveY;count++)
DIB_8BPP_PutPixel(DestSurf, DesX, count, color);
}
}
}
else
{
/* Draw one pixel on X - Led to the Des Zoom Out*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_24BPP_GetPixel(SourceSurf, sx, sy));
for (count=DesY;count<saveY;count++)
DIB_8BPP_PutPixel(DestSurf, DesX, count, color);
}
}
}
}
break;
case BMF_32BPP:
/* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */
/* This is a reference implementation, it hasn't been optimized for speed */
if (zoomX>1)
{
/* Draw one Hline on X - Led to the Des Zoom In*/
if (DesSizeX>SrcSizeX)
{
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_32BPP_GetPixel(SourceSurf, sx, sy));
saveX = DesX + zoomX;
for (count=DesY;count<saveY;count++)
DIB_8BPP_HLine(DestSurf, DesX, saveX, count, color);
}
}
}
else
{
/* Draw one Hline on X - Led to the Des Zoom Out*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_32BPP_GetPixel(SourceSurf, sx, sy));
saveX = DesX + zoomX;
for (count=DesY;count<saveY;count++)
DIB_8BPP_HLine(DestSurf, DesX, saveX, count, color);
}
}
}
}
else
{
if (DesSizeX>SrcSizeX)
{
/* Draw one pixel on X - Led to the Des Zoom In*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) SrcSizeX * (ULONG) DesX) / ((ULONG) DesSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_32BPP_GetPixel(SourceSurf, sx, sy));
for (count=DesY;count<saveY;count++)
DIB_8BPP_PutPixel(DestSurf, DesX, count, color);
}
}
}
else
{
/* Draw one pixel on X - Led to the Des Zoom Out*/
for (DesY=DestRect->bottom-zoomY; DesY>=0; DesY-=zoomY)
{
if (DesIsBiggerY)
sy = (int) ((ULONG) SrcSizeY * (ULONG) DesY) / ((ULONG) DesSizeY);
else
sy = (int) ((ULONG) DesSizeY * (ULONG) DesY) / ((ULONG) SrcSizeY);
if (sy > SourceRect->bottom) break;
saveY = DesY+zoomY;
for (DesX=DestRect->right-zoomX; DesX>=0; DesX-=zoomX)
{
sx = (int) ((ULONG) DesSizeX * (ULONG) DesX) / ((ULONG) SrcSizeX);
if (sx > SourceRect->right) break;
color = XLATEOBJ_iXlate(ColorTranslation, DIB_32BPP_GetPixel(SourceSurf, sx, sy));
for (count=DesY;count<saveY;count++)
DIB_8BPP_PutPixel(DestSurf, DesX, count, color);
}
}
}
}
break;
default:
DPRINT1("DIB_8BPP_StretchBlt: Unhandled Source BPP: %u\n", BitsPerFormat(SourceSurf->iBitmapFormat));
return FALSE;