gl schematics 2.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@666 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
47afae3dfe
commit
2216d9c0c0
1 changed files with 45 additions and 37 deletions
|
@ -284,14 +284,11 @@ static void PPL_BaseChain_NoBump_1TMU(msurface_t *first, texture_t *tex)
|
||||||
glBlendFunc (GL_ZERO, GL_SRC_COLOR);
|
glBlendFunc (GL_ZERO, GL_SRC_COLOR);
|
||||||
else if (gl_lightmap_format == GL_INTENSITY)
|
else if (gl_lightmap_format == GL_INTENSITY)
|
||||||
{
|
{
|
||||||
GL_TexEnv(GL_MODULATE);
|
|
||||||
glColor4f (0,0,0,1);
|
glColor4f (0,0,0,1);
|
||||||
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||||
}
|
}
|
||||||
else if (gl_lightmap_format == GL_RGBA)
|
else if (gl_lightmap_format == GL_RGBA)
|
||||||
{
|
|
||||||
glBlendFunc(GL_ZERO, GL_ONE_MINUS_SRC_ALPHA);
|
glBlendFunc(GL_ZERO, GL_ONE_MINUS_SRC_ALPHA);
|
||||||
}
|
|
||||||
|
|
||||||
glTexCoordPointer(2, GL_FLOAT, sizeof(surfvertexarray_t), varray_v->stl);
|
glTexCoordPointer(2, GL_FLOAT, sizeof(surfvertexarray_t), varray_v->stl);
|
||||||
|
|
||||||
|
@ -2492,41 +2489,44 @@ void PPL_SchematicsTextureChain(msurface_t *first)
|
||||||
frow=frow/2+0.5;
|
frow=frow/2+0.5;
|
||||||
glColor3f(frow, frow, 0);
|
glColor3f(frow, frow, 0);
|
||||||
|
|
||||||
glBegin(GL_QUADS);
|
if (gl_schematics.value != 2)
|
||||||
for (s = first; s ; s=s->texturechain)
|
|
||||||
{
|
{
|
||||||
for (v1 = 0; v1 < s->polys->numverts; v1++)
|
glBegin(GL_QUADS);
|
||||||
|
for (s = first; s ; s=s->texturechain)
|
||||||
{
|
{
|
||||||
v2 = v1+1;
|
for (v1 = 0; v1 < s->polys->numverts; v1++)
|
||||||
if (v2 == s->polys->numverts)
|
|
||||||
v2 = 0; //wrapped.
|
|
||||||
VectorSubtract(s->polys->verts[v1], s->polys->verts[v2], dir);
|
|
||||||
len = Length(dir);
|
|
||||||
VectorNormalize(dir);
|
|
||||||
sprintf(str, "%i", (len<1)?1:(int)len);
|
|
||||||
sl = strlen(str);
|
|
||||||
VectorMA(s->polys->verts[v2], len/2 + sl*4, dir, pos);
|
|
||||||
|
|
||||||
for (c = 0; c < sl; c++)
|
|
||||||
{
|
{
|
||||||
frow = (str[c]>>4)*size;
|
v2 = v1+1;
|
||||||
fcol = (str[c]&15)*size;
|
if (v2 == s->polys->numverts)
|
||||||
|
v2 = 0; //wrapped.
|
||||||
|
VectorSubtract(s->polys->verts[v1], s->polys->verts[v2], dir);
|
||||||
|
len = Length(dir);
|
||||||
|
VectorNormalize(dir);
|
||||||
|
sprintf(str, "%i", (len<1)?1:(int)len);
|
||||||
|
sl = strlen(str);
|
||||||
|
VectorMA(s->polys->verts[v2], len/2 + sl*4, dir, pos);
|
||||||
|
|
||||||
glTexCoord2f (fcol, frow + size);
|
for (c = 0; c < sl; c++)
|
||||||
glVertex3fv(pos);
|
{
|
||||||
VectorMA(pos, 8, s->normal, v);
|
frow = (str[c]>>4)*size;
|
||||||
glTexCoord2f (fcol, frow);
|
fcol = (str[c]&15)*size;
|
||||||
glVertex3fv(v);
|
|
||||||
VectorMA(pos, -8, dir, pos);
|
glTexCoord2f (fcol, frow + size);
|
||||||
VectorMA(pos, 8, s->normal, v);
|
glVertex3fv(pos);
|
||||||
glTexCoord2f (fcol + size, frow);
|
VectorMA(pos, 8, s->normal, v);
|
||||||
glVertex3fv(v);
|
glTexCoord2f (fcol, frow);
|
||||||
glTexCoord2f (fcol + size, frow + size);
|
glVertex3fv(v);
|
||||||
glVertex3fv(pos);
|
VectorMA(pos, -8, dir, pos);
|
||||||
|
VectorMA(pos, 8, s->normal, v);
|
||||||
|
glTexCoord2f (fcol + size, frow);
|
||||||
|
glVertex3fv(v);
|
||||||
|
glTexCoord2f (fcol + size, frow + size);
|
||||||
|
glVertex3fv(pos);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
glEnd();
|
||||||
}
|
}
|
||||||
glEnd();
|
|
||||||
|
|
||||||
glDisable(GL_POLYGON_OFFSET_FILL);
|
glDisable(GL_POLYGON_OFFSET_FILL);
|
||||||
glEnable(GL_POLYGON_OFFSET_LINE);
|
glEnable(GL_POLYGON_OFFSET_LINE);
|
||||||
|
@ -2544,8 +2544,14 @@ void PPL_SchematicsTextureChain(msurface_t *first)
|
||||||
VectorSubtract(s->polys->verts[v2], s->polys->verts[v1], dir);
|
VectorSubtract(s->polys->verts[v2], s->polys->verts[v1], dir);
|
||||||
len = Length(dir);
|
len = Length(dir);
|
||||||
VectorNormalize(dir);
|
VectorNormalize(dir);
|
||||||
sprintf(str, "%i", (len<1)?1:(int)len);
|
|
||||||
sl = strlen(str);
|
if (gl_schematics.value != 2)
|
||||||
|
{
|
||||||
|
sprintf(str, "%i", (len<1)?1:(int)len);
|
||||||
|
sl = strlen(str);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
sl = 0;
|
||||||
|
|
||||||
//left side. (find arrowhead part)
|
//left side. (find arrowhead part)
|
||||||
VectorMA(s->polys->verts[v1], 4, s->normal, pos);
|
VectorMA(s->polys->verts[v1], 4, s->normal, pos);
|
||||||
|
@ -2559,14 +2565,15 @@ void PPL_SchematicsTextureChain(msurface_t *first)
|
||||||
glVertex3fv(v);
|
glVertex3fv(v);
|
||||||
glVertex3fv(pos);
|
glVertex3fv(pos);
|
||||||
|
|
||||||
|
//the line
|
||||||
glVertex3fv(pos);
|
glVertex3fv(pos);
|
||||||
VectorMA(pos, len/2 - sl*4, dir, pos);
|
VectorMA(pos, len/2 - sl*4, dir, pos);
|
||||||
glVertex3fv(pos);
|
glVertex3fv(pos);
|
||||||
|
|
||||||
|
//right hand side.
|
||||||
VectorMA(s->polys->verts[v2], 4, s->normal, pos);
|
VectorMA(s->polys->verts[v2], 4, s->normal, pos);
|
||||||
|
|
||||||
VectorMA(pos, 4, dir, v);
|
VectorMA(pos, -4, dir, v);
|
||||||
VectorMA(v, -4, s->normal, v);
|
VectorMA(v, -4, s->normal, v);
|
||||||
glVertex3fv(v);
|
glVertex3fv(v);
|
||||||
glVertex3fv(pos);
|
glVertex3fv(pos);
|
||||||
|
@ -2575,6 +2582,7 @@ void PPL_SchematicsTextureChain(msurface_t *first)
|
||||||
glVertex3fv(v);
|
glVertex3fv(v);
|
||||||
glVertex3fv(pos);
|
glVertex3fv(pos);
|
||||||
|
|
||||||
|
//the line
|
||||||
glVertex3fv(pos);
|
glVertex3fv(pos);
|
||||||
VectorMA(pos, -(len/2 - sl*4), dir, pos);
|
VectorMA(pos, -(len/2 - sl*4), dir, pos);
|
||||||
glVertex3fv(pos);
|
glVertex3fv(pos);
|
||||||
|
@ -2923,11 +2931,11 @@ void PPL_RecursiveWorldNodeQ2_r (mnode_t *node)
|
||||||
{
|
{
|
||||||
if (surf->shadowframe != r_shadowframe)
|
if (surf->shadowframe != r_shadowframe)
|
||||||
continue;
|
continue;
|
||||||
|
/*
|
||||||
if (surf->lightframe == r_shadowframe) //done this one!
|
if (surf->lightframe == r_shadowframe) //done this one!
|
||||||
continue;
|
continue;
|
||||||
surf->lightframe = r_shadowframe;
|
surf->lightframe = r_shadowframe;
|
||||||
|
*/
|
||||||
// if ((dot < 0) ^ !!(surf->flags & SURF_PLANEBACK))
|
// if ((dot < 0) ^ !!(surf->flags & SURF_PLANEBACK))
|
||||||
// continue; // wrong side
|
// continue; // wrong side
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue