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...
77 float v[4]; // 4th item is only for padding
83 unsigned short firstvert;
88 extern transvert_t *transvert;
89 extern transpoly_t *transpoly;
90 extern unsigned short *transpolyindex;
91 extern wallvert_t *wallvert;
92 extern wallvertcolor_t *wallvertcolor;
93 extern wallpoly_t *wallpoly;
94 extern skyvert_t *skyvert;
95 extern skypoly_t *skypoly;
97 extern int currenttranspoly;
98 extern int currenttransvert;
99 extern int currentwallpoly;
100 extern int currentwallvert;
101 extern int currentskypoly;
102 extern int currentskyvert;
104 #define transpolybegin(ttexnum, tglowtexnum, tfogtexnum, ttranspolytype)\
106 if (currenttranspoly < MAX_TRANSPOLYS && currenttransvert < MAX_TRANSVERTS)\
108 transpoly[currenttranspoly].texnum = (unsigned short) (ttexnum);\
109 transpoly[currenttranspoly].glowtexnum = (unsigned short) (tglowtexnum);\
110 transpoly[currenttranspoly].fogtexnum = (unsigned short) (tfogtexnum);\
111 transpoly[currenttranspoly].transpolytype = (unsigned short) (ttranspolytype);\
112 transpoly[currenttranspoly].firstvert = currenttransvert;\
113 transpoly[currenttranspoly].verts = 0;\
117 #define transpolyvert(vx,vy,vz,vs,vt,vr,vg,vb,va) \
119 if (currenttranspoly < MAX_TRANSPOLYS && currenttransvert < MAX_TRANSVERTS)\
121 transvert[currenttransvert].s = (vs);\
122 transvert[currenttransvert].t = (vt);\
125 transvert[currenttransvert].r = (byte) (bound(0, (int) (vr) >> 1, 255));\
126 transvert[currenttransvert].g = (byte) (bound(0, (int) (vg) >> 1, 255));\
127 transvert[currenttransvert].b = (byte) (bound(0, (int) (vb) >> 1, 255));\
131 transvert[currenttransvert].r = (byte) (bound(0, (int) (vr), 255));\
132 transvert[currenttransvert].g = (byte) (bound(0, (int) (vg), 255));\
133 transvert[currenttransvert].b = (byte) (bound(0, (int) (vb), 255));\
135 transvert[currenttransvert].a = (byte) (bound(0, (int) (va), 255));\
136 transvert[currenttransvert].v[0] = (vx);\
137 transvert[currenttransvert].v[1] = (vy);\
138 transvert[currenttransvert].v[2] = (vz);\
140 transpoly[currenttranspoly].verts++;\
144 #define transpolyvertub(vx,vy,vz,vs,vt,vr,vg,vb,va) \
146 if (currenttranspoly < MAX_TRANSPOLYS && currenttransvert < MAX_TRANSVERTS)\
148 transvert[currenttransvert].s = (vs);\
149 transvert[currenttransvert].t = (vt);\
152 transvert[currenttransvert].r = (vr) >> 1;\
153 transvert[currenttransvert].g = (vg) >> 1;\
154 transvert[currenttransvert].b = (vb) >> 1;\
158 transvert[currenttransvert].r = (vr);\
159 transvert[currenttransvert].g = (vg);\
160 transvert[currenttransvert].b = (vb);\
162 transvert[currenttransvert].a = (va);\
163 transvert[currenttransvert].v[0] = (vx);\
164 transvert[currenttransvert].v[1] = (vy);\
165 transvert[currenttransvert].v[2] = (vz);\
167 transpoly[currenttranspoly].verts++;\