Project

General

Profile

« Previous | Next » 

Revision 6828c498

Added by Leszek Koltunski almost 2 years ago

fix showing the number of stars on app startup.

View differences:

src/main/java/org/distorted/main/RubikActivity.java
50 50
import org.distorted.external.RubikNetwork;
51 51
import org.distorted.objects.RubikObject;
52 52
import org.distorted.objects.RubikObjectList;
53
import org.distorted.overlays.DataStars;
54
import org.distorted.overlays.OverlayStars;
55 53
import org.distorted.purchase.PurchaseActivity;
56 54
import org.distorted.screens.RubikScreenSolving;
57 55
import org.distorted.screens.ScreenList;
......
290 288
        }
291 289
      else
292 290
        {
293
        RubikScores scores = RubikScores.getInstance();
294
        int totStars = scores.getNumStars();
295
        DistortedScreen screen = getScreen();
296
        OverlayStars stars = new OverlayStars();
297
        DataStars data = new DataStars(totStars,0,getResources());
298
        stars.startOverlay(screen,null,data);
291
        view.setShowStars();
299 292
        }
300 293
      }
301 294

  
src/main/java/org/distorted/main/RubikSurfaceView.java
20 20

  
21 21
import com.google.firebase.crashlytics.FirebaseCrashlytics;
22 22

  
23
import org.distorted.external.RubikScores;
24
import org.distorted.library.main.DistortedScreen;
23 25
import org.distorted.objectlib.main.ObjectControl;
24 26
import org.distorted.objectlib.main.TwistyObjectNode;
25

  
27
import org.distorted.overlays.DataStars;
28
import org.distorted.overlays.OverlayStars;
26 29
import org.distorted.screens.ScreenList;
27 30

  
28 31
///////////////////////////////////////////////////////////////////////////////////////////////////
......
33 36
    private RubikRenderer mRenderer;
34 37
    private int mScreenWidth, mScreenHeight;
35 38
    private boolean mCreated;
39
    private boolean mShowStars;
36 40

  
37 41
///////////////////////////////////////////////////////////////////////////////////////////////////
38 42

  
......
50 54
        objectNode.glDepthMask(false);
51 55
        objectNode.glStencilMask(0);
52 56
        mRenderer.getScreen().attach(objectNode);
57

  
58
        if( mShowStars )
59
          {
60
          mShowStars = false;
61
          RubikScores scores = RubikScores.getInstance();
62
          int totStars = scores.getNumStars();
63
          DistortedScreen screen = mRenderer.getScreen();
64
          OverlayStars stars = new OverlayStars();
65
          DataStars data = new DataStars(totStars,0,getResources());
66
          stars.startOverlay(screen,null,data);
67
          }
53 68
        }
54 69
      }
55 70

  
71
///////////////////////////////////////////////////////////////////////////////////////////////////
72

  
73
    void setShowStars()
74
      {
75
      mShowStars = true;
76
      }
77

  
56 78
///////////////////////////////////////////////////////////////////////////////////////////////////
57 79

  
58 80
    boolean isVertical()
......
83 105
      super(context,attrs);
84 106

  
85 107
      mCreated = false;
108
      mShowStars = false;
86 109

  
87 110
      if(!isInEditMode())
88 111
        {
src/main/java/org/distorted/overlays/OverlayStars.java
113 113
         {
114 114
         mAlphaStrength = new Dynamic1D();
115 115
         mAlphaStrength.setMode(Dynamic.MODE_PATH);
116
         mAlphaStrength.setDuration(DUR_APP);
116
         mAlphaStrength.setDuration( mNewStars==0 ? 3*DUR_APP : DUR_APP);
117 117
         mAlphaStrength.setCount(0.5f);
118 118
         equipAlpha(mAlphaStrength,appear);
119 119
         mAlpha = new FragmentEffectAlpha(mAlphaStrength);
......
143 143
      if( appear )
144 144
        {
145 145
        alpha.add(point0);
146
        if( mNewStars==0 ) alpha.add(point1);
146 147
        alpha.add(point1);
147 148
        }
148 149
      else
149 150
        {
150 151
        alpha.add(point1);
152
        if( mNewStars==0 ) alpha.add(point1);
151 153
        alpha.add(point0);
152 154
        }
153 155
      }
......
303 305

  
304 306
   private PostprocessEffectGlow constructGlow(boolean firstPhase)
305 307
      {
306
      Dynamic2D haloRadius = new Dynamic2D(DUR_GLO,0.5f);
308
      Dynamic2D haloRadius = new Dynamic2D( mNewStars==0 ? 2*DUR_GLO : DUR_GLO,0.5f);
307 309
      Static2D point20 = new Static2D( 0, 0);
308 310
      Static2D point21 = new Static2D(15,50);
309 311
      Dynamic4D color = new Dynamic4D(DUR_GLO, 0.5f);

Also available in: Unified diff