From 73185fc32cfa438b54c9336ed4627135c1011d9d Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Mon, 3 Aug 2015 16:46:48 -1000 Subject: [PATCH] proper handling of unnamed MREAs --- DataSpec/DNACommon/DNACommon.hpp | 3 ++- DataSpec/DNAMP1/DNAMP1.cpp | 9 +++++++++ DataSpec/DNAMP2/DNAMP2.cpp | 9 +++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/DataSpec/DNACommon/DNACommon.hpp b/DataSpec/DNACommon/DNACommon.hpp index a921879da..a98111ebc 100644 --- a/DataSpec/DNACommon/DNACommon.hpp +++ b/DataSpec/DNACommon/DNACommon.hpp @@ -332,11 +332,12 @@ public: auto sharedSearch = m_sharedEntries.find(entry->id); if (sharedSearch != m_sharedEntries.end()) { + HECL::ProjectPath uniquePathPre = entry->unique.uniquePath(m_pakWorking); HECL::SystemString entName = m_pak->bestEntryName(*entry); if (extractor.fileExt) entName += extractor.fileExt; HECL::ProjectPath sharedPath(m_sharedWorking, entName); - HECL::ProjectPath uniquePath(m_pakWorking, entName); + HECL::ProjectPath uniquePath(uniquePathPre, entName); if (extractor.func_a || extractor.func_b) uniquePath.makeLinkTo(sharedPath); m_sharedWorking.makeDir(); diff --git a/DataSpec/DNAMP1/DNAMP1.cpp b/DataSpec/DNAMP1/DNAMP1.cpp index 509884452..094bd1e00 100644 --- a/DataSpec/DNAMP1/DNAMP1.cpp +++ b/DataSpec/DNAMP1/DNAMP1.cpp @@ -136,6 +136,14 @@ void PAKBridge::build() areaName.read(rs); 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); unsigned r=0; @@ -151,6 +159,7 @@ void PAKBridge::build() areaDeps.resources.reserve(area.depCount - r); for (; r