소스 검색

Merge pull request #974 from ChrisWiki/master

Fixes a bug in createChannel if keyCount=1
Sean Paul Taylor 12 년 전
부모
커밋
9d33dc635d
1개의 변경된 파일5개의 추가작업 그리고 3개의 파일을 삭제
  1. 5 3
      gameplay/src/Animation.cpp

+ 5 - 3
gameplay/src/Animation.cpp

@@ -341,9 +341,11 @@ Animation::Channel* Animation::createChannel(AnimationTarget* target, int proper
         curve->setPoint(i, normalizedKeyTimes[i], (keyValues + pointOffset), (Curve::InterpolationType) type);
         pointOffset += propertyComponentCount;
     }
-    i = keyCount - 1;
-    normalizedKeyTimes[i] = 1.0f;
-    curve->setPoint(i, normalizedKeyTimes[i], keyValues + pointOffset, (Curve::InterpolationType) type);
+    if (keyCount > 1) {
+        i = keyCount - 1;
+        normalizedKeyTimes[i] = 1.0f;
+        curve->setPoint(i, normalizedKeyTimes[i], keyValues + pointOffset, (Curve::InterpolationType) type);
+    }
 
     SAFE_DELETE_ARRAY(normalizedKeyTimes);