summaryrefslogtreecommitdiff
path: root/editor/import
diff options
context:
space:
mode:
Diffstat (limited to 'editor/import')
-rw-r--r--editor/import/resource_importer_bitmask.cpp2
-rw-r--r--editor/import/resource_importer_wav.cpp12
2 files changed, 10 insertions, 4 deletions
diff --git a/editor/import/resource_importer_bitmask.cpp b/editor/import/resource_importer_bitmask.cpp
index 3d2959c598..a5d3959952 100644
--- a/editor/import/resource_importer_bitmask.cpp
+++ b/editor/import/resource_importer_bitmask.cpp
@@ -77,7 +77,7 @@ Error ResourceImporterBitMap::import(const String &p_source_file, const String &
bit = c.a > threshold;
}
- bitmap->set_bit(Vector2(i, j), bit);
+ bitmap->set_bit(Vector2(j, i), bit);
}
}
diff --git a/editor/import/resource_importer_wav.cpp b/editor/import/resource_importer_wav.cpp
index 12aa0bb33c..03155b3a48 100644
--- a/editor/import/resource_importer_wav.cpp
+++ b/editor/import/resource_importer_wav.cpp
@@ -268,9 +268,15 @@ Error ResourceImporterWAV::import(const String &p_source_file, const String &p_s
for (int i = 0; i < 10; i++)
file->get_32(); // i wish to know why should i do this... no doc!
- loop = file->get_32() ? AudioStreamSample::LOOP_PING_PONG : AudioStreamSample::LOOP_FORWARD;
- loop_begin = file->get_32();
- loop_end = file->get_32();
+ // only read 0x00 (loop forward) and 0x01 (loop ping-pong) and skip anything else because
+ // it's not supported (loop backward), reserved for future uses or sampler specific
+ // from https://sites.google.com/site/musicgapi/technical-documents/wav-file-format#smpl (loop type values table)
+ int loop_type = file->get_32();
+ if (loop_type == 0x00 || loop_type == 0x01) {
+ loop = loop_type ? AudioStreamSample::LOOP_PING_PONG : AudioStreamSample::LOOP_FORWARD;
+ loop_begin = file->get_32();
+ loop_end = file->get_32();
+ }
}
file->seek(file_pos + chunksize);
}