Revision b4cbe056
Added by Leszek Koltunski over 1 year ago
src/main/java/org/distorted/overlays/OverlayGeneric.java | ||
---|---|---|
11 | 11 |
|
12 | 12 |
import org.distorted.library.main.DistortedScreen; |
13 | 13 |
|
14 |
import java.lang.reflect.Method; |
|
15 |
|
|
14 | 16 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
15 | 17 |
|
16 | 18 |
public abstract class OverlayGeneric |
17 | 19 |
{ |
20 |
private enum Overlays |
|
21 |
{ |
|
22 |
STARS ( OverlayStars.class ) |
|
23 |
; |
|
24 |
|
|
25 |
private final Class<? extends OverlayGeneric> mClass; |
|
26 |
|
|
27 |
Overlays(Class<? extends OverlayGeneric> clazz) |
|
28 |
{ |
|
29 |
mClass = clazz; |
|
30 |
} |
|
31 |
} |
|
32 |
|
|
33 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
34 |
|
|
35 |
public static void enableEffects() |
|
36 |
{ |
|
37 |
Method method; |
|
38 |
|
|
39 |
for(Overlays overlay: Overlays.values() ) |
|
40 |
{ |
|
41 |
try |
|
42 |
{ |
|
43 |
method = overlay.mClass.getDeclaredMethod("enableEffects"); |
|
44 |
} |
|
45 |
catch(NoSuchMethodException ex) |
|
46 |
{ |
|
47 |
android.util.Log.e("OverlayGeneric", overlay.mClass.getSimpleName()+": exception getting method: "+ex.getMessage()); |
|
48 |
method = null; |
|
49 |
} |
|
50 |
|
|
51 |
try |
|
52 |
{ |
|
53 |
if( method!=null ) method.invoke(null); |
|
54 |
} |
|
55 |
catch(Exception ex) |
|
56 |
{ |
|
57 |
android.util.Log.e("OverlayGeneric", overlay.mClass.getSimpleName()+": exception invoking method: "+ex.getMessage()); |
|
58 |
} |
|
59 |
} |
|
60 |
} |
|
61 |
|
|
62 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
63 |
|
|
18 | 64 |
public abstract long startOverlay(DistortedScreen screen, ListenerOverlay listener, DataGeneric data); |
19 | 65 |
} |
Also available in: Unified diff
Disable writing DEPTH and STENCIL to the Screen from both the TwistyObjectNode and the Overlay Node.