More braces and whitespace.

This commit is contained in:
Bill Currie 2010-08-30 16:58:40 +09:00
parent 313677ee96
commit 4b1b838f87
3 changed files with 25 additions and 19 deletions

View file

@ -275,11 +275,12 @@ SelectPartition (surface_t *surfaces, int *detail)
// count onnode surfaces // count onnode surfaces
i = 0; i = 0;
bestsurface = NULL; bestsurface = NULL;
for (p = surfaces; p; p = p->next) for (p = surfaces; p; p = p->next) {
if (!p->onnode) { if (!p->onnode) {
i++; i++;
bestsurface = p; bestsurface = p;
} }
}
if (i == 0) if (i == 0)
return NULL; return NULL;
@ -296,13 +297,14 @@ SelectPartition (surface_t *surfaces, int *detail)
maxs[i] = -BOGUS_RANGE; maxs[i] = -BOGUS_RANGE;
} }
for (p = surfaces; p; p = p->next) for (p = surfaces; p; p = p->next) {
for (j = 0; j < 3; j++) { for (j = 0; j < 3; j++) {
if (p->mins[j] < mins[j]) if (p->mins[j] < mins[j])
mins[j] = p->mins[j]; mins[j] = p->mins[j];
if (p->maxs[j] > maxs[j]) if (p->maxs[j] > maxs[j])
maxs[j] = p->maxs[j]; maxs[j] = p->maxs[j];
} }
}
if (usemidsplit) // do fast way for clipping hull if (usemidsplit) // do fast way for clipping hull
return ChooseMidPlaneFromList (surfaces, mins, maxs); return ChooseMidPlaneFromList (surfaces, mins, maxs);
@ -346,7 +348,7 @@ CalcSurfaceInfo (surface_t * surf)
winding_t *fp = f->points; winding_t *fp = f->points;
if (f->contents[0] >= 0 || f->contents[1] >= 0) if (f->contents[0] >= 0 || f->contents[1] >= 0)
Sys_Error ("Bad contents"); Sys_Error ("Bad contents");
for (i = 0; i < fp->numpoints; i++) for (i = 0; i < fp->numpoints; i++) {
for (j = 0; j < 3; j++) { for (j = 0; j < 3; j++) {
if (fp->points[i][j] < surf->mins[j]) if (fp->points[i][j] < surf->mins[j])
surf->mins[j] = fp->points[i][j]; surf->mins[j] = fp->points[i][j];
@ -355,6 +357,7 @@ CalcSurfaceInfo (surface_t * surf)
} }
} }
} }
}
static void static void
DividePlane (surface_t *in, plane_t *split, surface_t **front, DividePlane (surface_t *in, plane_t *split, surface_t **front,

View file

@ -111,29 +111,32 @@ CanonicalVector (vec3_t vec)
if (len < EQUAL_EPSILON) if (len < EQUAL_EPSILON)
return false; return false;
if (vec[0] > EQUAL_EPSILON) if (vec[0] > EQUAL_EPSILON) {
return true; return true;
else if (vec[0] < -EQUAL_EPSILON) { } else if (vec[0] < -EQUAL_EPSILON) {
VectorNegate (vec, vec); VectorNegate (vec, vec);
return true; return true;
} else } else {
vec[0] = 0; vec[0] = 0;
}
if (vec[1] > EQUAL_EPSILON) if (vec[1] > EQUAL_EPSILON) {
return true; return true;
else if (vec[1] < -EQUAL_EPSILON) { } else if (vec[1] < -EQUAL_EPSILON) {
VectorNegate (vec, vec); VectorNegate (vec, vec);
return true; return true;
} else } else {
vec[1] = 0; vec[1] = 0;
}
if (vec[2] > EQUAL_EPSILON) if (vec[2] > EQUAL_EPSILON) {
return true; return true;
else if (vec[2] < -EQUAL_EPSILON) { } else if (vec[2] < -EQUAL_EPSILON) {
VectorNegate (vec, vec); VectorNegate (vec, vec);
return true; return true;
} else } else {
vec[2] = 0; vec[2] = 0;
}
return false; return false;
} }