From 6983aff1f3dc4ad4221f953e2730d566090dfe4e Mon Sep 17 00:00:00 2001 From: michael Date: Sat, 28 Feb 2015 10:55:40 +0100 Subject: [PATCH] *Reapplied -LINEAR fix from https://github.com/jMonkeyEngine/jmonkeyengine/commit/02322d04ccab5c1279e8634b76f520f4bb835aca --- .../java/com/jme3/material/plugins/J3MLoader.java | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/jme3-core/src/plugins/java/com/jme3/material/plugins/J3MLoader.java b/jme3-core/src/plugins/java/com/jme3/material/plugins/J3MLoader.java index 609245e8d..746a30aa8 100644 --- a/jme3-core/src/plugins/java/com/jme3/material/plugins/J3MLoader.java +++ b/jme3-core/src/plugins/java/com/jme3/material/plugins/J3MLoader.java @@ -230,15 +230,7 @@ public class J3MLoader implements AssetLoader { String defaultVal = null; ColorSpace colorSpace = null; - String[] split = statement.split("-"); - if (split.length > 1) { - if (split[1].equalsIgnoreCase("LINEAR")) { - colorSpace = ColorSpace.Linear; - } - statement = split[0].trim(); - } - - split = statement.split(":"); + String[] split = statement.split(":"); // Parse default val if (split.length == 1) { @@ -250,6 +242,10 @@ public class J3MLoader implements AssetLoader { statement = split[0].trim(); defaultVal = split[1].trim(); } + if (statement.endsWith("-LINEAR")) { + colorSpace = ColorSpace.Linear; + statement = statement.substring(0, statement.length() - "-LINEAR".length()); + } // Parse ffbinding int startParen = statement.indexOf("(");