More braces and whitespace.
This commit is contained in:
parent
313677ee96
commit
4b1b838f87
|
@ -275,11 +275,12 @@ SelectPartition (surface_t *surfaces, int *detail)
|
|||
// count onnode surfaces
|
||||
i = 0;
|
||||
bestsurface = NULL;
|
||||
for (p = surfaces; p; p = p->next)
|
||||
for (p = surfaces; p; p = p->next) {
|
||||
if (!p->onnode) {
|
||||
i++;
|
||||
bestsurface = p;
|
||||
}
|
||||
}
|
||||
|
||||
if (i == 0)
|
||||
return NULL;
|
||||
|
@ -296,13 +297,14 @@ SelectPartition (surface_t *surfaces, int *detail)
|
|||
maxs[i] = -BOGUS_RANGE;
|
||||
}
|
||||
|
||||
for (p = surfaces; p; p = p->next)
|
||||
for (p = surfaces; p; p = p->next) {
|
||||
for (j = 0; j < 3; j++) {
|
||||
if (p->mins[j] < mins[j])
|
||||
mins[j] = p->mins[j];
|
||||
if (p->maxs[j] > maxs[j])
|
||||
maxs[j] = p->maxs[j];
|
||||
}
|
||||
}
|
||||
|
||||
if (usemidsplit) // do fast way for clipping hull
|
||||
return ChooseMidPlaneFromList (surfaces, mins, maxs);
|
||||
|
@ -328,7 +330,7 @@ SelectPartition (surface_t *surfaces, int *detail)
|
|||
Calculates the bounding box
|
||||
*/
|
||||
void
|
||||
CalcSurfaceInfo (surface_t * surf)
|
||||
CalcSurfaceInfo (surface_t *surf)
|
||||
{
|
||||
face_t *f;
|
||||
int i, j;
|
||||
|
@ -346,7 +348,7 @@ CalcSurfaceInfo (surface_t * surf)
|
|||
winding_t *fp = f->points;
|
||||
if (f->contents[0] >= 0 || f->contents[1] >= 0)
|
||||
Sys_Error ("Bad contents");
|
||||
for (i = 0; i < fp->numpoints; i++)
|
||||
for (i = 0; i < fp->numpoints; i++) {
|
||||
for (j = 0; j < 3; j++) {
|
||||
if (fp->points[i][j] < surf->mins[j])
|
||||
surf->mins[j] = fp->points[i][j];
|
||||
|
@ -354,6 +356,7 @@ CalcSurfaceInfo (surface_t * surf)
|
|||
surf->maxs[j] = fp->points[i][j];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -111,29 +111,32 @@ CanonicalVector (vec3_t vec)
|
|||
if (len < EQUAL_EPSILON)
|
||||
return false;
|
||||
|
||||
if (vec[0] > EQUAL_EPSILON)
|
||||
if (vec[0] > EQUAL_EPSILON) {
|
||||
return true;
|
||||
else if (vec[0] < -EQUAL_EPSILON) {
|
||||
} else if (vec[0] < -EQUAL_EPSILON) {
|
||||
VectorNegate (vec, vec);
|
||||
return true;
|
||||
} else
|
||||
} else {
|
||||
vec[0] = 0;
|
||||
}
|
||||
|
||||
if (vec[1] > EQUAL_EPSILON)
|
||||
if (vec[1] > EQUAL_EPSILON) {
|
||||
return true;
|
||||
else if (vec[1] < -EQUAL_EPSILON) {
|
||||
} else if (vec[1] < -EQUAL_EPSILON) {
|
||||
VectorNegate (vec, vec);
|
||||
return true;
|
||||
} else
|
||||
} else {
|
||||
vec[1] = 0;
|
||||
}
|
||||
|
||||
if (vec[2] > EQUAL_EPSILON)
|
||||
if (vec[2] > EQUAL_EPSILON) {
|
||||
return true;
|
||||
else if (vec[2] < -EQUAL_EPSILON) {
|
||||
} else if (vec[2] < -EQUAL_EPSILON) {
|
||||
VectorNegate (vec, vec);
|
||||
return true;
|
||||
} else
|
||||
} else {
|
||||
vec[2] = 0;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue