summaryrefslogtreecommitdiff
path: root/tools/editor/plugins/sample_editor_plugin.cpp
diff options
context:
space:
mode:
authorSaracen <SaracenOne@gmail.com>2015-11-18 23:18:10 +0000
committerSaracen <SaracenOne@gmail.com>2015-11-18 23:18:10 +0000
commitdd00452997122029dd2f74a278574d781fd2bf5f (patch)
treee36f0c62cac499500724c2929100c042972d1a5c /tools/editor/plugins/sample_editor_plugin.cpp
parentc1d19ad258139c73e7aa81cf6e1fbd99e1bfe38b (diff)
parent94fdd01241749cb7a575ed5f9fa4c7bbb286901a (diff)
Merge branch 'master' of https://github.com/okamstudio/godot into shadow_color
Conflicts: drivers/gles2/shader_compiler_gles2.cpp
Diffstat (limited to 'tools/editor/plugins/sample_editor_plugin.cpp')
-rw-r--r--tools/editor/plugins/sample_editor_plugin.cpp8
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 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<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];