Project

General

Profile

« Previous | Next » 

Revision af27df87

Added by Leszek Koltunski about 7 years ago

A lot of different fixes.

A lot of issues still there:

1) if we only render part of the tree, tree isomorphism will sometimes not work correctly
2) when we change Effects that are inside Trees mid-render, even if we detach() the affected parts of the Tree first, for the last frame the new Effects will be used
3) Something is wrong wil the System FBOs after app restart (Blur & MultiBlur apps work erratically)

View differences:

src/main/java/org/distorted/library/DistortedOutputSurface.java
36 36

  
37 37
///////////////////////////////////////////////////////////////////////////////////////////////////
38 38

  
39
  DistortedOutputSurface(int width, int height, int color)
39
  DistortedOutputSurface(int width, int height, int color, boolean system)
40 40
    {
41
    super(width,height,color);
41
    super(width,height,color,system);
42 42

  
43 43
    mProjectionMatrix = new float[16];
44 44

  
......
106 106
    // can result in additional Framebuffers that would need
107 107
    // to be created immediately, before the calls to drawRecursive()
108 108

  
109
    if( DistortedAttachDaemon.toDo() )
109
    boolean changed = DistortedAttachDaemon.toDo();
110

  
111
    if( changed )
110 112
      {
111 113
      for(int i=0; i<mNumChildren; i++)
112 114
        {
113 115
        mChildren.get(i).treeIsomorphism();
116
        mChildren.get(i).debug(0);
114 117
        }
118

  
119
      //DistortedNode.debugMap();
115 120
      }
116 121

  
117 122
    toDo();
118 123

  
124
    if( changed )
125
      {
126
      DistortedSurface.debugLists();
127
      }
128

  
119 129
    for(int i=0; i<mNumChildren; i++)
120 130
      {
121 131
      mChildren.get(i).drawRecursive(time,this);
......
219 229
    mNumChildren++;
220 230
    }
221 231

  
232
///////////////////////////////////////////////////////////////////////////////////////////////////
233
/**
234
 * Removes the first occurrence of a specified child from the list of children of our Surface.
235
 * <p>
236
 * A bit questionable method as there can be many different Nodes attached as children, some
237
 * of them having the same Effects but - for instance - different Mesh. Use with care.
238
 * <p>
239
 * We cannot do this mid-render - actual detachment will be done just before the next render, by the
240
 * DistortedAttachDeamon (by calling detachNow())
241
 *
242
 * @param effects DistortedEffects to remove.
243
 */
244
  public void detach(DistortedEffects effects)
245
    {
246
    long id = effects.getID();
247
    DistortedNode node;
248

  
249
    for(int i=0; i<mNumChildren; i++)
250
      {
251
      node = mChildren.get(i);
252

  
253
      if( node.getEffects().getID()==id )
254
        {
255
        DistortedAttachDaemon.detach(this,node);
256
        break;
257
        }
258
      }
259
    }
260

  
222 261
///////////////////////////////////////////////////////////////////////////////////////////////////
223 262
/**
224 263
 * Removes the first occurrence of a specified child from the list of children of our Surface.

Also available in: Unified diff