Fix a few issues with BufferBuilder

Fix vanilla bug that caused the byte order of the buffer from getNextBuffer to be incorrect
Fix missing modification to nextElementBytes in putBulkData
This commit is contained in:
tterrag 2020-03-31 19:55:09 -04:00
parent db3d202c4e
commit 19444ffa18

View file

@ -8,7 +8,15 @@
} }
private void func_227829_a_(FloatBuffer p_227829_1_, int p_227829_2_) { private void func_227829_a_(FloatBuffer p_227829_1_, int p_227829_2_) {
@@ -364,4 +363,14 @@ @@ -297,6 +296,7 @@
}
ByteBuffer bytebuffer = this.field_179001_a.slice();
+ bytebuffer.order(this.field_179001_a.order()); // FORGE: Fix incorrect byte order
this.field_179001_a.clear();
return Pair.of(bufferbuilder$drawstate, bytebuffer);
}
@@ -364,4 +364,15 @@
this.field_179018_e = p_i225907_2_; this.field_179018_e = p_i225907_2_;
} }
} }
@ -18,6 +26,7 @@
+ this.field_179001_a.position(this.field_178997_d * this.field_179011_q.func_177338_f()); + this.field_179001_a.position(this.field_178997_d * this.field_179011_q.func_177338_f());
+ this.field_179001_a.put(buffer); + this.field_179001_a.put(buffer);
+ this.field_178997_d += buffer.limit() / this.field_179011_q.func_177338_f(); + this.field_178997_d += buffer.limit() / this.field_179011_q.func_177338_f();
+ this.field_227824_l_ += buffer.limit();
+ } + }
+ +
+ // Forge start + // Forge start