#include <win32k/debug.h>
#include <debug.h>
#include <ddk/winddi.h>
-#include "..\eng\objects.h"
+#include "../eng/objects.h"
#include "dib.h"
-VOID DIB_24BPP_PutPixel(PSURFOBJ SurfObj, LONG x, LONG y, RGBTRIPLE c)
+PFN_DIB_PutPixel DIB_24BPP_PutPixel(PSURFOBJ SurfObj, LONG x, LONG y, ULONG c)
{
PBYTE byteaddr = SurfObj->pvBits + y * SurfObj->lDelta;
PRGBTRIPLE addr = (PRGBTRIPLE)byteaddr + x;
- *addr = c;
+ *(PULONG)(addr) = c;
}
-RGBTRIPLE DIB_24BPP_GetPixel(PSURFOBJ SurfObj, LONG x, LONG y)
+PFN_DIB_GetPixel DIB_24BPP_GetPixel(PSURFOBJ SurfObj, LONG x, LONG y)
{
PBYTE byteaddr = SurfObj->pvBits + y * SurfObj->lDelta;
PRGBTRIPLE addr = (PRGBTRIPLE)byteaddr + x;
- return *addr;
+ return (PFN_DIB_GetPixel)(*(PULONG)(addr));
}
-VOID DIB_24BPP_HLine(PSURFOBJ SurfObj, LONG x1, LONG x2, LONG y, RGBTRIPLE c)
+PFN_DIB_HLine DIB_24BPP_HLine(PSURFOBJ SurfObj, LONG x1, LONG x2, LONG y, ULONG c)
{
PBYTE byteaddr = SurfObj->pvBits + y * SurfObj->lDelta;
PRGBTRIPLE addr = (PRGBTRIPLE)byteaddr + x1;
LONG cx = x1;
while(cx <= x2) {
- *addr = c;
+ *(PULONG)(addr) = c;
++addr;
++cx;
}
}
-VOID DIB_24BPP_VLine(PSURFOBJ SurfObj, LONG x, LONG y1, LONG y2, RGBTRIPLE c)
+PFN_DIB_VLine DIB_24BPP_VLine(PSURFOBJ SurfObj, LONG x, LONG y1, LONG y2, ULONG c)
{
PBYTE byteaddr = SurfObj->pvBits + y1 * SurfObj->lDelta;
PRGBTRIPLE addr = (PRGBTRIPLE)byteaddr + x;
byteaddr = (PBYTE)addr;
while(y1++ <= y2) {
- *addr = c;
+ *(PULONG)(addr) = c;
byteaddr += lDelta;
addr = (PRGBTRIPLE)byteaddr;
PRECTL DestRect, POINTL *SourcePoint,
ULONG Delta, XLATEOBJ *ColorTranslation)
{
- ULONG i, j, sx, xColor, f1;
+ ULONG i, j, sx, sy, xColor, f1;
PBYTE DestBits, SourceBits_24BPP, DestLine, SourceLine_24BPP;
PRGBTRIPLE SPDestBits, SPSourceBits_24BPP, SPDestLine, SPSourceLine_24BPP; // specially for 24-to-24 blit
PBYTE SourceBits_4BPP, SourceBits_8BPP, SourceLine_4BPP, SourceLine_8BPP;
switch(SourceGDI->BitsPerPixel)
{
+ case 1:
+ sx = SourcePoint->x;
+ sy = SourcePoint->y;
+
+ for (j=DestRect->top; j<DestRect->bottom; j++)
+ {
+ sx = SourcePoint->x;
+ for (i=DestRect->left; i<DestRect->right; i++)
+ {
+ if(DIB_1BPP_GetPixel(SourceSurf, sx, sy) == 0)
+ {
+ DIB_24BPP_PutPixel(DestSurf, i, j, XLATEOBJ_iXlate(ColorTranslation, 0));
+ } else {
+ DIB_24BPP_PutPixel(DestSurf, i, j, XLATEOBJ_iXlate(ColorTranslation, 1));
+ }
+ sx++;
+ }
+ sy++;
+ }
+ break;
+
case 4:
SourceBits_4BPP = SourceSurf->pvBits + (SourcePoint->y * SourceSurf->lDelta) + SourcePoint->x;