diff options
| author | Daniel J. Ramirez | 2017-08-18 21:21:24 -0500 |
|---|---|---|
| committer | Daniel J. Ramirez | 2017-08-20 13:53:02 -0500 |
| commit | da8fecf25e11ea05ad6aaab4f9676c78e4faecdc (patch) | |
| tree | f56d429c0bca3b6bfd214e4cbc1a8c481691b43e /editor | |
| parent | ab13d0aeed43b7263b1e62bb62551525b70822a8 (diff) | |
| download | godot-da8fecf25e11ea05ad6aaab4f9676c78e4faecdc.tar.gz godot-da8fecf25e11ea05ad6aaab4f9676c78e4faecdc.tar.zst godot-da8fecf25e11ea05ad6aaab4f9676c78e4faecdc.zip | |
Added support for SVG
Diffstat (limited to 'editor')
| -rw-r--r-- | editor/import/resource_importer_texture.cpp | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/editor/import/resource_importer_texture.cpp b/editor/import/resource_importer_texture.cpp index c0c507c2d..060e68307 100644 --- a/editor/import/resource_importer_texture.cpp +++ b/editor/import/resource_importer_texture.cpp @@ -45,8 +45,6 @@ void ResourceImporterTexture::_texture_reimport_srgb(const Ref<StreamTexture> &p singleton->make_flags[path] |= MAKE_SRGB_FLAG; - print_line("requesting srgb for " + String(path)); - singleton->mutex->unlock(); } @@ -61,8 +59,6 @@ void ResourceImporterTexture::_texture_reimport_3d(const Ref<StreamTexture> &p_t singleton->make_flags[path] |= MAKE_3D_FLAG; - print_line("requesting 3d for " + String(path)); - singleton->mutex->unlock(); } @@ -77,8 +73,6 @@ void ResourceImporterTexture::_texture_reimport_normal(const Ref<StreamTexture> singleton->make_flags[path] |= MAKE_NORMAL_FLAG; - print_line("requesting normalfor " + String(path)); - singleton->mutex->unlock(); } @@ -97,8 +91,6 @@ void ResourceImporterTexture::update_imports() { Vector<String> to_reimport; for (Map<StringName, int>::Element *E = make_flags.front(); E; E = E->next()) { - print_line("checking for reimport " + String(E->key())); - Ref<ConfigFile> cf; cf.instance(); String src_path = String(E->key()) + ".import"; @@ -207,11 +199,11 @@ void ResourceImporterTexture::get_import_options(List<ImportOption> *r_options, r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "stream"), false)); r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "size_limit", PROPERTY_HINT_RANGE, "0,4096,1"), 0)); r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "detect_3d"), p_preset == PRESET_DETECT)); + r_options->push_back(ImportOption(PropertyInfo(Variant::REAL, "scale", PROPERTY_HINT_RANGE, "0.001,100,0.1"), 1.0)); } void ResourceImporterTexture::_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) { - print_line("saving: " + p_to_path); FileAccess *f = FileAccess::open(p_to_path, FileAccess::WRITE); f->store_8('G'); f->store_8('D'); @@ -365,10 +357,11 @@ Error ResourceImporterTexture::import(const String &p_source_file, const String bool force_rgbe = int(p_options["compress/hdr_mode"]) == 1; bool hdr_as_srgb = p_options["process/HDR_as_SRGB"]; int normal = p_options["compress/normal_map"]; + float scale = p_options["scale"]; Ref<Image> image; image.instance(); - Error err = ImageLoader::load_image(p_source_file, image, NULL, hdr_as_srgb); + Error err = ImageLoader::load_image(p_source_file, image, NULL, hdr_as_srgb, scale); if (err != OK) return err; |
