mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-08 17:04:55 +00:00
Huge compile performance refactor
This commit is contained in:
@@ -1,15 +1,14 @@
|
||||
#include "ANIM.hpp"
|
||||
#include <cfloat>
|
||||
#include "zeus/Math.hpp"
|
||||
#include "hecl/Blender/Connection.hpp"
|
||||
|
||||
namespace DataSpec
|
||||
{
|
||||
namespace DNAMP3
|
||||
namespace DataSpec::DNAMP3
|
||||
{
|
||||
|
||||
using ANIMOutStream = hecl::BlenderConnection::PyOutStream::ANIMOutStream;
|
||||
using ANIMOutStream = hecl::blender::ANIMOutStream;
|
||||
|
||||
void ANIM::IANIM::sendANIMToBlender(hecl::BlenderConnection::PyOutStream& os,
|
||||
void ANIM::IANIM::sendANIMToBlender(hecl::blender::PyOutStream& os,
|
||||
const DNAANIM::RigInverter<CINF>& rig,
|
||||
bool additive) const
|
||||
{
|
||||
@@ -551,4 +550,3 @@ size_t ANIM::ANIM1::binarySize(size_t __isz) const
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,12 @@
|
||||
#ifndef _DNAMP3_ANIM_HPP_
|
||||
#define _DNAMP3_ANIM_HPP_
|
||||
|
||||
#include "hecl/Blender/BlenderConnection.hpp"
|
||||
#include "DNAMP3.hpp"
|
||||
#include "../DNACommon/ANIM.hpp"
|
||||
#include "../DNACommon/RigInverter.hpp"
|
||||
#include "CINF.hpp"
|
||||
|
||||
namespace DataSpec
|
||||
{
|
||||
namespace DNAMP3
|
||||
namespace DataSpec::DNAMP3
|
||||
{
|
||||
|
||||
struct ANIM : BigDNA
|
||||
@@ -29,7 +26,7 @@ struct ANIM : BigDNA
|
||||
float mainInterval = 0.0;
|
||||
bool looping = false;
|
||||
|
||||
void sendANIMToBlender(hecl::BlenderConnection::PyOutStream&,
|
||||
void sendANIMToBlender(hecl::blender::PyOutStream&,
|
||||
const DNAANIM::RigInverter<CINF>& rig,
|
||||
bool additive) const;
|
||||
};
|
||||
@@ -114,7 +111,7 @@ struct ANIM : BigDNA
|
||||
return m_anim->binarySize(__isz + 4);
|
||||
}
|
||||
|
||||
void sendANIMToBlender(hecl::BlenderConnection::PyOutStream& os,
|
||||
void sendANIMToBlender(hecl::blender::PyOutStream& os,
|
||||
const DNAANIM::RigInverter<CINF>& rig,
|
||||
bool additive) const
|
||||
{
|
||||
@@ -123,7 +120,6 @@ struct ANIM : BigDNA
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif // _DNAMP3_ANIM_HPP_
|
||||
|
||||
@@ -4,9 +4,7 @@
|
||||
#include "../DNACommon/DNACommon.hpp"
|
||||
#include "../DNACommon/PAK.hpp"
|
||||
|
||||
namespace DataSpec
|
||||
{
|
||||
namespace DNAMP3
|
||||
namespace DataSpec::DNAMP3
|
||||
{
|
||||
|
||||
struct CAUD : BigYAML
|
||||
@@ -205,6 +203,5 @@ struct CAUD : BigYAML
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // _DNAMP3_CAUD_HPP_
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
#include "CHAR.hpp"
|
||||
|
||||
namespace DataSpec
|
||||
{
|
||||
namespace DNAMP3
|
||||
namespace DataSpec::DNAMP3
|
||||
{
|
||||
|
||||
void CHAR::AnimationInfo::EVNT::SFXEvent::read(athena::io::IStreamReader& reader)
|
||||
@@ -173,4 +171,3 @@ const char* CHAR::AnimationInfo::MetaAnimFactory::DNAType()
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,15 +5,12 @@
|
||||
#include "../DNACommon/DNACommon.hpp"
|
||||
#include "../DNACommon/ANCS.hpp"
|
||||
#include "CMDLMaterials.hpp"
|
||||
#include "hecl/Blender/BlenderConnection.hpp"
|
||||
#include "CINF.hpp"
|
||||
#include "CSKR.hpp"
|
||||
#include "ANIM.hpp"
|
||||
#include "../DNAMP2/ANCS.hpp"
|
||||
|
||||
namespace DataSpec
|
||||
{
|
||||
namespace DNAMP3
|
||||
namespace DataSpec::DNAMP3
|
||||
{
|
||||
|
||||
struct CHAR : BigYAML
|
||||
@@ -312,7 +309,7 @@ struct CHAR : BigYAML
|
||||
PAKRouter<PAKBridge>& pakRouter,
|
||||
const PAK::Entry& entry,
|
||||
bool force,
|
||||
hecl::BlenderToken& btok,
|
||||
hecl::blender::Token& btok,
|
||||
std::function<void(const hecl::SystemChar*)> fileChanged)
|
||||
{
|
||||
hecl::ProjectPath yamlPath = outPath.getWithExtension(_S(".yaml"), true);
|
||||
@@ -335,7 +332,7 @@ struct CHAR : BigYAML
|
||||
|
||||
if (force || blendType == hecl::ProjectPath::Type::None)
|
||||
{
|
||||
hecl::BlenderConnection& conn = btok.getBlenderConnection();
|
||||
hecl::blender::Connection& conn = btok.getBlenderConnection();
|
||||
DNAANCS::ReadANCSToBlender<PAKRouter<PAKBridge>, CHAR, MaterialSet, DNACMDL::SurfaceHeader_3, 4>
|
||||
(conn, aChar, blendPath, pakRouter, entry, dataSpec, fileChanged, force);
|
||||
}
|
||||
@@ -345,7 +342,6 @@ struct CHAR : BigYAML
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif // _DNAMP3_CHAR_HPP_
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
#include "CINF.hpp"
|
||||
#include "hecl/Blender/Connection.hpp"
|
||||
|
||||
namespace DataSpec
|
||||
{
|
||||
namespace DNAMP3
|
||||
namespace DataSpec::DNAMP3
|
||||
{
|
||||
|
||||
void CINF::sendCINFToBlender(hecl::BlenderConnection::PyOutStream& os, const UniqueID64& cinfId) const
|
||||
void CINF::sendCINFToBlender(hecl::blender::PyOutStream& os, const UniqueID64& cinfId) const
|
||||
{
|
||||
DNAANIM::RigInverter<CINF> inverter(*this);
|
||||
|
||||
@@ -50,4 +49,3 @@ std::string CINF::GetCINFArmatureName(const UniqueID64& cinfId)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,23 +1,19 @@
|
||||
#ifndef _DNAMP3_CINF_HPP_
|
||||
#define _DNAMP3_CINF_HPP_
|
||||
|
||||
#include "hecl/Blender/BlenderConnection.hpp"
|
||||
#include "../DNACommon/DNACommon.hpp"
|
||||
#include "../DNAMP2/CINF.hpp"
|
||||
|
||||
namespace DataSpec
|
||||
{
|
||||
namespace DNAMP3
|
||||
namespace DataSpec::DNAMP3
|
||||
{
|
||||
|
||||
struct CINF : DNAMP2::CINF
|
||||
{
|
||||
Delete expl;
|
||||
void sendCINFToBlender(hecl::BlenderConnection::PyOutStream& os, const UniqueID64& cinfId) const;
|
||||
void sendCINFToBlender(hecl::blender::PyOutStream& os, const UniqueID64& cinfId) const;
|
||||
static std::string GetCINFArmatureName(const UniqueID64& cinfId);
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif // _DNAMP3_CINF_HPP_
|
||||
|
||||
39
DataSpec/DNAMP3/CMDL.cpp
Normal file
39
DataSpec/DNAMP3/CMDL.cpp
Normal file
@@ -0,0 +1,39 @@
|
||||
#include "CMDL.hpp"
|
||||
#include "hecl/Blender/Connection.hpp"
|
||||
|
||||
namespace DataSpec::DNAMP3
|
||||
{
|
||||
|
||||
bool CMDL::Extract(const SpecBase& dataSpec,
|
||||
PAKEntryReadStream& rs,
|
||||
const hecl::ProjectPath& outPath,
|
||||
PAKRouter<PAKBridge>& pakRouter,
|
||||
const PAK::Entry& entry,
|
||||
bool,
|
||||
hecl::blender::Token& btok,
|
||||
std::function<void(const hecl::SystemChar*)>)
|
||||
{
|
||||
/* Check for RigPair */
|
||||
const PAKRouter<PAKBridge>::RigPair* rp = pakRouter.lookupCMDLRigPair(entry.id);
|
||||
CINF cinf;
|
||||
CSKR cskr;
|
||||
std::pair<CSKR*,CINF*> loadRp(nullptr, nullptr);
|
||||
if (rp)
|
||||
{
|
||||
pakRouter.lookupAndReadDNA(rp->first, cskr);
|
||||
pakRouter.lookupAndReadDNA(rp->second, cinf);
|
||||
loadRp.first = &cskr;
|
||||
loadRp.second = &cinf;
|
||||
}
|
||||
|
||||
/* Do extract */
|
||||
hecl::blender::Connection& conn = btok.getBlenderConnection();
|
||||
if (!conn.createBlend(outPath, hecl::blender::BlendType::Mesh))
|
||||
return false;
|
||||
DNACMDL::ReadCMDLToBlender<PAKRouter<PAKBridge>, MaterialSet, std::pair<CSKR*,CINF*>, DNACMDL::SurfaceHeader_3, 5>
|
||||
(conn, rs, pakRouter, entry, dataSpec, loadRp);
|
||||
return conn.saveBlend();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,9 +8,7 @@
|
||||
#include "CINF.hpp"
|
||||
#include "CSKR.hpp"
|
||||
|
||||
namespace DataSpec
|
||||
{
|
||||
namespace DNAMP3
|
||||
namespace DataSpec::DNAMP3
|
||||
{
|
||||
|
||||
struct CMDL
|
||||
@@ -21,33 +19,10 @@ struct CMDL
|
||||
PAKRouter<PAKBridge>& pakRouter,
|
||||
const PAK::Entry& entry,
|
||||
bool,
|
||||
hecl::BlenderToken& btok,
|
||||
std::function<void(const hecl::SystemChar*)>)
|
||||
{
|
||||
/* Check for RigPair */
|
||||
const PAKRouter<PAKBridge>::RigPair* rp = pakRouter.lookupCMDLRigPair(entry.id);
|
||||
CINF cinf;
|
||||
CSKR cskr;
|
||||
std::pair<CSKR*,CINF*> loadRp(nullptr, nullptr);
|
||||
if (rp)
|
||||
{
|
||||
pakRouter.lookupAndReadDNA(rp->first, cskr);
|
||||
pakRouter.lookupAndReadDNA(rp->second, cinf);
|
||||
loadRp.first = &cskr;
|
||||
loadRp.second = &cinf;
|
||||
}
|
||||
|
||||
/* Do extract */
|
||||
hecl::BlenderConnection& conn = btok.getBlenderConnection();
|
||||
if (!conn.createBlend(outPath, hecl::BlenderConnection::BlendType::Mesh))
|
||||
return false;
|
||||
DNACMDL::ReadCMDLToBlender<PAKRouter<PAKBridge>, MaterialSet, std::pair<CSKR*,CINF*>, DNACMDL::SurfaceHeader_3, 5>
|
||||
(conn, rs, pakRouter, entry, dataSpec, loadRp);
|
||||
return conn.saveBlend();
|
||||
}
|
||||
hecl::blender::Token& btok,
|
||||
std::function<void(const hecl::SystemChar*)>);
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif // _DNAMP3_CMDL_HPP_
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
#include "CMDLMaterials.hpp"
|
||||
#include "hecl/Blender/Connection.hpp"
|
||||
|
||||
using Stream = hecl::BlenderConnection::PyOutStream;
|
||||
using Stream = hecl::blender::PyOutStream;
|
||||
|
||||
namespace DataSpec
|
||||
{
|
||||
namespace DNAMP3
|
||||
namespace DataSpec::DNAMP3
|
||||
{
|
||||
using Material = MaterialSet::Material;
|
||||
|
||||
@@ -108,7 +107,7 @@ void MaterialSet::ConstructMaterial(Stream& out,
|
||||
" new_nodetree.links.new(kcolor_nodes[-1][1].outputs[0], final_node.inputs['Alpha'])\n";
|
||||
}
|
||||
|
||||
void Material::SectionPASS::constructNode(hecl::BlenderConnection::PyOutStream& out,
|
||||
void Material::SectionPASS::constructNode(hecl::blender::PyOutStream& out,
|
||||
const PAKRouter<PAKBridge>& pakRouter,
|
||||
const PAK::Entry& entry,
|
||||
const Material::ISection* prevSection,
|
||||
@@ -259,7 +258,7 @@ void Material::SectionPASS::constructNode(hecl::BlenderConnection::PyOutStream&
|
||||
out << "gridder.row_break(2)\n";
|
||||
}
|
||||
|
||||
void Material::SectionCLR::constructNode(hecl::BlenderConnection::PyOutStream& out,
|
||||
void Material::SectionCLR::constructNode(hecl::blender::PyOutStream& out,
|
||||
const PAKRouter<PAKBridge>& pakRouter,
|
||||
const PAK::Entry& entry,
|
||||
const Material::ISection* prevSection,
|
||||
@@ -279,7 +278,7 @@ void Material::SectionCLR::constructNode(hecl::BlenderConnection::PyOutStream& o
|
||||
}
|
||||
}
|
||||
|
||||
void Material::SectionINT::constructNode(hecl::BlenderConnection::PyOutStream& out,
|
||||
void Material::SectionINT::constructNode(hecl::blender::PyOutStream& out,
|
||||
const PAKRouter<PAKBridge>& pakRouter,
|
||||
const PAK::Entry& entry,
|
||||
const Material::ISection* prevSection,
|
||||
@@ -316,4 +315,3 @@ void Material::SectionINT::constructNode(hecl::BlenderConnection::PyOutStream& o
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,9 +6,7 @@
|
||||
#include "../DNAMP1/CMDLMaterials.hpp"
|
||||
#include "DNAMP3.hpp"
|
||||
|
||||
namespace DataSpec
|
||||
{
|
||||
namespace DNAMP3
|
||||
namespace DataSpec::DNAMP3
|
||||
{
|
||||
|
||||
struct MaterialSet : BigDNA
|
||||
@@ -64,7 +62,7 @@ struct MaterialSet : BigDNA
|
||||
INT = SBIG('INT ')
|
||||
} m_type;
|
||||
ISection(Type type) : m_type(type) {}
|
||||
virtual void constructNode(hecl::BlenderConnection::PyOutStream& out,
|
||||
virtual void constructNode(hecl::blender::PyOutStream& out,
|
||||
const PAKRouter<PAKBridge>& pakRouter,
|
||||
const PAK::Entry& entry,
|
||||
const Material::ISection* prevSection,
|
||||
@@ -115,7 +113,7 @@ struct MaterialSet : BigDNA
|
||||
};
|
||||
Vector<UVAnimation, DNA_COUNT(uvAnimSize != 0)> uvAnim;
|
||||
|
||||
void constructNode(hecl::BlenderConnection::PyOutStream& out,
|
||||
void constructNode(hecl::blender::PyOutStream& out,
|
||||
const PAKRouter<PAKBridge>& pakRouter,
|
||||
const PAK::Entry& entry,
|
||||
const Material::ISection* prevSection,
|
||||
@@ -136,7 +134,7 @@ struct MaterialSet : BigDNA
|
||||
DNAFourCC subtype;
|
||||
GX::Color color;
|
||||
|
||||
void constructNode(hecl::BlenderConnection::PyOutStream& out,
|
||||
void constructNode(hecl::blender::PyOutStream& out,
|
||||
const PAKRouter<PAKBridge>& pakRouter,
|
||||
const PAK::Entry& entry,
|
||||
const Material::ISection* prevSection,
|
||||
@@ -160,7 +158,7 @@ struct MaterialSet : BigDNA
|
||||
DNAFourCC subtype;
|
||||
Value<atUint32> value;
|
||||
|
||||
void constructNode(hecl::BlenderConnection::PyOutStream& out,
|
||||
void constructNode(hecl::blender::PyOutStream& out,
|
||||
const PAKRouter<PAKBridge>& pakRouter,
|
||||
const PAK::Entry& entry,
|
||||
const Material::ISection* prevSection,
|
||||
@@ -236,14 +234,14 @@ struct MaterialSet : BigDNA
|
||||
};
|
||||
Vector<Material, DNA_COUNT(materialCount)> materials;
|
||||
|
||||
static void RegisterMaterialProps(hecl::BlenderConnection::PyOutStream& out);
|
||||
static void ConstructMaterial(hecl::BlenderConnection::PyOutStream& out,
|
||||
static void RegisterMaterialProps(hecl::blender::PyOutStream& out);
|
||||
static void ConstructMaterial(hecl::blender::PyOutStream& out,
|
||||
const PAKRouter<PAKBridge>& pakRouter,
|
||||
const PAK::Entry& entry,
|
||||
const MaterialSet::Material& material,
|
||||
unsigned groupIdx, unsigned matIdx);
|
||||
|
||||
void readToBlender(hecl::BlenderConnection::PyOutStream& os,
|
||||
void readToBlender(hecl::blender::PyOutStream& os,
|
||||
const PAKRouter<PAKBridge>& pakRouter,
|
||||
const PAKRouter<PAKBridge>::EntryType& entry,
|
||||
unsigned setIdx)
|
||||
@@ -252,7 +250,6 @@ struct MaterialSet : BigDNA
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif // _DNAMP3_CMDL_MATERIALS_HPP_
|
||||
|
||||
@@ -16,8 +16,9 @@ set(DNAMP3_SOURCES
|
||||
ANIM.cpp
|
||||
CINF.cpp
|
||||
CHAR.cpp
|
||||
CMDL.hpp
|
||||
CMDL.hpp CMDL.cpp
|
||||
CMDLMaterials.cpp
|
||||
CSKR.cpp
|
||||
STRG.hpp STRG.cpp
|
||||
MAPA.hpp
|
||||
MREA.cpp)
|
||||
|
||||
19
DataSpec/DNAMP3/CSKR.cpp
Normal file
19
DataSpec/DNAMP3/CSKR.cpp
Normal file
@@ -0,0 +1,19 @@
|
||||
#include "CSKR.hpp"
|
||||
#include "hecl/Blender/Connection.hpp"
|
||||
|
||||
namespace DataSpec::DNAMP3
|
||||
{
|
||||
|
||||
void CSKR::weightVertex(hecl::blender::PyOutStream& os, const CINF& cinf, atInt16 skinIdx) const
|
||||
{
|
||||
if (skinIdx < 0)
|
||||
return;
|
||||
const DNAMP2::CSKR::SkinningRule& rule = data.skinningRules[skinIdx];
|
||||
for (const DNAMP2::CSKR::SkinningRule::Weight& weight : rule.weights)
|
||||
os.format("vert[dvert_lay][%u] = %f\n",
|
||||
cinf.getBoneIdxFromId(weight.boneId),
|
||||
weight.weight);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,14 +1,11 @@
|
||||
#ifndef _DNAMP3_CSKR_HPP_
|
||||
#define _DNAMP3_CSKR_HPP_
|
||||
|
||||
#include "hecl/Blender/BlenderConnection.hpp"
|
||||
#include "../DNACommon/DNACommon.hpp"
|
||||
#include "CINF.hpp"
|
||||
#include "../DNAMP2/CSKR.hpp"
|
||||
|
||||
namespace DataSpec
|
||||
{
|
||||
namespace DNAMP3
|
||||
namespace DataSpec::DNAMP3
|
||||
{
|
||||
|
||||
struct CSKR : BigDNA
|
||||
@@ -41,19 +38,9 @@ struct CSKR : BigDNA
|
||||
return mtxBindings.at(idx).mtxs;
|
||||
}
|
||||
|
||||
void weightVertex(hecl::BlenderConnection::PyOutStream& os, const CINF& cinf, atInt16 skinIdx) const
|
||||
{
|
||||
if (skinIdx < 0)
|
||||
return;
|
||||
const DNAMP2::CSKR::SkinningRule& rule = data.skinningRules[skinIdx];
|
||||
for (const DNAMP2::CSKR::SkinningRule::Weight& weight : rule.weights)
|
||||
os.format("vert[dvert_lay][%u] = %f\n",
|
||||
cinf.getBoneIdxFromId(weight.boneId),
|
||||
weight.weight);
|
||||
}
|
||||
void weightVertex(hecl::blender::PyOutStream& os, const CINF& cinf, atInt16 skinIdx) const;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif // _DNAMP3_CSKR_HPP_
|
||||
|
||||
@@ -17,9 +17,7 @@
|
||||
#include "../DNACommon/DGRP.hpp"
|
||||
#include "Runtime/GCNTypes.hpp"
|
||||
|
||||
namespace DataSpec
|
||||
{
|
||||
namespace DNAMP3
|
||||
namespace DataSpec::DNAMP3
|
||||
{
|
||||
logvisor::Module Log("urde::DNAMP3");
|
||||
|
||||
@@ -298,4 +296,3 @@ ResExtractor<PAKBridge> PAKBridge::LookupExtractor(const PAK& pak, const PAK::En
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,9 +4,7 @@
|
||||
#include "../DNACommon/DNACommon.hpp"
|
||||
#include "PAK.hpp"
|
||||
|
||||
namespace DataSpec
|
||||
{
|
||||
namespace DNAMP3
|
||||
namespace DataSpec::DNAMP3
|
||||
{
|
||||
|
||||
extern logvisor::Module Log;
|
||||
@@ -44,7 +42,6 @@ public:
|
||||
std::unordered_map<UniqueID64, hecl::ProjectPath>& pathOverrides) const;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __DNAMP3_HPP__
|
||||
|
||||
@@ -4,9 +4,7 @@
|
||||
#include "../DNACommon/DNACommon.hpp"
|
||||
#include "PAK.hpp"
|
||||
|
||||
namespace DataSpec
|
||||
{
|
||||
namespace DNAMP3
|
||||
namespace DataSpec::DNAMP3
|
||||
{
|
||||
struct HINT : BigYAML
|
||||
{
|
||||
@@ -48,5 +46,4 @@ struct HINT : BigYAML
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
#endif // _DNAMP1_HINT_HPP_
|
||||
|
||||
@@ -5,9 +5,7 @@
|
||||
#include "../DNACommon/MAPA.hpp"
|
||||
#include "DNAMP3.hpp"
|
||||
|
||||
namespace DataSpec
|
||||
{
|
||||
namespace DNAMP3
|
||||
namespace DataSpec::DNAMP3
|
||||
{
|
||||
struct MAPA : DNAMAPA::MAPA
|
||||
{
|
||||
@@ -17,16 +15,16 @@ struct MAPA : DNAMAPA::MAPA
|
||||
PAKRouter<PAKBridge>& pakRouter,
|
||||
const PAK::Entry& entry,
|
||||
bool force,
|
||||
hecl::BlenderToken& btok,
|
||||
hecl::blender::Token& btok,
|
||||
std::function<void(const hecl::SystemChar*)> fileChanged)
|
||||
{
|
||||
MAPA mapa;
|
||||
mapa.read(rs);
|
||||
hecl::BlenderConnection& conn = btok.getBlenderConnection();
|
||||
hecl::blender::Connection& conn = btok.getBlenderConnection();
|
||||
return DNAMAPA::ReadMAPAToBlender(conn, mapa, outPath, pakRouter, entry, force);
|
||||
}
|
||||
|
||||
static bool Cook(const hecl::BlenderConnection::DataStream::MapArea& mapa, const hecl::ProjectPath& out)
|
||||
static bool Cook(const hecl::blender::MapArea& mapa, const hecl::ProjectPath& out)
|
||||
{
|
||||
return DNAMAPA::Cook<MAPA>(mapa, out);
|
||||
}
|
||||
@@ -36,7 +34,6 @@ struct MAPA : DNAMAPA::MAPA
|
||||
using MappableObject = DNAMAPA::MAPA::MappableObjectMP3;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -5,9 +5,7 @@
|
||||
#include "../DNACommon/MLVL.hpp"
|
||||
#include "DNAMP3.hpp"
|
||||
|
||||
namespace DataSpec
|
||||
{
|
||||
namespace DNAMP3
|
||||
namespace DataSpec::DNAMP3
|
||||
{
|
||||
|
||||
struct MLVL : BigYAML
|
||||
@@ -89,20 +87,19 @@ struct MLVL : BigYAML
|
||||
PAKRouter<PAKBridge>& pakRouter,
|
||||
const PAK::Entry& entry,
|
||||
bool force,
|
||||
hecl::BlenderToken& btok,
|
||||
hecl::blender::Token& btok,
|
||||
std::function<void(const hecl::SystemChar*)> fileChanged)
|
||||
{
|
||||
MLVL mlvl;
|
||||
mlvl.read(rs);
|
||||
athena::io::FileWriter writer(outPath.getWithExtension(_S(".yaml"), true).getAbsolutePath());
|
||||
mlvl.toYAMLStream(writer);
|
||||
hecl::BlenderConnection& conn = btok.getBlenderConnection();
|
||||
hecl::blender::Connection& conn = btok.getBlenderConnection();
|
||||
return DNAMLVL::ReadMLVLToBlender(conn, mlvl, outPath, pakRouter,
|
||||
entry, force, fileChanged);
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __DNAMP3_MLVL_HPP__
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "MREA.hpp"
|
||||
#include "../DNAMP2/DeafBabe.hpp"
|
||||
#include "../DNACommon/BabeDead.hpp"
|
||||
#include "hecl/Blender/Connection.hpp"
|
||||
|
||||
namespace DataSpec
|
||||
{
|
||||
@@ -46,7 +47,7 @@ void MREA::StreamReader::writeSecIdxs(athena::io::IStreamWriter& writer) const
|
||||
}
|
||||
}
|
||||
|
||||
void MREA::ReadBabeDeadToBlender_3(hecl::BlenderConnection::PyOutStream& os,
|
||||
void MREA::ReadBabeDeadToBlender_3(hecl::blender::PyOutStream& os,
|
||||
athena::io::IStreamReader& rs)
|
||||
{
|
||||
atUint32 bdMagic = rs.readUint32Big();
|
||||
@@ -74,7 +75,7 @@ bool MREA::Extract(const SpecBase& dataSpec,
|
||||
PAKRouter<PAKBridge>& pakRouter,
|
||||
const PAK::Entry& entry,
|
||||
bool force,
|
||||
hecl::BlenderToken& btok,
|
||||
hecl::blender::Token& btok,
|
||||
std::function<void(const hecl::SystemChar*)>)
|
||||
{
|
||||
using RigPair = std::pair<CSKR*, CINF*>;
|
||||
@@ -106,12 +107,12 @@ bool MREA::Extract(const SpecBase& dataSpec,
|
||||
|
||||
|
||||
/* Start up blender connection */
|
||||
hecl::BlenderConnection& conn = btok.getBlenderConnection();
|
||||
if (!conn.createBlend(outPath, hecl::BlenderConnection::BlendType::Area))
|
||||
hecl::blender::Connection& conn = btok.getBlenderConnection();
|
||||
if (!conn.createBlend(outPath, hecl::blender::BlendType::Area))
|
||||
return false;
|
||||
|
||||
/* Open Py Stream and read sections */
|
||||
hecl::BlenderConnection::PyOutStream os = conn.beginPythonOut(true);
|
||||
hecl::blender::PyOutStream os = conn.beginPythonOut(true);
|
||||
os.format("import bpy\n"
|
||||
"import bmesh\n"
|
||||
"from mathutils import Vector\n"
|
||||
|
||||
@@ -6,9 +6,7 @@
|
||||
#include "CSKR.hpp"
|
||||
#include "../DNAMP2/MREA.hpp"
|
||||
|
||||
namespace DataSpec
|
||||
{
|
||||
namespace DNAMP3
|
||||
namespace DataSpec::DNAMP3
|
||||
{
|
||||
|
||||
struct MREA
|
||||
@@ -112,7 +110,7 @@ struct MREA
|
||||
Value<atUint32> unk13;
|
||||
};
|
||||
|
||||
static void ReadBabeDeadToBlender_3(hecl::BlenderConnection::PyOutStream& os,
|
||||
static void ReadBabeDeadToBlender_3(hecl::blender::PyOutStream& os,
|
||||
athena::io::IStreamReader& rs);
|
||||
|
||||
static bool Extract(const SpecBase& dataSpec,
|
||||
@@ -121,13 +119,12 @@ struct MREA
|
||||
PAKRouter<PAKBridge>& pakRouter,
|
||||
const PAK::Entry& entry,
|
||||
bool,
|
||||
hecl::BlenderToken& btok,
|
||||
hecl::blender::Token& btok,
|
||||
std::function<void(const hecl::SystemChar*)>);
|
||||
|
||||
static bool ExtractLayerDeps(PAKEntryReadStream& rs, PAKBridge::Level::Area& areaOut);
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __DNAMP3_MREA_HPP__
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
#include "PAK.hpp"
|
||||
#include "DNAMP3.hpp"
|
||||
|
||||
namespace DataSpec
|
||||
{
|
||||
namespace DNAMP3
|
||||
namespace DataSpec::DNAMP3
|
||||
{
|
||||
|
||||
const hecl::FourCC CMPD("CMPD");
|
||||
@@ -240,4 +238,3 @@ std::string PAK::bestEntryName(const Entry& entry, bool& named) const
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,9 +7,7 @@
|
||||
#include <nod/DiscBase.hpp>
|
||||
#include "../DNACommon/PAK.hpp"
|
||||
|
||||
namespace DataSpec
|
||||
{
|
||||
namespace DNAMP3
|
||||
namespace DataSpec::DNAMP3
|
||||
{
|
||||
|
||||
extern const hecl::FourCC CMPD;
|
||||
@@ -70,7 +68,6 @@ struct PAK : BigDNA
|
||||
typedef UniqueID64 IDType;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __DNAMP3_PAK_HPP__
|
||||
|
||||
@@ -4,9 +4,7 @@
|
||||
#include "../DNACommon/SAVWCommon.hpp"
|
||||
#include "DNAMP3.hpp"
|
||||
|
||||
namespace DataSpec
|
||||
{
|
||||
namespace DNAMP3
|
||||
namespace DataSpec::DNAMP3
|
||||
{
|
||||
struct Scan : BigYAML
|
||||
{
|
||||
@@ -47,6 +45,5 @@ struct SAVW : BigYAML
|
||||
Vector<SavedState, DNA_COUNT(gameObjectCount)> gameObjects;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __DNAMP3_SAVW_HPP__
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
#include "STRG.hpp"
|
||||
#include "DNAMP3.hpp"
|
||||
|
||||
namespace DataSpec
|
||||
{
|
||||
namespace DNAMP3
|
||||
namespace DataSpec::DNAMP3
|
||||
{
|
||||
|
||||
void STRG::_read(athena::io::IStreamReader& reader)
|
||||
@@ -267,4 +265,3 @@ const char* STRG::DNAType()
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,9 +5,7 @@
|
||||
#include "../DNACommon/PAK.hpp"
|
||||
#include "../DNACommon/STRG.hpp"
|
||||
|
||||
namespace DataSpec
|
||||
{
|
||||
namespace DNAMP3
|
||||
namespace DataSpec::DNAMP3
|
||||
{
|
||||
|
||||
struct STRG : ISTRG
|
||||
@@ -83,7 +81,6 @@ struct STRG : ISTRG
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif // __DNAMP2_STRG_HPP__
|
||||
|
||||
Reference in New Issue
Block a user