From 3e6d649c48b13969d93f66f36ba2b4445454352e Mon Sep 17 00:00:00 2001 From: "Sha..rd" Date: Mon, 9 Jan 2012 05:10:06 +0000 Subject: [PATCH] * Fixed incorrect byte->float conversion when loading color buffer in Blender loader git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9014 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../com/jme3/scene/plugins/blender/meshes/MeshHelper.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/engine/src/blender/com/jme3/scene/plugins/blender/meshes/MeshHelper.java b/engine/src/blender/com/jme3/scene/plugins/blender/meshes/MeshHelper.java index c92693340..ea3bec534 100644 --- a/engine/src/blender/com/jme3/scene/plugins/blender/meshes/MeshHelper.java +++ b/engine/src/blender/com/jme3/scene/plugins/blender/meshes/MeshHelper.java @@ -480,10 +480,10 @@ public class MeshHelper extends AbstractBlenderHelper { verticesColors = new LinkedList(); mCol = pMCol.fetchData(blenderContext.getInputStream()); for (Structure color : mCol) { - float r = ((Number) color.getFieldValue("r")).byteValue() / 256.0f; - float g = ((Number) color.getFieldValue("g")).byteValue() / 256.0f; - float b = ((Number) color.getFieldValue("b")).byteValue() / 256.0f; - float a = ((Number) color.getFieldValue("a")).byteValue() / 256.0f; + float r = (((Number)color.getFieldValue("r")).byteValue() & 0xFF) / 256.0f; + float g = (((Number)color.getFieldValue("g")).byteValue() & 0xFF) / 256.0f; + float b = (((Number)color.getFieldValue("b")).byteValue() & 0xFF) / 256.0f; + float a = (((Number)color.getFieldValue("a")).byteValue() & 0xFF) / 256.0f; verticesColors.add(new float[]{b, g, r, a}); } }