]> git.cworth.org Git - kub/commitdiff
Created deck_spread which gives x, y values to tiles in deck, for drawing 8 rows...
authorKevin Worth <kworth@mac-mini.(none)>
Tue, 6 Mar 2007 12:45:02 +0000 (07:45 -0500)
committerKevin Worth <kworth@mac-mini.(none)>
Tue, 6 Mar 2007 12:45:02 +0000 (07:45 -0500)
kub.c

diff --git a/kub.c b/kub.c
index a2e34a11924a99ae3f17af7c4826d9284bfd0957..df363f54f40e182e467c6f6c096d61f5d4cc371c 100644 (file)
--- a/kub.c
+++ b/kub.c
@@ -359,6 +359,18 @@ static void deck_print(deck_t *deck)
     printf ("There are %d tiles in the deck\n" , deck->num_tiles);
 }
 
+static void deck_spread(deck_t *deck)
+{
+    int i, j;
+    for (i = 0; i < 8; i++)
+    {
+       for (j = 0; j < 13; j++)
+       {
+           deck->tiles[j + (i * 13)].x = j * 50;
+           deck->tiles[j + (i * 13)].y = i * 60;
+       }
+    }
+}
 
 static void deck_draw(game_t *game, cairo_t *cr)
 {
@@ -465,9 +477,10 @@ int main(int argc, char *argv[])
     
     game_init(&game);
     deck_print(&game.deck);
+    deck_spread(&game.deck);
     //deck_deal(&game, &game.deck);
-    hand_print(&game);
-    deck_print(&game.deck);
+    //hand_print(&game);
+    //deck_print(&game.deck);
 
     /* Create a new window */
     window = gtk_window_new (GTK_WINDOW_TOPLEVEL);