[cpp] Fix sequence timeline not setting renderer object correctly., formatting

This commit is contained in:
Mario Zechner 2021-12-22 15:30:21 +01:00
parent 1cba329685
commit 1976a3e6ca
3 changed files with 9 additions and 6 deletions

View File

@ -66,6 +66,7 @@ void Sequence::apply(Slot *slot, Attachment *attachment) {
if (attachment->getRTTI().isExactly(RegionAttachment::rtti)) {
RegionAttachment *regionAttachment = static_cast<RegionAttachment *>(attachment);
if (regionAttachment->getRegion() != region) {
regionAttachment->setRendererObject(region);
regionAttachment->setRegion(region);
regionAttachment->updateRegion();
}
@ -74,6 +75,7 @@ void Sequence::apply(Slot *slot, Attachment *attachment) {
if (attachment->getRTTI().isExactly(MeshAttachment::rtti)) {
MeshAttachment *meshAttachment = static_cast<MeshAttachment *>(attachment);
if (meshAttachment->getRegion() != region) {
meshAttachment->setRendererObject(region);
meshAttachment->setRegion(region);
meshAttachment->updateRegion();
}

View File

@ -1343,6 +1343,7 @@ Animation *SkeletonJson::readAnimation(Json *root, SkeletonData *skeletonData) {
if (modeString == "pingpongReverse") mode = SequenceMode::pingpongReverse;
timeline->setFrame(frame, time, mode, index, delay);
}
timelines.add(timeline);
}
}
}

View File

@ -645,13 +645,13 @@ int main() {
SpineExtension::setInstance(&dbgExtension);
testcase(dragon, "data/dragon-ess.json", "data/dragon-ess.skel", "data/dragon-pma.atlas", 0.6f);
testcase(vine, "data/vine-pro.json", "data/vine-pro.skel", "data/vine-pma.atlas", 0.5f);
testcase(owl, "data/owl-pro.json", "data/owl-pro.skel", "data/owl-pma.atlas", 0.5f);
testcase(ikDemo, "data/spineboy-pro.json", "data/spineboy-pro.skel", "data/spineboy-pma.atlas", 0.6f);
testcase(mixAndMatch, "data/mix-and-match-pro.json", "data/mix-and-match-pro.skel", "data/mix-and-match-pma.atlas", 0.5f);
testcase(coin, "data/coin-pro.json", "data/coin-pro.skel", "data/coin-pma.atlas", 0.5f);
testcase(owl, "data/owl-pro.json", "data/owl-pro.skel", "data/owl-pma.atlas", 0.5f);
testcase(spineboy, "data/spineboy-pro.json", "data/spineboy-pro.skel", "data/spineboy-pma.atlas", 0.6f);
testcase(raptor, "data/raptor-pro.json", "data/raptor-pro.skel", "data/raptor-pma.atlas", 0.5f);
testcase(vine, "data/vine-pro.json", "data/vine-pro.skel", "data/vine-pma.atlas", 0.5f);
testcase(tank, "data/tank-pro.json", "data/tank-pro.skel", "data/tank-pma.atlas", 0.2f);
testcase(raptor, "data/raptor-pro.json", "data/raptor-pro.skel", "data/raptor-pma.atlas", 0.5f);
testcase(goblins, "data/goblins-pro.json", "data/goblins-pro.skel", "data/goblins-pma.atlas", 1.4f);