- Material does not check anymore if a param is defined when clearing it.
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@6973 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
6fd3bbedae
commit
0dd27bda09
@ -288,6 +288,7 @@ public class Material implements Cloneable, Savable, Comparable<Material> {
|
|||||||
private String checkSetParam(VarType type, String name) {
|
private String checkSetParam(VarType type, String name) {
|
||||||
MatParam paramDef = def.getMaterialParam(name);
|
MatParam paramDef = def.getMaterialParam(name);
|
||||||
String newName = name;
|
String newName = name;
|
||||||
|
|
||||||
if (paramDef == null && name.startsWith("m_")) {
|
if (paramDef == null && name.startsWith("m_")) {
|
||||||
newName = name.substring(2);
|
newName = name.substring(2);
|
||||||
paramDef = def.getMaterialParam(newName);
|
paramDef = def.getMaterialParam(newName);
|
||||||
@ -335,7 +336,8 @@ public class Material implements Cloneable, Savable, Comparable<Material> {
|
|||||||
* @param name the name of the parameter to clear
|
* @param name the name of the parameter to clear
|
||||||
*/
|
*/
|
||||||
public void clearParam(String name) {
|
public void clearParam(String name) {
|
||||||
name = checkSetParam(null, name);
|
//On removal, we don't check if the param exists in the paramDef, and just go on with the process.
|
||||||
|
// name = checkSetParam(null, name);
|
||||||
|
|
||||||
MatParam matParam = getParam(name);
|
MatParam matParam = getParam(name);
|
||||||
if (matParam != null) {
|
if (matParam != null) {
|
||||||
@ -413,7 +415,7 @@ public class Material implements Cloneable, Savable, Comparable<Material> {
|
|||||||
*/
|
*/
|
||||||
public void setTexture(String name, Texture value) {
|
public void setTexture(String name, Texture value) {
|
||||||
if (value == null) {
|
if (value == null) {
|
||||||
// clear it
|
// clear it
|
||||||
clearTextureParam(name);
|
clearTextureParam(name);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user