num_dirs
directory entries that contains data about all the files within the WAD3 archive, as well as their position within the file.
typedef struct {
char[4] magic; // File format magic number
int num_dirs; // Number of Directory entries
int dir_offset; // Offset from the WAD3 data's beginning for first Directory entry
} Header;
The magic number is 4 bytes represented by the string WAD3
in ascii.
typedef struct {
int entry_offset; // Offset from the beginning of the WAD3 data
int disk_size; // The entry's size in the archive in bytes
int entry_size; // The entry's uncompressed size
char file_type; // File type of the entry
_Bool compressed; // Whether the file was compressed
short padding;
nt_string[16] texture_name // Null-terminated texture name
} DirEntry;
The file entries archived in the WAD3's directory are described using an array of DirEntry structures.
typedef struct {
int width, height;
char[height][width] data;
short colors_used;
char[colors_used][3] palette;
} QpicT;
// Image structure used by each mip level
typedef struct {
char[width][height] data; // Raw image data. Each byte points to an index in the palette
} MipImage;
// Color palette
typedef struct {
char[256][3] colors; // 256 triples of bytes (RGB)
} Palette;
// Texture structure
typedef struct {
nt_string[16] texture_name; // Null-terminated texture name
u_int width, height; // Dimensions of the texture (must be divisible by 16)
u_int[4] mip_offsets; // Offset from start of texture file to each mipmap level's image
MipImage[4] mip_images; // One MipImage for each mipmap level
short padding;
Palette[width][height] palette // The color palette for the mipmaps
} MipTex;
typedef struct {
short startoffset;
short charwidth;
} CharInfo;
typedef struct {
int width, height;
int row_count;
int row_height;
CharInfo[256] font_info;
char[height][width] data;
short colors_used;
char[colors_used][3] palette;
} Font;
You must log in to post a comment. You can login or register a new account.