-
Notifications
You must be signed in to change notification settings - Fork 14
/
wadext.h
119 lines (95 loc) · 2.14 KB
/
wadext.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
#include <stdint.h>
#ifdef _MSC_VER
#include <direct.h>
#else // !_MSC_VER
#include <ctype.h>
#include <unistd.h>
#include <sys/stat.h>
static char* strlwr(char* str)
{
for (char* ch = str; '\0' != *ch; ++ch)
{
*ch = tolower(*ch);
}
return str;
}
static char* strupr(char* str)
{
for (char* ch = str; '\0' != *ch; ++ch)
{
*ch = toupper(*ch);
}
return str;
}
static int mkdir(const char* path)
{
return mkdir(path, 0755);
}
#endif // !_MSC_VER
enum ExtractOpt
{
NO_CONVERT_GFX=1,
DO_HERETIC_PAL=2,
DO_HEXEN_PAL=4,
DO_STRIFE=8,
DO_STRIP=16, // strip map lumps ZDoom does not need (nodes, blockmap, reject)
NO_CONVERT_SND = 32,
};
//--------------------------------------------------------------------------
//
// Texture definition
//
//--------------------------------------------------------------------------
//
// Each texture is composed of one or more patches, with patches being lumps
// stored in the WAD. The lumps are referenced by number, and patched into
// the rectangular texture space using origin and possibly other attributes.
//
typedef struct
{
short originx;
short originy;
short patch;
short stepdir;
short colormap;
} mappatch_t;
//
// A wall texture is a list of patches which are to be combined in a
// predefined order.
//
typedef struct
{
char name[8];
uint16_t Flags; // [RH] Was unused
uint8_t ScaleX; // [RH] Scaling (8 is normal)
uint8_t ScaleY; // [RH] Same as above
short width;
short height;
uint8_t columndirectory[4]; // OBSOLETE
short patchcount;
mappatch_t patches[1];
} maptexture_t;
#define MAPTEXF_WORLDPANNING 0x8000
// [RH] Just for documentation purposes, here's what I think the
// Strife versions of the above two structures are:
typedef struct
{
short originx;
short originy;
short patch;
} strifemappatch_t;
//
// A wall texture is a list of patches which are to be combined in a
// predefined order.
//
typedef struct
{
char name[8];
uint16_t Flags; // [RH] Was nused
uint8_t ScaleX; // [RH] Scaling (8 is normal)
uint8_t ScaleY; // [RH] Same as above
short width;
short height;
short patchcount;
strifemappatch_t patches[1];
} strifemaptexture_t;