mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 09:25:10 +00:00
little clean-up
svn path=/trunk/; revision=9006
This commit is contained in:
parent
586548d926
commit
54dbe4faf6
6 changed files with 69 additions and 105 deletions
|
@ -16,7 +16,7 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
/* $Id: dib16bpp.c,v 1.26 2004/04/07 10:19:34 weiden Exp $ */
|
||||
/* $Id: dib16bpp.c,v 1.27 2004/04/07 15:37:49 weiden Exp $ */
|
||||
#undef WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#include <stdlib.h>
|
||||
|
@ -286,7 +286,7 @@ DIB_16BPP_BitBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
|
|||
ULONG wd, Dest, Source, Pattern = 0, PatternY;
|
||||
PULONG DestBits;
|
||||
BOOL UsesSource;
|
||||
BOOL UsesPattern, CalcPattern;
|
||||
BOOL UsesPattern;
|
||||
ULONG RoundedRight;
|
||||
/* Pattern brushes */
|
||||
PGDIBRUSHOBJ GdiBrush;
|
||||
|
@ -307,14 +307,10 @@ DIB_16BPP_BitBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
|
|||
}
|
||||
|
||||
UsesSource = ((Rop4 & 0xCC0000) >> 2) != (Rop4 & 0x330000);
|
||||
UsesPattern = ((Rop4 & 0xF00000) >> 4) != (Rop4 & 0x0F0000);
|
||||
UsesPattern = (((Rop4 & 0xF00000) >> 4) != (Rop4 & 0x0F0000)) && Brush;
|
||||
|
||||
if ((CalcPattern = UsesPattern))
|
||||
if (UsesPattern)
|
||||
{
|
||||
if (Brush == NULL)
|
||||
{
|
||||
UsesPattern = CalcPattern = FALSE;
|
||||
} else
|
||||
if (Brush->iSolidColor == 0xFFFFFFFF)
|
||||
{
|
||||
PBITMAPOBJ PatternBitmap;
|
||||
|
@ -331,11 +327,12 @@ DIB_16BPP_BitBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
|
|||
PatternObj = (PSURFOBJ)AccessUserObject((ULONG)PatternSurface);
|
||||
PatternWidth = PatternObj->sizlBitmap.cx;
|
||||
PatternHeight = PatternObj->sizlBitmap.cy;
|
||||
CalcPattern = TRUE;
|
||||
|
||||
UsesPattern = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
CalcPattern = FALSE;
|
||||
UsesPattern = FALSE;
|
||||
Pattern = (Brush->iSolidColor & 0xFFFF) |
|
||||
((Brush->iSolidColor & 0xFFFF) << 16);
|
||||
}
|
||||
|
@ -353,7 +350,7 @@ DIB_16BPP_BitBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
|
|||
{
|
||||
SourceX = SourcePoint->x;
|
||||
|
||||
if(CalcPattern)
|
||||
if(UsesPattern)
|
||||
PatternY = Y % PatternHeight;
|
||||
|
||||
for (X = DestRect->left; X < RoundedRight; X += 2, DestBits++, SourceX += 2)
|
||||
|
@ -366,7 +363,7 @@ DIB_16BPP_BitBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
|
|||
Source |= DIB_GetSource(SourceSurf, SourceGDI, SourceX + 1, SourceY, ColorTranslation) << 16;
|
||||
}
|
||||
|
||||
if (UsesPattern && (Brush->iSolidColor == 0xFFFFFFFF))
|
||||
if (UsesPattern)
|
||||
{
|
||||
Pattern = (DIB_1BPP_GetPixel(PatternObj, X % PatternWidth, PatternY) ? GdiBrush->crFore : GdiBrush->crBack);
|
||||
Pattern |= (DIB_1BPP_GetPixel(PatternObj, (X + 1) % PatternWidth, PatternY) ? GdiBrush->crFore : GdiBrush->crBack) << 16;
|
||||
|
@ -386,10 +383,7 @@ DIB_16BPP_BitBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
|
|||
|
||||
if (UsesPattern)
|
||||
{
|
||||
if (Brush->iSolidColor == 0xFFFFFFFF)
|
||||
Pattern = DIB_1BPP_GetPixel(PatternObj, X % PatternWidth, PatternY) ? GdiBrush->crFore : GdiBrush->crBack;
|
||||
else
|
||||
Pattern = Brush->iSolidColor & 0xFFFF;
|
||||
Pattern = DIB_1BPP_GetPixel(PatternObj, X % PatternWidth, PatternY) ? GdiBrush->crFore : GdiBrush->crBack;
|
||||
}
|
||||
|
||||
DIB_16BPP_PutPixel(DestSurf, X, Y, DIB_DoRop(Rop4, Dest, Source, Pattern) & 0xFFFF);
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
/* $Id: dib1bpp.c,v 1.20 2004/04/07 10:19:34 weiden Exp $ */
|
||||
/* $Id: dib1bpp.c,v 1.21 2004/04/07 15:37:50 weiden Exp $ */
|
||||
|
||||
#undef WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
|
@ -357,7 +357,7 @@ DIB_1BPP_BitBlt(
|
|||
ULONG Dest, Source, Pattern = 0;
|
||||
PULONG DestBits;
|
||||
BOOL UsesSource;
|
||||
BOOL UsesPattern, CalcPattern;
|
||||
BOOL UsesPattern;
|
||||
ULONG RoundedRight;
|
||||
BYTE NoBits;
|
||||
/* Pattern brushes */
|
||||
|
@ -379,14 +379,10 @@ DIB_1BPP_BitBlt(
|
|||
}
|
||||
|
||||
UsesSource = ((Rop4 & 0xCC0000) >> 2) != (Rop4 & 0x330000);
|
||||
UsesPattern = ((Rop4 & 0xF00000) >> 4) != (Rop4 & 0x0F0000);
|
||||
UsesPattern = (((Rop4 & 0xF00000) >> 4) != (Rop4 & 0x0F0000)) && Brush;
|
||||
|
||||
if ((CalcPattern = UsesPattern))
|
||||
if (UsesPattern)
|
||||
{
|
||||
if (Brush == NULL)
|
||||
{
|
||||
UsesPattern = CalcPattern = FALSE;
|
||||
} else
|
||||
if (Brush->iSolidColor == 0xFFFFFFFF)
|
||||
{
|
||||
PBITMAPOBJ PatternBitmap;
|
||||
|
@ -404,11 +400,11 @@ DIB_1BPP_BitBlt(
|
|||
PatternWidth = PatternObj->sizlBitmap.cx;
|
||||
PatternHeight = PatternObj->sizlBitmap.cy;
|
||||
|
||||
CalcPattern = TRUE;
|
||||
UsesPattern = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
CalcPattern = FALSE;
|
||||
UsesPattern = FALSE;
|
||||
Pattern = Brush->iSolidColor;
|
||||
}
|
||||
}
|
||||
|
@ -426,7 +422,7 @@ DIB_1BPP_BitBlt(
|
|||
(DestRect->left >> 3) +
|
||||
Y * DestSurf->lDelta);
|
||||
|
||||
if(CalcPattern)
|
||||
if(UsesPattern)
|
||||
PatternY = Y % PatternHeight;
|
||||
|
||||
X = DestRect->left;
|
||||
|
@ -444,7 +440,7 @@ DIB_1BPP_BitBlt(
|
|||
Source |= (DIB_GetSource(SourceSurf, SourceGDI, SourceX + k, SourceY, ColorTranslation) << (31 - k));
|
||||
}
|
||||
|
||||
if (UsesPattern && (Brush->iSolidColor == 0xFFFFFFFF))
|
||||
if (UsesPattern)
|
||||
{
|
||||
Pattern = 0;
|
||||
for (k = 31 - NoBits; k < NoBits; k++)
|
||||
|
@ -479,16 +475,13 @@ DIB_1BPP_BitBlt(
|
|||
|
||||
if (UsesPattern)
|
||||
{
|
||||
if (Brush->iSolidColor == 0xFFFFFFFF)
|
||||
Pattern = 0;
|
||||
for (k = 0; k < 8; k++)
|
||||
{
|
||||
Pattern = 0;
|
||||
for (k = 0; k < 8; k++)
|
||||
{
|
||||
Pattern |= (DIB_1BPP_GetPixel(PatternObj, (X + k) % PatternWidth, Y % PatternHeight) << (7 - k));
|
||||
Pattern |= (DIB_1BPP_GetPixel(PatternObj, (X + k + 8) % PatternWidth, Y % PatternHeight) << (8 + (7 - k)));
|
||||
Pattern |= (DIB_1BPP_GetPixel(PatternObj, (X + k + 16) % PatternWidth, Y % PatternHeight) << (16 + (7 - k)));
|
||||
Pattern |= (DIB_1BPP_GetPixel(PatternObj, (X + k + 24) % PatternWidth, Y % PatternHeight) << (24 + (7 - k)));
|
||||
}
|
||||
Pattern |= (DIB_1BPP_GetPixel(PatternObj, (X + k) % PatternWidth, Y % PatternHeight) << (7 - k));
|
||||
Pattern |= (DIB_1BPP_GetPixel(PatternObj, (X + k + 8) % PatternWidth, Y % PatternHeight) << (8 + (7 - k)));
|
||||
Pattern |= (DIB_1BPP_GetPixel(PatternObj, (X + k + 16) % PatternWidth, Y % PatternHeight) << (16 + (7 - k)));
|
||||
Pattern |= (DIB_1BPP_GetPixel(PatternObj, (X + k + 24) % PatternWidth, Y % PatternHeight) << (24 + (7 - k)));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -508,7 +501,7 @@ DIB_1BPP_BitBlt(
|
|||
Source = DIB_GetSource(SourceSurf, SourceGDI, SourceX, SourceY, ColorTranslation);
|
||||
}
|
||||
|
||||
if (UsesPattern && (Brush->iSolidColor == 0xFFFFFFFF))
|
||||
if (UsesPattern)
|
||||
{
|
||||
Pattern = DIB_1BPP_GetPixel(PatternObj, X % PatternWidth, Y % PatternHeight);
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
/* $Id: dib24bpp.c,v 1.22 2004/04/07 10:19:34 weiden Exp $ */
|
||||
/* $Id: dib24bpp.c,v 1.23 2004/04/07 15:37:50 weiden Exp $ */
|
||||
#undef WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#include <stdlib.h>
|
||||
|
@ -258,7 +258,7 @@ DIB_24BPP_BitBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
|
|||
ULONG Dest, Source, Pattern = 0, PatternY;
|
||||
PBYTE DestBits;
|
||||
BOOL UsesSource;
|
||||
BOOL UsesPattern, CalcPattern;
|
||||
BOOL UsesPattern;
|
||||
/* Pattern brushes */
|
||||
PGDIBRUSHOBJ GdiBrush;
|
||||
HBITMAP PatternSurface = NULL;
|
||||
|
@ -278,14 +278,10 @@ DIB_24BPP_BitBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
|
|||
}
|
||||
|
||||
UsesSource = ((Rop4 & 0xCC0000) >> 2) != (Rop4 & 0x330000);
|
||||
UsesPattern = ((Rop4 & 0xF00000) >> 4) != (Rop4 & 0x0F0000);
|
||||
UsesPattern = (((Rop4 & 0xF00000) >> 4) != (Rop4 & 0x0F0000)) && Brush;
|
||||
|
||||
if ((CalcPattern = UsesPattern))
|
||||
if (UsesPattern)
|
||||
{
|
||||
if (Brush == NULL)
|
||||
{
|
||||
UsesPattern = CalcPattern = FALSE;
|
||||
} else
|
||||
if (Brush->iSolidColor == 0xFFFFFFFF)
|
||||
{
|
||||
PBITMAPOBJ PatternBitmap;
|
||||
|
@ -303,11 +299,11 @@ DIB_24BPP_BitBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
|
|||
PatternWidth = PatternObj->sizlBitmap.cx;
|
||||
PatternHeight = PatternObj->sizlBitmap.cy;
|
||||
|
||||
CalcPattern = TRUE;
|
||||
UsesPattern = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
CalcPattern = FALSE;
|
||||
UsesPattern = FALSE;
|
||||
Pattern = Brush->iSolidColor;
|
||||
}
|
||||
}
|
||||
|
@ -322,7 +318,7 @@ DIB_24BPP_BitBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
|
|||
{
|
||||
SourceX = SourcePoint->x;
|
||||
|
||||
if(CalcPattern)
|
||||
if(UsesPattern)
|
||||
PatternY = Y % PatternHeight;
|
||||
|
||||
for (X = DestRect->left; X < DestRect->right; X++, DestBits += 3, SourceX++)
|
||||
|
@ -336,10 +332,7 @@ DIB_24BPP_BitBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
|
|||
|
||||
if (UsesPattern)
|
||||
{
|
||||
if (Brush->iSolidColor == 0xFFFFFFFF)
|
||||
{
|
||||
Pattern = DIB_1BPP_GetPixel(PatternObj, X % PatternWidth, PatternY) ? GdiBrush->crFore : GdiBrush->crBack;
|
||||
}
|
||||
Pattern = DIB_1BPP_GetPixel(PatternObj, X % PatternWidth, PatternY) ? GdiBrush->crFore : GdiBrush->crBack;
|
||||
}
|
||||
|
||||
Dest = DIB_DoRop(Rop4, Dest, Source, Pattern) & 0xFFFFFF;
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
/* $Id: dib32bpp.c,v 1.22 2004/04/07 10:19:34 weiden Exp $ */
|
||||
/* $Id: dib32bpp.c,v 1.23 2004/04/07 15:37:50 weiden Exp $ */
|
||||
#undef WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#include <stdlib.h>
|
||||
|
@ -307,7 +307,7 @@ DIB_32BPP_BitBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
|
|||
ULONG Dest, Source, Pattern = 0, wd;
|
||||
PULONG DestBits;
|
||||
BOOL UsesSource;
|
||||
BOOL UsesPattern, CalcPattern;
|
||||
BOOL UsesPattern;
|
||||
/* Pattern brushes */
|
||||
PGDIBRUSHOBJ GdiBrush;
|
||||
HBITMAP PatternSurface = NULL;
|
||||
|
@ -327,14 +327,10 @@ DIB_32BPP_BitBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
|
|||
}
|
||||
|
||||
UsesSource = ((Rop4 & 0xCC0000) >> 2) != (Rop4 & 0x330000);
|
||||
UsesPattern = ((Rop4 & 0xF00000) >> 4) != (Rop4 & 0x0F0000);
|
||||
UsesPattern = (((Rop4 & 0xF00000) >> 4) != (Rop4 & 0x0F0000)) && Brush;
|
||||
|
||||
if ((CalcPattern = UsesPattern))
|
||||
if (UsesPattern)
|
||||
{
|
||||
if (Brush == NULL)
|
||||
{
|
||||
UsesPattern = CalcPattern = FALSE;
|
||||
} else
|
||||
if (Brush->iSolidColor == 0xFFFFFFFF)
|
||||
{
|
||||
PBITMAPOBJ PatternBitmap;
|
||||
|
@ -352,11 +348,11 @@ DIB_32BPP_BitBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
|
|||
PatternWidth = PatternObj->sizlBitmap.cx;
|
||||
PatternHeight = PatternObj->sizlBitmap.cy;
|
||||
|
||||
CalcPattern = TRUE;
|
||||
UsesPattern = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
CalcPattern = FALSE;
|
||||
UsesPattern = FALSE;
|
||||
Pattern = Brush->iSolidColor;
|
||||
}
|
||||
}
|
||||
|
@ -373,7 +369,7 @@ DIB_32BPP_BitBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
|
|||
ULONG PatternY;
|
||||
SourceX = SourcePoint->x;
|
||||
|
||||
if(CalcPattern)
|
||||
if(UsesPattern)
|
||||
PatternY = Y % PatternHeight;
|
||||
|
||||
for (X = DestRect->left; X < DestRect->right; X++, DestBits++, SourceX++)
|
||||
|
@ -385,7 +381,7 @@ DIB_32BPP_BitBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
|
|||
Source = DIB_GetSource(SourceSurf, SourceGDI, SourceX, SourceY, ColorTranslation);
|
||||
}
|
||||
|
||||
if (UsesPattern && (Brush->iSolidColor == 0xFFFFFFFF))
|
||||
if (UsesPattern)
|
||||
{
|
||||
Pattern = DIB_1BPP_GetPixel(PatternObj, X % PatternWidth, PatternY) ? GdiBrush->crFore : GdiBrush->crBack;
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
/* $Id: dib4bpp.c,v 1.28 2004/04/07 14:43:08 weiden Exp $ */
|
||||
/* $Id: dib4bpp.c,v 1.29 2004/04/07 15:37:50 weiden Exp $ */
|
||||
#undef WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#include <stdlib.h>
|
||||
|
@ -242,7 +242,7 @@ DIB_4BPP_BitBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
|
|||
ULONG Dest, Source, Pattern = 0, PatternY;
|
||||
PULONG DestBits;
|
||||
BOOL UsesSource;
|
||||
BOOL UsesPattern, CalcPattern;
|
||||
BOOL UsesPattern;
|
||||
LONG RoundedRight;
|
||||
/* Pattern brushes */
|
||||
PGDIBRUSHOBJ GdiBrush;
|
||||
|
@ -282,14 +282,10 @@ DIB_4BPP_BitBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
|
|||
}
|
||||
|
||||
UsesSource = ((Rop4 & 0xCC0000) >> 2) != (Rop4 & 0x330000);
|
||||
UsesPattern = ((Rop4 & 0xF00000) >> 4) != (Rop4 & 0x0F0000);
|
||||
UsesPattern = (((Rop4 & 0xF00000) >> 4) != (Rop4 & 0x0F0000)) && Brush;
|
||||
|
||||
if ((CalcPattern = UsesPattern))
|
||||
if (UsesPattern)
|
||||
{
|
||||
if (Brush == NULL)
|
||||
{
|
||||
UsesPattern = CalcPattern = FALSE;
|
||||
} else
|
||||
if (Brush->iSolidColor == 0xFFFFFFFF)
|
||||
{
|
||||
PBITMAPOBJ PatternBitmap;
|
||||
|
@ -306,11 +302,12 @@ DIB_4BPP_BitBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
|
|||
PatternObj = (PSURFOBJ)AccessUserObject((ULONG)PatternSurface);
|
||||
PatternWidth = PatternObj->sizlBitmap.cx;
|
||||
PatternHeight = PatternObj->sizlBitmap.cy;
|
||||
CalcPattern = TRUE;
|
||||
|
||||
UsesPattern = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
CalcPattern = FALSE;
|
||||
UsesPattern = FALSE;
|
||||
Pattern = ExpandSolidColor[Brush->iSolidColor & 0xF];
|
||||
}
|
||||
}
|
||||
|
@ -324,7 +321,7 @@ DIB_4BPP_BitBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
|
|||
sx = SourcePoint->x;
|
||||
i = DestRect->left;
|
||||
|
||||
if(CalcPattern)
|
||||
if(UsesPattern)
|
||||
PatternY = j % PatternHeight;
|
||||
|
||||
if (i & 0x1)
|
||||
|
@ -336,7 +333,7 @@ DIB_4BPP_BitBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
|
|||
Source = DIB_GetSource(SourceSurf, SourceGDI, sx, sy, ColorTranslation);
|
||||
}
|
||||
|
||||
if (UsesPattern && (Brush->iSolidColor == 0xFFFFFFFF))
|
||||
if (UsesPattern)
|
||||
{
|
||||
Pattern = DIB_1BPP_GetPixel(PatternObj, i % PatternWidth, PatternY) ? GdiBrush->crFore : GdiBrush->crBack;
|
||||
}
|
||||
|
@ -365,17 +362,14 @@ DIB_4BPP_BitBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
|
|||
}
|
||||
if (UsesPattern)
|
||||
{
|
||||
if (Brush->iSolidColor == 0xFFFFFFFF)
|
||||
{
|
||||
Pattern = DIB_1BPP_GetPixel(PatternObj, i % PatternWidth, PatternY) ? GdiBrush->crFore : GdiBrush->crBack;
|
||||
Pattern |= (DIB_1BPP_GetPixel(PatternObj, (i + 1) % PatternWidth, PatternY) ? GdiBrush->crFore : GdiBrush->crBack) << 4;
|
||||
Pattern |= (DIB_1BPP_GetPixel(PatternObj, (i + 2) % PatternWidth, PatternY) ? GdiBrush->crFore : GdiBrush->crBack) << 8;
|
||||
Pattern |= (DIB_1BPP_GetPixel(PatternObj, (i + 3) % PatternWidth, PatternY) ? GdiBrush->crFore : GdiBrush->crBack) << 12;
|
||||
Pattern |= (DIB_1BPP_GetPixel(PatternObj, (i + 4) % PatternWidth, PatternY) ? GdiBrush->crFore : GdiBrush->crBack) << 16;
|
||||
Pattern |= (DIB_1BPP_GetPixel(PatternObj, (i + 5) % PatternWidth, PatternY) ? GdiBrush->crFore : GdiBrush->crBack) << 20;
|
||||
Pattern |= (DIB_1BPP_GetPixel(PatternObj, (i + 6) % PatternWidth, PatternY) ? GdiBrush->crFore : GdiBrush->crBack) << 24;
|
||||
Pattern |= (DIB_1BPP_GetPixel(PatternObj, (i + 7) % PatternWidth, PatternY) ? GdiBrush->crFore : GdiBrush->crBack) << 28;
|
||||
}
|
||||
Pattern = DIB_1BPP_GetPixel(PatternObj, i % PatternWidth, PatternY) ? GdiBrush->crFore : GdiBrush->crBack;
|
||||
Pattern |= (DIB_1BPP_GetPixel(PatternObj, (i + 1) % PatternWidth, PatternY) ? GdiBrush->crFore : GdiBrush->crBack) << 4;
|
||||
Pattern |= (DIB_1BPP_GetPixel(PatternObj, (i + 2) % PatternWidth, PatternY) ? GdiBrush->crFore : GdiBrush->crBack) << 8;
|
||||
Pattern |= (DIB_1BPP_GetPixel(PatternObj, (i + 3) % PatternWidth, PatternY) ? GdiBrush->crFore : GdiBrush->crBack) << 12;
|
||||
Pattern |= (DIB_1BPP_GetPixel(PatternObj, (i + 4) % PatternWidth, PatternY) ? GdiBrush->crFore : GdiBrush->crBack) << 16;
|
||||
Pattern |= (DIB_1BPP_GetPixel(PatternObj, (i + 5) % PatternWidth, PatternY) ? GdiBrush->crFore : GdiBrush->crBack) << 20;
|
||||
Pattern |= (DIB_1BPP_GetPixel(PatternObj, (i + 6) % PatternWidth, PatternY) ? GdiBrush->crFore : GdiBrush->crBack) << 24;
|
||||
Pattern |= (DIB_1BPP_GetPixel(PatternObj, (i + 7) % PatternWidth, PatternY) ? GdiBrush->crFore : GdiBrush->crBack) << 28;
|
||||
}
|
||||
*DestBits = DIB_DoRop(Rop4, Dest, Source, Pattern);
|
||||
}
|
||||
|
@ -388,7 +382,7 @@ DIB_4BPP_BitBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
|
|||
{
|
||||
Source = DIB_GetSource(SourceSurf, SourceGDI, sx, sy, ColorTranslation);
|
||||
}
|
||||
if (UsesPattern && (Brush->iSolidColor == 0xFFFFFFFF))
|
||||
if (UsesPattern)
|
||||
{
|
||||
Pattern = DIB_1BPP_GetPixel(PatternObj, i % PatternWidth, PatternY) ? GdiBrush->crFore : GdiBrush->crBack;
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
/* $Id: dib8bpp.c,v 1.20 2004/04/07 10:19:34 weiden Exp $ */
|
||||
/* $Id: dib8bpp.c,v 1.21 2004/04/07 15:37:50 weiden Exp $ */
|
||||
#undef WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#include <stdlib.h>
|
||||
|
@ -280,7 +280,7 @@ DIB_8BPP_BitBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
|
|||
ULONG Dest, Source, Pattern = 0, PatternY;
|
||||
PULONG DestBits;
|
||||
BOOL UsesSource;
|
||||
BOOL UsesPattern, CalcPattern;
|
||||
BOOL UsesPattern;
|
||||
LONG RoundedRight;
|
||||
/* Pattern brushes */
|
||||
PGDIBRUSHOBJ GdiBrush;
|
||||
|
@ -301,14 +301,10 @@ DIB_8BPP_BitBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
|
|||
}
|
||||
|
||||
UsesSource = ((Rop4 & 0xCC0000) >> 2) != (Rop4 & 0x330000);
|
||||
UsesPattern = ((Rop4 & 0xF00000) >> 4) != (Rop4 & 0x0F0000);
|
||||
UsesPattern = (((Rop4 & 0xF00000) >> 4) != (Rop4 & 0x0F0000)) && Brush;
|
||||
|
||||
if ((CalcPattern = UsesPattern))
|
||||
if (UsesPattern)
|
||||
{
|
||||
if (Brush == NULL)
|
||||
{
|
||||
UsesPattern = CalcPattern = FALSE;
|
||||
} else
|
||||
if (Brush->iSolidColor == 0xFFFFFFFF)
|
||||
{
|
||||
PBITMAPOBJ PatternBitmap;
|
||||
|
@ -325,11 +321,12 @@ DIB_8BPP_BitBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
|
|||
PatternObj = (PSURFOBJ)AccessUserObject((ULONG)PatternSurface);
|
||||
PatternWidth = PatternObj->sizlBitmap.cx;
|
||||
PatternHeight = PatternObj->sizlBitmap.cy;
|
||||
CalcPattern = TRUE;
|
||||
|
||||
UsesPattern = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
CalcPattern = FALSE;
|
||||
UsesPattern = FALSE;
|
||||
Pattern = (Brush->iSolidColor & 0xFF) |
|
||||
((Brush->iSolidColor & 0xFF) << 8) |
|
||||
((Brush->iSolidColor & 0xFF) << 16) |
|
||||
|
@ -345,7 +342,7 @@ DIB_8BPP_BitBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
|
|||
sx = SourcePoint->x;
|
||||
DestBits = (PULONG)(DestSurf->pvScan0 + DestRect->left + j * DestSurf->lDelta);
|
||||
|
||||
if(CalcPattern)
|
||||
if(UsesPattern)
|
||||
PatternY = j % PatternHeight;
|
||||
|
||||
for (i = DestRect->left; i < RoundedRight; i += 4, DestBits++)
|
||||
|
@ -359,7 +356,7 @@ DIB_8BPP_BitBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
|
|||
Source |= (DIB_GetSource(SourceSurf, SourceGDI, sx + (i - DestRect->left) + k, sy, ColorTranslation) << (k * 8));
|
||||
}
|
||||
|
||||
if (UsesPattern && (Brush->iSolidColor == 0xFFFFFFFF))
|
||||
if (UsesPattern)
|
||||
{
|
||||
Pattern = DIB_1BPP_GetPixel(PatternObj, i % PatternWidth, PatternY) ? GdiBrush->crFore : GdiBrush->crBack;
|
||||
Pattern |= (DIB_1BPP_GetPixel(PatternObj, (i + 1) % PatternWidth, PatternY) ? GdiBrush->crFore : GdiBrush->crBack) << 8;
|
||||
|
@ -381,10 +378,7 @@ DIB_8BPP_BitBlt(SURFOBJ *DestSurf, SURFOBJ *SourceSurf,
|
|||
|
||||
if (UsesPattern)
|
||||
{
|
||||
if (Brush->iSolidColor == 0xFFFFFFFF)
|
||||
Pattern = DIB_1BPP_GetPixel(PatternObj, i % PatternWidth,PatternY) ? GdiBrush->crFore : GdiBrush->crBack;
|
||||
else
|
||||
Pattern = Brush->iSolidColor & 0xFF;
|
||||
Pattern = DIB_1BPP_GetPixel(PatternObj, i % PatternWidth,PatternY) ? GdiBrush->crFore : GdiBrush->crBack;
|
||||
}
|
||||
|
||||
DIB_8BPP_PutPixel(DestSurf, i, j, DIB_DoRop(Rop4, Dest, Source, Pattern) & 0xFFFF);
|
||||
|
|
Loading…
Reference in a new issue