Shared extract only applies to world paks now

This commit is contained in:
Jack Andersen 2015-09-21 15:42:03 -10:00
parent bd3cf2b847
commit 45494ec9aa
6 changed files with 49 additions and 23 deletions

View File

@ -161,13 +161,16 @@ public:
if (sSearch != m_sharedEntries.end())
continue;
auto uSearch = m_uniqueEntries.find(entry.first);
if (!pak.m_noShare && uSearch != m_uniqueEntries.end())
if (!pak.m_noShare)
{
m_uniqueEntries.erase(uSearch);
m_sharedEntries[entry.first] = std::make_pair(bridgeIdx, entry.second);
if (uSearch != m_uniqueEntries.end())
{
m_uniqueEntries.erase(uSearch);
m_sharedEntries[entry.first] = std::make_pair(bridgeIdx, entry.second);
}
else
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 */
@ -255,6 +258,20 @@ public:
m_sharedWorking.makeDir();
return sharedPath;
}
const EntryType* singleSearch = m_pak->lookupEntry(entry->id);
if (singleSearch)
{
const HECL::ProjectPath& pakPath = m_bridgePaths[m_curBridgeIdx].first;
pakPath.makeDir();
#if HECL_UCS2
HECL::SystemString entName = HECL::UTF8ToWide(m_pak->bestEntryName(*entry));
#else
HECL::SystemString entName = m_pak->bestEntryName(*entry);
#endif
if (extractor.fileExts[0] && !extractor.fileExts[1])
entName += extractor.fileExts[0];
return HECL::ProjectPath(pakPath, entName);
}
LogDNACommon.report(LogVisor::FatalError, "Unable to find entry %s", entry->id.toString().c_str());
return HECL::ProjectPath();
}
@ -288,6 +305,13 @@ public:
m_sharedCooked.makeDir();
return HECL::ProjectPath(m_sharedCooked, m_pak->bestEntryName(*entry));
}
const EntryType* singleSearch = m_pak->lookupEntry(entry->id);
if (singleSearch)
{
const HECL::ProjectPath& pakPath = m_bridgePaths[m_curBridgeIdx].second;
pakPath.makeDir();
return HECL::ProjectPath(pakPath, m_pak->bestEntryName(*entry));
}
LogDNACommon.report(LogVisor::FatalError, "Unable to find entry %s", entry->id.toString().c_str());
return HECL::ProjectPath();
}

View File

@ -17,11 +17,11 @@ LogVisor::LogModule Log("Retro::DNAMP1");
static bool GetNoShare(const std::string& name)
{
if (!name.compare("RS5.pak"))
return true;
else if (!name.compare("Strings.pak"))
return true;
return false;
std::string lowerName = name;
std::transform(lowerName.begin(), lowerName.end(), lowerName.begin(), tolower);
if (!name.compare(0, 7, "metroid"))
return false;
return true;
}
PAKBridge::PAKBridge(HECL::Database::Project& project, const NOD::DiscBase::IPartition::Node& node)
@ -31,7 +31,7 @@ PAKBridge::PAKBridge(HECL::Database::Project& project, const NOD::DiscBase::IPar
m_pak.read(rs);
/* Append Level String */
for (const PAK::Entry& entry : m_pak.m_entries)
for (PAK::Entry& entry : m_pak.m_entries)
{
if (entry.type == FOURCC('MLVL'))
{

View File

@ -15,11 +15,11 @@ LogVisor::LogModule Log("Retro::DNAMP2");
static bool GetNoShare(const std::string& name)
{
if (!name.compare("RS5.PAK"))
return true;
else if (!name.compare("Strings.pak"))
return true;
return false;
std::string lowerName = name;
std::transform(lowerName.begin(), lowerName.end(), lowerName.begin(), tolower);
if (!name.compare(0, 7, "metroid"))
return false;
return true;
}
PAKBridge::PAKBridge(HECL::Database::Project& project, const NOD::DiscBase::IPartition::Node& node)
@ -29,7 +29,7 @@ PAKBridge::PAKBridge(HECL::Database::Project& project, const NOD::DiscBase::IPar
m_pak.read(rs);
/* Append Level String */
for (const DNAMP1::PAK::Entry& entry : m_pak.m_entries)
for (DNAMP1::PAK::Entry& entry : m_pak.m_entries)
{
if (entry.type == FOURCC('MLVL'))
{

View File

@ -16,9 +16,11 @@ LogVisor::LogModule Log("Retro::DNAMP3");
static bool GetNoShare(const std::string& name)
{
if (!name.compare("RS5.PAK"))
return true;
return false;
std::string lowerName = name;
std::transform(lowerName.begin(), lowerName.end(), lowerName.begin(), tolower);
if (!name.compare(0, 7, "metroid"))
return false;
return true;
}
PAKBridge::PAKBridge(HECL::Database::Project& project, const NOD::DiscBase::IPartition::Node& node)
@ -29,7 +31,7 @@ PAKBridge::PAKBridge(HECL::Database::Project& project, const NOD::DiscBase::IPar
/* Append Level String */
std::set<HECL::SystemString, CaseInsensitiveCompare> uniq;
for (const PAK::Entry& entry : m_pak.m_entries)
for (PAK::Entry& entry : m_pak.m_entries)
{
if (entry.type == FOURCC('MLVL'))
{

View File

@ -16,6 +16,6 @@ target_link_libraries(mp1
DNAMP1
DNACommon
HECLDatabase HECLBlender HECLCommon AthenaCore NOD
LogVisor AthenaLibYaml Boo ${PNG_LIB} squish blowfish
LogVisor AthenaLibYaml Boo ${PNG_LIB} squish xxhash
${ZLIB_LIBRARIES} ${LZO_LIB}
${BOO_SYS_LIBS})

2
hecl

@ -1 +1 @@
Subproject commit 36809b88f9ccaee782e0a4d2a30bbb6f0f88c385
Subproject commit 22c61b63d0fa3e2bf7fb1793145bc970e7b81e86