[gnome-games] Fix for API break in clutter-gtk



commit 5ebaea7786aadfb79c804181a138496a4895f353
Author: Thomas Hindoe Paaboel Andersen <phomes gmail com>
Date:   Wed Dec 29 01:44:27 2010 +0100

    Fix for API break in clutter-gtk

 gnibbles/board.c |   45 ++++++++++++++++++++++++++++++++++-----------
 gnibbles/boni.c  |    2 +-
 gnibbles/bonus.c |    4 ++--
 gnibbles/main.c  |    4 +++-
 gnibbles/warp.c  |    4 ++--
 gnibbles/worm.c  |   23 ++++++++++++++++-------
 6 files changed, 58 insertions(+), 24 deletions(-)
---
diff --git a/gnibbles/board.c b/gnibbles/board.c
index ccc2885..ef0884a 100644
--- a/gnibbles/board.c
+++ b/gnibbles/board.c
@@ -91,6 +91,7 @@ gnibbles_board_load_level (GnibblesBoard *board)
   gint x_pos, y_pos;
   ClutterActor *tmp;
   gboolean is_wall = TRUE;
+  GError *error = NULL;
 
   if (board->level) {
     clutter_group_remove_all (CLUTTER_GROUP (board->level));
@@ -109,37 +110,59 @@ gnibbles_board_load_level (GnibblesBoard *board)
           is_wall = FALSE;
           break; // break right away
         case 'b': // straight up
-          tmp = gtk_clutter_texture_new_from_pixbuf (wall_pixmaps[0]);
+          tmp = gtk_clutter_texture_new ();
+          gtk_clutter_texture_set_from_pixbuf (GTK_CLUTTER_TEXTURE (tmp),
+                                               wall_pixmaps[0], &error);
           break;
         case 'c': // straight side
-          tmp = gtk_clutter_texture_new_from_pixbuf (wall_pixmaps[1]);
+          tmp = gtk_clutter_texture_new ();
+          gtk_clutter_texture_set_from_pixbuf (GTK_CLUTTER_TEXTURE (tmp),
+                                               wall_pixmaps[1], &error);
           break;
         case 'd': // corner bottom left
-          tmp = gtk_clutter_texture_new_from_pixbuf (wall_pixmaps[2]);
+          tmp = gtk_clutter_texture_new ();
+          gtk_clutter_texture_set_from_pixbuf (GTK_CLUTTER_TEXTURE (tmp),
+                                               wall_pixmaps[2], &error);
           break;
         case 'e': // corner bottom right
-          tmp = gtk_clutter_texture_new_from_pixbuf (wall_pixmaps[3]);
+          tmp = gtk_clutter_texture_new ();
+          gtk_clutter_texture_set_from_pixbuf (GTK_CLUTTER_TEXTURE (tmp),
+                                               wall_pixmaps[3], &error);
           break;
           case 'f': // corner up left
-          tmp = gtk_clutter_texture_new_from_pixbuf (wall_pixmaps[4]);
+          tmp = gtk_clutter_texture_new ();
+          gtk_clutter_texture_set_from_pixbuf (GTK_CLUTTER_TEXTURE (tmp),
+                                               wall_pixmaps[4], &error);
           break;
         case 'g': // corner up right
-          tmp = gtk_clutter_texture_new_from_pixbuf (wall_pixmaps[5]);
+          tmp = gtk_clutter_texture_new ();
+          gtk_clutter_texture_set_from_pixbuf (GTK_CLUTTER_TEXTURE (tmp),
+                                               wall_pixmaps[5], &error);
           break;
         case 'h': // tee up
-          tmp = gtk_clutter_texture_new_from_pixbuf (wall_pixmaps[6]);
+          tmp = gtk_clutter_texture_new ();
+          gtk_clutter_texture_set_from_pixbuf (GTK_CLUTTER_TEXTURE (tmp),
+                                               wall_pixmaps[6], &error);
           break;
         case 'i': // tee right
-          tmp = gtk_clutter_texture_new_from_pixbuf (wall_pixmaps[7]);
+          tmp = gtk_clutter_texture_new ();
+          gtk_clutter_texture_set_from_pixbuf (GTK_CLUTTER_TEXTURE (tmp),
+                                               wall_pixmaps[7], &error);
           break;
         case 'j': // tee left
-          tmp = gtk_clutter_texture_new_from_pixbuf (wall_pixmaps[8]);
+          tmp = gtk_clutter_texture_new ();
+          gtk_clutter_texture_set_from_pixbuf (GTK_CLUTTER_TEXTURE (tmp),
+                                               wall_pixmaps[8], &error);
           break;
         case 'k': // tee down
-          tmp = gtk_clutter_texture_new_from_pixbuf (wall_pixmaps[9]);
+          tmp = gtk_clutter_texture_new ();
+          gtk_clutter_texture_set_from_pixbuf (GTK_CLUTTER_TEXTURE (tmp),
+                                               wall_pixmaps[9], &error);
           break;
         case 'l': // cross
-          tmp = gtk_clutter_texture_new_from_pixbuf (wall_pixmaps[10]);
+          tmp = gtk_clutter_texture_new ();
+          gtk_clutter_texture_set_from_pixbuf (GTK_CLUTTER_TEXTURE (tmp),
+                                               wall_pixmaps[10], &error);
           break;
         default:
           is_wall = FALSE;
diff --git a/gnibbles/boni.c b/gnibbles/boni.c
index 1bad8fb..95364d0 100644
--- a/gnibbles/boni.c
+++ b/gnibbles/boni.c
@@ -202,7 +202,7 @@ gnibbles_boni_rescale (GnibblesBoni *boni, gint tilesize)
     clutter_actor_set_position (boni->bonuses[i]->actor,
                                 (x_pos / properties->tilesize) * tilesize,
                                 (y_pos / properties->tilesize) * tilesize);
-    gtk_clutter_texture_set_from_pixbuf (CLUTTER_TEXTURE(boni->bonuses[i]->actor),
+    gtk_clutter_texture_set_from_pixbuf (GTK_CLUTTER_TEXTURE(boni->bonuses[i]->actor),
                                          boni_pixmaps[boni->bonuses[i]->type],
                                          &err);
     if (err)
diff --git a/gnibbles/bonus.c b/gnibbles/bonus.c
index afe4d23..d42ad19 100644
--- a/gnibbles/bonus.c
+++ b/gnibbles/bonus.c
@@ -81,7 +81,7 @@ gnibbles_bonus_new (gint t_x, gint t_y, gint t_type,
   tmp->type = t_type;
   tmp->fake = t_fake;
   tmp->countdown = t_countdown;
-  tmp->actor = clutter_texture_new ();
+  tmp->actor = gtk_clutter_texture_new ();
   return (tmp);
 }
 
@@ -94,7 +94,7 @@ gnibbles_bonus_draw (GnibblesBonus *bonus)
                               bonus->x * properties->tilesize,
                               bonus->y * properties->tilesize);
 
-  gtk_clutter_texture_set_from_pixbuf (CLUTTER_TEXTURE (bonus->actor),
+  gtk_clutter_texture_set_from_pixbuf (GTK_CLUTTER_TEXTURE (bonus->actor),
                                        boni_pixmaps[bonus->type],
                                        &err);
   if (err)
diff --git a/gnibbles/main.c b/gnibbles/main.c
index 90669fa..cc2c38d 100644
--- a/gnibbles/main.c
+++ b/gnibbles/main.c
@@ -872,6 +872,7 @@ render_logo (void)
   PangoFontDescription *pfd;
   PangoLayout *layout;
   PangoContext *context;
+  GError *error = NULL;
 
   gchar *nibbles = _("Nibbles");
   /* Translators: This string will be included in the intro screen, so don't make sure it fits! */
@@ -883,7 +884,8 @@ render_logo (void)
   if (!logo_pixmap)
     gnibbles_load_logo (properties->tilesize);
 
-  image = gtk_clutter_texture_new_from_pixbuf (logo_pixmap);
+  image = gtk_clutter_texture_new ();
+  gtk_clutter_texture_set_from_pixbuf (GTK_CLUTTER_TEXTURE (image), logo_pixmap, &error);
 
   stage_w = board->width * properties->tilesize;
   stage_h = board->height * properties->tilesize;
diff --git a/gnibbles/warp.c b/gnibbles/warp.c
index 75cc14f..09f0826 100644
--- a/gnibbles/warp.c
+++ b/gnibbles/warp.c
@@ -71,7 +71,7 @@ gnibbles_warp_new (gint t_x, gint t_y, gint t_wx, gint t_wy)
   tmp->y = t_y;
   tmp->wx = t_wx;
   tmp->wy = t_wy;
-  tmp->actor = clutter_texture_new ();
+  tmp->actor = gtk_clutter_texture_new ();
 
   return (tmp);
 }
@@ -81,7 +81,7 @@ gnibbles_warp_draw (GnibblesWarp *warp)
 {
   GError *err = NULL;
 
-  gtk_clutter_texture_set_from_pixbuf (CLUTTER_TEXTURE (warp->actor),
+  gtk_clutter_texture_set_from_pixbuf (GTK_CLUTTER_TEXTURE (warp->actor),
                                       boni_pixmaps[WARP],
                                       &err);
   if (err)
diff --git a/gnibbles/worm.c b/gnibbles/worm.c
index 7040983..a34626d 100644
--- a/gnibbles/worm.c
+++ b/gnibbles/worm.c
@@ -166,9 +166,12 @@ static void
 gnibbles_worm_add_actor (GnibblesWorm *worm)
 {
   ClutterActor *actor;
+  GError *error = NULL;
 
-  actor = gtk_clutter_texture_new_from_pixbuf (
-            worm_pixmaps[properties->wormprops[worm->number]->color - 12]);
+  actor = gtk_clutter_texture_new ();
+  gtk_clutter_texture_set_from_pixbuf (GTK_CLUTTER_TEXTURE (actor),
+                                       worm_pixmaps[properties->wormprops[worm->number]->color - 12],
+                                       &error);
   clutter_actor_set_size (actor, properties->tilesize, properties->tilesize);
   clutter_actor_set_position (actor,
                               worm->xhead * properties->tilesize,
@@ -481,13 +484,16 @@ gnibbles_worm_animate_death (GnibblesWorm *worm)
 {
   ClutterActor *group = clutter_group_new ();
   ClutterActor *tmp = NULL;
+  GError *error = NULL;
 
   int i;
   gfloat x,y;
 
   for (i = 0; i < g_list_length (worm->list); i++) {
-    tmp = gtk_clutter_texture_new_from_pixbuf (
-            worm_pixmaps [properties->wormprops[worm->number]->color - 12]);
+    tmp = gtk_clutter_texture_new ();
+    gtk_clutter_texture_set_from_pixbuf (GTK_CLUTTER_TEXTURE (tmp),
+                                         worm_pixmaps[properties->wormprops[worm->number]->color - 12],
+                                         &error);
 
     clutter_actor_get_position (CLUTTER_ACTOR (g_list_nth_data (worm->list, i)),
                                 &x, &y);
@@ -661,7 +667,7 @@ gnibbles_worm_rescale (GnibblesWorm *worm, gint tilesize)
                                 (y_pos / properties->tilesize) * tilesize);
 
     gtk_clutter_texture_set_from_pixbuf (
-       CLUTTER_TEXTURE (tmp),
+       GTK_CLUTTER_TEXTURE (tmp),
        worm_pixmaps[properties->wormprops[worm->number]->color - 12],
        &err);
     if (err)
@@ -704,6 +710,7 @@ gnibbles_worm_reduce_tail (GnibblesWorm *worm, gint erasesize)
   gfloat x,y;
   ClutterActor *tmp = NULL;
   ClutterActor *group = clutter_group_new ();
+  GError *error = NULL;
 
   if (erasesize) {
     if (g_list_length (worm->list) <= erasesize) {
@@ -712,8 +719,10 @@ gnibbles_worm_reduce_tail (GnibblesWorm *worm, gint erasesize)
     }
 
     for (i = 0; i < erasesize; i++) {
-      tmp = gtk_clutter_texture_new_from_pixbuf (
-              worm_pixmaps[properties->wormprops[worm->number]->color - 12]);
+      tmp = gtk_clutter_texture_new ();
+      gtk_clutter_texture_set_from_pixbuf (GTK_CLUTTER_TEXTURE (tmp),
+                                           worm_pixmaps[properties->wormprops[worm->number]->color - 12],
+                                           &error);
       clutter_actor_get_position
         (CLUTTER_ACTOR (g_list_last (worm->list)->data), &x, &y);
       clutter_actor_set_position (CLUTTER_ACTOR (tmp), x, y);



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