summaryrefslogtreecommitdiffstats
path: root/src/net/java/joglutils/msg/collections/Vec4fCollection.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/java/joglutils/msg/collections/Vec4fCollection.java')
-rw-r--r--src/net/java/joglutils/msg/collections/Vec4fCollection.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/net/java/joglutils/msg/collections/Vec4fCollection.java b/src/net/java/joglutils/msg/collections/Vec4fCollection.java
index a1d1e86..2f940cd 100644
--- a/src/net/java/joglutils/msg/collections/Vec4fCollection.java
+++ b/src/net/java/joglutils/msg/collections/Vec4fCollection.java
@@ -39,8 +39,6 @@ package net.java.joglutils.msg.collections;
import java.nio.*;
-import com.sun.opengl.util.*;
-
import net.java.joglutils.msg.impl.*;
import net.java.joglutils.msg.math.*;
@@ -105,9 +103,10 @@ public class Vec4fCollection {
public void add(Vec4f value) {
FloatBuffer buf = data;
if (buf.limit() == buf.capacity()) {
- FloatBuffer newBuf = BufferUtil.newFloatBuffer(Math.max(buf.capacity() + ELEMENT_SIZE,
- round((int) (buf.capacity() * 1.5f))));
+ FloatBuffer newBuf = BufferFactory.newFloatBuffer(Math.max(buf.capacity() + ELEMENT_SIZE,
+ round((int) (buf.capacity() * 1.5f))));
newBuf.put(buf);
+ newBuf.rewind();
newBuf.limit(buf.limit());
data = newBuf;
buf = newBuf;
@@ -133,11 +132,12 @@ public class Vec4fCollection {
// Simply lower the limit
buf.limit(buf.limit() - ELEMENT_SIZE);
} else {
- buf.position(pos + 1);
+ buf.position(pos + ELEMENT_SIZE);
FloatBuffer rest = buf.slice();
buf.position(pos);
buf.put(rest);
buf.limit(buf.limit() - ELEMENT_SIZE);
+ buf.rewind();
}
return res;
}