diff options
| author | Rémi Verschelde | 2017-03-19 00:36:26 +0100 |
|---|---|---|
| committer | Rémi Verschelde | 2017-03-19 00:36:26 +0100 |
| commit | f8db8a3faa30b71dca33ced38be16d3f93f43e8a (patch) | |
| tree | 3b798318132cca7eccfbca5818ab55656a2896d7 /modules/chibi/cp_sample_manager.cpp | |
| parent | 1d418afe863c9e553b69174ce63aef203c46d2f0 (diff) | |
| download | godot-f8db8a3faa30b71dca33ced38be16d3f93f43e8a.tar.gz godot-f8db8a3faa30b71dca33ced38be16d3f93f43e8a.tar.zst godot-f8db8a3faa30b71dca33ced38be16d3f93f43e8a.zip | |
Bring that Whole New World to the Old Continent too
Applies the clang-format style to the 2.1 branch as done for master in
5dbf1809c6e3e905b94b8764e99491e608122261.
Diffstat (limited to '')
| -rw-r--r-- | modules/chibi/cp_sample_manager.cpp | 53 |
1 files changed, 23 insertions, 30 deletions
diff --git a/modules/chibi/cp_sample_manager.cpp b/modules/chibi/cp_sample_manager.cpp index 2ad0a720b..001c10a83 100644 --- a/modules/chibi/cp_sample_manager.cpp +++ b/modules/chibi/cp_sample_manager.cpp @@ -28,48 +28,41 @@ /*************************************************************************/ #include "cp_sample_manager.h" +CPSampleManager *CPSampleManager::singleton = NULL; -CPSampleManager * CPSampleManager::singleton=NULL; +void CPSampleManager::copy_to(CPSample_ID p_from, CPSample_ID &p_to) { + ERR_FAIL_COND(!check(p_from)); -void CPSampleManager::copy_to(CPSample_ID p_from,CPSample_ID &p_to) { - - ERR_FAIL_COND(!check( p_from )); - - if (p_to.is_null()) { - - p_to=create( is_16bits( p_from), is_stereo( p_from), get_size(p_from)); + + p_to = create(is_16bits(p_from), is_stereo(p_from), get_size(p_from)); } else { - - recreate( p_to, is_16bits( p_from), is_stereo( p_from), get_size(p_from)); - + + recreate(p_to, is_16bits(p_from), is_stereo(p_from), get_size(p_from)); } - - int len=get_size( p_from ); - int ch=is_stereo( p_from ) ? 2 : 1; - - for (int c=0;c<ch;c++) { - - for (int i=0;i<len;i++) { - - int16_t s=get_data( p_from, i, c ); - set_data( p_to, i, s, c ); + + int len = get_size(p_from); + int ch = is_stereo(p_from) ? 2 : 1; + + for (int c = 0; c < ch; c++) { + + for (int i = 0; i < len; i++) { + + int16_t s = get_data(p_from, i, c); + set_data(p_to, i, s, c); } } - - set_loop_type( p_to, get_loop_type( p_from ) ); - set_loop_begin( p_to, get_loop_begin( p_from ) ); - set_loop_end( p_to, get_loop_end( p_from ) ); - set_c5_freq( p_to, get_c5_freq( p_from ) ); - - - + + set_loop_type(p_to, get_loop_type(p_from)); + set_loop_begin(p_to, get_loop_begin(p_from)); + set_loop_end(p_to, get_loop_end(p_from)); + set_c5_freq(p_to, get_c5_freq(p_from)); } CPSampleManager::CPSampleManager() { - singleton=this; + singleton = this; } CPSampleManager *CPSampleManager::get_singleton() { |
