}
}
-inline void UpdateNodeTransformValues( Node& node, int nodeDirtyFlags, BufferIndex updateBufferIndex )
+/**
+ * Updates transform values for the given node if the transform flag is dirty.
+ * This includes applying a new size should the SizeMode require it.
+ * Note that this will cause the size dirty flag to be set. This is why we pass
+ * the dirty flags in by reference.
+ * @param[in] node The node to update
+ * @param[in,out] nodeDirtyFlags A reference to the dirty flags, these may be modified by this function
+ * @param[in] updateBufferIndex The current index to use for this frame
+ */
+inline void UpdateNodeTransformValues( Node& node, int& nodeDirtyFlags, BufferIndex updateBufferIndex )
{
// If the transform values need to be reinherited
if( nodeDirtyFlags & TransformFlag )
// Handle size relative to parent modes.
// This must be delt with before rotation/translation as otherwise anything
// anchored to a corner of this child would appear at the wrong position.
+ // The size dirty flag is modified if the size is being overridden.
// Note: Switch is in order of use-case commonality.
switch( node.GetSizeMode() )
{
{
// Set the nodes size to that of the parent.
node.SetSize( updateBufferIndex, node.GetParent()->GetSize( updateBufferIndex ) );
+ nodeDirtyFlags |= SizeFlag;
break;
}
{
// Set the nodes size to the parents multiplied by a user defined value.
node.SetSize( updateBufferIndex, node.GetSizeModeFactor() * node.GetParent()->GetSize( updateBufferIndex ) );
+ nodeDirtyFlags |= SizeFlag;
break;
}
{
// Set the nodes size to the parents plus a user defined value.
node.SetSize( updateBufferIndex, node.GetSizeModeFactor() + node.GetParent()->GetSize( updateBufferIndex ) );
+ nodeDirtyFlags |= SizeFlag;
break;
}
}
UpdateNodeGeometry( node, nodeDirtyFlags, updateBufferIndex );
+ // Note: nodeDirtyFlags are passed in by reference and may be modified by the following function.
+ // It is important that the modified version of these flags are used by the RenderableAttachment.
UpdateNodeTransformValues( node, nodeDirtyFlags, updateBufferIndex );
// Setting STENCIL will override OVERLAY, if that would otherwise have been inherited.