From 17fd3d466eae2220e5ae874666fcd154d682cc11 Mon Sep 17 00:00:00 2001 From: shadowislord Date: Fri, 6 Jun 2014 20:09:20 -0400 Subject: [PATCH] * Fix Remy's grammar and spelling --- .../main/java/com/jme3/material/Material.java | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/jme3-core/src/main/java/com/jme3/material/Material.java b/jme3-core/src/main/java/com/jme3/material/Material.java index 7bef12e62..956fc7744 100644 --- a/jme3-core/src/main/java/com/jme3/material/Material.java +++ b/jme3-core/src/main/java/com/jme3/material/Material.java @@ -539,12 +539,23 @@ public class Material implements CloneableSmartAsset, Cloneable, Savable { checkSetParam(type, name); MatParamTexture val = getTextureParam(name); if (val == null) { - MatParamTexture paramDef = (MatParamTexture)def.getMaterialParam(name); - if(paramDef.getColorSpace() != null && paramDef.getColorSpace() != value.getImage().getColorSpace()){ + MatParamTexture paramDef = (MatParamTexture) def.getMaterialParam(name); + if (paramDef.getColorSpace() != null && paramDef.getColorSpace() != value.getImage().getColorSpace()) { value.getImage().setColorSpace(paramDef.getColorSpace()); - logger.log(Level.FINE, "Material parameter {0} needs a {1} texture, texture {2} was switched to {3} color space.", new Object[]{name, paramDef.getColorSpace().toString(), value.getName(), value.getImage().getColorSpace().name()}); - }else if(paramDef.getColorSpace() == null && value.getName() != null && value.getImage().getColorSpace() == ColorSpace.Linear){ - logger.log(Level.WARNING, "texture {0} has a {1} color space, but material parameter {2} has no color space requirement, this may lead to unexpected behavior.\n Cheack wether the image was not set to another material parameter with a linear color space, or that you did not set the ColorSpace to Linear using texture.getImage.setColorSpace().", new Object[]{value.getName(), value.getImage().getColorSpace().name(),name}); + logger.log(Level.FINE, "Material parameter {0} needs a {1} texture, " + + "texture {2} was switched to {3} color space.", + new Object[]{name, paramDef.getColorSpace().toString(), + value.getName(), + value.getImage().getColorSpace().name()}); + } else if (paramDef.getColorSpace() == null && value.getName() != null && value.getImage().getColorSpace() == ColorSpace.Linear) { + logger.log(Level.WARNING, + "The texture {0} has linear color space, but the material " + + "parameter {2} specifies no color space requirement, this may " + + "lead to unexpected behavior.\nCheck if the image " + + "was not set to another material parameter with a linear " + + "color space, or that you did not set the ColorSpace to " + + "Linear using texture.getImage.setColorSpace().", + new Object[]{value.getName(), value.getImage().getColorSpace().name(), name}); } paramValues.put(name, new MatParamTexture(type, name, value, nextTexUnit++)); } else {