From 1af7d3700724834e40ad8636bc9a56cdc3b19b15 Mon Sep 17 00:00:00 2001
From: Normand Briere <nbriere@noware.ca>
Date: Sat, 27 Jul 2019 11:52:38 -0400
Subject: [PATCH] New layout icons

---
 Composite.java |   94 +++++++++++++++++++++++++++++++----------------
 1 files changed, 62 insertions(+), 32 deletions(-)

diff --git a/Composite.java b/Composite.java
index 210413e..63b89d4 100644
--- a/Composite.java
+++ b/Composite.java
@@ -160,36 +160,37 @@
 //        //Touch();
 //    }
     
-    public void clear()
-    {
-        if (blockloop)
-        {
-            //blockloop = false;
-            return;
-        }
-
-        blockloop = true;
-        //Applet3D.tracein("Clear", this);
-        for (int i = 0; i < Children().size(); i++)
-        {
-            Object3D obj = (Object3D) Children().get(i); // reserve(i);
-            
-            //if (!obj.ReadOnly()) // Object3D Serial...
-            if (!(obj instanceof Composite) || !((Composite) obj).ReadOnly())
-            {
-                obj.clear();
-                //Children().release(i);
-                Children().remove(i);
-                --i;
-            } else
-            {
-                //Children().release(i);
-            }
-        }
-        //Applet3D.traceout("Clear", this);
-
-        blockloop = false;
-    }
+    // JUNE 2019??? That cannot work...
+//    public void clear()
+//    {
+//        if (blockloop)
+//        {
+//            //blockloop = false;
+//            return;
+//        }
+//
+//        blockloop = true;
+//        //Applet3D.tracein("Clear", this);
+//        for (int i = 0; i < Children().size(); i++)
+//        {
+//            Object3D obj = (Object3D) Children().get(i); // reserve(i);
+//            
+//            //if (!obj.ReadOnly()) // Object3D Serial...
+//            if (!(obj instanceof Composite) || !((Composite) obj).ReadOnly())
+//            {
+//                obj.clear();
+//                //Children().release(i);
+//                Children().remove(i);
+//                --i;
+//            } else
+//            {
+//                //Children().release(i);
+//            }
+//        }
+//        //Applet3D.traceout("Clear", this);
+//
+//        blockloop = false;
+//    }
 
     boolean ReadOnly()
     {
@@ -205,6 +206,7 @@
 
     boolean HasLoops()
     {
+                new Exception().printStackTrace();
         System.exit(0);
         if (blockloop)
         {
@@ -348,6 +350,7 @@
         
     void getBounds0(cVector minima, cVector maxima, boolean xform)
     {
+                new Exception().printStackTrace();
         System.exit(0);
         minima.x = minima.y = minima.z = 1E10;
         maxima.x = maxima.y = maxima.z = -1E10;
@@ -787,6 +790,8 @@
 
     void draw(ClickInfo info, int level, boolean select)
     {
+        new Exception().printStackTrace();
+        
         ClickInfo newInfo = new ClickInfo();
         newInfo.flags = info.flags;
         newInfo.bounds = info.bounds;
@@ -864,8 +869,29 @@
         tex = GetTextures();
     }
 
-    display.BindTextures(tex, texres);
+    boolean failedPigment = false;
+    boolean failedBump = false;
     
+    try
+    {
+        display.BindPigmentTexture(tex, texres);
+    }
+    catch (Exception e)
+    {
+        System.err.println("FAILED: " + this);
+        failedPigment = true;
+    }
+           
+    try
+    {
+        display.BindBumpTexture(tex, texres);
+    }
+    catch (Exception e)
+    {
+        //System.err.println("FAILED: " + this);
+        failedBump = true;
+    }
+               
         if (//true) // new NORMAND
             touched || softtouched)
         {
@@ -927,7 +953,11 @@
             }
         }
     
-    display.ReleaseTextures(tex);
+    if (!failedBump)
+        display.ReleaseBumpTexture(tex);
+    
+    if (!failedPigment)
+        display.ReleasePigmentTexture(tex);
     }
 
     void Reset0()

--
Gitblit v1.6.2