---------------------------------------------------------------------
| 545 | } |
| 546 | //--------------------------------------------------------------------- |
| 547 | void XMLSkeletonSerializer::writeAnimation(TiXmlElement* animsNode, |
| 548 | const Animation* anim) |
| 549 | { |
| 550 | TiXmlElement* animNode = |
| 551 | animsNode->InsertEndChild(TiXmlElement("animation"))->ToElement(); |
| 552 | |
| 553 | animNode->SetAttribute("name", anim->getName()); |
| 554 | animNode->SetAttribute("length", StringConverter::toString(anim->getLength())); |
| 555 | |
| 556 | // Optional base keyframe information |
| 557 | if (anim->getUseBaseKeyFrame()) |
| 558 | { |
| 559 | TiXmlElement* baseInfoNode = |
| 560 | animNode->InsertEndChild(TiXmlElement("baseinfo"))->ToElement(); |
| 561 | baseInfoNode->SetAttribute("baseanimationname", anim->getBaseKeyFrameAnimationName()); |
| 562 | baseInfoNode->SetAttribute("basekeyframetime", StringConverter::toString(anim->getBaseKeyFrameTime())); |
| 563 | } |
| 564 | |
| 565 | // Write all tracks |
| 566 | TiXmlElement* tracksNode = |
| 567 | animNode->InsertEndChild(TiXmlElement("tracks"))->ToElement(); |
| 568 | |
| 569 | Animation::OldNodeTrackIterator trackIt = anim->getOldNodeTrackIterator(); |
| 570 | while (trackIt.hasMoreElements()) |
| 571 | { |
| 572 | writeAnimationTrack(tracksNode, trackIt.getNext()); |
| 573 | } |
| 574 | |
| 575 | } |
| 576 | //--------------------------------------------------------------------- |
| 577 | void XMLSkeletonSerializer::writeAnimationTrack(TiXmlElement* tracksNode, |
| 578 | const OldNodeAnimationTrack* track) |
nothing calls this directly
no test coverage detected