From dcf3f3c0615370d9f1e12184cc9068d1e9424882 Mon Sep 17 00:00:00 2001 From: "sha..rd" Date: Fri, 29 Apr 2011 23:52:11 +0000 Subject: [PATCH] * Fixed bug in RenderImageJme Texture constructor that would not take into account width/height * MatParam toString() method will now display value git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7368 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- engine/src/core/com/jme3/material/MatParam.java | 2 +- engine/src/niftygui/com/jme3/niftygui/RenderImageJme.java | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/engine/src/core/com/jme3/material/MatParam.java b/engine/src/core/com/jme3/material/MatParam.java index 8dd89a19b..7129c5486 100644 --- a/engine/src/core/com/jme3/material/MatParam.java +++ b/engine/src/core/com/jme3/material/MatParam.java @@ -223,7 +223,7 @@ public class MatParam implements Savable, Cloneable { @Override public String toString(){ - return type.name()+" "+name; + return type.name() + " " + name + " : " + getValueAsString(); } public void apply(Renderer r, Technique technique) { diff --git a/engine/src/niftygui/com/jme3/niftygui/RenderImageJme.java b/engine/src/niftygui/com/jme3/niftygui/RenderImageJme.java index 5a9eb47d8..8faf32430 100644 --- a/engine/src/niftygui/com/jme3/niftygui/RenderImageJme.java +++ b/engine/src/niftygui/com/jme3/niftygui/RenderImageJme.java @@ -63,10 +63,13 @@ public class RenderImageJme implements RenderImage { } public RenderImageJme(Texture2D texture){ + if (texture.getImage() == null) + throw new IllegalArgumentException("texture.getImage() cannot be null"); + this.texture = texture; this.image = texture.getImage(); - if (this.image == null) - throw new NullPointerException("texture.getImage() cannot be null"); + width = image.getWidth(); + height = image.getHeight(); } public Texture2D getTexture(){