126 |
126 |
mErrorString = null;
|
127 |
127 |
}
|
128 |
128 |
|
|
129 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
|
130 |
|
|
131 |
public abstract int getTouchControlType();
|
|
132 |
public abstract int getTouchControlSplit();
|
|
133 |
public abstract boolean[][] getLayerRotatable(int[] numLayers);
|
|
134 |
public abstract int[][][] getEnabled();
|
|
135 |
public abstract int[][] getScrambleEdges();
|
|
136 |
public abstract float getStickerRadius();
|
|
137 |
public abstract float getStickerStroke();
|
|
138 |
public abstract float[][][] getStickerAngles();
|
|
139 |
public abstract float getScreenRatio();
|
|
140 |
public abstract int[] getColorTable();
|
|
141 |
public abstract String getShortName();
|
|
142 |
public abstract String printColor(int color);
|
|
143 |
public abstract int getNumPuzzleFaces();
|
|
144 |
public abstract int getFOV();
|
|
145 |
public abstract String[][] getTutorials();
|
|
146 |
|
129 |
147 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
130 |
148 |
|
131 |
149 |
private void initialize(int iconMode, Static4D quat, Static3D move, float scale, InitAssets asset, boolean fromJSON)
|
... | ... | |
176 |
194 |
mNode = new DistortedNode(mTexture,mEffects,mMesh);
|
177 |
195 |
}
|
178 |
196 |
|
|
197 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
|
198 |
|
|
199 |
private TablebasesAbstract getTablebase(OperatingSystemInterface os)
|
|
200 |
{
|
|
201 |
String shortName = getShortName();
|
|
202 |
return ImplementedTablebasesList.createPacked(os,shortName);
|
|
203 |
}
|
|
204 |
|
|
205 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
|
206 |
|
|
207 |
public int[][] getSolvedQuats()
|
|
208 |
{
|
|
209 |
return null;
|
|
210 |
}
|
|
211 |
|
|
212 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
|
213 |
|
|
214 |
protected int[][] getOldSolvedQuats()
|
|
215 |
{
|
|
216 |
return mSolved.getSolvedQuats(mNumLayers);
|
|
217 |
}
|
|
218 |
|
|
219 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
|
220 |
// 0: old, groups-of-quaternions based function.
|
|
221 |
// Still used by: Masterball, Mirror Skewb, Mirror Jing, Mirror Pyraminx & the Penrose Cubes.
|
|
222 |
//
|
|
223 |
// 1: specific function only for the Dino4.
|
|
224 |
//
|
|
225 |
// 2: the new default; automatic way based on automatic detection of monochromatic puzzle surfaces.
|
|
226 |
|
|
227 |
public int getSolvedFunctionIndex()
|
|
228 |
{
|
|
229 |
return 2;
|
|
230 |
}
|
|
231 |
|
|
232 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
|
233 |
|
|
234 |
boolean isSolved()
|
|
235 |
{
|
|
236 |
for(int c=0; c<mNumCubits; c++) mCubitQuats[c] = getCubitQuatIndex(c);
|
|
237 |
boolean solved = mSolved.isSolved(mCubitQuats);
|
|
238 |
return mRotation.isSolved(solved);
|
|
239 |
}
|
|
240 |
|
|
241 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
|
242 |
// LATER
|
179 |
243 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
180 |
244 |
|
181 |
245 |
public void recreateFaceColors()
|
... | ... | |
192 |
256 |
return 0;
|
193 |
257 |
}
|
194 |
258 |
|
195 |
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
196 |
|
|
197 |
|
private TablebasesAbstract getTablebase(OperatingSystemInterface os)
|
198 |
|
{
|
199 |
|
String shortName = getShortName();
|
200 |
|
return ImplementedTablebasesList.createPacked(os,shortName);
|
201 |
|
}
|
202 |
|
|
203 |
259 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
204 |
260 |
|
205 |
261 |
private void figureOutBitmapDimensions(int numTextures)
|
... | ... | |
286 |
342 |
return ScrambleEdgeGenerator.getScramblingAlgorithms(mBasicAngles);
|
287 |
343 |
}
|
288 |
344 |
|
289 |
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
290 |
|
|
291 |
|
public int[][] getSolvedQuats()
|
292 |
|
{
|
293 |
|
return null;
|
294 |
|
}
|
295 |
|
|
296 |
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
297 |
|
|
298 |
|
protected int[][] getOldSolvedQuats()
|
299 |
|
{
|
300 |
|
return mSolved.getSolvedQuats(mNumLayers,mNumCubitFaces);
|
301 |
|
}
|
302 |
|
|
303 |
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
304 |
|
// 0: old, groups-of-quaternions based function.
|
305 |
|
// Still used by: Masterball, Mirror Skewb, Mirror Jing, Mirror Pyraminx & the Penrose Cubes.
|
306 |
|
//
|
307 |
|
// 1: specific function only for the Dino4.
|
308 |
|
//
|
309 |
|
// 2: the new default; automatic way based on automatic detection of monochromatic puzzle surfaces.
|
310 |
|
|
311 |
|
public int getSolvedFunctionIndex()
|
312 |
|
{
|
313 |
|
return 2;
|
314 |
|
}
|
315 |
|
|
316 |
345 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
317 |
346 |
|
318 |
347 |
public int getScrambleType()
|
... | ... | |
390 |
419 |
final float ratioH = 1.0f/mNumTexRows;
|
391 |
420 |
final Static4D[] maps = new Static4D[1];
|
392 |
421 |
maps[0] = new Static4D(col*ratioW, row*ratioH, ratioW, ratioH);
|
393 |
|
mMesh.setTextureMap(maps,mNumCubitFaces*cubit+face);
|
|
422 |
mMesh.setTextureMap(maps, mMaxNumCubitFaces*cubit+face);
|
394 |
423 |
}
|
395 |
424 |
|
396 |
425 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
... | ... | |
443 |
472 |
|
444 |
473 |
for(int cubit=0; cubit<mNumCubits; cubit++)
|
445 |
474 |
{
|
446 |
|
final Static4D[] maps = new Static4D[mNumCubitFaces];
|
|
475 |
final Static4D[] maps = new Static4D[mMaxNumCubitFaces];
|
447 |
476 |
variant = getCubitVariant(cubit,mNumLayers);
|
448 |
477 |
|
449 |
|
for(int face=0; face<mNumCubitFaces; face++)
|
|
478 |
for( int face=0; face<mMaxNumCubitFaces; face++)
|
450 |
479 |
{
|
451 |
480 |
cubColor = getDefaultCubitFaceColor(cubit,face);
|
452 |
481 |
stiShape = getVariantStickerShape(variant,face);
|
... | ... | |
457 |
486 |
maps[face] = new Static4D( col*ratioW, row*ratioH, ratioW, ratioH);
|
458 |
487 |
}
|
459 |
488 |
|
460 |
|
mMesh.setTextureMap(maps,mNumCubitFaces*cubit);
|
|
489 |
mMesh.setTextureMap(maps, mMaxNumCubitFaces*cubit);
|
461 |
490 |
}
|
462 |
491 |
|
463 |
492 |
overrideCubitFaceColor();
|
... | ... | |
484 |
513 |
int cubit = cubitFaces[2*j];
|
485 |
514 |
int face = cubitFaces[2*j+1];
|
486 |
515 |
maps[0] = new Static4D(col*ratioW, row*ratioH, ratioW, ratioH);
|
487 |
|
mMesh.setTextureMap(maps,mNumCubitFaces*cubit+face);
|
|
516 |
mMesh.setTextureMap(maps, mMaxNumCubitFaces*cubit+face);
|
488 |
517 |
}
|
489 |
518 |
}
|
490 |
519 |
}
|
... | ... | |
892 |
921 |
return mObjectScreenRatio*mInitScreenRatio;
|
893 |
922 |
}
|
894 |
923 |
|
895 |
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
896 |
|
|
897 |
|
boolean isSolved()
|
898 |
|
{
|
899 |
|
for(int c=0; c<mNumCubits; c++) mCubitQuats[c] = getCubitQuatIndex(c);
|
900 |
|
boolean solved = mSolved.isSolved(mCubitQuats);
|
901 |
|
return mRotation.isSolved(solved);
|
902 |
|
}
|
903 |
|
|
904 |
924 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
905 |
925 |
// INTERNAL API - those are called from 'effects' package
|
906 |
926 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
... | ... | |
965 |
985 |
|
966 |
986 |
public int getCubitFaceStickerIndex(int cubit, int face)
|
967 |
987 |
{
|
968 |
|
Static4D texMap = mMesh.getTextureMap(mNumCubitFaces*cubit + face);
|
|
988 |
Static4D texMap = mMesh.getTextureMap(mMaxNumCubitFaces*cubit + face);
|
969 |
989 |
|
970 |
990 |
int x = (int)(texMap.get0()/texMap.get2());
|
971 |
991 |
int y = (int)(texMap.get1()/texMap.get3());
|
... | ... | |
1070 |
1090 |
public ObjectSignature getSignature() { return mMetadata.getSignature(); }
|
1071 |
1091 |
public int getCategory() { return mMetadata!=null ? mMetadata.getCategory() : 0; }
|
1072 |
1092 |
public boolean isSubmittable() { return mCurrentColorSchemeSubmittable; }
|
1073 |
|
|
1074 |
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
1075 |
|
|
1076 |
|
public abstract int getTouchControlType();
|
1077 |
|
public abstract int getTouchControlSplit();
|
1078 |
|
public abstract boolean[][] getLayerRotatable(int[] numLayers);
|
1079 |
|
public abstract int[][][] getEnabled();
|
1080 |
|
public abstract int[][] getScrambleEdges();
|
1081 |
|
public abstract float getStickerRadius();
|
1082 |
|
public abstract float getStickerStroke();
|
1083 |
|
public abstract float[][][] getStickerAngles();
|
1084 |
|
public abstract float getScreenRatio();
|
1085 |
|
public abstract int[] getColorTable();
|
1086 |
|
public abstract String getShortName();
|
1087 |
|
public abstract String printColor(int color);
|
1088 |
|
public abstract int getNumPuzzleFaces();
|
1089 |
|
public abstract int getFOV();
|
1090 |
|
public abstract String[][] getTutorials();
|
1091 |
1093 |
}
|
Cleanup