Skip to content

Commit

Permalink
restoring changes + code formatting only
Browse files Browse the repository at this point in the history
  • Loading branch information
capdevon authored Feb 19, 2024
1 parent b17f10d commit fd8ee52
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions jme3-core/src/main/java/com/jme3/shader/VarType.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,40 +46,39 @@

public enum VarType {

Float("float", float.class, Float.class),
Vector2("vec2", Vector2f.class),
Float("float", float.class, Float.class),
Vector2("vec2", Vector2f.class),
Vector3("vec3", Vector3f.class),
Vector4("vec4", Vector4f.class, ColorRGBA.class),

IntArray(true, false, "int", int[].class, Integer[].class),
FloatArray(true, false, "float", float[].class, Float[].class),
FloatArray(true, false, "float", float[].class, Float[].class),
Vector2Array(true, false, "vec2", Vector2f[].class),
Vector3Array(true, false, "vec3", Vector3f[].class),
Vector3Array(true, false, "vec3", Vector3f[].class),
Vector4Array(true, false, "vec4", Vector4f[].class),

Boolean("bool", boolean.class, Boolean.class),
Boolean("bool", Boolean.class, boolean.class),

Matrix3(true, false, "mat3", Matrix3f.class),
Matrix3(true, false, "mat3", Matrix3f.class),
Matrix4(true, false, "mat4", Matrix4f.class),

Matrix3Array(true, false, "mat3", Matrix3f[].class),
Matrix3Array(true, false, "mat3", Matrix3f[].class),
Matrix4Array(true, false, "mat4", Matrix4f[].class),

TextureBuffer(false, true, "sampler1D|sampler1DShadow"),
Texture2D(false, true, "sampler2D|sampler2DShadow", Texture2D.class, Texture.class),
Texture3D(false, true, "sampler3D", Texture3D.class, Texture.class),
TextureArray(false, true, "sampler2DArray|sampler2DArrayShadow", TextureArray.class, Texture.class),
TextureCubeMap(false, true, "samplerCube", TextureCubeMap.class, Texture.class),
Int("int", int.class, Integer.class),
UniformBufferObject(false, false, "custom", BufferObject.class),
Int("int", int.class, Integer.class),
UniformBufferObject(false, false, "custom", BufferObject.class),
ShaderStorageBufferObject(false, false, "custom", BufferObject.class);


private boolean usesMultiData = false;
private boolean textureType = false;
private final String glslType;
private Class<?>[] javaTypes;

VarType(String glslType, Class<?>... javaTypes) {
this.glslType = glslType;
if (javaTypes != null) {
Expand All @@ -90,7 +89,7 @@ public enum VarType {
}

VarType(boolean multiData, boolean textureType, String glslType, Class<?>... javaTypes) {
usesMultiData = multiData;
this.usesMultiData = multiData;
this.textureType = textureType;
this.glslType = glslType;
if (javaTypes != null) {
Expand All @@ -99,9 +98,10 @@ public enum VarType {
this.javaTypes = new Class<?>[0];
}
}

/**
* Check if the passed object is of a type mapped to this VarType
*
* @param o Object to check
* @return true if the object type is mapped to this VarType
*/
Expand All @@ -116,6 +116,7 @@ public boolean isOfType(Object o) {

/**
* Get the java types mapped to this VarType
*
* @return an array of classes mapped to this VarType
*/
public Class<?>[] getJavaType() {
Expand All @@ -132,6 +133,6 @@ public boolean usesMultiData() {

public String getGlslType() {
return glslType;
}
}

}

0 comments on commit fd8ee52

Please sign in to comment.