You've already forked PrimeRemasterStructs
mirror of
https://github.com/PrimeDecomp/PrimeRemasterStructs.git
synced 2026-03-31 14:23:23 -07:00
104 lines
1.9 KiB
Plaintext
104 lines
1.9 KiB
Plaintext
#ifndef _CMATERIALINSTANCERESOURCE
|
|
#define _CMATERIALINSTANCERESOURCE
|
|
|
|
#include "CChunkDescriptor.bt"
|
|
#include "CMayaSpline.bt"
|
|
#include "NGraphicsMaterial.bt"
|
|
|
|
int getCountFromBits(int b) {
|
|
local int count = 0;
|
|
|
|
while (b > 0) {
|
|
count += (b & 1);
|
|
b >>= 1;
|
|
}
|
|
|
|
return count;
|
|
}
|
|
typedef struct {
|
|
FourCC type;
|
|
FourCC id;
|
|
uchar unk1;
|
|
uchar unk2;
|
|
} CVariableDesc <name=(Str("%s %s", type, id))>;
|
|
|
|
typedef struct {
|
|
FourCC id;
|
|
uchar type;
|
|
|
|
switch (type) {
|
|
case 2:
|
|
int unk;
|
|
break;
|
|
case 3:
|
|
case 4:
|
|
case 12:
|
|
CColor4f color;
|
|
break;
|
|
case 5:
|
|
case 6:
|
|
case 7:
|
|
case 8:
|
|
GUID texture;
|
|
STextureUsageInfo textureUsage;
|
|
break;
|
|
case 10:
|
|
CVector4i unk;
|
|
break;
|
|
case 32:
|
|
uchar unk1[3];
|
|
CColor4f unk2;
|
|
CColor4f unk3;
|
|
break;
|
|
case 48:
|
|
uchar unk2[3];
|
|
CColor4f color1;
|
|
CColor4f color2;
|
|
CColor4f color3;
|
|
break;
|
|
}
|
|
|
|
} CMaterialInstanceData; // named from CMaterialInstanceDataBuilder, not guaranteed to be accurate
|
|
|
|
typedef struct {
|
|
ChunkDescriptor chunk;
|
|
GUID guid1;
|
|
GUID guid2;
|
|
if (form.readerVersion == 37) {
|
|
uchar unkByte;
|
|
uchar unkByte2;
|
|
uint unkInt;
|
|
uint unkInt2;
|
|
uint variableDescCount;
|
|
CVariableDesc variableDescs[variableDescCount];
|
|
uchar unkByte3;
|
|
|
|
if (unkByte3) {
|
|
struct {
|
|
ubyte packedCount;
|
|
local int actualCount = getCountFromBits(packedCount);
|
|
if (actualCount > 0) {
|
|
CMayaSpline splines[actualCount] <optimize = false>;
|
|
}
|
|
} unkData[unkByte3] <optimize = false>;
|
|
}
|
|
|
|
ubyte unk4;
|
|
} else {
|
|
uint unk1;
|
|
uchar unk2;
|
|
uint unk3;
|
|
uint variableDescCount;
|
|
CVariableDesc varibleDescs[variableDescCount];
|
|
}
|
|
|
|
uint propertyCount;
|
|
CMaterialInstanceData data[propertyCount]<optimize = false>;
|
|
uint unkFccCount;
|
|
struct {
|
|
FourCC fcc;
|
|
} unkFourCC[unkFccCount];
|
|
} CMaterialInstanceResource;
|
|
|
|
#endif// _CMATERIALINSTANCERESOURCE
|