Project

General

Profile

« Previous | Next » 

Revision d5b709df

Added by Leszek Koltunski about 5 years ago

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.

View differences:

src/main/java/org/distorted/library/main/DistortedChildrenList.java
53 53
  public interface Parent
54 54
    {
55 55
    void adjustIsomorphism();
56
    DistortedChildrenList getChildren();
57 56
    }
58 57

  
59 58
///////////////////////////////////////////////////////////////////////////////////////////////////
......
82 81

  
83 82
///////////////////////////////////////////////////////////////////////////////////////////////////
84 83

  
85
  void removeChild(DistortedNode node)
84
  void rearrangeByBuckets(int index,long bucket)
86 85
    {
87
    if( mChildren.remove(node) )
86
    DistortedNode child = mChildren.remove(index);
87
    int i;
88

  
89
    for(i=0; i<index; i++)
88 90
      {
89
      mNumChildren--;
91
      if( mChildren.get(i).getBucket() > bucket ) break;
90 92
      }
93

  
94
    mChildren.add(i,child);
91 95
    }
92 96

  
93 97
///////////////////////////////////////////////////////////////////////////////////////////////////
......
96 100
// We want to keep same buckets next to each other, while avoiding changes in order of the children
97 101
// (if possible!) We want to keep bucket=0 (i.e. the non-postprocessed children) at the beginning.
98 102

  
99
  void addSortingByBuckets(DistortedNode newChild)
103
  private void addSortingByBuckets(DistortedNode newChild)
100 104
    {
101 105
    int i;
102
    EffectQueue queue = newChild.getEffects().getQueues()[3];
103
    long bucket = queue.getID();
106
    long bucket = newChild.getBucket();
104 107
    boolean sameBucket = false;
105 108

  
106 109
    for(i=0; i<mNumChildren; i++)
107 110
      {
108
      queue = mChildren.get(i).getEffects().getQueues()[3];
109

  
110
      if( queue.getID() == bucket )
111
      if( mChildren.get(i).getBucket() == bucket )
111 112
        {
112 113
        sameBucket=true;
113 114
        }

Also available in: Unified diff