Revision 1e438fc7
Added by Leszek Koltunski almost 8 years ago
src/main/java/org/distorted/library/EffectListVertex.java | ||
---|---|---|
6 | 6 |
|
7 | 7 |
class EffectListVertex extends EffectList |
8 | 8 |
{ |
9 |
private static final int NUM_UNIFORMS = 9; |
|
9 |
private static final int NUM_UNIFORMS = 9; |
|
10 |
private static final int INDEX = EffectTypes.VERTEX.ordinal(); |
|
10 | 11 |
private static int mNumEffectsH; |
11 | 12 |
private static int mTypeH; |
12 | 13 |
private static int mUniformsH; |
... | ... | |
15 | 16 |
|
16 | 17 |
public EffectListVertex(DistortedObject obj) |
17 | 18 |
{ |
18 |
super(obj,NUM_UNIFORMS,VERTEX);
|
|
19 |
super(obj,NUM_UNIFORMS,INDEX);
|
|
19 | 20 |
} |
20 | 21 |
|
21 | 22 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
24 | 25 |
|
25 | 26 |
static boolean setMax(int m) |
26 | 27 |
{ |
27 |
if( (mCreated==false && !Distorted.isInitialized()) || m<=mMax[VERTEX] )
|
|
28 |
if( (mCreated==false && !Distorted.isInitialized()) || m<=mMax[INDEX] )
|
|
28 | 29 |
{ |
29 | 30 |
if( m<0 ) m = 0; |
30 | 31 |
else if( m>Byte.MAX_VALUE ) m = Byte.MAX_VALUE; |
31 | 32 |
|
32 |
mMax[VERTEX] = m;
|
|
33 |
mMax[INDEX] = m;
|
|
33 | 34 |
return true; |
34 | 35 |
} |
35 | 36 |
|
... | ... | |
40 | 41 |
|
41 | 42 |
static int getMax() |
42 | 43 |
{ |
43 |
return mMax[VERTEX];
|
|
44 |
return mMax[INDEX];
|
|
44 | 45 |
} |
45 | 46 |
|
46 | 47 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
77 | 78 |
for(int j=0; j<mNumListeners; j++) |
78 | 79 |
EffectMessageSender.newMessage( mListeners.elementAt(j), |
79 | 80 |
EffectMessage.EFFECT_FINISHED, |
80 |
(mID[i]<<DistortedObject.TYPE_NUM)+Distorted.TYPE_VERT,
|
|
81 |
(mID[i]<<EffectTypes.LENGTH)+EffectTypes.VERTEX.type,
|
|
81 | 82 |
mType[i], |
82 | 83 |
mBitmapID); |
83 | 84 |
|
... | ... | |
154 | 155 |
|
155 | 156 |
synchronized long add(EffectNames eln, Interpolator inter, Float4D region, Interpolator2D point) |
156 | 157 |
{ |
157 |
if( mMax[VERTEX]>mNumEffects )
|
|
158 |
if( mMax[INDEX]>mNumEffects )
|
|
158 | 159 |
{ |
159 | 160 |
EffectNames.fillWithUnities(eln.ordinal(), mUniforms, NUM_UNIFORMS*mNumEffects); |
160 | 161 |
|
... | ... | |
171 | 172 |
|
172 | 173 |
synchronized long add(EffectNames eln, Interpolator inter, Float4D region, float x, float y) |
173 | 174 |
{ |
174 |
if( mMax[VERTEX]>mNumEffects )
|
|
175 |
if( mMax[INDEX]>mNumEffects )
|
|
175 | 176 |
{ |
176 | 177 |
EffectNames.fillWithUnities(eln.ordinal(), mUniforms, NUM_UNIFORMS*mNumEffects); |
177 | 178 |
|
... | ... | |
190 | 191 |
|
191 | 192 |
synchronized long add(EffectNames eln, float v1, float v2, float v3, Float4D region, float x, float y) |
192 | 193 |
{ |
193 |
if( mMax[VERTEX]>mNumEffects )
|
|
194 |
if( mMax[INDEX]>mNumEffects )
|
|
194 | 195 |
{ |
195 | 196 |
EffectNames.fillWithUnities(eln.ordinal(), mUniforms, NUM_UNIFORMS*mNumEffects); |
196 | 197 |
mUniforms[NUM_UNIFORMS*mNumEffects ] = v1; |
Also available in: Unified diff
Introduce ENUM EffectTypes