From 372e11e190c751eecc6b82a68822cc0034af96c6 Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Thu, 31 Mar 2016 08:56:43 -1000 Subject: [PATCH] Cook path directories properly created --- DataSpec/DNACommon/CMDL.cpp | 14 ++++---------- DataSpec/DNAMP1/CMDL.hpp | 10 ++++------ DataSpec/SpecMP1.cpp | 6 +++++- Editor/ViewManager.cpp | 2 +- hecl | 2 +- 5 files changed, 15 insertions(+), 19 deletions(-) diff --git a/DataSpec/DNACommon/CMDL.cpp b/DataSpec/DNACommon/CMDL.cpp index 124498f77..c87750ca5 100644 --- a/DataSpec/DNACommon/CMDL.cpp +++ b/DataSpec/DNACommon/CMDL.cpp @@ -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 +(const hecl::ProjectPath& outPath, const hecl::ProjectPath& inPath, const Mesh& mesh); + } } diff --git a/DataSpec/DNAMP1/CMDL.hpp b/DataSpec/DNAMP1/CMDL.hpp index 4b90d1af2..fcee64a17 100644 --- a/DataSpec/DNAMP1/CMDL.hpp +++ b/DataSpec/DNAMP1/CMDL.hpp @@ -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(tempOut, inPath, skinMesh)) + if (!DNACMDL::WriteCMDL(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(tempOut, inPath, mesh)) + else if (!DNACMDL::WriteCMDL(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(tempOut, inPath, mesh)) + if (!DNACMDL::WriteHMDLCMDL(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(tempOut, inPath, mesh)) + else if (!DNACMDL::WriteHMDLCMDL(outPath, inPath, mesh)) return false; return true; } diff --git a/DataSpec/SpecMP1.cpp b/DataSpec/SpecMP1.cpp index 964b8429b..4667dab43 100644 --- a/DataSpec/SpecMP1.cpp +++ b/DataSpec/SpecMP1.cpp @@ -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, diff --git a/Editor/ViewManager.cpp b/Editor/ViewManager.cpp index a64a701f1..bacd17dbc 100644 --- a/Editor/ViewManager.cpp +++ b/Editor/ViewManager.cpp @@ -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"); diff --git a/hecl b/hecl index c5faedae3..d3c1e6590 160000 --- a/hecl +++ b/hecl @@ -1 +1 @@ -Subproject commit c5faedae338e1573ee2c97ef606623775df59936 +Subproject commit d3c1e65900b309c3d4c805e99c03dd1fc91818bb