In the project my team and I are currently working on we've seemingly ran into a huge roadblock.
In order to support older and lower end devices we added a quality setting to our game, which the user can change during the fights in our game (it's a cross between PunchOut and a political parody). In order to do this I would've liked to just be able to swap out the atlas at run-time with a performance variant, however as far as I can see this isn't possible with the C++/Cocos2d-x runtimes. (If this is possible, could you please point me in the right direction for it. I've been scouring the internet for a solution to this for days now and haven't turned up anything useful.)
To get around this we are disposing of the SkeletonAnimation object, and then creating a new one using the new texture atlas, this part works fine. But in order to maintain the state of the animation tracks before we dispose of the old skeleton we get a reference to the old skeleton's AnimationState, and try to apply this to the new skeleton...
This is where the issue begins, while this code seemingly works and positions the new skeleton in the same position of the animation that the old skeleton was in, the animation does not continue from that point. Until we play a new animation track the new skeleton will forever be in that frozen pose... For the life of me I can't seem to figure out how to maintain the AnimationState from the old skeleton to the new skeleton, and have the animation continue from that point.
So why is the skeleton frozen after using AnimationState->apply, and how do I get the skeleton to continue playing the animation from that point? Maintaining the AnimationState is vital for us because we use tons of TrackEntry's with their own lambda functions onTrackCompletion, independent of the animation itself but based on the state of the fighter, among other things.
I might not be explaining myself or what we are trying to accomplish very well, and am most likely doing something wrong or unintended to achieve this. Any advice and suggestions to fix this system would be greatly appreciated, as I'd rather not have to tell the player that all graphics changes will take place in the next fight... Thank you for your time!
TLDR; I get the AnimationState from a SkeletonAnimation object, create a new SkeletonAnimation object with the same JSON but a different atlas. I then use animationState->apply(*newSkeleton->getSkeleton()), which sets the new skeleton into the correct pose of the correct animation. The problem being that the new skeleton is frozen in that pose until we do newSkeleton->setAnimation(...).