mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-09 05:07:43 +00:00
DGRP Fixes
This commit is contained in:
@@ -5,6 +5,8 @@
|
||||
|
||||
namespace DataSpec
|
||||
{
|
||||
namespace DNADGRP
|
||||
{
|
||||
template <class IDType>
|
||||
void DGRP<IDType>::read(athena::io::IStreamReader& __dna_reader)
|
||||
{
|
||||
@@ -137,5 +139,5 @@ bool WriteDGRP(const DGRP<IDType>& dgrp, const hecl::ProjectPath& outPath)
|
||||
}
|
||||
template bool WriteDGRP<UniqueID32>(const DGRP<UniqueID32>& dgrp, const hecl::ProjectPath& outPath);
|
||||
template bool WriteDGRP<UniqueID64>(const DGRP<UniqueID64>& dgrp, const hecl::ProjectPath& outPath);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
33
DataSpec/DNACommon/DGRP.hpp
Normal file
33
DataSpec/DNACommon/DGRP.hpp
Normal file
@@ -0,0 +1,33 @@
|
||||
#ifndef __COMMON_DGRP_HPP__
|
||||
#define __COMMON_DGRP_HPP__
|
||||
|
||||
#include "DNACommon.hpp"
|
||||
#include "PAK.hpp"
|
||||
|
||||
namespace DataSpec
|
||||
{
|
||||
namespace DNADGRP
|
||||
{
|
||||
template <class IDType>
|
||||
struct DGRP : BigYAML
|
||||
{
|
||||
DECL_YAML
|
||||
Value<atUint32> dependCount;
|
||||
struct ObjectTag : BigYAML
|
||||
{
|
||||
DECL_YAML
|
||||
DNAFourCC type;
|
||||
UniqueID32 id;
|
||||
};
|
||||
|
||||
Vector<ObjectTag, DNA_COUNT(dependCount)> depends;
|
||||
};
|
||||
|
||||
|
||||
template <class IDType>
|
||||
bool ExtractDGRP(PAKEntryReadStream& rs, const hecl::ProjectPath& outPath);
|
||||
template <class IDType>
|
||||
bool WriteDGRP(const DGRP<IDType>& dgrp, const hecl::ProjectPath& outPath);
|
||||
}
|
||||
}
|
||||
#endif // __COMMON_DGRP_HPP__
|
||||
@@ -308,7 +308,7 @@ ResExtractor<PAKBridge> PAKBridge::LookupExtractor(const PAK::Entry& entry)
|
||||
case SBIG('FONT'):
|
||||
return {DNAFont::ExtractFONT<UniqueID32>, nullptr, {_S(".yaml")}};
|
||||
case SBIG('DGRP'):
|
||||
return {ExtractDGRP<UniqueID32>, nullptr, {_S(".yaml")}};
|
||||
return {DNADGRP::ExtractDGRP<UniqueID32>, nullptr, {_S(".yaml")}};
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
@@ -237,7 +237,7 @@ ResExtractor<PAKBridge> PAKBridge::LookupExtractor(const DNAMP1::PAK::Entry& ent
|
||||
case SBIG('FONT'):
|
||||
return {DNAFont::ExtractFONT<UniqueID32>, nullptr, {_S(".yaml")}};
|
||||
case SBIG('DGRP'):
|
||||
return {ExtractDGRP<UniqueID32>, nullptr, {_S(".yaml")}};
|
||||
return {DNADGRP::ExtractDGRP<UniqueID32>, nullptr, {_S(".yaml")}};
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
@@ -245,7 +245,7 @@ ResExtractor<PAKBridge> PAKBridge::LookupExtractor(const PAK::Entry& entry)
|
||||
case SBIG('FONT'):
|
||||
return {DNAFont::ExtractFONT<UniqueID64>, nullptr, {_S(".yaml")}};
|
||||
case SBIG('DGRP'):
|
||||
return {ExtractDGRP<UniqueID64>, nullptr, {_S(".yaml")}};
|
||||
return {DNADGRP::ExtractDGRP<UniqueID64>, nullptr, {_S(".yaml")}};
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#include "DNACommon/WPSC.hpp"
|
||||
#include "DNACommon/CRSC.hpp"
|
||||
#include "DNACommon/DPSC.hpp"
|
||||
#include "DNACommon/DGRP.hpp"
|
||||
|
||||
#include "hecl/ClientProcess.hpp"
|
||||
|
||||
@@ -339,6 +340,8 @@ struct SpecMP1 : SpecBase
|
||||
return true;
|
||||
else if (!strcmp(classType, DNAParticle::DPSM<UniqueID32>::DNAType()))
|
||||
return true;
|
||||
else if (!strcmp(classType, DNADGRP::DGRP<UniqueID32>::DNAType()))
|
||||
return true;
|
||||
return false;
|
||||
});
|
||||
}
|
||||
@@ -436,6 +439,12 @@ struct SpecMP1 : SpecBase
|
||||
dpsm.read(reader);
|
||||
DNAParticle::WriteDPSM(dpsm, out);
|
||||
}
|
||||
else if (!classStr.compare(DNADGRP::DGRP<UniqueID32>::DNAType()))
|
||||
{
|
||||
DNADGRP::DGRP<UniqueID32> dgrp;
|
||||
dgrp.read(reader);
|
||||
DNADGRP::WriteDGRP(dgrp, out);
|
||||
}
|
||||
}
|
||||
progress(_S("Done"));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user