diff --git a/sample_project/.nostalgia/type_descriptors/net.drinkingtea.nostalgia.core.NostalgiaGraphic b/sample_project/.nostalgia/type_descriptors/net.drinkingtea.nostalgia.core.NostalgiaGraphic new file mode 100644 index 00000000..0b8a38ff Binary files /dev/null and b/sample_project/.nostalgia/type_descriptors/net.drinkingtea.nostalgia.core.NostalgiaGraphic differ diff --git a/sample_project/.nostalgia/type_descriptors/net.drinkingtea.nostalgia.core.NostalgiaPalette b/sample_project/.nostalgia/type_descriptors/net.drinkingtea.nostalgia.core.NostalgiaPalette new file mode 100644 index 00000000..e02ec9fd Binary files /dev/null and b/sample_project/.nostalgia/type_descriptors/net.drinkingtea.nostalgia.core.NostalgiaPalette differ diff --git a/src/nostalgia/studio/lib/project.hpp b/src/nostalgia/studio/lib/project.hpp index a970e644..2bd4314c 100644 --- a/src/nostalgia/studio/lib/project.hpp +++ b/src/nostalgia/studio/lib/project.hpp @@ -16,8 +16,9 @@ #include #include -#include "ox/claw/claw.hpp" +#include #include +#include #include "nostalgiastudio_export.h" @@ -98,6 +99,16 @@ void Project::writeObj(QString path, T *obj) const { oxThrowError(err); // write to FS writeBuff(path, ox::bit_cast(buff.data()), buff.size()); + + // write type descriptor + const auto type = ox::buildTypeDef(obj); + const auto typeOut = ox::writeClaw(type.value, ox::ClawFormat::Organic); + oxThrowError(typeOut); + // write to FS + QString descPath = "/.nostalgia/type_descriptors/"; + const auto typePath = descPath + type.value->typeName.c_str(); + mkdir(descPath); + writeBuff(typePath, ox::bit_cast(typeOut.value.data()), typeOut.value.size()); emit fileUpdated(path); }