From df96407669868c8aa980b50d16319857b8876538 Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Tue, 16 Jun 2020 04:42:18 -0500 Subject: [PATCH] [nostalgia/studio] Make Project write out type data with data --- ...t.drinkingtea.nostalgia.core.NostalgiaGraphic | Bin 0 -> 1883 bytes ...t.drinkingtea.nostalgia.core.NostalgiaPalette | Bin 0 -> 280 bytes src/nostalgia/studio/lib/project.hpp | 13 ++++++++++++- 3 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 sample_project/.nostalgia/type_descriptors/net.drinkingtea.nostalgia.core.NostalgiaGraphic create mode 100644 sample_project/.nostalgia/type_descriptors/net.drinkingtea.nostalgia.core.NostalgiaPalette 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 0000000000000000000000000000000000000000..0b8a38fffbef8c83171027183cc2c74af85e9fc9 GIT binary patch literal 1883 zcmb_dO>e?54BfT;6{zQ_QW-<2oQBYLnb;1yp=rw60MSZQrC}eM`0ulm^eb&QU~r&K z?D##~FYZGyO{w%_!O}ODt|cWt|McfHj|9sk7f)Xqod(ly*YQ@2Ch!4qDVHVmT zN(dUHKQc>sY_y~R^sske^tbjuQY z6UTz)xj#pNnfRsy`eCrzK-U`R7?i&UOh%IP-98u#T$rhVwX!r_cD^~1Yih1d)L~Cq zXCbyM7*{PjWA##=OOmV^@gpv%zbKZ)oWgz~T<=_y(Bb-6Jn=JPU0KYy@wspvR7tl) Se%D7|hIfKw8y0!){^AFphOGnu literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..e02ec9fd55af1908a892e954e9e3cd68475ed8b4 GIT binary patch literal 280 zcmZ8c%?iRW4EEYS#pqcI6ZEj%#G_0P-iAoo;tY1}Xrm~ycekBWaEAo){UzC@xdD>3 zLvuyb5GZLMas$3{*pYRIX9szjzc>?T1YK{@lSs0Jvyw9wU^WtkY9SJ$vf4T?<^x5+ z{*jO3NlbYhbWCUn%PM?EiGg|4$38cJ6u5;3 #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); }