Revision 7602a827
Added by Leszek Koltunski about 5 years ago
src/main/java/org/distorted/library/effectqueue/EffectQueue.java | ||
---|---|---|
1 | 1 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
2 | 2 |
// Copyright 2016 Leszek Koltunski // |
3 | 3 |
// // |
4 |
// This file is part of Distorted. // |
|
4 |
// This file is part of DistortedLibrary. //
|
|
5 | 5 |
// // |
6 |
// Distorted is free software: you can redistribute it and/or modify // |
|
6 |
// DistortedLibrary is free software: you can redistribute it and/or modify //
|
|
7 | 7 |
// it under the terms of the GNU General Public License as published by // |
8 | 8 |
// the Free Software Foundation, either version 2 of the License, or // |
9 | 9 |
// (at your option) any later version. // |
10 | 10 |
// // |
11 |
// Distorted is distributed in the hope that it will be useful, // |
|
11 |
// DistortedLibrary is distributed in the hope that it will be useful, //
|
|
12 | 12 |
// but WITHOUT ANY WARRANTY; without even the implied warranty of // |
13 | 13 |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // |
14 | 14 |
// GNU General Public License for more details. // |
15 | 15 |
// // |
16 | 16 |
// You should have received a copy of the GNU General Public License // |
17 |
// along with Distorted. If not, see <http://www.gnu.org/licenses/>. // |
|
17 |
// along with DistortedLibrary. If not, see <http://www.gnu.org/licenses/>. //
|
|
18 | 18 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
19 | 19 |
|
20 | 20 |
package org.distorted.library.effectqueue; |
... | ... | |
22 | 22 |
import org.distorted.library.effect.Effect; |
23 | 23 |
import org.distorted.library.effect.EffectName; |
24 | 24 |
import org.distorted.library.effect.EffectType; |
25 |
import org.distorted.library.main.Distorted; |
|
26 |
import org.distorted.library.main.DistortedMaster;
|
|
25 |
import org.distorted.library.main.DistortedLibrary;
|
|
26 |
import org.distorted.library.main.InternalMaster;
|
|
27 | 27 |
import org.distorted.library.message.EffectListener; |
28 | 28 |
import org.distorted.library.message.EffectMessage; |
29 | 29 |
import org.distorted.library.message.EffectMessageSender; |
... | ... | |
37 | 37 |
* |
38 | 38 |
* @y.exclude |
39 | 39 |
*/ |
40 |
public abstract class EffectQueue implements DistortedMaster.Slave
|
|
40 |
public abstract class EffectQueue implements InternalMaster.Slave
|
|
41 | 41 |
{ |
42 | 42 |
static final int MAIN_VARIANTS = 3; // Number of Main program variants (ATM 3: MAIN, MAIN OIT, PREPROCESS) |
43 | 43 |
|
... | ... | |
100 | 100 |
mIndex = index; |
101 | 101 |
|
102 | 102 |
mJobs.add(new Job(CREATE,numUniforms,false,null)); // create the stuff that depends on max number |
103 |
DistortedMaster.newSlave(this); // of uniforms later, on first render.
|
|
103 |
InternalMaster.newSlave(this); // of uniforms later, on first render.
|
|
104 | 104 |
} |
105 | 105 |
|
106 | 106 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
107 | 107 |
|
108 | 108 |
public static void allocateQueues(EffectQueue[] queues, EffectQueue[] from, int flags, long id) |
109 | 109 |
{ |
110 |
queues[0] = (flags & Distorted.CLONE_MATRIX ) != 0 ? from[0] : new EffectQueueMatrix(id); |
|
111 |
queues[1] = (flags & Distorted.CLONE_VERTEX ) != 0 ? from[1] : new EffectQueueVertex(id); |
|
112 |
queues[2] = (flags & Distorted.CLONE_FRAGMENT ) != 0 ? from[2] : new EffectQueueFragment(id); |
|
113 |
queues[3] = (flags & Distorted.CLONE_POSTPROCESS) != 0 ? from[3] : new EffectQueuePostprocess(id); |
|
110 |
queues[0] = (flags & DistortedLibrary.CLONE_MATRIX ) != 0 ? from[0] : new EffectQueueMatrix(id);
|
|
111 |
queues[1] = (flags & DistortedLibrary.CLONE_VERTEX ) != 0 ? from[1] : new EffectQueueVertex(id);
|
|
112 |
queues[2] = (flags & DistortedLibrary.CLONE_FRAGMENT ) != 0 ? from[2] : new EffectQueueFragment(id);
|
|
113 |
queues[3] = (flags & DistortedLibrary.CLONE_POSTPROCESS) != 0 ? from[3] : new EffectQueuePostprocess(id);
|
|
114 | 114 |
} |
115 | 115 |
|
116 | 116 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
189 | 189 |
|
190 | 190 |
public static boolean setMax(int index, int m) |
191 | 191 |
{ |
192 |
if( !Distorted.isInitialized() || m<=mMax[index] ) |
|
192 |
if( !DistortedLibrary.isInitialized() || m<=mMax[index] )
|
|
193 | 193 |
{ |
194 | 194 |
mMax[index] = m<0 ? 0:m; |
195 | 195 |
return true; |
... | ... | |
276 | 276 |
|
277 | 277 |
if( ret>0 ) |
278 | 278 |
{ |
279 |
DistortedMaster.newSlave(this);
|
|
279 |
InternalMaster.newSlave(this);
|
|
280 | 280 |
mNumEffectsToBe-=ret; |
281 | 281 |
} |
282 | 282 |
|
... | ... | |
292 | 292 |
if( mEffects[i].getID() == id ) |
293 | 293 |
{ |
294 | 294 |
mJobs.add(new Job(DETACH,0,true,mEffects[i])); |
295 |
DistortedMaster.newSlave(this);
|
|
295 |
InternalMaster.newSlave(this);
|
|
296 | 296 |
mNumEffectsToBe--; |
297 | 297 |
return 1; |
298 | 298 |
} |
... | ... | |
310 | 310 |
if( mEffects[i]==effect ) |
311 | 311 |
{ |
312 | 312 |
mJobs.add(new Job(DETACH,0,true,mEffects[i])); |
313 |
DistortedMaster.newSlave(this);
|
|
313 |
InternalMaster.newSlave(this);
|
|
314 | 314 |
mNumEffectsToBe--; |
315 | 315 |
return 1; |
316 | 316 |
} |
... | ... | |
326 | 326 |
public synchronized int abortAll(boolean notify) |
327 | 327 |
{ |
328 | 328 |
mJobs.add(new Job(DETALL,0,notify,null)); |
329 |
DistortedMaster.newSlave(this);
|
|
329 |
InternalMaster.newSlave(this);
|
|
330 | 330 |
mNumEffectsToBe = 0; |
331 | 331 |
return mNumEffects; |
332 | 332 |
} |
... | ... | |
338 | 338 |
if( mMax[mIndex]>mNumEffectsToBe || !mCreated ) |
339 | 339 |
{ |
340 | 340 |
mJobs.add(new Job(ATTACH,0,false,effect)); |
341 |
DistortedMaster.newSlave(this);
|
|
341 |
InternalMaster.newSlave(this);
|
|
342 | 342 |
mNumEffectsToBe++; |
343 | 343 |
return true; |
344 | 344 |
} |
Also available in: Unified diff
Rename all the classes that are not exported to application to 'Internal'