From 7d947311a458efcecd0378ab474e384e10cf5066 Mon Sep 17 00:00:00 2001 From: LunaTheFoxgirl Date: Wed, 2 Oct 2024 06:32:09 +0200 Subject: [PATCH] Add support for 0.8.7 features --- dub.sdl | 2 +- source/creator/atlas/atlas.d | 2 +- source/creator/core/egg.d | 2 +- source/creator/ext/param.d | 4 ++-- source/creator/panels/nodes.d | 7 ------- source/creator/panels/scene.d | 14 ++++++++++++++ .../viewport/common/mesheditor/tools/lasso.d | 14 +++++++++----- source/creator/windows/flipconfig.d | 8 ++++---- 8 files changed, 32 insertions(+), 21 deletions(-) diff --git a/dub.sdl b/dub.sdl index 95dfe3bb4..2ccf86ed7 100644 --- a/dub.sdl +++ b/dub.sdl @@ -12,7 +12,7 @@ dependency "bindbc-sdl" version="~>1.1.2" dependency "dcv:core" version="~>0.3.0" dependency "i18n-d" version="~>1.0.2" dependency "i2d-imgui" version="~>0.8.0" -dependency "inochi2d" version="~>0.8.6" +dependency "inochi2d" version="~>0.8.7" dependency "mir-linux-kernel" version="~>1.0.1" targetPath "out/" workingDirectory "out/" diff --git a/source/creator/atlas/atlas.d b/source/creator/atlas/atlas.d index e349a3560..378390cd0 100644 --- a/source/creator/atlas/atlas.d +++ b/source/creator/atlas/atlas.d @@ -87,7 +87,7 @@ void incInitAtlassing() { glGenVertexArrays(1, &writeVAO); glGenBuffers(1, &writeVBO); - atlasShader = new Shader(import("shaders/atlassing.vert"), import("shaders/atlassing.frag")); + atlasShader = new Shader("atlassing", import("shaders/atlassing.vert"), import("shaders/atlassing.frag")); atlasMVP = atlasShader.getUniformLocation("mvp"); atlasRenderOpacity = atlasShader.getUniformLocation("opacity"); } diff --git a/source/creator/core/egg.d b/source/creator/core/egg.d index 78493f5c4..56d9c276f 100644 --- a/source/creator/core/egg.d +++ b/source/creator/core/egg.d @@ -94,7 +94,7 @@ version(InBranding) { } void incInitAda() { - adaShader = new Shader(import("shaders/ada.vert"), import("shaders/ada.frag")); + adaShader = new Shader("ada", import("shaders/ada.vert"), import("shaders/ada.frag")); cam = new Camera(); cam.position = vec2(0, 0); diff --git a/source/creator/ext/param.d b/source/creator/ext/param.d index 8a697dd93..ed58a0705 100644 --- a/source/creator/ext/param.d +++ b/source/creator/ext/param.d @@ -32,7 +32,7 @@ public: } override - FghjException deserializeFromFghj(Fghj data) { + SerdeException deserializeFromFghj(Fghj data) { data["groupUUID"].deserializeValue(this.uuid); if (!data["name"].isEmpty) data["name"].deserializeValue(this.name); if (!data["color"].isEmpty) data["color"].deserializeValue(this.color.vector); @@ -92,7 +92,7 @@ public: this.parent = parent; } override - FghjException deserializeFromFghj(Fghj data) { + SerdeException deserializeFromFghj(Fghj data) { if (!data["parentUUID"].isEmpty) data["parentUUID"].deserializeValue(this.parentUUID); return super.deserializeFromFghj(data); diff --git a/source/creator/panels/nodes.d b/source/creator/panels/nodes.d index 6ddd891c9..4b300bcd9 100644 --- a/source/creator/panels/nodes.d +++ b/source/creator/panels/nodes.d @@ -146,13 +146,6 @@ protected: igSameLine(0, 2); if (igMenuItem(__("Node"), "", false, true)) incAddChildWithHistory(new Node(cast(Node)null), n); - incText(incTypeIdToIcon("Mask")); - igSameLine(0, 2); - if (igMenuItem(__("Mask"), "", false, true)) { - MeshData empty; - incAddChildWithHistory(new Mask(empty, cast(Node)null), n); - } - incText(incTypeIdToIcon("Composite")); igSameLine(0, 2); if (igMenuItem(__("Composite"), "", false, true)) { diff --git a/source/creator/panels/scene.d b/source/creator/panels/scene.d index 0416914b3..735029ac8 100644 --- a/source/creator/panels/scene.d +++ b/source/creator/panels/scene.d @@ -16,6 +16,7 @@ import inochi2d; import std.conv; import i18n; import std.string; +import inmath; /** @@ -31,6 +32,19 @@ protected: ImGuiColorEditFlags.PickerHueWheel | ImGuiColorEditFlags.NoInputs ); + + igColorEdit3( + __("Scene Light Color"), + &inSceneLightColor.vector, + ImGuiColorEditFlags.PickerHueWheel | + ImGuiColorEditFlags.NoInputs + ); + + igSliderFloat3( + __("Light Direction"), + cast(float[3]*)inSceneLightDirection.ptr, + -1, 1 + ); } public: diff --git a/source/creator/viewport/common/mesheditor/tools/lasso.d b/source/creator/viewport/common/mesheditor/tools/lasso.d index 985ba75f2..4913d7a44 100644 --- a/source/creator/viewport/common/mesheditor/tools/lasso.d +++ b/source/creator/viewport/common/mesheditor/tools/lasso.d @@ -28,10 +28,14 @@ enum LassoType { } private { - const char* [LassoType] lassoTypeIcons = [ - LassoType.PolyLasso: "\ue922", // google material icon "timeline" - LassoType.RegularLasso: "\ue155", // google material icon "gesture" - ]; + const(char)* getLassoIcon(LassoType type) { + final switch(type) { + case LassoType.PolyLasso: + return "\ue922"; + case LassoType.RegularLasso: + return "\ue155"; + } + } string getLassoHint(LassoType lassoType) { switch (lassoType) { @@ -333,7 +337,7 @@ class LassoToolInfo : ToolInfoBase!LassoTool { bool displayToolOptions(bool deformOnly, VertexToolMode toolMode, IncMeshEditorOne[Node] editors) { auto lassoTool = cast(LassoTool)(editors.length == 0 ? null: editors.values()[0].getTool()); igBeginGroup(); - auto current_icon = lassoTypeIcons[lassoTool.lassoType]; + auto current_icon = getLassoIcon(lassoTool.lassoType); if (incButtonColored(current_icon, ImVec2(0, 0), ImVec4.init)) { foreach (e; editors) { auto lt = cast(LassoTool)(e.getTool()); diff --git a/source/creator/windows/flipconfig.d b/source/creator/windows/flipconfig.d index 96af88aaa..1849afdaf 100644 --- a/source/creator/windows/flipconfig.d +++ b/source/creator/windows/flipconfig.d @@ -44,12 +44,12 @@ class FlipPair : ISerializable { } void serialize(S)(ref S serializer) { - auto state = serializer.objectBegin(); + auto state = serializer.structBegin(); serializer.putKey("uuid1"); serializer.putValue(parts[0]? parts[0].uuid: InInvalidUUID); serializer.putKey("uuid2"); serializer.putValue(parts[1]? parts[1].uuid: InInvalidUUID); - serializer.objectEnd(state); + serializer.structEnd(state); } SerdeException deserializeFromFghj(Fghj data) { @@ -105,12 +105,12 @@ void incDumpFlipConfig(Puppet puppet) { if (flipPairs.length > 0) { auto app = appender!(char[]); auto serializer = inCreateSerializer(app); - auto i = serializer.arrayBegin(); + auto i = serializer.listBegin(); foreach (pair; flipPairs) { serializer.elemBegin; serializer.serializeValue(pair); } - serializer.arrayEnd(i); + serializer.listEnd(i); serializer.flush(); puppet.extData[FlipConfigPath] = cast(ubyte[])app.data;