[gnome-games/gnibbles-clutter] Change to follow clutter master.



commit 59f8018404dbf2a8db953f7c9e20bdb9790f81c1
Author: Guillaume Beland <guillaume beland gmail com>
Date:   Sat Jun 6 17:25:58 2009 -0400

    Change to follow clutter master.
    
    Changed size and position from gint/guint to gfloat, small fix in
    games-card-textures-cache.c and finally, removed the concept of FPS due to
    change in ClutterTimeline, this changes a lot of things I've planned for worm's
    movement. I'll have to go back to the drawing board to figure out a good way to
    set the speed of worms without the concept of fps
---
 gnibbles/board.c                             |    4 ++--
 gnibbles/main.c                              |    6 +++---
 gnibbles/worm-clutter.c                      |   17 +++++++++--------
 gnibbles/worm-clutter.h                      |    2 +-
 libgames-support/games-card-textures-cache.c |    2 +-
 5 files changed, 16 insertions(+), 15 deletions(-)

diff --git a/gnibbles/board.c b/gnibbles/board.c
index 4ccb73f..8447f76 100644
--- a/gnibbles/board.c
+++ b/gnibbles/board.c
@@ -182,8 +182,8 @@ gnibbles_board_resize (GnibblesBoard *board, gint newtile)
     return;
 
   int i;
-  int x_pos;
-  int y_pos;
+  gfloat x_pos;
+  gfloat y_pos;
   int count;
 
   ClutterActor *tmp;
diff --git a/gnibbles/main.c b/gnibbles/main.c
index 1701fa9..79cbf65 100644
--- a/gnibbles/main.c
+++ b/gnibbles/main.c
@@ -1163,7 +1163,7 @@ static void
 render_logo_clutter (GnibblesBoard *board)
 {
   
-  guint width, height;
+  gfloat width, height;
   ClutterActor *logo;
   ClutterActor *text;
   ClutterActor *desc;
@@ -1340,11 +1340,11 @@ main (int argc, char **argv)
     clutter_actor_raise_top (cworms[i]->actors);
   }
 
-  ClutterTimeline *timeline = clutter_timeline_new (10, 6);
+  ClutterTimeline *timeline = clutter_timeline_new (2);
   clutter_timeline_set_loop (timeline, TRUE);
   cworms[2]->direction = WORMDOWN;
   gnibbles_cworm_add_straight_actor (cworms[2]);
-  
+
   g_signal_connect (timeline, "new-frame", G_CALLBACK (gnibbles_cworm_move), cworms[2]);
   g_signal_connect (timeline, "new-frame", G_CALLBACK (gnibbles_cworm_move), cworms[3]);
   clutter_timeline_start (timeline);
diff --git a/gnibbles/worm-clutter.c b/gnibbles/worm-clutter.c
index f3aa30d..25c79fc 100644
--- a/gnibbles/worm-clutter.c
+++ b/gnibbles/worm-clutter.c
@@ -1,4 +1,4 @@
-/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */
 
 /* 
  *   Gnome Nibbles: Gnome Worm Game
@@ -90,7 +90,7 @@ gnibbles_cworm_add_straight_actor (GnibblesCWorm *worm)
 
   if (worm->list) {
     tmp = (g_list_first (worm->list))->data;
-    guint w,h;
+    gfloat w,h;
     clutter_actor_get_size (CLUTTER_ACTOR (tmp), &w, &h);
     size = w < h ? h : w;
     size = size / properties->tilesize;
@@ -183,10 +183,10 @@ gnibbles_cworm_resize (GnibblesCWorm *worm, gint newtile)
     return;
 
   int i;
-  int x_pos;
-  int y_pos;
+  gfloat x_pos;
+  gfloat y_pos;
   int count;    
-  guint w,h;
+  gfloat w,h;
   guint size;
   gboolean direction;
   GValue val = {0,};
@@ -223,10 +223,11 @@ gnibbles_cworm_resize (GnibblesCWorm *worm, gint newtile)
 }
 
 void
-gnibbles_cworm_move (ClutterTimeline *timeline, gint frame_num, gpointer data)
+gnibbles_cworm_move (ClutterTimeline *timeline, gint msecs, gpointer data)
 {
-  guint w,h;
-  gint x,y;
+
+  gfloat w,h;
+  gfloat x,y;
   guint size;
   gboolean direction;
   GValue val = {0,};
diff --git a/gnibbles/worm-clutter.h b/gnibbles/worm-clutter.h
index 5ad95b7..b57f1ed 100644
--- a/gnibbles/worm-clutter.h
+++ b/gnibbles/worm-clutter.h
@@ -74,7 +74,7 @@ void gnibbles_cworm_destroy (GnibblesCWorm * worm);
 void gnibbles_cworm_inverse (GnibblesCWorm *worm);
 gint gnibbles_cworm_lose_life (GnibblesCWorm * worm);
 void gnibbles_cworm_resize (GnibblesCWorm *worm, gint newtile);
-void gnibbles_cworm_move (ClutterTimeline *timeline, gint frame_num, gpointer data);
+void gnibbles_cworm_move (ClutterTimeline *timeline, gint msecs, gpointer data);
 
 gint gnibbles_cworm_handle_keypress (GnibblesCWorm * worm, guint keyval);
 void gnibbles_cworm_draw_head (GnibblesCWorm * worm);
diff --git a/libgames-support/games-card-textures-cache.c b/libgames-support/games-card-textures-cache.c
index 6d1f13c..2b7dbf5 100644
--- a/libgames-support/games-card-textures-cache.c
+++ b/libgames-support/games-card-textures-cache.c
@@ -307,7 +307,7 @@ games_card_textures_cache_get_card_texture_by_id (GamesCardTexturesCache *cache,
 
     handle = cogl_texture_new_from_data (gdk_pixbuf_get_width (pixbuf),
                                          gdk_pixbuf_get_height (pixbuf),
-                                         64, FALSE,
+                                         COGL_TEXTURE_NONE/*64, FALSE*/,
                                          gdk_pixbuf_get_has_alpha (pixbuf)
                                          ? COGL_PIXEL_FORMAT_RGBA_8888
                                          : COGL_PIXEL_FORMAT_RGB_888,



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