Project

General

Profile

« Previous | Next » 

Revision 07037b8a

Added by Leszek Koltunski almost 8 years ago

a few lame fixes for the issues uncovered by Olimpic but it is still wrong

View differences:

src/main/java/org/distorted/library/DistortedNode.java
108 108
    int i;
109 109

  
110 110
    for(i=0; i<depth; i++) tmp +="   ";
111
    tmp += ("NodeID="+mData.ID+" (nodes pointing: "+mData.numPointingNodes+" surfaceID="+mSurface.getID()+")");
111
    tmp += ("NodeID="+mData.ID+" nodes pointing: "+mData.numPointingNodes+" surfaceID="+
112
            mSurface.getID()+" FBO="+(mData.mFBO==null ? "null":mData.mFBO.getID()));
112 113

  
113 114
    android.util.Log.e("NODE", tmp);
114 115

  
......
145 146

  
146 147
    if( newData==null )
147 148
      {
149
      android.util.Log.d("NODE", "list "+newList+" not found!! node surfaceID="+mSurface.getID());
150

  
148 151
      newData = new NodeData(++mNextNodeID,newList);
149 152
      mMapNodeID.put(newList,newData);
150 153
      }
151 154
    else if( newData.ID != mData.ID )
152 155
      {
156
      android.util.Log.d("NODE", "list "+newList+" found!! node surfaceID="+mSurface.getID());
157

  
153 158
      newData.numPointingNodes++;
154 159
      }
155 160

  
......
161 166
        {
162 167
        if( mData.mFBO!=null )
163 168
          {
164
          android.util.Log.d("NODE", "copying over FBO of node surfaceID="+mSurface.getID());
165

  
166
          newData.mFBO = mData.mFBO;
167
          fboUsed = true;
169
          if( mData.numPointingNodes>1 )
170
            {
171
            android.util.Log.d("NODE", "creating1 new FBO of node surfaceID="+mSurface.getID());
172
            newData.mFBO = new DistortedFramebuffer(true,DistortedSurface.TYPE_TREE,mSurface.getWidth(),mSurface.getHeight());
173
            }
174
          else
175
            {
176
            android.util.Log.d("NODE", "copying over FBO of node surfaceID="+mSurface.getID());
177
            newData.mFBO = mData.mFBO;
178
            fboUsed = true;
179
            }
168 180
          }
169 181
        else
170 182
          {
171
          android.util.Log.d("NODE", "creating new FBO of node surfaceID="+mSurface.getID());
183
          android.util.Log.d("NODE", "creating2 new FBO of node surfaceID="+mSurface.getID());
172 184
          newData.mFBO = new DistortedFramebuffer(true,DistortedSurface.TYPE_TREE,mSurface.getWidth(),mSurface.getHeight());
173 185
          }
174 186
        }
175 187
      if( mNumChildren[0]==0 && newData.mFBO!=null )
176 188
        {
177 189
        android.util.Log.d("NODE", "deleting FBO of newData node!!");
178

  
179

  
180 190
        newData.mFBO.markForDeletion();
181 191
        newData.mFBO = null;
182 192
        }
183 193

  
184 194
      if( --mData.numPointingNodes==0 )
185 195
        {
196
        android.util.Log.d("NODE", "deleting1 map key "+mData.key);
197

  
186 198
        mMapNodeID.remove(mData.key);
187 199

  
188 200
        if( !fboUsed && mData.mFBO!=null )
......
448 460

  
449 461
      if( mNumChildren[0]==0 && mData.mFBO!=null )
450 462
        {
451
        mData.mFBO.markForDeletion();
463
        if( --mData.numPointingNodes==0 )
464
          {
465
          mData.mFBO.markForDeletion();
466
          android.util.Log.d("NODE", "deleting2 map key "+mData.key);
467

  
468
          mMapNodeID.remove(mData.key);
469
          }
452 470
        mData.mFBO = null;
453 471
        }
454 472
      }
......
481 499

  
482 500
      if( mData.mFBO!=null )
483 501
        {
484
        mData.mFBO.markForDeletion();
502
        if( --mData.numPointingNodes==0 )
503
          {
504
          mData.mFBO.markForDeletion();
505
          android.util.Log.d("NODE", "deleting3 map key "+mData.key);
506

  
507
          mMapNodeID.remove(mData.key);
508
          }
485 509
        mData.mFBO = null;
486 510
        }
487 511
      }

Also available in: Unified diff