Keep original paths for areas, worlds, and maps when not in a world pak

This commit is contained in:
Phillip Stephens 2016-03-10 18:56:16 -08:00
parent 9726682939
commit 95062eceb4
6 changed files with 40 additions and 10 deletions

View File

@ -92,8 +92,14 @@ bool ReadMAPAToBlender(hecl::BlenderConnection& conn,
const typename PAKRouter::EntryType& entry,
bool force)
{
/* Rename MAPA for consistency */
hecl::ProjectPath mapaPath(outPath.getParentPath(), _S("!map.blend"));
hecl::ProjectPath mapaPath;
if (pakRouter.isShared())
/* Rename MAPA for consistency */
mapaPath = hecl::ProjectPath(outPath.getParentPath(), _S("!map.blend"));
else
/* We're not in a world pak, so lets keep the original name */
mapaPath = outPath;
if (!force && mapaPath.getPathType() == hecl::ProjectPath::Type::File)
return true;

View File

@ -17,8 +17,13 @@ bool ReadMLVLToBlender(hecl::BlenderConnection& conn,
bool force,
std::function<void(const hecl::SystemChar*)> fileChanged)
{
/* Rename MLVL for consistency */
hecl::ProjectPath mlvlPath(outPath.getParentPath(), _S("!world.blend"));
hecl::ProjectPath mlvlPath;
if (pakRouter.isShared())
/* Rename MLVL for consistency */
mlvlPath = hecl::ProjectPath(outPath.getParentPath(), _S("!world.blend"));
else
/* We're not in a world pak, so lets keep the original name */
mlvlPath = outPath;
if (!force && mlvlPath.getPathType() == hecl::ProjectPath::Type::File)
return true;

View File

@ -147,6 +147,7 @@ public:
hecl::ProjectPath getWorking(const IDType& id) const;
hecl::ProjectPath getCooked(const EntryType* entry) const;
hecl::ProjectPath getCooked(const IDType& id) const;
bool isShared() { return m_pak ? !m_pak->m_noShare : false; }
hecl::SystemString getResourceRelativePath(const EntryType& a, const IDType& b) const;

View File

@ -62,8 +62,14 @@ bool MREA::Extract(const SpecBase& dataSpec,
using RigPair = std::pair<CSKR*, CINF*>;
RigPair dummy(nullptr, nullptr);
/* Rename MREA for consistency */
hecl::ProjectPath mreaPath(outPath.getParentPath(), _S("!area.blend"));
hecl::ProjectPath mreaPath;
if (pakRouter.isShared())
/* Rename MREA for consistency */
mreaPath = hecl::ProjectPath(outPath.getParentPath(), _S("!area.blend"));
else
/* We're not in a world pak, so lets keep the original name */
mreaPath = outPath;
if (!force && mreaPath.getPathType() == hecl::ProjectPath::Type::File)
return true;

View File

@ -168,8 +168,14 @@ bool MREA::Extract(const SpecBase& dataSpec,
using RigPair = std::pair<CSKR*, CINF*>;
RigPair dummy(nullptr, nullptr);
/* Rename MREA for consistency */
hecl::ProjectPath mreaPath(outPath.getParentPath(), _S("!area.blend"));
hecl::ProjectPath mreaPath;
if (pakRouter.isShared())
/* Rename MREA for consistency */
mreaPath = hecl::ProjectPath(outPath.getParentPath(), _S("!area.blend"));
else
/* We're not in a world pak, so lets keep the original name */
mreaPath = outPath;
if (!force && mreaPath.getPathType() == hecl::ProjectPath::Type::File)
return true;

View File

@ -77,8 +77,14 @@ bool MREA::Extract(const SpecBase& dataSpec,
using RigPair = std::pair<CSKR*, CINF*>;
RigPair dummy(nullptr, nullptr);
/* Rename MREA for consistency */
hecl::ProjectPath mreaPath(outPath.getParentPath(), _S("!area.blend"));
hecl::ProjectPath mreaPath;
if (pakRouter.isShared())
/* Rename MREA for consistency */
mreaPath = hecl::ProjectPath(outPath.getParentPath(), _S("!area.blend"));
else
/* We're not in a world pak, so lets keep the original name */
mreaPath = outPath;
if (!force && mreaPath.getPathType() == hecl::ProjectPath::Type::File)
return true;