That does sound like what I was seeing!
I attached the full project this time. And here's the slightly modified vine example I used to test:
void test_spine(const char* atlas_file, const char* skeleton_file, const char* animation_name)
{
// Load atlas, skeleton, and animations.
spAtlas* atlas = spAtlas_createFromFile(atlas_file, 0);
spSkeletonJson* json = spSkeletonJson_create(atlas);
json->scale = 0.5f;
spSkeletonData *skeletonData = spSkeletonJson_readSkeletonDataFile(json, skeleton_file);
if (!skeletonData) {
printf("Error: %s\n", json->error);
exit(0);
}
spSkeletonJson_dispose(json);
SkeletonDrawable* drawable = new SkeletonDrawable(skeletonData);
drawable->timeScale = 1;
spSkeleton* skeleton = drawable->skeleton;
skeleton->x = 320;
skeleton->y = 590;
spSkeleton_updateWorldTransform(skeleton);
spAnimationState_setAnimationByName(drawable->state, 0, animation_name, true);
sf::RenderWindow window(sf::VideoMode(640, 640), "Spine SFML - test");
window.setFramerateLimit(60);
sf::Event event;
sf::Clock deltaClock;
while (window.isOpen()) {
while (window.pollEvent(event))
if (event.type == sf::Event::Closed) window.close();
float dt = deltaClock.getElapsedTime().asSeconds();
deltaClock.restart();
drawable->OnUpdate(dt);
window.clear();
window.draw(*drawable);
window.display();
}
spSkeletonData_dispose(skeletonData);
spAtlas_dispose(atlas);
}
test_spine("Hero/Hero.atlas", "Hero/Hero.json", "Idle");
I also tried modifying the test code to rotate the root bone away from 0 to confirm the problem went away and it did not - like you saw. But if I do the same thing in my actual project then it does go away... I'll try to see if I can figure out what else is happening - maybe the ordering is different.
Also, completely unrelated, the spine-c runtime is by far the nicest library code I've ever seen. And it's not even your reference implementation! It's as simple as it can be and well organized so I can actually follow the data flow without needing to understand every part of it. And it's not abusing the heck out of the heap like everything else I try to use. You guys are heroes <3 Please make more stuff.
I guess I just wasn't rotating it far enough. If I add
skeleton->root->rotation = 5.0f;
after setting x, y then the animation appears to play correctly.