Merge duplicate ModCon defs

This commit is contained in:
Luke Street
2023-03-13 08:52:15 -04:00
parent 2568ad6675
commit 7bbb95b89d
3 changed files with 58 additions and 140 deletions
-128
View File
@@ -1,128 +0,0 @@
#ifndef _CMODCONDDATA
#define _CMODCONDDATA
#include "CCollisionTree.bt"
#include "CColor4f.bt"
#include "CRenderOctree.bt"
#include "SAtlasLookup.bt"
typedef struct {
typedef struct {
ChunkDescriptor mchd;
uint unk;
} SModCondHeader;
SModCondHeader header;
ChunkDescriptor mcvd;
uint modelGuidCount;
if (modelGuidCount) {
struct {
GUID guid;
} modelGuids[modelGuidCount];
}
uint unkGuidCount;
if (unkGuidCount) {
struct {
GUID guid;
} unkGuids[unkGuidCount];
}
uint colorCount;
if (colorCount) {
CColor4f colors[colorCount];
}
uint transformCount;
if (transformCount) {
CTransform4f transforms[transformCount];
}
uint guidXfCount;
if (guidXfCount) {
struct {
GUID guid;
CTransform4f xf;
} guidXf[guidXfCount];
}
uint dataCount1;
if (dataCount1) {
char data1[dataCount1];
}
uint shortCount1;
if (shortCount1) {
ushort shorts1[shortCount1];
}
uint shortCount2;
if (shortCount2) {
ushort shorts2[shortCount2];
}
uint dataCount2;
if (dataCount2) {
char data2[dataCount2];
}
uint dataCount3;
if (dataCount3) {
char data3[dataCount3];
}
uint atlasLookupCount1;
if (atlasLookupCount1) {
SAtlasLookup atlasLookups1[atlasLookupCount1];
}
uint atlasLookupCount2;
if (atlasLookupCount2) {
SAtlasLookup atlasLookups2[atlasLookupCount2];
}
uint hasRenderOctree;
if (hasRenderOctree) {
CRenderOctree renderOctree;
}
typedef struct SModelVertexBlendData {
uint unk1;
uint intCount;
if (intCount) {
uint ints[intCount];
}
uint shortCount;
if (shortCount) {
ushort shorts[shortCount];
}
} SModelVertexBlendData;
if (ReadInt(FTell()) == 0x4D435642) {
typedef struct SNodeVertexBlendData {
uint unkDataCount;
if (unkDataCount) {
char unkData[unkDataCount];
}
uint unkIntCount;
if (unkIntCount) {
uint unkInts[unkIntCount];
}
uint modelVertexBlendDataCount;
if (modelVertexBlendDataCount) {
SModelVertexBlendData
modelVertexBlendData[modelVertexBlendDataCount]<optimize = false>;
}
} SNodeVertexBlendData;
uint vertexBlendDataCount;
if (vertexBlendDataCount) {
SNodeVertexBlendData vertexBlendData[vertexBlendData]<optimize = false>;
}
}
if (ReadInt(FTell()) == 0x4443434D) {
ChunkDescriptor mccd;
CCollisionTree aaboxCollision(mccd.size, kCOL_AABox);
}
FourCC PEEK;
} CModCondData;
#endif // _CMODCONDDATA
+58 -9
View File
@@ -1,6 +1,11 @@
#ifndef _NMODCONFORMAT
#define _NMODCONFORMAT
#include "CCollisionTree.bt"
#include "CColor4f.bt"
#include "CRenderOctree.bt"
#include "SAtlasLookup.bt"
struct ModConHeader {
uint32 unk;
};
@@ -10,18 +15,22 @@ struct ModConVisualData {
if (count > 0) {
CGuid modelId[count];
}
uint32 count2;
if (count2 > 0) {
CGuid ids2[count2];
}
uint32 colorCount;
if (colorCount > 0) {
CColor4f color[colorCount];
}
uint32 transformCount;
if (transformCount > 0) {
CTransform4f xf[transformCount];
}
uint32 objectTransformCount;
if (objectTransformCount > 0) {
struct {
@@ -29,42 +38,82 @@ struct ModConVisualData {
CTransform4f xf;
} objectXf[objectTransformCount];
}
uint32 byteCount;
if (byteCount > 0) {
byte bytes[byteCount];
}
uint32 shortCount;
if (shortCount > 0) {
uint16 shorts[shortCount];
}
uint32 shortCount2;
if (shortCount2 > 0) {
uint16 shorts2[shortCount2];
}
uint32 byteCount2;
if (byteCount2 > 0) {
byte bytes2[byteCount2];
}
uint32 byteCount3;
if (byteCount3 > 0) {
byte bytes3[byteCount3];
}
uint32 atlasLookupCount;
if (atlasLookupCount > 0) {
SAtlasLookup atlasLookup[atlasLookupCount];
uint32 atlasLookupCount1;
if (atlasLookupCount1 > 0) {
SAtlasLookup atlasLookup1[atlasLookupCount1];
}
uint32 atlasLookupCount2;
if (atlasLookupCount2 > 0) {
SAtlasLookup atlasLookup2[atlasLookupCount2];
}
uint32 renderOctreeFlags;
if (renderOctreeFlags != 0) {
CRenderOctree renderOctree;
}
};
struct ModConCollisionData {
ChunkDescriptor chunk;
typedef struct {
uint32 unk1;
uint32 intCount;
if (intCount) {
uint32 ints[intCount];
}
uint32 shortCount;
if (shortCount) {
uint16 shorts[shortCount];
}
} SModelVertexBlendData <optimize = false>;
typedef struct {
uint32 unkDataCount;
if (unkDataCount) {
byte unkData[unkDataCount];
}
uint32 unkIntCount;
if (unkIntCount) {
uint32 unkInts[unkIntCount];
}
uint32 modelVertexBlendDataCount;
if (modelVertexBlendDataCount) {
SModelVertexBlendData modelVertexBlendData[modelVertexBlendDataCount];
}
} SNodeVertexBlendData <optimize = false>;
struct ModConVertexBlendData {
uint32 vertexBlendDataCount;
if (vertexBlendDataCount) {
SNodeVertexBlendData vertexBlendData[vertexBlendData];
}
};
struct ModConChunk;
@@ -86,10 +135,10 @@ typedef struct {
ModConVisualData data;
break;
case "MCCD":
// ModConCollisionData
while (FTell() < start + desc.size) {
ModConChunk chunk;
}
CCollisionTree data(desc.size, kCOL_AABox);
break;
case "MCVB":
ModConVertexBlendData data;
break;
default:
if (desc.size > 0) {
-3
View File
@@ -95,9 +95,6 @@ typedef struct {
case "CLSN":
CCollisionTree aaboxCollisionTree(form.size, kCOL_AABox);
break;
case "MCON":
CModCondData modCond;
break;
case "CHPR":
FCharInf charInfo;
break;