Commit b79b6521995670bef0e96e7b5d3eac8fd359db93
[dali_1.3.46] Merge branch 'devel/master'
Change-Id: I75aee0d88e06855f4e3c3dd7f6b2acabf1fae181
Showing
3 changed files
with
23 additions
and
21 deletions
examples/frame-callback/frame-callback.cpp
| @@ -18,8 +18,6 @@ | @@ -18,8 +18,6 @@ | ||
| 18 | // CLASS HEADER | 18 | // CLASS HEADER |
| 19 | #include "frame-callback.h" | 19 | #include "frame-callback.h" |
| 20 | 20 | ||
| 21 | -#include <iostream> | ||
| 22 | - | ||
| 23 | using namespace Dali; | 21 | using namespace Dali; |
| 24 | 22 | ||
| 25 | FrameCallback::FrameCallback() | 23 | FrameCallback::FrameCallback() |
| @@ -33,7 +31,7 @@ void FrameCallback::SetStageWidth( float stageWidth ) | @@ -33,7 +31,7 @@ void FrameCallback::SetStageWidth( float stageWidth ) | ||
| 33 | stageHalfWidth = stageWidth * 0.5f; | 31 | stageHalfWidth = stageWidth * 0.5f; |
| 34 | } | 32 | } |
| 35 | 33 | ||
| 36 | -void FrameCallback::AddId( unsigned int id ) | 34 | +void FrameCallback::AddId( uint32_t id ) |
| 37 | { | 35 | { |
| 38 | mActorIdContainer.PushBack( id ); | 36 | mActorIdContainer.PushBack( id ); |
| 39 | } | 37 | } |
| @@ -45,23 +43,27 @@ void FrameCallback::Update( Dali::UpdateProxy& updateProxy, float /* elapsedSeco | @@ -45,23 +43,27 @@ void FrameCallback::Update( Dali::UpdateProxy& updateProxy, float /* elapsedSeco | ||
| 45 | { | 43 | { |
| 46 | Vector3 position; | 44 | Vector3 position; |
| 47 | Vector3 size; | 45 | Vector3 size; |
| 48 | - updateProxy.GetPositionAndSize( i, position, size ); // Retrieve the position and size using the Actor ID. | ||
| 49 | - | ||
| 50 | - float halfWidthPoint = stageHalfWidth - size.width * 0.5f; | ||
| 51 | - float xTranslation = std::abs( position.x ); | ||
| 52 | - if( xTranslation > halfWidthPoint ) | 46 | + if( updateProxy.GetPositionAndSize( i, position, size ) ) // Retrieve the position and size using the Actor ID. |
| 53 | { | 47 | { |
| 54 | - // Actor has hit the edge, adjust the size accordingly. | ||
| 55 | - float adjustment = xTranslation - halfWidthPoint; | ||
| 56 | - size.width += adjustment * SIZE_MULTIPLIER; | ||
| 57 | - size.height += adjustment * SIZE_MULTIPLIER; | 48 | + float halfWidthPoint = stageHalfWidth - size.width * 0.5f; |
| 49 | + float xTranslation = std::abs( position.x ); | ||
| 50 | + if( xTranslation > halfWidthPoint ) | ||
| 51 | + { | ||
| 52 | + // Actor has hit the edge, adjust the size accordingly. | ||
| 53 | + float adjustment = xTranslation - halfWidthPoint; | ||
| 54 | + size.width += adjustment * SIZE_MULTIPLIER; | ||
| 55 | + size.height += adjustment * SIZE_MULTIPLIER; | ||
| 58 | 56 | ||
| 59 | - updateProxy.SetSize( i, size ); // Set the size using the UpdateProxy. | ||
| 60 | - } | 57 | + updateProxy.SetSize( i, size ); // Set the size using the UpdateProxy. |
| 58 | + } | ||
| 61 | 59 | ||
| 62 | - // Retrieve the actor's position and set make it more transparent the closer it is to the middle. | ||
| 63 | - Vector4 color = updateProxy.GetWorldColor( i ); | ||
| 64 | - color.a = xTranslation / halfWidthPoint; | ||
| 65 | - updateProxy.SetWorldColor( i, color ); | 60 | + // Retrieve the actor's position and set make it more transparent the closer it is to the middle. |
| 61 | + Vector4 color; | ||
| 62 | + if( updateProxy.GetColor( i, color ) ) | ||
| 63 | + { | ||
| 64 | + color.a = xTranslation / halfWidthPoint; | ||
| 65 | + updateProxy.SetColor( i, color ); | ||
| 66 | + } | ||
| 67 | + } | ||
| 66 | } | 68 | } |
| 67 | } | 69 | } |
examples/frame-callback/frame-callback.h
| @@ -48,7 +48,7 @@ public: | @@ -48,7 +48,7 @@ public: | ||
| 48 | * @brief The actor with the specified ID will be changed when Update() is called. | 48 | * @brief The actor with the specified ID will be changed when Update() is called. |
| 49 | * @param[in] id Actor ID of actor which should be changed by the FrameCallback. | 49 | * @param[in] id Actor ID of actor which should be changed by the FrameCallback. |
| 50 | */ | 50 | */ |
| 51 | - void AddId( unsigned int id ); | 51 | + void AddId( uint32_t id ); |
| 52 | 52 | ||
| 53 | private: | 53 | private: |
| 54 | 54 | ||
| @@ -61,7 +61,7 @@ private: | @@ -61,7 +61,7 @@ private: | ||
| 61 | 61 | ||
| 62 | private: | 62 | private: |
| 63 | 63 | ||
| 64 | - Dali::Vector< unsigned int > mActorIdContainer; ///< Container of Actor IDs. | 64 | + Dali::Vector< uint32_t > mActorIdContainer; ///< Container of Actor IDs. |
| 65 | float stageHalfWidth; ///< Half the width of the stage. Center is 0,0 in the world matrix. | 65 | float stageHalfWidth; ///< Half the width of the stage. Center is 0,0 in the world matrix. |
| 66 | 66 | ||
| 67 | constexpr static float SIZE_MULTIPLIER = 2.0f; ///< Multiplier for the size to set as the actors hit the edge. | 67 | constexpr static float SIZE_MULTIPLIER = 2.0f; ///< Multiplier for the size to set as the actors hit the edge. |
packaging/com.samsung.dali-demo.spec
| @@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
| 2 | 2 | ||
| 3 | Name: com.samsung.dali-demo | 3 | Name: com.samsung.dali-demo |
| 4 | Summary: The OpenGLES Canvas Core Demo | 4 | Summary: The OpenGLES Canvas Core Demo |
| 5 | -Version: 1.3.45 | 5 | +Version: 1.3.46 |
| 6 | Release: 1 | 6 | Release: 1 |
| 7 | Group: System/Libraries | 7 | Group: System/Libraries |
| 8 | License: Apache-2.0 | 8 | License: Apache-2.0 |