2018-10-07 03:42:33 +00:00
|
|
|
#pragma once
|
2015-09-20 06:09:27 +00:00
|
|
|
|
2018-06-29 20:21:36 +00:00
|
|
|
#include "DataSpec/DNACommon/DNACommon.hpp"
|
2015-09-20 06:09:27 +00:00
|
|
|
#include "CMDLMaterials.hpp"
|
|
|
|
#include "CSKR.hpp"
|
|
|
|
#include "../DNAMP2/MREA.hpp"
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
namespace DataSpec::DNAMP3 {
|
2015-09-20 06:09:27 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
struct MREA {
|
|
|
|
struct StreamReader : DNAMP2::MREA::StreamReader {
|
|
|
|
std::vector<std::pair<DNAFourCC, atUint32>> m_secIdxs;
|
|
|
|
StreamReader(athena::io::IStreamReader& source, atUint32 blkCount, atUint32 secIdxCount);
|
|
|
|
std::vector<std::pair<DNAFourCC, atUint32>>::const_iterator beginSecIdxs() { return m_secIdxs.begin(); }
|
|
|
|
void writeSecIdxs(athena::io::IStreamWriter& writer) const;
|
2020-04-10 03:20:20 +00:00
|
|
|
bool seekToSection(FourCC sec, const std::vector<atUint32>& secSizes);
|
2018-12-08 05:30:43 +00:00
|
|
|
};
|
2015-09-20 06:09:27 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
struct Header : BigDNA {
|
|
|
|
AT_DECL_DNA
|
|
|
|
Value<atUint32> magic;
|
|
|
|
Value<atUint32> version;
|
|
|
|
Value<atVec4f> localToWorldMtx[3];
|
|
|
|
Value<atUint32> meshCount;
|
|
|
|
Value<atUint32> sclyLayerCount;
|
|
|
|
Value<atUint32> secCount;
|
|
|
|
Value<atUint32> compressedBlockCount;
|
|
|
|
Value<atUint32> secIndexCount;
|
2019-09-08 01:01:16 +00:00
|
|
|
Seek<20, athena::SeekOrigin::Current> align1;
|
2018-12-08 05:30:43 +00:00
|
|
|
Vector<atUint32, AT_DNA_COUNT(secCount)> secSizes;
|
2015-09-23 06:35:07 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
atUint32 getSecOffset(atUint32 idx) const {
|
|
|
|
if (idx >= secSizes.size())
|
|
|
|
return -1;
|
|
|
|
atUint32 retval = 0;
|
|
|
|
for (atUint32 i = 0; i < idx; ++i)
|
|
|
|
retval += secSizes[i];
|
|
|
|
return retval;
|
|
|
|
}
|
|
|
|
};
|
2015-09-20 06:09:27 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
struct MeshHeader : BigDNA {
|
|
|
|
AT_DECL_DNA
|
|
|
|
struct VisorFlags : BigDNA {
|
|
|
|
AT_DECL_DNA
|
|
|
|
Value<atUint32> flags;
|
|
|
|
} visorFlags;
|
|
|
|
Value<atVec4f> xfMtx[3];
|
|
|
|
Value<atVec3f> aabb[2];
|
|
|
|
};
|
2015-09-20 06:09:27 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
struct DEPS : BigDNA {
|
|
|
|
AT_DECL_DNA
|
|
|
|
Value<atUint32> depCount;
|
|
|
|
struct Dependency : BigDNA {
|
|
|
|
AT_DECL_DNA
|
|
|
|
UniqueID64 id;
|
|
|
|
DNAFourCC type;
|
2015-09-23 06:35:07 +00:00
|
|
|
};
|
2018-12-08 05:30:43 +00:00
|
|
|
Vector<Dependency, AT_DNA_COUNT(depCount)> deps;
|
|
|
|
Value<atUint32> depLayerCount;
|
|
|
|
Vector<atUint32, AT_DNA_COUNT(depLayerCount)> depLayers;
|
|
|
|
};
|
2015-09-23 06:35:07 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
struct BabeDeadLight : BigDNA {
|
|
|
|
AT_DECL_DNA
|
|
|
|
enum class LightType : atUint32 { LocalAmbient, Directional, Custom, Spot, Spot2, LocalAmbient2 };
|
|
|
|
enum class Falloff : atUint32 { Constant, Linear, Quadratic };
|
|
|
|
Value<LightType> lightType;
|
|
|
|
Value<atVec3f> color;
|
|
|
|
Value<float> alpha = 1.f;
|
|
|
|
Value<atVec3f> position;
|
|
|
|
Value<atVec3f> direction;
|
|
|
|
Value<atVec3f> codirection;
|
|
|
|
Value<float> q;
|
|
|
|
Value<float> spotCutoff;
|
|
|
|
Value<float> unk7;
|
|
|
|
Value<bool> castShadows;
|
|
|
|
Value<float> unk9;
|
|
|
|
Value<Falloff> falloff;
|
|
|
|
Value<float> unk11;
|
|
|
|
Value<atVec4f> unk12;
|
|
|
|
Value<atUint32> unk13;
|
|
|
|
};
|
2015-09-20 06:09:27 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
static void ReadBabeDeadToBlender_3(hecl::blender::PyOutStream& os, athena::io::IStreamReader& rs);
|
2015-09-20 06:09:27 +00:00
|
|
|
|
2020-04-10 03:20:20 +00:00
|
|
|
static UniqueID64 GetPATHId(PAKEntryReadStream& rs);
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
static bool 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*)>);
|
2015-09-23 06:35:07 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
static bool ExtractLayerDeps(PAKEntryReadStream& rs, PAKBridge::Level::Area& areaOut);
|
2015-09-20 06:09:27 +00:00
|
|
|
};
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
} // namespace DataSpec::DNAMP3
|