filesystem: common: move wad structures to wadfile.h

This commit is contained in:
Sergey Degtyar
2025-07-16 18:17:44 +03:00
committed by Alibek Omarov
parent e36486b73a
commit 7dc88f9417
2 changed files with 34 additions and 20 deletions

View File

@@ -35,6 +35,7 @@ infotable dlumpinfo_t[dwadinfo_t->numlumps]
#define IDWAD2HEADER (('2'<<24)+('D'<<16)+('A'<<8)+'W') // little-endian "WAD2" quake wads
#define IDWAD3HEADER (('3'<<24)+('D'<<16)+('A'<<8)+'W') // little-endian "WAD3" half-life wads
#define WAD3_NAMELEN 16
// dlumpinfo_t->attribs
#define ATTR_NONE 0 // allow to read-write
@@ -83,4 +84,37 @@ typedef struct mip_s
unsigned int offsets[4]; // four mip maps stored
} mip_t;
/*
========================================================================
.WAD header format (half-Life textures)
========================================================================
*/
typedef struct
{
int ident; // should be WAD3
int numlumps; // num files
int infotableofs; // LUT offset
} dwadinfo_t;
/*
========================================================================
.WAD struct (half-Life textures)
========================================================================
*/
typedef struct
{
int filepos; // file offset in WAD
int disksize; // compressed or uncompressed
int size; // uncompressed
signed char type; // TYP_*
signed char attribs; // file attribs
signed char pad0;
signed char pad1;
char name[WAD3_NAMELEN]; // must be null terminated
} dlumpinfo_t;
#endif//WADFILE_H

View File

@@ -46,31 +46,11 @@ file_n: byte[dwadinfo_t[num]->disksize]
infotable dlumpinfo_t[dwadinfo_t->numlumps]
========================================================================
*/
#define WAD3_NAMELEN 16
#define HINT_NAMELEN 5 // e.g. _mask, _norm
#define MAX_FILES_IN_WAD 65535 // real limit as above <2Gb size not a lumpcount
#include "const.h"
typedef struct
{
int ident; // should be WAD3
int numlumps; // num files
int infotableofs; // LUT offset
} dwadinfo_t;
typedef struct
{
int filepos; // file offset in WAD
int disksize; // compressed or uncompressed
int size; // uncompressed
signed char type; // TYP_*
signed char attribs; // file attribs
signed char pad0;
signed char pad1;
char name[WAD3_NAMELEN]; // must be null terminated
} dlumpinfo_t;
struct wfile_s
{
int infotableofs;