Project

General

Profile

« Previous | Next » 

Revision 063ae851

Added by Leszek Koltunski almost 2 years ago

Minor.

View differences:

src/main/java/org/distorted/overlays/OverlayStars.java
48 48
public class OverlayStars extends OverlayGeneric implements EffectListener
49 49
{
50 50
   private static final int DUR_APP =  1500;
51
   private static final int DUR_MOV =  3000;
51
   private static final int DUR_MOV =  13000;
52 52
   private static final int DUR_GLO =   600;
53 53

  
54 54
   private ListenerOverlay mListener;
......
75 75
      Dynamic3D move = new Dynamic3D();
76 76
      move.setMode(Dynamic.MODE_PATH);
77 77
      move.setDuration(DUR_MOV);
78
      move.setCount(0.40f);
78
      move.setCount( mNewStars>0 ? 0.40f : 0.50f );
79 79

  
80 80
      float widthS = (mRandom.nextFloat()-0.5f)*mWidth*1.10f;
81 81
      float widthM = widthS + (mRandom.nextFloat()-0.5f)*mWidth*0.2f;
82 82
      float heighS = mRandom.nextFloat()*mHeight*0.2f;
83 83
      float heighM = (mRandom.nextFloat()-0.5f)*mHeight*0.2f;
84 84

  
85
      Static3D pointS = new Static3D(widthS,mHeight*0.55f+heighS,0);
85
      Static3D pointS = new Static3D(0,mHeight*0.55f+heighS,0);
86 86
      Static3D pointM = new Static3D(widthM,mHeight*0.25f+heighM,0);
87 87
      Static3D pointE = new Static3D(0,0,0);
88 88
      Static3D pointF = new Static3D(0,0,-10000);
......
117 117
         mAlphaStrength.setCount(0.5f);
118 118
         equipAlpha(mAlphaStrength,appear);
119 119
         mAlpha = new FragmentEffectAlpha(mAlphaStrength);
120

  
121
         if( mNewStars==0 )
122
            {
123
            mMoveID = mAlpha.getID();
124
            mAlpha.notifyWhenFinished(this);
125
            }
120 126
         }
121 127
      else
122 128
         {
......
270 276
      mListener= listener;
271 277
      DataStars stars = (DataStars)data;
272 278
      mTotalStars = stars.getTotal();
273
      mNewStars   = stars.getNew();
279
      mNewStars   = -stars.getNew();
274 280
      Resources res = stars.getResources();
275 281
      mWidth = mScreen.getWidth();
276 282
      mHeight= mScreen.getHeight();
......
278 284
      if( !mIncrease ) mNewStars = -mNewStars;
279 285

  
280 286
      createBitmap(res, mTotalStars);
281
      mNodeFalling = createNodeFalling(mIncrease);
282
      mNodeFalling.enableDepthStencil(InternalOutputSurface.NO_DEPTH_NO_STENCIL);
283
      mScreen.attach(mNodeFalling);
287

  
288
      if( mNewStars!=0 )
289
         {
290
         mNodeFalling = createNodeFalling(mIncrease);
291
         mNodeFalling.enableDepthStencil(InternalOutputSurface.NO_DEPTH_NO_STENCIL);
292
         mScreen.attach(mNodeFalling);
293
         }
294

  
284 295
      mNodeCentral = createNodeCentral(mTotalStars);
285 296
      mNodeCentral.glDepthMask(false);
286 297
      mScreen.attach(mNodeCentral);
......
355 366
         mScreen.detach(mNodeCentral);
356 367
         mNodeCentral.markForDeletion();
357 368
         mNodeCentral=null;
358
         mScreen.detach(mNodeFalling);
359
         mNodeFalling.markForDeletion();
360
         mNodeFalling=null;
369

  
370
         if( mNodeFalling!=null )
371
            {
372
            mScreen.detach(mNodeFalling);
373
            mNodeFalling.markForDeletion();
374
            mNodeFalling=null;
375
            }
376

  
361 377
         mListener.overlayFinished(id);
362 378
         }
363 379
      }

Also available in: Unified diff