From 86a87c4b3d4d0210fde9e76c39d109428293d9d9 Mon Sep 17 00:00:00 2001 From: "David \"Blackmagic\" Elahee" Date: Mon, 30 Jun 2014 15:11:54 +0200 Subject: [PATCH] Added a resize func Since resize is possible, I took advantage of it. If there is a& better way to do it let me know :) --- lime/utils/Float32Array.hx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lime/utils/Float32Array.hx b/lime/utils/Float32Array.hx index a19856e95..e5884d330 100644 --- a/lime/utils/Float32Array.hx +++ b/lime/utils/Float32Array.hx @@ -84,6 +84,13 @@ package lime.utils; return new Float32Array (matrix.rawData); } + public function __setLength( nbFloat : Int) { + length = nbFloat; + byteLength = nbFloat << 2; + + buffer.setLength(byteLength); + } + @:noCompletion @:keep inline public function __get (index:Int):Float { return getFloat32 (index << 2); } @:noCompletion @:keep inline public function __set (index:Int, value:Float):Void { setFloat32 (index << 2, value); }