From 54c4b354929790a4eb8714de9940dbeee0c84e24 Mon Sep 17 00:00:00 2001 From: luboslenco Date: Thu, 20 Jun 2019 12:11:01 +0200 Subject: [PATCH] Update packages --- Sources/arm/io/Exporter.hx | 16 ++++++++++------ Sources/arm/io/ImportBlend.hx | 5 +++-- Sources/arm/io/ImportFbx.hx | 2 +- Sources/arm/io/ImportGltf.hx | 2 +- Sources/arm/io/ImportObj.hx | 2 +- Sources/arm/ui/UITrait.hx | 4 ++-- 6 files changed, 18 insertions(+), 13 deletions(-) diff --git a/Sources/arm/io/Exporter.hx b/Sources/arm/io/Exporter.hx index 1f6667eb..580a2e5a 100644 --- a/Sources/arm/io/Exporter.hx +++ b/Sources/arm/io/Exporter.hx @@ -4,6 +4,10 @@ import haxe.io.Bytes; import haxe.io.BytesOutput; import kha.Image; import iron.data.SceneFormat; +import iron.format.ExrWriter; +import iron.format.JpgWriter; +import iron.format.PngWriter; +import iron.format.PngTools; import arm.ui.UITrait; import arm.ui.UIBox; import arm.App; @@ -18,20 +22,20 @@ class Exporter { var bitsHandle = UITrait.inst.bitsHandle.position; var bits = bitsHandle == 0 ? 8 : bitsHandle == 1 ? 16 : 32; if (bits > 8) { // 16/32bit - var writer = new iron.format.exr.Writer(out, res, res, pixels, bits, type, off); + var writer = new ExrWriter(out, res, res, pixels, bits, type, off); } else if (UITrait.inst.formatType == 0) { - var writer = new iron.format.png.Writer(out); + var writer = new PngWriter(out); var data = type == 1 ? - iron.format.png.Tools.build32RGB1(res, res, pixels) : + PngTools.build32RGB1(res, res, pixels) : type == 2 ? - iron.format.png.Tools.build32RRR1(res, res, pixels, off) : - iron.format.png.Tools.build32RGBA(res, res, pixels); + PngTools.build32RRR1(res, res, pixels, off) : + PngTools.build32RGBA(res, res, pixels); writer.write(data); } else { - var writer = new iron.format.jpg.Writer(out); + var writer = new JpgWriter(out); writer.write({ width: res, height: res, diff --git a/Sources/arm/io/ImportBlend.hx b/Sources/arm/io/ImportBlend.hx index 8111d0aa..a2b10788 100644 --- a/Sources/arm/io/ImportBlend.hx +++ b/Sources/arm/io/ImportBlend.hx @@ -6,6 +6,7 @@ import kha.arrays.Float32Array; import kha.arrays.Int16Array; import iron.data.Data; import iron.math.Vec4; +import iron.format.BlendParser; import zui.Nodes; import arm.App; import arm.ui.UITrait; @@ -20,7 +21,7 @@ class ImportBlend { public static function run(path:String) { Data.getBlob(path, function(b:Blob) { - var bl = new iron.format.blend.Blend(b); + var bl = new BlendParser(b); if (bl.dna == null) { UITrait.inst.showError("Error: Compressed blend"); return; @@ -176,7 +177,7 @@ class ImportBlend { public static function runMaterial(path:String) { Data.getBlob(path, function(b:Blob) { - var bl = new iron.format.blend.Blend(b); + var bl = new BlendParser(b); if (bl.dna == null) { UITrait.inst.showError("Error: Compressed blend"); return; diff --git a/Sources/arm/io/ImportFbx.hx b/Sources/arm/io/ImportFbx.hx index 97186273..14fc08d2 100644 --- a/Sources/arm/io/ImportFbx.hx +++ b/Sources/arm/io/ImportFbx.hx @@ -2,7 +2,7 @@ package arm.io; import kha.Blob; import iron.data.Data; -import iron.format.fbx.FbxParser; +import iron.format.FbxParser; import arm.ui.UITrait; class ImportFbx { diff --git a/Sources/arm/io/ImportGltf.hx b/Sources/arm/io/ImportGltf.hx index 28d13c71..745790e3 100644 --- a/Sources/arm/io/ImportGltf.hx +++ b/Sources/arm/io/ImportGltf.hx @@ -2,7 +2,7 @@ package arm.io; import kha.Blob; import iron.data.Data; -import iron.format.gltf.GltfParser; +import iron.format.GltfParser; class ImportGltf { diff --git a/Sources/arm/io/ImportObj.hx b/Sources/arm/io/ImportObj.hx index 26b4eb89..4eb01e3b 100644 --- a/Sources/arm/io/ImportObj.hx +++ b/Sources/arm/io/ImportObj.hx @@ -2,7 +2,7 @@ package arm.io; import kha.Blob; import iron.data.Data; -import iron.format.obj.ObjParser; +import iron.format.ObjParser; import arm.ui.UITrait; class ImportObj { diff --git a/Sources/arm/ui/UITrait.hx b/Sources/arm/ui/UITrait.hx index 55cba68c..91be8e05 100644 --- a/Sources/arm/ui/UITrait.hx +++ b/Sources/arm/ui/UITrait.hx @@ -2569,7 +2569,7 @@ class UITrait { } static function roundfp(f:Float, precision = 2):Float { - f *= std.Math.pow(10, precision); - return std.Math.round(f) / std.Math.pow(10, precision); + f *= Math.pow(10, precision); + return Math.round(f) / Math.pow(10, precision); } }