diff options
| author | Saracen | 2015-11-18 23:18:10 +0000 |
|---|---|---|
| committer | Saracen | 2015-11-18 23:18:10 +0000 |
| commit | dd00452997122029dd2f74a278574d781fd2bf5f (patch) | |
| tree | e36f0c62cac499500724c2929100c042972d1a5c /tools/editor/plugins/sample_editor_plugin.cpp | |
| parent | c1d19ad258139c73e7aa81cf6e1fbd99e1bfe38b (diff) | |
| parent | 94fdd01241749cb7a575ed5f9fa4c7bbb286901a (diff) | |
| download | godot-dd00452997122029dd2f74a278574d781fd2bf5f.tar.gz godot-dd00452997122029dd2f74a278574d781fd2bf5f.tar.zst godot-dd00452997122029dd2f74a278574d781fd2bf5f.zip | |
Diffstat (limited to 'tools/editor/plugins/sample_editor_plugin.cpp')
| -rw-r--r-- | tools/editor/plugins/sample_editor_plugin.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/editor/plugins/sample_editor_plugin.cpp b/tools/editor/plugins/sample_editor_plugin.cpp index 31fa7246a..d88f2adc7 100644 --- a/tools/editor/plugins/sample_editor_plugin.cpp +++ b/tools/editor/plugins/sample_editor_plugin.cpp @@ -156,8 +156,14 @@ void SampleEditor::generate_preview_texture(const Ref<Sample>& p_sample,Ref<Imag ima_adpcm.last_nibble++; const uint8_t *src_ptr=sdata; + int ofs = ima_adpcm.last_nibble>>1; + + if (stereo) + ofs*=2; + nibble = (ima_adpcm.last_nibble&1)? - (src_ptr[ima_adpcm.last_nibble>>1]>>4):(src_ptr[ima_adpcm.last_nibble>>1]&0xF); + (src_ptr[ofs]>>4):(src_ptr[ofs]&0xF); + step=_ima_adpcm_step_table[ima_adpcm.step_index]; ima_adpcm.step_index += _ima_adpcm_index_table[nibble]; |
