Project

General

Profile

« Previous | Next » 

Revision 8badfe2a

Added by Leszek Koltunski over 3 years ago

Progress with RubikControl.

View differences:

src/main/java/org/distorted/control/RubikControlRotate.java
41 41

  
42 42
  private Dynamic3D mDynamic;
43 43
  private MatrixEffectScale mScale;
44
  private MeshQuad mQuad;
44 45

  
45 46
///////////////////////////////////////////////////////////////////////////////////////////////////
46 47

  
......
79 80
    if( mNodes==null )
80 81
      {
81 82
      mNodes = new DistortedNode[NUM_NODE];
82
      MeshQuad mesh = new MeshQuad();
83
      DistortedTexture texture = new DistortedTexture();
84
      texture.setColorARGB(0xff00ff00);
85

  
86
      mNodes[0]= new DistortedNode(texture,mEffects[0],mesh);
83
      mQuad = new MeshQuad();
87 84
      }
85

  
86
    DistortedTexture texture = new DistortedTexture();
87
    texture.setColorARGB(0xff00ff00);
88
    mNodes[0] = new DistortedNode(texture, mEffects[0], mQuad);
88 89
    }
89 90

  
90 91
///////////////////////////////////////////////////////////////////////////////////////////////////
src/main/java/org/distorted/control/RubikControlWhole.java
49 49
  private DistortedEffects[] mEffects;
50 50
  private DistortedNode[] mNodes;
51 51
  private long mEffectID;
52
  private MeshQuad mQuad;
52 53

  
53 54
  private Dynamic3D mDynamicHand1;
54 55
  private MatrixEffectMove mMoveHand1;
......
57 58

  
58 59
   private Bitmap openBitmap(RubikActivity act, int resource)
59 60
     {
60
     try(InputStream is = act.getResources().openRawResource(resource) )
61
     try( InputStream is = act.getResources().openRawResource(resource) )
61 62
       {
62 63
       return BitmapFactory.decodeStream(is);
63 64
       }
64
     catch(IOException e)
65
     catch( IOException e )
65 66
       {
66 67
       // ignore
67 68
       }
......
131 132
    if( mNodes==null )
132 133
      {
133 134
      mNodes = new DistortedNode[NUM_NODE];
134
      RubikActivity act = mControl.getActivity();
135

  
136
      if( act!=null )
137
        {
138
        MeshQuad mesh = new MeshQuad();
139

  
140
        Bitmap bmpCirc = openBitmap(act, R.drawable.ui_fading_circle);
141
        DistortedTexture textureCirc = new DistortedTexture();
142
        textureCirc.setTexture(bmpCirc);
143
        mNodes[0]= new DistortedNode(textureCirc,mEffects[0],mesh);
144
        mNodes[1]= new DistortedNode(textureCirc,mEffects[1],mesh);
145

  
146
        Bitmap bmpHand = openBitmap(act, R.drawable.ui_hand_pointer);
147
        DistortedTexture textureHand = new DistortedTexture();
148
        textureHand.setTexture(bmpHand);
149
        mNodes[2]= new DistortedNode(textureHand,mEffects[2],mesh);
150
        mNodes[3]= new DistortedNode(textureHand,mEffects[3],mesh);
151
        }
152
      else
153
        {
154
        android.util.Log.e("D", "Activity NULL!!");
155
        }
135
      mQuad  = new MeshQuad();
136
      }
137

  
138
    RubikActivity act = mControl.getActivity();
139

  
140
    if( act!=null )
141
      {
142
      Bitmap bmpCirc = openBitmap(act, R.drawable.ui_fading_circle);
143
      DistortedTexture textureCirc = new DistortedTexture();
144
      textureCirc.setTexture(bmpCirc);
145
      mNodes[0]= new DistortedNode(textureCirc,mEffects[0],mQuad);
146
      mNodes[1]= new DistortedNode(textureCirc,mEffects[1],mQuad);
147

  
148
      Bitmap bmpHand = openBitmap(act, R.drawable.ui_hand_pointer);
149
      DistortedTexture textureHand = new DistortedTexture();
150
      textureHand.setTexture(bmpHand);
151
      mNodes[2]= new DistortedNode(textureHand,mEffects[2],mQuad);
152
      mNodes[3]= new DistortedNode(textureHand,mEffects[3],mQuad);
153
      }
154
    else
155
      {
156
      android.util.Log.e("D", "Activity NULL!!");
156 157
      }
157 158
    }
158 159

  
src/main/java/org/distorted/main/RubikActivity.java
244 244
      view.initialize();
245 245
      restorePreferences();
246 246
      ScreenList.setScreen(this);
247
      unblockEverything();
247 248

  
248 249
      if( mJustStarted )
249 250
        {
......
574 575

  
575 576
      RubikPreRender pre = getPreRender();
576 577
      pre.blockEverything();
578

  
579
      RubikScreenPlay play = (RubikScreenPlay) ScreenList.PLAY.getScreenClass();
580
      play.setLockState(this);
577 581
      }
578 582

  
579 583
///////////////////////////////////////////////////////////////////////////////////////////////////
......
584 588

  
585 589
      RubikPreRender pre = getPreRender();
586 590
      pre.unblockEverything();
591

  
592
      RubikScreenPlay play = (RubikScreenPlay) ScreenList.PLAY.getScreenClass();
593
      play.setLockState(this);
587 594
      }
588 595

  
589 596
///////////////////////////////////////////////////////////////////////////////////////////////////
src/main/java/org/distorted/screens/RubikScreenBase.java
174 174
      });
175 175
    }
176 176

  
177
///////////////////////////////////////////////////////////////////////////////////////////////////
178

  
179
  public void setLockState(RubikActivity act)
180
    {
181
    mLockButton.setImageResource(getLockIcon(act));
182
    }
183

  
177 184
///////////////////////////////////////////////////////////////////////////////////////////////////
178 185

  
179 186
  public void addMove(int axis, int row, int angle)

Also available in: Unified diff