Implemented invisibleghost, deckx and decko drawing modes, and

improved ghost drawing mode.
This commit is contained in:
Sami Nopanen 2004-03-29 20:26:21 +00:00 committed by Alexandre Julliard
parent 74bd1e47ed
commit f6c513ca60
5 changed files with 670 additions and 646 deletions

View File

@ -30,6 +30,7 @@ d9.bmp
dj.bmp
dk.bmp
dq.bmp
free.bmp
h1.bmp
h10.bmp
h2.bmp
@ -57,4 +58,6 @@ s9.bmp
sj.bmp
sk.bmp
sq.bmp
theo.bmp
thex.bmp
version.res

View File

@ -42,6 +42,7 @@ RC_BINARIES = \
dj.bmp \
dk.bmp \
dq.bmp \
free.bmp \
h1.bmp \
h2.bmp \
h3.bmp \
@ -68,7 +69,9 @@ RC_BINARIES = \
s10.bmp \
sj.bmp \
sk.bmp \
sq.bmp
sq.bmp \
theo.bmp \
thex.bmp
@MAKE_DLL_RULES@

View File

@ -86,6 +86,8 @@ BOOL WINAPI cdtDrawExt(HDC hdc, int x, int y, int dx, int dy, int card, int mode
DWORD rasterOp = SRCCOPY;
BOOL roundCornersFlag;
COLORREF savedPixels[12];
BOOL eraseFlag = FALSE;
BOOL drawFlag = TRUE;
TRACE("(%p, %d, %d, %d, %d, %d, %d, %ld)\n", hdc, x, y, dx, dy, card, mode, color);
@ -105,17 +107,41 @@ BOOL WINAPI cdtDrawExt(HDC hdc, int x, int y, int dx, int dy, int card, int mode
return FALSE;
}
if(mode == MODE_INVISIBLEGHOST || mode == MODE_DECKX || mode == MODE_DECKO)
switch(mode)
{
FIXME("Mode %d not implemented.\n", mode);
return FALSE;
case MODE_FACEUP:
break;
case MODE_FACEDOWN:
break;
case MODE_HILITE:
rasterOp = NOTSRCCOPY;
break;
case MODE_GHOST:
card = CARD_FREE_MASK;
eraseFlag = TRUE;
rasterOp = SRCAND;
break;
case MODE_REMOVE:
eraseFlag = TRUE;
drawFlag = FALSE;
break;
case MODE_INVISIBLEGHOST:
card = CARD_FREE_MASK;
rasterOp = SRCAND;
break;
case MODE_DECKX:
card = CARD_BACK_THE_X;
break;
case MODE_DECKO:
card = CARD_BACK_THE_O;
break;
}
hMemoryDC = CreateCompatibleDC(hdc);
if(hMemoryDC == 0)
return FALSE;
if((mode == MODE_REMOVE) || (mode == MODE_GHOST))
if(eraseFlag)
{
HBRUSH hBrush;
RECT rect;
@ -125,18 +151,10 @@ BOOL WINAPI cdtDrawExt(HDC hdc, int x, int y, int dx, int dy, int card, int mode
rect.right = x + cardWidth - 1;
rect.bottom = y + cardHeight - 1;
FillRect(hdc, &rect, hBrush);
if(mode == MODE_GHOST)
{
hBrush = CreateSolidBrush(RGB(255, 255, 255));
FrameRect(hdc, &rect, hBrush);
}
}
else /* MODE_FACEUP, MODE_FACEDOWN, MODE_HILITE */
{
if(mode == MODE_HILITE)
rasterOp = NOTSRCCOPY;
if(drawFlag)
{
hCardBitmap = cardBitmaps[card];
if(hCardBitmap == 0)
return FALSE;
@ -204,7 +222,7 @@ BOOL WINAPI cdtDrawExt(HDC hdc, int x, int y, int dx, int dy, int card, int mode
* MODE_HILITE ; draw face up, with NOTSRCCOPY
* MODE_GHOST ; draw 'ghost' card
* MODE_REMOVE ; draw with background color
* MODE_INVISIBLEGHOST ; ?
* MODE_INVISIBLEGHOST ; draw 'ghost' card, without clearing background
* MODE_DECKX ; draw X
* MODE_DECKO ; draw O
*

View File

@ -29,9 +29,9 @@
/* 0-51 = normal 52 cards of deck */
/* 52 = ? */
/* 52 = ghost card mask */
/* 53-68 = card backs */
#define CARD_UNKNOWN 52
#define CARD_FREE_MASK 52
#define CARD_BACK_CROSSHATCH 53
#define CARD_BACK_WEAVE1 54
#define CARD_BACK_WEAVE2 55

File diff suppressed because it is too large Load Diff