Project

General

Profile

« Previous | Next » 

Revision df664009

Added by Leszek Koltunski over 3 years ago

Minor

View differences:

src/main/java/org/distorted/objects/MovementCube.java
41 41
    {
42 42
    enabled[0] = 2;
43 43

  
44
    switch(face)
44
    switch(face/2)
45 45
      {
46
      case 0: case 1: enabled[1]=1; enabled[2]=2; break;
47
      case 2: case 3: enabled[1]=0; enabled[2]=2; break;
48
      case 4: case 5: enabled[1]=0; enabled[2]=1; break;
46
      case 0: enabled[1]=1; enabled[2]=2; break;
47
      case 1: enabled[1]=0; enabled[2]=2; break;
48
      case 2: enabled[1]=0; enabled[2]=1; break;
49 49
      }
50 50
    }
51 51
}
src/main/java/org/distorted/objects/MovementHelicopter.java
49 49
    boolean p0 = touchPoint[0] > 0;
50 50
    boolean p1 = touchPoint[1] > 0;
51 51

  
52
    if( p0 )  return p1 ? 0:1;
53
    else      return p1 ? 3:2;
52
    return p0 ? (p1 ? 0:1) : (p1 ? 3:2);
54 53
    }
55 54

  
56 55
///////////////////////////////////////////////////////////////////////////////////////////////////
src/main/java/org/distorted/objects/MovementSquare.java
39 39

  
40 40
  void computeEnabledAxis(int face, float[] touchPoint, int[] enabled)
41 41
    {
42
    switch(face)
42
    switch(face/2)
43 43
      {
44
      case 0:
45
      case 1: enabled[0]=1; enabled[1]=0; break;
46
      case 2:
47
      case 3: enabled[0]=1; enabled[1]=1; break;
48
      case 4:
49
      case 5: enabled[0]=2; enabled[1]=0; enabled[2]=1; break;
44
      case 0: enabled[0]=1; enabled[1]=0; break;
45
      case 1: enabled[0]=1; enabled[1]=1; break;
46
      case 2: enabled[0]=2; enabled[1]=0; enabled[2]=1; break;
50 47
      }
51 48
    }
52 49
}

Also available in: Unified diff