Browse Source

Non-public, separate property strings.

Requested by project owner.  Used same pattern for the value as seen in
original Animation.cpp.
Jeremy Karlson 13 years ago
parent
commit
5ea13bf57c
3 changed files with 6 additions and 6 deletions
  1. 2 1
      gameplay/src/Animation.cpp
  2. 0 3
      gameplay/src/Animation.h
  3. 4 2
      gameplay/src/AnimationTarget.cpp

+ 2 - 1
gameplay/src/Animation.cpp

@@ -7,6 +7,7 @@
 #include "Transform.h"
 #include "Properties.h"
 
+#define ANIMATION_INDEFINITE_STR "INDEFINITE"
 #define ANIMATION_DEFAULT_CLIP 0
 #define ANIMATION_ROTATE_OFFSET 0
 #define ANIMATION_SRT_OFFSET 3
@@ -255,7 +256,7 @@ void Animation::createClips(Properties* animationProperties, unsigned int frameC
 
         AnimationClip* clip = createClip(pClip->getId(), ((float) begin / frameCount) * _duration, ((float) end / frameCount) * _duration);
 
-        const char* repeat = pClip->getString(ANIMATION_REPEAT_COUNT_STR);
+        const char* repeat = pClip->getString("repeatCount");
         if (repeat)
         {
             if (strcmp(repeat, ANIMATION_INDEFINITE_STR) == 0)

+ 0 - 3
gameplay/src/Animation.h

@@ -5,9 +5,6 @@
 #include "Properties.h"
 #include "Curve.h"
 
-#define ANIMATION_INDEFINITE_STR "INDEFINITE"
-#define ANIMATION_REPEAT_COUNT_STR "repeatCount"
-
 namespace gameplay
 {
 

+ 4 - 2
gameplay/src/AnimationTarget.cpp

@@ -4,6 +4,8 @@
 #include "Game.h"
 #include "Node.h"
 
+#define ANIMATION_TARGET_INDEFINITE_STR "INDEFINITE"
+
 namespace gameplay
 {
 
@@ -261,10 +263,10 @@ Animation* AnimationTarget::createAnimation(const char* id, Properties* animatio
         animation = createAnimation(id, propertyId, keyCount, keyTimes, keyValues, (Curve::InterpolationType) curve);
     }
 
-    const char* repeat = animationProperties->getString(ANIMATION_REPEAT_COUNT_STR);
+    const char* repeat = animationProperties->getString("repeatCount");
     if (repeat)
     {
-        if (strcmp(repeat, ANIMATION_INDEFINITE_STR) == 0)
+        if (strcmp(repeat, ANIMATION_TARGET_INDEFINITE_STR) == 0)
         {
             animation->getClip()->setRepeatCount(AnimationClip::REPEAT_INDEFINITE);
         }