소스 검색

fixed FloatBuffer usage with preallocated size

Nicolas Cannasse 5 년 전
부모
커밋
8417323240
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  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 var length(get, set) : Int;
 
 
 	public function new(length) {
 	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;
 	inline function get_length() return this.pos;