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;
|
||||
entity_t *ownerent;
|
||||
glpoly_t *polys; // multiple if warped
|
||||
vec3_t center; //adverage
|
||||
float radius; //max dist from center
|
||||
// vec3_t center; //adverage
|
||||
// float radius; //max dist from center
|
||||
struct msurface_s *texturechain;
|
||||
|
||||
vec3_t normal;
|
||||
|
|
|
@ -3549,8 +3549,6 @@ void BuildSurfaceDisplayList (msurface_t *fa)
|
|||
int vertpage;
|
||||
float *vec;
|
||||
float s, t;
|
||||
float distoff;
|
||||
vec3_t offcenter;
|
||||
glpoly_t *poly;
|
||||
int lm;
|
||||
|
||||
|
@ -3646,10 +3644,6 @@ void BuildSurfaceDisplayList (msurface_t *fa)
|
|||
fa->polys = poly;
|
||||
poly->numverts = lnumverts;
|
||||
|
||||
fa->center[0]=0;
|
||||
fa->center[1]=0;
|
||||
fa->center[2]=0;
|
||||
|
||||
for (i=0 ; i<lnumverts ; i++)
|
||||
{
|
||||
lindex = currentmodel->surfedges[fa->firstedge + i];
|
||||
|
@ -3665,8 +3659,6 @@ void BuildSurfaceDisplayList (msurface_t *fa)
|
|||
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];
|
||||
t = DotProduct (vec, fa->texinfo->vecs[1]) + fa->texinfo->vecs[1][3];
|
||||
|
||||
|
@ -3711,18 +3703,6 @@ void BuildSurfaceDisplayList (msurface_t *fa)
|
|||
#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
|
||||
//
|
||||
|
|
Loading…
Reference in a new issue