Skip to content

Commit

Permalink
Fix floatbuffer stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
cam72cam committed Sep 9, 2017
1 parent d03c872 commit 38ba587
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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]));
Expand All @@ -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]));
Expand All @@ -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]));
Expand Down

0 comments on commit 38ba587

Please sign in to comment.