-Properly handle missing ETC support on export
-Added ability for resource importers to save metadata -Added ability for resource importers to validate depending on project settings
This commit is contained in:
@ -130,7 +130,7 @@ bool EditorImportPlugin::get_option_visibility(const String &p_option, const Map
|
||||
return get_script_instance()->call("get_option_visibility", p_option, d);
|
||||
}
|
||||
|
||||
Error EditorImportPlugin::import(const String &p_source_file, const String &p_save_path, const Map<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files) {
|
||||
Error EditorImportPlugin::import(const String &p_source_file, const String &p_save_path, const Map<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files, Variant *r_metadata) {
|
||||
|
||||
ERR_FAIL_COND_V(!(get_script_instance() && get_script_instance()->has_method("import")), ERR_UNAVAILABLE);
|
||||
Dictionary options;
|
||||
|
||||
@ -51,7 +51,7 @@ public:
|
||||
virtual int get_import_order() const;
|
||||
virtual void get_import_options(List<ImportOption> *r_options, int p_preset) const;
|
||||
virtual bool get_option_visibility(const String &p_option, const Map<StringName, Variant> &p_options) const;
|
||||
virtual Error import(const String &p_source_file, const String &p_save_path, const Map<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files);
|
||||
virtual Error import(const String &p_source_file, const String &p_save_path, const Map<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files, Variant *r_metadata = NULL);
|
||||
};
|
||||
|
||||
#endif //EDITOR_IMPORT_PLUGIN_H
|
||||
|
||||
@ -78,7 +78,7 @@ void ResourceImporterBitMap::get_import_options(List<ImportOption> *r_options, i
|
||||
r_options->push_back(ImportOption(PropertyInfo(Variant::REAL, "threshold", PROPERTY_HINT_RANGE, "0,1,0.01"), 0.5));
|
||||
}
|
||||
|
||||
Error ResourceImporterBitMap::import(const String &p_source_file, const String &p_save_path, const Map<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files) {
|
||||
Error ResourceImporterBitMap::import(const String &p_source_file, const String &p_save_path, const Map<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files, Variant *r_metadata) {
|
||||
|
||||
int create_from = p_options["create_from"];
|
||||
float threshold = p_options["threshold"];
|
||||
|
||||
@ -51,7 +51,7 @@ public:
|
||||
|
||||
virtual void get_import_options(List<ImportOption> *r_options, int p_preset = 0) const;
|
||||
virtual bool get_option_visibility(const String &p_option, const Map<StringName, Variant> &p_options) const;
|
||||
virtual Error import(const String &p_source_file, const String &p_save_path, const Map<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files = NULL);
|
||||
virtual Error import(const String &p_source_file, const String &p_save_path, const Map<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files = NULL, Variant *r_metadata = NULL);
|
||||
|
||||
ResourceImporterBitMap();
|
||||
~ResourceImporterBitMap();
|
||||
|
||||
@ -77,7 +77,7 @@ void ResourceImporterCSVTranslation::get_import_options(List<ImportOption> *r_op
|
||||
r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "delimiter", PROPERTY_HINT_ENUM, "Comma,Semicolon,Tab"), 0));
|
||||
}
|
||||
|
||||
Error ResourceImporterCSVTranslation::import(const String &p_source_file, const String &p_save_path, const Map<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files) {
|
||||
Error ResourceImporterCSVTranslation::import(const String &p_source_file, const String &p_save_path, const Map<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files, Variant *r_metadata) {
|
||||
|
||||
bool compress = p_options["compress"];
|
||||
|
||||
|
||||
@ -48,7 +48,7 @@ public:
|
||||
virtual void get_import_options(List<ImportOption> *r_options, int p_preset = 0) const;
|
||||
virtual bool get_option_visibility(const String &p_option, const Map<StringName, Variant> &p_options) const;
|
||||
|
||||
virtual Error import(const String &p_source_file, const String &p_save_path, const Map<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files = NULL);
|
||||
virtual Error import(const String &p_source_file, const String &p_save_path, const Map<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files = NULL, Variant *r_metadata = NULL);
|
||||
|
||||
ResourceImporterCSVTranslation();
|
||||
};
|
||||
|
||||
@ -74,7 +74,7 @@ String ResourceImporterImage::get_preset_name(int p_idx) const {
|
||||
void ResourceImporterImage::get_import_options(List<ImportOption> *r_options, int p_preset) const {
|
||||
}
|
||||
|
||||
Error ResourceImporterImage::import(const String &p_source_file, const String &p_save_path, const Map<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files) {
|
||||
Error ResourceImporterImage::import(const String &p_source_file, const String &p_save_path, const Map<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files, Variant *r_metadata) {
|
||||
|
||||
FileAccess *f = FileAccess::open(p_source_file, FileAccess::READ);
|
||||
if (!f) {
|
||||
|
||||
@ -49,7 +49,7 @@ public:
|
||||
virtual void get_import_options(List<ImportOption> *r_options, int p_preset = 0) const;
|
||||
virtual bool get_option_visibility(const String &p_option, const Map<StringName, Variant> &p_options) const;
|
||||
|
||||
virtual Error import(const String &p_source_file, const String &p_save_path, const Map<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files = NULL);
|
||||
virtual Error import(const String &p_source_file, const String &p_save_path, const Map<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files = NULL, Variant *r_metadata = NULL);
|
||||
|
||||
ResourceImporterImage();
|
||||
};
|
||||
|
||||
@ -191,7 +191,7 @@ void ResourceImporterLayeredTexture::_save_tex(const Vector<Ref<Image> > &p_imag
|
||||
memdelete(f);
|
||||
}
|
||||
|
||||
Error ResourceImporterLayeredTexture::import(const String &p_source_file, const String &p_save_path, const Map<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files) {
|
||||
Error ResourceImporterLayeredTexture::import(const String &p_source_file, const String &p_save_path, const Map<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files, Variant *r_metadata) {
|
||||
|
||||
int compress_mode = p_options["compress/mode"];
|
||||
int no_bptc_if_rgb = p_options["compress/no_bptc_if_rgb"];
|
||||
@ -252,6 +252,7 @@ Error ResourceImporterLayeredTexture::import(const String &p_source_file, const
|
||||
}
|
||||
|
||||
String extension = get_save_extension();
|
||||
Array formats_imported;
|
||||
|
||||
if (compress_mode == COMPRESS_VIDEO_RAM) {
|
||||
//must import in all formats, in order of priority (so platform choses the best supported one. IE, etc2 over etc).
|
||||
@ -270,6 +271,8 @@ Error ResourceImporterLayeredTexture::import(const String &p_source_file, const
|
||||
encode_bptc = false;
|
||||
}
|
||||
}
|
||||
|
||||
formats_imported.push_back("bptc");
|
||||
}
|
||||
|
||||
if (encode_bptc) {
|
||||
@ -284,23 +287,27 @@ Error ResourceImporterLayeredTexture::import(const String &p_source_file, const
|
||||
_save_tex(slices, p_save_path + ".s3tc." + extension, compress_mode, Image::COMPRESS_S3TC, mipmaps, tex_flags);
|
||||
r_platform_variants->push_back("s3tc");
|
||||
ok_on_pc = true;
|
||||
formats_imported.push_back("s3tc");
|
||||
}
|
||||
|
||||
if (ProjectSettings::get_singleton()->get("rendering/vram_compression/import_etc2")) {
|
||||
|
||||
_save_tex(slices, p_save_path + ".etc2." + extension, compress_mode, Image::COMPRESS_ETC2, mipmaps, tex_flags);
|
||||
r_platform_variants->push_back("etc2");
|
||||
formats_imported.push_back("etc2");
|
||||
}
|
||||
|
||||
if (ProjectSettings::get_singleton()->get("rendering/vram_compression/import_etc")) {
|
||||
_save_tex(slices, p_save_path + ".etc." + extension, compress_mode, Image::COMPRESS_ETC, mipmaps, tex_flags);
|
||||
r_platform_variants->push_back("etc");
|
||||
formats_imported.push_back("etc");
|
||||
}
|
||||
|
||||
if (ProjectSettings::get_singleton()->get("rendering/vram_compression/import_pvrtc")) {
|
||||
|
||||
_save_tex(slices, p_save_path + ".pvrtc." + extension, compress_mode, Image::COMPRESS_PVRTC4, mipmaps, tex_flags);
|
||||
r_platform_variants->push_back("pvrtc");
|
||||
formats_imported.push_back("pvrtc");
|
||||
}
|
||||
|
||||
if (!ok_on_pc) {
|
||||
@ -311,9 +318,79 @@ Error ResourceImporterLayeredTexture::import(const String &p_source_file, const
|
||||
_save_tex(slices, p_save_path + "." + extension, compress_mode, Image::COMPRESS_S3TC /*this is ignored */, mipmaps, tex_flags);
|
||||
}
|
||||
|
||||
if (r_metadata) {
|
||||
Dictionary metadata;
|
||||
metadata["vram_texture"] = compress_mode == COMPRESS_VIDEO_RAM;
|
||||
if (formats_imported.size()) {
|
||||
metadata["imported_formats"] = formats_imported;
|
||||
}
|
||||
*r_metadata = metadata;
|
||||
}
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
const char *ResourceImporterLayeredTexture::compression_formats[] = {
|
||||
"bptc",
|
||||
"s3tc",
|
||||
"etc",
|
||||
"etc2",
|
||||
"pvrtc",
|
||||
NULL
|
||||
};
|
||||
String ResourceImporterLayeredTexture::get_import_settings_string() const {
|
||||
|
||||
String s;
|
||||
|
||||
int index = 0;
|
||||
while (compression_formats[index]) {
|
||||
String setting_path = "rendering/vram_compression/import_" + String(compression_formats[index]);
|
||||
bool test = ProjectSettings::get_singleton()->get(setting_path);
|
||||
if (test) {
|
||||
s += String(compression_formats[index]);
|
||||
}
|
||||
index++;
|
||||
}
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
bool ResourceImporterLayeredTexture::are_import_settings_valid(const String &p_path) const {
|
||||
|
||||
//will become invalid if formats are missing to import
|
||||
Dictionary metadata = ResourceFormatImporter::get_singleton()->get_resource_metadata(p_path);
|
||||
|
||||
if (!metadata.has("vram_texture")) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool vram = metadata["vram_texture"];
|
||||
if (!vram) {
|
||||
return true; //do not care about non vram
|
||||
}
|
||||
|
||||
Vector<String> formats_imported;
|
||||
if (metadata.has("imported_formats")) {
|
||||
formats_imported = metadata["imported_formats"];
|
||||
}
|
||||
|
||||
int index = 0;
|
||||
bool valid = true;
|
||||
while (compression_formats[index]) {
|
||||
String setting_path = "rendering/vram_compression/import_" + String(compression_formats[index]);
|
||||
bool test = ProjectSettings::get_singleton()->get(setting_path);
|
||||
if (test) {
|
||||
if (formats_imported.find(compression_formats[index]) == -1) {
|
||||
valid = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
index++;
|
||||
}
|
||||
|
||||
return valid;
|
||||
}
|
||||
|
||||
ResourceImporterLayeredTexture *ResourceImporterLayeredTexture::singleton = NULL;
|
||||
|
||||
ResourceImporterLayeredTexture::ResourceImporterLayeredTexture() {
|
||||
|
||||
@ -40,6 +40,7 @@ class ResourceImporterLayeredTexture : public ResourceImporter {
|
||||
GDCLASS(ResourceImporterLayeredTexture, ResourceImporter)
|
||||
|
||||
bool is_3d;
|
||||
static const char *compression_formats[];
|
||||
|
||||
protected:
|
||||
static void _texture_reimport_srgb(const Ref<StreamTexture> &p_tex);
|
||||
@ -76,10 +77,13 @@ public:
|
||||
|
||||
void _save_tex(const Vector<Ref<Image> > &p_images, const String &p_to_path, int p_compress_mode, Image::CompressMode p_vram_compression, bool p_mipmaps, int p_texture_flags);
|
||||
|
||||
virtual Error import(const String &p_source_file, const String &p_save_path, const Map<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files = NULL);
|
||||
virtual Error import(const String &p_source_file, const String &p_save_path, const Map<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files = NULL, Variant *r_metadata = NULL);
|
||||
|
||||
void update_imports();
|
||||
|
||||
virtual bool are_import_settings_valid(const String &p_path) const;
|
||||
virtual String get_import_settings_string() const;
|
||||
|
||||
void set_3d(bool p_3d) { is_3d = p_3d; }
|
||||
ResourceImporterLayeredTexture();
|
||||
~ResourceImporterLayeredTexture();
|
||||
|
||||
@ -499,7 +499,7 @@ bool ResourceImporterOBJ::get_option_visibility(const String &p_option, const Ma
|
||||
return true;
|
||||
}
|
||||
|
||||
Error ResourceImporterOBJ::import(const String &p_source_file, const String &p_save_path, const Map<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files) {
|
||||
Error ResourceImporterOBJ::import(const String &p_source_file, const String &p_save_path, const Map<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files, Variant *r_metadata) {
|
||||
|
||||
List<Ref<Mesh> > meshes;
|
||||
|
||||
|
||||
@ -61,7 +61,7 @@ public:
|
||||
virtual void get_import_options(List<ImportOption> *r_options, int p_preset = 0) const;
|
||||
virtual bool get_option_visibility(const String &p_option, const Map<StringName, Variant> &p_options) const;
|
||||
|
||||
virtual Error import(const String &p_source_file, const String &p_save_path, const Map<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files = NULL);
|
||||
virtual Error import(const String &p_source_file, const String &p_save_path, const Map<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files = NULL, Variant *r_metadata = NULL);
|
||||
|
||||
ResourceImporterOBJ();
|
||||
};
|
||||
|
||||
@ -1183,7 +1183,7 @@ Ref<Animation> ResourceImporterScene::import_animation_from_other_importer(Edito
|
||||
return importer->import_animation(p_path, p_flags, p_bake_fps);
|
||||
}
|
||||
|
||||
Error ResourceImporterScene::import(const String &p_source_file, const String &p_save_path, const Map<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files) {
|
||||
Error ResourceImporterScene::import(const String &p_source_file, const String &p_save_path, const Map<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files, Variant *r_metadata) {
|
||||
|
||||
String src_path = p_source_file;
|
||||
|
||||
|
||||
@ -153,7 +153,7 @@ public:
|
||||
void _filter_tracks(Node *scene, const String &p_text);
|
||||
void _optimize_animations(Node *scene, float p_max_lin_error, float p_max_ang_error, float p_max_angle);
|
||||
|
||||
virtual Error import(const String &p_source_file, const String &p_save_path, const Map<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files = NULL);
|
||||
virtual Error import(const String &p_source_file, const String &p_save_path, const Map<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files = NULL, Variant *r_metadata = NULL);
|
||||
|
||||
Node *import_scene_from_other_importer(EditorSceneImporter *p_exception, const String &p_path, uint32_t p_flags, int p_bake_fps);
|
||||
Ref<Animation> import_animation_from_other_importer(EditorSceneImporter *p_exception, const String &p_path, uint32_t p_flags, int p_bake_fps);
|
||||
|
||||
@ -375,7 +375,7 @@ void ResourceImporterTexture::_save_stex(const Ref<Image> &p_image, const String
|
||||
memdelete(f);
|
||||
}
|
||||
|
||||
Error ResourceImporterTexture::import(const String &p_source_file, const String &p_save_path, const Map<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files) {
|
||||
Error ResourceImporterTexture::import(const String &p_source_file, const String &p_save_path, const Map<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files, Variant *r_metadata) {
|
||||
|
||||
int compress_mode = p_options["compress/mode"];
|
||||
float lossy = p_options["compress/lossy_quality"];
|
||||
@ -401,6 +401,8 @@ Error ResourceImporterTexture::import(const String &p_source_file, const String
|
||||
if (err != OK)
|
||||
return err;
|
||||
|
||||
Array formats_imported;
|
||||
|
||||
int tex_flags = 0;
|
||||
if (repeat > 0)
|
||||
tex_flags |= Texture::FLAG_REPEAT;
|
||||
@ -485,6 +487,8 @@ Error ResourceImporterTexture::import(const String &p_source_file, const String
|
||||
can_bptc = false;
|
||||
}
|
||||
}
|
||||
|
||||
formats_imported.push_back("bptc");
|
||||
}
|
||||
|
||||
if (!can_bptc && is_hdr && !force_rgbe) {
|
||||
@ -495,6 +499,7 @@ Error ResourceImporterTexture::import(const String &p_source_file, const String
|
||||
if (can_bptc || can_s3tc) {
|
||||
_save_stex(image, p_save_path + ".s3tc.stex", compress_mode, lossy, can_bptc ? Image::COMPRESS_BPTC : Image::COMPRESS_S3TC, mipmaps, tex_flags, stream, detect_3d, detect_srgb, force_rgbe, detect_normal, force_normal, false);
|
||||
r_platform_variants->push_back("s3tc");
|
||||
formats_imported.push_back("s3tc");
|
||||
ok_on_pc = true;
|
||||
}
|
||||
|
||||
@ -502,17 +507,20 @@ Error ResourceImporterTexture::import(const String &p_source_file, const String
|
||||
|
||||
_save_stex(image, p_save_path + ".etc2.stex", compress_mode, lossy, Image::COMPRESS_ETC2, mipmaps, tex_flags, stream, detect_3d, detect_srgb, force_rgbe, detect_normal, force_normal, false);
|
||||
r_platform_variants->push_back("etc2");
|
||||
formats_imported.push_back("etc2");
|
||||
}
|
||||
|
||||
if (ProjectSettings::get_singleton()->get("rendering/vram_compression/import_etc")) {
|
||||
_save_stex(image, p_save_path + ".etc.stex", compress_mode, lossy, Image::COMPRESS_ETC, mipmaps, tex_flags, stream, detect_3d, detect_srgb, force_rgbe, detect_normal, force_normal, true);
|
||||
r_platform_variants->push_back("etc");
|
||||
formats_imported.push_back("etc");
|
||||
}
|
||||
|
||||
if (ProjectSettings::get_singleton()->get("rendering/vram_compression/import_pvrtc")) {
|
||||
|
||||
_save_stex(image, p_save_path + ".pvrtc.stex", compress_mode, lossy, Image::COMPRESS_PVRTC4, mipmaps, tex_flags, stream, detect_3d, detect_srgb, force_rgbe, detect_normal, force_normal, true);
|
||||
r_platform_variants->push_back("pvrtc");
|
||||
formats_imported.push_back("pvrtc");
|
||||
}
|
||||
|
||||
if (!ok_on_pc) {
|
||||
@ -523,9 +531,78 @@ Error ResourceImporterTexture::import(const String &p_source_file, const String
|
||||
_save_stex(image, p_save_path + ".stex", compress_mode, lossy, Image::COMPRESS_S3TC /*this is ignored */, mipmaps, tex_flags, stream, detect_3d, detect_srgb, force_rgbe, detect_normal, force_normal, false);
|
||||
}
|
||||
|
||||
if (r_metadata) {
|
||||
Dictionary metadata;
|
||||
metadata["vram_texture"] = compress_mode == COMPRESS_VIDEO_RAM;
|
||||
if (formats_imported.size()) {
|
||||
metadata["imported_formats"] = formats_imported;
|
||||
}
|
||||
*r_metadata = metadata;
|
||||
}
|
||||
return OK;
|
||||
}
|
||||
|
||||
const char *ResourceImporterTexture::compression_formats[] = {
|
||||
"bptc",
|
||||
"s3tc",
|
||||
"etc",
|
||||
"etc2",
|
||||
"pvrtc",
|
||||
NULL
|
||||
};
|
||||
String ResourceImporterTexture::get_import_settings_string() const {
|
||||
|
||||
String s;
|
||||
|
||||
int index = 0;
|
||||
while (compression_formats[index]) {
|
||||
String setting_path = "rendering/vram_compression/import_" + String(compression_formats[index]);
|
||||
bool test = ProjectSettings::get_singleton()->get(setting_path);
|
||||
if (test) {
|
||||
s += String(compression_formats[index]);
|
||||
}
|
||||
index++;
|
||||
}
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
bool ResourceImporterTexture::are_import_settings_valid(const String &p_path) const {
|
||||
|
||||
//will become invalid if formats are missing to import
|
||||
Dictionary metadata = ResourceFormatImporter::get_singleton()->get_resource_metadata(p_path);
|
||||
|
||||
if (!metadata.has("vram_texture")) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool vram = metadata["vram_texture"];
|
||||
if (!vram) {
|
||||
return true; //do not care about non vram
|
||||
}
|
||||
|
||||
Vector<String> formats_imported;
|
||||
if (metadata.has("imported_formats")) {
|
||||
formats_imported = metadata["imported_formats"];
|
||||
}
|
||||
|
||||
int index = 0;
|
||||
bool valid = true;
|
||||
while (compression_formats[index]) {
|
||||
String setting_path = "rendering/vram_compression/import_" + String(compression_formats[index]);
|
||||
bool test = ProjectSettings::get_singleton()->get(setting_path);
|
||||
if (test) {
|
||||
if (formats_imported.find(compression_formats[index]) == -1) {
|
||||
valid = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
index++;
|
||||
}
|
||||
|
||||
return valid;
|
||||
}
|
||||
|
||||
ResourceImporterTexture *ResourceImporterTexture::singleton = NULL;
|
||||
|
||||
ResourceImporterTexture::ResourceImporterTexture() {
|
||||
|
||||
@ -54,6 +54,7 @@ protected:
|
||||
static void _texture_reimport_normal(const Ref<StreamTexture> &p_tex);
|
||||
|
||||
static ResourceImporterTexture *singleton;
|
||||
static const char *compression_formats[];
|
||||
|
||||
public:
|
||||
static ResourceImporterTexture *get_singleton() { return singleton; }
|
||||
@ -85,10 +86,13 @@ public:
|
||||
|
||||
void _save_stex(const Ref<Image> &p_image, const String &p_to_path, int p_compress_mode, float p_lossy_quality, Image::CompressMode p_vram_compression, bool p_mipmaps, int p_texture_flags, bool p_streamable, bool p_detect_3d, bool p_detect_srgb, bool p_force_rgbe, bool p_detect_normal, bool p_force_normal, bool p_force_po2_for_compressed);
|
||||
|
||||
virtual Error import(const String &p_source_file, const String &p_save_path, const Map<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files = NULL);
|
||||
virtual Error import(const String &p_source_file, const String &p_save_path, const Map<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files = NULL, Variant *r_metadata = NULL);
|
||||
|
||||
void update_imports();
|
||||
|
||||
virtual bool are_import_settings_valid(const String &p_path) const;
|
||||
virtual String get_import_settings_string() const;
|
||||
|
||||
ResourceImporterTexture();
|
||||
~ResourceImporterTexture();
|
||||
};
|
||||
|
||||
@ -82,7 +82,7 @@ void ResourceImporterWAV::get_import_options(List<ImportOption> *r_options, int
|
||||
r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "compress/mode", PROPERTY_HINT_ENUM, "Disabled,RAM (Ima-ADPCM)"), 0));
|
||||
}
|
||||
|
||||
Error ResourceImporterWAV::import(const String &p_source_file, const String &p_save_path, const Map<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files) {
|
||||
Error ResourceImporterWAV::import(const String &p_source_file, const String &p_save_path, const Map<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files, Variant *r_metadata) {
|
||||
|
||||
/* STEP 1, READ WAVE FILE */
|
||||
|
||||
|
||||
@ -161,7 +161,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
virtual Error import(const String &p_source_file, const String &p_save_path, const Map<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files = NULL);
|
||||
virtual Error import(const String &p_source_file, const String &p_save_path, const Map<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files = NULL, Variant *r_metadata = NULL);
|
||||
|
||||
ResourceImporterWAV();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user