END_TEST;
}
+int UtcDaliActorInheritOpacity(void)
+{
+ tet_infoline("Testing Actor::Inherit Opacity");
+ TestApplication application;
+
+ Actor parent = Actor::New();
+ Actor child = Actor::New();
+ parent.Add( child );
+ Stage::GetCurrent().Add( parent );
+
+ DALI_TEST_EQUALS( parent.GetProperty( Actor::Property::COLOR_ALPHA ).Get<float>(), 1.0f, 0.0001f, TEST_LOCATION );
+ DALI_TEST_EQUALS( child.GetProperty( Actor::Property::COLOR_ALPHA ).Get<float>(), 1.0f, 0.0001f, TEST_LOCATION );
+
+ // flush the queue and render once
+ application.SendNotification();
+ application.Render();
+
+ parent.SetOpacity( 0.1f );
+
+ DALI_TEST_EQUALS( parent.GetProperty( Actor::Property::COLOR_ALPHA ).Get<float>(), 0.1f, 0.0001f, TEST_LOCATION );
+ DALI_TEST_EQUALS( child.GetProperty( Actor::Property::COLOR_ALPHA ).Get<float>(), 1.0f, 0.0001f, TEST_LOCATION );
+
+ application.SendNotification();
+ application.Render();
+
+ DALI_TEST_EQUALS( parent.GetProperty( Actor::Property::WORLD_COLOR ).Get<Vector4>(), Vector4(1.f, 1.f, 1.f, 0.1f), 0.0001f, TEST_LOCATION );
+ DALI_TEST_EQUALS( parent.GetCurrentProperty( Actor::Property::COLOR_ALPHA ).Get<float>(), 0.1f, 0.0001f, TEST_LOCATION );
+ DALI_TEST_EQUALS( parent.GetCurrentProperty( Actor::Property::WORLD_COLOR ).Get<Vector4>(), Vector4(1.f, 1.f, 1.f, 0.1f), 0.0001f, TEST_LOCATION );
+ DALI_TEST_EQUALS( child.GetProperty( Actor::Property::WORLD_COLOR ).Get<Vector4>(), Vector4(1.f, 1.f, 1.f, 0.1f), 0.0001f, TEST_LOCATION );
+ DALI_TEST_EQUALS( child.GetCurrentProperty( Actor::Property::WORLD_COLOR ).Get<Vector4>(), Vector4(1.f, 1.f, 1.f, 0.1f), 0.0001f, TEST_LOCATION );
+ DALI_TEST_EQUALS( child.GetCurrentProperty( Actor::Property::COLOR_ALPHA ).Get<float>(), 1.f, 0.0001f, TEST_LOCATION );
+
+ END_TEST;
+}
+
// SetOrientation(float angleRadians, Vector3 axis)
int UtcDaliActorSetOrientation01(void)
{
--- /dev/null
+#ifndef DALI_BITWISE_ENUM_H
+#define DALI_BITWISE_ENUM_H
+
+/*
+ * Copyright (c) 2018 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <type_traits> // std::enable_if, std::underlying_type
+
+namespace Dali
+{
+
+/**
+ * Type traits and methods to enable type safe bit field operators for an enum.
+ * usage:
+ * template<> struct EnableBitMaskOperators< MyEnumType > { static const bool ENABLE = true; };
+ * after this one can set bitfields with | and |=, like
+ * MyEnumType value = FLAG1 | FLAG2;
+ * and test them with &, like:
+ * if( myFlag & FLAG2 )
+ * // do something
+ */
+template< typename Enum >
+struct EnableBitMaskOperators
+{
+ static const bool ENABLE = false; // can't be constexpr as it's a data member
+};
+
+/**
+ * Combine two bitfields
+ * @param lhs bitfield to or
+ * @param rhs bitfield to or
+ * @return EnumType with both flags set
+ */
+template < typename EnumType >
+inline typename std::enable_if< EnableBitMaskOperators< EnumType >::ENABLE, EnumType >::type operator|( EnumType lhs, EnumType rhs )
+{
+ using UnderlyingType = typename std::underlying_type<EnumType>::type;
+ return static_cast<EnumType>( static_cast<UnderlyingType>( lhs ) | static_cast<UnderlyingType>(rhs ) );
+}
+
+/**
+ * Combine two bitfields
+ * @param lhs bitfield to or
+ * @param rhs bitfield to or
+ * @return reference to lhs with both flags set
+ */
+template < typename EnumType >
+inline typename std::enable_if< EnableBitMaskOperators< EnumType >::ENABLE, EnumType& >::type operator|=( EnumType& lhs, EnumType rhs )
+{
+ using UnderlyingType = typename std::underlying_type<EnumType>::type;
+ lhs = static_cast<EnumType>(static_cast<UnderlyingType>( lhs ) | static_cast<UnderlyingType>( rhs ) );
+ return lhs;
+}
+
+/**
+ * Test two bitfields.
+ * @param lhs bitfield to AND
+ * @param rhs bitfield to AND
+ * @return true if at least one flag is same in both
+ */
+template < typename EnumType >
+inline typename std::enable_if< EnableBitMaskOperators< EnumType >::ENABLE, bool >::type operator&( EnumType lhs, EnumType rhs )
+{
+ using UnderlyingType = typename std::underlying_type<EnumType>::type;
+ return static_cast<bool>( static_cast<UnderlyingType>( lhs ) & static_cast<UnderlyingType>(rhs ) );
+}
+
+} // namespace Dali
+
+#endif // DALI_BITWISE_ENUM_H
$(devel_api_src_dir)/animation/animation-devel.h
devel_api_core_common_header_files = \
+ $(devel_api_src_dir)/common/bitwise-enum.h \
$(devel_api_src_dir)/common/circular-queue.h \
$(devel_api_src_dir)/common/hash.h \
$(devel_api_src_dir)/common/map-wrapper.h \
************************** Update node hierarchy *****************************
******************************************************************************/
-inline void UpdateRootNodeOpacity( Layer& rootNode, int nodeDirtyFlags, BufferIndex updateBufferIndex )
+inline void UpdateRootNodeOpacity( Layer& rootNode, NodePropertyFlags nodeDirtyFlags, BufferIndex updateBufferIndex )
{
- if ( nodeDirtyFlags & ColorFlag )
+ if ( nodeDirtyFlags & NodePropertyFlags::COLOR )
{
rootNode.SetWorldColor( rootNode.GetColor( updateBufferIndex ), updateBufferIndex );
}
}
}
-inline void UpdateNodeOpacity( Node& node, int nodeDirtyFlags, BufferIndex updateBufferIndex )
+inline void UpdateNodeOpacity( Node& node, NodePropertyFlags nodeDirtyFlags, BufferIndex updateBufferIndex )
{
// If opacity needs to be recalculated
- if ( nodeDirtyFlags & ColorFlag )
+ if ( nodeDirtyFlags & NodePropertyFlags::COLOR )
{
node.InheritWorldColor( updateBufferIndex );
}
/**
* This is called recursively for all children of the root Node
*/
-inline int UpdateNodes( Node& node,
- int parentFlags,
- BufferIndex updateBufferIndex,
- RenderQueue& renderQueue,
- Layer& currentLayer,
- int inheritedDrawMode )
+inline NodePropertyFlags UpdateNodes( Node& node,
+ NodePropertyFlags parentFlags,
+ BufferIndex updateBufferIndex,
+ RenderQueue& renderQueue,
+ Layer& currentLayer,
+ uint32_t inheritedDrawMode )
{
// Apply constraints to the node
ConstrainPropertyOwner( node, updateBufferIndex );
// Short-circuit for invisible nodes
if ( !node.IsVisible( updateBufferIndex ) )
{
- return 0;
+ return NodePropertyFlags::NOTHING;
}
// If the node was not previously visible
}
// Some dirty flags are inherited from parent
- int nodeDirtyFlags( node.GetDirtyFlags() | ( parentFlags & InheritedDirtyFlags ) );
+ NodePropertyFlags nodeDirtyFlags = node.GetInheritedDirtyFlags( parentFlags );
- int cumulativeDirtyFlags = nodeDirtyFlags;
+ NodePropertyFlags cumulativeDirtyFlags = nodeDirtyFlags;
Layer* layer = ¤tLayer;
Layer* nodeIsLayer( node.GetLayer() );
/**
* The root node is treated separately; it cannot inherit values since it has no parent
*/
-int UpdateNodeTree( Layer& rootNode,
- BufferIndex updateBufferIndex,
- RenderQueue& renderQueue )
+NodePropertyFlags UpdateNodeTree( Layer& rootNode,
+ BufferIndex updateBufferIndex,
+ RenderQueue& renderQueue )
{
DALI_ASSERT_DEBUG( rootNode.IsRoot() );
// Short-circuit for invisible nodes
if ( DALI_UNLIKELY( !rootNode.IsVisible( updateBufferIndex ) ) ) // almost never ever true
{
- return 0;
+ return NodePropertyFlags::NOTHING;
}
// If the root node was not previously visible
rootNode.SetAllDirtyFlags();
}
- int nodeDirtyFlags( rootNode.GetDirtyFlags() );
+ NodePropertyFlags nodeDirtyFlags( rootNode.GetDirtyFlags() );
- int cumulativeDirtyFlags = nodeDirtyFlags;
+ NodePropertyFlags cumulativeDirtyFlags = nodeDirtyFlags;
UpdateRootNodeOpacity( rootNode, nodeDirtyFlags, updateBufferIndex );
#define __DALI_INTERNAL_SCENE_GRAPH_UPDATE_ALGORITHMS_H__
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
// INTERNAL INCLUDES
#include <dali/internal/common/buffer-index.h>
+#include <dali/internal/update/nodes/node-declarations.h>
namespace Dali
{
{
class Layer;
-class Node;
class PropertyOwner;
class RenderQueue;
* @param[in] renderQueue Used to query messages for the next Render.
* @return The cumulative (ORed) dirty flags for the updated nodes
*/
-int UpdateNodeTree( Layer& rootNode,
- BufferIndex updateBufferIndex,
- RenderQueue& renderQueue );
+NodePropertyFlags UpdateNodeTree( Layer& rootNode,
+ BufferIndex updateBufferIndex,
+ RenderQueue& renderQueue );
} // namespace SceneGraph
messageQueue( renderController, sceneGraphBuffers ),
frameCallbackProcessor( NULL ),
keepRenderingSeconds( 0.0f ),
- nodeDirtyFlags( TransformFlag ), // set to TransformFlag to ensure full update the first time through Update()
+ nodeDirtyFlags( NodePropertyFlags::TRANSFORM ), // set to TransformFlag to ensure full update the first time through Update()
frameCounter( 0 ),
renderingBehavior( DevelStage::Rendering::IF_REQUIRED ),
animationFinishedDuringUpdate( false ),
OwnerPointer<FrameCallbackProcessor> frameCallbackProcessor; ///< Owned FrameCallbackProcessor, only created if required.
float keepRenderingSeconds; ///< Set via Dali::Stage::KeepRendering
- int nodeDirtyFlags; ///< cumulative node dirty flags from previous frame
+ NodePropertyFlags nodeDirtyFlags; ///< cumulative node dirty flags from previous frame
int frameCounter; ///< Frame counter used in debugging to choose which frame to debug and which to ignore.
DevelStage::Rendering renderingBehavior; ///< Set via DevelStage::SetRenderingBehavior
{
Node* parent = node->GetParent();
DALI_ASSERT_ALWAYS( NULL != parent );
- parent->SetDirtyFlag( ChildDeletedFlag ); // make parent dirty so that render items dont get reused
+ parent->SetDirtyFlag( NodePropertyFlags::CHILD_DELETED ); // make parent dirty so that render items dont get reused
parent->DisconnectChild( mSceneGraphBuffers.GetUpdateBufferIndex(), *node );
void UpdateManager::UpdateNodes( BufferIndex bufferIndex )
{
- mImpl->nodeDirtyFlags = NothingFlag;
+ mImpl->nodeDirtyFlags = NodePropertyFlags::NOTHING;
if ( !mImpl->root )
{
#define __DALI_INTERNAL_SCENE_GRAPH_NODE_DECLARATIONS_H__
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
// INTERNAL INCLUDES
#include <dali/public-api/common/dali-vector.h>
+#include <dali/devel-api/common/bitwise-enum.h>
#include <dali/devel-api/common/owner-container.h>
#include <dali/internal/common/owner-pointer.h>
typedef NodeContainer::Iterator NodeIter;
typedef NodeContainer::ConstIterator NodeConstIter;
+/**
+ * Flag whether property has changed, during the Update phase.
+ */
+enum class NodePropertyFlags : uint8_t
+// 8 bits is enough for 4 flags (compiler will check it)
+{
+ NOTHING = 0x000,
+ TRANSFORM = 0x001,
+ VISIBLE = 0x002,
+ COLOR = 0x004,
+ CHILD_DELETED = 0x008,
+ ALL = ( CHILD_DELETED << 1 ) - 1 // all the flags
+};
+
} // namespace SceneGraph
} // namespace Internal
+// specialization has to be done in the same namespace
+template<> struct EnableBitMaskOperators< Internal::SceneGraph::NodePropertyFlags > { static const bool ENABLE = true; };
+
} // namespace Dali
#endif // __DALI_INTERNAL_SCENE_GRAPH_NODE_DECLARATIONS_H__
Dali::Internal::MemoryPoolObjectAllocator<Dali::Internal::SceneGraph::Node> gNodeMemoryPool;
#ifdef DEBUG_ENABLED
// keep track of nodes created / deleted, to ensure we have 0 when the process exits or DALi library is unloaded
-int gNodeCount =0;
+int32_t gNodeCount =0;
// Called when the process is about to exit, Node count should be zero at this point.
void __attribute__ ((destructor)) ShutDown(void)
const PositionInheritanceMode Node::DEFAULT_POSITION_INHERITANCE_MODE( INHERIT_PARENT_POSITION );
const ColorMode Node::DEFAULT_COLOR_MODE( USE_OWN_MULTIPLY_PARENT_ALPHA );
-
-Node* Node::New( unsigned int id )
+Node* Node::New( uint32_t id )
{
return new ( gNodeMemoryPool.AllocateRawThreadSafe() ) Node( id );
}
}
}
-Node::Node( unsigned int id )
+Node::Node( uint32_t id )
: mTransformManager( NULL ),
mTransformId( INVALID_TRANSFORM_ID ),
mParentOrigin( TRANSFORM_PROPERTY_PARENT_ORIGIN ),
mClippingDepth( 0u ),
mScissorDepth( 0u ),
mDepthIndex( 0u ),
+ mDirtyFlags( NodePropertyFlags::ALL ),
mRegenerateUniformMap( 0 ),
- mDirtyFlags( AllFlags ),
mDrawMode( DrawMode::NORMAL ),
mColorMode( DEFAULT_COLOR_MODE ),
mClippingMode( ClippingMode::DISABLED ),
void Node::PrepareRender( BufferIndex bufferIndex )
{
- if(mRegenerateUniformMap != 0 )
+ if( mRegenerateUniformMap != 0 )
{
if( mRegenerateUniformMap == 2 )
{
CollectedUniformMap& localMap = mCollectedUniformMap[ bufferIndex ];
localMap.Resize(0);
- for( unsigned int i=0, count=mUniformMaps.Count(); i<count; ++i )
+ for( uint32_t i = 0, count=mUniformMaps.Count(); i<count; ++i )
{
localMap.PushBack( &mUniformMaps[i] );
}
localMap.Resize( oldMap.Count() );
- unsigned int index=0;
+ CollectedUniformMap::SizeType index = 0;
for( CollectedUniformMap::Iterator iter = oldMap.Begin(), end = oldMap.End() ; iter != end ; ++iter, ++index )
{
localMap[index] = *iter;
void Node::AddRenderer( Renderer* renderer )
{
- // Check that it has not been already added.
- unsigned int rendererCount( mRenderer.Size() );
- for( unsigned int i(0); i < rendererCount; ++i )
- {
- if( mRenderer[i] == renderer )
- {
- // Renderer is already in the list.
- return;
- }
- }
-
// If it is the first renderer added, make sure the world transform will be calculated
// in the next update as world transform is not computed if node has no renderers.
- if( rendererCount == 0 )
+ if( mRenderer.Empty() )
{
- mDirtyFlags |= TransformFlag;
+ mDirtyFlags |= NodePropertyFlags::TRANSFORM;
+ }
+ else
+ {
+ // Check that it has not been already added.
+ for( auto&& existingRenderer : mRenderer )
+ {
+ if( existingRenderer == renderer )
+ {
+ // Renderer is already in the list.
+ return;
+ }
+ }
}
mRenderer.PushBack( renderer );
void Node::RemoveRenderer( Renderer* renderer )
{
- unsigned int rendererCount( mRenderer.Size() );
- for( unsigned int i(0); i<rendererCount; ++i )
+ RendererContainer::SizeType rendererCount( mRenderer.Size() );
+ for( RendererContainer::SizeType i = 0; i < rendererCount; ++i )
{
if( mRenderer[i] == renderer )
{
}
}
-int Node::GetDirtyFlags() const
+NodePropertyFlags Node::GetDirtyFlags() const
{
// get initial dirty flags, they are reset ResetDefaultProperties, but setters may have made the node dirty already
- int flags = mDirtyFlags;
+ NodePropertyFlags flags = mDirtyFlags;
// Check whether the visible property has changed
if ( !mVisible.IsClean() )
{
- flags |= VisibleFlag;
+ flags |= NodePropertyFlags::VISIBLE;
}
// Check whether the color property has changed
if ( !mColor.IsClean() )
{
- flags |= ColorFlag;
+ flags |= NodePropertyFlags::COLOR;
}
return flags;
}
+NodePropertyFlags Node::GetInheritedDirtyFlags( NodePropertyFlags parentFlags ) const
+{
+ // Size is not inherited. VisibleFlag is inherited
+ static const NodePropertyFlags InheritedDirtyFlags = NodePropertyFlags::TRANSFORM | NodePropertyFlags::VISIBLE | NodePropertyFlags::COLOR;
+ using UnderlyingType = typename std::underlying_type<NodePropertyFlags>::type;
+
+ return static_cast<NodePropertyFlags>( static_cast<UnderlyingType>( mDirtyFlags ) |
+ ( static_cast<UnderlyingType>( parentFlags ) & static_cast<UnderlyingType>( InheritedDirtyFlags ) ) );
+}
+
void Node::ResetDirtyFlags( BufferIndex updateBufferIndex )
{
- mDirtyFlags = NothingFlag;
+ mDirtyFlags = NodePropertyFlags::NOTHING;
}
void Node::SetParent( Node& parentNode )
class RenderTask;
class UpdateManager;
-/**
- * Flag whether property has changed, during the Update phase.
- */
-enum NodePropertyFlags
-{
- NothingFlag = 0x000,
- TransformFlag = 0x001,
- VisibleFlag = 0x002,
- ColorFlag = 0x004,
- SizeFlag = 0x008,
- OverlayFlag = 0x010,
- SortModifierFlag = 0x020,
- ChildDeletedFlag = 0x040,
-};
-
-static const int AllFlags = ( ChildDeletedFlag << 1 ) - 1; // all the flags
-
-/**
- * Size is not inherited. VisibleFlag is inherited
- */
-static const int InheritedDirtyFlags = TransformFlag | VisibleFlag | ColorFlag | OverlayFlag;
// Flags which require the scene renderable lists to be updated
-static const int RenderableUpdateFlags = TransformFlag | SortModifierFlag | ChildDeletedFlag;
+static NodePropertyFlags RenderableUpdateFlags = NodePropertyFlags::TRANSFORM | NodePropertyFlags::CHILD_DELETED;
/**
* Node is the base class for all nodes in the Scene Graph.
* Construct a new Node.
* @param[in] id The unique ID of the node
*/
- static Node* New( unsigned int id );
+ static Node* New( uint32_t id );
/**
* Deletes a Node.
* Get the renderer at the given index
* @param[in] index
*/
- Renderer* GetRendererAt( unsigned int index ) const
+ Renderer* GetRendererAt( uint32_t index ) const
{
return mRenderer[index];
}
/**
* Retrieve the number of renderers for the node
*/
- unsigned int GetRendererCount()
+ uint32_t GetRendererCount() const
{
- return mRenderer.Size();
+ return static_cast<uint32_t>( mRenderer.Size() );
}
// Containment methods
* Flag that one of the node values has changed in the current frame.
* @param[in] flag The flag to set.
*/
- void SetDirtyFlag(NodePropertyFlags flag)
+ void SetDirtyFlag( NodePropertyFlags flag )
{
mDirtyFlags |= flag;
}
*/
void SetAllDirtyFlags()
{
- mDirtyFlags = AllFlags;
+ mDirtyFlags = NodePropertyFlags::ALL;
}
/**
* Query whether a node is dirty.
* @return The dirty flags
*/
- int GetDirtyFlags() const;
+ NodePropertyFlags GetDirtyFlags() const;
+
+ /**
+ * Query inherited dirty flags.
+ *
+ * @param The parentFlags to or with
+ * @return The inherited dirty flags
+ */
+ NodePropertyFlags GetInheritedDirtyFlags( NodePropertyFlags parentFlags ) const;
/**
* Retrieve the parent-origin of the node.
* or inherits its parent color.
* @param[in] colorMode The new color mode.
*/
- void SetColorMode(ColorMode colorMode)
+ void SetColorMode( ColorMode colorMode )
{
mColorMode = colorMode;
- SetDirtyFlag(ColorFlag);
+ SetDirtyFlag( NodePropertyFlags::COLOR );
}
/**
* @brief Sets the sibling order of the node
* @param[in] order The new order
*/
- void SetDepthIndex( unsigned int depthIndex ){ mDepthIndex = depthIndex; }
+ void SetDepthIndex( uint32_t depthIndex )
+ {
+ mDepthIndex = depthIndex;
+ }
/**
* @brief Get the depth index of the node
* @return Current depth index
*/
- unsigned int GetDepthIndex(){ return mDepthIndex; }
+ uint32_t GetDepthIndex()
+ {
+ return mDepthIndex;
+ }
/**
* @brief Sets the boolean which states whether the position should use the anchor-point.
* Protected constructor; See also Node::New()
* @param[in] id The Unique ID of the actor creating the node
*/
- Node( unsigned int id );
+ Node( uint32_t id );
/**
* Protected virtual destructor; See also Node::Delete( Node* )
/**
* @copydoc NodeDataProvider::GetModelMatrix
*/
- virtual const Matrix& GetModelMatrix( unsigned int bufferId ) const
+ virtual const Matrix& GetModelMatrix( BufferIndex bufferIndex ) const
{
- return GetWorldMatrix( bufferId );
+ return GetWorldMatrix( bufferIndex );
}
/**
* @copydoc NodeDataProvider::GetRenderColor
*/
- virtual const Vector4& GetRenderColor( unsigned int bufferId ) const
+ virtual const Vector4& GetRenderColor( BufferIndex bufferIndex ) const
{
- return GetWorldColor( bufferId );
+ return GetWorldColor( bufferIndex );
}
public: // From UniformMapDataProvider
TransformManager* mTransformManager;
TransformId mTransformId;
- TransformManagerPropertyVector3 mParentOrigin; ///< Local transform; the position is relative to this. Sets the TransformFlag dirty when changed
- TransformManagerPropertyVector3 mAnchorPoint; ///< Local transform; local center of rotation. Sets the TransformFlag dirty when changed
+ TransformManagerPropertyVector3 mParentOrigin; ///< Local transform; the position is relative to this. Sets the Transform flag dirty when changed
+ TransformManagerPropertyVector3 mAnchorPoint; ///< Local transform; local center of rotation. Sets the Transform flag dirty when changed
TransformManagerPropertyVector3 mSize; ///< Size is provided for layouting
TransformManagerPropertyVector3 mPosition; ///< Local transform; distance between parent-origin & anchor-point
TransformManagerPropertyQuaternion mOrientation; ///< Local transform; rotation relative to parent node
InheritedColor mWorldColor; ///< Full inherited color
uint32_t mClippingSortModifier; ///< Contains bit-packed clipping information for quick access when sorting
- const unsigned int mId; ///< The Unique ID of the node.
+ const uint32_t mId; ///< The Unique ID of the node.
protected:
NodeContainer mChildren; ///< Container of children; not owned
CollectedUniformMap mCollectedUniformMap[2]; ///< Uniform maps of the node
- unsigned int mUniformMapChanged[2]; ///< Records if the uniform map has been altered this frame
+ uint32_t mUniformMapChanged[2]; ///< Records if the uniform map has been altered this frame
uint32_t mClippingDepth; ///< The number of stencil clipping nodes deep this node is
uint32_t mScissorDepth; ///< The number of scissor clipping nodes deep this node is
uint32_t mDepthIndex; ///< Depth index of the node
// flags, compressed to bitfield
- unsigned int mRegenerateUniformMap:2; ///< Indicate if the uniform map has to be regenerated this frame
- int mDirtyFlags:8; ///< A composite set of flags for each of the Node properties
+ NodePropertyFlags mDirtyFlags; ///< Dirty flags for each of the Node properties
+ uint32_t mRegenerateUniformMap:2; ///< Indicate if the uniform map has to be regenerated this frame
DrawMode::Type mDrawMode:3; ///< How the Node and its children should be drawn
ColorMode mColorMode:3; ///< Determines whether mWorldColor is inherited, 2 bits is enough
ClippingMode::Type mClippingMode:3; ///< The clipping mode of this node
typedef MessageValue1< Node, bool > LocalType;
// Reserve some memory inside the message queue
- unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+ uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
// Construct message in the message queue memory; note that delete should not be called on the return value
new (slot) LocalType( &node, &Node::SetInheritOrientation, inherit );
typedef MessageValue1< Node, Vector3 > LocalType;
// Reserve some memory inside the message queue
- unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+ uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
// Construct message in the message queue memory; note that delete should not be called on the return value
new (slot) LocalType( &node, &Node::SetParentOrigin, origin );
typedef MessageValue1< Node, Vector3 > LocalType;
// Reserve some memory inside the message queue
- unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+ uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
// Construct message in the message queue memory; note that delete should not be called on the return value
new (slot) LocalType( &node, &Node::SetAnchorPoint, anchor );
typedef MessageValue1< Node, bool > LocalType;
// Reserve some memory inside the message queue
- unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+ uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
// Construct message in the message queue memory; note that delete should not be called on the return value
new (slot) LocalType( &node, &Node::SetInheritPosition, inherit );
typedef MessageValue1< Node, bool > LocalType;
// Reserve some memory inside the message queue
- unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+ uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
// Construct message in the message queue memory; note that delete should not be called on the return value
new (slot) LocalType( &node, &Node::SetInheritScale, inherit );
typedef MessageValue1< Node, ColorMode > LocalType;
// Reserve some memory inside the message queue
- unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+ uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
// Construct message in the message queue memory; note that delete should not be called on the return value
new (slot) LocalType( &node, &Node::SetColorMode, colorMode );
typedef MessageValue1< Node, DrawMode::Type > LocalType;
// Reserve some memory inside the message queue
- unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+ uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
// Construct message in the message queue memory; note that delete should not be called on the return value
new (slot) LocalType( &node, &Node::SetDrawMode, drawMode );
typedef MessageValue1< Node, Renderer* > LocalType;
// Reserve some memory inside the message queue
- unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+ uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
// Construct message in the message queue memory; note that delete should not be called on the return value
new (slot) LocalType( &node, &Node::AddRenderer, renderer );
typedef MessageValue1< Node, Renderer* > LocalType;
// Reserve some memory inside the message queue
- unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+ uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
// Construct message in the message queue memory; note that delete should not be called on the return value
new (slot) LocalType( &node, &Node::RemoveRenderer, renderer );
}
-inline void SetDepthIndexMessage( EventThreadServices& eventThreadServices, const Node& node, unsigned int depthIndex )
+inline void SetDepthIndexMessage( EventThreadServices& eventThreadServices, const Node& node, uint32_t depthIndex )
{
- typedef MessageValue1< Node, unsigned int > LocalType;
+ typedef MessageValue1< Node, uint32_t > LocalType;
// Reserve some memory inside the message queue
- unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+ uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
// Construct message in the message queue memory; note that delete should not be called on the return value
new (slot) LocalType( &node, &Node::SetDepthIndex, depthIndex );
typedef MessageValue1< Node, ClippingMode::Type > LocalType;
// Reserve some memory inside the message queue
- unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+ uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
// Construct message in the message queue memory; note that delete should not be called on the return value
new (slot) LocalType( &node, &Node::SetClippingMode, clippingMode );
typedef MessageValue1< Node, bool > LocalType;
// Reserve some memory inside the message queue
- unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+ uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
// Construct message in the message queue memory; note that delete should not be called on the return value
new (slot) LocalType( &node, &Node::SetPositionUsesAnchorPoint, positionUsesAnchorPoint );
{
mUpdateViewFlag = UPDATE_COUNT;
}
- if( mNode->GetDirtyFlags() & VisibleFlag )
+ if( mNode->GetDirtyFlags() & NodePropertyFlags::VISIBLE )
{
// If the visibility changes, the projection matrix needs to be re-calculated.
// It may happen the first time an actor is rendered it's rendered only once and becomes invisible,