+2007-11-30 Øyvind Kolås <pippin@o-hand.com>
+
+ * clutter/clutter-timeline.c: (clutter_timeline_get_delta): return the
+ number of milliseconds passed between new-frame events instead of
+ since new-frame events, thus making sure that the sum of _get_delta's
+ returned for all new-frame events is equal to total time elapsed.
+
2007-11-30 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-actor.c (parse_units),
gulong last_frame_msecs;
gulong start_frame_secs;
+ guint msecs_delta;
guint loop : 1;
};
self->priv->fps = clutter_get_default_frame_rate ();
self->priv->n_frames = 0;
+ self->priv->msecs_delta = 0;
}
static gboolean
+ (timeval.tv_usec / 1000);
n_frames = (msecs - priv->last_frame_msecs)
/ (1000 / priv->fps);
+ priv->msecs_delta = msecs - priv->last_frame_msecs;
if (n_frames <= 0)
{
/* First frame, set up timings.*/
priv->start_frame_secs = timeval.tv_sec;
priv->skipped_frames = 0;
+ priv->msecs_delta = 0;
msecs = timeval.tv_usec / 1000;
n_frames = 1;
if (msecs)
{
- GTimeVal timeval;
-
- g_get_current_time (&timeval);
-
- if (priv->last_frame_msecs)
- {
- *msecs = ((timeval.tv_sec - priv->start_frame_secs) * 1000)
- + (timeval.tv_usec / 1000);
- }
- else
- {
- *msecs = timeval.tv_usec / 1000;
- }
+ *msecs = timeline->priv->msecs_delta;
}
return priv->skipped_frames + 1;