mirror of
https://github.com/FWGS/xash3d-fwgs.git
synced 2026-08-05 03:24:56 +08:00
filesystem: common: move wad structures to wadfile.h
This commit is contained in:
committed by
Alibek Omarov
parent
e36486b73a
commit
7dc88f9417
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user