Project

General

Profile

« Previous | Next » 

Revision 728a7820

Added by Leszek Koltunski over 3 years ago

Fix the fact that we would keep adding new InternalBuffers to the 'Done' list - split 'invalidate()' and 'recreate()' to two separate actions!

View differences:

src/main/java/org/distorted/library/mesh/UniformBlockAssociation.java
63 63

  
64 64
///////////////////////////////////////////////////////////////////////////////////////////////////
65 65

  
66
   boolean matchesAssociation( int comp, int andAssoc, int equAssoc)
67
     {
68
     return (andAssoc & mAssociations[4*comp]) != 0 || (equAssoc == mAssociations[4*comp+2]);
69
     }
66
  boolean matchesAssociation( int comp, int andAssoc, int equAssoc)
67
    {
68
    return (andAssoc & mAssociations[4*comp]) != 0 || (equAssoc == mAssociations[4*comp+2]);
69
    }
70 70

  
71 71
///////////////////////////////////////////////////////////////////////////////////////////////////
72 72

  
73
   void setEffectAssociationNow(int comp, int andAssociation, int equAssociation)
74
     {
75
     mAssociations[4*comp  ] = andAssociation;
76
     mAssociations[4*comp+2] = equAssociation;
73
  void setEffectAssociationNow(int comp, int andAssociation, int equAssociation)
74
    {
75
    mAssociations[4*comp  ] = andAssociation;
76
    mAssociations[4*comp+2] = equAssociation;
77 77

  
78
     mUBO.invalidate();
79
     }
78
    mUBO.invalidate();
79
    }
80 80

  
81 81
///////////////////////////////////////////////////////////////////////////////////////////////////
82 82

  
83
   int getIndex()
84
     {
85
     return mUBO.createImmediatelyInt( BLOCK_SIZE, mAssociations);
86
     }
83
  int getIndex()
84
    {
85
    return mUBO.createImmediatelyInt( BLOCK_SIZE, mAssociations);
86
    }
87 87

  
88 88
///////////////////////////////////////////////////////////////////////////////////////////////////
89 89

  
90
   void copy(int compTo, UniformBlockAssociation assocFrom, int compFrom)
91
     {
92
     mAssociations[4*compTo  ] = assocFrom.mAssociations[4*compFrom  ];
93
     mAssociations[4*compTo+2] = assocFrom.mAssociations[4*compFrom+2];
94
     }
90
  void copy(int compTo, UniformBlockAssociation assocFrom, int compFrom)
91
    {
92
    mAssociations[4*compTo  ] = assocFrom.mAssociations[4*compFrom  ];
93
    mAssociations[4*compTo+2] = assocFrom.mAssociations[4*compFrom+2];
94
    }
95

  
96
///////////////////////////////////////////////////////////////////////////////////////////////////
97

  
98
  void print()
99
    {
100
    StringBuilder builder = new StringBuilder();
101

  
102
    builder.append(mUBO.getID());
103
    builder.append(' ');
104

  
105
    for(int i=0; i<8; i++)
106
      {
107
      builder.append(mAssociations[4*i]);
108
      builder.append(' ');
109
      builder.append(mAssociations[4*i+2]);
110
      builder.append(' ');
111
      }
112

  
113
    String res = builder.toString();
114

  
115
    android.util.Log.e("uba", res);
116
    }
95 117
  }

Also available in: Unified diff