[studio] Eliminate redundant serialization and deserialization
All checks were successful
Build / build (push) Successful in 1m42s

This commit is contained in:
2025-07-30 21:48:44 -05:00
parent f7c3c02c4c
commit e38b85b4f4

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);
}