From 07a3d1d8e37bbfa3be24c1422110c952a65590b2 Mon Sep 17 00:00:00 2001 From: David Welch Date: Fri, 1 Aug 2003 14:34:19 +0000 Subject: [PATCH] - Added a missing break - fixes nonmasked, non-pattern blits. - Added support for all vga to vga blit directions. svn path=/trunk/; revision=5365 --- .../drivers/dd/vga/display/objects/bitblt.c | 54 ++++++++++++++----- 1 file changed, 42 insertions(+), 12 deletions(-) diff --git a/reactos/drivers/dd/vga/display/objects/bitblt.c b/reactos/drivers/dd/vga/display/objects/bitblt.c index 363656b5393..7b485e2d3af 100644 --- a/reactos/drivers/dd/vga/display/objects/bitblt.c +++ b/reactos/drivers/dd/vga/display/objects/bitblt.c @@ -140,8 +140,7 @@ VGAtoVGA(SURFOBJ *Dest, SURFOBJ *Source, XLATEOBJ *ColorTranslation, RECTL *DestRect, POINTL *SourcePoint) { // FIXME: Use fast blts instead of get and putpixels - - int i, j, dx, dy, alterx, altery, BltDirection; + LONG i, j, dx, dy, alterx, altery, BltDirection; // Calculate deltas @@ -179,16 +178,46 @@ VGAtoVGA(SURFOBJ *Dest, SURFOBJ *Source, XLATEOBJ *ColorTranslation, } // Do the VGA to VGA BitBlt - // FIXME: Right now we're only doing CN_LEFTDOWN and we're using slow - // get and put pixel routines - - for(j=SourcePoint->y; jy+dy; j++) - { - for(i=SourcePoint->x; ix+dx; i++) - { - vgaPutPixel(i+alterx, j+altery, vgaGetPixel(i, j)); - } - } + // FIXME: we're using slow get and put pixel routines + switch (BltDirection) + { + case CD_LEFTDOWN: + for(j=SourcePoint->y; jy+dy; j++) + { + for(i=SourcePoint->x; ix+dx; i++) + { + vgaPutPixel(i+alterx, j+altery, vgaGetPixel(i, j)); + } + } + break; + case CD_LEFTUP: + for(j=(SourcePoint->y+dy-1); j>=SourcePoint->y; j--) + { + for(i=SourcePoint->x; ix+dx; i++) + { + vgaPutPixel(i+alterx, j+altery, vgaGetPixel(i, j)); + } + } + break; + case CD_RIGHTDOWN: + for(j=SourcePoint->y; jy+dy; j++) + { + for(i=(SourcePoint->x+dx-1); i>=SourcePoint->x; i--) + { + vgaPutPixel(i+alterx, j+altery, vgaGetPixel(i, j)); + } + } + break; + case CD_RIGHTUP: + for(j=(SourcePoint->y+dy-1); j>=SourcePoint->y; j--) + { + for(i=(SourcePoint->x+dx-1); i>=SourcePoint->x; i--) + { + vgaPutPixel(i+alterx, j+altery, vgaGetPixel(i, j)); + } + } + break; + } return TRUE; } @@ -413,6 +442,7 @@ DrvBitBlt(SURFOBJ *Dest, { return FALSE; } + break; case 0xAACC: BltRectFunc = VGADDI_BltMask;