proper handling of unnamed MREAs

This commit is contained in:
Jack Andersen 2015-08-03 16:46:48 -10:00
parent 6e58666a80
commit 73185fc32c
3 changed files with 20 additions and 1 deletions

View File

@ -332,11 +332,12 @@ 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())
{ {
HECL::ProjectPath uniquePathPre = entry->unique.uniquePath(m_pakWorking);
HECL::SystemString entName = m_pak->bestEntryName(*entry); HECL::SystemString entName = m_pak->bestEntryName(*entry);
if (extractor.fileExt) if (extractor.fileExt)
entName += extractor.fileExt; entName += extractor.fileExt;
HECL::ProjectPath sharedPath(m_sharedWorking, entName); HECL::ProjectPath sharedPath(m_sharedWorking, entName);
HECL::ProjectPath uniquePath(m_pakWorking, entName); HECL::ProjectPath uniquePath(uniquePathPre, entName);
if (extractor.func_a || extractor.func_b) if (extractor.func_a || extractor.func_b)
uniquePath.makeLinkTo(sharedPath); uniquePath.makeLinkTo(sharedPath);
m_sharedWorking.makeDir(); m_sharedWorking.makeDir();

View File

@ -136,6 +136,14 @@ void PAKBridge::build()
areaName.read(rs); areaName.read(rs);
areaDeps.name = areaName.getSystemString(Retro::ENGL, 0); areaDeps.name = areaName.getSystemString(Retro::ENGL, 0);
} }
if (areaDeps.name.empty())
{
#if HECL_UCS2
areaDeps.name = _S("MREA_") + HECL::UTF8ToWide(area.areaMREAId.toString());
#else
areaDeps.name = "MREA_" + area.areaMREAId.toString();
#endif
}
areaDeps.layers.reserve(area.depLayerCount-1); areaDeps.layers.reserve(area.depLayerCount-1);
unsigned r=0; unsigned r=0;
@ -151,6 +159,7 @@ void PAKBridge::build()
areaDeps.resources.reserve(area.depCount - r); areaDeps.resources.reserve(area.depCount - r);
for (; r<area.depCount ; ++r) for (; r<area.depCount ; ++r)
areaDeps.resources.emplace(area.deps[r].id); areaDeps.resources.emplace(area.deps[r].id);
areaDeps.resources.emplace(area.areaMREAId);
} }
} }
} }

View File

@ -134,6 +134,14 @@ void PAKBridge::build()
areaName.read(rs); areaName.read(rs);
areaDeps.name = areaName.getSystemString(Retro::ENGL, 0); areaDeps.name = areaName.getSystemString(Retro::ENGL, 0);
} }
if (areaDeps.name.empty())
{
#if HECL_UCS2
areaDeps.name = _S("MREA_") + HECL::UTF8ToWide(area.areaMREAId.toString());
#else
areaDeps.name = "MREA_" + area.areaMREAId.toString();
#endif
}
areaDeps.layers.reserve(area.depLayerCount-1); areaDeps.layers.reserve(area.depLayerCount-1);
unsigned r=0; unsigned r=0;
@ -149,6 +157,7 @@ void PAKBridge::build()
areaDeps.resources.reserve(area.depCount - r); areaDeps.resources.reserve(area.depCount - r);
for (; r<area.depCount ; ++r) for (; r<area.depCount ; ++r)
areaDeps.resources.emplace(area.deps[r].id); areaDeps.resources.emplace(area.deps[r].id);
areaDeps.resources.emplace(area.areaMREAId);
} }
} }
} }