From c209bbe1cf788c9af3dcffea7667c830170a3f1f Mon Sep 17 00:00:00 2001
From: Normand Briere <nbriere@noware.ca>
Date: Wed, 01 May 2019 20:30:51 -0400
Subject: [PATCH] Complete advanced mode.

---
 CameraPane.java |   37 ++++++++++++++++++++++++-------------
 1 files changed, 24 insertions(+), 13 deletions(-)

diff --git a/CameraPane.java b/CameraPane.java
index 55e5ab4..e5811ae 100644
--- a/CameraPane.java
+++ b/CameraPane.java
@@ -56,8 +56,6 @@
     static int CURRENTANTIALIAS = 0; // 1;
 	/*static*/ boolean RENDERSHADOW = true;
     /*static*/ int RENDERPROGRAM = 2; // 0 == none, 1 == fast, 2 == normal
-    static boolean ANIMATION = false;
-    static String filename;
     
     boolean DISPLAYTEXT = false;
     //boolean REDUCETEXTURE = true;
@@ -86,7 +84,7 @@
 static    boolean FULLSCREEN = false;
 static    boolean SUPPORT = true;
 static    boolean INERTIA = true;
-static    boolean FAST = true; // false;
+static    boolean FAST = false;
 static    boolean SLOWPOSE = false;
 static    boolean FOOTCONTACT = true;
 
@@ -108,7 +106,7 @@
 static    boolean OEIL = true;
 static    boolean OEILONCE = false; // do oeilon then oeiloff
 static    boolean LOOKAT = true;
-static    boolean RANDOM = true; // false;
+static    boolean SWITCH = true; // false;
 static    boolean HANDLES = false; // selection doesn't work!!
 static  boolean PAINTMODE = false;
 
@@ -2269,7 +2267,7 @@
 
     void ToggleRandom()
     {
-        RANDOM ^= true;
+        SWITCH ^= true;
     }
 
     void ToggleHandles()
@@ -4208,6 +4206,7 @@
     
     com.sun.opengl.util.texture.Texture CompressTexture2(String name)
     {
+                new Exception().printStackTrace();
         System.exit(0);
         com.sun.opengl.util.texture.Texture texture = null;
 
@@ -9394,7 +9393,7 @@
             //gl.glFlush();
             gl.glAccum(gl.GL_ACCUM, 1.0f / ACSIZE);
 
-            if (ANIMATION && ABORTED)
+            if (Globals.ANIMATION && ABORTED)
             {
     System.err.println("    ABORTED FRAME");
                 break;
@@ -9424,7 +9423,7 @@
         setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
 
         // save image
-        if (ANIMATION && !ABORTED)
+        if (Globals.ANIMATION && !ABORTED)
         {
             VPwidth = viewport[2];
             VPheight = viewport[3];
@@ -9535,7 +9534,7 @@
             
 //            imagecount++;
             
-            String fullname = filename + (i%100000)/10000 + "" + (i%10000)/1000 + "" + (i%1000)/100 + "" + (i%100)/10 + "" + (i%10) + "." + ext;
+            String fullname = Globals.filename + (i%100000)/10000 + "" + (i%10000)/1000 + "" + (i%1000)/100 + "" + (i%100)/10 + "" + (i%10) + "." + ext;
             
             if (!BOXMODE)
             {
@@ -11259,8 +11258,14 @@
     {
             renderpass++;
 //        System.out.println("Draw object... ");
+        STEP = 1;
         if (FAST) // in case there is no script
-            STEP = 16;
+            STEP = 8;
+            
+        if (CURRENTANTIALIAS == 0 || ACSIZE == 1)
+        {
+            STEP *= 4;
+        }
             
         //object.FullInvariants();
         
@@ -12598,8 +12603,10 @@
             "MAX ndotl.x, ndotl.x, -ndotl.x;" +
                 
                 "SUB temp.x, one.x, ndotl.x;" +
-                "ADD temp.x, temp.x, options2.z;" + // lightsheen
-                "ADD temp.y, one.y, options2.y;" + // sursurface
+                // Tuning for default skin
+                //"ADD temp.x, temp.x, options2.z;" + // lightsheen
+                "MAD temp.x, options2.z, half.y, temp.x;" + // lightsheen
+                "ADD temp.y, one.y, options2.y;" + // subsurface
                 "MUL temp.x, temp.x, temp.y;" +
                                 
                 "MUL saturation, saturation, temp.xxxx;" +
@@ -12747,7 +12754,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;":""
               ) +
@@ -12755,7 +12762,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;":""
               ) +
@@ -13946,6 +13953,7 @@
         
         public void run()
         {
+                new Exception().printStackTrace();
             System.exit(0);
             for (;;)
             {
@@ -15144,6 +15152,7 @@
 
     void SelectParent()
     {
+                new Exception().printStackTrace();
         System.exit(0);
         Composite group = (Composite) object;
         java.util.Vector selectees = new java.util.Vector(group.selection);
@@ -15167,6 +15176,7 @@
 
     void SelectChildren()
     {
+                new Exception().printStackTrace();
         System.exit(0);
         /*
         Composite group = (Composite) object;
@@ -16280,6 +16290,7 @@
         {
             if (!selection)
             {
+                new Exception().printStackTrace();
                 System.exit(0);
                 return;
             }

--
Gitblit v1.6.2