Merge branch 'master' of https://github.com/jxhgzs/cocos2d-x into jianghua-patch

This commit is contained in:
James Chen 2013-02-22 13:46:00 +08:00
commit 46ee771e1c
2 changed files with 12 additions and 2 deletions

View File

@ -86,6 +86,7 @@ CCNode::CCNode(void)
, m_uOrderOfArrival(0)
, m_eGLServerState(ccGLServerState(0))
, m_bReorderChildDirty(false)
, m_sOtherTransform(CCAffineTransformMakeIdentity())
{
// set default scheduler and actionManager
CCDirector *director = CCDirector::sharedDirector();
@ -1158,13 +1159,17 @@ CCAffineTransform CCNode::nodeToParentTransform(void)
m_sTransform = CCAffineTransformTranslate(m_sTransform, -m_obAnchorPointInPoints.x, -m_obAnchorPointInPoints.y);
}
}
m_sTransform = CCAffineTransformConcat(m_sTransform, m_sOtherTransform);
m_bTransformDirty = false;
}
return m_sTransform;
}
void CCNode::translateFormOtherNode(CCAffineTransform &transform)
{
m_sOtherTransform = CCAffineTransformMake(transform.a, transform.b, transform.c, transform.d, transform.tx, transform.ty);
m_bTransformDirty = true;
}
CCAffineTransform CCNode::parentToNodeTransform(void)
{
if ( m_bInverseDirty ) {

View File

@ -1256,6 +1256,10 @@ public:
*/
CCPoint convertTouchToNodeSpaceAR(CCTouch * touch);
/**
* Additional a transformation matrix, Used in is not parent-child relationship but we still need to maintain transformation parent-child
*/
void translateFormOtherNode(CCAffineTransform &transform);
/// @} end of Coordinate Converters
private:
@ -1290,6 +1294,7 @@ protected:
CCSize m_obContentSize; ///< untransformed size of the node
CCAffineTransform m_sOtherTransform;///< transform
CCAffineTransform m_sTransform; ///< transform
CCAffineTransform m_sInverse; ///< transform