Explorar o código

Cleaned up check-in.

Kieran Cunney %!s(int64=14) %!d(string=hai) anos
pai
achega
59afb41412
Modificáronse 2 ficheiros con 6 adicións e 3 borrados
  1. 5 2
      gameplay/src/AnimationClip.cpp
  2. 1 1
      gameplay/src/AnimationClip.h

+ 5 - 2
gameplay/src/AnimationClip.cpp

@@ -160,6 +160,9 @@ void AnimationClip::crossFade(AnimationClip* clip, unsigned long duration)
 {
     assert(clip);
 
+    // Check if the given clip is fading into this clip.
+    // We should reset the clip from fading out, and this one from fading in 
+    // in order to start the crossfade back the other way.
     if (clip->isClipStateBitSet(CLIP_IS_FADING_OUT_BIT) && clip->_crossFadeToClip == this)
     {
         clip->resetClipStateBit(CLIP_IS_FADING_OUT_BIT);
@@ -174,13 +177,13 @@ void AnimationClip::crossFade(AnimationClip* clip, unsigned long duration)
         SAFE_RELEASE(_crossFadeToClip);
     }
 
-    // Set the crossfade clip
+    // Set and initialize the crossfade clip
     _crossFadeToClip = clip;
     _crossFadeToClip->addRef();
     _crossFadeToClip->setClipStateBit(CLIP_IS_FADING_IN_BIT);
     _crossFadeToClip->_blendWeight = 0.0f;
     
-    // Set this clip to fade out, set the fade duration and reset the fade elapsed time.
+    // Set and intiliaze this clip to fade out
     setClipStateBit(CLIP_IS_FADING_OUT_STARTED_BIT);
     setClipStateBit(CLIP_IS_FADING_OUT_BIT);
     _crossFadeOutElapsed = 0L;

+ 1 - 1
gameplay/src/AnimationClip.h

@@ -222,7 +222,7 @@ private:
     static const char CLIP_IS_FADING_OUT_STARTED_BIT = 0x04;  // Bit representing that a cross fade has started.
     static const char CLIP_IS_FADING_OUT_BIT = 0x08;          // Bit representing whether the clip is fading out.
     static const char CLIP_IS_FADING_IN_BIT = 0x10;           // Bit representing whether the clip is fading out.
-    static const char CLIP_ALL_BITS = 0x1F;
+    static const char CLIP_ALL_BITS = 0x1F;                   // Bit mask for all the state bits.
 
     /**
      * Constructor.