68 lines
No EOL
1.6 KiB
Text
Executable file
68 lines
No EOL
1.6 KiB
Text
Executable file
//------------------------------------------------
|
|
//--- 010 Editor v12.0.1 Binary Template
|
|
//
|
|
// File:
|
|
// Authors:
|
|
// Version:
|
|
// Purpose:
|
|
// Category:
|
|
// File Mask:
|
|
// ID Bytes:
|
|
// History:
|
|
//------------------------------------------------
|
|
|
|
// ========
|
|
// Typedefs
|
|
// ========
|
|
|
|
typedef struct {
|
|
unsigned int dxgiFormat;
|
|
unsigned int resourceDimension;
|
|
unsigned int miscFlag;
|
|
unsigned int arraySize;
|
|
unsigned int miscFlags2;
|
|
} stingray::image::DDSImage::DDS_DX10_HEADER;
|
|
|
|
|
|
typedef struct {
|
|
unsigned int dwSize;
|
|
unsigned int dwFlags;
|
|
unsigned int dwFourCC;
|
|
unsigned int dwRGBBitCount;
|
|
unsigned int dwRBitMask;
|
|
unsigned int dwGBitMask;
|
|
unsigned int dwBBitMask;
|
|
unsigned int dwABitMask;
|
|
} stingray::image::DDSImage::DDS_PIXELFORMAT;
|
|
|
|
typedef struct
|
|
{
|
|
unsigned int dwSize;
|
|
unsigned int dwHeaderFlags;
|
|
unsigned int dwHeight;
|
|
unsigned int dwWidth;
|
|
unsigned int dwPitchOrLinearSize;
|
|
unsigned int dwDepth;
|
|
unsigned int dwMipMapCount;
|
|
unsigned int dwReserved1[11];
|
|
stingray::image::DDSImage::DDS_PIXELFORMAT ddspf;
|
|
unsigned int dwCaps;
|
|
unsigned int dwCaps2;
|
|
unsigned int dwReserved2[3];
|
|
} stingray::image::DDSImage::DDS_HEADER;
|
|
|
|
// =========
|
|
// Structure
|
|
// =========
|
|
|
|
uint32 skip_1;
|
|
stingray::image::DDSImage::DDS_HEADER header;
|
|
|
|
if (header.ddspf.dwFourCC == 0x30315844) {
|
|
stingray::image::DDSImage::DDS_DX10_HEADER dx10_header;
|
|
}
|
|
|
|
// TODO: Lots of calculations and value checking is done in the code
|
|
// before it's determined how to read the next section.
|
|
// Though it does look like there are only two ways that it does end up proceeding.
|
|
// In the first case, `header.dwDepth` plays a role |