Revision 85bfeb7a
Added by Leszek Koltunski almost 6 years ago
src/main/java/org/distorted/library/main/DistortedMaster.java | ||
---|---|---|
96 | 96 |
} |
97 | 97 |
|
98 | 98 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
99 |
// can make this logarithmic but the typical number of children is very small anyway |
|
99 |
// Can make this logarithmic but the typical number of children is very small anyway. |
|
100 |
// |
|
101 |
// We want to keep same buckets next to each other, while avoiding changes in order of the children |
|
102 |
// (if possible!) We want to keep bucket=0 (i.e. the non-postprocessed children) at the beginning. |
|
100 | 103 |
|
101 |
static void addSorted(ArrayList<DistortedNode> mChildren, DistortedNode newChild)
|
|
104 |
static void addSortingByBuckets(ArrayList<DistortedNode> mChildren, DistortedNode newChild)
|
|
102 | 105 |
{ |
103 | 106 |
int i,num = mChildren.size(); |
104 | 107 |
long bucket = newChild.getPostprocessQueue().getID(); |
108 |
boolean sameBucket = false; |
|
105 | 109 |
|
106 | 110 |
for(i=0; i<num; i++) |
107 | 111 |
{ |
108 |
if( mChildren.get(i).getPostprocessQueue().getID() > bucket ) break; |
|
112 |
if( mChildren.get(i).getPostprocessQueue().getID() == bucket ) |
|
113 |
{ |
|
114 |
sameBucket=true; |
|
115 |
} |
|
116 |
else if( sameBucket || bucket==0 ) |
|
117 |
{ |
|
118 |
break; |
|
119 |
} |
|
109 | 120 |
} |
110 | 121 |
|
111 | 122 |
mChildren.add(i,newChild); |
Also available in: Unified diff
Try and avoid re-sorting the children by buckets (if we can!). This makes change in rendering order in the 'Transparency' app actually work.