Am a Fking idiot ;-;

This commit is contained in:
mcrcortex
2025-05-27 15:00:22 +10:00
parent b899dde5fe
commit 0c5882af8e

View File

@@ -87,7 +87,7 @@ public final class ReuseVertexConsumer implements VertexConsumer {
if ((long) (this.count + 5) * VERTEX_FORMAT_SIZE < this.buffer.size) {
return;
}
long offset = this.buffer.address-this.ptr;
long offset = this.ptr-this.buffer.address;
//1.5x the size
var newBuffer = new MemoryBuffer((((int)(this.buffer.size*2)+VERTEX_FORMAT_SIZE-1)/VERTEX_FORMAT_SIZE)*VERTEX_FORMAT_SIZE);
this.buffer.cpyTo(newBuffer.address);
@@ -104,6 +104,8 @@ public final class ReuseVertexConsumer implements VertexConsumer {
}
public void free() {
this.ptr = 0;
this.count = 0;
this.buffer.free();
this.buffer = null;
}