Revision 1a106eb8
Added by Leszek Koltunski over 3 years ago
| src/main/java/org/distorted/bandaged/BandagedCreatorRenderer.java | ||
|---|---|---|
| 29 | 29 |
|
| 30 | 30 |
import org.distorted.dialogs.RubikDialogBandagedSave; |
| 31 | 31 |
import org.distorted.library.effect.EffectType; |
| 32 |
import org.distorted.library.effect.FragmentEffectBrightness; |
|
| 32 | 33 |
import org.distorted.library.effect.PostprocessEffectBorder; |
| 33 | 34 |
import org.distorted.library.effect.VertexEffectDeform; |
| 34 | 35 |
import org.distorted.library.main.DistortedEffects; |
| ... | ... | |
| 61 | 62 |
public static final float BRIGHTNESS = 0.333f; |
| 62 | 63 |
private static final int DURATION = 1000; |
| 63 | 64 |
|
| 64 |
private static final int COLOR_DEFAULT = 0xffffff55; |
|
| 65 |
private static final int COLOR_MARKED = 0xffff0000; |
|
| 66 |
|
|
| 67 | 65 |
static final float SCREEN_RATIO = 0.5f; |
| 68 | 66 |
static final float OBJECT_SIZE = 3.0f; |
| 69 | 67 |
|
| ... | ... | |
| 162 | 160 |
|
| 163 | 161 |
for(int c=0; c<len; c++) |
| 164 | 162 |
{
|
| 165 |
cubits[c] = new BandagedCubit(POSITIONS[c],mQuatT,mQuatA,mScale,COLOR_DEFAULT,roundCorners);
|
|
| 163 |
cubits[c] = new BandagedCubit(POSITIONS[c],mQuatT,mQuatA,mScale,roundCorners); |
|
| 166 | 164 |
} |
| 167 | 165 |
|
| 168 | 166 |
return cubits; |
| ... | ... | |
| 181 | 179 |
if( !mCubits[c].isAttached() ) |
| 182 | 180 |
{
|
| 183 | 181 |
mCubits[c].attach(); |
| 184 |
mCubits[c].setTexture( COLOR_DEFAULT);
|
|
| 182 |
mCubits[c].setUnmarked();
|
|
| 185 | 183 |
mScreen.attach(mCubits[c].getNode()); |
| 186 | 184 |
} |
| 187 | 185 |
if( mCubits[c].getPosition().length>3 ) |
| ... | ... | |
| 262 | 260 |
if( mCubits[i].isAttached() ) |
| 263 | 261 |
{
|
| 264 | 262 |
mCubits[i].scaleMove(mScaleValue); |
| 265 |
mCubits[i].setTexture( touched==i ? COLOR_MARKED : COLOR_DEFAULT); |
|
| 263 |
if( touched==i ) mCubits[i].setMarked(); |
|
| 264 |
else mCubits[i].setUnmarked(); |
|
| 266 | 265 |
DistortedNode node = mCubits[i].getNode(); |
| 267 | 266 |
mScreen.attach(node); |
| 268 | 267 |
} |
| ... | ... | |
| 281 | 280 |
MeshBase.setMaxEffComponents(50); |
| 282 | 281 |
|
| 283 | 282 |
VertexEffectDeform.enable(); |
| 283 |
FragmentEffectBrightness.enable(); |
|
| 284 | 284 |
|
| 285 | 285 |
DistortedLibrary.onSurfaceCreated(mView.getContext(),this,1); |
| 286 | 286 |
DistortedLibrary.setCull(true); |
| ... | ... | |
| 556 | 556 |
|
| 557 | 557 |
public void touchCubit(int index) |
| 558 | 558 |
{
|
| 559 |
mCubits[index].setTexture(COLOR_MARKED);
|
|
| 559 |
mCubits[index].setMarked();
|
|
| 560 | 560 |
} |
| 561 | 561 |
|
| 562 | 562 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
| 563 | 563 |
|
| 564 | 564 |
public void untouchCubit(int index) |
| 565 | 565 |
{
|
| 566 |
mCubits[index].setTexture(COLOR_DEFAULT);
|
|
| 566 |
mCubits[index].setUnmarked();
|
|
| 567 | 567 |
} |
| 568 | 568 |
} |
Also available in: Unified diff
BandagedCreator: mark cubits