commit aee078f8bb1f8c6c955846baaf110c39080c92af
Author: Leszek Koltunski <leszek@koltunski.pl>
Date:   Sat May 30 01:16:14 2020 +0100

    Correct VertexEffectQueue in the Mesh. There's no need to have a separate Queue in every component.

diff --git a/src/main/java/org/distorted/library/mesh/MeshBase.java b/src/main/java/org/distorted/library/mesh/MeshBase.java
index 0aee0c5..f08b911 100644
--- a/src/main/java/org/distorted/library/mesh/MeshBase.java
+++ b/src/main/java/org/distorted/library/mesh/MeshBase.java
@@ -88,18 +88,17 @@ public abstract class MeshBase
    private int[] mAssociation;
 
    private static int[] mComponentAssociationH = new int[EffectQueue.MAIN_VARIANTS];
+   private EffectQueueVertex mQueue;
 
    private static class Component
      {
      private int mEndIndex;
      private Static4D mTextureMap;
-     private EffectQueueVertex mQueue;
 
      Component(int end)
        {
        mEndIndex  = end;
        mTextureMap= new Static4D(0,0,1,1);
-       mQueue     = new EffectQueueVertex();
        }
      Component(Component original)
        {
@@ -110,7 +109,6 @@ public abstract class MeshBase
        float z = original.mTextureMap.get2();
        float w = original.mTextureMap.get3();
        mTextureMap = new Static4D(x,y,z,w);
-       mQueue = new EffectQueueVertex(original.mQueue);
        }
 
      void setMap(Static4D map)
@@ -133,6 +131,7 @@ public abstract class MeshBase
      for(int i=0; i<MAX_COMPONENTS; i++) mAssociation[i] = DEFAULT_ASSOCIATION;
 
      mNeedsAdjustment = new boolean[1];
+     mQueue = new EffectQueueVertex();
 
      mVBO1= new InternalBuffer(GLES30.GL_ARRAY_BUFFER             , GLES30.GL_STATIC_READ);
      mVBO2= new InternalBuffer(GLES30.GL_ARRAY_BUFFER             , GLES30.GL_STATIC_READ);
@@ -150,6 +149,7 @@ public abstract class MeshBase
 
      int size = original.mComponent.size();
      mComponent = new ArrayList<>();
+     mQueue = new EffectQueueVertex(original.mQueue);
 
      for(int i=0; i<size; i++)
        {
@@ -363,12 +363,7 @@ public abstract class MeshBase
 
      GLES30.glUnmapBuffer(GLES30.GL_TRANSFORM_FEEDBACK);
 
-     int numComp = mComponent.size();
-
-     for(int i=0; i<numComp; i++)
-       {
-       mComponent.get(i).mQueue.removeAll(false);
-       }
+     mQueue.removeAll(false);
      }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -379,12 +374,7 @@ public abstract class MeshBase
  */
    public void computeQueue()
      {
-     int numComp = mComponent.size();
-
-     for(int i=0; i<numComp; i++)
-       {
-       mComponent.get(i).mQueue.compute(1);
-       }
+     mQueue.compute(1);
      }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -395,12 +385,7 @@ public abstract class MeshBase
  */
    public void sendQueue()
      {
-     int numComp = mComponent.size();
-
-     for(int i=0; i<numComp; i++)
-       {
-       mComponent.get(i).mQueue.send(0.0f,3);
-       }
+     mQueue.send(0.0f,3);
      }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -573,13 +558,7 @@ public abstract class MeshBase
  */
    public void apply(VertexEffect effect)
      {
-     int numComp = mComponent.size();
-
-     for(int i=0; i<numComp; i++)
-       {
-       mComponent.get(i).mQueue.add(effect);
-       }
-
+     mQueue.add(effect);
      mNeedsAdjustment[0] = true;
      }
 
diff --git a/src/main/java/org/distorted/library/mesh/MeshCubes.java b/src/main/java/org/distorted/library/mesh/MeshCubes.java
index 7fd77fe..ff29fa8 100644
--- a/src/main/java/org/distorted/library/mesh/MeshCubes.java
+++ b/src/main/java/org/distorted/library/mesh/MeshCubes.java
@@ -941,7 +941,7 @@ public class MeshCubes extends MeshBase
  *
  * @param deep If to be a deep or shallow copy of mVertAttribs1, i.e. the array holding vertices,
  *             normals and inflates (the rest, in particular the mVertAttribs2 containing texture
- *             coordinates and effect assocciations, is always deep copied).
+ *             coordinates and effect associations, is always deep copied).
  */
  public MeshCubes copy(boolean deep)
    {
diff --git a/src/main/java/org/distorted/library/mesh/MeshJoined.java b/src/main/java/org/distorted/library/mesh/MeshJoined.java
index 922f64a..f7bbd51 100644
--- a/src/main/java/org/distorted/library/mesh/MeshJoined.java
+++ b/src/main/java/org/distorted/library/mesh/MeshJoined.java
@@ -50,7 +50,7 @@ public class MeshJoined extends MeshBase
  *
  * @param deep If to be a deep or shallow copy of mVertAttribs1, i.e. the array holding vertices,
  *             normals and inflates (the rest, in particular the mVertAttribs2 containing texture
- *             coordinates and effect assocciations, is always deep copied)
+ *             coordinates and effect associations, is always deep copied)
  */
   public MeshJoined copy(boolean deep)
    {
diff --git a/src/main/java/org/distorted/library/mesh/MeshQuad.java b/src/main/java/org/distorted/library/mesh/MeshQuad.java
index 6cb142f..51eb4e2 100644
--- a/src/main/java/org/distorted/library/mesh/MeshQuad.java
+++ b/src/main/java/org/distorted/library/mesh/MeshQuad.java
@@ -84,7 +84,7 @@ public class MeshQuad extends MeshBase
  *
  * @param deep If to be a deep or shallow copy of mVertAttribs1, i.e. the array holding vertices,
  *             normals and inflates (the rest, in particular the mVertAttribs2 containing texture
- *             coordinates and effect assocciations, is always deep copied)
+ *             coordinates and effect associations, is always deep copied)
  */
   public MeshQuad copy(boolean deep)
     {
diff --git a/src/main/java/org/distorted/library/mesh/MeshRectangles.java b/src/main/java/org/distorted/library/mesh/MeshRectangles.java
index 0c92fcf..f1a56b6 100644
--- a/src/main/java/org/distorted/library/mesh/MeshRectangles.java
+++ b/src/main/java/org/distorted/library/mesh/MeshRectangles.java
@@ -187,7 +187,7 @@ public class MeshRectangles extends MeshBase
  *
  * @param deep If to be a deep or shallow copy of mVertAttribs1, i.e. the array holding vertices,
  *             normals and inflates (the rest, in particular the mVertAttribs2 containing texture
- *             coordinates and effect assocciations, is always deep copied)
+ *             coordinates and effect associations, is always deep copied)
  */
   public MeshRectangles copy(boolean deep)
     {
diff --git a/src/main/java/org/distorted/library/mesh/MeshSphere.java b/src/main/java/org/distorted/library/mesh/MeshSphere.java
index a88dea0..213d7c7 100644
--- a/src/main/java/org/distorted/library/mesh/MeshSphere.java
+++ b/src/main/java/org/distorted/library/mesh/MeshSphere.java
@@ -285,7 +285,7 @@ public class MeshSphere extends MeshBase
  *
  * @param deep If to be a deep or shallow copy of mVertAttribs1, i.e. the array holding vertices,
  *             normals and inflates (the rest, in particular the mVertAttribs2 containing texture
- *             coordinates and effect assocciations, is always deep copied)
+ *             coordinates and effect associations, is always deep copied)
  */
   public MeshSphere copy(boolean deep)
     {
diff --git a/src/main/java/org/distorted/library/mesh/MeshTriangles.java b/src/main/java/org/distorted/library/mesh/MeshTriangles.java
index 2df3c81..0f9cbca 100644
--- a/src/main/java/org/distorted/library/mesh/MeshTriangles.java
+++ b/src/main/java/org/distorted/library/mesh/MeshTriangles.java
@@ -137,7 +137,7 @@ public class MeshTriangles extends MeshBase
  *
  * @param deep If to be a deep or shallow copy of mVertAttribs1, i.e. the array holding vertices,
  *             normals and inflates (the rest, in particular the mVertAttribs2 containing texture
- *             coordinates and effect assocciations, is always deep copied)
+ *             coordinates and effect associations, is always deep copied)
  */
   public MeshTriangles copy(boolean deep)
     {
