Cook path directories properly created

This commit is contained in:
Jack Andersen 2016-03-31 08:56:43 -10:00
parent d5ff5e3ace
commit 372e11e190
5 changed files with 15 additions and 19 deletions

View File

@ -1505,16 +1505,7 @@ bool WriteHMDLCMDL(const hecl::ProjectPath& outPath, const hecl::ProjectPath& in
}
for (const hecl::ProjectPath& path : texPaths)
{
const hecl::SystemString& relPath = path.getRelativePath();
/* TODO: incorporate hecl hashes */
size_t search = relPath.find(_S("TXTR_"));
if (search != hecl::SystemString::npos)
targetMSet.head.addTexture(relPath.c_str() + search + 5);
else
LogDNACommon.report(logvisor::Fatal, "unable to get hash from path");
}
targetMSet.head.addTexture(path);
size_t secSz = targetMSet.binarySize(0);
size_t secSz32 = ROUND_UP_32(secSz);
@ -1628,5 +1619,8 @@ bool WriteHMDLCMDL(const hecl::ProjectPath& outPath, const hecl::ProjectPath& in
return true;
}
template bool WriteHMDLCMDL<DNAMP1::HMDLMaterialSet, DNACMDL::SurfaceHeader_1, 2>
(const hecl::ProjectPath& outPath, const hecl::ProjectPath& inPath, const Mesh& mesh);
}
}

View File

@ -85,11 +85,10 @@ struct CMDL
const hecl::ProjectPath& inPath,
const DNACMDL::Mesh& mesh)
{
hecl::ProjectPath tempOut = outPath.getWithExtension(_S(".recook"));
if (mesh.skins.size())
{
DNACMDL::Mesh skinMesh = mesh.getContiguousSkinningVersion();
if (!DNACMDL::WriteCMDL<MaterialSet, DNACMDL::SurfaceHeader_1, 2>(tempOut, inPath, skinMesh))
if (!DNACMDL::WriteCMDL<MaterialSet, DNACMDL::SurfaceHeader_1, 2>(outPath, inPath, skinMesh))
return false;
/* Output skinning intermediate */
@ -111,7 +110,7 @@ struct CMDL
for (const std::string& boneName : skinMesh.boneNames)
writer.writeString(boneName);
}
else if (!DNACMDL::WriteCMDL<MaterialSet, DNACMDL::SurfaceHeader_1, 2>(tempOut, inPath, mesh))
else if (!DNACMDL::WriteCMDL<MaterialSet, DNACMDL::SurfaceHeader_1, 2>(outPath, inPath, mesh))
return false;
return true;
}
@ -120,10 +119,9 @@ struct CMDL
const hecl::ProjectPath& inPath,
const DNACMDL::Mesh& mesh)
{
hecl::ProjectPath tempOut = outPath.getWithExtension(_S(".recook"));
if (mesh.skins.size())
{
if (!DNACMDL::WriteHMDLCMDL<HMDLMaterialSet, DNACMDL::SurfaceHeader_1, 2>(tempOut, inPath, mesh))
if (!DNACMDL::WriteHMDLCMDL<HMDLMaterialSet, DNACMDL::SurfaceHeader_1, 2>(outPath, inPath, mesh))
return false;
/* Output skinning intermediate */
@ -139,7 +137,7 @@ struct CMDL
for (const std::string& boneName : mesh.boneNames)
writer.writeString(boneName);
}
else if (!DNACMDL::WriteHMDLCMDL<HMDLMaterialSet, DNACMDL::SurfaceHeader_1, 2>(tempOut, inPath, mesh))
else if (!DNACMDL::WriteHMDLCMDL<HMDLMaterialSet, DNACMDL::SurfaceHeader_1, 2>(outPath, inPath, mesh))
return false;
return true;
}

View File

@ -324,7 +324,11 @@ struct SpecMP1 : SpecBase
{
progress(hecl::SysFormat(_S("%d"), surfCount).c_str());
});
DNAMP1::CMDL::Cook(out, in, mesh);
if (m_pc)
DNAMP1::CMDL::HMDLCook(out, in, mesh);
else
DNAMP1::CMDL::Cook(out, in, mesh);
}
void cookActor(const hecl::ProjectPath& out, const hecl::ProjectPath& in,

View File

@ -20,7 +20,7 @@ namespace urde
void ViewManager::BuildTestPART(urde::IObjectStore& objStore)
{
//m_modelTest = objStore.GetObj("CMDL_GameCube");
m_modelTest = objStore.GetObj("CMDL_GameCube");
//m_partGenDesc = objStore.GetObj({hecl::FOURCC('PART'), 0x972A5CD2});
m_partGenDesc = objStore.GetObj("BusterSparks");

2
hecl

@ -1 +1 @@
Subproject commit c5faedae338e1573ee2c97ef606623775df59936
Subproject commit d3c1e65900b309c3d4c805e99c03dd1fc91818bb