commit 3a70bd6db10c3cba8d4a428cdfa71aacaa194893
Author: leszek <leszek@koltunski.pl>
Date:   Thu Feb 16 23:21:10 2017 +0000

    Bugfix in EffectQueues: if we interpolate something, then stop and again start interpolating, it used to use the old position (position from the moment when we stopped interpolating!) during the first run after the resume. Fix that.

diff --git a/src/main/java/org/distorted/library/DistortedNode.java b/src/main/java/org/distorted/library/DistortedNode.java
index 00903fe..cd8340d 100644
--- a/src/main/java/org/distorted/library/DistortedNode.java
+++ b/src/main/java/org/distorted/library/DistortedNode.java
@@ -33,7 +33,7 @@ import android.opengl.GLES30;
  * <p>
  * The class takes special care to only render identical sub-trees once. Each Node holds a reference
  * to sub-class 'NodeData'. Two identical sub-trees attached at different points of the main tree
- * will point to the same NodeData; only the first of this is rendered (when mData.numRendered==0).
+ * will point to the same NodeData; only the first of this is rendered (mData.numRender!).
  */
 public class DistortedNode implements DistortedAttacheable
   {
diff --git a/src/main/java/org/distorted/library/DistortedSurface.java b/src/main/java/org/distorted/library/DistortedSurface.java
index 0c20ada..4ddbd4b 100644
--- a/src/main/java/org/distorted/library/DistortedSurface.java
+++ b/src/main/java/org/distorted/library/DistortedSurface.java
@@ -247,9 +247,9 @@ abstract class DistortedSurface
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
 /**
- * Return the height of this Surface.
+ * Return the width of this Surface.
  *
- * @return height of the object, in pixels.
+ * @return width of the Object, in pixels.
  */
   public int getWidth()
     {
@@ -258,9 +258,9 @@ abstract class DistortedSurface
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 /**
- * Return the width of this Surface.
+ * Return the height of this Surface.
  *
- * @return width of the Object, in pixels.
+ * @return height of the Object, in pixels.
  */
   public int getHeight()
     {
diff --git a/src/main/java/org/distorted/library/EffectQueueFragment.java b/src/main/java/org/distorted/library/EffectQueueFragment.java
index 7472eba..9d3363f 100644
--- a/src/main/java/org/distorted/library/EffectQueueFragment.java
+++ b/src/main/java/org/distorted/library/EffectQueueFragment.java
@@ -69,6 +69,8 @@ class EffectQueueFragment extends EffectQueue
    
     for(int i=0; i<mNumEffects; i++)
       {
+      mCurrentDuration[i] += step;
+
       if( mInter[0][i]!=null && mInter[0][i].interpolateMain(mUniforms ,NUM_UNIFORMS*i, mCurrentDuration[i], step) )
         {
         for(int j=0; j<mNumListeners; j++)   
@@ -89,8 +91,6 @@ class EffectQueueFragment extends EffectQueue
 
       if( mInter[1][i]!=null ) mInter[1][i].interpolateMain( mCache   , NUM_CACHE*i     , mCurrentDuration[i], step);
       if( mInter[2][i]!=null ) mInter[2][i].interpolateMain( mUniforms, NUM_UNIFORMS*i+1, mCurrentDuration[i], step);
-
-      mCurrentDuration[i] += step;
       }
    
     mTime = currTime;  
diff --git a/src/main/java/org/distorted/library/EffectQueueMatrix.java b/src/main/java/org/distorted/library/EffectQueueMatrix.java
index 504dae8..c32758e 100644
--- a/src/main/java/org/distorted/library/EffectQueueMatrix.java
+++ b/src/main/java/org/distorted/library/EffectQueueMatrix.java
@@ -240,6 +240,8 @@ class EffectQueueMatrix extends EffectQueue
    
     for(int i=0; i<mNumEffects; i++)
       {
+      mCurrentDuration[i] += step;
+
       if( mInter[0][i]!=null && mInter[0][i].interpolateMain(mUniforms ,NUM_UNIFORMS*i, mCurrentDuration[i], step) )
         {
         for(int j=0; j<mNumListeners; j++)
@@ -262,8 +264,6 @@ class EffectQueueMatrix extends EffectQueue
         {
         mInter[1][i].interpolateMain(mUniforms, NUM_UNIFORMS*i+4, mCurrentDuration[i], step);
         }
-
-      mCurrentDuration[i] += step;
       }
      
     mTime = currTime;  
diff --git a/src/main/java/org/distorted/library/EffectQueuePostprocess.java b/src/main/java/org/distorted/library/EffectQueuePostprocess.java
index 683e09a..321fa0f 100644
--- a/src/main/java/org/distorted/library/EffectQueuePostprocess.java
+++ b/src/main/java/org/distorted/library/EffectQueuePostprocess.java
@@ -144,6 +144,8 @@ class EffectQueuePostprocess extends EffectQueue
    
     for(int i=0; i<mNumEffects; i++)
       {
+      mCurrentDuration[i] += step;
+
       if( mInter[0][i]!=null && mInter[0][i].interpolateMain(mUniforms ,NUM_UNIFORMS*i, mCurrentDuration[i], step) )
         {
         for(int j=0; j<mNumListeners; j++)
@@ -161,8 +163,6 @@ class EffectQueuePostprocess extends EffectQueue
           }
         else mInter[0][i] = null;
         }
-
-      mCurrentDuration[i] += step;
       }
      
     mTime = currTime;  
diff --git a/src/main/java/org/distorted/library/EffectQueueVertex.java b/src/main/java/org/distorted/library/EffectQueueVertex.java
index 219885d..98a74d6 100644
--- a/src/main/java/org/distorted/library/EffectQueueVertex.java
+++ b/src/main/java/org/distorted/library/EffectQueueVertex.java
@@ -75,6 +75,8 @@ class EffectQueueVertex extends EffectQueue
    
     for(int i=0; i<mNumEffects; i++)
       {
+      mCurrentDuration[i] += step;
+
       if( mInter[0][i]!=null )
         {
         if( mInter[0][i].interpolateMain(mUniforms ,NUM_UNIFORMS*i, mCurrentDuration[i], step) )
@@ -104,8 +106,6 @@ class EffectQueueVertex extends EffectQueue
 
       if( mInter[1][i]!=null ) mInter[1][i].interpolateMain(mUniforms, NUM_UNIFORMS*i+8, mCurrentDuration[i], step);
       if( mInter[2][i]!=null ) mInter[2][i].interpolateMain(mCache   , NUM_CACHE*i     , mCurrentDuration[i], step);
-
-      mCurrentDuration[i] += step;
       }
      
     mTime = currTime;  
