Skip to content

Commit 9bcb51f

Browse files
committed
Steve: fix warnings /spine/
1 parent bc91f16 commit 9bcb51f

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

cocos/editor-support/spine/SkeletonAnimation.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ void SkeletonAnimation::initialize () {
116116
_state->listener = animationCallback;
117117

118118
_spAnimationState* stateInternal = (_spAnimationState*)_state;
119+
(void)stateInternal; //STEVE: unused
119120
}
120121

121122
SkeletonAnimation::SkeletonAnimation ()

cocos/editor-support/spine/SkeletonJson.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -410,9 +410,9 @@ static spAnimation* _spSkeletonJson_readAnimation (spSkeletonJson* self, Json* r
410410
}
411411
memset(deform2 + v, 0, sizeof(float) * (deformLength - v));
412412
if (!weighted) {
413-
float* vertices = attachment->vertices;
413+
float* vertices2 = attachment->vertices;
414414
for (v = 0; v < deformLength; ++v)
415-
deform2[v] += vertices[v];
415+
deform2[v] += vertices2[v];
416416
}
417417
}
418418
spDeformTimeline_setFrame(timeline, frameIndex, Json_getFloat(valueMap, "time", 0), deform2);
@@ -431,16 +431,16 @@ static spAnimation* _spSkeletonJson_readAnimation (spSkeletonJson* self, Json* r
431431
spDrawOrderTimeline* timeline = spDrawOrderTimeline_create(drawOrder->size, skeletonData->slotsCount);
432432
for (valueMap = drawOrder->child, frameIndex = 0; valueMap; valueMap = valueMap->next, ++frameIndex) {
433433
int ii;
434-
int* drawOrder = 0;
434+
int* drawOrder2 = 0;
435435
Json* offsets = Json_getItem(valueMap, "offsets");
436436
if (offsets) {
437437
Json* offsetMap;
438438
int* unchanged = MALLOC(int, skeletonData->slotsCount - offsets->size);
439439
int originalIndex = 0, unchangedIndex = 0;
440440

441-
drawOrder = MALLOC(int, skeletonData->slotsCount);
441+
drawOrder2 = MALLOC(int, skeletonData->slotsCount);
442442
for (ii = skeletonData->slotsCount - 1; ii >= 0; --ii)
443-
drawOrder[ii] = -1;
443+
drawOrder2[ii] = -1;
444444

445445
for (offsetMap = offsets->child; offsetMap; offsetMap = offsetMap->next) {
446446
int slotIndex = spSkeletonData_findSlotIndex(skeletonData, Json_getString(offsetMap, "slot", 0));
@@ -453,19 +453,19 @@ static spAnimation* _spSkeletonJson_readAnimation (spSkeletonJson* self, Json* r
453453
while (originalIndex != slotIndex)
454454
unchanged[unchangedIndex++] = originalIndex++;
455455
/* Set changed items. */
456-
drawOrder[originalIndex + Json_getInt(offsetMap, "offset", 0)] = originalIndex;
456+
drawOrder2[originalIndex + Json_getInt(offsetMap, "offset", 0)] = originalIndex;
457457
originalIndex++;
458458
}
459459
/* Collect remaining unchanged items. */
460460
while (originalIndex < skeletonData->slotsCount)
461461
unchanged[unchangedIndex++] = originalIndex++;
462462
/* Fill in unchanged items. */
463463
for (ii = skeletonData->slotsCount - 1; ii >= 0; ii--)
464-
if (drawOrder[ii] == -1) drawOrder[ii] = unchanged[--unchangedIndex];
464+
if (drawOrder2[ii] == -1) drawOrder2[ii] = unchanged[--unchangedIndex];
465465
FREE(unchanged);
466466
}
467-
spDrawOrderTimeline_setFrame(timeline, frameIndex, Json_getFloat(valueMap, "time", 0), drawOrder);
468-
FREE(drawOrder);
467+
spDrawOrderTimeline_setFrame(timeline, frameIndex, Json_getFloat(valueMap, "time", 0), drawOrder2);
468+
FREE(drawOrder2);
469469
}
470470
animation->timelines[animation->timelinesCount++] = SUPER_CAST(spTimeline, timeline);
471471
animation->duration = MAX(animation->duration, timeline->frames[drawOrder->size - 1]);

0 commit comments

Comments
 (0)