2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-08 15:44:56 +00:00

Full PAK Indexing even for partial extracts

This commit is contained in:
Jack Andersen
2015-09-27 15:13:27 -10:00
parent 3540a3e19a
commit 739c31d87c
10 changed files with 78 additions and 72 deletions

View File

@@ -22,8 +22,10 @@ static bool GetNoShare(const std::string& name)
return true;
}
PAKBridge::PAKBridge(HECL::Database::Project& project, const NOD::DiscBase::IPartition::Node& node)
: m_project(project), m_node(node), m_pak(true, GetNoShare(node.getName()))
PAKBridge::PAKBridge(HECL::Database::Project& project,
const NOD::DiscBase::IPartition::Node& node,
bool doExtract)
: m_project(project), m_node(node), m_pak(true, GetNoShare(node.getName())), m_doExtract(doExtract)
{
NOD::AthenaPartReadStream rs(node.beginReadStream());
m_pak.read(rs);
@@ -70,7 +72,7 @@ void PAKBridge::build()
{
if (entry.type == FOURCC('MLVL'))
{
PAKBridge::Level& level = m_levelDeps[entry.id];
Level& level = m_levelDeps[entry.id];
PAKEntryReadStream rs = entry.beginReadStream(m_node);
MLVL mlvl;

View File

@@ -18,26 +18,14 @@ class PAKBridge
const NOD::DiscBase::IPartition::Node& m_node;
DNAMP1::PAK m_pak;
public:
struct Level
{
HECL::SystemString name;
struct Area
{
HECL::SystemString name;
struct Layer
{
HECL::SystemString name;
std::unordered_set<UniqueID32> resources;
};
std::vector<Layer> layers;
std::unordered_set<UniqueID32> resources;
};
std::unordered_map<UniqueID32, Area> areas;
};
bool m_doExtract;
using Level = Level<UniqueID32>;
std::unordered_map<UniqueID32, Level> m_levelDeps;
HECL::SystemString m_levelString;
PAKBridge(HECL::Database::Project& project, const NOD::DiscBase::IPartition::Node& node);
PAKBridge(HECL::Database::Project& project,
const NOD::DiscBase::IPartition::Node& node,
bool doExtract=true);
void build();
static ResExtractor<PAKBridge> LookupExtractor(const DNAMP1::PAK::Entry& entry);
const std::string& getName() const {return m_node.getName();}