Project

General

Profile

« Previous | Next » 

Revision 71d8aba1

Added by Leszek Koltunski over 4 years ago

Bugfix ( Mesh shallow copy wasn't working )

View differences:

src/main/java/org/distorted/library/mesh/DeferredJobs.java
175 175
      jn.mPrevJobs.remove(node);
176 176
      }
177 177

  
178
    node.mJob.mTarget.mJobNode = null;
178
    node.mJob.mTarget.mJobNode[0] = null;
179 179
    }
180 180

  
181 181
///////////////////////////////////////////////////////////////////////////////////////////////////
182 182

  
183 183
  static JobNode vertex(MeshBase target, VertexEffect effect)
184 184
    {
185
    JobNode jn = target.mJobNode;
185
    JobNode jn = target.mJobNode[0];
186 186

  
187 187
    if( jn==null )
188 188
      {
src/main/java/org/distorted/library/mesh/MeshBase.java
82 82
   private float mInflate;
83 83
   private int[] mAssociation;
84 84

  
85
   DeferredJobs.JobNode mJobNode;
85
   DeferredJobs.JobNode[] mJobNode;
86 86

  
87 87
   private static int[] mComponentAssociationH = new int[EffectQueue.MAIN_VARIANTS];
88 88

  
......
124 124
     mComponent  = new ArrayList<>();
125 125
     mAssociation= new int[MAX_COMPONENTS];
126 126

  
127
     mJobNode = new DeferredJobs.JobNode[1];
128

  
127 129
     for(int i=0; i<MAX_COMPONENTS; i++) mAssociation[i] = DEFAULT_ASSOCIATION;
128 130

  
129 131
     mVBO1= new InternalBuffer(GLES30.GL_ARRAY_BUFFER             , GLES30.GL_STATIC_READ);
......
154 156

  
155 157
     if( deep )
156 158
       {
157
       if( original.mJobNode!=null )
159
       mJobNode = new DeferredJobs.JobNode[1];
160

  
161
       if( original.mJobNode[0]!=null )
158 162
         {
159
         mJobNode = new DeferredJobs.JobNode(original.mJobNode);
163
         mJobNode[0] = new DeferredJobs.JobNode(original.mJobNode[0]);
160 164
         }
161 165

  
162 166
       mVBO1= new InternalBuffer(GLES30.GL_ARRAY_BUFFER, GLES30.GL_STATIC_READ);
......
166 170
       }
167 171
     else
168 172
       {
169
       mJobNode         = original.mJobNode;
170
       mVBO1            = original.mVBO1;
171
       mVertAttribs1    = original.mVertAttribs1;
173
       mJobNode      = original.mJobNode;
174
       mVBO1         = original.mVBO1;
175
       mVertAttribs1 = original.mVertAttribs1;
172 176
       }
173 177

  
174 178
     mVBO2= new InternalBuffer(GLES30.GL_ARRAY_BUFFER, GLES30.GL_STATIC_READ);
......
399 403
 */
400 404
   public void bindVertexAttribs(DistortedProgram program)
401 405
     {
402
     if( mJobNode!=null )
406
     if( mJobNode[0]!=null )
403 407
       {
404
       mJobNode.execute();  // this will set itself to null
408
       mJobNode[0].execute();  // this will set itself to null
405 409
       }
406 410

  
407 411
     int index1 = mVBO1.createImmediately(mNumVertices*VERT1_SIZE, mVertAttribs1);
......
508 512
 */
509 513
   public void apply(VertexEffect effect)
510 514
     {
511
     mJobNode = DeferredJobs.vertex(this,effect);
515
     mJobNode[0] = DeferredJobs.vertex(this,effect);
512 516
     }
513 517

  
514 518
///////////////////////////////////////////////////////////////////////////////////////////////////

Also available in: Unified diff