From 61c4c5795ff9057b1c67142758418a4f982a0241 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Mon, 9 Nov 2015 00:49:18 -0300 Subject: -support for stereo ima-adpcm sample compression & playback -support for converting samples to ima-adpcm upon export --- tools/editor/plugins/sample_editor_plugin.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'tools/editor/plugins/sample_editor_plugin.cpp') diff --git a/tools/editor/plugins/sample_editor_plugin.cpp b/tools/editor/plugins/sample_editor_plugin.cpp index 31fa7246ae..d88f2adc73 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& p_sample,Ref>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]; -- cgit v1.2.3