Revision 8d5a8e06
Added by Leszek Koltunski about 5 years ago
src/main/java/org/distorted/examples/rubik/RubikRenderer.java | ||
---|---|---|
25 | 25 |
import org.distorted.library.main.DistortedLibrary; |
26 | 26 |
import org.distorted.library.main.DistortedScreen; |
27 | 27 |
import org.distorted.library.message.EffectListener; |
28 |
import org.distorted.library.message.EffectMessage; |
|
29 | 28 |
import org.distorted.library.type.Static3D; |
30 | 29 |
|
31 | 30 |
import javax.microedition.khronos.egl.EGLConfig; |
... | ... | |
84 | 83 |
} |
85 | 84 |
|
86 | 85 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
87 |
// EffectListener. The library sends a message to us when it's time to create a new cube. |
|
88 | 86 |
|
89 |
public void effectMessage(final EffectMessage em, final long effectID, final long objectID)
|
|
87 |
public void effectFinished(final long effectID)
|
|
90 | 88 |
{ |
91 |
switch(em) |
|
92 |
{ |
|
93 |
case EFFECT_FINISHED: mNextCubeSize++; |
|
94 |
if( mNextCubeSize> MAX_CUBE_SIZE ) mNextCubeSize = MIN_CUBE_SIZE; |
|
95 |
mChangeCubeSizeNow = true; |
|
96 |
break; |
|
97 |
} |
|
89 |
mNextCubeSize++; |
|
90 |
if( mNextCubeSize> MAX_CUBE_SIZE ) mNextCubeSize = MIN_CUBE_SIZE; |
|
91 |
mChangeCubeSizeNow = true; |
|
98 | 92 |
} |
99 | 93 |
|
100 | 94 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
Also available in: Unified diff
Simplify the way applications can get notifications when an effect finishes.
Now, instead of the 'DistortedEffects.(de)registerForNotifications()' 2 APIs, we call a single 'Effect.notifyWhenFinished()'.