mirror of
https://github.com/brl/mutter.git
synced 2024-12-22 19:12:04 +00:00
2007-01-30 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-alpha.h: * clutter/clutter-alpha.c: Add the square waveform function clutter_square_func() to the precooked alpha functions.
This commit is contained in:
parent
244cacd14b
commit
9661bd50b8
@ -1,3 +1,10 @@
|
||||
2007-01-30 Emmanuele Bassi <ebassi@openedhand.com>
|
||||
|
||||
* clutter/clutter-alpha.h:
|
||||
* clutter/clutter-alpha.c: Add the square waveform
|
||||
function clutter_square_func() to the precooked
|
||||
alpha functions.
|
||||
|
||||
2007-01-23 Matthew Allum <mallum@openedhand.com>
|
||||
|
||||
* Makefile.am:
|
||||
|
@ -626,3 +626,31 @@ clutter_sine_inc_func (ClutterAlpha *alpha,
|
||||
return sincx1024_func (alpha, 81, CFX_ONE);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_square_func:
|
||||
* @alpha: a #ClutterAlpha
|
||||
* @dummy: unused argument
|
||||
*
|
||||
* Convenience alpha function for a square wave. You can use this
|
||||
* function as the alpha function for clutter_alpha_set_func().
|
||||
*
|
||||
* Return value: an alpha value
|
||||
*
|
||||
* Since: 0.4
|
||||
*/
|
||||
guint32
|
||||
clutter_square_func (ClutterAlpha *alpha,
|
||||
gpointer dummy)
|
||||
{
|
||||
ClutterTimeline *timeline;
|
||||
gint current_frame_num, n_frames;
|
||||
|
||||
timeline = clutter_alpha_get_timeline (alpha);
|
||||
|
||||
current_frame_num = clutter_timeline_get_current_frame (timeline);
|
||||
n_frames = clutter_timeline_get_n_frames (timeline);
|
||||
|
||||
return (current_frame_num > (n_frames / 2)) ? CLUTTER_ALPHA_MAX_ALPHA
|
||||
: 0;
|
||||
}
|
||||
|
@ -104,6 +104,7 @@ ClutterTimeline *clutter_alpha_get_timeline (ClutterAlpha *alpha);
|
||||
#define CLUTTER_ALPHA_RAMP_DEC clutter_ramp_dec_func
|
||||
#define CLUTTER_ALPHA_RAMP clutter_ramp_func
|
||||
#define CLUTTER_ALPHA_SINE clutter_sine_func
|
||||
#define CLUTTER_ALPHA_SQUARE clutter_square_func
|
||||
|
||||
guint32 clutter_ramp_inc_func (ClutterAlpha *alpha,
|
||||
gpointer dummy);
|
||||
@ -113,6 +114,8 @@ guint32 clutter_ramp_func (ClutterAlpha *alpha,
|
||||
gpointer dummy);
|
||||
guint32 clutter_sine_func (ClutterAlpha *alpha,
|
||||
gpointer dummy);
|
||||
guint32 clutter_square_func (ClutterAlpha *alpha,
|
||||
gpointer dummy);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user