Say I have multiple sprites with the same animation.
Will I save memory by creating their CCAnimate* from a shared CCAnimation instance?
or can I create a new CCAnimation for all new CCAnimate.
E.i.:
///////////////////////////
//Does this save on memory?
///////////////////////////
//Create a shared animation
CCAnimation* sharedAnimation= CCAnimation::animationWithFrames(animFrames, 1.0f);
//Create two run animation actions from the same animation
CCAnimate* runAction01 = CCAnimate::actionWithAnimation(sharedAnimation);
CCAnimate* runAction02 = CCAnimate::actionWithAnimation(sharedAnimation);
//Let the sprites run the animations
sprite01->runAction(CCAnimate::actionWithAnimation( runAction01 ));
sprite02->runAction(CCAnimate::actionWithAnimation( runAction02 ));
V.S.
//////////////////////////////
//Does this use more memory?
//////////////////////////////
//Create two animations from the same frames
CCAnimation* anim01= CCAnimation::animationWithFrames(animFrames, 1.0f);
CCAnimation* anim02= CCAnimation::animationWithFrames(animFrames, 1.0f);
//Create two run animation actions from two different animations
CCAnimate* runAction01 = CCAnimate::actionWithAnimation(anim01);
CCAnimate* runAction02 = CCAnimate::actionWithAnimation(anim02);
//Let the sprites run the animations
sprite01->runAction(CCAnimate::actionWithAnimation( runAction01 ));
sprite02->runAction(CCAnimate::actionWithAnimation( runAction02 ));