Revision e50e7ba7
Added by Leszek Koltunski almost 4 years ago
src/main/java/org/distorted/examples/wind/WindGust.java | ||
---|---|---|
28 | 28 |
private static final long TIME_PERIOD = 1000; |
29 | 29 |
private int mAvgWind; |
30 | 30 |
private boolean mBlowingNow; |
31 |
private long mLastTime; |
|
31 |
private long mLastTime, mPausedTime;
|
|
32 | 32 |
private static Random mRnd = new Random(); |
33 | 33 |
|
34 | 34 |
WindGust() |
... | ... | |
45 | 45 |
mAvgWind = wind; |
46 | 46 |
} |
47 | 47 |
|
48 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
49 |
|
|
50 |
void pauseWind() |
|
51 |
{ |
|
52 |
mPausedTime = System.currentTimeMillis(); |
|
53 |
} |
|
54 |
|
|
55 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
56 |
|
|
57 |
void resumeWind() |
|
58 |
{ |
|
59 |
long gap = System.currentTimeMillis() - mPausedTime; |
|
60 |
mLastTime += gap; |
|
61 |
} |
|
62 |
|
|
48 | 63 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
49 | 64 |
|
50 | 65 |
boolean isWindBlowingNow(long currTime) |
Also available in: Unified diff
1) rename DistortedTexture's setColor to setColorARGB
2) fix the Wiind app to take into account paused time
3) fix the Dynamic so that if a single Dynamic is used more than once (in more than one effect) than it doesn't get adjusted for paused time multiple times.