mirror of https://github.com/AxioDL/metaforce.git
Working MP1 extract with tags replaced with paths
This commit is contained in:
parent
8648dfbf10
commit
7049ab2b1d
|
@ -121,6 +121,8 @@ public:
|
||||||
}
|
}
|
||||||
void write(Athena::io::YAMLDocWriter& writer) const
|
void write(Athena::io::YAMLDocWriter& writer) const
|
||||||
{
|
{
|
||||||
|
if (!operator bool())
|
||||||
|
return;
|
||||||
writer.writeString(nullptr, UniqueIDBridge::TranslatePakIdToPath(*this).getRelativePathUTF8());
|
writer.writeString(nullptr, UniqueIDBridge::TranslatePakIdToPath(*this).getRelativePathUTF8());
|
||||||
}
|
}
|
||||||
size_t binarySize(size_t __isz) const
|
size_t binarySize(size_t __isz) const
|
||||||
|
@ -132,6 +134,7 @@ public:
|
||||||
bool operator!=(const UniqueID32& other) const {return m_id != other.m_id;}
|
bool operator!=(const UniqueID32& other) const {return m_id != other.m_id;}
|
||||||
bool operator==(const UniqueID32& other) const {return m_id == other.m_id;}
|
bool operator==(const UniqueID32& other) const {return m_id == other.m_id;}
|
||||||
uint32_t toUint32() const {return m_id;}
|
uint32_t toUint32() const {return m_id;}
|
||||||
|
uint64_t toUint64() const {return m_id;}
|
||||||
std::string toString() const
|
std::string toString() const
|
||||||
{
|
{
|
||||||
char buf[9];
|
char buf[9];
|
||||||
|
@ -178,6 +181,8 @@ public:
|
||||||
}
|
}
|
||||||
void write(Athena::io::YAMLDocWriter& writer) const
|
void write(Athena::io::YAMLDocWriter& writer) const
|
||||||
{
|
{
|
||||||
|
if (!operator bool())
|
||||||
|
return;
|
||||||
writer.writeString(nullptr, UniqueIDBridge::TranslatePakIdToPath(*this).getRelativePathUTF8());
|
writer.writeString(nullptr, UniqueIDBridge::TranslatePakIdToPath(*this).getRelativePathUTF8());
|
||||||
}
|
}
|
||||||
size_t binarySize(size_t __isz) const
|
size_t binarySize(size_t __isz) const
|
||||||
|
@ -257,6 +262,8 @@ public:
|
||||||
}
|
}
|
||||||
void write(Athena::io::YAMLDocWriter& writer) const
|
void write(Athena::io::YAMLDocWriter& writer) const
|
||||||
{
|
{
|
||||||
|
if (!operator bool())
|
||||||
|
return;
|
||||||
writer.writeString(nullptr, UniqueIDBridge::TranslatePakIdToPath(*this).getRelativePathUTF8());
|
writer.writeString(nullptr, UniqueIDBridge::TranslatePakIdToPath(*this).getRelativePathUTF8());
|
||||||
}
|
}
|
||||||
size_t binarySize(size_t __isz) const
|
size_t binarySize(size_t __isz) const
|
||||||
|
|
|
@ -260,7 +260,6 @@ public:
|
||||||
|
|
||||||
void build(std::vector<BRIDGETYPE>& bridges, std::function<void(float)> progress)
|
void build(std::vector<BRIDGETYPE>& bridges, std::function<void(float)> progress)
|
||||||
{
|
{
|
||||||
g_PakRouter = this;
|
|
||||||
m_bridges = &bridges;
|
m_bridges = &bridges;
|
||||||
m_bridgePaths.clear();
|
m_bridgePaths.clear();
|
||||||
|
|
||||||
|
@ -304,6 +303,8 @@ public:
|
||||||
else
|
else
|
||||||
m_uniqueEntries[entry.first] = std::make_pair(bridgeIdx, entry.second);
|
m_uniqueEntries[entry.first] = std::make_pair(bridgeIdx, entry.second);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
m_uniqueEntries[entry.first] = std::make_pair(bridgeIdx, entry.second);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Add RigPairs to global map */
|
/* Add RigPairs to global map */
|
||||||
|
@ -313,10 +314,12 @@ public:
|
||||||
++bridgeIdx;
|
++bridgeIdx;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Add named resources to catalog YAML */
|
/* Add named resources to catalog YAML files */
|
||||||
Athena::io::YAMLDocWriter catalogWriter(nullptr);
|
|
||||||
for (BRIDGETYPE& bridge : bridges)
|
for (BRIDGETYPE& bridge : bridges)
|
||||||
{
|
{
|
||||||
|
Athena::io::YAMLDocWriter catalogWriter(nullptr);
|
||||||
|
|
||||||
|
enterPAKBridge(bridge);
|
||||||
const typename BRIDGETYPE::PAKType& pak = bridge.getPAK();
|
const typename BRIDGETYPE::PAKType& pak = bridge.getPAK();
|
||||||
for (const auto& namedEntry : pak.m_nameEntries)
|
for (const auto& namedEntry : pak.m_nameEntries)
|
||||||
{
|
{
|
||||||
|
@ -324,18 +327,20 @@ public:
|
||||||
catalogWriter.writeString(nullptr, getWorking(namedEntry.id).getRelativePathUTF8().c_str());
|
catalogWriter.writeString(nullptr, getWorking(namedEntry.id).getRelativePathUTF8().c_str());
|
||||||
catalogWriter.leaveSubRecord();
|
catalogWriter.leaveSubRecord();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/* Write catalog */
|
/* Write catalog */
|
||||||
HECL::SystemString catalogPath = HECL::ProjectPath(m_gameWorking, "catalog.yaml").getAbsolutePath();
|
const HECL::ProjectPath& pakPath = m_bridgePaths[m_curBridgeIdx].first;
|
||||||
|
HECL::SystemString catalogPath = HECL::ProjectPath(pakPath, "catalog.yaml").getAbsolutePath();
|
||||||
FILE* catalog = HECL::Fopen(catalogPath.c_str(), _S("w"));
|
FILE* catalog = HECL::Fopen(catalogPath.c_str(), _S("w"));
|
||||||
yaml_emitter_set_output_file(catalogWriter.getEmitter(), catalog);
|
yaml_emitter_set_output_file(catalogWriter.getEmitter(), catalog);
|
||||||
catalogWriter.finish();
|
catalogWriter.finish();
|
||||||
fclose(catalog);
|
fclose(catalog);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void enterPAKBridge(const BRIDGETYPE& pakBridge)
|
void enterPAKBridge(const BRIDGETYPE& pakBridge)
|
||||||
{
|
{
|
||||||
|
g_PakRouter = this;
|
||||||
auto pit = m_bridgePaths.begin();
|
auto pit = m_bridgePaths.begin();
|
||||||
size_t bridgeIdx = 0;
|
size_t bridgeIdx = 0;
|
||||||
for (const BRIDGETYPE& bridge : *m_bridges)
|
for (const BRIDGETYPE& bridge : *m_bridges)
|
||||||
|
@ -353,12 +358,13 @@ public:
|
||||||
++bridgeIdx;
|
++bridgeIdx;
|
||||||
}
|
}
|
||||||
LogDNACommon.report(LogVisor::FatalError, "PAKBridge provided to PAKRouter::enterPAKBridge() was not part of build()");
|
LogDNACommon.report(LogVisor::FatalError, "PAKBridge provided to PAKRouter::enterPAKBridge() was not part of build()");
|
||||||
g_PakRouter = this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
HECL::ProjectPath getWorking(const EntryType* entry,
|
HECL::ProjectPath getWorking(const EntryType* entry,
|
||||||
const ResExtractor<BRIDGETYPE>& extractor) const
|
const ResExtractor<BRIDGETYPE>& extractor) const
|
||||||
{
|
{
|
||||||
|
if (!entry)
|
||||||
|
return HECL::ProjectPath();
|
||||||
if (!m_pak)
|
if (!m_pak)
|
||||||
LogDNACommon.report(LogVisor::FatalError,
|
LogDNACommon.report(LogVisor::FatalError,
|
||||||
"PAKRouter::enterPAKBridge() must be called before PAKRouter::getWorkingPath()");
|
"PAKRouter::enterPAKBridge() must be called before PAKRouter::getWorkingPath()");
|
||||||
|
@ -370,9 +376,9 @@ public:
|
||||||
const HECL::ProjectPath& pakPath = m_bridgePaths[m_curBridgeIdx].first;
|
const HECL::ProjectPath& pakPath = m_bridgePaths[m_curBridgeIdx].first;
|
||||||
pakPath.makeDir();
|
pakPath.makeDir();
|
||||||
#if HECL_UCS2
|
#if HECL_UCS2
|
||||||
HECL::SystemString entName = HECL::UTF8ToWide(m_pak->bestEntryName(*entry));
|
HECL::SystemString entName = HECL::UTF8ToWide(getBestEntryName(*entry));
|
||||||
#else
|
#else
|
||||||
HECL::SystemString entName = m_pak->bestEntryName(*entry);
|
HECL::SystemString entName = getBestEntryName(*entry);
|
||||||
#endif
|
#endif
|
||||||
if (extractor.fileExts[0] && !extractor.fileExts[1])
|
if (extractor.fileExts[0] && !extractor.fileExts[1])
|
||||||
entName += extractor.fileExts[0];
|
entName += extractor.fileExts[0];
|
||||||
|
@ -387,9 +393,9 @@ public:
|
||||||
pakPath.makeDir();
|
pakPath.makeDir();
|
||||||
HECL::ProjectPath uniquePath = entry->unique.uniquePath(pakPath);
|
HECL::ProjectPath uniquePath = entry->unique.uniquePath(pakPath);
|
||||||
#if HECL_UCS2
|
#if HECL_UCS2
|
||||||
HECL::SystemString entName = HECL::UTF8ToWide(m_pak->bestEntryName(*entry));
|
HECL::SystemString entName = HECL::UTF8ToWide(getBestEntryName(*entry));
|
||||||
#else
|
#else
|
||||||
HECL::SystemString entName = m_pak->bestEntryName(*entry);
|
HECL::SystemString entName = getBestEntryName(*entry);
|
||||||
#endif
|
#endif
|
||||||
if (extractor.fileExts[0] && !extractor.fileExts[1])
|
if (extractor.fileExts[0] && !extractor.fileExts[1])
|
||||||
entName += extractor.fileExts[0];
|
entName += extractor.fileExts[0];
|
||||||
|
@ -399,11 +405,10 @@ public:
|
||||||
auto sharedSearch = m_sharedEntries.find(entry->id);
|
auto sharedSearch = m_sharedEntries.find(entry->id);
|
||||||
if (sharedSearch != m_sharedEntries.end())
|
if (sharedSearch != m_sharedEntries.end())
|
||||||
{
|
{
|
||||||
const HECL::ProjectPath& pakPath = m_bridgePaths[m_curBridgeIdx].first;
|
|
||||||
#if HECL_UCS2
|
#if HECL_UCS2
|
||||||
HECL::SystemString entBase = HECL::UTF8ToWide(m_pak->bestEntryName(*entry));
|
HECL::SystemString entBase = HECL::UTF8ToWide(getBestEntryName(*entry));
|
||||||
#else
|
#else
|
||||||
HECL::SystemString entBase = m_pak->bestEntryName(*entry);
|
HECL::SystemString entBase = getBestEntryName(*entry);
|
||||||
#endif
|
#endif
|
||||||
HECL::SystemString entName = entBase;
|
HECL::SystemString entName = entBase;
|
||||||
if (extractor.fileExts[0] && !extractor.fileExts[1])
|
if (extractor.fileExts[0] && !extractor.fileExts[1])
|
||||||
|
@ -419,6 +424,8 @@ public:
|
||||||
|
|
||||||
HECL::ProjectPath getWorking(const EntryType* entry) const
|
HECL::ProjectPath getWorking(const EntryType* entry) const
|
||||||
{
|
{
|
||||||
|
if (!entry)
|
||||||
|
return HECL::ProjectPath();
|
||||||
return getWorking(entry, BRIDGETYPE::LookupExtractor(*entry));
|
return getWorking(entry, BRIDGETYPE::LookupExtractor(*entry));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -429,6 +436,8 @@ public:
|
||||||
|
|
||||||
HECL::ProjectPath getCooked(const EntryType* entry) const
|
HECL::ProjectPath getCooked(const EntryType* entry) const
|
||||||
{
|
{
|
||||||
|
if (!entry)
|
||||||
|
return HECL::ProjectPath();
|
||||||
if (!m_pak)
|
if (!m_pak)
|
||||||
LogDNACommon.report(LogVisor::FatalError,
|
LogDNACommon.report(LogVisor::FatalError,
|
||||||
"PAKRouter::enterPAKBridge() must be called before PAKRouter::getCookedPath()");
|
"PAKRouter::enterPAKBridge() must be called before PAKRouter::getCookedPath()");
|
||||||
|
@ -439,7 +448,7 @@ public:
|
||||||
{
|
{
|
||||||
const HECL::ProjectPath& pakPath = m_bridgePaths[m_curBridgeIdx].second;
|
const HECL::ProjectPath& pakPath = m_bridgePaths[m_curBridgeIdx].second;
|
||||||
pakPath.makeDir();
|
pakPath.makeDir();
|
||||||
return HECL::ProjectPath(pakPath, m_pak->bestEntryName(*entry));
|
return HECL::ProjectPath(pakPath, getBestEntryName(*entry));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
auto uniqueSearch = m_uniqueEntries.find(entry->id);
|
auto uniqueSearch = m_uniqueEntries.find(entry->id);
|
||||||
|
@ -448,13 +457,13 @@ public:
|
||||||
const HECL::ProjectPath& pakPath = m_bridgePaths[uniqueSearch->second.first].second;
|
const HECL::ProjectPath& pakPath = m_bridgePaths[uniqueSearch->second.first].second;
|
||||||
pakPath.makeDir();
|
pakPath.makeDir();
|
||||||
HECL::ProjectPath uniquePath = entry->unique.uniquePath(pakPath);
|
HECL::ProjectPath uniquePath = entry->unique.uniquePath(pakPath);
|
||||||
return HECL::ProjectPath(uniquePath, m_pak->bestEntryName(*entry));
|
return HECL::ProjectPath(uniquePath, getBestEntryName(*entry));
|
||||||
}
|
}
|
||||||
auto sharedSearch = m_sharedEntries.find(entry->id);
|
auto sharedSearch = m_sharedEntries.find(entry->id);
|
||||||
if (sharedSearch != m_sharedEntries.end())
|
if (sharedSearch != m_sharedEntries.end())
|
||||||
{
|
{
|
||||||
m_sharedCooked.makeDir();
|
m_sharedCooked.makeDir();
|
||||||
return HECL::ProjectPath(m_sharedCooked, m_pak->bestEntryName(*entry));
|
return HECL::ProjectPath(m_sharedCooked, getBestEntryName(*entry));
|
||||||
}
|
}
|
||||||
LogDNACommon.report(LogVisor::FatalError, "Unable to find entry %s", entry->id.toString().c_str());
|
LogDNACommon.report(LogVisor::FatalError, "Unable to find entry %s", entry->id.toString().c_str());
|
||||||
return HECL::ProjectPath();
|
return HECL::ProjectPath();
|
||||||
|
@ -484,21 +493,33 @@ public:
|
||||||
|
|
||||||
std::string getBestEntryName(const EntryType& entry) const
|
std::string getBestEntryName(const EntryType& entry) const
|
||||||
{
|
{
|
||||||
if (!m_pak)
|
std::string name;
|
||||||
LogDNACommon.report(LogVisor::FatalError,
|
for (const BRIDGETYPE& bridge : *m_bridges)
|
||||||
"PAKRouter::enterPAKBridge() must be called before PAKRouter::getBestEntryName()");
|
{
|
||||||
return m_pak->bestEntryName(entry);
|
const typename BRIDGETYPE::PAKType& pak = bridge.getPAK();
|
||||||
|
bool named;
|
||||||
|
name = pak.bestEntryName(entry, named);
|
||||||
|
if (named)
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string getBestEntryName(const IDType& entry) const
|
std::string getBestEntryName(const IDType& entry) const
|
||||||
{
|
{
|
||||||
if (!m_pak)
|
std::string name;
|
||||||
LogDNACommon.report(LogVisor::FatalError,
|
for (const BRIDGETYPE& bridge : *m_bridges)
|
||||||
"PAKRouter::enterPAKBridge() must be called before PAKRouter::getBestEntryName()");
|
{
|
||||||
const typename BRIDGETYPE::PAKType::Entry* e = m_pak->lookupEntry(entry);
|
const typename BRIDGETYPE::PAKType& pak = bridge.getPAK();
|
||||||
|
const typename BRIDGETYPE::PAKType::Entry* e = pak.lookupEntry(entry);
|
||||||
if (!e)
|
if (!e)
|
||||||
return entry.toString();
|
continue;
|
||||||
return m_pak->bestEntryName(*e);
|
bool named;
|
||||||
|
name = pak.bestEntryName(*e, named);
|
||||||
|
if (named)
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool extractResources(const BRIDGETYPE& pakBridge, bool force,
|
bool extractResources(const BRIDGETYPE& pakBridge, bool force,
|
||||||
|
|
|
@ -87,10 +87,11 @@ void PAKBridge::build()
|
||||||
PAKEntryReadStream rs = entry.beginReadStream(m_node);
|
PAKEntryReadStream rs = entry.beginReadStream(m_node);
|
||||||
mlvl.read(rs);
|
mlvl.read(rs);
|
||||||
}
|
}
|
||||||
|
bool named;
|
||||||
#if HECL_UCS2
|
#if HECL_UCS2
|
||||||
level.name = HECL::UTF8ToWide(m_pak.bestEntryName(entry));
|
level.name = HECL::UTF8ToWide(m_pak.bestEntryName(entry, named));
|
||||||
#else
|
#else
|
||||||
level.name = m_pak.bestEntryName(entry);
|
level.name = m_pak.bestEntryName(entry, named);
|
||||||
#endif
|
#endif
|
||||||
level.areas.reserve(mlvl.areaCount);
|
level.areas.reserve(mlvl.areaCount);
|
||||||
unsigned layerIdx = 0;
|
unsigned layerIdx = 0;
|
||||||
|
|
|
@ -39,7 +39,7 @@ struct MLVL : BigYAML
|
||||||
Value<atVec4f> transformMtx[3];
|
Value<atVec4f> transformMtx[3];
|
||||||
Value<atVec3f> aabb[2];
|
Value<atVec3f> aabb[2];
|
||||||
UniqueID32 areaMREAId;
|
UniqueID32 areaMREAId;
|
||||||
UniqueID32 areaId;
|
Value<atUint32> areaId;
|
||||||
|
|
||||||
Value<atUint32> attachedAreaCount;
|
Value<atUint32> attachedAreaCount;
|
||||||
Vector<atUint16, DNA_COUNT(attachedAreaCount)> attachedAreas;
|
Vector<atUint16, DNA_COUNT(attachedAreaCount)> attachedAreas;
|
||||||
|
|
|
@ -69,14 +69,18 @@ struct PAK : BigDNA
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string bestEntryName(const Entry& entry) const
|
std::string bestEntryName(const Entry& entry, bool& named) const
|
||||||
{
|
{
|
||||||
/* Prefer named entries first */
|
/* Prefer named entries first */
|
||||||
for (const NameEntry& nentry : m_nameEntries)
|
for (const NameEntry& nentry : m_nameEntries)
|
||||||
if (nentry.id == entry.id)
|
if (nentry.id == entry.id)
|
||||||
|
{
|
||||||
|
named = true;
|
||||||
return nentry.name;
|
return nentry.name;
|
||||||
|
}
|
||||||
|
|
||||||
/* Otherwise return ID format string */
|
/* Otherwise return ID format string */
|
||||||
|
named = false;
|
||||||
return entry.type.toString() + '_' + entry.id.toString();
|
return entry.type.toString() + '_' + entry.id.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@ struct SpecialFunction : IScriptObject
|
||||||
struct LayerSwitch : BigYAML
|
struct LayerSwitch : BigYAML
|
||||||
{
|
{
|
||||||
DECL_YAML
|
DECL_YAML
|
||||||
UniqueID32 area;
|
Value<atUint32> area;
|
||||||
Value<atUint32> layerIdx;
|
Value<atUint32> layerIdx;
|
||||||
} layerSwitch;
|
} layerSwitch;
|
||||||
Value<EPickupType> pickup;
|
Value<EPickupType> pickup;
|
||||||
|
|
|
@ -81,10 +81,11 @@ void PAKBridge::build()
|
||||||
PAKEntryReadStream rs = entry.beginReadStream(m_node);
|
PAKEntryReadStream rs = entry.beginReadStream(m_node);
|
||||||
mlvl.read(rs);
|
mlvl.read(rs);
|
||||||
}
|
}
|
||||||
|
bool named;
|
||||||
#if HECL_UCS2
|
#if HECL_UCS2
|
||||||
level.name = HECL::UTF8ToWide(m_pak.bestEntryName(entry));
|
level.name = HECL::UTF8ToWide(m_pak.bestEntryName(entry, named));
|
||||||
#else
|
#else
|
||||||
level.name = m_pak.bestEntryName(entry);
|
level.name = m_pak.bestEntryName(entry, named);
|
||||||
#endif
|
#endif
|
||||||
level.areas.reserve(mlvl.areaCount);
|
level.areas.reserve(mlvl.areaCount);
|
||||||
unsigned layerIdx = 0;
|
unsigned layerIdx = 0;
|
||||||
|
|
|
@ -29,7 +29,7 @@ struct MLVL : BigYAML
|
||||||
Value<atVec4f> transformMtx[3];
|
Value<atVec4f> transformMtx[3];
|
||||||
Value<atVec3f> aabb[2];
|
Value<atVec3f> aabb[2];
|
||||||
UniqueID32 areaMREAId;
|
UniqueID32 areaMREAId;
|
||||||
UniqueID32 areaId;
|
Value<atUint32> areaId;
|
||||||
|
|
||||||
Value<atUint32> attachedAreaCount;
|
Value<atUint32> attachedAreaCount;
|
||||||
Vector<atUint16, DNA_COUNT(attachedAreaCount)> attachedAreas;
|
Vector<atUint16, DNA_COUNT(attachedAreaCount)> attachedAreas;
|
||||||
|
|
|
@ -89,10 +89,11 @@ void PAKBridge::build()
|
||||||
PAKEntryReadStream rs = entry.beginReadStream(m_node);
|
PAKEntryReadStream rs = entry.beginReadStream(m_node);
|
||||||
mlvl.read(rs);
|
mlvl.read(rs);
|
||||||
}
|
}
|
||||||
|
bool named;
|
||||||
#if HECL_UCS2
|
#if HECL_UCS2
|
||||||
level.name = HECL::UTF8ToWide(m_pak.bestEntryName(entry));
|
level.name = HECL::UTF8ToWide(m_pak.bestEntryName(entry, named));
|
||||||
#else
|
#else
|
||||||
level.name = m_pak.bestEntryName(entry);
|
level.name = m_pak.bestEntryName(entry, named);
|
||||||
#endif
|
#endif
|
||||||
level.areas.reserve(mlvl.areaCount);
|
level.areas.reserve(mlvl.areaCount);
|
||||||
unsigned layerIdx = 0;
|
unsigned layerIdx = 0;
|
||||||
|
|
|
@ -28,7 +28,7 @@ struct MLVL : BigYAML
|
||||||
Value<atVec4f> transformMtx[3];
|
Value<atVec4f> transformMtx[3];
|
||||||
Value<atVec3f> aabb[2];
|
Value<atVec3f> aabb[2];
|
||||||
UniqueID64 areaMREAId;
|
UniqueID64 areaMREAId;
|
||||||
UniqueID64 areaId;
|
Value<atUint64> areaId;
|
||||||
|
|
||||||
Value<atUint32> attachedAreaCount;
|
Value<atUint32> attachedAreaCount;
|
||||||
Vector<atUint16, DNA_COUNT(attachedAreaCount)> attachedAreas;
|
Vector<atUint16, DNA_COUNT(attachedAreaCount)> attachedAreas;
|
||||||
|
|
|
@ -80,14 +80,18 @@ struct PAK : BigDNA
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline std::string bestEntryName(const Entry& entry) const
|
inline std::string bestEntryName(const Entry& entry, bool& named) const
|
||||||
{
|
{
|
||||||
/* Prefer named entries first */
|
/* Prefer named entries first */
|
||||||
for (const NameEntry& nentry : m_nameEntries)
|
for (const NameEntry& nentry : m_nameEntries)
|
||||||
if (nentry.id == entry.id)
|
if (nentry.id == entry.id)
|
||||||
|
{
|
||||||
|
named = true;
|
||||||
return nentry.name;
|
return nentry.name;
|
||||||
|
}
|
||||||
|
|
||||||
/* Otherwise return ID format string */
|
/* Otherwise return ID format string */
|
||||||
|
named = false;
|
||||||
return entry.type.toString() + '_' + entry.id.toString();
|
return entry.type.toString() + '_' + entry.id.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -219,6 +219,11 @@ struct SpecMP1 : SpecBase
|
||||||
{
|
{
|
||||||
NOD::ExtractionContext ctx = {true, force, nullptr};
|
NOD::ExtractionContext ctx = {true, force, nullptr};
|
||||||
|
|
||||||
|
m_workPath.makeDir();
|
||||||
|
const HECL::ProjectPath& cookPath = m_project.getProjectCookedPath(SpecEntMP1);
|
||||||
|
cookPath.makeDir();
|
||||||
|
m_cookPath.makeDir();
|
||||||
|
|
||||||
progress(_S("Indexing PAKs"), _S(""), 2, 0.0);
|
progress(_S("Indexing PAKs"), _S(""), 2, 0.0);
|
||||||
m_pakRouter.build(m_paks, [&progress](float factor)
|
m_pakRouter.build(m_paks, [&progress](float factor)
|
||||||
{
|
{
|
||||||
|
@ -226,7 +231,6 @@ struct SpecMP1 : SpecBase
|
||||||
});
|
});
|
||||||
progress(_S("Indexing PAKs"), _S(""), 2, 1.0);
|
progress(_S("Indexing PAKs"), _S(""), 2, 1.0);
|
||||||
|
|
||||||
m_workPath.makeDir();
|
|
||||||
HECL::ProjectPath outPath(m_project.getProjectWorkingPath(), _S("out"));
|
HECL::ProjectPath outPath(m_project.getProjectWorkingPath(), _S("out"));
|
||||||
outPath.makeDir();
|
outPath.makeDir();
|
||||||
HECL::ProjectPath mp1OutPath(outPath, _S("MP1"));
|
HECL::ProjectPath mp1OutPath(outPath, _S("MP1"));
|
||||||
|
@ -244,10 +248,6 @@ struct SpecMP1 : SpecBase
|
||||||
}
|
}
|
||||||
progress(_S("MP1 Root"), _S(""), 3, 1.0);
|
progress(_S("MP1 Root"), _S(""), 3, 1.0);
|
||||||
|
|
||||||
const HECL::ProjectPath& cookPath = m_project.getProjectCookedPath(SpecEntMP1);
|
|
||||||
cookPath.makeDir();
|
|
||||||
m_cookPath.makeDir();
|
|
||||||
|
|
||||||
int compIdx = 4;
|
int compIdx = 4;
|
||||||
prog = 0;
|
prog = 0;
|
||||||
for (std::pair<std::string, DNAMP1::PAKBridge*> pair : m_orderedPaks)
|
for (std::pair<std::string, DNAMP1::PAKBridge*> pair : m_orderedPaks)
|
||||||
|
|
|
@ -209,6 +209,11 @@ struct SpecMP2 : SpecBase
|
||||||
{
|
{
|
||||||
NOD::ExtractionContext ctx = {true, force, nullptr};
|
NOD::ExtractionContext ctx = {true, force, nullptr};
|
||||||
|
|
||||||
|
m_workPath.makeDir();
|
||||||
|
const HECL::ProjectPath& cookPath = m_project.getProjectCookedPath(SpecEntMP2);
|
||||||
|
cookPath.makeDir();
|
||||||
|
m_cookPath.makeDir();
|
||||||
|
|
||||||
progress(_S("Indexing PAKs"), _S(""), 2, 0.0);
|
progress(_S("Indexing PAKs"), _S(""), 2, 0.0);
|
||||||
m_pakRouter.build(m_paks, [&progress](float factor)
|
m_pakRouter.build(m_paks, [&progress](float factor)
|
||||||
{
|
{
|
||||||
|
@ -216,7 +221,6 @@ struct SpecMP2 : SpecBase
|
||||||
});
|
});
|
||||||
progress(_S("Indexing PAKs"), _S(""), 2, 1.0);
|
progress(_S("Indexing PAKs"), _S(""), 2, 1.0);
|
||||||
|
|
||||||
m_workPath.makeDir();
|
|
||||||
HECL::ProjectPath outPath(m_project.getProjectWorkingPath(), _S("out"));
|
HECL::ProjectPath outPath(m_project.getProjectWorkingPath(), _S("out"));
|
||||||
outPath.makeDir();
|
outPath.makeDir();
|
||||||
HECL::ProjectPath mp2OutPath(outPath, _S("MP2"));
|
HECL::ProjectPath mp2OutPath(outPath, _S("MP2"));
|
||||||
|
@ -234,10 +238,6 @@ struct SpecMP2 : SpecBase
|
||||||
}
|
}
|
||||||
progress(_S("MP2 Root"), _S(""), 3, 1.0);
|
progress(_S("MP2 Root"), _S(""), 3, 1.0);
|
||||||
|
|
||||||
const HECL::ProjectPath& cookPath = m_project.getProjectCookedPath(SpecEntMP2);
|
|
||||||
cookPath.makeDir();
|
|
||||||
m_cookPath.makeDir();
|
|
||||||
|
|
||||||
int compIdx = 4;
|
int compIdx = 4;
|
||||||
prog = 0;
|
prog = 0;
|
||||||
for (std::pair<std::string, DNAMP2::PAKBridge*> pair : m_orderedPaks)
|
for (std::pair<std::string, DNAMP2::PAKBridge*> pair : m_orderedPaks)
|
||||||
|
|
|
@ -339,6 +339,11 @@ struct SpecMP3 : SpecBase
|
||||||
}};
|
}};
|
||||||
if (doMP3)
|
if (doMP3)
|
||||||
{
|
{
|
||||||
|
m_workPath.makeDir();
|
||||||
|
const HECL::ProjectPath& cookPath = m_project.getProjectCookedPath(SpecEntMP3);
|
||||||
|
cookPath.makeDir();
|
||||||
|
m_cookPath.makeDir();
|
||||||
|
|
||||||
progress(_S("Indexing PAKs"), _S(""), compIdx, 0.0);
|
progress(_S("Indexing PAKs"), _S(""), compIdx, 0.0);
|
||||||
m_pakRouter.build(m_paks, [&progress, &compIdx](float factor)
|
m_pakRouter.build(m_paks, [&progress, &compIdx](float factor)
|
||||||
{
|
{
|
||||||
|
@ -346,8 +351,6 @@ struct SpecMP3 : SpecBase
|
||||||
});
|
});
|
||||||
progress(_S("Indexing PAKs"), _S(""), compIdx++, 1.0);
|
progress(_S("Indexing PAKs"), _S(""), compIdx++, 1.0);
|
||||||
|
|
||||||
HECL::ProjectPath mp3WorkPath(m_project.getProjectWorkingPath(), _S("MP3"));
|
|
||||||
mp3WorkPath.makeDir();
|
|
||||||
HECL::ProjectPath outPath(m_project.getProjectWorkingPath(), _S("out"));
|
HECL::ProjectPath outPath(m_project.getProjectWorkingPath(), _S("out"));
|
||||||
outPath.makeDir();
|
outPath.makeDir();
|
||||||
HECL::ProjectPath mp3OutPath(outPath, _S("MP3"));
|
HECL::ProjectPath mp3OutPath(outPath, _S("MP3"));
|
||||||
|
@ -367,11 +370,6 @@ struct SpecMP3 : SpecBase
|
||||||
|
|
||||||
progress(currentTarget.c_str(), _S(""), compIdx++, 1.0);
|
progress(currentTarget.c_str(), _S(""), compIdx++, 1.0);
|
||||||
|
|
||||||
const HECL::ProjectPath& cookPath = m_project.getProjectCookedPath(SpecEntMP3);
|
|
||||||
cookPath.makeDir();
|
|
||||||
HECL::ProjectPath mp3CookPath(cookPath, "MP3");
|
|
||||||
mp3CookPath.makeDir();
|
|
||||||
|
|
||||||
prog = 0;
|
prog = 0;
|
||||||
for (std::pair<std::string, DNAMP3::PAKBridge*> pair : m_orderedPaks)
|
for (std::pair<std::string, DNAMP3::PAKBridge*> pair : m_orderedPaks)
|
||||||
{
|
{
|
||||||
|
@ -394,6 +392,11 @@ struct SpecMP3 : SpecBase
|
||||||
|
|
||||||
if (doMPTFE)
|
if (doMPTFE)
|
||||||
{
|
{
|
||||||
|
m_feWorkPath.makeDir();
|
||||||
|
const HECL::ProjectPath& cookPath = m_project.getProjectCookedPath(SpecEntMP3);
|
||||||
|
cookPath.makeDir();
|
||||||
|
m_feCookPath.makeDir();
|
||||||
|
|
||||||
progress(_S("Indexing PAKs"), _S(""), compIdx, 0.0);
|
progress(_S("Indexing PAKs"), _S(""), compIdx, 0.0);
|
||||||
m_fePakRouter.build(m_fePaks, [&progress, &compIdx](float factor)
|
m_fePakRouter.build(m_fePaks, [&progress, &compIdx](float factor)
|
||||||
{
|
{
|
||||||
|
@ -401,7 +404,6 @@ struct SpecMP3 : SpecBase
|
||||||
});
|
});
|
||||||
progress(_S("Indexing PAKs"), _S(""), compIdx++, 1.0);
|
progress(_S("Indexing PAKs"), _S(""), compIdx++, 1.0);
|
||||||
|
|
||||||
m_feWorkPath.makeDir();
|
|
||||||
HECL::ProjectPath outPath(m_project.getProjectWorkingPath(), _S("out"));
|
HECL::ProjectPath outPath(m_project.getProjectWorkingPath(), _S("out"));
|
||||||
outPath.makeDir();
|
outPath.makeDir();
|
||||||
HECL::ProjectPath feOutPath(outPath, _S("fe"));
|
HECL::ProjectPath feOutPath(outPath, _S("fe"));
|
||||||
|
@ -419,10 +421,6 @@ struct SpecMP3 : SpecBase
|
||||||
}
|
}
|
||||||
progress(currentTarget.c_str(), _S(""), compIdx++, 1.0);
|
progress(currentTarget.c_str(), _S(""), compIdx++, 1.0);
|
||||||
|
|
||||||
const HECL::ProjectPath& cookPath = m_project.getProjectCookedPath(SpecEntMP3);
|
|
||||||
cookPath.makeDir();
|
|
||||||
m_feCookPath.makeDir();
|
|
||||||
|
|
||||||
prog = 0;
|
prog = 0;
|
||||||
for (std::pair<std::string, DNAMP3::PAKBridge*> pair : m_feOrderedPaks)
|
for (std::pair<std::string, DNAMP3::PAKBridge*> pair : m_feOrderedPaks)
|
||||||
{
|
{
|
||||||
|
|
2
hecl
2
hecl
|
@ -1 +1 @@
|
||||||
Subproject commit f33c1774196a2648599b57dd3638b415dc6c77e5
|
Subproject commit 448e1953e1ac457aa2ab21aef3030a04aca1e53e
|
Loading…
Reference in New Issue