30 #define DYNAMIC_LIGHT_WIDTH 128
31 #define DYNAMIC_LIGHT_HEIGHT 128
33 #define LIGHTMAP_BYTES 4
35 #define BLOCK_WIDTH 128
36 #define BLOCK_HEIGHT 128
116 verts[
i].vertex[0] =
v[0];
117 verts[
i].vertex[1] =
v[1];
118 verts[
i].vertex[2] =
v[2];
119 verts[
i].texCoord[0] =
v[3];
120 verts[
i].texCoord[1] =
v[4];
126 VkDeviceSize vboOffset;
128 VkDescriptorSet uboDescriptorSet;
131 memcpy(vertData, verts,
sizeof(polyvert) * p->
numverts);
132 memcpy(uboData, color,
sizeof(
float) * 4);
134 VkDescriptorSet descriptorSets[] = {
texture->vk_texture.descriptorSet, uboDescriptorSet };
171 verts[
i].vertex[0] =
v[0];
172 verts[
i].vertex[1] =
v[1];
173 verts[
i].vertex[2] =
v[2];
174 verts[
i].texCoord[0] =
v[3] + scroll;
175 verts[
i].texCoord[1] =
v[4];
181 VkDeviceSize vboOffset;
183 VkDescriptorSet uboDescriptorSet;
186 memcpy(vertData, verts,
sizeof(polyvert) * p->
numverts);
187 memcpy(uboData, color,
sizeof(
float) * 4);
189 VkDescriptorSet descriptorSets[] = {
texture->vk_texture.descriptorSet, uboDescriptorSet };
210 VkDeviceSize vboOffset;
211 float color[3] = { 1.f, 1.f, 1.f };
219 VkDescriptorSet uboDescriptorSet;
231 for (; p; p = p->
chain)
235 triVert[0].v[0] = p->
verts[0][0];
236 triVert[0].v[1] = p->
verts[0][1];
237 triVert[0].v[2] = p->
verts[0][2];
238 memcpy(triVert[0].color, color,
sizeof(color));
240 triVert[1].v[0] = p->
verts[
j - 1][0];
241 triVert[1].v[1] = p->
verts[
j - 1][1];
242 triVert[1].v[2] = p->
verts[
j - 1][2];
243 memcpy(triVert[1].color, color,
sizeof(color));
245 triVert[2].v[0] = p->
verts[
j][0];
246 triVert[2].v[1] = p->
verts[
j][1];
247 triVert[2].v[2] = p->
verts[
j][2];
248 memcpy(triVert[2].color, color,
sizeof(color));
250 triVert[3].v[0] = p->
verts[0][0];
251 triVert[3].v[1] = p->
verts[0][1];
252 triVert[3].v[2] = p->
verts[0][2];
253 memcpy(triVert[3].color, color,
sizeof(color));
256 memcpy(vertData, triVert,
sizeof(triVert));
276 float color[4] = { 1.f, 1.f, 1.f,
alpha };
325 unsigned temp[34 * 34];
328 smax = (fa->
extents[0] >> 4) + 1;
329 tmax = (fa->
extents[1] >> 4) + 1;
370 float color[4] = { intens, intens, intens, 1.f };
427 for (;
s;
s =
s->texturechain)
451 float texCoordLmap[2];
465 memcpy(lmapPolyUbo.model, modelMatrix,
sizeof(
float) * 16);
475 VkDescriptorSet uboDescriptorSet;
477 memcpy(uboData, &lmapPolyUbo,
sizeof(lmapPolyUbo));
500 unsigned temp[128 * 128];
505 smax = (surf->
extents[0] >> 4) + 1;
506 tmax = (surf->
extents[1] >> 4) + 1;
516 smax = (surf->
extents[0] >> 4) + 1;
517 tmax = (surf->
extents[1] >> 4) + 1;
538 VkDeviceSize vboOffset;
547 verts[
i].vertex[0] =
v[0];
548 verts[
i].vertex[1] =
v[1];
549 verts[
i].vertex[2] =
v[2];
550 verts[
i].texCoord[0] =
v[3] + scroll;
551 verts[
i].texCoord[1] =
v[4];
552 verts[
i].texCoordLmap[0] =
v[5];
553 verts[
i].texCoordLmap[1] =
v[6];
557 memcpy(vertData, verts,
sizeof(lmappolyvert) * nv);
567 VkDeviceSize vboOffset;
576 verts[
i].vertex[0] =
v[0];
577 verts[
i].vertex[1] =
v[1];
578 verts[
i].vertex[2] =
v[2];
579 verts[
i].texCoord[0] =
v[3];
580 verts[
i].texCoord[1] =
v[4];
581 verts[
i].texCoordLmap[0] =
v[5];
582 verts[
i].texCoordLmap[1] =
v[6];
586 memcpy(vertData, verts,
sizeof(lmappolyvert) * nv);
615 verts[
i].vertex[0] =
v[0];
616 verts[
i].vertex[1] =
v[1];
617 verts[
i].vertex[2] =
v[2];
618 verts[
i].texCoord[0] =
v[3] + scroll;
619 verts[
i].texCoord[1] =
v[4];
620 verts[
i].texCoordLmap[0] =
v[5];
621 verts[
i].texCoordLmap[1] =
v[6];
624 VkDeviceSize vboOffset;
626 memcpy(vertData, verts,
sizeof(lmappolyvert) * nv);
644 verts[
i].vertex[0] =
v[0];
645 verts[
i].vertex[1] =
v[1];
646 verts[
i].vertex[2] =
v[2];
647 verts[
i].texCoord[0] =
v[3];
648 verts[
i].texCoord[1] =
v[4];
649 verts[
i].texCoordLmap[0] =
v[5];
650 verts[
i].texCoordLmap[1] =
v[6];
653 VkDeviceSize vboOffset;
655 memcpy(vertData, verts,
sizeof(lmappolyvert) * nv);
708 pplane = psurf->
plane;
752 for (
i = 0;
i<3;
i++)
809 int c, side, sidebit;
947 memset (&ent, 0,
sizeof(ent));
1014 for (
i=0 ;
i<c ;
i++)
1015 ((
int *)fatvis)[
i] |= ((
int *)vis)[
i];
1024 if (vis[cluster>>3] & (1<<(cluster&7)))
1108 for (
j=0 ;
j<
w ;
j++)
1125 for (
i=0 ;
i<
w ;
i++)
1138 int i, lindex, lnumverts;
1159 for (
i=0 ;
i<lnumverts ;
i++)
1220 smax = (surf->
extents[0]>>4)+1;
1221 tmax = (surf->
extents[1]>>4)+1;
1265 lightstyles[
i].
rgb[0] = 1;
1266 lightstyles[
i].
rgb[1] = 1;
1267 lightstyles[
i].
rgb[2] = 1;
1268 lightstyles[
i].
white = 3;