#ifndef DEVIL1TEX_H #define DEVIL1TEX_H #include #include // disable struct padding // to easily impose struct on plain data. #pragma pack(push, 1) struct TexturePack { char id[4]; int32_t batchNumber; uint32_t firstBatchOffset; // uint32_t unknownA; }; struct TextureBatchDescriptor{ int32_t batchIdx; uint32_t hash; // uint32_t texNumber; uint32_t unknownA[8]; // uint32_t textureSize; // uint32_t unknownB[30]; }; struct Texture { // size of array is defined by descriptor // textureSize unsigned char *data; }; struct TextureBatch { // quantity of textures are defined by descriptor // texNumber struct Texture *batch; }; #pragma pack(pop) typedef struct { // input: pointer to struct void (* const printheader) (struct TexturePack*); // input: pointer to struct void (* const printbatchdesc)(struct TextureBatchDescriptor*); // input: pointer of pointer to struct, order, file data, file size // ** = 'pass by reference' of a pointer to struct bool (* const getbatchdesc) (struct TextureBatchDescriptor**, unsigned int, const char *, unsigned int); // input: pointer of pointer to struct, order, file data, file size // ** = 'pass by reference' of a pointer to struct bool (* const getbatch) (struct TextureBatch**, unsigned int, const char*, unsigned int); // input: pointer to struct, order, file data, file size bool (* const gettextures) (struct Texture*, unsigned int, const char*, const unsigned int); } fn_devil1tex; extern fn_devil1tex const DEVIL1TEX; #endif