Updates to CGraphicsModel/MaterialArchive

This commit is contained in:
Luke Street
2023-03-10 23:29:58 -05:00
parent c50beb53c0
commit 633ad8a722
4 changed files with 50 additions and 5 deletions
+34 -4
View File
@@ -37,6 +37,7 @@ struct SCausticData {
uint32 unkData[unkD];
};
// CModelDataSource
struct DataSourceLoader {
if (ReadByte() == 0) //Type for WiiU is an I32
{
@@ -60,19 +61,27 @@ struct DataSourceLoader {
}
switch (type) {
case "ANUV":
// NModelCustomData::sAnimUvDataSourceLoader
SModelAnimatedUVData animatedUvs;
break;
case "WIND":
// NModelCustomData::sWindModelDataSourceLoader
SModelWindData wind;
break;
case "CAUS":
// NModelCustomData::sCausticDataSourceLoader
SCausticData caustic;
break;
}
// NModelCustomData::sSkinnedModelAnimUvDataSourceLoader
// NModelCustomData::sVertAnimModelDataSourceLoader
};
struct CustomDataLoader {
FourCC type;
// CModelCustomDataMPT
// byte b;
// if (b) CModelSurfaceMetaDataMPT
};
struct ModelHeader {
@@ -367,7 +376,9 @@ typedef struct {
//material type list (can be 0)
uint typeCount;
}
struct { FourCC type; } types[typeCount];
if (typeCount != 0) {
struct { FourCC type; } types[typeCount];
}
if (isDKCTF == 1)
{
uint flags;
@@ -376,13 +387,15 @@ typedef struct {
{
//material data types (with extra value)
uint renderTypeCount;
MaterialRenderTypes renderTypes[renderTypeCount];
if (renderTypeCount != 0) {
MaterialRenderTypes renderTypes[renderTypeCount];
}
}
//material data types
uint dataCount;
if (useMaterialTypeChunk || !isDKCTF)
{
MaterialType dataTypes2[dataCount];
MaterialType dataTypes[dataCount];
}
//data parse
CMaterialData data[dataCount] <optimize=false>;
@@ -407,7 +420,24 @@ typedef struct {
struct SMeshLoadInformation {
uint meshCount;
CRenderMesh meshes[meshCount]<optimize=false>;
CRenderMesh meshes[meshCount] <optimize=false>;
byte unk[(meshCount + 3) / 4];
byte unk2[(meshCount + 7) / 8];
uint shortCount;
if (shortCount > 0) {
uint16 shorts[shortCount];
}
byte lodCount;
struct {
struct {
uint32 a;
uint32 b;
} inner[5];
} outer[lodCount];
uint32 hasLodRule;
if (hasLodRule == 1) {
float lodRule[lodCount];
}
};
enum <uint32> EVertexDataFormat {
+12
View File
@@ -303,5 +303,17 @@ struct MaterialArchive(uint64 size) {
}
};
struct SMaterialMetaData(uint64 fileStart) {
uint32 count;
uint32 version;
uint32 compressedSize;
uint32 decompressedSize;
uint32 fileOffset;
local uint64 pos <format=hex, hidden=true> = FTell();
FSeek(fileStart + fileOffset);
byte zlibData[compressedSize];
FSeek(pos);
};
#endif// _MATERIALARCHIVE
+3
View File
@@ -13,6 +13,9 @@ typedef struct(FourCC type, uint64 size, uint64 fileStart)
case "CMDL":
SModelMetaData meta(fileStart);
break;
case "MTRL":
SMaterialMetaData meta(fileStart);
break;
default:
byte data[size];
break;
+1 -1
View File
@@ -10,6 +10,7 @@ if (!exists(isDKCTF)) {
// Meta
#include "CGraphicsModel.bt"
#include "MaterialArchive.bt"
#include "Meta.bt"
#include "NTextureFormat.bt"
@@ -29,7 +30,6 @@ if (!exists(isDKCTF)) {
#include "CReflectionProbeData.bt"
#include "CUniverseInfo.bt"
#include "CVectorField.bt"
#include "MaterialArchive.bt"
#include "MessageTable.bt"
// #include "CRuleSet.bt"
#include "CGameAreaResource.bt"