Revision 6f3af598
Added by Leszek Koltunski over 2 years ago
src/main/java/org/distorted/bandaged/BandagedCreatorRenderer.java | ||
---|---|---|
61 | 61 |
public static final float BRIGHTNESS = 0.333f; |
62 | 62 |
private static final int DURATION = 1000; |
63 | 63 |
|
64 |
static final int COLOR_DEFAULT = 0xffffff55; |
|
65 |
static final int COLOR_MARKED = 0xffff0000; |
|
64 |
private static final int COLOR_DEFAULT = 0xffffff55;
|
|
65 |
private static final int COLOR_MARKED = 0xffff0000;
|
|
66 | 66 |
|
67 | 67 |
static final float SCREEN_RATIO = 0.5f; |
68 | 68 |
static final float OBJECT_SIZE = 3.0f; |
... | ... | |
551 | 551 |
|
552 | 552 |
return quotient>1.0f; |
553 | 553 |
} |
554 |
|
|
555 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
556 |
|
|
557 |
public void touchCubit(int index) |
|
558 |
{ |
|
559 |
mCubits[index].setTexture(COLOR_MARKED); |
|
560 |
} |
|
561 |
|
|
562 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
563 |
|
|
564 |
public void untouchCubit(int index) |
|
565 |
{ |
|
566 |
mCubits[index].setTexture(COLOR_DEFAULT); |
|
567 |
} |
|
554 | 568 |
} |
src/main/java/org/distorted/bandaged/BandagedCreatorTouchControl.java | ||
---|---|---|
255 | 255 |
|
256 | 256 |
return whichCubitTouched(mLastTouchedFace,mPoint2D[0],mPoint2D[1]); |
257 | 257 |
} |
258 |
|
|
259 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
260 |
|
|
261 |
public void markCubit(int index, int color) |
|
262 |
{ |
|
263 |
mCubits[index].setTexture(color); |
|
264 |
} |
|
265 | 258 |
} |
266 | 259 |
|
src/main/java/org/distorted/bandaged/BandagedCreatorView.java | ||
---|---|---|
117 | 117 |
|
118 | 118 |
public void resetCubits() |
119 | 119 |
{ |
120 |
if( mTouchedIndex1>=0 ) mTouchControl.markCubit(mTouchedIndex1, BandagedCreatorRenderer.COLOR_DEFAULT);
|
|
121 |
if( mTouchedIndex2>=0 ) mTouchControl.markCubit(mTouchedIndex2, BandagedCreatorRenderer.COLOR_DEFAULT);
|
|
120 |
if( mTouchedIndex1>=0 ) mRenderer.untouchCubit(mTouchedIndex1);
|
|
121 |
if( mTouchedIndex2>=0 ) mRenderer.untouchCubit(mTouchedIndex2);
|
|
122 | 122 |
|
123 | 123 |
mTouchedIndex1 = -1; |
124 | 124 |
mTouchedIndex2 = -1; |
... | ... | |
164 | 164 |
if( mTouchedIndex1<0 ) |
165 | 165 |
{ |
166 | 166 |
mTouchedIndex1 = index; |
167 |
mTouchControl.markCubit(mTouchedIndex1, BandagedCreatorRenderer.COLOR_MARKED);
|
|
167 |
mRenderer.touchCubit(mTouchedIndex1);
|
|
168 | 168 |
} |
169 | 169 |
else |
170 | 170 |
{ |
... | ... | |
172 | 172 |
|
173 | 173 |
if( mTouchedIndex1 != index ) |
174 | 174 |
{ |
175 |
mTouchControl.markCubit(mTouchedIndex2, BandagedCreatorRenderer.COLOR_MARKED);
|
|
175 |
mRenderer.touchCubit(mTouchedIndex2);
|
|
176 | 176 |
} |
177 | 177 |
} |
178 | 178 |
} |
... | ... | |
208 | 208 |
|
209 | 209 |
case MotionEvent.ACTION_UP : if( mTouchedIndex2>=0 ) |
210 | 210 |
{ |
211 |
mTouchControl.markCubit(mTouchedIndex1, BandagedCreatorRenderer.COLOR_DEFAULT); |
|
212 |
mTouchControl.markCubit(mTouchedIndex2, BandagedCreatorRenderer.COLOR_DEFAULT); |
|
213 |
|
|
211 |
mRenderer.untouchCubit(mTouchedIndex1); |
|
212 |
mRenderer.untouchCubit(mTouchedIndex2); |
|
214 | 213 |
mRenderer.tryConnectingCubits(mTouchedIndex1,mTouchedIndex2); |
215 |
|
|
216 | 214 |
mTouchedIndex1 = -1; |
217 | 215 |
mTouchedIndex2 = -1; |
218 | 216 |
} |
Also available in: Unified diff
Minor.