Revision 0351740a
Added by Leszek Koltunski over 2 years ago
src/main/java/org/distorted/objectlib/helpers/FactorySticker.java | ||
---|---|---|
19 | 19 |
|
20 | 20 |
package org.distorted.objectlib.helpers; |
21 | 21 |
|
22 |
import static org.distorted.objectlib.main.TwistyObject.COLOR_BLACK;
|
|
22 |
import static org.distorted.objectlib.main.TwistyObject.COLOR_INTERNAL;
|
|
23 | 23 |
import static org.distorted.objectlib.main.TwistyObject.TEXTURE_HEIGHT; |
24 | 24 |
|
25 | 25 |
import android.graphics.Canvas; |
... | ... | |
265 | 265 |
|
266 | 266 |
canvas.drawRect(left,top,left+TEXTURE_HEIGHT,top+TEXTURE_HEIGHT,paint); |
267 | 267 |
|
268 |
paint.setColor(COLOR_BLACK);
|
|
268 |
paint.setColor(COLOR_INTERNAL);
|
|
269 | 269 |
paint.setStyle(Paint.Style.STROKE); |
270 | 270 |
|
271 | 271 |
int length = vertices.length; |
src/main/java/org/distorted/objectlib/main/TwistyObject.java | ||
---|---|---|
67 | 67 |
public static final int MESH_NICE = 0; |
68 | 68 |
public static final int MESH_FAST = 1; |
69 | 69 |
|
70 |
public static final int COLOR_YELLOW = 0xffffff00; |
|
71 |
public static final int COLOR_WHITE = 0xffffffff; |
|
72 |
public static final int COLOR_BLUE = 0xff0000ff; |
|
73 |
public static final int COLOR_GREEN = 0xff00bb00; |
|
74 |
public static final int COLOR_RED = 0xff990000; |
|
75 |
public static final int COLOR_ORANGE = 0xffff6200; |
|
76 |
public static final int COLOR_GREY = 0xff727c7b; |
|
77 |
public static final int COLOR_VIOLET = 0xff7700bb; |
|
78 |
public static final int COLOR_BLACK = 0xff000000;
|
|
70 |
public static final int COLOR_YELLOW = 0xffffff00;
|
|
71 |
public static final int COLOR_WHITE = 0xffffffff;
|
|
72 |
public static final int COLOR_BLUE = 0xff0000ff;
|
|
73 |
public static final int COLOR_GREEN = 0xff00bb00;
|
|
74 |
public static final int COLOR_RED = 0xff990000;
|
|
75 |
public static final int COLOR_ORANGE = 0xffff6200;
|
|
76 |
public static final int COLOR_GREY = 0xff727c7b;
|
|
77 |
public static final int COLOR_VIOLET = 0xff7700bb;
|
|
78 |
public static final int COLOR_INTERNAL= 0xff000000;
|
|
79 | 79 |
|
80 | 80 |
public static final int TEXTURE_HEIGHT = 256; |
81 | 81 |
static final int NUM_STICKERS_IN_ROW = 4; |
... | ... | |
1092 | 1092 |
paint.setTextAlign(Paint.Align.CENTER); |
1093 | 1093 |
paint.setStyle(Paint.Style.FILL); |
1094 | 1094 |
|
1095 |
paint.setColor(COLOR_BLACK);
|
|
1095 |
paint.setColor(COLOR_INTERNAL);
|
|
1096 | 1096 |
canvas.drawRect(0, 0, mNumTexCols*TEXTURE_HEIGHT, mNumTexRows*TEXTURE_HEIGHT, paint); |
1097 | 1097 |
|
1098 | 1098 |
int texture = 0; |
src/main/java/org/distorted/objectlib/objects/TwistyMegaminx.java | ||
---|---|---|
88 | 88 |
{ |
89 | 89 |
if( mCenterCoords==null ) initializeCenterCoords(); |
90 | 90 |
float[] coords = mCenterCoords[center]; |
91 |
float A = 0.33f*numLayers;
|
|
91 |
float A = (float)numLayers/3;
|
|
92 | 92 |
|
93 | 93 |
return new float[] { A*coords[0], A*coords[1], A*coords[2] }; |
94 | 94 |
} |
... | ... | |
355 | 355 |
else |
356 | 356 |
{ |
357 | 357 |
float width = 2*numL*(MEGA_D+(0.5f-MEGA_D)*SIN18); |
358 |
final float V = 0.83f; // ?? |
|
359 |
final double ANGLE = V*Math.PI; |
|
358 |
final double ANGLE = 0.825f*Math.PI; |
|
360 | 359 |
final float cosA = (float)Math.cos(ANGLE); |
361 | 360 |
final float sinA = (float)Math.sin(ANGLE); |
362 | 361 |
|
Also available in: Unified diff
Bugfixes for the shape of Megaminxes.