Project

General

Profile

« Previous | Next » 

Revision 77e66c58

Added by Leszek Koltunski 11 months ago

in API 34 R.id. things are no loger constants and cannot be used in switches.

View differences:

src/main/java/org/distorted/examples/meshfile/MeshFileRenderer.java
210 210
      float F = 0.5f;
211 211
      float E = SQ3/2;
212 212

  
213
      switch(resourceID)
214
          {
215
          case  R.raw.deferredjob:
216
          case  R.raw.meshjoin   :
217
          case  PROCEDURAL       :
218
          case  POLYGON          :
219
          case  R.raw.predeform  : return createWhiteTexture();
220

  
221
          case  R.raw.cube2      :
222
          case  R.raw.cube3      :
223
          case  R.raw.cube4      :
224
          case  R.raw.cube5      : colors = new int[] { 0xffffff00, 0xffffffff, 0xff0000ff, 0xff00ff00, 0xffff0000, 0xffb5651d };
225
                                   vertices = new float[] { -F,-F, +F,-F, +F,+F, -F,+F};
226
                                   return factory.createTexture(vertices,colors,0.10f, 0.10f, true);
227
          case  R.raw.pyra3      :
228
          case  R.raw.pyra4      :
229
          case  R.raw.pyra5      : colors = new int[] { 0xffffff00, 0xff00ff00, 0xff0000ff, 0xffff0000 };
230
                                   vertices = new float[] { -F,-E/3, +F,-E/3, 0.0f,2*E/3};
231
                                   return factory.createTexture(vertices,colors,0.05f, 0.05f, true);
232

  
233
          case  R.raw.dino       : colors = new int[] { 0xffffff00, 0xffffffff, 0xff0000ff, 0xff00ff00, 0xffff0000, 0xffb5651d };
234
                                   vertices = new float[] { -F,F/3, 0,-2*F/3, +F,F/3 };
235
                                   return factory.createTexture(vertices,colors,0.05f, 0.03f, true);
236

  
237
          case R.raw.skewb       : colors = new int[] { 0xffffff00, 0xffffffff, 0xff0000ff, 0xff00ff00, 0xffff0000, 0xffb5651d };
238
                                   //vertices = new float[] { -G,-G, +G,-G, +G,+G, -G,+G };
239

  
240
                                   vertices = new float[] { -F+F/4,F/4, F/4,-F+F/4, F/4,F/4};
241
                                   return factory.createTexture(vertices,colors,0.05f, 0.08f, true);
242
          }
213
      if( resourceID == R.raw.deferredjob ||
214
          resourceID == R.raw.meshjoin    ||
215
          resourceID == PROCEDURAL        ||
216
          resourceID == POLYGON           ||
217
          resourceID == R.raw.predeform    ) return createWhiteTexture();
218

  
219
      if( resourceID == R.raw.cube2       ||
220
          resourceID == R.raw.cube3       ||
221
          resourceID == R.raw.cube4       ||
222
          resourceID == R.raw.cube5        )
223
        {
224
        colors = new int[] { 0xffffff00, 0xffffffff, 0xff0000ff, 0xff00ff00, 0xffff0000, 0xffb5651d };
225
        vertices = new float[] { -F,-F, +F,-F, +F,+F, -F,+F};
226
        return factory.createTexture(vertices,colors,0.10f, 0.10f, true);
227
        }
228
      if( resourceID == R.raw.pyra3       ||
229
          resourceID == R.raw.pyra4       ||
230
          resourceID == R.raw.pyra5        )
231
        {
232
        colors = new int[] { 0xffffff00, 0xff00ff00, 0xff0000ff, 0xffff0000 };
233
        vertices = new float[] { -F,-E/3, +F,-E/3, 0.0f,2*E/3};
234
        return factory.createTexture(vertices,colors,0.05f, 0.05f, true);
235
        }
236
      if( resourceID == R.raw.dino )
237
        {
238
        colors = new int[] { 0xffffff00, 0xffffffff, 0xff0000ff, 0xff00ff00, 0xffff0000, 0xffb5651d };
239
        vertices = new float[] { -F,F/3, 0,-2*F/3, +F,F/3 };
240
        return factory.createTexture(vertices,colors,0.05f, 0.03f, true);
241
        }
242
      if( resourceID == R.raw.skewb )
243
        {
244
        colors = new int[] { 0xffffff00, 0xffffffff, 0xff0000ff, 0xff00ff00, 0xffff0000, 0xffb5651d };
245
        vertices = new float[] { -F+F/4,F/4, F/4,-F+F/4, F/4,F/4};
246
        return factory.createTexture(vertices,colors,0.05f, 0.08f, true);
247
        }
243 248

  
244 249
      return null;
245 250
      }

Also available in: Unified diff