From 5e3d657006351cfc775a9533f39e4af06a0f5757 Mon Sep 17 00:00:00 2001 From: luboslenco Date: Wed, 25 Mar 2020 20:19:36 +0100 Subject: [PATCH] Cleanup --- Sources/arm/App.hx | 2 +- Sources/arm/Context.hx | 2 +- Sources/arm/Layers.hx | 2 +- Sources/arm/Project.hx | 36 +----------------------------- Sources/arm/ProjectFormat.hx | 39 +++++++++++++++++++++++++++++++++ Sources/arm/io/ExportArm.hx | 2 +- Sources/arm/io/ImportArm.hx | 2 +- Sources/arm/io/ImportTexture.hx | 2 +- Sources/arm/ui/UISidebar.hx | 2 +- 9 files changed, 47 insertions(+), 42 deletions(-) create mode 100644 Sources/arm/ProjectFormat.hx diff --git a/Sources/arm/App.hx b/Sources/arm/App.hx index 4bafacfc..020fc8b5 100644 --- a/Sources/arm/App.hx +++ b/Sources/arm/App.hx @@ -33,7 +33,7 @@ import arm.data.ConstData; import arm.plugin.Camera; import arm.node.MaterialParser; import arm.Enums; -import arm.Project; +import arm.ProjectFormat; import arm.Res; class App { diff --git a/Sources/arm/Context.hx b/Sources/arm/Context.hx index c81ca208..e8010a55 100644 --- a/Sources/arm/Context.hx +++ b/Sources/arm/Context.hx @@ -15,7 +15,7 @@ import arm.ui.UIView2D; import arm.ui.UIHeader; import arm.node.MaterialParser; import arm.Enums; -import arm.Project; +import arm.ProjectFormat; class Context { diff --git a/Sources/arm/Layers.hx b/Sources/arm/Layers.hx index c5fd97b6..22d959e6 100644 --- a/Sources/arm/Layers.hx +++ b/Sources/arm/Layers.hx @@ -16,7 +16,7 @@ import arm.node.MaterialParser; import arm.render.RenderPathPaint; import arm.util.MeshUtil; import arm.Enums; -import arm.Project; +import arm.ProjectFormat; class Layers { diff --git a/Sources/arm/Project.hx b/Sources/arm/Project.hx index efb4d899..fac5e14b 100644 --- a/Sources/arm/Project.hx +++ b/Sources/arm/Project.hx @@ -25,6 +25,7 @@ import arm.io.ImportArm; import arm.io.ImportBlend; import arm.io.ImportMesh; import arm.io.ExportArm; +import arm.ProjectFormat; import arm.Enums; class Project { @@ -299,38 +300,3 @@ class Project { }); } } - -typedef TProjectFormat = { - public var version: String; - @:optional public var brush_nodes: Array; - @:optional public var brush_icons: Array; - @:optional public var material_nodes: Array; - @:optional public var material_icons: Array; - @:optional public var assets: Array; // texture_assets - @:optional public var layer_datas: Array; - @:optional public var mesh_datas: Array; - @:optional public var mesh_assets: Array; -} - -typedef TLayerData = { - public var res: Int; // Width pixels - public var bpp: Int; // Bits per pixel - public var texpaint: haxe.io.Bytes; - public var texpaint_nor: haxe.io.Bytes; - public var texpaint_pack: haxe.io.Bytes; - public var texpaint_mask: haxe.io.Bytes; - public var uv_scale: Float; - public var uv_rot: Float; - public var uv_type: Int; - public var opacity_mask: Float; - public var material_mask: Int; - public var object_mask: Int; - public var blending: Int; - public var parent: Int; -} - -typedef TAsset = { - public var id: Int; - public var name: String; - public var file: String; -} diff --git a/Sources/arm/ProjectFormat.hx b/Sources/arm/ProjectFormat.hx new file mode 100644 index 00000000..405fbfd0 --- /dev/null +++ b/Sources/arm/ProjectFormat.hx @@ -0,0 +1,39 @@ +package arm; + +import zui.Nodes; +import iron.data.SceneFormat; + +typedef TProjectFormat = { + @:optional public var version: String; + @:optional public var brush_nodes: Array; + @:optional public var brush_icons: Array; + @:optional public var material_nodes: Array; + @:optional public var material_icons: Array; + @:optional public var assets: Array; // texture_assets + @:optional public var layer_datas: Array; + @:optional public var mesh_datas: Array; + @:optional public var mesh_assets: Array; +} + +typedef TLayerData = { + public var res: Int; // Width pixels + public var bpp: Int; // Bits per pixel + public var texpaint: haxe.io.Bytes; + public var texpaint_nor: haxe.io.Bytes; + public var texpaint_pack: haxe.io.Bytes; + public var texpaint_mask: haxe.io.Bytes; + public var uv_scale: Float; + public var uv_rot: Float; + public var uv_type: Int; + public var opacity_mask: Float; + public var material_mask: Int; + public var object_mask: Int; + public var blending: Int; + public var parent: Int; +} + +typedef TAsset = { + public var id: Int; + public var name: String; + public var file: String; +} diff --git a/Sources/arm/io/ExportArm.hx b/Sources/arm/io/ExportArm.hx index 53c9bea8..1b17ea30 100644 --- a/Sources/arm/io/ExportArm.hx +++ b/Sources/arm/io/ExportArm.hx @@ -7,7 +7,7 @@ import iron.system.ArmPack; import arm.ui.UISidebar; import arm.format.Lz4; import arm.sys.Path; -import arm.Project; +import arm.ProjectFormat; import arm.Enums; class ExportArm { diff --git a/Sources/arm/io/ImportArm.hx b/Sources/arm/io/ImportArm.hx index d2e0fa19..24484ebd 100644 --- a/Sources/arm/io/ImportArm.hx +++ b/Sources/arm/io/ImportArm.hx @@ -16,7 +16,7 @@ import iron.object.Object; import iron.object.MeshObject; import iron.Scene; import iron.RenderPath; -import arm.Project; +import arm.ProjectFormat; import arm.ui.UISidebar; import arm.ui.UIFiles; import arm.sys.Path; diff --git a/Sources/arm/io/ImportTexture.hx b/Sources/arm/io/ImportTexture.hx index 2ffe9e33..0462fcbc 100644 --- a/Sources/arm/io/ImportTexture.hx +++ b/Sources/arm/io/ImportTexture.hx @@ -4,7 +4,7 @@ import kha.Image; import iron.data.Data; import arm.ui.UISidebar; import arm.sys.Path; -import arm.Project; +import arm.ProjectFormat; class ImportTexture { diff --git a/Sources/arm/ui/UISidebar.hx b/Sources/arm/ui/UISidebar.hx index f0fc18bb..d7119a04 100644 --- a/Sources/arm/ui/UISidebar.hx +++ b/Sources/arm/ui/UISidebar.hx @@ -25,7 +25,7 @@ import arm.data.MaterialSlot; import arm.io.ImportFont; import arm.io.ExportTexture; import arm.Enums; -import arm.Project; +import arm.ProjectFormat; import arm.Res; @:access(zui.Zui)