Normand Briere
2019-08-28 47745d8ade7238a188f7ab78eaf5e8a269d96fdd
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 {
....@@ -348,6 +350,7 @@
348350
349351 void getBounds0(cVector minima, cVector maxima, boolean xform)
350352 {
353
+ new Exception().printStackTrace();
351354 System.exit(0);
352355 minima.x = minima.y = minima.z = 1E10;
353356 maxima.x = maxima.y = maxima.z = -1E10;
....@@ -398,7 +401,6 @@
398401 {
399402 child = (Object3D) e.nextElement();
400403 }
401
-
402404 }
403405
404406 void createEditWindow(GroupEditor callee, boolean newWindow) //, boolean root)
....@@ -787,6 +789,8 @@
787789
788790 void draw(ClickInfo info, int level, boolean select)
789791 {
792
+ new Exception().printStackTrace();
793
+
790794 ClickInfo newInfo = new ClickInfo();
791795 newInfo.flags = info.flags;
792796 newInfo.bounds = info.bounds;
....@@ -837,7 +841,7 @@
837841 }
838842
839843 if ((//display.drawMode == CameraPane.SHADOW ||
840
- display.DrawMode() == CameraPane.SELECTION || CameraPane.DEBUG_SELECTION) &&
844
+ display.DrawMode() == CameraPane.SELECTION || display.IsDebugSelection()) &&
841845 //HasTransparency())
842846 // SERIAL PATCH
843847 // if (viewCode == -1)
....@@ -855,7 +859,7 @@
855859
856860 cTexture tex = null;
857861
858
- boolean selectmode = display.DrawMode() == display.SELECTION || CameraPane.DEBUG_SELECTION;
862
+ boolean selectmode = display.DrawMode() == display.SELECTION || display.IsDebugSelection();
859863
860864 if (//display.drawMode != display.SHADOW &&
861865 !selectmode // display.drawMode != display.SELECTION
....@@ -864,8 +868,29 @@
864868 tex = GetTextures();
865869 }
866870
867
- display.BindTextures(tex, texres);
871
+ boolean failedPigment = false;
872
+ boolean failedBump = false;
868873
874
+ try
875
+ {
876
+ display.BindPigmentTexture(tex, texres);
877
+ }
878
+ catch (Exception e)
879
+ {
880
+ // System.err.println("FAILED: " + this);
881
+ failedPigment = true;
882
+ }
883
+
884
+ try
885
+ {
886
+ display.BindBumpTexture(tex, texres);
887
+ }
888
+ catch (Exception e)
889
+ {
890
+ //System.err.println("FAILED: " + this);
891
+ failedBump = true;
892
+ }
893
+
869894 if (//true) // new NORMAND
870895 touched || softtouched)
871896 {
....@@ -927,7 +952,11 @@
927952 }
928953 }
929954
930
- display.ReleaseTextures(tex);
955
+ if (!failedBump)
956
+ display.ReleaseBumpTexture(tex);
957
+
958
+ if (!failedPigment)
959
+ display.ReleasePigmentTexture(tex);
931960 }
932961
933962 void Reset0()
....@@ -994,7 +1023,7 @@
9941023 // }
9951024 // }
9961025
997
- void drawSelfOld(CameraPane display, Object3D /*Composite*/ root, boolean selected)
1026
+ void drawSelfOld(iCameraPane display, Object3D /*Composite*/ root, boolean selected)
9981027 {
9991028 // if (count <= 0) // || display.IsFreezed())
10001029 // {