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;