23 #define FACE_HASH_BITS 5
24 #define FACE_HASH_SIZE (1 << FACE_HASH_BITS)
25 #define FACE_HASH_MASK (FACE_HASH_SIZE - 1)
76 #define PARTICLE_SIZE (1 + M_SQRT1_2)
77 #define PARTICLE_SCALE (1 / (2 * PARTICLE_SIZE))
91 if (!
glr.
fd.num_particles)
105 p =
glr.
fd.particles;
106 total =
glr.
fd.num_particles;
120 VectorSubtract(p->origin,
glr.
fd.vieworg, transformed);
125 scale += dist * 0.01f;
127 if (p->color == -1) {
128 color.u32 = p->rgba.u32;
131 color.u8[3] = 255 * p->alpha;
137 VectorMA(dst_vert, scale,
glr.
viewaxis[2], dst_vert + 5);
138 VectorMA(dst_vert, -scale,
glr.
viewaxis[1], dst_vert + 10);
140 dst_vert[ 3] = 0; dst_vert[ 4] = 0;
144 dst_color = (uint32_t *)
tess.
colors + numverts;
145 dst_color[0] =
color.u32;
146 dst_color[1] =
color.u32;
147 dst_color[2] =
color.u32;
191 numverts = numindices = 0;
192 for (i = 0, ent =
glr.
fd.entities; i <
glr.
fd.num_entities; i++, ent++) {
193 if (!(ent->flags & RF_BEAM)) {
198 end = ent->oldorigin;
199 VectorSubtract(end, start, d1);
200 VectorSubtract(
glr.
fd.vieworg, start, d2);
201 CrossProduct(d1, d2, d3);
202 length = VectorLength(d3);
203 length = ent->frame * 1.2f / length;
204 VectorScale(d3, length, d3);
206 length = VectorLength(d1);
208 if (ent->skinnum == -1) {
209 color.u32 = ent->rgba.u32;
212 color.u8[3] = 255 * ent->alpha;
219 numverts = numindices = 0;
223 VectorAdd(start, d3, dst_vert);
224 VectorSubtract(start, d3, dst_vert + 5);
225 VectorSubtract(end, d3, dst_vert + 10);
226 VectorAdd(end, d3, dst_vert + 15);
228 dst_vert[3] = 0; dst_vert[4] = 0;
229 dst_vert[8] = 1; dst_vert[9] = 0;
230 dst_vert[13] = 1; dst_vert[14] = length;
231 dst_vert[18] = 0; dst_vert[19] = length;
233 dst_color = (uint32_t *)
tess.
colors + numverts;
234 dst_color[0] =
color.u32;
235 dst_color[1] =
color.u32;
236 dst_color[2] =
color.u32;
237 dst_color[3] =
color.u32;
240 dst_indices[0] = numverts + 0;
241 dst_indices[1] = numverts + 2;
242 dst_indices[2] = numverts + 3;
243 dst_indices[3] = numverts + 0;
244 dst_indices[4] = numverts + 1;
245 dst_indices[5] = numverts + 2;
345 memcpy(dst, src, surf->numsurfedges *
VERTEX_SIZE *
sizeof(vec_t));
356 if (q_unlikely(tex->next)) {
357 c =
glr.
ent->frame % tex->numframes;
364 return tex->image->texnum;
369 int numtris = surf->numsurfedges - 2;
370 int numindices = numtris * 3;
376 texnum[0] = surf->texnum[1];
382 texnum[1] = surf->texnum[1];
403 for (i = 0; i < numtris; i++) {
405 dst_indices[1] = j + (i + 1);
406 dst_indices[2] = j + (i + 2);
420 for (face = *
head; face; face = face->next) {
466 hash = face->texnum[0] ^ face->texnum[1] ^ face->statebits;