#ifndef __DNAMP1_MREA_HPP__ #define __DNAMP1_MREA_HPP__ #include "../DNACommon/DNACommon.hpp" #include "CMDLMaterials.hpp" #include "CSKR.hpp" namespace Retro { namespace DNAMP1 { struct MREA { struct Header : BigDNA { DECL_DNA Value magic; Value version; Value localToWorldMtx[3]; Value meshCount; Value secCount; Value geomSecIdx; Value sclySecIdx; Value collisionSecIdx; Value unkSecIdx; Value lightSecIdx; Value visiSecIdx; Value pathSecIdx; Value arotSecIdx; Vector secSizes; }; struct MeshHeader : BigDNA { DECL_DNA struct VisorFlags : BigDNA { DECL_DNA Value flags; enum ThermalLevel { ThermalCool, ThermalHot, ThermalWarm }; static const char* GetThermalLevelStr(ThermalLevel t) { switch (t) { case ThermalCool: return "COOL"; case ThermalHot: return "HOT"; case ThermalWarm: return "WARM"; default: break; } return nullptr; } bool disableEnviro() const {return flags >> 1 & 0x1;} void setDisableEnviro(bool v) {flags &= ~0x2; flags |= v << 1;} bool disableThermal() const {return flags >> 2 & 0x1;} void setDisableThermal(bool v) {flags &= ~0x4; flags |= v << 2;} bool disableXray() const {return flags >> 3 & 0x1;} void setDisableXray(bool v) {flags &= ~0x8; flags |= v << 3;} ThermalLevel thermalLevel() const {return ThermalLevel(flags >> 4 & 0x3);} void setThermalLevel(ThermalLevel v) {flags &= ~0x30; flags |= v << 4;} const char* thermalLevelStr() const {return GetThermalLevelStr(thermalLevel());} } visorFlags; Value xfMtx[3]; Value aabb[2]; }; struct BabeDeadLight : BigDNA { DECL_DNA enum LightType : atUint32 { LightLocalAmbient, LightDirectional, LightCustom, LightSpot, LightSpot2, LightLocalAmbient2 }; enum Falloff : atUint32 { FalloffConstant, FalloffLinear, FalloffQuadratic }; Value lightType; Value color; Value position; Value direction; Value q; Value spotCutoff; Value unk5; Value unk6; Value unk7; Value falloff; Value unk9; }; static void ReadBabeDeadToBlender_1_2(HECL::BlenderConnection::PyOutStream& os, Athena::io::IStreamReader& rs); static void AddCMDLRigPairs(PAKEntryReadStream& rs, PAKRouter& pakRouter, std::unordered_map>& addTo); static bool Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const HECL::ProjectPath& outPath, PAKRouter& pakRouter, const PAK::Entry& entry, bool, std::function); static void Name(const SpecBase& dataSpec, PAKEntryReadStream& rs, PAKRouter& pakRouter, PAK::Entry& entry); }; } } #endif