diff --git a/DataSpec/DNAMP1/CMakeLists.txt b/DataSpec/DNAMP1/CMakeLists.txt index ae9a255f3..6413da356 100644 --- a/DataSpec/DNAMP1/CMakeLists.txt +++ b/DataSpec/DNAMP1/CMakeLists.txt @@ -1,6 +1,7 @@ make_dnalist(liblist PAK MLVL + MAPA CMDL CMDLMaterials) add_library(DNAMP1 diff --git a/DataSpec/DNAMP1/MAPA.hpp b/DataSpec/DNAMP1/MAPA.hpp new file mode 100644 index 000000000..915edd48d --- /dev/null +++ b/DataSpec/DNAMP1/MAPA.hpp @@ -0,0 +1,81 @@ +#ifndef __DNAMP1_MAPA_HPP__ +#define __DNAMP1_MAPA_HPP__ + +#include + +#include "../DNACommon/DNACommon.hpp" + +namespace Retro +{ +namespace DNAMP1 +{ +struct MAPA : BigDNA +{ + DECL_DNA + Value magic; + Value version; + Value unknown1; + Value unknown2; + Value aabbMin; + Value aabbMax; + Value mappableObjectCount; + Value vertexCount; + Value surfaceCount; + + struct MappableObject : BigDNA + { + DECL_DNA + Value type; + Value unknown1; + Value unknown2; + Value id; + Seek seek1; + Value transform1; + Value transform2; + Value transform3; + Seek seek2; + }; + Vector mappableObjects; + Vector vertices; + + struct SurfaceHeader : BigDNA + { + DECL_DNA + Value unkFloats1; + Value unkFloats2; + Value start; + Value end; + }; + + Vector surfaceHeaders; + + struct Surface : BigDNA + { + DECL_DNA + Value primitiveCount; + struct Primitive : BigDNA + { + DECL_DNA + Value type; + Value indexCount; + Vector indices; + Align<4> align; + }; + Vector primitives; + Value borderCount; + struct Border : BigDNA + { + DECL_DNA + Value indexCount; + Vector indices; + Align<4> align; + }; + Vector borders; + }; + + Vector surfaces; +}; +} +} + +#endif diff --git a/DataSpec/SpecMP1.cpp b/DataSpec/SpecMP1.cpp index c444d4cbe..7a3b6494d 100644 --- a/DataSpec/SpecMP1.cpp +++ b/DataSpec/SpecMP1.cpp @@ -234,8 +234,9 @@ struct SpecMP1 : SpecBase int compIdx = 4; prog = 0; - for (DNAMP1::PAKBridge& pak : m_paks) + for (std::pair pair : m_orderedPaks) { + DNAMP1::PAKBridge& pak = *pair.second; const std::string& name = pak.getName(); HECL::SystemStringView sysName(name); diff --git a/DataSpec/SpecMP2.cpp b/DataSpec/SpecMP2.cpp index 5feebec67..8d258401d 100644 --- a/DataSpec/SpecMP2.cpp +++ b/DataSpec/SpecMP2.cpp @@ -230,8 +230,9 @@ struct SpecMP2 : SpecBase int compIdx = 4; prog = 0; - for (DNAMP2::PAKBridge& pak : m_paks) + for (std::pair pair : m_orderedPaks) { + DNAMP2::PAKBridge& pak = *pair.second; const std::string& name = pak.getName(); HECL::SystemStringView sysName(name); diff --git a/DataSpec/SpecMP3.cpp b/DataSpec/SpecMP3.cpp index 29bba29f8..296320b0f 100644 --- a/DataSpec/SpecMP3.cpp +++ b/DataSpec/SpecMP3.cpp @@ -332,8 +332,9 @@ struct SpecMP3 : SpecBase mp3CookPath.makeDir(); prog = 0; - for (DNAMP3::PAKBridge& pak : m_paks) + for (std::pair pair : m_orderedPaks) { + DNAMP3::PAKBridge& pak = *pair.second; m_pakRouter.enterPAKBridge(pak); const std::string& name = pak.getName(); @@ -373,8 +374,9 @@ struct SpecMP3 : SpecBase m_feCookPath.makeDir(); prog = 0; - for (DNAMP3::PAKBridge& pak : m_fePaks) + for (std::pair pair : m_feOrderedPaks) { + DNAMP3::PAKBridge& pak = *pair.second; const std::string& name = pak.getName(); HECL::SystemStringView sysName(name);