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

Integrate Amuse into hecl cook/extract for MP1/2

This commit is contained in:
Jack Andersen
2018-09-02 14:46:16 -10:00
parent 5a60a0acfc
commit e46ec80b64
150 changed files with 5011 additions and 430 deletions

View File

@@ -2,6 +2,7 @@
#include <lzo/lzo1x.h>
#include "DNAMP1.hpp"
#include "PAK.hpp"
#include "AGSC.hpp"
namespace DataSpec::DNAMP1
{
@@ -181,8 +182,19 @@ const PAK::Entry* PAK::lookupEntry(std::string_view name) const
return nullptr;
}
std::string PAK::bestEntryName(const Entry& entry, bool& named) const
std::string PAK::bestEntryName(const nod::Node& pakNode, const Entry& entry, bool& named) const
{
std::unordered_map<UniqueID32, Entry>::const_iterator search;
if (entry.type == FOURCC('AGSC') && (search = m_entries.find(entry.id)) != m_entries.cend())
{
/* Use internal AGSC name for entry */
auto rs = search->second.beginReadStream(pakNode);
AGSC::Header header;
header.read(rs);
named = true;
return header.groupName;
}
/* Prefer named entries first */
for (const NameEntry& nentry : m_nameEntries)
if (nentry.id == entry.id)