/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
mDisconnectAction(disconnectAction),
mState(Stopped),
mProgressReachedSignalRequired( false ),
- mAutoReverseEnabled( false )
+ mAutoReverseEnabled( false ),
+ mIsActive{ false }
{
}
- Animation::~Animation()
- {
- }
+ Animation::~Animation() = default;
void Animation::operator delete( void* ptr )
{
void Animation::UpdateAnimators( BufferIndex bufferIndex, bool bake, bool animationFinished )
{
+ mIsActive[bufferIndex] = false;
+
const Vector2 playRange( mPlayRange * mDurationSeconds );
float elapsedSecondsClamped = Clamp( mElapsedSeconds, playRange.x, playRange.y );
progress = Clamp((elapsedSecondsClamped - intervalDelay) / animatorDuration, 0.0f , 1.0f );
}
animator->Update(bufferIndex, progress, bake);
+
+ if (animatorDuration > 0.0f && (elapsedSecondsClamped - intervalDelay) <= animatorDuration)
+ {
+ mIsActive[bufferIndex] = true;
+ }
}
applied = true;
}
/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
mReorder(false)
{}
- TransformManager::~TransformManager()
- {}
+ TransformManager::~TransformManager() = default;
TransformId TransformManager::CreateTransform()
{
}
}
-void TransformManager::Update()
+bool TransformManager::Update()
{
+ bool componentsChanged = false;
+
if( mReorder )
{
//If some transform component has change its parent or has been removed since last update
mBoundingSpheres[i] = mWorld[i].GetTranslation();
mBoundingSpheres[i].w = Length( centerToEdgeWorldSpace );
+ componentsChanged = componentsChanged || mComponentDirty[i];
mComponentDirty[i] = false;
}
+
+ return componentsChanged;
}
void TransformManager::SwapComponents( unsigned int i, unsigned int j )
case TRANSFORM_PROPERTY_POSITION:
{
TransformId index( mIds[id] );
- mComponentDirty[ index ] = true;
return mTxComponentAnimatable[ index ].mPosition;
}
case TRANSFORM_PROPERTY_SCALE:
{
TransformId index( mIds[id] );
- mComponentDirty[ index ] = true;
return mTxComponentAnimatable[ index ].mScale;
}
case TRANSFORM_PROPERTY_PARENT_ORIGIN:
{
TransformId index( mIds[id] );
- mComponentDirty[ index ] = true;
return mTxComponentStatic[ index ].mParentOrigin;
}
case TRANSFORM_PROPERTY_ANCHOR_POINT:
{
TransformId index( mIds[id] );
- mComponentDirty[ index ] = true;
return mTxComponentStatic[ index ].mAnchorPoint;
}
case TRANSFORM_PROPERTY_SIZE:
{
TransformId index( mIds[id] );
- mComponentDirty[ index ] = true;
return mSize[ index ];
}
default:
Quaternion& TransformManager::GetQuaternionPropertyValue( TransformId id )
{
TransformId index( mIds[id] );
- mComponentDirty[ index ] = true;
return mTxComponentAnimatable[ index ].mOrientation;
}
struct NodeDepths
{
- NodeDepths()
- {
- }
+ NodeDepths() = default;
void Add( SceneGraph::Node* node, uint32_t sortedDepth )
{
void SetRenderingBehavior( DevelStage::Rendering renderingBehavior );
/**
+ * Request to render the current frame
+ * @note This is a temporary workaround (to be removed in the future) to request the rendering of
+ * the current frame if the color or visibility of any actor is updated. It MUST NOT be used
+ * for any other purposes.
+ */
+ void RequestRendering();
+
+ /**
* Sets the depths of all layers.
* @param layers The layers in depth order.
* @param[in] rootLayer The root layer of the sorted layers.
* Perform animation updates
* @param[in] bufferIndex to use
* @param[in] elapsedSeconds time since last frame
+ * @return true if at least one animations is currently active or false otherwise
*/
- void Animate( BufferIndex bufferIndex, float elapsedSeconds );
+ bool Animate( BufferIndex bufferIndex, float elapsedSeconds );
/**
* Applies constraints to CustomObjects
new (slot) LocalType( &manager, &UpdateManager::SetRenderingBehavior, renderingBehavior );
}
+inline void RequestRenderingMessage( UpdateManager& manager )
+{
+ using LocalType = Message<UpdateManager>;
+
+ // Reserve some memory inside the message queue
+ uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
+
+ // Construct message in the message queue memory; note that delete should not be called on the return value
+ new (slot) LocalType( &manager, &UpdateManager::RequestRendering );
+}
+
/**
* Create a message for setting the depth of a layer
* @param[in] manager The update manager
/**
* Virtual destructor
*/
- ~IndexBufferMessage() override
- {
- }
+ ~IndexBufferMessage() override = default;
/**
* @copydoc MessageBase::Process