mirror of https://github.com/AxioDL/metaforce.git
Merge branch 'master' of https://github.com/AxioDL/PathShagged
This commit is contained in:
commit
6c78f91fa7
|
@ -219,12 +219,12 @@ ResExtractor<PAKBridge> PAKBridge::LookupExtractor(const DNAMP1::PAK::Entry& ent
|
||||||
return {nullptr, CMDL::Extract, {_S(".blend")}, 1};
|
return {nullptr, CMDL::Extract, {_S(".blend")}, 1};
|
||||||
case SBIG('ANCS'):
|
case SBIG('ANCS'):
|
||||||
return {nullptr, ANCS::Extract, {_S(".yaml"), _S(".blend")}, 2};
|
return {nullptr, ANCS::Extract, {_S(".yaml"), _S(".blend")}, 2};
|
||||||
case SBIG('MREA'):
|
|
||||||
return {nullptr, MREA::Extract, {_S(".blend")}, 3};
|
|
||||||
case SBIG('MLVL'):
|
case SBIG('MLVL'):
|
||||||
return {MLVL::Extract, nullptr, {_S(".yaml")}};
|
return {nullptr, MLVL::Extract, {_S(".blend")}, 3};
|
||||||
// case SBIG('MAPA'):
|
case SBIG('MREA'):
|
||||||
// return {nullptr, MAPA::Extract, {_S(".blend")}, 4};
|
return {nullptr, MREA::Extract, {_S(".blend")}, 4};
|
||||||
|
case SBIG('MAPA'):
|
||||||
|
return {nullptr, MAPA::Extract, {_S(".blend")}, 4};
|
||||||
}
|
}
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,14 +1,30 @@
|
||||||
#ifndef __DNAMP2_MAPA_HPP__
|
#ifndef __DNAMP2_MAPA_HPP__
|
||||||
#define __DNAMP2_MAPA_HPP__
|
#define __DNAMP2_MAPA_HPP__
|
||||||
|
|
||||||
|
#include "../DNACommon/PAK.hpp"
|
||||||
#include "../DNAMP1/MAPA.hpp"
|
#include "../DNAMP1/MAPA.hpp"
|
||||||
|
#include "DNAMP2.hpp"
|
||||||
|
|
||||||
namespace Retro
|
namespace Retro
|
||||||
{
|
{
|
||||||
namespace DNAMP2
|
namespace DNAMP2
|
||||||
{
|
{
|
||||||
struct MAPA : DNAMP1::MAPA
|
struct MAPA : DNAMP1::MAPA
|
||||||
{};
|
{
|
||||||
|
static bool Extract(const SpecBase& dataSpec,
|
||||||
|
PAKEntryReadStream& rs,
|
||||||
|
const HECL::ProjectPath& outPath,
|
||||||
|
PAKRouter<PAKBridge>& pakRouter,
|
||||||
|
const DNAMP1::PAK::Entry& entry,
|
||||||
|
bool force,
|
||||||
|
std::function<void(const HECL::SystemChar*)> fileChanged)
|
||||||
|
{
|
||||||
|
MAPA mapa;
|
||||||
|
mapa.read(rs);
|
||||||
|
HECL::BlenderConnection& conn = HECL::BlenderConnection::SharedConnection();
|
||||||
|
return DNAMAPA::ReadMAPAToBlender(conn, mapa, outPath, pakRouter, entry, force);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
#define __DNAMP2_MLVL_HPP__
|
#define __DNAMP2_MLVL_HPP__
|
||||||
|
|
||||||
#include "../DNACommon/PAK.hpp"
|
#include "../DNACommon/PAK.hpp"
|
||||||
|
#include "../DNACommon/MLVL.hpp"
|
||||||
|
#include "DNAMP2.hpp"
|
||||||
|
|
||||||
namespace Retro
|
namespace Retro
|
||||||
{
|
{
|
||||||
|
@ -91,14 +93,23 @@ struct MLVL : BigYAML
|
||||||
Value<atUint32> layerNameOffsetCount;
|
Value<atUint32> layerNameOffsetCount;
|
||||||
Vector<atUint32, DNA_COUNT(layerNameOffsetCount)> layerNameOffsets;
|
Vector<atUint32, DNA_COUNT(layerNameOffsetCount)> layerNameOffsets;
|
||||||
|
|
||||||
static bool Extract(PAKEntryReadStream& rs, const HECL::ProjectPath& outPath)
|
|
||||||
|
static bool Extract(const SpecBase& dataSpec,
|
||||||
|
PAKEntryReadStream& rs,
|
||||||
|
const HECL::ProjectPath& outPath,
|
||||||
|
PAKRouter<PAKBridge>& pakRouter,
|
||||||
|
const DNAMP1::PAK::Entry& entry,
|
||||||
|
bool force,
|
||||||
|
std::function<void(const HECL::SystemChar*)> fileChanged)
|
||||||
{
|
{
|
||||||
MLVL mlvl;
|
MLVL mlvl;
|
||||||
mlvl.read(rs);
|
mlvl.read(rs);
|
||||||
FILE* fp = HECL::Fopen(outPath.getAbsolutePath().c_str(), _S("wb"));
|
FILE* fp = HECL::Fopen(outPath.getAbsolutePath().c_str(), _S("wb"));
|
||||||
mlvl.toYAMLFile(fp);
|
mlvl.toYAMLFile(fp);
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
return true;
|
HECL::BlenderConnection& conn = HECL::BlenderConnection::SharedConnection();
|
||||||
|
return DNAMLVL::ReadMLVLToBlender(conn, mlvl, outPath, pakRouter,
|
||||||
|
entry, force, fileChanged);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -154,24 +154,24 @@ void PAKBridge::build()
|
||||||
HECL::SNPrintf(num, 16, _S("%02u "), ai);
|
HECL::SNPrintf(num, 16, _S("%02u "), ai);
|
||||||
areaDeps.name = num + areaDeps.name;
|
areaDeps.name = num + areaDeps.name;
|
||||||
|
|
||||||
const MLVL::LayerFlags& areaLayers = *layerFlagsIt++;
|
const MLVL::LayerFlags& layerFlags = *layerFlagsIt++;
|
||||||
if (areaLayers.layerCount)
|
if (layerFlags.layerCount)
|
||||||
{
|
{
|
||||||
areaDeps.layers.reserve(areaLayers.layerCount);
|
areaDeps.layers.reserve(layerFlags.layerCount);
|
||||||
for (unsigned l=0 ; l<areaLayers.layerCount ; ++l)
|
for (unsigned l=1 ; l<layerFlags.layerCount ; ++l)
|
||||||
{
|
{
|
||||||
areaDeps.layers.emplace_back();
|
areaDeps.layers.emplace_back();
|
||||||
Level::Area::Layer& layer = areaDeps.layers.back();
|
Level::Area::Layer& layer = areaDeps.layers.back();
|
||||||
layer.name = LayerName(mlvl.layerNames[layerIdx++]);
|
layer.name = LayerName(mlvl.layerNames[layerIdx++]);
|
||||||
layer.active = areaLayers.flags >> l & 0x1;
|
layer.active = layerFlags.flags >> (l-1) & 0x1;
|
||||||
/* Trim possible trailing whitespace */
|
/* Trim possible trailing whitespace */
|
||||||
#if HECL_UCS2
|
#if HECL_UCS2
|
||||||
while (layer.name.size() && iswspace(layer.name.back()))
|
while (layer.name.size() && iswspace(layer.name.back()))
|
||||||
layer.name.pop_back();
|
layer.name.pop_back();
|
||||||
#else
|
#else
|
||||||
while (layer.name.size() && isspace(layer.name.back()))
|
while (layer.name.size() && isspace(layer.name.back()))
|
||||||
layer.name.pop_back();
|
layer.name.pop_back();
|
||||||
#endif
|
#endif
|
||||||
HECL::SNPrintf(num, 16, layer.active ? _S("%02ua ") : _S("%02u "), l-1);
|
HECL::SNPrintf(num, 16, layer.active ? _S("%02ua ") : _S("%02u "), l-1);
|
||||||
layer.name = num + layer.name;
|
layer.name = num + layer.name;
|
||||||
}
|
}
|
||||||
|
@ -229,10 +229,10 @@ ResExtractor<PAKBridge> PAKBridge::LookupExtractor(const PAK::Entry& entry)
|
||||||
return {nullptr, CMDL::Extract, {_S(".blend")}, 1};
|
return {nullptr, CMDL::Extract, {_S(".blend")}, 1};
|
||||||
case SBIG('CHAR'):
|
case SBIG('CHAR'):
|
||||||
return {nullptr, CHAR::Extract, {_S(".yaml"), _S(".blend")}, 2};
|
return {nullptr, CHAR::Extract, {_S(".yaml"), _S(".blend")}, 2};
|
||||||
case SBIG('MREA'):
|
|
||||||
return {nullptr, MREA::Extract, {_S(".blend")}, 3};
|
|
||||||
case SBIG('MLVL'):
|
case SBIG('MLVL'):
|
||||||
return {MLVL::Extract, nullptr, {_S(".yaml")}};
|
return {nullptr, MLVL::Extract, {_S(".blend")}, 3};
|
||||||
|
case SBIG('MREA'):
|
||||||
|
return {nullptr, MREA::Extract, {_S(".blend")}, 4};
|
||||||
}
|
}
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
#define __DNAMP3_MLVL_HPP__
|
#define __DNAMP3_MLVL_HPP__
|
||||||
|
|
||||||
#include "../DNACommon/PAK.hpp"
|
#include "../DNACommon/PAK.hpp"
|
||||||
|
#include "../DNACommon/MLVL.hpp"
|
||||||
|
#include "DNAMP3.hpp"
|
||||||
|
|
||||||
namespace Retro
|
namespace Retro
|
||||||
{
|
{
|
||||||
|
@ -75,14 +77,23 @@ struct MLVL : BigYAML
|
||||||
Value<atUint32> layerNameOffsetCount;
|
Value<atUint32> layerNameOffsetCount;
|
||||||
Vector<atUint32, DNA_COUNT(layerNameOffsetCount)> layerNameOffsets;
|
Vector<atUint32, DNA_COUNT(layerNameOffsetCount)> layerNameOffsets;
|
||||||
|
|
||||||
static bool Extract(PAKEntryReadStream& rs, const HECL::ProjectPath& outPath)
|
|
||||||
|
static bool Extract(const SpecBase& dataSpec,
|
||||||
|
PAKEntryReadStream& rs,
|
||||||
|
const HECL::ProjectPath& outPath,
|
||||||
|
PAKRouter<PAKBridge>& pakRouter,
|
||||||
|
const PAK::Entry& entry,
|
||||||
|
bool force,
|
||||||
|
std::function<void(const HECL::SystemChar*)> fileChanged)
|
||||||
{
|
{
|
||||||
MLVL mlvl;
|
MLVL mlvl;
|
||||||
mlvl.read(rs);
|
mlvl.read(rs);
|
||||||
FILE* fp = HECL::Fopen(outPath.getAbsolutePath().c_str(), _S("wb"));
|
FILE* fp = HECL::Fopen(outPath.getAbsolutePath().c_str(), _S("wb"));
|
||||||
mlvl.toYAMLFile(fp);
|
mlvl.toYAMLFile(fp);
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
return true;
|
HECL::BlenderConnection& conn = HECL::BlenderConnection::SharedConnection();
|
||||||
|
return DNAMLVL::ReadMLVLToBlender(conn, mlvl, outPath, pakRouter,
|
||||||
|
entry, force, fileChanged);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue