diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-05-14 23:09:03 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-14 23:09:03 +0200 |
commit | 00949f0c5fcc6a4f8382a4a97d5591fd9ec380f8 (patch) | |
tree | 2b1c31f45add24085b64425ce440f577424c16a1 /editor/import/resource_importer_wav.h | |
parent | 5046f666a1181675b39f156c38346525dc1c444e (diff) | |
parent | 0ee0fa42e6639b6fa474b7cf6afc6b1a78142185 (diff) |
Merge pull request #38738 from akien-mga/cause-we-never-go-out-of-style
Style: Remove new line at block start, enforce line between functions, enforce braces in if and loop blocks
Diffstat (limited to 'editor/import/resource_importer_wav.h')
-rw-r--r-- | editor/import/resource_importer_wav.h | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/editor/import/resource_importer_wav.h b/editor/import/resource_importer_wav.h index bc2f023e6b..3ff3aea9f4 100644 --- a/editor/import/resource_importer_wav.h +++ b/editor/import/resource_importer_wav.h @@ -72,8 +72,9 @@ public: int datalen = p_data.size(); int datamax = datalen; - if (datalen & 1) + if (datalen & 1) { datalen++; + } dst_data.resize(datalen / 2 + 4); uint8_t *w = dst_data.ptrw(); @@ -96,10 +97,9 @@ public: uint8_t nibble; int16_t xm_sample; - if (i >= datamax) + if (i >= datamax) { xm_sample = 0; - else { - + } else { xm_sample = CLAMP(in[i] * 32767.0, -32768, 32767); /* if (xm_sample==32767 || xm_sample==-32768) @@ -121,9 +121,7 @@ public: } mask = 4; while (mask) { - if (diff >= step) { - nibble |= mask; diff -= step; vpdiff += step; @@ -133,10 +131,11 @@ public: mask >>= 1; }; - if (nibble & 8) + if (nibble & 8) { prev -= vpdiff; - else + } else { prev += vpdiff; + } if (prev > 32767) { //printf("%i,xms %i, prev %i,diff %i, vpdiff %i, clip up %i\n",i,xm_sample,prev,diff,vpdiff,prev); @@ -147,10 +146,11 @@ public: } step_idx += _ima_adpcm_index_table[nibble]; - if (step_idx < 0) + if (step_idx < 0) { step_idx = 0; - else if (step_idx > 88) + } else if (step_idx > 88) { step_idx = 88; + } if (i & 1) { *out |= nibble << 4; |