* @SuppressWarnings("fallthrough") to prevent warnings
* Fixed rest of the warnings git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7241 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
7dd3d52e9e
commit
d729da9e78
engine/src
core-plugins/com/jme3/export/binary
core/com/jme3
desktop-fx/com/jme3/shadow
lwjgl-ogl/com/jme3/renderer/lwjgl
@ -416,6 +416,13 @@ final class BinaryOutputCapsule implements OutputCapsule {
|
|||||||
return Arrays.equals(bytes, other);
|
return Arrays.equals(bytes, other);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
int hash = 7;
|
||||||
|
hash = 23 * hash + Arrays.hashCode(this.bytes);
|
||||||
|
return hash;
|
||||||
|
}
|
||||||
|
|
||||||
public void finish() {
|
public void finish() {
|
||||||
// renamed to finish as 'finalize' in java.lang.Object should not be
|
// renamed to finish as 'finalize' in java.lang.Object should not be
|
||||||
// overridden like this
|
// overridden like this
|
||||||
|
@ -170,6 +170,7 @@ public final class Matrix3f implements Savable, Cloneable {
|
|||||||
* the colum index.
|
* the colum index.
|
||||||
* @return the value at (i, j).
|
* @return the value at (i, j).
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("fallthrough")
|
||||||
public float get(int i, int j) {
|
public float get(int i, int j) {
|
||||||
switch (i) {
|
switch (i) {
|
||||||
case 0:
|
case 0:
|
||||||
@ -489,6 +490,7 @@ public final class Matrix3f implements Savable, Cloneable {
|
|||||||
* the value for (i, j).
|
* the value for (i, j).
|
||||||
* @return this
|
* @return this
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("fallthrough")
|
||||||
public Matrix3f set(int i, int j, float value) {
|
public Matrix3f set(int i, int j, float value) {
|
||||||
switch (i) {
|
switch (i) {
|
||||||
case 0:
|
case 0:
|
||||||
@ -846,7 +848,6 @@ public final class Matrix3f implements Savable, Cloneable {
|
|||||||
* @return This matrix, after the multiplication
|
* @return This matrix, after the multiplication
|
||||||
*/
|
*/
|
||||||
public Matrix3f multLocal(Matrix3f mat) {
|
public Matrix3f multLocal(Matrix3f mat) {
|
||||||
|
|
||||||
return mult(mat, this);
|
return mult(mat, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1050,8 +1051,9 @@ public final class Matrix3f implements Savable, Cloneable {
|
|||||||
*
|
*
|
||||||
* @return the string representation of this object.
|
* @return the string representation of this object.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
StringBuffer result = new StringBuffer("Matrix3f\n[\n");
|
StringBuilder result = new StringBuilder("Matrix3f\n[\n");
|
||||||
result.append(" ");
|
result.append(" ");
|
||||||
result.append(m00);
|
result.append(m00);
|
||||||
result.append(" ");
|
result.append(" ");
|
||||||
@ -1085,6 +1087,7 @@ public final class Matrix3f implements Savable, Cloneable {
|
|||||||
* @return the hashcode for this instance of Matrix4f.
|
* @return the hashcode for this instance of Matrix4f.
|
||||||
* @see java.lang.Object#hashCode()
|
* @see java.lang.Object#hashCode()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
int hash = 37;
|
int hash = 37;
|
||||||
hash = 37 * hash + Float.floatToIntBits(m00);
|
hash = 37 * hash + Float.floatToIntBits(m00);
|
||||||
@ -1109,6 +1112,7 @@ public final class Matrix3f implements Savable, Cloneable {
|
|||||||
* the object to compare for equality
|
* the object to compare for equality
|
||||||
* @return true if they are equal
|
* @return true if they are equal
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (!(o instanceof Matrix3f) || o == null) {
|
if (!(o instanceof Matrix3f) || o == null) {
|
||||||
return false;
|
return false;
|
||||||
@ -1270,7 +1274,7 @@ public final class Matrix3f implements Savable, Cloneable {
|
|||||||
m22 *= scale.z;
|
m22 *= scale.z;
|
||||||
}
|
}
|
||||||
|
|
||||||
static final boolean equalIdentity(Matrix3f mat) {
|
static boolean equalIdentity(Matrix3f mat) {
|
||||||
if (Math.abs(mat.m00 - 1) > 1e-4) return false;
|
if (Math.abs(mat.m00 - 1) > 1e-4) return false;
|
||||||
if (Math.abs(mat.m11 - 1) > 1e-4) return false;
|
if (Math.abs(mat.m11 - 1) > 1e-4) return false;
|
||||||
if (Math.abs(mat.m22 - 1) > 1e-4) return false;
|
if (Math.abs(mat.m22 - 1) > 1e-4) return false;
|
||||||
|
@ -280,6 +280,7 @@ public final class Matrix4f implements Savable, Cloneable {
|
|||||||
* the colum index.
|
* the colum index.
|
||||||
* @return the value at (i, j).
|
* @return the value at (i, j).
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("fallthrough")
|
||||||
public float get(int i, int j) {
|
public float get(int i, int j) {
|
||||||
switch (i) {
|
switch (i) {
|
||||||
case 0:
|
case 0:
|
||||||
@ -450,6 +451,7 @@ public final class Matrix4f implements Savable, Cloneable {
|
|||||||
* @param value
|
* @param value
|
||||||
* the value for (i, j).
|
* the value for (i, j).
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("fallthrough")
|
||||||
public void set(int i, int j, float value) {
|
public void set(int i, int j, float value) {
|
||||||
switch (i) {
|
switch (i) {
|
||||||
case 0:
|
case 0:
|
||||||
|
@ -20,6 +20,7 @@ import com.jme3.util.BufferUtils;
|
|||||||
* @author Marcin Roguski (Kealthas)
|
* @author Marcin Roguski (Kealthas)
|
||||||
*/
|
*/
|
||||||
public class Surface extends Mesh {
|
public class Surface extends Mesh {
|
||||||
|
|
||||||
private SplineType type; //the type of the surface
|
private SplineType type; //the type of the surface
|
||||||
private List<List<Vector4f>> controlPoints; //space control points and their weights
|
private List<List<Vector4f>> controlPoints; //space control points and their weights
|
||||||
private List<Float>[] knots; //knots of the surface
|
private List<Float>[] knots; //knots of the surface
|
||||||
|
@ -153,12 +153,8 @@ public class Torus extends Mesh {
|
|||||||
float sinPhi = FastMath.sin(phi);
|
float sinPhi = FastMath.sin(phi);
|
||||||
tempNormal.set(radialAxis).multLocal(cosPhi);
|
tempNormal.set(radialAxis).multLocal(cosPhi);
|
||||||
tempNormal.z += sinPhi;
|
tempNormal.z += sinPhi;
|
||||||
if (true)
|
|
||||||
fnb.put(tempNormal.x).put(tempNormal.y).put(
|
fnb.put(tempNormal.x).put(tempNormal.y).put(
|
||||||
tempNormal.z);
|
tempNormal.z);
|
||||||
else
|
|
||||||
fnb.put(-tempNormal.x).put(-tempNormal.y)
|
|
||||||
.put(-tempNormal.z);
|
|
||||||
|
|
||||||
tempNormal.multLocal(innerRadius).addLocal(torusMiddle);
|
tempNormal.multLocal(innerRadius).addLocal(torusMiddle);
|
||||||
fpb.put(tempNormal.x).put(tempNormal.y).put(
|
fpb.put(tempNormal.x).put(tempNormal.y).put(
|
||||||
|
@ -286,6 +286,7 @@ public class PssmShadowRenderer implements SceneProcessor {
|
|||||||
this.direction.set(direction).normalizeLocal();
|
this.direction.set(direction).normalizeLocal();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("fallthrough")
|
||||||
public void postQueue(RenderQueue rq) {
|
public void postQueue(RenderQueue rq) {
|
||||||
GeometryList occluders = rq.getShadowQueueContent(ShadowMode.Cast);
|
GeometryList occluders = rq.getShadowQueueContent(ShadowMode.Cast);
|
||||||
if (occluders.size() == 0)
|
if (occluders.size() == 0)
|
||||||
@ -317,6 +318,8 @@ public class PssmShadowRenderer implements SceneProcessor {
|
|||||||
shadowCam.updateViewProjection();
|
shadowCam.updateViewProjection();
|
||||||
|
|
||||||
PssmShadowUtil.updateFrustumSplits(splitsArray, viewCam.getFrustumNear(), zFar, lambda);
|
PssmShadowUtil.updateFrustumSplits(splitsArray, viewCam.getFrustumNear(), zFar, lambda);
|
||||||
|
|
||||||
|
|
||||||
switch (splitsArray.length){
|
switch (splitsArray.length){
|
||||||
case 5:
|
case 5:
|
||||||
splits.a = splitsArray[4];
|
splits.a = splitsArray[4];
|
||||||
|
@ -82,6 +82,7 @@ import java.util.logging.Logger;
|
|||||||
//import org.lwjgl.opengl.ARBVertexArrayObject;
|
//import org.lwjgl.opengl.ARBVertexArrayObject;
|
||||||
//import org.lwjgl.opengl.ARBHalfFloatVertex;
|
//import org.lwjgl.opengl.ARBHalfFloatVertex;
|
||||||
//import org.lwjgl.opengl.ARBVertexArrayObject;
|
//import org.lwjgl.opengl.ARBVertexArrayObject;
|
||||||
|
//import jme3tools.converters.MipMapGenerator;
|
||||||
import org.lwjgl.opengl.ARBDrawBuffers;
|
import org.lwjgl.opengl.ARBDrawBuffers;
|
||||||
//import org.lwjgl.opengl.ARBDrawInstanced;
|
//import org.lwjgl.opengl.ARBDrawInstanced;
|
||||||
import org.lwjgl.opengl.ARBDrawInstanced;
|
import org.lwjgl.opengl.ARBDrawInstanced;
|
||||||
@ -168,6 +169,7 @@ public class LwjglRenderer implements Renderer {
|
|||||||
return caps;
|
return caps;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("fallthrough")
|
||||||
public void initialize() {
|
public void initialize() {
|
||||||
ContextCapabilities ctxCaps = GLContext.getCapabilities();
|
ContextCapabilities ctxCaps = GLContext.getCapabilities();
|
||||||
if (ctxCaps.OpenGL20) {
|
if (ctxCaps.OpenGL20) {
|
||||||
@ -1514,6 +1516,7 @@ public class LwjglRenderer implements Renderer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("fallthrough")
|
||||||
private void setupTextureParams(Texture tex) {
|
private void setupTextureParams(Texture tex) {
|
||||||
Image image = tex.getImage();
|
Image image = tex.getImage();
|
||||||
int target = convertTextureType(tex.getType(), image != null ? image.getMultiSamples() : 1);
|
int target = convertTextureType(tex.getType(), image != null ? image.getMultiSamples() : 1);
|
||||||
@ -1618,6 +1621,8 @@ public class LwjglRenderer implements Renderer {
|
|||||||
|| img.getWidth() != img.getHeight()){
|
|| img.getWidth() != img.getHeight()){
|
||||||
logger.log(Level.WARNING, "Encountered NPOT texture {0}, "
|
logger.log(Level.WARNING, "Encountered NPOT texture {0}, "
|
||||||
+ "it might not display correctly.", img);
|
+ "it might not display correctly.", img);
|
||||||
|
|
||||||
|
//MipMapGenerator.resizeToPowerOf2(img);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user