Explorar el Código

added resize()

ncannasse hace 12 años
padre
commit
ad2424d5e4
Se han modificado 1 ficheros con 10 adiciones y 0 borrados
  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.);
 		#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 {
 		return this[key];