[gnome-games] lightsoff: Remove deprecated Clutter calls and fix board layering animation
- From: Robert Ancell <rancell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games] lightsoff: Remove deprecated Clutter calls and fix board layering animation
- Date: Sat, 10 Mar 2012 13:42:08 +0000 (UTC)
commit c9f067dc8c96a495c2c93bf7b2c4188714758445
Author: Robert Ancell <robert ancell canonical com>
Date: Sat Mar 10 15:34:21 2012 +1100
lightsoff: Remove deprecated Clutter calls and fix board layering animation
lightsoff/src/game-view.vala | 26 ++++++++++----------------
lightsoff/src/led-array.vala | 2 --
lightsoff/src/lightsoff.vala | 1 -
3 files changed, 10 insertions(+), 19 deletions(-)
---
diff --git a/lightsoff/src/game-view.vala b/lightsoff/src/game-view.vala
index e64550a..d4eae5b 100644
--- a/lightsoff/src/game-view.vala
+++ b/lightsoff/src/game-view.vala
@@ -12,6 +12,7 @@ public class GameView : Clutter.Group
private List<Clutter.Actor> actor_remove_queue = null;
private LEDArray score_view;
+ private Clutter.Group board_group;
private BoardView board_view;
private BoardView? new_board_view = null;
private Clutter.Actor backing_view;
@@ -63,10 +64,13 @@ public class GameView : Clutter.Group
var real_board_width = 5 * off_texture.width + 4;
var real_board_height = 5 * off_texture.height + 4;
+ board_group = new Clutter.Group ();
+ add_actor (board_group);
+
current_level = level;
board_view = create_board_view (current_level);
board_view.playable = true;
- add_actor (board_view);
+ board_group.add_actor (board_view);
backing_view = new Clutter.Clone (backing_texture);
backing_view.set_position (0, real_board_height);
@@ -114,21 +118,15 @@ public class GameView : Clutter.Group
// The boards have finished transitioning; delete the old one!
private void transition_complete_cb ()
{
- remove_actor (board_view);
+ board_view.destroy ();
board_view = new_board_view;
board_view.playable = true;
- key_cursor_view.raise_top ();
new_board_view = null;
timeline = null;
// Remove all of the queued-for-removal actors
foreach (var actor in actor_remove_queue)
- {
- if (actor.get_parent () == null)
- continue;
- var group = (Clutter.Group) actor.get_parent ();
- group.remove_actor (actor);
- }
+ actor.destroy ();
actor_remove_queue = null;
}
@@ -155,8 +153,7 @@ public class GameView : Clutter.Group
last_sign = sign;
new_board_view = create_board_view (current_level);
- add_actor (new_board_view);
- new_board_view.lower (board_view);
+ board_group.add_actor (new_board_view);
timeline = new Clutter.Timeline (1500);
new_board_view.slide_in (direction, sign, timeline);
@@ -199,8 +196,7 @@ public class GameView : Clutter.Group
timeline = new Clutter.Timeline (500);
new_board_view = create_board_view (current_level);
- add_actor (new_board_view);
- new_board_view.lower (board_view);
+ board_group.add_actor (new_board_view);
new_board_view.depth = -250 * direction;
new_board_view.opacity = 0;
@@ -213,7 +209,6 @@ public class GameView : Clutter.Group
public void hide_cursor ()
{
- key_cursor_view.raise_top ();
key_cursor_view.animate (Clutter.AnimationMode.EASE_OUT_SINE, 250, "opacity", 0);
key_cursor_ready = false;
}
@@ -262,8 +257,7 @@ public class GameView : Clutter.Group
timeline = new Clutter.Timeline (500);
new_board_view = create_board_view (current_level);
- add_actor (new_board_view);
- new_board_view.lower (board_view);
+ board_group.add_actor (new_board_view);
new_board_view.depth = 250;
new_board_view.opacity = 0;
diff --git a/lightsoff/src/led-array.vala b/lightsoff/src/led-array.vala
index 72e7951..e9050e1 100644
--- a/lightsoff/src/led-array.vala
+++ b/lightsoff/src/led-array.vala
@@ -127,7 +127,5 @@ public class LEDArray : Clutter.Group
add_actor (d);
digits.prepend (d);
}
-
- back.lower_bottom ();
}
}
diff --git a/lightsoff/src/lightsoff.vala b/lightsoff/src/lightsoff.vala
index dcd7fc2..ea2eb92 100644
--- a/lightsoff/src/lightsoff.vala
+++ b/lightsoff/src/lightsoff.vala
@@ -47,7 +47,6 @@ public class LightsOff : Gtk.Application
var stage = (Clutter.Stage) clutter_embed.get_stage ();
stage.key_release_event.connect (key_release_event_cb);
stage.color = Clutter.Color.from_string ("#000000");
- stage.use_fog = false;
game_view = new GameView (settings.get_int ("level"));
game_view.level_changed.connect (level_changed_cb);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]