diff options
author | Campbell Barton <campbell@blender.org> | 2022-10-07 14:52:53 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-10-07 14:55:03 +0300 |
commit | 331f8500569df9b3b2aa776c5bcaad7b99c57295 (patch) | |
tree | 93547846177ff3415f9564ca54cb8f13433755cf /source/blender/blenkernel/intern/ocean.c | |
parent | 11abeae99fdbfc8f047c4a3c1d2b9b8c47883516 (diff) |
Cleanup: redundant parenthesis
Diffstat (limited to 'source/blender/blenkernel/intern/ocean.c')
-rw-r--r-- | source/blender/blenkernel/intern/ocean.c | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/source/blender/blenkernel/intern/ocean.c b/source/blender/blenkernel/intern/ocean.c index c142f096395..396c3443a73 100644 --- a/source/blender/blenkernel/intern/ocean.c +++ b/source/blender/blenkernel/intern/ocean.c @@ -55,8 +55,8 @@ static float gaussRand(RNG *rng) float length2; do { - x = (float)(nextfr(rng, -1, 1)); - y = (float)(nextfr(rng, -1, 1)); + x = (float)nextfr(rng, -1, 1); + y = (float)nextfr(rng, -1, 1); length2 = x * x + y * y; } while (length2 >= 1 || length2 == 0); @@ -930,40 +930,37 @@ bool BKE_ocean_init(struct Ocean *o, case MOD_OCEAN_SPECTRUM_JONSWAP: mul_complex_f(o->_h0[i * o->_N + j], r1r2, - (float)(sqrt(BLI_ocean_spectrum_jonswap(o, o->_kx[i], o->_kz[j]) / 2.0f))); - mul_complex_f( - o->_h0_minus[i * o->_N + j], - r1r2, - (float)(sqrt(BLI_ocean_spectrum_jonswap(o, -o->_kx[i], -o->_kz[j]) / 2.0f))); + (float)sqrt(BLI_ocean_spectrum_jonswap(o, o->_kx[i], o->_kz[j]) / 2.0f)); + mul_complex_f(o->_h0_minus[i * o->_N + j], + r1r2, + (float)sqrt(BLI_ocean_spectrum_jonswap(o, -o->_kx[i], -o->_kz[j]) / 2.0f)); break; case MOD_OCEAN_SPECTRUM_TEXEL_MARSEN_ARSLOE: mul_complex_f( o->_h0[i * o->_N + j], r1r2, - (float)(sqrt(BLI_ocean_spectrum_texelmarsenarsloe(o, o->_kx[i], o->_kz[j]) / 2.0f))); + (float)sqrt(BLI_ocean_spectrum_texelmarsenarsloe(o, o->_kx[i], o->_kz[j]) / 2.0f)); mul_complex_f( o->_h0_minus[i * o->_N + j], r1r2, - (float)(sqrt(BLI_ocean_spectrum_texelmarsenarsloe(o, -o->_kx[i], -o->_kz[j]) / - 2.0f))); + (float)sqrt(BLI_ocean_spectrum_texelmarsenarsloe(o, -o->_kx[i], -o->_kz[j]) / 2.0f)); break; case MOD_OCEAN_SPECTRUM_PIERSON_MOSKOWITZ: mul_complex_f( o->_h0[i * o->_N + j], r1r2, - (float)(sqrt(BLI_ocean_spectrum_piersonmoskowitz(o, o->_kx[i], o->_kz[j]) / 2.0f))); + (float)sqrt(BLI_ocean_spectrum_piersonmoskowitz(o, o->_kx[i], o->_kz[j]) / 2.0f)); mul_complex_f( o->_h0_minus[i * o->_N + j], r1r2, - (float)(sqrt(BLI_ocean_spectrum_piersonmoskowitz(o, -o->_kx[i], -o->_kz[j]) / - 2.0f))); + (float)sqrt(BLI_ocean_spectrum_piersonmoskowitz(o, -o->_kx[i], -o->_kz[j]) / 2.0f)); break; default: mul_complex_f( - o->_h0[i * o->_N + j], r1r2, (float)(sqrt(Ph(o, o->_kx[i], o->_kz[j]) / 2.0f))); + o->_h0[i * o->_N + j], r1r2, (float)sqrt(Ph(o, o->_kx[i], o->_kz[j]) / 2.0f)); mul_complex_f(o->_h0_minus[i * o->_N + j], r1r2, - (float)(sqrt(Ph(o, -o->_kx[i], -o->_kz[j]) / 2.0f))); + (float)sqrt(Ph(o, -o->_kx[i], -o->_kz[j]) / 2.0f)); break; } } |