Project

General

Profile

« Previous | Next » 

Revision b0c97683

Added by Leszek Koltunski almost 2 years ago

Sticker overrides finished. Add crazy planets JSONs and icons (correction)

View differences:

src/main/java/org/distorted/objectlib/main/TwistyObject.java
477 477
    if( mNumTexCols*mNumTexRows < mNumTextures+1 ) mNumTexRows++;
478 478

  
479 479
    if( !fromDMESH || shouldResetTextureMaps() ) resetAllTextureMaps();
480
    else overrideCubitFaceColor();
481

  
480 482
    setTexture();
481 483
    }
482 484

  
......
1537 1539
      mMesh.setTextureMap(maps,mNumCubitFaces*cubit);
1538 1540
      }
1539 1541

  
1542
    overrideCubitFaceColor();
1543
    }
1544

  
1545
///////////////////////////////////////////////////////////////////////////////////////////////////
1546

  
1547
  private void overrideCubitFaceColor()
1548
    {
1549
    final float ratioW = 1.0f/mNumTexCols;
1550
    final float ratioH = 1.0f/mNumTexRows;
1551

  
1540 1552
    for(int i=0; i<mNumOverrides; i++)
1541 1553
      {
1542 1554
      int[] cubitFaces = mStickerOverrides[i].getCubitFaces();
1543 1555
      int length = cubitFaces.length/2;
1544 1556

  
1545 1557
      for(int j=0; j<length; j++)
1546
        overrideCubitFaceColor(i,cubitFaces[2*j],cubitFaces[2*j+1], ratioW, ratioH);
1558
        {
1559
        final Static4D[] maps = new Static4D[1];
1560
        int color = mNumTextures-mNumOverrides+1+i;
1561
        int row   = (mNumTexRows-1) - color/mNumTexCols;
1562
        int col   = color%mNumTexCols;
1563
        int cubit = cubitFaces[2*j];
1564
        int face  = cubitFaces[2*j+1];
1565
        maps[0] = new Static4D(col*ratioW, row*ratioH, ratioW, ratioH);
1566
        mMesh.setTextureMap(maps,mNumCubitFaces*cubit+face);
1567
        }
1547 1568
      }
1548 1569
    }
1549 1570

  
1550
///////////////////////////////////////////////////////////////////////////////////////////////////
1551

  
1552
  private void overrideCubitFaceColor(int override, int cubit, int face, float ratioW, float ratioH)
1553
    {
1554
    final Static4D[] maps = new Static4D[1];
1555
    int color = mNumTextures-mNumOverrides+1+override;
1556
    int row   = (mNumTexRows-1) - color/mNumTexCols;
1557
    int col   = color%mNumTexCols;
1558
    maps[0] = new Static4D(col*ratioW, row*ratioH, ratioW, ratioH);
1559
    mMesh.setTextureMap(maps,mNumCubitFaces*cubit+face);
1560
    }
1561

  
1562 1571
///////////////////////////////////////////////////////////////////////////////////////////////////
1563 1572

  
1564 1573
  void releaseResources()
src/main/java/org/distorted/objectlib/objects/TwistyCrazy3x3.java
1011 1011

  
1012 1012
    switch(param)
1013 1013
      {
1014
      case CRAZY  : return "Crazy 3x3";
1014
      case CRAZY  : return "Circle 3x3";
1015 1015
      case MERCURY: return "Crazy Plus Mercury";
1016 1016
      case VENUS  : return "Crazy Plus Venus";
1017 1017
      case EARTH  : return "Crazy Plus Earth";

Also available in: Unified diff