Initial PATH cooking support

This commit is contained in:
Jack Andersen 2018-02-24 22:23:27 -10:00
parent 13e6ff31c6
commit 619a784434
58 changed files with 459 additions and 340 deletions

View File

@ -1,5 +1,6 @@
#include "AROTBuilder.hpp"
#include "hecl/Blender/Connection.hpp"
#include "../DNAMP1/PATH.hpp"
namespace DataSpec
{
@ -287,6 +288,60 @@ void AROTBuilder::Node::writeColNodes(uint8_t*& ptr, const zeus::CAABox& curAABB
}
}
void AROTBuilder::Node::pathCountNodesAndLookups(size_t& nodeCount, size_t& lookupCount)
{
++nodeCount;
if (childNodes.empty())
{
lookupCount += childIndices.size();
}
else
{
for (int i=0 ; i<8 ; ++i)
childNodes[i].pathCountNodesAndLookups(nodeCount, lookupCount);
}
}
void AROTBuilder::Node::pathWrite(DNAMP1::PATH& path, const zeus::CAABox& curAABB)
{
if (childNodes.empty())
{
path.octree.emplace_back();
DNAMP1::PATH::OctreeNode& n = path.octree.back();
n.isLeaf = 1;
n.aabb[0] = curAABB.min;
n.aabb[1] = curAABB.max;
n.centroid = curAABB.center();
for (int i=0 ; i<8 ; ++i)
n.children[i] = 0xffffffff;
n.regionCount = childIndices.size();
n.regionStart = path.octreeRegionLookup.size();
for (int r : childIndices)
path.octreeRegionLookup.push_back(r);
}
else
{
atUint32 children[8];
for (int i=0 ; i<8 ; ++i)
{
/* Head recursion (first node will be a leaf) */
children[i] = path.octree.size();
childNodes[i].pathWrite(path, SplitAABB(curAABB, i));
}
path.octree.emplace_back();
DNAMP1::PATH::OctreeNode& n = path.octree.back();
n.isLeaf = 0;
n.aabb[0] = curAABB.min;
n.aabb[1] = curAABB.max;
n.centroid = curAABB.center();
for (int i=0 ; i<8 ; ++i)
n.children[i] = children[i];
n.regionCount = 0;
n.regionStart = 0;
}
}
void AROTBuilder::build(std::vector<std::vector<uint8_t>>& secs, const zeus::CAABox& fullAabb,
const std::vector<zeus::CAABox>& meshAabbs, const std::vector<DNACMDL::Mesh>& meshes)
{
@ -391,4 +446,31 @@ std::pair<std::unique_ptr<uint8_t[]>, uint32_t> AROTBuilder::buildCol(const ColM
return {std::move(ret), totalSize};
}
void AROTBuilder::buildPath(DNAMP1::PATH& path)
{
/* Accumulate total AABB and gather region boxes */
std::vector<zeus::CAABox> regionBoxes;
regionBoxes.reserve(path.regions.size());
zeus::CAABox fullAABB;
for (const DNAMP1::PATH::Region& r : path.regions)
{
regionBoxes.emplace_back(r.aabb[0], r.aabb[1]);
fullAABB.accumulateBounds(regionBoxes.back());
}
/* Recursively split */
BspNodeType dontCare;
rootNode.addChild(0, 4, regionBoxes, fullAABB, dontCare);
/* Write out */
size_t nodeCount = 0;
size_t lookupCount = 0;
rootNode.pathCountNodesAndLookups(nodeCount, lookupCount);
path.octreeNodeCount = nodeCount;
path.octree.reserve(nodeCount);
path.octreeRegionLookupCount = lookupCount;
path.octreeRegionLookup.reserve(lookupCount);
rootNode.pathWrite(path, fullAABB);
}
}

View File

@ -9,6 +9,10 @@
namespace DataSpec
{
namespace DNAMP1
{
struct PATH;
}
struct AROTBuilder
{
@ -40,11 +44,15 @@ struct AROTBuilder
void colSize(size_t& totalSz);
void writeColNodes(uint8_t*& ptr, const zeus::CAABox& curAABB);
void pathCountNodesAndLookups(size_t& nodeCount, size_t& lookupCount);
void pathWrite(DNAMP1::PATH& path, const zeus::CAABox& curAABB);
} rootNode;
void build(std::vector<std::vector<uint8_t>>& secs, const zeus::CAABox& fullAabb,
const std::vector<zeus::CAABox>& meshAabbs, const std::vector<DNACMDL::Mesh>& meshes);
std::pair<std::unique_ptr<uint8_t[]>, uint32_t> buildCol(const ColMesh& mesh, BspNodeType& rootOut);
void buildPath(DNAMP1::PATH& path);
};
}

View File

@ -33,7 +33,7 @@ struct Header : BigDNA
Value<atVec3f> aabbMax;
Value<atUint32> secCount;
Value<atUint32> matSetCount;
Vector<atUint32, DNA_COUNT(secCount)> secSizes;
Vector<atUint32, AT_DNA_COUNT(secCount)> secSizes;
Align<32> align;
};

View File

@ -19,7 +19,7 @@ struct AT_SPECIALIZE_PARMS(DataSpec::UniqueID32, DataSpec::UniqueID64) DGRP : Bi
Value<IDType> id;
};
Vector<ObjectTag, DNA_COUNT(dependCount)> depends;
Vector<ObjectTag, AT_DNA_COUNT(dependCount)> depends;
};
template <class IDType>

View File

@ -17,7 +17,7 @@ struct EGMC : public BigDNA
Value<atUint32> instanceId;
};
Vector<Object, DNA_COUNT(count)> objects;
Vector<Object, AT_DNA_COUNT(count)> objects;
};
}
#endif // _DNACOMMON_EGMC_HPP_

View File

@ -109,7 +109,7 @@ struct AT_SPECIALIZE_PARMS(DataSpec::UniqueID32, DataSpec::UniqueID64) FONT : Bi
Value<atUint32> glyphCount;
std::vector<std::unique_ptr<IGlyph>> glyphs;
Value<atUint32> kerningInfoCount;
Vector<KerningInfo, DNA_COUNT(kerningInfoCount)> kerningInfo;
Vector<KerningInfo, AT_DNA_COUNT(kerningInfoCount)> kerningInfo;
void gatherDependencies(std::vector<hecl::ProjectPath>& pathsOut) const
{

View File

@ -42,7 +42,7 @@ struct AT_SPECIALIZE_PARMS(DataSpec::UniqueID32, DataSpec::UniqueID64) FSM2 : Bi
AT_DECL_DNA_YAML
String<-1> name;
Value<atUint32> unknownCount;
Vector<CommonStruct, DNA_COUNT(unknownCount)> unknown;
Vector<CommonStruct, AT_DNA_COUNT(unknownCount)> unknown;
};
struct Unknown1 : BigDNA
@ -51,7 +51,7 @@ struct AT_SPECIALIZE_PARMS(DataSpec::UniqueID32, DataSpec::UniqueID64) FSM2 : Bi
String<-1> name;
Value<float> unknown1;
Value<atUint32> unknown2Count;
Vector<CommonStruct, DNA_COUNT(unknown2Count)> unknown2;
Vector<CommonStruct, AT_DNA_COUNT(unknown2Count)> unknown2;
Value<atUint8> unknown3;
};
@ -60,7 +60,7 @@ struct AT_SPECIALIZE_PARMS(DataSpec::UniqueID32, DataSpec::UniqueID64) FSM2 : Bi
AT_DECL_DNA_YAML
String<-1> name;
Value<atUint32> unknownCount;
Vector<CommonStruct, DNA_COUNT(unknownCount)> unknown;
Vector<CommonStruct, AT_DNA_COUNT(unknownCount)> unknown;
};
struct Unknown3 : BigDNA
@ -68,14 +68,14 @@ struct AT_SPECIALIZE_PARMS(DataSpec::UniqueID32, DataSpec::UniqueID64) FSM2 : Bi
AT_DECL_DNA_YAML
String<-1> name;
Value<atUint32> unknownCount;
Vector<CommonStruct, DNA_COUNT(unknownCount)> unknown;
Vector<CommonStruct, AT_DNA_COUNT(unknownCount)> unknown;
Value<IDType> fsmId;
};
Vector<State, DNA_COUNT(stateCount)> states;
Vector<Unknown1, DNA_COUNT(unknown1Count)> unknown1;
Vector<Unknown2, DNA_COUNT(unknown2Count)> unknown2;
Vector<Unknown3, DNA_COUNT(unknown3Count)> unknown3;
Vector<State, AT_DNA_COUNT(stateCount)> states;
Vector<Unknown1, AT_DNA_COUNT(unknown1Count)> unknown1;
Vector<Unknown2, AT_DNA_COUNT(unknown2Count)> unknown2;
Vector<Unknown3, AT_DNA_COUNT(unknown3Count)> unknown3;
};
struct FSMV2 : IFSM
@ -95,7 +95,7 @@ struct AT_SPECIALIZE_PARMS(DataSpec::UniqueID32, DataSpec::UniqueID64) FSM2 : Bi
Value<atUint32> unknown3;
Value<atUint32> unknown4;
Value<atUint32> unknown5Count;
Vector<CommonStruct, DNA_COUNT(unknown5Count)> unknown5;
Vector<CommonStruct, AT_DNA_COUNT(unknown5Count)> unknown5;
};
struct Unknown1 : BigDNA
@ -108,7 +108,7 @@ struct AT_SPECIALIZE_PARMS(DataSpec::UniqueID32, DataSpec::UniqueID64) FSM2 : Bi
Value<atUint32> unknown4;
Value<float> unknown5;
Value<atUint32> unknown6Count;
Vector<CommonStruct, DNA_COUNT(unknown6Count)> unknown6;
Vector<CommonStruct, AT_DNA_COUNT(unknown6Count)> unknown6;
Value<atUint8> unknown7;
};
@ -121,7 +121,7 @@ struct AT_SPECIALIZE_PARMS(DataSpec::UniqueID32, DataSpec::UniqueID64) FSM2 : Bi
Value<atUint32> unknown3;
Value<atUint32> unknown4;
Value<atUint32> unknown5Count;
Vector<CommonStruct, DNA_COUNT(unknown5Count)> unknown5;
Vector<CommonStruct, AT_DNA_COUNT(unknown5Count)> unknown5;
};
struct Unknown3 : BigDNA
@ -133,14 +133,14 @@ struct AT_SPECIALIZE_PARMS(DataSpec::UniqueID32, DataSpec::UniqueID64) FSM2 : Bi
Value<atUint32> unknown3;
Value<atUint32> unknown4;
Value<atUint32> unknown5Count;
Vector<CommonStruct, DNA_COUNT(unknown5Count)> unknown5;
Vector<CommonStruct, AT_DNA_COUNT(unknown5Count)> unknown5;
Value<IDType> fsmId;
};
Vector<State, DNA_COUNT(stateCount)> states;
Vector<Unknown1, DNA_COUNT(unknown1Count)> unknown1;
Vector<Unknown2, DNA_COUNT(unknown2Count)> unknown2;
Vector<Unknown3, DNA_COUNT(unknown3Count)> unknown3;
Vector<State, AT_DNA_COUNT(stateCount)> states;
Vector<Unknown1, AT_DNA_COUNT(unknown1Count)> unknown1;
Vector<Unknown2, AT_DNA_COUNT(unknown2Count)> unknown2;
Vector<Unknown3, AT_DNA_COUNT(unknown3Count)> unknown3;
};
std::unique_ptr<IFSM> detail;

View File

@ -72,7 +72,7 @@ struct MAPA : BigDNA
Value<atUint32> surfCount = 0;
Value<atUint32> internalNameLength = 0;
Value<atUint32> unknown7 = 0;
String<DNA_COUNT(internalNameLength)> internalName;
String<AT_DNA_COUNT(internalNameLength)> internalName;
atUint32 visMode() const { return mapVisMode; }
atUint32 mappableObjectCount() const { return moCount;}
atUint32 vertexCount() const { return vtxCount; }
@ -131,14 +131,14 @@ struct MAPA : BigDNA
Value<Type> type;
Value<atUint32> visMode;
Value<atUint32> sclyId;
Buffer<DNA_COUNT(0x10)> unknownHash;
Buffer<AT_DNA_COUNT(0x10)> unknownHash;
Value<atInt32> seek1 = -1;
Value<atVec4f> transformMtx[3];
Value<atInt32> seek2[4] = {-1, -1, -1, -1};
};
std::vector<std::unique_ptr<IMappableObject>> mappableObjects;
Vector<atVec3f, DNA_COUNT(header->vertexCount())> vertices;
Vector<atVec3f, AT_DNA_COUNT(header->vertexCount())> vertices;
struct SurfaceHeader : BigDNA
{
@ -149,7 +149,7 @@ struct MAPA : BigDNA
Value<atUint32> edgeOff;
};
Vector<SurfaceHeader, DNA_COUNT(header->surfaceCount())> surfaceHeaders;
Vector<SurfaceHeader, AT_DNA_COUNT(header->surfaceCount())> surfaceHeaders;
struct Surface : BigDNA
{
@ -160,22 +160,22 @@ struct MAPA : BigDNA
AT_DECL_DNA
Value<atUint32> type;
Value<atUint32> indexCount;
Vector<atUint8, DNA_COUNT(indexCount)> indices;
Vector<atUint8, AT_DNA_COUNT(indexCount)> indices;
Align<4> align;
};
Vector<Primitive, DNA_COUNT(primitiveCount)> primitives;
Vector<Primitive, AT_DNA_COUNT(primitiveCount)> primitives;
Value<atUint32> borderCount;
struct Border : BigDNA
{
AT_DECL_DNA
Value<atUint32> indexCount;
Vector<atUint8, DNA_COUNT(indexCount)> indices;
Vector<atUint8, AT_DNA_COUNT(indexCount)> indices;
Align<4> align;
};
Vector<Border, DNA_COUNT(borderCount)> borders;
Vector<Border, AT_DNA_COUNT(borderCount)> borders;
};
Vector<Surface, DNA_COUNT(header->surfaceCount())> surfaces;
Vector<Surface, AT_DNA_COUNT(header->surfaceCount())> surfaces;
};
template <typename PAKRouter>

View File

@ -24,10 +24,10 @@ struct MAPU : BigDNA
UniqueID32 mlvl;
Transform transform;
Value<uint32_t> hexCount;
Vector<Transform, DNA_COUNT(hexCount)> hexTransforms;
Vector<Transform, AT_DNA_COUNT(hexCount)> hexTransforms;
DNAColor hexColor;
};
Vector<World, DNA_COUNT(worldCount)> worlds;
Vector<World, AT_DNA_COUNT(worldCount)> worlds;
static bool Cook(const hecl::blender::MapUniverse& mapu, const hecl::ProjectPath& out);
};

View File

@ -129,7 +129,7 @@ struct REKeyframeEmitter : IRealElement
Value<atUint32> loopEnd;
Value<atUint32> loopStart;
Value<atUint32> count;
Vector<float, DNA_COUNT(count)> keys;
Vector<float, AT_DNA_COUNT(count)> keys;
const char* ClassID() const {return percentageTween ? "KEYP" : "KEYE";}
};
@ -339,7 +339,7 @@ struct IEKeyframeEmitter : IIntElement
Value<atUint32> loopEnd;
Value<atUint32> loopStart;
Value<atUint32> count;
Vector<atUint32, DNA_COUNT(count)> keys;
Vector<atUint32, AT_DNA_COUNT(count)> keys;
const char* ClassID() const {return percentageTween ? "KEYP" : "KEYE";}
};
@ -544,7 +544,7 @@ struct VEKeyframeEmitter : IVectorElement
Value<atUint32> loopEnd;
Value<atUint32> loopStart;
Value<atUint32> count;
Vector<atVec3f, DNA_COUNT(count)> keys;
Vector<atVec3f, AT_DNA_COUNT(count)> keys;
const char* ClassID() const {return percentageTween ? "KEYP" : "KEYE";}
};
@ -620,7 +620,7 @@ struct CEKeyframeEmitter : IColorElement
Value<atUint32> loopEnd;
Value<atUint32> loopStart;
Value<atUint32> count;
Vector<atVec4f, DNA_COUNT(count)> keys;
Vector<atVec4f, AT_DNA_COUNT(count)> keys;
const char* ClassID() const {return percentageTween ? "KEYP" : "KEYE";}
};

View File

@ -11,7 +11,7 @@ struct AFSM : public BigDNA
{
AT_DECL_DNA_YAML
Value<atUint32> stateCount;
Vector<String<-1>, DNA_COUNT(stateCount)> stateNames;
Vector<String<-1>, AT_DNA_COUNT(stateCount)> stateNames;
Value<atUint32> triggerCount;
struct State : public BigDNA
@ -31,11 +31,11 @@ struct AFSM : public BigDNA
Value<float> parameter;
Value<atUint32> targetState;
};
Vector<Trigger, DNA_COUNT(triggerCount)> triggers;
Vector<Trigger, AT_DNA_COUNT(triggerCount)> triggers;
};
Vector<Transition, DNA_COUNT(transitionCount)> transitions;
Vector<Transition, AT_DNA_COUNT(transitionCount)> transitions;
};
Vector<State, DNA_COUNT(stateCount)> states;
Vector<State, AT_DNA_COUNT(stateCount)> states;
static bool Extract(PAKEntryReadStream& rs, const hecl::ProjectPath& outPath)
{

View File

@ -99,7 +99,7 @@ struct ANCS : BigDNA
};
std::vector<AnimInfo> animInfos;
};
Vector<AnimState, DNA_COUNT(animStateCount)> animStates;
Vector<AnimState, AT_DNA_COUNT(animStateCount)> animStates;
} pasDatabase;
struct ParticleResData
@ -136,7 +136,7 @@ struct ANCS : BigDNA
Value<atUint32> parentMode;
Value<atUint32> flags;
};
Vector<EffectComponent, DNA_COUNT(compCount)> comps;
Vector<EffectComponent, AT_DNA_COUNT(compCount)> comps;
};
std::vector<Effect> effects;
@ -145,7 +145,7 @@ struct ANCS : BigDNA
std::vector<atUint32> animIdxs;
};
Vector<CharacterInfo, DNA_COUNT(characterCount)> characters;
Vector<CharacterInfo, AT_DNA_COUNT(characterCount)> characters;
} characterSet;
struct AnimationSet : BigDNA
@ -262,7 +262,7 @@ struct ANCS : BigDNA
MetaAnimFactory anim;
Value<atUint32> probability;
};
Vector<Child, DNA_COUNT(animCount)> children;
Vector<Child, AT_DNA_COUNT(animCount)> children;
void gatherPrimitives(std::map<atUint32, DNAANCS::AnimationResInfo<UniqueID32>>& out)
{
@ -284,7 +284,7 @@ struct ANCS : BigDNA
AT_DECL_DNA_YAML
AT_DECL_DNAV
Value<atUint32> animCount;
Vector<MetaAnimFactory, DNA_COUNT(animCount)> children;
Vector<MetaAnimFactory, AT_DNA_COUNT(animCount)> children;
void gatherPrimitives(std::map<atUint32, DNAANCS::AnimationResInfo<UniqueID32>>& out)
{

View File

@ -18,12 +18,12 @@ struct CINF : BigDNA
Value<atUint32> parentId;
Value<atVec3f> origin;
Value<atUint32> linkedCount;
Vector<atUint32, DNA_COUNT(linkedCount)> linked;
Vector<atUint32, AT_DNA_COUNT(linkedCount)> linked;
};
Vector<Bone, DNA_COUNT(boneCount)> bones;
Vector<Bone, AT_DNA_COUNT(boneCount)> bones;
Value<atUint32> boneIdCount;
Vector<atUint32, DNA_COUNT(boneIdCount)> boneIds;
Vector<atUint32, AT_DNA_COUNT(boneIdCount)> boneIds;
Value<atUint32> nameCount;
struct Name : BigDNA
@ -32,7 +32,7 @@ struct CINF : BigDNA
String<-1> name;
Value<atUint32> boneId;
};
Vector<Name, DNA_COUNT(nameCount)> names;
Vector<Name, AT_DNA_COUNT(nameCount)> names;
atUint32 getInternalBoneIdxFromId(atUint32 id) const;
atUint32 getBoneIdxFromId(atUint32 id) const;

View File

@ -18,9 +18,9 @@ struct MaterialSet : BigDNA
{
AT_DECL_DNA
Value<atUint32> textureCount = 0;
Vector<UniqueID32, DNA_COUNT(textureCount)> textureIDs;
Vector<UniqueID32, AT_DNA_COUNT(textureCount)> textureIDs;
Value<atUint32> materialCount = 0;
Vector<atUint32, DNA_COUNT(materialCount)> materialEndOffs;
Vector<atUint32, AT_DNA_COUNT(materialCount)> materialEndOffs;
void addTexture(const UniqueID32& id) {textureIDs.push_back(id); ++textureCount;}
void addMaterialEndOff(atUint32 off) {materialEndOffs.push_back(off); ++materialCount;}
@ -59,7 +59,7 @@ struct MaterialSet : BigDNA
const Flags& getFlags() const {return flags;}
Value<atUint32> textureCount = 0;
Vector<atUint32, DNA_COUNT(textureCount)> textureIdxs;
Vector<atUint32, AT_DNA_COUNT(textureCount)> textureIdxs;
struct VAFlags : BigDNA
{
AT_DECL_DNA
@ -132,13 +132,13 @@ struct MaterialSet : BigDNA
const VAFlags& getVAFlags() const {return vaFlags;}
Value<atUint32> groupIdx;
Vector<atUint32, DNA_COUNT(flags.konstValuesEnabled())> konstCount;
Vector<GX::Color, DNA_COUNT(flags.konstValuesEnabled() ? konstCount[0] : 0)> konstColors;
Vector<atUint32, AT_DNA_COUNT(flags.konstValuesEnabled())> konstCount;
Vector<GX::Color, AT_DNA_COUNT(flags.konstValuesEnabled() ? konstCount[0] : 0)> konstColors;
using BlendFactor = GX::BlendFactor;
Value<BlendFactor> blendDstFac;
Value<BlendFactor> blendSrcFac;
Vector<atUint32, DNA_COUNT(flags.samusReflectionIndirectTexture())> indTexSlot;
Vector<atUint32, AT_DNA_COUNT(flags.samusReflectionIndirectTexture())> indTexSlot;
Value<atUint32> colorChannelCount = 0;
struct ColorChannel : BigDNA
@ -158,7 +158,7 @@ struct MaterialSet : BigDNA
GX::AttnFn attenuationFn() const {return GX::AttnFn(flags >> 13 & 0x3);}
void setAttenuationFn(GX::AttnFn fn) {flags &= ~0x6000; flags |= atUint32(fn) << 13;}
};
Vector<ColorChannel, DNA_COUNT(colorChannelCount)> colorChannels;
Vector<ColorChannel, AT_DNA_COUNT(colorChannelCount)> colorChannels;
Value<atUint32> tevStageCount = 0;
struct TEVStage : BigDNA
@ -218,7 +218,7 @@ struct MaterialSet : BigDNA
GX::TevKAlphaSel kAlphaIn() const {return GX::TevKAlphaSel(kaInput);}
void setKAlphaIn(GX::TevKAlphaSel val) {kaInput = val;}
};
Vector<TEVStage, DNA_COUNT(tevStageCount)> tevStages;
Vector<TEVStage, AT_DNA_COUNT(tevStageCount)> tevStages;
struct TEVStageTexInfo : BigDNA
{
AT_DECL_DNA
@ -226,7 +226,7 @@ struct MaterialSet : BigDNA
Value<atUint8> texSlot = 0xff;
Value<atUint8> tcgSlot = 0xff;
};
Vector<TEVStageTexInfo, DNA_COUNT(tevStageCount)> tevStageTexInfo;
Vector<TEVStageTexInfo, AT_DNA_COUNT(tevStageCount)> tevStageTexInfo;
Value<atUint32> tcgCount = 0;
struct TexCoordGen : BigDNA
@ -245,7 +245,7 @@ struct MaterialSet : BigDNA
GX::PTTexMtx postMtx() const {return GX::PTTexMtx((flags >> 15 & 0x3f) + 64);}
void setPostMtx(GX::PTTexMtx val) {flags &= ~0x1f8000; flags |= (atUint32(val)-64) << 15;}
};
Vector<TexCoordGen, DNA_COUNT(tcgCount)> tcgs;
Vector<TexCoordGen, AT_DNA_COUNT(tcgCount)> tcgs;
Value<atUint32> uvAnimsSize = 4;
Value<atUint32> uvAnimsCount = 0;
@ -270,7 +270,7 @@ struct MaterialSet : BigDNA
UVAnimation(const std::string& gameFunction,
const std::vector<atVec4f>& gameArgs);
};
Vector<UVAnimation, DNA_COUNT(uvAnimsCount)> uvAnims;
Vector<UVAnimation, AT_DNA_COUNT(uvAnimsCount)> uvAnims;
static void AddTexture(hecl::blender::PyOutStream& out,
GX::TexGenSrc type, int mtxIdx, uint32_t texIdx);
@ -293,7 +293,7 @@ struct MaterialSet : BigDNA
bool matrixSkinning,
atUint32 grpIdx);
};
Vector<Material, DNA_COUNT(head.materialCount)> materials;
Vector<Material, AT_DNA_COUNT(head.materialCount)> materials;
static void RegisterMaterialProps(hecl::blender::PyOutStream& out);
static void ConstructMaterial(hecl::blender::PyOutStream& out,
@ -366,13 +366,13 @@ struct HMDLMaterialSet : BigDNA
MaterialSet::Material::Flags flags;
Value<atUint32> textureCount = 0;
Vector<atUint32, DNA_COUNT(textureCount)> textureIdxs;
Vector<atUint32, AT_DNA_COUNT(textureCount)> textureIdxs;
Vector<atUint32, DNA_COUNT(flags.samusReflectionIndirectTexture())> indTexSlot;
Vector<atUint32, AT_DNA_COUNT(flags.samusReflectionIndirectTexture())> indTexSlot;
Value<atUint32> uvAnimsSize = 4;
Value<atUint32> uvAnimsCount = 0;
Vector<MaterialSet::Material::UVAnimation, DNA_COUNT(uvAnimsCount)> uvAnims;
Vector<MaterialSet::Material::UVAnimation, AT_DNA_COUNT(uvAnimsCount)> uvAnims;
String<-1> heclSource;
hecl::Frontend::IR heclIr;
@ -384,7 +384,7 @@ struct HMDLMaterialSet : BigDNA
const std::unordered_map<std::string, int32_t>& iprops,
const std::vector<hecl::ProjectPath>& texPaths);
};
Vector<Material, DNA_COUNT(head.materialCount)> materials;
Vector<Material, AT_DNA_COUNT(head.materialCount)> materials;
};
}

View File

@ -21,10 +21,10 @@ struct CSKR : BigDNA
Value<atUint32> boneId;
Value<float> weight;
};
Vector<Weight, DNA_COUNT(weightCount)> weights;
Vector<Weight, AT_DNA_COUNT(weightCount)> weights;
Value<atUint32> vertCount;
};
Vector<SkinningRule, DNA_COUNT(skinningRuleCount)> skinningRules;
Vector<SkinningRule, AT_DNA_COUNT(skinningRuleCount)> skinningRules;
const atInt16* getMatrixBank(size_t) const
{

View File

@ -30,19 +30,19 @@ struct DCLN : BigDNA
Value<atUint32> version;
Value<atUint32> memSize;
Value<atUint32> materialCount;
Vector<Material, DNA_COUNT(materialCount)> materials;
Vector<Material, AT_DNA_COUNT(materialCount)> materials;
Value<atUint32> vertMatsCount;
Vector<atUint8, DNA_COUNT(vertMatsCount)> vertMats;
Vector<atUint8, AT_DNA_COUNT(vertMatsCount)> vertMats;
Value<atUint32> edgeMatsCount;
Vector<atUint8, DNA_COUNT(edgeMatsCount)> edgeMats;
Vector<atUint8, AT_DNA_COUNT(edgeMatsCount)> edgeMats;
Value<atUint32> triMatsCount;
Vector<atUint8, DNA_COUNT(triMatsCount)> triMats;
Vector<atUint8, AT_DNA_COUNT(triMatsCount)> triMats;
Value<atUint32> edgeVertsCount;
Vector<Edge, DNA_COUNT(edgeVertsCount)> edgeVertConnections;
Vector<Edge, AT_DNA_COUNT(edgeVertsCount)> edgeVertConnections;
Value<atUint32> triangleEdgesCount;
Vector<Triangle, DNA_COUNT(triangleEdgesCount / 3)> triangleEdgeConnections;
Vector<Triangle, AT_DNA_COUNT(triangleEdgesCount / 3)> triangleEdgeConnections;
Value<atUint32> vertCount;
Vector<atVec3f, DNA_COUNT(vertCount)> verts;
Vector<atVec3f, AT_DNA_COUNT(vertCount)> verts;
struct Node : BigDNA
{
@ -52,7 +52,7 @@ struct DCLN : BigDNA
{
AT_DECL_DNA
Value<atUint32> triangleIndexCount;
Vector<atUint16, DNA_COUNT(triangleIndexCount)> triangleIndices;
Vector<atUint16, AT_DNA_COUNT(triangleIndexCount)> triangleIndices;
size_t getMemoryUsage() const { return (((triangleIndices.size() * 2) + 16) + 3) & ~3; }
};
@ -92,7 +92,7 @@ struct DCLN : BigDNA
};
Vector<Collision, DNA_COUNT(colCount)> collision;
Vector<Collision, AT_DNA_COUNT(colCount)> collision;
void sendToBlender(hecl::blender::Connection& conn, std::string_view entryName);

View File

@ -124,21 +124,21 @@ struct DeafBabe : BigDNA
Value<atVec3f> aabb[2];
Value<BspNodeType> rootNodeType;
Value<atUint32> bspSize;
Buffer<DNA_COUNT(bspSize)> bspTree;
Buffer<AT_DNA_COUNT(bspSize)> bspTree;
Value<atUint32> materialCount;
Vector<Material, DNA_COUNT(materialCount)> materials;
Vector<Material, AT_DNA_COUNT(materialCount)> materials;
Value<atUint32> vertMatsCount;
Vector<atUint8, DNA_COUNT(vertMatsCount)> vertMats;
Vector<atUint8, AT_DNA_COUNT(vertMatsCount)> vertMats;
Value<atUint32> edgeMatsCount;
Vector<atUint8, DNA_COUNT(edgeMatsCount)> edgeMats;
Vector<atUint8, AT_DNA_COUNT(edgeMatsCount)> edgeMats;
Value<atUint32> triMatsCount;
Vector<atUint8, DNA_COUNT(triMatsCount)> triMats;
Vector<atUint8, AT_DNA_COUNT(triMatsCount)> triMats;
Value<atUint32> edgeVertsCount;
Vector<Edge, DNA_COUNT(edgeVertsCount)> edgeVertConnections;
Vector<Edge, AT_DNA_COUNT(edgeVertsCount)> edgeVertConnections;
Value<atUint32> triangleEdgesCount;
Vector<Triangle, DNA_COUNT(triangleEdgesCount / 3)> triangleEdgeConnections;
Vector<Triangle, AT_DNA_COUNT(triangleEdgesCount / 3)> triangleEdgeConnections;
Value<atUint32> vertCount;
Vector<atVec3f, DNA_COUNT(vertCount)> verts;
Vector<atVec3f, AT_DNA_COUNT(vertCount)> verts;
/* Dummy MP2 member */
void insertNoClimb(hecl::blender::PyOutStream&) const {}

View File

@ -48,7 +48,7 @@ struct EVNT : BigDNA
Value<atUint8> value;
};
Value<atUint32> boolPOICount;
Vector<BoolPOINode, DNA_COUNT(boolPOICount)> boolPOINodes;
Vector<BoolPOINode, AT_DNA_COUNT(boolPOICount)> boolPOINodes;
struct Int32POINode : POINode
{
@ -57,7 +57,7 @@ struct EVNT : BigDNA
String<-1> locator;
};
Value<atUint32> int32POICount;
Vector<Int32POINode, DNA_COUNT(int32POICount)> int32POINodes;
Vector<Int32POINode, AT_DNA_COUNT(int32POICount)> int32POINodes;
struct ParticlePOINode : POINode
{
@ -70,7 +70,7 @@ struct EVNT : BigDNA
Value<atUint32> parentMode;
};
Value<atUint32> particlePOICount;
Vector<ParticlePOINode, DNA_COUNT(particlePOICount)> particlePOINodes;
Vector<ParticlePOINode, AT_DNA_COUNT(particlePOICount)> particlePOINodes;
struct SoundPOINode : POINode
{
@ -80,7 +80,7 @@ struct EVNT : BigDNA
Value<float> maxDist;
};
Value<atUint32> soundPOICount;
Vector<SoundPOINode, DNA_COUNT(soundPOICount)> soundPOINodes;
Vector<SoundPOINode, AT_DNA_COUNT(soundPOICount)> soundPOINodes;
static bool Extract(PAKEntryReadStream& rs, const hecl::ProjectPath& outPath)
{

View File

@ -296,15 +296,15 @@ struct FRME : BigDNA
Value<atUint32> unk1;
Value<atUint32> unk2;
Value<atUint32> quadCoordCount;
Vector<atVec3f, DNA_COUNT(quadCoordCount)> quadCoords;
Vector<atVec3f, AT_DNA_COUNT(quadCoordCount)> quadCoords;
Value<atUint32> uvCoordCount;
Vector<atVec2f, DNA_COUNT(uvCoordCount)> uvCoords;
Vector<atVec2f, AT_DNA_COUNT(uvCoordCount)> uvCoords;
FourCC fourcc() const { return FOURCC('IMGP'); }
};
};
Vector<Widget, DNA_COUNT(widgetCount)> widgets;
Vector<Widget, AT_DNA_COUNT(widgetCount)> widgets;
static bool Extract(const SpecBase& dataSpec,
PAKEntryReadStream& rs,
const hecl::ProjectPath& outPath,

View File

@ -30,10 +30,10 @@ struct HINT : BigDNA
};
Value<atUint32> locationCount;
Vector<Location, DNA_COUNT(locationCount)> locations;
Vector<Location, AT_DNA_COUNT(locationCount)> locations;
};
Value<atUint32> hintCount;
Vector<Hint, DNA_COUNT(hintCount)> hints;
Vector<Hint, AT_DNA_COUNT(hintCount)> hints;
static bool Extract(PAKEntryReadStream& rs, const hecl::ProjectPath& outPath)

View File

@ -314,7 +314,8 @@ bool MLVL::Cook(const hecl::ProjectPath& outPath, const hecl::ProjectPath& inPat
}
}
urde::SObjectTag pathTag = g_curSpec->buildTagFromPath(areaPath.ensureAuxInfo(_S("PATH")), btok);
hecl::ProjectPath pathPath(areaPath.getParentPath(), _S("!path.blend"));
urde::SObjectTag pathTag = g_curSpec->buildTagFromPath(pathPath, btok);
if (pathTag.id.IsValid())
areaOut.deps.emplace_back(pathTag.id.Value(), pathTag.type);

View File

@ -26,7 +26,7 @@ struct MLVL : BigDNA
Value<atUint16> msg;
Value<bool> active;
};
Vector<MemRelayLink, DNA_COUNT(memRelayLinkCount)> memRelayLinks;
Vector<MemRelayLink, AT_DNA_COUNT(memRelayLinkCount)> memRelayLinks;
Value<atUint32> areaCount;
Value<atUint32> unknown1;
@ -40,7 +40,7 @@ struct MLVL : BigDNA
Value<atUint32> areaId;
Value<atUint32> attachedAreaCount;
Vector<atUint16, DNA_COUNT(attachedAreaCount)> attachedAreas;
Vector<atUint16, AT_DNA_COUNT(attachedAreaCount)> attachedAreas;
Value<atUint32> padding;
Value<atUint32> depCount;
@ -54,10 +54,10 @@ struct MLVL : BigDNA
Dependency(const UniqueID32& idin, const hecl::FourCC& fcc)
: id(idin), type(fcc) {}
};
Vector<Dependency, DNA_COUNT(depCount)> deps;
Vector<Dependency, AT_DNA_COUNT(depCount)> deps;
Value<atUint32> depLayerCount;
Vector<atUint32, DNA_COUNT(depLayerCount)> depLayers;
Vector<atUint32, AT_DNA_COUNT(depLayerCount)> depLayers;
Value<atUint32> dockCount;
struct Dock : BigDNA
@ -70,14 +70,14 @@ struct MLVL : BigDNA
Value<atUint32> areaIdx;
Value<atUint32> dockIdx;
};
Vector<Endpoint, DNA_COUNT(endpointCount)> endpoints;
Vector<Endpoint, AT_DNA_COUNT(endpointCount)> endpoints;
Value<atUint32> planeVertCount;
Vector<atVec3f, DNA_COUNT(planeVertCount)> planeVerts;
Vector<atVec3f, AT_DNA_COUNT(planeVertCount)> planeVerts;
};
Vector<Dock, DNA_COUNT(dockCount)> docks;
Vector<Dock, AT_DNA_COUNT(dockCount)> docks;
};
Vector<Area, DNA_COUNT(areaCount)> areas;
Vector<Area, AT_DNA_COUNT(areaCount)> areas;
void finishLastArea()
{
@ -102,7 +102,7 @@ struct MLVL : BigDNA
Value<atUint32> groupId;
UniqueID32 agscId;
};
Vector<AudioGroup, DNA_COUNT(audioGroupCount)> audioGroups;
Vector<AudioGroup, AT_DNA_COUNT(audioGroupCount)> audioGroups;
String<-1> unkString;
Value<atUint32> layerFlagCount;
@ -112,13 +112,13 @@ struct MLVL : BigDNA
Value<atUint32> layerCount;
Value<atUint64> flags;
};
Vector<LayerFlags, DNA_COUNT(layerFlagCount)> layerFlags;
Vector<LayerFlags, AT_DNA_COUNT(layerFlagCount)> layerFlags;
Value<atUint32> layerNameCount;
Vector<String<-1>, DNA_COUNT(layerNameCount)> layerNames;
Vector<String<-1>, AT_DNA_COUNT(layerNameCount)> layerNames;
Value<atUint32> layerNameOffsetCount;
Vector<atUint32, DNA_COUNT(layerNameOffsetCount)> layerNameOffsets;
Vector<atUint32, AT_DNA_COUNT(layerNameOffsetCount)> layerNameOffsets;
void readMeta(athena::io::YAMLDocReader& __dna_docin)
{

View File

@ -798,7 +798,8 @@ bool MREA::PCCook(const hecl::ProjectPath& outPath,
/* PATH */
{
UniqueID32 pathId = inPath.ensureAuxInfo(_S("PATH"));
hecl::ProjectPath pathPath(inPath.getParentPath(), _S("!path.blend"));
UniqueID32 pathId = pathPath;
secs.emplace_back(4, 0);
athena::io::MemoryWriter w(secs.back().data(), secs.back().size());
pathId.write(w);
@ -826,31 +827,4 @@ bool MREA::PCCook(const hecl::ProjectPath& outPath,
return true;
}
bool MREA::CookPath(const hecl::ProjectPath& outPath,
const hecl::ProjectPath& inPath)
{
PATH path = {};
path.version = 4;
path.octreeNodeCount = 1;
path.octree.emplace_back();
PATH::OctreeNode& s = path.octree.back();
s.isLeaf = 1;
s.points[0] = atVec3f{FLT_MAX, FLT_MAX, FLT_MAX};
s.points[1] = atVec3f{-FLT_MAX, -FLT_MAX, -FLT_MAX};
s.points[2] = atVec3f{0.f, 0.f, 0.f};
for (int i=0 ; i<8 ; ++i)
s.children[i] = 0xffffffff;
s.regionCount = 0;
s.regionStart = 0;
athena::io::FileWriter w(outPath.getAbsolutePath());
path.write(w);
int64_t rem = w.position() % 32;
if (rem)
for (int64_t i=0 ; i<32-rem ; ++i)
w.writeUByte(0xff);
return true;
}
}

View File

@ -26,7 +26,7 @@ struct MREA
Value<atUint32> visiSecIdx;
Value<atUint32> pathSecIdx;
Value<atUint32> arotSecIdx;
Vector<atUint32, DNA_COUNT(secCount)> secSizes;
Vector<atUint32, AT_DNA_COUNT(secCount)> secSizes;
};
struct MeshHeader : BigDNA
@ -137,9 +137,6 @@ struct MREA
const ColMesh& cMesh,
const std::vector<Light>& lights,
hecl::blender::Token& btok);
static bool CookPath(const hecl::ProjectPath& outPath,
const hecl::ProjectPath& inPath);
};
}

View File

@ -22,7 +22,7 @@ struct PAK : BigDNA
DNAFourCC type;
UniqueID32 id;
Value<atUint32> nameLen;
String<DNA_COUNT(nameLen)> name;
String<AT_DNA_COUNT(nameLen)> name;
};
struct Entry : BigDNA

View File

@ -1,6 +1,7 @@
#include "PATH.hpp"
#include "hecl/Blender/Connection.hpp"
#include <unordered_set>
#include "zeus/CAABox.hpp"
#include "../DNACommon/AROTBuilder.hpp"
namespace DataSpec::DNAMP1
{
@ -14,18 +15,41 @@ void PATH::sendToBlender(hecl::blender::Connection& conn, std::string_view entry
"import bmesh\n"
"from mathutils import Vector, Matrix\n"
"\n"
"bpy.types.Material.retro_path_idx_mask = bpy.props.IntProperty(name='Retro: Path Index Mask')\n"
"bpy.types.Material.retro_path_type_mask = bpy.props.IntProperty(name='Retro: Path Type Mask')\n"
"\n"
"material_dict = {}\n"
"material_index = []\n"
"def select_material(data):\n"
" if data in material_index:\n"
" return material_index.index(data)\n"
" elif data in material_dict:\n"
" material_index.append(data)\n"
"def make_ground_material(idxMask):\n"
" mat = bpy.data.materials.new('Ground %%X' %% idxMask)\n"
" mat.diffuse_color = (0.8, 0.460, 0.194)\n"
" return mat\n"
"def make_flyer_material(idxMask):\n"
" mat = bpy.data.materials.new('Flyer %%X' %% idxMask)\n"
" mat.diffuse_color = (0.016, 0.8, 0.8)\n"
" return mat\n"
"def make_swimmer_material(idxMask):\n"
" mat = bpy.data.materials.new('Swimmer %%X' %% idxMask)\n"
" mat.diffuse_color = (0.074, 0.293, 0.8)\n"
" return mat\n"
"def select_material(meshIdxMask, meshTypeMask):\n"
" key = (meshIdxMask, meshTypeMask)\n"
" if key in material_index:\n"
" return material_index.index(key)\n"
" elif key in material_dict:\n"
" material_index.append(key)\n"
" return len(material_index)-1\n"
" else:\n"
" mat = bpy.data.materials.new(data)\n"
" material_dict[data] = mat\n"
" material_index.append(data)\n"
" if meshTypeMask == 0x2:\n"
" mat = make_flyer_material(meshIdxMask)\n"
" elif meshTypeMask == 0x4:\n"
" mat = make_swimmer_material(meshIdxMask)\n"
" else:\n"
" mat = make_ground_material(meshIdxMask)\n"
" mat.retro_path_idx_mask = meshIdxMask\n"
" mat.retro_path_type_mask = meshTypeMask\n"
" material_dict[key] = mat\n"
" material_index.append(key)\n"
" return len(material_index)-1\n"
"\n"
"bpy.context.scene.name = '%s'\n"
@ -35,7 +59,8 @@ void PATH::sendToBlender(hecl::blender::Connection& conn, std::string_view entry
" bpy.context.scene.objects.unlink(ob)\n"
" bpy.data.objects.remove(ob)\n"
"\n"
"bm = bmesh.new()\n",
"bm = bmesh.new()\n"
"height_lay = bm.faces.layers.float.new('Height')\n",
entryName.data());
for (const Node& n : nodes)
@ -50,23 +75,38 @@ void PATH::sendToBlender(hecl::blender::Connection& conn, std::string_view entry
for (int i=0 ; i<r.nodeCount ; ++i)
os.format("tri_verts.append(bm.verts[%u])\n", r.nodeStart + i);
zeus::CVector3f centroid = r.centroid;
if (xf)
centroid = xf->multiplyOneOverW(centroid);
os.format("face = bm.faces.get(tri_verts)\n"
"if face is None:\n"
" face = bm.faces.new(tri_verts)\n"
" face.normal_flip()\n"
"face.material_index = select_material('0x%08X')\n"
"face.material_index = select_material(0x%04X, 0x%04X)\n"
"face.smooth = False\n"
"hobj = bpy.data.objects.new('Height', None)\n"
"hobj.location = (%f,%f,%f)\n"
"hobj.layers[1] = True\n"
"bpy.context.scene.objects.link(hobj)\n"
"\n", r.flags, centroid.v[0], centroid.v[1], centroid.v[2] + r.height);
"face[height_lay] = %f\n"
"\n", r.meshIndexMask, r.meshTypeMask, r.height);
#if 0
zeus::CVector3f center = xf->multiplyOneOverW(r.centroid);
zeus::CAABox aabb(xf->multiplyOneOverW(r.aabb[0]), xf->multiplyOneOverW(r.aabb[1]));
os.format("aabb = bpy.data.objects.new('AABB', None)\n"
"aabb.location = (%f,%f,%f)\n"
"aabb.scale = (%f,%f,%f)\n"
"aabb.empty_draw_type = 'CUBE'\n"
"bpy.context.scene.objects.link(aabb)\n"
"centr = bpy.data.objects.new('Center', None)\n"
"centr.location = (%f,%f,%f)\n"
"bpy.context.scene.objects.link(centr)\n",
aabb.min.v[0] + (aabb.max.v[0] - aabb.min.v[0]) / 2.f,
aabb.min.v[1] + (aabb.max.v[1] - aabb.min.v[1]) / 2.f,
aabb.min.v[2] + (aabb.max.v[2] - aabb.min.v[2]) / 2.f,
(aabb.max.v[0] - aabb.min.v[0]) / 2.f,
(aabb.max.v[1] - aabb.min.v[1]) / 2.f,
(aabb.max.v[2] - aabb.min.v[2]) / 2.f,
center.x, center.y, center.z);
#endif
}
os << "path_mesh = bpy.data.meshes.new('PATH')\n"
os << "bmesh.ops.remove_doubles(bm, verts=bm.verts, dist=0.001)\n"
"path_mesh = bpy.data.meshes.new('PATH')\n"
"bm.to_mesh(path_mesh)\n"
"path_mesh_obj = bpy.data.objects.new(path_mesh.name, path_mesh)\n"
"\n"
@ -129,7 +169,11 @@ bool PATH::Cook(const hecl::ProjectPath& outPath,
const PathMesh& mesh,
hecl::blender::Connection* conn)
{
athena::io::MemoryReader r(mesh.data.data(), mesh.data.size());
PATH path;
path.read(r);
AROTBuilder octreeBuilder;
octreeBuilder.buildPath(path);
athena::io::FileWriter w(outPath.getAbsolutePath());
path.write(w);

View File

@ -21,7 +21,7 @@ struct PATH : BigDNA
Value<atVec3f> normal;
};
Value<atUint32> nodeCount;
Vector<Node, DNA_COUNT(nodeCount)> nodes;
Vector<Node, AT_DNA_COUNT(nodeCount)> nodes;
struct Link : BigDNA
{
@ -32,7 +32,7 @@ struct PATH : BigDNA
Value<float> oneOverWidth2d;
};
Value<atUint32> linkCount;
Vector<Link, DNA_COUNT(linkCount)> links;
Vector<Link, AT_DNA_COUNT(linkCount)> links;
struct Region : BigDNA
{
@ -41,7 +41,8 @@ struct PATH : BigDNA
Value<atUint32> nodeStart;
Value<atUint32> linkCount;
Value<atUint32> linkStart;
Value<atUint32> flags;
Value<atUint16> meshIndexMask;
Value<atUint16> meshTypeMask;
Value<float> height;
Value<atVec3f> normal;
Value<atUint32> regionIdx;
@ -50,26 +51,27 @@ struct PATH : BigDNA
Value<atUint32> regionIdxPtr;
};
Value<atUint32> regionCount;
Vector<Region, DNA_COUNT(regionCount)> regions;
Vector<Region, AT_DNA_COUNT(regionCount)> regions;
Vector<atUint32, DNA_COUNT((((regionCount * (regionCount - 1)) / 2) + 31) / 32)> bitmap1;
Vector<atUint32, DNA_COUNT(bitmap1.size())> bitmap2;
Vector<atUint32, DNA_COUNT(((((regionCount * regionCount) + 31) / 32) - bitmap1.size()) * 2)> bitmap3;
Vector<atUint32, AT_DNA_COUNT((((regionCount * (regionCount - 1)) / 2) + 31) / 32)> bitmap1;
Vector<atUint32, AT_DNA_COUNT(bitmap1.size())> bitmap2;
Vector<atUint32, AT_DNA_COUNT(((((regionCount * regionCount) + 31) / 32) - bitmap1.size()) * 2)> bitmap3;
Value<atUint32> octreeRegionLookupCount;
Vector<atUint32, DNA_COUNT(octreeRegionLookupCount)> octreeRegionLookup;
Vector<atUint32, AT_DNA_COUNT(octreeRegionLookupCount)> octreeRegionLookup;
struct OctreeNode : BigDNA
{
AT_DECL_DNA
Value<atUint32> isLeaf;
Value<atVec3f> points[3];
Value<atVec3f> aabb[2];
Value<atVec3f> centroid;
Value<atUint32> children[8];
Value<atUint32> regionCount;
Value<atUint32> regionStart;
};
Value<atUint32> octreeNodeCount;
Vector<OctreeNode, DNA_COUNT(octreeNodeCount)> octree;
Vector<OctreeNode, AT_DNA_COUNT(octreeNodeCount)> octree;
void sendToBlender(hecl::blender::Connection& conn, std::string_view entryName,
const zeus::CMatrix4f* xf);

View File

@ -21,15 +21,15 @@ struct SAVW : BigDNA
AT_DECL_DNA_YAML
SAVWCommon::Header header;
Value<atUint32> skippableCutsceneCount;
Vector<atUint32, DNA_COUNT(skippableCutsceneCount)> skippableCutscenes;
Vector<atUint32, AT_DNA_COUNT(skippableCutsceneCount)> skippableCutscenes;
Value<atUint32> relayCount;
Vector<atUint32, DNA_COUNT(relayCount)> relays;
Vector<atUint32, AT_DNA_COUNT(relayCount)> relays;
Value<atUint32> layerCount;
Vector<SAVWCommon::Layer, DNA_COUNT(layerCount)> layers;
Vector<SAVWCommon::Layer, AT_DNA_COUNT(layerCount)> layers;
Value<atUint32> doorCount;
Vector<atUint32, DNA_COUNT(doorCount)> doors;
Vector<atUint32, AT_DNA_COUNT(doorCount)> doors;
Value<atUint32> scanCount;
Vector<Scan, DNA_COUNT(scanCount)> scans;
Vector<Scan, AT_DNA_COUNT(scanCount)> scans;
};
}

View File

@ -14,19 +14,19 @@ struct SCLY : BigDNA
Value<atUint32> version;
Value<atUint32> layerCount;
Vector<atUint32, DNA_COUNT(layerCount)> layerSizes;
Vector<atUint32, AT_DNA_COUNT(layerCount)> layerSizes;
struct ScriptLayer : BigDNA
{
AT_DECL_EXPLICIT_DNA_YAML
Value<atUint8> unknown;
Value<atUint32> objectCount;
Vector<std::unique_ptr<IScriptObject>, DNA_COUNT(objectCount)> objects;
Vector<std::unique_ptr<IScriptObject>, AT_DNA_COUNT(objectCount)> objects;
void addCMDLRigPairs(PAKRouter<PAKBridge>& pakRouter,
std::unordered_map<UniqueID32, std::pair<UniqueID32, UniqueID32>>& addTo) const;
void nameIDs(PAKRouter<PAKBridge>& pakRouter) const;
};
Vector<ScriptLayer, DNA_COUNT(layerCount)> layers;
Vector<ScriptLayer, AT_DNA_COUNT(layerCount)> layers;
void exportToLayerDirectories(const PAK::Entry &, PAKRouter<PAKBridge>&, bool) const;
void addCMDLRigPairs(PAKRouter<PAKBridge>& pakRouter,

View File

@ -37,7 +37,7 @@ struct IScriptObject : BigDNAVYaml
};
Value<atUint32> connectionCount;
Vector<Connection, DNA_COUNT(connectionCount)> connections;
Vector<Connection, AT_DNA_COUNT(connectionCount)> connections;
Value<atUint32> propertyCount;
virtual ~IScriptObject() = default;

View File

@ -383,7 +383,7 @@ struct PlayerParameters : BigDNA
{
AT_DECL_DNA_YAML
Value<atUint32> propertyCount;
Vector<bool, DNA_COUNT(propertyCount)> bools;
Vector<bool, AT_DNA_COUNT(propertyCount)> bools;
};
struct ActorParameters : BigDNA

View File

@ -74,7 +74,7 @@ struct CTweakAutoMapper final : public ITweakAutoMapper
DNAColor xf8_;
DNAColor xfc_;
Value<atUint32> x100_doorColorCount;
Vector<DNAColor, DNA_COUNT(x100_doorColorCount)> x104_doorColors;
Vector<DNAColor, AT_DNA_COUNT(x100_doorColorCount)> x104_doorColors;
DNAColor x118_doorBorderColor;
DNAColor x11c_openDoorColor;

View File

@ -162,7 +162,7 @@ struct CTweakGui final : ITweakGui
Value<float> x2bc_hudLightAttMulLinear;
Value<float> x2c0_hudLightAttMulQuadratic;
Value<atUint32> m_scanSpeedsCount;
Vector<float, DNA_COUNT(m_scanSpeedsCount)> x2c4_scanSpeeds;
Vector<float, AT_DNA_COUNT(m_scanSpeedsCount)> x2c4_scanSpeeds;
String<-1> x2d0_;
String<-1> x2e0_;
String<-1> x2f0_;

View File

@ -133,7 +133,7 @@ struct CTweakGuiColors final : public ITweakGuiColors
};
Value<atUint32> x1c4_perVisorCount;
/* Combat, Scan, XRay, Thermal, Ball */
Vector<PerVisorColors, DNA_COUNT(x1c4_perVisorCount)> x1c4_perVisorColors;
Vector<PerVisorColors, AT_DNA_COUNT(x1c4_perVisorCount)> x1c4_perVisorColors;
CTweakGuiColors() = default;
CTweakGuiColors(athena::io::IStreamReader& r) { this->read(r); }

View File

@ -9,7 +9,7 @@ namespace DataSpec::DNAMP1
struct CTweakPlayerControl final : ITweakPlayerControl
{
AT_DECL_DNA_YAML
Vector<atUint32, DNA_COUNT(67)> m_mappings;
Vector<atUint32, AT_DNA_COUNT(67)> m_mappings;
atUint32 GetMapping(atUint32 command) const {return m_mappings[command];}
CTweakPlayerControl() = default;
CTweakPlayerControl(athena::io::IStreamReader& reader) {this->read(reader);}

View File

@ -62,11 +62,11 @@ struct CTweakTargeting final : public ITweakTargeting
{
AT_DECL_DNA
Value<atUint32> count;
Vector<float, DNA_COUNT(count)> floats;
Vector<float, AT_DNA_COUNT(count)> floats;
};
Vector<UnkVec, DNA_COUNT(xf8_outerBeamSquareAngleCount)> xf8_outerBeamSquareAngles;
Vector<UnkVec, AT_DNA_COUNT(xf8_outerBeamSquareAngleCount)> xf8_outerBeamSquareAngles;
Value<atUint32> x108_chargeGaugeAngleCount;
Vector<float, DNA_COUNT(x108_chargeGaugeAngleCount)> x108_chargeGaugeAngles;
Vector<float, AT_DNA_COUNT(x108_chargeGaugeAngleCount)> x108_chargeGaugeAngles;
Value<float> x118_chargeGaugeScale;
DNAColor x11c_chargeGaugeNonFullColor;
Value<atUint32> x120_chargeTickCount;

View File

@ -77,7 +77,7 @@ struct ANCS : BigDNA
Value<atUint32> unk2;
Value<atUint32> unk3;
};
Vector<EffectComponent, DNA_COUNT(compCount)> comps;
Vector<EffectComponent, AT_DNA_COUNT(compCount)> comps;
};
std::vector<Effect> effects;
@ -97,7 +97,7 @@ struct ANCS : BigDNA
};
std::vector<Extents> extents;
};
Vector<CharacterInfo, DNA_COUNT(characterCount)> characters;
Vector<CharacterInfo, AT_DNA_COUNT(characterCount)> characters;
} characterSet;
struct AnimationSet : BigDNA
@ -145,7 +145,7 @@ struct ANCS : BigDNA
Value<atUint8> flag;
};
Value<atUint32> loopEventCount;
Vector<LoopEvent, DNA_COUNT(loopEventCount)> loopEvents;
Vector<LoopEvent, AT_DNA_COUNT(loopEventCount)> loopEvents;
struct UEVTEvent : EventBase
{
@ -154,7 +154,7 @@ struct ANCS : BigDNA
String<-1> boneName;
};
Value<atUint32> uevtEventCount;
Vector<UEVTEvent, DNA_COUNT(uevtEventCount)> uevtEvents;
Vector<UEVTEvent, AT_DNA_COUNT(uevtEventCount)> uevtEvents;
struct EffectEvent : EventBase
{
@ -167,7 +167,7 @@ struct ANCS : BigDNA
Value<atUint32> parentMode;
};
Value<atUint32> effectEventCount;
Vector<EffectEvent, DNA_COUNT(effectEventCount)> effectEvents;
Vector<EffectEvent, AT_DNA_COUNT(effectEventCount)> effectEvents;
struct SFXEvent : EventBase
{
@ -181,7 +181,7 @@ struct ANCS : BigDNA
Value<float> sfxUnk4;
};
Value<atUint32> sfxEventCount;
Vector<SFXEvent, DNA_COUNT(sfxEventCount)> sfxEvents;
Vector<SFXEvent, AT_DNA_COUNT(sfxEventCount)> sfxEvents;
};
std::vector<EVNT> evnts;
} animationSet;

View File

@ -20,12 +20,12 @@ struct CINF : BigDNA
Value<atVec4f> q1;
Value<atVec4f> q2;
Value<atUint32> linkedCount;
Vector<atUint32, DNA_COUNT(linkedCount)> linked;
Vector<atUint32, AT_DNA_COUNT(linkedCount)> linked;
};
Vector<Bone, DNA_COUNT(boneCount)> bones;
Vector<Bone, AT_DNA_COUNT(boneCount)> bones;
Value<atUint32> boneIdCount;
Vector<atUint32, DNA_COUNT(boneIdCount)> boneIds;
Vector<atUint32, AT_DNA_COUNT(boneIdCount)> boneIds;
Value<atUint32> nameCount;
struct Name : BigDNA
@ -34,7 +34,7 @@ struct CINF : BigDNA
String<-1> name;
Value<atUint32> boneId;
};
Vector<Name, DNA_COUNT(nameCount)> names;
Vector<Name, AT_DNA_COUNT(nameCount)> names;
atUint32 getInternalBoneIdxFromId(atUint32 id) const;
atUint32 getBoneIdxFromId(atUint32 id) const;

View File

@ -25,7 +25,7 @@ struct MaterialSet : BigDNA
const Flags& getFlags() const {return flags;}
Value<atUint32> textureCount;
Vector<atUint32, DNA_COUNT(textureCount)> textureIdxs;
Vector<atUint32, AT_DNA_COUNT(textureCount)> textureIdxs;
using VAFlags = DNAMP1::MaterialSet::Material::VAFlags;
DNAMP1::MaterialSet::Material::VAFlags vaFlags;
const VAFlags& getVAFlags() const {return vaFlags;}
@ -33,29 +33,29 @@ struct MaterialSet : BigDNA
Value<atUint32> unk1; /* MP2 only */
Value<atUint32> groupIdx;
Vector<atUint32, DNA_COUNT(flags.konstValuesEnabled())> konstCount;
Vector<GX::Color, DNA_COUNT(flags.konstValuesEnabled() ? konstCount[0] : 0)> konstColors;
Vector<atUint32, AT_DNA_COUNT(flags.konstValuesEnabled())> konstCount;
Vector<GX::Color, AT_DNA_COUNT(flags.konstValuesEnabled() ? konstCount[0] : 0)> konstColors;
using BlendFactor = GX::BlendFactor;
Value<BlendFactor> blendDstFac;
Value<BlendFactor> blendSrcFac;
Vector<atUint32, DNA_COUNT(flags.samusReflectionIndirectTexture())> indTexSlot;
Vector<atUint32, AT_DNA_COUNT(flags.samusReflectionIndirectTexture())> indTexSlot;
Value<atUint32> colorChannelCount;
Vector<DNAMP1::MaterialSet::Material::ColorChannel, DNA_COUNT(colorChannelCount)> colorChannels;
Vector<DNAMP1::MaterialSet::Material::ColorChannel, AT_DNA_COUNT(colorChannelCount)> colorChannels;
Value<atUint32> tevStageCount;
Vector<DNAMP1::MaterialSet::Material::TEVStage, DNA_COUNT(tevStageCount)> tevStages;
Vector<DNAMP1::MaterialSet::Material::TEVStageTexInfo, DNA_COUNT(tevStageCount)> tevStageTexInfo;
Vector<DNAMP1::MaterialSet::Material::TEVStage, AT_DNA_COUNT(tevStageCount)> tevStages;
Vector<DNAMP1::MaterialSet::Material::TEVStageTexInfo, AT_DNA_COUNT(tevStageCount)> tevStageTexInfo;
Value<atUint32> tcgCount;
Vector<DNAMP1::MaterialSet::Material::TexCoordGen, DNA_COUNT(tcgCount)> tcgs;
Vector<DNAMP1::MaterialSet::Material::TexCoordGen, AT_DNA_COUNT(tcgCount)> tcgs;
Value<atUint32> uvAnimsSize;
Value<atUint32> uvAnimsCount;
Vector<DNAMP1::MaterialSet::Material::UVAnimation, DNA_COUNT(uvAnimsCount)> uvAnims;
Vector<DNAMP1::MaterialSet::Material::UVAnimation, AT_DNA_COUNT(uvAnimsCount)> uvAnims;
};
Vector<Material, DNA_COUNT(head.materialCount)> materials;
Vector<Material, AT_DNA_COUNT(head.materialCount)> materials;
static void RegisterMaterialProps(hecl::blender::PyOutStream& out)
{

View File

@ -115,23 +115,23 @@ struct DeafBabe : BigDNA
Value<atVec3f> aabb[2];
Value<BspNodeType> rootNodeType;
Value<atUint32> bspSize;
Buffer<DNA_COUNT(bspSize)> bspTree;
Buffer<AT_DNA_COUNT(bspSize)> bspTree;
Value<atUint32> materialCount;
Vector<Material, DNA_COUNT(materialCount)> materials;
Vector<Material, AT_DNA_COUNT(materialCount)> materials;
Value<atUint32> vertMatsCount;
Vector<atUint8, DNA_COUNT(vertMatsCount)> vertMats;
Vector<atUint8, AT_DNA_COUNT(vertMatsCount)> vertMats;
Value<atUint32> edgeMatsCount;
Vector<atUint8, DNA_COUNT(edgeMatsCount)> edgeMats;
Vector<atUint8, AT_DNA_COUNT(edgeMatsCount)> edgeMats;
Value<atUint32> triMatsCount;
Vector<atUint8, DNA_COUNT(triMatsCount)> triMats;
Vector<atUint8, AT_DNA_COUNT(triMatsCount)> triMats;
Value<atUint32> edgeVertsCount;
Vector<Edge, DNA_COUNT(edgeVertsCount)> edgeVertConnections;
Vector<Edge, AT_DNA_COUNT(edgeVertsCount)> edgeVertConnections;
Value<atUint32> triangleEdgesCount;
Vector<Triangle, DNA_COUNT(triangleEdgesCount / 3)> triangleEdgeConnections;
Vector<Triangle, AT_DNA_COUNT(triangleEdgesCount / 3)> triangleEdgeConnections;
Value<atUint32> noClimbEdgeCount;
Vector<atInt16, DNA_COUNT(noClimbEdgeCount)> noClimbEdges;
Vector<atInt16, AT_DNA_COUNT(noClimbEdgeCount)> noClimbEdges;
Value<atUint32> vertCount;
Vector<atVec3f, DNA_COUNT(vertCount)> verts;
Vector<atVec3f, AT_DNA_COUNT(vertCount)> verts;
static void BlenderInit(hecl::blender::PyOutStream& os);
void insertNoClimb(hecl::blender::PyOutStream& os) const;

View File

@ -30,7 +30,7 @@ struct MLVL : BigDNA
Value<atUint32> areaId;
Value<atUint32> attachedAreaCount;
Vector<atUint16, DNA_COUNT(attachedAreaCount)> attachedAreas;
Vector<atUint16, AT_DNA_COUNT(attachedAreaCount)> attachedAreas;
Value<atUint32> padding;
Value<atUint32> depCount;
@ -40,10 +40,10 @@ struct MLVL : BigDNA
UniqueID32 id;
DNAFourCC type;
};
Vector<Dependency, DNA_COUNT(depCount)> deps;
Vector<Dependency, AT_DNA_COUNT(depCount)> deps;
Value<atUint32> depLayerCount;
Vector<atUint32, DNA_COUNT(depLayerCount)> depLayers;
Vector<atUint32, AT_DNA_COUNT(depLayerCount)> depLayers;
Value<atUint32> dockCount;
struct Dock : BigDNA
@ -56,21 +56,21 @@ struct MLVL : BigDNA
Value<atUint32> areaIdx;
Value<atUint32> dockIdx;
};
Vector<Endpoint, DNA_COUNT(endpointCount)> endpoints;
Vector<Endpoint, AT_DNA_COUNT(endpointCount)> endpoints;
Value<atUint32> planeVertCount;
Vector<atVec3f, DNA_COUNT(planeVertCount)> planeVerts;
Vector<atVec3f, AT_DNA_COUNT(planeVertCount)> planeVerts;
};
Vector<Dock, DNA_COUNT(dockCount)> docks;
Vector<Dock, AT_DNA_COUNT(dockCount)> docks;
Value<atUint32> relCount;
Vector<String<-1>, DNA_COUNT(relCount)> relFilenames;
Vector<String<-1>, AT_DNA_COUNT(relCount)> relFilenames;
Value<atUint32> relOffsetCount;
Vector<atUint32, DNA_COUNT(relOffsetCount)> relOffsets;
Vector<atUint32, AT_DNA_COUNT(relOffsetCount)> relOffsets;
String<-1> internalAreaName;
};
Vector<Area, DNA_COUNT(areaCount)> areas;
Vector<Area, AT_DNA_COUNT(areaCount)> areas;
UniqueID32 worldMap;
Value<atUint8> unknown2;
@ -83,13 +83,13 @@ struct MLVL : BigDNA
Value<atUint32> layerCount;
Value<atUint64> flags;
};
Vector<LayerFlags, DNA_COUNT(layerFlagCount)> layerFlags;
Vector<LayerFlags, AT_DNA_COUNT(layerFlagCount)> layerFlags;
Value<atUint32> layerNameCount;
Vector<String<-1>, DNA_COUNT(layerNameCount)> layerNames;
Vector<String<-1>, AT_DNA_COUNT(layerNameCount)> layerNames;
Value<atUint32> layerNameOffsetCount;
Vector<atUint32, DNA_COUNT(layerNameOffsetCount)> layerNameOffsets;
Vector<atUint32, AT_DNA_COUNT(layerNameOffsetCount)> layerNameOffsets;
static bool Extract(const SpecBase& dataSpec,

View File

@ -74,7 +74,7 @@ struct MREA
Value<atUint32> egmcSecIdx;
Value<atUint32> compressedBlockCount;
Seek<12, athena::Current> align1;
Vector<atUint32, DNA_COUNT(secCount)> secSizes;
Vector<atUint32, AT_DNA_COUNT(secCount)> secSizes;
};
struct MeshHeader : BigDNA

View File

@ -23,12 +23,12 @@ struct PTLA : BigDNA
Value<atUint16> unknown5;
Value<atUint16> unknown6;
};
Vector<Entry, DNA_COUNT(count)> entries;
Vector<Entry, AT_DNA_COUNT(count)> entries;
Value<atUint16> unknown1;
Value<atVec3f> unknown2[2];
};
Value<atUint32> count1;
Vector<UnknownStruct1, DNA_COUNT(count1)> entries1;
Vector<UnknownStruct1, AT_DNA_COUNT(count1)> entries1;
struct UnknownStruct2 : BigDNA
{
@ -42,17 +42,17 @@ struct PTLA : BigDNA
Value<float> unknown3;
Value<float> unknown4;
};
Vector<Entry, DNA_COUNT(count)> entries;
Vector<Entry, AT_DNA_COUNT(count)> entries;
Value<atUint16> unknown;
};
Value<atUint32> count2;
Vector<UnknownStruct2, DNA_COUNT(count2)> entries2;
Vector<UnknownStruct2, AT_DNA_COUNT(count2)> entries2;
Value<atUint32> shortCount1;
Vector<atUint16, DNA_COUNT(shortCount1)> shorts1;
Vector<atUint16, AT_DNA_COUNT(shortCount1)> shorts1;
Value<atUint32> shortCount2;
Vector<atUint16, DNA_COUNT(shortCount2)> shorts2;
Vector<atUint16, AT_DNA_COUNT(shortCount2)> shorts2;
struct UnknownStruct3 : BigDNA
{
@ -63,7 +63,7 @@ struct PTLA : BigDNA
Value<atUint16> unknown4;
};
Value<atUint32> count3;
Vector<UnknownStruct3, DNA_COUNT(count3)> entries3;
Vector<UnknownStruct3, AT_DNA_COUNT(count3)> entries3;
};
}
#endif // __DNAMP2_PTLA_HPP__

View File

@ -10,11 +10,11 @@ struct SAVW : DNAMP1::SAVW
{
AT_DECL_DNA_YAML
Value<atUint32> systemVarCount;
Vector<SAVWCommon::EnvironmentVariable, DNA_COUNT(systemVarCount)> systemVars;
Vector<SAVWCommon::EnvironmentVariable, AT_DNA_COUNT(systemVarCount)> systemVars;
Value<atUint32> gameVarCount;
Vector<SAVWCommon::EnvironmentVariable, DNA_COUNT(gameVarCount)> gameVars;
Vector<SAVWCommon::EnvironmentVariable, AT_DNA_COUNT(gameVarCount)> gameVars;
Value<atUint32> gameObjectCount;
Vector<atUint32, DNA_COUNT(gameObjectCount)> gameObjects;
Vector<atUint32, AT_DNA_COUNT(gameObjectCount)> gameObjects;
};
}

View File

@ -14,7 +14,7 @@ struct CAUD : BigDNA
Value<atUint32> version;
String<-1> name;
Value<atUint32> nameCount;
Vector<String<-1>, DNA_COUNT(nameCount)> names;
Vector<String<-1>, AT_DNA_COUNT(nameCount)> names;
Value<float> unknown1;
Value<atUint32> unknown2;
Value<float> unknown3;
@ -49,12 +49,12 @@ struct CAUD : BigDNA
Value<atUint8> unknown4;
};
Value<atUint32> unknown15;
Vector<UnknownStruct1, DNA_COUNT(unknown15)> unknown16;
Vector<UnknownStruct1, AT_DNA_COUNT(unknown15)> unknown16;
struct UnknownStruct2 : BigDNA
{
AT_DECL_DNA_YAML
Value<atUint8> unknown1;
Vector<atUint8, DNA_COUNT(unknown1)> unknown2;
Vector<atUint8, AT_DNA_COUNT(unknown1)> unknown2;
Value<float> unknown3;
Value<float> unknown4;
Value<atUint16> unknown5;
@ -65,7 +65,7 @@ struct CAUD : BigDNA
Value<atInt32> unknown2;
};
Value<atUint16> unknown6;
Vector<UnknownPair, DNA_COUNT(unknown6)> unknown7;
Vector<UnknownPair, AT_DNA_COUNT(unknown6)> unknown7;
struct UnknownQuad: BigDNA
{
AT_DECL_EXPLICIT_DNA_YAML
@ -77,7 +77,7 @@ struct CAUD : BigDNA
};
Value<atUint16> unknown8;
Vector<UnknownQuad, DNA_COUNT(unknown8)> unknown9;
Vector<UnknownQuad, AT_DNA_COUNT(unknown8)> unknown9;
};
UnknownStruct2 unknown17[4];
Value<atUint16> unknown18;
@ -99,13 +99,13 @@ struct CAUD : BigDNA
Value<atUint8> unknown3;
Value<atUint8> unknown4;
};
Vector<UnknownStruct3, DNA_COUNT(unknown27)> unknown29;
Vector<UnknownStruct3, AT_DNA_COUNT(unknown27)> unknown29;
Value<float> unknown30;
Value<float> unknown31;
};
Value<atUint32> infoCount;
Vector<CSMPInfo, DNA_COUNT(infoCount)> info;
Vector<CSMPInfo, AT_DNA_COUNT(infoCount)> info;
static bool Extract(PAKEntryReadStream& rs, const hecl::ProjectPath& outPath)
{

View File

@ -36,7 +36,7 @@ struct CHAR : BigDNA
UniqueID64 cmdl;
UniqueID64 cskr;
};
Vector<Overlay, DNA_COUNT(overlayCount)> overlays;
Vector<Overlay, AT_DNA_COUNT(overlayCount)> overlays;
UniqueID64 cinf;
UniqueID64 sand;
@ -47,17 +47,17 @@ struct CHAR : BigDNA
{
AT_DECL_DNA_YAML
Value<atUint32> partCount;
Vector<UniqueID64, DNA_COUNT(partCount)> part;
Vector<UniqueID64, AT_DNA_COUNT(partCount)> part;
Value<atUint32> swhcCount;
Vector<UniqueID64, DNA_COUNT(swhcCount)> swhc;
Vector<UniqueID64, AT_DNA_COUNT(swhcCount)> swhc;
Value<atUint32> unkCount;
Vector<UniqueID64, DNA_COUNT(unkCount)> unk;
Vector<UniqueID64, AT_DNA_COUNT(unkCount)> unk;
Value<atUint32> elscCount;
Vector<UniqueID64, DNA_COUNT(elscCount)> elsc;
Vector<UniqueID64, AT_DNA_COUNT(elscCount)> elsc;
Value<atUint32> spscCount;
Vector<UniqueID64, DNA_COUNT(spscCount)> spsc;
Vector<UniqueID64, AT_DNA_COUNT(spscCount)> spsc;
Value<atUint32> unk2Count;
Vector<UniqueID64, DNA_COUNT(unk2Count)> unk2;
Vector<UniqueID64, AT_DNA_COUNT(unk2Count)> unk2;
} partResData;
} characterInfo;
@ -103,7 +103,7 @@ struct CHAR : BigDNA
Value<atUint32> parentMode;
};
Value<atUint32> effectCount;
Vector<EffectEvent, DNA_COUNT(effectCount)> effectEvents;
Vector<EffectEvent, AT_DNA_COUNT(effectCount)> effectEvents;
struct SFXEvent : EventBase
{
@ -119,10 +119,10 @@ struct CHAR : BigDNA
Value<float> extraFloat;
};
Value<atUint32> sfxCount;
Vector<SFXEvent, DNA_COUNT(sfxCount)> sfxEvents;
Vector<SFXEvent, AT_DNA_COUNT(sfxCount)> sfxEvents;
};
Value<atUint32> evntCount;
Vector<EVNT, DNA_COUNT(evntCount)> evnts;
Vector<EVNT, AT_DNA_COUNT(evntCount)> evnts;
struct IMetaAnim : BigDNAVYaml
{
@ -206,7 +206,7 @@ struct CHAR : BigDNA
MetaAnimFactory anim;
Value<atUint32> probability;
};
Vector<Child, DNA_COUNT(animCount)> children;
Vector<Child, AT_DNA_COUNT(animCount)> children;
void gatherPrimitives(std::map<atUint32, DNAANCS::AnimationResInfo<UniqueID64>>& out)
{
@ -220,7 +220,7 @@ struct CHAR : BigDNA
AT_DECL_DNA_YAML
AT_DECL_DNAV
Value<atUint32> animCount;
Vector<MetaAnimFactory, DNA_COUNT(animCount)> children;
Vector<MetaAnimFactory, AT_DNA_COUNT(animCount)> children;
void gatherPrimitives(std::map<atUint32, DNAANCS::AnimationResInfo<UniqueID64>>& out)
{
@ -236,7 +236,7 @@ struct CHAR : BigDNA
MetaAnimFactory metaAnim;
};
Value<atUint32> animationCount;
Vector<Animation, DNA_COUNT(animationCount)> animations;
Vector<Animation, AT_DNA_COUNT(animationCount)> animations;
struct ActionAABB : BigDNA
{
@ -245,12 +245,12 @@ struct CHAR : BigDNA
Value<atVec3f> aabb[2];
};
Value<atUint32> animAABBCount;
Vector<ActionAABB, DNA_COUNT(animAABBCount)> animAABBs;
Vector<ActionAABB, AT_DNA_COUNT(animAABBCount)> animAABBs;
Value<atUint8> unkByte;
Value<atUint32> additiveMapCount;
Vector<bool, DNA_COUNT(additiveMapCount)> additiveMap;
Vector<bool, AT_DNA_COUNT(additiveMapCount)> additiveMap;
} animationInfo;
@ -278,10 +278,10 @@ struct CHAR : BigDNA
String<-1> boneName;
Value<float> unk14;
};
Vector<Hitbox, DNA_COUNT(hitboxCount)> hitboxes;
Vector<Hitbox, AT_DNA_COUNT(hitboxCount)> hitboxes;
};
Value<atUint32> hitboxSetCount;
Vector<HitboxSet, DNA_COUNT(hitboxSetCount)> hitboxSets;
Vector<HitboxSet, AT_DNA_COUNT(hitboxSetCount)> hitboxSets;
void getCharacterResInfo(std::vector<DNAANCS::CharacterResInfo<UniqueID64>>& out) const
{

View File

@ -112,7 +112,7 @@ struct MaterialSet : BigDNA
Value<atUint16> unk2;
DNAMP1::MaterialSet::Material::UVAnimation anim;
};
Vector<UVAnimation, DNA_COUNT(uvAnimSize != 0)> uvAnim;
Vector<UVAnimation, AT_DNA_COUNT(uvAnimSize != 0)> uvAnim;
void constructNode(hecl::blender::PyOutStream& out,
const PAKRouter<PAKBridge>& pakRouter,
@ -177,7 +177,7 @@ struct MaterialSet : BigDNA
};
std::vector<SectionFactory> sections;
};
Vector<Material, DNA_COUNT(materialCount)> materials;
Vector<Material, AT_DNA_COUNT(materialCount)> materials;
static void RegisterMaterialProps(hecl::blender::PyOutStream& out);
static void ConstructMaterial(hecl::blender::PyOutStream& out,

View File

@ -20,18 +20,18 @@ struct CSKR : BigDNA
AT_DECL_DNA
Value<atInt16> mtxs[10];
};
Vector<MatrixBindings, DNA_COUNT(matrixCount / 10)> mtxBindings;
Vector<MatrixBindings, AT_DNA_COUNT(matrixCount / 10)> mtxBindings;
Value<atUint32> unkCount1;
Vector<atUint8, DNA_COUNT(unkCount1)> unk1;
Vector<atUint8, AT_DNA_COUNT(unkCount1)> unk1;
Value<atUint32> unkCount2;
Vector<atUint8, DNA_COUNT(unkCount2)> unk2;
Vector<atUint8, AT_DNA_COUNT(unkCount2)> unk2;
Value<atUint32> unkCount3;
Vector<atUint8, DNA_COUNT(unkCount3)> unk3;
Vector<atUint8, AT_DNA_COUNT(unkCount3)> unk3;
Value<atUint32> unkCount4;
Vector<atUint8, DNA_COUNT(unkCount4)> unk4;
Vector<atUint8, AT_DNA_COUNT(unkCount4)> unk4;
Value<atUint32> unkCount5;
Vector<atUint8, DNA_COUNT(unkCount5)> unk5;
Vector<atUint8, AT_DNA_COUNT(unkCount5)> unk5;
const atInt16* getMatrixBank(size_t idx) const
{

View File

@ -31,10 +31,10 @@ struct HINT : BigDNA
};
Value<atUint32> locationCount;
Vector<Location, DNA_COUNT(locationCount)> locations;
Vector<Location, AT_DNA_COUNT(locationCount)> locations;
};
Value<atUint32> hintCount;
Vector<Hint, DNA_COUNT(hintCount)> hints;
Vector<Hint, AT_DNA_COUNT(hintCount)> hints;
static bool Extract(PAKEntryReadStream& rs, const hecl::ProjectPath& outPath)
{

View File

@ -29,7 +29,7 @@ struct MLVL : BigDNA
Value<atUint64> areaId;
Value<atUint32> attachedAreaCount;
Vector<atUint16, DNA_COUNT(attachedAreaCount)> attachedAreas;
Vector<atUint16, AT_DNA_COUNT(attachedAreaCount)> attachedAreas;
Value<atUint32> dockCount;
struct Dock : BigDNA
@ -42,16 +42,16 @@ struct MLVL : BigDNA
Value<atUint32> areaIdx;
Value<atUint32> dockIdx;
};
Vector<Endpoint, DNA_COUNT(endpointCount)> endpoints;
Vector<Endpoint, AT_DNA_COUNT(endpointCount)> endpoints;
Value<atUint32> planeVertCount;
Vector<atVec3f, DNA_COUNT(planeVertCount)> planeVerts;
Vector<atVec3f, AT_DNA_COUNT(planeVertCount)> planeVerts;
};
Vector<Dock, DNA_COUNT(dockCount)> docks;
Vector<Dock, AT_DNA_COUNT(dockCount)> docks;
String<-1> internalAreaName;
};
Vector<Area, DNA_COUNT(areaCount)> areas;
Vector<Area, AT_DNA_COUNT(areaCount)> areas;
UniqueID64 worldMap;
Value<atUint8> unknown2;
@ -64,10 +64,10 @@ struct MLVL : BigDNA
Value<atUint32> layerCount;
Value<atUint64> flags;
};
Vector<LayerFlags, DNA_COUNT(layerFlagCount)> layerFlags;
Vector<LayerFlags, AT_DNA_COUNT(layerFlagCount)> layerFlags;
Value<atUint32> layerNameCount;
Vector<String<-1>, DNA_COUNT(layerNameCount)> layerNames;
Vector<String<-1>, AT_DNA_COUNT(layerNameCount)> layerNames;
Value<atUint32> layerIDCount;
struct LayerID : BigDNA
@ -75,10 +75,10 @@ struct MLVL : BigDNA
AT_DECL_DNA_YAML
Value<atUint64> id[2];
};
Vector<LayerID, DNA_COUNT(layerIDCount)> layerIDs;
Vector<LayerID, AT_DNA_COUNT(layerIDCount)> layerIDs;
Value<atUint32> layerNameOffsetCount;
Vector<atUint32, DNA_COUNT(layerNameOffsetCount)> layerNameOffsets;
Vector<atUint32, AT_DNA_COUNT(layerNameOffsetCount)> layerNameOffsets;
static bool Extract(const SpecBase& dataSpec,

View File

@ -35,7 +35,7 @@ struct MREA
Value<atUint32> compressedBlockCount;
Value<atUint32> secIndexCount;
Seek<20, athena::Current> align1;
Vector<atUint32, DNA_COUNT(secCount)> secSizes;
Vector<atUint32, AT_DNA_COUNT(secCount)> secSizes;
atUint32 getSecOffset(atUint32 idx) const
{
@ -70,9 +70,9 @@ struct MREA
UniqueID64 id;
DNAFourCC type;
};
Vector<Dependency, DNA_COUNT(depCount)> deps;
Vector<Dependency, AT_DNA_COUNT(depCount)> deps;
Value<atUint32> depLayerCount;
Vector<atUint32, DNA_COUNT(depLayerCount)> depLayers;
Vector<atUint32, AT_DNA_COUNT(depLayerCount)> depLayers;
};
struct BabeDeadLight : BigDNA

View File

@ -30,19 +30,19 @@ struct SAVW : BigDNA
AT_DECL_DNA_YAML
SAVWCommon::Header header;
Value<atUint32> skippableCutsceneCount;
Vector<SavedState, DNA_COUNT(skippableCutsceneCount)> skippableCutscenes;
Vector<SavedState, AT_DNA_COUNT(skippableCutsceneCount)> skippableCutscenes;
Value<atUint32> relayCount;
Vector<SavedState, DNA_COUNT(relayCount)> relays;
Vector<SavedState, AT_DNA_COUNT(relayCount)> relays;
Value<atUint32> doorCount;
Vector<SavedState, DNA_COUNT(doorCount)> doors;
Vector<SavedState, AT_DNA_COUNT(doorCount)> doors;
Value<atUint32> scanCount;
Vector<Scan, DNA_COUNT(scanCount)> scans;
Vector<Scan, AT_DNA_COUNT(scanCount)> scans;
Value<atUint32> systemVarCount;
Vector<SAVWCommon::EnvironmentVariable, DNA_COUNT(systemVarCount)> systemVars;
Vector<SAVWCommon::EnvironmentVariable, AT_DNA_COUNT(systemVarCount)> systemVars;
Value<atUint32> gameVarCount;
Vector<SAVWCommon::EnvironmentVariable, DNA_COUNT(gameVarCount)> gameVars;
Vector<SAVWCommon::EnvironmentVariable, AT_DNA_COUNT(gameVarCount)> gameVars;
Value<atUint32> gameObjectCount;
Vector<SavedState, DNA_COUNT(gameObjectCount)> gameObjects;
Vector<SavedState, AT_DNA_COUNT(gameObjectCount)> gameObjects;
};
}

View File

@ -272,6 +272,12 @@ void SpecBase::doCook(const hecl::ProjectPath& path, const hecl::ProjectPath& co
cookColMesh(cookedPath, path, ds, fast, btok, progress);
break;
}
case hecl::blender::BlendType::PathMesh:
{
hecl::blender::DataStream ds = conn.beginData();
cookPathMesh(cookedPath, path, ds, fast, btok, progress);
break;
}
case hecl::blender::BlendType::Actor:
{
hecl::blender::DataStream ds = conn.beginData();
@ -1106,17 +1112,6 @@ bool SpecBase::addFileToIndex(const hecl::ProjectPath& path,
pathTag = {SBIG('AGSC'), asGlob.hash().val32()};
useGlob = true;
}
else if (pathTag.type == SBIG('MREA'))
{
hecl::ProjectPath subPath = path.ensureAuxInfo(_S("PATH"));
urde::SObjectTag pathTag = buildTagFromPath(subPath, m_backgroundBlender);
m_tagToPath[pathTag] = subPath;
m_pathToTag[subPath.hash()] = pathTag;
WriteTag(cacheWriter, pathTag, subPath);
#if DUMP_CACHE_FILL
DumpCacheAdd(pathTag, subPath);
#endif
}
/* Cache in-memory */
const hecl::ProjectPath& usePath = useGlob ? asGlob : path;

View File

@ -74,6 +74,7 @@ struct SpecBase : hecl::Database::IDataSpec
using BlendStream = hecl::blender::DataStream;
using Mesh = hecl::blender::Mesh;
using ColMesh = hecl::blender::ColMesh;
using PathMesh = hecl::blender::PathMesh;
using Light = hecl::blender::Light;
using Actor = hecl::blender::Actor;
@ -83,6 +84,9 @@ struct SpecBase : hecl::Database::IDataSpec
virtual void cookColMesh(const hecl::ProjectPath& out, const hecl::ProjectPath& in,
BlendStream& ds, bool fast, hecl::blender::Token& btok,
FCookProgress progress)=0;
virtual void cookPathMesh(const hecl::ProjectPath& out, const hecl::ProjectPath& in,
BlendStream& ds, bool fast, hecl::blender::Token& btok,
FCookProgress progress)=0;
virtual void cookActor(const hecl::ProjectPath& out, const hecl::ProjectPath& in,
BlendStream& ds, bool fast, hecl::blender::Token& btok,
FCookProgress progress)=0;

View File

@ -16,6 +16,7 @@
#include "DNAMP1/AGSC.hpp"
#include "DNAMP1/CSNG.hpp"
#include "DNAMP1/MAPA.hpp"
#include "DNAMP1/PATH.hpp"
#include "DNACommon/ATBL.hpp"
#include "DNACommon/FONT.hpp"
#include "DNACommon/PART.hpp"
@ -571,6 +572,8 @@ struct SpecMP1 : SpecBase
return {SBIG('CMDL'), path.hash().val32()};
case hecl::blender::BlendType::ColMesh:
return {SBIG('DCLN'), path.hash().val32()};
case hecl::blender::BlendType::PathMesh:
return {SBIG('PATH'), path.hash().val32()};
case hecl::blender::BlendType::Actor:
if (path.getAuxInfo().size())
{
@ -583,11 +586,7 @@ struct SpecMP1 : SpecBase
}
return {SBIG('ANCS'), path.getWithExtension(_S(".*"), true).hash().val32()};
case hecl::blender::BlendType::Area:
{
if (hecl::StringUtils::EndsWith(path.getAuxInfo(), _S("PATH")))
return {SBIG('PATH'), path.hash().val32()};
return {SBIG('MREA'), path.hash().val32()};
}
case hecl::blender::BlendType::World:
{
if (path.getAuxInfo().size())
@ -757,13 +756,21 @@ struct SpecMP1 : SpecBase
}
void cookColMesh(const hecl::ProjectPath& out, const hecl::ProjectPath& in, BlendStream& ds, bool fast,
hecl::blender::Token& btok, FCookProgress progress)
hecl::blender::Token& btok, FCookProgress progress)
{
std::vector<ColMesh> mesh = ds.compileColMeshes();
ds.close();
DNAMP1::DCLN::Cook(out, in, mesh);
}
void cookPathMesh(const hecl::ProjectPath& out, const hecl::ProjectPath& in, BlendStream& ds, bool fast,
hecl::blender::Token& btok, FCookProgress progress)
{
PathMesh mesh = ds.compilePathMesh();
ds.close();
DNAMP1::PATH::Cook(out, in, mesh);
}
void cookActor(const hecl::ProjectPath& out, const hecl::ProjectPath& in, BlendStream& ds, bool fast,
hecl::blender::Token& btok, FCookProgress progress)
{
@ -801,44 +808,37 @@ struct SpecMP1 : SpecBase
void cookArea(const hecl::ProjectPath& out, const hecl::ProjectPath& in, BlendStream& ds, bool fast,
hecl::blender::Token& btok, FCookProgress progress)
{
if (hecl::StringUtils::EndsWith(in.getAuxInfo(), _S("PATH")))
{
DNAMP1::MREA::CookPath(out, in);
}
else
{
std::vector<std::string> meshes = ds.getMeshList();
std::vector<Mesh> meshCompiles;
meshCompiles.reserve(meshes.size());
std::vector<std::string> meshes = ds.getMeshList();
std::vector<Mesh> meshCompiles;
meshCompiles.reserve(meshes.size());
std::experimental::optional<ColMesh> colMesh;
std::experimental::optional<ColMesh> colMesh;
for (const std::string& mesh : meshes)
for (const std::string& mesh : meshes)
{
hecl::SystemStringConv meshSys(mesh);
if (!mesh.compare("CMESH"))
{
hecl::SystemStringConv meshSys(mesh);
if (!mesh.compare("CMESH"))
{
colMesh = ds.compileColMesh(mesh);
progress(_S("Collision Mesh"));
continue;
}
meshCompiles.push_back(ds.compileMesh(
mesh, fast ? hecl::HMDLTopology::Triangles : hecl::HMDLTopology::TriStrips, -1,
[&](int surfCount) { progress(hecl::SysFormat(_S("%s %d"), meshSys.c_str(), surfCount).c_str()); }));
colMesh = ds.compileColMesh(mesh);
progress(_S("Collision Mesh"));
continue;
}
if (!colMesh)
Log.report(logvisor::Fatal, _S("unable to find mesh named 'CMESH' in %s"), in.getAbsolutePath().data());
std::vector<Light> lights = ds.compileLights();
ds.close();
if (m_pc)
DNAMP1::MREA::PCCook(out, in, meshCompiles, *colMesh, lights, btok);
else
DNAMP1::MREA::Cook(out, in, meshCompiles, *colMesh, lights);
meshCompiles.push_back(ds.compileMesh(
mesh, fast ? hecl::HMDLTopology::Triangles : hecl::HMDLTopology::TriStrips, -1,
[&](int surfCount) { progress(hecl::SysFormat(_S("%s %d"), meshSys.c_str(), surfCount).c_str()); }));
}
if (!colMesh)
Log.report(logvisor::Fatal, _S("unable to find mesh named 'CMESH' in %s"), in.getAbsolutePath().data());
std::vector<Light> lights = ds.compileLights();
ds.close();
if (m_pc)
DNAMP1::MREA::PCCook(out, in, meshCompiles, *colMesh, lights, btok);
else
DNAMP1::MREA::Cook(out, in, meshCompiles, *colMesh, lights);
}
void cookWorld(const hecl::ProjectPath& out, const hecl::ProjectPath& in, BlendStream& ds, bool fast,

View File

@ -339,6 +339,12 @@ struct SpecMP2 : SpecBase
{
}
void cookPathMesh(const hecl::ProjectPath& out, const hecl::ProjectPath& in,
BlendStream& ds, bool fast, hecl::blender::Token& btok,
FCookProgress progress)
{
}
void cookActor(const hecl::ProjectPath& out, const hecl::ProjectPath& in,
BlendStream& ds, bool fast, hecl::blender::Token& btok,
FCookProgress progress)

View File

@ -533,6 +533,12 @@ struct SpecMP3 : SpecBase
{
}
void cookPathMesh(const hecl::ProjectPath& out, const hecl::ProjectPath& in,
BlendStream& ds, bool fast, hecl::blender::Token& btok,
FCookProgress progress)
{
}
void cookActor(const hecl::ProjectPath& out, const hecl::ProjectPath& in,
BlendStream& ds, bool fast, hecl::blender::Token& btok,
FCookProgress progress)

2
hecl

@ -1 +1 @@
Subproject commit 8e2c8ed29174aa184d23edd24925062920b25e2b
Subproject commit b014d6114bcd34d473bcf2573654c43fee6347c0