2 extern int R_SetSkyBox(char* sky);
3 extern cvar_t r_skyquality;
5 #define TPOLYTYPE_ALPHA 0
6 #define TPOLYTYPE_ADD 1
8 extern void transpolyclear(void);
9 extern void transpolyrender(void);
10 extern void transpolybegin(int texnum, int glowtexnum, int fogtexnum, int transpolytype);
11 extern void transpolyend(void);
13 extern void wallpolyclear(void);
14 extern void wallpolyrender(void);
16 extern void skypolyclear(void);
17 extern void skypolyrender(void);
18 extern void skypolybegin(void);
19 extern void skypolyvert(float x, float y, float z);
20 extern void skypolyend(void);
22 #define MAX_TRANSPOLYS 65536
23 #define MAX_TRANSVERTS (MAX_TRANSPOLYS*4)
24 #define MAX_WALLPOLYS 65536
25 #define MAX_WALLVERTS (MAX_WALLPOLYS*3)
26 #define MAX_SKYPOLYS 2048
27 #define MAX_SKYVERTS (MAX_SKYPOLYS*4)
39 // vec_t mindistance, maxdistance; // closest and farthest distance along v_forward
40 // vec_t distance; // distance to center
41 // vec3_t n; // normal
42 // vec_t ndist; // distance from origin along that normal
43 unsigned short texnum;
44 unsigned short glowtexnum;
45 unsigned short fogtexnum;
46 unsigned short firstvert;
48 unsigned short transpolytype;
52 // note: must match format of glpoly_t vertices due to a memcpy used in RSurf_DrawWall
55 vec_t vert[VERTEXSIZE]; // xyz st uv
67 unsigned short texnum, lighttexnum, glowtexnum;
68 unsigned short firstvert;
69 unsigned short numverts;
70 unsigned short lit; // doesn't need to be an unsigned short, but to keep the structure consistent...
78 float v[4]; // 4th item is only for padding
84 unsigned short firstvert;
89 extern transvert_t *transvert;
90 extern transpoly_t *transpoly;
91 extern unsigned short *transpolyindex;
92 extern wallvert_t *wallvert;
93 extern wallvertcolor_t *wallvertcolor;
94 extern wallpoly_t *wallpoly;
95 extern skyvert_t *skyvert;
96 extern skypoly_t *skypoly;
98 extern int currenttranspoly;
99 extern int currenttransvert;
100 extern int currentwallpoly;
101 extern int currentwallvert;
102 extern int currentskypoly;
103 extern int currentskyvert;
105 #define transpolybegin(ttexnum, tglowtexnum, tfogtexnum, ttranspolytype)\
107 if (currenttranspoly < MAX_TRANSPOLYS && currenttransvert < MAX_TRANSVERTS)\
109 transpoly[currenttranspoly].texnum = (unsigned short) (ttexnum);\
110 transpoly[currenttranspoly].glowtexnum = (unsigned short) (tglowtexnum);\
111 transpoly[currenttranspoly].fogtexnum = (unsigned short) (tfogtexnum);\
112 transpoly[currenttranspoly].transpolytype = (unsigned short) (ttranspolytype);\
113 transpoly[currenttranspoly].firstvert = currenttransvert;\
114 transpoly[currenttranspoly].verts = 0;\
118 #define transpolyvert(vx,vy,vz,vs,vt,vr,vg,vb,va) \
120 if (currenttranspoly < MAX_TRANSPOLYS && currenttransvert < MAX_TRANSVERTS)\
122 transvert[currenttransvert].s = (vs);\
123 transvert[currenttransvert].t = (vt);\
126 transvert[currenttransvert].r = (byte) (bound(0, (int) (vr) >> 1, 255));\
127 transvert[currenttransvert].g = (byte) (bound(0, (int) (vg) >> 1, 255));\
128 transvert[currenttransvert].b = (byte) (bound(0, (int) (vb) >> 1, 255));\
132 transvert[currenttransvert].r = (byte) (bound(0, (int) (vr), 255));\
133 transvert[currenttransvert].g = (byte) (bound(0, (int) (vg), 255));\
134 transvert[currenttransvert].b = (byte) (bound(0, (int) (vb), 255));\
136 transvert[currenttransvert].a = (byte) (bound(0, (int) (va), 255));\
137 transvert[currenttransvert].v[0] = (vx);\
138 transvert[currenttransvert].v[1] = (vy);\
139 transvert[currenttransvert].v[2] = (vz);\
141 transpoly[currenttranspoly].verts++;\
145 #define transpolyvertub(vx,vy,vz,vs,vt,vr,vg,vb,va) \
147 if (currenttranspoly < MAX_TRANSPOLYS && currenttransvert < MAX_TRANSVERTS)\
149 transvert[currenttransvert].s = (vs);\
150 transvert[currenttransvert].t = (vt);\
153 transvert[currenttransvert].r = (vr) >> 1;\
154 transvert[currenttransvert].g = (vg) >> 1;\
155 transvert[currenttransvert].b = (vb) >> 1;\
159 transvert[currenttransvert].r = (vr);\
160 transvert[currenttransvert].g = (vg);\
161 transvert[currenttransvert].b = (vb);\
163 transvert[currenttransvert].a = (va);\
164 transvert[currenttransvert].v[0] = (vx);\
165 transvert[currenttransvert].v[1] = (vy);\
166 transvert[currenttransvert].v[2] = (vz);\
168 transpoly[currenttranspoly].verts++;\