private static void populateShortBuffer(ShortBuffer buffer, LittleEndien stream, int count, int byteOffset, int byteStride, int numComponents, VertexBuffer.Format format) throws IOException { int componentSize = format.getComponentSize(); int index = byteOffset; int dataLength = componentSize * numComponents; int stride = Math.max(dataLength, byteStride); int end = count * stride + byteOffset; stream.skipBytes(byteOffset); while (index < end) { for (int i = 0; i < numComponents; i++) { buffer.put(stream.readShort()); } if (dataLength < stride) { stream.skipBytes(stride - dataLength); } index += stride; } System.err.println(""); }
private static void populateShortArray(short[] array, LittleEndien stream, int count, int byteOffset, int byteStride, int numComponents, VertexBuffer.Format format) throws IOException { int componentSize = format.getComponentSize(); int index = byteOffset; int dataLength = componentSize * numComponents; int stride = Math.max(dataLength, byteStride); int end = count * stride + byteOffset; stream.skipBytes(byteOffset); int arrayIndex = 0; while (index < end) { for (int i = 0; i < numComponents; i++) { if (componentSize == 2) { array[arrayIndex] = stream.readShort(); } else { array[arrayIndex] = stream.readByte(); } arrayIndex++; } if (dataLength < stride) { stream.skipBytes(stride - dataLength); } index += stride; } }
private static void populateShortBuffer(ShortBuffer buffer, LittleEndien stream, int count, int byteOffset, int byteStride, int numComponents, VertexBuffer.Format format) throws IOException { int componentSize = format.getComponentSize(); int index = byteOffset; int dataLength = componentSize * numComponents; int stride = Math.max(dataLength, byteStride); int end = count * stride + byteOffset; stream.skipBytes(byteOffset); while (index < end) { for (int i = 0; i < numComponents; i++) { buffer.put(stream.readShort()); } if (dataLength < stride) { stream.skipBytes(stride - dataLength); } index += stride; } System.err.println(""); }
private static void populateShortArray(short[] array, LittleEndien stream, int count, int byteOffset, int byteStride, int numComponents, VertexBuffer.Format format) throws IOException { int componentSize = format.getComponentSize(); int index = byteOffset; int dataLength = componentSize * numComponents; int stride = Math.max(dataLength, byteStride); int end = count * stride + byteOffset; stream.skipBytes(byteOffset); int arrayIndex = 0; while (index < end) { for (int i = 0; i < numComponents; i++) { if (componentSize == 2) { array[arrayIndex] = stream.readShort(); } else { array[arrayIndex] = stream.readByte(); } arrayIndex++; } if (dataLength < stride) { stream.skipBytes(stride - dataLength); } index += stride; } }