Normand Briere
2019-09-20 cbe4e90105d07d7d3fecabffaa01342403aa2ae3
Composite.java
....@@ -160,36 +160,37 @@
160160 // //Touch();
161161 // }
162162
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
+// }
193194
194195 boolean ReadOnly()
195196 {
....@@ -278,11 +279,15 @@
278279
279280 Composite compo = new Composite();
280281
281
- super.deepCopySelf(compo);
282
+ super.deepCopyNode(compo);
283
+
284
+ compo.count = 2;
282285
283286 for (int i = 0; i < Children().size(); i++)
284287 {
285288 Object3D obj = (Object3D) Children().reserve(i);
289
+ if (obj == null)
290
+ continue;
286291 compo.addChild(obj.copyExpand());
287292 Children().release(i);
288293 }
....@@ -292,9 +297,9 @@
292297 return compo;
293298 }
294299
295
- protected void deepCopySelf(Object3D other)
300
+ protected void deepCopyNode(Object3D other)
296301 {
297
- super.deepCopySelf(other);
302
+ super.deepCopyNode(other);
298303
299304 if (false)
300305 {
....@@ -400,7 +405,6 @@
400405 {
401406 child = (Object3D) e.nextElement();
402407 }
403
-
404408 }
405409
406410 void createEditWindow(GroupEditor callee, boolean newWindow) //, boolean root)
....@@ -789,6 +793,8 @@
789793
790794 void draw(ClickInfo info, int level, boolean select)
791795 {
796
+ new Exception().printStackTrace();
797
+
792798 ClickInfo newInfo = new ClickInfo();
793799 newInfo.flags = info.flags;
794800 newInfo.bounds = info.bounds;
....@@ -866,15 +872,29 @@
866872 tex = GetTextures();
867873 }
868874
875
+ boolean failedPigment = false;
876
+ boolean failedBump = false;
877
+
869878 try
870879 {
871
- display.BindTextures(tex, texres);
880
+ display.BindPigmentTexture(tex, texres);
872881 }
873882 catch (Exception e)
874883 {
875
- System.err.println("FAILED: " + this);
884
+ // System.err.println("FAILED: " + this);
885
+ failedPigment = true;
876886 }
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
+
878898 if (//true) // new NORMAND
879899 touched || softtouched)
880900 {
....@@ -936,7 +956,11 @@
936956 }
937957 }
938958
939
- display.ReleaseTextures(tex);
959
+ if (!failedBump)
960
+ display.ReleaseBumpTexture(tex);
961
+
962
+ if (!failedPigment)
963
+ display.ReleasePigmentTexture(tex);
940964 }
941965
942966 void Reset0()