Updated MatParam.getAsString to reflect recent change on j3m texture parameter format

cleanup_build_scripts
Nehon 9 years ago
parent eea4d54be7
commit f14e609287
  1. 35
      jme3-core/src/main/java/com/jme3/material/MatParam.java

@ -248,16 +248,45 @@ When arrays can be inserted in J3M files
if (texKey.isFlipY()) { if (texKey.isFlipY()) {
ret += "Flip "; ret += "Flip ";
} }
if (texVal.getWrap(Texture.WrapAxis.S) == WrapMode.Repeat) {
ret += "Repeat "; //Wrap mode
ret += getWrapMode(texVal, Texture.WrapAxis.S);
ret += getWrapMode(texVal, Texture.WrapAxis.T);
ret += getWrapMode(texVal, Texture.WrapAxis.R);
//Min and Mag filter
Texture.MinFilter def = Texture.MinFilter.BilinearNoMipMaps;
if(texVal.getImage().hasMipmaps() || texKey.isGenerateMips()){
def = Texture.MinFilter.Trilinear;
}
if(texVal.getMinFilter() != def){
ret += "Min" + texVal.getMinFilter().name()+ " ";
} }
return ret + texKey.getName(); if(texVal.getMagFilter() != Texture.MagFilter.Bilinear){
ret += "Mag" + texVal.getMagFilter().name()+ " ";
}
return ret + "\"" + texKey.getName() + "\"";
default: default:
return null; // parameter type not supported in J3M return null; // parameter type not supported in J3M
} }
} }
private String getWrapMode(Texture texVal, Texture.WrapAxis axis) {
WrapMode mode = WrapMode.EdgeClamp;
try{
mode = texVal.getWrap(axis);
}catch (IllegalArgumentException e){
//this axis doesn't exist on the texture
return "";
}
if(mode != WrapMode.EdgeClamp){
return"Wrap"+ mode.name() + "_" + axis.name() + " ";
}
return "";
}
@Override @Override
public MatParam clone() { public MatParam clone() {
try { try {

Loading…
Cancel
Save