[ros-diffs] [cfinck] 29573: 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.

cfinck at svn.reactos.org cfinck at svn.reactos.org
Sun Oct 14 21:49:13 CEST 2007


Author: cfinck
Date: Sun Oct 14 23:49:12 2007
New Revision: 29573

URL: http://svn.reactos.org/svn/reactos?rev=29573&view=rev
Log:
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.

Modified:
    trunk/reactos/base/applications/games/solitaire/solcreate.cpp
    trunk/reactos/base/applications/games/solitaire/solitaire.cpp
    trunk/reactos/base/applications/games/solitaire/solitaire.h

Modified: trunk/reactos/base/applications/games/solitaire/solcreate.cpp
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/games/solitaire/solcreate.cpp?rev=29573&r1=29572&r2=29573&view=diff
==============================================================================
--- trunk/reactos/base/applications/games/solitaire/solcreate.cpp (original)
+++ trunk/reactos/base/applications/games/solitaire/solcreate.cpp Sun Oct 14 23:49:12 2007
@@ -15,6 +15,7 @@
 
 HBITMAP hbmBitmap;
 HDC     hdcBitmap;
+int     yRowStackCardOffset;
 
 void CreateSol()
 {
@@ -25,6 +26,8 @@
 
     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 @@
     //
     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);
         

Modified: trunk/reactos/base/applications/games/solitaire/solitaire.cpp
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/games/solitaire/solitaire.cpp?rev=29573&r1=29572&r2=29573&view=diff
==============================================================================
--- trunk/reactos/base/applications/games/solitaire/solitaire.cpp (original)
+++ trunk/reactos/base/applications/games/solitaire/solitaire.cpp Sun Oct 14 23:49:12 2007
@@ -465,15 +465,15 @@
             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();
 
@@ -514,7 +514,7 @@
                                     Y_BORDER +
                                     __cardheight +
                                     Y_ROWSTACK_BORDER +
-                                    6 * Y_ROWSTACK_CARDOFFSET +
+                                    6 * yRowStackCardOffset +
                                     __cardheight +
                                     Y_BORDER +
                                     (dwOptions & OPTION_SHOW_STATUS ? nStatusHeight : 0);

Modified: trunk/reactos/base/applications/games/solitaire/solitaire.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/games/solitaire/solitaire.h?rev=29573&r1=29572&r2=29573&view=diff
==============================================================================
--- trunk/reactos/base/applications/games/solitaire/solitaire.h (original)
+++ trunk/reactos/base/applications/games/solitaire/solitaire.h Sun Oct 14 23:49:12 2007
@@ -30,7 +30,7 @@
 #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;




More information about the Ros-diffs mailing list