gnome-games r8165 - trunk/aisleriot



Author: jclinton
Date: Tue Oct 21 19:47:28 2008
New Revision: 8165
URL: http://svn.gnome.org/viewvc/gnome-games?rev=8165&view=rev

Log:
Convert the highlight start id back to int so that it can highlight
the empty slot when it's set to -1

Modified:
   trunk/aisleriot/board.c
   trunk/aisleriot/slot-renderer.c
   trunk/aisleriot/slot-renderer.h

Modified: trunk/aisleriot/board.c
==============================================================================
--- trunk/aisleriot/board.c	(original)
+++ trunk/aisleriot/board.c	Tue Oct 21 19:47:28 2008
@@ -243,7 +243,7 @@
                                           Slot *slot);
 static void slot_update_card_images_full (AisleriotBoard *board,
                                           Slot *slot,
-                                          guint highlight_start_card_id);
+                                          gint highlight_start_card_id);
 
 #ifndef HAVE_HILDON 
 
@@ -678,7 +678,7 @@
       gdk_window_invalidate_rect (widget->window, &priv->selection_rect, FALSE);
 
       /* Clear selection card images */
-      slot_update_card_images_full (board, priv->selection_slot, G_MAXUINT);
+      slot_update_card_images_full (board, priv->selection_slot, G_MAXINT);
     }
 
     priv->selection_slot = NULL;
@@ -945,7 +945,7 @@
 static void
 slot_update_card_images_full (AisleriotBoard *board,
                               Slot *slot,
-                              guint highlight_start_card_id)
+                              gint highlight_start_card_id)
 {
   AisleriotBoardPrivate *priv = board->priv;
   ClutterActor *stage
@@ -970,7 +970,7 @@
 
   aisleriot_slot_renderer_set_highlight
     (AISLERIOT_SLOT_RENDERER (slot->slot_renderer),
-     priv->show_highlight ? highlight_start_card_id : G_MAXUINT);
+     priv->show_highlight ? highlight_start_card_id : G_MAXINT);
 }
 
 static void
@@ -978,7 +978,7 @@
                          Slot *slot)
 {
   AisleriotBoardPrivate *priv = board->priv;
-  int highlight_start_card_id = G_MAXUINT;
+  int highlight_start_card_id = G_MAXINT;
 
   if (G_UNLIKELY (slot == priv->highlight_slot &&
                   priv->show_highlight)) {
@@ -1322,7 +1322,7 @@
     /* It's ok to call this directly here, since the old highlight_slot cannot
      * have been the same as the current selection_slot!
      */
-    slot_update_card_images_full (board, old_slot, G_MAXUINT);
+    slot_update_card_images_full (board, old_slot, G_MAXINT);
   }
 
   if (!cards_are_droppable (board, slot))

Modified: trunk/aisleriot/slot-renderer.c
==============================================================================
--- trunk/aisleriot/slot-renderer.c	(original)
+++ trunk/aisleriot/slot-renderer.c	Tue Oct 21 19:47:28 2008
@@ -74,7 +74,7 @@
   Slot *slot;
 
   gboolean show_highlight;
-  guint highlight_start;
+  gint highlight_start;
 
   ClutterTimeline *timeline;
   guint completed_handler;
@@ -129,14 +129,14 @@
                                 G_PARAM_STATIC_BLURB);
   g_object_class_install_property (gobject_class, PROP_SLOT, pspec);
 
-  pspec = g_param_spec_uint ("highlight", NULL, NULL,
-                             0, G_MAXUINT, 0,
-                             G_PARAM_WRITABLE |
-                             G_PARAM_READABLE |
-                             G_PARAM_CONSTRUCT_ONLY |
-                             G_PARAM_STATIC_NAME |
-                             G_PARAM_STATIC_NICK |
-                             G_PARAM_STATIC_BLURB);
+  pspec = g_param_spec_int ("highlight", NULL, NULL,
+                            0, G_MAXINT, 0,
+                            G_PARAM_WRITABLE |
+                            G_PARAM_READABLE |
+                            G_PARAM_CONSTRUCT_ONLY |
+                            G_PARAM_STATIC_NAME |
+                            G_PARAM_STATIC_NICK |
+                            G_PARAM_STATIC_BLURB);
   g_object_class_install_property (gobject_class, PROP_HIGHLIGHT, pspec);
 
   g_type_class_add_private (klass, sizeof (AisleriotSlotRendererPrivate));
@@ -149,7 +149,7 @@
 
   priv = self->priv = AISLERIOT_SLOT_RENDERER_GET_PRIVATE (self);
 
-  priv->highlight_start = G_MAXUINT;
+  priv->highlight_start = G_MAXINT;
   priv->animations = g_array_new (FALSE, FALSE, sizeof (AnimationData));
   priv->timeline = clutter_timeline_new_for_duration (500);
   g_signal_connect_swapped (priv->timeline, "completed",
@@ -233,7 +233,7 @@
 
     case PROP_HIGHLIGHT:
       aisleriot_slot_renderer_set_highlight (srend,
-                                             g_value_get_uint (value));
+                                             g_value_get_int (value));
       break;
 
     default:
@@ -252,7 +252,7 @@
 
   switch (property_id) {
     case PROP_HIGHLIGHT:
-      g_value_set_uint (value,
+      g_value_set_int (value,
                         aisleriot_slot_renderer_get_highlight (srend));
       break;
 
@@ -351,14 +351,14 @@
 
 void
 aisleriot_slot_renderer_set_highlight (AisleriotSlotRenderer *srend,
-                                       guint highlight)
+                                       gint highlight)
 {
   AisleriotSlotRendererPrivate *priv = srend->priv;
 
   g_return_if_fail (AISLERIOT_IS_SLOT_RENDERER (srend));
 
   priv->highlight_start = highlight;
-  priv->show_highlight = priv->highlight_start != G_MAXUINT;
+  priv->show_highlight = priv->highlight_start != G_MAXINT;
 
   clutter_actor_queue_redraw (CLUTTER_ACTOR (srend));
 }

Modified: trunk/aisleriot/slot-renderer.h
==============================================================================
--- trunk/aisleriot/slot-renderer.h	(original)
+++ trunk/aisleriot/slot-renderer.h	Tue Oct 21 19:47:28 2008
@@ -76,7 +76,7 @@
                                            Slot *slot);
 
 void aisleriot_slot_renderer_set_highlight (AisleriotSlotRenderer *srend,
-                                            guint hightlight_start);
+                                            gint hightlight_start);
 guint aisleriot_slot_renderer_get_highlight (AisleriotSlotRenderer *srend);
 
 void aisleriot_slot_renderer_set_animations (AisleriotSlotRenderer *srend,



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