initial MP1 MLVL DNA structure

This commit is contained in:
Jack Andersen 2015-06-24 10:56:23 -10:00
parent de29d08623
commit da98329eb4
8 changed files with 177 additions and 1 deletions

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "PakLib"]
path = PakLib
url = https://github.com/RetroView/PakLib.git

2
DNA/DNA.pri Normal file
View File

@ -0,0 +1,2 @@
include(DNA_common/DNA_common.pri)
include(DNA_mp1/DNA_mp1.pri)

View File

@ -0,0 +1,2 @@
HEADERS += \
$$PWD/common.hpp

55
DNA/DNA_common/common.hpp Normal file
View File

@ -0,0 +1,55 @@
#ifndef __DNA_COMMON_HPP__
#define __DNA_COMMON_HPP__
#include <Athena/DNA.hpp>
#include <CFourCC.hpp>
#include <CUniqueID.hpp>
/* This comes up a great deal */
typedef Athena::io::DNA<Athena::BigEndian> BigDNA;
/* FourCC DNA */
class DNAFourCC : public BigDNA, public CFourCC
{
public:
Delete expl;
void read(Athena::io::IStreamReader& reader)
{_read(reader);}
void write(Athena::io::IStreamWriter& writer) const
{_write(writer);}
};
/* PAK 32-bit Unique ID DNA */
class DNAUniqueID32 : public BigDNA, public CUniqueID
{
public:
Delete expl;
void read(Athena::io::IStreamReader& reader)
{_read(reader, E_32Bits);}
void write(Athena::io::IStreamWriter& writer) const
{_write(writer);}
};
/* PAK 64-bit Unique ID DNA */
class DNAUniqueID64 : public BigDNA, public CUniqueID
{
public:
Delete expl;
void read(Athena::io::IStreamReader& reader)
{_read(reader, E_64Bits);}
void write(Athena::io::IStreamWriter& writer) const
{_write(writer);}
};
/* PAK 128-bit Unique ID DNA */
class DNAUniqueID128 : public BigDNA, public CUniqueID
{
public:
Delete expl;
void read(Athena::io::IStreamReader& reader)
{_read(reader, E_128Bits);}
void write(Athena::io::IStreamWriter& writer) const
{_write(writer);}
};
#endif // __DNA_COMMON_HPP__

2
DNA/DNA_mp1/DNA_mp1.pri Normal file
View File

@ -0,0 +1,2 @@
HEADERS += \
$$PWD/MLVL.hpp

108
DNA/DNA_mp1/MLVL.hpp Normal file
View File

@ -0,0 +1,108 @@
#include "../DNA_common/common.hpp"
namespace MP1
{
struct MLVL : public BigDNA
{
DECL_DNA
DNAFourCC magic;
Value<atUint32> version;
DNAUniqueID32 worldNameId;
DNAUniqueID32 saveWorldId;
DNAUniqueID32 worldSkyboxId;
Value<atUint32> memRelayLinkCount;
struct MemRelayLink : public BigDNA
{
DECL_DNA
Value<atUint32> memRelayId;
Value<atUint32> targetId;
Value<atUint16> msg;
Value<atUint8> unk;
};
Vector<MemRelayLink, DNA_COUNT(memRelayLinkCount)> memRelayLinks;
Value<atUint32> areaCount;
Value<atUint32> unknown1;
struct Area : public BigDNA
{
DECL_DNA
DNAUniqueID32 areaNameId;
Value<atVec4f> transformMtx[3];
Value<atVec3f> aabb[2];
DNAUniqueID32 areaMREAId;
Value<atUint32> areaId;
Value<atUint32> attachedAreaCount;
Vector<atUint16, DNA_COUNT(attachedAreaCount)> attachedAreas;
Value<atUint32> padding;
Value<atUint32> depCount;
struct Dependency : public BigDNA
{
DECL_DNA
DNAUniqueID32 id;
DNAFourCC type;
};
Vector<Dependency, DNA_COUNT(depCount)> deps;
Value<atUint32> depLayerCount;
Vector<atUint32, DNA_COUNT(depLayerCount)> depLayers;
Value<atUint32> dockCount;
struct Dock : public BigDNA
{
DECL_DNA
Value<atUint32> endpointCount;
struct Endpoint : public BigDNA
{
DECL_DNA
Value<atUint32> areaIdx;
Value<atUint32> dockIdx;
};
DNAFourCC type;
Vector<Endpoint, DNA_COUNT(endpointCount)> endpoints;
Value<atUint32> planeVertCount;
Vector<atVec3f, DNA_COUNT(planeVertCount)> planeVerts;
};
Vector<Dock, DNA_COUNT(dockCount)> docks;
};
DNAUniqueID32 worldMap;
Value<atUint8> unknown2;
Value<atUint32> unknown3;
Value<atUint32> audioGroupCount;
struct AudioGroup : public BigDNA
{
DECL_DNA
Value<atUint32> unknown;
DNAUniqueID32 agscId;
};
Vector<AudioGroup, DNA_COUNT(audioGroupCount)> audioGroups;
String<-1> unkString;
Value<atUint32> layerFlagCount;
struct LayerFlags : public BigDNA
{
DECL_DNA
Value<atUint32> layerCount;
Value<atUint64> flags;
};
Vector<LayerFlags, DNA_COUNT(layerFlagCount)> layerFlags;
Value<atUint32> layerNameCount;
struct LayerName : public BigDNA
{
DECL_DNA
String<-1> name;
};
Vector<LayerName, DNA_COUNT(layerNameCount)> layerNames;
Value<atUint32> layerNameOffsetCount;
Vector<atUint32, DNA_COUNT(layerNameOffsetCount)> layerNameOffsets;
};
}

1
PakLib Submodule

@ -0,0 +1 @@
Subproject commit 6a71c1fdc4b176f1b14d83b87b57a519f8ba534a

View File

@ -1,6 +1,7 @@
INCLUDEPATH += $$PWD/include INCLUDEPATH += $$PWD/DNA $$PWD/include
include(../libSquish/libSquish.pri) include(../libSquish/libSquish.pri)
include(PakLib/PakLib.pri)
HEADERS += \ HEADERS += \
$$PWD/include/RetroCommon.hpp $$PWD/include/RetroCommon.hpp
@ -8,3 +9,5 @@ HEADERS += \
SOURCES += \ SOURCES += \
$$PWD/src/RetroCommon.cpp \ $$PWD/src/RetroCommon.cpp \
$$PWD/src/MREADecompress.cpp $$PWD/src/MREADecompress.cpp
include(DNA/DNA.pri)