Revision 253e440f
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_INTERNAL;
|
|
22 |
import static org.distorted.objectlib.main.TwistyObject.COLOR_STROKE;
|
|
23 | 23 |
import static org.distorted.objectlib.main.TwistyObject.TEXTURE_HEIGHT; |
24 | 24 |
|
25 | 25 |
import android.graphics.Canvas; |
... | ... | |
268 | 268 |
canvas.clipRect(left,top,left+TEXTURE_HEIGHT,top+TEXTURE_HEIGHT); |
269 | 269 |
canvas.drawRect(left,top,left+TEXTURE_HEIGHT,top+TEXTURE_HEIGHT,paint); |
270 | 270 |
|
271 |
paint.setColor(COLOR_INTERNAL);
|
|
271 |
paint.setColor(COLOR_STROKE);
|
|
272 | 272 |
paint.setStyle(Paint.Style.STROKE); |
273 | 273 |
|
274 | 274 |
int length = vertices.length; |
src/main/java/org/distorted/objectlib/json/JsonReader.java | ||
---|---|---|
69 | 69 |
private float mSize; |
70 | 70 |
private int mScrambleType, mNumScrambles; |
71 | 71 |
private int[] mColor; |
72 |
private int mInternalColor; |
|
72 | 73 |
private ObjectType mType; |
73 | 74 |
private boolean mResetMaps; |
74 | 75 |
|
... | ... | |
440 | 441 |
|
441 | 442 |
private void parseColors(JSONArray object) throws JSONException |
442 | 443 |
{ |
443 |
mNumFaceColors = object.length(); |
|
444 |
mNumFaceColors = object.length()-1; |
|
445 |
|
|
444 | 446 |
mColor = new int[mNumFaceColors]; |
445 | 447 |
for(int i=0; i<mNumFaceColors; i++) mColor[i] = object.getInt(i); |
448 |
|
|
449 |
mInternalColor = object.getInt(mNumFaceColors); |
|
446 | 450 |
} |
447 | 451 |
|
448 | 452 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
826 | 830 |
return mColor[face]; |
827 | 831 |
} |
828 | 832 |
|
833 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
834 |
|
|
835 |
public int getInternalColor() |
|
836 |
{ |
|
837 |
return mInternalColor; |
|
838 |
} |
|
839 |
|
|
829 | 840 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
830 | 841 |
|
831 | 842 |
public boolean shouldResetTextureMaps() |
src/main/java/org/distorted/objectlib/json/JsonWriter.java | ||
---|---|---|
514 | 514 |
int numFaceColors = object.getNumFaceColors(); |
515 | 515 |
for(int i=0; i<numFaceColors; i++) jsonColors.put(object.getColor(i)); |
516 | 516 |
|
517 |
jsonColors.put(object.getInternalColor()); |
|
518 |
|
|
517 | 519 |
return jsonColors; |
518 | 520 |
} |
519 | 521 |
|
src/main/java/org/distorted/objectlib/main/TwistyJson.java | ||
---|---|---|
122 | 122 |
return mReader.shouldResetTextureMaps(); |
123 | 123 |
} |
124 | 124 |
|
125 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
126 |
|
|
127 |
@Override |
|
128 |
public int getInternalColor() |
|
129 |
{ |
|
130 |
return mReader.getInternalColor(); |
|
131 |
} |
|
132 |
|
|
125 | 133 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
126 | 134 |
|
127 | 135 |
public void setReader(JsonReader reader) |
src/main/java/org/distorted/objectlib/main/TwistyObject.java | ||
---|---|---|
77 | 77 |
public static final int COLOR_ORANGE = 0xffff6200; |
78 | 78 |
public static final int COLOR_GREY = 0xff727c7b; |
79 | 79 |
public static final int COLOR_VIOLET = 0xff7700bb; |
80 |
public static final int COLOR_INTERNAL= 0xff000000; |
|
80 |
public static final int COLOR_STROKE = 0xff000000; |
|
81 |
private static final int COLOR_INTERNAL= 0xff222222; |
|
81 | 82 |
|
82 | 83 |
public static final int TEXTURE_HEIGHT = 256; |
83 | 84 |
static final int NUM_STICKERS_IN_ROW = 4; |
... | ... | |
1251 | 1252 |
return mObjectQuats; |
1252 | 1253 |
} |
1253 | 1254 |
|
1255 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
1256 |
|
|
1257 |
public int getInternalColor() |
|
1258 |
{ |
|
1259 |
return COLOR_INTERNAL; |
|
1260 |
} |
|
1261 |
|
|
1254 | 1262 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
1255 | 1263 |
// the getFaceColors + final black in a grid (so that we do not exceed the maximum texture size) |
1256 | 1264 |
|
... | ... | |
1264 | 1272 |
paint.setTextAlign(Paint.Align.CENTER); |
1265 | 1273 |
paint.setStyle(Paint.Style.FILL); |
1266 | 1274 |
|
1267 |
paint.setColor(COLOR_INTERNAL);
|
|
1275 |
paint.setColor(getInternalColor());
|
|
1268 | 1276 |
canvas.drawRect(0, 0, mNumTexCols*TEXTURE_HEIGHT, mNumTexRows*TEXTURE_HEIGHT, paint); |
1269 | 1277 |
|
1270 | 1278 |
int texture = 0; |
src/main/java/org/distorted/objectlib/objects/TwistyContainer.java | ||
---|---|---|
23 | 23 |
import org.distorted.library.type.Static4D; |
24 | 24 |
import org.distorted.objectlib.helpers.ObjectFaceShape; |
25 | 25 |
import org.distorted.objectlib.helpers.ObjectShape; |
26 |
import org.distorted.objectlib.helpers.QuatGroupGenerator; |
|
27 | 26 |
import org.distorted.objectlib.helpers.ScrambleState; |
28 | 27 |
import org.distorted.objectlib.main.ObjectControl; |
29 | 28 |
import org.distorted.objectlib.main.ObjectType; |
... | ... | |
50 | 49 |
private ScrambleState[] mStates; |
51 | 50 |
private int[] mBasicAngle; |
52 | 51 |
private float[][] mCuts; |
53 |
private int[] mRotQuat; |
|
54 | 52 |
|
55 | 53 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
56 | 54 |
|
... | ... | |
59 | 57 |
super(numL, meshState, numL[0], quat, move, scale, stream); |
60 | 58 |
} |
61 | 59 |
|
60 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
61 |
|
|
62 |
@Override |
|
63 |
public int getInternalColor() |
|
64 |
{ |
|
65 |
return 0xff999999; |
|
66 |
} |
|
67 |
|
|
62 | 68 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
63 | 69 |
|
64 | 70 |
public ScrambleState[] getScrambleStates() |
src/main/java/org/distorted/objectlib/objects/TwistyMirror.java | ||
---|---|---|
63 | 63 |
super(numL, meshState, numL[0], quat, move, scale, stream); |
64 | 64 |
} |
65 | 65 |
|
66 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
67 |
|
|
68 |
@Override |
|
69 |
public int getInternalColor() |
|
70 |
{ |
|
71 |
return 0xff333333; |
|
72 |
} |
|
73 |
|
|
66 | 74 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
67 | 75 |
|
68 | 76 |
@Override |
Also available in: Unified diff
Configurable internal colors. This somehow screwed up the Container!