commit 20156af7821491f19da79fbd4591f6c115b3b39d
Author: Leszek Koltunski <leszek@koltunski.pl>
Date:   Sat Dec 8 00:03:03 2018 +0000

    Important bugfix in MeshCubes for the Inflate vectors.

diff --git a/src/main/java/org/distorted/library/main/EffectQueueMatrix.java b/src/main/java/org/distorted/library/main/EffectQueueMatrix.java
index 3d77f16..aae5391 100644
--- a/src/main/java/org/distorted/library/main/EffectQueueMatrix.java
+++ b/src/main/java/org/distorted/library/main/EffectQueueMatrix.java
@@ -107,7 +107,7 @@ class EffectQueueMatrix extends EffectQueue
     // Here we need a bit more because we are marking not only the halo, but a little bit around
     // it as well so that the (blur for example) will be smooth on the edges. Thus the 2.0f.
     //
-    // mMipmap ( 1.0 , 0.5, 0.25, 0.125 ) - we need to make the size of the halo independent
+    // mMipmap ( 1.0, 0.5, 0.25, 0.125 ) - we need to make the size of the halo independent
     // of postprocessing effect quality.
 
     return projection.mMipmap*2.0f*marginInPixels/( xLenInPixels>yLenInPixels ? yLenInPixels:xLenInPixels );
diff --git a/src/main/java/org/distorted/library/mesh/MeshCubes.java b/src/main/java/org/distorted/library/mesh/MeshCubes.java
index a6871c1..29cf113 100644
--- a/src/main/java/org/distorted/library/mesh/MeshCubes.java
+++ b/src/main/java/org/distorted/library/mesh/MeshCubes.java
@@ -194,14 +194,14 @@ public class MeshCubes extends MeshBase
        mInflateX = new byte[mRows+1][mCols+1];
        mInflateY = new byte[mRows+1][mCols+1];
 
-       for(int j=0; j<mCols; j++)
-         for(int i=0; i<mRows; i++)
-           mCubes[i][j] = (desc.charAt(i * mCols + j) == '1' ? 1 : 0);
+       for(int col=0; col<mCols; col++)
+         for(int row=0; row<mRows; row++)
+           mCubes[row][col] = (desc.charAt(row * mCols + col) == '1' ? 1 : 0);
 
-       for(int j=0; j<mCols+1; j++)
-         for(int i=0; i<mRows+1; i++)
+       for(int col=0; col<mCols+1; col++)
+         for(int row=0; row<mRows+1; row++)
            {
-           fillInflate(j,i);
+           fillInflate(row,col);
            }
 
        markRegions();
@@ -226,14 +226,14 @@ public class MeshCubes extends MeshBase
        mInflateX = new byte[mRows+1][mCols+1];
        mInflateY = new byte[mRows+1][mCols+1];
 
-       for(int j=0; j<mCols; j++)
-         for(int i=0; i<mRows; i++)
-           mCubes[i][j] = 1;
+       for(int col=0; col<mCols; col++)
+         for(int row=0; row<mRows; row++)
+           mCubes[row][col] = 1;
 
-       for(int j=0; j<mCols+1; j++)
-         for(int i=0; i<mRows+1; i++)
+       for(int col=0; col<mCols+1; col++)
+         for(int row=0; row<mRows+1; row++)
            {
-           fillInflate(j,i);
+           fillInflate(row,col);
            }
 
        markRegions();
@@ -586,12 +586,12 @@ public class MeshCubes extends MeshBase
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  private void fillInflate(int col, int row)
+  private void fillInflate(int row, int col)
     {
     int diff;
 
-         if( col==0     ) mInflateX[col][row] = -1;
-    else if( col==mCols ) mInflateX[col][row] = +1;
+         if( col==0     ) mInflateX[row][col] = -1;
+    else if( col==mCols ) mInflateX[row][col] = +1;
     else
       {
       if( row==0 )
@@ -611,11 +611,11 @@ public class MeshCubes extends MeshBase
         if( diff== 2 ) diff= 1;
         }
 
-      mInflateX[col][row] = (byte)diff;
+      mInflateX[row][col] = (byte)diff;
       }
 
-         if( row==0    ) mInflateY[col][row] = +1;
-    else if(row==mRows ) mInflateY[col][row] = -1;
+         if( row==0     ) mInflateY[row][col] = +1;
+    else if( row==mRows ) mInflateY[row][col] = -1;
     else
       {
       if( col==0 )
@@ -635,7 +635,7 @@ public class MeshCubes extends MeshBase
         if( diff== 2 ) diff= 1;
         }
 
-      mInflateY[col][row] = (byte)diff;
+      mInflateY[row][col] = (byte)diff;
       }
 
     //android.util.Log.e("mesh","col="+col+" row="+row+" inflateX="+mInflateX[col][row]+" InflateY="+mInflateY[col][row]);
@@ -656,8 +656,8 @@ public class MeshCubes extends MeshBase
      attribs[VERT_ATTRIBS*currVert + NOR_ATTRIB+1] = mNormalY[index];
      attribs[VERT_ATTRIBS*currVert + NOR_ATTRIB+2] = mNormalZ[index];
 
-     attribs[VERT_ATTRIBS*currVert + INF_ATTRIB  ] = mInflateX[col][row]/2.0f;
-     attribs[VERT_ATTRIBS*currVert + INF_ATTRIB+1] = mInflateY[col][row]/2.0f;
+     attribs[VERT_ATTRIBS*currVert + INF_ATTRIB  ] = mInflateX[row][col]/2.0f;
+     attribs[VERT_ATTRIBS*currVert + INF_ATTRIB+1] = mInflateY[row][col]/2.0f;
      attribs[VERT_ATTRIBS*currVert + INF_ATTRIB+2] = vectZ;
 
      attribs[VERT_ATTRIBS*currVert + TEX_ATTRIB  ] = x;
@@ -690,8 +690,8 @@ public class MeshCubes extends MeshBase
                    attribs[VERT_ATTRIBS*currVert + NOR_ATTRIB+1] = 1.0f;
                    attribs[VERT_ATTRIBS*currVert + NOR_ATTRIB+2] = (slice==0 ? R : (slice==mSlices ? -R:0) );
 
-                   attribs[VERT_ATTRIBS*currVert + INF_ATTRIB  ] = mInflateX[col][row]/2.0f;
-                   attribs[VERT_ATTRIBS*currVert + INF_ATTRIB+1] = mInflateY[col][row]/2.0f;
+                   attribs[VERT_ATTRIBS*currVert + INF_ATTRIB  ] = mInflateX[row][col]/2.0f;
+                   attribs[VERT_ATTRIBS*currVert + INF_ATTRIB+1] = mInflateY[row][col]/2.0f;
                    attribs[VERT_ATTRIBS*currVert + INF_ATTRIB+2] = z;
 
                    attribs[VERT_ATTRIBS*currVert + TEX_ATTRIB  ] = x;
@@ -711,8 +711,8 @@ public class MeshCubes extends MeshBase
                    attribs[VERT_ATTRIBS*currVert + NOR_ATTRIB+1] =-1.0f;
                    attribs[VERT_ATTRIBS*currVert + NOR_ATTRIB+2] = (slice==0 ? R : (slice==mSlices ? -R:0) );
 
-                   attribs[VERT_ATTRIBS*currVert + INF_ATTRIB  ] = mInflateX[col][row]/2.0f;
-                   attribs[VERT_ATTRIBS*currVert + INF_ATTRIB+1] = mInflateY[col][row]/2.0f;
+                   attribs[VERT_ATTRIBS*currVert + INF_ATTRIB  ] = mInflateX[row][col]/2.0f;
+                   attribs[VERT_ATTRIBS*currVert + INF_ATTRIB+1] = mInflateY[row][col]/2.0f;
                    attribs[VERT_ATTRIBS*currVert + INF_ATTRIB+2] = z;
 
                    attribs[VERT_ATTRIBS*currVert + TEX_ATTRIB  ] = x;
@@ -732,8 +732,8 @@ public class MeshCubes extends MeshBase
                    attribs[VERT_ATTRIBS*currVert + NOR_ATTRIB+1] = side==WEST ? 0.0f : (side==NORTH?-R:R);
                    attribs[VERT_ATTRIBS*currVert + NOR_ATTRIB+2] = (slice==0 ? R : (slice==mSlices ? -R:0) );
 
-                   attribs[VERT_ATTRIBS*currVert + INF_ATTRIB  ] = mInflateX[col][row]/2.0f;
-                   attribs[VERT_ATTRIBS*currVert + INF_ATTRIB+1] = mInflateY[col][row]/2.0f;
+                   attribs[VERT_ATTRIBS*currVert + INF_ATTRIB  ] = mInflateX[row][col]/2.0f;
+                   attribs[VERT_ATTRIBS*currVert + INF_ATTRIB+1] = mInflateY[row][col]/2.0f;
                    attribs[VERT_ATTRIBS*currVert + INF_ATTRIB+2] = z;
 
                    attribs[VERT_ATTRIBS*currVert + TEX_ATTRIB  ] = (float)(col-slice)/mCols;
@@ -753,8 +753,8 @@ public class MeshCubes extends MeshBase
                    attribs[VERT_ATTRIBS*currVert + NOR_ATTRIB+1] = side==EAST ? 0.0f : (side==SOUTH?-R:R);
                    attribs[VERT_ATTRIBS*currVert + NOR_ATTRIB+2] = (slice==0 ? R : (slice==mSlices ? -R:0) );
 
-                   attribs[VERT_ATTRIBS*currVert + INF_ATTRIB  ] = mInflateX[col][row]/2.0f;
-                   attribs[VERT_ATTRIBS*currVert + INF_ATTRIB+1] = mInflateY[col][row]/2.0f;
+                   attribs[VERT_ATTRIBS*currVert + INF_ATTRIB  ] = mInflateX[row][col]/2.0f;
+                   attribs[VERT_ATTRIBS*currVert + INF_ATTRIB+1] = mInflateY[row][col]/2.0f;
                    attribs[VERT_ATTRIBS*currVert + INF_ATTRIB+2] = z;
 
                    attribs[VERT_ATTRIBS*currVert + TEX_ATTRIB  ] = (float)(col+slice)/mCols;
