2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-16 08:57:03 +00:00

Initial PATH support for MP2

This commit is contained in:
2020-03-17 23:12:43 -07:00
parent 25842949a9
commit eb9efbf8c3
18 changed files with 411 additions and 303 deletions

View File

@@ -296,5 +296,22 @@ bool MREA::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl:
return conn.saveBlend();
}
UniqueID32 MREA::GetPATHId(PAKEntryReadStream& rs) {
/* Do extract */
Header head;
head.read(rs);
rs.seekAlign32();
/* Skip to PATH */
atUint32 curSec = 0;
atUint64 secStart = rs.position();
while (curSec != head.pathSecIdx)
secStart += head.secSizes[curSec++];
if (!head.secSizes[curSec])
return {};
rs.seek(secStart, athena::SeekOrigin::Begin);
return {rs};
}
} // namespace DNAMP2
} // namespace DataSpec