Squashed 'deps/nostalgia/' changes from f7c3c02c..e38b85b4

e38b85b4 [studio] Eliminate redundant serialization and deserialization

git-subtree-dir: deps/nostalgia
git-subtree-split: e38b85b4f4134af04b9b71caddcd2268f425f5df
This commit is contained in:
2025-07-31 00:41:06 -05:00
parent 375388c0f1
commit b67b95767b

View File

@@ -185,14 +185,13 @@ ox::Error Project::writeObj(ox::StringViewCR path, T const &obj) noexcept {
template<typename T>
ox::Result<T> Project::loadObj(ox::StringViewCR path) const noexcept {
OX_REQUIRE_M(buff, loadBuff(path));
OX_REQUIRE(buff, loadBuff(path));
if constexpr(ox::is_same_v<T, ox::ModelObject>) {
return keel::readAsset(m_typeStore, buff);
} else {
OX_REQUIRE(typeId, keel::readAssetTypeId(buff));
if (typeId != ox::ModelTypeId_v<T>) {
OX_REQUIRE(ah, keel::readAssetHeader(buff));
OX_RETURN_ERROR(keel::convertBuffToBuff<T>(m_kctx, buff, ah.clawHdr.fmt).moveTo(buff));
return keel::convert<T>(m_kctx, buff);
}
return keel::readAsset<T>(buff);
}