- Fix a bug in Solitaire: When you used the 1-card-mode before, there never was a card behind the one, which you drag from the pile.

Now Solitaire collects all the cards from the deck in the 1-card-mode like Windows Solitaire does.
- Make it possible to use CS_EI_CIRC (the O sign) and CS_EI_X (the X sign) as empty images for a deck.
  Actually make use of CS_EI_CIRC for the Solitaire deck.

svn path=/trunk/; revision=29663
This commit is contained in:
Colin Finck 2007-10-18 21:54:39 +00:00
parent 33aa43c80f
commit e82f596e25
5 changed files with 36 additions and 12 deletions

View file

@ -8,15 +8,14 @@ void CardLib_SetZoomSpeed(int);
#define CS_EI_NONE 0
#define CS_EI_SUNK 1
#define CS_EI_CIRC 67
#define CS_EI_X 66
#define CS_DEFXOFF 12 //x-offset
#define CS_DEFYOFF 18 //y-offset
#define CS_NO3D 1 //default 3d counts (recommened)
#define CS_DEF3D 10 //(best for decks)
//#define CS_EI_CIRC 2
//#define CS_EI_X 3
#define CS_DRAG_NONE 0
#define CS_DRAG_TOP 1
#define CS_DRAG_ALL 2

View file

@ -365,7 +365,10 @@ void CardRegion::SetEmptyImage(UINT uImage)
{
switch(uImage)
{
case CS_EI_NONE: case CS_EI_SUNK:
case CS_EI_NONE:
case CS_EI_SUNK:
case CS_EI_CIRC:
case CS_EI_X:
uEmptyImage = uImage;
break;

View file

@ -347,16 +347,22 @@ void CardRegion::Render(HDC hdc)
switch(uEmptyImage)
{
default: case CS_EI_NONE:
default:
case CS_EI_NONE:
//this wipes the RECT variable, so watch out!
//SetRect(&rect, x, y, x+__cardwidth, y+__cardheight);
//PaintRect(hdc, &rect, MAKE_PALETTERGB(crBackgnd));
parentWnd.PaintCardRgn(hdc, x, y, __cardwidth, __cardheight, x, y);
break;
case CS_EI_SUNK: //case CS_EI_CIRC: case CS_EI_X:
case CS_EI_SUNK:
DrawCard(hdc, x, y, __hdcPlaceHolder, __cardwidth, __cardheight);
break;
case CS_EI_CIRC:
case CS_EI_X:
CardBlt(hdc, x, y, uEmptyImage);
break;
}
}
@ -466,6 +472,11 @@ void CardRegion::PrepareDragBitmaps(int numtodrag)
case CS_EI_SUNK:
DrawCard(hdcBackGnd, xoff, yoff, __hdcPlaceHolder, __cardwidth, __cardheight);
break;
case CS_EI_CIRC:
case CS_EI_X:
CardBlt(hdc, xoff, yoff, uEmptyImage);
break;
}
}
@ -559,7 +570,7 @@ void CardRegion::PrepareDragBitmapsThreed(int numtodrag)
//
// If there are no cards under this one, just draw the place holder
//
if(numcards == 0)
if(numcards == 0)
{
switch(uEmptyImage)
{
@ -573,7 +584,11 @@ void CardRegion::PrepareDragBitmapsThreed(int numtodrag)
case CS_EI_SUNK:
DrawCard(hdcBackGnd, 0, 0, __hdcPlaceHolder, __cardwidth, __cardheight);
break;
case CS_EI_CIRC:
case CS_EI_X:
CardBlt(hdc, 0, 0, uEmptyImage);
break;
}
}

View file

@ -30,7 +30,7 @@ void CreateSol()
yRowStackCardOffset = (int)(__cardheight / 6.7);
pDeck = SolWnd.CreateRegion(DECK_ID, true, X_BORDER, Y_BORDER, 2, 1);
pDeck->SetEmptyImage(CS_EI_SUNK);
pDeck->SetEmptyImage(CS_EI_CIRC);
pDeck->SetThreedCount(6);
pDeck->SetDragRule(CS_DRAG_NONE, 0);
pDeck->SetDropRule(CS_DROP_NONE, 0);

View file

@ -50,7 +50,11 @@ void NewGame(void)
//put the other cards onto the deck
pDeck->SetCardStack(deck);
pDeck->Update();
// For the 1-card-mode, all cards need to be completely overlapped
if(!(dwOptions & OPTION_THREE_CARDS))
pPile->SetOffsets(0, 0);
SolWnd.Redraw();
fGameStarted = false;
@ -331,7 +335,8 @@ void CARDLIBPROC DeckClickProc(CardRegion &stackobj, int iNumClicked)
fGameStarted = true;
//reset the face-up pile to represent 3 cards
pPile->SetOffsets(CS_DEFXOFF, 1);
if(dwOptions & OPTION_THREE_CARDS)
pPile->SetOffsets(CS_DEFXOFF, 1);
if(cardstack.NumCards() == 0)
{
@ -350,7 +355,9 @@ void CARDLIBPROC DeckClickProc(CardRegion &stackobj, int iNumClicked)
temp = cardstack.Pop(numcards);
temp.Reverse();
pile.Clear();
if(dwOptions & OPTION_THREE_CARDS)
pile.Clear();
pile.Push(temp);
//remove the top 3 from deck