Revision 43814a57
Added by Leszek Koltunski over 3 years ago
src/main/java/org/distorted/library/main/DistortedEffects.java | ||
---|---|---|
23 | 23 |
import org.distorted.library.effect.EffectName; |
24 | 24 |
import org.distorted.library.effectqueue.EffectQueue; |
25 | 25 |
import org.distorted.library.effect.EffectType; |
26 |
import org.distorted.library.effectqueue.EffectQueueVertex; |
|
27 |
|
|
28 |
import java.util.ArrayList; |
|
29 | 26 |
|
30 | 27 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
31 | 28 |
/** |
... | ... | |
35 | 32 |
*/ |
36 | 33 |
public class DistortedEffects |
37 | 34 |
{ |
38 |
private static ArrayList<DistortedEffects> mAllEffectQueues = new ArrayList<>(); |
|
39 | 35 |
private static long mNextID =0; |
40 | 36 |
private long mID; |
41 | 37 |
private EffectQueue[] mQueues; |
... | ... | |
54 | 50 |
static void onDestroy() |
55 | 51 |
{ |
56 | 52 |
mNextID = 0; |
57 |
mAllEffectQueues.clear(); |
|
58 |
} |
|
59 |
|
|
60 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
61 |
/** |
|
62 |
* @y.exclude |
|
63 |
*/ |
|
64 |
public static void setAssociation(long effectID) |
|
65 |
{ |
|
66 |
EffectQueue[] queues; |
|
67 |
int numQueues = mAllEffectQueues.size(); |
|
68 |
|
|
69 |
for(int i=0; i<numQueues; i++) |
|
70 |
{ |
|
71 |
queues = mAllEffectQueues.get(i).getQueues(); |
|
72 |
((EffectQueueVertex)queues[1]).setAssociation(effectID); |
|
73 |
} |
|
74 | 53 |
} |
75 | 54 |
|
76 | 55 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
84 | 63 |
mID = ++mNextID; |
85 | 64 |
mQueues = new EffectQueue[EffectType.LENGTH]; |
86 | 65 |
EffectQueue.allocateQueues(mQueues,null,0); |
87 |
mAllEffectQueues.add(this); |
|
88 | 66 |
} |
89 | 67 |
|
90 | 68 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
102 | 80 |
mID = ++mNextID; |
103 | 81 |
mQueues = new EffectQueue[EffectType.LENGTH]; |
104 | 82 |
EffectQueue.allocateQueues(mQueues,dc.getQueues(),flags); |
105 |
mAllEffectQueues.add(this); |
|
106 | 83 |
} |
107 | 84 |
|
108 | 85 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
Also available in: Unified diff
Fix the fact that the static DistortedEffects.mAllQueues was global, shared between all Activities.
Completely replace this mechanism with a non-static list of links from a VertexEffect to all VertexEffectQueues this effect is a member of.