Exemplo n.º 1
0
 void readCurve(CurveTimeline timeline, int frameIndex, JsonValue valueMap) {
   JsonValue curve = valueMap.get("curve");
   if (curve == null) return;
   if (curve.isString() && curve.asString().equals("stepped")) timeline.setStepped(frameIndex);
   else if (curve.isArray()) {
     timeline.setCurve(
         frameIndex, curve.getFloat(0), curve.getFloat(1), curve.getFloat(2), curve.getFloat(3));
   }
 }
 private void readCurve(DataInput input, int frameIndex, CurveTimeline timeline)
     throws IOException {
   switch (input.readByte()) {
     case CURVE_STEPPED:
       timeline.setStepped(frameIndex);
       break;
     case CURVE_BEZIER:
       setCurve(
           timeline,
           frameIndex,
           input.readFloat(),
           input.readFloat(),
           input.readFloat(),
           input.readFloat());
       break;
   }
 }