property = animatable->GetSceneGraphProperty();
}
- else if ( index >= DEFAULT_PROPERTY_MAX_COUNT )
+ else if ( ( index >= CHILD_PROPERTY_REGISTRATION_START_INDEX ) && // Child properties are also stored as custom properties
+ ( index <= PROPERTY_CUSTOM_MAX_INDEX ) )
{
CustomPropertyMetadata* custom = FindCustomProperty( index );
DALI_ASSERT_ALWAYS( custom && "Property index is invalid" );
property = animatable->GetSceneGraphProperty();
}
- else if ( index >= DEFAULT_PROPERTY_MAX_COUNT )
+ else if ( ( index >= CHILD_PROPERTY_REGISTRATION_START_INDEX ) && // Child properties are also stored as custom properties
+ ( index <= PROPERTY_CUSTOM_MAX_INDEX ) )
{
CustomPropertyMetadata* custom = FindCustomProperty( index );
DALI_ASSERT_ALWAYS( custom && "Property index is invalid" );
DALI_ASSERT_ALWAYS( animatable && "Property index is invalid" );
property = animatable->GetSceneGraphProperty();
}
- else if ( index >= DEFAULT_PROPERTY_MAX_COUNT )
+ else if ( ( index > CHILD_PROPERTY_REGISTRATION_START_INDEX ) && // Child properties are also stored as custom properties
+ ( index <= PROPERTY_CUSTOM_MAX_INDEX ) )
{
CustomPropertyMetadata* custom = (object->*findCustomPropertyMethod)( index );
DALI_ASSERT_ALWAYS( custom && "Property index is invalid" );
const PropertyBase* property = newProperty.Get();
if(index >= PROPERTY_CUSTOM_START_INDEX)
{
+ DALI_ASSERT_ALWAYS( index <= PROPERTY_CUSTOM_MAX_INDEX && "Too many custom properties have been registered" );
+
mCustomProperties.PushBack( new CustomPropertyMetadata( name, propertyValue.GetType(), property ) );
}
else
CustomPropertyMetadata* Object::FindCustomProperty( Property::Index index ) const
{
CustomPropertyMetadata* property( NULL );
- int arrayIndex;
if ( ( index >= CHILD_PROPERTY_REGISTRATION_START_INDEX ) && ( index <= CHILD_PROPERTY_REGISTRATION_MAX_INDEX ) )
{
- for ( arrayIndex = 0; arrayIndex < (int)mCustomProperties.Count(); arrayIndex++ )
+ for ( std::size_t arrayIndex = 0; arrayIndex < mCustomProperties.Count(); arrayIndex++ )
{
CustomPropertyMetadata* custom = static_cast<CustomPropertyMetadata*>( mCustomProperties[ arrayIndex ] );
if( custom->childPropertyIndex == index )
}
else
{
- arrayIndex = index - PROPERTY_CUSTOM_START_INDEX;
+ 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
return property;
}
- if ( index >= DEFAULT_PROPERTY_MAX_COUNT )
+ if ( ( index >= CHILD_PROPERTY_REGISTRATION_START_INDEX ) && // Child properties are also stored as custom properties
+ ( index <= PROPERTY_CUSTOM_MAX_INDEX ) )
{
CustomPropertyMetadata* custom = FindCustomProperty( index );
DALI_ASSERT_ALWAYS( custom && "Property index is invalid" );
{
PropertyMetadata* property = NULL;
- if(index >= PROPERTY_CUSTOM_START_INDEX )
+ if( ( index >= CHILD_PROPERTY_REGISTRATION_START_INDEX ) && // Child properties are also stored as custom properties
+ ( index <= PROPERTY_CUSTOM_MAX_INDEX ) )
{
property = FindCustomProperty( index );
}
- else
+ else if( ( index >= ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX ) && ( index <= ANIMATABLE_PROPERTY_REGISTRATION_MAX_INDEX ) )
{
property = FindAnimatableProperty( index );
}
CHILD_PROPERTY_REGISTRATION_MAX_INDEX = 49999999, ///< The maximum index supported when registering a child property @SINCE_1_1.35
PROPERTY_CUSTOM_START_INDEX = 50000000, ///< The index at which custom properties start (SceneGraph and Event side properties per instance) @SINCE_1_0.0
+ PROPERTY_CUSTOM_MAX_INDEX = 59999999, ///< The maximum index supported for custom properties @SINCE_1_1.45
+
+ CORE_PROPERTY_MAX_INDEX = PROPERTY_CUSTOM_MAX_INDEX, ///< The maximum index that Core properties can go up to @SINCE_1_1.45
};
/**