* 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
This commit is contained in:
parent
8cca61b3ef
commit
3e6d649c48
@ -480,10 +480,10 @@ public class MeshHelper extends AbstractBlenderHelper {
|
|||||||
verticesColors = new LinkedList<float[]>();
|
verticesColors = new LinkedList<float[]>();
|
||||||
mCol = pMCol.fetchData(blenderContext.getInputStream());
|
mCol = pMCol.fetchData(blenderContext.getInputStream());
|
||||||
for (Structure color : mCol) {
|
for (Structure color : mCol) {
|
||||||
float r = ((Number) color.getFieldValue("r")).byteValue() / 256.0f;
|
float r = (((Number)color.getFieldValue("r")).byteValue() & 0xFF) / 256.0f;
|
||||||
float g = ((Number) color.getFieldValue("g")).byteValue() / 256.0f;
|
float g = (((Number)color.getFieldValue("g")).byteValue() & 0xFF) / 256.0f;
|
||||||
float b = ((Number) color.getFieldValue("b")).byteValue() / 256.0f;
|
float b = (((Number)color.getFieldValue("b")).byteValue() & 0xFF) / 256.0f;
|
||||||
float a = ((Number) color.getFieldValue("a")).byteValue() / 256.0f;
|
float a = (((Number)color.getFieldValue("a")).byteValue() & 0xFF) / 256.0f;
|
||||||
verticesColors.add(new float[]{b, g, r, a});
|
verticesColors.add(new float[]{b, g, r, a});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user