#ifndef _DNAMP1_CMDL_HPP_ #define _DNAMP1_CMDL_HPP_ #include "../DNACommon/DNACommon.hpp" #include "CMDLMaterials.hpp" #include "BlenderConnection.hpp" #include "DNAMP1.hpp" namespace Retro { namespace DNAMP1 { struct CMDL { struct Header : BigDNA { DECL_DNA Value magic; Value version; struct Flags : BigDNA { DECL_DNA Value flags; inline bool shortNormals() const {return (flags & 0x2) != 0;} inline void setShortNormals(bool val) {flags &= ~0x2; flags |= val << 1;} inline bool shortUVs() const {return (flags & 0x4) != 0;} inline void setShortUVs(bool val) {flags &= ~0x4; flags |= val << 2;} } flags; Value aabbMin; Value aabbMax; Value secCount; Value matSetCount; Vector secSizes; Align<32> align; }; struct SurfaceHeader : BigDNA { DECL_DNA Value centroid; Value matIdx; Value qDiv; Value dlSize; Seek<8, Athena::Current> seek; Value aabbSz; Value reflectionNormal; Seek seek2; Align<32> align; }; static bool ReadToBlender(HECL::BlenderConnection& conn, Athena::io::IStreamReader& reader, PAKRouter& pakRouter); static bool Extract(PAKEntryReadStream& rs, const HECL::ProjectPath& outPath, PAKRouter& pakRouter) { HECL::BlenderConnection& conn = HECL::BlenderConnection::SharedConnection(); if (!conn.createBlend(outPath.getAbsolutePath())) return false; return ReadToBlender(conn, rs, pakRouter); } }; } } #endif // _DNAMP1_CMDL_HPP_