Revision 4562f295
Added by Leszek Koltunski over 7 years ago
src/main/java/org/distorted/examples/movingeffects/MovingEffectsSurfaceView.java | ||
---|---|---|
50 | 50 |
public static final int EFFECT_CHROMA=4; |
51 | 51 |
public static final int EFFECT_SWIRL =5; |
52 | 52 |
|
53 |
private static Dynamic2D di2D; |
|
54 |
private static Static4D dr; |
|
55 |
private static Dynamic4D mRegion; |
|
56 |
|
|
57 |
private static Paint mPaint; |
|
58 |
private static int moving; |
|
59 | 53 |
private static final Object lock = new Object(); |
60 |
private static long mTime = 0; |
|
54 |
|
|
55 |
private Dynamic2D di2D; |
|
56 |
private Static4D dr; |
|
57 |
private Dynamic4D mRegion; |
|
58 |
|
|
59 |
private Paint mPaint; |
|
60 |
private int moving; |
|
61 |
private long mTime = 0; |
|
61 | 62 |
|
62 |
private static int mCurrEffect;
|
|
63 |
private static int mSize1, mSize2, mSizeR;
|
|
64 |
private static int mMax;
|
|
63 |
private int mCurrEffect; |
|
64 |
private int mSize1, mSize2, mSizeR; |
|
65 |
private int mMax; |
|
65 | 66 |
|
66 | 67 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
67 | 68 |
|
... | ... | |
96 | 97 |
|
97 | 98 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
98 | 99 |
|
99 |
public static void onSurfaceChanged(int width,int height)
|
|
100 |
public void onSurfaceChanged(int width,int height) |
|
100 | 101 |
{ |
101 | 102 |
mMax = width>height ? width:height; |
102 | 103 |
|
... | ... | |
109 | 110 |
|
110 | 111 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
111 | 112 |
|
112 |
public static int getCurrentEffect()
|
|
113 |
public int getCurrentEffect() |
|
113 | 114 |
{ |
114 | 115 |
return mCurrEffect; |
115 | 116 |
} |
116 | 117 |
|
117 | 118 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
118 | 119 |
|
119 |
public static void Bubble()
|
|
120 |
public void Bubble() |
|
120 | 121 |
{ |
121 | 122 |
if( mCurrEffect==EFFECT_BUBBLE ) return; |
122 | 123 |
|
... | ... | |
131 | 132 |
|
132 | 133 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
133 | 134 |
|
134 |
public static void Sink()
|
|
135 |
public void Sink() |
|
135 | 136 |
{ |
136 | 137 |
if( mCurrEffect==EFFECT_SINK ) return; |
137 | 138 |
|
... | ... | |
146 | 147 |
|
147 | 148 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
148 | 149 |
|
149 |
public static void Chroma()
|
|
150 |
public void Chroma() |
|
150 | 151 |
{ |
151 | 152 |
if( mCurrEffect==EFFECT_CHROMA ) return; |
152 | 153 |
|
... | ... | |
161 | 162 |
|
162 | 163 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
163 | 164 |
|
164 |
public static void Transparency()
|
|
165 |
public void Transparency() |
|
165 | 166 |
{ |
166 | 167 |
if( mCurrEffect==EFFECT_TRANS ) return; |
167 | 168 |
|
... | ... | |
176 | 177 |
|
177 | 178 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
178 | 179 |
|
179 |
public static void Swirl()
|
|
180 |
public void Swirl() |
|
180 | 181 |
{ |
181 | 182 |
if( mCurrEffect==EFFECT_SWIRL ) return; |
182 | 183 |
|
... | ... | |
191 | 192 |
|
192 | 193 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
193 | 194 |
|
194 |
public static void Abort()
|
|
195 |
public void Abort() |
|
195 | 196 |
{ |
196 | 197 |
synchronized(lock) |
197 | 198 |
{ |
... | ... | |
205 | 206 |
|
206 | 207 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
207 | 208 |
|
208 |
public static void drawCurve(Canvas c, long time)
|
|
209 |
public void drawCurve(Canvas c, long time) |
|
209 | 210 |
{ |
210 | 211 |
synchronized(lock) |
211 | 212 |
{ |
Also available in: Unified diff
Tidy up 'Moving effects'