| .. | .. |
|---|
| 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 | { |
|---|
| .. | .. |
|---|
| 866 | 867 | tex = GetTextures(); |
|---|
| 867 | 868 | } |
|---|
| 868 | 869 | |
|---|
| 869 | | - display.BindTextures(tex, texres); |
|---|
| 870 | + boolean failedPigment = false; |
|---|
| 871 | + boolean failedBump = false; |
|---|
| 870 | 872 | |
|---|
| 873 | + try |
|---|
| 874 | + { |
|---|
| 875 | + display.BindPigmentTexture(tex, texres); |
|---|
| 876 | + } |
|---|
| 877 | + catch (Exception e) |
|---|
| 878 | + { |
|---|
| 879 | + System.err.println("FAILED: " + this); |
|---|
| 880 | + failedPigment = true; |
|---|
| 881 | + } |
|---|
| 882 | + |
|---|
| 883 | + try |
|---|
| 884 | + { |
|---|
| 885 | + display.BindBumpTexture(tex, texres); |
|---|
| 886 | + } |
|---|
| 887 | + catch (Exception e) |
|---|
| 888 | + { |
|---|
| 889 | + //System.err.println("FAILED: " + this); |
|---|
| 890 | + failedBump = true; |
|---|
| 891 | + } |
|---|
| 892 | + |
|---|
| 871 | 893 | if (//true) // new NORMAND |
|---|
| 872 | 894 | touched || softtouched) |
|---|
| 873 | 895 | { |
|---|
| .. | .. |
|---|
| 929 | 951 | } |
|---|
| 930 | 952 | } |
|---|
| 931 | 953 | |
|---|
| 932 | | - display.ReleaseTextures(tex); |
|---|
| 954 | + if (!failedBump) |
|---|
| 955 | + display.ReleaseBumpTexture(tex); |
|---|
| 956 | + |
|---|
| 957 | + if (!failedPigment) |
|---|
| 958 | + display.ReleasePigmentTexture(tex); |
|---|
| 933 | 959 | } |
|---|
| 934 | 960 | |
|---|
| 935 | 961 | void Reset0() |
|---|