Project

General

Profile

« Previous | Next » 

Revision 0333d81e

Added by Leszek Koltunski about 4 years ago

Progress with StateSolving

View differences:

src/main/java/org/distorted/magic/RubikRenderer.java
19 19

  
20 20
package org.distorted.magic;
21 21

  
22
import android.content.SharedPreferences;
22 23
import android.opengl.GLSurfaceView;
23 24

  
24 25
import org.distorted.effect.BaseEffect;
......
33 34
import org.distorted.object.RubikObject;
34 35
import org.distorted.uistate.RubikState;
35 36
import org.distorted.uistate.RubikStatePlay;
37
import org.distorted.uistate.RubikStateSolving;
36 38

  
37 39
import javax.microedition.khronos.egl.EGLConfig;
38 40
import javax.microedition.khronos.opengles.GL10;
......
133 135
       }
134 136
     }
135 137

  
138
///////////////////////////////////////////////////////////////////////////////////////////////////
139

  
140
   void savePreferences(SharedPreferences.Editor editor)
141
     {
142
     android.util.Log.e("renderer", "saving prefs");
143

  
144
     //editor.putInt("state", mCurrentState.ordinal() );
145
     }
146

  
147
///////////////////////////////////////////////////////////////////////////////////////////////////
148

  
149
   void restorePreferences(SharedPreferences preferences)
150
     {
151
     android.util.Log.e("renderer", "restoring prefs");
152

  
153
     //int stateOrdinal = preferences.getInt("state", RubikState.MAIN.ordinal() );
154
     }
155

  
136 156
///////////////////////////////////////////////////////////////////////////////////////////////////
137 157
// no this will not race with onDrawFrame
138 158

  
......
242 262

  
243 263
       if( solved && !mIsSolved )
244 264
         {
245
         mCanDrag        = true;
246
         mCanRotate      = false;
247
         mCanUI          = false;
265
         if( RubikState.getCurrentState()==RubikState.SOLV )
266
           {
267
           RubikStateSolving solving = (RubikStateSolving)RubikState.SOLV.getStateClass();
268
           long time = solving.stopCounting();
269
           android.util.Log.e("renderer", "solving time: "+time+" milliseconds");
270
           }
271

  
272
         mCanDrag   = true;
273
         mCanRotate = false;
274
         mCanUI     = false;
248 275
         doEffectNow( BaseEffect.Type.WIN );
249 276
         }
250 277
       else

Also available in: Unified diff