Revision a8c3ada7
Added by Leszek Koltunski over 8 years ago
src/main/java/org/distorted/examples/bean/BeanRenderer.java | ||
---|---|---|
84 | 84 |
|
85 | 85 |
public void onSurfaceChanged(GL10 glUnused, int width, int height) |
86 | 86 |
{ |
87 |
mBean.abortAllEffects(EffectTypes.MATRIX.type);
|
|
87 |
mBean.abortEffects(EffectTypes.MATRIX);
|
|
88 | 88 |
|
89 | 89 |
if( bmpHeight/bmpWidth > height/width ) |
90 | 90 |
{ |
src/main/java/org/distorted/examples/check/CheckRenderer.java | ||
---|---|---|
61 | 61 |
|
62 | 62 |
public void onSurfaceChanged(GL10 glUnused, int width, int height) |
63 | 63 |
{ |
64 |
mSuccess.abortAllEffects(EffectTypes.MATRIX.type);
|
|
64 |
mSuccess.abortEffects(EffectTypes.MATRIX);
|
|
65 | 65 |
|
66 | 66 |
if( bmpHeight/bmpWidth > height/width ) |
67 | 67 |
{ |
src/main/java/org/distorted/examples/cubes/CubesRenderer.java | ||
---|---|---|
79 | 79 |
{ |
80 | 80 |
mScreenMin = width<height ? width:height; |
81 | 81 |
|
82 |
mCubes.abortAllEffects(EffectTypes.MATRIX.type);
|
|
82 |
mCubes.abortEffects(EffectTypes.MATRIX);
|
|
83 | 83 |
|
84 | 84 |
if( mRows/mCols > height/width ) |
85 | 85 |
{ |
src/main/java/org/distorted/examples/deform/DeformRenderer.java | ||
---|---|---|
142 | 142 |
} |
143 | 143 |
else |
144 | 144 |
{ |
145 |
stretch.abortAllEffects(EffectTypes.FRAGMENT.type|EffectTypes.VERTEX.type); |
|
145 |
stretch.abortEffects(EffectTypes.VERTEX); |
|
146 |
stretch.abortEffects(EffectTypes.FRAGMENT); |
|
146 | 147 |
stretch.abortEffect(shearID); |
147 | 148 |
} |
148 | 149 |
} |
... | ... | |
203 | 204 |
|
204 | 205 |
public void down(int x, int y) |
205 | 206 |
{ |
206 |
stretch.abortAllEffects(EffectTypes.FRAGMENT.type|EffectTypes.VERTEX.type); |
|
207 |
stretch.abortEffects(EffectTypes.VERTEX); |
|
208 |
stretch.abortEffects(EffectTypes.FRAGMENT); |
|
207 | 209 |
stretch.abortEffect(shearID); |
208 | 210 |
|
209 | 211 |
int xt = x-scrWidth/4; |
... | ... | |
249 | 251 |
|
250 | 252 |
public void up() |
251 | 253 |
{ |
252 |
stretch.abortAllEffects(EffectTypes.FRAGMENT.type|EffectTypes.VERTEX.type); |
|
254 |
stretch.abortEffects(EffectTypes.VERTEX); |
|
255 |
stretch.abortEffects(EffectTypes.FRAGMENT); |
|
253 | 256 |
stretch.abortEffect(shearID); |
254 | 257 |
|
255 | 258 |
float damp = -0.65f; |
src/main/java/org/distorted/examples/differentbitmaps/DifferentBitmapsRenderer.java | ||
---|---|---|
93 | 93 |
{ |
94 | 94 |
for(int i=NUM-1; i>=0; i--) |
95 | 95 |
{ |
96 |
bmp[i].abortAllEffects(EffectTypes.MATRIX.type);
|
|
96 |
bmp[i].abortEffects(EffectTypes.MATRIX);
|
|
97 | 97 |
} |
98 | 98 |
|
99 | 99 |
if( bmpHeight/(NUM*bmpWidth) > height/width ) |
src/main/java/org/distorted/examples/differenteffects/DifferentEffectsRenderer.java | ||
---|---|---|
79 | 79 |
{ |
80 | 80 |
for(int i=NUM-1; i>=0; i--) |
81 | 81 |
{ |
82 |
bmp[i].abortAllEffects(EffectTypes.MATRIX.type);
|
|
82 |
bmp[i].abortEffects(EffectTypes.MATRIX);
|
|
83 | 83 |
} |
84 | 84 |
|
85 | 85 |
if( bmpHeight/(NUM*bmpWidth) > height/width ) |
src/main/java/org/distorted/examples/effects3d/Effects3DRenderer.java | ||
---|---|---|
79 | 79 |
|
80 | 80 |
public static void setMatrixEffects() |
81 | 81 |
{ |
82 |
mCube.abortAllEffects(EffectTypes.MATRIX.type);
|
|
82 |
mCube.abortEffects(EffectTypes.MATRIX);
|
|
83 | 83 |
|
84 | 84 |
for( int i=0; i<=order.length-1 ; i++ ) |
85 | 85 |
{ |
src/main/java/org/distorted/examples/fbo/FBORenderer.java | ||
---|---|---|
51 | 51 |
|
52 | 52 |
public void onSurfaceChanged(GL10 glUnused, int width, int height) |
53 | 53 |
{ |
54 |
mLisa.abortAllEffects(EffectTypes.MATRIX.type);
|
|
54 |
mLisa.abortEffects(EffectTypes.MATRIX);
|
|
55 | 55 |
|
56 | 56 |
if( lisaHeight/lisaWidth > height/width ) |
57 | 57 |
{ |
src/main/java/org/distorted/examples/girl/GirlRenderer.java | ||
---|---|---|
149 | 149 |
|
150 | 150 |
public void onSurfaceChanged(GL10 glUnused, int width, int height) |
151 | 151 |
{ |
152 |
mGirl.abortAllEffects(EffectTypes.MATRIX.type);
|
|
152 |
mGirl.abortEffects(EffectTypes.MATRIX);
|
|
153 | 153 |
|
154 | 154 |
if( bmpHeight/bmpWidth > height/width ) |
155 | 155 |
{ |
src/main/java/org/distorted/examples/interpolator/InterpolatorRenderer.java | ||
---|---|---|
66 | 66 |
|
67 | 67 |
public void onSurfaceChanged(GL10 glUnused, int width, int height) |
68 | 68 |
{ |
69 |
mBackground.abortAllEffects(EffectTypes.MATRIX.type);
|
|
69 |
mBackground.abortEffects(EffectTypes.MATRIX);
|
|
70 | 70 |
mBackground.scale((float)width/texWidth,(float)height/texHeight,1); |
71 | 71 |
Distorted.onSurfaceChanged(width, height); |
72 | 72 |
InterpolatorSurfaceView.setScreenSize(width,height); |
src/main/java/org/distorted/examples/listener/ListenerRenderer.java | ||
---|---|---|
47 | 47 |
|
48 | 48 |
private long randomizeNewBubble() |
49 | 49 |
{ |
50 |
int radius = (int)((0.10f + 0.70f*mRnd.nextFloat())*bmpWidth); // pop up a bubble of size (radius,height)
|
|
50 |
int radius = (int)(( 0.10f + 0.70f*mRnd.nextFloat())*bmpWidth); // pop up a bubble of size (radius,height)
|
|
51 | 51 |
int height = (int)((-0.10f + 0.20f*mRnd.nextFloat())*bmpWidth); // |
52 |
int pointx = mRnd.nextInt( (int)(0.8f*bmpWidth)) + (int)(0.1f*bmpWidth); // at a random place on the bitmap (but not near the edge)
|
|
52 |
int pointx = mRnd.nextInt( (int)(0.8f*bmpWidth ))+ (int)(0.1f*bmpWidth ); // at a random place on the bitmap (but not near the edge)
|
|
53 | 53 |
int pointy = mRnd.nextInt( (int)(0.8f*bmpHeight))+ (int)(0.1f*bmpHeight); // |
54 | 54 |
int duration = 1000 + mRnd.nextInt(3000); // for anytime from 3 to 4 seconds |
55 | 55 |
|
... | ... | |
85 | 85 |
|
86 | 86 |
public void onSurfaceChanged(GL10 glUnused, int width, int height) |
87 | 87 |
{ |
88 |
water.abortAllEffects(EffectTypes.MATRIX.type);
|
|
88 |
water.abortEffects(EffectTypes.MATRIX);
|
|
89 | 89 |
|
90 | 90 |
if( bmpHeight/bmpWidth > height/width ) |
91 | 91 |
{ |
src/main/java/org/distorted/examples/macroblock/MacroblockRenderer.java | ||
---|---|---|
114 | 114 |
diRotate.add(new Float1D( 0)); |
115 | 115 |
diRotate.add(new Float1D(360)); |
116 | 116 |
|
117 |
macroblock.abortAllEffects(EffectTypes.MATRIX.type);
|
|
117 |
macroblock.abortEffects(EffectTypes.MATRIX);
|
|
118 | 118 |
|
119 | 119 |
macroblock.move(diMove); |
120 | 120 |
macroblock.scale(diScale); |
src/main/java/org/distorted/examples/monalisa/MonaLisaRenderer.java | ||
---|---|---|
61 | 61 |
|
62 | 62 |
public void onSurfaceChanged(GL10 glUnused, int width, int height) |
63 | 63 |
{ |
64 |
monaLisa.abortAllEffects(EffectTypes.MATRIX.type);
|
|
64 |
monaLisa.abortEffects(EffectTypes.MATRIX);
|
|
65 | 65 |
|
66 | 66 |
if( bmpHeight/bmpWidth > height/width ) |
67 | 67 |
{ |
src/main/java/org/distorted/examples/movingeffects/MovingEffectsRenderer.java | ||
---|---|---|
81 | 81 |
|
82 | 82 |
public void onSurfaceChanged(GL10 glUnused, int width, int height) |
83 | 83 |
{ |
84 |
mBackground.abortAllEffects(EffectTypes.MATRIX.type);
|
|
84 |
mBackground.abortEffects(EffectTypes.MATRIX);
|
|
85 | 85 |
mBackground.scale((float)width/texWidth,(float)height/texHeight,1); |
86 | 86 |
|
87 | 87 |
Distorted.onSurfaceChanged(width, height); |
src/main/java/org/distorted/examples/movingeffects/MovingEffectsSurfaceView.java | ||
---|---|---|
107 | 107 |
|
108 | 108 |
synchronized(lock) |
109 | 109 |
{ |
110 |
MovingEffectsRenderer.mBackground.abortAllEffects(EffectTypes.FRAGMENT.type|EffectTypes.VERTEX.type); |
|
110 |
MovingEffectsRenderer.mBackground.abortEffects(EffectTypes.VERTEX); |
|
111 |
MovingEffectsRenderer.mBackground.abortEffects(EffectTypes.FRAGMENT); |
|
111 | 112 |
MovingEffectsRenderer.mBackground.distort(di3D, dr, di2D); |
112 | 113 |
mCurrEffect = EFFECT_BUBBLE; |
113 | 114 |
} |
... | ... | |
121 | 122 |
|
122 | 123 |
synchronized(lock) |
123 | 124 |
{ |
124 |
MovingEffectsRenderer.mBackground.abortAllEffects(EffectTypes.FRAGMENT.type|EffectTypes.VERTEX.type); |
|
125 |
MovingEffectsRenderer.mBackground.sink(10.0f, dr, di2D, 0, 0.5f); |
|
125 |
MovingEffectsRenderer.mBackground.abortEffects(EffectTypes.VERTEX); |
|
126 |
MovingEffectsRenderer.mBackground.abortEffects(EffectTypes.FRAGMENT); |
|
127 |
MovingEffectsRenderer.mBackground.sink(10.0f, dr, di2D, 0, 0.5f); |
|
126 | 128 |
mCurrEffect = EFFECT_SINK; |
127 | 129 |
} |
128 | 130 |
} |
... | ... | |
135 | 137 |
|
136 | 138 |
synchronized(lock) |
137 | 139 |
{ |
138 |
MovingEffectsRenderer.mBackground.abortAllEffects(EffectTypes.FRAGMENT.type|EffectTypes.VERTEX.type); |
|
140 |
MovingEffectsRenderer.mBackground.abortEffects(EffectTypes.VERTEX); |
|
141 |
MovingEffectsRenderer.mBackground.abortEffects(EffectTypes.FRAGMENT); |
|
139 | 142 |
MovingEffectsRenderer.mBackground.macroblock(3, dr, di2D, 0, 0.5f); |
140 | 143 |
mCurrEffect = EFFECT_MACRO; |
141 | 144 |
} |
... | ... | |
149 | 152 |
|
150 | 153 |
synchronized(lock) |
151 | 154 |
{ |
152 |
MovingEffectsRenderer.mBackground.abortAllEffects(EffectTypes.FRAGMENT.type|EffectTypes.VERTEX.type); |
|
155 |
MovingEffectsRenderer.mBackground.abortEffects(EffectTypes.VERTEX); |
|
156 |
MovingEffectsRenderer.mBackground.abortEffects(EffectTypes.FRAGMENT); |
|
153 | 157 |
MovingEffectsRenderer.mBackground.smooth_alpha(0.5f, dr, di2D, 0, 0.5f); |
154 | 158 |
mCurrEffect = EFFECT_TRANS; |
155 | 159 |
} |
... | ... | |
163 | 167 |
|
164 | 168 |
synchronized(lock) |
165 | 169 |
{ |
166 |
MovingEffectsRenderer.mBackground.abortAllEffects(EffectTypes.FRAGMENT.type|EffectTypes.VERTEX.type); |
|
170 |
MovingEffectsRenderer.mBackground.abortEffects(EffectTypes.VERTEX); |
|
171 |
MovingEffectsRenderer.mBackground.abortEffects(EffectTypes.FRAGMENT); |
|
167 | 172 |
MovingEffectsRenderer.mBackground.swirl(30, dr, di2D, 0, 0.5f); |
168 | 173 |
mCurrEffect = EFFECT_SWIRL; |
169 | 174 |
} |
... | ... | |
175 | 180 |
{ |
176 | 181 |
synchronized(lock) |
177 | 182 |
{ |
178 |
MovingEffectsRenderer.mBackground.abortAllEffects(EffectTypes.FRAGMENT.type|EffectTypes.VERTEX.type); |
|
183 |
MovingEffectsRenderer.mBackground.abortEffects(EffectTypes.VERTEX); |
|
184 |
MovingEffectsRenderer.mBackground.abortEffects(EffectTypes.FRAGMENT); |
|
179 | 185 |
di2D.removeAll(); |
180 | 186 |
mCurrEffect = EFFECT_POINTS; |
181 | 187 |
} |
src/main/java/org/distorted/examples/olimpic/OlimpicRenderer.java | ||
---|---|---|
106 | 106 |
int bmpWidth = bmp.getWidth(); |
107 | 107 |
int bmpHeight = bmp.getHeight(); |
108 | 108 |
|
109 |
bmp.abortAllEffects(EffectTypes.MATRIX.type);
|
|
109 |
bmp.abortEffects(EffectTypes.MATRIX);
|
|
110 | 110 |
|
111 | 111 |
if( bmpHeight/bmpWidth > height/width ) |
112 | 112 |
{ |
src/main/java/org/distorted/examples/plainmonalisa/RenderThread.java | ||
---|---|---|
206 | 206 |
{ |
207 | 207 |
Log.d(TAG, "surfaceChanged " + width + "x" + height); |
208 | 208 |
|
209 |
monaLisa.abortAllEffects(EffectTypes.MATRIX.type);
|
|
209 |
monaLisa.abortEffects(EffectTypes.MATRIX);
|
|
210 | 210 |
|
211 | 211 |
if( bmpHeight/bmpWidth > height/width ) |
212 | 212 |
{ |
src/main/java/org/distorted/examples/quaternion/QuaternionRenderer.java | ||
---|---|---|
77 | 77 |
|
78 | 78 |
public void onSurfaceChanged(GL10 glUnused, int width, int height) |
79 | 79 |
{ |
80 |
mCube.abortAllEffects(EffectTypes.MATRIX.type);
|
|
80 |
mCube.abortEffects(EffectTypes.MATRIX);
|
|
81 | 81 |
|
82 | 82 |
if( width > height ) |
83 | 83 |
{ |
src/main/java/org/distorted/examples/scratchpad/ScratchpadRenderer.java | ||
---|---|---|
76 | 76 |
|
77 | 77 |
public void onSurfaceChanged(GL10 glUnused, int width, int height) |
78 | 78 |
{ |
79 |
mBackground.abortAllEffects(EffectTypes.MATRIX.type);
|
|
79 |
mBackground.abortEffects(EffectTypes.MATRIX);
|
|
80 | 80 |
mBackground.scale((float)width/texWidth,(float)height/texHeight,1); |
81 | 81 |
Distorted.onSurfaceChanged(width,height); |
82 | 82 |
ScratchpadSurfaceView.setScreenSize(width,height); |
src/main/java/org/distorted/examples/sink/SinkRenderer.java | ||
---|---|---|
55 | 55 |
|
56 | 56 |
public void onSurfaceChanged(GL10 glUnused, int width, int height) |
57 | 57 |
{ |
58 |
sinkBmp.abortAllEffects(EffectTypes.MATRIX.type);
|
|
58 |
sinkBmp.abortEffects(EffectTypes.MATRIX);
|
|
59 | 59 |
|
60 | 60 |
if( bmpHeight/bmpWidth > height/width ) |
61 | 61 |
{ |
Also available in: Unified diff
Improve aborting Effects.