From dc908bafd1e7d65a32738a0954068f8bd1c66631 Mon Sep 17 00:00:00 2001 From: Jason Filby Date: Sat, 28 Sep 2002 22:23:36 +0000 Subject: [PATCH] Perform color translation for 4BPP to 4BPP DIBs svn path=/trunk/; revision=3573 --- reactos/subsys/win32k/dib/dib4bpp.c | 17 +++-------------- reactos/subsys/win32k/eng/xlate.c | 3 +++ 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/reactos/subsys/win32k/dib/dib4bpp.c b/reactos/subsys/win32k/dib/dib4bpp.c index e9a7d948111..856ea0d537a 100644 --- a/reactos/subsys/win32k/dib/dib4bpp.c +++ b/reactos/subsys/win32k/dib/dib4bpp.c @@ -87,29 +87,18 @@ BOOLEAN DIB_To_4BPP_Bitblt( SURFOBJ *DestSurf, SURFOBJ *SourceSurf, break; case 4: - SourceBits_4BPP = SourceSurf->pvBits + (SourcePoint->y * SourceSurf->lDelta) + SourcePoint->x; + sy = SourcePoint->y; for (j=DestRect->top; jbottom; j++) { - SourceLine_4BPP = SourceBits_4BPP; - DestLine = DestBits; sx = SourcePoint->x; - f1 = sx & 1; - f2 = DestRect->left & 1; - - // FIXME: handle odd begin pixel for (i=DestRect->left; iright; i++) { - if(f1 == 1) { SourceLine_4BPP++; f1 = 0; } else { f1 = 1; } - if(f2 == 1) { DestLine++; f2 = 0; } else { f2 = 1; *DestLine = *SourceLine_4BPP; } + DIB_4BPP_PutPixel(DestSurf, i, j, XLATEOBJ_iXlate(ColorTranslation, DIB_4BPP_GetPixel(SourceSurf, sx, sy))); sx++; } - - // FIXME: handle odd end pixel - - SourceBits_4BPP += SourceSurf->lDelta; - DestBits += DestSurf->lDelta; + sy++; } break; diff --git a/reactos/subsys/win32k/eng/xlate.c b/reactos/subsys/win32k/eng/xlate.c index c49ed99bc6c..3022c56d477 100644 --- a/reactos/subsys/win32k/eng/xlate.c +++ b/reactos/subsys/win32k/eng/xlate.c @@ -232,6 +232,9 @@ XLATEOBJ_iXlate(XLATEOBJ *XlateObj, PALGDI *PalGDI; XLATEGDI *XlateGDI = (XLATEGDI*)AccessInternalObjectFromUserObject(XlateObj); + // Return the original color if there's no color translation object + if(!XlateObj) return Color; + if(XlateObj->flXlate & XO_TRIVIAL) { return Color;