From 1b11b5185989319794e3c9ac2aedc59bdcc43bcd Mon Sep 17 00:00:00 2001 From: Lubos Lenco Date: Wed, 18 Aug 2021 15:46:58 +0200 Subject: [PATCH] Add mesh icons to project format --- Sources/arm/ProjectFormat.hx | 1 + Sources/arm/ui/UIFiles.hx | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/Sources/arm/ProjectFormat.hx b/Sources/arm/ProjectFormat.hx index ff02826c..8a33fdc1 100644 --- a/Sources/arm/ProjectFormat.hx +++ b/Sources/arm/ProjectFormat.hx @@ -15,6 +15,7 @@ typedef TProjectFormat = { @:optional public var layer_datas: Array; @:optional public var mesh_datas: Array; @:optional public var mesh_assets: Array; + @:optional public var mesh_icons: Array; @:optional public var atlas_objects: Array; @:optional public var atlas_names: Array; @:optional public var swatches: Array; diff --git a/Sources/arm/ui/UIFiles.hx b/Sources/arm/ui/UIFiles.hx index b8856802..b863fa1a 100644 --- a/Sources/arm/ui/UIFiles.hx +++ b/Sources/arm/ui/UIFiles.hx @@ -230,6 +230,10 @@ class UIFiles { var bytesIcon = raw.material_icons[0]; icon = kha.Image.fromBytes(Lz4.decode(bytesIcon, 256 * 256 * 4), 256, 256); } + if (raw.mesh_icons != null) { + var bytesIcon = raw.mesh_icons[0]; + icon = kha.Image.fromBytes(Lz4.decode(bytesIcon, 256 * 256 * 4), 256, 256); + } iconMap.set(key, icon); } if (icon != null) {