Project

General

Profile

« Previous | Next » 

Revision c90aca24

Added by Leszek Koltunski about 4 years ago

Move the 'pre-multiply mesh before applying any effects' thing from [(Xsize of texture, Ysize of texture) x Mesh's zFactor] to Effects.setStretch(sx,sy,sz)

View differences:

src/main/java/org/distorted/library/mesh/MeshRectangles.java
50 50
                     (mCols>=2 && mRows>=2 ? 2*mRows-2 : 1);
51 51
       }
52 52

  
53
     //android.util.Log.e("MeshRectangles","vertices="+numVertices+" rows="+mRows+" cols="+mCols);
54

  
55 53
     remainingVert = numVertices;
56 54
     }
57 55

  
......
83 81

  
84 82
  private int repeatLast(int vertex, float[] attribs)
85 83
     {
86
     //android.util.Log.e("MeshRectangles", "repeating last vertex!");
87

  
88 84
     if( vertex>0 )
89 85
       {
90 86
       remainingVert--;
......
122 118
     final float X = 1.0f/mCols;
123 119
     final float Y = 1.0f/mRows;
124 120

  
125
     //android.util.Log.d("MeshRectangles", "buildGrid");
126

  
127 121
     y = 0.0f;
128 122

  
129 123
     for(int row=0; row<mRows; row++)
......
151 145

  
152 146
       y+=Y;
153 147
       }
154

  
155
     //android.util.Log.d("MeshRectangles", "buildGrid done");
156 148
     }
157 149

  
158
///////////////////////////////////////////////////////////////////////////////////////////////////
159
/*
160
  private static String debug(float[] val, int stop)
161
     {
162
     String ret="";
163

  
164
     for(int i=0; i<val.length; i++)
165
        {
166
        if( i%stop==0 ) ret+="\n";
167
        ret+=(" "+val[i]);
168
        }
169

  
170
     return ret;
171
     }
172
*/
173

  
174 150
///////////////////////////////////////////////////////////////////////////////////////////////////
175 151
// PUBLIC API
176 152
///////////////////////////////////////////////////////////////////////////////////////////////////
......
182 158
 */
183 159
 public MeshRectangles(int cols, int rows)
184 160
    {
185
    super(0.0f);
186 161
    computeNumberOfVertices(cols,rows);
187 162

  
188 163
    float[] attribs= new float[VERT_ATTRIBS*numVertices];
189 164

  
190 165
    buildGrid(attribs);
191 166

  
192
    //android.util.Log.e("MeshRectangles", "dataLen="+numVertices);
193
    //android.util.Log.d("MeshRectangles", "attribs: "+debug(attribs,VERT_ATTRIBS) );
194

  
195 167
    if( remainingVert!=0 )
196 168
      android.util.Log.d("MeshRectangles", "remainingVert " +remainingVert );
197 169

  

Also available in: Unified diff