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 {
....@@ -205,6 +206,7 @@
205206
206207 boolean HasLoops()
207208 {
209
+ new Exception().printStackTrace();
208210 System.exit(0);
209211 if (blockloop)
210212 {
....@@ -277,11 +279,15 @@
277279
278280 Composite compo = new Composite();
279281
280
- super.deepCopySelf(compo);
282
+ super.deepCopyNode(compo);
283
+
284
+ compo.count = 2;
281285
282286 for (int i = 0; i < Children().size(); i++)
283287 {
284288 Object3D obj = (Object3D) Children().reserve(i);
289
+ if (obj == null)
290
+ continue;
285291 compo.addChild(obj.copyExpand());
286292 Children().release(i);
287293 }
....@@ -291,9 +297,9 @@
291297 return compo;
292298 }
293299
294
- protected void deepCopySelf(Object3D other)
300
+ protected void deepCopyNode(Object3D other)
295301 {
296
- super.deepCopySelf(other);
302
+ super.deepCopyNode(other);
297303
298304 if (false)
299305 {
....@@ -348,6 +354,7 @@
348354
349355 void getBounds0(cVector minima, cVector maxima, boolean xform)
350356 {
357
+ new Exception().printStackTrace();
351358 System.exit(0);
352359 minima.x = minima.y = minima.z = 1E10;
353360 maxima.x = maxima.y = maxima.z = -1E10;
....@@ -398,7 +405,6 @@
398405 {
399406 child = (Object3D) e.nextElement();
400407 }
401
-
402408 }
403409
404410 void createEditWindow(GroupEditor callee, boolean newWindow) //, boolean root)
....@@ -787,6 +793,8 @@
787793
788794 void draw(ClickInfo info, int level, boolean select)
789795 {
796
+ new Exception().printStackTrace();
797
+
790798 ClickInfo newInfo = new ClickInfo();
791799 newInfo.flags = info.flags;
792800 newInfo.bounds = info.bounds;
....@@ -864,8 +872,29 @@
864872 tex = GetTextures();
865873 }
866874
867
- display.BindTextures(tex, texres);
875
+ boolean failedPigment = false;
876
+ boolean failedBump = false;
868877
878
+ try
879
+ {
880
+ display.BindPigmentTexture(tex, texres);
881
+ }
882
+ catch (Exception e)
883
+ {
884
+ // System.err.println("FAILED: " + this);
885
+ failedPigment = true;
886
+ }
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
+
869898 if (//true) // new NORMAND
870899 touched || softtouched)
871900 {
....@@ -927,7 +956,11 @@
927956 }
928957 }
929958
930
- display.ReleaseTextures(tex);
959
+ if (!failedBump)
960
+ display.ReleaseBumpTexture(tex);
961
+
962
+ if (!failedPigment)
963
+ display.ReleasePigmentTexture(tex);
931964 }
932965
933966 void Reset0()