Project

General

Profile

« Previous | Next » 

Revision 0a046359

Added by Leszek Koltunski over 7 years ago

The EffectQueues are now totally independent of the size of the underlying Bitmap.

View differences:

src/main/java/org/distorted/library/EffectQueue.java
31 31
  {
32 32
  protected byte mNumEffects;   // number of effects at the moment
33 33
  protected long mTotalEffects; // total number of effects ever created
34
  
35 34
  protected int[] mName;
36 35
  protected float[] mUniforms;
36
  protected float[] mCache;
37 37
  protected Dynamic[][] mInter;
38 38
  protected long[] mCurrentDuration;
39 39
  protected byte[] mFreeIndexes;
40 40
  protected byte[] mIDIndex;
41 41
  protected long[] mID;
42
  
43 42
  protected long mTime=0;
44
  protected float mObjHalfX, mObjHalfY, mObjHalfZ;
45
  
46 43
  protected static int[] mMax = new int[EffectTypes.LENGTH];
47 44
  protected int mMaxIndex;
48

  
49 45
  protected Vector<EffectListener> mListeners =null;
50 46
  protected int mNumListeners=0;  // ==mListeners.length(), but we only create mListeners if the first one gets added
51 47
  protected long mObjectID;
......
59 55
  
60 56
///////////////////////////////////////////////////////////////////////////////////////////////////
61 57
   
62
  EffectQueue(DistortedObject obj, int numUniforms, int index)
58
  EffectQueue(long id, int numUniforms, int numCache, int index)
63 59
    {
64 60
    mNumEffects   = 0;
65 61
    mTotalEffects = 0;
66 62
    mMaxIndex     = index;
67

  
68
    if( obj!=null )
69
      {
70
      mObjHalfX = obj.getWidth() / 2.0f;
71
      mObjHalfY = obj.getHeight()/ 2.0f;
72
      mObjHalfZ = obj.getDepth() / 2.0f;
73
      mObjectID = obj.getID();
74
      }
63
    mObjectID     = id;
75 64

  
76 65
    if( mMax[mMaxIndex]>0 )
77 66
      {
......
84 73
      mFreeIndexes     = new byte[mMax[mMaxIndex]];
85 74
     
86 75
      for(byte i=0; i<mMax[mMaxIndex]; i++) mFreeIndexes[i] = i;
76

  
77
      if( numCache>0 )
78
        {
79
        mCache = new float[numCache*mMax[mMaxIndex]];
80
        }
87 81
      }
88 82
   
89 83
    mCreated = true;  

Also available in: Unified diff