[gnome-games] Same process with warp, Integrated clutter to warp..



commit 9d1176cd6510e0640db054f24ff984f3f6044db7
Author: Guillaume Beland <guillaume beland gmail com>
Date:   Sat Jun 20 22:39:57 2009 -0400

    Same process with warp, Integrated clutter to warp..

 gnibbles/warp.c |   12 ++++++++++++
 gnibbles/warp.h |    2 ++
 2 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/gnibbles/warp.c b/gnibbles/warp.c
index 0c1753a..cff6e63 100644
--- a/gnibbles/warp.c
+++ b/gnibbles/warp.c
@@ -20,10 +20,15 @@
 #include <config.h>
 
 #include <gtk/gtk.h>
+#include <clutter/clutter.h>
+#include <clutter-gtk/clutter-gtk.h>
 
 #include "gnibbles.h"
 #include "warp.h"
+#include "properties.h"
 
+extern GnibblesProperties *properties;
+extern GdkPixbuf *boni_pixmaps[];
 GnibblesWarp *
 gnibbles_warp_new (gint t_x, gint t_y, gint t_wx, gint t_wy)
 {
@@ -35,6 +40,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 ();
 
   return (tmp);
 }
@@ -42,5 +48,11 @@ gnibbles_warp_new (gint t_x, gint t_y, gint t_wx, gint t_wy)
 void
 gnibbles_warp_draw_buffer (GnibblesWarp * warp)
 {
+  gtk_clutter_texture_set_from_pixbuf (CLUTTER_TEXTURE (warp->actor),
+                                      boni_pixmaps[WARP]) ;
+  clutter_actor_set_position (CLUTTER_ACTOR (warp->actor),
+                              properties->tilesize * warp->x,
+                              properties->tilesize * warp->y);
+
   gnibbles_draw_big_pixmap_buffer (WARP, warp->x, warp->y);
 }
diff --git a/gnibbles/warp.h b/gnibbles/warp.h
index 2c8c922..6ee0806 100644
--- a/gnibbles/warp.h
+++ b/gnibbles/warp.h
@@ -23,12 +23,14 @@
 #include <config.h>
 
 #include <gtk/gtk.h>
+#include <clutter/clutter.h>
 
 #define WARP     8
 
 typedef struct {
   gint x, y;
   gint wx, wy;
+  ClutterActor *actor;
 } GnibblesWarp;
 
 GnibblesWarp *gnibbles_warp_new (gint t_x, gint t_y, gint t_wx, gint t_wy);



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