From 5d9955ebd30f9378d2546afbe2fc46d9757ed49a Mon Sep 17 00:00:00 2001 From: Luke Street Date: Mon, 29 Dec 2025 22:57:52 -0700 Subject: [PATCH] Initial work on MP4 models (incompatible with MPR due to laziness) --- CFont.bt | 4 ++-- CGraphicsModel.bt | 25 ++++++++++++-------- NModConFormat.bt | 59 +++++++++++++++++++++++++++++++++++++++-------- 3 files changed, 67 insertions(+), 21 deletions(-) diff --git a/CFont.bt b/CFont.bt index 33456d8..b9ca4ac 100644 --- a/CFont.bt +++ b/CFont.bt @@ -35,7 +35,7 @@ typedef struct CFont { GUID id; } Guids[guidCount]; - uint32 unknowValue; + // uint32 unknowValue; uint32 floatCount01; float floatValues01[floatCount01]; @@ -58,4 +58,4 @@ typedef struct CFont { Kerning kernings[kerningCount]; } key_value_vector_node[glyphCount] ; } -}; \ No newline at end of file +}; diff --git a/CGraphicsModel.bt b/CGraphicsModel.bt index 69ab8b1..bc2f700 100644 --- a/CGraphicsModel.bt +++ b/CGraphicsModel.bt @@ -30,8 +30,8 @@ struct SModelWindData { CVector3f WindMax; float unk; } windset[windSets]; - uint32 unkD; - byte unkData[unkD]; + // uint32 unkD; + // byte unkData[unkD]; }; struct SCausticData { @@ -329,6 +329,8 @@ typedef struct(int readerVersion, int writerVersion) { CLayeredTextureData data; } else if (IsTextureMaterialDataId(dataId)) { // TODO + } else if (dataId == DATA_ID_XCH0) { + byte unk[56]; } } break; @@ -498,11 +500,12 @@ struct SVertexDataComponent { }; struct SVertexBufferInfo { - uint32 vertexCount; + // uint32 vertexCount; uint32 numAttributes; SVertexDataComponent component[numAttributes]; if (!isDKCTF) { + uint32 unk2; byte unk; } }; @@ -565,12 +568,15 @@ typedef struct(int readerVersion, int writerVersion) { case "MESH": SMeshLoadInformation loadInformation; break; - case "VBUF": - CGraphicsVertexBufferToken data; - break; - case "IBUF": - CGraphicsIndexBufferToken data; - break; + case "VBUF": + CGraphicsVertexBufferToken data; + break; + case "IBUF": + CGraphicsIndexBufferToken data; + break; + case "GPU ": + byte data[chunk.size]; + break; } FSeek(pos + chunk.size); } ModelChunk ; @@ -596,6 +602,7 @@ struct SModelBufferInfo uint32 offset ; uint32 size ; uint32 destSize ; + uint32 unk ; }; // NModelFormat::SMetaData diff --git a/NModConFormat.bt b/NModConFormat.bt index 66c04f1..8ae7abf 100644 --- a/NModConFormat.bt +++ b/NModConFormat.bt @@ -39,9 +39,40 @@ struct ModConVisualData { } objectXf[objectTransformCount]; } - uint32 byteCount; - if (byteCount > 0) { - byte bytes[byteCount]; + uint32 unkCount; + if (unkCount > 0) { + // ? + struct { + float x; + float y; + uint32 z; + uint32 w[z]; + } unk[unkCount] ; + } + + uint32 byteCount2; + if (byteCount2 > 0) { + byte bytes2[byteCount2]; + } + + uint32 byteCount3; + if (byteCount3 > 0) { + byte bytes3[byteCount3]; + } + + uint32 byteCount4; + if (byteCount4 > 0) { + byte bytes4[byteCount4]; + } + + uint32 byteCount5; + if (byteCount5 > 0) { + byte bytes5[byteCount5]; + } + + uint32 byteCount6; + if (byteCount6 > 0) { + byte bytes6[byteCount6]; } uint32 shortCount; @@ -54,16 +85,24 @@ struct ModConVisualData { uint16 shorts2[shortCount2]; } - uint32 byteCount2; - if (byteCount2 > 0) { - byte bytes2[byteCount2]; + uint32 byteCount7; + if (byteCount7 > 0) { + byte bytes7[byteCount7]; } - uint32 byteCount3; - if (byteCount3 > 0) { - byte bytes3[byteCount3]; + uint32 byteCount8; + if (byteCount8 > 0) { + byte bytes8[byteCount8]; } + uint32 dwordCount; + if (dwordCount > 0) { + uint32 dwords[dwordCount]; + } + + uint32 unkCount1; + uint32 unkCount2; + uint32 atlasLookupCount1; if (atlasLookupCount1 > 0) { SAtlasLookup atlasLookup1[atlasLookupCount1]; @@ -155,7 +194,7 @@ typedef struct { struct CModConData(uint64 size) { local uint64 start = FTell(); - while (FTell() < start + size) { + while (FTell() + 4 < start + size) { ModConChunk data; } };