2018-09-03 00:46:16 +00:00
|
|
|
#include "PAK.hpp"
|
|
|
|
#include "AGSC.hpp"
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
namespace DataSpec::DNAMP2 {
|
2018-09-03 00:46:16 +00:00
|
|
|
|
2019-10-01 07:38:03 +00:00
|
|
|
std::string PAK::bestEntryName(const nod::Node& pakNode, const Entry& entry, std::string& catalogueName) const {
|
2018-12-08 05:30:43 +00:00
|
|
|
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);
|
2019-10-01 07:38:03 +00:00
|
|
|
catalogueName = header.groupName;
|
2020-04-11 22:51:39 +00:00
|
|
|
return fmt::format(FMT_STRING("{}_{}"), header.groupName, entry.id);
|
2018-12-08 05:30:43 +00:00
|
|
|
}
|
2018-09-03 00:46:16 +00:00
|
|
|
|
2019-10-01 07:38:03 +00:00
|
|
|
return DNAMP1::PAK::bestEntryName(pakNode, entry, catalogueName);
|
2018-09-03 00:46:16 +00:00
|
|
|
}
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
} // namespace DataSpec::DNAMP2
|