case Property::STRING:
case Property::ARRAY:
case Property::MAP:
+ case Property::EXTENTS:
case Property::NONE:
{
DALI_ASSERT_ALWAYS( !"PropertyType is not animatable" );
}
// queue a message to add the property
- InstallCustomPropertyMessage( const_cast<EventThreadServices&>(GetEventThreadServices()), *scenePropertyOwner, newProperty.Release() ); // Message takes ownership
+ InstallCustomPropertyMessage( const_cast<EventThreadServices&>(GetEventThreadServices()), *scenePropertyOwner, newProperty ); // Message takes ownership
// notify the derived class (optional) method in case it needs to do some more work on the new property
// note! have to use the local pointer as OwnerPointer now points to NULL as it handed over its ownership
}
}
-void Object::NotifyPropertyAnimation( Animation& animation, Property::Index index, const Property::Value& value )
+void Object::NotifyPropertyAnimation( Animation& animation, Property::Index index, const Property::Value& value, Animation::Type animationType )
{
if ( index < DEFAULT_PROPERTY_MAX_COUNT )
{
- OnNotifyDefaultPropertyAnimation( animation, index, value );
+ OnNotifyDefaultPropertyAnimation( animation, index, value, animationType );
}
- else if ( ( index >= ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX ) && ( index <= ANIMATABLE_PROPERTY_REGISTRATION_MAX_INDEX ) )
+ else
{
- AnimatablePropertyMetadata* animatableProperty = FindAnimatableProperty( index );
- if( animatableProperty )
+ PropertyMetadata* propertyMetadata = NULL;
+ if( ( index >= ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX ) && ( index <= ANIMATABLE_PROPERTY_REGISTRATION_MAX_INDEX ) )
{
- // update the cached property value
- animatableProperty->SetPropertyValue( value );
+ propertyMetadata = FindAnimatableProperty( index );
}
- }
- else
- {
- CustomPropertyMetadata* custom = FindCustomProperty( index );
- if( custom && custom->IsAnimatable() )
+ else
{
- // update the cached property value
- custom->SetPropertyValue( value );
+ CustomPropertyMetadata* custom = FindCustomProperty( index );
+ if( custom && custom->IsAnimatable() )
+ {
+ propertyMetadata = custom;
+ }
+ }
+
+ if( propertyMetadata )
+ {
+ switch( animationType )
+ {
+ case Animation::TO:
+ case Animation::BETWEEN:
+ {
+ // Update the cached property value
+ propertyMetadata->SetPropertyValue( value );
+ break;
+ }
+ case Animation::BY:
+ {
+ // Adjust the cached property value
+ propertyMetadata->AdjustPropertyValueBy( value );
+ break;
+ }
+ }
}
}
}
if( sceneObject != NULL )
{
- SceneGraph::UniformPropertyMapping* map = new SceneGraph::UniformPropertyMapping( uniformName, propertyPtr );
+ OwnerPointer< SceneGraph::UniformPropertyMapping > map = new SceneGraph::UniformPropertyMapping( uniformName, propertyPtr );
// Message takes ownership of Uniform map (and will delete it after copy)
- AddUniformMapMessage( const_cast<EventThreadServices&>(GetEventThreadServices()), *sceneObject, map);
+ AddUniformMapMessage( const_cast<EventThreadServices&>(GetEventThreadServices()), *sceneObject, map );
}
else
{
int arrayIndex = index - PROPERTY_CUSTOM_START_INDEX;
if( arrayIndex >= 0 )
{
- if( arrayIndex < (int)mCustomProperties.Count() ) // we can only access the first 2 billion custom properties
+ if( arrayIndex < static_cast<int>( mCustomProperties.Count() ) ) // we can only access the first 2 billion custom properties
{
property = static_cast<CustomPropertyMetadata*>(mCustomProperties[ arrayIndex ]);
}
AnimatablePropertyMetadata* Object::FindAnimatableProperty( Property::Index index ) const
{
- for ( int arrayIndex = 0; arrayIndex < (int)mAnimatableProperties.Count(); arrayIndex++ )
+ const PropertyMetadataLookup::SizeType count = mAnimatableProperties.Count();
+ for ( PropertyMetadataLookup::SizeType arrayIndex = 0; arrayIndex < count; ++arrayIndex )
{
AnimatablePropertyMetadata* property = static_cast<AnimatablePropertyMetadata*>( mAnimatableProperties[ arrayIndex ] );
if( property->index == index )
if( parentTypeInfo )
{
// Go through each custom property
- for ( int arrayIndex = 0; arrayIndex < (int)mCustomProperties.Count(); arrayIndex++ )
+ const PropertyMetadataLookup::SizeType count = mCustomProperties.Count();
+ for ( PropertyMetadataLookup::SizeType arrayIndex = 0; arrayIndex < count; ++arrayIndex )
{
CustomPropertyMetadata* customProperty = static_cast<CustomPropertyMetadata*>( mCustomProperties[ arrayIndex ] );