Explorar el Código

jme3-core: delete useless fields and variables

Stephen Gold hace 4 años
padre
commit
feffbdb628

+ 1 - 2
jme3-core/src/main/java/com/jme3/anim/AnimComposer.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2020 jMonkeyEngine
+ * Copyright (c) 2009-2021 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -462,7 +462,6 @@ public class AnimComposer extends AbstractControl {
         private AnimComposer ac;
         private Action currentAction;
         private AnimationMask mask;
-        private float weight;
         private double time;
 
         public Layer(AnimComposer ac) {

+ 1 - 3
jme3-core/src/main/java/com/jme3/app/BasicProfiler.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 jMonkeyEngine
+ * Copyright (c) 2014-2021 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -67,7 +67,6 @@ public class BasicProfiler implements AppProfiler {
     private long[] frames;
     private long startTime;
     private long renderTime;
-    private long previousFrame;
     private long updateInterval = 1000000L; // once a millisecond
     private long lastUpdate = 0;
     
@@ -174,7 +173,6 @@ public class BasicProfiler implements AppProfiler {
             case EndFrame:
                 long time = System.nanoTime();
                 frames[frameIndex * 2 + 1] = time - renderTime;
-                previousFrame = startTime; 
                 frameIndex++;
                 if( frameIndex >= size ) {
                     frameIndex = 0;

+ 0 - 1
jme3-core/src/main/java/com/jme3/app/state/AppStateManager.java

@@ -96,7 +96,6 @@ public class AppStateManager {
     // is that they are all modified from the same thread anyway.
     
     private final Application app;
-    private AppState[] stateArray;
 
     public AppStateManager(Application app){
         this.app = app;

+ 1 - 3
jme3-core/src/main/java/com/jme3/app/state/ScreenshotAppState.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2020 jMonkeyEngine
+ * Copyright (c) 2009-2021 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -67,7 +67,6 @@ public class ScreenshotAppState extends AbstractAppState implements ActionListen
     private String shotName;
     private long shotIndex = 0;
     private int width, height;
-    private AppProfiler prof;
     /**
      * InputManager to which the ActionListener and the mapping are added
      */
@@ -312,7 +311,6 @@ public class ScreenshotAppState extends AbstractAppState implements ActionListen
 
     @Override
     public void setProfiler(AppProfiler profiler) {
-        this.prof = profiler;
     }
 
     /**

+ 0 - 1
jme3-core/src/main/java/com/jme3/cinematic/events/MotionEvent.java

@@ -70,7 +70,6 @@ public class MotionEvent extends AbstractCinematicEvent implements Control, JmeC
     protected Direction directionType = Direction.None;
     protected MotionPath path;
     private boolean isControl = true;
-    final private int travelDirection = 1;
     /**
      * the distance traveled by the spatial on the path
      */

+ 1 - 8
jme3-core/src/main/java/com/jme3/collision/bih/BIHTree.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2020 jMonkeyEngine
+ * Copyright (c) 2009-2021 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -72,13 +72,6 @@ public class BIHTree implements CollisionData {
     // private transient CollisionResults boundResults = new CollisionResults();
     private transient float[] bihSwapTmp;
     
-    private static final TriangleAxisComparator[] comparators = new TriangleAxisComparator[]
-    {
-        new TriangleAxisComparator(0),
-        new TriangleAxisComparator(1),
-        new TriangleAxisComparator(2)
-    };
-
     private void initTriList(FloatBuffer vb, IndexBuffer ib) {
         pointData = new float[numTris * 3 * 3];
         int p = 0;

+ 1 - 2
jme3-core/src/main/java/com/jme3/input/InputManager.java

@@ -94,7 +94,6 @@ public class InputManager implements RawInputListener {
     private long lastLastUpdateTime = 0;
     private long lastUpdateTime = 0;
     private long frameDelta = 0;
-    private long firstTime = 0;
     private boolean eventsPermitted = false;
     private boolean mouseVisible = true;
     private boolean safeMode = false;
@@ -151,7 +150,7 @@ public class InputManager implements RawInputListener {
             touch.setInputListener(this);
         }
 
-        firstTime = keys.getInputTimeNanos();
+        keys.getInputTimeNanos();
     }
 
     private void invokeActions(int hash, boolean pressed) {

+ 1 - 4
jme3-core/src/main/java/com/jme3/post/PreDepthProcessor.java

@@ -49,13 +49,10 @@ public class PreDepthProcessor implements SceneProcessor {
 
     private RenderManager rm;
     private ViewPort vp;
-    final private AssetManager assetManager;
     final private Material preDepth;
     final private RenderState forcedRS;
-    private AppProfiler prof;
 
     public PreDepthProcessor(AssetManager assetManager){
-        this.assetManager = assetManager;
         preDepth = new Material(assetManager, "Common/MatDefs/Shadow/PreShadow.j3md");
         preDepth.getAdditionalRenderState().setPolyOffset(0, 0);
         preDepth.getAdditionalRenderState().setFaceCullMode(FaceCullMode.Back);
@@ -107,7 +104,7 @@ public class PreDepthProcessor implements SceneProcessor {
 
     @Override
     public void setProfiler(AppProfiler profiler) {
-        this.prof = profiler;
+        // not implemented
     }
 
 }

+ 0 - 1
jme3-core/src/main/java/com/jme3/renderer/opengl/GLRenderer.java

@@ -84,7 +84,6 @@ public final class GLRenderer implements Renderer {
     private final StringBuilder stringBuf = new StringBuilder(250);
     private final IntBuffer intBuf1 = BufferUtils.createIntBuffer(1);
     private final IntBuffer intBuf16 = BufferUtils.createIntBuffer(16);
-    private final FloatBuffer floatBuf16 = BufferUtils.createFloatBuffer(16);
     private final RenderContext context = new RenderContext();
     private final NativeObjectManager objManager = new NativeObjectManager();
     private final EnumSet<Caps> caps = EnumSet.noneOf(Caps.class);

+ 0 - 2
jme3-core/src/main/java/com/jme3/renderer/opengl/GLTracer.java

@@ -59,14 +59,12 @@ public final class GLTracer implements InvocationHandler {
     
     private static final String ANSI_RESET = "\u001B[0m";
     private static final String ANSI_BRIGHT = "\u001B[1m";
-    private static final String ANSI_BLACK = "\u001B[30m";
     private static final String ANSI_RED = "\u001B[31m";
     private static final String ANSI_GREEN = "\u001B[32m";
     private static final String ANSI_YELLOW = "\u001B[33m";
     private static final String ANSI_BLUE = "\u001B[34m";
     private static final String ANSI_MAGENTA = "\u001B[35m";
     private static final String ANSI_CYAN = "\u001B[36m";
-    private static final String ANSI_WHITE = "\u001B[37m";
 
     private static void noEnumArgs(String method, int... argSlots) {
         IntMap<Void> argSlotsMap = new IntMap<>();

+ 1 - 34
jme3-core/src/main/java/com/jme3/util/SortUtil.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2020 jMonkeyEngine
+ * Copyright (c) 2009-2021 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -40,39 +40,6 @@ import java.util.Comparator;
  */
 public class SortUtil {
 
-    /** 
-     * The size at or below which we will use insertion sort because it's
-     * probably faster. 
-     */
-    private static final int INSERTION_SORT_THRESHOLD = 7;
-    
-    
-    /*
- procedure optimizedGnomeSort(a[])
-    pos := 1
-    last := 0
-    while pos < length(a)
-        if (a[pos] >= a[pos-1])
-            if (last != 0)
-                pos := last
-                last := 0
-            end if
-            pos := pos + 1
-        else
-            swap a[pos] and a[pos-1]
-            if (pos > 1)
-                if (last == 0)
-                    last := pos
-                end if
-                pos := pos - 1
-            else
-                pos := pos + 1
-            end if
-        end if
-    end while
-end procedure
-     */
-    
     @SuppressWarnings("unchecked")
     public static void gsort(Object[] a, Comparator comp) {
         int pos = 1;

+ 3 - 15
jme3-core/src/plugins/java/com/jme3/texture/plugins/DDSLoader.java

@@ -61,12 +61,10 @@ import java.util.logging.Logger;
 public class DDSLoader implements AssetLoader {
 
     private static final Logger logger = Logger.getLogger(DDSLoader.class.getName());
-    private static final boolean forceRGBA = false;
     private static final int DDSD_MANDATORY = 0x1007;
     private static final int DDSD_MANDATORY_DX10 = 0x6;
     private static final int DDSD_MIPMAPCOUNT = 0x20000;
     private static final int DDSD_LINEARSIZE = 0x80000;
-    private static final int DDSD_DEPTH = 0x800000;
     private static final int DDPF_ALPHAPIXELS = 0x1;
     private static final int DDPF_FOURCC = 0x4;
     private static final int DDPF_RGB = 0x40;
@@ -76,8 +74,6 @@ public class DDSLoader implements AssetLoader {
     private static final int DDPF_ALPHA = 0x2;
     // used by NVTextureTools to mark normal images.
     private static final int DDPF_NORMAL = 0x80000000;
-    private static final int SWIZZLE_xGxR = 0x78477852;
-    private static final int DDSCAPS_COMPLEX = 0x8;
     private static final int DDSCAPS_TEXTURE = 0x1000;
     private static final int DDSCAPS_MIPMAP = 0x400000;
     private static final int DDSCAPS2_CUBEMAP = 0x200;
@@ -88,12 +84,8 @@ public class DDSLoader implements AssetLoader {
     private static final int PF_ATI1 = 0x31495441;
     private static final int PF_ATI2 = 0x32495441; // 0x41544932;
     private static final int PF_DX10 = 0x30315844; // a DX10 format
-    private static final int DX10DIM_BUFFER = 0x1,
-            DX10DIM_TEXTURE1D = 0x2,
-            DX10DIM_TEXTURE2D = 0x3,
-            DX10DIM_TEXTURE3D = 0x4;
-    private static final int DX10MISC_GENERATE_MIPS = 0x1,
-            DX10MISC_TEXTURECUBE = 0x4;
+    private static final int DX10DIM_TEXTURE3D = 0x4;
+    private static final int DX10MISC_TEXTURECUBE = 0x4;
     private static final double LOG2 = Math.log(2);
     private int width;
     private int height;
@@ -107,7 +99,6 @@ public class DDSLoader implements AssetLoader {
     private boolean compressed;
     private boolean texture3D;
     private boolean grayscaleOrAlpha;
-    private boolean normal;
     private Format pixelFormat;
     private int bpp;
     private int[] sizes;
@@ -253,7 +244,7 @@ public class DDSLoader implements AssetLoader {
         }
 
         int pfFlags = in.readInt();
-        normal = is(pfFlags, DDPF_NORMAL);
+        is(pfFlags, DDPF_NORMAL);
 
         if (is(pfFlags, DDPF_FOURCC)) {
             compressed = true;
@@ -277,9 +268,6 @@ public class DDSLoader implements AssetLoader {
                 case PF_DXT5:
                     bpp = 8;
                     pixelFormat = Image.Format.DXT5;
-                    if (swizzle == SWIZZLE_xGxR) {
-                        normal = true;
-                    }
                     break;
                 case PF_ATI1:
                     bpp = 4;

+ 1 - 2
jme3-core/src/test/java/com/jme3/shader/DefineListTest.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2015 jMonkeyEngine
+ * Copyright (c) 2009-2021 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -47,7 +47,6 @@ public class DefineListTest {
     private static final int BOOL_VAR = 0;
     private static final int INT_VAR = 1;
     private static final int FLOAT_VAR = 2;
-    private static final DefineList EMPTY = new DefineList(NUM_DEFINES);
 
     @Test
     public void testHashCollision() {