From 6c2c00ee7f33ec46f79eba11c349f766cb207ec0 Mon Sep 17 00:00:00 2001
From: Normand Briere <nbriere@noware.ca>
Date: Mon, 29 Apr 2019 10:39:23 -0400
Subject: [PATCH] Material pane

---
 CameraPane.java |   33 +++++++++++++++++++++++----------
 1 files changed, 23 insertions(+), 10 deletions(-)

diff --git a/CameraPane.java b/CameraPane.java
index 8c8c173..296ba69 100644
--- a/CameraPane.java
+++ b/CameraPane.java
@@ -86,12 +86,14 @@
 static    boolean FULLSCREEN = false;
 static    boolean SUPPORT = true;
 static    boolean INERTIA = true;
-static    boolean FAST = false;
+static    boolean FAST = true; // false;
 static    boolean SLOWPOSE = false;
 static    boolean FOOTCONTACT = true;
 
 static    int tickcount = 0; // slow pose issue
 
+static    boolean BUTTONLESSWHEEL = false;
+static    boolean ZOOMBOXMODE = false;
 static    boolean BOXMODE = false;
 static    boolean IMAGEFLIP = false;
 static    boolean SMOOTHFOCUS = false;
@@ -223,6 +225,11 @@
     public boolean IsBoxMode()
     {
             return BOXMODE;
+    }
+    
+    public boolean IsZoomBoxMode()
+    {
+            return ZOOMBOXMODE;
     }
     
     public void ClearDepth()
@@ -1612,12 +1619,12 @@
         //col.getColorComponents(ColorSpace.getInstance(ColorSpace.CS_LINEAR_RGB), CameraPane.modelParams0);
         if (!material.multiply)
         {
-            display.color = color;
+            display.color = material.color;
             display.saturation = material.modulation;
         }
         else
         {
-            display.color *= color*2;
+            display.color *= material.color*2;
             display.saturation *= material.modulation*2;
         }
             
@@ -2168,6 +2175,11 @@
     public void ToggleBoxMode()
     {
         BOXMODE ^= true;
+    }
+
+    public void ToggleZoomBoxMode()
+    {
+        ZOOMBOXMODE ^= true;
     }
 
     public void ToggleSmoothFocus()
@@ -12735,7 +12747,7 @@
               "MUL final.y, fragment.texcoord[0].x, c256;" +
               "FLR final.x, final.y;" +
               "SUB final.y, final.y, final.x;" +
-              "MUL final.x, final.x, c256i;" +
+              //"MUL final.x, final.x, c256i;" +
               "MOV final.z, zero.x;" +
               "MOV final.a, one.w;":""
               ) +
@@ -12743,7 +12755,7 @@
               "MUL final.y, fragment.texcoord[0].y, c256;" +
               "FLR final.x, final.y;" +
               "SUB final.y, final.y, final.x;" +
-              "MUL final.x, final.x, c256i;" +
+              //"MUL final.x, final.x, c256i;" +
               "MOV final.z, zero.x;" +
               "MOV final.a, one.w;":""
               ) +
@@ -13523,6 +13535,7 @@
 	
         //System.err.println("Dtime = " + Dtime + "; units = " + e.getUnitsToScroll() + "; ratio (units/ms) = " + ratio);
             
+        if (BUTTONLESSWHEEL)
 	if (Math.abs(ratio) < 0.1 || Math.abs(Dtime) == 0) // < 30)
 	{
             return;
@@ -13531,7 +13544,7 @@
         boolean capsLocked = Toolkit.getDefaultToolkit().getLockingKeyState(KeyEvent.VK_CAPS_LOCK);
         
         // TIMER
-        if (!wheeltimer.isRunning() && e.getModifiersEx() == 0 && !capsLocked) // VR
+        if (ZOOMBOXMODE && !wheeltimer.isRunning() && e.getModifiersEx() == 0 && !capsLocked) // VR
         {
             keepboxmode = BOXMODE;
             keepsupport = SUPPORT;
@@ -13748,11 +13761,11 @@
     
     public void mouseDragged(MouseEvent e)
     {
+        //System.out.println("mouseDragged: " + e);
         if (isRenderer)
             movingcamera = true;
         //if (drawing)
         //return;
-        //System.out.println("mouseDragged: " + e);
         if ((e.getModifiersEx() & CTRL) != 0
             || (e.getModifiersEx() & COMMAND) != 0) // || IsFrozen())
         {
@@ -14287,7 +14300,6 @@
     public void mouseMoved(MouseEvent e)
     {
         //System.out.println("mouseMoved: " + e);
-
         if (isRenderer)
             return;
         
@@ -15100,8 +15112,9 @@
 
     protected void processMouseMotionEvent(MouseEvent e)
     {
-        //System.out.println("processMouseMotionEvent: " + mouseMode);
-        if (e.getButton() == MouseEvent.NOBUTTON && (mouseMode & SELECT) == 0)
+        //System.out.println("processMouseMotionEvent: " + mouseMode + " " + e.getModifiers() + " " + e.getModifiersEx() + " " + e.getButton());
+        //if (e.getButton() == MouseEvent.NOBUTTON && (mouseMode & SELECT) == 0)
+        if ((e.getModifiers() & MouseEvent.BUTTON1_MASK) == 0 && (mouseMode & SELECT) == 0)
         {
             mouseMoved(e);
         } else

--
Gitblit v1.6.2