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

@@ -203,13 +203,15 @@ void BCMatrix::unit()
* precision = -1 indicates to not limit the precision. */
void BCMatrix::get_matrix(DMatrix &mat, const bool transposed, const int precision) const
{
for (int i = 0; i < 4; i++)
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 4; j++) {
float val = (transposed) ? matrix[j][i] : matrix[i][j];
if (precision >= 0)
if (precision >= 0) {
val = floor((val * pow(10, precision) + 0.5)) / pow(10, precision);
}
mat[i][j] = val;
}
}
}
void BCMatrix::get_matrix(Matrix &mat,
@@ -217,13 +219,15 @@ void BCMatrix::get_matrix(Matrix &mat,
const int precision,
const bool inverted) const
{
for (int i = 0; i < 4; i++)
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 4; j++) {
float val = (transposed) ? matrix[j][i] : matrix[i][j];
if (precision >= 0)
if (precision >= 0) {
val = floor((val * pow(10, precision) + 0.5)) / pow(10, precision);
}
mat[i][j] = val;
}
}
if (inverted) {
invert_m4(mat);