1 |
08f92d82
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
2 |
|
|
// Copyright 2016 Leszek Koltunski //
|
3 |
|
|
// //
|
4 |
|
|
// This file is part of Distorted. //
|
5 |
|
|
// //
|
6 |
|
|
// Distorted is free software: you can redistribute it and/or modify //
|
7 |
|
|
// it under the terms of the GNU General Public License as published by //
|
8 |
|
|
// the Free Software Foundation, either version 2 of the License, or //
|
9 |
|
|
// (at your option) any later version. //
|
10 |
|
|
// //
|
11 |
|
|
// Distorted is distributed in the hope that it will be useful, //
|
12 |
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
13 |
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
14 |
|
|
// GNU General Public License for more details. //
|
15 |
|
|
// //
|
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/>. //
|
18 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
19 |
|
|
|
20 |
76a81b6a
|
Leszek Koltunski
|
package org.distorted.examples.effects3d;
|
21 |
08f92d82
|
Leszek Koltunski
|
|
22 |
|
|
import android.app.Activity;
|
23 |
9167cfd4
|
Leszek Koltunski
|
import android.graphics.Bitmap;
|
24 |
|
|
import android.graphics.BitmapFactory;
|
25 |
|
|
import android.graphics.Canvas;
|
26 |
|
|
import android.graphics.Paint;
|
27 |
08f92d82
|
Leszek Koltunski
|
import android.opengl.GLSurfaceView;
|
28 |
|
|
import android.os.Bundle;
|
29 |
d40cfeb2
|
Leszek Koltunski
|
import android.view.Gravity;
|
30 |
08f92d82
|
Leszek Koltunski
|
import android.view.View;
|
31 |
50ac40a6
|
Leszek Koltunski
|
import android.widget.AdapterView;
|
32 |
|
|
import android.widget.ArrayAdapter;
|
33 |
d40cfeb2
|
Leszek Koltunski
|
import android.widget.Button;
|
34 |
0ab55f0c
|
Leszek Koltunski
|
import android.widget.CheckBox;
|
35 |
08f92d82
|
Leszek Koltunski
|
import android.widget.LinearLayout;
|
36 |
d40cfeb2
|
Leszek Koltunski
|
import android.widget.NumberPicker;
|
37 |
50ac40a6
|
Leszek Koltunski
|
import android.widget.Spinner;
|
38 |
d40cfeb2
|
Leszek Koltunski
|
import android.widget.TableRow;
|
39 |
08f92d82
|
Leszek Koltunski
|
|
40 |
|
|
import org.distorted.examples.R;
|
41 |
01782e85
|
Leszek Koltunski
|
import org.distorted.library.main.Distorted;
|
42 |
|
|
import org.distorted.library.main.MeshCubes;
|
43 |
|
|
import org.distorted.library.main.MeshFlat;
|
44 |
|
|
import org.distorted.library.main.MeshObject;
|
45 |
|
|
import org.distorted.library.main.DistortedTexture;
|
46 |
|
|
import org.distorted.library.main.DistortedEffects;
|
47 |
08f92d82
|
Leszek Koltunski
|
import org.distorted.library.EffectNames;
|
48 |
56cbe1cf
|
Leszek Koltunski
|
import org.distorted.library.EffectTypes;
|
49 |
|
|
|
50 |
9167cfd4
|
Leszek Koltunski
|
import java.io.IOException;
|
51 |
|
|
import java.io.InputStream;
|
52 |
56cbe1cf
|
Leszek Koltunski
|
import java.util.ArrayList;
|
53 |
08f92d82
|
Leszek Koltunski
|
|
54 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
55 |
|
|
|
56 |
76a81b6a
|
Leszek Koltunski
|
public class Effects3DActivity extends Activity
|
57 |
bfcf419a
|
Leszek Koltunski
|
implements View.OnClickListener,
|
58 |
|
|
AdapterView.OnItemSelectedListener
|
59 |
d40cfeb2
|
Leszek Koltunski
|
{
|
60 |
50ac40a6
|
Leszek Koltunski
|
private static final int COLOR_OFF = 0xffffe81f;
|
61 |
|
|
private static final int COLOR_ON = 0xff0000ff;
|
62 |
bfcf419a
|
Leszek Koltunski
|
private static final int COLOR_INAC= 0xff00ff00;
|
63 |
50ac40a6
|
Leszek Koltunski
|
|
64 |
56cbe1cf
|
Leszek Koltunski
|
private int mNumCols = 10;
|
65 |
|
|
private int mNumRows = 10;
|
66 |
b3b2c6cf
|
leszek
|
private int mNumSlic = 1;
|
67 |
2e755580
|
Leszek Koltunski
|
private boolean mGridInitialized;
|
68 |
b3b2c6cf
|
leszek
|
private NumberPicker mColsPicker, mRowsPicker, mSlicPicker;
|
69 |
50ac40a6
|
Leszek Koltunski
|
private boolean[] mShape;
|
70 |
f6d884d5
|
Leszek Koltunski
|
private DistortedTexture mTexture;
|
71 |
d04a4886
|
Leszek Koltunski
|
private DistortedEffects mEffects;
|
72 |
b01acdaf
|
Leszek Koltunski
|
private MeshObject mMesh;
|
73 |
bcc8e016
|
Leszek Koltunski
|
private int mObjectType;
|
74 |
cdc515b9
|
Leszek Koltunski
|
private int mBitmapID;
|
75 |
|
|
private Bitmap mBitmap;
|
76 |
bfcf419a
|
Leszek Koltunski
|
private LinearLayout mLay;
|
77 |
d40cfeb2
|
Leszek Koltunski
|
|
78 |
d04a4886
|
Leszek Koltunski
|
private ArrayList<Effects3DEffect> mList;
|
79 |
56cbe1cf
|
Leszek Koltunski
|
private int mEffectAdd;
|
80 |
334c13fa
|
Leszek Koltunski
|
private float mCenterX, mCenterY, mCenterZ;
|
81 |
6f779cd4
|
Leszek Koltunski
|
private float mRegionX, mRegionY, mRegionR;
|
82 |
50ac40a6
|
Leszek Koltunski
|
|
83 |
8fd9f5fa
|
Leszek Koltunski
|
private EffectNames[] mEffectNames;
|
84 |
24991bc2
|
Leszek Koltunski
|
|
85 |
47833473
|
Leszek Koltunski
|
private static boolean mSupportsRegion;
|
86 |
4d5b37fe
|
Leszek Koltunski
|
private static boolean mSupportsCenter;
|
87 |
24991bc2
|
Leszek Koltunski
|
|
88 |
0ab55f0c
|
Leszek Koltunski
|
private static boolean mShowCenter = true;
|
89 |
|
|
private static boolean mShowRegion = true;
|
90 |
|
|
private static boolean mShowNormal = true;
|
91 |
|
|
|
92 |
08f92d82
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
93 |
56cbe1cf
|
Leszek Koltunski
|
|
94 |
d40cfeb2
|
Leszek Koltunski
|
@Override
|
95 |
|
|
protected void onCreate(Bundle savedState)
|
96 |
|
|
{
|
97 |
|
|
super.onCreate(savedState);
|
98 |
|
|
|
99 |
d04a4886
|
Leszek Koltunski
|
mList = new ArrayList<>();
|
100 |
56cbe1cf
|
Leszek Koltunski
|
|
101 |
8fd9f5fa
|
Leszek Koltunski
|
createEffectNames();
|
102 |
|
|
|
103 |
50ac40a6
|
Leszek Koltunski
|
setContentView(R.layout.objectpickerlayout);
|
104 |
d40cfeb2
|
Leszek Koltunski
|
|
105 |
bfcf419a
|
Leszek Koltunski
|
mLay = (LinearLayout)findViewById(R.id.objectpicker_buttongrid);
|
106 |
|
|
|
107 |
50ac40a6
|
Leszek Koltunski
|
mColsPicker = (NumberPicker)findViewById(R.id.objectpicker_cols);
|
108 |
|
|
mRowsPicker = (NumberPicker)findViewById(R.id.objectpicker_rows);
|
109 |
b3b2c6cf
|
leszek
|
mSlicPicker = (NumberPicker)findViewById(R.id.objectpicker_slices);
|
110 |
d40cfeb2
|
Leszek Koltunski
|
|
111 |
9758b1ec
|
Leszek Koltunski
|
mColsPicker.setMaxValue(40);
|
112 |
d40cfeb2
|
Leszek Koltunski
|
mColsPicker.setMinValue( 0);
|
113 |
9758b1ec
|
Leszek Koltunski
|
mRowsPicker.setMaxValue(40);
|
114 |
d40cfeb2
|
Leszek Koltunski
|
mRowsPicker.setMinValue( 0);
|
115 |
b3b2c6cf
|
leszek
|
mSlicPicker.setMaxValue(40);
|
116 |
|
|
mSlicPicker.setMinValue( 0);
|
117 |
d40cfeb2
|
Leszek Koltunski
|
|
118 |
|
|
mColsPicker.setOnValueChangedListener(new NumberPicker.OnValueChangeListener()
|
119 |
bfcf419a
|
Leszek Koltunski
|
{
|
120 |
|
|
@Override
|
121 |
|
|
public void onValueChange(NumberPicker picker, int oldVal, int newVal)
|
122 |
|
|
{
|
123 |
|
|
setGrid();
|
124 |
|
|
}
|
125 |
|
|
});
|
126 |
d40cfeb2
|
Leszek Koltunski
|
|
127 |
|
|
mRowsPicker.setOnValueChangedListener(new NumberPicker.OnValueChangeListener()
|
128 |
bfcf419a
|
Leszek Koltunski
|
{
|
129 |
|
|
@Override
|
130 |
|
|
public void onValueChange(NumberPicker picker, int oldVal, int newVal)
|
131 |
|
|
{
|
132 |
|
|
setGrid();
|
133 |
|
|
}
|
134 |
|
|
});
|
135 |
d40cfeb2
|
Leszek Koltunski
|
|
136 |
b3b2c6cf
|
leszek
|
mSlicPicker.setOnValueChangedListener(new NumberPicker.OnValueChangeListener()
|
137 |
|
|
{
|
138 |
|
|
@Override
|
139 |
|
|
public void onValueChange(NumberPicker picker, int oldVal, int newVal)
|
140 |
|
|
{
|
141 |
|
|
mNumSlic = mSlicPicker.getValue();
|
142 |
|
|
}
|
143 |
|
|
});
|
144 |
|
|
|
145 |
50ac40a6
|
Leszek Koltunski
|
mObjectType = 0;
|
146 |
2e755580
|
Leszek Koltunski
|
mGridInitialized = false;
|
147 |
d40cfeb2
|
Leszek Koltunski
|
|
148 |
50ac40a6
|
Leszek Koltunski
|
Spinner typeSpinner = (Spinner)findViewById(R.id.objectpicker_spinnerType);
|
149 |
|
|
typeSpinner.setOnItemSelectedListener(this);
|
150 |
d40cfeb2
|
Leszek Koltunski
|
|
151 |
bfcf419a
|
Leszek Koltunski
|
String[] objectType = new String[] {"Mesh: Cubes", "Mesh: Flat"};
|
152 |
d40cfeb2
|
Leszek Koltunski
|
|
153 |
bcc8e016
|
Leszek Koltunski
|
ArrayAdapter<String> adapterType = new ArrayAdapter<>(this, android.R.layout.simple_spinner_item, objectType);
|
154 |
|
|
adapterType.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
155 |
|
|
typeSpinner.setAdapter(adapterType);
|
156 |
|
|
|
157 |
|
|
Spinner bitmapSpinner = (Spinner)findViewById(R.id.objectpicker_spinnerBitmap);
|
158 |
|
|
bitmapSpinner.setOnItemSelectedListener(this);
|
159 |
|
|
|
160 |
bfcf419a
|
Leszek Koltunski
|
String[] objectBitmap = new String[] { "Texture: Grid", "Texture: Girl", "Texture: Dog", "Texture: Cat",
|
161 |
|
|
"Texture: Squares", "Texture: Bean", "Texture: Lisa" };
|
162 |
bcc8e016
|
Leszek Koltunski
|
|
163 |
|
|
ArrayAdapter<String> adapterBitmap = new ArrayAdapter<>(this, android.R.layout.simple_spinner_item, objectBitmap);
|
164 |
|
|
adapterBitmap.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
165 |
|
|
bitmapSpinner.setAdapter(adapterBitmap);
|
166 |
d40cfeb2
|
Leszek Koltunski
|
}
|
167 |
|
|
|
168 |
8fd9f5fa
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
169 |
|
|
|
170 |
|
|
private void createEffectNames()
|
171 |
|
|
{
|
172 |
76a81b6a
|
Leszek Koltunski
|
EffectTypes type1 = EffectTypes.FRAGMENT;
|
173 |
|
|
EffectTypes type2 = EffectTypes.VERTEX;
|
174 |
|
|
|
175 |
8fd9f5fa
|
Leszek Koltunski
|
EffectNames[] names = EffectNames.values();
|
176 |
|
|
|
177 |
76a81b6a
|
Leszek Koltunski
|
int numEffects=0;
|
178 |
8fd9f5fa
|
Leszek Koltunski
|
|
179 |
|
|
for(int i=0; i<names.length; i++)
|
180 |
76a81b6a
|
Leszek Koltunski
|
if( names[i].getType() == type1 || names[i].getType() == type2 ) numEffects++;
|
181 |
8fd9f5fa
|
Leszek Koltunski
|
|
182 |
76a81b6a
|
Leszek Koltunski
|
mEffectNames = new EffectNames[numEffects];
|
183 |
8fd9f5fa
|
Leszek Koltunski
|
|
184 |
76a81b6a
|
Leszek Koltunski
|
numEffects=0;
|
185 |
8fd9f5fa
|
Leszek Koltunski
|
|
186 |
|
|
for(int i=0; i<names.length; i++)
|
187 |
76a81b6a
|
Leszek Koltunski
|
if( names[i].getType() == type1 || names[i].getType() == type2 )
|
188 |
8fd9f5fa
|
Leszek Koltunski
|
{
|
189 |
76a81b6a
|
Leszek Koltunski
|
mEffectNames[numEffects++] = names[i];
|
190 |
8fd9f5fa
|
Leszek Koltunski
|
}
|
191 |
|
|
}
|
192 |
|
|
|
193 |
d40cfeb2
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
194 |
|
|
|
195 |
50ac40a6
|
Leszek Koltunski
|
private void setGrid()
|
196 |
d40cfeb2
|
Leszek Koltunski
|
{
|
197 |
2e755580
|
Leszek Koltunski
|
mGridInitialized = true;
|
198 |
|
|
|
199 |
bfcf419a
|
Leszek Koltunski
|
mNumCols = mColsPicker.getValue();
|
200 |
|
|
mNumRows = mRowsPicker.getValue();
|
201 |
d40cfeb2
|
Leszek Koltunski
|
|
202 |
bfcf419a
|
Leszek Koltunski
|
int width = mLay.getWidth();
|
203 |
|
|
int height= mLay.getHeight();
|
204 |
57ba16f3
|
Leszek Koltunski
|
int w = mNumCols>0 ? (int)( 0.9f*width / mNumCols) : 0;
|
205 |
|
|
int h = mNumRows>0 ? (int)( 0.9f*height/ mNumRows) : 0;
|
206 |
d40cfeb2
|
Leszek Koltunski
|
int size= w<h ? w:h;
|
207 |
57ba16f3
|
Leszek Koltunski
|
int pad = size<20 ? 1 : size/20;
|
208 |
d40cfeb2
|
Leszek Koltunski
|
|
209 |
bfcf419a
|
Leszek Koltunski
|
mLay.removeAllViews();
|
210 |
d40cfeb2
|
Leszek Koltunski
|
|
211 |
|
|
mShape = new boolean[mNumRows*mNumCols];
|
212 |
|
|
|
213 |
56cbe1cf
|
Leszek Koltunski
|
TableRow.LayoutParams p = new TableRow.LayoutParams();
|
214 |
d40cfeb2
|
Leszek Koltunski
|
|
215 |
|
|
p.rightMargin = pad;
|
216 |
|
|
p.leftMargin = pad;
|
217 |
|
|
p.topMargin = pad;
|
218 |
|
|
p.bottomMargin = pad;
|
219 |
|
|
p.height = size;
|
220 |
|
|
p.width = size;
|
221 |
|
|
|
222 |
|
|
for (int rows=0; rows<mNumRows; rows++)
|
223 |
08f92d82
|
Leszek Koltunski
|
{
|
224 |
d40cfeb2
|
Leszek Koltunski
|
TableRow tr = new TableRow(this);
|
225 |
|
|
tr.setGravity(Gravity.CENTER);
|
226 |
|
|
|
227 |
|
|
for(int cols=0; cols<mNumCols; cols++)
|
228 |
|
|
{
|
229 |
|
|
Button b = new Button(this);
|
230 |
|
|
b.setOnClickListener(this);
|
231 |
|
|
b.setId(rows*mNumCols+cols);
|
232 |
|
|
b.setLayoutParams(p);
|
233 |
bfcf419a
|
Leszek Koltunski
|
b.setBackgroundColor(mObjectType==1 ? COLOR_INAC : COLOR_ON);
|
234 |
d40cfeb2
|
Leszek Koltunski
|
tr.addView(b, p);
|
235 |
bcc8e016
|
Leszek Koltunski
|
mShape[rows*mNumCols+cols] = true;
|
236 |
d40cfeb2
|
Leszek Koltunski
|
}
|
237 |
|
|
|
238 |
bfcf419a
|
Leszek Koltunski
|
mLay.addView(tr);
|
239 |
d40cfeb2
|
Leszek Koltunski
|
}
|
240 |
|
|
}
|
241 |
|
|
|
242 |
50ac40a6
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
243 |
|
|
|
244 |
f6d884d5
|
Leszek Koltunski
|
public DistortedTexture getTexture()
|
245 |
50ac40a6
|
Leszek Koltunski
|
{
|
246 |
f6d884d5
|
Leszek Koltunski
|
return mTexture;
|
247 |
|
|
}
|
248 |
|
|
|
249 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
250 |
|
|
|
251 |
d04a4886
|
Leszek Koltunski
|
public DistortedEffects getEffects()
|
252 |
f6d884d5
|
Leszek Koltunski
|
{
|
253 |
d04a4886
|
Leszek Koltunski
|
return mEffects;
|
254 |
50ac40a6
|
Leszek Koltunski
|
}
|
255 |
|
|
|
256 |
e8b6aa95
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
257 |
|
|
|
258 |
7fca6741
|
Leszek Koltunski
|
public MeshObject getMesh()
|
259 |
e8b6aa95
|
Leszek Koltunski
|
{
|
260 |
b01acdaf
|
Leszek Koltunski
|
return mMesh;
|
261 |
e8b6aa95
|
Leszek Koltunski
|
}
|
262 |
|
|
|
263 |
24991bc2
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
264 |
|
|
|
265 |
f338550a
|
leszek
|
public void setSupportsRegion(boolean supports)
|
266 |
24991bc2
|
Leszek Koltunski
|
{
|
267 |
98c04ab8
|
leszek
|
mSupportsRegion = supports;
|
268 |
24991bc2
|
Leszek Koltunski
|
}
|
269 |
|
|
|
270 |
76a81b6a
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
271 |
|
|
|
272 |
f338550a
|
leszek
|
public void setSupportsCenter(boolean supports)
|
273 |
76a81b6a
|
Leszek Koltunski
|
{
|
274 |
98c04ab8
|
leszek
|
mSupportsCenter = supports;
|
275 |
76a81b6a
|
Leszek Koltunski
|
}
|
276 |
|
|
|
277 |
d40cfeb2
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
278 |
|
|
|
279 |
9167cfd4
|
Leszek Koltunski
|
public Bitmap getBitmap()
|
280 |
d40cfeb2
|
Leszek Koltunski
|
{
|
281 |
cdc515b9
|
Leszek Koltunski
|
if( mBitmap==null )
|
282 |
9167cfd4
|
Leszek Koltunski
|
{
|
283 |
cdc515b9
|
Leszek Koltunski
|
if( mBitmapID!=-1)
|
284 |
9167cfd4
|
Leszek Koltunski
|
{
|
285 |
cdc515b9
|
Leszek Koltunski
|
InputStream is = getResources().openRawResource(mBitmapID);
|
286 |
|
|
|
287 |
9167cfd4
|
Leszek Koltunski
|
try
|
288 |
|
|
{
|
289 |
cdc515b9
|
Leszek Koltunski
|
mBitmap = BitmapFactory.decodeStream(is);
|
290 |
|
|
}
|
291 |
|
|
finally
|
292 |
|
|
{
|
293 |
|
|
try
|
294 |
|
|
{
|
295 |
|
|
is.close();
|
296 |
|
|
}
|
297 |
|
|
catch(IOException e) { }
|
298 |
9167cfd4
|
Leszek Koltunski
|
}
|
299 |
|
|
}
|
300 |
cdc515b9
|
Leszek Koltunski
|
else
|
301 |
|
|
{
|
302 |
0ab55f0c
|
Leszek Koltunski
|
final int W = 64*mNumCols;
|
303 |
|
|
final int H = 64*mNumRows;
|
304 |
9167cfd4
|
Leszek Koltunski
|
|
305 |
cdc515b9
|
Leszek Koltunski
|
Paint paint = new Paint();
|
306 |
|
|
mBitmap = Bitmap.createBitmap(W,H, Bitmap.Config.ARGB_8888);
|
307 |
|
|
Canvas canvas = new Canvas(mBitmap);
|
308 |
9167cfd4
|
Leszek Koltunski
|
|
309 |
cdc515b9
|
Leszek Koltunski
|
paint.setAntiAlias(true);
|
310 |
|
|
paint.setTextAlign(Paint.Align.CENTER);
|
311 |
|
|
paint.setColor(0xff008800);
|
312 |
|
|
paint.setStyle(Paint.Style.FILL);
|
313 |
|
|
canvas.drawRect(0, 0, W, H, paint);
|
314 |
|
|
paint.setColor(0xffffffff);
|
315 |
9167cfd4
|
Leszek Koltunski
|
|
316 |
0ab55f0c
|
Leszek Koltunski
|
for(int i=0; i<=mNumCols ; i++ ) canvas.drawRect(W*i/mNumCols-1, 0, W*i/mNumCols + 1, H, paint);
|
317 |
|
|
for(int i=0; i<=mNumRows ; i++ ) canvas.drawRect( 0, H*i/mNumRows-1, W, H*i/mNumRows+1, paint);
|
318 |
9167cfd4
|
Leszek Koltunski
|
}
|
319 |
|
|
}
|
320 |
|
|
|
321 |
cdc515b9
|
Leszek Koltunski
|
return mBitmap;
|
322 |
d40cfeb2
|
Leszek Koltunski
|
}
|
323 |
|
|
|
324 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
325 |
|
|
|
326 |
56cbe1cf
|
Leszek Koltunski
|
public void onClick(View view)
|
327 |
d40cfeb2
|
Leszek Koltunski
|
{
|
328 |
bfcf419a
|
Leszek Koltunski
|
if( mObjectType!=1 )
|
329 |
|
|
{
|
330 |
|
|
Button tmp = (Button)view;
|
331 |
|
|
int id = tmp.getId();
|
332 |
|
|
mShape[id] = !mShape[id];
|
333 |
|
|
tmp.setBackgroundColor(mShape[id] ? COLOR_ON:COLOR_OFF);
|
334 |
|
|
}
|
335 |
|
|
}
|
336 |
|
|
|
337 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
338 |
|
|
|
339 |
|
|
private void uncheckAll()
|
340 |
|
|
{
|
341 |
|
|
TableRow tr;
|
342 |
|
|
Button butt;
|
343 |
|
|
|
344 |
|
|
for (int row=0; row<mNumRows; row++)
|
345 |
|
|
{
|
346 |
|
|
tr = (TableRow)mLay.getChildAt(row);
|
347 |
|
|
|
348 |
|
|
for(int col=0; col<mNumCols; col++)
|
349 |
|
|
{
|
350 |
|
|
butt = (Button)tr.getVirtualChildAt(col);
|
351 |
|
|
butt.setBackgroundColor(mObjectType==1 ? COLOR_INAC : COLOR_ON);
|
352 |
|
|
mShape[row*mNumCols+col] = true;
|
353 |
|
|
}
|
354 |
|
|
}
|
355 |
bcc8e016
|
Leszek Koltunski
|
}
|
356 |
|
|
|
357 |
6f779cd4
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
358 |
|
|
|
359 |
|
|
public void setRegion(float x, float y, float r)
|
360 |
|
|
{
|
361 |
|
|
mRegionX = x;
|
362 |
24991bc2
|
Leszek Koltunski
|
mRegionY =-y;
|
363 |
6f779cd4
|
Leszek Koltunski
|
mRegionR = r;
|
364 |
|
|
|
365 |
76a81b6a
|
Leszek Koltunski
|
Effects3DSurfaceView view = (Effects3DSurfaceView)findViewById(R.id.effects3dSurfaceView);
|
366 |
6f779cd4
|
Leszek Koltunski
|
view.getRenderer().setRegion(mRegionX, mRegionY, mRegionR);
|
367 |
|
|
}
|
368 |
|
|
|
369 |
950511ed
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
370 |
|
|
|
371 |
334c13fa
|
Leszek Koltunski
|
public void setCenter(float x, float y, float z)
|
372 |
950511ed
|
Leszek Koltunski
|
{
|
373 |
|
|
mCenterX = x;
|
374 |
|
|
mCenterY = y;
|
375 |
334c13fa
|
Leszek Koltunski
|
mCenterZ = z;
|
376 |
950511ed
|
Leszek Koltunski
|
|
377 |
76a81b6a
|
Leszek Koltunski
|
Effects3DSurfaceView view = (Effects3DSurfaceView)findViewById(R.id.effects3dSurfaceView);
|
378 |
334c13fa
|
Leszek Koltunski
|
view.getRenderer().setCenter( mCenterX, mCenterY, mCenterZ );
|
379 |
950511ed
|
Leszek Koltunski
|
}
|
380 |
|
|
|
381 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
382 |
|
|
|
383 |
|
|
public float getCenterX()
|
384 |
|
|
{
|
385 |
|
|
return mCenterX;
|
386 |
|
|
}
|
387 |
|
|
|
388 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
389 |
|
|
|
390 |
|
|
public float getCenterY()
|
391 |
|
|
{
|
392 |
|
|
return mCenterY;
|
393 |
|
|
}
|
394 |
|
|
|
395 |
334c13fa
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
396 |
|
|
|
397 |
|
|
public float getCenterZ()
|
398 |
|
|
{
|
399 |
|
|
return mCenterZ;
|
400 |
|
|
}
|
401 |
|
|
|
402 |
6f779cd4
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
403 |
|
|
|
404 |
|
|
public float getRegionX()
|
405 |
|
|
{
|
406 |
|
|
return mRegionX;
|
407 |
|
|
}
|
408 |
|
|
|
409 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
410 |
|
|
|
411 |
|
|
public float getRegionY()
|
412 |
|
|
{
|
413 |
|
|
return mRegionY;
|
414 |
|
|
}
|
415 |
|
|
|
416 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
417 |
|
|
|
418 |
|
|
public float getRegionR()
|
419 |
|
|
{
|
420 |
|
|
return mRegionR;
|
421 |
|
|
}
|
422 |
|
|
|
423 |
bcc8e016
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
424 |
50ac40a6
|
Leszek Koltunski
|
|
425 |
bfcf419a
|
Leszek Koltunski
|
public void Create(View v)
|
426 |
bcc8e016
|
Leszek Koltunski
|
{
|
427 |
76f9798b
|
Leszek Koltunski
|
DistortedEffects.setMaxVertex(20); // those have to be called before
|
428 |
|
|
DistortedEffects.setMaxFragment(3); // any DistortedEffect get created!
|
429 |
a98db446
|
Leszek Koltunski
|
|
430 |
50ac40a6
|
Leszek Koltunski
|
if( mObjectType==1 )
|
431 |
|
|
{
|
432 |
bfcf419a
|
Leszek Koltunski
|
mMesh = new MeshFlat(mNumCols,mNumRows);
|
433 |
50ac40a6
|
Leszek Koltunski
|
}
|
434 |
|
|
else
|
435 |
|
|
{
|
436 |
bfcf419a
|
Leszek Koltunski
|
String str = "";
|
437 |
50ac40a6
|
Leszek Koltunski
|
|
438 |
bfcf419a
|
Leszek Koltunski
|
for(int i=0; i<mNumRows*mNumCols; i++)
|
439 |
|
|
str += mShape[i] ? "1" : "0";
|
440 |
50ac40a6
|
Leszek Koltunski
|
|
441 |
b3b2c6cf
|
leszek
|
mMesh = new MeshCubes(mNumCols, str, mNumSlic);
|
442 |
50ac40a6
|
Leszek Koltunski
|
}
|
443 |
bcc8e016
|
Leszek Koltunski
|
|
444 |
0ab55f0c
|
Leszek Koltunski
|
mMesh.setShowNormals(mShowNormal);
|
445 |
|
|
|
446 |
bfcf419a
|
Leszek Koltunski
|
mEffects= new DistortedEffects();
|
447 |
|
|
mTexture= new DistortedTexture(mNumCols,mNumRows);
|
448 |
bcc8e016
|
Leszek Koltunski
|
|
449 |
bfcf419a
|
Leszek Koltunski
|
final View view = getLayoutInflater().inflate(R.layout.effects3dlayout, null);
|
450 |
bcc8e016
|
Leszek Koltunski
|
|
451 |
bfcf419a
|
Leszek Koltunski
|
setContentView(view);
|
452 |
bcc8e016
|
Leszek Koltunski
|
|
453 |
bfcf419a
|
Leszek Koltunski
|
String[] effects = new String[mEffectNames.length];
|
454 |
50ac40a6
|
Leszek Koltunski
|
|
455 |
bfcf419a
|
Leszek Koltunski
|
for(int i=0; i<mEffectNames.length; i++) effects[i] = mEffectNames[i].name();
|
456 |
|
|
|
457 |
|
|
Spinner effectSpinner = (Spinner)findViewById(R.id.effects3dspinner );
|
458 |
|
|
effectSpinner.setOnItemSelectedListener(this);
|
459 |
|
|
|
460 |
|
|
ArrayAdapter<String> adapterEffect = new ArrayAdapter<>(this, android.R.layout.simple_spinner_item, effects);
|
461 |
|
|
adapterEffect.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
462 |
|
|
effectSpinner.setAdapter(adapterEffect);
|
463 |
|
|
|
464 |
98c04ab8
|
leszek
|
resetData();
|
465 |
|
|
|
466 |
bfcf419a
|
Leszek Koltunski
|
mEffectAdd = 0;
|
467 |
d40cfeb2
|
Leszek Koltunski
|
}
|
468 |
|
|
|
469 |
50ac40a6
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
470 |
|
|
|
471 |
|
|
public void onItemSelected(AdapterView<?> parent, View view, int pos, long id)
|
472 |
|
|
{
|
473 |
|
|
switch(parent.getId())
|
474 |
|
|
{
|
475 |
bfcf419a
|
Leszek Koltunski
|
case R.id.objectpicker_spinnerType : if( mObjectType!=pos )
|
476 |
|
|
{
|
477 |
|
|
mObjectType = pos;
|
478 |
|
|
uncheckAll();
|
479 |
|
|
}
|
480 |
56cbe1cf
|
Leszek Koltunski
|
break;
|
481 |
bcc8e016
|
Leszek Koltunski
|
case R.id.objectpicker_spinnerBitmap: switch(pos)
|
482 |
|
|
{
|
483 |
cdc515b9
|
Leszek Koltunski
|
case 0: mBitmapID = -1 ; break;
|
484 |
|
|
case 1: mBitmapID = R.raw.face; break;
|
485 |
|
|
case 2: mBitmapID = R.raw.dog ; break;
|
486 |
|
|
case 3: mBitmapID = R.raw.cat ; break;
|
487 |
|
|
case 4: mBitmapID = R.raw.grid; break;
|
488 |
|
|
case 5: mBitmapID = R.raw.bean; break;
|
489 |
|
|
case 6: mBitmapID = R.raw.monalisa; break;
|
490 |
bcc8e016
|
Leszek Koltunski
|
}
|
491 |
|
|
break;
|
492 |
76a81b6a
|
Leszek Koltunski
|
case R.id.effects3dspinner : mEffectAdd = pos;
|
493 |
56cbe1cf
|
Leszek Koltunski
|
break;
|
494 |
50ac40a6
|
Leszek Koltunski
|
}
|
495 |
|
|
}
|
496 |
|
|
|
497 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
498 |
|
|
|
499 |
|
|
public void onNothingSelected(AdapterView<?> parent)
|
500 |
|
|
{
|
501 |
|
|
}
|
502 |
|
|
|
503 |
d40cfeb2
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
504 |
|
|
|
505 |
56cbe1cf
|
Leszek Koltunski
|
public int getWidth()
|
506 |
d40cfeb2
|
Leszek Koltunski
|
{
|
507 |
f6d884d5
|
Leszek Koltunski
|
return mTexture==null ? 0: mTexture.getWidth();
|
508 |
d40cfeb2
|
Leszek Koltunski
|
}
|
509 |
08f92d82
|
Leszek Koltunski
|
|
510 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
511 |
|
|
|
512 |
56cbe1cf
|
Leszek Koltunski
|
public int getHeight()
|
513 |
d40cfeb2
|
Leszek Koltunski
|
{
|
514 |
f6d884d5
|
Leszek Koltunski
|
return mTexture==null ? 0: mTexture.getHeight();
|
515 |
d40cfeb2
|
Leszek Koltunski
|
}
|
516 |
08f92d82
|
Leszek Koltunski
|
|
517 |
334c13fa
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
518 |
|
|
|
519 |
|
|
public int getDepth()
|
520 |
|
|
{
|
521 |
b01acdaf
|
Leszek Koltunski
|
return mTexture==null ? 0: mTexture.getDepth(mMesh);
|
522 |
334c13fa
|
Leszek Koltunski
|
}
|
523 |
|
|
|
524 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
525 |
|
|
|
526 |
|
|
public int getScreenWidth()
|
527 |
|
|
{
|
528 |
|
|
return 0;
|
529 |
|
|
}
|
530 |
|
|
|
531 |
08f92d82
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
532 |
|
|
|
533 |
6f779cd4
|
Leszek Koltunski
|
private void resetData()
|
534 |
d40cfeb2
|
Leszek Koltunski
|
{
|
535 |
950511ed
|
Leszek Koltunski
|
mCenterX = 0.5f*getWidth();
|
536 |
|
|
mCenterY = 0.5f*getHeight();
|
537 |
6f779cd4
|
Leszek Koltunski
|
mRegionX = 0;
|
538 |
|
|
mRegionY = 0;
|
539 |
|
|
mRegionR = getWidth()/2;
|
540 |
47833473
|
Leszek Koltunski
|
|
541 |
f338550a
|
leszek
|
mSupportsRegion =false;
|
542 |
4d5b37fe
|
Leszek Koltunski
|
mSupportsCenter =false;
|
543 |
98c04ab8
|
leszek
|
|
544 |
|
|
Effects3DSurfaceView view = (Effects3DSurfaceView)findViewById(R.id.effects3dSurfaceView);
|
545 |
0ab55f0c
|
Leszek Koltunski
|
view.getRenderer().showRegionAndCenter(false,false);
|
546 |
6f779cd4
|
Leszek Koltunski
|
}
|
547 |
|
|
|
548 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
549 |
|
|
// 'second screen' methods
|
550 |
|
|
|
551 |
56cbe1cf
|
Leszek Koltunski
|
public void newEffect(View v)
|
552 |
794e6c4f
|
Leszek Koltunski
|
{
|
553 |
76a81b6a
|
Leszek Koltunski
|
Effects3DEffect eff = new Effects3DEffect(mEffectNames[mEffectAdd], this);
|
554 |
d04a4886
|
Leszek Koltunski
|
mList.add(eff);
|
555 |
d2337a3a
|
Leszek Koltunski
|
|
556 |
76a81b6a
|
Leszek Koltunski
|
LinearLayout layout = (LinearLayout)findViewById(R.id.effects3dlayout);
|
557 |
56cbe1cf
|
Leszek Koltunski
|
View view = eff.createView();
|
558 |
|
|
layout.addView(view);
|
559 |
950511ed
|
Leszek Koltunski
|
|
560 |
4d5b37fe
|
Leszek Koltunski
|
if( mSupportsCenter )
|
561 |
76a81b6a
|
Leszek Koltunski
|
{
|
562 |
|
|
View center = eff.createCenter();
|
563 |
|
|
layout.addView(center);
|
564 |
|
|
}
|
565 |
|
|
|
566 |
|
|
if( mSupportsRegion )
|
567 |
950511ed
|
Leszek Koltunski
|
{
|
568 |
|
|
View region = eff.createRegion();
|
569 |
|
|
layout.addView(region);
|
570 |
|
|
}
|
571 |
|
|
|
572 |
d04a4886
|
Leszek Koltunski
|
eff.apply(mEffects);
|
573 |
98c04ab8
|
leszek
|
|
574 |
0ab55f0c
|
Leszek Koltunski
|
boolean show = (mEffectNames[mEffectAdd].getType()==EffectTypes.VERTEX);
|
575 |
98c04ab8
|
leszek
|
Effects3DSurfaceView sv = (Effects3DSurfaceView)findViewById(R.id.effects3dSurfaceView);
|
576 |
0ab55f0c
|
Leszek Koltunski
|
sv.getRenderer().showRegionAndCenter( (show && mShowRegion) , (show && mShowCenter) );
|
577 |
d2337a3a
|
Leszek Koltunski
|
}
|
578 |
|
|
|
579 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
580 |
|
|
|
581 |
56cbe1cf
|
Leszek Koltunski
|
public void removeAll(View v)
|
582 |
d2337a3a
|
Leszek Koltunski
|
{
|
583 |
d04a4886
|
Leszek Koltunski
|
mList.clear();
|
584 |
76a81b6a
|
Leszek Koltunski
|
LinearLayout layout = (LinearLayout)findViewById(R.id.effects3dlayout);
|
585 |
56cbe1cf
|
Leszek Koltunski
|
layout.removeAllViews();
|
586 |
d04a4886
|
Leszek Koltunski
|
mEffects.abortEffects(EffectTypes.VERTEX);
|
587 |
|
|
mEffects.abortEffects(EffectTypes.FRAGMENT);
|
588 |
950511ed
|
Leszek Koltunski
|
|
589 |
6f779cd4
|
Leszek Koltunski
|
resetData();
|
590 |
950511ed
|
Leszek Koltunski
|
|
591 |
76a81b6a
|
Leszek Koltunski
|
Effects3DSurfaceView view = (Effects3DSurfaceView)findViewById(R.id.effects3dSurfaceView);
|
592 |
|
|
Effects3DRenderer renderer= view.getRenderer();
|
593 |
950511ed
|
Leszek Koltunski
|
|
594 |
334c13fa
|
Leszek Koltunski
|
renderer.setCenter( mCenterX, mCenterY, mCenterZ );
|
595 |
6f779cd4
|
Leszek Koltunski
|
renderer.setRegion( mRegionX, mRegionY, mRegionR );
|
596 |
950511ed
|
Leszek Koltunski
|
renderer.mQuat1.set(0,0,0,1);
|
597 |
|
|
renderer.mQuat2.set(0,0,0,1);
|
598 |
d2337a3a
|
Leszek Koltunski
|
}
|
599 |
|
|
|
600 |
de82c8b7
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
601 |
|
|
|
602 |
|
|
public void remove(View v)
|
603 |
|
|
{
|
604 |
d04a4886
|
Leszek Koltunski
|
for(Effects3DEffect effect: mList)
|
605 |
fa9053f5
|
Leszek Koltunski
|
{
|
606 |
|
|
if( effect.thisView(v) )
|
607 |
|
|
{
|
608 |
fed00329
|
Leszek Koltunski
|
LinearLayout layout = (LinearLayout)findViewById(R.id.effects3dlayout);
|
609 |
|
|
View view;
|
610 |
|
|
|
611 |
|
|
view = effect.getEffect();
|
612 |
|
|
if( view!=null ) layout.removeView(view);
|
613 |
|
|
view = effect.getCenter();
|
614 |
|
|
if( view!=null ) layout.removeView(view);
|
615 |
|
|
view = effect.getRegion();
|
616 |
|
|
if( view!=null ) layout.removeView(view);
|
617 |
|
|
|
618 |
d04a4886
|
Leszek Koltunski
|
mEffects.abortEffect(effect.getId());
|
619 |
|
|
mList.remove(effect);
|
620 |
adc117e0
|
Leszek Koltunski
|
|
621 |
|
|
resetData();
|
622 |
fed00329
|
Leszek Koltunski
|
|
623 |
|
|
break;
|
624 |
fa9053f5
|
Leszek Koltunski
|
}
|
625 |
|
|
}
|
626 |
de82c8b7
|
Leszek Koltunski
|
}
|
627 |
|
|
|
628 |
0ab55f0c
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
629 |
|
|
|
630 |
|
|
boolean getShowCenter()
|
631 |
|
|
{
|
632 |
|
|
return mShowCenter;
|
633 |
|
|
}
|
634 |
|
|
|
635 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
636 |
|
|
|
637 |
|
|
boolean getShowRegion()
|
638 |
|
|
{
|
639 |
|
|
return mShowRegion;
|
640 |
|
|
}
|
641 |
|
|
|
642 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
643 |
|
|
|
644 |
|
|
public void showCenter(View view)
|
645 |
|
|
{
|
646 |
|
|
CheckBox box = (CheckBox)view;
|
647 |
|
|
mShowCenter = box.isChecked();
|
648 |
|
|
|
649 |
|
|
Effects3DSurfaceView sv = (Effects3DSurfaceView)findViewById(R.id.effects3dSurfaceView);
|
650 |
|
|
sv.getRenderer().showRegionAndCenter(mShowRegion,mShowCenter);
|
651 |
|
|
}
|
652 |
|
|
|
653 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
654 |
|
|
|
655 |
|
|
public void showRegion(View view)
|
656 |
|
|
{
|
657 |
|
|
CheckBox box = (CheckBox)view;
|
658 |
|
|
mShowRegion = box.isChecked();
|
659 |
|
|
|
660 |
|
|
Effects3DSurfaceView sv = (Effects3DSurfaceView)findViewById(R.id.effects3dSurfaceView);
|
661 |
|
|
sv.getRenderer().showRegionAndCenter(mShowRegion,mShowCenter);
|
662 |
|
|
}
|
663 |
|
|
|
664 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
665 |
|
|
|
666 |
|
|
public void showNormal(View view)
|
667 |
|
|
{
|
668 |
|
|
CheckBox box = (CheckBox)view;
|
669 |
|
|
mShowNormal = box.isChecked();
|
670 |
|
|
|
671 |
|
|
if ( mMesh!=null )
|
672 |
|
|
{
|
673 |
|
|
mMesh.setShowNormals(mShowNormal);
|
674 |
|
|
}
|
675 |
|
|
}
|
676 |
|
|
|
677 |
08f92d82
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
678 |
d40cfeb2
|
Leszek Koltunski
|
// Overrides
|
679 |
|
|
|
680 |
|
|
@Override
|
681 |
|
|
protected void onPause()
|
682 |
|
|
{
|
683 |
76a81b6a
|
Leszek Koltunski
|
GLSurfaceView mView = (GLSurfaceView)findViewById(R.id.effects3dSurfaceView);
|
684 |
d40cfeb2
|
Leszek Koltunski
|
if( mView!=null ) mView.onPause();
|
685 |
b0ebdf5e
|
Leszek Koltunski
|
|
686 |
|
|
Distorted.onPause();
|
687 |
d40cfeb2
|
Leszek Koltunski
|
super.onPause();
|
688 |
|
|
}
|
689 |
08f92d82
|
Leszek Koltunski
|
|
690 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
691 |
|
|
|
692 |
d40cfeb2
|
Leszek Koltunski
|
@Override
|
693 |
|
|
protected void onResume()
|
694 |
|
|
{
|
695 |
|
|
super.onResume();
|
696 |
76a81b6a
|
Leszek Koltunski
|
GLSurfaceView mView = (GLSurfaceView)findViewById(R.id.effects3dSurfaceView);
|
697 |
d40cfeb2
|
Leszek Koltunski
|
if( mView!=null ) mView.onResume();
|
698 |
|
|
}
|
699 |
08f92d82
|
Leszek Koltunski
|
|
700 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
701 |
|
|
|
702 |
d40cfeb2
|
Leszek Koltunski
|
@Override
|
703 |
|
|
public void onWindowFocusChanged(boolean hasFocus)
|
704 |
|
|
{
|
705 |
|
|
super.onWindowFocusChanged(hasFocus);
|
706 |
|
|
|
707 |
bfcf419a
|
Leszek Koltunski
|
mColsPicker.setValue(mNumCols);
|
708 |
|
|
mRowsPicker.setValue(mNumRows);
|
709 |
b3b2c6cf
|
leszek
|
mSlicPicker.setValue(mNumSlic);
|
710 |
bfcf419a
|
Leszek Koltunski
|
|
711 |
2e755580
|
Leszek Koltunski
|
if( !mGridInitialized ) setGrid();
|
712 |
d40cfeb2
|
Leszek Koltunski
|
}
|
713 |
08f92d82
|
Leszek Koltunski
|
|
714 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
715 |
|
|
|
716 |
d40cfeb2
|
Leszek Koltunski
|
@Override
|
717 |
|
|
protected void onDestroy()
|
718 |
|
|
{
|
719 |
|
|
Distorted.onDestroy();
|
720 |
|
|
super.onDestroy();
|
721 |
|
|
}
|
722 |
08f92d82
|
Leszek Koltunski
|
|
723 |
d40cfeb2
|
Leszek Koltunski
|
}
|