Project

General

Profile

« Previous | Next » 

Revision e02264ff

Added by Leszek Koltunski about 7 years ago

Bugfix (before we couldn't call postprocess() more than once per frame)

View differences:

src/main/java/org/distorted/library/DistortedOutputSurface.java
116 116
    }
117 117

  
118 118
///////////////////////////////////////////////////////////////////////////////////////////////////
119
// Render all children, one by one. If there are no postprocessing effects, just render to THIS.
120
// Otherwise, render to a buffer and on each change of Postprocessing Bucket, apply the postprocessing
121
// to a whole buffer and merge it.
119 122

  
120 123
  int renderChildren(long time, int num, ArrayList<DistortedNode> children)
121 124
    {
......
124 127
    EffectQueuePostprocess lastP=null, currP;
125 128
    long lastB=0, currB;
126 129

  
127
    // Render all children, one by one.
128
    // If there are no postprocessing effects, just render to THIS.
129
    // Otherwise, render to a buffer and on each change of Postprocessing Bucket,
130
    // apply the postprocessing to a whole buffer and merge it.
131

  
132 130
    for(int i=0; i<num; i++)
133 131
      {
134 132
      child = children.get(i);
......
137 135

  
138 136
      if( lastB!=currB && lastB!=0 )
139 137
        {
140
        //android.util.Log.e("output", "i="+i+" postprocess and merge");
141 138
        numRenders += lastP.postprocess(time,this);
142 139
        }
143 140

  
144 141
      if( currB==0 )
145 142
        {
146
        //android.util.Log.e("output", "i="+i+" draw to this");
147 143
        numRenders += child.draw(time,this);
148 144
        }
149 145
      else
......
154 150
          mBuffer2 = new DistortedFramebuffer(false                     , DistortedSurface.TYPE_TREE, mWidth, mHeight);
155 151
          }
156 152

  
157
        //android.util.Log.e("output", "i="+i+" draw to buffer");
158 153
        numRenders += child.draw(time,mBuffer1);
159 154
        if( i==num-1 )
160 155
          {
161
          //android.util.Log.e("output", "i="+i+" postprocess and merge");
162 156
          numRenders += currP.postprocess(time,this);
163 157
          }
164 158
        }

Also available in: Unified diff