Revision 6bb59aad
Added by Leszek Koltunski almost 7 years ago
src/main/java/org/distorted/library/effect/Effect.java | ||
---|---|---|
29 | 29 |
private final int mDimension; |
30 | 30 |
private final boolean mSupportsR; |
31 | 31 |
private final boolean mSupportsC; |
32 |
private final String mStr; |
|
32 | 33 |
|
33 | 34 |
private static long mNextID = 0; |
34 | 35 |
|
... | ... | |
39 | 40 |
|
40 | 41 |
public static final int LENGTH = 4; // The number of effect types above. |
41 | 42 |
public static final int MASK= (1<<LENGTH)-1; // Needed when we do bitwise operations on Effect Types. |
43 |
static final int MAX_EFFECTS = 1000; // The can be no more than MAX_EFFECTS effects of a given type. |
|
42 | 44 |
|
43 | 45 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
44 | 46 |
|
... | ... | |
61 | 63 |
maxtable[3] = PostprocessEffect.MAX; |
62 | 64 |
} |
63 | 65 |
|
66 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
67 |
|
|
68 |
public static int getType(int name) |
|
69 |
{ |
|
70 |
return name/MAX_EFFECTS; |
|
71 |
} |
|
72 |
|
|
64 | 73 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
65 | 74 |
|
66 | 75 |
public int getType() |
... | ... | |
82 | 91 |
return mID; |
83 | 92 |
} |
84 | 93 |
|
94 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
95 |
|
|
96 |
public String getString() |
|
97 |
{ |
|
98 |
return mStr; |
|
99 |
} |
|
100 |
|
|
85 | 101 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
86 | 102 |
|
87 | 103 |
public boolean supportsCenter() |
... | ... | |
105 | 121 |
|
106 | 122 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
107 | 123 |
|
108 |
Effect(int type, int name, int dimension, boolean center, boolean region) |
|
124 |
Effect(int type, int name, int dimension, boolean center, boolean region, final String str)
|
|
109 | 125 |
{ |
110 | 126 |
mID = mNextID++; |
111 | 127 |
|
... | ... | |
114 | 130 |
mDimension = dimension; |
115 | 131 |
mSupportsC = center; |
116 | 132 |
mSupportsR = region; |
133 |
mStr = str; |
|
117 | 134 |
} |
118 | 135 |
} |
Also available in: Unified diff
Progress with support for Effect classes.