From c373f70d01dbd3009d61767d6b190a6283721593 Mon Sep 17 00:00:00 2001 From: "Sha..rd" Date: Fri, 15 Jun 2012 02:27:08 +0000 Subject: [PATCH] * Fixed issue where a model loaded from J3O would crash on render (thanks ghoust) * Uniform.toString() now handles the case where name = null git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9497 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../src/core/com/jme3/material/MatParam.java | 1 + engine/src/core/com/jme3/shader/Uniform.java | 20 +++++++++---------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/engine/src/core/com/jme3/material/MatParam.java b/engine/src/core/com/jme3/material/MatParam.java index 5a63fc11d..f30440eff 100644 --- a/engine/src/core/com/jme3/material/MatParam.java +++ b/engine/src/core/com/jme3/material/MatParam.java @@ -310,6 +310,7 @@ When arrays can be inserted in J3M files InputCapsule ic = im.getCapsule(this); type = ic.readEnum("varType", VarType.class, null); name = ic.readString("name", null); + prefixedName = "m_" + name; ffBinding = ic.readEnum("ff_binding", FixedFuncBinding.class, null); switch (getVarType()) { case Boolean: diff --git a/engine/src/core/com/jme3/shader/Uniform.java b/engine/src/core/com/jme3/shader/Uniform.java index 228e0974a..1ca87ee5c 100644 --- a/engine/src/core/com/jme3/shader/Uniform.java +++ b/engine/src/core/com/jme3/shader/Uniform.java @@ -161,17 +161,15 @@ public class Uniform extends ShaderVariable { @Override public String toString(){ StringBuilder sb = new StringBuilder(); - if (name != null){ - sb.append("Uniform[name="); - sb.append(name); - if (varType != null){ - sb.append(", type="); - sb.append(varType); - sb.append(", value="); - sb.append(value); - }else{ - sb.append(", value="); - } + sb.append("Uniform[name="); + sb.append(name); + if (varType != null){ + sb.append(", type="); + sb.append(varType); + sb.append(", value="); + sb.append(value); + }else{ + sb.append(", value="); } sb.append("]"); return sb.toString();