Revision aee078f8
Added by Leszek Koltunski almost 4 years ago
src/main/java/org/distorted/library/mesh/MeshBase.java | ||
---|---|---|
88 | 88 |
private int[] mAssociation; |
89 | 89 |
|
90 | 90 |
private static int[] mComponentAssociationH = new int[EffectQueue.MAIN_VARIANTS]; |
91 |
private EffectQueueVertex mQueue; |
|
91 | 92 |
|
92 | 93 |
private static class Component |
93 | 94 |
{ |
94 | 95 |
private int mEndIndex; |
95 | 96 |
private Static4D mTextureMap; |
96 |
private EffectQueueVertex mQueue; |
|
97 | 97 |
|
98 | 98 |
Component(int end) |
99 | 99 |
{ |
100 | 100 |
mEndIndex = end; |
101 | 101 |
mTextureMap= new Static4D(0,0,1,1); |
102 |
mQueue = new EffectQueueVertex(); |
|
103 | 102 |
} |
104 | 103 |
Component(Component original) |
105 | 104 |
{ |
... | ... | |
110 | 109 |
float z = original.mTextureMap.get2(); |
111 | 110 |
float w = original.mTextureMap.get3(); |
112 | 111 |
mTextureMap = new Static4D(x,y,z,w); |
113 |
mQueue = new EffectQueueVertex(original.mQueue); |
|
114 | 112 |
} |
115 | 113 |
|
116 | 114 |
void setMap(Static4D map) |
... | ... | |
133 | 131 |
for(int i=0; i<MAX_COMPONENTS; i++) mAssociation[i] = DEFAULT_ASSOCIATION; |
134 | 132 |
|
135 | 133 |
mNeedsAdjustment = new boolean[1]; |
134 |
mQueue = new EffectQueueVertex(); |
|
136 | 135 |
|
137 | 136 |
mVBO1= new InternalBuffer(GLES30.GL_ARRAY_BUFFER , GLES30.GL_STATIC_READ); |
138 | 137 |
mVBO2= new InternalBuffer(GLES30.GL_ARRAY_BUFFER , GLES30.GL_STATIC_READ); |
... | ... | |
150 | 149 |
|
151 | 150 |
int size = original.mComponent.size(); |
152 | 151 |
mComponent = new ArrayList<>(); |
152 |
mQueue = new EffectQueueVertex(original.mQueue); |
|
153 | 153 |
|
154 | 154 |
for(int i=0; i<size; i++) |
155 | 155 |
{ |
... | ... | |
363 | 363 |
|
364 | 364 |
GLES30.glUnmapBuffer(GLES30.GL_TRANSFORM_FEEDBACK); |
365 | 365 |
|
366 |
int numComp = mComponent.size(); |
|
367 |
|
|
368 |
for(int i=0; i<numComp; i++) |
|
369 |
{ |
|
370 |
mComponent.get(i).mQueue.removeAll(false); |
|
371 |
} |
|
366 |
mQueue.removeAll(false); |
|
372 | 367 |
} |
373 | 368 |
|
374 | 369 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
379 | 374 |
*/ |
380 | 375 |
public void computeQueue() |
381 | 376 |
{ |
382 |
int numComp = mComponent.size(); |
|
383 |
|
|
384 |
for(int i=0; i<numComp; i++) |
|
385 |
{ |
|
386 |
mComponent.get(i).mQueue.compute(1); |
|
387 |
} |
|
377 |
mQueue.compute(1); |
|
388 | 378 |
} |
389 | 379 |
|
390 | 380 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
395 | 385 |
*/ |
396 | 386 |
public void sendQueue() |
397 | 387 |
{ |
398 |
int numComp = mComponent.size(); |
|
399 |
|
|
400 |
for(int i=0; i<numComp; i++) |
|
401 |
{ |
|
402 |
mComponent.get(i).mQueue.send(0.0f,3); |
|
403 |
} |
|
388 |
mQueue.send(0.0f,3); |
|
404 | 389 |
} |
405 | 390 |
|
406 | 391 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
573 | 558 |
*/ |
574 | 559 |
public void apply(VertexEffect effect) |
575 | 560 |
{ |
576 |
int numComp = mComponent.size(); |
|
577 |
|
|
578 |
for(int i=0; i<numComp; i++) |
|
579 |
{ |
|
580 |
mComponent.get(i).mQueue.add(effect); |
|
581 |
} |
|
582 |
|
|
561 |
mQueue.add(effect); |
|
583 | 562 |
mNeedsAdjustment[0] = true; |
584 | 563 |
} |
585 | 564 |
|
Also available in: Unified diff
Correct VertexEffectQueue in the Mesh. There's no need to have a separate Queue in every component.