[gnome-games] Added fade-in effect on bonus, removed useless commented code



commit 3d31d0fd5f73fe407f9189e22b637a54d8425f93
Author: Guillaume Beland <guillaume beland gmail com>
Date:   Sat Jul 18 12:48:13 2009 -0400

    Added fade-in effect on bonus, removed useless commented code

 gnibbles/boni.c        |   37 ++++---------------------------------
 gnibbles/bonus.c       |   22 +++++-----------------
 gnibbles/warp.c        |   13 ++++++-------
 gnibbles/warpmanager.c |   11 +----------
 4 files changed, 16 insertions(+), 67 deletions(-)
---
diff --git a/gnibbles/boni.c b/gnibbles/boni.c
index 6d46ca9..5a3f4f1 100644
--- a/gnibbles/boni.c
+++ b/gnibbles/boni.c
@@ -32,7 +32,6 @@
 #include "ggz-network.h"
 #include "level.h"
 
-//extern gchar board[BOARDWIDTH][BOARDHEIGHT];
 extern GnibblesLevel *level;
 
 GnibblesBoni *
@@ -71,19 +70,12 @@ gnibbles_boni_add_bonus (GnibblesBoni * boni, gint t_x, gint t_y,
   boni->bonuses[boni->numbonuses] = gnibbles_bonus_new (t_x, t_y,
 							                                          t_type, t_fake,
 							                                          t_countdown);
-/*
-  board[t_x][t_y] = t_type + 'A';
-  board[t_x + 1][t_y] = t_type + 'A';
-  board[t_x][t_y + 1] = t_type + 'A';
-  board[t_x + 1][t_y + 1] = t_type + 'A';
-*/
-  //gnibbles-clutter-level
+
   level->walls[t_x][t_y] = t_type = 'A';
   level->walls[t_x + 1][t_y] = t_type + 'A';
   level->walls[t_x][t_y + 1] = t_type + 'A';
   level->walls[t_x + 1][t_y + 1] = t_type + 'A';
 
-  //gnibbles_bonus_draw (boni->bonuses[boni->numbonuses]);
   gnibbles_bonus_draw_clutter (boni->bonuses[boni->numbonuses]);
   
   boni->numbonuses++;
@@ -105,19 +97,12 @@ gnibbles_boni_add_bonus_final (GnibblesBoni * boni, gint t_x, gint t_y,
   boni->bonuses[boni->numbonuses] = gnibbles_bonus_new (t_x, t_y,
 							t_type, t_fake,
 							t_countdown);
-/*
-  board[t_x][t_y] = t_type + 'A';
-  board[t_x + 1][t_y] = t_type + 'A';
-  board[t_x][t_y + 1] = t_type + 'A';
-  board[t_x + 1][t_y + 1] = t_type + 'A';
-*/
-  //gnibbles-clutter-level
+
   level->walls[t_x][t_y] = t_type + 'A';
   level->walls[t_x + 1][t_y] = t_type + 'A';
   level->walls[t_x][t_y + 1] = t_type + 'A';
   level->walls[t_x + 1][t_y + 1] = t_type + 'A';
 
-  //gnibbles_bonus_draw (boni->bonuses[boni->numbonuses]);
   gnibbles_bonus_draw_clutter (boni->bonuses[boni->numbonuses]);
   boni->numbonuses++;
   if (t_type != BONUSREGULAR)
@@ -162,19 +147,12 @@ gnibbles_boni_remove_bonus (GnibblesBoni * boni, gint x, gint y)
 	      (x == boni->bonuses[i]->x &&
 	      y == boni->bonuses[i]->y + 1) ||
 	      (x == boni->bonuses[i]->x + 1 && y == boni->bonuses[i]->y + 1)) {
-/*      
-      board[boni->bonuses[i]->x][boni->bonuses[i]->y] = EMPTYCHAR;
-      board[boni->bonuses[i]->x + 1][boni->bonuses[i]->y] = EMPTYCHAR;
-      board[boni->bonuses[i]->x][boni->bonuses[i]->y + 1] = EMPTYCHAR;
-      board[boni->bonuses[i]->x + 1][boni->bonuses[i]->y + 1]	= EMPTYCHAR;
-*/
-      //gnibbles-clutter-level
+
       level->walls[boni->bonuses[i]->x][boni->bonuses[i]->y] = EMPTYCHAR;
       level->walls[boni->bonuses[i]->x + 1][boni->bonuses[i]->y] = EMPTYCHAR;
       level->walls[boni->bonuses[i]->x][boni->bonuses[i]->y + 1] = EMPTYCHAR;
       level->walls[boni->bonuses[i]->x + 1][boni->bonuses[i]->y + 1]	= EMPTYCHAR;
 
-      //gnibbles_bonus_erase (boni->bonuses[i]);
       gnibbles_bonus_erase_clutter (boni->bonuses[i]);
       boni->bonuses[i] = boni->bonuses[--boni->numbonuses];
       return;
@@ -195,19 +173,12 @@ gnibbles_boni_remove_bonus_final (GnibblesBoni * boni, gint x, gint y)
 	      (x == boni->bonuses[i]->x &&
 	      y == boni->bonuses[i]->y + 1) ||
 	      (x == boni->bonuses[i]->x + 1 && y == boni->bonuses[i]->y + 1)) {
-/*      
-      board[boni->bonuses[i]->x][boni->bonuses[i]->y] = EMPTYCHAR;
-      board[boni->bonuses[i]->x + 1][boni->bonuses[i]->y] = EMPTYCHAR;
-      board[boni->bonuses[i]->x][boni->bonuses[i]->y + 1] = EMPTYCHAR;
-      board[boni->bonuses[i]->x + 1][boni->bonuses[i]->y + 1] = EMPTYCHAR;
-*/
-      //gnibbles-clutter-level
+
       level->walls[boni->bonuses[i]->x][boni->bonuses[i]->y] = EMPTYCHAR;
       level->walls[boni->bonuses[i]->x + 1][boni->bonuses[i]->y] = EMPTYCHAR;
       level->walls[boni->bonuses[i]->x][boni->bonuses[i]->y + 1] = EMPTYCHAR;
       level->walls[boni->bonuses[i]->x + 1][boni->bonuses[i]->y + 1] = EMPTYCHAR;
 
-      //gnibbles_bonus_erase (boni->bonuses[i]);
       gnibbles_bonus_erase_clutter (boni->bonuses[i]);
       boni->bonuses[i] = boni->bonuses[--boni->numbonuses];
       return;
diff --git a/gnibbles/bonus.c b/gnibbles/bonus.c
index 656c023..0ed710e 100644
--- a/gnibbles/bonus.c
+++ b/gnibbles/bonus.c
@@ -51,13 +51,7 @@ gnibbles_bonus_new (gint t_x, gint t_y, gint t_type,
 
   return (tmp);
 }
-/*
-void
-gnibbles_bonus_draw (GnibblesBonus * bonus)
-{
-  gnibbles_draw_big_pixmap (bonus->type, bonus->x, bonus->y);
-}
-*/
+
 void
 gnibbles_bonus_draw_clutter (GnibblesBonus *bonus)
 {
@@ -68,18 +62,12 @@ gnibbles_bonus_draw_clutter (GnibblesBonus *bonus)
                               bonus->y * properties->tilesize);
   ClutterActor *stage = gnibbles_board_get_stage (board);
   clutter_container_add_actor (CLUTTER_CONTAINER (stage), bonus->actor);
+  clutter_actor_set_opacity (bonus->actor, 0);
+  clutter_actor_animate (bonus->actor, CLUTTER_EASE_IN_QUAD, 410,
+                         "opacity", 0xff,
+                         NULL);
 }
-/*
-void
-gnibbles_bonus_erase (GnibblesBonus * bonus)
-{
-  gnibbles_draw_big_pixmap (BONUSNONE, bonus->x, bonus->y);
-
-  clutter_actor_hide (bonus->actor);
 
-  free (bonus);
-}
-*/
 void
 gnibbles_bonus_erase_clutter (GnibblesBonus *bonus)
 {
diff --git a/gnibbles/warp.c b/gnibbles/warp.c
index 0fa523c..9e0b20c 100644
--- a/gnibbles/warp.c
+++ b/gnibbles/warp.c
@@ -47,13 +47,7 @@ gnibbles_warp_new (gint t_x, gint t_y, gint t_wx, gint t_wy)
 
   return (tmp);
 }
-/*
-void
-gnibbles_warp_draw_buffer (GnibblesWarp * warp)
-{
-  gnibbles_draw_big_pixmap_buffer (WARP, warp->x, warp->y);
-}
-*/
+
 void
 gnibbles_warp_draw (GnibblesWarp *warp)
 {
@@ -64,5 +58,10 @@ gnibbles_warp_draw (GnibblesWarp *warp)
                               properties->tilesize * warp->y);
   ClutterActor *stage = gnibbles_board_get_stage (board);
   clutter_container_add_actor (CLUTTER_CONTAINER (stage), warp->actor);
+  clutter_actor_set_opacity (warp->actor, 0);
+  clutter_actor_animate (warp->actor, CLUTTER_EASE_IN_QUAD, 410,
+                         "opacity", 0xff,
+                         NULL);
+
 
 }
diff --git a/gnibbles/warpmanager.c b/gnibbles/warpmanager.c
index 74374b1..d212ad6 100644
--- a/gnibbles/warpmanager.c
+++ b/gnibbles/warpmanager.c
@@ -27,11 +27,9 @@
 #include "warp.h"
 #include "warpmanager.h"
 #include "boni.h"
-//#include "worm.h"
 #include "main.h"
 #include "level.h"
 
-//extern gchar board[BOARDWIDTH][BOARDHEIGHT];
 extern GnibblesLevel *level;
 extern GnibblesBoni *boni;
 
@@ -97,19 +95,12 @@ gnibbles_warpmanager_add_warp (GnibblesWarpManager * warpmanager, gint t_x,
       draw = warpmanager->numwarps;
       warpmanager->numwarps++;
     }
-/*
-    board[t_x][t_y] = WARPLETTER;
-    board[t_x + 1][t_y] = WARPLETTER;
-    board[t_x][t_y + 1] = WARPLETTER;
-    board[t_x + 1][t_y + 1] = WARPLETTER;
-*/
-    //gnibbles-clutter-level
+
     level->walls[t_x][t_y] = WARPLETTER;
     level->walls[t_x + 1][t_y] = WARPLETTER;
     level->walls[t_x][t_y + 1] = WARPLETTER;
     level->walls[t_x + 1][t_y + 1] = WARPLETTER;
 
-    //gnibbles_warp_draw_buffer (warpmanager->warps[draw]);
     gnibbles_warp_draw (warpmanager->warps[draw]);
   }
 }



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