File tree Expand file tree Collapse file tree 3 files changed +27
-41
lines changed
source/inochi2d/core/nodes Expand file tree Collapse file tree 3 files changed +27
-41
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 88*/
99module inochi2d.core.nodes.composite ;
1010import inochi2d.core.nodes.drawable ;
11- import inochi2d.core.nodes.common ;
1211import inochi2d.core.nodes ;
1312import inochi2d.core.math ;
1413import inochi2d.core;
Original file line number Diff line number Diff line change @@ -187,4 +187,31 @@ public:
187187 void drawAsMask (float delta, DrawList drawList, MaskingMode mode) {
188188 drawList.setMesh(drawListSlot);
189189 }
190+ }
191+
192+ /**
193+ A binding between a mask and a mode
194+ */
195+ struct MaskBinding {
196+ public :
197+ GUID maskSrcGUID;
198+ MaskingMode mode;
199+ Drawable maskSrc;
200+
201+ /**
202+ Serialization function
203+ */
204+ void onSerialize (ref JSONValue object, bool recursive = true ) {
205+ auto srcGuid = maskSrcGUID.toString();
206+ object[" source" ] = srcGuid.dup ;
207+ object[" mode" ] = mode;
208+ }
209+
210+ /**
211+ Deserialization function
212+ */
213+ void onDeserialize (ref JSONValue object) {
214+ maskSrcGUID = object.tryGetGUID(" source" , " source" );
215+ mode = object.tryGet! string (" mode" , null ).toMaskingMode;
216+ }
190217}
You can’t perform that action at this time.
0 commit comments