#ifndef DEVIL1TEX_H #define DEVIL1TEX_H #include #include #pragma pack(push, 1) // disable struct padding // to easily impose struct on plain data. 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) // re-enable stuct padding for whatever other reason. void printtph(struct TexturePack*); void printtbd(struct TextureBatchDescriptor*); void gettbd(struct TextureBatchDescriptor**, const char*, unsigned int); unsigned int gettexturebatch( struct TextureBatch**, struct TextureBatchDescriptor**, const char*, unsigned int); void locatetextures(unsigned int*, struct TexturePack*, struct TextureBatchDescriptor**); bool gettexdescriptor(struct TextureBatchDescriptor**, unsigned int, const char *, unsigned int); bool gettexbatch(struct TextureBatch**, unsigned int, const char*, unsigned int); bool unpacktexbatch(struct Texture*, unsigned int, const char*, const unsigned int); #endif