gnome-games r8642 - in trunk: aisleriot libgames-support



Author: chpe
Date: Tue Feb  3 17:58:22 2009
New Revision: 8642
URL: http://svn.gnome.org/viewvc/gnome-games?rev=8642&view=rev

Log:
Don't return aggregates.

Modified:
   trunk/aisleriot/board-noclutter.c
   trunk/aisleriot/board.c
   trunk/aisleriot/game.c
   trunk/libgames-support/games-card-images.c
   trunk/libgames-support/games-card-images.h
   trunk/libgames-support/games-card-theme-fixed.c
   trunk/libgames-support/games-card-theme-preimage.c
   trunk/libgames-support/games-card-theme-private.h
   trunk/libgames-support/games-card-theme-pysol.c
   trunk/libgames-support/games-card-theme.c
   trunk/libgames-support/games-card-theme.h
   trunk/libgames-support/render-cards.c

Modified: trunk/aisleriot/board-noclutter.c
==============================================================================
--- trunk/aisleriot/board-noclutter.c	(original)
+++ trunk/aisleriot/board-noclutter.c	Tue Feb  3 17:58:22 2009
@@ -925,7 +925,8 @@
                                              priv->yslotstep,
                                              CARD_SLOT_PROP);
 
-  card_size = priv->card_size = games_card_images_get_size (priv->images);
+  games_card_images_get_size (priv->images, &card_size);
+  priv->card_size = card_size;
 
   /* If the cards are too far apart, bunch them in the middle. */
   priv->xbaseoffset = 0;

Modified: trunk/aisleriot/board.c
==============================================================================
--- trunk/aisleriot/board.c	(original)
+++ trunk/aisleriot/board.c	Tue Feb  3 17:58:22 2009
@@ -1066,7 +1066,8 @@
                              priv->yslotstep,
                              CARD_SLOT_PROP);
 
-  card_size = priv->card_size = games_card_theme_get_size (priv->theme);
+  games_card_theme_get_size (priv->theme, &card_size);
+  priv->card_size = card_size;
 
   /* If the cards are too far apart, bunch them in the middle. */
   priv->xbaseoffset = 0;

Modified: trunk/aisleriot/game.c
==============================================================================
--- trunk/aisleriot/game.c	(original)
+++ trunk/aisleriot/game.c	Tue Feb  3 17:58:22 2009
@@ -493,23 +493,21 @@
                                        SCM_EOL)));
 }
 
-static Card
-scm2c_card (SCM card_data)
+static void
+scm2c_card (SCM card_data,
+            Card *card)
 {
-  Card card;
   guint rank, suit, face_down;
 
-  card.value = 0;
+  card->value = 0;
 
   rank = scm_to_int (SCM_CAR (card_data));
   suit = scm_to_int (SCM_CADR (card_data));
   face_down = !(SCM_NFALSEP (SCM_CADDR (card_data)));
 
-  card.attr.rank = rank;
-  card.attr.suit = suit;
-  card.attr.face_down = face_down;
-
-  return card;
+  card->attr.rank = rank;
+  card->attr.suit = suit;
+  card->attr.face_down = face_down;
 }
 
 static SCM
@@ -544,7 +542,10 @@
     i = n_cards;
 
     for (list_el = cards; list_el != SCM_EOL; list_el = SCM_CDR (list_el)) {
-      data[--i] = CARD_UINT (scm2c_card (SCM_CAR (list_el)));
+      Card card;
+
+      scm2c_card (SCM_CAR (list_el), &card);
+      data[--i] = CARD_UINT (card);
     }
   }
 

Modified: trunk/libgames-support/games-card-images.c
==============================================================================
--- trunk/libgames-support/games-card-images.c	(original)
+++ trunk/libgames-support/games-card-images.c	Tue Feb  3 17:58:22 2009
@@ -445,10 +445,11 @@
  *
  * Returns: the currently selected card size
  */
-CardSize
-games_card_images_get_size (GamesCardImages * images)
+void
+games_card_images_get_size (GamesCardImages *images,
+                            CardSize *size)
 {
-  return games_card_theme_get_size (images->theme);
+  games_card_theme_get_size (images->theme, size);
 }
 
 /**

Modified: trunk/libgames-support/games-card-images.h
==============================================================================
--- trunk/libgames-support/games-card-images.h	(original)
+++ trunk/libgames-support/games-card-images.h	Tue Feb  3 17:58:22 2009
@@ -67,7 +67,8 @@
                                      gint width,
                                      gint height, gdouble proportion);
 
-CardSize games_card_images_get_size (GamesCardImages * images);
+void games_card_images_get_size (GamesCardImages *images,
+                                 CardSize *size);
 
 void games_card_images_set_background_color (GamesCardImages * images,
                                              const GdkColor * color);

Modified: trunk/libgames-support/games-card-theme-fixed.c
==============================================================================
--- trunk/libgames-support/games-card-theme-fixed.c	(original)
+++ trunk/libgames-support/games-card-theme-fixed.c	Tue Feb  3 17:58:22 2009
@@ -246,12 +246,13 @@
   return TRUE;
 }
 
-static CardSize
-games_card_theme_fixed_get_card_size (GamesCardTheme *card_theme)
+static void
+games_card_theme_fixed_get_card_size (GamesCardTheme *card_theme,
+                                      CardSize *size)
 {
   GamesCardThemeFixed *theme = (GamesCardThemeFixed *) card_theme;
 
-  return theme->card_size;
+  *size = theme->card_size;
 }
 
 static double

Modified: trunk/libgames-support/games-card-theme-preimage.c
==============================================================================
--- trunk/libgames-support/games-card-theme-preimage.c	(original)
+++ trunk/libgames-support/games-card-theme-preimage.c	Tue Feb  3 17:58:22 2009
@@ -197,12 +197,13 @@
   return TRUE;
 }
 
-static CardSize
-games_card_theme_preimage_get_card_size (GamesCardTheme *card_theme)
+static void
+games_card_theme_preimage_get_card_size (GamesCardTheme *card_theme,
+                                         CardSize *size)
 {
   GamesCardThemePreimage *theme = (GamesCardThemePreimage *) card_theme;
 
-  return theme->card_size;
+  *size = theme->card_size;
 }
 
 static double

Modified: trunk/libgames-support/games-card-theme-private.h
==============================================================================
--- trunk/libgames-support/games-card-theme-private.h	(original)
+++ trunk/libgames-support/games-card-theme-private.h	Tue Feb  3 17:58:22 2009
@@ -74,7 +74,8 @@
                                      int width,
                                      int height,
                                      double proportion);
-  CardSize    (* get_card_size)     (GamesCardTheme *theme);
+  void        (* get_card_size)     (GamesCardTheme *theme,
+                                     CardSize *size);
   double      (* get_card_aspect)   (GamesCardTheme *theme);
   GdkPixbuf*  (* get_card_pixbuf)   (GamesCardTheme *theme,
                                      int card_id);

Modified: trunk/libgames-support/games-card-theme-pysol.c
==============================================================================
--- trunk/libgames-support/games-card-theme-pysol.c	(original)
+++ trunk/libgames-support/games-card-theme-pysol.c	Tue Feb  3 17:58:22 2009
@@ -302,13 +302,14 @@
   return FALSE;
 }
 
-static CardSize
-games_card_theme_pysol_get_card_size (GamesCardTheme *card_theme)
+static void
+games_card_theme_pysol_get_card_size (GamesCardTheme *card_theme,
+                                      CardSize *size)
 {
   GamesCardThemeInfo *theme_info = card_theme->theme_info;
   PySolConfigTxtData *pysol_data = theme_info->data;
 
-  return pysol_data->card_size;
+  *size = pysol_data->card_size;
 }
 
 static double

Modified: trunk/libgames-support/games-card-theme.c
==============================================================================
--- trunk/libgames-support/games-card-theme.c	(original)
+++ trunk/libgames-support/games-card-theme.c	Tue Feb  3 17:58:22 2009
@@ -277,13 +277,15 @@
 /**
  * games_card_theme_get_size:
  * @theme:
+ * @size: location to store the card size
  *
- * Returns: the currently selected card size
+ * Returns the currently selected card size in @size.
  */
-CardSize
-games_card_theme_get_size (GamesCardTheme *theme)
+void
+games_card_theme_get_size (GamesCardTheme *theme,
+                           CardSize *size)
 {
-  return theme->klass->get_card_size (theme);
+  theme->klass->get_card_size (theme, size);
 }
 
 /**

Modified: trunk/libgames-support/games-card-theme.h
==============================================================================
--- trunk/libgames-support/games-card-theme.h	(original)
+++ trunk/libgames-support/games-card-theme.h	Tue Feb  3 17:58:22 2009
@@ -87,7 +87,8 @@
                                     int height,
                                     double proportion);
 
-CardSize games_card_theme_get_size (GamesCardTheme * theme);
+void games_card_theme_get_size (GamesCardTheme *theme,
+                                CardSize *size);
 
 double games_card_theme_get_aspect (GamesCardTheme * theme);
 

Modified: trunk/libgames-support/render-cards.c
==============================================================================
--- trunk/libgames-support/render-cards.c	(original)
+++ trunk/libgames-support/render-cards.c	Tue Feb  3 17:58:22 2009
@@ -220,7 +220,7 @@
 
     sizes[i] = size;
 
-    card_size = games_card_theme_get_size (theme);
+    games_card_theme_get_size (theme, &card_size);
     g_key_file_set_integer (key_file, sizestr, "Width", card_size.width);
     g_key_file_set_integer (key_file, sizestr, "Height", card_size.height);
   }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]