Revision d5b709df
Added by Leszek Koltunski about 5 years ago
src/main/java/org/distorted/library/main/DistortedNode.java | ||
---|---|---|
59 | 59 |
mData.mFBO.markForDeletion(); |
60 | 60 |
mData.mFBO = null; |
61 | 61 |
} |
62 |
} |
|
63 |
|
|
64 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
62 | 65 |
|
63 |
mEffects.removeNode(this); |
|
66 |
long getBucket() |
|
67 |
{ |
|
68 |
return mEffects.getQueues()[3].getID(); |
|
64 | 69 |
} |
65 | 70 |
|
66 | 71 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
140 | 145 |
if( mParent!=null ) mParent.adjustIsomorphism(); |
141 | 146 |
} |
142 | 147 |
|
143 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
144 |
/** |
|
145 |
* This is not really part of the public API. Has to be public only because it is a part of the |
|
146 |
* DistortedChildrenList.Parent interface. |
|
147 |
* |
|
148 |
* @y.exclude |
|
149 |
*/ |
|
150 |
public DistortedChildrenList getChildren() |
|
151 |
{ |
|
152 |
return mChildren; |
|
153 |
} |
|
154 |
|
|
155 | 148 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
156 | 149 |
// return the total number of render calls issued |
157 | 150 |
|
... | ... | |
215 | 208 |
|
216 | 209 |
if( numChildren>0 && mData.notRenderedYetAtThisTime(currTime) ) |
217 | 210 |
{ |
211 |
DistortedNode node; |
|
212 |
long oldBucket=0, newBucket; |
|
213 |
|
|
218 | 214 |
for (int i=0; i<numChildren; i++) |
219 | 215 |
{ |
220 |
numRenders += mChildren.getChild(i).renderRecursive(currTime); |
|
216 |
node = mChildren.getChild(i); |
|
217 |
newBucket = node.getBucket(); |
|
218 |
numRenders += node.renderRecursive(currTime); |
|
219 |
if( newBucket<oldBucket ) mChildren.rearrangeByBuckets(i,newBucket); |
|
220 |
else oldBucket=newBucket; |
|
221 | 221 |
} |
222 | 222 |
|
223 | 223 |
if( mData.mFBO==null ) mData.mFBO = allocateNewFBO(); |
... | ... | |
251 | 251 |
mParent = parent; |
252 | 252 |
} |
253 | 253 |
|
254 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
255 |
|
|
256 |
void sort() |
|
257 |
{ |
|
258 |
if( mParent!=null ) |
|
259 |
{ |
|
260 |
DistortedChildrenList siblings = mParent.getChildren(); |
|
261 |
siblings.removeChild(this); |
|
262 |
siblings.addSortingByBuckets(this); |
|
263 |
} |
|
264 |
} |
|
265 |
|
|
266 | 254 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
267 | 255 |
// PUBLIC API |
268 | 256 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
288 | 276 |
mFboDepthStencil = DistortedFramebuffer.DEPTH_NO_STENCIL; |
289 | 277 |
|
290 | 278 |
mData = DistortedNodeData.returnData(generateIDList()); |
291 |
mEffects.newNode(this); |
|
292 | 279 |
} |
293 | 280 |
|
294 | 281 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
350 | 337 |
} |
351 | 338 |
|
352 | 339 |
mData = DistortedNodeData.returnData(generateIDList()); |
353 |
mEffects.newNode(this); |
|
354 | 340 |
} |
355 | 341 |
|
356 | 342 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
Also available in: Unified diff
Cut another interdependency between the Queues and the rest: it is no longer necessary to add DNodes to PostprocessQueue to rearrange the Nodes by buckets. The rearranging is now done on next render instead.