Преглед на файлове

* Made some classes pretty, hope you like it

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9547 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
Sha..rd преди 13 години
родител
ревизия
7825249952

+ 0 - 2
engine/src/core-effects/com/jme3/post/filters/RadialBlurFilter.java

@@ -73,11 +73,9 @@ public class RadialBlurFilter extends Filter {
 
     @Override
     protected Material getMaterial() {
-
         material.setFloat("SampleDist", sampleDist);
         material.setFloat("SampleStrength", sampleStrength);
         material.setParam("Samples", VarType.FloatArray, samples);
-
         return material;
     }
 

+ 1 - 1
engine/src/core/com/jme3/audio/Environment.java

@@ -70,7 +70,7 @@ public class Environment {
         Closet = new Environment(1, 1, 1, 1, .15f, 1, .6f, .0025f, .5f, .0006f);
     }
 
-    private static final float eaxDbToAmp(float eaxDb){
+    private static float eaxDbToAmp(float eaxDb){
         float dB = eaxDb / 2000f;
         return FastMath.pow(10f, dB);
     }

+ 0 - 1
engine/src/core/com/jme3/scene/Node.java

@@ -62,7 +62,6 @@ public class Node extends Spatial implements Savable {
 
     private static final Logger logger = Logger.getLogger(Node.class.getName());
 
-
     /** 
      * This node's children.
      */

+ 13 - 7
engine/src/core/com/jme3/util/NativeObjectManager.java

@@ -32,6 +32,7 @@
 
 package com.jme3.util;
 
+import com.jme3.renderer.Renderer;
 import java.lang.ref.PhantomReference;
 import java.lang.ref.ReferenceQueue;
 import java.lang.ref.WeakReference;
@@ -58,8 +59,8 @@ public class NativeObjectManager {
     private static final int MAX_REMOVES_PER_FRAME = 100;
     
     /**
-     * The queue will receive notifications of {@link NativeObject}s which are no longer
-     * referenced.
+     * The queue will receive notifications of {@link NativeObject}s which 
+     * are no longer referenced.
      */
     private ReferenceQueue<Object> refQueue = new ReferenceQueue<Object>();
 
@@ -89,27 +90,32 @@ public class NativeObjectManager {
     public void registerForCleanup(NativeObject obj){
         NativeObjectRef ref = new NativeObjectRef(obj);
         refList.add(ref);
-        if (logger.isLoggable(Level.FINEST))
+        if (logger.isLoggable(Level.FINEST)) {
             logger.log(Level.FINEST, "Registered: {0}", new String[]{obj.toString()});
+        }
     }
 
     /**
-     * Deletes unused GLObjects
+     * Deletes unused NativeObjects.
+     * Will delete at most {@link #MAX_REMOVES_PER_FRAME} objects.
+     * 
+     * @param rendererObject The renderer object. 
+     * For graphics objects, {@link Renderer} is used, for audio, {#link AudioRenderer} is used.
      */
     public void deleteUnused(Object rendererObject){
         int removed = 0;
         while (removed < MAX_REMOVES_PER_FRAME) {
             NativeObjectRef ref = (NativeObjectRef) refQueue.poll();
-            if (ref == null)
+            if (ref == null) {
                 break;
+            }
 
             refList.remove(ref);
             ref.objClone.deleteObject(rendererObject);
             removed++;
         }
         if (removed >= 1) {
-            //System.out.println("NativeObjectManager: " + removed + " native objects were removed from GL");
-            logger.log(Level.FINE, "NativeObjectManager: {0} native objects were removed from GL", removed);
+            logger.log(Level.FINE, "NativeObjectManager: {0} native objects were removed from native", removed);
         }
     }
 

+ 2 - 2
engine/src/core/com/jme3/util/xml/SAXUtil.java

@@ -46,8 +46,8 @@ public final class SAXUtil {
      * Parses an integer from a string, if the string is null returns
      * def.
      * 
-     * @param i
-     * @param def
+     * @param i The string to parse
+     * @param def The default value if the string is null
      * @return
      * @throws SAXException 
      */

+ 10 - 8
engine/src/lwjgl/com/jme3/system/lwjgl/LwjglDisplay.java

@@ -68,20 +68,21 @@ public class LwjglDisplay extends LwjglAbstractDisplay {
     }
 
     protected void createContext(AppSettings settings) throws LWJGLException{
-        DisplayMode displayMode = null;
+        DisplayMode displayMode;
         if (settings.getWidth() <= 0 || settings.getHeight() <= 0){
             displayMode = Display.getDesktopDisplayMode();
             settings.setResolution(displayMode.getWidth(), displayMode.getHeight());
         }else if (settings.isFullscreen()){
             displayMode = getFullscreenDisplayMode(settings.getWidth(), settings.getHeight(),
                                                    settings.getBitsPerPixel(), settings.getFrequency());
-            if (displayMode == null)
+            if (displayMode == null) {
                 throw new RuntimeException("Unable to find fullscreen display mode matching settings");
+            }
         }else{
             displayMode = new DisplayMode(settings.getWidth(), settings.getHeight());
         }
 
-	   int samples = 0;
+        int samples = 0;
         if (settings.getSamples() > 1){
             samples = settings.getSamples();
         }
@@ -106,14 +107,15 @@ public class LwjglDisplay extends LwjglAbstractDisplay {
         pixelFormat = pf;
         
         Display.setTitle(settings.getTitle());
-        if (displayMode != null){
-            if (settings.isFullscreen()){
+        
+        if (displayMode != null) {
+            if (settings.isFullscreen()) {
                 Display.setDisplayModeAndFullscreen(displayMode);
-            }else{
+            } else {
                 Display.setFullscreen(false);
                 Display.setDisplayMode(displayMode);
             }
-        }else{
+        } else {
             Display.setFullscreen(settings.isFullscreen());
         }
 
@@ -123,7 +125,7 @@ public class LwjglDisplay extends LwjglAbstractDisplay {
         
         Display.setVSyncEnabled(settings.isVSync());
         
-        if (created.get() && !pixelFormatChanged){
+        if (created.get() && !pixelFormatChanged) {
             Display.releaseContext();
             Display.makeCurrent();
             Display.update();

+ 4 - 4
engine/src/lwjgl/com/jme3/system/lwjgl/LwjglOffscreenBuffer.java

@@ -53,16 +53,16 @@ public class LwjglOffscreenBuffer extends LwjglContext implements Runnable {
     private int width;
     private int height;
     private PixelFormat pixelFormat;
-
+    
     protected void initInThread(){
         if ((Pbuffer.getCapabilities() & Pbuffer.PBUFFER_SUPPORTED) == 0){
             logger.severe("Offscreen surfaces are not supported.");
             return;
         }
 
-	   int samples = 0;
-         if (settings.getSamples() > 1){
-              samples = settings.getSamples();
+        int samples = 0;
+        if (settings.getSamples() > 1) {
+            samples = settings.getSamples();
         }
         pixelFormat = new PixelFormat(settings.getBitsPerPixel(),
                                       0,

+ 0 - 2
engine/src/niftygui/com/jme3/niftygui/InputSystemJme.java

@@ -173,7 +173,6 @@ public class InputSystemJme implements InputSystem, RawInputListener {
         if (consumed && pressed) {
             processSoftKeyboard();
         }
-
     }
 
     private void onKeyEventQueued(KeyInputEvent evt, NiftyInputConsumer nic) {
@@ -259,7 +258,6 @@ public class InputSystemJme implements InputSystem, RawInputListener {
                     }
 
                     softTextDialogInput.requestDialog(SoftTextDialogInput.TEXT_ENTRY_DIALOG, "Enter Text", initialValue, new SoftTextDialogInputListener() {
-
                         public void onSoftText(int action, String text) {
                             if (action == SoftTextDialogInputListener.COMPLETE) {
                                 textField.setText(text);

+ 0 - 1
engine/src/terrain/com/jme3/terrain/geomipmap/lodcalc/DistanceLodCalculator.java

@@ -65,7 +65,6 @@ public class DistanceLodCalculator implements LodCalculator {
     public boolean calculateLod(TerrainPatch terrainPatch, List<Vector3f> locations, HashMap<String, UpdatedTerrainPatch> updates) {
         float distance = getCenterLocation(terrainPatch).distance(locations.get(0));
 
-        
         if (turnOffLod) {
             // set to full detail
             int prevLOD = terrainPatch.getLod();