mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-20 17:26:01 +08:00
[cpp] Fix sequence timeline not setting renderer object correctly., formatting
This commit is contained in:
parent
1cba329685
commit
1976a3e6ca
@ -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();
|
||||
}
|
||||
|
||||
@ -1279,8 +1279,8 @@ Animation *SkeletonJson::readAnimation(Json *root, SkeletonData *skeletonData) {
|
||||
Vector<float> &verts = vertexAttachment->_vertices;
|
||||
int deformLength = weighted ? verts.size() / 3 * 2 : verts.size();
|
||||
|
||||
DeformTimeline *timeline = new(__FILE__, __LINE__) DeformTimeline(frames,
|
||||
frames, slotIndex,vertexAttachment);
|
||||
DeformTimeline *timeline = new (__FILE__, __LINE__) DeformTimeline(frames,
|
||||
frames, slotIndex, vertexAttachment);
|
||||
float time = Json::getFloat(keyMap, "time", 0);
|
||||
for (frame = 0, bezier = 0;; frame++) {
|
||||
Json *vertices = Json::getItem(keyMap, "vertices");
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user