Update packages

This commit is contained in:
luboslenco
2019-06-20 12:11:01 +02:00
parent f6003ab556
commit 54c4b35492
6 changed files with 18 additions and 13 deletions
+10 -6
View File
@@ -4,6 +4,10 @@ import haxe.io.Bytes;
import haxe.io.BytesOutput; import haxe.io.BytesOutput;
import kha.Image; import kha.Image;
import iron.data.SceneFormat; 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.UITrait;
import arm.ui.UIBox; import arm.ui.UIBox;
import arm.App; import arm.App;
@@ -18,20 +22,20 @@ class Exporter {
var bitsHandle = UITrait.inst.bitsHandle.position; var bitsHandle = UITrait.inst.bitsHandle.position;
var bits = bitsHandle == 0 ? 8 : bitsHandle == 1 ? 16 : 32; var bits = bitsHandle == 0 ? 8 : bitsHandle == 1 ? 16 : 32;
if (bits > 8) { // 16/32bit 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) { else if (UITrait.inst.formatType == 0) {
var writer = new iron.format.png.Writer(out); var writer = new PngWriter(out);
var data = var data =
type == 1 ? type == 1 ?
iron.format.png.Tools.build32RGB1(res, res, pixels) : PngTools.build32RGB1(res, res, pixels) :
type == 2 ? type == 2 ?
iron.format.png.Tools.build32RRR1(res, res, pixels, off) : PngTools.build32RRR1(res, res, pixels, off) :
iron.format.png.Tools.build32RGBA(res, res, pixels); PngTools.build32RGBA(res, res, pixels);
writer.write(data); writer.write(data);
} }
else { else {
var writer = new iron.format.jpg.Writer(out); var writer = new JpgWriter(out);
writer.write({ writer.write({
width: res, width: res,
height: res, height: res,
+3 -2
View File
@@ -6,6 +6,7 @@ import kha.arrays.Float32Array;
import kha.arrays.Int16Array; import kha.arrays.Int16Array;
import iron.data.Data; import iron.data.Data;
import iron.math.Vec4; import iron.math.Vec4;
import iron.format.BlendParser;
import zui.Nodes; import zui.Nodes;
import arm.App; import arm.App;
import arm.ui.UITrait; import arm.ui.UITrait;
@@ -20,7 +21,7 @@ class ImportBlend {
public static function run(path:String) { public static function run(path:String) {
Data.getBlob(path, function(b:Blob) { Data.getBlob(path, function(b:Blob) {
var bl = new iron.format.blend.Blend(b); var bl = new BlendParser(b);
if (bl.dna == null) { if (bl.dna == null) {
UITrait.inst.showError("Error: Compressed blend"); UITrait.inst.showError("Error: Compressed blend");
return; return;
@@ -176,7 +177,7 @@ class ImportBlend {
public static function runMaterial(path:String) { public static function runMaterial(path:String) {
Data.getBlob(path, function(b:Blob) { Data.getBlob(path, function(b:Blob) {
var bl = new iron.format.blend.Blend(b); var bl = new BlendParser(b);
if (bl.dna == null) { if (bl.dna == null) {
UITrait.inst.showError("Error: Compressed blend"); UITrait.inst.showError("Error: Compressed blend");
return; return;
+1 -1
View File
@@ -2,7 +2,7 @@ package arm.io;
import kha.Blob; import kha.Blob;
import iron.data.Data; import iron.data.Data;
import iron.format.fbx.FbxParser; import iron.format.FbxParser;
import arm.ui.UITrait; import arm.ui.UITrait;
class ImportFbx { class ImportFbx {
+1 -1
View File
@@ -2,7 +2,7 @@ package arm.io;
import kha.Blob; import kha.Blob;
import iron.data.Data; import iron.data.Data;
import iron.format.gltf.GltfParser; import iron.format.GltfParser;
class ImportGltf { class ImportGltf {
+1 -1
View File
@@ -2,7 +2,7 @@ package arm.io;
import kha.Blob; import kha.Blob;
import iron.data.Data; import iron.data.Data;
import iron.format.obj.ObjParser; import iron.format.ObjParser;
import arm.ui.UITrait; import arm.ui.UITrait;
class ImportObj { class ImportObj {
+2 -2
View File
@@ -2569,7 +2569,7 @@ class UITrait {
} }
static function roundfp(f:Float, precision = 2):Float { static function roundfp(f:Float, precision = 2):Float {
f *= std.Math.pow(10, precision); f *= Math.pow(10, precision);
return std.Math.round(f) / std.Math.pow(10, precision); return Math.round(f) / Math.pow(10, precision);
} }
} }