This should correctly compute the normal of all BUILD floors and walls. Fixes bug 2806174 (E1L1 projection room floor not affected by light and parallaxing artifacts).

git-svn-id: https://svn.eduke32.com/eduke32@1589 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
plagman 2010-01-18 07:07:22 +00:00
parent 86fefa266d
commit 80b6a96901

View file

@ -2867,7 +2867,7 @@ static void polymer_drawwall(int16_t sectnum, int16_t wallnum)
if (pr_verbosity >= 3) OSD_Printf("PR : Finished drawing wall %i...\n", wallnum);
}
#define INDICE(n) ((p->indices) ? (p->indices[i+n]*5) : ((i+n)*5))
#define INDICE(n) ((p->indices) ? (p->indices[(i+n)%p->indicescount]*5) : (((i+n)%p->vertcount)*5))
// HSR
static void polymer_computeplane(_prplane* p)
@ -2909,8 +2909,7 @@ static void polymer_computeplane(_prplane* p)
norm = plane[0] * plane[0] + plane[1] * plane[1] + plane[2] * plane[2];
// hack to work around a precision issue with slopes
if ((norm >= 15000) ||
(((p->indices) ? p->indices[i+2] : i+2) >= p->vertcount))
if (norm >= 15000)
{
// normalize the normal/plane equation and calculate its plane norm
norm = -sqrt(norm);
@ -2979,9 +2978,10 @@ static void polymer_computeplane(_prplane* p)
break;
}
i+= 1;
i+= (p->indices) ? 3 : 1;
}
while ((i + 2) < p->indicescount);
while ((p->indices && i < p->indicescount) ||
(!p->indices && i < p->vertcount));
}
static inline void polymer_crossproduct(GLfloat* in_a, GLfloat* in_b, GLfloat* out)