[nostalgia/studio] Add ClawViewer for unknown types

This commit is contained in:
2022-12-15 01:36:55 -06:00
parent 79d255b63f
commit 44f45e64e9
16 changed files with 505 additions and 75 deletions
+7 -4
View File
@@ -61,7 +61,7 @@ class NOSTALGIASTUDIO_EXPORT Project {
ox::Error writeObj(const ox::String &path, const T *obj, ox::ClawFormat fmt = ox::ClawFormat::Metal) noexcept;
template<typename T>
ox::Result<ox::UniquePtr<T>> loadObj(const ox::String &path) const noexcept;
ox::Result<T> loadObj(const ox::String &path) const noexcept;
ox::Result<ox::FileStat> stat(const ox::String &path) const noexcept;
@@ -126,10 +126,13 @@ ox::Error Project::writeObj(const ox::String &path, const T *obj, ox::ClawFormat
}
template<typename T>
ox::Result<ox::UniquePtr<T>> Project::loadObj(const ox::String &path) const noexcept {
auto obj = ox::make_unique<T>();
ox::Result<T> Project::loadObj(const ox::String &path) const noexcept {
oxRequire(buff, loadBuff(path));
return ox::readClaw<T>(buff);
if constexpr (ox::is_same_v<T, ox::ModelObject>) {
return ox::readClaw(&m_typeStore, buff);
} else {
return ox::readClaw<T>(buff);
}
}
template<typename Functor>