2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-16 14:17:02 +00:00

Additional extract directory tier for level names

This commit is contained in:
Jack Andersen
2015-09-23 12:59:12 -10:00
parent b1f55c2733
commit 2893eb7e76
9 changed files with 253 additions and 105 deletions

View File

@@ -55,31 +55,44 @@ struct UniqueResult
enum Type
{
UNIQUE_NOTFOUND,
UNIQUE_PAK,
UNIQUE_LEVEL,
UNIQUE_AREA,
UNIQUE_LAYER
} type = UNIQUE_NOTFOUND;
const HECL::SystemString* levelName = nullptr;
const HECL::SystemString* areaName = nullptr;
const HECL::SystemString* layerName = nullptr;
UniqueResult() = default;
UniqueResult(Type tp) : type(tp) {}
HECL::ProjectPath uniquePath(const HECL::ProjectPath& pakPath) const
{
if (type == UNIQUE_PAK)
return pakPath;
HECL::ProjectPath levelDir;
if (levelName)
levelDir.assign(pakPath, *levelName);
else
levelDir = pakPath;
levelDir.makeDir();
if (type == UNIQUE_AREA)
{
HECL::ProjectPath areaDir(pakPath, *areaName);
HECL::ProjectPath areaDir(levelDir, *areaName);
areaDir.makeDir();
return areaDir;
}
else if (type == UNIQUE_LAYER)
{
HECL::ProjectPath areaDir(pakPath, *areaName);
HECL::ProjectPath areaDir(levelDir, *areaName);
areaDir.makeDir();
HECL::ProjectPath layerDir(areaDir, *layerName);
layerDir.makeDir();
return layerDir;
}
return pakPath;
return levelDir;
}
};