gnome-games r8676 - trunk/gnometris



Author: jclinton
Date: Sat Feb  7 20:12:08 2009
New Revision: 8676
URL: http://svn.gnome.org/viewvc/gnome-games?rev=8676&view=rev

Log:
Fix the callback problem mentioned in the previous commit.

However the >2 case now not only draws incorrectly, it crashes.

Modified:
   trunk/gnometris/blockops.cpp
   trunk/gnometris/blockops.h

Modified: trunk/gnometris/blockops.cpp
==============================================================================
--- trunk/gnometris/blockops.cpp	(original)
+++ trunk/gnometris/blockops.cpp	Sat Feb  7 20:12:08 2009
@@ -32,18 +32,11 @@
 void
 Block::animation_destroy (ClutterTimeline *tml, gpointer *data)
 {
-	ClutterActor *tmp_actor;
-	g_list_foreach(destroy_actors, (GFunc)Block::reap_actor, tmp_actor);
+	ClutterActor *tmp_actor = NULL;
+	g_list_foreach(destroy_actors, (GFunc)clutter_actor_destroy, CLUTTER_ACTOR(tmp_actor));
 	g_list_free (destroy_actors);
 }
 
-void
-Block::reap_actor (ClutterActor *actor)
-{
-	clutter_actor_destroy (CLUTTER_ACTOR(actor));
-}
-
-
 Block::Block ():
 	what(EMPTY),
 	actor(NULL),
@@ -285,8 +278,6 @@
 			field[x][y].move_from (field[x][y - 1]);
 		}
 	}
-	g_signal_connect (timeline, "completed",
-			  G_CALLBACK (Block::animation_destroy), NULL);
 }
 
 int
@@ -321,6 +312,9 @@
 		{
 			eliminateLine(fullLines[i]);
 		}
+		g_signal_connect (timeline, "completed",
+				  G_CALLBACK (Block::animation_destroy), (gpointer) NULL);
+		clutter_timeline_start (timeline);
 	}
 
 	return numFullLines;

Modified: trunk/gnometris/blockops.h
==============================================================================
--- trunk/gnometris/blockops.h	(original)
+++ trunk/gnometris/blockops.h	Sat Feb  7 20:12:08 2009
@@ -56,7 +56,6 @@
 
 	static GList *destroy_actors;
 	static void animation_destroy (ClutterTimeline *timeline, gpointer *data);
-	static void reap_actor (ClutterActor *actor);
 };
 
 class BlockOps {



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