seed r844 - trunk/examples/same-seed



Author: hortont
Date: Tue Feb  3 17:16:49 2009
New Revision: 844
URL: http://svn.gnome.org/viewvc/seed?rev=844&view=rev

Log:
Horrible hack to make SS work on slower machines/with many, many tiles... will be much improved when we gain the ability to pass a timeline into the animate function.


Modified:
   trunk/examples/same-seed/board.js
   trunk/examples/same-seed/light.js

Modified: trunk/examples/same-seed/board.js
==============================================================================
--- trunk/examples/same-seed/board.js	(original)
+++ trunk/examples/same-seed/board.js	Tue Feb  3 17:16:49 2009
@@ -10,6 +10,7 @@
 		
 		function done_animating()
 		{
+			Seed.print("HIFJHGIDUFHG");
 			animating = false;
 			
 			var x = new Object(), y = new Object();
@@ -220,6 +221,8 @@
 			
 			var real_x = 0, timeline = 0;
 			
+			animating = true;
+			
 			for(var x in lights)
 			{
 				var good_lights = [];
@@ -252,21 +255,36 @@
 					if(!li.get_closed() && ((new_x != li.x) ||
 												 (new_y != li.y)))
 					{
-						animating = true;
-						
 						timeline = li.animate_to(new_x, new_y);
+						
+						// This might go away after we can pass timelines around
+						var nullize_anim = function (asdf, li)
+						{
+							li.anim = null;
+						}
+						
+						timeline.signal.completed.connect(nullize_anim, li);
 					}
 					
 					if(!li.get_closed())
 						empty_col = false;
+					
+					GLib.main_context_iteration();
 				}
 				
+				GLib.main_context_iteration();
+				
 				if(!empty_col)
 					real_x++;
 			}
 			
-			if(timeline)
+			if(timeline && li.anim)
+						// This needs to be changed when we get the ability
+						// to pass timelines around.... will fix bugs on
+						// slower machines / boards with many tiles
 				timeline.signal.completed.connect(done_animating);
+			else
+				animating = false;
 			
 			for(;real_x < tiles_w; real_x++)
 				lights[real_x] = null;

Modified: trunk/examples/same-seed/light.js
==============================================================================
--- trunk/examples/same-seed/light.js	(original)
+++ trunk/examples/same-seed/light.js	Tue Feb  3 17:16:49 2009
@@ -50,6 +50,8 @@
 			});
 			
 			this.anim.timeline.start();
+			
+			GLib.main_context_iteration();
 		}
 		
 		this.animate_to = function (new_x, new_y)
@@ -61,6 +63,8 @@
 			});
 			this.anim.timeline.start();
 			
+			GLib.main_context_iteration();
+			
 			return this.anim.timeline;
 		}
 		



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