Revision 5e254115
Added by Leszek Koltunski over 3 years ago
src/main/java/org/distorted/objects/TwistyBandagedAbstract.java | ||
---|---|---|
433 | 433 |
return reaches ? stickerIndex*NUM_FACES + face : NUM_STICKERS*NUM_FACES; |
434 | 434 |
} |
435 | 435 |
|
436 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
437 |
// this implements the fact that certain cubits have multiple 'centers' and this means the cubit |
|
438 |
// might span more than one layer along a given axis - i.e. that this is a bandaged puzzle. |
|
439 |
|
|
440 |
int computeBitmapFromRow(int rowBitmap, int axis) |
|
441 |
{ |
|
442 |
int bitmap, initBitmap=0; |
|
443 |
|
|
444 |
while( initBitmap!=rowBitmap ) |
|
445 |
{ |
|
446 |
initBitmap = rowBitmap; |
|
447 |
|
|
448 |
for(int cubit=0; cubit<NUM_CUBITS; cubit++) |
|
449 |
{ |
|
450 |
bitmap = CUBITS[cubit].mRotationRow[axis]; |
|
451 |
if( (rowBitmap & bitmap) != 0 ) rowBitmap |= bitmap; |
|
452 |
} |
|
453 |
} |
|
454 |
|
|
455 |
return rowBitmap; |
|
456 |
} |
|
457 |
|
|
458 | 436 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
459 | 437 |
|
460 | 438 |
float returnMultiplier() |
src/main/java/org/distorted/objects/TwistyObject.java | ||
---|---|---|
116 | 116 |
private final DistortedTexture mTexture; |
117 | 117 |
private final float mInitScreenRatio; |
118 | 118 |
private final int mSolvedFunctionIndex; |
119 |
private final boolean mIsBandaged; |
|
119 | 120 |
private float mObjectScreenRatio; |
120 | 121 |
private int[][] mSolvedQuats; |
121 | 122 |
private int[][] mQuatMult; |
... | ... | |
163 | 164 |
NUM_TEXTURES = getNumStickerTypes(mNumLayers)*NUM_FACES; |
164 | 165 |
NUM_AXIS = mAxis.length; |
165 | 166 |
|
167 |
boolean bandaged=false; |
|
168 |
|
|
169 |
for(int c=0; c<NUM_CUBITS; c++) |
|
170 |
{ |
|
171 |
if( mOrigPos[c].length>3 ) |
|
172 |
{ |
|
173 |
bandaged=true; |
|
174 |
break; |
|
175 |
} |
|
176 |
} |
|
177 |
|
|
178 |
mIsBandaged = bandaged; |
|
179 |
|
|
166 | 180 |
mQuatDebug = new int[NUM_CUBITS]; |
167 | 181 |
|
168 | 182 |
if( mObjectScreenRatio>MAX_SIZE_CHANGE) mObjectScreenRatio = MAX_SIZE_CHANGE; |
... | ... | |
655 | 669 |
} |
656 | 670 |
|
657 | 671 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
658 |
// normal, not bandaged, object. |
|
659 | 672 |
|
660 | 673 |
int computeBitmapFromRow(int rowBitmap, int axis) |
661 | 674 |
{ |
675 |
if( mIsBandaged ) |
|
676 |
{ |
|
677 |
int bitmap, initBitmap=0; |
|
678 |
|
|
679 |
while( initBitmap!=rowBitmap ) |
|
680 |
{ |
|
681 |
initBitmap = rowBitmap; |
|
682 |
|
|
683 |
for(int cubit=0; cubit<NUM_CUBITS; cubit++) |
|
684 |
{ |
|
685 |
bitmap = CUBITS[cubit].mRotationRow[axis]; |
|
686 |
if( (rowBitmap & bitmap) != 0 ) rowBitmap |= bitmap; |
|
687 |
} |
|
688 |
} |
|
689 |
} |
|
690 |
|
|
662 | 691 |
return rowBitmap; |
663 | 692 |
} |
664 | 693 |
|
src/main/java/org/distorted/objects/TwistySquare1.java | ||
---|---|---|
275 | 275 |
return mStickerType[variant][cubitface]*FACE_COLORS.length + mStickerColor[cubit][cubitface]; |
276 | 276 |
} |
277 | 277 |
|
278 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
279 |
// this implements the fact that corner cubits have multiple 'centers' and this means the cubit |
|
280 |
// might span more than one layer along a given axis - i.e. that this is a bandaged puzzle. |
|
281 |
|
|
282 |
int computeBitmapFromRow(int rowBitmap, int axis) |
|
283 |
{ |
|
284 |
int bitmap, initBitmap=0; |
|
285 |
|
|
286 |
while( initBitmap!=rowBitmap ) |
|
287 |
{ |
|
288 |
initBitmap = rowBitmap; |
|
289 |
|
|
290 |
for(int cubit=0; cubit<NUM_CUBITS; cubit++) |
|
291 |
{ |
|
292 |
bitmap = CUBITS[cubit].mRotationRow[axis]; |
|
293 |
if( (rowBitmap & bitmap) != 0 ) rowBitmap |= bitmap; |
|
294 |
} |
|
295 |
} |
|
296 |
|
|
297 |
return rowBitmap; |
|
298 |
} |
|
299 |
|
|
300 | 278 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
301 | 279 |
|
302 | 280 |
private boolean cornerIsUp(int index) |
Also available in: Unified diff
auto-compute the bandaged status from dimension of the CENTERS. Make 'computeBitmapFromRow' generic for bandageed and not bandaged objects.