commit d5411af4d68e85cb1b9cbaf80e6c71d7fad59faf
Author: Leszek Koltunski <leszek@koltunski.pl>
Date:   Fri May 13 09:16:55 2022 +0200

    one more crash fix and a bump to 1.10.3

diff --git a/src/main/java/org/distorted/objectlib/main/ObjectControl.java b/src/main/java/org/distorted/objectlib/main/ObjectControl.java
index dd600359..21509710 100644
--- a/src/main/java/org/distorted/objectlib/main/ObjectControl.java
+++ b/src/main/java/org/distorted/objectlib/main/ObjectControl.java
@@ -237,7 +237,7 @@ public class ObjectControl
       TwistyObject object = mPreRender.getObject();
       int[][] angles = object.getBasicAngles();
 
-      if( mCurrentAxis<angles.length )
+      if( mCurrentAxis<angles.length && mCurrentRow<angles[mCurrentAxis].length )
         {
         computeCurrentSpeedInInchesPerSecond();
         int basic = angles[mCurrentAxis][mCurrentRow];
diff --git a/src/main/java/org/distorted/objectlib/main/ObjectSignatures.java b/src/main/java/org/distorted/objectlib/main/ObjectSignatures.java
index 0ef3d6c1..f0d40805 100644
--- a/src/main/java/org/distorted/objectlib/main/ObjectSignatures.java
+++ b/src/main/java/org/distorted/objectlib/main/ObjectSignatures.java
@@ -72,4 +72,5 @@ public class ObjectSignatures
   public static final int CRYS_3 = ObjectType.CRYS_3.ordinal();
   public static final int STAR_3 = ObjectType.STAR_3.ordinal();
   public static final int PENT_2 = ObjectType.PENT_2.ordinal();
+  public static final int MIXU_3 = ObjectType.MIXU_3.ordinal();
   }
diff --git a/src/main/java/org/distorted/objectlib/main/ObjectType.java b/src/main/java/org/distorted/objectlib/main/ObjectType.java
index 52248c7f..90153e88 100644
--- a/src/main/java/org/distorted/objectlib/main/ObjectType.java
+++ b/src/main/java/org/distorted/objectlib/main/ObjectType.java
@@ -79,6 +79,8 @@ public enum ObjectType
   SKEW_3 ( TwistySkewb.class         , new int[] {3,3,3,3}    , 21, R.drawable.skew_3, true),
   CONT_2 ( TwistyContainer.class     , new int[] {2,2,2,2}    , 12, R.drawable.cont_2, true),
 
+  MIXU_3 ( TwistyMixup.class         , new int[] {3,3,3}      , 22, R.drawable.cont_2, false),
+
   VOID_3 ( TwistyVoid.class          , new int[] {3,3,3}      , 17, R.drawable.void_3, false),  // wasDownloadableButNowIsBuiltIn()
   CRYS_3 ( TwistyCrystal.class       , new int[] {3,3,3,3,3,3}, 27, R.drawable.crys_3, false),  // function!
   STAR_3 ( TwistyStarminx.class      , new int[] {3,3,3,3,3,3}, 27, R.drawable.star_3, false),
diff --git a/src/main/java/org/distorted/objectlib/objects/TwistyMixup.java b/src/main/java/org/distorted/objectlib/objects/TwistyMixup.java
new file mode 100644
index 00000000..d3279cac
--- /dev/null
+++ b/src/main/java/org/distorted/objectlib/objects/TwistyMixup.java
@@ -0,0 +1,435 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// Copyright 2020 Leszek Koltunski                                                               //
+//                                                                                               //
+// This file is part of Magic Cube.                                                              //
+//                                                                                               //
+// Magic Cube is free software: you can redistribute it and/or modify                            //
+// it under the terms of the GNU General Public License as published by                          //
+// the Free Software Foundation, either version 2 of the License, or                             //
+// (at your option) any later version.                                                           //
+//                                                                                               //
+// Magic Cube is distributed in the hope that it will be useful,                                 //
+// but WITHOUT ANY WARRANTY; without even the implied warranty of                                //
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                 //
+// GNU General Public License for more details.                                                  //
+//                                                                                               //
+// You should have received a copy of the GNU General Public License                             //
+// along with Magic Cube.  If not, see <http://www.gnu.org/licenses/>.                           //
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+package org.distorted.objectlib.objects;
+
+import org.distorted.library.type.Static3D;
+import org.distorted.library.type.Static4D;
+import org.distorted.objectlib.helpers.ObjectFaceShape;
+import org.distorted.objectlib.helpers.ObjectShape;
+import org.distorted.objectlib.helpers.ObjectSignature;
+import org.distorted.objectlib.main.ObjectType;
+import org.distorted.objectlib.main.ShapeHexahedron;
+import org.distorted.objectlib.scrambling.ScrambleState;
+import org.distorted.objectlib.touchcontrol.TouchControlHexahedron;
+
+import java.io.InputStream;
+
+import static org.distorted.objectlib.touchcontrol.TouchControl.TC_HEXAHEDRON;
+import static org.distorted.objectlib.touchcontrol.TouchControl.TYPE_NOT_SPLIT;
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+public class TwistyMixup extends ShapeHexahedron
+{
+  static final Static3D[] ROT_AXIS = new Static3D[]
+         {
+           new Static3D(1,0,0),
+           new Static3D(0,1,0),
+           new Static3D(0,0,1)
+         };
+
+  private ScrambleState[] mStates;
+  private int[][] mBasicAngle;
+  private float[][] mCuts;
+  private float[][] mPosition;
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public TwistyMixup(int[] numL, int meshState, int iconMode, Static4D quat, Static3D move, float scale, InputStream stream)
+    {
+    super(numL, meshState, iconMode, numL[0], quat, move, scale, stream);
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public ScrambleState[] getScrambleStates()
+    {
+    if( mStates==null )
+      {
+      int[][] m = new int[16][];
+
+      for(int i=0; i<16; i++) m[i] = new int[] { 0,-2,i,0, 2,i,0, 4,i,
+                                                 1,-3,i,1,-2,i,1,-1,i,1,1,i,1,2,i,1,3,i,1,4,i,
+                                                 2,-2,i,2, 2,i,2, 4,i };
+
+      mStates = new ScrambleState[]
+          {
+          new ScrambleState( new int[][] { m[ 1], m[ 2], m[ 3] } ),  //  0 0
+          new ScrambleState( new int[][] {  null, m[ 4], m[ 5] } ),  //  1 x
+          new ScrambleState( new int[][] { m[ 6],  null, m[ 7] } ),  //  2 y
+          new ScrambleState( new int[][] { m[ 8], m[ 9],  null } ),  //  3 z
+          new ScrambleState( new int[][] { m[10],  null, m[ 7] } ),  //  4 xy
+          new ScrambleState( new int[][] { m[11], m[ 9],  null } ),  //  5 xz
+          new ScrambleState( new int[][] {  null, m[12], m[ 5] } ),  //  6 yx
+          new ScrambleState( new int[][] { m[ 8], m[13],  null } ),  //  7 yz
+          new ScrambleState( new int[][] {  null, m[ 4], m[14] } ),  //  8 zx
+          new ScrambleState( new int[][] { m[ 6],  null, m[15] } ),  //  9 zy
+          new ScrambleState( new int[][] {  null,  null, m[ 5] } ),  // 10 xyx
+          new ScrambleState( new int[][] {  null, m[ 4],  null } ),  // 11 xzx
+          new ScrambleState( new int[][] {  null,  null, m[ 7] } ),  // 12 yxy
+          new ScrambleState( new int[][] { m[ 6],  null,  null } ),  // 13 yzy
+          new ScrambleState( new int[][] {  null, m[ 9],  null } ),  // 14 zxz
+          new ScrambleState( new int[][] { m[ 8],  null,  null } ),  // 15 zyz
+          };
+      }
+
+    return mStates;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public float[][] getCuts(int[] numLayers)
+    {
+    if( mCuts==null )
+      {
+      float C = 1.5f*(SQ2-1);
+      float[] cut = new float[] {-C,+C};
+      mCuts = new float[][] { cut,cut,cut };
+      }
+
+    return mCuts;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public boolean[][] getLayerRotatable(int[] numLayers)
+    {
+    boolean[] tmp = new boolean[] {true,true,true};
+    return new boolean[][] { tmp,tmp,tmp };
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public int getTouchControlType()
+    {
+    return TC_HEXAHEDRON;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public int getTouchControlSplit()
+    {
+    return TYPE_NOT_SPLIT;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public int[][][] getEnabled()
+    {
+    return new int[][][] { {{1,2}},{{1,2}},{{0,2}},{{0,2}},{{0,1}},{{0,1}} };
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public float[] getDist3D(int[] numLayers)
+    {
+    return TouchControlHexahedron.D3D;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public Static3D[] getFaceAxis()
+    {
+    return TouchControlHexahedron.FACE_AXIS;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// TODO
+
+  public float[][] getCubitPositions(int[] numLayers)
+    {
+    if( mPosition==null )
+      {
+      final float DIST_CORNER = 1.0f;
+      final float DIST_EDGE   = 1.5f;
+
+      mPosition = new float[][]
+         {
+             { DIST_CORNER, DIST_CORNER, DIST_CORNER },
+             { DIST_CORNER, DIST_CORNER,-DIST_CORNER },
+             { DIST_CORNER,-DIST_CORNER, DIST_CORNER },
+             { DIST_CORNER,-DIST_CORNER,-DIST_CORNER },
+             {-DIST_CORNER, DIST_CORNER, DIST_CORNER },
+             {-DIST_CORNER, DIST_CORNER,-DIST_CORNER },
+             {-DIST_CORNER,-DIST_CORNER, DIST_CORNER },
+             {-DIST_CORNER,-DIST_CORNER,-DIST_CORNER },
+
+             {      0.0f, DIST_EDGE, DIST_EDGE },
+             { DIST_EDGE,      0.0f, DIST_EDGE },
+             {      0.0f,-DIST_EDGE, DIST_EDGE },
+             {-DIST_EDGE,      0.0f, DIST_EDGE },
+             { DIST_EDGE, DIST_EDGE,      0.0f },
+             { DIST_EDGE,-DIST_EDGE,      0.0f },
+             {-DIST_EDGE,-DIST_EDGE,      0.0f },
+             {-DIST_EDGE, DIST_EDGE,      0.0f },
+             {      0.0f, DIST_EDGE,-DIST_EDGE },
+             { DIST_EDGE,      0.0f,-DIST_EDGE },
+             {      0.0f,-DIST_EDGE,-DIST_EDGE },
+             {-DIST_EDGE,      0.0f,-DIST_EDGE }
+         };
+      }
+
+    return mPosition;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// TODO
+
+  public Static4D getCubitQuats(int cubit, int[] numLayers)
+    {
+    switch(cubit)
+      {
+      case  0: return mObjectQuats[0];                   //  unit quat
+      case  1: return new Static4D( SQ2/2,0,0,SQ2/2);    //  90 along X
+      case  2: return new Static4D(-SQ2/2,0,0,SQ2/2);    // -90 along X
+      case  3: return mObjectQuats[9];                   // 180 along X
+      case  4: return new Static4D(0, SQ2/2,0,SQ2/2);    //  90 along Y
+      case  5: return mObjectQuats[11];                  // 180 along Y
+      case  6: return mObjectQuats[10];                  // 180 along Z
+      case  7: return new Static4D(SQ2/2,0,-SQ2/2,0);    // 180 along (SQ2/2,0,-SQ2/2)
+
+      case  8: return mObjectQuats[0];
+      case  9: return mObjectQuats[2];
+      case 10: return mObjectQuats[10];
+      case 11: return mObjectQuats[8];
+      case 12: return mObjectQuats[1];
+      case 13: return mObjectQuats[4];
+      case 14: return mObjectQuats[6];
+      case 15: return mObjectQuats[7];
+      case 16: return mObjectQuats[11];
+      case 17: return mObjectQuats[5];
+      case 18: return mObjectQuats[9];
+      case 19: return mObjectQuats[3];
+      }
+
+    return null;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// TODO
+
+  public ObjectShape getObjectShape(int variant)
+    {
+    if( variant==0 )
+      {
+      float[][] vertices =
+          {
+             { 0.0f, 0.0f, 0.0f },
+             {-0.5f, 0.5f, 0.5f },
+             {-0.5f,-0.5f, 0.5f },
+             { 0.5f, 0.5f, 0.5f },
+             { 0.5f,-0.5f, 0.5f },
+             { 0.5f, 0.5f,-0.5f },
+             { 0.5f,-0.5f,-0.5f },
+             {-0.5f, 0.5f,-0.5f },
+          };
+
+      int[][] indices =
+          {
+             { 2,4,3,1 },
+             { 1,3,5,7 },
+             { 4,6,5,3 },
+
+             { 0,4,2 },
+             { 0,7,5 },
+             { 0,6,4 },
+             { 0,1,7 },
+             { 0,2,1 },
+             { 0,5,6 }
+          };
+
+      return new ObjectShape(vertices, indices);
+      }
+    else
+      {
+      float[][] vertices =
+          {
+             {-0.5f, 0.0f, 0.0f},
+             { 0.5f, 0.0f, 0.0f},
+             {-0.5f,-1.0f, 0.0f},
+             { 0.5f,-1.0f, 0.0f},
+             { 0.0f,-1.5f, 0.0f},
+             {-0.5f, 0.0f,-1.0f},
+             { 0.5f, 0.0f,-1.0f},
+             { 0.0f, 0.0f,-1.5f},
+          };
+
+      int[][] indices =
+          {
+             { 0,2,4,3,1 },
+             { 0,1,6,7,5 },
+             { 1,3,6 },
+             { 5,2,0 },
+             { 4,7,6,3 },
+             { 2,5,7,4 }
+          };
+
+      return new ObjectShape(vertices, indices);
+      }
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// TODO
+
+  public ObjectFaceShape getObjectFaceShape(int variant)
+    {
+    if( variant==0 )
+      {
+      float h1 = isInIconMode() ? 0.001f : 0.06f;
+      float h2 = isInIconMode() ? 0.001f : 0.01f;
+
+      float[][] bands     = { {h1,35,0.5f,0.7f,5,2,2}, {h2,35,0.2f,0.4f,5,2,2} };
+      int[] bandIndices   = { 0,0,0,1,1,1,1,1,1 };
+      float[][] corners   = { {0.06f,0.12f} };
+      int[] cornerIndices = { -1,0,-1,0,0,0,-1,-1 };
+      float[][] centers   = { { 0.0f, 0.0f, 0.0f} };
+      int[] centerIndices = { -1,0,-1,0,0,0,-1,-1 };
+      return new ObjectFaceShape(bands,bandIndices,corners,cornerIndices,centers,centerIndices,null);
+      }
+    else
+      {
+      float h1 = isInIconMode() ? 0.001f : 0.038f;
+      float h2 = isInIconMode() ? 0.001f : 0.020f;
+
+      float[][] bands     = { {h1,35,0.250f,0.7f,7,2,2}, {h2,35,0.125f,0.2f,3,1,2}, {h2,35,0.125f,0.2f,3,1,1} };
+      int[] bandIndices   = { 0,0,1,1,2,2 };
+      float[][] corners   = { {0.06f,0.20f} };
+      int[] cornerIndices = { 0,0,-1,-1,-1,-1,-1,-1 };
+      float[][] centers   = { { 0.0f,-0.75f,-0.75f} };
+      int[] centerIndices = { 0,0,-1,-1,-1,-1,-1,-1 };
+      return new ObjectFaceShape(bands,bandIndices,corners,cornerIndices,centers,centerIndices,null);
+      }
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public int getNumCubitVariants(int[] numLayers)
+    {
+    return 3;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public int getCubitVariant(int cubit, int[] numLayers)
+    {
+    return cubit<8 ? 0 : (cubit<20?1:2);
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public float getStickerRadius()
+    {
+    return 0.09f;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public float getStickerStroke()
+    {
+    return isInIconMode() ? 0.20f : 0.09f;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public float[][] getStickerAngles()
+    {
+    return null;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// PUBLIC API
+
+  public Static3D[] getRotationAxis()
+    {
+    return ROT_AXIS;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public int[][] getBasicAngles()
+    {
+    if( mBasicAngle ==null )
+      {
+      int[] tmp = new int[] {4,8,4};
+      mBasicAngle = new int[][] { tmp,tmp,tmp };
+      }
+
+    return mBasicAngle;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public String getShortName()
+    {
+    return ObjectType.MIXU_3.name();
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public ObjectSignature getSignature()
+    {
+    return new ObjectSignature(ObjectType.MIXU_3);
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public String getObjectName()
+    {
+    return "Mixup Cube";
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public String getInventor()
+    {
+    return "Sergey Makarov";
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public int getYearOfInvention()
+    {
+    return 1985;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public int getComplexity()
+    {
+    return 2;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public String[][] getTutorials()
+    {
+    return new String[][] {
+                          {"gb","Qn7TJED6O-4","How to Solve the MoYu Redi Cube","Z3"},
+                          {"es","g0M38Aotgac","Resolver Redi Cube","Cuby"},
+                          {"ru","dlNRbE-hyzU","Как собрать Реди Куб","Алексей Ярыгин"},
+                          {"fr","zw7UZcqqsgA","Comment résoudre le Redi Cube","ValentinoCube"},
+                          {"de","YU8riouyC2w","Redi Cube Solve","CubaroCubing"},
+                          {"pl","vxo3lXMsWQI","Jak ułożyć Redi Cube?","DJ rubiks"},
+                          {"br","muQ8U_G4LmM","Como resolver o Redi Cube","Rafael Cinoto"},
+                          {"kr","a5CzDMbRzbY","레디큐브를 배우기","vincentcube"},
+                          {"vn","2JZxtmrKUn4","Tutorial N.6 - Redi","Duy Thích Rubik"},
+                         };
+    }
+}
