Cube  Diff

Differences From Artifact [0e2553a48d]:

To Artifact [06881e859d]:


29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45


















46
47
48
49
50
51
52
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







-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+







	CHF,       // idem ceiling
	SPACE,     // entirely empty cube
	SEMISOLID, // generated by mipmapping
	MAXTYPE
};

struct sqr {
	uchar type;             // one of the above
	char floor, ceil;       // height, in cubes
	uchar wtex, ftex, ctex; // wall/floor/ceil texture ids
	uchar r, g, b;          // light value at upper left vertex
	uchar vdelta;           // vertex delta, used for heightfield cubes
	char defer; // used in mipmapping, when true this cube is not a perfect
	            // mip
	char occluded; // true when occluded
	uchar utex;    // upper wall tex id
	uchar tag;     // used by triggers
	// one of the above
	unsigned char type;
	// height, in cubes
	char floor, ceil;
	// wall/floor/ceil texture ids
	unsigned char wtex, ftex, ctex;
	// light value at upper left vertex
	unsigned char r, g, b;
	// vertex delta, used for heightfield cubes
	unsigned char vdelta;
	// used in mipmapping, when true this cube is not a perfect mip
	char defer;
	// true when occluded
	char occluded;
	// upper wall tex id
	unsigned char utex;
	// used by triggers
	unsigned char tag;
};

// hardcoded texture numbers
enum {
	DEFAULT_SKY = 0,
	DEFAULT_LIQUID,
	DEFAULT_WALL,
83
84
85
86
87
88
89
90

91
92
93
94
95
96
97
91
92
93
94
95
96
97

98
99
100
101
102
103
104
105







-
+







struct header {
	char head[4];   // "CUBE"
	int version;    // any >8bit quantity is a little indian
	int headersize; // sizeof(header)
	int sfactor;    // in bits
	int numents;
	char maptitle[128];
	uchar texlists[3][256];
	unsigned char texlists[3][256];
	int waterlevel;
	int reserved[15];
};

#define SWS(w, x, y, s) (&(w)[(y) * (s) + (x)])
#define SW(w, x, y) SWS(w, x, y, ssize)
#define S(x, y) SW(world, x, y) // convenient lookup of a lowest mip cube
233
234
235
236
237
238
239
240

241
242
243
244
245
246
247
241
242
243
244
245
246
247

248
249
250
251
252
253
254
255







-
+







	S_JUMPPAD,
};

// vertex array format

struct vertex {
	float u, v, x, y, z;
	uchar r, g, b, a;
	unsigned char r, g, b, a;
};

// globals ooh naughty

#ifdef __cplusplus
extern "C" {
#endif