Przeglądaj źródła

Fixes bug in evaluate() when interpolation type is SMOOTH, STEP or LINEAR

Kieran Cunney 14 lat temu
rodzic
commit
194470ddf8
1 zmienionych plików z 3 dodań i 3 usunięć
  1. 3 3
      gameplay/src/Curve.cpp

+ 3 - 3
gameplay/src/Curve.cpp

@@ -216,18 +216,18 @@ void Curve::evaluate(float time, float* dst) const
         }
         case LINEAR:
         {
-            interpolateLinear(t, from, to, dst);
+            // Can just break here because linear formula follows switch
             break;
         }
         case SMOOTH:
         {
             interpolateHermiteSmooth(t, index, from, to, dst);
-            break;
+            return;
         }
         case STEP:
         {
             memcpy(dst, from->value, _componentSize);
-            break;
+            return;
         }
         case QUADRATIC_IN:
         {