diff --git a/reactos/base/applications/games/solitaire/cardlib/cardlib.h b/reactos/base/applications/games/solitaire/cardlib/cardlib.h index 33f5c02540d..af7dc121b71 100644 --- a/reactos/base/applications/games/solitaire/cardlib/cardlib.h +++ b/reactos/base/applications/games/solitaire/cardlib/cardlib.h @@ -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 diff --git a/reactos/base/applications/games/solitaire/cardlib/cardregion.cpp b/reactos/base/applications/games/solitaire/cardlib/cardregion.cpp index f783ec55d5f..8ed739f2273 100644 --- a/reactos/base/applications/games/solitaire/cardlib/cardregion.cpp +++ b/reactos/base/applications/games/solitaire/cardlib/cardregion.cpp @@ -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; diff --git a/reactos/base/applications/games/solitaire/cardlib/cardrgndraw.cpp b/reactos/base/applications/games/solitaire/cardlib/cardrgndraw.cpp index d9b34050ed9..00c5dafc233 100644 --- a/reactos/base/applications/games/solitaire/cardlib/cardrgndraw.cpp +++ b/reactos/base/applications/games/solitaire/cardlib/cardrgndraw.cpp @@ -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; } } diff --git a/reactos/base/applications/games/solitaire/solcreate.cpp b/reactos/base/applications/games/solitaire/solcreate.cpp index d80ddbbe7aa..76d2c0e98ec 100644 --- a/reactos/base/applications/games/solitaire/solcreate.cpp +++ b/reactos/base/applications/games/solitaire/solcreate.cpp @@ -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); diff --git a/reactos/base/applications/games/solitaire/solgame.cpp b/reactos/base/applications/games/solitaire/solgame.cpp index 7be141c812f..00b5e84e1fb 100644 --- a/reactos/base/applications/games/solitaire/solgame.cpp +++ b/reactos/base/applications/games/solitaire/solgame.cpp @@ -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