mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 17:34:57 +00:00
Compute the card offset for the row stack based on the height of the card.
Otherwise the numbers of larger cards (like in cardsbav) are not visible. svn path=/trunk/; revision=29573
This commit is contained in:
parent
5c9cfdf1ff
commit
32bb43598d
3 changed files with 10 additions and 7 deletions
|
@ -15,6 +15,7 @@ extern CardStack activepile;
|
|||
|
||||
HBITMAP hbmBitmap;
|
||||
HDC hdcBitmap;
|
||||
int yRowStackCardOffset;
|
||||
|
||||
void CreateSol()
|
||||
{
|
||||
|
@ -25,6 +26,8 @@ void CreateSol()
|
|||
|
||||
activepile.Clear();
|
||||
|
||||
// Compute the value for yRowStackCardOffset based on the height of the card, so the card number isn't hidden on larger cards
|
||||
yRowStackCardOffset = __cardheight / 6.7;
|
||||
|
||||
pDeck = SolWnd.CreateRegion(DECK_ID, true, X_BORDER, Y_BORDER, 2, 1);
|
||||
pDeck->SetEmptyImage(CS_EI_SUNK);
|
||||
|
@ -62,7 +65,7 @@ void CreateSol()
|
|||
//
|
||||
for(i = 0; i < NUM_ROW_STACKS; i++)
|
||||
{
|
||||
pRowStack[i] = SolWnd.CreateRegion(ROW_ID+i, true, 0, Y_BORDER + __cardheight + Y_ROWSTACK_BORDER, 0, Y_ROWSTACK_CARDOFFSET);
|
||||
pRowStack[i] = SolWnd.CreateRegion(ROW_ID+i, true, 0, Y_BORDER + __cardheight + Y_ROWSTACK_BORDER, 0, yRowStackCardOffset);
|
||||
pRowStack[i]->SetEmptyImage(CS_EI_SUNK);
|
||||
pRowStack[i]->SetFaceDirection(CS_FACE_DOWNUP, i);
|
||||
|
||||
|
|
|
@ -465,16 +465,16 @@ LRESULT CALLBACK WndProc (HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
|
|||
SendMessage(hwndStatus, SB_SETPARTS, 2, (LPARAM)parts);
|
||||
SendMessage(hwndStatus, SB_SETTEXT, 0 | SBT_NOBORDERS, (LPARAM)"");
|
||||
|
||||
SolWnd.Create(hwnd, WS_EX_CLIENTEDGE, WS_CHILD|WS_VISIBLE, 0, 0, 0, 0);
|
||||
|
||||
CreateSol();
|
||||
|
||||
// The status bar height is fixed and needed later in WM_SIZE and WM_GETMINMAXINFO
|
||||
// Force the window to process WM_GETMINMAXINFO again
|
||||
GetWindowRect(hwndStatus, &rcStatus);
|
||||
nStatusHeight = rcStatus.bottom - rcStatus.top;
|
||||
SetWindowPos(hwnd, NULL, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOZORDER);
|
||||
|
||||
SolWnd.Create(hwnd, WS_EX_CLIENTEDGE, WS_CHILD|WS_VISIBLE, 0, 0, 0, 0);
|
||||
|
||||
CreateSol();
|
||||
|
||||
NewGame();
|
||||
|
||||
dwAppStartTime = GetTickCount();
|
||||
|
@ -514,7 +514,7 @@ LRESULT CALLBACK WndProc (HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
|
|||
Y_BORDER +
|
||||
__cardheight +
|
||||
Y_ROWSTACK_BORDER +
|
||||
6 * Y_ROWSTACK_CARDOFFSET +
|
||||
6 * yRowStackCardOffset +
|
||||
__cardheight +
|
||||
Y_BORDER +
|
||||
(dwOptions & OPTION_SHOW_STATUS ? nStatusHeight : 0);
|
||||
|
|
|
@ -30,7 +30,7 @@ void NewGame(void);
|
|||
#define X_SUITSTACK_BORDER 10
|
||||
#define Y_BORDER 20
|
||||
#define Y_ROWSTACK_BORDER 32
|
||||
#define Y_ROWSTACK_CARDOFFSET 14
|
||||
extern int yRowStackCardOffset;
|
||||
|
||||
extern CardRegion *pDeck;
|
||||
extern CardRegion *pPile;
|
||||
|
|
Loading…
Reference in a new issue