X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-core%2Ftrunk%2Fsrc%2Fsynfig%2Fvaluenode_composite.cpp;h=8d7428b1d67b1d3a19e1bafdf7e80de558a52fee;hb=ee0fd97e97433501befb38b88478ab4eb7487ff5;hp=84203c00ccdc7ab6adf63fb8aa34c76c332b3e2a;hpb=cc54c38609ee9745ad678e5e9b9d7d2912be9c95;p=synfig.git diff --git a/synfig-core/trunk/src/synfig/valuenode_composite.cpp b/synfig-core/trunk/src/synfig/valuenode_composite.cpp index 84203c0..8d7428b 100644 --- a/synfig-core/trunk/src/synfig/valuenode_composite.cpp +++ b/synfig-core/trunk/src/synfig/valuenode_composite.cpp @@ -1,6 +1,6 @@ /* === S Y N F I G ========================================================= */ /*! \file valuenode_composite.cpp -** \brief Template File +** \brief Implementation of the "Composite" valuenode conversion. ** ** $Id$ ** @@ -88,7 +88,7 @@ synfig::ValueNode_Composite::ValueNode_Composite(const ValueBase &value): } default: assert(0); - throw Exception::BadType(ValueBase::type_name(get_type())); + throw Exception::BadType(ValueBase::type_local_name(get_type())); } } @@ -184,8 +184,7 @@ ValueNode_Composite::link_count()const bool ValueNode_Composite::set_link_vfunc(int i,ValueNode::Handle x) { - assert(i>=0); - assert(i<6); + assert(i>=0 && iget_type()==ValueBase(Real()).get_type() || PlaceholderValueNode::Handle::cast_dynamic(x)) { components[i]=x; @@ -205,7 +203,6 @@ ValueNode_Composite::set_link_vfunc(int i,ValueNode::Handle x) break; case ValueBase::TYPE_COLOR: - assert(i<4); if(x->get_type()==ValueBase(Real()).get_type() || PlaceholderValueNode::Handle::cast_dynamic(x)) { components[i]=x; @@ -214,7 +211,6 @@ ValueNode_Composite::set_link_vfunc(int i,ValueNode::Handle x) break; case ValueBase::TYPE_SEGMENT: - assert(i<4); if(x->get_type()==ValueBase(Point()).get_type() || PlaceholderValueNode::Handle::cast_dynamic(x)) { components[i]=x; @@ -223,7 +219,6 @@ ValueNode_Composite::set_link_vfunc(int i,ValueNode::Handle x) break; case ValueBase::TYPE_BLINEPOINT: - assert(i<6); if((i==0 || i==4 || i==5) && x->get_type()==ValueBase(Point()).get_type()) { components[i]=x; @@ -250,14 +245,16 @@ ValueNode_Composite::set_link_vfunc(int i,ValueNode::Handle x) ValueNode::LooseHandle ValueNode_Composite::get_link_vfunc(int i)const { - assert(i>=0 && i<6); + assert(i>=0 && i=0 && i<6); + assert(i>=0 && i=0 && i<5); - return strprintf("c%d",i); + assert(i>=0 && i= 0 && name[1]-'1' < link_count()) + return name[1]-'1'; switch(get_type()) { @@ -345,7 +392,7 @@ ValueNode_Composite::get_link_index_from_name(const String &name)const return 0; if(name[0]=='y') return 1; - if(name[0]=='z') + if(name[0]=='z') // \todo "z"? really? return 2; case ValueBase::TYPE_BLINEPOINT: if(name[0]=='p' || name=="v1" || name=="p1")