Cleanup: style, use braces in source/

Automated using clang-tidy.
This commit is contained in:
2019-05-31 22:51:19 +10:00
parent 8987f7987d
commit d8dbd49a2f
290 changed files with 4326 additions and 2162 deletions

View File

@@ -156,16 +156,20 @@ int BlenderFileLoader::countClippedFaces(float v1[3], float v2[3], float v3[3],
numTris = 2; // tetragon
break;
case 2:
if (sum == 0)
if (sum == 0) {
numTris = 3; // pentagon
else
}
else {
numTris = 1; // triangle
}
break;
case 3:
if (sum == 3 || sum == -3)
if (sum == 3 || sum == -3) {
numTris = 0;
else
}
else {
numTris = 2; // tetragon
}
break;
}
return numTris;
@@ -188,8 +192,9 @@ void BlenderFileLoader::clipLine(float v1[3], float v2[3], float c[3], float z)
q = v1;
}
double d[3];
for (int i = 0; i < 3; i++)
for (int i = 0; i < 3; i++) {
d[i] = q[i] - p[i];
}
double t = (z - p[2]) / d[2];
c[0] = p[0] + t * d[0];
c[1] = p[1] + t * d[1];
@@ -303,11 +308,13 @@ void BlenderFileLoader::addTriangle(struct LoaderState *ls,
// update the bounding box
for (j = 0; j < 3; j++) {
if (ls->minBBox[j] > ls->pv[j])
if (ls->minBBox[j] > ls->pv[j]) {
ls->minBBox[j] = ls->pv[j];
}
if (ls->maxBBox[j] < ls->pv[j])
if (ls->maxBBox[j] < ls->pv[j]) {
ls->maxBBox[j] = ls->pv[j];
}
}
#if 0
@@ -329,14 +336,18 @@ void BlenderFileLoader::addTriangle(struct LoaderState *ls,
ls->pmi++;
}
if (fm)
if (fm) {
marks |= IndexedFaceSet::FACE_MARK;
if (em1)
}
if (em1) {
marks |= IndexedFaceSet::EDGE_MARK_V1V2;
if (em2)
}
if (em2) {
marks |= IndexedFaceSet::EDGE_MARK_V2V3;
if (em3)
}
if (em3) {
marks |= IndexedFaceSet::EDGE_MARK_V3V1;
}
*(ls->pm++) = marks;
}
@@ -543,8 +554,9 @@ void BlenderFileLoader::insertShapeNode(Object *ob, Mesh *me, int id)
}
unsigned int numTris = countClippedFaces(v1, v2, v3, clip);
if (numTris == 0)
if (numTris == 0) {
continue;
}
bool fm = (ffa) ? (ffa[lt->poly].flag & FREESTYLE_FACE_MARK) != 0 : false;
bool em1 = false, em2 = false, em3 = false;
@@ -688,8 +700,9 @@ void BlenderFileLoader::insertShapeNode(Object *ob, Mesh *me, int id)
detri.v = zero;
detri.n = 0;
for (unsigned int j = 0; j < viSize; j += 3) {
if (i == j)
if (i == j) {
continue;
}
vi0 = cleanVIndices[j];
vi1 = cleanVIndices[j + 1];
vi2 = cleanVIndices[j + 2];