From: dooglus Date: Mon, 3 Mar 2008 18:11:07 +0000 (+0000) Subject: Remove the ETL_FIXED_DERIVATIVE macro. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=003520b8158176c1509825eef09f46cd417dcc16;p=synfig.git Remove the ETL_FIXED_DERIVATIVE macro. git-svn-id: http://svn.voria.com/code@1853 1f10aa63-cdf2-0310-b900-c93c546f37ac --- diff --git a/ETL/trunk/ETL/_calculus.h b/ETL/trunk/ETL/_calculus.h index a9c95ed..279ed91 100644 --- a/ETL/trunk/ETL/_calculus.h +++ b/ETL/trunk/ETL/_calculus.h @@ -34,8 +34,6 @@ //#define _EPSILON 0.0000001 //#endif -#define ETL_FIXED_DERIVATIVE 1 - /* === T Y P E D E F S ===================================================== */ /* === C L A S S E S & S T R U C T S ======================================= */ @@ -53,11 +51,7 @@ public: typename T::result_type operator()(const typename T::argument_type &x)const { -#ifdef ETL_FIXED_DERIVATIVE return (func(x+epsilon)-func(x))/epsilon; -#else - return (func(x)-func(x+epsilon))/epsilon; -#endif } }; diff --git a/synfig-core/trunk/src/synfig/valuenode_blinecalctangent.cpp b/synfig-core/trunk/src/synfig/valuenode_blinecalctangent.cpp index 671ce59..51bcafc 100644 --- a/synfig-core/trunk/src/synfig/valuenode_blinecalctangent.cpp +++ b/synfig-core/trunk/src/synfig/valuenode_blinecalctangent.cpp @@ -127,21 +127,12 @@ ValueNode_BLineCalcTangent::operator()(Time t)const blinepoint0.get_tangent2(), blinepoint1.get_tangent1()); etl::derivative< etl::hermite > deriv(curve); -#ifdef ETL_FIXED_DERIVATIVE switch (get_type()) { case ValueBase::TYPE_ANGLE: return (deriv(amount-from_vertex)*(0.5)).angle(); case ValueBase::TYPE_VECTOR: return deriv(amount-from_vertex)*(0.5); default: assert(0); return ValueBase(); } -#else - switch (get_type()) - { - case ValueBase::TYPE_ANGLE: return (deriv(amount-from_vertex)*(-0.5)).angle(); - case ValueBase::TYPE_VECTOR: return deriv(amount-from_vertex)*(-0.5); - default: assert(0); return ValueBase(); - } -#endif } String diff --git a/synfig-core/trunk/src/synfig/valuenode_segcalctangent.cpp b/synfig-core/trunk/src/synfig/valuenode_segcalctangent.cpp index 2159663..ab3f454 100644 --- a/synfig-core/trunk/src/synfig/valuenode_segcalctangent.cpp +++ b/synfig-core/trunk/src/synfig/valuenode_segcalctangent.cpp @@ -84,12 +84,7 @@ ValueNode_SegCalcTangent::operator()(Time t)const etl::hermite curve(segment.p1,segment.p2,segment.t1,segment.t2); etl::derivative< etl::hermite > deriv(curve); -#ifdef ETL_FIXED_DERIVATIVE return deriv((*amount_)(t).get(Real()))*(0.5); -#else - return deriv((*amount_)(t).get(Real()))*(-0.5); -#endif - } diff --git a/synfig-studio/trunk/src/gtkmm/state_bline.cpp b/synfig-studio/trunk/src/gtkmm/state_bline.cpp index 51afaff..cee1d8d 100644 --- a/synfig-studio/trunk/src/gtkmm/state_bline.cpp +++ b/synfig-studio/trunk/src/gtkmm/state_bline.cpp @@ -1306,11 +1306,7 @@ StateBLine_Context::bline_insert_vertex(synfig::ValueNode_Const::Handle value_no bline_point.set_vertex(curve(origin)); bline_point.set_width((next_bline_point.get_width()-prev_bline_point.get_width())*origin+prev_bline_point.get_width()); -#ifdef ETL_FIXED_DERIVATIVE bline_point.set_tangent1(deriv(origin)*std::min(1.0f-origin,origin)); -#else - bline_point.set_tangent1(-deriv(origin)*std::min(1.0f-origin,origin)); -#endif bline_point.set_tangent2(bline_point.get_tangent1()); bline_point.set_split_tangent_flag(false); bline_point.set_origin(origin);