mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-21 09:46:02 +08:00
Formatting
This commit is contained in:
parent
42bce02619
commit
a57f1b85b6
@ -676,18 +676,18 @@ void _spAnimationState_applyRotateTimeline(spAnimationState *self, spTimeline *t
|
|||||||
lastTotal = timelinesRotation[i];
|
lastTotal = timelinesRotation[i];
|
||||||
lastDiff = timelinesRotation[i + 1];
|
lastDiff = timelinesRotation[i + 1];
|
||||||
}
|
}
|
||||||
loops = lastTotal - FMOD(lastTotal, 360);
|
loops = lastTotal - FMOD(lastTotal, 360);
|
||||||
total = diff + loops;
|
total = diff + loops;
|
||||||
current = diff >= 0, dir = lastTotal >= 0;
|
current = diff >= 0, dir = lastTotal >= 0;
|
||||||
if (ABS(lastDiff) <= 90 && SIGNUM(lastDiff) != SIGNUM(diff)) {
|
if (ABS(lastDiff) <= 90 && SIGNUM(lastDiff) != SIGNUM(diff)) {
|
||||||
if (ABS(lastTotal - loops) > 180) {
|
if (ABS(lastTotal - loops) > 180) {
|
||||||
total += 360 * SIGNUM(lastTotal);
|
total += 360 * SIGNUM(lastTotal);
|
||||||
dir = current;
|
dir = current;
|
||||||
} else if (loops != 0)
|
} else if (loops != 0)
|
||||||
total -= 360 * SIGNUM(lastTotal);
|
total -= 360 * SIGNUM(lastTotal);
|
||||||
else
|
else
|
||||||
dir = current;
|
dir = current;
|
||||||
}
|
}
|
||||||
if (dir != current) total += 360 * SIGNUM(lastTotal);
|
if (dir != current) total += 360 * SIGNUM(lastTotal);
|
||||||
timelinesRotation[i] = total;
|
timelinesRotation[i] = total;
|
||||||
}
|
}
|
||||||
@ -1037,9 +1037,9 @@ float spTrackEntry_getAnimationTime(spTrackEntry *entry) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void spTrackEntry_resetRotationDirections(spTrackEntry *entry) {
|
void spTrackEntry_resetRotationDirections(spTrackEntry *entry) {
|
||||||
FREE(entry->timelinesRotation);
|
FREE(entry->timelinesRotation);
|
||||||
entry->timelinesRotation = NULL;
|
entry->timelinesRotation = NULL;
|
||||||
entry->timelinesRotationCount = 0;
|
entry->timelinesRotationCount = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
float spTrackEntry_getTrackComplete(spTrackEntry *entry) {
|
float spTrackEntry_getTrackComplete(spTrackEntry *entry) {
|
||||||
|
|||||||
@ -745,18 +745,18 @@ void AnimationState::applyRotateTimeline(RotateTimeline *rotateTimeline, Skeleto
|
|||||||
lastTotal = timelinesRotation[i];
|
lastTotal = timelinesRotation[i];
|
||||||
lastDiff = timelinesRotation[i + 1];
|
lastDiff = timelinesRotation[i + 1];
|
||||||
}
|
}
|
||||||
float loops = lastTotal - MathUtil::fmod(lastTotal, 360.f);
|
float loops = lastTotal - MathUtil::fmod(lastTotal, 360.f);
|
||||||
total = diff + loops;
|
total = diff + loops;
|
||||||
bool current = diff >= 0, dir = lastTotal >= 0;
|
bool current = diff >= 0, dir = lastTotal >= 0;
|
||||||
if (MathUtil::abs(lastDiff) <= 90 && MathUtil::sign(lastDiff) != MathUtil::sign(diff)) {
|
if (MathUtil::abs(lastDiff) <= 90 && MathUtil::sign(lastDiff) != MathUtil::sign(diff)) {
|
||||||
if (MathUtil::abs(lastTotal - loops) > 180) {
|
if (MathUtil::abs(lastTotal - loops) > 180) {
|
||||||
total += 360.f * MathUtil::sign(lastTotal);
|
total += 360.f * MathUtil::sign(lastTotal);
|
||||||
dir = current;
|
dir = current;
|
||||||
} else if (loops != 0)
|
} else if (loops != 0)
|
||||||
total -= 360.f * MathUtil::sign(lastTotal);
|
total -= 360.f * MathUtil::sign(lastTotal);
|
||||||
else
|
else
|
||||||
dir = current;
|
dir = current;
|
||||||
}
|
}
|
||||||
if (dir != current) {
|
if (dir != current) {
|
||||||
total += 360 * MathUtil::sign(lastTotal);
|
total += 360 * MathUtil::sign(lastTotal);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -123,7 +123,7 @@ namespace spine {
|
|||||||
uvs = ®ionAttachment->getUVs();
|
uvs = ®ionAttachment->getUVs();
|
||||||
indices = &quadIndices;
|
indices = &quadIndices;
|
||||||
indicesCount = 6;
|
indicesCount = 6;
|
||||||
texture = (Texture *) ((AtlasRegion*)regionAttachment->getRegion())->page->texture;
|
texture = (Texture *) ((AtlasRegion *) regionAttachment->getRegion())->page->texture;
|
||||||
|
|
||||||
} else if (attachment->getRTTI().isExactly(MeshAttachment::rtti)) {
|
} else if (attachment->getRTTI().isExactly(MeshAttachment::rtti)) {
|
||||||
MeshAttachment *mesh = (MeshAttachment *) attachment;
|
MeshAttachment *mesh = (MeshAttachment *) attachment;
|
||||||
@ -140,7 +140,7 @@ namespace spine {
|
|||||||
uvs = &mesh->getUVs();
|
uvs = &mesh->getUVs();
|
||||||
indices = &mesh->getTriangles();
|
indices = &mesh->getTriangles();
|
||||||
indicesCount = mesh->getTriangles().size();
|
indicesCount = mesh->getTriangles().size();
|
||||||
texture = (Texture *) ((AtlasRegion*)mesh->getRegion())->page->texture;
|
texture = (Texture *) ((AtlasRegion *) mesh->getRegion())->page->texture;
|
||||||
|
|
||||||
} else if (attachment->getRTTI().isExactly(ClippingAttachment::rtti)) {
|
} else if (attachment->getRTTI().isExactly(ClippingAttachment::rtti)) {
|
||||||
ClippingAttachment *clip = (ClippingAttachment *) slot.getAttachment();
|
ClippingAttachment *clip = (ClippingAttachment *) slot.getAttachment();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user