From f6cbff942f0698addbaffbb971a7e736b76282b7 Mon Sep 17 00:00:00 2001 From: NathanSweet Date: Mon, 5 May 2014 21:31:59 +0200 Subject: [PATCH] ANSI C is fun! --- spine-c/src/spine/Animation.c | 6 ++++-- spine-c/src/spine/Atlas.c | 9 ++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/spine-c/src/spine/Animation.c b/spine-c/src/spine/Animation.c index b56d31a70..89db633d4 100644 --- a/spine-c/src/spine/Animation.c +++ b/spine-c/src/spine/Animation.c @@ -641,6 +641,8 @@ void _spFFDTimeline_apply (const spTimeline* timeline, spSkeleton* skeleton, flo int* eventCount, float alpha) { int frameIndex, i; float percent, frameTime; + const float* prevVertices; + const float* nextVertices; spFFDTimeline* self = (spFFDTimeline*)timeline; spSlot *slot = skeleton->slots[self->slotIndex]; @@ -677,8 +679,8 @@ void _spFFDTimeline_apply (const spTimeline* timeline, spSkeleton* skeleton, flo percent = 1 - (time - frameTime) / (self->frames[frameIndex - 1] - frameTime); percent = spCurveTimeline_getCurvePercent(SUPER(self), frameIndex - 1, percent < 0 ? 0 : (percent > 1 ? 1 : percent)); - const float* prevVertices = self->frameVertices[frameIndex - 1]; - const float* nextVertices = self->frameVertices[frameIndex]; + prevVertices = self->frameVertices[frameIndex - 1]; + nextVertices = self->frameVertices[frameIndex]; if (alpha < 1) { for (i = 0; i < self->frameVerticesCount; ++i) { diff --git a/spine-c/src/spine/Atlas.c b/spine-c/src/spine/Atlas.c index 00fcd140a..720ba8292 100644 --- a/spine-c/src/spine/Atlas.c +++ b/spine-c/src/spine/Atlas.c @@ -173,19 +173,22 @@ static const char* textureFilterNames[] = {"Nearest", "Linear", "MipMap", "MipMa "MipMapNearestLinear", "MipMapLinearLinear"}; spAtlas* spAtlas_create (const char* begin, int length, const char* dir, void* rendererObject) { + spAtlas* self; + int count; const char* end = begin + length; int dirLength = strlen(dir); int needsSlash = dirLength > 0 && dir[dirLength - 1] != '/' && dir[dirLength - 1] != '\\'; - spAtlas* self = NEW(spAtlas); - self->rendererObject = rendererObject; - spAtlasPage *page = 0; spAtlasPage *lastPage = 0; spAtlasRegion *lastRegion = 0; Str str; Str tuple[4]; + + self = NEW(spAtlas); + self->rendererObject = rendererObject; + readLine(begin, 0, 0); while (readLine(0, end, &str)) { if (str.end - str.begin == 0) {