diff options
author | Neil Roberts <neil@linux.intel.com> | 2009-06-05 14:06:41 +0100 |
---|---|---|
committer | Neil Roberts <neil@linux.intel.com> | 2009-06-05 14:06:41 +0100 |
commit | 86f41eaacd406902b5d772417738529c971d5935 (patch) | |
tree | 9aad075a3d58f1a561a8efad79a6f739cef9f04c | |
parent | 8e4966de6a061349a5b8669e4f86a87da1efb19d (diff) | |
download | clutter-gtk-86f41eaacd406902b5d772417738529c971d5935.tar.gz |
[gtk-clutter-test] Update for the clutter timeline changes
ClutterTimeline no longer has a frame number so we need to calculate
the rotation using clutter_timeline_get_progress.
-rw-r--r-- | examples/gtk-clutter-test.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/examples/gtk-clutter-test.c b/examples/gtk-clutter-test.c index 9667c78..83e7c2d 100644 --- a/examples/gtk-clutter-test.c +++ b/examples/gtk-clutter-test.c @@ -54,11 +54,12 @@ input_cb (ClutterStage *stage, /* Timeline handler */ void frame_cb (ClutterTimeline *timeline, - gint frame_num, + gint msecs, gpointer data) { SuperOH *oh = (SuperOH *)data; gint i; + guint rotation = clutter_timeline_get_progress (timeline) * 360.0f; #if TRAILS oh->bgpixb = clutter_stage_snapshot (CLUTTER_STAGE (stage), @@ -73,7 +74,7 @@ frame_cb (ClutterTimeline *timeline, /* Rotate everything clockwise about stage center*/ clutter_actor_set_rotation (CLUTTER_ACTOR (oh->group), CLUTTER_Z_AXIS, - frame_num, + rotation, WINWIDTH / 2, WINHEIGHT / 2, 0); for (i = 0; i < NHANDS; i++) @@ -81,12 +82,12 @@ frame_cb (ClutterTimeline *timeline, /* rotate each hand around there centers */ clutter_actor_set_rotation (oh->hand[i], CLUTTER_Z_AXIS, - - 6.0 * frame_num, + - 6.0 * rotation, clutter_actor_get_width (oh->hand[i]) / 2, clutter_actor_get_height (oh->hand[i]) / 2, 0); if (fade == TRUE) - clutter_actor_set_opacity (oh->hand[i], (255 - (frame_num % 255))); + clutter_actor_set_opacity (oh->hand[i], (255 - (rotation % 255))); } /* @@ -241,7 +242,7 @@ main (int argc, char *argv[]) clutter_actor_show_all (CLUTTER_ACTOR (oh->group)); /* Create a timeline to manage animation */ - timeline = clutter_timeline_new (360, 60); /* num frames, fps */ + timeline = clutter_timeline_new (6000); g_object_set(timeline, "loop", TRUE, NULL); /* have it loop */ /* fire a callback for frame change */ |