Add mesh icons to project format

This commit is contained in:
Lubos Lenco
2021-08-18 15:46:58 +02:00
parent 67af5393c4
commit 1b11b51859
2 changed files with 5 additions and 0 deletions
+1
View File
@@ -15,6 +15,7 @@ typedef TProjectFormat = {
@:optional public var layer_datas: Array<TLayerData>;
@:optional public var mesh_datas: Array<TMeshData>;
@:optional public var mesh_assets: Array<String>;
@:optional public var mesh_icons: Array<haxe.io.Bytes>;
@:optional public var atlas_objects: Array<Int>;
@:optional public var atlas_names: Array<String>;
@:optional public var swatches: Array<TSwatchColor>;
+4
View File
@@ -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) {