From ae6d930bba31e3a87b2b93ccb8426614296f99e6 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Thu, 6 Nov 2008 10:54:31 +0000 Subject: [PATCH] 2008-11-06 Emmanuele Bassi Bug 1233 - CLUTTER_ALPHA_SINE_INC is broken in trunk * clutter/clutter-alpha.c: Fix a rollover in the sine functions. --- ChangeLog | 6 ++++++ clutter/clutter-alpha.c | 8 +++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 572da5db7..418a29c0d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-11-06 Emmanuele Bassi + + Bug 1233 - CLUTTER_ALPHA_SINE_INC is broken in trunk + + * clutter/clutter-alpha.c: Fix a rollover in the sine functions. + 2008-11-05 Neil Roberts * clutter/clutter-color.c (clutter_color_new): Remove CLAMP macros diff --git a/clutter/clutter-alpha.c b/clutter/clutter-alpha.c index 1630ef10c..d8aa48f46 100644 --- a/clutter/clutter-alpha.c +++ b/clutter/clutter-alpha.c @@ -585,7 +585,9 @@ sincx1024_func (ClutterAlpha *alpha, sine = ((cogl_angle_sin (x) + offset) / 2) * CLUTTER_ALPHA_MAX_ALPHA; - return COGL_FIXED_TO_INT (sine); + sine = sine >> COGL_FIXED_Q; + + return sine; } #if 0 @@ -717,7 +719,7 @@ clutter_sine_inc_func (ClutterAlpha *alpha, sine = cogl_angle_sin (x) * CLUTTER_ALPHA_MAX_ALPHA; - return COGL_FIXED_TO_INT (sine); + return ((guint32) sine) >> COGL_FIXED_Q; } /** @@ -759,7 +761,7 @@ clutter_sine_dec_func (ClutterAlpha *alpha, sine = cogl_angle_sin (x) * CLUTTER_ALPHA_MAX_ALPHA; - return COGL_FIXED_TO_INT (sine); + return ((guint32) sine) >> COGL_FIXED_Q; } /**