/* 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),
/* 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++)
/* 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)));
}
/*
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 */