animator: Code style fixes

This commit is contained in:
Emmanuele Bassi 2010-09-29 11:44:46 +01:00
parent 3fe10e0bb1
commit e798047ca0

View File

@ -276,6 +276,7 @@ property_iter_new (ClutterAnimator *animator,
PropObjectKey *key, PropObjectKey *key,
GType type) GType type)
{ {
ClutterAnimatorPrivate *priv = animator->priv;
PropertyIter *property_iter = g_slice_new (PropertyIter); PropertyIter *property_iter = g_slice_new (PropertyIter);
ClutterInterval *interval = g_object_new (CLUTTER_TYPE_INTERVAL, ClutterInterval *interval = g_object_new (CLUTTER_TYPE_INTERVAL,
"value-type", type, "value-type", type,
@ -287,8 +288,7 @@ property_iter_new (ClutterAnimator *animator,
property_iter->interval = interval; property_iter->interval = interval;
property_iter->key = key; property_iter->key = key;
property_iter->alpha = clutter_alpha_new (); property_iter->alpha = clutter_alpha_new ();
clutter_alpha_set_timeline (property_iter->alpha, clutter_alpha_set_timeline (property_iter->alpha, priv->slave_timeline);
animator->priv->slave_timeline);
/* as well as the alpha */ /* as well as the alpha */
g_object_ref_sink (property_iter->alpha); g_object_ref_sink (property_iter->alpha);
@ -861,6 +861,7 @@ clutter_animator_compute_value (ClutterAnimator *animator,
gdouble progress, gdouble progress,
GValue *value) GValue *value)
{ {
ClutterAnimatorPrivate *priv;
ClutterAnimatorKey key; ClutterAnimatorKey key;
ClutterAnimatorKey *previous; ClutterAnimatorKey *previous;
ClutterAnimatorKey *next = NULL; ClutterAnimatorKey *next = NULL;
@ -876,6 +877,8 @@ clutter_animator_compute_value (ClutterAnimator *animator,
g_return_val_if_fail (property_name, FALSE); g_return_val_if_fail (property_name, FALSE);
g_return_val_if_fail (value, FALSE); g_return_val_if_fail (value, FALSE);
priv = animator->priv;
ease_in = clutter_animator_property_get_ease_in (animator, object, ease_in = clutter_animator_property_get_ease_in (animator, object,
property_name); property_name);
interpolation = clutter_animator_property_get_interpolation (animator, interpolation = clutter_animator_property_get_interpolation (animator,
@ -891,7 +894,7 @@ clutter_animator_compute_value (ClutterAnimator *animator,
initial_l = g_list_find_custom (animator->priv->score, &key, initial_l = g_list_find_custom (animator->priv->score, &key,
sort_actor_prop_func); sort_actor_prop_func);
if (!initial_l) if (initial_l == NULL)
return FALSE; return FALSE;
/* first find the interval we belong in, that is the first interval /* first find the interval we belong in, that is the first interval
@ -914,9 +917,7 @@ clutter_animator_compute_value (ClutterAnimator *animator,
} }
} }
else else
{
next = NULL; next = NULL;
}
if (progress < previous->progress) if (progress < previous->progress)
{ {
@ -933,6 +934,7 @@ clutter_animator_compute_value (ClutterAnimator *animator,
g_value_copy (&previous->value, value); g_value_copy (&previous->value, value);
return TRUE; return TRUE;
} }
if (next && next->progress >= progress) if (next && next->progress >= progress)
{ {
ClutterInterval *interval; ClutterInterval *interval;
@ -954,17 +956,15 @@ clutter_animator_compute_value (ClutterAnimator *animator,
g_value_unset (&tmp_value); g_value_unset (&tmp_value);
} }
else else
{
clutter_interval_set_initial_value (interval, &previous->value); clutter_interval_set_initial_value (interval, &previous->value);
}
clutter_interval_set_final_value (interval, &next->value); clutter_interval_set_final_value (interval, &next->value);
alpha = clutter_alpha_new (); alpha = clutter_alpha_new ();
clutter_alpha_set_timeline (alpha, clutter_alpha_set_timeline (alpha, priv->slave_timeline);
animator->priv->slave_timeline);
clutter_alpha_set_mode (alpha, next->mode); clutter_alpha_set_mode (alpha, next->mode);
clutter_timeline_advance (animator->priv->slave_timeline, clutter_timeline_advance (priv->slave_timeline,
sub_progress * 10000); sub_progress * 10000);
sub_progress = clutter_alpha_get_alpha (alpha); sub_progress = clutter_alpha_get_alpha (alpha);