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);
12 extern void transpolyparticle(vec3_t org, vec3_t right, vec3_t up, vec_t scale, unsigned short texnum, unsigned short transpolytype, int ir, int ig, int ib, float alphaf, float s1, float t1, float s2, float t2);
14 extern void wallpolyclear(void);
15 extern void wallpolyrender1(void);
16 extern void wallpolyrender2(void);
18 extern void skypolyclear(void);
19 extern void skypolyrender(void);
20 extern void skypolybegin(void);
21 extern void skypolyvert(float x, float y, float z);
22 extern void skypolyend(void);
24 #define MAX_TRANSPOLYS 65536
25 #define MAX_TRANSVERTS (MAX_TRANSPOLYS*4)
26 #define MAX_WALLPOLYS 65536
27 #define MAX_WALLVERTS (MAX_WALLPOLYS*3)
28 #define MAX_SKYPOLYS 2048
29 #define MAX_SKYVERTS (MAX_SKYPOLYS*4)
41 // vec_t mindistance, maxdistance; // closest and farthest distance along v_forward
42 // vec_t distance; // distance to center
43 // vec3_t n; // normal
44 // vec_t ndist; // distance from origin along that normal
45 unsigned short texnum;
46 unsigned short glowtexnum;
47 unsigned short fogtexnum;
48 unsigned short firstvert;
50 unsigned short transpolytype;
54 // note: must match format of glpoly_t vertices due to a memcpy used in RSurf_DrawWall
57 vec_t vert[VERTEXSIZE]; // xyz st uv
69 unsigned short texnum, lighttexnum, glowtexnum;
70 unsigned short firstvert;
71 unsigned short numverts;
72 unsigned short lit; // doesn't need to be an unsigned short, but to keep the structure consistent...
80 float v[4]; // 4th item is only for padding
86 unsigned short firstvert;
91 extern transvert_t *transvert;
92 extern transpoly_t *transpoly;
93 extern int *transpolyindex;
94 extern int *transvertindex;
95 extern transpoly_t **transpolylist;
96 extern wallvert_t *wallvert;
97 extern wallvertcolor_t *wallvertcolor;
98 extern wallpoly_t *wallpoly;
99 extern skyvert_t *skyvert;
100 extern skypoly_t *skypoly;
102 extern int currenttranspoly;
103 extern int currenttransvert;
104 extern int currentwallpoly;
105 extern int currentwallvert;
106 extern int currentskypoly;
107 extern int currentskyvert;
109 #define transpolybegin(ttexnum, tglowtexnum, tfogtexnum, ttranspolytype)\
111 if (currenttranspoly < MAX_TRANSPOLYS && currenttransvert < MAX_TRANSVERTS)\
113 transpoly[currenttranspoly].texnum = (unsigned short) (ttexnum);\
114 transpoly[currenttranspoly].glowtexnum = (unsigned short) (tglowtexnum);\
115 transpoly[currenttranspoly].fogtexnum = (unsigned short) (tfogtexnum);\
116 transpoly[currenttranspoly].transpolytype = (unsigned short) (ttranspolytype);\
117 transpoly[currenttranspoly].firstvert = currenttransvert;\
118 transpoly[currenttranspoly].verts = 0;\
122 #define transpolyvert(vx,vy,vz,vs,vt,vr,vg,vb,va) \
124 if (currenttranspoly < MAX_TRANSPOLYS && currenttransvert < MAX_TRANSVERTS)\
126 transvert[currenttransvert].s = (vs);\
127 transvert[currenttransvert].t = (vt);\
130 transvert[currenttransvert].r = (byte) (bound(0, (int) (vr) >> 1, 255));\
131 transvert[currenttransvert].g = (byte) (bound(0, (int) (vg) >> 1, 255));\
132 transvert[currenttransvert].b = (byte) (bound(0, (int) (vb) >> 1, 255));\
136 transvert[currenttransvert].r = (byte) (bound(0, (int) (vr), 255));\
137 transvert[currenttransvert].g = (byte) (bound(0, (int) (vg), 255));\
138 transvert[currenttransvert].b = (byte) (bound(0, (int) (vb), 255));\
140 transvert[currenttransvert].a = (byte) (bound(0, (int) (va), 255));\
141 transvert[currenttransvert].v[0] = (vx);\
142 transvert[currenttransvert].v[1] = (vy);\
143 transvert[currenttransvert].v[2] = (vz);\
145 transpoly[currenttranspoly].verts++;\
149 #define transpolyvertub(vx,vy,vz,vs,vt,vr,vg,vb,va) \
151 if (currenttranspoly < MAX_TRANSPOLYS && currenttransvert < MAX_TRANSVERTS)\
153 transvert[currenttransvert].s = (vs);\
154 transvert[currenttransvert].t = (vt);\
157 transvert[currenttransvert].r = (vr) >> 1;\
158 transvert[currenttransvert].g = (vg) >> 1;\
159 transvert[currenttransvert].b = (vb) >> 1;\
163 transvert[currenttransvert].r = (vr);\
164 transvert[currenttransvert].g = (vg);\
165 transvert[currenttransvert].b = (vb);\
167 transvert[currenttransvert].a = (va);\
168 transvert[currenttransvert].v[0] = (vx);\
169 transvert[currenttransvert].v[1] = (vy);\
170 transvert[currenttransvert].v[2] = (vz);\
172 transpoly[currenttranspoly].verts++;\