A small speedup, and more memory efficiency too. Won't shadowalker be happy. :)
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@928 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
6f5a1247e8
commit
1baee5fbe1
2 changed files with 2 additions and 22 deletions
|
@ -254,8 +254,8 @@ typedef struct msurface_s
|
||||||
mesh_t *mesh;
|
mesh_t *mesh;
|
||||||
entity_t *ownerent;
|
entity_t *ownerent;
|
||||||
glpoly_t *polys; // multiple if warped
|
glpoly_t *polys; // multiple if warped
|
||||||
vec3_t center; //adverage
|
// vec3_t center; //adverage
|
||||||
float radius; //max dist from center
|
// float radius; //max dist from center
|
||||||
struct msurface_s *texturechain;
|
struct msurface_s *texturechain;
|
||||||
|
|
||||||
vec3_t normal;
|
vec3_t normal;
|
||||||
|
|
|
@ -3549,8 +3549,6 @@ void BuildSurfaceDisplayList (msurface_t *fa)
|
||||||
int vertpage;
|
int vertpage;
|
||||||
float *vec;
|
float *vec;
|
||||||
float s, t;
|
float s, t;
|
||||||
float distoff;
|
|
||||||
vec3_t offcenter;
|
|
||||||
glpoly_t *poly;
|
glpoly_t *poly;
|
||||||
int lm;
|
int lm;
|
||||||
|
|
||||||
|
@ -3646,10 +3644,6 @@ void BuildSurfaceDisplayList (msurface_t *fa)
|
||||||
fa->polys = poly;
|
fa->polys = poly;
|
||||||
poly->numverts = lnumverts;
|
poly->numverts = lnumverts;
|
||||||
|
|
||||||
fa->center[0]=0;
|
|
||||||
fa->center[1]=0;
|
|
||||||
fa->center[2]=0;
|
|
||||||
|
|
||||||
for (i=0 ; i<lnumverts ; i++)
|
for (i=0 ; i<lnumverts ; i++)
|
||||||
{
|
{
|
||||||
lindex = currentmodel->surfedges[fa->firstedge + i];
|
lindex = currentmodel->surfedges[fa->firstedge + i];
|
||||||
|
@ -3665,8 +3659,6 @@ void BuildSurfaceDisplayList (msurface_t *fa)
|
||||||
vec = r_pcurrentvertbase[r_pedge->v[1]].position;
|
vec = r_pcurrentvertbase[r_pedge->v[1]].position;
|
||||||
}
|
}
|
||||||
|
|
||||||
VectorAdd(vec, fa->center, fa->center);
|
|
||||||
|
|
||||||
s = DotProduct (vec, fa->texinfo->vecs[0]) + fa->texinfo->vecs[0][3];
|
s = DotProduct (vec, fa->texinfo->vecs[0]) + fa->texinfo->vecs[0][3];
|
||||||
t = DotProduct (vec, fa->texinfo->vecs[1]) + fa->texinfo->vecs[1][3];
|
t = DotProduct (vec, fa->texinfo->vecs[1]) + fa->texinfo->vecs[1][3];
|
||||||
|
|
||||||
|
@ -3711,18 +3703,6 @@ void BuildSurfaceDisplayList (msurface_t *fa)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
fa->center[0]/=lnumverts;
|
|
||||||
fa->center[1]/=lnumverts;
|
|
||||||
fa->center[2]/=lnumverts;
|
|
||||||
fa->radius = 0;
|
|
||||||
for (i=0 ; i<lnumverts ; i++)
|
|
||||||
{
|
|
||||||
VectorSubtract(poly->verts[0], fa->center, offcenter);
|
|
||||||
distoff = Length(offcenter);
|
|
||||||
if (distoff > fa->radius)
|
|
||||||
fa->radius = distoff;
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// remove co-linear points - Ed
|
// remove co-linear points - Ed
|
||||||
//
|
//
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue