Revision 95593730
Added by Leszek Koltunski over 8 years ago
src/main/java/org/distorted/examples/bean/BeanRenderer.java | ||
---|---|---|
9 | 9 |
|
10 | 10 |
import org.distorted.examples.R; |
11 | 11 |
|
12 |
import org.distorted.library.EffectTypes; |
|
12 | 13 |
import org.distorted.library.Interpolator2D; |
13 | 14 |
import org.distorted.library.Distorted; |
14 | 15 |
import org.distorted.library.DistortedBitmap; |
... | ... | |
83 | 84 |
|
84 | 85 |
public void onSurfaceChanged(GL10 glUnused, int width, int height) |
85 | 86 |
{ |
86 |
mBean.abortAllEffects(Distorted.TYPE_PRE);
|
|
87 |
mBean.abortAllEffects(EffectTypes.MATRIX.type);
|
|
87 | 88 |
|
88 | 89 |
if( bmpHeight/bmpWidth > height/width ) |
89 | 90 |
{ |
src/main/java/org/distorted/examples/check/CheckRenderer.java | ||
---|---|---|
11 | 11 |
|
12 | 12 |
import org.distorted.library.Distorted; |
13 | 13 |
import org.distorted.library.DistortedBitmap; |
14 |
import org.distorted.library.EffectTypes; |
|
14 | 15 |
import org.distorted.library.Float2D; |
15 | 16 |
import org.distorted.library.Float3D; |
16 | 17 |
|
... | ... | |
60 | 61 |
|
61 | 62 |
public void onSurfaceChanged(GL10 glUnused, int width, int height) |
62 | 63 |
{ |
63 |
mSuccess.abortAllEffects(Distorted.TYPE_PRE);
|
|
64 |
mSuccess.abortAllEffects(EffectTypes.MATRIX.type);
|
|
64 | 65 |
|
65 | 66 |
if( bmpHeight/bmpWidth > height/width ) |
66 | 67 |
{ |
src/main/java/org/distorted/examples/cubes/CubesRenderer.java | ||
---|---|---|
9 | 9 |
|
10 | 10 |
import org.distorted.examples.R; |
11 | 11 |
|
12 |
import org.distorted.library.EffectTypes; |
|
12 | 13 |
import org.distorted.library.InterpolatorQuat; |
13 | 14 |
import org.distorted.library.DistortedCubes; |
14 | 15 |
import org.distorted.library.Float4D; |
... | ... | |
78 | 79 |
{ |
79 | 80 |
mScreenMin = width<height ? width:height; |
80 | 81 |
|
81 |
mCubes.abortAllEffects(Distorted.TYPE_PRE);
|
|
82 |
mCubes.abortAllEffects(EffectTypes.MATRIX.type);
|
|
82 | 83 |
|
83 | 84 |
if( mRows/mCols > height/width ) |
84 | 85 |
{ |
src/main/java/org/distorted/examples/deform/DeformRenderer.java | ||
---|---|---|
6 | 6 |
|
7 | 7 |
import org.distorted.library.Distorted; |
8 | 8 |
import org.distorted.library.DistortedBitmap; |
9 |
import org.distorted.library.EffectTypes; |
|
9 | 10 |
import org.distorted.library.Interpolator2D; |
10 | 11 |
import org.distorted.library.Float3D; |
11 | 12 |
import org.distorted.library.Float4D; |
... | ... | |
141 | 142 |
} |
142 | 143 |
else |
143 | 144 |
{ |
144 |
stretch.abortAllEffects(Distorted.TYPE_FRAG|Distorted.TYPE_VERT);
|
|
145 |
stretch.abortAllEffects(EffectTypes.FRAGMENT.type|EffectTypes.VERTEX.type);
|
|
145 | 146 |
stretch.abortEffect(shearID); |
146 | 147 |
} |
147 | 148 |
} |
... | ... | |
202 | 203 |
|
203 | 204 |
public void down(int x, int y) |
204 | 205 |
{ |
205 |
stretch.abortAllEffects(Distorted.TYPE_FRAG|Distorted.TYPE_VERT);
|
|
206 |
stretch.abortAllEffects(EffectTypes.FRAGMENT.type|EffectTypes.VERTEX.type);
|
|
206 | 207 |
stretch.abortEffect(shearID); |
207 | 208 |
|
208 | 209 |
int xt = x-scrWidth/4; |
... | ... | |
248 | 249 |
|
249 | 250 |
public void up() |
250 | 251 |
{ |
251 |
stretch.abortAllEffects(Distorted.TYPE_FRAG|Distorted.TYPE_VERT);
|
|
252 |
stretch.abortAllEffects(EffectTypes.FRAGMENT.type|EffectTypes.VERTEX.type);
|
|
252 | 253 |
stretch.abortEffect(shearID); |
253 | 254 |
|
254 | 255 |
float damp = -0.65f; |
src/main/java/org/distorted/examples/differentbitmaps/DifferentBitmapsRenderer.java | ||
---|---|---|
11 | 11 |
|
12 | 12 |
import org.distorted.library.Distorted; |
13 | 13 |
import org.distorted.library.DistortedBitmap; |
14 |
import org.distorted.library.EffectTypes; |
|
14 | 15 |
import org.distorted.library.Float2D; |
15 | 16 |
import org.distorted.library.Float4D; |
16 | 17 |
import org.distorted.library.Interpolator2D; |
... | ... | |
92 | 93 |
{ |
93 | 94 |
for(int i=NUM-1; i>=0; i--) |
94 | 95 |
{ |
95 |
bmp[i].abortAllEffects(Distorted.TYPE_PRE);
|
|
96 |
bmp[i].abortAllEffects(EffectTypes.MATRIX.type);
|
|
96 | 97 |
} |
97 | 98 |
|
98 | 99 |
if( bmpHeight/(NUM*bmpWidth) > height/width ) |
src/main/java/org/distorted/examples/differenteffects/DifferentEffectsRenderer.java | ||
---|---|---|
11 | 11 |
|
12 | 12 |
import org.distorted.library.Distorted; |
13 | 13 |
import org.distorted.library.DistortedBitmap; |
14 |
import org.distorted.library.EffectTypes; |
|
14 | 15 |
import org.distorted.library.Float2D; |
15 | 16 |
import org.distorted.library.Float3D; |
16 | 17 |
import org.distorted.library.Float4D; |
... | ... | |
78 | 79 |
{ |
79 | 80 |
for(int i=NUM-1; i>=0; i--) |
80 | 81 |
{ |
81 |
bmp[i].abortAllEffects(Distorted.TYPE_PRE);
|
|
82 |
bmp[i].abortAllEffects(EffectTypes.MATRIX.type);
|
|
82 | 83 |
} |
83 | 84 |
|
84 | 85 |
if( bmpHeight/(NUM*bmpWidth) > height/width ) |
src/main/java/org/distorted/examples/effects3d/Effects3DRenderer.java | ||
---|---|---|
10 | 10 |
import org.distorted.examples.R; |
11 | 11 |
|
12 | 12 |
import org.distorted.library.DistortedCubes; |
13 |
import org.distorted.library.EffectTypes; |
|
13 | 14 |
import org.distorted.library.Float3D; |
14 | 15 |
import org.distorted.library.Float4D; |
15 | 16 |
import org.distorted.library.Interpolator3D; |
... | ... | |
78 | 79 |
|
79 | 80 |
public static void setMatrixEffects() |
80 | 81 |
{ |
81 |
mCube.abortAllEffects(Distorted.TYPE_PRE);
|
|
82 |
mCube.abortAllEffects(EffectTypes.MATRIX.type);
|
|
82 | 83 |
|
83 | 84 |
for( int i=0; i<=order.length-1 ; i++ ) |
84 | 85 |
{ |
src/main/java/org/distorted/examples/fbo/FBORenderer.java | ||
---|---|---|
12 | 12 |
import org.distorted.library.DistortedNode; |
13 | 13 |
import org.distorted.library.Distorted; |
14 | 14 |
import org.distorted.library.DistortedBitmap; |
15 |
import org.distorted.library.EffectTypes; |
|
15 | 16 |
import org.distorted.library.Float2D; |
16 | 17 |
|
17 | 18 |
import android.graphics.Bitmap; |
... | ... | |
50 | 51 |
|
51 | 52 |
public void onSurfaceChanged(GL10 glUnused, int width, int height) |
52 | 53 |
{ |
53 |
mLisa.abortAllEffects(Distorted.TYPE_PRE);
|
|
54 |
mLisa.abortAllEffects(EffectTypes.MATRIX.type);
|
|
54 | 55 |
|
55 | 56 |
if( lisaHeight/lisaWidth > height/width ) |
56 | 57 |
{ |
src/main/java/org/distorted/examples/girl/GirlRenderer.java | ||
---|---|---|
11 | 11 |
|
12 | 12 |
import org.distorted.library.Distorted; |
13 | 13 |
import org.distorted.library.DistortedBitmap; |
14 |
import org.distorted.library.EffectTypes; |
|
14 | 15 |
import org.distorted.library.Float1D; |
15 | 16 |
import org.distorted.library.Float2D; |
16 | 17 |
import org.distorted.library.Float3D; |
... | ... | |
148 | 149 |
|
149 | 150 |
public void onSurfaceChanged(GL10 glUnused, int width, int height) |
150 | 151 |
{ |
151 |
mGirl.abortAllEffects(Distorted.TYPE_PRE);
|
|
152 |
mGirl.abortAllEffects(EffectTypes.MATRIX.type);
|
|
152 | 153 |
|
153 | 154 |
if( bmpHeight/bmpWidth > height/width ) |
154 | 155 |
{ |
src/main/java/org/distorted/examples/interpolator/InterpolatorRenderer.java | ||
---|---|---|
12 | 12 |
|
13 | 13 |
import org.distorted.library.DistortedBitmap; |
14 | 14 |
import org.distorted.library.Distorted; |
15 |
import org.distorted.library.EffectTypes; |
|
15 | 16 |
|
16 | 17 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
17 | 18 |
|
... | ... | |
65 | 66 |
|
66 | 67 |
public void onSurfaceChanged(GL10 glUnused, int width, int height) |
67 | 68 |
{ |
68 |
mBackground.abortAllEffects(Distorted.TYPE_PRE);
|
|
69 |
mBackground.abortAllEffects(EffectTypes.MATRIX.type);
|
|
69 | 70 |
mBackground.scale((float)width/texWidth,(float)height/texHeight,1); |
70 | 71 |
Distorted.onSurfaceChanged(width, height); |
71 | 72 |
InterpolatorSurfaceView.setScreenSize(width,height); |
src/main/java/org/distorted/examples/listener/ListenerRenderer.java | ||
---|---|---|
12 | 12 |
|
13 | 13 |
import org.distorted.library.Distorted; |
14 | 14 |
import org.distorted.library.DistortedBitmap; |
15 |
import org.distorted.library.EffectTypes; |
|
15 | 16 |
import org.distorted.library.Float2D; |
16 | 17 |
import org.distorted.library.Float3D; |
17 | 18 |
import org.distorted.library.Float4D; |
... | ... | |
84 | 85 |
|
85 | 86 |
public void onSurfaceChanged(GL10 glUnused, int width, int height) |
86 | 87 |
{ |
87 |
water.abortAllEffects(Distorted.TYPE_PRE);
|
|
88 |
water.abortAllEffects(EffectTypes.MATRIX.type);
|
|
88 | 89 |
|
89 | 90 |
if( bmpHeight/bmpWidth > height/width ) |
90 | 91 |
{ |
src/main/java/org/distorted/examples/macroblock/MacroblockRenderer.java | ||
---|---|---|
9 | 9 |
import org.distorted.examples.R; |
10 | 10 |
import org.distorted.library.Distorted; |
11 | 11 |
import org.distorted.library.DistortedBitmap; |
12 |
import org.distorted.library.EffectTypes; |
|
12 | 13 |
import org.distorted.library.Interpolator1D; |
13 | 14 |
import org.distorted.library.Interpolator3D; |
14 | 15 |
import org.distorted.library.Float1D; |
... | ... | |
113 | 114 |
diRotate.add(new Float1D( 0)); |
114 | 115 |
diRotate.add(new Float1D(360)); |
115 | 116 |
|
116 |
macroblock.abortAllEffects(Distorted.TYPE_PRE);
|
|
117 |
macroblock.abortAllEffects(EffectTypes.MATRIX.type);
|
|
117 | 118 |
|
118 | 119 |
macroblock.move(diMove); |
119 | 120 |
macroblock.scale(diScale); |
src/main/java/org/distorted/examples/monalisa/MonaLisaRenderer.java | ||
---|---|---|
10 | 10 |
import org.distorted.examples.R; |
11 | 11 |
import org.distorted.library.Distorted; |
12 | 12 |
import org.distorted.library.DistortedBitmap; |
13 |
import org.distorted.library.EffectTypes; |
|
13 | 14 |
import org.distorted.library.Float2D; |
14 | 15 |
import org.distorted.library.Float3D; |
15 | 16 |
import org.distorted.library.Float4D; |
... | ... | |
60 | 61 |
|
61 | 62 |
public void onSurfaceChanged(GL10 glUnused, int width, int height) |
62 | 63 |
{ |
63 |
monaLisa.abortAllEffects(Distorted.TYPE_PRE);
|
|
64 |
monaLisa.abortAllEffects(EffectTypes.MATRIX.type);
|
|
64 | 65 |
|
65 | 66 |
if( bmpHeight/bmpWidth > height/width ) |
66 | 67 |
{ |
src/main/java/org/distorted/examples/movingeffects/MovingEffectsRenderer.java | ||
---|---|---|
12 | 12 |
|
13 | 13 |
import org.distorted.library.DistortedBitmap; |
14 | 14 |
import org.distorted.library.Distorted; |
15 |
import org.distorted.library.EffectTypes; |
|
15 | 16 |
|
16 | 17 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
17 | 18 |
|
... | ... | |
80 | 81 |
|
81 | 82 |
public void onSurfaceChanged(GL10 glUnused, int width, int height) |
82 | 83 |
{ |
83 |
mBackground.abortAllEffects(Distorted.TYPE_PRE);
|
|
84 |
mBackground.abortAllEffects(EffectTypes.MATRIX.type);
|
|
84 | 85 |
mBackground.scale((float)width/texWidth,(float)height/texHeight,1); |
85 | 86 |
|
86 | 87 |
Distorted.onSurfaceChanged(width, height); |
src/main/java/org/distorted/examples/movingeffects/MovingEffectsSurfaceView.java | ||
---|---|---|
9 | 9 |
import android.view.MotionEvent; |
10 | 10 |
import android.util.AttributeSet; |
11 | 11 |
|
12 |
import org.distorted.library.Distorted;
|
|
12 |
import org.distorted.library.EffectTypes;
|
|
13 | 13 |
import org.distorted.library.Float2D; |
14 | 14 |
import org.distorted.library.Float3D; |
15 | 15 |
import org.distorted.library.Float4D; |
... | ... | |
107 | 107 |
|
108 | 108 |
synchronized(lock) |
109 | 109 |
{ |
110 |
MovingEffectsRenderer.mBackground.abortAllEffects(Distorted.TYPE_FRAG|Distorted.TYPE_VERT);
|
|
110 |
MovingEffectsRenderer.mBackground.abortAllEffects(EffectTypes.FRAGMENT.type|EffectTypes.VERTEX.type);
|
|
111 | 111 |
MovingEffectsRenderer.mBackground.distort(di3D, dr, di2D); |
112 | 112 |
mCurrEffect = EFFECT_BUBBLE; |
113 | 113 |
} |
... | ... | |
121 | 121 |
|
122 | 122 |
synchronized(lock) |
123 | 123 |
{ |
124 |
MovingEffectsRenderer.mBackground.abortAllEffects(Distorted.TYPE_FRAG|Distorted.TYPE_VERT);
|
|
124 |
MovingEffectsRenderer.mBackground.abortAllEffects(EffectTypes.FRAGMENT.type|EffectTypes.VERTEX.type);
|
|
125 | 125 |
MovingEffectsRenderer.mBackground.sink(10.0f, dr, di2D, 0, 0.5f); |
126 | 126 |
mCurrEffect = EFFECT_SINK; |
127 | 127 |
} |
... | ... | |
135 | 135 |
|
136 | 136 |
synchronized(lock) |
137 | 137 |
{ |
138 |
MovingEffectsRenderer.mBackground.abortAllEffects(Distorted.TYPE_FRAG|Distorted.TYPE_VERT);
|
|
138 |
MovingEffectsRenderer.mBackground.abortAllEffects(EffectTypes.FRAGMENT.type|EffectTypes.VERTEX.type);
|
|
139 | 139 |
MovingEffectsRenderer.mBackground.macroblock(3, dr, di2D, 0, 0.5f); |
140 | 140 |
mCurrEffect = EFFECT_MACRO; |
141 | 141 |
} |
... | ... | |
149 | 149 |
|
150 | 150 |
synchronized(lock) |
151 | 151 |
{ |
152 |
MovingEffectsRenderer.mBackground.abortAllEffects(Distorted.TYPE_FRAG|Distorted.TYPE_VERT);
|
|
152 |
MovingEffectsRenderer.mBackground.abortAllEffects(EffectTypes.FRAGMENT.type|EffectTypes.VERTEX.type);
|
|
153 | 153 |
MovingEffectsRenderer.mBackground.smooth_alpha(0.5f, dr, di2D, 0, 0.5f); |
154 | 154 |
mCurrEffect = EFFECT_TRANS; |
155 | 155 |
} |
... | ... | |
163 | 163 |
|
164 | 164 |
synchronized(lock) |
165 | 165 |
{ |
166 |
MovingEffectsRenderer.mBackground.abortAllEffects(Distorted.TYPE_FRAG|Distorted.TYPE_VERT);
|
|
166 |
MovingEffectsRenderer.mBackground.abortAllEffects(EffectTypes.FRAGMENT.type|EffectTypes.VERTEX.type);
|
|
167 | 167 |
MovingEffectsRenderer.mBackground.swirl(30, dr, di2D, 0, 0.5f); |
168 | 168 |
mCurrEffect = EFFECT_SWIRL; |
169 | 169 |
} |
... | ... | |
175 | 175 |
{ |
176 | 176 |
synchronized(lock) |
177 | 177 |
{ |
178 |
MovingEffectsRenderer.mBackground.abortAllEffects(Distorted.TYPE_FRAG|Distorted.TYPE_VERT);
|
|
178 |
MovingEffectsRenderer.mBackground.abortAllEffects(EffectTypes.FRAGMENT.type|EffectTypes.VERTEX.type);
|
|
179 | 179 |
di2D.removeAll(); |
180 | 180 |
mCurrEffect = EFFECT_POINTS; |
181 | 181 |
} |
src/main/java/org/distorted/examples/olimpic/OlimpicRenderer.java | ||
---|---|---|
9 | 9 |
|
10 | 10 |
import org.distorted.examples.R; |
11 | 11 |
|
12 |
import org.distorted.library.EffectTypes; |
|
12 | 13 |
import org.distorted.library.Interpolator1D; |
13 | 14 |
import org.distorted.library.DistortedNode; |
14 | 15 |
import org.distorted.library.Float3D; |
... | ... | |
105 | 106 |
int bmpWidth = bmp.getWidth(); |
106 | 107 |
int bmpHeight = bmp.getHeight(); |
107 | 108 |
|
108 |
bmp.abortAllEffects(Distorted.TYPE_PRE);
|
|
109 |
bmp.abortAllEffects(EffectTypes.MATRIX.type);
|
|
109 | 110 |
|
110 | 111 |
if( bmpHeight/bmpWidth > height/width ) |
111 | 112 |
{ |
src/main/java/org/distorted/examples/plainmonalisa/RenderThread.java | ||
---|---|---|
14 | 14 |
|
15 | 15 |
import org.distorted.library.Distorted; |
16 | 16 |
import org.distorted.library.DistortedBitmap; |
17 |
import org.distorted.library.EffectTypes; |
|
17 | 18 |
import org.distorted.library.Float2D; |
18 | 19 |
import org.distorted.library.Float3D; |
19 | 20 |
import org.distorted.library.Float4D; |
... | ... | |
205 | 206 |
{ |
206 | 207 |
Log.d(TAG, "surfaceChanged " + width + "x" + height); |
207 | 208 |
|
208 |
monaLisa.abortAllEffects(Distorted.TYPE_PRE);
|
|
209 |
monaLisa.abortAllEffects(EffectTypes.MATRIX.type);
|
|
209 | 210 |
|
210 | 211 |
if( bmpHeight/bmpWidth > height/width ) |
211 | 212 |
{ |
src/main/java/org/distorted/examples/quaternion/QuaternionRenderer.java | ||
---|---|---|
10 | 10 |
|
11 | 11 |
import org.distorted.examples.R; |
12 | 12 |
|
13 |
import org.distorted.library.EffectTypes; |
|
13 | 14 |
import org.distorted.library.Interpolator; |
14 | 15 |
import org.distorted.library.InterpolatorQuat; |
15 | 16 |
import org.distorted.library.DistortedCubes; |
... | ... | |
76 | 77 |
|
77 | 78 |
public void onSurfaceChanged(GL10 glUnused, int width, int height) |
78 | 79 |
{ |
79 |
mCube.abortAllEffects(Distorted.TYPE_PRE);
|
|
80 |
mCube.abortAllEffects(EffectTypes.MATRIX.type);
|
|
80 | 81 |
|
81 | 82 |
if( width > height ) |
82 | 83 |
{ |
src/main/java/org/distorted/examples/scratchpad/ScratchpadRenderer.java | ||
---|---|---|
12 | 12 |
|
13 | 13 |
import org.distorted.library.DistortedBitmap; |
14 | 14 |
import org.distorted.library.Distorted; |
15 |
import org.distorted.library.EffectTypes; |
|
15 | 16 |
|
16 | 17 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
17 | 18 |
|
... | ... | |
75 | 76 |
|
76 | 77 |
public void onSurfaceChanged(GL10 glUnused, int width, int height) |
77 | 78 |
{ |
78 |
mBackground.abortAllEffects(Distorted.TYPE_PRE);
|
|
79 |
mBackground.abortAllEffects(EffectTypes.MATRIX.type);
|
|
79 | 80 |
mBackground.scale((float)width/texWidth,(float)height/texHeight,1); |
80 | 81 |
Distorted.onSurfaceChanged(width,height); |
81 | 82 |
ScratchpadSurfaceView.setScreenSize(width,height); |
src/main/java/org/distorted/examples/sink/SinkRenderer.java | ||
---|---|---|
11 | 11 |
|
12 | 12 |
import org.distorted.library.Distorted; |
13 | 13 |
import org.distorted.library.DistortedBitmap; |
14 |
import org.distorted.library.EffectTypes; |
|
14 | 15 |
import org.distorted.library.Float2D; |
15 | 16 |
import org.distorted.library.Float4D; |
16 | 17 |
|
... | ... | |
54 | 55 |
|
55 | 56 |
public void onSurfaceChanged(GL10 glUnused, int width, int height) |
56 | 57 |
{ |
57 |
sinkBmp.abortAllEffects(Distorted.TYPE_PRE);
|
|
58 |
sinkBmp.abortAllEffects(EffectTypes.MATRIX.type);
|
|
58 | 59 |
|
59 | 60 |
if( bmpHeight/bmpWidth > height/width ) |
60 | 61 |
{ |
Also available in: Unified diff
Introduce ENUM EffectTypes