[Automatic fixed-to-float.sh change] Applies all scripted changes

This is the result of running a number of sed and perl scripts over the code to
do 90% of the work in converting from 16.16 fixed to single precision floating
point.

Note: A pristine cogl-fixed.c has been maintained as a standalone utility API
      so that applications may still take advantage of fixed point if they
      desire for certain optimisations where lower precision may be acceptable.

Note: no API changes were made in Clutter, only in Cogl.

Overview of changes:
- Within clutter/* all usage of the COGL_FIXED_ macros have been changed to use
the CLUTTER_FIXED_ macros.

- Within cogl/* all usage of the COGL_FIXED_ macros have been completly stripped
and expanded into code that works with single precision floats instead.

- Uses of cogl_fixed_* have been replaced with single precision math.h
alternatives.

- Uses of COGL_ANGLE_* and cogl_angle_* have been replaced so we use a float for
angles and math.h replacements.
This commit is contained in:
Robert Bragg
2009-01-20 16:20:54 +00:00
parent abc2a359ea
commit e82f656590
43 changed files with 1428 additions and 1434 deletions

View File

@ -130,42 +130,42 @@ static void
clutter_value_transform_fixed_int (const GValue *src,
GValue *dest)
{
dest->data[0].v_int = COGL_FIXED_TO_INT (src->data[0].v_int);
dest->data[0].v_int = (src->data[0].v_int);
}
static void
clutter_value_transform_fixed_double (const GValue *src,
GValue *dest)
{
dest->data[0].v_double = COGL_FIXED_TO_DOUBLE (src->data[0].v_int);
dest->data[0].v_double = CLUTTER_FIXED_TO_DOUBLE (src->data[0].v_int);
}
static void
clutter_value_transform_fixed_float (const GValue *src,
GValue *dest)
{
dest->data[0].v_float = COGL_FIXED_TO_FLOAT (src->data[0].v_int);
dest->data[0].v_float = CLUTTER_FIXED_TO_FLOAT (src->data[0].v_int);
}
static void
clutter_value_transform_int_fixed (const GValue *src,
GValue *dest)
{
dest->data[0].v_int = COGL_FIXED_FROM_INT (src->data[0].v_int);
dest->data[0].v_int = (float)(src->data[0].v_int);
}
static void
clutter_value_transform_double_fixed (const GValue *src,
GValue *dest)
{
dest->data[0].v_int = COGL_FIXED_FROM_FLOAT (src->data[0].v_double);
dest->data[0].v_int = CLUTTER_FLOAT_TO_FIXED (src->data[0].v_double);
}
static void
clutter_value_transform_float_fixed (const GValue *src,
GValue *dest)
{
dest->data[0].v_int = COGL_FIXED_FROM_FLOAT (src->data[0].v_float);
dest->data[0].v_int = CLUTTER_FLOAT_TO_FIXED (src->data[0].v_float);
}
@ -268,7 +268,7 @@ param_fixed_validate (GParamSpec *pspec,
GValue *value)
{
ClutterParamSpecFixed *fspec = CLUTTER_PARAM_SPEC_FIXED (pspec);
gint oval = COGL_FIXED_TO_INT (value->data[0].v_int);
gint oval = (value->data[0].v_int);
gint min, max, val;
g_assert (CLUTTER_IS_PARAM_SPEC_FIXED (pspec));
@ -279,7 +279,7 @@ param_fixed_validate (GParamSpec *pspec,
min = fspec->minimum;
max = fspec->maximum;
val = COGL_FIXED_TO_INT (value->data[0].v_int);
val = (value->data[0].v_int);
val = CLAMP (val, min, max);
if (val != oval)