* Made some classes pretty, hope you like it

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9547 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
Sha..rd 13 years ago
parent 27e97c34da
commit 7825249952
  1. 2
      engine/src/core-effects/com/jme3/post/filters/RadialBlurFilter.java
  2. 2
      engine/src/core/com/jme3/audio/Environment.java
  3. 1
      engine/src/core/com/jme3/scene/Node.java
  4. 20
      engine/src/core/com/jme3/util/NativeObjectManager.java
  5. 4
      engine/src/core/com/jme3/util/xml/SAXUtil.java
  6. 6
      engine/src/lwjgl/com/jme3/system/lwjgl/LwjglDisplay.java
  7. 2
      engine/src/niftygui/com/jme3/niftygui/InputSystemJme.java
  8. 1
      engine/src/terrain/com/jme3/terrain/geomipmap/lodcalc/DistanceLodCalculator.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;
}

@ -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);
}

@ -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.
*/

@ -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);
}
}

@ -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
*/

@ -68,15 +68,16 @@ 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());
}
@ -106,6 +107,7 @@ public class LwjglDisplay extends LwjglAbstractDisplay {
pixelFormat = pf;
Display.setTitle(settings.getTitle());
if (displayMode != null) {
if (settings.isFullscreen()) {
Display.setDisplayModeAndFullscreen(displayMode);

@ -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);

@ -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();

Loading…
Cancel
Save