* Made some classes pretty, hope you like it
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9547 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
27e97c34da
commit
7825249952
@ -73,11 +73,9 @@ public class RadialBlurFilter extends Filter {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Material getMaterial() {
|
protected Material getMaterial() {
|
||||||
|
|
||||||
material.setFloat("SampleDist", sampleDist);
|
material.setFloat("SampleDist", sampleDist);
|
||||||
material.setFloat("SampleStrength", sampleStrength);
|
material.setFloat("SampleStrength", sampleStrength);
|
||||||
material.setParam("Samples", VarType.FloatArray, samples);
|
material.setParam("Samples", VarType.FloatArray, samples);
|
||||||
|
|
||||||
return material;
|
return material;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@ public class Environment {
|
|||||||
Closet = new Environment(1, 1, 1, 1, .15f, 1, .6f, .0025f, .5f, .0006f);
|
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;
|
float dB = eaxDb / 2000f;
|
||||||
return FastMath.pow(10f, dB);
|
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());
|
private static final Logger logger = Logger.getLogger(Node.class.getName());
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This node's children.
|
* This node's children.
|
||||||
*/
|
*/
|
||||||
|
@ -32,6 +32,7 @@
|
|||||||
|
|
||||||
package com.jme3.util;
|
package com.jme3.util;
|
||||||
|
|
||||||
|
import com.jme3.renderer.Renderer;
|
||||||
import java.lang.ref.PhantomReference;
|
import java.lang.ref.PhantomReference;
|
||||||
import java.lang.ref.ReferenceQueue;
|
import java.lang.ref.ReferenceQueue;
|
||||||
import java.lang.ref.WeakReference;
|
import java.lang.ref.WeakReference;
|
||||||
@ -58,8 +59,8 @@ public class NativeObjectManager {
|
|||||||
private static final int MAX_REMOVES_PER_FRAME = 100;
|
private static final int MAX_REMOVES_PER_FRAME = 100;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The queue will receive notifications of {@link NativeObject}s which are no longer
|
* The queue will receive notifications of {@link NativeObject}s which
|
||||||
* referenced.
|
* are no longer referenced.
|
||||||
*/
|
*/
|
||||||
private ReferenceQueue<Object> refQueue = new ReferenceQueue<Object>();
|
private ReferenceQueue<Object> refQueue = new ReferenceQueue<Object>();
|
||||||
|
|
||||||
@ -89,27 +90,32 @@ public class NativeObjectManager {
|
|||||||
public void registerForCleanup(NativeObject obj){
|
public void registerForCleanup(NativeObject obj){
|
||||||
NativeObjectRef ref = new NativeObjectRef(obj);
|
NativeObjectRef ref = new NativeObjectRef(obj);
|
||||||
refList.add(ref);
|
refList.add(ref);
|
||||||
if (logger.isLoggable(Level.FINEST))
|
if (logger.isLoggable(Level.FINEST)) {
|
||||||
logger.log(Level.FINEST, "Registered: {0}", new String[]{obj.toString()});
|
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){
|
public void deleteUnused(Object rendererObject){
|
||||||
int removed = 0;
|
int removed = 0;
|
||||||
while (removed < MAX_REMOVES_PER_FRAME) {
|
while (removed < MAX_REMOVES_PER_FRAME) {
|
||||||
NativeObjectRef ref = (NativeObjectRef) refQueue.poll();
|
NativeObjectRef ref = (NativeObjectRef) refQueue.poll();
|
||||||
if (ref == null)
|
if (ref == null) {
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
refList.remove(ref);
|
refList.remove(ref);
|
||||||
ref.objClone.deleteObject(rendererObject);
|
ref.objClone.deleteObject(rendererObject);
|
||||||
removed++;
|
removed++;
|
||||||
}
|
}
|
||||||
if (removed >= 1) {
|
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 native", removed);
|
||||||
logger.log(Level.FINE, "NativeObjectManager: {0} native objects were removed from GL", removed);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,8 +46,8 @@ public final class SAXUtil {
|
|||||||
* Parses an integer from a string, if the string is null returns
|
* Parses an integer from a string, if the string is null returns
|
||||||
* def.
|
* def.
|
||||||
*
|
*
|
||||||
* @param i
|
* @param i The string to parse
|
||||||
* @param def
|
* @param def The default value if the string is null
|
||||||
* @return
|
* @return
|
||||||
* @throws SAXException
|
* @throws SAXException
|
||||||
*/
|
*/
|
||||||
|
@ -68,15 +68,16 @@ public class LwjglDisplay extends LwjglAbstractDisplay {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected void createContext(AppSettings settings) throws LWJGLException{
|
protected void createContext(AppSettings settings) throws LWJGLException{
|
||||||
DisplayMode displayMode = null;
|
DisplayMode displayMode;
|
||||||
if (settings.getWidth() <= 0 || settings.getHeight() <= 0){
|
if (settings.getWidth() <= 0 || settings.getHeight() <= 0){
|
||||||
displayMode = Display.getDesktopDisplayMode();
|
displayMode = Display.getDesktopDisplayMode();
|
||||||
settings.setResolution(displayMode.getWidth(), displayMode.getHeight());
|
settings.setResolution(displayMode.getWidth(), displayMode.getHeight());
|
||||||
}else if (settings.isFullscreen()){
|
}else if (settings.isFullscreen()){
|
||||||
displayMode = getFullscreenDisplayMode(settings.getWidth(), settings.getHeight(),
|
displayMode = getFullscreenDisplayMode(settings.getWidth(), settings.getHeight(),
|
||||||
settings.getBitsPerPixel(), settings.getFrequency());
|
settings.getBitsPerPixel(), settings.getFrequency());
|
||||||
if (displayMode == null)
|
if (displayMode == null) {
|
||||||
throw new RuntimeException("Unable to find fullscreen display mode matching settings");
|
throw new RuntimeException("Unable to find fullscreen display mode matching settings");
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
displayMode = new DisplayMode(settings.getWidth(), settings.getHeight());
|
displayMode = new DisplayMode(settings.getWidth(), settings.getHeight());
|
||||||
}
|
}
|
||||||
@ -106,6 +107,7 @@ public class LwjglDisplay extends LwjglAbstractDisplay {
|
|||||||
pixelFormat = pf;
|
pixelFormat = pf;
|
||||||
|
|
||||||
Display.setTitle(settings.getTitle());
|
Display.setTitle(settings.getTitle());
|
||||||
|
|
||||||
if (displayMode != null) {
|
if (displayMode != null) {
|
||||||
if (settings.isFullscreen()) {
|
if (settings.isFullscreen()) {
|
||||||
Display.setDisplayModeAndFullscreen(displayMode);
|
Display.setDisplayModeAndFullscreen(displayMode);
|
||||||
|
@ -173,7 +173,6 @@ public class InputSystemJme implements InputSystem, RawInputListener {
|
|||||||
if (consumed && pressed) {
|
if (consumed && pressed) {
|
||||||
processSoftKeyboard();
|
processSoftKeyboard();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onKeyEventQueued(KeyInputEvent evt, NiftyInputConsumer nic) {
|
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() {
|
softTextDialogInput.requestDialog(SoftTextDialogInput.TEXT_ENTRY_DIALOG, "Enter Text", initialValue, new SoftTextDialogInputListener() {
|
||||||
|
|
||||||
public void onSoftText(int action, String text) {
|
public void onSoftText(int action, String text) {
|
||||||
if (action == SoftTextDialogInputListener.COMPLETE) {
|
if (action == SoftTextDialogInputListener.COMPLETE) {
|
||||||
textField.setText(text);
|
textField.setText(text);
|
||||||
|
@ -65,7 +65,6 @@ public class DistanceLodCalculator implements LodCalculator {
|
|||||||
public boolean calculateLod(TerrainPatch terrainPatch, List<Vector3f> locations, HashMap<String, UpdatedTerrainPatch> updates) {
|
public boolean calculateLod(TerrainPatch terrainPatch, List<Vector3f> locations, HashMap<String, UpdatedTerrainPatch> updates) {
|
||||||
float distance = getCenterLocation(terrainPatch).distance(locations.get(0));
|
float distance = getCenterLocation(terrainPatch).distance(locations.get(0));
|
||||||
|
|
||||||
|
|
||||||
if (turnOffLod) {
|
if (turnOffLod) {
|
||||||
// set to full detail
|
// set to full detail
|
||||||
int prevLOD = terrainPatch.getLod();
|
int prevLOD = terrainPatch.getLod();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user