Project

General

Profile

« Previous | Next » 

Revision 55acff1e

Added by Leszek Koltunski 2 months ago

progress with configurable stickers

View differences:

src/main/java/org/distorted/objectlib/main/ObjectControl.java
899 899
      mPreRender.setTextureMap(cubit,face,newColor);
900 900
      }
901 901

  
902
///////////////////////////////////////////////////////////////////////////////////////////////////
903

  
904
    public void repaintPuzzleFace(int cubit, int face, int color)
905
      {
906
      mPreRender.repaintPuzzleFace(cubit,face,color);
907
      }
908

  
902 909
///////////////////////////////////////////////////////////////////////////////////////////////////
903 910

  
904 911
    public boolean onTouchEvent(int mode)
src/main/java/org/distorted/objectlib/main/ObjectPreRender.java
45 45
  private boolean mFinishRotation, mRemoveManualRotation, mRemoveProgramaticRotation, mAddRotation,
46 46
                  mSetQuat, mChangeObject, mSolveObject, mScrambleObject, mFastScrambleObject,
47 47
                  mPresentObject,mInitializeObject, mSetTextureMap, mResetAllTextureMaps, mSolve,
48
                  mApplyScrambles, mResetTextureEffect;
48
                  mApplyScrambles, mResetTextureEffect, mRepaintPuzzleFace;
49 49
  private boolean mScramblingAndSolvingBlocked, mRotationBlocked, mIsSolved;
50 50
  private long mRotationFinishedID;
51 51
  private final long[] mEffectID;
......
83 83
    mFastScrambleObject   = false;
84 84
    mPresentObject        = false;
85 85
    mResetTextureEffect   = false;
86
    mRepaintPuzzleFace    = false;
86 87

  
87 88
    mOldObject = null;
88 89
    mNewObject = null;
......
380 381
  private void setTextureMapNow()
381 382
    {
382 383
    mSetTextureMap = false;
383

  
384 384
    if( mNewObject!=null ) mNewObject.setTextureMap(mCubit,mFace,mNewColor);
385 385
    }
386 386

  
387
///////////////////////////////////////////////////////////////////////////////////////////////////
388

  
389
  private void repaintPuzzleFaceNow()
390
    {
391
    mRepaintPuzzleFace = false;
392
    if( mNewObject!=null ) mNewObject.repaintPuzzleFace(mCubit,mFace,mNewColor);
393
    }
394

  
387 395
///////////////////////////////////////////////////////////////////////////////////////////////////
388 396

  
389 397
  private void resetAllTextureMapsNow()
......
462 470
    mNewColor = newColor;
463 471
    }
464 472

  
473
///////////////////////////////////////////////////////////////////////////////////////////////////
474

  
475
  public void repaintPuzzleFace(int cubit, int face, int newColor)
476
    {
477
    mRepaintPuzzleFace = true;
478

  
479
    mCubit    = cubit;
480
    mFace     = face;
481
    mNewColor = newColor;
482
    }
483

  
465 484
///////////////////////////////////////////////////////////////////////////////////////////////////
466 485

  
467 486
  void setQuatOnNextRender()
......
624 643
    if( mResetAllTextureMaps      ) resetAllTextureMapsNow();
625 644
    if( mSetTextureMap            ) setTextureMapNow();
626 645
    if( mResetTextureEffect       ) resetTextureNow();
646
    if( mRepaintPuzzleFace        ) repaintPuzzleFaceNow();
627 647
    }
628 648

  
629 649
///////////////////////////////////////////////////////////////////////////////////////////////////
src/main/java/org/distorted/objectlib/main/TwistyObject.java
1235 1235
    mMesh.setTextureMap(maps,mNumCubitFaces*cubit+face);
1236 1236
    }
1237 1237

  
1238
///////////////////////////////////////////////////////////////////////////////////////////////////
1239
// figure out the whole face to which (cubit,face) belongs, repaint all (cubit,face) pairs to
1240
// the new color.
1241

  
1242
  void repaintPuzzleFace(int cubit, int face, int color)
1243
    {
1244
    android.util.Log.e("D", "repainting: "+cubit+" "+face+" "+color);
1245
    }
1246

  
1238 1247
///////////////////////////////////////////////////////////////////////////////////////////////////
1239 1248

  
1240 1249
  int getCubitFaceColor(int cubit, int face)

Also available in: Unified diff