From 38ba58707893f1f394556cca31666d80b2344632 Mon Sep 17 00:00:00 2001 From: Christian Mesh Date: Sat, 9 Sep 2017 18:56:07 -0400 Subject: [PATCH] Fix floatbuffer stuff --- .../immersiverailroading/render/obj/OBJModel.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/cam72cam/immersiverailroading/render/obj/OBJModel.java b/src/main/java/cam72cam/immersiverailroading/render/obj/OBJModel.java index f2d66bc32..43e12cd76 100644 --- a/src/main/java/cam72cam/immersiverailroading/render/obj/OBJModel.java +++ b/src/main/java/cam72cam/immersiverailroading/render/obj/OBJModel.java @@ -1,7 +1,7 @@ package cam72cam.immersiverailroading.render.obj; import java.io.InputStream; -import java.nio.FloatBuffer; +import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; @@ -117,7 +117,7 @@ public OBJModel(ResourceLocation modelLoc) throws Exception { currentMTL.name = parts[1]; break; case "Ka": - currentMTL.Ka = FloatBuffer.allocate(4); + currentMTL.Ka = ByteBuffer.allocateDirect(4*4).asFloatBuffer(); currentMTL.Ka.put(Float.parseFloat(parts[1])); currentMTL.Ka.put(Float.parseFloat(parts[2])); currentMTL.Ka.put(Float.parseFloat(parts[3])); @@ -129,7 +129,7 @@ public OBJModel(ResourceLocation modelLoc) throws Exception { currentMTL.Ka.position(0); break; case "Kd": - currentMTL.Kd = FloatBuffer.allocate(4); + currentMTL.Kd = ByteBuffer.allocateDirect(4*4).asFloatBuffer(); currentMTL.Kd.put(Float.parseFloat(parts[1])); currentMTL.Kd.put(Float.parseFloat(parts[2])); currentMTL.Kd.put(Float.parseFloat(parts[3])); @@ -141,7 +141,7 @@ public OBJModel(ResourceLocation modelLoc) throws Exception { currentMTL.Kd.position(0); break; case "Ks": - currentMTL.Ks = FloatBuffer.allocate(4); + currentMTL.Ks = ByteBuffer.allocateDirect(4*4).asFloatBuffer(); currentMTL.Ks.put(Float.parseFloat(parts[1])); currentMTL.Ks.put(Float.parseFloat(parts[2])); currentMTL.Ks.put(Float.parseFloat(parts[3]));