Revision 71887484
Added by Leszek Koltunski over 9 years ago
| src/main/java/org/distorted/library/EffectQueueOther.java | ||
|---|---|---|
| 2 | 2 |
|
| 3 | 3 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
| 4 | 4 |
|
| 5 |
import java.util.Vector; |
|
| 6 |
|
|
| 7 |
/** |
|
| 8 |
* Do NOT base this on EffectQueue - this is an entirely different animal than the first 3 EffectLists. |
|
| 9 |
* The Effects in here will be executed after all the shaders have been executed - thus there are no |
|
| 10 |
* uniforms to send, no real queues to maintain. |
|
| 11 |
* <p> |
|
| 12 |
* Only 2 effects here ATM: |
|
| 13 |
* - save current Surface to a PNG file |
|
| 14 |
* - save current animation to a .MP4 file |
|
| 15 |
* |
|
| 16 |
* In contrast to the other EffectLists, only one instance of each allowed at any given moment - thus |
|
| 17 |
* this is not even a real EffectQueue, it is named so only for consistency with the others. |
|
| 18 |
*/ |
|
| 19 |
public class EffectQueueOther |
|
| 5 |
class EffectQueueOther extends EffectQueue |
|
| 20 | 6 |
{
|
| 21 |
private Vector<EffectListener> mListeners =null;
|
|
| 22 |
private int mNumListeners=0; // ==mListeners.length(), but we only create mListeners if the first one gets added
|
|
| 7 |
private static final int NUM_UNIFORMS = 0;
|
|
| 8 |
private static final int INDEX = EffectTypes.OTHER.ordinal();
|
|
| 23 | 9 |
|
| 24 | 10 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
| 25 | 11 |
|
| 26 | 12 |
public EffectQueueOther(DistortedObject obj) |
| 27 | 13 |
{
|
| 28 |
|
|
| 14 |
super(obj,NUM_UNIFORMS, INDEX ); |
|
| 29 | 15 |
} |
| 30 | 16 |
|
| 31 | 17 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
| 18 |
// There are no Uniforms, nothing to move |
|
| 32 | 19 |
|
| 33 |
synchronized void send()
|
|
| 20 |
protected void moveEffect(int index)
|
|
| 34 | 21 |
{
|
| 35 | 22 |
|
| 36 | 23 |
} |
| 37 | 24 |
|
| 38 | 25 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
| 39 | 26 |
|
| 40 |
synchronized int abortAll() |
|
| 41 |
{
|
|
| 42 |
|
|
| 43 |
return 0; |
|
| 44 |
} |
|
| 45 |
|
|
| 46 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
| 47 |
|
|
| 48 |
void addListener(EffectListener el) |
|
| 49 |
{
|
|
| 50 |
if( mListeners==null ) mListeners = new Vector<>(2,2); |
|
| 51 |
|
|
| 52 |
mListeners.add(el); |
|
| 53 |
mNumListeners++; |
|
| 54 |
} |
|
| 55 |
|
|
| 56 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
| 57 |
|
|
| 58 |
void removeListener(EffectListener el) |
|
| 59 |
{
|
|
| 60 |
if( mNumListeners>0 ) |
|
| 61 |
{
|
|
| 62 |
mListeners.remove(el); |
|
| 63 |
mNumListeners--; |
|
| 64 |
} |
|
| 65 |
} |
|
| 66 |
|
|
| 67 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
| 68 |
|
|
| 69 |
synchronized boolean removeByID(long id) |
|
| 70 |
{
|
|
| 71 |
//.... |
|
| 72 |
|
|
| 73 |
return false; |
|
| 74 |
} |
|
| 75 |
|
|
| 76 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
| 77 |
|
|
| 78 |
synchronized boolean removeByType(EffectNames effect) |
|
| 27 |
synchronized void send() |
|
| 79 | 28 |
{
|
| 80 |
// ... |
|
| 81 |
|
|
| 82 |
return false; |
|
| 83 |
} |
|
| 84 |
|
|
| 85 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
| 86 | 29 |
|
| 87 |
protected boolean printByID(long id) |
|
| 88 |
{
|
|
| 89 |
return false; |
|
| 90 | 30 |
} |
| 91 | 31 |
|
| 92 | 32 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
Also available in: Unified diff
abstract setMax and getMax to EffectQueue.