.. | .. |
---|
160 | 160 | // //Touch(); |
---|
161 | 161 | // } |
---|
162 | 162 | |
---|
163 | | - public void clear() |
---|
164 | | - { |
---|
165 | | - if (blockloop) |
---|
166 | | - { |
---|
167 | | - //blockloop = false; |
---|
168 | | - return; |
---|
169 | | - } |
---|
170 | | - |
---|
171 | | - blockloop = true; |
---|
172 | | - //Applet3D.tracein("Clear", this); |
---|
173 | | - for (int i = 0; i < Children().size(); i++) |
---|
174 | | - { |
---|
175 | | - Object3D obj = (Object3D) Children().get(i); // reserve(i); |
---|
176 | | - |
---|
177 | | - //if (!obj.ReadOnly()) // Object3D Serial... |
---|
178 | | - if (!(obj instanceof Composite) || !((Composite) obj).ReadOnly()) |
---|
179 | | - { |
---|
180 | | - obj.clear(); |
---|
181 | | - //Children().release(i); |
---|
182 | | - Children().remove(i); |
---|
183 | | - --i; |
---|
184 | | - } else |
---|
185 | | - { |
---|
186 | | - //Children().release(i); |
---|
187 | | - } |
---|
188 | | - } |
---|
189 | | - //Applet3D.traceout("Clear", this); |
---|
190 | | - |
---|
191 | | - blockloop = false; |
---|
192 | | - } |
---|
| 163 | + // JUNE 2019??? That cannot work... |
---|
| 164 | +// public void clear() |
---|
| 165 | +// { |
---|
| 166 | +// if (blockloop) |
---|
| 167 | +// { |
---|
| 168 | +// //blockloop = false; |
---|
| 169 | +// return; |
---|
| 170 | +// } |
---|
| 171 | +// |
---|
| 172 | +// blockloop = true; |
---|
| 173 | +// //Applet3D.tracein("Clear", this); |
---|
| 174 | +// for (int i = 0; i < Children().size(); i++) |
---|
| 175 | +// { |
---|
| 176 | +// Object3D obj = (Object3D) Children().get(i); // reserve(i); |
---|
| 177 | +// |
---|
| 178 | +// //if (!obj.ReadOnly()) // Object3D Serial... |
---|
| 179 | +// if (!(obj instanceof Composite) || !((Composite) obj).ReadOnly()) |
---|
| 180 | +// { |
---|
| 181 | +// obj.clear(); |
---|
| 182 | +// //Children().release(i); |
---|
| 183 | +// Children().remove(i); |
---|
| 184 | +// --i; |
---|
| 185 | +// } else |
---|
| 186 | +// { |
---|
| 187 | +// //Children().release(i); |
---|
| 188 | +// } |
---|
| 189 | +// } |
---|
| 190 | +// //Applet3D.traceout("Clear", this); |
---|
| 191 | +// |
---|
| 192 | +// blockloop = false; |
---|
| 193 | +// } |
---|
193 | 194 | |
---|
194 | 195 | boolean ReadOnly() |
---|
195 | 196 | { |
---|
.. | .. |
---|
278 | 279 | |
---|
279 | 280 | Composite compo = new Composite(); |
---|
280 | 281 | |
---|
281 | | - super.deepCopySelf(compo); |
---|
| 282 | + super.deepCopyNode(compo); |
---|
| 283 | + |
---|
| 284 | + compo.count = 2; |
---|
282 | 285 | |
---|
283 | 286 | for (int i = 0; i < Children().size(); i++) |
---|
284 | 287 | { |
---|
285 | 288 | Object3D obj = (Object3D) Children().reserve(i); |
---|
| 289 | + if (obj == null) |
---|
| 290 | + continue; |
---|
286 | 291 | compo.addChild(obj.copyExpand()); |
---|
287 | 292 | Children().release(i); |
---|
288 | 293 | } |
---|
.. | .. |
---|
292 | 297 | return compo; |
---|
293 | 298 | } |
---|
294 | 299 | |
---|
295 | | - protected void deepCopySelf(Object3D other) |
---|
| 300 | + protected void deepCopyNode(Object3D other) |
---|
296 | 301 | { |
---|
297 | | - super.deepCopySelf(other); |
---|
| 302 | + super.deepCopyNode(other); |
---|
298 | 303 | |
---|
299 | 304 | if (false) |
---|
300 | 305 | { |
---|
.. | .. |
---|
400 | 405 | { |
---|
401 | 406 | child = (Object3D) e.nextElement(); |
---|
402 | 407 | } |
---|
403 | | - |
---|
404 | 408 | } |
---|
405 | 409 | |
---|
406 | 410 | void createEditWindow(GroupEditor callee, boolean newWindow) //, boolean root) |
---|
.. | .. |
---|
789 | 793 | |
---|
790 | 794 | void draw(ClickInfo info, int level, boolean select) |
---|
791 | 795 | { |
---|
| 796 | + new Exception().printStackTrace(); |
---|
| 797 | + |
---|
792 | 798 | ClickInfo newInfo = new ClickInfo(); |
---|
793 | 799 | newInfo.flags = info.flags; |
---|
794 | 800 | newInfo.bounds = info.bounds; |
---|
.. | .. |
---|
866 | 872 | tex = GetTextures(); |
---|
867 | 873 | } |
---|
868 | 874 | |
---|
| 875 | + boolean failedPigment = false; |
---|
| 876 | + boolean failedBump = false; |
---|
| 877 | + |
---|
869 | 878 | try |
---|
870 | 879 | { |
---|
871 | | - display.BindTextures(tex, texres); |
---|
| 880 | + display.BindPigmentTexture(tex, texres); |
---|
872 | 881 | } |
---|
873 | 882 | catch (Exception e) |
---|
874 | 883 | { |
---|
875 | | - System.err.println("FAILED: " + this); |
---|
| 884 | + // System.err.println("FAILED: " + this); |
---|
| 885 | + failedPigment = true; |
---|
876 | 886 | } |
---|
877 | | - |
---|
| 887 | + |
---|
| 888 | + try |
---|
| 889 | + { |
---|
| 890 | + display.BindBumpTexture(tex, texres); |
---|
| 891 | + } |
---|
| 892 | + catch (Exception e) |
---|
| 893 | + { |
---|
| 894 | + //System.err.println("FAILED: " + this); |
---|
| 895 | + failedBump = true; |
---|
| 896 | + } |
---|
| 897 | + |
---|
878 | 898 | if (//true) // new NORMAND |
---|
879 | 899 | touched || softtouched) |
---|
880 | 900 | { |
---|
.. | .. |
---|
936 | 956 | } |
---|
937 | 957 | } |
---|
938 | 958 | |
---|
939 | | - display.ReleaseTextures(tex); |
---|
| 959 | + if (!failedBump) |
---|
| 960 | + display.ReleaseBumpTexture(tex); |
---|
| 961 | + |
---|
| 962 | + if (!failedPigment) |
---|
| 963 | + display.ReleasePigmentTexture(tex); |
---|
940 | 964 | } |
---|
941 | 965 | |
---|
942 | 966 | void Reset0() |
---|