Pre-increment for consistency.

This commit is contained in:
NathanSweet 2014-05-05 15:07:28 +02:00
parent 22c58fd8dc
commit 79c11424f4
2 changed files with 10 additions and 10 deletions

View File

@ -536,7 +536,7 @@ void _spEventTimeline_apply (const spTimeline* timeline, spSkeleton* skeleton, f
frameIndex--;
}
}
for (; frameIndex < self->framesCount && time >= self->frames[frameIndex]; frameIndex++) {
for (; frameIndex < self->framesCount && time >= self->frames[frameIndex]; ++frameIndex) {
firedEvents[*eventCount] = self->events[frameIndex];
(*eventCount)++;
}
@ -593,7 +593,7 @@ void _spDrawOrderTimeline_apply (const spTimeline* timeline, spSkeleton* skeleto
if (!drawOrderToSetupIndex)
memcpy(skeleton->drawOrder, skeleton->slots, self->slotCount * sizeof(int));
else {
for (i = 0; i < self->slotCount; i++)
for (i = 0; i < self->slotCount; ++i)
skeleton->drawOrder[i] = skeleton->slots[drawOrderToSetupIndex[i]];
}
}
@ -664,7 +664,7 @@ void _spFFDTimeline_apply (const spTimeline* timeline, spSkeleton* skeleton, flo
/* Time is after last frame. */
const float* lastVertices = self->frameVertices[self->framesCount - 1];
if (alpha < 1) {
for (i = 0; i < self->frameVerticesCount; i++)
for (i = 0; i < self->frameVerticesCount; ++i)
slot->attachmentVertices[i] += (lastVertices[i] - slot->attachmentVertices[i]) * alpha;
} else
memcpy(slot->attachmentVertices, lastVertices, self->frameVerticesCount * sizeof(float));
@ -681,12 +681,12 @@ void _spFFDTimeline_apply (const spTimeline* timeline, spSkeleton* skeleton, flo
const float* nextVertices = self->frameVertices[frameIndex];
if (alpha < 1) {
for (i = 0; i < self->frameVerticesCount; i++) {
for (i = 0; i < self->frameVerticesCount; ++i) {
float prev = prevVertices[i];
slot->attachmentVertices[i] += (prev + (nextVertices[i] - prev) * percent - slot->attachmentVertices[i]) * alpha;
}
} else {
for (i = 0; i < self->frameVerticesCount; i++) {
for (i = 0; i < self->frameVerticesCount; ++i) {
float prev = prevVertices[i];
slot->attachmentVertices[i] = prev + (nextVertices[i] - prev) * percent;
}

View File

@ -74,7 +74,7 @@ void spAnimationState_dispose (spAnimationState* self) {
int i;
_spAnimationState* internal = SUB_CAST(_spAnimationState, self);
FREE(internal->events);
for (i = 0; i < self->trackCount; i++)
for (i = 0; i < self->trackCount; ++i)
_spTrackEntry_disposeAll(self->tracks[i]);
FREE(self->tracks);
FREE(self);
@ -84,7 +84,7 @@ void spAnimationState_update (spAnimationState* self, float delta) {
int i;
float previousDelta;
delta *= self->timeScale;
for (i = 0; i < self->trackCount; i++) {
for (i = 0; i < self->trackCount; ++i) {
spTrackEntry* current = self->tracks[i];
if (!current) continue;
@ -112,7 +112,7 @@ void spAnimationState_apply (spAnimationState* self, spSkeleton* skeleton) {
int entryChanged;
float time;
spTrackEntry* previous;
for (i = 0; i < self->trackCount; i++) {
for (i = 0; i < self->trackCount; ++i) {
spTrackEntry* current = self->tracks[i];
if (!current) continue;
@ -147,7 +147,7 @@ void spAnimationState_apply (spAnimationState* self, spSkeleton* skeleton) {
}
entryChanged = 0;
for (ii = 0; ii < eventCount; ii++) {
for (ii = 0; ii < eventCount; ++ii) {
spEvent* event = internal->events[ii];
if (current->listener) {
current->listener(self, i, SP_ANIMATION_EVENT, event, 0);
@ -186,7 +186,7 @@ void spAnimationState_apply (spAnimationState* self, spSkeleton* skeleton) {
void spAnimationState_clearTracks (spAnimationState* self) {
int i;
for (i = 0; i < self->trackCount; i++)
for (i = 0; i < self->trackCount; ++i)
spAnimationState_clearTrack(self, i);
self->trackCount = 0;
}