[nostalgia/studio] Add ClawViewer for unknown types
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user