Project

General

Profile

« Previous | Next » 

Revision 46dc4091

Added by Leszek Koltunski 11 months ago

Fix a bug noticed by Rohan M.

View differences:

src/main/java/org/distorted/library/effect/EffectQuality.java
34 34
 */
35 35
public enum EffectQuality
36 36
  {
37
  HIGHEST  ( 0 ),   // has to start from 0
38
  HIGH     ( 1 ),
39
  MEDIUM   ( 2 ),
40
  LOW      ( 3 );
37
  HIGHEST  ( 0, 1.000f ),   // has to start from 0
38
  HIGH     ( 1, 0.500f ),
39
  MEDIUM   ( 2, 0.250f ),
40
  LOW      ( 3, 0.125f );
41 41

  
42 42
///////////////////////////////////////////////////////////////////////////////////////////////////
43
/**
44
 * Each next Quality level renders into 1/MULTIPLIER smaller buffers.
45
 */
46
  public static final float MULTIPLIER = 0.5f;
47 43
/**
48 44
 * Numof of possible qualities.
49 45
 */
50 46
  public static final int LENGTH = values().length;
51 47

  
52 48
  private final int level;
49
  private final float mipmap;
50

  
51
  private static final EffectQuality[] qualities;
52

  
53
  static
54
    {
55
    int i=0;
56
    qualities= new EffectQuality[LENGTH];
57
    for(EffectQuality q: EffectQuality.values()) qualities[i++] = q;
58
    }
53 59

  
54 60
///////////////////////////////////////////////////////////////////////////////////////////////////
55 61

  
56
  EffectQuality(int level)
62
  EffectQuality(int level, float mipmap)
57 63
    {
58 64
    this.level = level;
65
    this.mipmap= mipmap;
59 66
    }
60 67

  
61 68
///////////////////////////////////////////////////////////////////////////////////////////////////
......
68 75
    {
69 76
    return level;
70 77
    }
78

  
79
///////////////////////////////////////////////////////////////////////////////////////////////////
80
/**
81
 * Only for use by the library itself.
82
 *
83
 * @y.exclude
84
 */
85
  public static float getMipmap(int quality)
86
    {
87
    return qualities[quality].mipmap;
88
    }
71 89
  }
72 90

  

Also available in: Unified diff