mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Fix crash when editing SampleLibrary with broken dependencies
This commit is contained in:
parent
d84ae4ad7f
commit
118dd478e7
2 changed files with 4 additions and 1 deletions
|
|
@ -69,6 +69,9 @@ void SampleEditor::_stop_pressed() {
|
||||||
|
|
||||||
void SampleEditor::generate_preview_texture(const Ref<Sample> &p_sample, Ref<ImageTexture> &p_texture) {
|
void SampleEditor::generate_preview_texture(const Ref<Sample> &p_sample, Ref<ImageTexture> &p_texture) {
|
||||||
|
|
||||||
|
if (p_sample == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
DVector<uint8_t> data = p_sample->get_data();
|
DVector<uint8_t> data = p_sample->get_data();
|
||||||
|
|
||||||
DVector<uint8_t> img;
|
DVector<uint8_t> img;
|
||||||
|
|
|
||||||
|
|
@ -238,7 +238,7 @@ void SampleLibraryEditor::_update_library() {
|
||||||
ti->set_cell_mode(2, TreeItem::CELL_MODE_STRING);
|
ti->set_cell_mode(2, TreeItem::CELL_MODE_STRING);
|
||||||
ti->set_editable(2, false);
|
ti->set_editable(2, false);
|
||||||
ti->set_selectable(2, false);
|
ti->set_selectable(2, false);
|
||||||
ti->set_text(2, String() + (smp->get_format() == Sample::FORMAT_PCM16 ? TTR("16 Bits") + ", " : (smp->get_format() == Sample::FORMAT_PCM8 ? TTR("8 Bits") + ", " : "IMA-ADPCM,")) + (smp->is_stereo() ? TTR("Stereo") : TTR("Mono")));
|
ti->set_text(2, String() + (smp != NULL ? (smp->get_format() == Sample::FORMAT_PCM16 ? TTR("16 Bits") + ", " : (smp->get_format() == Sample::FORMAT_PCM8 ? TTR("8 Bits") + ", " : "IMA-ADPCM,")) + (smp->is_stereo() ? TTR("Stereo") : TTR("Mono")) : TTR("Invalid")));
|
||||||
|
|
||||||
// Volume dB
|
// Volume dB
|
||||||
ti->set_cell_mode(3, TreeItem::CELL_MODE_RANGE);
|
ti->set_cell_mode(3, TreeItem::CELL_MODE_RANGE);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue