mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-10 07:07:42 +00:00
Initial PATH support for MP2
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
#include "MREA.hpp"
|
||||
#include "MAPA.hpp"
|
||||
#include "MAPU.hpp"
|
||||
#include "PATH.hpp"
|
||||
#include "AFSM.hpp"
|
||||
#include "SAVW.hpp"
|
||||
#include "AGSC.hpp"
|
||||
@@ -171,6 +172,18 @@ void PAKBridge::addCMDLRigPairs(PAKRouter<PAKBridge>& pakRouter, CharacterAssoci
|
||||
}
|
||||
}
|
||||
|
||||
void PAKBridge::addPATHToMREA(PAKRouter<PAKBridge>& pakRouter,
|
||||
std::unordered_map<UniqueID32, UniqueID32>& pathToMrea) const {
|
||||
for (const auto& [id, entry] : m_pak.m_entries) {
|
||||
if (entry.type == FOURCC('MREA')) {
|
||||
PAKEntryReadStream rs = entry.beginReadStream(m_node);
|
||||
UniqueID32 pathID = MREA::GetPATHId(rs);
|
||||
if (pathID.isValid())
|
||||
pathToMrea[pathID] = id;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static const atVec4f BottomRow = {{0.f, 0.f, 0.f, 1.f}};
|
||||
|
||||
void PAKBridge::addMAPATransforms(PAKRouter<PAKBridge>& pakRouter,
|
||||
@@ -190,6 +203,18 @@ void PAKBridge::addMAPATransforms(PAKRouter<PAKBridge>& pakRouter,
|
||||
fmt::format(fmt(_SYS_STR("!name_{}.yaml")), mlvl.worldNameId));
|
||||
|
||||
for (const MLVL::Area& area : mlvl.areas) {
|
||||
#if 0
|
||||
{
|
||||
/* Get PATH transform */
|
||||
const nod::Node* areaNode;
|
||||
const PAK::Entry* areaEntry = pakRouter.lookupEntry(area.areaMREAId, &areaNode);
|
||||
PAKEntryReadStream rs = areaEntry->beginReadStream(*areaNode);
|
||||
UniqueID32 pathId = MREA::GetPATHId(rs);
|
||||
if (pathId.isValid())
|
||||
addTo[pathId] = zeus::CMatrix4f(area.transformMtx[0], area.transformMtx[1], area.transformMtx[2], BottomRow)
|
||||
.transposed();
|
||||
}
|
||||
#endif
|
||||
hecl::ProjectPath areaDirPath = pakRouter.getWorking(area.areaMREAId).getParentPath();
|
||||
if (area.areaNameId.isValid())
|
||||
pathOverrides[area.areaNameId] = hecl::ProjectPath(areaDirPath,
|
||||
@@ -247,6 +272,8 @@ ResExtractor<PAKBridge> PAKBridge::LookupExtractor(const nod::Node& pakNode, con
|
||||
return {MAPA::Extract, {_SYS_STR(".blend")}, 4};
|
||||
case SBIG('MAPU'):
|
||||
return {MAPU::Extract, {_SYS_STR(".blend")}, 5};
|
||||
// case SBIG('PATH'):
|
||||
// return {PATH::Extract, {_SYS_STR(".blend")}, 5};
|
||||
case SBIG('FSM2'):
|
||||
return {DNAFSM2::ExtractFSM2<UniqueID32>, {_SYS_STR(".yaml")}};
|
||||
case SBIG('FONT'):
|
||||
|
||||
Reference in New Issue
Block a user