Revision a75ae1ee
Added by Leszek Koltunski over 2 years ago
src/main/java/org/distorted/objectlib/main/TwistyObject.java | ||
---|---|---|
399 | 399 |
|
400 | 400 |
protected int retCubitSolvedStatus(int cubit, int[] numLayers) |
401 | 401 |
{ |
402 |
int numNonBlack=0, nonBlackIndex=-1, color; |
|
402 |
int numNonBlack=0, nonBlackIndex=-1, varColor, cubColor; |
|
403 |
int variant = getCubitVariant(cubit,numLayers); |
|
403 | 404 |
|
404 | 405 |
for(int face=0; face<mNumCubitFaces; face++) |
405 | 406 |
{ |
406 |
color = getFaceColor(cubit,face,numLayers); |
|
407 |
varColor = getVariantFaceColor(variant,face,numLayers); |
|
408 |
cubColor = getCubitFaceColor(cubit,face,numLayers); |
|
407 | 409 |
|
408 |
if( color<NUM_TEXTURES )
|
|
410 |
if( varColor>=0 && cubColor>=0 )
|
|
409 | 411 |
{ |
410 | 412 |
numNonBlack++; |
411 |
nonBlackIndex = color%NUM_FACE_COLORS;
|
|
413 |
nonBlackIndex = cubColor;
|
|
412 | 414 |
} |
413 | 415 |
} |
414 | 416 |
|
... | ... | |
1031 | 1033 |
{ |
1032 | 1034 |
final float ratioW = 1.0f/mNumTexCols; |
1033 | 1035 |
final float ratioH = 1.0f/mNumTexRows; |
1034 |
int color, row, col;
|
|
1036 |
int cubColor, varColor, color, variant, row, col;
|
|
1035 | 1037 |
|
1036 | 1038 |
for(int cubit=0; cubit<NUM_CUBITS; cubit++) |
1037 | 1039 |
{ |
1038 | 1040 |
final Static4D[] maps = new Static4D[mNumCubitFaces]; |
1041 |
variant = getCubitVariant(cubit,mNumLayers); |
|
1039 | 1042 |
|
1040 |
for(int cubitface=0; cubitface<mNumCubitFaces; cubitface++)
|
|
1043 |
for(int face=0; face<mNumCubitFaces; face++)
|
|
1041 | 1044 |
{ |
1042 |
color = getFaceColor(cubit,cubitface,mNumLayers); |
|
1043 |
row = (mNumTexRows-1) - color/mNumTexCols; |
|
1044 |
col = color%mNumTexCols; |
|
1045 |
maps[cubitface] = new Static4D( col*ratioW, row*ratioH, ratioW, ratioH); |
|
1045 |
cubColor = getCubitFaceColor(cubit,face,mNumLayers); |
|
1046 |
varColor = getVariantFaceColor(variant,face,mNumLayers); |
|
1047 |
color = cubColor<0 || varColor<0 ? NUM_TEXTURES : varColor*NUM_FACE_COLORS + cubColor; |
|
1048 |
row = (mNumTexRows-1) - color/mNumTexCols; |
|
1049 |
col = color%mNumTexCols; |
|
1050 |
|
|
1051 |
maps[face] = new Static4D( col*ratioW, row*ratioH, ratioW, ratioH); |
|
1046 | 1052 |
} |
1047 | 1053 |
|
1048 | 1054 |
mMesh.setTextureMap(maps,mNumCubitFaces*cubit); |
... | ... | |
1379 | 1385 |
|
1380 | 1386 |
protected abstract int getFOV(); |
1381 | 1387 |
protected abstract float getScreenRatio(); |
1382 |
protected abstract int getNumFaceColors(); |
|
1383 | 1388 |
protected abstract int getColor(int face); |
1384 |
protected abstract int getNumCubitFaces(); |
|
1385 |
protected abstract int getFaceColor(int cubit, int cubitface, int[] numLayers); |
|
1386 | 1389 |
protected abstract int getResource(int[] numLayers); |
1387 | 1390 |
protected abstract ObjectType intGetObjectType(int[] numLayers); |
1388 | 1391 |
|
... | ... | |
1404 | 1407 |
public abstract float[][] getCubitPositions(int[] numLayers); |
1405 | 1408 |
public abstract Static4D getQuat(int cubit, int[] numLayers); |
1406 | 1409 |
public abstract int[] getSolvedQuats(int cubit, int[] numLayers); |
1410 |
public abstract int getCubitFaceColor(int cubit, int face, int[] numLayers); |
|
1411 |
public abstract int getVariantFaceColor(int variant, int face, int[] numLayers); |
|
1412 |
public abstract int getNumFaceColors(); |
|
1413 |
public abstract int getNumCubitFaces(); |
|
1407 | 1414 |
|
1408 |
|
|
1415 |
// not only for JSON |
|
1409 | 1416 |
public abstract Static3D[] getRotationAxis(); |
1410 | 1417 |
public abstract int[] getBasicAngle(); |
1411 | 1418 |
public abstract int getNumFaces(); |
Also available in: Unified diff
Separate the notions of a sticker shape and a sticker color.