2018-04-04 14:06:28 +05:30
|
|
|
#ifndef DEVIL1TEX_H
|
|
|
|
#define DEVIL1TEX_H
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
#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; // <format=hex>
|
|
|
|
uint32_t unknownA;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct TextureBatchDescriptor{
|
|
|
|
int32_t batchIdx;
|
|
|
|
uint32_t hash; // <format=hex>
|
|
|
|
uint32_t texNumber;
|
|
|
|
uint32_t unknownA[8]; // <format=hex>
|
|
|
|
uint32_t textureSize; // <format=hex>
|
|
|
|
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*);
|
|
|
|
|
2018-04-04 22:42:29 +05:30
|
|
|
void printtbd(struct TextureBatchDescriptor*);
|
|
|
|
|
|
|
|
void gettbd(struct TextureBatchDescriptor**,
|
2018-04-04 14:06:28 +05:30
|
|
|
const char*,
|
|
|
|
unsigned int);
|
|
|
|
|
2018-04-05 08:08:30 +05:30
|
|
|
void gettexturebatch(struct TextureBatch**,
|
|
|
|
const char*,
|
|
|
|
unsigned int);
|
2018-04-04 14:06:28 +05:30
|
|
|
#endif
|