Przeglądaj źródła

fixed FloatBuffer usage with preallocated size

Nicolas Cannasse 5 lat temu
rodzic
commit
8417323240
1 zmienionych plików z 1 dodań i 1 usunięć
  1. 1 1
      hxd/FloatBuffer.hx

+ 1 - 1
hxd/FloatBuffer.hx

@@ -9,7 +9,7 @@ private abstract Float32Expand({ pos : Int, array : hxd.impl.TypedArray.Float32A
 	public var length(get, set) : Int;
 
 	public function new(length) {
-		this = { pos : 0, array : new Float32Array(new ArrayBuffer(length<<2)) };
+		this = { pos : length, array : new Float32Array(new ArrayBuffer(length<<2)) };
 	}
 
 	inline function get_length() return this.pos;