commit 39cbf9dcdc5a871607853bb0376697cf60d9576e
Author: Leszek Koltunski <leszek@distoretedandroid.org>
Date:   Fri Jun 24 14:06:56 2016 +0100

    Minor: deal with IntelliJ warnings

diff --git a/src/main/java/org/distorted/library/Distorted.java b/src/main/java/org/distorted/library/Distorted.java
index d6fe66a..58b1cbb 100644
--- a/src/main/java/org/distorted/library/Distorted.java
+++ b/src/main/java/org/distorted/library/Distorted.java
@@ -36,7 +36,7 @@ import org.distorted.library.exception.*;
  * A singleton class used to control various global settings.
  */
 public class Distorted 
-{
+  {
   /**
    * When creating an instance of a DistortedObject from another instance, do not clone anything.
    * Used in the copy constructor.
@@ -496,7 +496,4 @@ public class Distorted
     {
     return EffectQueue.setMax(EffectTypes.FRAGMENT.ordinal(),max);
     }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-//end of file  
-}
+  }
diff --git a/src/main/java/org/distorted/library/DistortedBitmapGrid.java b/src/main/java/org/distorted/library/DistortedBitmapGrid.java
index d27b3c5..959f95f 100644
--- a/src/main/java/org/distorted/library/DistortedBitmapGrid.java
+++ b/src/main/java/org/distorted/library/DistortedBitmapGrid.java
@@ -111,6 +111,4 @@ class DistortedBitmapGrid extends DistortedObjectGrid
 
     //for(int g=0; g<dataLength; g++) android.util.Log.e("BACKGROUND", "pos["+g+"]=("+bufferData[3*g]+","+bufferData[3*g+1]+")");
     }
-  };
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
+  }
\ No newline at end of file
diff --git a/src/main/java/org/distorted/library/DistortedCubesGrid.java b/src/main/java/org/distorted/library/DistortedCubesGrid.java
index 40d1de7..f66356a 100644
--- a/src/main/java/org/distorted/library/DistortedCubesGrid.java
+++ b/src/main/java/org/distorted/library/DistortedCubesGrid.java
@@ -56,12 +56,11 @@ class DistortedCubesGrid extends DistortedObjectGrid
        row = r;
        col = c;
        }
-     };
+     }
    
-   private int frontVert, sideVert;
    private int mCols, mRows;
    private short[][] mCubes;
-   private ArrayList<Edge> mEdges = new ArrayList<Edge>();
+   private ArrayList<Edge> mEdges = new ArrayList<>();
    
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
@@ -103,8 +102,8 @@ class DistortedCubesGrid extends DistortedObjectGrid
         while( curr.col!=startX || curr.row!=startY || curr.side!=startS );
         }
       
-      frontVert = 2*( frontWalls + 2*frontSegments - 1);
-      sideVert  = 2*( sideWalls + sideBends + edges -1);
+      int frontVert = 2*( frontWalls + 2*frontSegments - 1);
+      int sideVert  = 2*( sideWalls + sideBends + edges -1);
       
       int dataL = frontOnly ? frontVert : (frontVert+1) + (1+sideVert+1) + (1+frontVert);
       
@@ -178,7 +177,7 @@ class DistortedCubesGrid extends DistortedObjectGrid
          for(int i=reallen; i<len; i++) desc += "0";
          }
     
-       if( desc.indexOf("1")>=0 )
+       if( desc.contains("1") )
          {
          mCols = cols;
          mRows = len/cols;
@@ -386,25 +385,25 @@ class DistortedCubesGrid extends DistortedObjectGrid
 
              if( front ) // NW corner
                {
-               position[3*vertex+0] = (centerX-0.5f)/mCols;
+               position[3*vertex  ] = (centerX-0.5f)/mCols;
                position[3*vertex+1] = (centerY+0.5f)/mRows;
                position[3*vertex+2] = FRONTZ;
-               normal[3*vertex+0]   = mNormalX[0];
+               normal[3*vertex  ]   = mNormalX[0];
                normal[3*vertex+1]   = mNormalY[0];
                normal[3*vertex+2]   = 1.0f;
-               texture[2*vertex+0]  = (float)j/mCols;
+               texture[2*vertex  ]  = (float)j/mCols;
                texture[2*vertex+1]  = (float)i/mRows;     
                vertex++;
                }
              else  // SW corner
                { 
-               position[3*vertex+0] = (centerX-0.5f)/mCols;
+               position[3*vertex  ] = (centerX-0.5f)/mCols;
                position[3*vertex+1] = (centerY-0.5f)/mRows; 
                position[3*vertex+2] = BACKZ; 
-               normal[3*vertex+0]   = mNormalX[1];
+               normal[3*vertex  ]   = mNormalX[1];
                normal[3*vertex+1]   = mNormalY[1];
                normal[3*vertex+2]   =-1.0f;
-               texture[2*vertex+0]  = (float)j/mCols;
+               texture[2*vertex  ]  = (float)j/mCols;
                texture[2*vertex+1]  = (float)(i+1)/mRows;
                vertex++;
                
@@ -415,25 +414,25 @@ class DistortedCubesGrid extends DistortedObjectGrid
 
              if( front ) // SW corner
                {
-               position[3*vertex+0] = (centerX-0.5f)/mCols;
+               position[3*vertex  ] = (centerX-0.5f)/mCols;
                position[3*vertex+1] = (centerY-0.5f)/mRows; 
                position[3*vertex+2] = FRONTZ; 
-               normal[3*vertex+0]   = mNormalX[1];
+               normal[3*vertex  ]   = mNormalX[1];
                normal[3*vertex+1]   = mNormalY[1];
                normal[3*vertex+2]   = 1.0f;
-               texture[2*vertex+0]  = (float)j/mCols;
+               texture[2*vertex  ]  = (float)j/mCols;
                texture[2*vertex+1]  = (float)(i+1)/mRows;
                vertex++; 
                }
              else  // NW corner
                {
-               position[3*vertex+0] = (centerX-0.5f)/mCols;
+               position[3*vertex  ] = (centerX-0.5f)/mCols;
                position[3*vertex+1] = (centerY+0.5f)/mRows;
                position[3*vertex+2] = BACKZ;
-               normal[3*vertex+0]   = mNormalX[0];
+               normal[3*vertex  ]   = mNormalX[0];
                normal[3*vertex+1]   = mNormalY[0];
                normal[3*vertex+2]   =-1.0f;
-               texture[2*vertex+0]  = (float)j/mCols;
+               texture[2*vertex  ]  = (float)j/mCols;
                texture[2*vertex+1]  = (float)i/mRows;     
                vertex++; 
                }
@@ -441,50 +440,50 @@ class DistortedCubesGrid extends DistortedObjectGrid
               
            if( front )  // NE corner
              {
-             position[3*vertex+0] = (centerX+0.5f)/mCols;
+             position[3*vertex  ] = (centerX+0.5f)/mCols;
              position[3*vertex+1] = (centerY+0.5f)/mRows;
              position[3*vertex+2] = FRONTZ; 
-             normal[3*vertex+0]   = mNormalX[2];
+             normal[3*vertex  ]   = mNormalX[2];
              normal[3*vertex+1]   = mNormalY[2];
              normal[3*vertex+2]   = 1.0f;
-             texture[2*vertex+0]  = (float)(j+1)/mCols;
+             texture[2*vertex  ]  = (float)(j+1)/mCols;
              texture[2*vertex+1]  = (float)i/mRows;
              vertex++;
              }
            else // SE corner
              {
-             position[3*vertex+0] = (centerX+0.5f)/mCols;
+             position[3*vertex  ] = (centerX+0.5f)/mCols;
              position[3*vertex+1] = (centerY-0.5f)/mRows;
              position[3*vertex+2] = BACKZ; 
-             normal[3*vertex+0]   = mNormalX[3];
+             normal[3*vertex  ]   = mNormalX[3];
              normal[3*vertex+1]   = mNormalY[3];
              normal[3*vertex+2]   =-1.0f;
-             texture[2*vertex+0]  = (float)(j+1)/mCols;
+             texture[2*vertex  ]  = (float)(j+1)/mCols;
              texture[2*vertex+1]  = (float)(i+1)/mRows;
              vertex++; 
              }
            
            if( front )  // SE corner
              {
-             position[3*vertex+0] = (centerX+0.5f)/mCols;
+             position[3*vertex  ] = (centerX+0.5f)/mCols;
              position[3*vertex+1] = (centerY-0.5f)/mRows;
              position[3*vertex+2] = FRONTZ; 
-             normal[3*vertex+0]   = mNormalX[3];
+             normal[3*vertex  ]   = mNormalX[3];
              normal[3*vertex+1]   = mNormalY[3];
              normal[3*vertex+2]   = 1.0f;
-             texture[2*vertex+0]  = (float)(j+1)/mCols;
+             texture[2*vertex  ]  = (float)(j+1)/mCols;
              texture[2*vertex+1]  = (float)(i+1)/mRows;
              vertex++;
              }
            else // NE corner
              {
-             position[3*vertex+0] = (centerX+0.5f)/mCols;
+             position[3*vertex  ] = (centerX+0.5f)/mCols;
              position[3*vertex+1] = (centerY+0.5f)/mRows;
              position[3*vertex+2] = BACKZ; 
-             normal[3*vertex+0]   = mNormalX[2];
+             normal[3*vertex  ]   = mNormalX[2];
              normal[3*vertex+1]   = mNormalY[2];
              normal[3*vertex+2]   =-1.0f;
-             texture[2*vertex+0]  = (float)(j+1)/mCols;
+             texture[2*vertex  ]  = (float)(j+1)/mCols;
              texture[2*vertex+1]  = (float)i/mRows;
              vertex++; 
              }
@@ -505,15 +504,15 @@ class DistortedCubesGrid extends DistortedObjectGrid
      {
      if( vertex>0 )
        {
-       position[3*vertex+0] = position[3*vertex-3]; 
+       position[3*vertex  ] = position[3*vertex-3];
        position[3*vertex+1] = position[3*vertex-2];
        position[3*vertex+2] = position[3*vertex-1];
 
-       normal[3*vertex+0]   = normal[3*vertex-3]; 
+       normal[3*vertex  ]   = normal[3*vertex-3];
        normal[3*vertex+1]   = normal[3*vertex-2];
        normal[3*vertex+2]   = normal[3*vertex-1];
 
-       texture[2*vertex+0]  = texture[2*vertex-2];
+       texture[2*vertex  ]  = texture[2*vertex-2];
        texture[2*vertex+1]  = texture[2*vertex-1];
          
        vertex++;     
@@ -646,54 +645,54 @@ class DistortedCubesGrid extends DistortedObjectGrid
   
      switch(curr.side)
        {
-       case NORTH: position[3*vertex+0] = (back ? (centerX-0.5f) : (centerX+0.5f))/mCols; 
+       case NORTH: position[3*vertex  ] = (back ? (centerX-0.5f) : (centerX+0.5f))/mCols;
                    position[3*vertex+1] = (centerY+0.5f)/mRows;
                    position[3*vertex+2] = lower ? BACKZ : FRONTZ;
 
-                   normal[3*vertex+0]   = side==NORTH ? 0.0f : (side==WEST?-R:R);
+                   normal[3*vertex  ]   = side==NORTH ? 0.0f : (side==WEST?-R:R);
                    normal[3*vertex+1]   = 1.0f;
                    normal[3*vertex+2]   = lower ? -R:R;
 
-                   texture[2*vertex+0]  = (float)(back ? (curr.col  ):(curr.col+1))/mCols;
+                   texture[2*vertex  ]  = (float)(back ? (curr.col  ):(curr.col+1))/mCols;
                    texture[2*vertex+1]  = (float)(lower? (curr.row-1):(curr.row  ))/mRows;  
                    break;
-       case SOUTH: position[3*vertex+0] = (back ? (centerX+0.5f) : (centerX-0.5f))/mCols;
+       case SOUTH: position[3*vertex  ] = (back ? (centerX+0.5f) : (centerX-0.5f))/mCols;
                    position[3*vertex+1] = (centerY-0.5f)/mRows;
                    position[3*vertex+2] = lower ? BACKZ : FRONTZ;  
             
-                   normal[3*vertex+0]   = side==SOUTH ? 0.0f: (side==EAST?-R:R);
+                   normal[3*vertex  ]   = side==SOUTH ? 0.0f: (side==EAST?-R:R);
                    normal[3*vertex+1]   =-1.0f;
                    normal[3*vertex+2]   = lower ? -R:R;
 
-                   texture[2*vertex+0]  = (float)(back ? (curr.col+1):(curr.col  ))/mCols;
+                   texture[2*vertex  ]  = (float)(back ? (curr.col+1):(curr.col  ))/mCols;
                    texture[2*vertex+1]  = (float)(lower? (curr.row+2):(curr.row+1))/mRows;
                    break;
-       case WEST : position[3*vertex+0] = (centerX-0.5f)/mCols;
+       case WEST : position[3*vertex  ] = (centerX-0.5f)/mCols;
                    position[3*vertex+1] = (back ? (centerY-0.5f):(centerY+0.5f))/mRows;
                    position[3*vertex+2] = lower ? BACKZ : FRONTZ;
 
-                   normal[3*vertex+0]   =-1.0f;
+                   normal[3*vertex  ]   =-1.0f;
                    normal[3*vertex+1]   = side==WEST ? 0.0f : (side==NORTH?-R:R);
                    normal[3*vertex+2]   = lower ? -R:R;
  
-                   texture[2*vertex+0]  = (float)(lower ? (curr.col-1):(curr.col  ))/mCols;
+                   texture[2*vertex  ]  = (float)(lower ? (curr.col-1):(curr.col  ))/mCols;
                    texture[2*vertex+1]  = (float)(back  ? (curr.row+1):(curr.row  ))/mRows;
                    break;
-       case EAST : position[3*vertex+0] = (centerX+0.5f)/mCols;
+       case EAST : position[3*vertex  ] = (centerX+0.5f)/mCols;
                    position[3*vertex+1] = (back ? (centerY+0.5f):(centerY-0.5f))/mRows;
                    position[3*vertex+2] = lower ? BACKZ : FRONTZ;
 
-                   normal[3*vertex+0]   = 1.0f;
+                   normal[3*vertex  ]   = 1.0f;
                    normal[3*vertex+1]   = side==EAST ? 0.0f : (side==SOUTH?-R:R);
                    normal[3*vertex+2]   = lower ? -R:R; 
 
-                   texture[2*vertex+0]  = (float)(lower ? (curr.col+2):(curr.col+1))/mCols;
+                   texture[2*vertex  ]  = (float)(lower ? (curr.col+2):(curr.col+1))/mCols;
                    texture[2*vertex+1]  = (float)(back  ? (curr.row  ):(curr.row+1))/mRows;
                    break;
        }
      
-     if(texture[2*vertex+0]>1.0f) texture[2*vertex+0] =2.0f-texture[2*vertex+0];
-     if(texture[2*vertex+0]<0.0f) texture[2*vertex+0] =    -texture[2*vertex+0];
+     if(texture[2*vertex  ]>1.0f) texture[2*vertex  ] =2.0f-texture[2*vertex  ];
+     if(texture[2*vertex  ]<0.0f) texture[2*vertex  ] =    -texture[2*vertex  ];
      if(texture[2*vertex+1]>1.0f) texture[2*vertex+1] =2.0f-texture[2*vertex+1];
      if(texture[2*vertex+1]<0.0f) texture[2*vertex+1] =    -texture[2*vertex+1];
      }
@@ -705,8 +704,9 @@ class DistortedCubesGrid extends DistortedObjectGrid
 /**
  * Creates the underlying grid of vertices, normals, texture coords and colors.
  *    
- * @param rows See {@link DistortedCubes#DistortedCubes(String)} 
- * @param desc See {@link DistortedCubes#DistortedCubes(String)}
+ * @param cols      See {@link DistortedCubes#DistortedCubes(int,String,int,boolean)}
+ * @param desc      See {@link DistortedCubes#DistortedCubes(int,String,int,boolean)}
+ * @param frontOnly See {@link DistortedCubes#DistortedCubes(int,String,int,boolean)}
  */
    public DistortedCubesGrid(int cols, String desc, boolean frontOnly)
       {
@@ -720,7 +720,7 @@ class DistortedCubesGrid extends DistortedObjectGrid
       
       for(int i=0; i<dataLength; i++)
         {
-        colorData[COLOR_DATA_SIZE*i+0] = 1.0f; // r
+        colorData[COLOR_DATA_SIZE*i  ] = 1.0f; // r
         colorData[COLOR_DATA_SIZE*i+1] = 1.0f; // g
         colorData[COLOR_DATA_SIZE*i+2] = 1.0f; // b
         colorData[COLOR_DATA_SIZE*i+3] = 1.0f; // a
