2007-01-18 Tomas Frydrych <tf@openedhand.com>
authorTomas Frydrych <tf@openedhand.com>
Fri, 18 Jan 2008 12:17:41 +0000 (12:17 +0000)
committerTomas Frydrych <tf@openedhand.com>
Fri, 18 Jan 2008 12:17:41 +0000 (12:17 +0000)
* clutter/clutter-fixed.h:
* clutter/clutter-fixed.c:
Added CLUTTER_QDIV() for 64-bit division (bug 564, patch by
Gwenole Beauchesne).

ChangeLog
clutter/clutter-fixed.c
clutter/clutter-fixed.h

index d17870e..7ea0f1b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2007-01-18  Tomas Frydrych  <tf@openedhand.com>
+
+       * clutter/clutter-fixed.h:
+       * clutter/clutter-fixed.c:
+       Added CLUTTER_QDIV() for 64-bit division (bug 564, patch by
+       Gwenole Beauchesne).
+
 2008-01-18  Emmanuele Bassi  <ebassi@openedhand.com>
 
        * clutter/clutter-event.h: Add a gunichar field for the Unicode
@@ -39,7 +46,7 @@
        * clutter/clutter-effect.h:
        * clutter/clutter-effect.c (clutter_effect_scale): Split the
        final scale factor to match the ClutterBehaviourScale changes. (#709)
-       
+
        * tests/test-actors.c:
        * tests/test-effects.c:
        * tests/test-rotate.c:
        * clutter/clutter-model.c:
        (clutter_model_appendv),
        (clutter_model_prependv): Add vector based API for bindings.
-       
+
        (clutter_model_get_column_name),
        (clutter_model_get_column_type),
        (clutter_model_set_sorting_column): Fix the check in the condition
 2008-01-04  Emmanuele Bassi  <ebassi@openedhand.com>
 
        * clutter.symbols: Add clutter_actor_move_byu()
-       
+
        * clutter/clutter-actor.h:
        * clutter/clutter-actor.c:
        (clutter_actor_move_by),
index 891dc1a..f978325 100644 (file)
@@ -741,6 +741,24 @@ clutter_qmulx (ClutterFixed op1, ClutterFixed op2)
 #endif
 }
 
+/**
+ * clutter_fixed_qdivx:
+ * @op1: #ClutterFixed
+ * @op2: #ClutterFixed
+ *
+ * Return value: #ClutterFixed.
+ *
+ * Divides two fixed values using 64bit arithmetic; this provides
+ * significantly better precission than the #CLUTTER_FIXED_DIV macro,
+ * but at performance cost.
+ *
+ * Since: 0.4
+ */
+ClutterFixed
+clutter_qdivx (ClutterFixed op1, ClutterFixed op2)
+{
+  return (ClutterFixed)((((gint64)op1) << CFX_Q) / op2);
+}
 
 /*
  * The log2x() and pow2x() functions
index 7433b4e..912395b 100644 (file)
@@ -274,6 +274,7 @@ typedef gint32 ClutterAngle;    /* angle such that 1024 == 2*PI */
 #define CFX_MUL         CLUTTER_FIXED_MUL
 #define CFX_DIV         CLUTTER_FIXED_DIV
 #define CFX_QMUL(x,y)   clutter_qmulx (x,y)
+#define CFX_QDIV(x,y)   clutter_qdivx (x,y)
 
 /*< public >*/
 /* Fixed point math routines */