2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-09 04:27:42 +00:00

Shader refactor bug fixes and attachment model extract/cook

This commit is contained in:
Jack Andersen
2018-10-11 10:50:05 -10:00
parent c91e5df986
commit 1559163f98
85 changed files with 535 additions and 382 deletions

View File

@@ -427,6 +427,31 @@ public:
/** Resource cooker function */
typedef std::function<bool(const hecl::ProjectPath&, const hecl::ProjectPath&)> ResCooker;
/** Mappings of resources involved in extracting characters */
template <class IDType>
struct CharacterAssociations
{
using RigPair = std::pair<IDType, IDType>;
/* CMDL -> (CSKR, CINF) */
std::unordered_map<IDType, RigPair> m_cmdlRigs;
/* (CSKR, CINF) -> ANCS */
std::unordered_map<IDType, std::pair<IDType, std::string>> m_cskrCinfToCharacter;
/* ANCS -> (CINF, CMDL) */
std::unordered_multimap<IDType, std::pair<RigPair, std::string>> m_characterToAttachmentRigs;
using MultimapIteratorPair = std::pair<
typename std::unordered_multimap<IDType, std::pair<RigPair, std::string>>::const_iterator,
typename std::unordered_multimap<IDType, std::pair<RigPair, std::string>>::const_iterator>;
void addAttachmentRig(IDType character, IDType cinf, IDType cmdl, const char* name)
{
auto range = m_characterToAttachmentRigs.equal_range(character);
for (auto it = range.first; it != range.second; ++it)
if (it->second.second == name)
return;
m_characterToAttachmentRigs.insert(
std::make_pair(character, std::make_pair(std::make_pair(cinf, cmdl), name)));
}
};
}
/* Hash template-specializations for UniqueID types */