Hi All, Nate,
Sorry to keep asking questions about optimization stuff (I'm sure you're all super busy adding new features).
This one seemed worth mentioning - not super high priority since there's a workaround.
Testing on an old Motorola Droid I get 11fps if I do the following:
atlas = Atlas_readAtlasFile("bird_orange.atlas");
for( int i = 0; i < 30; ++i )
{
customLoader = SUPER(CustomAttachmentLoader_create(atlas));
skeletonJson = SkeletonJson_createWithLoader(customLoader);
skeletonData = SkeletonJson_readSkeletonDataFile(skeletonJson, "skeleton.json");
animationStateData = AnimationStateData_create( skeletonData );
skeletonNode = CCSkeleton::create(skeletonData, animationStateData );
skeletonNode->setSkin( "bird_orange" );
skeletonNode->setSlotsToBindPose();
skeletonNode->setAnimation("animation_test_0", true);
skeletonNode->timeScale = 0.8f;
skeletonNode->setPosition(ccp(windowSize.width / 3 * 2, parentNode->getContentSize().height/2 + i*5));
parentNode->addChild(skeletonNode);
}
But if simply recreate the atlas each time, I get 19.5fps. That's a pretty huge difference and allows us to support all those 2.2 devices out there.
for( int i = 0; i < 30; ++i )
{
atlas = Atlas_readAtlasFile("bird_orange.atlas"); //<===========================New Atlas Each Time
customLoader = SUPER(CustomAttachmentLoader_create(atlas));
skeletonJson = SkeletonJson_createWithLoader(customLoader);
skeletonData = SkeletonJson_readSkeletonDataFile(skeletonJson, "skeleton.json");
animationStateData = AnimationStateData_create( skeletonData );
skeletonNode = CCSkeleton::create(skeletonData, animationStateData );
skeletonNode->setSkin( "bird_orange" );
skeletonNode->setSlotsToBindPose();
skeletonNode->setAnimation("animation_test_0", true);
skeletonNode->timeScale = 0.8f;
skeletonNode->setPosition(ccp(windowSize.width / 3 * 2, parentNode->getContentSize().height/2 + i*5));
parentNode->addChild(skeletonNode);
}
Thanks,
-Chad