and fix dedicated servers again...

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4612 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2014-02-14 13:19:00 +00:00
parent 80dd9a1e79
commit 4deebba5ee
2 changed files with 90 additions and 94 deletions

View file

@ -2131,6 +2131,96 @@ void CLQ1_DrawLine(shader_t *shader, vec3_t v1, vec3_t v2, float r, float g, flo
t->numidx = cl_numstrisidx - t->firstidx;
cl_numstrisvert += 2;
}
#include "shader.h"
void CL_AddOrientedCube(float *normal, float dist, float r, float g, float b, qboolean enqueue)
{
scenetris_t *t;
if (!enqueue)
cl_numstris = 0;
if (cl_numstris == cl_maxstris)
{
cl_maxstris+=8;
cl_stris = BZ_Realloc(cl_stris, sizeof(*cl_stris)*cl_maxstris);
}
t = &cl_stris[cl_numstris++];
t->shader = R_RegisterShader("testplane", SUF_NONE, "{\n{\nmap $whiteimage\nrgbgen vertex\nalphagen vertex\nblendfunc add\nnodepth\n}\n}\n");
t->firstidx = cl_numstrisidx;
t->firstvert = cl_numstrisvert;
t->numvert = 0;
t->numidx = 0;
if (cl_numstrisidx+6 > cl_maxstrisidx)
{
cl_maxstrisidx=cl_numstrisidx+6 + 64;
cl_strisidx = BZ_Realloc(cl_strisidx, sizeof(*cl_strisidx)*cl_maxstrisidx);
}
if (cl_numstrisvert+4 > cl_maxstrisvert)
{
cl_maxstrisvert+=64;
cl_strisvertv = BZ_Realloc(cl_strisvertv, sizeof(*cl_strisvertv)*cl_maxstrisvert);
cl_strisvertt = BZ_Realloc(cl_strisvertt, sizeof(*cl_strisvertt)*cl_maxstrisvert);
cl_strisvertc = BZ_Realloc(cl_strisvertc, sizeof(*cl_strisvertc)*cl_maxstrisvert);
}
{
vec3_t tmp = {0,0.04,0.96};
vec3_t right, forward;
CrossProduct(normal, tmp, right);
VectorNormalize(right);
CrossProduct(normal, right, forward);
VectorNormalize(forward);
VectorScale( normal, dist, cl_strisvertv[cl_numstrisvert]);
VectorMA(cl_strisvertv[cl_numstrisvert], 8192, right, cl_strisvertv[cl_numstrisvert]);
VectorMA(cl_strisvertv[cl_numstrisvert], 8192, forward, cl_strisvertv[cl_numstrisvert]);
Vector4Set(cl_strisvertc[cl_numstrisvert], r, g, b, 0.2);
cl_numstrisvert++;
VectorScale( normal, dist, cl_strisvertv[cl_numstrisvert]);
VectorMA(cl_strisvertv[cl_numstrisvert], 8192, right, cl_strisvertv[cl_numstrisvert]);
VectorMA(cl_strisvertv[cl_numstrisvert], -8192, forward, cl_strisvertv[cl_numstrisvert]);
Vector4Set(cl_strisvertc[cl_numstrisvert], r, g, b, 0.2);
cl_numstrisvert++;
VectorScale( normal, dist, cl_strisvertv[cl_numstrisvert]);
VectorMA(cl_strisvertv[cl_numstrisvert], -8192, right, cl_strisvertv[cl_numstrisvert]);
VectorMA(cl_strisvertv[cl_numstrisvert], -8192, forward, cl_strisvertv[cl_numstrisvert]);
Vector4Set(cl_strisvertc[cl_numstrisvert], r, g, b, 0.2);
cl_numstrisvert++;
VectorScale( normal, dist, cl_strisvertv[cl_numstrisvert]);
VectorMA(cl_strisvertv[cl_numstrisvert], -8192, right, cl_strisvertv[cl_numstrisvert]);
VectorMA(cl_strisvertv[cl_numstrisvert], 8192, forward, cl_strisvertv[cl_numstrisvert]);
Vector4Set(cl_strisvertc[cl_numstrisvert], r, g, b, 0.2);
cl_numstrisvert++;
}
/*build the triangles*/
cl_strisidx[cl_numstrisidx++] = t->numvert + 0;
cl_strisidx[cl_numstrisidx++] = t->numvert + 1;
cl_strisidx[cl_numstrisidx++] = t->numvert + 2;
cl_strisidx[cl_numstrisidx++] = t->numvert + 0;
cl_strisidx[cl_numstrisidx++] = t->numvert + 2;
cl_strisidx[cl_numstrisidx++] = t->numvert + 3;
t->numidx = cl_numstrisidx - t->firstidx;
t->numvert += 4;
if (!enqueue)
{
// int oldents = cl_numvisedicts;
// cl_numvisedicts = 0;
BE_DrawWorld(false, NULL);
cl_numstris = 0;
// cl_numvisedicts = oldents;
}
}
void CLQ1_AddOrientedCube(shader_t *shader, vec3_t mins, vec3_t maxs, float *matrix, float r, float g, float b, float a)
{
int v;

View file

@ -386,100 +386,6 @@ struct traceinfo_s
vec3_t end;
};
#if 1
#include "shader.h"
void BE_GenPolyBatches(batch_t **batches);
void TestDrawPlane(float *normal, float dist, float r, float g, float b, qboolean enqueue)
{
scenetris_t *t;
if (!enqueue)
cl_numstris = 0;
if (cl_numstris == cl_maxstris)
{
cl_maxstris+=8;
cl_stris = BZ_Realloc(cl_stris, sizeof(*cl_stris)*cl_maxstris);
}
t = &cl_stris[cl_numstris++];
t->shader = R_RegisterShader("testplane", SUF_NONE, "{\n{\nmap $whiteimage\nrgbgen vertex\nalphagen vertex\nblendfunc add\nnodepth\n}\n}\n");
t->firstidx = cl_numstrisidx;
t->firstvert = cl_numstrisvert;
t->numvert = 0;
t->numidx = 0;
if (cl_numstrisidx+6 > cl_maxstrisidx)
{
cl_maxstrisidx=cl_numstrisidx+6 + 64;
cl_strisidx = BZ_Realloc(cl_strisidx, sizeof(*cl_strisidx)*cl_maxstrisidx);
}
if (cl_numstrisvert+4 > cl_maxstrisvert)
{
cl_maxstrisvert+=64;
cl_strisvertv = BZ_Realloc(cl_strisvertv, sizeof(*cl_strisvertv)*cl_maxstrisvert);
cl_strisvertt = BZ_Realloc(cl_strisvertt, sizeof(*cl_strisvertt)*cl_maxstrisvert);
cl_strisvertc = BZ_Realloc(cl_strisvertc, sizeof(*cl_strisvertc)*cl_maxstrisvert);
}
{
vec3_t tmp = {0,0.04,0.96};
vec3_t right, forward;
CrossProduct(normal, tmp, right);
VectorNormalize(right);
CrossProduct(normal, right, forward);
VectorNormalize(forward);
VectorScale( normal, dist, cl_strisvertv[cl_numstrisvert]);
VectorMA(cl_strisvertv[cl_numstrisvert], 8192, right, cl_strisvertv[cl_numstrisvert]);
VectorMA(cl_strisvertv[cl_numstrisvert], 8192, forward, cl_strisvertv[cl_numstrisvert]);
Vector4Set(cl_strisvertc[cl_numstrisvert], r, g, b, 0.2);
cl_numstrisvert++;
VectorScale( normal, dist, cl_strisvertv[cl_numstrisvert]);
VectorMA(cl_strisvertv[cl_numstrisvert], 8192, right, cl_strisvertv[cl_numstrisvert]);
VectorMA(cl_strisvertv[cl_numstrisvert], -8192, forward, cl_strisvertv[cl_numstrisvert]);
Vector4Set(cl_strisvertc[cl_numstrisvert], r, g, b, 0.2);
cl_numstrisvert++;
VectorScale( normal, dist, cl_strisvertv[cl_numstrisvert]);
VectorMA(cl_strisvertv[cl_numstrisvert], -8192, right, cl_strisvertv[cl_numstrisvert]);
VectorMA(cl_strisvertv[cl_numstrisvert], -8192, forward, cl_strisvertv[cl_numstrisvert]);
Vector4Set(cl_strisvertc[cl_numstrisvert], r, g, b, 0.2);
cl_numstrisvert++;
VectorScale( normal, dist, cl_strisvertv[cl_numstrisvert]);
VectorMA(cl_strisvertv[cl_numstrisvert], -8192, right, cl_strisvertv[cl_numstrisvert]);
VectorMA(cl_strisvertv[cl_numstrisvert], 8192, forward, cl_strisvertv[cl_numstrisvert]);
Vector4Set(cl_strisvertc[cl_numstrisvert], r, g, b, 0.2);
cl_numstrisvert++;
}
/*build the triangles*/
cl_strisidx[cl_numstrisidx++] = t->numvert + 0;
cl_strisidx[cl_numstrisidx++] = t->numvert + 1;
cl_strisidx[cl_numstrisidx++] = t->numvert + 2;
cl_strisidx[cl_numstrisidx++] = t->numvert + 0;
cl_strisidx[cl_numstrisidx++] = t->numvert + 2;
cl_strisidx[cl_numstrisidx++] = t->numvert + 3;
t->numidx = cl_numstrisidx - t->firstidx;
t->numvert += 4;
if (!enqueue)
{
// int oldents = cl_numvisedicts;
// cl_numvisedicts = 0;
BE_DrawWorld(false, NULL);
cl_numstris = 0;
// cl_numvisedicts = oldents;
}
}
#endif
static void Q1BSP_ClipToBrushes(struct traceinfo_s *traceinfo, mbrush_t *brush)
{
struct mbrushplane_s *plane;