ncannasse 12 роки тому
батько
коміт
ad2424d5e4
1 змінених файлів з 10 додано та 0 видалено
  1. 10 0
      hxd/FloatBuffer.hx

+ 10 - 0
hxd/FloatBuffer.hx

@@ -46,6 +46,16 @@ abstract FloatBuffer(InnerData) {
 		while( this.length < v ) this.push(0.);
 		while( this.length < v ) this.push(0.);
 		#end
 		#end
 	}
 	}
+
+	public inline function resize( v : Int ) {
+		#if flash
+		this.length = v;
+		#else
+		while( this.length < v ) this.push(0.);
+		if( this.length > v ) this.splice(v, this.length - v);
+		#end
+	}
+	
 	
 	
 	@:arrayAccess inline function arrayRead(key:Int) : Float {
 	@:arrayAccess inline function arrayRead(key:Int) : Float {
 		return this[key];
 		return this[key];