diff options
Diffstat (limited to 'src/jake2/render/fast')
-rw-r--r-- | src/jake2/render/fast/Mesh.java | 3 | ||||
-rw-r--r-- | src/jake2/render/fast/Model.java | 8 |
2 files changed, 6 insertions, 5 deletions
diff --git a/src/jake2/render/fast/Mesh.java b/src/jake2/render/fast/Mesh.java index a2e9268..547be66 100644 --- a/src/jake2/render/fast/Mesh.java +++ b/src/jake2/render/fast/Mesh.java @@ -36,6 +36,7 @@ import jake2.util.Math3D; import java.nio.FloatBuffer; import java.nio.IntBuffer; +import java.nio.ShortBuffer; /** * Mesh @@ -228,7 +229,7 @@ public abstract class Mesh extends Light { int pos = 0; int[] counts = paliashdr.counts; - IntBuffer srcIndexBuf = null; + ShortBuffer srcIndexBuf = null; FloatBuffer dstTextureCoords = textureArrayBuf; FloatBuffer srcTextureCoords = paliashdr.textureCoordBuf; diff --git a/src/jake2/render/fast/Model.java b/src/jake2/render/fast/Model.java index 93180d5..15e8107 100644 --- a/src/jake2/render/fast/Model.java +++ b/src/jake2/render/fast/Model.java @@ -1287,12 +1287,12 @@ public abstract class Model extends Surf { */ static final int MODEL_BUFFER_SIZE = 50000; static FloatBuffer globalModelTextureCoordBuf = Lib.newFloatBuffer(MODEL_BUFFER_SIZE * 2); - static IntBuffer globalModelVertexIndexBuf = Lib.newIntBuffer(MODEL_BUFFER_SIZE); + static ShortBuffer globalModelVertexIndexBuf = Lib.newShortBuffer(MODEL_BUFFER_SIZE); void precompileGLCmds(qfiles.dmdl_t model) { model.textureCoordBuf = globalModelTextureCoordBuf.slice(); model.vertexIndexBuf = globalModelVertexIndexBuf.slice(); - Vector tmp = new Vector(); + final Vector<Integer> tmp = new Vector<Integer>(); int count = 0; int[] order = model.glCmds; @@ -1320,7 +1320,7 @@ public abstract class Model extends Surf { // texture coordinates come from the draw list globalModelTextureCoordBuf.put(Float.intBitsToFloat(order[orderIndex + 0])); globalModelTextureCoordBuf.put(Float.intBitsToFloat(order[orderIndex + 1])); - globalModelVertexIndexBuf.put(order[orderIndex + 2]); + globalModelVertexIndexBuf.put( (short) ( 0x0000FFFF & order[orderIndex + 2] ) ); orderIndex += 3; } while (--count != 0); @@ -1329,7 +1329,7 @@ public abstract class Model extends Surf { int size = tmp.size(); model.counts = new int[size]; - model.indexElements = new IntBuffer[size]; + model.indexElements = new ShortBuffer[size]; count = 0; int pos = 0; |