2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-08 12:24:56 +00:00

Refactor for blender 2.8 and new shader model

This commit is contained in:
Jack Andersen
2019-05-07 17:50:21 -10:00
parent 1f10769af3
commit 233d13ceb9
67 changed files with 2827 additions and 2105 deletions

View File

@@ -14,7 +14,7 @@ CToken ProjectResourcePool::GetObj(std::string_view name) {
hecl::ProjectPath path(*m_parent.project(), name);
SObjectTag tag =
static_cast<ProjectResourceFactoryBase&>(x18_factory).TagFromPath(path, hecl::blender::SharedBlenderToken);
static_cast<ProjectResourceFactoryBase&>(x18_factory).TagFromPath(path);
if (tag)
return CSimplePool::GetObj(tag);
@@ -28,7 +28,7 @@ CToken ProjectResourcePool::GetObj(std::string_view name, const CVParamTransfer&
hecl::ProjectPath path(*m_parent.project(), name);
SObjectTag tag =
static_cast<ProjectResourceFactoryBase&>(x18_factory).TagFromPath(path, hecl::blender::SharedBlenderToken);
static_cast<ProjectResourceFactoryBase&>(x18_factory).TagFromPath(path);
if (tag)
return CSimplePool::GetObj(tag, pvxfer);

View File

@@ -61,7 +61,7 @@ void ProjectResourceFactoryBase::AsyncTask::EnsurePath(const urde::SObjectTag& t
m_cookedPath = path.getCookedPath(*m_parent.m_origSpec);
if (!m_cookedPath.isFile() || m_cookedPath.getModtime() < path.getModtime()) {
/* Last chance type validation */
urde::SObjectTag verifyTag = m_parent.TagFromPath(path, hecl::blender::SharedBlenderToken);
urde::SObjectTag verifyTag = m_parent.TagFromPath(path);
if (verifyTag.type != tag.type) {
Log.report(logvisor::Error, _SYS_STR("%s: expected type '%.4s', found '%.4s'"), path.getRelativePath().data(),
tag.type.getChars(), verifyTag.type.getChars());
@@ -179,7 +179,7 @@ bool ProjectResourceFactoryBase::PrepForReadSync(const SObjectTag& tag, const he
cooked = path.getCookedPath(*m_origSpec);
if (!cooked.isFile() || cooked.getModtime() < path.getModtime()) {
/* Last chance type validation */
urde::SObjectTag verifyTag = TagFromPath(path, hecl::blender::SharedBlenderToken);
urde::SObjectTag verifyTag = TagFromPath(path);
if (verifyTag.type != tag.type) {
Log.report(logvisor::Error, _SYS_STR("%s: expected type '%.4s', found '%.4s'"), path.getRelativePath().data(),
tag.type.getChars(), verifyTag.type.getChars());

View File

@@ -96,11 +96,11 @@ protected:
bool WaitForTagReady(const urde::SObjectTag& tag, const hecl::ProjectPath*& pathOut) {
return static_cast<DataSpec::SpecBase&>(*m_cookSpec).waitForTagReady(tag, pathOut);
}
SObjectTag TagFromPath(const hecl::ProjectPath& path, hecl::blender::Token& btok) const {
return static_cast<DataSpec::SpecBase&>(*m_cookSpec).tagFromPath(path, btok);
SObjectTag TagFromPath(const hecl::ProjectPath& path) const {
return static_cast<DataSpec::SpecBase&>(*m_cookSpec).tagFromPath(path);
}
SObjectTag BuildTagFromPath(const hecl::ProjectPath& path, hecl::blender::Token& btok) const {
return static_cast<DataSpec::SpecBase&>(*m_cookSpec).buildTagFromPath(path, btok);
SObjectTag BuildTagFromPath(const hecl::ProjectPath& path) const {
return static_cast<DataSpec::SpecBase&>(*m_cookSpec).buildTagFromPath(path);
}
void GetTagListForFile(const char* pakName, std::vector<SObjectTag>& out) const {
return static_cast<DataSpec::SpecBase&>(*m_cookSpec).getTagListForFile(pakName, out);
@@ -150,7 +150,7 @@ public:
bool IsBusy() const { return m_asyncLoadMap.size() != 0; }
SObjectTag TagFromPath(hecl::SystemStringView path) const {
return TagFromPath(hecl::ProjectPath(*(hecl::Database::Project*)m_proj, path), hecl::blender::SharedBlenderToken);
return TagFromPath(hecl::ProjectPath(*(hecl::Database::Project*)m_proj, path));
}
~ProjectResourceFactoryBase() { Shutdown(); }