220 lines
4.6 KiB
C
220 lines
4.6 KiB
C
#ifndef MATERIAL_H
|
|
#define MATERIAL_H
|
|
|
|
#include "materialtechset.h"
|
|
|
|
struct GfxDrawSurfFields
|
|
{
|
|
unsigned __int64 objectId : 16;
|
|
unsigned __int64 reflectionProbeIndex : 8;
|
|
unsigned __int64 customIndex : 5;
|
|
unsigned __int64 materialSortedIndex : 11;
|
|
unsigned __int64 prepass : 2;
|
|
unsigned __int64 primaryLightIndex : 8;
|
|
unsigned __int64 surfType : 4;
|
|
unsigned __int64 primarySortKey : 6;
|
|
unsigned __int64 unused : 4;
|
|
};
|
|
|
|
union GfxDrawSurf
|
|
{
|
|
GfxDrawSurfFields fields;
|
|
unsigned __int64 packed;
|
|
};
|
|
|
|
struct __declspec(align(8)) MaterialInfo
|
|
{
|
|
const char *name;
|
|
unsigned __int8 gameFlags;
|
|
unsigned __int8 sortKey;
|
|
unsigned __int8 textureAtlasRowCount;
|
|
unsigned __int8 textureAtlasColumnCount;
|
|
GfxDrawSurf drawSurf;
|
|
unsigned int surfaceTypeBits;
|
|
};
|
|
|
|
enum MapType : __int32
|
|
{
|
|
MAPTYPE_NONE = 0x0,
|
|
MAPTYPE_INVALID1 = 0x1,
|
|
MAPTYPE_INVALID2 = 0x2,
|
|
MAPTYPE_2D = 0x3,
|
|
MAPTYPE_3D = 0x4,
|
|
MAPTYPE_CUBE = 0x5,
|
|
MAPTYPE_COUNT = 0x6,
|
|
};
|
|
|
|
struct GPUTEXTURESIZE_1D
|
|
{
|
|
unsigned __int32 Width : 24;
|
|
};
|
|
|
|
struct GPUTEXTURESIZE_2D
|
|
{
|
|
unsigned __int32 Width : 13;
|
|
unsigned __int32 Height : 13;
|
|
};
|
|
|
|
struct GPUTEXTURESIZE_3D
|
|
{
|
|
unsigned __int32 Width : 11;
|
|
unsigned __int32 Height : 11;
|
|
unsigned __int32 Depth : 10;
|
|
};
|
|
|
|
struct GPUTEXTURESIZE_STACK
|
|
{
|
|
unsigned __int32 Width : 13;
|
|
unsigned __int32 Height : 13;
|
|
unsigned __int32 Depth : 6;
|
|
};
|
|
|
|
struct $FD14676823C8BF1A2A32FD1720A565E9
|
|
{
|
|
unsigned __int32 Type : 2;
|
|
unsigned __int32 SignX : 2;
|
|
unsigned __int32 SignY : 2;
|
|
unsigned __int32 SignZ : 2;
|
|
unsigned __int32 SignW : 2;
|
|
unsigned __int32 ClampX : 3;
|
|
unsigned __int32 ClampY : 3;
|
|
unsigned __int32 ClampZ : 3;
|
|
unsigned __int32 : 3;
|
|
unsigned __int32 Pitch : 9;
|
|
unsigned __int32 Tiled : 1;
|
|
unsigned __int32 DataFormat : 6;
|
|
unsigned __int32 Endian : 2;
|
|
unsigned __int32 RequestSize : 2;
|
|
unsigned __int32 Stacked : 1;
|
|
unsigned __int32 ClampPolicy : 1;
|
|
unsigned __int32 BaseAddress : 20;
|
|
union
|
|
{
|
|
GPUTEXTURESIZE_1D OneD;
|
|
GPUTEXTURESIZE_2D TwoD;
|
|
GPUTEXTURESIZE_3D ThreeD;
|
|
GPUTEXTURESIZE_STACK Stack;
|
|
} Size;
|
|
unsigned __int32 NumFormat : 1;
|
|
unsigned __int32 SwizzleX : 3;
|
|
unsigned __int32 SwizzleY : 3;
|
|
unsigned __int32 SwizzleZ : 3;
|
|
unsigned __int32 SwizzleW : 3;
|
|
__int32 ExpAdjust : 6;
|
|
unsigned __int32 MagFilter : 2;
|
|
unsigned __int32 MinFilter : 2;
|
|
unsigned __int32 MipFilter : 2;
|
|
unsigned __int32 AnisoFilter : 3;
|
|
unsigned __int32 : 3;
|
|
unsigned __int32 BorderSize : 1;
|
|
unsigned __int32 VolMagFilter : 1;
|
|
unsigned __int32 VolMinFilter : 1;
|
|
unsigned __int32 MinMipLevel : 4;
|
|
unsigned __int32 MaxMipLevel : 4;
|
|
unsigned __int32 MagAnisoWalk : 1;
|
|
unsigned __int32 MinAnisoWalk : 1;
|
|
__int32 LODBias : 10;
|
|
__int32 GradExpAdjustH : 5;
|
|
__int32 GradExpAdjustV : 5;
|
|
unsigned __int32 BorderColor : 2;
|
|
unsigned __int32 ForceBCWToMax : 1;
|
|
unsigned __int32 TriClamp : 2;
|
|
__int32 AnisoBias : 4;
|
|
unsigned __int32 Dimension : 2;
|
|
unsigned __int32 PackedMips : 1;
|
|
unsigned __int32 MipAddress : 20;
|
|
};
|
|
|
|
union GPUTEXTURE_FETCH_CONSTANT
|
|
{
|
|
$FD14676823C8BF1A2A32FD1720A565E9 __s0;
|
|
unsigned int dword[6];
|
|
};
|
|
|
|
struct D3DBaseTexture : D3DResource
|
|
{
|
|
unsigned int MipFlush;
|
|
GPUTEXTURE_FETCH_CONSTANT Format;
|
|
};
|
|
|
|
struct D3DTexture : D3DBaseTexture
|
|
{
|
|
};
|
|
|
|
struct D3DVolumeTexture : D3DBaseTexture
|
|
{
|
|
};
|
|
|
|
struct D3DCubeTexture : D3DBaseTexture
|
|
{
|
|
};
|
|
|
|
struct WaterWritable
|
|
{
|
|
float floatTime;
|
|
};
|
|
|
|
struct GfxImage;
|
|
struct water_t
|
|
{
|
|
WaterWritable writable;
|
|
float *H0X;
|
|
float *H0Y;
|
|
float *wTerm;
|
|
int M;
|
|
int N;
|
|
float Lx;
|
|
float Lz;
|
|
float gravity;
|
|
float windvel;
|
|
float winddir[2];
|
|
float amplitude;
|
|
float codeConstant[4];
|
|
GfxImage *image;
|
|
};
|
|
|
|
union MaterialTextureDefInfo
|
|
{
|
|
GfxImage *image;
|
|
water_t *water;
|
|
};
|
|
|
|
struct MaterialTextureDef
|
|
{
|
|
unsigned int nameHash;
|
|
char nameStart;
|
|
char nameEnd;
|
|
unsigned __int8 samplerState;
|
|
unsigned __int8 semantic;
|
|
MaterialTextureDefInfo u;
|
|
};
|
|
|
|
struct MaterialConstantDef
|
|
{
|
|
unsigned int nameHash;
|
|
char name[12];
|
|
float literal[4];
|
|
};
|
|
|
|
struct GfxStateBits
|
|
{
|
|
unsigned int loadBits[2];
|
|
};
|
|
|
|
struct Material
|
|
{
|
|
MaterialInfo info;
|
|
unsigned __int8 stateBitsEntry[26];
|
|
unsigned __int8 textureCount;
|
|
unsigned __int8 constantCount;
|
|
unsigned __int8 stateBitsCount;
|
|
unsigned __int8 stateFlags;
|
|
unsigned __int8 cameraRegion;
|
|
MaterialTechSet *techniqueSet;
|
|
MaterialTextureDef *textureTable;
|
|
MaterialConstantDef *constantTable;
|
|
GfxStateBits *stateBitsTable;
|
|
};
|
|
|
|
#endif // MATERIAL_H
|