diff options
335 files changed, 9787 insertions, 8786 deletions
diff --git a/.gitignore b/.gitignore index 7552e8fd17..497d8b50d2 100644 --- a/.gitignore +++ b/.gitignore @@ -284,3 +284,6 @@ platform/windows/godot_res.res # Visual Studio 2017 and Visual Studio Code workspace folder /.vs /.vscode + +# Scons progress indicator +.scons_node_count diff --git a/.travis.yml b/.travis.yml index 12d49f5d5d..8aa21a4de4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -88,8 +88,8 @@ script: sh ./misc/travis/clang-format.sh; else if [ "$TRAVIS_OS_NAME" = "windows" ]; then - scons platform=$GODOT_TARGET CXX=$CXX openssl=builtin; + scons platform=$GODOT_TARGET progress=no verbose=yes CXX=$CXX openssl=builtin; else - scons platform=$GODOT_TARGET bits=64 CXX=$CXX openssl=builtin; + scons platform=$GODOT_TARGET progress=no verbose=yes bits=64 CXX=$CXX openssl=builtin; fi fi diff --git a/COPYRIGHT.txt b/COPYRIGHT.txt index 84a57d2663..b36f2b1134 100644 --- a/COPYRIGHT.txt +++ b/COPYRIGHT.txt @@ -95,13 +95,6 @@ Copyright: 1997-2017, Sam Lantinga 2014-2017, Godot Engine contributors (cf. AUTHORS.md) License: Expat and Zlib -Files: ./platform/uwp/export/export.cpp -Comment: fb-util-for-appx -Copyright: 2016, Facebook, Inc. All rights reserved. - 2007-2017, Juan Linietsky, Ariel Manzur. - 2014-2017, Godot Engine contributors (cf. AUTHORS.md) -License: BSD-3-clause and Expat - Files: ./servers/physics/gjk_epa.cpp ./servers/physics/joints/generic_6dof_joint_sw.cpp ./servers/physics/joints/generic_6dof_joint_sw.h diff --git a/SConstruct b/SConstruct index a403117065..f8b2d82b66 100644 --- a/SConstruct +++ b/SConstruct @@ -150,9 +150,11 @@ opts.Add('disable_3d', "Disable 3D nodes for smaller executable (yes/no)", 'no') opts.Add('disable_advanced_gui', "Disable advance 3D gui nodes and behaviors (yes/no)", 'no') opts.Add('extra_suffix', "Custom extra suffix added to the base filename of all generated binary files", '') opts.Add('unix_global_settings_path', "UNIX-specific path to system-wide settings. Currently only used for templates", '') -opts.Add('verbose', "Enable verbose output for the compilation (yes/no)", 'yes') +opts.Add('verbose', "Enable verbose output for the compilation (yes/no)", 'no') opts.Add('vsproj', "Generate Visual Studio Project. (yes/no)", 'no') -opts.Add('warnings', "Set the level of warnings emitted during compilation (extra/all/moderate/no)", 'all') +opts.Add('warnings', "Set the level of warnings emitted during compilation (extra/all/moderate/no)", 'no') +opts.Add('progress', "Show a progress indicator during build (yes/no)", 'yes') +opts.Add('dev', "If yes, alias for verbose=yes warnings=all (yes/no)", 'no') # Thirdparty libraries opts.Add('builtin_enet', "Use the builtin enet library (yes/no)", 'yes') @@ -208,8 +210,8 @@ if (env_base['target'] == 'debug'): env_base.Append(CPPFLAGS=['-DDEBUG_MEMORY_ALLOC']) env_base.Append(CPPFLAGS=['-DSCI_NAMESPACE']) -if (env_base['deprecated'] != 'no'): - env_base.Append(CPPFLAGS=['-DENABLE_DEPRECATED']) +if (env_base['deprecated'] == 'no'): + env_base.Append(CPPFLAGS=['-DDISABLE_DEPRECATED']) env_base.platforms = {} @@ -231,6 +233,10 @@ if selected_platform in platform_list: env = detect.create(env_base) else: env = env_base.Clone() + + if (env["dev"] == "yes"): + env["warnings"] = "all" + env["verbose"] = "yes" if env['vsproj'] == "yes": env.vs_incs = [] @@ -449,3 +455,38 @@ else: for x in platform_list: print("\t" + x) print("\nPlease run scons again with argument: platform=<string>") + + +screen = sys.stdout +node_count = 0 +node_count_max = 0 +node_count_interval = 1 +node_count_fname = str(env.Dir('#')) + '/.scons_node_count' + +def progress_function(node): + global node_count, node_count_max, node_count_interval, node_count_fname + node_count += node_count_interval + if (node_count_max > 0 and node_count <= node_count_max): + screen.write('\r[%3d%%] ' % (node_count * 100 / node_count_max)) + screen.flush() + elif (node_count_max > 0 and node_count > node_count_max): + screen.write('\r[100%] ') + screen.flush() + else: + screen.write('\r[Initial build] ') + screen.flush() + +def progress_finish(target, source, env): + global node_count + with open(node_count_fname, 'w') as f: + f.write('%d\n' % node_count) + +if (env["progress"] == "yes"): + try: + with open(node_count_fname) as f: + node_count_max = int(f.readline()) + except: + pass + Progress(progress_function, interval = node_count_interval) + progress_finish_command = Command('progress_finish', [], progress_finish) + AlwaysBuild(progress_finish_command) diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp index 095f058ed9..e863078a48 100644 --- a/core/bind/core_bind.cpp +++ b/core/bind/core_bind.cpp @@ -300,6 +300,11 @@ bool _OS::get_borderless_window() const { return OS::get_singleton()->get_borderless_window(); } +void _OS::set_ime_position(const Point2 &p_pos) { + + return OS::get_singleton()->set_ime_position(p_pos); +} + void _OS::set_use_file_access_save_and_swap(bool p_enable) { FileAccess::set_backup_save(p_enable); @@ -993,6 +998,8 @@ void _OS::_bind_methods() { ClassDB::bind_method(D_METHOD("set_borderless_window", "borderless"), &_OS::set_borderless_window); ClassDB::bind_method(D_METHOD("get_borderless_window"), &_OS::get_borderless_window); + ClassDB::bind_method(D_METHOD("set_ime_position"), &_OS::set_ime_position); + ClassDB::bind_method(D_METHOD("set_screen_orientation", "orientation"), &_OS::set_screen_orientation); ClassDB::bind_method(D_METHOD("get_screen_orientation"), &_OS::get_screen_orientation); diff --git a/core/bind/core_bind.h b/core/bind/core_bind.h index 87d84c0732..f72f665d9e 100644 --- a/core/bind/core_bind.h +++ b/core/bind/core_bind.h @@ -158,6 +158,8 @@ public: virtual void set_borderless_window(bool p_borderless); virtual bool get_borderless_window() const; + virtual void set_ime_position(const Point2 &p_pos); + Error native_video_play(String p_path, float p_volume, String p_audio_track, String p_subtitle_track); bool native_video_is_playing(); void native_video_pause(); diff --git a/core/engine.cpp b/core/engine.cpp index 5301c4e519..c16a2903d3 100644 --- a/core/engine.cpp +++ b/core/engine.cpp @@ -30,6 +30,7 @@ #include "engine.h" #include "version.h" +#include "version_hash.gen.h" void Engine::set_iterations_per_second(int p_ips) { @@ -87,6 +88,9 @@ Dictionary Engine::get_version_info() const { dict["revision"] = _MKSTR(VERSION_REVISION); dict["year"] = VERSION_YEAR; + String hash = String(VERSION_HASH); + dict["hash"] = hash.length() == 0 ? String("unknown") : hash; + String stringver = String(dict["major"]) + "." + String(dict["minor"]); if ((int)dict["patch"] != 0) stringver += "." + String(dict["patch"]); @@ -115,4 +119,6 @@ Engine::Engine() { _fixed_frames = 0; _idle_frames = 0; _in_fixed = false; + _frame_ticks = 0; + _frame_step = 0; } diff --git a/core/engine.h b/core/engine.h index 80b11c095d..16dfb77593 100644 --- a/core/engine.h +++ b/core/engine.h @@ -42,6 +42,8 @@ class Engine { String _custom_level; uint64_t frames_drawn; uint32_t _frame_delay; + uint64_t _frame_ticks; + float _frame_step; int ips; float _fps; @@ -72,6 +74,8 @@ public: uint64_t get_fixed_frames() const { return _fixed_frames; } uint64_t get_idle_frames() const { return _idle_frames; } bool is_in_fixed_frame() const { return _in_fixed; } + uint64_t get_idle_frame_ticks() const { return _frame_ticks; } + float get_idle_frame_step() const { return _frame_step; } void set_time_scale(float p_scale); float get_time_scale() const; diff --git a/core/global_config.cpp b/core/global_config.cpp index ba0a7f3e31..caae73ee2e 100644 --- a/core/global_config.cpp +++ b/core/global_config.cpp @@ -835,7 +835,7 @@ void GlobalConfig::_bind_methods() { ClassDB::bind_method(D_METHOD("get_singleton", "name"), &GlobalConfig::get_singleton_object); ClassDB::bind_method(D_METHOD("load_resource_pack", "pack"), &GlobalConfig::_load_resource_pack); ClassDB::bind_method(D_METHOD("property_can_revert", "name"), &GlobalConfig::property_can_revert); - ClassDB::bind_method(D_METHOD("property_get_revert", "name"), &GlobalConfig::property_get_revert); + ClassDB::bind_method(D_METHOD("property_get_revert:Variant", "name"), &GlobalConfig::property_get_revert); ClassDB::bind_method(D_METHOD("save_custom", "file"), &GlobalConfig::_save_custom_bnd); } diff --git a/core/io/resource_format_binary.cpp b/core/io/resource_format_binary.cpp index b474c2e078..728cd5d4ff 100644 --- a/core/io/resource_format_binary.cpp +++ b/core/io/resource_format_binary.cpp @@ -29,6 +29,7 @@ /*************************************************************************/ #include "resource_format_binary.h" #include "global_config.h" +#include "image.h" #include "io/file_access_compressed.h" #include "io/marshalls.h" #include "os/dir_access.h" @@ -54,7 +55,6 @@ enum { VARIANT_TRANSFORM = 17, VARIANT_MATRIX32 = 18, VARIANT_COLOR = 20, - //VARIANT_IMAGE = 21, - no longer variant type VARIANT_NODE_PATH = 22, VARIANT_RID = 23, VARIANT_OBJECT = 24, @@ -70,7 +70,13 @@ enum { VARIANT_VECTOR2_ARRAY = 37, VARIANT_INT64 = 40, VARIANT_DOUBLE = 41, - +#ifndef DISABLE_DEPRECATED + VARIANT_IMAGE = 21, // - no longer variant type + IMAGE_ENCODING_EMPTY = 0, + IMAGE_ENCODING_RAW = 1, + IMAGE_ENCODING_LOSSLESS = 2, + IMAGE_ENCODING_LOSSY = 3, +#endif OBJECT_EMPTY = 0, OBJECT_EXTERNAL_RESOURCE = 1, OBJECT_INTERNAL_RESOURCE = 2, @@ -541,7 +547,69 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant &r_v) { w = PoolVector<Color>::Write(); r_v = array; } break; +#ifndef DISABLE_DEPRECATED + case VARIANT_IMAGE: { + uint32_t encoding = f->get_32(); + if (encoding == IMAGE_ENCODING_EMPTY) { + r_v = Ref<Image>(); + break; + } else if (encoding == IMAGE_ENCODING_RAW) { + uint32_t width = f->get_32(); + uint32_t height = f->get_32(); + uint32_t mipmaps = f->get_32(); + uint32_t format = f->get_32(); + const uint32_t format_version_shift = 24; + const uint32_t format_version_mask = format_version_shift - 1; + + uint32_t format_version = format >> format_version_shift; + + const uint32_t current_version = 0; + if (format_version > current_version) { + + ERR_PRINT("Format version for encoded binary image is too new"); + return ERR_PARSE_ERROR; + } + + Image::Format fmt = Image::Format(format & format_version_mask); //if format changes, we can add a compatibility bit on top + + uint32_t datalen = f->get_32(); + + PoolVector<uint8_t> imgdata; + imgdata.resize(datalen); + PoolVector<uint8_t>::Write w = imgdata.write(); + f->get_buffer(w.ptr(), datalen); + _advance_padding(datalen); + w = PoolVector<uint8_t>::Write(); + + Ref<Image> image; + image.instance(); + image->create(width, height, mipmaps, fmt, imgdata); + r_v = image; + + } else { + //compressed + PoolVector<uint8_t> data; + data.resize(f->get_32()); + PoolVector<uint8_t>::Write w = data.write(); + f->get_buffer(w.ptr(), data.size()); + w = PoolVector<uint8_t>::Write(); + + Ref<Image> image; + if (encoding == IMAGE_ENCODING_LOSSY && Image::lossy_unpacker) { + + image = Image::lossy_unpacker(data); + } else if (encoding == IMAGE_ENCODING_LOSSLESS && Image::lossless_unpacker) { + + image = Image::lossless_unpacker(data); + } + _advance_padding(data.size()); + + r_v = image; + } + + } break; +#endif default: { ERR_FAIL_V(ERR_FILE_CORRUPT); } break; @@ -1644,7 +1712,6 @@ void ResourceFormatSaverBinaryInstance::_find_resources(const Variant &p_variant get_string_index(np.get_property()); } break; - default: {} } } diff --git a/core/io/translation_loader_po.cpp b/core/io/translation_loader_po.cpp index 6104608961..1a670b0ab0 100644 --- a/core/io/translation_loader_po.cpp +++ b/core/io/translation_loader_po.cpp @@ -51,6 +51,8 @@ RES TranslationLoaderPO::load_translation(FileAccess *f, Error *r_error, const S Ref<Translation> translation = Ref<Translation>(memnew(Translation)); int line = 1; + bool skip_this; + bool skip_next; while (true) { @@ -60,9 +62,10 @@ RES TranslationLoaderPO::load_translation(FileAccess *f, Error *r_error, const S if (status == STATUS_READING_STRING) { - if (msg_id != "") - translation->add_message(msg_id, msg_str); - else if (config == "") + if (msg_id != "") { + if (!skip_this) + translation->add_message(msg_id, msg_str); + } else if (config == "") config = msg_str; break; @@ -85,15 +88,18 @@ RES TranslationLoaderPO::load_translation(FileAccess *f, Error *r_error, const S ERR_FAIL_V(RES()); } - if (msg_id != "") - translation->add_message(msg_id, msg_str); - else if (config == "") + if (msg_id != "") { + if (!skip_this) + translation->add_message(msg_id, msg_str); + } else if (config == "") config = msg_str; l = l.substr(5, l.length()).strip_edges(); status = STATUS_READING_ID; msg_id = ""; msg_str = ""; + skip_this = skip_next; + skip_next = false; } if (l.begins_with("msgstr")) { @@ -110,6 +116,9 @@ RES TranslationLoaderPO::load_translation(FileAccess *f, Error *r_error, const S } if (l == "" || l.begins_with("#")) { + if (l.find("fuzzy") != -1) { + skip_next = true; + } line++; continue; //nothing to read or comment } diff --git a/core/math/a_star.cpp b/core/math/a_star.cpp index 838fec22f0..04e4383f03 100644 --- a/core/math/a_star.cpp +++ b/core/math/a_star.cpp @@ -123,6 +123,12 @@ void AStar::disconnect_points(int p_id, int p_with_id) { a->neighbours.erase(b); b->neighbours.erase(a); } + +bool AStar::has_point(int p_id) const { + + return points.has(p_id); +} + bool AStar::are_points_connected(int p_id, int p_with_id) const { Segment s(p_id, p_with_id); @@ -400,6 +406,7 @@ void AStar::_bind_methods() { ClassDB::bind_method(D_METHOD("get_point_pos", "id"), &AStar::get_point_pos); ClassDB::bind_method(D_METHOD("get_point_weight_scale", "id"), &AStar::get_point_weight_scale); ClassDB::bind_method(D_METHOD("remove_point", "id"), &AStar::remove_point); + ClassDB::bind_method(D_METHOD("has_point", "id"), &AStar::has_point); ClassDB::bind_method(D_METHOD("connect_points", "id", "to_id", "bidirectional"), &AStar::connect_points, DEFVAL(true)); ClassDB::bind_method(D_METHOD("disconnect_points", "id", "to_id"), &AStar::disconnect_points); diff --git a/core/math/a_star.h b/core/math/a_star.h index 34a5358344..ebf1407c17 100644 --- a/core/math/a_star.h +++ b/core/math/a_star.h @@ -104,6 +104,7 @@ public: Vector3 get_point_pos(int p_id) const; real_t get_point_weight_scale(int p_id) const; void remove_point(int p_id); + bool has_point(int p_id) const; void connect_points(int p_id, int p_with_id, bool bidirectional = true); void disconnect_points(int p_id, int p_with_id); diff --git a/core/math/audio_frame.h b/core/math/audio_frame.h index 5ccc9d9e5e..d54f622197 100644 --- a/core/math/audio_frame.h +++ b/core/math/audio_frame.h @@ -102,6 +102,16 @@ struct AudioFrame { r = ::undenormalise(r); } + _FORCE_INLINE_ AudioFrame linear_interpolate(const AudioFrame &p_b, float p_t) const { + + AudioFrame res = *this; + + res.l += (p_t * (p_b.l - l)); + res.r += (p_t * (p_b.r - r)); + + return res; + } + _ALWAYS_INLINE_ AudioFrame(float p_l, float p_r) { l = p_l; r = p_r; diff --git a/core/math/vector3.h b/core/math/vector3.h index 7dfcedd0da..6a7974681e 100644 --- a/core/math/vector3.h +++ b/core/math/vector3.h @@ -100,6 +100,7 @@ struct Vector3 { _FORCE_INLINE_ Vector3 abs() const; _FORCE_INLINE_ Vector3 floor() const; + _FORCE_INLINE_ Vector3 sign() const; _FORCE_INLINE_ Vector3 ceil() const; _FORCE_INLINE_ real_t distance_to(const Vector3 &p_b) const; @@ -187,6 +188,11 @@ Vector3 Vector3::abs() const { return Vector3(Math::abs(x), Math::abs(y), Math::abs(z)); } +Vector3 Vector3::sign() const { + + return Vector3(SGN(x), SGN(y), SGN(z)); +} + Vector3 Vector3::floor() const { return Vector3(Math::floor(x), Math::floor(y), Math::floor(z)); diff --git a/core/object.cpp b/core/object.cpp index 3416cd8c5a..9184fb9cd0 100644 --- a/core/object.cpp +++ b/core/object.cpp @@ -1655,7 +1655,7 @@ void Object::_bind_methods() { ClassDB::bind_method(D_METHOD("get_script:Script"), &Object::get_script); ClassDB::bind_method(D_METHOD("set_meta", "name", "value"), &Object::set_meta); - ClassDB::bind_method(D_METHOD("get_meta", "name", "value"), &Object::get_meta); + ClassDB::bind_method(D_METHOD("get_meta:Variant", "name", "value"), &Object::get_meta); ClassDB::bind_method(D_METHOD("has_meta", "name"), &Object::has_meta); ClassDB::bind_method(D_METHOD("get_meta_list"), &Object::_get_meta_list_bind); @@ -1817,6 +1817,23 @@ uint32_t Object::get_edited_version() const { } #endif +void *Object::get_script_instance_binding(int p_script_language_index) { +#ifdef DEBUG_ENABLED + ERR_FAIL_INDEX_V(p_script_language_index, MAX_SCRIPT_INSTANCE_BINDINGS, NULL); +#endif + + //it's up to the script language to make this thread safe, if the function is called twice due to threads being out of syncro + //just return the same pointer. + //if you want to put a big lock in the entire function and keep allocated pointers in a map or something, feel free to do it + //as it should not really affect performance much (won't be called too often), as in far most caes the condition below will be false afterwards + + if (!_script_instance_bindings[p_script_language_index]) { + _script_instance_bindings[p_script_language_index] = ScriptServer::get_language(p_script_language_index)->alloc_instance_binding_data(this); + } + + return _script_instance_bindings[p_script_language_index]; +} + Object::Object() { _class_ptr = NULL; @@ -1826,6 +1843,7 @@ Object::Object() { _instance_ID = ObjectDB::add_instance(this); _can_translate = true; _is_queued_for_deletion = false; + memset(_script_instance_bindings, 0, sizeof(void *) * MAX_SCRIPT_INSTANCE_BINDINGS); script_instance = NULL; #ifdef TOOLS_ENABLED @@ -1877,6 +1895,12 @@ Object::~Object() { ObjectDB::remove_instance(this); _instance_ID = 0; _predelete_ok = 2; + + for (int i = 0; i < MAX_SCRIPT_INSTANCE_BINDINGS; i++) { + if (_script_instance_bindings[i]) { + ScriptServer::get_language(i)->free_instance_binding_data(_script_instance_bindings[i]); + } + } } bool predelete_handler(Object *p_object) { diff --git a/core/object.h b/core/object.h index f87705c48b..556f3f1586 100644 --- a/core/object.h +++ b/core/object.h @@ -381,6 +381,10 @@ public: }; private: + enum { + MAX_SCRIPT_INSTANCE_BINDINGS = 8 + }; + #ifdef DEBUG_ENABLED friend class _ObjectDebugLock; #endif @@ -447,6 +451,8 @@ private: void _set_bind(const String &p_set, const Variant &p_value); Variant _get_bind(const String &p_name) const; + void *_script_instance_bindings[MAX_SCRIPT_INSTANCE_BINDINGS]; + void property_list_changed_notify(); protected: @@ -683,6 +689,9 @@ public: bool editor_is_section_unfolded(const String &p_section); #endif + //used by script languages to store binding data + void *get_script_instance_binding(int p_script_language_index); + void clear_internal_resource_paths(); Object(); diff --git a/core/os/os.h b/core/os/os.h index 11fe8b44e3..cafd1f4e14 100644 --- a/core/os/os.h +++ b/core/os/os.h @@ -179,6 +179,8 @@ public: virtual void set_borderless_window(int p_borderless) {} virtual bool get_borderless_window() { return 0; } + virtual void set_ime_position(const Point2 &p_pos) {} + virtual Error open_dynamic_library(const String p_path, void *&p_library_handle) { return ERR_UNAVAILABLE; }; virtual Error close_dynamic_library(void *p_library_handle) { return ERR_UNAVAILABLE; }; virtual Error get_dynamic_library_symbol_handle(void *p_library_handle, const String p_name, void *&p_symbol_handle) { return ERR_UNAVAILABLE; }; diff --git a/core/script_language.cpp b/core/script_language.cpp index 72f0acec3b..4a7fdc9d64 100644 --- a/core/script_language.cpp +++ b/core/script_language.cpp @@ -66,11 +66,6 @@ bool ScriptServer::is_scripting_enabled() { return scripting_enabled; } -int ScriptServer::get_language_count() { - - return _language_count; -} - ScriptLanguage *ScriptServer::get_language(int p_idx) { ERR_FAIL_INDEX_V(p_idx, _language_count, NULL); diff --git a/core/script_language.h b/core/script_language.h index 6e39593a89..a81300233f 100644 --- a/core/script_language.h +++ b/core/script_language.h @@ -57,7 +57,7 @@ public: static void set_scripting_enabled(bool p_enabled); static bool is_scripting_enabled(); - static int get_language_count(); + _FORCE_INLINE_ static int get_language_count() { return _language_count; } static ScriptLanguage *get_language(int p_idx); static void register_language(ScriptLanguage *p_language); static void unregister_language(ScriptLanguage *p_language); @@ -274,6 +274,9 @@ public: virtual int profiling_get_accumulated_data(ProfilingInfo *p_info_arr, int p_info_max) = 0; virtual int profiling_get_frame_data(ProfilingInfo *p_info_arr, int p_info_max) = 0; + virtual void *alloc_instance_binding_data(Object *p_object) { return NULL; } //optional, not used by all languages + virtual void free_instance_binding_data(void *p_data) {} //optional, not used by all languages + virtual void frame(); virtual ~ScriptLanguage(){}; diff --git a/core/self_list.h b/core/self_list.h index 9edf735f7b..e229d5bf8e 100644 --- a/core/self_list.h +++ b/core/self_list.h @@ -51,6 +51,25 @@ public: _first->_prev = p_elem; _first = p_elem; } + void add_last(SelfList<T> *p_elem) { + + ERR_FAIL_COND(p_elem->_root); + + if (!_first) { + add(p_elem); + return; + } + + SelfList<T> *e = _first; + + while (e->next()) { + e = e->next(); + } + + e->_next = p_elem; + p_elem->_prev = e->_next; + p_elem->_root = this; + } void remove(SelfList<T> *p_elem) { diff --git a/doc/base/classes.xml b/doc/base/classes.xml index 6ff3e0fa29..d6ee2ab0c5 100644 --- a/doc/base/classes.xml +++ b/doc/base/classes.xml @@ -2081,6 +2081,14 @@ <description> </description> </method> + <method name="has_point" qualifiers="const"> + <return type="bool"> + </return> + <argument index="0" name="id" type="int"> + </argument> + <description> + </description> + </method> <method name="remove_point"> <argument index="0" name="id" type="int"> </argument> @@ -3754,6 +3762,12 @@ Return the angular damp rate. </description> </method> + <method name="get_audio_bus" qualifiers="const"> + <return type="String"> + </return> + <description> + </description> + </method> <method name="get_collision_layer" qualifiers="const"> <return type="int"> </return> @@ -3835,6 +3849,24 @@ Return the processing order of this area. </description> </method> + <method name="get_reverb_amount" qualifiers="const"> + <return type="float"> + </return> + <description> + </description> + </method> + <method name="get_reverb_bus" qualifiers="const"> + <return type="String"> + </return> + <description> + </description> + </method> + <method name="get_reverb_uniformity" qualifiers="const"> + <return type="float"> + </return> + <description> + </description> + </method> <method name="get_space_override_mode" qualifiers="const"> <return type="int"> </return> @@ -3863,6 +3895,18 @@ Return whether this area detects bodies/areas entering/exiting it. </description> </method> + <method name="is_overriding_audio_bus" qualifiers="const"> + <return type="bool"> + </return> + <description> + </description> + </method> + <method name="is_using_reverb_bus" qualifiers="const"> + <return type="bool"> + </return> + <description> + </description> + </method> <method name="overlaps_area" qualifiers="const"> <return type="bool"> </return> @@ -3889,6 +3933,18 @@ In practice, as the fraction of speed lost gets smaller with each frame, a value of 1.0 does not mean the object will stop in exactly one second. Only when the physics calculations are done at 1 frame per second, it does stop in a second. </description> </method> + <method name="set_audio_bus"> + <argument index="0" name="name" type="String"> + </argument> + <description> + </description> + </method> + <method name="set_audio_bus_override"> + <argument index="0" name="enable" type="bool"> + </argument> + <description> + </description> + </method> <method name="set_collision_layer"> <argument index="0" name="collision_layer" type="int"> </argument> @@ -3983,6 +4039,24 @@ Areas with the same priority value get evaluated in an unpredictable order, and should be differentiated if evaluation order is to be important. </description> </method> + <method name="set_reverb_amount"> + <argument index="0" name="amount" type="float"> + </argument> + <description> + </description> + </method> + <method name="set_reverb_bus"> + <argument index="0" name="name" type="String"> + </argument> + <description> + </description> + </method> + <method name="set_reverb_uniformity"> + <argument index="0" name="amount" type="float"> + </argument> + <description> + </description> + </method> <method name="set_space_override_mode"> <argument index="0" name="enable" type="int"> </argument> @@ -3995,10 +4069,20 @@ AREA_SPACE_OVERRIDE_REPLACE_COMBINE: This area replaces any gravity/damp calculated so far, but keeps calculating the rest of the areas, down to the default one. </description> </method> + <method name="set_use_reverb_bus"> + <argument index="0" name="enable" type="bool"> + </argument> + <description> + </description> + </method> </methods> <members> <member name="angular_damp" type="float" setter="set_angular_damp" getter="get_angular_damp" brief=""> </member> + <member name="audio_bus_name" type="String" setter="set_audio_bus" getter="get_audio_bus" brief=""> + </member> + <member name="audio_bus_override" type="bool" setter="set_audio_bus_override" getter="is_overriding_audio_bus" brief=""> + </member> <member name="collision_layer" type="int" setter="set_collision_layer" getter="get_collision_layer" brief=""> </member> <member name="collision_mask" type="int" setter="set_collision_mask" getter="get_collision_mask" brief=""> @@ -4019,6 +4103,14 @@ </member> <member name="priority" type="int" setter="set_priority" getter="get_priority" brief=""> </member> + <member name="reverb_bus_amount" type="float" setter="set_reverb_amount" getter="get_reverb_amount" brief=""> + </member> + <member name="reverb_bus_enable" type="bool" setter="set_use_reverb_bus" getter="is_using_reverb_bus" brief=""> + </member> + <member name="reverb_bus_name" type="String" setter="set_reverb_bus" getter="get_reverb_bus" brief=""> + </member> + <member name="reverb_bus_uniformity" type="float" setter="set_reverb_uniformity" getter="get_reverb_uniformity" brief=""> + </member> <member name="space_override" type="int" setter="set_space_override_mode" getter="get_space_override_mode" brief=""> </member> </members> @@ -4122,6 +4214,12 @@ Return the angular damp rate. </description> </method> + <method name="get_audio_bus" qualifiers="const"> + <return type="String"> + </return> + <description> + </description> + </method> <method name="get_collision_layer" qualifiers="const"> <return type="int"> </return> @@ -4231,6 +4329,12 @@ Return whether this area detects bodies/areas entering/exiting it. </description> </method> + <method name="is_overriding_audio_bus" qualifiers="const"> + <return type="bool"> + </return> + <description> + </description> + </method> <method name="overlaps_area" qualifiers="const"> <return type="bool"> </return> @@ -4257,6 +4361,18 @@ In practice, as the fraction of speed lost gets smaller with each frame, a value of 1.0 does not mean the object will stop in exactly one second. Only when the physics calculations are done at 1 frame per second, it does stop in a second. </description> </method> + <method name="set_audio_bus"> + <argument index="0" name="name" type="String"> + </argument> + <description> + </description> + </method> + <method name="set_audio_bus_override"> + <argument index="0" name="enable" type="bool"> + </argument> + <description> + </description> + </method> <method name="set_collision_layer"> <argument index="0" name="collision_layer" type="int"> </argument> @@ -4367,6 +4483,10 @@ <members> <member name="angular_damp" type="float" setter="set_angular_damp" getter="get_angular_damp" brief=""> </member> + <member name="audio_bus_name" type="String" setter="set_audio_bus" getter="get_audio_bus" brief=""> + </member> + <member name="audio_bus_override" type="bool" setter="set_audio_bus_override" getter="is_overriding_audio_bus" brief=""> + </member> <member name="collision_layer" type="int" setter="set_collision_layer" getter="get_collision_layer" brief=""> </member> <member name="collision_mask" type="int" setter="set_collision_mask" getter="get_collision_mask" brief=""> @@ -5326,7 +5446,7 @@ <description> </description> </method> - <method name="get_treshold" qualifiers="const"> + <method name="get_threshold" qualifiers="const"> <return type="float"> </return> <description> @@ -5368,8 +5488,8 @@ <description> </description> </method> - <method name="set_treshold"> - <argument index="0" name="treshold" type="float"> + <method name="set_threshold"> + <argument index="0" name="threshold" type="float"> </argument> <description> </description> @@ -5388,7 +5508,7 @@ </member> <member name="sidechain" type="float" setter="set_sidechain" getter="get_sidechain" brief=""> </member> - <member name="treshold" type="float" setter="set_treshold" getter="get_treshold" brief=""> + <member name="threshold" type="float" setter="set_threshold" getter="get_threshold" brief=""> </member> </members> <constants> @@ -5844,7 +5964,7 @@ <description> </description> </method> - <method name="get_treshold_db" qualifiers="const"> + <method name="get_threshold_db" qualifiers="const"> <return type="float"> </return> <description> @@ -5868,8 +5988,8 @@ <description> </description> </method> - <method name="set_treshold_db"> - <argument index="0" name="treshold" type="float"> + <method name="set_threshold_db"> + <argument index="0" name="threshold" type="float"> </argument> <description> </description> @@ -5882,7 +6002,7 @@ </member> <member name="soft_clip_ratio" type="float" setter="set_soft_clip_ratio" getter="get_soft_clip_ratio" brief=""> </member> - <member name="treshold_db" type="float" setter="set_treshold_db" getter="get_treshold_db" brief=""> + <member name="threshold_db" type="float" setter="set_threshold_db" getter="get_threshold_db" brief=""> </member> </members> <constants> @@ -6230,118 +6350,6 @@ <constants> </constants> </class> -<class name="AudioPlayer" inherits="Node" category="Core"> - <brief_description> - </brief_description> - <description> - </description> - <methods> - <method name="get_bus" qualifiers="const"> - <return type="String"> - </return> - <description> - </description> - </method> - <method name="get_mix_target" qualifiers="const"> - <return type="int"> - </return> - <description> - </description> - </method> - <method name="get_pos"> - <return type="float"> - </return> - <description> - </description> - </method> - <method name="get_stream" qualifiers="const"> - <return type="Object"> - </return> - <description> - </description> - </method> - <method name="get_volume_db" qualifiers="const"> - <return type="float"> - </return> - <description> - </description> - </method> - <method name="is_autoplay_enabled"> - <return type="bool"> - </return> - <description> - </description> - </method> - <method name="is_playing" qualifiers="const"> - <return type="bool"> - </return> - <description> - </description> - </method> - <method name="play"> - <argument index="0" name="from_pos" type="float" default="0"> - </argument> - <description> - </description> - </method> - <method name="seek"> - <argument index="0" name="to_pos" type="float"> - </argument> - <description> - </description> - </method> - <method name="set_autoplay"> - <argument index="0" name="enable" type="bool"> - </argument> - <description> - </description> - </method> - <method name="set_bus"> - <argument index="0" name="bus" type="String"> - </argument> - <description> - </description> - </method> - <method name="set_mix_target"> - <argument index="0" name="mix_target" type="int"> - </argument> - <description> - </description> - </method> - <method name="set_stream"> - <argument index="0" name="stream" type="AudioStream"> - </argument> - <description> - </description> - </method> - <method name="set_volume_db"> - <argument index="0" name="volume_db" type="float"> - </argument> - <description> - </description> - </method> - <method name="stop"> - <description> - </description> - </method> - </methods> - <members> - <member name="autoplay" type="bool" setter="set_autoplay" getter="is_autoplay_enabled" brief=""> - </member> - <member name="bus" type="String" setter="set_bus" getter="get_bus" brief=""> - </member> - <member name="mix_target" type="int" setter="set_mix_target" getter="get_mix_target" brief=""> - </member> - <member name="playing" type="bool" setter="_set_playing" getter="_is_active" brief=""> - </member> - <member name="stream" type="AudioStream" setter="set_stream" getter="get_stream" brief=""> - </member> - <member name="volume_db" type="float" setter="set_volume_db" getter="get_volume_db" brief=""> - </member> - </members> - <constants> - </constants> -</class> <class name="AudioServer" inherits="Object" category="Core"> <brief_description> Server interface for low level audio access. @@ -6398,6 +6406,14 @@ <description> </description> </method> + <method name="get_bus_index" qualifiers="const"> + <return type="int"> + </return> + <argument index="0" name="bus_name" type="String"> + </argument> + <description> + </description> + </method> <method name="get_bus_name" qualifiers="const"> <return type="String"> </return> @@ -6672,6 +6688,580 @@ <constants> </constants> </class> +<class name="AudioStreamPlayer" inherits="Node" category="Core"> + <brief_description> + </brief_description> + <description> + </description> + <methods> + <method name="get_bus" qualifiers="const"> + <return type="String"> + </return> + <description> + </description> + </method> + <method name="get_mix_target" qualifiers="const"> + <return type="int"> + </return> + <description> + </description> + </method> + <method name="get_pos"> + <return type="float"> + </return> + <description> + </description> + </method> + <method name="get_stream" qualifiers="const"> + <return type="Object"> + </return> + <description> + </description> + </method> + <method name="get_volume_db" qualifiers="const"> + <return type="float"> + </return> + <description> + </description> + </method> + <method name="is_autoplay_enabled"> + <return type="bool"> + </return> + <description> + </description> + </method> + <method name="is_playing" qualifiers="const"> + <return type="bool"> + </return> + <description> + </description> + </method> + <method name="play"> + <argument index="0" name="from_pos" type="float" default="0"> + </argument> + <description> + </description> + </method> + <method name="seek"> + <argument index="0" name="to_pos" type="float"> + </argument> + <description> + </description> + </method> + <method name="set_autoplay"> + <argument index="0" name="enable" type="bool"> + </argument> + <description> + </description> + </method> + <method name="set_bus"> + <argument index="0" name="bus" type="String"> + </argument> + <description> + </description> + </method> + <method name="set_mix_target"> + <argument index="0" name="mix_target" type="int"> + </argument> + <description> + </description> + </method> + <method name="set_stream"> + <argument index="0" name="stream" type="AudioStream"> + </argument> + <description> + </description> + </method> + <method name="set_volume_db"> + <argument index="0" name="volume_db" type="float"> + </argument> + <description> + </description> + </method> + <method name="stop"> + <description> + </description> + </method> + </methods> + <members> + <member name="autoplay" type="bool" setter="set_autoplay" getter="is_autoplay_enabled" brief=""> + </member> + <member name="bus" type="String" setter="set_bus" getter="get_bus" brief=""> + </member> + <member name="mix_target" type="int" setter="set_mix_target" getter="get_mix_target" brief=""> + </member> + <member name="playing" type="bool" setter="_set_playing" getter="_is_active" brief=""> + </member> + <member name="stream" type="AudioStream" setter="set_stream" getter="get_stream" brief=""> + </member> + <member name="volume_db" type="float" setter="set_volume_db" getter="get_volume_db" brief=""> + </member> + </members> + <constants> + </constants> +</class> +<class name="AudioStreamPlayer2D" inherits="Node2D" category="Core"> + <brief_description> + </brief_description> + <description> + </description> + <methods> + <method name="get_area_mask" qualifiers="const"> + <return type="int"> + </return> + <description> + </description> + </method> + <method name="get_attenuation" qualifiers="const"> + <return type="float"> + </return> + <description> + </description> + </method> + <method name="get_bus" qualifiers="const"> + <return type="String"> + </return> + <description> + </description> + </method> + <method name="get_max_distance" qualifiers="const"> + <return type="float"> + </return> + <description> + </description> + </method> + <method name="get_pos"> + <return type="float"> + </return> + <description> + </description> + </method> + <method name="get_stream" qualifiers="const"> + <return type="Object"> + </return> + <description> + </description> + </method> + <method name="get_volume_db" qualifiers="const"> + <return type="float"> + </return> + <description> + </description> + </method> + <method name="is_autoplay_enabled"> + <return type="bool"> + </return> + <description> + </description> + </method> + <method name="is_playing" qualifiers="const"> + <return type="bool"> + </return> + <description> + </description> + </method> + <method name="play"> + <argument index="0" name="from_pos" type="float" default="0"> + </argument> + <description> + </description> + </method> + <method name="seek"> + <argument index="0" name="to_pos" type="float"> + </argument> + <description> + </description> + </method> + <method name="set_area_mask"> + <argument index="0" name="mask" type="int"> + </argument> + <description> + </description> + </method> + <method name="set_attenuation"> + <argument index="0" name="curve" type="float"> + </argument> + <description> + </description> + </method> + <method name="set_autoplay"> + <argument index="0" name="enable" type="bool"> + </argument> + <description> + </description> + </method> + <method name="set_bus"> + <argument index="0" name="bus" type="String"> + </argument> + <description> + </description> + </method> + <method name="set_max_distance"> + <argument index="0" name="pixels" type="float"> + </argument> + <description> + </description> + </method> + <method name="set_stream"> + <argument index="0" name="stream" type="AudioStream"> + </argument> + <description> + </description> + </method> + <method name="set_volume_db"> + <argument index="0" name="volume_db" type="float"> + </argument> + <description> + </description> + </method> + <method name="stop"> + <description> + </description> + </method> + </methods> + <members> + <member name="area_mask" type="int" setter="set_area_mask" getter="get_area_mask" brief=""> + </member> + <member name="attenuation" type="float" setter="set_attenuation" getter="get_attenuation" brief=""> + </member> + <member name="autoplay" type="bool" setter="set_autoplay" getter="is_autoplay_enabled" brief=""> + </member> + <member name="bus" type="String" setter="set_bus" getter="get_bus" brief=""> + </member> + <member name="max_distance" type="float" setter="set_max_distance" getter="get_max_distance" brief=""> + </member> + <member name="playing" type="bool" setter="_set_playing" getter="_is_active" brief=""> + </member> + <member name="stream" type="AudioStream" setter="set_stream" getter="get_stream" brief=""> + </member> + <member name="volume_db" type="float" setter="set_volume_db" getter="get_volume_db" brief=""> + </member> + </members> + <constants> + </constants> +</class> +<class name="AudioStreamPlayer3D" inherits="Spatial" category="Core"> + <brief_description> + </brief_description> + <description> + </description> + <methods> + <method name="get_area_mask" qualifiers="const"> + <return type="int"> + </return> + <description> + </description> + </method> + <method name="get_attenuation_filter_cutoff_hz" qualifiers="const"> + <return type="float"> + </return> + <description> + </description> + </method> + <method name="get_attenuation_filter_db" qualifiers="const"> + <return type="float"> + </return> + <description> + </description> + </method> + <method name="get_attenuation_model" qualifiers="const"> + <return type="int"> + </return> + <description> + </description> + </method> + <method name="get_bus" qualifiers="const"> + <return type="String"> + </return> + <description> + </description> + </method> + <method name="get_doppler_tracking" qualifiers="const"> + <return type="int"> + </return> + <description> + </description> + </method> + <method name="get_emission_angle" qualifiers="const"> + <return type="float"> + </return> + <description> + </description> + </method> + <method name="get_emission_angle_filter_attenuation_db" qualifiers="const"> + <return type="float"> + </return> + <description> + </description> + </method> + <method name="get_max_db" qualifiers="const"> + <return type="float"> + </return> + <description> + </description> + </method> + <method name="get_max_distance" qualifiers="const"> + <return type="float"> + </return> + <description> + </description> + </method> + <method name="get_out_of_range_mode" qualifiers="const"> + <return type="int"> + </return> + <description> + </description> + </method> + <method name="get_pos"> + <return type="float"> + </return> + <description> + </description> + </method> + <method name="get_stream" qualifiers="const"> + <return type="Object"> + </return> + <description> + </description> + </method> + <method name="get_unit_db" qualifiers="const"> + <return type="float"> + </return> + <description> + </description> + </method> + <method name="get_unit_size" qualifiers="const"> + <return type="float"> + </return> + <description> + </description> + </method> + <method name="is_autoplay_enabled"> + <return type="bool"> + </return> + <description> + </description> + </method> + <method name="is_emission_angle_enabled" qualifiers="const"> + <return type="bool"> + </return> + <description> + </description> + </method> + <method name="is_playing" qualifiers="const"> + <return type="bool"> + </return> + <description> + </description> + </method> + <method name="play"> + <argument index="0" name="from_pos" type="float" default="0"> + </argument> + <description> + </description> + </method> + <method name="seek"> + <argument index="0" name="to_pos" type="float"> + </argument> + <description> + </description> + </method> + <method name="set_area_mask"> + <argument index="0" name="mask" type="int"> + </argument> + <description> + </description> + </method> + <method name="set_attenuation_filter_cutoff_hz"> + <argument index="0" name="degrees" type="float"> + </argument> + <description> + </description> + </method> + <method name="set_attenuation_filter_db"> + <argument index="0" name="db" type="float"> + </argument> + <description> + </description> + </method> + <method name="set_attenuation_model"> + <argument index="0" name="model" type="int"> + </argument> + <description> + </description> + </method> + <method name="set_autoplay"> + <argument index="0" name="enable" type="bool"> + </argument> + <description> + </description> + </method> + <method name="set_bus"> + <argument index="0" name="bus" type="String"> + </argument> + <description> + </description> + </method> + <method name="set_doppler_tracking"> + <argument index="0" name="mode" type="int"> + </argument> + <description> + </description> + </method> + <method name="set_emission_angle"> + <argument index="0" name="degrees" type="float"> + </argument> + <description> + </description> + </method> + <method name="set_emission_angle_enabled"> + <argument index="0" name="enabled" type="bool"> + </argument> + <description> + </description> + </method> + <method name="set_emission_angle_filter_attenuation_db"> + <argument index="0" name="db" type="float"> + </argument> + <description> + </description> + </method> + <method name="set_max_db"> + <argument index="0" name="max_db" type="float"> + </argument> + <description> + </description> + </method> + <method name="set_max_distance"> + <argument index="0" name="metres" type="float"> + </argument> + <description> + </description> + </method> + <method name="set_out_of_range_mode"> + <argument index="0" name="mode" type="int"> + </argument> + <description> + </description> + </method> + <method name="set_stream"> + <argument index="0" name="stream" type="AudioStream"> + </argument> + <description> + </description> + </method> + <method name="set_unit_db"> + <argument index="0" name="unit_db" type="float"> + </argument> + <description> + </description> + </method> + <method name="set_unit_size"> + <argument index="0" name="unit_size" type="float"> + </argument> + <description> + </description> + </method> + <method name="stop"> + <description> + </description> + </method> + </methods> + <members> + <member name="area_mask" type="int" setter="set_area_mask" getter="get_area_mask" brief=""> + </member> + <member name="attenuation_filter_cutoff_hz" type="float" setter="set_attenuation_filter_cutoff_hz" getter="get_attenuation_filter_cutoff_hz" brief=""> + </member> + <member name="attenuation_filter_db" type="float" setter="set_attenuation_filter_db" getter="get_attenuation_filter_db" brief=""> + </member> + <member name="attenuation_model" type="int" setter="set_attenuation_model" getter="get_attenuation_model" brief=""> + </member> + <member name="autoplay" type="bool" setter="set_autoplay" getter="is_autoplay_enabled" brief=""> + </member> + <member name="bus" type="String" setter="set_bus" getter="get_bus" brief=""> + </member> + <member name="doppler_tracking" type="int" setter="set_doppler_tracking" getter="get_doppler_tracking" brief=""> + </member> + <member name="emission_angle_degrees" type="float" setter="set_emission_angle" getter="get_emission_angle" brief=""> + </member> + <member name="emission_angle_enabled" type="bool" setter="set_emission_angle_enabled" getter="is_emission_angle_enabled" brief=""> + </member> + <member name="emission_angle_filter_attenuation_db" type="float" setter="set_emission_angle_filter_attenuation_db" getter="get_emission_angle_filter_attenuation_db" brief=""> + </member> + <member name="max_db" type="float" setter="set_max_db" getter="get_max_db" brief=""> + </member> + <member name="max_distance" type="float" setter="set_max_distance" getter="get_max_distance" brief=""> + </member> + <member name="out_of_range_mode" type="int" setter="set_out_of_range_mode" getter="get_out_of_range_mode" brief=""> + </member> + <member name="playing" type="bool" setter="_set_playing" getter="_is_active" brief=""> + </member> + <member name="stream" type="AudioStream" setter="set_stream" getter="get_stream" brief=""> + </member> + <member name="unit_db" type="float" setter="set_unit_db" getter="get_unit_db" brief=""> + </member> + <member name="unit_size" type="float" setter="set_unit_size" getter="get_unit_size" brief=""> + </member> + </members> + <constants> + <constant name="ATTENUATION_INVERSE_DISTANCE" value="0"> + </constant> + <constant name="ATTENUATION_INVERSE_SQUARE_DISTANCE" value="1"> + </constant> + <constant name="ATTENUATION_LOGARITHMIC" value="2"> + </constant> + <constant name="OUT_OF_RANGE_MIX" value="0"> + </constant> + <constant name="OUT_OF_RANGE_PAUSE" value="1"> + </constant> + <constant name="DOPPLER_TRACKING_DISABLED" value="0"> + </constant> + <constant name="DOPPLER_TRACKING_IDLE_STEP" value="1"> + </constant> + <constant name="DOPPLER_TRACKING_FIXED_STEP" value="2"> + </constant> + </constants> +</class> +<class name="AudioStreamRandomPitch" inherits="AudioStream" category="Core"> + <brief_description> + </brief_description> + <description> + </description> + <methods> + <method name="get_audio_stream" qualifiers="const"> + <return type="Object"> + </return> + <description> + </description> + </method> + <method name="get_random_pitch" qualifiers="const"> + <return type="float"> + </return> + <description> + </description> + </method> + <method name="set_audio_stream"> + <argument index="0" name="stream" type="Object"> + </argument> + <description> + </description> + </method> + <method name="set_random_pitch"> + <argument index="0" name="scale" type="float"> + </argument> + <description> + </description> + </method> + </methods> + <members> + <member name="audio_stream" type="AudioStream" setter="set_audio_stream" getter="get_audio_stream" brief=""> + </member> + <member name="random_pitch" type="float" setter="set_random_pitch" getter="get_random_pitch" brief=""> + </member> + </members> + <constants> + </constants> +</class> <class name="AudioStreamSample" inherits="AudioStream" category="Core"> <brief_description> </brief_description> @@ -7705,6 +8295,12 @@ <description> </description> </method> + <method name="get_doppler_tracking" qualifiers="const"> + <return type="int"> + </return> + <description> + </description> + </method> <method name="get_environment" qualifiers="const"> <return type="Environment"> </return> @@ -7819,6 +8415,12 @@ <description> </description> </method> + <method name="set_doppler_tracking"> + <argument index="0" name="mode" type="int"> + </argument> + <description> + </description> + </method> <method name="set_environment"> <argument index="0" name="env" type="Environment"> </argument> @@ -7886,6 +8488,12 @@ </constant> <constant name="KEEP_HEIGHT" value="1"> </constant> + <constant name="DOPPLER_TRACKING_DISABLED" value="0"> + </constant> + <constant name="DOPPLER_TRACKING_IDLE_STEP" value="1"> + </constant> + <constant name="DOPPLER_TRACKING_FIXED_STEP" value="2"> + </constant> </constants> </class> <class name="Camera2D" inherits="Node2D" category="Core"> @@ -8004,18 +8612,36 @@ <description> </description> </method> + <method name="is_limit_drawing_enabled" qualifiers="const"> + <return type="bool"> + </return> + <description> + </description> + </method> <method name="is_limit_smoothing_enabled" qualifiers="const"> <return type="bool"> </return> <description> </description> </method> + <method name="is_margin_drawing_enabled" qualifiers="const"> + <return type="bool"> + </return> + <description> + </description> + </method> <method name="is_rotating" qualifiers="const"> <return type="bool"> </return> <description> </description> </method> + <method name="is_screen_drawing_enabled" qualifiers="const"> + <return type="bool"> + </return> + <description> + </description> + </method> <method name="is_v_drag_enabled" qualifiers="const"> <return type="bool"> </return> @@ -8087,6 +8713,12 @@ Set the scrolling limit in pixels. </description> </method> + <method name="set_limit_drawing_enabled"> + <argument index="0" name="limit_drawing_enabled" type="bool"> + </argument> + <description> + </description> + </method> <method name="set_limit_smoothing_enabled"> <argument index="0" name="limit_smoothing_enabled" type="bool"> </argument> @@ -8095,6 +8727,12 @@ This requires camera smoothing being enabled to have a noticeable effect. </description> </method> + <method name="set_margin_drawing_enabled"> + <argument index="0" name="margin_drawing_enabled" type="bool"> + </argument> + <description> + </description> + </method> <method name="set_offset"> <argument index="0" name="offset" type="Vector2"> </argument> @@ -8108,6 +8746,12 @@ <description> </description> </method> + <method name="set_screen_drawing_enabled"> + <argument index="0" name="screen_drawing_enabled" type="bool"> + </argument> + <description> + </description> + </method> <method name="set_v_drag_enabled"> <argument index="0" name="enabled" type="bool"> </argument> @@ -8144,6 +8788,12 @@ </member> <member name="drag_margin_v_enabled" type="bool" setter="set_v_drag_enabled" getter="is_v_drag_enabled" brief=""> </member> + <member name="editor_draw_drag_margin" type="bool" setter="set_margin_drawing_enabled" getter="is_margin_drawing_enabled" brief=""> + </member> + <member name="editor_draw_limits" type="bool" setter="set_limit_drawing_enabled" getter="is_limit_drawing_enabled" brief=""> + </member> + <member name="editor_draw_screen" type="bool" setter="set_screen_drawing_enabled" getter="is_screen_drawing_enabled" brief=""> + </member> <member name="limit_bottom" type="int" setter="set_limit" getter="get_limit" brief=""> </member> <member name="limit_left" type="int" setter="set_limit" getter="get_limit" brief=""> @@ -8226,6 +8876,8 @@ </argument> <argument index="3" name="texture" type="Texture" default="NULL"> </argument> + <argument index="4" name="normal_map" type="Texture" default="NULL"> + </argument> <description> Draw a colored polygon of any amount of points, convex or concave. </description> @@ -8254,10 +8906,36 @@ </argument> <argument index="3" name="texture" type="Texture" default="NULL"> </argument> + <argument index="4" name="normal_map" type="Texture" default="NULL"> + </argument> <description> Draw a polygon of any amount of points, convex or concave. </description> </method> + <method name="draw_polyline"> + <argument index="0" name="points" type="PoolVector2Array"> + </argument> + <argument index="1" name="color" type="Color"> + </argument> + <argument index="2" name="width" type="float" default="1"> + </argument> + <argument index="3" name="antialiased" type="bool" default="false"> + </argument> + <description> + </description> + </method> + <method name="draw_polyline_colors"> + <argument index="0" name="points" type="PoolVector2Array"> + </argument> + <argument index="1" name="colors" type="PoolColorArray"> + </argument> + <argument index="2" name="width" type="float" default="1"> + </argument> + <argument index="3" name="antialiased" type="bool" default="false"> + </argument> + <description> + </description> + </method> <method name="draw_primitive"> <argument index="0" name="points" type="PoolVector2Array"> </argument> @@ -8269,6 +8947,8 @@ </argument> <argument index="4" name="width" type="float" default="1"> </argument> + <argument index="5" name="normal_map" type="Texture" default="NULL"> + </argument> <description> Draw a custom primitive, 1 point for a point, 2 points for a line, 3 points for a triangle and 4 points for a quad. </description> @@ -8278,6 +8958,8 @@ </argument> <argument index="1" name="color" type="Color"> </argument> + <argument index="2" name="filled" type="bool" default="true"> + </argument> <description> Draw a colored rectangle. </description> @@ -8330,6 +9012,8 @@ </argument> <argument index="2" name="modulate" type="Color" default="Color(1,1,1,1)"> </argument> + <argument index="3" name="normal_map" type="Texture" default="NULL"> + </argument> <description> Draw a texture at a given position. </description> @@ -8345,6 +9029,8 @@ </argument> <argument index="4" name="transpose" type="bool" default="false"> </argument> + <argument index="5" name="normal_map" type="Texture" default="NULL"> + </argument> <description> Draw a textured rectangle at a given position, optionally modulated by a color. Transpose swaps the x and y coordinates when reading the texture. </description> @@ -8360,6 +9046,10 @@ </argument> <argument index="4" name="transpose" type="bool" default="false"> </argument> + <argument index="5" name="normal_map" type="Texture" default="NULL"> + </argument> + <argument index="6" name="clip_uv" type="bool" default="true"> + </argument> <description> Draw a textured rectangle region at a given position, optionally modulated by a color. Transpose swaps the x and y coordinates when reading the texture. </description> @@ -8462,7 +9152,7 @@ </description> </method> <method name="get_material" qualifiers="const"> - <return type="ShaderMaterial"> + <return type="Material"> </return> <description> Get the material of this item. @@ -8599,7 +9289,7 @@ </description> </method> <method name="set_material"> - <argument index="0" name="material" type="ShaderMaterial"> + <argument index="0" name="material" type="Material"> </argument> <description> Set the material of this item. @@ -8660,7 +9350,7 @@ <members> <member name="light_mask" type="int" setter="set_light_mask" getter="get_light_mask" brief=""> </member> - <member name="material" type="ShaderMaterial" setter="set_material" getter="get_material" brief=""> + <member name="material" type="ShaderMaterial,CanvasItemMaterial" setter="set_material" getter="get_material" brief=""> </member> <member name="modulate" type="Color" setter="set_modulate" getter="get_modulate" brief=""> </member> @@ -8730,6 +9420,62 @@ </constant> </constants> </class> +<class name="CanvasItemMaterial" inherits="Material" category="Core"> + <brief_description> + </brief_description> + <description> + </description> + <methods> + <method name="get_blend_mode" qualifiers="const"> + <return type="int"> + </return> + <description> + </description> + </method> + <method name="get_light_mode" qualifiers="const"> + <return type="int"> + </return> + <description> + </description> + </method> + <method name="set_blend_mode"> + <argument index="0" name="blend_mode" type="int"> + </argument> + <description> + </description> + </method> + <method name="set_light_mode"> + <argument index="0" name="light_mode" type="int"> + </argument> + <description> + </description> + </method> + </methods> + <members> + <member name="blend_mode" type="int" setter="set_blend_mode" getter="get_blend_mode" brief=""> + </member> + <member name="light_mode" type="int" setter="set_light_mode" getter="get_light_mode" brief=""> + </member> + </members> + <constants> + <constant name="BLEND_MODE_MIX" value="0"> + </constant> + <constant name="BLEND_MODE_ADD" value="1"> + </constant> + <constant name="BLEND_MODE_SUB" value="2"> + </constant> + <constant name="BLEND_MODE_MUL" value="3"> + </constant> + <constant name="BLEND_MODE_PREMULT_ALPHA" value="4"> + </constant> + <constant name="LIGHT_MODE_NORMAL" value="0"> + </constant> + <constant name="LIGHT_MODE_UNSHADED" value="1"> + </constant> + <constant name="LIGHT_MODE_LIGHT_ONLY" value="2"> + </constant> + </constants> +</class> <class name="CanvasLayer" inherits="Node" category="Core"> <brief_description> Canvas Item layer. @@ -9409,18 +10155,6 @@ <description> </description> </method> - <method name="add_shape"> - <argument index="0" name="shape" type="Shape"> - </argument> - <argument index="1" name="transform" type="Transform" default="Transform()"> - </argument> - <description> - </description> - </method> - <method name="clear_shapes"> - <description> - </description> - </method> <method name="get_capture_input_on_drag" qualifiers="const"> <return type="bool"> </return> @@ -9433,48 +10167,12 @@ <description> </description> </method> - <method name="get_shape" qualifiers="const"> - <return type="Shape"> - </return> - <argument index="0" name="shape_idx" type="int"> - </argument> - <description> - </description> - </method> - <method name="get_shape_count" qualifiers="const"> - <return type="int"> - </return> - <description> - </description> - </method> - <method name="get_shape_transform" qualifiers="const"> - <return type="Transform"> - </return> - <argument index="0" name="shape_idx" type="int"> - </argument> - <description> - </description> - </method> <method name="is_ray_pickable" qualifiers="const"> <return type="bool"> </return> <description> </description> </method> - <method name="is_shape_set_as_trigger" qualifiers="const"> - <return type="bool"> - </return> - <argument index="0" name="shape_idx" type="int"> - </argument> - <description> - </description> - </method> - <method name="remove_shape"> - <argument index="0" name="shape_idx" type="int"> - </argument> - <description> - </description> - </method> <method name="set_capture_input_on_drag"> <argument index="0" name="enable" type="bool"> </argument> @@ -9487,30 +10185,6 @@ <description> </description> </method> - <method name="set_shape"> - <argument index="0" name="shape_idx" type="int"> - </argument> - <argument index="1" name="shape" type="Shape"> - </argument> - <description> - </description> - </method> - <method name="set_shape_as_trigger"> - <argument index="0" name="shape_idx" type="int"> - </argument> - <argument index="1" name="enable" type="bool"> - </argument> - <description> - </description> - </method> - <method name="set_shape_transform"> - <argument index="0" name="shape_idx" type="int"> - </argument> - <argument index="1" name="transform" type="Transform"> - </argument> - <description> - </description> - </method> </methods> <members> <member name="input_capture_on_drag" type="bool" setter="set_capture_input_on_drag" getter="get_capture_input_on_drag" brief=""> @@ -9563,20 +10237,6 @@ <description> </description> </method> - <method name="add_shape"> - <argument index="0" name="shape" type="Shape2D"> - </argument> - <argument index="1" name="transform" type="Transform2D" default="((1, 0), (0, 1), (0, 0))"> - </argument> - <description> - Add a [Shape2D] to the collision body, with a given custom transform. - </description> - </method> - <method name="clear_shapes"> - <description> - Remove all shapes. - </description> - </method> <method name="get_rid" qualifiers="const"> <return type="RID"> </return> @@ -9584,31 +10244,6 @@ Return the RID of this object. </description> </method> - <method name="get_shape" qualifiers="const"> - <return type="Shape2D"> - </return> - <argument index="0" name="shape_idx" type="int"> - </argument> - <description> - Return the shape in the given index. - </description> - </method> - <method name="get_shape_count" qualifiers="const"> - <return type="int"> - </return> - <description> - Return the amount of shapes in the collision body. Because a [CollisionPolygon2D] can generate more than one [Shape2D], the amount returned does not have to match the sum of [CollisionShape2D] and [CollisionPolygon2D]. - </description> - </method> - <method name="get_shape_transform" qualifiers="const"> - <return type="Transform2D"> - </return> - <argument index="0" name="shape_idx" type="int"> - </argument> - <description> - Return the shape transform in the given index. - </description> - </method> <method name="is_pickable" qualifiers="const"> <return type="bool"> </return> @@ -9616,22 +10251,6 @@ Return whether this object is pickable. </description> </method> - <method name="is_shape_set_as_trigger" qualifiers="const"> - <return type="bool"> - </return> - <argument index="0" name="shape_idx" type="int"> - </argument> - <description> - Return whether a shape is a trigger. A trigger shape detects collisions, but is otherwise unaffected by physics (i.e. colliding objects will not get blocked). - </description> - </method> - <method name="remove_shape"> - <argument index="0" name="shape_idx" type="int"> - </argument> - <description> - Remove the shape in the given index. - </description> - </method> <method name="set_pickable"> <argument index="0" name="enabled" type="bool"> </argument> @@ -9639,33 +10258,6 @@ Set whether this object is pickable. A pickable object can detect the mouse pointer enter/leave it and, if the mouse is inside it, report input events. </description> </method> - <method name="set_shape"> - <argument index="0" name="shape_idx" type="int"> - </argument> - <argument index="1" name="shape" type="Shape"> - </argument> - <description> - Change a shape in the collision body. - </description> - </method> - <method name="set_shape_as_trigger"> - <argument index="0" name="shape_idx" type="int"> - </argument> - <argument index="1" name="enable" type="bool"> - </argument> - <description> - Set whether a shape is a trigger. A trigger shape detects collisions, but is otherwise unaffected by physics (i.e. colliding objects will not get blocked). - </description> - </method> - <method name="set_shape_transform"> - <argument index="0" name="shape_idx" type="int"> - </argument> - <argument index="1" name="transform" type="Transform2D"> - </argument> - <description> - Change the shape transform in the collision body. - </description> - </method> </methods> <members> <member name="input_pickable" type="bool" setter="set_pickable" getter="is_pickable" brief=""> @@ -9702,24 +10294,6 @@ <description> </description> <methods> - <method name="get_build_mode" qualifiers="const"> - <return type="int"> - </return> - <description> - </description> - </method> - <method name="get_collision_object_first_shape" qualifiers="const"> - <return type="int"> - </return> - <description> - </description> - </method> - <method name="get_collision_object_last_shape" qualifiers="const"> - <return type="int"> - </return> - <description> - </description> - </method> <method name="get_depth" qualifiers="const"> <return type="float"> </return> @@ -9732,9 +10306,9 @@ <description> </description> </method> - <method name="set_build_mode"> - <argument index="0" name="build_mode" type="int"> - </argument> + <method name="is_disabled" qualifiers="const"> + <return type="bool"> + </return> <description> </description> </method> @@ -9744,6 +10318,12 @@ <description> </description> </method> + <method name="set_disabled"> + <argument index="0" name="disabled" type="bool"> + </argument> + <description> + </description> + </method> <method name="set_polygon"> <argument index="0" name="polygon" type="PoolVector2Array"> </argument> @@ -9752,13 +10332,11 @@ </method> </methods> <members> - <member name="build_mode" type="int" setter="set_build_mode" getter="get_build_mode" brief=""> - </member> <member name="depth" type="float" setter="set_depth" getter="get_depth" brief=""> </member> - <member name="polygon" type="PoolVector2Array" setter="set_polygon" getter="get_polygon" brief=""> + <member name="disabled" type="bool" setter="set_disabled" getter="is_disabled" brief=""> </member> - <member name="shape_range" type="Vector2" setter="_set_shape_range" getter="_get_shape_range" brief=""> + <member name="polygon" type="PoolVector2Array" setter="set_polygon" getter="get_polygon" brief=""> </member> </members> <constants> @@ -9779,34 +10357,23 @@ Return whether the polygon is a [ConvexPolygonShape2D] ([code]build_mode==0[/code]), or a [ConcavePolygonShape2D] ([code]build_mode==1[/code]). </description> </method> - <method name="get_collision_object_first_shape" qualifiers="const"> - <return type="int"> - </return> - <description> - Return the index of the first shape generated by the editor. - When [code]build_mode[/code] is set to generate convex polygons, the shape shown in the editor may be decomposed into many convex polygons. In that case, a range of indexes is needed to directly access the [Shape2D]. - When [code]build_mode[/code] is set to generate concave polygons, there is only one [Shape2D] generated, so the start index and the end index are the same. - </description> - </method> - <method name="get_collision_object_last_shape" qualifiers="const"> - <return type="int"> + <method name="get_polygon" qualifiers="const"> + <return type="PoolVector2Array"> </return> <description> - Return the index of the last shape generated by the editor. + Return the list of points that define the polygon. </description> </method> - <method name="get_polygon" qualifiers="const"> - <return type="PoolVector2Array"> + <method name="is_disabled" qualifiers="const"> + <return type="bool"> </return> <description> - Return the list of points that define the polygon. </description> </method> - <method name="is_trigger" qualifiers="const"> + <method name="is_one_way_collision_enabled" qualifiers="const"> <return type="bool"> </return> <description> - Return whether this polygon is a trigger. </description> </method> <method name="set_build_mode"> @@ -9816,30 +10383,35 @@ Set whether the polygon is to be a [ConvexPolygonShape2D] ([code]build_mode==0[/code]), or a [ConcavePolygonShape2D] ([code]build_mode==1[/code]). </description> </method> - <method name="set_polygon"> - <argument index="0" name="polygon" type="PoolVector2Array"> + <method name="set_disabled"> + <argument index="0" name="disabled" type="bool"> </argument> <description> - Set the array of points forming the polygon. - When editing the point list via the editor, depending on [method get_build_mode], it has to be a list of points (for [code]build_mode==0[/code]), or a list of lines (for [code]build_mode==1[/code]). In the second case, the even elements of the array define the start point of the line, and the odd elements the end point. </description> </method> - <method name="set_trigger"> - <argument index="0" name="trigger" type="bool"> + <method name="set_one_way_collision"> + <argument index="0" name="enabled" type="bool"> </argument> <description> - Set whether this polygon is a trigger. A trigger polygon detects collisions, but is otherwise unaffected by physics (i.e. colliding objects will not get blocked). + </description> + </method> + <method name="set_polygon"> + <argument index="0" name="polygon" type="PoolVector2Array"> + </argument> + <description> + Set the array of points forming the polygon. + When editing the point list via the editor, depending on [method get_build_mode], it has to be a list of points (for [code]build_mode==0[/code]), or a list of lines (for [code]build_mode==1[/code]). In the second case, the even elements of the array define the start point of the line, and the odd elements the end point. </description> </method> </methods> <members> <member name="build_mode" type="int" setter="set_build_mode" getter="get_build_mode" brief=""> </member> - <member name="polygon" type="PoolVector2Array" setter="set_polygon" getter="get_polygon" brief=""> + <member name="disabled" type="bool" setter="set_disabled" getter="is_disabled" brief=""> </member> - <member name="shape_range" type="Vector2" setter="_set_shape_range" getter="_get_shape_range" brief=""> + <member name="one_way_collision" type="bool" setter="set_one_way_collision" getter="is_one_way_collision_enabled" brief=""> </member> - <member name="trigger" type="bool" setter="set_trigger" getter="is_trigger" brief=""> + <member name="polygon" type="PoolVector2Array" setter="set_polygon" getter="get_polygon" brief=""> </member> </members> <constants> @@ -9851,19 +10423,13 @@ <description> </description> <methods> - <method name="get_collision_object_shape_index" qualifiers="const"> - <return type="int"> - </return> - <description> - </description> - </method> <method name="get_shape" qualifiers="const"> <return type="Object"> </return> <description> </description> </method> - <method name="is_trigger" qualifiers="const"> + <method name="is_disabled" qualifiers="const"> <return type="bool"> </return> <description> @@ -9879,26 +10445,24 @@ <description> </description> </method> - <method name="set_shape"> - <argument index="0" name="shape" type="Object"> + <method name="set_disabled"> + <argument index="0" name="enable" type="bool"> </argument> <description> </description> </method> - <method name="set_trigger"> - <argument index="0" name="enable" type="bool"> + <method name="set_shape"> + <argument index="0" name="shape" type="Object"> </argument> <description> </description> </method> </methods> <members> - <member name="_update_shape_index" type="int" setter="_set_update_shape_index" getter="_get_update_shape_index" brief=""> + <member name="disabled" type="bool" setter="set_disabled" getter="is_disabled" brief=""> </member> <member name="shape" type="Shape" setter="set_shape" getter="get_shape" brief=""> </member> - <member name="trigger" type="bool" setter="set_trigger" getter="is_trigger" brief=""> - </member> </members> <constants> </constants> @@ -9911,48 +10475,51 @@ Editor-only class. This is not present when running the game. It's used in the editor to properly edit and position collision shapes in [CollisionObject2D]. This is not accessible from regular code. </description> <methods> - <method name="get_collision_object_shape_index" qualifiers="const"> - <return type="int"> + <method name="get_shape" qualifiers="const"> + <return type="Object"> </return> <description> - Return the index of this shape inside its container [CollisionObject2D]. This can be used to directly access the underlying [Shape2D]. + Return this shape's [Shape2D]. </description> </method> - <method name="get_shape" qualifiers="const"> - <return type="Object"> + <method name="is_disabled" qualifiers="const"> + <return type="bool"> </return> <description> - Return this shape's [Shape2D]. </description> </method> - <method name="is_trigger" qualifiers="const"> + <method name="is_one_way_collision_enabled" qualifiers="const"> <return type="bool"> </return> <description> - Return whether this shape is a trigger. </description> </method> - <method name="set_shape"> - <argument index="0" name="shape" type="Object"> + <method name="set_disabled"> + <argument index="0" name="disabled" type="bool"> </argument> <description> - Set this shape's [Shape2D]. This will not appear as a node, but can be directly edited as a property. </description> </method> - <method name="set_trigger"> - <argument index="0" name="enable" type="bool"> + <method name="set_one_way_collision"> + <argument index="0" name="enabled" type="bool"> </argument> <description> - Set whether this shape is a trigger. A trigger shape detects collisions, but is otherwise unaffected by physics (i.e. will not block movement of colliding objects). + </description> + </method> + <method name="set_shape"> + <argument index="0" name="shape" type="Object"> + </argument> + <description> + Set this shape's [Shape2D]. This will not appear as a node, but can be directly edited as a property. </description> </method> </methods> <members> - <member name="_update_shape_index" type="int" setter="_set_update_shape_index" getter="_get_update_shape_index" brief=""> + <member name="disabled" type="bool" setter="set_disabled" getter="is_disabled" brief=""> </member> - <member name="shape" type="Shape2D" setter="set_shape" getter="get_shape" brief=""> + <member name="one_way_collision" type="bool" setter="set_one_way_collision" getter="is_one_way_collision_enabled" brief=""> </member> - <member name="trigger" type="bool" setter="set_trigger" getter="is_trigger" brief=""> + <member name="shape" type="Shape2D" setter="set_shape" getter="get_shape" brief=""> </member> </members> <constants> @@ -10822,6 +11389,12 @@ Return position and size of the Control, relative to the top-left corner of the [i]window[/i] Control. This is a helper (see [method get_global_pos], [method get_size]). </description> </method> + <method name="get_h_grow_direction" qualifiers="const"> + <return type="int"> + </return> + <description> + </description> + </method> <method name="get_h_size_flags" qualifiers="const"> <return type="int"> </return> @@ -10874,6 +11447,12 @@ <description> </description> </method> + <method name="get_pivot_offset" qualifiers="const"> + <return type="Vector2"> + </return> + <description> + </description> + </method> <method name="get_position" qualifiers="const"> <return type="Vector2"> </return> @@ -10948,6 +11527,12 @@ Return the tooltip, which will appear when the cursor is resting over this control. </description> </method> + <method name="get_v_grow_direction" qualifiers="const"> + <return type="int"> + </return> + <description> + </description> + </method> <method name="get_v_size_flags" qualifiers="const"> <return type="int"> </return> @@ -11180,6 +11765,12 @@ Move the Control to a new position, relative to the top-left corner of the [i]window[/i] Control, and without changing current anchor mode. (see [method set_margin]). </description> </method> + <method name="set_h_grow_direction"> + <argument index="0" name="direction" type="int"> + </argument> + <description> + </description> + </method> <method name="set_h_size_flags"> <argument index="0" name="flags" type="int"> </argument> @@ -11203,6 +11794,12 @@ Set when the control is ignoring mouse events (even touchpad events send mouse events). (see the MOUSE_FILTER_* constants) </description> </method> + <method name="set_pivot_offset"> + <argument index="0" name="pivot_offset" type="Vector2"> + </argument> + <description> + </description> + </method> <method name="set_position"> <argument index="0" name="pos" type="Vector2"> </argument> @@ -11258,6 +11855,12 @@ Set a tooltip, which will appear when the cursor is resting over this control. </description> </method> + <method name="set_v_grow_direction"> + <argument index="0" name="direction" type="int"> + </argument> + <description> + </description> + </method> <method name="set_v_size_flags"> <argument index="0" name="flags" type="int"> </argument> @@ -11296,6 +11899,10 @@ </member> <member name="focus_neighbour_top" type="NodePath" setter="set_focus_neighbour" getter="get_focus_neighbour" brief=""> </member> + <member name="grow_horizontal" type="int" setter="set_h_grow_direction" getter="get_h_grow_direction" brief=""> + </member> + <member name="grow_vertical" type="int" setter="set_v_grow_direction" getter="get_v_grow_direction" brief=""> + </member> <member name="hint_tooltip" type="String" setter="set_tooltip" getter="_get_tooltip" brief=""> </member> <member name="margin_bottom" type="int" setter="set_margin" getter="get_margin" brief=""> @@ -11312,6 +11919,8 @@ </member> <member name="rect_min_size" type="Vector2" setter="set_custom_minimum_size" getter="get_custom_minimum_size" brief=""> </member> + <member name="rect_pivot_offset" type="Vector2" setter="set_pivot_offset" getter="get_pivot_offset" brief=""> + </member> <member name="rect_position" type="Vector2" setter="set_position" getter="get_position" brief=""> </member> <member name="rect_rotation" type="float" setter="set_rotation_deg" getter="get_rotation_deg" brief=""> @@ -11455,12 +12064,20 @@ </constant> <constant name="SIZE_EXPAND_FILL" value="3"> </constant> + <constant name="SIZE_SHRINK_CENTER" value="4"> + </constant> + <constant name="SIZE_SHRINK_END" value="8"> + </constant> <constant name="MOUSE_FILTER_STOP" value="0"> </constant> <constant name="MOUSE_FILTER_PASS" value="1"> </constant> <constant name="MOUSE_FILTER_IGNORE" value="2"> </constant> + <constant name="GROW_DIRECTION_BEGIN" value="0"> + </constant> + <constant name="GROW_DIRECTION_END" value="1"> + </constant> </constants> </class> <class name="ConvexPolygonShape" inherits="Shape" category="Core"> @@ -11697,6 +12314,206 @@ <constants> </constants> </class> +<class name="Curve" inherits="Resource" category="Core"> + <brief_description> + </brief_description> + <description> + </description> + <methods> + <method name="add_point"> + <return type="int"> + </return> + <argument index="0" name="pos" type="Vector2"> + </argument> + <argument index="1" name="left_tangent" type="float" default="0"> + </argument> + <argument index="2" name="right_tangent" type="float" default="0"> + </argument> + <argument index="3" name="left_mode" type="int" default="0"> + </argument> + <argument index="4" name="right_mode" type="int" default="0"> + </argument> + <description> + </description> + </method> + <method name="bake"> + <description> + </description> + </method> + <method name="clean_dupes"> + <description> + </description> + </method> + <method name="clear_points"> + <description> + </description> + </method> + <method name="get_bake_resolution" qualifiers="const"> + <return type="int"> + </return> + <description> + </description> + </method> + <method name="get_max_value" qualifiers="const"> + <return type="float"> + </return> + <description> + </description> + </method> + <method name="get_min_value" qualifiers="const"> + <return type="float"> + </return> + <description> + </description> + </method> + <method name="get_point_left_mode" qualifiers="const"> + <return type="int"> + </return> + <argument index="0" name="index" type="int"> + </argument> + <description> + </description> + </method> + <method name="get_point_left_tangent" qualifiers="const"> + <return type="float"> + </return> + <argument index="0" name="index" type="int"> + </argument> + <description> + </description> + </method> + <method name="get_point_pos" qualifiers="const"> + <return type="Vector2"> + </return> + <argument index="0" name="index" type="int"> + </argument> + <description> + </description> + </method> + <method name="get_point_right_mode" qualifiers="const"> + <return type="int"> + </return> + <argument index="0" name="index" type="int"> + </argument> + <description> + </description> + </method> + <method name="get_point_right_tangent" qualifiers="const"> + <return type="float"> + </return> + <argument index="0" name="index" type="int"> + </argument> + <description> + </description> + </method> + <method name="interpolate" qualifiers="const"> + <return type="float"> + </return> + <argument index="0" name="offset" type="float"> + </argument> + <description> + </description> + </method> + <method name="interpolate_baked"> + <return type="float"> + </return> + <argument index="0" name="offset" type="float"> + </argument> + <description> + </description> + </method> + <method name="remove_point"> + <argument index="0" name="index" type="int"> + </argument> + <description> + </description> + </method> + <method name="set_bake_resolution"> + <argument index="0" name="resolution" type="int"> + </argument> + <description> + </description> + </method> + <method name="set_max_value"> + <argument index="0" name="max" type="float"> + </argument> + <description> + </description> + </method> + <method name="set_min_value"> + <argument index="0" name="min" type="float"> + </argument> + <description> + </description> + </method> + <method name="set_point_left_mode"> + <argument index="0" name="index" type="int"> + </argument> + <argument index="1" name="mode" type="int"> + </argument> + <description> + </description> + </method> + <method name="set_point_left_tangent"> + <argument index="0" name="index" type="int"> + </argument> + <argument index="1" name="tangent" type="float"> + </argument> + <description> + </description> + </method> + <method name="set_point_offset"> + <argument index="0" name="index" type="int"> + </argument> + <argument index="1" name="offset" type="float"> + </argument> + <description> + </description> + </method> + <method name="set_point_right_mode"> + <argument index="0" name="index" type="int"> + </argument> + <argument index="1" name="mode" type="int"> + </argument> + <description> + </description> + </method> + <method name="set_point_right_tangent"> + <argument index="0" name="index" type="int"> + </argument> + <argument index="1" name="tangent" type="float"> + </argument> + <description> + </description> + </method> + <method name="set_point_value"> + <argument index="0" name="index" type="int"> + </argument> + <argument index="1" name="y" type="float"> + </argument> + <description> + </description> + </method> + </methods> + <members> + <member name="_data" type="int" setter="_set_data" getter="_get_data" brief=""> + </member> + <member name="bake_resolution" type="int" setter="set_bake_resolution" getter="get_bake_resolution" brief=""> + </member> + <member name="max_value" type="float" setter="set_max_value" getter="get_max_value" brief=""> + </member> + <member name="min_value" type="float" setter="set_min_value" getter="get_min_value" brief=""> + </member> + </members> + <signals> + <signal name="range_changed"> + <description> + </description> + </signal> + </signals> + <constants> + </constants> +</class> <class name="Curve2D" inherits="Resource" category="Core"> <brief_description> Describes a Bezier curve in 2D space. @@ -12091,38 +12908,14 @@ <description> </description> <methods> - <method name="get_max" qualifiers="const"> - <return type="float"> - </return> - <description> - </description> - </method> - <method name="get_min" qualifiers="const"> - <return type="float"> - </return> - <description> - </description> - </method> - <method name="get_points" qualifiers="const"> - <return type="PoolVector2Array"> + <method name="get_curve" qualifiers="const"> + <return type="Curve"> </return> <description> </description> </method> - <method name="set_max"> - <argument index="0" name="max" type="float"> - </argument> - <description> - </description> - </method> - <method name="set_min"> - <argument index="0" name="min" type="float"> - </argument> - <description> - </description> - </method> - <method name="set_points"> - <argument index="0" name="points" type="PoolVector2Array"> + <method name="set_curve"> + <argument index="0" name="curve" type="Curve"> </argument> <description> </description> @@ -12135,11 +12928,7 @@ </method> </methods> <members> - <member name="max" type="float" setter="set_max" getter="get_max" brief=""> - </member> - <member name="min" type="float" setter="set_min" getter="get_min" brief=""> - </member> - <member name="points" type="PoolVector2Array" setter="set_points" getter="get_points" brief=""> + <member name="curve" type="Curve" setter="set_curve" getter="get_curve" brief=""> </member> <member name="width" type="int" setter="set_width" getter="get_width" brief=""> </member> @@ -13462,11 +14251,25 @@ Remember that you have to manage the visibility of all your editor controls manually. </description> </method> + <method name="open_scene_from_path"> + <argument index="0" name="scene_filepath" type="String"> + </argument> + <description> + Opens scene in editor. Do not use during plugin initialization. If you need, then use it together with [method Object.call_deferred]. + </description> + </method> <method name="queue_save_layout" qualifiers="const"> <description> Queue save the project's editor layout. </description> </method> + <method name="reload_scene_from_path"> + <argument index="0" name="scene_filepath" type="String"> + </argument> + <description> + Reloads already loaded editor scene. + </description> + </method> <method name="remove_control_from_bottom_panel"> <argument index="0" name="control" type="Control"> </argument> @@ -13499,6 +14302,10 @@ This method is called after the editor saves the project or when it's closed. It asks the plugin to save edited external scenes/resources. </description> </method> + <method name="set_input_event_forwarding_always_enabled"> + <description> + </description> + </method> <method name="set_state" qualifiers="virtual"> <argument index="0" name="state" type="Dictionary"> </argument> @@ -14255,7 +15062,7 @@ <description> </description> </method> - <method name="get_glow_hdr_bleed_treshold" qualifiers="const"> + <method name="get_glow_hdr_bleed_threshold" qualifiers="const"> <return type="float"> </return> <description> @@ -14725,8 +15532,8 @@ <description> </description> </method> - <method name="set_glow_hdr_bleed_treshold"> - <argument index="0" name="treshold" type="float"> + <method name="set_glow_hdr_bleed_threshold"> + <argument index="0" name="threshold" type="float"> </argument> <description> </description> @@ -14752,7 +15559,7 @@ </description> </method> <method name="set_sky"> - <argument index="0" name="sky" type="CubeMap"> + <argument index="0" name="sky" type="Sky"> </argument> <description> </description> @@ -14997,7 +15804,7 @@ </member> <member name="glow_hdr_scale" type="float" setter="set_glow_hdr_bleed_scale" getter="get_glow_hdr_bleed_scale" brief=""> </member> - <member name="glow_hdr_treshold" type="float" setter="set_glow_hdr_bleed_treshold" getter="get_glow_hdr_bleed_treshold" brief=""> + <member name="glow_hdr_threshold" type="float" setter="set_glow_hdr_bleed_threshold" getter="get_glow_hdr_bleed_threshold" brief=""> </member> <member name="glow_intensity" type="float" setter="set_glow_intensity" getter="get_glow_intensity" brief=""> </member> @@ -15815,6 +16622,14 @@ </description> </method> </methods> + <signals> + <signal name="completed"> + <argument index="0" name="result" type="Nil"> + </argument> + <description> + </description> + </signal> + </signals> <constants> </constants> </class> @@ -16864,7 +17679,7 @@ </member> <member name="lod_min_hysteresis" type="int" setter="set_lod_min_hysteresis" getter="get_lod_min_hysteresis" brief=""> </member> - <member name="material_override" type="Material" setter="set_material_override" getter="get_material_override" brief=""> + <member name="material_override" type="ShaderMaterial,SpatialMaterial" setter="set_material_override" getter="get_material_override" brief=""> </member> <member name="use_in_baked_light" type="bool" setter="set_flag" getter="get_flag" brief=""> </member> @@ -16992,6 +17807,8 @@ </description> </method> <method name="property_get_revert"> + <return type="Variant"> + </return> <argument index="0" name="name" type="String"> </argument> <description> @@ -17152,86 +17969,14 @@ <description> </description> <methods> - <method name="add_point"> - <argument index="0" name="offset" type="float"> - </argument> - <argument index="1" name="color" type="Color"> - </argument> - <description> - </description> - </method> - <method name="get_color" qualifiers="const"> - <return type="Color"> - </return> - <argument index="0" name="point" type="int"> - </argument> - <description> - </description> - </method> - <method name="get_colors" qualifiers="const"> - <return type="PoolColorArray"> - </return> - <description> - </description> - </method> - <method name="get_offset" qualifiers="const"> - <return type="float"> - </return> - <argument index="0" name="point" type="int"> - </argument> - <description> - </description> - </method> - <method name="get_offsets" qualifiers="const"> - <return type="PoolRealArray"> - </return> - <description> - </description> - </method> - <method name="get_point_count" qualifiers="const"> - <return type="int"> - </return> - <description> - </description> - </method> - <method name="interpolate"> - <return type="Color"> + <method name="get_gradient" qualifiers="const"> + <return type="Gradient"> </return> - <argument index="0" name="offset" type="float"> - </argument> - <description> - </description> - </method> - <method name="remove_point"> - <argument index="0" name="offset" type="int"> - </argument> - <description> - </description> - </method> - <method name="set_color"> - <argument index="0" name="point" type="int"> - </argument> - <argument index="1" name="color" type="Color"> - </argument> <description> </description> </method> - <method name="set_colors"> - <argument index="0" name="colors" type="PoolColorArray"> - </argument> - <description> - </description> - </method> - <method name="set_offset"> - <argument index="0" name="point" type="int"> - </argument> - <argument index="1" name="offset" type="float"> - </argument> - <description> - </description> - </method> - <method name="set_offsets"> - <argument index="0" name="offsets" type="PoolRealArray"> + <method name="set_gradient"> + <argument index="0" name="gradient" type="Gradient"> </argument> <description> </description> @@ -17244,9 +17989,7 @@ </method> </methods> <members> - <member name="colors" type="float" setter="set_colors" getter="get_colors" brief=""> - </member> - <member name="offsets" type="float" setter="set_offsets" getter="get_offsets" brief=""> + <member name="gradient" type="Gradient" setter="set_gradient" getter="get_gradient" brief=""> </member> <member name="width" type="int" setter="set_width" getter="get_width" brief=""> </member> @@ -18231,6 +18974,10 @@ </theme_item> <theme_item name="grabber" type="Texture"> </theme_item> + <theme_item name="grabber_disabled" type="Texture"> + </theme_item> + <theme_item name="grabber_disabled" type="StyleBox"> + </theme_item> <theme_item name="grabber_highlight" type="Texture"> </theme_item> <theme_item name="grabber_highlight" type="StyleBox"> @@ -19007,6 +19754,19 @@ Copy a "src_rect" [Rect2] from "src" [Image] to this [Image] on coordinates "dest". </description> </method> + <method name="blit_rect_mask"> + <argument index="0" name="src" type="Image"> + </argument> + <argument index="1" name="mask" type="Image"> + </argument> + <argument index="2" name="src_rect" type="Rect2"> + </argument> + <argument index="3" name="dst" type="Vector2"> + </argument> + <description> + Blits a "src_rect" [Rect2] from "src" [Image] to this [Image] using a "mask" [Image] on coordinates "dest". Alpha channel is required for "mask", will copy src pixel onto dest if the corresponding mask pixel's alpha value is not 0. "src" [Image] and "mask" [Image] *must* have the same size (width and height) but they can have different formats + </description> + </method> <method name="clear_mipmaps"> <description> </description> @@ -19218,16 +19978,6 @@ <description> </description> </method> - <method name="set_pixel"> - <argument index="0" name="x" type="int"> - </argument> - <argument index="1" name="y" type="int"> - </argument> - <argument index="2" name="color" type="Color"> - </argument> - <description> - </description> - </method> <method name="resize"> <argument index="0" name="width" type="int"> </argument> @@ -19239,7 +19989,7 @@ </description> </method> <method name="resize_to_po2"> - <argument index="0" name="square" type="bool" default=""false""> + <argument index="0" name="square" type="bool" default="false"> </argument> <description> </description> @@ -19253,6 +20003,16 @@ Save this [Image] as a png. </description> </method> + <method name="set_pixel"> + <argument index="0" name="x" type="int"> + </argument> + <argument index="1" name="y" type="int"> + </argument> + <argument index="2" name="color" type="Color"> + </argument> + <description> + </description> + </method> <method name="shrink_x2"> <description> </description> @@ -19984,6 +20744,14 @@ <description> </description> </method> + <method name="shortcut_match" qualifiers="const"> + <return type="bool"> + </return> + <argument index="0" name="event" type="InputEvent"> + </argument> + <description> + </description> + </method> <method name="xformed_by" qualifiers="const"> <return type="InputEvent"> </return> @@ -19995,6 +20763,10 @@ </description> </method> </methods> + <members> + <member name="device" type="int" setter="set_device" getter="get_device" brief=""> + </member> + </members> <constants> </constants> </class> @@ -20882,6 +21654,8 @@ </description> </method> <method name="get_item_metadata" qualifiers="const"> + <return type="Variant"> + </return> <argument index="0" name="idx" type="int"> </argument> <description> @@ -21151,6 +21925,26 @@ </description> </method> </methods> + <members> + <member name="allow_rmb_select" type="bool" setter="set_allow_rmb_select" getter="get_allow_rmb_select" brief=""> + </member> + <member name="fixed_column_width" type="int" setter="set_fixed_column_width" getter="get_fixed_column_width" brief=""> + </member> + <member name="icon_mode" type="int" setter="set_icon_mode" getter="get_icon_mode" brief=""> + </member> + <member name="icon_scale" type="float" setter="set_icon_scale" getter="get_icon_scale" brief=""> + </member> + <member name="items" type="Array" setter="_set_items" getter="_get_items" brief=""> + </member> + <member name="max_columns" type="int" setter="set_max_columns" getter="get_max_columns" brief=""> + </member> + <member name="max_text_lines" type="int" setter="set_max_text_lines" getter="get_max_text_lines" brief=""> + </member> + <member name="same_column_width" type="bool" setter="set_same_column_width" getter="is_same_column_width" brief=""> + </member> + <member name="select_mode" type="int" setter="set_select_mode" getter="get_select_mode" brief=""> + </member> + </members> <signals> <signal name="item_activated"> <argument index="0" name="index" type="int"> @@ -21380,124 +22174,130 @@ Kinematic Characters: KinematicBody also has an api for moving objects (the [method move] method) while performing collision tests. This makes them really useful to implement characters that collide against a world, but that don't require advanced physics. </description> <methods> - <method name="can_collide_with_character_bodies" qualifiers="const"> - <return type="bool"> + <method name="get_collision_collider" qualifiers="const"> + <return type="Object"> </return> + <argument index="0" name="collision" type="int"> + </argument> <description> - Return if this body can collide with character bodies. </description> </method> - <method name="can_collide_with_kinematic_bodies" qualifiers="const"> - <return type="bool"> + <method name="get_collision_collider_id" qualifiers="const"> + <return type="int"> </return> + <argument index="0" name="collision" type="int"> + </argument> <description> - Return if this body can collide with kinematic bodies. </description> </method> - <method name="can_collide_with_rigid_bodies" qualifiers="const"> - <return type="bool"> - </return> + <method name="get_collision_collider_metadata" qualifiers="const"> + <argument index="0" name="collision" type="int"> + </argument> <description> - Return if this body can collide with rigid bodies. </description> </method> - <method name="can_collide_with_static_bodies" qualifiers="const"> - <return type="bool"> + <method name="get_collision_collider_shape" qualifiers="const"> + <return type="Object"> </return> + <argument index="0" name="collision" type="int"> + </argument> <description> - Return if this body can collide with static bodies. </description> </method> - <method name="can_teleport_to"> - <return type="bool"> + <method name="get_collision_collider_shape_index" qualifiers="const"> + <return type="int"> </return> - <argument index="0" name="position" type="Vector3"> + <argument index="0" name="collision" type="int"> </argument> <description> - Returns whether the KinematicBody can be teleported to the destination given as an argument, checking all collision shapes of the body against potential colliders at the destination. </description> </method> - <method name="get_collider" qualifiers="const"> - <return type="Variant"> + <method name="get_collision_collider_velocity" qualifiers="const"> + <return type="Vector3"> </return> + <argument index="0" name="collision" type="int"> + </argument> <description> - Return the body that collided with this one. </description> </method> - <method name="get_collider_shape" qualifiers="const"> + <method name="get_collision_count" qualifiers="const"> <return type="int"> </return> <description> - Return the shape index from the body that collided with this one. If there is no collision, this method will return 0, so collisions must be checked first with [method is_colliding]. </description> </method> - <method name="get_collider_velocity" qualifiers="const"> - <return type="Vector3"> + <method name="get_collision_local_shape" qualifiers="const"> + <return type="Object"> </return> + <argument index="0" name="collision" type="int"> + </argument> <description> - Return the velocity of the body that collided with this one. </description> </method> - <method name="get_collision_margin" qualifiers="const"> - <return type="float"> + <method name="get_collision_normal" qualifiers="const"> + <return type="Vector3"> </return> + <argument index="0" name="collision" type="int"> + </argument> <description> - Return the collision margin for this object. </description> </method> - <method name="get_collision_normal" qualifiers="const"> + <method name="get_collision_position" qualifiers="const"> <return type="Vector3"> </return> + <argument index="0" name="collision" type="int"> + </argument> <description> - Return the normal of the surface the body collided with. This is useful to implement sliding along a surface. </description> </method> - <method name="get_collision_pos" qualifiers="const"> + <method name="get_collision_remainder" qualifiers="const"> <return type="Vector3"> </return> + <argument index="0" name="collision" type="int"> + </argument> <description> - Return the point in space where the body is touching another. If there is no collision, this method will return (0,0,0), so collisions must be checked first with [method is_colliding]. </description> </method> - <method name="get_move_and_slide_colliders" qualifiers="const"> - <return type="Array"> + <method name="get_collision_travel" qualifiers="const"> + <return type="Vector3"> </return> + <argument index="0" name="collision" type="int"> + </argument> <description> </description> </method> - <method name="get_travel" qualifiers="const"> + <method name="get_floor_velocity" qualifiers="const"> <return type="Vector3"> </return> <description> </description> </method> - <method name="is_colliding" qualifiers="const"> - <return type="bool"> + <method name="get_safe_margin" qualifiers="const"> + <return type="float"> </return> <description> - Return whether the body is colliding with another. </description> </method> - <method name="is_move_and_slide_on_ceiling" qualifiers="const"> + <method name="is_on_ceiling" qualifiers="const"> <return type="bool"> </return> <description> </description> </method> - <method name="is_move_and_slide_on_floor" qualifiers="const"> + <method name="is_on_floor" qualifiers="const"> <return type="bool"> </return> <description> </description> </method> - <method name="is_move_and_slide_on_wall" qualifiers="const"> + <method name="is_on_wall" qualifiers="const"> <return type="bool"> </return> <description> </description> </method> <method name="move"> - <return type="Vector3"> + <return type="Dictionary"> </return> <argument index="0" name="rel_vec" type="Vector3"> </argument> @@ -21512,78 +22312,34 @@ </argument> <argument index="1" name="floor_normal" type="Vector3" default="Vector3(0, 0, 0)"> </argument> - <argument index="2" name="ceil_normal" type="Vector3" default="Vector3(0, 0, 0)"> - </argument> - <argument index="3" name="slope_stop_min_velocity" type="float" default="5"> + <argument index="2" name="slope_stop_min_velocity" type="float" default="0.05"> </argument> - <argument index="4" name="max_bounces" type="int" default="4"> - </argument> - <argument index="5" name="floor_max_angle" type="float" default="0.785398"> - </argument> - <argument index="6" name="ceil_max_angle" type="float" default="0.785398"> - </argument> - <description> - </description> - </method> - <method name="move_to"> - <return type="Vector3"> - </return> - <argument index="0" name="position" type="Vector3"> - </argument> - <description> - Move the body to the given position. This is not a teleport, and the body will stop if there is an obstacle. The returned vector is how much movement was remaining before being stopped. - </description> - </method> - <method name="revert_motion"> - <description> - </description> - </method> - <method name="set_collide_with_character_bodies"> - <argument index="0" name="enable" type="bool"> + <argument index="3" name="max_bounces" type="int" default="4"> </argument> - <description> - Set if this body should collide with character bodies. - </description> - </method> - <method name="set_collide_with_kinematic_bodies"> - <argument index="0" name="enable" type="bool"> + <argument index="4" name="floor_max_angle" type="float" default="0.785398"> </argument> <description> - Set if this body should collide with kinematic bodies. </description> </method> - <method name="set_collide_with_rigid_bodies"> - <argument index="0" name="enable" type="bool"> + <method name="set_safe_margin"> + <argument index="0" name="pixels" type="float"> </argument> <description> - Set if this body should collide with rigid bodies. </description> </method> - <method name="set_collide_with_static_bodies"> - <argument index="0" name="enable" type="bool"> + <method name="test_move"> + <return type="bool"> + </return> + <argument index="0" name="from" type="Transform"> </argument> - <description> - Set if this body should collide with static bodies. - </description> - </method> - <method name="set_collision_margin"> - <argument index="0" name="pixels" type="float"> + <argument index="1" name="rel_vec" type="Vector3"> </argument> <description> - Set the collision margin for this object. A collision margin is an amount that all shapes will grow when computing collisions, to account for numerical imprecision. </description> </method> </methods> <members> - <member name="collide_with/character" type="bool" setter="set_collide_with_character_bodies" getter="can_collide_with_character_bodies" brief=""> - </member> - <member name="collide_with/kinematic" type="bool" setter="set_collide_with_kinematic_bodies" getter="can_collide_with_kinematic_bodies" brief=""> - </member> - <member name="collide_with/rigid" type="bool" setter="set_collide_with_rigid_bodies" getter="can_collide_with_rigid_bodies" brief=""> - </member> - <member name="collide_with/static" type="bool" setter="set_collide_with_static_bodies" getter="can_collide_with_static_bodies" brief=""> - </member> - <member name="collision/margin" type="float" setter="set_collision_margin" getter="get_collision_margin" brief=""> + <member name="collision/safe_margin" type="float" setter="set_safe_margin" getter="get_safe_margin" brief=""> </member> </members> <constants> @@ -21599,95 +22355,131 @@ Kinematic Characters: KinematicBody2D also has an api for moving objects (the [method move] method) while performing collision tests. This makes them really useful to implement characters that collide against a world, but that don't require advanced physics. </description> <methods> - <method name="get_collider" qualifiers="const"> - <return type="Variant"> + <method name="get_collision_collider" qualifiers="const"> + <return type="Object"> </return> + <argument index="0" name="collision" type="int"> + </argument> <description> - Return the body that collided with this one. </description> </method> - <method name="get_collider_metadata" qualifiers="const"> - <return type="Variant"> + <method name="get_collision_collider_id" qualifiers="const"> + <return type="int"> </return> + <argument index="0" name="collision" type="int"> + </argument> <description> - Return the metadata of the shape that collided with this body. If there is no collision, it will return 0, so collisions must be checked first with [method is_colliding]. Additionally, this metadata can not be set with [method Object.set_meta], it must be set with [method Physics2DServer.body_set_shape_metadata]. </description> </method> - <method name="get_collider_shape" qualifiers="const"> + <method name="get_collision_collider_metadata" qualifiers="const"> + <argument index="0" name="collision" type="int"> + </argument> + <description> + </description> + </method> + <method name="get_collision_collider_shape" qualifiers="const"> + <return type="Object"> + </return> + <argument index="0" name="collision" type="int"> + </argument> + <description> + </description> + </method> + <method name="get_collision_collider_shape_index" qualifiers="const"> <return type="int"> </return> + <argument index="0" name="collision" type="int"> + </argument> <description> - Return the shape index from the body that collided with this one. If there is no collision, this method will return 0, so collisions must be checked first with [method is_colliding]. </description> </method> - <method name="get_collider_velocity" qualifiers="const"> + <method name="get_collision_collider_velocity" qualifiers="const"> <return type="Vector2"> </return> + <argument index="0" name="collision" type="int"> + </argument> <description> Return the velocity of the body that collided with this one. </description> </method> - <method name="get_collision_margin" qualifiers="const"> - <return type="float"> + <method name="get_collision_count" qualifiers="const"> + <return type="int"> + </return> + <description> + </description> + </method> + <method name="get_collision_local_shape" qualifiers="const"> + <return type="Object"> </return> + <argument index="0" name="collision" type="int"> + </argument> <description> - Return the collision margin for this object. </description> </method> <method name="get_collision_normal" qualifiers="const"> <return type="Vector2"> </return> + <argument index="0" name="collision" type="int"> + </argument> <description> - Return the normal of the surface the body collided with. This is useful to implement sliding along a surface. </description> </method> - <method name="get_collision_pos" qualifiers="const"> + <method name="get_collision_position" qualifiers="const"> <return type="Vector2"> </return> + <argument index="0" name="collision" type="int"> + </argument> <description> - Return the point in space where the body is touching another. If there is no collision, this method will return (0,0), so collisions must be checked first with [method is_colliding]. </description> </method> - <method name="get_move_and_slide_colliders" qualifiers="const"> - <return type="Array"> + <method name="get_collision_remainder" qualifiers="const"> + <return type="Vector2"> </return> + <argument index="0" name="collision" type="int"> + </argument> <description> </description> </method> - <method name="get_travel" qualifiers="const"> + <method name="get_collision_travel" qualifiers="const"> <return type="Vector2"> </return> + <argument index="0" name="collision" type="int"> + </argument> <description> - Return the last movement done by the body. </description> </method> - <method name="is_colliding" qualifiers="const"> - <return type="bool"> + <method name="get_floor_velocity" qualifiers="const"> + <return type="Vector2"> + </return> + <description> + </description> + </method> + <method name="get_safe_margin" qualifiers="const"> + <return type="float"> </return> <description> - Return whether the body is colliding with another. </description> </method> - <method name="is_move_and_slide_on_ceiling" qualifiers="const"> + <method name="is_on_ceiling" qualifiers="const"> <return type="bool"> </return> <description> </description> </method> - <method name="is_move_and_slide_on_floor" qualifiers="const"> + <method name="is_on_floor" qualifiers="const"> <return type="bool"> </return> <description> </description> </method> - <method name="is_move_and_slide_on_wall" qualifiers="const"> + <method name="is_on_wall" qualifiers="const"> <return type="bool"> </return> <description> </description> </method> <method name="move"> - <return type="Vector2"> + <return type="Dictionary"> </return> <argument index="0" name="rel_vec" type="Vector2"> </argument> @@ -21711,26 +22503,10 @@ <description> </description> </method> - <method name="move_to"> - <return type="Vector2"> - </return> - <argument index="0" name="position" type="Vector2"> - </argument> - <description> - Move the body to the given position. This is not a teleport, and the body will stop if there is an obstacle. The returned vector is how much movement was remaining before being stopped. - [code]floor_max_angle[/code] is in radians (default is pi/4), and filters which obstacles should be considered as floors/cellings instead of walls. - </description> - </method> - <method name="revert_motion"> - <description> - Undo the last movement done by the body. - </description> - </method> - <method name="set_collision_margin"> + <method name="set_safe_margin"> <argument index="0" name="pixels" type="float"> </argument> <description> - Set the collision margin for this object. A collision margin is an amount (in pixels) that all shapes will grow when computing collisions, to account for numerical imprecision. </description> </method> <method name="test_move"> @@ -21746,7 +22522,7 @@ </method> </methods> <members> - <member name="collision/margin" type="float" setter="set_collision_margin" getter="get_collision_margin" brief=""> + <member name="collision/safe_margin" type="float" setter="set_safe_margin" getter="get_safe_margin" brief=""> </member> </members> <constants> @@ -23450,7 +24226,23 @@ Material is a base [Resource] used for coloring and shading geometry. All materials inherit from it and almost all [VisualInstance] derived nodes carry a Material. A few flags and parameters are shared between all material types and are configured here. </description> <methods> + <method name="get_next_pass" qualifiers="const"> + <return type="Material"> + </return> + <description> + </description> + </method> + <method name="set_next_pass"> + <argument index="0" name="next_pass" type="Material"> + </argument> + <description> + </description> + </method> </methods> + <members> + <member name="next_pass" type="Material" setter="set_next_pass" getter="get_next_pass" brief=""> + </member> + </members> <constants> </constants> </class> @@ -23594,6 +24386,8 @@ </description> </method> <method name="get_edge_meta" qualifiers="const"> + <return type="Variant"> + </return> <argument index="0" name="idx" type="int"> </argument> <description> @@ -23626,6 +24420,8 @@ </description> </method> <method name="get_face_meta" qualifiers="const"> + <return type="Variant"> + </return> <argument index="0" name="idx" type="int"> </argument> <description> @@ -23708,6 +24504,8 @@ </description> </method> <method name="get_vertex_meta" qualifiers="const"> + <return type="Variant"> + </return> <argument index="0" name="idx" type="int"> </argument> <description> @@ -23863,6 +24661,10 @@ <description> </description> </method> + <method name="create_debug_tagents"> + <description> + </description> + </method> <method name="create_trimesh_collision"> <description> This helper creates a [StaticBody] child [Node] using the mesh geometry as collision. It's mainly used for testing. @@ -23881,6 +24683,14 @@ <description> </description> </method> + <method name="get_surface_material" qualifiers="const"> + <return type="Material"> + </return> + <argument index="0" name="surface" type="int"> + </argument> + <description> + </description> + </method> <method name="set_mesh"> <argument index="0" name="mesh" type="Mesh"> </argument> @@ -23894,6 +24704,14 @@ <description> </description> </method> + <method name="set_surface_material"> + <argument index="0" name="surface" type="int"> + </argument> + <argument index="1" name="material" type="Material"> + </argument> + <description> + </description> + </method> </methods> <members> <member name="mesh" type="Mesh" setter="set_mesh" getter="get_mesh" brief=""> @@ -24958,6 +25776,12 @@ <description> </description> </method> + <method name="get_h_axis_stretch_mode" qualifiers="const"> + <return type="int"> + </return> + <description> + </description> + </method> <method name="get_patch_margin" qualifiers="const"> <return type="int"> </return> @@ -24978,12 +25802,24 @@ <description> </description> </method> + <method name="get_v_axis_stretch_mode" qualifiers="const"> + <return type="int"> + </return> + <description> + </description> + </method> <method name="set_draw_center"> <argument index="0" name="draw_center" type="bool"> </argument> <description> </description> </method> + <method name="set_h_axis_stretch_mode"> + <argument index="0" name="mode" type="int"> + </argument> + <description> + </description> + </method> <method name="set_patch_margin"> <argument index="0" name="margin" type="int"> </argument> @@ -25004,8 +25840,18 @@ <description> </description> </method> + <method name="set_v_axis_stretch_mode"> + <argument index="0" name="mode" type="int"> + </argument> + <description> + </description> + </method> </methods> <members> + <member name="axis_stretch_horizontal" type="int" setter="set_h_axis_stretch_mode" getter="get_h_axis_stretch_mode" brief=""> + </member> + <member name="axis_stretch_vertical" type="int" setter="set_v_axis_stretch_mode" getter="get_v_axis_stretch_mode" brief=""> + </member> <member name="draw_center" type="bool" setter="set_draw_center" getter="get_draw_center" brief=""> </member> <member name="patch_margin_bottom" type="int" setter="set_patch_margin" getter="get_patch_margin" brief=""> @@ -25028,6 +25874,12 @@ </signal> </signals> <constants> + <constant name="AXIS_STRETCH_MODE_STRETCH" value="0"> + </constant> + <constant name="AXIS_STRETCH_MODE_TILE" value="1"> + </constant> + <constant name="AXIS_STRETCH_MODE_TILE_FIT" value="2"> + </constant> </constants> </class> <class name="Node" inherits="Object" category="Core"> @@ -25208,7 +26060,7 @@ Return the name of the node. This name is unique among the siblings (other child nodes from the same parent). </description> </method> - <method name="get_network_mode" qualifiers="const"> + <method name="get_network_master" qualifiers="const"> <return type="int"> </return> <description> @@ -25612,11 +26464,12 @@ Set the name of the [Node]. Name must be unique within parent, and setting an already existing name will cause for the node to be automatically renamed. </description> </method> - <method name="set_network_mode"> - <argument index="0" name="mode" type="int"> + <method name="set_network_master"> + <argument index="0" name="id" type="int"> + </argument> + <argument index="1" name="recursive" type="bool" default="true"> </argument> <description> - Change the networking mode of the [Node], where [i]mode[/i] is one of the constants NETWORK_MODE_*. Master nodes will only call gdscript methods defined as [i]master func[/i] if a RPC call is received (slave nodes will only call [i]slave func[/i]; both will call [i]remote func[/i] if the call is not local, and [i]sync func[/i] in any case). Inherit mode looks at the parent node to determine the value (root node depends on the [SceneTree] having a networking peer set with [method SceneTree.set_network_peer]) </description> </method> <method name="set_owner"> @@ -25733,12 +26586,6 @@ </constant> <constant name="NOTIFICATION_INTERNAL_FIXED_PROCESS" value="26"> </constant> - <constant name="NETWORK_MODE_INHERIT" value="0"> - </constant> - <constant name="NETWORK_MODE_MASTER" value="1"> - </constant> - <constant name="NETWORK_MODE_SLAVE" value="2"> - </constant> <constant name="RPC_MODE_DISABLED" value="0"> </constant> <constant name="RPC_MODE_REMOTE" value="1"> @@ -26701,6 +27548,12 @@ <description> </description> </method> + <method name="set_ime_position"> + <argument index="0" name="arg0" type="Vector2"> + </argument> + <description> + </description> + </method> <method name="set_keep_screen_on"> <argument index="0" name="enabled" type="bool"> </argument> @@ -27037,6 +27890,12 @@ Return the class of the object as a string. </description> </method> + <method name="get_incoming_connections" qualifiers="const"> + <return type="Array"> + </return> + <description> + </description> + </method> <method name="get_instance_ID" qualifiers="const"> <return type="int"> </return> @@ -27409,6 +28268,8 @@ </description> </method> <method name="get_item_metadata" qualifiers="const"> + <return type="Variant"> + </return> <argument index="0" name="idx" type="int"> </argument> <description> @@ -27437,6 +28298,8 @@ </description> </method> <method name="get_selected_metadata" qualifiers="const"> + <return type="Variant"> + </return> <description> </description> </method> @@ -28080,102 +28943,6 @@ <constants> </constants> </class> -<class name="ParticleAttractor2D" inherits="Node2D" category="Core"> - <brief_description> - </brief_description> - <description> - </description> - <methods> - <method name="get_absorption" qualifiers="const"> - <return type="float"> - </return> - <description> - </description> - </method> - <method name="get_disable_radius" qualifiers="const"> - <return type="float"> - </return> - <description> - </description> - </method> - <method name="get_gravity" qualifiers="const"> - <return type="float"> - </return> - <description> - </description> - </method> - <method name="get_particles_path" qualifiers="const"> - <return type="NodePath"> - </return> - <description> - </description> - </method> - <method name="get_radius" qualifiers="const"> - <return type="float"> - </return> - <description> - </description> - </method> - <method name="is_enabled" qualifiers="const"> - <return type="bool"> - </return> - <description> - </description> - </method> - <method name="set_absorption"> - <argument index="0" name="absorption" type="float"> - </argument> - <description> - </description> - </method> - <method name="set_disable_radius"> - <argument index="0" name="radius" type="float"> - </argument> - <description> - </description> - </method> - <method name="set_enabled"> - <argument index="0" name="enabled" type="bool"> - </argument> - <description> - </description> - </method> - <method name="set_gravity"> - <argument index="0" name="gravity" type="float"> - </argument> - <description> - </description> - </method> - <method name="set_particles_path"> - <argument index="0" name="path" type="NodePath"> - </argument> - <description> - </description> - </method> - <method name="set_radius"> - <argument index="0" name="radius" type="float"> - </argument> - <description> - </description> - </method> - </methods> - <members> - <member name="absorption" type="float" setter="set_absorption" getter="get_absorption" brief=""> - </member> - <member name="disable_radius" type="float" setter="set_disable_radius" getter="get_disable_radius" brief=""> - </member> - <member name="enabled" type="bool" setter="set_enabled" getter="is_enabled" brief=""> - </member> - <member name="gravity" type="float" setter="set_gravity" getter="get_gravity" brief=""> - </member> - <member name="particles_path" type="NodePath" setter="set_particles_path" getter="get_particles_path" brief=""> - </member> - <member name="radius" type="float" setter="set_radius" getter="get_radius" brief=""> - </member> - </members> - <constants> - </constants> -</class> <class name="Particles" inherits="GeometryInstance" category="Core"> <brief_description> </brief_description> @@ -28238,6 +29005,12 @@ <description> </description> </method> + <method name="get_one_shot" qualifiers="const"> + <return type="bool"> + </return> + <description> + </description> + </method> <method name="get_pre_process_time" qualifiers="const"> <return type="float"> </return> @@ -28280,6 +29053,10 @@ <description> </description> </method> + <method name="restart"> + <description> + </description> + </method> <method name="set_amount"> <argument index="0" name="amount" type="int"> </argument> @@ -28336,6 +29113,12 @@ <description> </description> </method> + <method name="set_one_shot"> + <argument index="0" name="enable" type="bool"> + </argument> + <description> + </description> + </method> <method name="set_pre_process_time"> <argument index="0" name="secs" type="float"> </argument> @@ -28400,9 +29183,11 @@ </member> <member name="local_coords" type="bool" setter="set_use_local_coordinates" getter="get_use_local_coordinates" brief=""> </member> + <member name="one_shot" type="bool" setter="set_one_shot" getter="get_one_shot" brief=""> + </member> <member name="preprocess" type="float" setter="set_pre_process_time" getter="get_pre_process_time" brief=""> </member> - <member name="process_material" type="ParticlesMaterial,ShaderMaterial" setter="set_process_material" getter="get_process_material" brief=""> + <member name="process_material" type="ShaderMaterial,ParticlesMaterial" setter="set_process_material" getter="get_process_material" brief=""> </member> <member name="randomness" type="float" setter="set_randomness_ratio" getter="get_randomness_ratio" brief=""> </member> @@ -28430,129 +29215,90 @@ Particles2D is a particle system 2D [Node] that is used to simulate several types of particle effects, such as explosions, rain, snow, fireflies, or other magical-like shinny sparkles. Particles are drawn using impostors, and given their dynamic behavior, the user must provide a visibility bounding box (although helpers to create one automatically exist). </description> <methods> - <method name="get_amount" qualifiers="const"> - <return type="int"> + <method name="capture_rect" qualifiers="const"> + <return type="Rect2"> </return> <description> - Returns the amount of particles spawned at each emission </description> </method> - <method name="get_color" qualifiers="const"> - <return type="Color"> + <method name="get_amount" qualifiers="const"> + <return type="int"> </return> <description> - Returns the tint color for each particle. + Returns the amount of particles spawned at each emission </description> </method> - <method name="get_color_phase_color" qualifiers="const"> - <return type="Color"> + <method name="get_draw_order" qualifiers="const"> + <return type="int"> </return> - <argument index="0" name="phase" type="int"> - </argument> <description> </description> </method> - <method name="get_color_phase_pos" qualifiers="const"> + <method name="get_explosiveness_ratio" qualifiers="const"> <return type="float"> </return> - <argument index="0" name="phase" type="int"> - </argument> <description> </description> </method> - <method name="get_color_phases" qualifiers="const"> + <method name="get_fixed_fps" qualifiers="const"> <return type="int"> </return> <description> </description> </method> - <method name="get_emission_half_extents" qualifiers="const"> - <return type="Vector2"> - </return> - <description> - Returns the half extents of the emission box. - </description> - </method> - <method name="get_emission_points" qualifiers="const"> - <return type="PoolVector2Array"> - </return> - <description> - </description> - </method> - <method name="get_emissor_offset" qualifiers="const"> - <return type="Vector2"> + <method name="get_fractional_delta" qualifiers="const"> + <return type="bool"> </return> <description> - Returns the particle spawn origin position relative to the emitter. </description> </method> - <method name="get_emit_timeout" qualifiers="const"> - <return type="float"> + <method name="get_h_frames" qualifiers="const"> + <return type="int"> </return> <description> - Returns the amount of seconds during which the emitter will spawn particles </description> </method> - <method name="get_explosiveness" qualifiers="const"> + <method name="get_lifetime" qualifiers="const"> <return type="float"> </return> <description> + Gets the amount of seconds that each particle will be visible. </description> </method> - <method name="get_gradient" qualifiers="const"> - <return type="Gradient"> - </return> - <description> - Returns the [Gradient] used to tint each particle. - </description> - </method> - <method name="get_h_frames" qualifiers="const"> - <return type="int"> + <method name="get_normal_map" qualifiers="const"> + <return type="Texture"> </return> <description> </description> </method> - <method name="get_initial_velocity" qualifiers="const"> - <return type="Vector2"> + <method name="get_one_shot" qualifiers="const"> + <return type="bool"> </return> <description> </description> </method> - <method name="get_lifetime" qualifiers="const"> + <method name="get_pre_process_time" qualifiers="const"> <return type="float"> </return> <description> - Gets the amount of seconds that each particle will be visible. </description> </method> - <method name="get_param" qualifiers="const"> - <return type="float"> + <method name="get_process_material" qualifiers="const"> + <return type="Material"> </return> - <argument index="0" name="param" type="int"> - </argument> <description> - Returns the value of the specified emitter parameter </description> </method> - <method name="get_pre_process_time" qualifiers="const"> + <method name="get_randomness_ratio" qualifiers="const"> <return type="float"> </return> <description> </description> </method> - <method name="get_process_mode" qualifiers="const"> - <return type="int"> - </return> - <description> - </description> - </method> - <method name="get_randomness" qualifiers="const"> + <method name="get_speed_scale" qualifiers="const"> <return type="float"> </return> - <argument index="0" name="param" type="int"> - </argument> <description> - Returns the randomness value of the specified emitter parameter </description> </method> <method name="get_texture" qualifiers="const"> @@ -28562,11 +29308,10 @@ Returns the texture for emitted particles </description> </method> - <method name="get_time_scale" qualifiers="const"> - <return type="float"> + <method name="get_use_local_coordinates" qualifiers="const"> + <return type="bool"> </return> <description> - Returns the emitter time scale </description> </method> <method name="get_v_frames" qualifiers="const"> @@ -28575,38 +29320,20 @@ <description> </description> </method> - <method name="is_emitting" qualifiers="const"> - <return type="bool"> - </return> - <description> - Returns whether this emitter is currently emitting or not - </description> - </method> - <method name="is_flipped_h" qualifiers="const"> - <return type="bool"> - </return> - <description> - </description> - </method> - <method name="is_flipped_v" qualifiers="const"> - <return type="bool"> + <method name="get_visibility_rect" qualifiers="const"> + <return type="Rect2"> </return> <description> </description> </method> - <method name="is_using_local_space" qualifiers="const"> + <method name="is_emitting" qualifiers="const"> <return type="bool"> </return> <description> + Returns whether this emitter is currently emitting or not </description> </method> - <method name="pre_process"> - <argument index="0" name="time" type="float"> - </argument> - <description> - </description> - </method> - <method name="reset"> + <method name="restart"> <description> </description> </method> @@ -28617,348 +29344,153 @@ Sets the amount of particles spawned at each emission </description> </method> - <method name="set_color"> - <argument index="0" name="color" type="Color"> - </argument> - <description> - Set the tint color for each particle. - </description> - </method> - <method name="set_color_phase_color"> - <argument index="0" name="phase" type="int"> - </argument> - <argument index="1" name="color" type="Color"> - </argument> - <description> - </description> - </method> - <method name="set_color_phase_pos"> - <argument index="0" name="phase" type="int"> - </argument> - <argument index="1" name="pos" type="float"> - </argument> - <description> - </description> - </method> - <method name="set_color_phases"> - <argument index="0" name="phases" type="int"> - </argument> - <description> - </description> - </method> - <method name="set_emission_half_extents"> - <argument index="0" name="extents" type="Vector2"> - </argument> - <description> - Sets the half extents of the emission box, particles will be spawned at random inside this box. - </description> - </method> - <method name="set_emission_points"> - <argument index="0" name="points" type="PoolVector2Array"> - </argument> - <description> - </description> - </method> - <method name="set_emissor_offset"> - <argument index="0" name="offset" type="Vector2"> - </argument> - <description> - Sets the particle spawn origin position relative to the emitter center. for example if this value is set to (50, 50), the particle will spawn 50 units to the right and 50 units to the bottom of the emitter center. - </description> - </method> - <method name="set_emit_timeout"> - <argument index="0" name="value" type="float"> + <method name="set_draw_order"> + <argument index="0" name="order" type="int"> </argument> <description> - Sets the amount of seconds during which the emitter will spawn particles, after the specified seconds the emitter state will be set to non emitting, so calling [method is_emitting] will return false. If the timeout is 0 the emitter will spawn forever. </description> </method> <method name="set_emitting"> - <argument index="0" name="active" type="bool"> + <argument index="0" name="emitting" type="bool"> </argument> <description> If this is set to true then the particle emitter will emit particles, if its false it will not. </description> </method> - <method name="set_explosiveness"> - <argument index="0" name="amount" type="float"> + <method name="set_explosiveness_ratio"> + <argument index="0" name="ratio" type="float"> </argument> <description> </description> </method> - <method name="set_flip_h"> - <argument index="0" name="enable" type="bool"> + <method name="set_fixed_fps"> + <argument index="0" name="fps" type="int"> </argument> <description> </description> </method> - <method name="set_flip_v"> + <method name="set_fractional_delta"> <argument index="0" name="enable" type="bool"> </argument> <description> </description> </method> - <method name="set_gradient"> - <return type="Gradient"> - </return> - <argument index="0" name="gradient" type="Object"> + <method name="set_h_frames"> + <argument index="0" name="frames" type="int"> </argument> <description> - Sets the [Gradient] used to tint each particle. Particle will be tinted according to their lifetimes. </description> </method> - <method name="set_h_frames"> - <argument index="0" name="enable" type="int"> + <method name="set_lifetime"> + <argument index="0" name="secs" type="float"> </argument> <description> + Sets the amount of seconds that each particle will be visible. </description> </method> - <method name="set_initial_velocity"> - <argument index="0" name="velocity" type="Vector2"> + <method name="set_normal_map"> + <argument index="0" name="texture" type="Texture"> </argument> <description> </description> </method> - <method name="set_lifetime"> - <argument index="0" name="lifetime" type="float"> + <method name="set_one_shot"> + <argument index="0" name="secs" type="bool"> </argument> <description> - Sets the amount of seconds that each particle will be visible. </description> </method> - <method name="set_param"> - <argument index="0" name="param" type="int"> - </argument> - <argument index="1" name="value" type="float"> + <method name="set_pre_process_time"> + <argument index="0" name="secs" type="float"> </argument> <description> - Sets the value of the specified emitter parameter (see the constants secction for the list of parameters) </description> </method> - <method name="set_pre_process_time"> - <argument index="0" name="time" type="float"> + <method name="set_process_material"> + <argument index="0" name="material" type="Material"> </argument> <description> </description> </method> - <method name="set_process_mode"> - <argument index="0" name="mode" type="int"> + <method name="set_randomness_ratio"> + <argument index="0" name="ratio" type="float"> </argument> <description> </description> </method> - <method name="set_randomness"> - <argument index="0" name="param" type="int"> - </argument> - <argument index="1" name="value" type="float"> + <method name="set_speed_scale"> + <argument index="0" name="scale" type="float"> </argument> <description> - Sets the randomness value of the specified emitter parameter (see the constants secction for the list of parameters), 0 means no randomness, so every particle will have the parameters specified, 1 means that the parameter will be chosen at random, the closer the randomness value gets to 0 the more conservative the variation of the parameter will be. </description> </method> <method name="set_texture"> - <return type="Texture"> - </return> - <argument index="0" name="texture" type="Object"> + <argument index="0" name="texture" type="Texture"> </argument> <description> - Sets the texture for each particle </description> </method> - <method name="set_time_scale"> - <argument index="0" name="time_scale" type="float"> + <method name="set_use_local_coordinates"> + <argument index="0" name="enable" type="bool"> </argument> <description> - Sets the increment or decrement for the particle lifetime. for example: if the time scale is set to 2, the particles will die and move twice as fast. </description> </method> - <method name="set_use_local_space"> - <argument index="0" name="enable" type="bool"> + <method name="set_v_frames"> + <argument index="0" name="frames" type="int"> </argument> <description> </description> </method> - <method name="set_v_frames"> - <argument index="0" name="enable" type="int"> + <method name="set_visibility_rect"> + <argument index="0" name="aabb" type="Rect2"> </argument> <description> </description> </method> </methods> <members> - <member name="color/color" type="Color" setter="set_color" getter="get_color" brief=""> - </member> - <member name="color/color_ramp" type="Gradient" setter="set_color_ramp" getter="get_color_ramp" brief=""> - </member> - <member name="color_phases/count" type="int" setter="set_color_phases" getter="get_color_phases" brief=""> - </member> - <member name="config/amount" type="int" setter="set_amount" getter="get_amount" brief=""> - </member> - <member name="config/emit_timeout" type="float" setter="set_emit_timeout" getter="get_emit_timeout" brief=""> - </member> - <member name="config/emitting" type="bool" setter="set_emitting" getter="is_emitting" brief=""> - </member> - <member name="config/explosiveness" type="float" setter="set_explosiveness" getter="get_explosiveness" brief=""> - </member> - <member name="config/flip_h" type="bool" setter="set_flip_h" getter="is_flipped_h" brief=""> - </member> - <member name="config/flip_v" type="bool" setter="set_flip_v" getter="is_flipped_v" brief=""> - </member> - <member name="config/h_frames" type="int" setter="set_h_frames" getter="get_h_frames" brief=""> - </member> - <member name="config/half_extents" type="Vector2" setter="set_emission_half_extents" getter="get_emission_half_extents" brief=""> - </member> - <member name="config/lifetime" type="float" setter="set_lifetime" getter="get_lifetime" brief=""> - </member> - <member name="config/local_space" type="bool" setter="set_use_local_space" getter="is_using_local_space" brief=""> - </member> - <member name="config/offset" type="Vector2" setter="set_emissor_offset" getter="get_emissor_offset" brief=""> - </member> - <member name="config/preprocess" type="float" setter="set_pre_process_time" getter="get_pre_process_time" brief=""> - </member> - <member name="config/process_mode" type="int" setter="set_process_mode" getter="get_process_mode" brief=""> - </member> - <member name="config/texture" type="Texture" setter="set_texture" getter="get_texture" brief=""> - </member> - <member name="config/time_scale" type="float" setter="set_time_scale" getter="get_time_scale" brief=""> - </member> - <member name="config/v_frames" type="int" setter="set_v_frames" getter="get_v_frames" brief=""> - </member> - <member name="emission_points" type="PoolVector2Array" setter="set_emission_points" getter="get_emission_points" brief=""> - </member> - <member name="params/anim_initial_pos" type="float" setter="set_param" getter="get_param" brief=""> - </member> - <member name="params/anim_speed_scale" type="float" setter="set_param" getter="get_param" brief=""> - </member> - <member name="params/damping" type="float" setter="set_param" getter="get_param" brief=""> - </member> - <member name="params/direction" type="float" setter="set_param" getter="get_param" brief=""> - </member> - <member name="params/final_size" type="float" setter="set_param" getter="get_param" brief=""> - </member> - <member name="params/gravity_direction" type="float" setter="set_param" getter="get_param" brief=""> - </member> - <member name="params/gravity_strength" type="float" setter="set_param" getter="get_param" brief=""> - </member> - <member name="params/hue_variation" type="float" setter="set_param" getter="get_param" brief=""> - </member> - <member name="params/initial_angle" type="float" setter="set_param" getter="get_param" brief=""> - </member> - <member name="params/initial_size" type="float" setter="set_param" getter="get_param" brief=""> - </member> - <member name="params/linear_velocity" type="float" setter="set_param" getter="get_param" brief=""> - </member> - <member name="params/orbit_velocity" type="float" setter="set_param" getter="get_param" brief=""> - </member> - <member name="params/radial_accel" type="float" setter="set_param" getter="get_param" brief=""> - </member> - <member name="params/spin_velocity" type="float" setter="set_param" getter="get_param" brief=""> - </member> - <member name="params/spread" type="float" setter="set_param" getter="get_param" brief=""> - </member> - <member name="params/tangential_accel" type="float" setter="set_param" getter="get_param" brief=""> - </member> - <member name="phase_0/color" type="Color" setter="set_color_phase_color" getter="get_color_phase_color" brief=""> - </member> - <member name="phase_0/pos" type="float" setter="set_color_phase_pos" getter="get_color_phase_pos" brief=""> - </member> - <member name="phase_1/color" type="Color" setter="set_color_phase_color" getter="get_color_phase_color" brief=""> - </member> - <member name="phase_1/pos" type="float" setter="set_color_phase_pos" getter="get_color_phase_pos" brief=""> - </member> - <member name="phase_2/color" type="Color" setter="set_color_phase_color" getter="get_color_phase_color" brief=""> - </member> - <member name="phase_2/pos" type="float" setter="set_color_phase_pos" getter="get_color_phase_pos" brief=""> - </member> - <member name="phase_3/color" type="Color" setter="set_color_phase_color" getter="get_color_phase_color" brief=""> + <member name="amount" type="int" setter="set_amount" getter="get_amount" brief=""> </member> - <member name="phase_3/pos" type="float" setter="set_color_phase_pos" getter="get_color_phase_pos" brief=""> + <member name="draw_order" type="int" setter="set_draw_order" getter="get_draw_order" brief=""> </member> - <member name="randomness/anim_initial_pos" type="float" setter="set_randomness" getter="get_randomness" brief=""> + <member name="emitting" type="bool" setter="set_emitting" getter="is_emitting" brief=""> </member> - <member name="randomness/anim_speed_scale" type="float" setter="set_randomness" getter="get_randomness" brief=""> + <member name="explosiveness" type="float" setter="set_explosiveness_ratio" getter="get_explosiveness_ratio" brief=""> </member> - <member name="randomness/damping" type="float" setter="set_randomness" getter="get_randomness" brief=""> + <member name="fixed_fps" type="int" setter="set_fixed_fps" getter="get_fixed_fps" brief=""> </member> - <member name="randomness/direction" type="float" setter="set_randomness" getter="get_randomness" brief=""> + <member name="fract_delta" type="bool" setter="set_fractional_delta" getter="get_fractional_delta" brief=""> </member> - <member name="randomness/final_size" type="float" setter="set_randomness" getter="get_randomness" brief=""> + <member name="h_frames" type="int" setter="set_h_frames" getter="get_h_frames" brief=""> </member> - <member name="randomness/gravity_direction" type="float" setter="set_randomness" getter="get_randomness" brief=""> + <member name="lifetime" type="float" setter="set_lifetime" getter="get_lifetime" brief=""> </member> - <member name="randomness/gravity_strength" type="float" setter="set_randomness" getter="get_randomness" brief=""> + <member name="local_coords" type="bool" setter="set_use_local_coordinates" getter="get_use_local_coordinates" brief=""> </member> - <member name="randomness/hue_variation" type="float" setter="set_randomness" getter="get_randomness" brief=""> + <member name="normal_map" type="Texture" setter="set_normal_map" getter="get_normal_map" brief=""> </member> - <member name="randomness/initial_angle" type="float" setter="set_randomness" getter="get_randomness" brief=""> + <member name="one_shot" type="bool" setter="set_one_shot" getter="get_one_shot" brief=""> </member> - <member name="randomness/initial_size" type="float" setter="set_randomness" getter="get_randomness" brief=""> + <member name="preprocess" type="float" setter="set_pre_process_time" getter="get_pre_process_time" brief=""> </member> - <member name="randomness/linear_velocity" type="float" setter="set_randomness" getter="get_randomness" brief=""> + <member name="process_material" type="ShaderMaterial,ParticlesMaterial" setter="set_process_material" getter="get_process_material" brief=""> </member> - <member name="randomness/orbit_velocity" type="float" setter="set_randomness" getter="get_randomness" brief=""> + <member name="randomness" type="float" setter="set_randomness_ratio" getter="get_randomness_ratio" brief=""> </member> - <member name="randomness/radial_accel" type="float" setter="set_randomness" getter="get_randomness" brief=""> + <member name="speed_scale" type="float" setter="set_speed_scale" getter="get_speed_scale" brief=""> </member> - <member name="randomness/spin_velocity" type="float" setter="set_randomness" getter="get_randomness" brief=""> + <member name="texture" type="Texture" setter="set_texture" getter="get_texture" brief=""> </member> - <member name="randomness/spread" type="float" setter="set_randomness" getter="get_randomness" brief=""> + <member name="v_frames" type="int" setter="set_v_frames" getter="get_v_frames" brief=""> </member> - <member name="randomness/tangential_accel" type="float" setter="set_randomness" getter="get_randomness" brief=""> + <member name="visibility_rect" type="Rect3" setter="set_visibility_rect" getter="get_visibility_rect" brief=""> </member> </members> - <signals> - <signal name="emission_finished"> - <description> - </description> - </signal> - </signals> <constants> - <constant name="PARAM_DIRECTION" value="0"> - Direction in degrees at which the particles will be launched, Notice that when the direction is set to 0 the particles will be launched to the negative - </constant> - <constant name="PARAM_SPREAD" value="1"> - </constant> - <constant name="PARAM_LINEAR_VELOCITY" value="2"> - Velocity at which the particles will be launched. - </constant> - <constant name="PARAM_SPIN_VELOCITY" value="3"> - The speed at which particles will spin around its own center. - </constant> - <constant name="PARAM_ORBIT_VELOCITY" value="4"> - Velocity at which the particles will orbit around the emitter center - </constant> - <constant name="PARAM_GRAVITY_DIRECTION" value="5"> - Direction in degrees at which the particles will be attracted - </constant> - <constant name="PARAM_GRAVITY_STRENGTH" value="6"> - Strength of the gravitation attraction for each particle - </constant> - <constant name="PARAM_RADIAL_ACCEL" value="7"> - </constant> - <constant name="PARAM_TANGENTIAL_ACCEL" value="8"> - </constant> - <constant name="PARAM_DAMPING" value="9"> - Amount of damping for each particle - </constant> - <constant name="PARAM_INITIAL_ANGLE" value="10"> - Initial angle in radians at which each particle will be spawned - </constant> - <constant name="PARAM_INITIAL_SIZE" value="11"> - Initial size of each particle - </constant> - <constant name="PARAM_FINAL_SIZE" value="12"> - Final size of each particle, the particle size will interpolate to this value during its lifetime. - </constant> - <constant name="PARAM_HUE_VARIATION" value="13"> - </constant> - <constant name="PARAM_ANIM_SPEED_SCALE" value="14"> - </constant> - <constant name="PARAM_ANIM_INITIAL_POS" value="15"> - </constant> - <constant name="PARAM_MAX" value="16"> + <constant name="DRAW_ORDER_INDEX" value="0"> </constant> - <constant name="MAX_COLOR_PHASES" value="4"> + <constant name="DRAW_ORDER_LIFETIME" value="1"> </constant> </constants> </class> @@ -28986,6 +29518,12 @@ <description> </description> </method> + <method name="get_emission_color_texture" qualifiers="const"> + <return type="Texture"> + </return> + <description> + </description> + </method> <method name="get_emission_normal_texture" qualifiers="const"> <return type="Texture"> </return> @@ -29102,6 +29640,12 @@ <description> </description> </method> + <method name="set_emission_color_texture"> + <argument index="0" name="texture" type="Texture"> + </argument> + <description> + </description> + </method> <method name="set_emission_normal_texture"> <argument index="0" name="texture" type="Texture"> </argument> @@ -29214,6 +29758,8 @@ </member> <member name="angular_velocity_random" type="float" setter="set_param_randomness" getter="get_param_randomness" brief=""> </member> + <member name="anim_loop" type="bool" setter="set_flag" getter="get_flag" brief=""> + </member> <member name="anim_offset" type="float" setter="set_param" getter="get_param" brief=""> </member> <member name="anim_offset_curve" type="CurveTexture" setter="set_param_texture" getter="get_param_texture" brief=""> @@ -29238,6 +29784,8 @@ </member> <member name="emission_box_extents" type="Vector3" setter="set_emission_box_extents" getter="get_emission_box_extents" brief=""> </member> + <member name="emission_color_texture" type="Texture" setter="set_emission_color_texture" getter="get_emission_color_texture" brief=""> + </member> <member name="emission_normal_texture" type="Texture" setter="set_emission_normal_texture" getter="get_emission_normal_texture" brief=""> </member> <member name="emission_point_count" type="int" setter="set_emission_point_count" getter="get_emission_point_count" brief=""> @@ -29250,6 +29798,8 @@ </member> <member name="flag_align_y" type="bool" setter="set_flag" getter="get_flag" brief=""> </member> + <member name="flag_disable_z" type="bool" setter="set_flag" getter="get_flag" brief=""> + </member> <member name="flag_rotate_y" type="bool" setter="set_flag" getter="get_flag" brief=""> </member> <member name="flatness" type="float" setter="set_flatness" getter="get_flatness" brief=""> @@ -29336,7 +29886,7 @@ </constant> <constant name="FLAG_ROTATE_Y" value="1"> </constant> - <constant name="FLAG_MAX" value="2"> + <constant name="FLAG_MAX" value="4"> </constant> <constant name="EMISSION_SHAPE_POINT" value="0"> </constant> @@ -30273,6 +30823,16 @@ Substitute a given area shape by another. The old shape is selected by its index, the new one by its [RID]. </description> </method> + <method name="area_set_shape_disabled"> + <argument index="0" name="area" type="RID"> + </argument> + <argument index="1" name="shape_idx" type="int"> + </argument> + <argument index="2" name="disable" type="bool"> + </argument> + <description> + </description> + </method> <method name="area_set_shape_transform"> <argument index="0" name="area" type="RID"> </argument> @@ -30434,24 +30994,6 @@ Get the instance ID of the object the area is assigned to. </description> </method> - <method name="body_get_one_way_collision_direction" qualifiers="const"> - <return type="Vector2"> - </return> - <argument index="0" name="body" type="RID"> - </argument> - <description> - Return the direction used for one-way collision detection. - </description> - </method> - <method name="body_get_one_way_collision_max_depth" qualifiers="const"> - <return type="float"> - </return> - <argument index="0" name="body" type="RID"> - </argument> - <description> - Return how far a body can go through the given one, when it allows one-way collisions. - </description> - </method> <method name="body_get_param" qualifiers="const"> <return type="float"> </return> @@ -30530,17 +31072,6 @@ Return whether a body uses a callback function to calculate its own physics (see [method body_set_force_integration_callback]). </description> </method> - <method name="body_is_shape_set_as_trigger" qualifiers="const"> - <return type="bool"> - </return> - <argument index="0" name="body" type="RID"> - </argument> - <argument index="1" name="shape_idx" type="int"> - </argument> - <description> - Return whether a body's shape is marked as a trigger. - </description> - </method> <method name="body_remove_collision_exception"> <argument index="0" name="body" type="RID"> </argument> @@ -30636,24 +31167,6 @@ Set whether a body uses a callback function to calculate its own physics (see [method body_set_force_integration_callback]). </description> </method> - <method name="body_set_one_way_collision_direction"> - <argument index="0" name="body" type="RID"> - </argument> - <argument index="1" name="normal" type="Vector2"> - </argument> - <description> - Set a direction in which bodies can go through the given one. If this value is different from (0,0), any movement within 90 degrees of this vector is considered a valid movement. Set this direction to (0,0) to disable one-way collisions. - </description> - </method> - <method name="body_set_one_way_collision_max_depth"> - <argument index="0" name="body" type="RID"> - </argument> - <argument index="1" name="depth" type="float"> - </argument> - <description> - Set how far a body can go through the given one, if it allows one-way collisions (see [method body_set_one_way_collision_direction]). - </description> - </method> <method name="body_set_param"> <argument index="0" name="body" type="RID"> </argument> @@ -30676,7 +31189,7 @@ Substitute a given body shape by another. The old shape is selected by its index, the new one by its [RID]. </description> </method> - <method name="body_set_shape_as_trigger"> + <method name="body_set_shape_as_one_way_collision"> <argument index="0" name="body" type="RID"> </argument> <argument index="1" name="shape_idx" type="int"> @@ -30684,7 +31197,16 @@ <argument index="2" name="enable" type="bool"> </argument> <description> - Mark a body's shape as a trigger. A trigger shape cannot affect other bodies, but detects other shapes entering and exiting it. + </description> + </method> + <method name="body_set_shape_disabled"> + <argument index="0" name="body" type="RID"> + </argument> + <argument index="1" name="shape_idx" type="int"> + </argument> + <argument index="2" name="disable" type="bool"> + </argument> + <description> </description> </method> <method name="body_set_shape_metadata"> @@ -30968,11 +31490,9 @@ <constant name="SPACE_PARAM_BODY_MAX_ALLOWED_PENETRATION" value="2"> Constant to set/get the maximum distance a shape can penetrate another shape before it is considered a collision. </constant> - <constant name="SPACE_PARAM_BODY_LINEAR_VELOCITY_SLEEP_TRESHOLD" value="3"> - Constant to set/get the linear velocity threshold. Bodies slower than this will be marked as potentially inactive. + <constant name="SPACE_PARAM_BODY_LINEAR_VELOCITY_SLEEP_THRESHOLD" value="3"> </constant> - <constant name="SPACE_PARAM_BODY_ANGULAR_VELOCITY_SLEEP_TRESHOLD" value="4"> - Constant to set/get the angular velocity threshold. Bodies slower than this will be marked as potentially inactive. + <constant name="SPACE_PARAM_BODY_ANGULAR_VELOCITY_SLEEP_THRESHOLD" value="4"> </constant> <constant name="SPACE_PARAM_BODY_TIME_TO_SLEEP" value="5"> Constant to set/get the maximum time of activity. A body marked as potentially inactive for both linear and angular velocity will be put to sleep after this time. @@ -31512,20 +32032,6 @@ Return an individual bit on the collision mask. </description> </method> - <method name="get_one_way_collision_direction" qualifiers="const"> - <return type="Vector2"> - </return> - <description> - Return the direction used for one-way collision detection. - </description> - </method> - <method name="get_one_way_collision_max_depth" qualifiers="const"> - <return type="float"> - </return> - <description> - Return how far a body can go through this one, when it allows one-way collisions. - </description> - </method> <method name="remove_collision_exception_with"> <argument index="0" name="body" type="PhysicsBody2D"> </argument> @@ -31567,20 +32073,6 @@ Set/clear individual bits on the collision mask. This makes selecting the areas scanned easier. </description> </method> - <method name="set_one_way_collision_direction"> - <argument index="0" name="dir" type="Vector2"> - </argument> - <description> - Set a direction in which bodies can go through this one. If this value is different from (0,0), any movement within 90 degrees of this vector is considered a valid movement. Set this direction to (0,0) to disable one-way collisions. - </description> - </method> - <method name="set_one_way_collision_max_depth"> - <argument index="0" name="depth" type="float"> - </argument> - <description> - Set how far a body can go through this one, when it allows one-way collisions (see [method set_one_way_collision_direction]). - </description> - </method> </methods> <members> <member name="collision_layer" type="int" setter="set_collision_layer" getter="get_collision_layer" brief=""> @@ -31589,10 +32081,6 @@ </member> <member name="layers" type="int" setter="_set_layers" getter="_get_layers" brief=""> </member> - <member name="one_way_collision/direction" type="Vector2" setter="set_one_way_collision_direction" getter="get_one_way_collision_direction" brief=""> - </member> - <member name="one_way_collision/max_depth" type="float" setter="set_one_way_collision_max_depth" getter="get_one_way_collision_max_depth" brief=""> - </member> </members> <constants> </constants> @@ -33793,7 +34281,7 @@ <argument index="0" name="compression_mode" type="int" default="0"> </argument> <description> - Returns a new [PoolByteArray] with the data compressed. The compression mode can be set using one of the COMPRESS_* constants of [File]. + Returns a new [PoolByteArray] with the data compressed. The compression mode can be set using one of the COMPRESS_* constants of [File]. </description> </method> <method name="decompress"> @@ -33804,7 +34292,7 @@ <argument index="1" name="compression_mode" type="int" default="0"> </argument> <description> - Returns a new [PoolByteArray] with the data decompressed. The buffer_size should be set as the size of the uncompressed data. The compression mode can be set using one of the COMPRESS_* constants of [File]. + Returns a new [PoolByteArray] with the data decompressed. The buffer_size should be set as the size of the uncompressed data. The compression mode can be set using one of the COMPRESS_* constants of [File]. </description> </method> <method name="get_string_from_ascii"> @@ -34678,6 +35166,8 @@ </description> </method> <method name="get_item_metadata" qualifiers="const"> + <return type="Variant"> + </return> <argument index="0" name="idx" type="int"> </argument> <description> @@ -34718,6 +35208,13 @@ <description> </description> </method> + <method name="is_hide_on_checkable_item_selection"> + <return type="bool"> + </return> + <description> + Returns a boolean that indicates whether or not the PopupMenu will hide on checkable item selection. + </description> + </method> <method name="is_hide_on_item_selection"> <return type="bool"> </return> @@ -34725,13 +35222,6 @@ Returns a boolean that indicates whether or not the PopupMenu will hide on item selection. </description> </method> - <method name="is_hide_on_checkable_item_selection"> - <return type="bool"> - </return> - <description> - Returns a boolean that indicates whether or not the PopupMenu will hide on checkable item selection. - </description> - </method> <method name="is_item_checkable" qualifiers="const"> <return type="bool"> </return> @@ -34775,6 +35265,13 @@ Removes the item at index "idx" from the menu. Note that the indexes of items after the removed item are going to be shifted by one. </description> </method> + <method name="set_hide_on_checkable_item_selection"> + <argument index="0" name="enable" type="bool"> + </argument> + <description> + Sets whether or not the PopupMenu will hide on checkable item selection. + </description> + </method> <method name="set_hide_on_item_selection"> <argument index="0" name="enable" type="bool"> </argument> @@ -34782,13 +35279,6 @@ Sets whether or not the PopupMenu will hide on item selection. </description> </method> - <method name="set_hide_on_checkable_item_selection"> - <argument index="0" name="enable" type="bool"> - </argument> - <description> - Sets whether or not the PopupMenu will hide on checkable item selection. - </description> - </method> <method name="set_item_ID"> <argument index="0" name="idx" type="int"> </argument> @@ -34905,6 +35395,8 @@ </method> </methods> <members> + <member name="hide_on_checkable_item_selection" type="bool" setter="set_hide_on_checkable_item_selection" getter="is_hide_on_checkable_item_selection" brief=""> + </member> <member name="hide_on_item_selection" type="bool" setter="set_hide_on_item_selection" getter="is_hide_on_item_selection" brief=""> </member> <member name="items" type="Array" setter="_set_items" getter="_get_items" brief=""> @@ -36384,6 +36876,7 @@ Ending corner. </member> <member name="position" type="Vector2" setter="" getter="" brief=""> + Position (starting corner). </member> <member name="size" type="Vector2" setter="" getter="" brief=""> Size from position to end. @@ -36580,8 +37073,7 @@ <member name="end" type="Vector3" setter="" getter="" brief=""> Ending corner. </member> - <member name="pos" type="Vector3" setter="" getter="" brief=""> - Position (starting corner). + <member name="position" type="Vector3" setter="" getter="" brief=""> </member> <member name="size" type="Vector3" setter="" getter="" brief=""> Size from position to end. @@ -36924,7 +37416,7 @@ </description> </method> <method name="search" qualifiers="const"> - <return type="Object"> + <return type="RegExMatch"> </return> <argument index="0" name="text" type="String"> </argument> @@ -37047,16 +37539,72 @@ <description> </description> </method> + <method name="get_update_position" qualifiers="const"> + <return type="bool"> + </return> + <description> + </description> + </method> + <method name="get_update_rotation" qualifiers="const"> + <return type="bool"> + </return> + <description> + </description> + </method> + <method name="get_update_scale" qualifiers="const"> + <return type="bool"> + </return> + <description> + </description> + </method> + <method name="get_use_global_coordinates" qualifiers="const"> + <return type="bool"> + </return> + <description> + </description> + </method> <method name="set_remote_node"> <argument index="0" name="path" type="NodePath"> </argument> <description> </description> </method> + <method name="set_update_position"> + <argument index="0" name="update_remote_position" type="bool"> + </argument> + <description> + </description> + </method> + <method name="set_update_rotation"> + <argument index="0" name="update_remote_rotation" type="bool"> + </argument> + <description> + </description> + </method> + <method name="set_update_scale"> + <argument index="0" name="update_remote_scale" type="bool"> + </argument> + <description> + </description> + </method> + <method name="set_use_global_coordinates"> + <argument index="0" name="use_global_coordinates" type="bool"> + </argument> + <description> + </description> + </method> </methods> <members> <member name="remote_path" type="NodePath" setter="set_remote_node" getter="get_remote_node" brief=""> </member> + <member name="update_position" type="bool" setter="set_update_position" getter="get_update_position" brief=""> + </member> + <member name="update_rotation" type="bool" setter="set_update_rotation" getter="get_update_rotation" brief=""> + </member> + <member name="update_scale" type="bool" setter="set_update_scale" getter="get_update_scale" brief=""> + </member> + <member name="use_global_coordinates" type="bool" setter="set_use_global_coordinates" getter="get_use_global_coordinates" brief=""> + </member> </members> <constants> </constants> @@ -37073,16 +37621,72 @@ <description> </description> </method> + <method name="get_update_position" qualifiers="const"> + <return type="bool"> + </return> + <description> + </description> + </method> + <method name="get_update_rotation" qualifiers="const"> + <return type="bool"> + </return> + <description> + </description> + </method> + <method name="get_update_scale" qualifiers="const"> + <return type="bool"> + </return> + <description> + </description> + </method> + <method name="get_use_global_coordinates" qualifiers="const"> + <return type="bool"> + </return> + <description> + </description> + </method> <method name="set_remote_node"> <argument index="0" name="path" type="NodePath"> </argument> <description> </description> </method> + <method name="set_update_position"> + <argument index="0" name="update_remote_position" type="bool"> + </argument> + <description> + </description> + </method> + <method name="set_update_rotation"> + <argument index="0" name="update_remote_rotation" type="bool"> + </argument> + <description> + </description> + </method> + <method name="set_update_scale"> + <argument index="0" name="update_remote_scale" type="bool"> + </argument> + <description> + </description> + </method> + <method name="set_use_global_coordinates"> + <argument index="0" name="use_global_coordinates" type="bool"> + </argument> + <description> + </description> + </method> </methods> <members> <member name="remote_path" type="NodePath" setter="set_remote_node" getter="get_remote_node" brief=""> </member> + <member name="update_position" type="bool" setter="set_update_position" getter="get_update_position" brief=""> + </member> + <member name="update_rotation" type="bool" setter="set_update_rotation" getter="get_update_rotation" brief=""> + </member> + <member name="update_scale" type="bool" setter="set_update_scale" getter="get_update_scale" brief=""> + </member> + <member name="use_global_coordinates" type="bool" setter="set_use_global_coordinates" getter="get_use_global_coordinates" brief=""> + </member> </members> <constants> </constants> @@ -37472,6 +38076,12 @@ <description> </description> </method> + <method name="get_percent_visible" qualifiers="const"> + <return type="float"> + </return> + <description> + </description> + </method> <method name="get_tab_size" qualifiers="const"> <return type="int"> </return> @@ -37492,7 +38102,7 @@ </description> </method> <method name="get_v_scroll"> - <return type="Object"> + <return type="VScrollBar"> </return> <description> </description> @@ -37567,7 +38177,7 @@ </description> </method> <method name="push_font"> - <argument index="0" name="font" type="Object"> + <argument index="0" name="font" type="Font"> </argument> <description> </description> @@ -37626,6 +38236,12 @@ <description> </description> </method> + <method name="set_percent_visible"> + <argument index="0" name="percent_visible" type="float"> + </argument> + <description> + </description> + </method> <method name="set_scroll_active"> <argument index="0" name="active" type="bool"> </argument> @@ -37661,6 +38277,12 @@ <description> </description> </method> + <method name="set_text"> + <argument index="0" name="text" type="String"> + </argument> + <description> + </description> + </method> <method name="set_use_bbcode"> <argument index="0" name="enable" type="bool"> </argument> @@ -37679,6 +38301,8 @@ </member> <member name="bbcode_text" type="String" setter="set_bbcode" getter="get_bbcode" brief=""> </member> + <member name="percent_visible" type="float" setter="set_percent_visible" getter="get_percent_visible" brief=""> + </member> <member name="visible_characters" type="int" setter="set_visible_characters" getter="get_visible_characters" brief=""> </member> </members> @@ -38761,6 +39385,8 @@ </description> </method> <method name="get_node_property_value" qualifiers="const"> + <return type="Variant"> + </return> <argument index="0" name="idx" type="int"> </argument> <argument index="1" name="prop_idx" type="int"> @@ -38862,6 +39488,12 @@ <description> </description> </method> + <method name="get_network_connected_peers" qualifiers="const"> + <return type="PoolIntArray"> + </return> + <description> + </description> + </method> <method name="get_network_unique_id" qualifiers="const"> <return type="int"> </return> @@ -39507,6 +40139,8 @@ </description> </method> <method name="get_shader_param" qualifiers="const"> + <return type="Variant"> + </return> <argument index="0" name="param" type="String"> </argument> <description> @@ -39933,6 +40567,18 @@ Return true if ticks are visible on borders. </description> </method> + <method name="is_editable" qualifiers="const"> + <return type="bool"> + </return> + <description> + </description> + </method> + <method name="set_editable"> + <argument index="0" name="editable" type="bool"> + </argument> + <description> + </description> + </method> <method name="set_ticks"> <argument index="0" name="count" type="int"> </argument> @@ -39949,6 +40595,8 @@ </method> </methods> <members> + <member name="editable" type="bool" setter="set_editable" getter="is_editable" brief=""> + </member> <member name="focus_mode" type="int" setter="set_focus_mode" getter="get_focus_mode" brief=""> </member> <member name="tick_count" type="int" setter="set_ticks" getter="get_ticks" brief=""> @@ -40497,6 +41145,12 @@ <description> </description> </method> + <method name="get_grow" qualifiers="const"> + <return type="float"> + </return> + <description> + </description> + </method> <method name="get_line_width" qualifiers="const"> <return type="float"> </return> @@ -40569,6 +41223,12 @@ <description> </description> </method> + <method name="get_specular_mode" qualifiers="const"> + <return type="int"> + </return> + <description> + </description> + </method> <method name="get_subsurface_scattering_strength" qualifiers="const"> <return type="float"> </return> @@ -40584,25 +41244,37 @@ </description> </method> <method name="get_uv1_offset" qualifiers="const"> - <return type="Vector2"> + <return type="Vector3"> </return> <description> </description> </method> <method name="get_uv1_scale" qualifiers="const"> - <return type="Vector2"> + <return type="Vector3"> + </return> + <description> + </description> + </method> + <method name="get_uv1_triplanar_blend_sharpness" qualifiers="const"> + <return type="float"> </return> <description> </description> </method> <method name="get_uv2_offset" qualifiers="const"> - <return type="Vector2"> + <return type="Vector3"> </return> <description> </description> </method> <method name="get_uv2_scale" qualifiers="const"> - <return type="Vector2"> + <return type="Vector3"> + </return> + <description> + </description> + </method> + <method name="get_uv2_triplanar_blend_sharpness" qualifiers="const"> + <return type="float"> </return> <description> </description> @@ -40613,6 +41285,12 @@ <description> </description> </method> + <method name="is_grow_enabled" qualifiers="const"> + <return type="bool"> + </return> + <description> + </description> + </method> <method name="set_albedo"> <argument index="0" name="albedo" type="Color"> </argument> @@ -40731,6 +41409,18 @@ <description> </description> </method> + <method name="set_grow"> + <argument index="0" name="amount" type="float"> + </argument> + <description> + </description> + </method> + <method name="set_grow_enabled"> + <argument index="0" name="enable" type="bool"> + </argument> + <description> + </description> + </method> <method name="set_line_width"> <argument index="0" name="line_width" type="float"> </argument> @@ -40803,6 +41493,12 @@ <description> </description> </method> + <method name="set_specular_mode"> + <argument index="0" name="specular_mode" type="int"> + </argument> + <description> + </description> + </method> <method name="set_subsurface_scattering_strength"> <argument index="0" name="strength" type="float"> </argument> @@ -40818,25 +41514,37 @@ </description> </method> <method name="set_uv1_offset"> - <argument index="0" name="offset" type="Vector2"> + <argument index="0" name="offset" type="Vector3"> </argument> <description> </description> </method> <method name="set_uv1_scale"> - <argument index="0" name="scale" type="Vector2"> + <argument index="0" name="scale" type="Vector3"> + </argument> + <description> + </description> + </method> + <method name="set_uv1_triplanar_blend_sharpness"> + <argument index="0" name="sharpness" type="float"> </argument> <description> </description> </method> <method name="set_uv2_offset"> - <argument index="0" name="offset" type="Vector2"> + <argument index="0" name="offset" type="Vector3"> </argument> <description> </description> </method> <method name="set_uv2_scale"> - <argument index="0" name="scale" type="Vector2"> + <argument index="0" name="scale" type="Vector3"> + </argument> + <description> + </description> + </method> + <method name="set_uv2_triplanar_blend_sharpness"> + <argument index="0" name="sharpness" type="float"> </argument> <description> </description> @@ -40847,7 +41555,7 @@ </member> <member name="albedo_texture" type="Texture" setter="set_texture" getter="get_texture" brief=""> </member> - <member name="anisotropy_anisotropy" type="float" setter="set_anisotropy" getter="get_anisotropy" brief=""> + <member name="anisotropy" type="float" setter="set_anisotropy" getter="get_anisotropy" brief=""> </member> <member name="anisotropy_enabled" type="bool" setter="set_feature" getter="get_feature" brief=""> </member> @@ -40855,9 +41563,11 @@ </member> <member name="ao_enabled" type="bool" setter="set_feature" getter="get_feature" brief=""> </member> + <member name="ao_on_uv2" type="bool" setter="set_flag" getter="get_flag" brief=""> + </member> <member name="ao_texture" type="Texture" setter="set_texture" getter="get_texture" brief=""> </member> - <member name="clearcoat_amount" type="float" setter="set_clearcoat" getter="get_clearcoat" brief=""> + <member name="clearcoat" type="float" setter="set_clearcoat" getter="get_clearcoat" brief=""> </member> <member name="clearcoat_enabled" type="bool" setter="set_feature" getter="get_feature" brief=""> </member> @@ -40889,7 +41599,7 @@ </member> <member name="detail_uv_layer" type="int" setter="set_detail_uv" getter="get_detail_uv" brief=""> </member> - <member name="emission_color" type="Color" setter="set_emission" getter="get_emission" brief=""> + <member name="emission" type="Color" setter="set_emission" getter="get_emission" brief=""> </member> <member name="emission_enabled" type="bool" setter="set_feature" getter="get_feature" brief=""> </member> @@ -40907,7 +41617,7 @@ </member> <member name="flags_use_point_size" type="bool" setter="set_flag" getter="get_flag" brief=""> </member> - <member name="metallic_amount" type="float" setter="set_metallic" getter="get_metallic" brief=""> + <member name="metallic" type="float" setter="set_metallic" getter="get_metallic" brief=""> </member> <member name="metallic_specular" type="float" setter="set_specular" getter="get_specular" brief=""> </member> @@ -40929,10 +41639,16 @@ </member> <member name="params_diffuse_mode" type="int" setter="set_diffuse_mode" getter="get_diffuse_mode" brief=""> </member> + <member name="params_grow" type="bool" setter="set_grow_enabled" getter="is_grow_enabled" brief=""> + </member> + <member name="params_grow_amount" type="float" setter="set_grow" getter="get_grow" brief=""> + </member> <member name="params_line_width" type="float" setter="set_line_width" getter="get_line_width" brief=""> </member> <member name="params_point_size" type="float" setter="set_point_size" getter="get_point_size" brief=""> </member> + <member name="params_specular_mode" type="int" setter="set_specular_mode" getter="get_specular_mode" brief=""> + </member> <member name="particles_anim_h_frames" type="int" setter="set_particles_anim_h_frames" getter="get_particles_anim_h_frames" brief=""> </member> <member name="particles_anim_loop" type="bool" setter="set_particles_anim_loop" getter="get_particles_anim_loop" brief=""> @@ -40945,7 +41661,7 @@ </member> <member name="refraction_texture" type="Texture" setter="set_texture" getter="get_texture" brief=""> </member> - <member name="rim_amount" type="float" setter="set_rim" getter="get_rim" brief=""> + <member name="rim" type="float" setter="set_rim" getter="get_rim" brief=""> </member> <member name="rim_enabled" type="bool" setter="set_feature" getter="get_feature" brief=""> </member> @@ -40953,7 +41669,7 @@ </member> <member name="rim_tint" type="float" setter="set_rim_tint" getter="get_rim_tint" brief=""> </member> - <member name="roughness_amount" type="float" setter="set_roughness" getter="get_roughness" brief=""> + <member name="roughness" type="float" setter="set_roughness" getter="get_roughness" brief=""> </member> <member name="roughness_texture" type="Texture" setter="set_texture" getter="get_texture" brief=""> </member> @@ -40963,13 +41679,21 @@ </member> <member name="subsurf_scatter_texture" type="Texture" setter="set_texture" getter="get_texture" brief=""> </member> - <member name="uv1_offset" type="Vector2" setter="set_uv1_offset" getter="get_uv1_offset" brief=""> + <member name="uv1_offset" type="Vector3" setter="set_uv1_offset" getter="get_uv1_offset" brief=""> + </member> + <member name="uv1_scale" type="Vector3" setter="set_uv1_scale" getter="get_uv1_scale" brief=""> + </member> + <member name="uv1_triplanar" type="bool" setter="set_flag" getter="get_flag" brief=""> + </member> + <member name="uv1_triplanar_sharpness" type="float" setter="set_uv1_triplanar_blend_sharpness" getter="get_uv1_triplanar_blend_sharpness" brief=""> + </member> + <member name="uv2_offset" type="Vector3" setter="set_uv2_offset" getter="get_uv2_offset" brief=""> </member> - <member name="uv1_scale" type="Vector2" setter="set_uv1_scale" getter="get_uv1_scale" brief=""> + <member name="uv2_scale" type="Vector3" setter="set_uv2_scale" getter="get_uv2_scale" brief=""> </member> - <member name="uv2_offset" type="Vector2" setter="set_uv2_offset" getter="get_uv2_offset" brief=""> + <member name="uv2_triplanar" type="bool" setter="set_flag" getter="get_flag" brief=""> </member> - <member name="uv2_scale" type="Vector2" setter="set_uv2_scale" getter="get_uv2_scale" brief=""> + <member name="uv2_triplanar_sharpness" type="float" setter="set_uv2_triplanar_blend_sharpness" getter="get_uv2_triplanar_blend_sharpness" brief=""> </member> <member name="vertex_color_is_srgb" type="bool" setter="set_flag" getter="get_flag" brief=""> </member> @@ -41071,7 +41795,7 @@ </constant> <constant name="FLAG_FIXED_SIZE" value="5"> </constant> - <constant name="FLAG_MAX" value="6"> + <constant name="FLAG_MAX" value="9"> </constant> <constant name="DIFFUSE_LAMBERT" value="0"> </constant> @@ -41081,6 +41805,18 @@ </constant> <constant name="DIFFUSE_BURLEY" value="3"> </constant> + <constant name="DIFFUSE_TOON" value="4"> + </constant> + <constant name="SPECULAR_SCHLICK_GGX" value="0"> + </constant> + <constant name="SPECULAR_BLINN" value="1"> + </constant> + <constant name="SPECULAR_PHONG" value="2"> + </constant> + <constant name="SPECULAR_TOON" value="3"> + </constant> + <constant name="SPECULAR_DISABLED" value="4"> + </constant> <constant name="BILLBOARD_DISABLED" value="0"> </constant> <constant name="BILLBOARD_ENABLED" value="1"> @@ -41091,6 +41827,46 @@ </constant> </constants> </class> +<class name="SpatialVelocityTracker" inherits="Reference" category="Core"> + <brief_description> + </brief_description> + <description> + </description> + <methods> + <method name="get_tracked_linear_velocity" qualifiers="const"> + <return type="Vector3"> + </return> + <description> + </description> + </method> + <method name="is_tracking_fixed_step" qualifiers="const"> + <return type="bool"> + </return> + <description> + </description> + </method> + <method name="reset"> + <argument index="0" name="position" type="Vector3"> + </argument> + <description> + </description> + </method> + <method name="set_track_fixed_step"> + <argument index="0" name="enable" type="bool"> + </argument> + <description> + </description> + </method> + <method name="update_position"> + <argument index="0" name="position" type="Vector3"> + </argument> + <description> + </description> + </method> + </methods> + <constants> + </constants> +</class> <class name="SphereMesh" inherits="PrimitiveMesh" category="Core"> <brief_description> </brief_description> @@ -41394,6 +42170,12 @@ Return the amount of horizontal frames. See [method set_hframes]. </description> </method> + <method name="get_normal_map" qualifiers="const"> + <return type="Texture"> + </return> + <description> + </description> + </method> <method name="get_offset" qualifiers="const"> <return type="Vector2"> </return> @@ -41450,6 +42232,12 @@ Return if the sprite reads from a region. </description> </method> + <method name="is_region_filter_clip_enabled" qualifiers="const"> + <return type="bool"> + </return> + <description> + </description> + </method> <method name="set_centered"> <argument index="0" name="centered" type="bool"> </argument> @@ -41485,6 +42273,12 @@ Set the amount of horizontal frames and converts the sprite into a sprite-sheet. This is useful for animation. </description> </method> + <method name="set_normal_map"> + <argument index="0" name="normal_map" type="Texture"> + </argument> + <description> + </description> + </method> <method name="set_offset"> <argument index="0" name="offset" type="Vector2"> </argument> @@ -41499,6 +42293,12 @@ Set the sprite as a sub-region of a bigger texture. Useful for texture-atlases. </description> </method> + <method name="set_region_filter_clip"> + <argument index="0" name="enabled" type="bool"> + </argument> + <description> + </description> + </method> <method name="set_region_rect"> <argument index="0" name="rect" type="Rect2"> </argument> @@ -41532,9 +42332,13 @@ </member> <member name="hframes" type="int" setter="set_hframes" getter="get_hframes" brief=""> </member> + <member name="normal_map" type="Texture" setter="set_normal_map" getter="get_normal_map" brief=""> + </member> <member name="offset" type="Vector2" setter="set_offset" getter="get_offset" brief=""> </member> - <member name="region" type="bool" setter="set_region" getter="is_region" brief=""> + <member name="region_enabled" type="bool" setter="set_region" getter="is_region" brief=""> + </member> + <member name="region_filter_clip" type="bool" setter="set_region_filter_clip" getter="is_region_filter_clip_enabled" brief=""> </member> <member name="region_rect" type="Rect2" setter="set_region_rect" getter="get_region_rect" brief=""> </member> @@ -41640,7 +42444,7 @@ </member> <member name="hframes" type="int" setter="set_hframes" getter="get_hframes" brief=""> </member> - <member name="region" type="bool" setter="set_region" getter="is_region" brief=""> + <member name="region_enabled" type="bool" setter="set_region" getter="is_region" brief=""> </member> <member name="region_rect" type="Rect2" setter="set_region_rect" getter="get_region_rect" brief=""> </member> @@ -41802,6 +42606,8 @@ </member> <member name="centered" type="bool" setter="set_centered" getter="is_centered" brief=""> </member> + <member name="double_sided" type="bool" setter="set_draw_flag" getter="get_draw_flag" brief=""> + </member> <member name="flip_h" type="bool" setter="set_flip_h" getter="is_flipped_h" brief=""> </member> <member name="flip_v" type="bool" setter="set_flip_v" getter="is_flipped_v" brief=""> @@ -41824,7 +42630,9 @@ </constant> <constant name="FLAG_SHADED" value="1"> </constant> - <constant name="FLAG_MAX" value="2"> + <constant name="FLAG_DOUBLE_SIDED" value="2"> + </constant> + <constant name="FLAG_MAX" value="3"> </constant> <constant name="ALPHA_CUT_DISABLED" value="0"> </constant> @@ -43543,6 +44351,12 @@ <description> </description> </method> + <method name="get_normal_map" qualifiers="const"> + <return type="Texture"> + </return> + <description> + </description> + </method> <method name="get_region_rect" qualifiers="const"> <return type="Rect2"> </return> @@ -43583,6 +44397,12 @@ <description> </description> </method> + <method name="set_normal_map"> + <argument index="0" name="normal_map" type="Texture"> + </argument> + <description> + </description> + </method> <method name="set_region_rect"> <argument index="0" name="region" type="Rect2"> </argument> @@ -43617,6 +44437,8 @@ </member> <member name="modulate_color" type="Color" setter="set_modulate" getter="get_modulate" brief=""> </member> + <member name="normal_map" type="Texture" setter="set_normal_map" getter="get_normal_map" brief=""> + </member> <member name="region_rect" type="Rect2" setter="set_region_rect" getter="get_region_rect" brief=""> </member> <member name="texture" type="Texture" setter="set_texture" getter="get_texture" brief=""> @@ -44152,6 +44974,12 @@ </member> </members> <signals> + <signal name="reposition_active_tab_request"> + <argument index="0" name="idx_to" type="int"> + </argument> + <description> + </description> + </signal> <signal name="right_button_pressed"> <argument index="0" name="tab" type="int"> </argument> @@ -44713,6 +45541,8 @@ </argument> <argument index="3" name="transpose" type="bool" default="false"> </argument> + <argument index="4" name="normal_map" type="Texture" default="NULL"> + </argument> <description> </description> </method> @@ -44727,6 +45557,8 @@ </argument> <argument index="4" name="transpose" type="bool" default="false"> </argument> + <argument index="5" name="normal_map" type="Texture" default="NULL"> + </argument> <description> </description> </method> @@ -44741,6 +45573,10 @@ </argument> <argument index="4" name="transpose" type="bool" default="false"> </argument> + <argument index="5" name="normal_map" type="Texture" default="NULL"> + </argument> + <argument index="6" name="clip_uv" type="bool" default="true"> + </argument> <description> </description> </method> @@ -45998,6 +46834,18 @@ Remove the tile referenced by the given ID. </description> </method> + <method name="tile_add_shape"> + <argument index="0" name="id" type="int"> + </argument> + <argument index="1" name="shape" type="Shape2D"> + </argument> + <argument index="2" name="shape_transform" type="Transform2D"> + </argument> + <argument index="3" name="one_way" type="bool" default="false"> + </argument> + <description> + </description> + </method> <method name="tile_get_light_occluder" qualifiers="const"> <return type="OccluderPolygon2D"> </return> @@ -46043,6 +46891,14 @@ Return the offset of the tile's navigation polygon. </description> </method> + <method name="tile_get_normal_map" qualifiers="const"> + <return type="Texture"> + </return> + <argument index="0" name="id" type="int"> + </argument> + <description> + </description> + </method> <method name="tile_get_occluder_offset" qualifiers="const"> <return type="Vector2"> </return> @@ -46066,17 +46922,37 @@ </return> <argument index="0" name="id" type="int"> </argument> + <argument index="1" name="shape_id" type="int"> + </argument> <description> - Return the shape of the tile. </description> </method> - <method name="tile_get_shape_offset" qualifiers="const"> - <return type="Vector2"> + <method name="tile_get_shape_count" qualifiers="const"> + <return type="int"> + </return> + <argument index="0" name="id" type="int"> + </argument> + <description> + </description> + </method> + <method name="tile_get_shape_one_way" qualifiers="const"> + <return type="bool"> </return> <argument index="0" name="id" type="int"> </argument> + <argument index="1" name="shape_id" type="int"> + </argument> + <description> + </description> + </method> + <method name="tile_get_shape_transform" qualifiers="const"> + <return type="Transform2D"> + </return> + <argument index="0" name="id" type="int"> + </argument> + <argument index="1" name="shape_id" type="int"> + </argument> <description> - Return the shape offset of the tile. </description> </method> <method name="tile_get_shapes" qualifiers="const"> @@ -46151,6 +47027,14 @@ Set an offset for the tile's navigation polygon. </description> </method> + <method name="tile_set_normal_map"> + <argument index="0" name="id" type="int"> + </argument> + <argument index="1" name="normal_map" type="Texture"> + </argument> + <description> + </description> + </method> <method name="tile_set_occluder_offset"> <argument index="0" name="id" type="int"> </argument> @@ -46172,19 +47056,31 @@ <method name="tile_set_shape"> <argument index="0" name="id" type="int"> </argument> - <argument index="1" name="shape" type="Shape2D"> + <argument index="1" name="shape_id" type="int"> + </argument> + <argument index="2" name="shape" type="Shape2D"> </argument> <description> - Set a shape for the tile, enabling physics to collide with it. </description> </method> - <method name="tile_set_shape_offset"> + <method name="tile_set_shape_one_way"> <argument index="0" name="id" type="int"> </argument> - <argument index="1" name="shape_offset" type="Vector2"> + <argument index="1" name="shape_id" type="int"> + </argument> + <argument index="2" name="one_way" type="bool"> + </argument> + <description> + </description> + </method> + <method name="tile_set_shape_transform"> + <argument index="0" name="id" type="int"> + </argument> + <argument index="1" name="shape_id" type="int"> + </argument> + <argument index="2" name="shape_transform" type="Transform2D"> </argument> <description> - Set the shape offset of the tile. </description> </method> <method name="tile_set_shapes"> @@ -46830,7 +47726,7 @@ </method> </methods> <members> - <member name="o" type="Vector2" setter="" getter="" brief=""> + <member name="origin" type="Vector2" setter="" getter="" brief=""> </member> <member name="x" type="Vector2" setter="" getter="" brief=""> </member> @@ -47497,6 +48393,14 @@ <description> </description> </method> + <method name="get_expand_right" qualifiers="const"> + <return type="bool"> + </return> + <argument index="0" name="column" type="int"> + </argument> + <description> + </description> + </method> <method name="get_icon" qualifiers="const"> <return type="Texture"> </return> @@ -47581,6 +48485,14 @@ <description> </description> </method> + <method name="get_text_align" qualifiers="const"> + <return type="int"> + </return> + <argument index="0" name="column" type="int"> + </argument> + <description> + </description> + </method> <method name="get_tooltip" qualifiers="const"> <return type="String"> </return> @@ -47629,6 +48541,12 @@ <description> </description> </method> + <method name="is_folding_disabled" qualifiers="const"> + <return type="bool"> + </return> + <description> + </description> + </method> <method name="is_selectable" qualifiers="const"> <return type="bool"> </return> @@ -47735,6 +48653,12 @@ <description> </description> </method> + <method name="set_disable_folding"> + <argument index="0" name="disable" type="bool"> + </argument> + <description> + </description> + </method> <method name="set_editable"> <argument index="0" name="column" type="int"> </argument> @@ -47743,6 +48667,14 @@ <description> </description> </method> + <method name="set_expand_right"> + <argument index="0" name="column" type="int"> + </argument> + <argument index="1" name="enable" type="bool"> + </argument> + <description> + </description> + </method> <method name="set_icon"> <argument index="0" name="column" type="int"> </argument> @@ -47813,6 +48745,14 @@ <description> </description> </method> + <method name="set_text_align"> + <argument index="0" name="column" type="int"> + </argument> + <argument index="1" name="text_align" type="int"> + </argument> + <description> + </description> + </method> <method name="set_tooltip"> <argument index="0" name="column" type="int"> </argument> @@ -48495,6 +49435,10 @@ do_property]. <theme_items> <theme_item name="grabber" type="Texture"> </theme_item> + <theme_item name="grabber_disabled" type="Texture"> + </theme_item> + <theme_item name="grabber_disabled" type="StyleBox"> + </theme_item> <theme_item name="grabber_highlight" type="Texture"> </theme_item> <theme_item name="grabber_highlight" type="StyleBox"> @@ -48745,12 +49689,6 @@ do_property]. </method> </methods> <members> - <member name="height" type="float" setter="" getter="" brief=""> - Height of the vector (Same as Y). - </member> - <member name="width" type="float" setter="" getter="" brief=""> - Width of the vector (Same as X). - </member> <member name="x" type="float" setter="" getter="" brief=""> X component of the vector. </member> @@ -50944,6 +51882,8 @@ do_property]. </description> </method> <method name="get_constant_value" qualifiers="const"> + <return type="Variant"> + </return> <description> </description> </method> @@ -50961,9 +51901,9 @@ do_property]. </method> </methods> <members> - <member name="constant/type" type="int" setter="set_constant_type" getter="get_constant_type" brief=""> + <member name="type" type="int" setter="set_constant_type" getter="get_constant_type" brief=""> </member> - <member name="constant/value" type="Nil" setter="set_constant_value" getter="get_constant_value" brief=""> + <member name="value" type="Nil" setter="set_constant_value" getter="get_constant_value" brief=""> </member> </members> <constants> @@ -51185,7 +52125,7 @@ do_property]. </method> </methods> <members> - <member name="signal/signal" type="String" setter="set_signal" getter="get_signal" brief=""> + <member name="signal" type="String" setter="set_signal" getter="get_signal" brief=""> </member> </members> <constants> @@ -51365,27 +52305,27 @@ do_property]. </method> </methods> <members> - <member name="function/argument_cache" type="Dictionary" setter="_set_argument_cache" getter="_get_argument_cache" brief=""> + <member name="argument_cache" type="Dictionary" setter="_set_argument_cache" getter="_get_argument_cache" brief=""> </member> - <member name="function/base_script" type="String" setter="set_base_script" getter="get_base_script" brief=""> + <member name="base_script" type="String" setter="set_base_script" getter="get_base_script" brief=""> </member> - <member name="function/base_type" type="String" setter="set_base_type" getter="get_base_type" brief=""> + <member name="base_type" type="String" setter="set_base_type" getter="get_base_type" brief=""> </member> - <member name="function/basic_type" type="int" setter="set_basic_type" getter="get_basic_type" brief=""> + <member name="basic_type" type="int" setter="set_basic_type" getter="get_basic_type" brief=""> </member> - <member name="function/call_mode" type="int" setter="set_call_mode" getter="get_call_mode" brief=""> + <member name="call_mode" type="int" setter="set_call_mode" getter="get_call_mode" brief=""> </member> - <member name="function/function" type="String" setter="set_function" getter="get_function" brief=""> + <member name="function" type="String" setter="set_function" getter="get_function" brief=""> </member> - <member name="function/node_path" type="NodePath" setter="set_base_path" getter="get_base_path" brief=""> + <member name="node_path" type="NodePath" setter="set_base_path" getter="get_base_path" brief=""> </member> - <member name="function/singleton" type="String" setter="set_singleton" getter="get_singleton" brief=""> + <member name="rpc_call_mode" type="int" setter="set_rpc_call_mode" getter="get_rpc_call_mode" brief=""> </member> - <member name="function/use_default_args" type="int" setter="set_use_default_args" getter="get_use_default_args" brief=""> + <member name="singleton" type="String" setter="set_singleton" getter="get_singleton" brief=""> </member> - <member name="function/validate" type="bool" setter="set_validate" getter="get_validate" brief=""> + <member name="use_default_args" type="int" setter="set_use_default_args" getter="get_use_default_args" brief=""> </member> - <member name="rpc/call_mode" type="int" setter="set_rpc_call_mode" getter="get_rpc_call_mode" brief=""> + <member name="validate" type="bool" setter="set_validate" getter="get_validate" brief=""> </member> </members> <constants> @@ -51561,9 +52501,9 @@ do_property]. </method> </methods> <members> - <member name="variable/name" type="String" setter="set_var_name" getter="get_var_name" brief=""> + <member name="type" type="int" setter="set_var_type" getter="get_var_type" brief=""> </member> - <member name="variable/type" type="int" setter="set_var_type" getter="get_var_type" brief=""> + <member name="var_name" type="String" setter="set_var_name" getter="get_var_name" brief=""> </member> </members> <constants> @@ -51601,9 +52541,9 @@ do_property]. </method> </methods> <members> - <member name="variable/name" type="String" setter="set_var_name" getter="get_var_name" brief=""> + <member name="type" type="int" setter="set_var_type" getter="get_var_type" brief=""> </member> - <member name="variable/type" type="int" setter="set_var_type" getter="get_var_type" brief=""> + <member name="var_name" type="String" setter="set_var_name" getter="get_var_name" brief=""> </member> </members> <constants> @@ -51709,9 +52649,9 @@ do_property]. </method> </methods> <members> - <member name="operator_value/type" type="int" setter="set_operator" getter="get_operator" brief=""> + <member name="operator" type="int" setter="set_operator" getter="get_operator" brief=""> </member> - <member name="typed_value/typed" type="int" setter="set_typed" getter="get_typed" brief=""> + <member name="type" type="int" setter="set_typed" getter="get_typed" brief=""> </member> </members> <constants> @@ -51779,6 +52719,12 @@ do_property]. <description> </description> </method> + <method name="get_index" qualifiers="const"> + <return type="String"> + </return> + <description> + </description> + </method> <method name="get_property" qualifiers="const"> <return type="String"> </return> @@ -51815,6 +52761,12 @@ do_property]. <description> </description> </method> + <method name="set_index"> + <argument index="0" name="index" type="String"> + </argument> + <description> + </description> + </method> <method name="set_property"> <argument index="0" name="property" type="String"> </argument> @@ -51823,19 +52775,21 @@ do_property]. </method> </methods> <members> - <member name="property/base_script" type="String" setter="set_base_script" getter="get_base_script" brief=""> + <member name="base_script" type="String" setter="set_base_script" getter="get_base_script" brief=""> </member> - <member name="property/base_type" type="String" setter="set_base_type" getter="get_base_type" brief=""> + <member name="base_type" type="String" setter="set_base_type" getter="get_base_type" brief=""> + </member> + <member name="basic_type" type="int" setter="set_basic_type" getter="get_basic_type" brief=""> </member> - <member name="property/basic_type" type="int" setter="set_basic_type" getter="get_basic_type" brief=""> + <member name="index" type="String" setter="set_index" getter="get_index" brief=""> </member> - <member name="property/node_path" type="NodePath" setter="set_base_path" getter="get_base_path" brief=""> + <member name="node_path" type="NodePath" setter="set_base_path" getter="get_base_path" brief=""> </member> - <member name="property/property" type="String" setter="set_property" getter="get_property" brief=""> + <member name="property" type="String" setter="set_property" getter="get_property" brief=""> </member> - <member name="property/set_mode" type="int" setter="set_call_mode" getter="get_call_mode" brief=""> + <member name="set_mode" type="int" setter="set_call_mode" getter="get_call_mode" brief=""> </member> - <member name="property/type_cache" type="int" setter="_set_type_cache" getter="_get_type_cache" brief=""> + <member name="type_cache" type="int" setter="_set_type_cache" getter="_get_type_cache" brief=""> </member> </members> <constants> @@ -51853,6 +52807,12 @@ do_property]. <description> </description> <methods> + <method name="get_assign_op" qualifiers="const"> + <return type="int"> + </return> + <description> + </description> + </method> <method name="get_base_path" qualifiers="const"> <return type="NodePath"> </return> @@ -51883,12 +52843,24 @@ do_property]. <description> </description> </method> + <method name="get_index" qualifiers="const"> + <return type="String"> + </return> + <description> + </description> + </method> <method name="get_property" qualifiers="const"> <return type="String"> </return> <description> </description> </method> + <method name="set_assign_op"> + <argument index="0" name="assign_op" type="int"> + </argument> + <description> + </description> + </method> <method name="set_base_path"> <argument index="0" name="base_path" type="NodePath"> </argument> @@ -51919,6 +52891,12 @@ do_property]. <description> </description> </method> + <method name="set_index"> + <argument index="0" name="index" type="String"> + </argument> + <description> + </description> + </method> <method name="set_property"> <argument index="0" name="property" type="String"> </argument> @@ -51927,19 +52905,23 @@ do_property]. </method> </methods> <members> - <member name="property/base_script" type="String" setter="set_base_script" getter="get_base_script" brief=""> + <member name="assign_op" type="int" setter="set_assign_op" getter="get_assign_op" brief=""> </member> - <member name="property/base_type" type="String" setter="set_base_type" getter="get_base_type" brief=""> + <member name="base_script" type="String" setter="set_base_script" getter="get_base_script" brief=""> </member> - <member name="property/basic_type" type="int" setter="set_basic_type" getter="get_basic_type" brief=""> + <member name="base_type" type="String" setter="set_base_type" getter="get_base_type" brief=""> + </member> + <member name="basic_type" type="int" setter="set_basic_type" getter="get_basic_type" brief=""> </member> - <member name="property/node_path" type="NodePath" setter="set_base_path" getter="get_base_path" brief=""> + <member name="index" type="String" setter="set_index" getter="get_index" brief=""> </member> - <member name="property/property" type="String" setter="set_property" getter="get_property" brief=""> + <member name="node_path" type="NodePath" setter="set_base_path" getter="get_base_path" brief=""> </member> - <member name="property/set_mode" type="int" setter="set_call_mode" getter="get_call_mode" brief=""> + <member name="property" type="String" setter="set_property" getter="get_property" brief=""> </member> - <member name="property/type_cache" type="int" setter="_set_type_cache" getter="_get_type_cache" brief=""> + <member name="set_mode" type="int" setter="set_call_mode" getter="get_call_mode" brief=""> + </member> + <member name="type_cache" type="int" setter="_set_type_cache" getter="_get_type_cache" brief=""> </member> </members> <constants> @@ -52009,9 +52991,9 @@ do_property]. </method> </methods> <members> - <member name="return_value/enabled" type="bool" setter="set_enable_return_value" getter="is_return_value_enabled" brief=""> + <member name="return_enabled" type="bool" setter="set_enable_return_value" getter="is_return_value_enabled" brief=""> </member> - <member name="return_value/type" type="int" setter="set_return_type" getter="get_return_type" brief=""> + <member name="return_type" type="int" setter="set_return_type" getter="get_return_type" brief=""> </member> </members> <constants> @@ -52053,6 +53035,32 @@ do_property]. <constants> </constants> </class> +<class name="VisualScriptSelect" inherits="VisualScriptNode" category="Core"> + <brief_description> + </brief_description> + <description> + </description> + <methods> + <method name="get_typed" qualifiers="const"> + <return type="int"> + </return> + <description> + </description> + </method> + <method name="set_typed"> + <argument index="0" name="type" type="int"> + </argument> + <description> + </description> + </method> + </methods> + <members> + <member name="type" type="int" setter="set_typed" getter="get_typed" brief=""> + </member> + </members> + <constants> + </constants> +</class> <class name="VisualScriptSelf" inherits="VisualScriptNode" category="Core"> <brief_description> </brief_description> @@ -52147,9 +53155,9 @@ do_property]. </method> </methods> <members> - <member name="function/base_type" type="String" setter="set_base_type" getter="get_base_type" brief=""> + <member name="base_script" type="String" setter="set_base_script" getter="get_base_script" brief=""> </member> - <member name="property/base_script" type="String" setter="set_base_script" getter="get_base_script" brief=""> + <member name="base_type" type="String" setter="set_base_type" getter="get_base_type" brief=""> </member> </members> <constants> @@ -52175,7 +53183,7 @@ do_property]. </method> </methods> <members> - <member name="variable/name" type="String" setter="set_variable" getter="get_variable" brief=""> + <member name="var_name" type="String" setter="set_variable" getter="get_variable" brief=""> </member> </members> <constants> @@ -52201,7 +53209,7 @@ do_property]. </method> </methods> <members> - <member name="variable/name" type="String" setter="set_variable" getter="get_variable" brief=""> + <member name="var_name" type="String" setter="set_variable" getter="get_variable" brief=""> </member> </members> <constants> @@ -52319,13 +53327,13 @@ do_property]. </method> </methods> <members> - <member name="signal/base_type" type="String" setter="set_base_type" getter="get_base_type" brief=""> + <member name="base_type" type="String" setter="set_base_type" getter="get_base_type" brief=""> </member> - <member name="signal/call_mode" type="int" setter="set_call_mode" getter="get_call_mode" brief=""> + <member name="call_mode" type="int" setter="set_call_mode" getter="get_call_mode" brief=""> </member> - <member name="signal/node_path" type="NodePath" setter="set_base_path" getter="get_base_path" brief=""> + <member name="node_path" type="NodePath" setter="set_base_path" getter="get_base_path" brief=""> </member> - <member name="signal/signal" type="String" setter="set_signal" getter="get_signal" brief=""> + <member name="signal" type="String" setter="set_signal" getter="get_signal" brief=""> </member> </members> <constants> @@ -52576,13 +53584,6 @@ do_property]. Retrieve the state of this world's physics space. This allows arbitrary querying for collision. </description> </method> - <method name="get_sound_space"> - <return type="RID"> - </return> - <description> - Retrieve the [RID] of this world's sound space resource. Used by the [SpatialSound2DServer] for 2D spatial audio. - </description> - </method> <method name="get_space"> <return type="RID"> </return> @@ -52594,7 +53595,7 @@ do_property]. <constants> </constants> </class> -<class name="WorldEnvironment" inherits="Spatial" category="Core"> +<class name="WorldEnvironment" inherits="Node" category="Core"> <brief_description> Sets environment properties for the entire scene </brief_description> diff --git a/drivers/gles3/rasterizer_scene_gles3.cpp b/drivers/gles3/rasterizer_scene_gles3.cpp index e8c6502bf4..8dfa91473a 100644 --- a/drivers/gles3/rasterizer_scene_gles3.cpp +++ b/drivers/gles3/rasterizer_scene_gles3.cpp @@ -761,7 +761,7 @@ bool RasterizerSceneGLES3::reflection_probe_instance_postprocess_step(RID p_inst storage->shaders.cubemap_filter.set_conditional(CubemapFilterShaderGLES3::LOW_QUALITY, rpi->probe_ptr->update_mode == VS::REFLECTION_PROBE_UPDATE_ALWAYS); for (int i = 0; i < 2; i++) { - storage->shaders.cubemap_filter.set_uniform(CubemapFilterShaderGLES3::Z_FLIP, i > 0); + storage->shaders.cubemap_filter.set_uniform(CubemapFilterShaderGLES3::Z_FLIP, i == 0); storage->shaders.cubemap_filter.set_uniform(CubemapFilterShaderGLES3::ROUGHNESS, rpi->render_step / 5.0); uint32_t local_width = width, local_height = height; @@ -1834,12 +1834,14 @@ void RasterizerSceneGLES3::_setup_light(RenderList::Element *e, const Transform GIProbeInstance *gipi = gi_probe_instance_owner.getptr(ridp[0]); + float bias_scale = e->instance->baked_light ? 1 : 0; glActiveTexture(GL_TEXTURE0 + storage->config.max_texture_image_units - 9); glBindTexture(GL_TEXTURE_3D, gipi->tex_cache); state.scene_shader.set_uniform(SceneShaderGLES3::GI_PROBE_XFORM1, gipi->transform_to_data * p_view_transform); state.scene_shader.set_uniform(SceneShaderGLES3::GI_PROBE_BOUNDS1, gipi->bounds); state.scene_shader.set_uniform(SceneShaderGLES3::GI_PROBE_MULTIPLIER1, gipi->probe ? gipi->probe->dynamic_range * gipi->probe->energy : 0.0); - state.scene_shader.set_uniform(SceneShaderGLES3::GI_PROBE_BIAS1, gipi->probe ? gipi->probe->bias : 0.0); + state.scene_shader.set_uniform(SceneShaderGLES3::GI_PROBE_BIAS1, gipi->probe ? gipi->probe->bias * bias_scale : 0.0); + state.scene_shader.set_uniform(SceneShaderGLES3::GI_PROBE_NORMAL_BIAS1, gipi->probe ? gipi->probe->normal_bias * bias_scale : 0.0); state.scene_shader.set_uniform(SceneShaderGLES3::GI_PROBE_BLEND_AMBIENT1, gipi->probe ? !gipi->probe->interior : false); state.scene_shader.set_uniform(SceneShaderGLES3::GI_PROBE_CELL_SIZE1, gipi->cell_size_cache); if (gi_probe_count > 1) { @@ -1852,7 +1854,8 @@ void RasterizerSceneGLES3::_setup_light(RenderList::Element *e, const Transform state.scene_shader.set_uniform(SceneShaderGLES3::GI_PROBE_BOUNDS2, gipi2->bounds); state.scene_shader.set_uniform(SceneShaderGLES3::GI_PROBE_CELL_SIZE2, gipi2->cell_size_cache); state.scene_shader.set_uniform(SceneShaderGLES3::GI_PROBE_MULTIPLIER2, gipi2->probe ? gipi2->probe->dynamic_range * gipi2->probe->energy : 0.0); - state.scene_shader.set_uniform(SceneShaderGLES3::GI_PROBE_BIAS2, gipi2->probe ? gipi2->probe->bias : 0.0); + state.scene_shader.set_uniform(SceneShaderGLES3::GI_PROBE_BIAS2, gipi2->probe ? gipi2->probe->bias * bias_scale : 0.0); + state.scene_shader.set_uniform(SceneShaderGLES3::GI_PROBE_NORMAL_BIAS2, gipi2->probe ? gipi2->probe->normal_bias * bias_scale : 0.0); state.scene_shader.set_uniform(SceneShaderGLES3::GI_PROBE_BLEND_AMBIENT2, gipi2->probe ? !gipi2->probe->interior : false); state.scene_shader.set_uniform(SceneShaderGLES3::GI_PROBE2_ENABLED, true); } else { @@ -2889,7 +2892,7 @@ void RasterizerSceneGLES3::_setup_reflections(RID *p_reflection_probe_cull_resul reflection_ubo.atlas_clamp[0] = float(x) / reflection_atlas->size; reflection_ubo.atlas_clamp[1] = float(y) / reflection_atlas->size; reflection_ubo.atlas_clamp[2] = float(width) / reflection_atlas->size; - reflection_ubo.atlas_clamp[3] = float(height / 2) / reflection_atlas->size; + reflection_ubo.atlas_clamp[3] = float(height) / reflection_atlas->size; Transform proj = (p_camera_inverse_transform * rpi->transform).inverse(); store_transform(proj, reflection_ubo.local_matrix); @@ -4156,7 +4159,7 @@ void RasterizerSceneGLES3::render_scene(const Transform &p_cam_transform, const glDrawBuffers(1, &gldb); } - if (env && env->bg_mode == VS::ENV_BG_SKY && !storage->frame.current_rt->flags[RasterizerStorage::RENDER_TARGET_TRANSPARENT] && state.debug_draw != VS::VIEWPORT_DEBUG_DRAW_OVERDRAW) { + if (env && env->bg_mode == VS::ENV_BG_SKY && (!storage->frame.current_rt || (!storage->frame.current_rt->flags[RasterizerStorage::RENDER_TARGET_TRANSPARENT] && state.debug_draw != VS::VIEWPORT_DEBUG_DRAW_OVERDRAW))) { /* if (use_mrt) { @@ -4175,7 +4178,7 @@ void RasterizerSceneGLES3::render_scene(const Transform &p_cam_transform, const _render_mrts(env, p_cam_projection); } else { //FIXME: check that this is possible to use - if (state.used_screen_texture) { + if (storage->frame.current_rt && state.used_screen_texture) { glBindFramebuffer(GL_READ_FRAMEBUFFER, storage->frame.current_rt->buffers.fbo); glReadBuffer(GL_COLOR_ATTACHMENT0); glBindFramebuffer(GL_DRAW_FRAMEBUFFER, storage->frame.current_rt->effects.mip_maps[0].sizes[0].fbo); @@ -4189,7 +4192,7 @@ void RasterizerSceneGLES3::render_scene(const Transform &p_cam_transform, const } } - if (state.used_screen_texture) { + if (storage->frame.current_rt && state.used_screen_texture) { glActiveTexture(GL_TEXTURE0 + storage->config.max_texture_image_units - 7); glBindTexture(GL_TEXTURE_2D, storage->frame.current_rt->effects.mip_maps[0].color); } @@ -4199,7 +4202,7 @@ void RasterizerSceneGLES3::render_scene(const Transform &p_cam_transform, const glEnable(GL_DEPTH_TEST); glDisable(GL_SCISSOR_TEST); - render_list.sort_by_depth(true); + render_list.sort_by_reverse_depth(true); if (state.directional_light_count == 0) { directional_light = NULL; diff --git a/drivers/gles3/rasterizer_scene_gles3.h b/drivers/gles3/rasterizer_scene_gles3.h index 37bbd60797..a03e3dbe3d 100644 --- a/drivers/gles3/rasterizer_scene_gles3.h +++ b/drivers/gles3/rasterizer_scene_gles3.h @@ -666,7 +666,7 @@ public: uint64_t sort_key; }; - Element *_elements; + Element *base_elements; Element **elements; int element_count; @@ -700,11 +700,11 @@ public: struct SortByDepth { _FORCE_INLINE_ bool operator()(const Element *A, const Element *B) const { - return A->instance->depth > B->instance->depth; + return A->instance->depth < B->instance->depth; } }; - void sort_by_depth(bool p_alpha) { + void sort_by_depth(bool p_alpha) { //used for shadows SortArray<Element *, SortByDepth> sorter; if (p_alpha) { @@ -714,11 +714,28 @@ public: } } + struct SortByReverseDepth { + + _FORCE_INLINE_ bool operator()(const Element *A, const Element *B) const { + return A->instance->depth > B->instance->depth; + } + }; + + void sort_by_reverse_depth(bool p_alpha) { //used for alpha + + SortArray<Element *, SortByReverseDepth> sorter; + if (p_alpha) { + sorter.sort(&elements[max_elements - alpha_element_count], alpha_element_count); + } else { + sorter.sort(elements, element_count); + } + } + _FORCE_INLINE_ Element *add_element() { if (element_count + alpha_element_count >= max_elements) return NULL; - elements[element_count] = &_elements[element_count]; + elements[element_count] = &base_elements[element_count]; return elements[element_count++]; } @@ -727,7 +744,7 @@ public: if (element_count + alpha_element_count >= max_elements) return NULL; int idx = max_elements - alpha_element_count - 1; - elements[idx] = &_elements[idx]; + elements[idx] = &base_elements[idx]; alpha_element_count++; return elements[idx]; } @@ -737,9 +754,9 @@ public: element_count = 0; alpha_element_count = 0; elements = memnew_arr(Element *, max_elements); - _elements = memnew_arr(Element, max_elements); + base_elements = memnew_arr(Element, max_elements); for (int i = 0; i < max_elements; i++) - elements[i] = &_elements[i]; // assign elements + elements[i] = &base_elements[i]; // assign elements } RenderList() { @@ -749,7 +766,7 @@ public: ~RenderList() { memdelete_arr(elements); - memdelete_arr(_elements); + memdelete_arr(base_elements); } }; diff --git a/drivers/gles3/rasterizer_storage_gles3.cpp b/drivers/gles3/rasterizer_storage_gles3.cpp index 14fb36f3b0..ab12bcef6d 100644 --- a/drivers/gles3/rasterizer_storage_gles3.cpp +++ b/drivers/gles3/rasterizer_storage_gles3.cpp @@ -4866,6 +4866,7 @@ RID RasterizerStorageGLES3::gi_probe_create() { gip->energy = 1.0; gip->propagation = 1.0; gip->bias = 0.4; + gip->normal_bias = 0.4; gip->interior = false; gip->compress = false; gip->version = 1; @@ -4972,6 +4973,14 @@ void RasterizerStorageGLES3::gi_probe_set_bias(RID p_probe, float p_range) { gip->bias = p_range; } +void RasterizerStorageGLES3::gi_probe_set_normal_bias(RID p_probe, float p_range) { + + GIProbe *gip = gi_probe_owner.getornull(p_probe); + ERR_FAIL_COND(!gip); + + gip->normal_bias = p_range; +} + void RasterizerStorageGLES3::gi_probe_set_propagation(RID p_probe, float p_range) { GIProbe *gip = gi_probe_owner.getornull(p_probe); @@ -5027,6 +5036,14 @@ float RasterizerStorageGLES3::gi_probe_get_bias(RID p_probe) const { return gip->bias; } +float RasterizerStorageGLES3::gi_probe_get_normal_bias(RID p_probe) const { + + const GIProbe *gip = gi_probe_owner.getornull(p_probe); + ERR_FAIL_COND_V(!gip, 0); + + return gip->normal_bias; +} + float RasterizerStorageGLES3::gi_probe_get_propagation(RID p_probe) const { const GIProbe *gip = gi_probe_owner.getornull(p_probe); diff --git a/drivers/gles3/rasterizer_storage_gles3.h b/drivers/gles3/rasterizer_storage_gles3.h index 183db534ac..b24da44afd 100644 --- a/drivers/gles3/rasterizer_storage_gles3.h +++ b/drivers/gles3/rasterizer_storage_gles3.h @@ -972,6 +972,7 @@ public: int dynamic_range; float energy; float bias; + float normal_bias; float propagation; bool interior; bool compress; @@ -1006,6 +1007,9 @@ public: virtual void gi_probe_set_bias(RID p_probe, float p_range); virtual float gi_probe_get_bias(RID p_probe) const; + virtual void gi_probe_set_normal_bias(RID p_probe, float p_range); + virtual float gi_probe_get_normal_bias(RID p_probe) const; + virtual void gi_probe_set_propagation(RID p_probe, float p_range); virtual float gi_probe_get_propagation(RID p_probe) const; diff --git a/drivers/gles3/shaders/cubemap_filter.glsl b/drivers/gles3/shaders/cubemap_filter.glsl index 393ef2892a..ac4e47a440 100644 --- a/drivers/gles3/shaders/cubemap_filter.glsl +++ b/drivers/gles3/shaders/cubemap_filter.glsl @@ -247,6 +247,7 @@ void main() { #if !defined(USE_SOURCE_DUAL_PARABOLOID_ARRAY) && !defined(USE_SOURCE_PANORAMA) + N.y=-N.y; frag_color=vec4(texture(N,source_cube).rgb,1.0); #endif @@ -277,6 +278,7 @@ void main() { #endif #if !defined(USE_SOURCE_DUAL_PARABOLOID_ARRAY) && !defined(USE_SOURCE_PANORAMA) + H.y=-H.y; sum.rgb += textureLod(source_cube, H, 0.0).rgb *ndotl; #endif sum.a += ndotl; diff --git a/drivers/gles3/shaders/scene.glsl b/drivers/gles3/shaders/scene.glsl index 6fbfeeff6c..9d474d3902 100644 --- a/drivers/gles3/shaders/scene.glsl +++ b/drivers/gles3/shaders/scene.glsl @@ -1093,27 +1093,19 @@ void reflection_process(int idx, vec3 vertex, vec3 normal,vec3 binormal, vec3 ta } - - vec3 splane=normalize(local_ref_vec); vec4 clamp_rect=reflections[idx].atlas_clamp; - - splane.z*=-1.0; - if (splane.z>=0.0) { - splane.z+=1.0; - clamp_rect.y+=clamp_rect.w; - } else { - splane.z=1.0 - splane.z; - splane.y=-splane.y; + vec3 norm = normalize(local_ref_vec); + norm.xy/=1.0+abs(norm.z); + norm.xy=norm.xy * vec2(0.5,0.25) + vec2(0.5,0.25); + if (norm.z>0) { + norm.y=0.5-norm.y+0.5; } - splane.xy/=splane.z; - splane.xy=splane.xy * 0.5 + 0.5; - - splane.xy = splane.xy * clamp_rect.zw + clamp_rect.xy; - splane.xy = clamp(splane.xy,clamp_rect.xy,clamp_rect.xy+clamp_rect.zw); + vec2 atlas_uv = norm.xy * clamp_rect.zw + clamp_rect.xy; + atlas_uv = clamp(atlas_uv,clamp_rect.xy,clamp_rect.xy+clamp_rect.zw); highp vec4 reflection; - reflection.rgb = textureLod(reflection_atlas,splane.xy,roughness*5.0).rgb; + reflection.rgb = textureLod(reflection_atlas,atlas_uv,roughness*5.0).rgb; if (reflections[idx].params.z < 0.5) { reflection.rgb = mix(skybox,reflection.rgb,blend); @@ -1180,6 +1172,7 @@ uniform highp vec3 gi_probe_bounds1; uniform highp vec3 gi_probe_cell_size1; uniform highp float gi_probe_multiplier1; uniform highp float gi_probe_bias1; +uniform highp float gi_probe_normal_bias1; uniform bool gi_probe_blend_ambient1; uniform mediump sampler3D gi_probe2; //texunit:-10 @@ -1188,12 +1181,12 @@ uniform highp vec3 gi_probe_bounds2; uniform highp vec3 gi_probe_cell_size2; uniform highp float gi_probe_multiplier2; uniform highp float gi_probe_bias2; +uniform highp float gi_probe_normal_bias2; uniform bool gi_probe2_enabled; uniform bool gi_probe_blend_ambient2; vec3 voxel_cone_trace(sampler3D probe, vec3 cell_size, vec3 pos, vec3 ambient, bool blend_ambient, vec3 direction, float tan_half_angle, float max_distance, float p_bias) { - float dist = p_bias;//1.0; //dot(direction,mix(vec3(-1.0),vec3(1.0),greaterThan(direction,vec3(0.0))))*2.0; float alpha=0.0; vec3 color = vec3(0.0); @@ -1214,27 +1207,30 @@ vec3 voxel_cone_trace(sampler3D probe, vec3 cell_size, vec3 pos, vec3 ambient, b return color; } -void gi_probe_compute(sampler3D probe, mat4 probe_xform, vec3 bounds,vec3 cell_size,vec3 pos, vec3 ambient, vec3 environment, bool blend_ambient,float multiplier, mat3 normal_mtx,vec3 ref_vec, float roughness,float p_bias, out vec4 out_spec, out vec4 out_diff) { +void gi_probe_compute(sampler3D probe, mat4 probe_xform, vec3 bounds,vec3 cell_size,vec3 pos, vec3 ambient, vec3 environment, bool blend_ambient,float multiplier, mat3 normal_mtx,vec3 ref_vec, float roughness,float p_bias,float p_normal_bias, inout vec4 out_spec, inout vec4 out_diff) { vec3 probe_pos = (probe_xform * vec4(pos,1.0)).xyz; vec3 ref_pos = (probe_xform * vec4(pos+ref_vec,1.0)).xyz; - ref_vec = normalize(ref_pos - probe_pos); + probe_pos+=(probe_xform * vec4(normal_mtx[2],0.0)).xyz*p_normal_bias; + /* out_diff.rgb = voxel_cone_trace(probe,cell_size,probe_pos,normalize((probe_xform * vec4(ref_vec,0.0)).xyz),0.0 ,100.0); out_diff.a = 1.0; return;*/ //out_diff = vec4(textureLod(probe,probe_pos*cell_size,3.0).rgb,1.0); //return; - if (any(bvec2(any(lessThan(probe_pos,vec3(0.0))),any(greaterThan(probe_pos,bounds))))) + //this causes corrupted pixels, i have no idea why.. + if (any(bvec2(any(lessThan(probe_pos,vec3(0.0))),any(greaterThan(probe_pos,bounds))))) { return; + } - vec3 blendv = probe_pos/bounds * 2.0 - 1.0; - float blend = 1.001-max(blendv.x,max(blendv.y,blendv.z)); - blend=1.0; + //vec3 blendv = probe_pos/bounds * 2.0 - 1.0; + //float blend = 1.001-max(blendv.x,max(blendv.y,blendv.z)); + float blend=1.0; float max_distance = length(bounds); @@ -1281,7 +1277,7 @@ void gi_probe_compute(sampler3D probe, mat4 probe_xform, vec3 bounds,vec3 cell_s light*=multiplier; - out_diff = vec4(light*blend,blend); + out_diff += vec4(light*blend,blend); //irradiance @@ -1290,7 +1286,8 @@ void gi_probe_compute(sampler3D probe, mat4 probe_xform, vec3 bounds,vec3 cell_s irr_light *= multiplier; //irr_light=vec3(0.0); - out_spec = vec4(irr_light*blend,blend); + out_spec += vec4(irr_light*blend,blend); + } @@ -1316,11 +1313,11 @@ void gi_probes_compute(vec3 pos, vec3 normal, float roughness, inout vec3 out_sp out_specular = vec3(0.0); - gi_probe_compute(gi_probe1,gi_probe_xform1,gi_probe_bounds1,gi_probe_cell_size1,pos,ambient,environment,gi_probe_blend_ambient1,gi_probe_multiplier1,normal_mat,ref_vec,roughness,gi_probe_bias1,spec_accum,diff_accum); + gi_probe_compute(gi_probe1,gi_probe_xform1,gi_probe_bounds1,gi_probe_cell_size1,pos,ambient,environment,gi_probe_blend_ambient1,gi_probe_multiplier1,normal_mat,ref_vec,roughness,gi_probe_bias1,gi_probe_normal_bias1,spec_accum,diff_accum); if (gi_probe2_enabled) { - gi_probe_compute(gi_probe2,gi_probe_xform2,gi_probe_bounds2,gi_probe_cell_size2,pos,ambient,environment,gi_probe_blend_ambient2,gi_probe_multiplier2,normal_mat,ref_vec,roughness,gi_probe_bias2,spec_accum,diff_accum); + gi_probe_compute(gi_probe2,gi_probe_xform2,gi_probe_bounds2,gi_probe_cell_size2,pos,ambient,environment,gi_probe_blend_ambient2,gi_probe_multiplier2,normal_mat,ref_vec,roughness,gi_probe_bias2,gi_probe_normal_bias2,spec_accum,diff_accum); } if (diff_accum.a>0.0) { @@ -1466,6 +1463,7 @@ FRAGMENT_SHADER_CODE vec3 specular_light = vec3(0.0,0.0,0.0); vec3 ambient_light; vec3 diffuse_light = vec3(0.0,0.0,0.0); + vec3 env_reflection_light = vec3(0.0,0.0,0.0); vec3 eye_vec = -normalize( vertex_interp ); @@ -1483,7 +1481,7 @@ FRAGMENT_SHADER_CODE vec3 ref_vec = reflect(-eye_vec,normal); //2.0 * ndotv * normal - view; // reflect(v, n); ref_vec=normalize((radiance_inverse_xform * vec4(ref_vec,0.0)).xyz); vec3 radiance = textureDualParaboloid(radiance_map,ref_vec,roughness) * bg_energy; - specular_light = radiance; + env_reflection_light = radiance; } //no longer a cubemap @@ -1662,7 +1660,7 @@ FRAGMENT_SHADER_CODE #endif //#USE_LIGHT_DIRECTIONAL #ifdef USE_GI_PROBES - gi_probes_compute(vertex,normal,roughness,specular_light,ambient_light); + gi_probes_compute(vertex,normal,roughness,env_reflection_light,ambient_light); #endif @@ -1673,12 +1671,15 @@ FRAGMENT_SHADER_CODE highp vec4 ambient_accum = vec4(0.0,0.0,0.0,0.0); for(int i=0;i<reflection_count;i++) { - reflection_process(reflection_indices[i],vertex,normal,binormal,tangent,roughness,anisotropy,ambient_light,specular_light,reflection_accum,ambient_accum); + reflection_process(reflection_indices[i],vertex,normal,binormal,tangent,roughness,anisotropy,ambient_light,env_reflection_light,reflection_accum,ambient_accum); } if (reflection_accum.a>0.0) { specular_light+=reflection_accum.rgb/reflection_accum.a; + } else { + specular_light+=env_reflection_light; } + if (ambient_accum.a>0.0) { ambient_light+=ambient_accum.rgb/ambient_accum.a; } diff --git a/drivers/unix/os_unix.cpp b/drivers/unix/os_unix.cpp index 75f40cacca..479d97e563 100644 --- a/drivers/unix/os_unix.cpp +++ b/drivers/unix/os_unix.cpp @@ -50,7 +50,7 @@ #include <mach-o/dyld.h> #endif -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__OpenBSD__) #include <sys/param.h> #endif #include "global_config.h" @@ -532,7 +532,7 @@ String OS_Unix::get_executable_path() const { return OS::get_executable_path(); } return b; -#elif defined(__FreeBSD__) +#elif defined(__FreeBSD__) || defined(__OpenBSD__) char resolved_path[MAXPATHLEN]; realpath(OS::get_executable_path().utf8().get_data(), resolved_path); diff --git a/editor/editor_audio_buses.cpp b/editor/editor_audio_buses.cpp index e3e5793ec8..08b093aecb 100644 --- a/editor/editor_audio_buses.cpp +++ b/editor/editor_audio_buses.cpp @@ -47,6 +47,10 @@ void EditorAudioBus::_notification(int p_what) { disabled_vu = get_icon("BusVuFrozen", "EditorIcons"); + solo->set_icon(get_icon("AudioBusSolo", "EditorIcons")); + mute->set_icon(get_icon("AudioBusMute", "EditorIcons")); + bypass->set_icon(get_icon("AudioBusBypass", "EditorIcons")); + prev_active = true; update_bus(); set_process(true); @@ -630,24 +634,24 @@ EditorAudioBus::EditorAudioBus(EditorAudioBuses *p_buses) { vb->add_child(hbc); hbc->add_spacer(); solo = memnew(ToolButton); - solo->set_text("S"); solo->set_toggle_mode(true); + solo->set_tooltip(TTR("Solo")); solo->add_color_override("font_color_pressed", Color(0.2, 0.9, 0.2)); solo->add_color_override("font_color_hover", Color(0.6, 0.9, 0.6)); solo->set_focus_mode(FOCUS_NONE); solo->connect("pressed", this, "_solo_toggled"); hbc->add_child(solo); mute = memnew(ToolButton); - mute->set_text("M"); mute->set_toggle_mode(true); + mute->set_tooltip(TTR("Mute")); mute->add_color_override("font_color_pressed", Color(0.9, 0.2, 0.2)); mute->add_color_override("font_color_hover", Color(0.9, 0.6, 0.6)); mute->set_focus_mode(FOCUS_NONE); mute->connect("pressed", this, "_mute_toggled"); hbc->add_child(mute); bypass = memnew(ToolButton); - bypass->set_text("B"); bypass->set_toggle_mode(true); + bypass->set_tooltip(TTR("Bypass")); bypass->add_color_override("font_color_pressed", Color(0.9, 0.9, 0.2)); bypass->add_color_override("font_color_hover", Color(0.9, 0.9, 0.6)); bypass->set_focus_mode(FOCUS_NONE); diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp index 5089468e1d..952c98d0f6 100644 --- a/editor/editor_help.cpp +++ b/editor/editor_help.cpp @@ -1782,8 +1782,8 @@ void EditorHelpBit::_bind_methods() { void EditorHelpBit::_notification(int p_what) { - if (p_what == NOTIFICATION_ENTER_TREE) { - add_style_override("panel", get_stylebox("ScriptPanel", "EditorStyles")); + if (p_what == EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED) { + add_style_override("panel", EditorNode::get_singleton()->get_gui_base()->get_stylebox("ScriptPanel", "EditorStyles")); } } @@ -1800,4 +1800,5 @@ EditorHelpBit::EditorHelpBit() { rich_text->set_area_as_parent_rect(8 * EDSCALE); rich_text->connect("meta_clicked", this, "_meta_clicked"); set_custom_minimum_size(Size2(0, 70 * EDSCALE)); + add_style_override("panel", EditorNode::get_singleton()->get_gui_base()->get_stylebox("ScriptPanel", "EditorStyles")); } diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index b61f82ffaf..2e0174ad68 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -2753,6 +2753,8 @@ int EditorNode::_next_unsaved_scene() { for (int i = 0; i < editor_data.get_edited_scene_count(); i++) { + if (!editor_data.get_edited_scene_root(i)) + continue; int current = editor_data.get_edited_scene(); bool unsaved = (i == current) ? saved_version != editor_data.get_undo_redo().get_version() : editor_data.get_scene_version(i) != 0; if (unsaved) { @@ -4383,6 +4385,10 @@ void EditorNode::_scene_tab_closed(int p_tab) { current_option = SCENE_TAB_CLOSE; tab_closing = p_tab; Node *scene = editor_data.get_edited_scene_root(p_tab); + if (!scene) { + _discard_changes(); + return; + } bool unsaved = (p_tab == editor_data.get_edited_scene()) ? saved_version != editor_data.get_undo_redo().get_version() : @@ -4430,6 +4436,11 @@ void EditorNode::_scene_tab_input(const Ref<InputEvent> &p_input) { } } +void EditorNode::_reposition_active_tab(int idx_to) { + editor_data.move_edited_scene_to_index(idx_to); + _update_scene_tabs(); +} + void EditorNode::_thumbnail_done(const String &p_path, const Ref<Texture> &p_preview, const Variant &p_udata) { int p_tab = p_udata.operator signed int(); if (p_preview.is_valid()) { @@ -5019,6 +5030,7 @@ void EditorNode::_bind_methods() { ClassDB::bind_method("_scene_tab_hover", &EditorNode::_scene_tab_hover); ClassDB::bind_method("_scene_tab_exit", &EditorNode::_scene_tab_exit); ClassDB::bind_method("_scene_tab_input", &EditorNode::_scene_tab_input); + ClassDB::bind_method("_reposition_active_tab", &EditorNode::_reposition_active_tab); ClassDB::bind_method("_thumbnail_done", &EditorNode::_thumbnail_done); ClassDB::bind_method("_scene_tab_script_edited", &EditorNode::_scene_tab_script_edited); ClassDB::bind_method("_set_main_scene_state", &EditorNode::_set_main_scene_state); @@ -5393,6 +5405,7 @@ EditorNode::EditorNode() { scene_tabs->connect("tab_hover", this, "_scene_tab_hover"); scene_tabs->connect("mouse_exited", this, "_scene_tab_exit"); scene_tabs->connect("gui_input", this, "_scene_tab_input"); + scene_tabs->connect("reposition_active_tab_request", this, "_reposition_active_tab"); HBoxContainer *tabbar_container = memnew(HBoxContainer); scene_tabs->set_h_size_flags(Control::SIZE_EXPAND_FILL); @@ -5886,7 +5899,7 @@ EditorNode::EditorNode() { search_button = memnew(ToolButton); search_button->set_toggle_mode(true); search_button->set_pressed(false); - search_button->set_icon(gui_base->get_icon("Zoom", "EditorIcons")); + search_button->set_icon(gui_base->get_icon("Search", "EditorIcons")); prop_editor_hb->add_child(search_button); search_button->connect("toggled", this, "_toggle_search_bar"); @@ -6330,21 +6343,17 @@ EditorNode::EditorNode() { add_editor_plugin( memnew( ShaderEditorPlugin(this,false) ) );*/ add_editor_plugin(memnew(CameraEditorPlugin(this))); - // add_editor_plugin( memnew( SampleEditorPlugin(this) ) ); - // add_editor_plugin( memnew( SampleLibraryEditorPlugin(this) ) ); add_editor_plugin(memnew(ThemeEditorPlugin(this))); add_editor_plugin(memnew(MultiMeshEditorPlugin(this))); add_editor_plugin(memnew(MeshInstanceEditorPlugin(this))); add_editor_plugin(memnew(AnimationTreeEditorPlugin(this))); - //add_editor_plugin( memnew( SamplePlayerEditorPlugin(this) ) ); - this is kind of useless at this point //add_editor_plugin( memnew( MeshLibraryEditorPlugin(this) ) ); - //add_editor_plugin( memnew( StreamEditorPlugin(this) ) ); add_editor_plugin(memnew(StyleBoxEditorPlugin(this))); add_editor_plugin(memnew(ParticlesEditorPlugin(this))); add_editor_plugin(memnew(ResourcePreloaderEditorPlugin(this))); add_editor_plugin(memnew(ItemListEditorPlugin(this))); //add_editor_plugin( memnew( RichTextEditorPlugin(this) ) ); - //add_editor_plugin( memnew( CollisionPolygonEditorPlugin(this) ) ); + add_editor_plugin(memnew(CollisionPolygonEditorPlugin(this))); add_editor_plugin(memnew(CollisionPolygon2DEditorPlugin(this))); add_editor_plugin(memnew(TileSetEditorPlugin(this))); add_editor_plugin(memnew(TileMapEditorPlugin(this))); @@ -6354,7 +6363,6 @@ EditorNode::EditorNode() { add_editor_plugin(memnew(GIProbeEditorPlugin(this))); add_editor_plugin(memnew(Path2DEditorPlugin(this))); add_editor_plugin(memnew(PathEditorPlugin(this))); - //add_editor_plugin( memnew( BakedLightEditorPlugin(this) ) ); add_editor_plugin(memnew(Line2DEditorPlugin(this))); add_editor_plugin(memnew(Polygon2DEditorPlugin(this))); add_editor_plugin(memnew(LightOccluder2DEditorPlugin(this))); @@ -6523,10 +6531,10 @@ EditorNode::EditorNode() { _dim_timer->connect("timeout", this, "_dim_timeout"); add_child(_dim_timer); - ED_SHORTCUT("editor/editor_2d", TTR("Open 2D Editor"), KEY_F2); - ED_SHORTCUT("editor/editor_3d", TTR("Open 3D Editor"), KEY_F3); - ED_SHORTCUT("editor/editor_script", TTR("Open Script Editor"), KEY_F4); - ED_SHORTCUT("editor/editor_help", TTR("Search Help"), KEY_F1); + ED_SHORTCUT("editor/editor_2d", TTR("Open 2D Editor"), KEY_F1); + ED_SHORTCUT("editor/editor_3d", TTR("Open 3D Editor"), KEY_F2); + ED_SHORTCUT("editor/editor_script", TTR("Open Script Editor"), KEY_F3); //hack neded for script editor F3 search to work :) Assign like this or don't use F3 + ED_SHORTCUT("editor/editor_help", TTR("Search Help"), KEY_F4); ED_SHORTCUT("editor/editor_assetlib", TTR("Open Asset Library")); ED_SHORTCUT("editor/editor_next", TTR("Open the next Editor")); ED_SHORTCUT("editor/editor_prev", TTR("Open the previous Editor")); diff --git a/editor/editor_node.h b/editor/editor_node.h index 49ac04243c..991cf1df71 100644 --- a/editor/editor_node.h +++ b/editor/editor_node.h @@ -572,6 +572,7 @@ private: void _scene_tab_hover(int p_tab); void _scene_tab_exit(); void _scene_tab_input(const Ref<InputEvent> &p_input); + void _reposition_active_tab(int idx_to); void _thumbnail_done(const String &p_path, const Ref<Texture> &p_preview, const Variant &p_udata); void _scene_tab_script_edited(int p_tab); diff --git a/editor/editor_plugin.cpp b/editor/editor_plugin.cpp index e4b055a9e2..606fd8ee5e 100644 --- a/editor/editor_plugin.cpp +++ b/editor/editor_plugin.cpp @@ -80,6 +80,24 @@ void EditorPlugin::edit_resource(const Ref<Resource> &p_resource) { EditorNode::get_singleton()->edit_resource(p_resource); } +void EditorPlugin::open_scene_from_path(const String &scene_path) { + + if (EditorNode::get_singleton()->is_changing_scene()) { + return; + } + + EditorNode::get_singleton()->open_request(scene_path); +} + +void EditorPlugin::reload_scene_from_path(const String &scene_path) { + + if (EditorNode::get_singleton()->is_changing_scene()) { + return; + } + + EditorNode::get_singleton()->reload_scene(scene_path); +} + void EditorPlugin::add_control_to_container(CustomControlContainer p_location, Control *p_control) { switch (p_location) { @@ -376,6 +394,8 @@ void EditorPlugin::_bind_methods() { ClassDB::bind_method(D_METHOD("get_editor_settings:EditorSettings"), &EditorPlugin::get_editor_settings); ClassDB::bind_method(D_METHOD("queue_save_layout"), &EditorPlugin::queue_save_layout); ClassDB::bind_method(D_METHOD("edit_resource"), &EditorPlugin::edit_resource); + ClassDB::bind_method(D_METHOD("open_scene_from_path", "scene_filepath"), &EditorPlugin::open_scene_from_path); + ClassDB::bind_method(D_METHOD("reload_scene_from_path", "scene_filepath"), &EditorPlugin::reload_scene_from_path); ClassDB::bind_method(D_METHOD("add_import_plugin"), &EditorPlugin::add_import_plugin); ClassDB::bind_method(D_METHOD("remove_import_plugin"), &EditorPlugin::remove_import_plugin); ClassDB::bind_method(D_METHOD("set_input_event_forwarding_always_enabled"), &EditorPlugin::set_input_event_forwarding_always_enabled); diff --git a/editor/editor_plugin.h b/editor/editor_plugin.h index 57a22a8b2f..3653851d5a 100644 --- a/editor/editor_plugin.h +++ b/editor/editor_plugin.h @@ -103,6 +103,8 @@ public: void remove_control_from_bottom_panel(Control *p_control); Control *get_editor_viewport(); void edit_resource(const Ref<Resource> &p_resource); + void open_scene_from_path(const String &scene_path); + void reload_scene_from_path(const String &scene_path); void add_tool_menu_item(const String &p_name, Object *p_handler, const String &p_callback, const Variant &p_ud = Variant()); void add_tool_submenu_item(const String &p_name, Object *p_submenu); diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp index 5c6ba892cb..7a7b2b7d1e 100644 --- a/editor/editor_settings.cpp +++ b/editor/editor_settings.cpp @@ -216,6 +216,20 @@ Variant _EDITOR_DEF(const String &p_var, const Variant &p_default) { return p_default; } +static void _create_script_templates(const String &p_path) { + + FileAccess *file = FileAccess::open(p_path.plus_file("no_comments.gd"), FileAccess::WRITE); + ERR_FAIL_COND(!file); + String script = String("extends %BASE%\n\nfunc _ready():\n%TS%pass\n"); + file->store_string(script); + file->close(); + file->reopen(p_path.plus_file("empty.gd"), FileAccess::WRITE); + script = "extends %BASE%\n\n"; + file->store_string(script); + file->close(); + memdelete(file); +} + void EditorSettings::create() { if (singleton.ptr()) @@ -294,6 +308,7 @@ void EditorSettings::create() { if (dir->change_dir("script_templates") != OK) { dir->make_dir("script_templates"); + _create_script_templates(dir->get_current_dir() + "/script_templates"); } else { dir->change_dir(".."); } diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp index 62fb241ade..fe66cd7009 100644 --- a/editor/filesystem_dock.cpp +++ b/editor/filesystem_dock.cpp @@ -153,7 +153,7 @@ void FileSystemDock::_notification(int p_what) { files->connect("item_activated", this, "_select_file"); button_hist_next->connect("pressed", this, "_fw_history"); button_hist_prev->connect("pressed", this, "_bw_history"); - search_icon->set_texture(get_icon("Zoom", "EditorIcons")); + search_icon->set_texture(get_icon("Search", "EditorIcons")); button_hist_next->set_icon(get_icon("Forward", "EditorIcons")); button_hist_prev->set_icon(get_icon("Back", "EditorIcons")); diff --git a/editor/icons/2x/icon_animation_tree.png b/editor/icons/2x/icon_animation_tree.png Binary files differindex a1dd4f137f..ba7930b88f 100644 --- a/editor/icons/2x/icon_animation_tree.png +++ b/editor/icons/2x/icon_animation_tree.png diff --git a/editor/icons/2x/icon_animation_tree_player.png b/editor/icons/2x/icon_animation_tree_player.png Binary files differindex a1dd4f137f..ba7930b88f 100644 --- a/editor/icons/2x/icon_animation_tree_player.png +++ b/editor/icons/2x/icon_animation_tree_player.png diff --git a/editor/icons/2x/icon_audio_player.png b/editor/icons/2x/icon_audio_stream_player.png Binary files differindex 799b93cc5d..799b93cc5d 100644 --- a/editor/icons/2x/icon_audio_player.png +++ b/editor/icons/2x/icon_audio_stream_player.png diff --git a/editor/icons/2x/icon_audio_stream_player_2_d.png b/editor/icons/2x/icon_audio_stream_player_2_d.png Binary files differnew file mode 100644 index 0000000000..f2eaa41769 --- /dev/null +++ b/editor/icons/2x/icon_audio_stream_player_2_d.png diff --git a/editor/icons/2x/icon_audio_stream_sample.png b/editor/icons/2x/icon_audio_stream_sample.png Binary files differnew file mode 100644 index 0000000000..baaa7bf86f --- /dev/null +++ b/editor/icons/2x/icon_audio_stream_sample.png diff --git a/editor/icons/2x/icon_bit_map.png b/editor/icons/2x/icon_bit_map.png Binary files differindex 7372b85944..864d09991e 100644 --- a/editor/icons/2x/icon_bit_map.png +++ b/editor/icons/2x/icon_bit_map.png diff --git a/editor/icons/2x/icon_button.png b/editor/icons/2x/icon_button.png Binary files differindex 210b0da486..dc07e92b73 100644 --- a/editor/icons/2x/icon_button.png +++ b/editor/icons/2x/icon_button.png diff --git a/editor/icons/2x/icon_button_group.png b/editor/icons/2x/icon_button_group.png Binary files differindex 47f62005b9..15bcae7690 100644 --- a/editor/icons/2x/icon_button_group.png +++ b/editor/icons/2x/icon_button_group.png diff --git a/editor/icons/2x/icon_capsule_mesh.png b/editor/icons/2x/icon_capsule_mesh.png Binary files differnew file mode 100644 index 0000000000..ebc48ee736 --- /dev/null +++ b/editor/icons/2x/icon_capsule_mesh.png diff --git a/editor/icons/2x/icon_color_rect.png b/editor/icons/2x/icon_color_rect.png Binary files differindex 153029ac20..7f258d5d92 100644 --- a/editor/icons/2x/icon_color_rect.png +++ b/editor/icons/2x/icon_color_rect.png diff --git a/editor/icons/2x/icon_confirmation_dialog.png b/editor/icons/2x/icon_confirmation_dialog.png Binary files differindex a0df7fcd1e..ebf5886445 100644 --- a/editor/icons/2x/icon_confirmation_dialog.png +++ b/editor/icons/2x/icon_confirmation_dialog.png diff --git a/editor/icons/2x/icon_cube_mesh.png b/editor/icons/2x/icon_cube_mesh.png Binary files differnew file mode 100644 index 0000000000..b2acdd156d --- /dev/null +++ b/editor/icons/2x/icon_cube_mesh.png diff --git a/editor/icons/2x/icon_curve.png b/editor/icons/2x/icon_curve.png Binary files differnew file mode 100644 index 0000000000..fb8c209d1e --- /dev/null +++ b/editor/icons/2x/icon_curve.png diff --git a/editor/icons/2x/icon_cylinder_mesh.png b/editor/icons/2x/icon_cylinder_mesh.png Binary files differnew file mode 100644 index 0000000000..b36f599522 --- /dev/null +++ b/editor/icons/2x/icon_cylinder_mesh.png diff --git a/editor/icons/2x/icon_debug.png b/editor/icons/2x/icon_debug.png Binary files differindex 9c581f340f..c007d54b6e 100644 --- a/editor/icons/2x/icon_debug.png +++ b/editor/icons/2x/icon_debug.png diff --git a/editor/icons/2x/icon_environment.png b/editor/icons/2x/icon_environment.png Binary files differindex 4c4c30b0e5..b8438202c1 100644 --- a/editor/icons/2x/icon_environment.png +++ b/editor/icons/2x/icon_environment.png diff --git a/editor/icons/2x/icon_file_big.png b/editor/icons/2x/icon_file_big.png Binary files differindex 8c86c6b958..092132ff36 100644 --- a/editor/icons/2x/icon_file_big.png +++ b/editor/icons/2x/icon_file_big.png diff --git a/editor/icons/2x/icon_file_dialog.png b/editor/icons/2x/icon_file_dialog.png Binary files differindex f19b4d7507..ca34090296 100644 --- a/editor/icons/2x/icon_file_dialog.png +++ b/editor/icons/2x/icon_file_dialog.png diff --git a/editor/icons/2x/icon_g_d_native_library.png b/editor/icons/2x/icon_g_d_native_library.png Binary files differnew file mode 100644 index 0000000000..1deb0664ed --- /dev/null +++ b/editor/icons/2x/icon_g_d_native_library.png diff --git a/editor/icons/2x/icon_godot.png b/editor/icons/2x/icon_godot.png Binary files differnew file mode 100644 index 0000000000..d40c25cae7 --- /dev/null +++ b/editor/icons/2x/icon_godot.png diff --git a/editor/icons/2x/icon_gradient.png b/editor/icons/2x/icon_gradient.png Binary files differnew file mode 100644 index 0000000000..caf6da5836 --- /dev/null +++ b/editor/icons/2x/icon_gradient.png diff --git a/editor/icons/2x/icon_grid_map.png b/editor/icons/2x/icon_grid_map.png Binary files differindex 5bbd16d3df..83baf36c1b 100644 --- a/editor/icons/2x/icon_grid_map.png +++ b/editor/icons/2x/icon_grid_map.png diff --git a/editor/icons/2x/icon_h_button_array.png b/editor/icons/2x/icon_h_button_array.png Binary files differindex 750eef8267..3e4464f33e 100644 --- a/editor/icons/2x/icon_h_button_array.png +++ b/editor/icons/2x/icon_h_button_array.png diff --git a/editor/icons/2x/icon_h_scroll_bar.png b/editor/icons/2x/icon_h_scroll_bar.png Binary files differindex d15a36bb16..6186d23742 100644 --- a/editor/icons/2x/icon_h_scroll_bar.png +++ b/editor/icons/2x/icon_h_scroll_bar.png diff --git a/editor/icons/2x/icon_h_slider.png b/editor/icons/2x/icon_h_slider.png Binary files differindex 50bad1cc18..dee580d909 100644 --- a/editor/icons/2x/icon_h_slider.png +++ b/editor/icons/2x/icon_h_slider.png diff --git a/editor/icons/2x/icon_line_edit.png b/editor/icons/2x/icon_line_edit.png Binary files differindex d0c987388f..e6a0bc4777 100644 --- a/editor/icons/2x/icon_line_edit.png +++ b/editor/icons/2x/icon_line_edit.png diff --git a/editor/icons/2x/icon_load.png b/editor/icons/2x/icon_load.png Binary files differindex 2e797c448b..759381d636 100644 --- a/editor/icons/2x/icon_load.png +++ b/editor/icons/2x/icon_load.png diff --git a/editor/icons/2x/icon_multi_script.png b/editor/icons/2x/icon_multi_script.png Binary files differnew file mode 100644 index 0000000000..8a7dd4ee11 --- /dev/null +++ b/editor/icons/2x/icon_multi_script.png diff --git a/editor/icons/2x/icon_nine_patch_rect.png b/editor/icons/2x/icon_nine_patch_rect.png Binary files differindex 5762a0392e..95edb79936 100644 --- a/editor/icons/2x/icon_nine_patch_rect.png +++ b/editor/icons/2x/icon_nine_patch_rect.png diff --git a/editor/icons/2x/icon_open.png b/editor/icons/2x/icon_open.png Binary files differindex 2e797c448b..759381d636 100644 --- a/editor/icons/2x/icon_open.png +++ b/editor/icons/2x/icon_open.png diff --git a/editor/icons/2x/icon_option_button.png b/editor/icons/2x/icon_option_button.png Binary files differindex f4438f9efd..0e9998f856 100644 --- a/editor/icons/2x/icon_option_button.png +++ b/editor/icons/2x/icon_option_button.png diff --git a/editor/icons/2x/icon_panorama_sky.png b/editor/icons/2x/icon_panorama_sky.png Binary files differnew file mode 100644 index 0000000000..984b92c682 --- /dev/null +++ b/editor/icons/2x/icon_panorama_sky.png diff --git a/editor/icons/2x/icon_plane_mesh.png b/editor/icons/2x/icon_plane_mesh.png Binary files differnew file mode 100644 index 0000000000..d7692eae72 --- /dev/null +++ b/editor/icons/2x/icon_plane_mesh.png diff --git a/editor/icons/2x/icon_prism_mesh.png b/editor/icons/2x/icon_prism_mesh.png Binary files differnew file mode 100644 index 0000000000..fcf34ba7a6 --- /dev/null +++ b/editor/icons/2x/icon_prism_mesh.png diff --git a/editor/icons/2x/icon_procedural_sky.png b/editor/icons/2x/icon_procedural_sky.png Binary files differnew file mode 100644 index 0000000000..b615c16ecb --- /dev/null +++ b/editor/icons/2x/icon_procedural_sky.png diff --git a/editor/icons/2x/icon_quad_mesh.png b/editor/icons/2x/icon_quad_mesh.png Binary files differnew file mode 100644 index 0000000000..a8a3513b6d --- /dev/null +++ b/editor/icons/2x/icon_quad_mesh.png diff --git a/editor/icons/2x/icon_reference_rect.png b/editor/icons/2x/icon_reference_rect.png Binary files differindex 63fe559fa7..41130f7fdd 100644 --- a/editor/icons/2x/icon_reference_rect.png +++ b/editor/icons/2x/icon_reference_rect.png diff --git a/editor/icons/2x/icon_remote_transform.png b/editor/icons/2x/icon_remote_transform.png Binary files differindex dad528615a..38bfaad644 100644 --- a/editor/icons/2x/icon_remote_transform.png +++ b/editor/icons/2x/icon_remote_transform.png diff --git a/editor/icons/2x/icon_remote_transform_2d.png b/editor/icons/2x/icon_remote_transform_2d.png Binary files differindex 7ef3e06f81..022da8a9ef 100644 --- a/editor/icons/2x/icon_remote_transform_2d.png +++ b/editor/icons/2x/icon_remote_transform_2d.png diff --git a/editor/icons/2x/icon_slider_joint.png b/editor/icons/2x/icon_slider_joint.png Binary files differindex 626479152f..d3bb501bac 100644 --- a/editor/icons/2x/icon_slider_joint.png +++ b/editor/icons/2x/icon_slider_joint.png diff --git a/editor/icons/2x/icon_sphere_mesh.png b/editor/icons/2x/icon_sphere_mesh.png Binary files differnew file mode 100644 index 0000000000..29b01ebd1b --- /dev/null +++ b/editor/icons/2x/icon_sphere_mesh.png diff --git a/editor/icons/2x/icon_texture_rect.png b/editor/icons/2x/icon_texture_rect.png Binary files differindex 50d715dd09..4eba75c4e7 100644 --- a/editor/icons/2x/icon_texture_rect.png +++ b/editor/icons/2x/icon_texture_rect.png diff --git a/editor/icons/2x/icon_timer.png b/editor/icons/2x/icon_timer.png Binary files differindex b0df31d803..bc07f41828 100644 --- a/editor/icons/2x/icon_timer.png +++ b/editor/icons/2x/icon_timer.png diff --git a/editor/icons/2x/icon_tool_button.png b/editor/icons/2x/icon_tool_button.png Binary files differindex 091fa8334f..b9dd65518f 100644 --- a/editor/icons/2x/icon_tool_button.png +++ b/editor/icons/2x/icon_tool_button.png diff --git a/editor/icons/2x/icon_tools.png b/editor/icons/2x/icon_tools.png Binary files differindex 6143191fc7..be76e8fc3a 100644 --- a/editor/icons/2x/icon_tools.png +++ b/editor/icons/2x/icon_tools.png diff --git a/editor/icons/2x/icon_tree.png b/editor/icons/2x/icon_tree.png Binary files differindex 3f470cc0f3..7fb4f97f83 100644 --- a/editor/icons/2x/icon_tree.png +++ b/editor/icons/2x/icon_tree.png diff --git a/editor/icons/2x/icon_v_button_array.png b/editor/icons/2x/icon_v_button_array.png Binary files differindex 93fd1fed04..c91d7ec1cb 100644 --- a/editor/icons/2x/icon_v_button_array.png +++ b/editor/icons/2x/icon_v_button_array.png diff --git a/editor/icons/2x/icon_v_scroll_bar.png b/editor/icons/2x/icon_v_scroll_bar.png Binary files differindex 5e4f83197f..2601f681b7 100644 --- a/editor/icons/2x/icon_v_scroll_bar.png +++ b/editor/icons/2x/icon_v_scroll_bar.png diff --git a/editor/icons/2x/icon_v_slider.png b/editor/icons/2x/icon_v_slider.png Binary files differindex afc88cf510..fb7d8c2e56 100644 --- a/editor/icons/2x/icon_v_slider.png +++ b/editor/icons/2x/icon_v_slider.png diff --git a/editor/icons/2x/icon_video_player.png b/editor/icons/2x/icon_video_player.png Binary files differindex 588e17aa4e..4c1961f2ae 100644 --- a/editor/icons/2x/icon_video_player.png +++ b/editor/icons/2x/icon_video_player.png diff --git a/editor/icons/2x/icon_visual_script.png b/editor/icons/2x/icon_visual_script.png Binary files differindex 78a3a0c318..eefd214811 100644 --- a/editor/icons/2x/icon_visual_script.png +++ b/editor/icons/2x/icon_visual_script.png diff --git a/editor/icons/2x/icon_world_environment.png b/editor/icons/2x/icon_world_environment.png Binary files differindex 9ca558fcba..c680dd99bd 100644 --- a/editor/icons/2x/icon_world_environment.png +++ b/editor/icons/2x/icon_world_environment.png diff --git a/editor/icons/icon_animation_tree.png b/editor/icons/icon_animation_tree.png Binary files differindex 7a29f4d841..0bc8e7245a 100644 --- a/editor/icons/icon_animation_tree.png +++ b/editor/icons/icon_animation_tree.png diff --git a/editor/icons/icon_animation_tree_player.png b/editor/icons/icon_animation_tree_player.png Binary files differindex 7a29f4d841..0bc8e7245a 100644 --- a/editor/icons/icon_animation_tree_player.png +++ b/editor/icons/icon_animation_tree_player.png diff --git a/editor/icons/icon_audio_stream_player.png b/editor/icons/icon_audio_stream_player.png Binary files differnew file mode 100644 index 0000000000..c3e6d6cafa --- /dev/null +++ b/editor/icons/icon_audio_stream_player.png diff --git a/editor/icons/icon_audio_stream_player_2_d.png b/editor/icons/icon_audio_stream_player_2_d.png Binary files differnew file mode 100644 index 0000000000..a332b876ea --- /dev/null +++ b/editor/icons/icon_audio_stream_player_2_d.png diff --git a/editor/icons/icon_audio_stream_sample.png b/editor/icons/icon_audio_stream_sample.png Binary files differnew file mode 100644 index 0000000000..2b97f6198b --- /dev/null +++ b/editor/icons/icon_audio_stream_sample.png diff --git a/editor/icons/icon_bit_map.png b/editor/icons/icon_bit_map.png Binary files differindex 50dd8157d1..58468c98bd 100644 --- a/editor/icons/icon_bit_map.png +++ b/editor/icons/icon_bit_map.png diff --git a/editor/icons/icon_button.png b/editor/icons/icon_button.png Binary files differindex da02831da2..0c39e003e4 100644 --- a/editor/icons/icon_button.png +++ b/editor/icons/icon_button.png diff --git a/editor/icons/icon_button_group.png b/editor/icons/icon_button_group.png Binary files differindex c105234598..ac2e484abc 100644 --- a/editor/icons/icon_button_group.png +++ b/editor/icons/icon_button_group.png diff --git a/editor/icons/icon_capsule_mesh.png b/editor/icons/icon_capsule_mesh.png Binary files differnew file mode 100644 index 0000000000..e656b4b047 --- /dev/null +++ b/editor/icons/icon_capsule_mesh.png diff --git a/editor/icons/icon_color_rect.png b/editor/icons/icon_color_rect.png Binary files differindex 40b9dab605..4199a89049 100644 --- a/editor/icons/icon_color_rect.png +++ b/editor/icons/icon_color_rect.png diff --git a/editor/icons/icon_confirmation_dialog.png b/editor/icons/icon_confirmation_dialog.png Binary files differindex 2dd4cd00fb..ffadb9d907 100644 --- a/editor/icons/icon_confirmation_dialog.png +++ b/editor/icons/icon_confirmation_dialog.png diff --git a/editor/icons/icon_cube_mesh.png b/editor/icons/icon_cube_mesh.png Binary files differnew file mode 100644 index 0000000000..a52d7a1823 --- /dev/null +++ b/editor/icons/icon_cube_mesh.png diff --git a/editor/icons/icon_curve.png b/editor/icons/icon_curve.png Binary files differindex 27d423edcd..a261e00f66 100644 --- a/editor/icons/icon_curve.png +++ b/editor/icons/icon_curve.png diff --git a/editor/icons/icon_cylinder_mesh.png b/editor/icons/icon_cylinder_mesh.png Binary files differnew file mode 100644 index 0000000000..da147ce7b4 --- /dev/null +++ b/editor/icons/icon_cylinder_mesh.png diff --git a/editor/icons/icon_debug.png b/editor/icons/icon_debug.png Binary files differindex a4a4591e12..b67e306697 100644 --- a/editor/icons/icon_debug.png +++ b/editor/icons/icon_debug.png diff --git a/editor/icons/icon_environment.png b/editor/icons/icon_environment.png Binary files differindex c8c4da3e8f..265af5e4ad 100644 --- a/editor/icons/icon_environment.png +++ b/editor/icons/icon_environment.png diff --git a/editor/icons/icon_file_big.png b/editor/icons/icon_file_big.png Binary files differindex d429736b57..e0aff764f1 100644 --- a/editor/icons/icon_file_big.png +++ b/editor/icons/icon_file_big.png diff --git a/editor/icons/icon_file_dialog.png b/editor/icons/icon_file_dialog.png Binary files differindex 162827b2b0..c918e2b3b2 100644 --- a/editor/icons/icon_file_dialog.png +++ b/editor/icons/icon_file_dialog.png diff --git a/editor/icons/icon_g_d_native_library.png b/editor/icons/icon_g_d_native_library.png Binary files differnew file mode 100644 index 0000000000..530e06a982 --- /dev/null +++ b/editor/icons/icon_g_d_native_library.png diff --git a/editor/icons/icon_godot.png b/editor/icons/icon_godot.png Binary files differnew file mode 100644 index 0000000000..a5e371865c --- /dev/null +++ b/editor/icons/icon_godot.png diff --git a/editor/icons/icon_gradient.png b/editor/icons/icon_gradient.png Binary files differnew file mode 100644 index 0000000000..c5e89c3908 --- /dev/null +++ b/editor/icons/icon_gradient.png diff --git a/editor/icons/icon_grid_map.png b/editor/icons/icon_grid_map.png Binary files differindex 570b11d085..69a431ccba 100644 --- a/editor/icons/icon_grid_map.png +++ b/editor/icons/icon_grid_map.png diff --git a/editor/icons/icon_h_button_array.png b/editor/icons/icon_h_button_array.png Binary files differnew file mode 100644 index 0000000000..81b2bf79e3 --- /dev/null +++ b/editor/icons/icon_h_button_array.png diff --git a/editor/icons/icon_h_scroll_bar.png b/editor/icons/icon_h_scroll_bar.png Binary files differindex e4576c4ae3..c6c6daf7a4 100644 --- a/editor/icons/icon_h_scroll_bar.png +++ b/editor/icons/icon_h_scroll_bar.png diff --git a/editor/icons/icon_h_slider.png b/editor/icons/icon_h_slider.png Binary files differindex 87cf585e14..156364e920 100644 --- a/editor/icons/icon_h_slider.png +++ b/editor/icons/icon_h_slider.png diff --git a/editor/icons/icon_line_edit.png b/editor/icons/icon_line_edit.png Binary files differindex 81b5efcf6c..813642f25e 100644 --- a/editor/icons/icon_line_edit.png +++ b/editor/icons/icon_line_edit.png diff --git a/editor/icons/icon_load.png b/editor/icons/icon_load.png Binary files differindex cc05e98ebb..81835efa25 100644 --- a/editor/icons/icon_load.png +++ b/editor/icons/icon_load.png diff --git a/editor/icons/icon_multi_script.png b/editor/icons/icon_multi_script.png Binary files differnew file mode 100644 index 0000000000..7626937296 --- /dev/null +++ b/editor/icons/icon_multi_script.png diff --git a/editor/icons/icon_nine_patch_rect.png b/editor/icons/icon_nine_patch_rect.png Binary files differindex bdd1467144..721bd36d08 100644 --- a/editor/icons/icon_nine_patch_rect.png +++ b/editor/icons/icon_nine_patch_rect.png diff --git a/editor/icons/icon_open.png b/editor/icons/icon_open.png Binary files differindex cc05e98ebb..81835efa25 100644 --- a/editor/icons/icon_open.png +++ b/editor/icons/icon_open.png diff --git a/editor/icons/icon_option_button.png b/editor/icons/icon_option_button.png Binary files differindex c1155309aa..b67e951fef 100644 --- a/editor/icons/icon_option_button.png +++ b/editor/icons/icon_option_button.png diff --git a/editor/icons/icon_panorama_sky.png b/editor/icons/icon_panorama_sky.png Binary files differnew file mode 100644 index 0000000000..38a53afe52 --- /dev/null +++ b/editor/icons/icon_panorama_sky.png diff --git a/editor/icons/icon_plane_mesh.png b/editor/icons/icon_plane_mesh.png Binary files differnew file mode 100644 index 0000000000..8b86099d67 --- /dev/null +++ b/editor/icons/icon_plane_mesh.png diff --git a/editor/icons/icon_prism_mesh.png b/editor/icons/icon_prism_mesh.png Binary files differnew file mode 100644 index 0000000000..49f773765f --- /dev/null +++ b/editor/icons/icon_prism_mesh.png diff --git a/editor/icons/icon_procedural_sky.png b/editor/icons/icon_procedural_sky.png Binary files differnew file mode 100644 index 0000000000..484bcde038 --- /dev/null +++ b/editor/icons/icon_procedural_sky.png diff --git a/editor/icons/icon_quad_mesh.png b/editor/icons/icon_quad_mesh.png Binary files differnew file mode 100644 index 0000000000..52f19899a3 --- /dev/null +++ b/editor/icons/icon_quad_mesh.png diff --git a/editor/icons/icon_reference_rect.png b/editor/icons/icon_reference_rect.png Binary files differindex b253af477f..3d08ee4f76 100644 --- a/editor/icons/icon_reference_rect.png +++ b/editor/icons/icon_reference_rect.png diff --git a/editor/icons/icon_remote_transform.png b/editor/icons/icon_remote_transform.png Binary files differindex 2a8b5f4d0e..9a6c30bcc8 100644 --- a/editor/icons/icon_remote_transform.png +++ b/editor/icons/icon_remote_transform.png diff --git a/editor/icons/icon_remote_transform_2d.png b/editor/icons/icon_remote_transform_2d.png Binary files differindex 16d2691832..7266f2a71d 100644 --- a/editor/icons/icon_remote_transform_2d.png +++ b/editor/icons/icon_remote_transform_2d.png diff --git a/editor/icons/icon_slider_joint.png b/editor/icons/icon_slider_joint.png Binary files differindex d65fb3650d..5b8c2df6ff 100644 --- a/editor/icons/icon_slider_joint.png +++ b/editor/icons/icon_slider_joint.png diff --git a/editor/icons/icon_sphere_mesh.png b/editor/icons/icon_sphere_mesh.png Binary files differnew file mode 100644 index 0000000000..19ed49c3cd --- /dev/null +++ b/editor/icons/icon_sphere_mesh.png diff --git a/editor/icons/icon_texture_rect.png b/editor/icons/icon_texture_rect.png Binary files differindex 84e4a90bfb..20adc22715 100644 --- a/editor/icons/icon_texture_rect.png +++ b/editor/icons/icon_texture_rect.png diff --git a/editor/icons/icon_timer.png b/editor/icons/icon_timer.png Binary files differindex d3eb6a4b49..81e619cdaa 100644 --- a/editor/icons/icon_timer.png +++ b/editor/icons/icon_timer.png diff --git a/editor/icons/icon_tool_button.png b/editor/icons/icon_tool_button.png Binary files differindex b2f3f6103f..43c08592c6 100644 --- a/editor/icons/icon_tool_button.png +++ b/editor/icons/icon_tool_button.png diff --git a/editor/icons/icon_tools.png b/editor/icons/icon_tools.png Binary files differindex 4db4c53796..d81c93f212 100644 --- a/editor/icons/icon_tools.png +++ b/editor/icons/icon_tools.png diff --git a/editor/icons/icon_tree.png b/editor/icons/icon_tree.png Binary files differindex 50ec1df98b..de856a79fb 100644 --- a/editor/icons/icon_tree.png +++ b/editor/icons/icon_tree.png diff --git a/editor/icons/icon_v_button_array.png b/editor/icons/icon_v_button_array.png Binary files differnew file mode 100644 index 0000000000..996475ffa4 --- /dev/null +++ b/editor/icons/icon_v_button_array.png diff --git a/editor/icons/icon_v_scroll_bar.png b/editor/icons/icon_v_scroll_bar.png Binary files differindex 91e00f4619..edd6d4cd67 100644 --- a/editor/icons/icon_v_scroll_bar.png +++ b/editor/icons/icon_v_scroll_bar.png diff --git a/editor/icons/icon_v_slider.png b/editor/icons/icon_v_slider.png Binary files differindex 545c126d23..d9c0bb00d9 100644 --- a/editor/icons/icon_v_slider.png +++ b/editor/icons/icon_v_slider.png diff --git a/editor/icons/icon_video_player.png b/editor/icons/icon_video_player.png Binary files differindex 5fd3723b22..0d5dc0ed73 100644 --- a/editor/icons/icon_video_player.png +++ b/editor/icons/icon_video_player.png diff --git a/editor/icons/icon_visual_script.png b/editor/icons/icon_visual_script.png Binary files differindex 1678998d17..355d3c03c3 100644 --- a/editor/icons/icon_visual_script.png +++ b/editor/icons/icon_visual_script.png diff --git a/editor/icons/icon_world_environment.png b/editor/icons/icon_world_environment.png Binary files differindex d9f1323386..230d660107 100644 --- a/editor/icons/icon_world_environment.png +++ b/editor/icons/icon_world_environment.png diff --git a/editor/icons/source/icon_tree_arrow_right.svg b/editor/icons/source/icon_2_d.svg index 43134ba1b1..54c93a45aa 100644 --- a/editor/icons/source/icon_tree_arrow_right.svg +++ b/editor/icons/source/icon_2_d.svg @@ -9,16 +9,16 @@ xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="12" - height="12" - viewBox="0 0 12 12" + width="16" + height="16" + viewBox="0 0 16 16" id="svg2" version="1.1" inkscape:version="0.92.1 r" - inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_collapse.png" + inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_add_track.png" inkscape:export-xdpi="45" inkscape:export-ydpi="45" - sodipodi:docname="arrow_right.svg"> + sodipodi:docname="icon_2_d.svg"> <defs id="defs4" /> <sodipodi:namedview @@ -28,9 +28,9 @@ borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" - inkscape:zoom="45.254836" - inkscape:cx="4.0845752" - inkscape:cy="5.8802612" + inkscape:zoom="22.627418" + inkscape:cx="1.7654173" + inkscape:cy="7.2653991" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="true" @@ -47,6 +47,7 @@ inkscape:window-x="0" inkscape:window-y="27" inkscape:window-maximized="1" + inkscape:snap-midpoints="true" inkscape:snap-smooth-nodes="true" inkscape:object-nodes="true"> <inkscape:grid @@ -69,12 +70,24 @@ inkscape:label="Layer 1" inkscape:groupmode="layer" id="layer1" - transform="translate(0,-1040.3622)"> + transform="translate(0,-1036.3622)"> <path - style="fill:none;stroke:#ffffff;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.39215687" - d="m 4,1049.3622 3.0000202,-3 -3.0000202,-3" - id="path814" + style="fill:none;stroke:#e0e0e0;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 2,1040.3622 2,-2 2,2" + id="path4485" inkscape:connector-curvature="0" sodipodi:nodetypes="ccc" /> + <path + style="fill:none;stroke:#e0e0e0;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 4,1039.3622 v 9 h 9" + id="path4487" + inkscape:connector-curvature="0" + sodipodi:nodetypes="ccc" /> + <path + sodipodi:nodetypes="ccc" + inkscape:connector-curvature="0" + id="path4489" + d="m 12,1046.3622 2,2 -2,2" + style="fill:none;stroke:#e0e0e0;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> </g> </svg> diff --git a/editor/icons/source/icon_tree_arrow_down.svg b/editor/icons/source/icon_3_d.svg index 1dd209720f..3147d14dc1 100644 --- a/editor/icons/source/icon_tree_arrow_down.svg +++ b/editor/icons/source/icon_3_d.svg @@ -9,16 +9,16 @@ xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="12" - height="12" - viewBox="0 0 12 12" + width="16" + height="16" + viewBox="0 0 16 16" id="svg2" version="1.1" inkscape:version="0.92.1 r" - inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_collapse.png" + inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_add_track.png" inkscape:export-xdpi="45" inkscape:export-ydpi="45" - sodipodi:docname="arrow_down.svg"> + sodipodi:docname="icon_3_d.svg"> <defs id="defs4" /> <sodipodi:namedview @@ -28,9 +28,9 @@ borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" - inkscape:zoom="22.627417" - inkscape:cx="1.7981958" - inkscape:cy="7.5815407" + inkscape:zoom="32.000001" + inkscape:cx="7.1007207" + inkscape:cy="6.155123" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="true" @@ -47,6 +47,7 @@ inkscape:window-x="0" inkscape:window-y="27" inkscape:window-maximized="1" + inkscape:snap-midpoints="true" inkscape:snap-smooth-nodes="true" inkscape:object-nodes="true"> <inkscape:grid @@ -69,12 +70,36 @@ inkscape:label="Layer 1" inkscape:groupmode="layer" id="layer1" - transform="translate(0,-1040.3622)"> + transform="translate(0,-1036.3622)"> <path - style="fill:none;stroke:#ffffff;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.39215687" - d="m 3,1045.3622 3,3 3,-3" - id="path814" + style="fill:none;stroke:#e0e0e0;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 2.0050708,1040.3622 2,-2 2,2" + id="path4485" inkscape:connector-curvature="0" sodipodi:nodetypes="ccc" /> + <path + style="fill:none;stroke:#e0e0e0;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 4.0050708,1039.3622 v 9 h 9.0000002" + id="path4487" + inkscape:connector-curvature="0" + sodipodi:nodetypes="ccc" /> + <path + sodipodi:nodetypes="ccc" + inkscape:connector-curvature="0" + id="path4489" + d="m 12.005071,1046.3622 2,2 -2,2" + style="fill:none;stroke:#e0e0e0;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + <path + style="fill:none;stroke:#e0e0e0;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 4.0050708,1048.3622 8.0000002,-8" + id="path4496" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cc" /> + <path + sodipodi:nodetypes="ccc" + inkscape:connector-curvature="0" + id="path4498" + d="m 10.176644,1039.3622 h 2.828427 v 2.8284" + style="fill:none;stroke:#e0e0e0;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> </g> </svg> diff --git a/editor/icons/source/icon_animation_tree_player.svg b/editor/icons/source/icon_animation_tree_player.svg index 1c5c41e5f2..fa5803489e 100644 --- a/editor/icons/source/icon_animation_tree_player.svg +++ b/editor/icons/source/icon_animation_tree_player.svg @@ -28,9 +28,9 @@ borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" - inkscape:zoom="22.627416" - inkscape:cx="-0.31764706" - inkscape:cy="5.3536612" + inkscape:zoom="31.999999" + inkscape:cx="5.6353556" + inkscape:cy="8.4280346" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="true" @@ -70,7 +70,7 @@ transform="translate(0,-1036.3622)"> <path style="opacity:1;fill:#fbe87a;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - d="M 1 1 L 1 15 L 2.1660156 15 L 2.1660156 13 L 4 13 L 4 15 L 12 15 L 12 13 L 14 13 L 14 15 L 15 15 L 15 1 L 14 1 L 14 3 L 12 3 L 12 1 L 4 1 L 4 3 L 2.1660156 3 L 2.1660156 1 L 1 1 z M 5.984375 2.9863281 A 1.0001 1.0001 0 0 1 7 4 L 7 6.3828125 L 9.5527344 5.1054688 A 1.0001 1.0001 0 0 1 10.003906 4.9941406 A 1.0001 1.0001 0 0 1 10.447266 6.8945312 L 7 8.6171875 L 7 12 A 1.0001 1.0001 0 1 1 5 12 L 5 7.9921875 L 5 4 A 1.0001 1.0001 0 0 1 5.984375 2.9863281 z M 2.1660156 5 L 4 5 L 4 7 L 2.1660156 7 L 2.1660156 5 z M 12 5 L 14 5 L 14 7 L 12 7 L 12 5 z M 2.1660156 9 L 4 9 L 4 11 L 2.1660156 11 L 2.1660156 9 z M 12 9 L 14 9 L 14 11 L 12 11 L 12 9 z " + d="M 1 1 L 1 15 L 2.1660156 15 L 2.1660156 13 L 4 13 L 4 15 L 12 15 L 12 13 L 14 13 L 14 15 L 15 15 L 15 1 L 14 1 L 14 3 L 12 3 L 12 1 L 4 1 L 4 3 L 2.1660156 3 L 2.1660156 1 L 1 1 z M 5 4 L 7 4 L 7 5 L 7 6 L 8 6 L 11 6 L 11 8 L 9 8 L 9 9 L 9 10 L 10 10 L 11 10 L 11 12 L 10 12 L 8 12 A 1.0001 1.0001 0 0 1 7 11 L 7 10 L 7 8 L 6 8 A 1.0001 1.0001 0 0 1 5 7 L 5 6 L 5 5 L 5 4 z M 2.1660156 5 L 4 5 L 4 7 L 2.1660156 7 L 2.1660156 5 z M 12 5 L 14 5 L 14 7 L 12 7 L 12 5 z M 2.1660156 9 L 4 9 L 4 11 L 2.1660156 11 L 2.1660156 9 z M 12 9 L 14 9 L 14 11 L 12 11 L 12 9 z " transform="translate(0,1036.3622)" id="rect4136" /> </g> diff --git a/editor/icons/source/icon_audio_player.svg b/editor/icons/source/icon_audio_stream_player.svg index 2d9c5f4e6c..2d9c5f4e6c 100644 --- a/editor/icons/source/icon_audio_player.svg +++ b/editor/icons/source/icon_audio_stream_player.svg diff --git a/editor/icons/source/icon_audio_stream_player_2_d.svg b/editor/icons/source/icon_audio_stream_player_2_d.svg new file mode 100644 index 0000000000..39149786c4 --- /dev/null +++ b/editor/icons/source/icon_audio_stream_player_2_d.svg @@ -0,0 +1,114 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="16" + height="16" + viewBox="0 0 16 16" + id="svg2" + version="1.1" + inkscape:version="0.92+devel unknown" + inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_add_track.png" + inkscape:export-xdpi="45" + inkscape:export-ydpi="45" + sodipodi:docname="icon_audio_player_2d.svg"> + <defs + id="defs4"> + <linearGradient + id="linearGradient959-5" + inkscape:collect="always"> + <stop + style="stop-color:#ff8484;stop-opacity:1" + offset="0" + id="stop957-3" /> + <stop + id="stop955-5" + offset="0.5" + style="stop-color:#e1dc7a;stop-opacity:1" /> + <stop + style="stop-color:#84ffb1;stop-opacity:1" + offset="1" + id="stop953-6" /> + </linearGradient> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient959-5" + id="linearGradient4552" + x1="8" + y1="1" + x2="8" + y2="15" + gradientUnits="userSpaceOnUse" /> + </defs> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="11.313709" + inkscape:cx="12.877013" + inkscape:cy="3.5679216" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="true" + units="px" + inkscape:snap-bbox="true" + inkscape:bbox-paths="true" + inkscape:bbox-nodes="true" + inkscape:snap-bbox-edge-midpoints="true" + inkscape:snap-bbox-midpoints="false" + inkscape:snap-object-midpoints="true" + inkscape:snap-center="true" + inkscape:window-width="1920" + inkscape:window-height="1016" + inkscape:window-x="0" + inkscape:window-y="27" + inkscape:window-maximized="1" + inkscape:snap-midpoints="true" + inkscape:snap-smooth-nodes="true" + inkscape:object-nodes="true" + inkscape:document-rotation="0"> + <inkscape:grid + type="xygrid" + id="grid3336" /> + </sodipodi:namedview> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1" + transform="translate(0,-1036.3622)"> + <path + style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#a5b7f1;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.97227669;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" + d="m 10.023235,1044.3625 c -0.5613918,-0.013 -1.0235345,0.4264 -1.0234377,0.9724 v 5.0542 c 6.911e-4,0.7482 0.8336124,1.2154 1.4999997,0.8414 l 4,-2.5262 c 0.666937,-0.3743 0.666937,-1.3104 0,-1.6847 l -4,-2.5261 c -0.145049,-0.082 -0.308928,-0.1269 -0.476562,-0.131 z" + id="path4507" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cccccccc" /> + <path + style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:url(#linearGradient4552);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" + d="M 11.970703 1.0019531 A 1.0001 1.0001 0 0 0 11.724609 1.0390625 L 4.7246094 3.0390625 A 1.0001 1.0001 0 0 0 4 4 L 4 9.5507812 A 2.5 2.4999914 0 0 0 3.5 9.5 A 2.5 2.4999914 0 0 0 1 12 A 2.5 2.4999914 0 0 0 3.5 14.5 A 2.5 2.4999914 0 0 0 5.9960938 12.087891 A 1.0001 1.0001 0 0 0 6 12 L 6 4.7558594 L 11 3.328125 L 11 6.5 L 13 5.5 L 13 2 A 1.0001 1.0001 0 0 0 11.970703 1.0019531 z " + transform="translate(0,1036.3622)" + id="path4514" /> + </g> +</svg> diff --git a/editor/icons/source/icon_spinbox_updown.svg b/editor/icons/source/icon_audio_stream_sample.svg index e29d7fe0d2..0724daa333 100644 --- a/editor/icons/source/icon_spinbox_updown.svg +++ b/editor/icons/source/icon_audio_stream_sample.svg @@ -7,6 +7,7 @@ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="16" @@ -14,13 +15,39 @@ viewBox="0 0 16 16" id="svg2" version="1.1" - inkscape:version="0.92.1 r" - inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_collapse.png" + inkscape:version="0.92+devel unknown" + inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_add_track.png" inkscape:export-xdpi="45" inkscape:export-ydpi="45" - sodipodi:docname="spinbox_updown.svg"> + sodipodi:docname="icon_audio_stream_sample.svg"> <defs - id="defs4" /> + id="defs4"> + <linearGradient + id="linearGradient959-5" + inkscape:collect="always"> + <stop + style="stop-color:#ff8484;stop-opacity:1" + offset="0" + id="stop957-3" /> + <stop + id="stop955-5" + offset="0.5" + style="stop-color:#e1dc7a;stop-opacity:1" /> + <stop + style="stop-color:#84ffb1;stop-opacity:1" + offset="1" + id="stop953-6" /> + </linearGradient> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient959-5" + id="linearGradient4552" + x1="8" + y1="1" + x2="8" + y2="15" + gradientUnits="userSpaceOnUse" /> + </defs> <sodipodi:namedview id="base" pagecolor="#ffffff" @@ -28,11 +55,11 @@ borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" - inkscape:zoom="16" - inkscape:cx="-1.901723" - inkscape:cy="9.1326297" + inkscape:zoom="11.313708" + inkscape:cx="0.86295209" + inkscape:cy="-2.4874516" inkscape:document-units="px" - inkscape:current-layer="layer1-5" + inkscape:current-layer="layer1" showgrid="true" units="px" inkscape:snap-bbox="true" @@ -42,13 +69,15 @@ inkscape:snap-bbox-midpoints="false" inkscape:snap-object-midpoints="true" inkscape:snap-center="true" - inkscape:window-width="1600" - inkscape:window-height="836" + inkscape:window-width="1920" + inkscape:window-height="1016" inkscape:window-x="0" inkscape:window-y="27" inkscape:window-maximized="1" + inkscape:snap-midpoints="true" inkscape:snap-smooth-nodes="true" - inkscape:object-nodes="true"> + inkscape:object-nodes="true" + inkscape:document-rotation="0"> <inkscape:grid type="xygrid" id="grid3336" /> @@ -71,13 +100,9 @@ id="layer1" transform="translate(0,-1036.3622)"> <path - style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#e0e0e0;fill-opacity:0.78431374;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" - d="M 7.984375 1.0019531 A 1.0001 1.0001 0 0 0 7.2929688 1.2929688 L 3.2929688 5.2929688 A 1.0001 1.0001 0 1 0 4.7070312 6.7070312 L 8 3.4140625 L 11.292969 6.7070312 A 1.0001 1.0001 0 1 0 12.707031 5.2929688 L 8.7070312 1.2929688 A 1.0001 1.0001 0 0 0 7.984375 1.0019531 z M 11.990234 8.9863281 A 1.0001 1.0001 0 0 0 11.292969 9.2929688 L 8 12.585938 L 4.7070312 9.2929688 A 1.0001 1.0001 0 0 0 3.9902344 8.9902344 A 1.0001 1.0001 0 0 0 3.2929688 10.707031 L 7.2929688 14.707031 A 1.0001 1.0001 0 0 0 8.7070312 14.707031 L 12.707031 10.707031 A 1.0001 1.0001 0 0 0 11.990234 8.9863281 z " + style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:url(#linearGradient4552);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" + d="M 11.970703 1.0019531 C 11.887443 1.0040231 11.804775 1.0164945 11.724609 1.0390625 L 4.7246094 3.0390625 C 4.2958022 3.1619372 4.0002098 3.5539354 4 4 L 4 9.5507812 C 3.8354622 9.5171023 3.6679493 9.5000892 3.5 9.5 C 2.1192848 9.5 0.99999525 10.61929 1 12 C 0.99999525 13.38071 2.1192848 14.5 3.5 14.5 C 4.8455926 14.4987 5.9487926 13.432648 5.9960938 12.087891 C 5.9986844 12.058665 5.9999878 12.02934 6 12 L 6 4.7558594 L 11 3.328125 L 11 6.5 L 13 5.5 L 13 2 C 12.999084 1.4368608 12.533603 0.98551202 11.970703 1.0019531 z M 10.5 8 C 10.223 8 10 8.223 10 8.5 L 10 13.5 C 10 13.777 10.223 14 10.5 14 C 10.777 14 11 13.777 11 13.5 L 11 8.5 C 11 8.223 10.777 8 10.5 8 z M 12.5 9 C 12.223 9 12 9.223 12 9.5 L 12 12.5 C 12 12.777 12.223 13 12.5 13 C 12.777 13 13 12.777 13 12.5 L 13 9.5 C 13 9.223 12.777 9 12.5 9 z M 8.5 10 C 8.223 10 8 10.223 8 10.5 L 8 11.5 C 8 11.777 8.223 12 8.5 12 C 8.777 12 9 11.777 9 11.5 L 9 10.5 C 9 10.223 8.777 10 8.5 10 z M 14.5 10 C 14.223 10 14 10.223 14 10.5 L 14 11.5 C 14 11.777 14.223 12 14.5 12 C 14.777 12 15 11.777 15 11.5 L 15 10.5 C 15 10.223 14.777 10 14.5 10 z " transform="translate(0,1036.3622)" - id="path4484" /> - <g - id="layer1-5" - inkscape:label="Layer 1" - transform="translate(14.210182,-5.3664)" /> + id="path4514" /> </g> </svg> diff --git a/editor/icons/source/icon_bit_map.svg b/editor/icons/source/icon_bit_map.svg index fbaf573af6..5c1ad9139a 100644 --- a/editor/icons/source/icon_bit_map.svg +++ b/editor/icons/source/icon_bit_map.svg @@ -14,7 +14,7 @@ viewBox="0 0 16 16" id="svg2" version="1.1" - inkscape:version="0.91 r13725" + inkscape:version="0.92.1 r" inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_collision_shape.png" inkscape:export-xdpi="90" inkscape:export-ydpi="90" @@ -29,8 +29,8 @@ inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="32" - inkscape:cx="-0.178935" - inkscape:cy="8.367044" + inkscape:cx="3.664815" + inkscape:cy="7.867044" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="true" @@ -42,8 +42,8 @@ inkscape:snap-bbox-midpoints="true" inkscape:snap-object-midpoints="true" inkscape:snap-center="true" - inkscape:window-width="1920" - inkscape:window-height="1016" + inkscape:window-width="1600" + inkscape:window-height="836" inkscape:window-x="0" inkscape:window-y="27" inkscape:window-maximized="1" @@ -74,7 +74,7 @@ id="layer1" transform="translate(0,-1036.3622)"> <path - style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" d="M 1 1 L 1 3 L 3 3 L 3 1 L 1 1 z M 3 3 L 3 5 L 5 5 L 5 3 L 3 3 z M 5 3 L 7 3 L 7 1 L 5 1 L 5 3 z M 7 3 L 7 5 L 9 5 L 9 3 L 7 3 z M 9 3 L 11 3 L 11 1 L 9 1 L 9 3 z M 11 3 L 11 5 L 13 5 L 13 3 L 11 3 z M 13 3 L 15 3 L 15 1 L 13 1 L 13 3 z M 13 5 L 13 7 L 15 7 L 15 5 L 13 5 z M 13 7 L 11 7 L 11 9 L 13 9 L 13 7 z M 13 9 L 13 11 L 15 11 L 15 9 L 13 9 z M 13 11 L 11 11 L 11 13 L 13 13 L 13 11 z M 13 13 L 13 15 L 15 15 L 15 13 L 13 13 z M 11 13 L 9 13 L 9 15 L 11 15 L 11 13 z M 9 13 L 9 11 L 7 11 L 7 13 L 9 13 z M 7 13 L 5 13 L 5 15 L 7 15 L 7 13 z M 5 13 L 5 11 L 3 11 L 3 13 L 5 13 z M 3 13 L 1 13 L 1 15 L 3 15 L 3 13 z M 3 11 L 3 9 L 1 9 L 1 11 L 3 11 z M 3 9 L 5 9 L 5 7 L 3 7 L 3 9 z M 3 7 L 3 5 L 1 5 L 1 7 L 3 7 z M 5 7 L 7 7 L 7 5 L 5 5 L 5 7 z M 7 7 L 7 9 L 9 9 L 9 7 L 7 7 z M 9 7 L 11 7 L 11 5 L 9 5 L 9 7 z M 9 9 L 9 11 L 11 11 L 11 9 L 9 9 z M 7 9 L 5 9 L 5 11 L 7 11 L 7 9 z " id="rect4170" transform="translate(0,1036.3622)" /> diff --git a/editor/icons/source/icon_button.svg b/editor/icons/source/icon_button.svg index 54644ecb9b..f095b169ca 100644 --- a/editor/icons/source/icon_button.svg +++ b/editor/icons/source/icon_button.svg @@ -14,7 +14,7 @@ viewBox="0 0 16 16" id="svg2" version="1.1" - inkscape:version="0.91 r13725" + inkscape:version="0.92.1 r" inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_button.png" inkscape:export-xdpi="90" inkscape:export-ydpi="90" @@ -28,9 +28,9 @@ borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" - inkscape:zoom="45.254834" - inkscape:cx="6.249456" - inkscape:cy="9.3054468" + inkscape:zoom="32" + inkscape:cx="9.0492367" + inkscape:cy="8.5595615" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="true" @@ -42,8 +42,8 @@ inkscape:snap-bbox-midpoints="true" inkscape:snap-object-midpoints="true" inkscape:snap-center="true" - inkscape:window-width="1920" - inkscape:window-height="1016" + inkscape:window-width="1600" + inkscape:window-height="836" inkscape:window-x="0" inkscape:window-y="27" inkscape:window-maximized="1"> @@ -60,7 +60,7 @@ <dc:format>image/svg+xml</dc:format> <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title></dc:title> + <dc:title /> </cc:Work> </rdf:RDF> </metadata> @@ -69,26 +69,40 @@ inkscape:groupmode="layer" id="layer1" transform="translate(0,-1036.3622)"> - <path - style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - d="M 1 3 L 1 11 L 15 11 L 15 3 L 1 3 z M 4 5 L 7 5 L 7 9 L 4 9 L 4 5 z M 9 5 L 10 5 L 10 6 L 11 6 L 11 5 L 12 5 L 12 6 L 11 6 L 11 7 L 12 7 L 12 9 L 11 9 L 11 7 L 10 7 L 10 9 L 9 9 L 9 5 z M 5 6 L 5 8 L 6 8 L 6 6 L 5 6 z " - transform="translate(0,1036.3622)" - id="rect4139" /> <rect - transform="scale(1,-1)" - style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect4160" - width="14" - height="2.0000522" - x="1" - y="-1049.3622" /> + style="fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect829" + width="8" + height="4.0000172" + x="4" + y="1045.3622" + ry="1.5" /> + <rect + style="fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:1.92153788;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect825" + width="12" + height="2" + x="2" + y="1048.3622" + ry="0" /> <rect - y="-1049.3622" - x="1" - height="2.0000522" - width="14" - id="rect4142" - style="opacity:1;fill:#000000;fill-opacity:0.07843138;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - transform="scale(1,-1)" /> + style="fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect827" + width="8" + height="2" + x="4" + y="1047.3622" + ry="0" /> + <path + style="fill:none;stroke:#a5efac;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 5,1040.3622 3,2 3,-2" + id="path831" + inkscape:connector-curvature="0" /> + <path + style="fill:none;stroke:#a5efac;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 8,1037.3622 v 5" + id="path833" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cc" /> </g> </svg> diff --git a/editor/icons/source/icon_button_group.svg b/editor/icons/source/icon_button_group.svg index 9d5df99deb..d1433634df 100644 --- a/editor/icons/source/icon_button_group.svg +++ b/editor/icons/source/icon_button_group.svg @@ -14,7 +14,7 @@ viewBox="0 0 16 16" id="svg2" version="1.1" - inkscape:version="0.91 r13725" + inkscape:version="0.92.1 r" inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_button_group.png" inkscape:export-xdpi="90" inkscape:export-ydpi="90" @@ -29,8 +29,8 @@ inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="32" - inkscape:cx="3.5392558" - inkscape:cy="8.9453899" + inkscape:cx="10.59901" + inkscape:cy="8.8192036" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="true" @@ -42,8 +42,8 @@ inkscape:snap-bbox-midpoints="true" inkscape:snap-object-midpoints="true" inkscape:snap-center="true" - inkscape:window-width="1920" - inkscape:window-height="1016" + inkscape:window-width="1600" + inkscape:window-height="836" inkscape:window-x="0" inkscape:window-y="27" inkscape:window-maximized="1"> @@ -69,110 +69,10 @@ inkscape:groupmode="layer" id="layer1" transform="translate(0,-1036.3622)"> - <rect - style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect4172" - width="1" - height="10" - x="0" - y="1039.3622" /> - <rect - y="1039.3622" - x="15" - height="10" - width="1" - id="rect4174" - style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> <path - style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="path4176" - sodipodi:type="arc" - sodipodi:cx="1" - sodipodi:cy="1049.3622" - sodipodi:rx="1" - sodipodi:ry="1" - sodipodi:start="0" - sodipodi:end="4.712389" - d="m 2,1049.3622 a 1,1 0 0 1 -0.6173166,0.9239 1,1 0 0 1 -1.08979019,-0.2168 1,1 0 0 1 -0.21677274,-1.0898 A 1,1 0 0 1 1,1048.3622 l 0,1 z" /> - <rect - y="-15" - x="1049.3622" - height="14" - width="1" - id="rect4178" - style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - transform="matrix(0,1,-1,0,0,0)" /> - <path - d="m -14,1049.3622 a 1,1 0 0 1 -0.617317,0.9239 1,1 0 0 1 -1.08979,-0.2168 1,1 0 0 1 -0.216773,-1.0898 1,1 0 0 1 0.92388,-0.6173 l 0,1 z" - sodipodi:end="4.712389" - sodipodi:start="0" - sodipodi:ry="1" - sodipodi:rx="1" - sodipodi:cy="1049.3622" - sodipodi:cx="-15" - sodipodi:type="arc" - id="path4180" - style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - transform="scale(-1,1)" /> - <path - d="m 2,-1039.3622 a 1,1 0 0 1 -0.6173166,0.9239 1,1 0 0 1 -1.08979019,-0.2168 1,1 0 0 1 -0.21677274,-1.0898 A 1,1 0 0 1 1,-1040.3622 l 0,1 z" - sodipodi:end="4.712389" - sodipodi:start="0" - sodipodi:ry="1" - sodipodi:rx="1" - sodipodi:cy="-1039.3622" - sodipodi:cx="1" - sodipodi:type="arc" - id="path4182" - style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - transform="scale(1,-1)" /> - <path - transform="scale(-1,-1)" - style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="path4184" - sodipodi:type="arc" - sodipodi:cx="-15" - sodipodi:cy="-1039.3622" - sodipodi:rx="1" - sodipodi:ry="1" - sodipodi:start="0" - sodipodi:end="4.712389" - d="m -14,-1039.3622 a 1,1 0 0 1 -0.617317,0.9239 1,1 0 0 1 -1.08979,-0.2168 1,1 0 0 1 -0.216773,-1.0898 1,1 0 0 1 0.92388,-0.6173 l 0,1 z" /> - <rect - transform="matrix(0,1,-1,0,0,0)" - style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect4186" - width="1" - height="14" - x="1038.3622" - y="-15" /> - <rect - style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect4188" - width="4" - height="6.0000172" - x="3" - y="1041.3622" /> - <rect - y="1041.3622" - x="9" - height="6.0000172" - width="4" - id="rect4190" - style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> - <rect - y="1045.3622" - x="3" - height="1.9999998" - width="4" - id="rect4192" - style="opacity:1;fill:#98dc9f;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#98dc9f;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect4194" - width="4" - height="1.9999998" - x="9" - y="1045.3622" /> + style="fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="M 4 1 C 3.446 1 3 1.446 3 2 L 3 14 C 3 14.554 3.446 15 4 15 L 12 15 C 12.554 15 13 14.554 13 14 L 13 2 C 13 1.446 12.554 1 12 1 L 4 1 z M 5 2 L 7 2 C 7.554 2 8 2.446 8 3 C 8 3.554 7.554 4 7 4 L 5 4 C 4.446 4 4 3.554 4 3 C 4 2.446 4.446 2 5 2 z M 11 2 C 11.552285 2 12 2.4477153 12 3 C 12 3.5522847 11.552285 4 11 4 C 10.447715 4 10 3.5522847 10 3 C 10 2.4477153 10.447715 2 11 2 z M 6 6 A 2 2 0 0 1 8 8 A 2 2 0 0 1 6 10 A 2 2 0 0 1 4 8 A 2 2 0 0 1 6 6 z M 11 6 C 11.552285 6 12 6.4477153 12 7 C 12 7.5522847 11.552285 8 11 8 C 10.447715 8 10 7.5522847 10 7 C 10 6.4477153 10.447715 6 11 6 z M 11 10 C 11.552285 10 12 10.447715 12 11 C 12 11.552285 11.552285 12 11 12 C 10.447715 12 10 11.552285 10 11 C 10 10.447715 10.447715 10 11 10 z M 4 12 L 5 12 L 5 14 L 4 14 L 4 12 z M 6 12 L 7 12 L 7 14 L 6 14 L 6 12 z M 8 12 L 9 12 L 9 14 L 8 14 L 8 12 z " + transform="translate(0,1036.3622)" + id="rect4500" /> </g> </svg> diff --git a/editor/icons/source/icon_tab_menu.svg b/editor/icons/source/icon_capsule_mesh.svg index 39e0d1f261..38975b3d25 100644 --- a/editor/icons/source/icon_tab_menu.svg +++ b/editor/icons/source/icon_capsule_mesh.svg @@ -14,11 +14,11 @@ viewBox="0 0 16 16" id="svg2" version="1.1" - inkscape:version="0.92.1 r" - inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_collapse.png" - inkscape:export-xdpi="45" - inkscape:export-ydpi="45" - sodipodi:docname="tab_menu.svg"> + inkscape:version="0.92+devel unknown" + inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_node_2d.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" + sodipodi:docname="icon_capsule_mesh.svg"> <defs id="defs4" /> <sodipodi:namedview @@ -28,9 +28,9 @@ borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" - inkscape:zoom="32.000001" - inkscape:cx="4.0814179" - inkscape:cy="8.4695645" + inkscape:zoom="32" + inkscape:cx="10.821682" + inkscape:cy="9.8571693" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="true" @@ -39,19 +39,19 @@ inkscape:bbox-paths="true" inkscape:bbox-nodes="true" inkscape:snap-bbox-edge-midpoints="true" - inkscape:snap-bbox-midpoints="false" + inkscape:snap-bbox-midpoints="true" inkscape:snap-object-midpoints="true" inkscape:snap-center="true" - inkscape:window-width="1600" - inkscape:window-height="836" + inkscape:window-width="1920" + inkscape:window-height="1016" inkscape:window-x="0" inkscape:window-y="27" inkscape:window-maximized="1" - inkscape:snap-smooth-nodes="true" - inkscape:object-nodes="true"> + inkscape:document-rotation="0"> <inkscape:grid type="xygrid" - id="grid3336" /> + id="grid3336" + empspacing="4" /> </sodipodi:namedview> <metadata id="metadata7"> @@ -61,7 +61,7 @@ <dc:format>image/svg+xml</dc:format> <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title /> + <dc:title></dc:title> </cc:Work> </rdf:RDF> </metadata> @@ -70,23 +70,24 @@ inkscape:groupmode="layer" id="layer1" transform="translate(0,-1036.3622)"> - <circle - style="fill:#ffffff;fill-opacity:0.39215687;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.35294118" - id="path819" - cx="8" - cy="1038.3622" - r="2" /> - <circle - r="2" - cy="1044.3622" - cx="8" - id="circle821" - style="fill:#ffffff;fill-opacity:0.39215687;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.35294118" /> - <circle - style="fill:#ffffff;fill-opacity:0.39215687;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.35294118" - id="circle823" - cx="8" - cy="1050.3622" - r="2" /> + <rect + style="fill:none;stroke:#ffd684;stroke-width:1.93995905;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect4266" + width="8" + height="11.999983" + x="4" + y="1038.3622" + ry="4" /> + <path + style="fill:none;stroke:#ffd684;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 4,1044.3622 c 2.7376816,1.306 5.3946358,1.3618 8,0" + id="path4268" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cc" /> + <path + style="fill:none;stroke:#ffd684;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none" + d="m 8,1038.3622 v 12" + id="path4270" + inkscape:connector-curvature="0" /> </g> </svg> diff --git a/editor/icons/source/icon_checked.svg b/editor/icons/source/icon_checked.svg deleted file mode 100644 index 6d2c03f4c5..0000000000 --- a/editor/icons/source/icon_checked.svg +++ /dev/null @@ -1,79 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://creativecommons.org/ns#" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="16" - height="16" - viewBox="0 0 16 15.999999" - id="svg2" - version="1.1" - inkscape:version="0.92.1 r" - sodipodi:docname="checked.svg" - inkscape:export-filename="/home/djrm/Projects/godot/scene/resources/default_theme/checked.png" - inkscape:export-xdpi="90" - inkscape:export-ydpi="90"> - <defs - id="defs4" /> - <sodipodi:namedview - id="base" - pagecolor="#ffffff" - bordercolor="#666666" - borderopacity="1.0" - inkscape:pageopacity="0.0" - inkscape:pageshadow="2" - inkscape:zoom="32" - inkscape:cx="8.555527" - inkscape:cy="7.1886752" - inkscape:document-units="px" - inkscape:current-layer="layer1" - showgrid="true" - units="px" - inkscape:object-paths="false" - inkscape:snap-intersection-paths="false" - inkscape:snap-bbox="true" - inkscape:bbox-paths="true" - inkscape:bbox-nodes="true" - inkscape:snap-bbox-edge-midpoints="true" - inkscape:window-width="1600" - inkscape:window-height="836" - inkscape:window-x="0" - inkscape:window-y="27" - inkscape:window-maximized="1" - inkscape:snap-smooth-nodes="true" - inkscape:object-nodes="true"> - <inkscape:grid - type="xygrid" - id="grid4136" - empspacing="4" /> - </sodipodi:namedview> - <metadata - id="metadata7"> - <rdf:RDF> - <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title /> - </cc:Work> - </rdf:RDF> - </metadata> - <g - inkscape:label="Layer 1" - inkscape:groupmode="layer" - id="layer1" - transform="translate(0,-1036.3623)"> - <path - style="opacity:1;fill:#e0e0e0;fill-opacity:0.78431374;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - d="M 4 2 C 2.8954305 2 2 2.8954305 2 4 L 2 12 C 2 13.104569 2.8954305 14 4 14 L 12 14 C 13.104569 14 14 13.104569 14 12 L 14 4 C 14 2.8954305 13.104569 2 12 2 L 4 2 z M 11.292969 4.2929688 L 12.707031 5.7070312 L 6 12.414062 L 3.2929688 9.7070312 L 4.7070312 8.2929688 L 6 9.5859375 L 11.292969 4.2929688 z " - transform="translate(0,1036.3623)" - id="circle4178" /> - </g> -</svg> diff --git a/editor/icons/source/icon_color_rect.svg b/editor/icons/source/icon_color_rect.svg index 76bf6596a9..f352c5552a 100644 --- a/editor/icons/source/icon_color_rect.svg +++ b/editor/icons/source/icon_color_rect.svg @@ -14,7 +14,7 @@ viewBox="0 0 16 16" id="svg2" version="1.1" - inkscape:version="0.91 r13725" + inkscape:version="0.92.1 r" inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_center_container.png" inkscape:export-xdpi="90" inkscape:export-ydpi="90" @@ -66,8 +66,8 @@ inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="32" - inkscape:cx="9.9050022" - inkscape:cy="11.383887" + inkscape:cx="9.1237522" + inkscape:cy="7.790137" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="true" @@ -79,8 +79,8 @@ inkscape:snap-bbox-midpoints="true" inkscape:snap-object-midpoints="true" inkscape:snap-center="true" - inkscape:window-width="1920" - inkscape:window-height="1016" + inkscape:window-width="1600" + inkscape:window-height="836" inkscape:window-x="0" inkscape:window-y="27" inkscape:window-maximized="1" @@ -99,7 +99,7 @@ <dc:format>image/svg+xml</dc:format> <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title></dc:title> + <dc:title /> </cc:Work> </rdf:RDF> </metadata> @@ -109,46 +109,46 @@ id="layer1" transform="translate(0,-1036.3622)"> <rect - style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2.82842708;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" id="rect4154" - width="1" + width="2" height="14" x="1" y="1037.3622" /> <rect - y="1050.3622" + y="1049.3622" x="1" - height="0.9999826" + height="1.9999652" width="14" id="rect4156" - style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2.82842708;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> <rect - style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2.82846403;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" id="rect4158" width="14" - height="0.9999826" + height="2.0000174" x="1" y="1037.3622" /> <rect y="1037.3622" - x="14" + x="13" height="14" - width="1" + width="2" id="rect4160" - style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2.82842708;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> <path - style="fill:#70bfff;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;fill-opacity:1" - d="m 13,1049.3622 -6,0 6,-6 z" + style="fill:#70bfff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.80000001px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + d="M 12,1048.3622 H 7.2 l 4.8,-4.8 z" id="path4168" inkscape:connector-curvature="0" /> <path inkscape:connector-curvature="0" id="path4170" - d="m 3,1039.3622 6,0 -6,6 z" - style="fill:#ff7070;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> + d="m 4,1040.3622 h 4.8 l -4.8,4.8 z" + style="fill:#ff7070;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.80000001px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> <path - style="fill:#7aff70;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="m 3,1049.3622 0,-4 6,-6 4,0 0,4 -6,6 z" + style="fill:#7aff70;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.80000001px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + d="m 4,1048.3622 v -3.2 l 4.8,-4.8 H 12 v 3.2 l -4.8,4.8 z" id="path4172" inkscape:connector-curvature="0" sodipodi:nodetypes="ccccccc" /> diff --git a/editor/icons/source/icon_confirmation_dialog.svg b/editor/icons/source/icon_confirmation_dialog.svg index 49dbc21e92..52cdf7618e 100644 --- a/editor/icons/source/icon_confirmation_dialog.svg +++ b/editor/icons/source/icon_confirmation_dialog.svg @@ -14,7 +14,7 @@ viewBox="0 0 16 16" id="svg2" version="1.1" - inkscape:version="0.91 r13725" + inkscape:version="0.92.1 r" inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_confirmation_dialog.png" inkscape:export-xdpi="90" inkscape:export-ydpi="90" @@ -28,9 +28,9 @@ borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" - inkscape:zoom="16" - inkscape:cx="7.6980886" - inkscape:cy="13.203824" + inkscape:zoom="32" + inkscape:cx="8.6970479" + inkscape:cy="7.4854117" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="true" @@ -42,8 +42,8 @@ inkscape:snap-bbox-midpoints="true" inkscape:snap-object-midpoints="true" inkscape:snap-center="true" - inkscape:window-width="1920" - inkscape:window-height="1016" + inkscape:window-width="1600" + inkscape:window-height="836" inkscape:window-x="0" inkscape:window-y="27" inkscape:window-maximized="1"> @@ -59,7 +59,7 @@ <dc:format>image/svg+xml</dc:format> <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title></dc:title> + <dc:title /> </cc:Work> </rdf:RDF> </metadata> @@ -70,7 +70,7 @@ transform="translate(0,-1036.3622)"> <path style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - d="M 3 1 C 1.89543 1 1 1.8954 1 3 L 1 4 L 15 4 L 15 3 C 15 1.8954 14.104569 1 13 1 L 3 1 z M 12 2 L 13 2 L 13 3 L 12 3 L 12 2 z M 1 5 L 1 13 C 1 14.1046 1.89543 15 3 15 L 13 15 C 14.104569 15 15 14.1046 15 13 L 15 5 L 1 5 z M 2.5859375 8.8789062 L 4 10.292969 L 5.4140625 8.8789062 L 6.1210938 9.5859375 L 4.7070312 11 L 6.1210938 12.414062 L 5.4140625 13.121094 L 4 11.707031 L 2.5859375 13.121094 L 1.8789062 12.414062 L 3.2929688 11 L 1.8789062 9.5859375 L 2.5859375 8.8789062 z M 12.949219 8.8789062 L 13.65625 9.5859375 L 10.828125 12.414062 L 10.121094 13.121094 L 9.4140625 12.414062 L 8 11 L 8.7070312 10.292969 L 10.121094 11.707031 L 12.949219 8.8789062 z " + d="M 3 1 C 1.89543 1 1 1.8954 1 3 L 1 4 L 15 4 L 15 3 C 15 1.8954 14.104569 1 13 1 L 3 1 z M 12 2 L 13 2 L 13 3 L 12 3 L 12 2 z M 1 5 L 1 13 C 1 14.1046 1.89543 15 3 15 L 13 15 C 14.104569 15 15 14.1046 15 13 L 15 5 L 1 5 z M 7.9863281 6.0019531 C 8.3332141 5.9996687 8.6849305 6.0577156 9.0253906 6.1816406 C 10.387231 6.6772406 11.206736 8.0942844 10.955078 9.5214844 C 10.764025 10.604982 9.9933535 11.46759 9 11.822266 L 9 12 L 8 12 L 7 12 L 7 11.158203 A 1.0001 1.0001 0 0 1 8 10 C 8.4919343 10 8.898952 9.6582281 8.984375 9.1738281 C 9.0697985 8.6893281 8.8040639 8.2287469 8.3417969 8.0605469 C 7.8795298 7.8922469 7.3807328 8.074 7.1347656 8.5 A 1.0001606 1.0001606 0 0 1 5.4023438 7.5 C 5.9458088 6.558525 6.9456702 6.0088063 7.9863281 6.0019531 z M 7 13 L 9 13 L 9 14 L 7 14 L 7 13 z " transform="translate(0,1036.3622)" id="rect4140" /> </g> diff --git a/editor/icons/source/icon_cube_mesh.svg b/editor/icons/source/icon_cube_mesh.svg new file mode 100644 index 0000000000..1506b3e434 --- /dev/null +++ b/editor/icons/source/icon_cube_mesh.svg @@ -0,0 +1,87 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="16" + height="16" + viewBox="0 0 14.999999 14.999999" + id="svg2" + version="1.1" + inkscape:version="0.92+devel unknown" + inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_collision_shape.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" + sodipodi:docname="icon_cube_mesh.svg"> + <defs + id="defs4" /> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="45.254834" + inkscape:cx="10.638124" + inkscape:cy="7.9587327" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="true" + units="px" + inkscape:snap-bbox="true" + inkscape:bbox-paths="true" + inkscape:bbox-nodes="true" + inkscape:snap-bbox-edge-midpoints="true" + inkscape:snap-bbox-midpoints="true" + inkscape:snap-object-midpoints="true" + inkscape:snap-center="true" + inkscape:window-width="1920" + inkscape:window-height="1016" + inkscape:window-x="0" + inkscape:window-y="27" + inkscape:window-maximized="1" + inkscape:object-paths="false" + inkscape:snap-intersection-paths="false" + inkscape:object-nodes="false" + inkscape:snap-smooth-nodes="false" + inkscape:snap-midpoints="true" + inkscape:document-rotation="0"> + <inkscape:grid + type="xygrid" + id="grid3336" + originx="0" + originy="0" + spacingx="0.93749994" + spacingy="0.93749994" /> + </sodipodi:namedview> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1" + transform="translate(0,-1037.3622)"> + <path + style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-variant-east-asian:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#ffd684;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.7735548;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" + d="m 7.4999994,1038.1958 -6.56249953,3.2804 v 6.772 l 0.49015243,0.246 6.0723471,3.0344 6.5624996,-3.2804 v -6.772 z m 0,1.9831 3.6925976,1.8463 -3.6925977,1.8463 -3.6925967,-1.8463 z m -4.7889446,3.2804 3.9021671,1.9502 v 3.6944 l -3.9021671,-1.952 z m 9.5778892,0 v 3.6926 l -3.9021673,1.952 v -3.6944 z" + id="path4298" + inkscape:connector-curvature="0" /> + </g> +</svg> diff --git a/editor/icons/source/icon_sample_player_2d.svg b/editor/icons/source/icon_curve.svg index 33a7eba019..a58e08d950 100644 --- a/editor/icons/source/icon_sample_player_2d.svg +++ b/editor/icons/source/icon_curve.svg @@ -14,11 +14,11 @@ viewBox="0 0 16 16" id="svg2" version="1.1" - inkscape:version="0.91 r13725" + inkscape:version="0.92+devel unknown" inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_node_2d.png" inkscape:export-xdpi="90" inkscape:export-ydpi="90" - sodipodi:docname="icon_sample_player_2d.svg"> + sodipodi:docname="icon_curve.svg"> <defs id="defs4" /> <sodipodi:namedview @@ -28,9 +28,9 @@ borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" - inkscape:zoom="31.999999" - inkscape:cx="8.6950163" - inkscape:cy="7.1009775" + inkscape:zoom="32" + inkscape:cx="7.6124179" + inkscape:cy="9.8854217" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="true" @@ -46,7 +46,8 @@ inkscape:window-height="1016" inkscape:window-x="0" inkscape:window-y="27" - inkscape:window-maximized="1"> + inkscape:window-maximized="1" + inkscape:document-rotation="0"> <inkscape:grid type="xygrid" id="grid3336" @@ -70,9 +71,15 @@ id="layer1" transform="translate(0,-1036.3622)"> <path - style="opacity:1;fill:#a5b7f7;fill-opacity:0.98823529;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843" - d="M 8 1 L 4 6 L 1 6 L 1 10 L 4 10 L 8 15 L 8 1 z M 13 3 L 13 13 L 14 13 L 14 3 L 13 3 z M 10 6 L 10 11 L 11 11 L 11 6 L 10 6 z " - transform="translate(0,1036.3622)" - id="rect4154" /> + style="fill:none;stroke:#e0e0e0;stroke-width:2;stroke-linecap:square;stroke-linejoin:miter;stroke-opacity:0.32549021;stroke-miterlimit:4;stroke-dasharray:none" + d="m 2,1038.3622 v 12 h 12" + id="path4289" + inkscape:connector-curvature="0" /> + <path + style="fill:none;stroke:#e0e0e0;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 2,1050.3622 c 8,0 12,-4 12,-12" + id="path4285" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cc" /> </g> </svg> diff --git a/editor/icons/source/icon_cylinder_mesh.svg b/editor/icons/source/icon_cylinder_mesh.svg new file mode 100644 index 0000000000..26003365bc --- /dev/null +++ b/editor/icons/source/icon_cylinder_mesh.svg @@ -0,0 +1,89 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="16" + height="16" + viewBox="0 0 14.999999 14.999999" + id="svg2" + version="1.1" + inkscape:version="0.92+devel unknown" + inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_collision_shape.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" + sodipodi:docname="icon_cylinder_mesh.svg"> + <defs + id="defs4" /> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="32" + inkscape:cx="8.8446434" + inkscape:cy="10.246909" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="true" + units="px" + inkscape:snap-bbox="true" + inkscape:bbox-paths="true" + inkscape:bbox-nodes="true" + inkscape:snap-bbox-edge-midpoints="true" + inkscape:snap-bbox-midpoints="true" + inkscape:snap-object-midpoints="true" + inkscape:snap-center="true" + inkscape:window-width="1920" + inkscape:window-height="1016" + inkscape:window-x="0" + inkscape:window-y="27" + inkscape:window-maximized="1" + inkscape:object-paths="true" + inkscape:snap-intersection-paths="true" + inkscape:object-nodes="true" + inkscape:snap-smooth-nodes="true" + inkscape:snap-midpoints="true" + inkscape:document-rotation="0"> + <inkscape:grid + type="xygrid" + id="grid3336" + originx="0" + originy="0" + spacingx="0.93749994" + spacingy="0.93749994" /> + </sodipodi:namedview> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1" + transform="translate(0,-1037.3622)"> + <path + style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-variant-east-asian:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#ffd684;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" + d="M 8,1 C 6.2530724,1 4.6719569,1.2264786 3.4414062,1.6367188 2.8261309,1.8418388 2.2942826,2.0885933 1.8515625,2.4375 1.4088424,2.7864067 1,3.3185066 1,4 v 8 c 0,0.681493 0.4088424,1.215546 0.8515625,1.564453 0.4427201,0.348907 0.9745684,0.595768 1.5898437,0.800781 C 4.6719569,14.775474 6.2530724,15 8,15 c 1.7469276,0 3.328042,-0.224526 4.558594,-0.634766 0.615274,-0.205013 1.147122,-0.451874 1.589844,-0.800781 C 14.591158,13.215546 15,12.681493 15,12 V 4 C 15,3.3185066 14.591158,2.7864067 14.148438,2.4375 13.705716,2.0885933 13.173868,1.8418388 12.558594,1.6367188 11.328042,1.2264786 9.7469276,1 8,1 Z m 0,2 c 1.5667809,0 2.986711,0.2214496 3.927734,0.5351562 0.463676,0.1545602 0.801384,0.3374102 0.96875,0.4667969 -0.167523,0.12928 -0.505463,0.3104971 -0.96875,0.4648438 C 10.986711,4.7805036 9.5667809,5 8,5 6.4332191,5 5.0132879,4.7805036 4.0722656,4.4667969 3.6089791,4.3124502 3.271039,4.1312331 3.1035156,4.0019531 3.2708819,3.8725664 3.6085896,3.6897164 4.0722656,3.5351562 5.0132879,3.2214496 6.4332191,3 8,3 Z M 3,6.1875 C 3.1467977,6.2465706 3.2834962,6.3126178 3.4414062,6.3652344 4.6719569,6.7754744 6.2530724,7 8,7 9.7469276,7 11.328042,6.7754744 12.558594,6.3652344 12.716504,6.3126178 12.853202,6.2465706 13,6.1875 V 12 c -0.167523,0.12928 -0.608979,0.31245 -1.072266,0.466797 C 10.986711,12.780504 9.5667809,13 8,13 6.4332191,13 5.0132879,12.780504 4.0722656,12.466797 3.6089791,12.31245 3.1675234,12.12928 3,12 Z" + transform="matrix(0.93749994,0,0,0.93749994,0,1037.3622)" + id="path4385" + inkscape:connector-curvature="0" + sodipodi:nodetypes="sssssscsccsscssscccscccsccsccccsccc" /> + </g> +</svg> diff --git a/editor/icons/source/icon_debug.svg b/editor/icons/source/icon_debug.svg index 1b3e748668..25ca0d6a11 100644 --- a/editor/icons/source/icon_debug.svg +++ b/editor/icons/source/icon_debug.svg @@ -29,8 +29,8 @@ inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="32" - inkscape:cx="8.8380296" - inkscape:cy="8.0475262" + inkscape:cx="6.6351189" + inkscape:cy="7.5931892" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="true" @@ -62,7 +62,7 @@ <dc:format>image/svg+xml</dc:format> <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title></dc:title> + <dc:title /> </cc:Work> </rdf:RDF> </metadata> @@ -72,22 +72,72 @@ id="layer1" transform="translate(0,-1036.3622)"> <path - style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#e0e0e0;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" - d="M 3 3.9863281 A 1.0001 1.0001 0 0 0 2.015625 5.1816406 C 2.2178415 6.2802406 2.7057331 7.1756813 3.390625 7.8007812 C 3.6768866 8.0620519 3.9944862 8.2637767 4.3242188 8.4375 A 4 4 0 0 0 4.1289062 9 L 2 9 A 1.0001 1.0001 0 1 0 2 11 L 4.1328125 11 A 4 4 0 0 0 4.3652344 11.658203 C 4.2801416 11.696657 4.2143084 11.719391 4.1210938 11.765625 C 3.5374123 12.055025 2.8673634 12.538772 2.2089844 13.388672 A 1.0003084 1.0003084 0 1 0 3.7910156 14.613281 C 4.2919543 13.966681 4.6296764 13.745141 5.0097656 13.556641 C 5.205099 13.459768 5.4352695 13.372568 5.6953125 13.263672 A 4 4 0 0 0 8 14 A 4 4 0 0 0 10.332031 13.244141 C 11.496007 13.78538 11.98739 14.238118 12.128906 14.490234 A 1.0001 1.0001 0 1 0 13.871094 13.511719 C 13.471096 12.799229 12.778174 12.20655 11.644531 11.634766 A 4 4 0 0 0 11.869141 11 L 14 11 A 1.0001 1.0001 0 1 0 14 9 L 11.867188 9 A 4 4 0 0 0 11.685547 8.4550781 C 12.182886 8.1889169 12.596375 7.860606 12.908203 7.4804688 C 13.491193 6.7697687 13.74859 5.9803156 13.957031 5.2910156 A 1.0001 1.0001 0 0 0 12.982422 3.9882812 A 1.0001 1.0001 0 0 0 12.042969 4.7109375 C 11.850379 5.3477375 11.656068 5.8559906 11.363281 6.2128906 C 11.080302 6.5578365 10.697905 6.8305531 9.8867188 7 L 6.1503906 7 C 5.5504757 6.8482606 5.0764053 6.630863 4.7382812 6.3222656 C 4.3835001 5.9984656 4.1227361 5.5721125 3.984375 4.8203125 A 1.0001 1.0001 0 0 0 3 3.9863281 z M 8.046875 4 A 2 2 0 0 0 7 4.2675781 A 2 2 0 0 0 6 6 L 10 6 A 2 2 0 0 0 9 4.2675781 A 2 2 0 0 0 8.046875 4 z " - id="path4507" - transform="translate(0,1036.3622)" /> - <path - style="fill:none;fill-opacity:1;stroke:#e0e0e0;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.78431373" + style="fill:none;fill-opacity:1;stroke:#f0f0f0;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" id="path4548" sodipodi:type="arc" sodipodi:cx="8" - sodipodi:cy="-1041.3622" + sodipodi:cy="-1042.3622" sodipodi:rx="4" sodipodi:ry="4" sodipodi:start="0.78539816" sodipodi:end="2.3561945" - d="M 10.828427,-1038.5338 A 4,4 0 0 1 8,-1037.3622 a 4,4 0 0 1 -2.8284272,-1.1716" + d="M 10.828427,-1039.5338 A 4,4 0 0 1 8,-1038.3622 a 4,4 0 0 1 -2.8284272,-1.1716" transform="scale(1,-1)" sodipodi:open="true" /> + <ellipse + style="fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:0;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.97303921" + id="path4491" + cx="8" + cy="1047.3572" + rx="3.644531" + ry="1.6348" /> + <circle + style="fill:#f0f0f0;fill-opacity:1;stroke:#4c4c4c;stroke-width:0;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.78431373" + id="path4493" + cx="8" + cy="1047.3622" + r="3.9999993" /> + <path + style="fill:none;stroke:#f0f0f0;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="M 5,1047.3622 H 2" + id="path4495" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cc" /> + <path + style="fill:none;stroke:#f0f0f0;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 10,1047.3622 h 4" + id="path4497" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cc" /> + <path + style="fill:none;stroke:#f0f0f0;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 6,1045.3572 c -2,0 -3,-2 -3,-3" + id="path4499" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cc" /> + <path + style="fill:none;stroke:#f0f0f0;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 10,1045.3572 c 2,0 3,-2 3,-3" + id="path4501" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cc" /> + <path + style="fill:none;stroke:#f0f0f0;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 6,1049.3572 c -1,0 -2,1 -3,2" + id="path4503" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cc" /> + <path + style="fill:none;stroke:#f0f0f0;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 10,1049.3572 c 1,0 2,1 3,2" + id="path4505" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cc" /> + <circle + style="fill:#f0f0f0;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.78431373" + id="path4508" + cx="8" + cy="1043.3622" + r="2" /> </g> </svg> diff --git a/editor/icons/source/icon_dropdown.svg b/editor/icons/source/icon_dropdown.svg deleted file mode 100644 index 5963e74007..0000000000 --- a/editor/icons/source/icon_dropdown.svg +++ /dev/null @@ -1,79 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://creativecommons.org/ns#" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="8" - height="8" - viewBox="0 0 8 8" - id="svg2" - version="1.1" - inkscape:version="0.92.1 r" - inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_collapse.png" - inkscape:export-xdpi="45" - inkscape:export-ydpi="45" - sodipodi:docname="dropdown.svg"> - <defs - id="defs4" /> - <sodipodi:namedview - id="base" - pagecolor="#ffffff" - bordercolor="#666666" - borderopacity="1.0" - inkscape:pageopacity="0.0" - inkscape:pageshadow="2" - inkscape:zoom="64" - inkscape:cx="3.5701039" - inkscape:cy="3.3945836" - inkscape:document-units="px" - inkscape:current-layer="layer1" - showgrid="true" - units="px" - inkscape:snap-bbox="true" - inkscape:bbox-paths="true" - inkscape:bbox-nodes="true" - inkscape:snap-bbox-edge-midpoints="true" - inkscape:snap-bbox-midpoints="false" - inkscape:snap-object-midpoints="true" - inkscape:snap-center="true" - inkscape:window-width="1600" - inkscape:window-height="836" - inkscape:window-x="0" - inkscape:window-y="27" - inkscape:window-maximized="1" - inkscape:snap-smooth-nodes="true" - inkscape:object-nodes="true"> - <inkscape:grid - type="xygrid" - id="grid3336" /> - </sodipodi:namedview> - <metadata - id="metadata7"> - <rdf:RDF> - <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title></dc:title> - </cc:Work> - </rdf:RDF> - </metadata> - <g - inkscape:label="Layer 1" - inkscape:groupmode="layer" - id="layer1" - transform="translate(0,-1044.3622)"> - <path - style="fill:none;stroke:#e0e0e0;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.78431374" - d="m 1,1047.3622 3,3 3,-3" - id="path4503" - inkscape:connector-curvature="0" /> - </g> -</svg> diff --git a/editor/icons/source/icon_environment.svg b/editor/icons/source/icon_environment.svg index 45add2c7f7..96d0f7e29c 100644 --- a/editor/icons/source/icon_environment.svg +++ b/editor/icons/source/icon_environment.svg @@ -14,7 +14,7 @@ viewBox="0 0 16 16" id="svg2" version="1.1" - inkscape:version="0.91 r13725" + inkscape:version="0.92.1 r" inkscape:export-filename="/home/djrm/icon_node_2d.png" inkscape:export-xdpi="90" inkscape:export-ydpi="90" @@ -28,9 +28,9 @@ borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" - inkscape:zoom="16" - inkscape:cx="10.741006" - inkscape:cy="10.690232" + inkscape:zoom="22.627417" + inkscape:cx="4.0727417" + inkscape:cy="8.9873869" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="true" @@ -42,8 +42,8 @@ inkscape:snap-bbox-midpoints="true" inkscape:snap-object-midpoints="true" inkscape:snap-center="true" - inkscape:window-width="1920" - inkscape:window-height="1016" + inkscape:window-width="1600" + inkscape:window-height="836" inkscape:window-x="0" inkscape:window-y="27" inkscape:window-maximized="1" @@ -64,7 +64,7 @@ <dc:format>image/svg+xml</dc:format> <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title></dc:title> + <dc:title /> </cc:Work> </rdf:RDF> </metadata> @@ -73,10 +73,29 @@ inkscape:groupmode="layer" id="layer1" transform="translate(0,-1036.3622)"> + <circle + style="fill:none;fill-opacity:1;stroke:#e0e0e0;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="path814" + cx="8" + cy="1044.3622" + r="6" /> <path - style="opacity:1;fill:#e1e1e1;fill-opacity:0.99215686;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843" - d="M 8 1 A 7 7 0 0 0 1 8 A 7 7 0 0 0 8 15 A 7 7 0 0 0 15 8 A 7 7 0 0 0 8 1 z M 7.0273438 2.0820312 C 6.3462908 2.6213949 5.3431503 3.5860946 4.6757812 5 L 2.8105469 5 A 6 6 0 0 1 7.0273438 2.0820312 z M 8.9785156 2.0859375 A 6 6 0 0 1 13.1875 5 L 11.324219 5 C 10.658501 3.5895934 9.6595492 2.6261235 8.9785156 2.0859375 z M 8 2.6054688 C 8.3858776 2.856627 9.3974911 3.6104334 10.185547 5 L 5.8144531 5 C 6.6025089 3.6104334 7.6141224 2.856627 8 2.6054688 z M 2.3515625 6 L 4.2949219 6 C 4.1145279 6.6059544 4 7.2695302 4 8 C 4 8.7306855 4.1144398 9.3938115 4.2949219 10 L 2.3496094 10 A 6 6 0 0 1 2 8 A 6 6 0 0 1 2.3515625 6 z M 5.3398438 6 L 10.660156 6 C 10.868048 6.5934731 11 7.2583063 11 8 C 11 8.7421382 10.866303 9.4061377 10.658203 10 L 5.3417969 10 C 5.1336971 9.4061377 5 8.7421382 5 8 C 5 7.2583063 5.1319522 6.5934731 5.3398438 6 z M 11.705078 6 L 13.650391 6 A 6 6 0 0 1 14 8 A 6 6 0 0 1 13.648438 10 L 11.705078 10 C 11.88556 9.3938115 12 8.7306855 12 8 C 12 7.2695302 11.885472 6.6059544 11.705078 6 z M 2.8125 11 L 4.6777344 11 C 5.343895 12.410381 6.3427806 13.374042 7.0234375 13.914062 A 6 6 0 0 1 2.8125 11 z M 5.8144531 11 L 10.185547 11 C 9.3971916 12.390235 8.3853773 13.145488 8 13.396484 C 7.6146227 13.145488 6.6028084 12.390235 5.8144531 11 z M 11.322266 11 L 13.189453 11 A 6 6 0 0 1 8.9707031 13.917969 C 9.651376 13.378771 10.654456 12.413873 11.322266 11 z " - transform="translate(0,1036.3622)" - id="path4158" /> + style="fill:none;stroke:#e0e0e0;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none" + d="m 2,1044.3622 c 4.5932382,1.582 8.398513,1.0627 12,0" + id="path816" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cc" /> + <path + sodipodi:nodetypes="cc" + inkscape:connector-curvature="0" + id="path820" + d="m 8,1038.3622 c -3,4 -3,8 0,12" + style="fill:none;stroke:#e0e0e0;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + <path + style="fill:none;stroke:#e0e0e0;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 8,1038.3622 c 3,4 3,8 0,12" + id="path822" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cc" /> </g> </svg> diff --git a/editor/icons/source/icon_file_big.svg b/editor/icons/source/icon_file_big.svg index 38ad9b707a..084247937b 100644 --- a/editor/icons/source/icon_file_big.svg +++ b/editor/icons/source/icon_file_big.svg @@ -14,7 +14,7 @@ viewBox="0 0 64 64" id="svg2" version="1.1" - inkscape:version="0.91 r13725" + inkscape:version="0.92.1 r" inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_new.png" inkscape:export-xdpi="90" inkscape:export-ydpi="90" @@ -28,9 +28,9 @@ borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" - inkscape:zoom="11.313708" - inkscape:cx="32.899003" - inkscape:cy="32.88081" + inkscape:zoom="8" + inkscape:cx="29.157928" + inkscape:cy="37.490712" inkscape:document-units="px" inkscape:current-layer="layer1-8" showgrid="true" @@ -42,14 +42,16 @@ inkscape:snap-bbox-midpoints="false" inkscape:snap-object-midpoints="true" inkscape:snap-center="true" - inkscape:window-width="1920" - inkscape:window-height="1016" + inkscape:window-width="1600" + inkscape:window-height="836" inkscape:window-x="0" inkscape:window-y="27" inkscape:window-maximized="1" - inkscape:object-paths="false" - inkscape:snap-intersection-paths="false" - inkscape:object-nodes="false"> + inkscape:object-paths="true" + inkscape:snap-intersection-paths="true" + inkscape:object-nodes="true" + inkscape:snap-midpoints="true" + inkscape:snap-smooth-nodes="true"> <inkscape:grid type="xygrid" id="grid3336" /> @@ -76,12 +78,10 @@ inkscape:label="Layer 1" transform="translate(0,-1.6949463e-5)"> <path - style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - d="m 10,5 0,54 44,0 0,-36 -18,0 0,-18 z m 31,0 0,13 13,0 z" + style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#ffffff;fill-opacity:0.58823532;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" + d="M 14 5 C 11.801312 5 10 6.80131 10 9 L 10 55 C 10 57.1987 11.801312 59 14 59 L 50 59 C 52.198688 59 54 57.1987 54 55 L 54 22 L 53.992188 22 C 53.994308 21.751685 53.912915 21.499015 53.707031 21.292969 L 37.707031 5.2929688 C 37.519176 5.1060418 37.264574 5.003582 37 5.0039062 L 37 5 L 14 5 z M 14 7 L 36 7 L 36 9 L 36 19 C 36 21.1987 37.801349 23 40 23 L 50 23 L 52 23 L 52 55 C 52 56.1253 51.125282 57 50 57 L 14 57 C 12.874718 57 12 56.1253 12 55 L 12 9 C 12 7.87472 12.874718 7 14 7 z " transform="translate(0,988.36222)" - id="rect4158" - inkscape:connector-curvature="0" - sodipodi:nodetypes="ccccccccccc" /> + id="rect815" /> </g> </g> </svg> diff --git a/editor/icons/source/icon_file_dialog.svg b/editor/icons/source/icon_file_dialog.svg index 9dee04c220..a3af269bee 100644 --- a/editor/icons/source/icon_file_dialog.svg +++ b/editor/icons/source/icon_file_dialog.svg @@ -14,7 +14,7 @@ viewBox="0 0 16 16" id="svg2" version="1.1" - inkscape:version="0.91 r13725" + inkscape:version="0.92.1 r" inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_confirmation_dialog.png" inkscape:export-xdpi="90" inkscape:export-ydpi="90" @@ -28,9 +28,9 @@ borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" - inkscape:zoom="16" - inkscape:cx="2.7469423" - inkscape:cy="8.766806" + inkscape:zoom="22.627417" + inkscape:cx="6.7929949" + inkscape:cy="8.3839819" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="true" @@ -42,8 +42,8 @@ inkscape:snap-bbox-midpoints="true" inkscape:snap-object-midpoints="true" inkscape:snap-center="true" - inkscape:window-width="1920" - inkscape:window-height="1016" + inkscape:window-width="1600" + inkscape:window-height="836" inkscape:window-x="0" inkscape:window-y="27" inkscape:window-maximized="1"> @@ -59,7 +59,7 @@ <dc:format>image/svg+xml</dc:format> <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title></dc:title> + <dc:title /> </cc:Work> </rdf:RDF> </metadata> @@ -70,8 +70,10 @@ transform="translate(0,-1036.3622)"> <path style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - d="M 3 1 C 1.89543 1 1 1.8954 1 3 L 1 4 L 15 4 L 15 3 C 15 1.8954 14.104569 1 13 1 L 3 1 z M 12 2 L 13 2 L 13 3 L 12 3 L 12 2 z M 1 5 L 1 13 C 1 14.1046 1.89543 15 3 15 L 13 15 C 14.104569 15 15 14.1046 15 13 L 15 5 L 1 5 z M 5 7 L 8 7 L 8 8 L 11 8 L 11 13 L 5 13 L 5 7 z " + d="M 3,1 C 1.89543,1 1,1.8954 1,3 V 4 H 15 V 3 C 15,1.8954 14.104569,1 13,1 Z m 9,1 h 1 V 3 H 12 Z M 1,5 v 8 c 0,1.1046 0.89543,2 2,2 h 10 c 1.104569,0 2,-0.8954 2,-2 V 5 Z m 3,2 h 3 c 1,0 1,2 2,2 h 3 v 4 H 4 Z" transform="translate(0,1036.3622)" - id="rect4140" /> + id="rect4140" + inkscape:connector-curvature="0" + sodipodi:nodetypes="ssccsssccccccssssccccccccc" /> </g> </svg> diff --git a/editor/icons/source/icon_g_d_native_library.svg b/editor/icons/source/icon_g_d_native_library.svg new file mode 100644 index 0000000000..9eae07c69b --- /dev/null +++ b/editor/icons/source/icon_g_d_native_library.svg @@ -0,0 +1,83 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="16" + height="16" + viewBox="0 0 16 16" + id="svg2" + version="1.1" + inkscape:version="0.92.1 r" + inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_g_d_script.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" + sodipodi:docname="icon_g_d_native_library.svg"> + <defs + id="defs4" /> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="32" + inkscape:cx="9.2871559" + inkscape:cy="8.7634992" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="true" + units="px" + inkscape:snap-bbox="true" + inkscape:bbox-paths="true" + inkscape:bbox-nodes="true" + inkscape:snap-bbox-edge-midpoints="true" + inkscape:snap-bbox-midpoints="true" + inkscape:snap-object-midpoints="true" + inkscape:snap-center="true" + inkscape:window-width="1600" + inkscape:window-height="836" + inkscape:window-x="0" + inkscape:window-y="27" + inkscape:window-maximized="1"> + <inkscape:grid + type="xygrid" + id="grid3336" /> + </sodipodi:namedview> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1" + transform="translate(0,-1036.3622)"> + <path + style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:3;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + d="M 7 1 L 6.4355469 3.2578125 A 5.0000172 5.0000172 0 0 0 5.7460938 3.5371094 L 3.7578125 2.34375 L 2.34375 3.7578125 L 3.5390625 5.7519531 A 5.0000172 5.0000172 0 0 0 3.2539062 6.4375 L 1 7 L 1 9 L 3.2578125 9.5644531 A 5.0000172 5.0000172 0 0 0 3.5371094 10.251953 L 2.34375 12.242188 L 3.7578125 13.65625 L 5.7519531 12.460938 A 5.0000172 5.0000172 0 0 0 6.4375 12.746094 L 7 15 L 7 9.7304688 A 2.0000174 2.0000174 0 0 1 6 8 A 2.0000174 2.0000174 0 0 1 7 6.2714844 L 7 6 L 8 6 L 12.576172 6 A 5.0000172 5.0000172 0 0 0 12.462891 5.7480469 L 13.65625 3.7578125 L 12.242188 2.34375 L 10.248047 3.5390625 A 5.0000172 5.0000172 0 0 0 9.5625 3.2539062 L 9 1 L 7 1 z " + transform="translate(0,1036.3622)" + id="path4176" /> + <path + inkscape:connector-curvature="0" + style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + d="m 9,1044.3622 v 1 5 1 h 5 c 0.552285,0 1,-0.4477 1,-1 v -5 c 0,-0.5523 -0.447715,-1 -1,-1 v 4 l -1,-1 -1,1 v -4 z" + id="path4162" + sodipodi:nodetypes="ccccssscccccc" /> + </g> +</svg> diff --git a/editor/icons/source/icon_godot.svg b/editor/icons/source/icon_godot.svg new file mode 100644 index 0000000000..8f90c4c91a --- /dev/null +++ b/editor/icons/source/icon_godot.svg @@ -0,0 +1,176 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="16" + height="16" + viewBox="0 0 16 16" + id="svg2" + version="1.1" + inkscape:version="0.92+devel unknown" + inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_collision_shape_2d.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" + sodipodi:docname="icon_godot.svg"> + <defs + id="defs4" /> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="22.627417" + inkscape:cx="18.673414" + inkscape:cy="10.896798" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="true" + units="px" + inkscape:snap-bbox="true" + inkscape:bbox-paths="true" + inkscape:bbox-nodes="true" + inkscape:snap-bbox-edge-midpoints="true" + inkscape:snap-bbox-midpoints="true" + inkscape:snap-object-midpoints="true" + inkscape:snap-center="true" + inkscape:window-width="1920" + inkscape:window-height="1016" + inkscape:window-x="0" + inkscape:window-y="27" + inkscape:window-maximized="1" + inkscape:document-rotation="0"> + <inkscape:grid + type="xygrid" + id="grid3336" /> + </sodipodi:namedview> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1" + transform="translate(0,-1036.3622)"> + <g + transform="matrix(0.01724138,0,0,0.01724138,-0.82758616,1033.7378)" + id="layer1-6" + inkscape:label="Layer 1"> + <g + style="stroke-width:0.32031175" + transform="matrix(4.162611,0,0,-4.162611,919.24059,771.67186)" + id="g78"> + <path + inkscape:connector-curvature="0" + id="path80" + style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.32031175" + d="m 0,0 c 0,0 -0.325,1.994 -0.515,1.976 l -36.182,-3.491 c -2.879,-0.278 -5.115,-2.574 -5.317,-5.459 l -0.994,-14.247 -27.992,-1.997 -1.904,12.912 c -0.424,2.872 -2.932,5.037 -5.835,5.037 h -38.188 c -2.902,0 -5.41,-2.165 -5.834,-5.037 l -1.905,-12.912 -27.992,1.997 -0.994,14.247 c -0.202,2.886 -2.438,5.182 -5.317,5.46 l -36.2,3.49 c -0.187,0.018 -0.324,-1.978 -0.511,-1.978 l -0.049,-7.83 30.658,-4.944 1.004,-14.374 c 0.203,-2.91 2.551,-5.263 5.463,-5.472 l 38.551,-2.75 c 0.146,-0.01 0.29,-0.016 0.434,-0.016 2.897,0 5.401,2.166 5.825,5.038 l 1.959,13.286 h 28.005 l 1.959,-13.286 c 0.423,-2.871 2.93,-5.037 5.831,-5.037 0.142,0 0.284,0.005 0.423,0.015 l 38.556,2.75 c 2.911,0.209 5.26,2.562 5.463,5.472 l 1.003,14.374 30.645,4.966 z" /> + </g> + <g + style="stroke-width:0.32031175" + transform="matrix(4.162611,0,0,-4.162611,104.69892,525.90697)" + id="g82-3"> + <path + inkscape:connector-curvature="0" + id="path84-6" + style="fill:#478cbf;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.32031175" + d="m 0,0 v -47.514 -6.035 -5.492 c 0.108,-0.001 0.216,-0.005 0.323,-0.015 l 36.196,-3.49 c 1.896,-0.183 3.382,-1.709 3.514,-3.609 l 1.116,-15.978 31.574,-2.253 2.175,14.747 c 0.282,1.912 1.922,3.329 3.856,3.329 h 38.188 c 1.933,0 3.573,-1.417 3.855,-3.329 l 2.175,-14.747 31.575,2.253 1.115,15.978 c 0.133,1.9 1.618,3.425 3.514,3.609 l 36.182,3.49 c 0.107,0.01 0.214,0.014 0.322,0.015 v 4.711 l 0.015,0.005 V 0 h 0.134 c 4.795,6.12 9.232,12.569 13.487,19.449 -5.651,9.62 -12.575,18.217 -19.976,26.182 -6.864,-3.455 -13.531,-7.369 -19.828,-11.534 -3.151,3.132 -6.7,5.694 -10.186,8.372 -3.425,2.751 -7.285,4.768 -10.946,7.118 1.09,8.117 1.629,16.108 1.846,24.448 -9.446,4.754 -19.519,7.906 -29.708,10.17 -4.068,-6.837 -7.788,-14.241 -11.028,-21.479 -3.842,0.642 -7.702,0.88 -11.567,0.926 v 0.006 c -0.027,0 -0.052,-0.006 -0.075,-0.006 -0.024,0 -0.049,0.006 -0.073,0.006 V 63.652 C 93.903,63.606 90.046,63.368 86.203,62.726 82.965,69.964 79.247,77.368 75.173,84.205 64.989,81.941 54.915,78.789 45.47,74.035 45.686,65.695 46.225,57.704 47.318,49.587 43.65,47.237 39.795,45.22 36.369,42.469 32.888,39.791 29.333,37.229 26.181,34.097 19.884,38.262 13.219,42.176 6.353,45.631 -1.048,37.666 -7.968,29.069 -13.621,19.449 -9.368,12.569 -4.928,6.12 -0.134,0 Z" /> + </g> + <g + style="stroke-width:0.32031175" + transform="matrix(4.162611,0,0,-4.162611,784.07144,817.24284)" + id="g86-7"> + <path + inkscape:connector-curvature="0" + id="path88-5" + style="fill:#478cbf;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.32031175" + d="m 0,0 -1.121,-16.063 c -0.135,-1.936 -1.675,-3.477 -3.611,-3.616 l -38.555,-2.751 c -0.094,-0.007 -0.188,-0.01 -0.281,-0.01 -1.916,0 -3.569,1.406 -3.852,3.33 l -2.211,14.994 H -81.09 l -2.211,-14.994 c -0.297,-2.018 -2.101,-3.469 -4.133,-3.32 l -38.555,2.751 c -1.936,0.139 -3.476,1.68 -3.611,3.616 L -130.721,0 -163.268,3.138 c 0.015,-3.498 0.06,-7.33 0.06,-8.093 0,-34.374 43.605,-50.896 97.781,-51.086 h 0.066 0.067 c 54.176,0.19 97.766,16.712 97.766,51.086 0,0.777 0.047,4.593 0.063,8.093 z" /> + </g> + <g + style="stroke-width:0.32031175" + transform="matrix(4.162611,0,0,-4.162611,389.21484,625.67104)" + id="g90-3"> + <path + inkscape:connector-curvature="0" + id="path92-5" + style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.32031175" + d="m 0,0 c 0,-12.052 -9.765,-21.815 -21.813,-21.815 -12.042,0 -21.81,9.763 -21.81,21.815 0,12.044 9.768,21.802 21.81,21.802 C -9.765,21.802 0,12.044 0,0" /> + </g> + <g + style="stroke-width:0.32031175" + transform="matrix(4.162611,0,0,-4.162611,367.36686,631.05679)" + id="g94-6"> + <path + inkscape:connector-curvature="0" + id="path96-2" + style="fill:#414042;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.32031175" + d="m 0,0 c 0,-7.994 -6.479,-14.473 -14.479,-14.473 -7.996,0 -14.479,6.479 -14.479,14.473 0,7.994 6.483,14.479 14.479,14.479 C -6.479,14.479 0,7.994 0,0" /> + </g> + <g + style="stroke-width:0.32031175" + transform="matrix(4.162611,0,0,-4.162611,511.99336,724.73954)" + id="g98-9"> + <path + inkscape:connector-curvature="0" + id="path100-1" + style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.32031175" + d="m 0,0 c -3.878,0 -7.021,2.858 -7.021,6.381 v 20.081 c 0,3.52 3.143,6.381 7.021,6.381 3.878,0 7.028,-2.861 7.028,-6.381 V 6.381 C 7.028,2.858 3.878,0 0,0" /> + </g> + <g + style="stroke-width:0.32031175" + transform="matrix(4.162611,0,0,-4.162611,634.78706,625.67104)" + id="g102-2"> + <path + inkscape:connector-curvature="0" + id="path104-7" + style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.32031175" + d="m 0,0 c 0,-12.052 9.765,-21.815 21.815,-21.815 12.041,0 21.808,9.763 21.808,21.815 0,12.044 -9.767,21.802 -21.808,21.802 C 9.765,21.802 0,12.044 0,0" /> + </g> + <g + style="stroke-width:0.32031175" + transform="matrix(4.162611,0,0,-4.162611,656.64056,631.05679)" + id="g106-0"> + <path + inkscape:connector-curvature="0" + id="path108-9" + style="fill:#414042;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.32031175" + d="m 0,0 c 0,-7.994 6.477,-14.473 14.471,-14.473 8.002,0 14.479,6.479 14.479,14.473 0,7.994 -6.477,14.479 -14.479,14.479 C 6.477,14.479 0,7.994 0,0" /> + </g> + </g> + <path + style="opacity:1;fill:#000000;fill-opacity:1;stroke:none;stroke-width:6;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.44162436" + d="m 4,1041.3622 a 3,3 0 0 0 -3,3 3,3 0 0 0 3,3 3,3 0 0 0 3,-3 3,3 0 0 0 -3,-3 z m 0,1 a 2.0000174,2.0000174 0 0 1 2,2 2.0000174,2.0000174 0 0 1 -2,2 2.0000174,2.0000174 0 0 1 -2,-2 2.0000174,2.0000174 0 0 1 2,-2 z" + id="path4151" + inkscape:connector-curvature="0" /> + <path + inkscape:connector-curvature="0" + id="path4156" + d="m 12,1041.3622 a 3,3 0 0 0 -3,3 3,3 0 0 0 3,3 3,3 0 0 0 3,-3 3,3 0 0 0 -3,-3 z m 0,1 a 2.0000174,2.0000174 0 0 1 2,2 2.0000174,2.0000174 0 0 1 -2,2 2.0000174,2.0000174 0 0 1 -2,-2 2.0000174,2.0000174 0 0 1 2,-2 z" + style="opacity:1;fill:#000000;fill-opacity:1;stroke:none;stroke-width:6;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.44162436" /> + <rect + style="opacity:1;fill:#000000;fill-opacity:1;stroke:none;stroke-width:6;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.44162436" + id="rect4160" + width="4" + height="1" + x="6" + y="1043.3622" + ry="0" /> + </g> +</svg> diff --git a/editor/icons/source/icon_godot_docs.svg b/editor/icons/source/icon_godot_docs.svg deleted file mode 100644 index 77aa92b31f..0000000000 --- a/editor/icons/source/icon_godot_docs.svg +++ /dev/null @@ -1,173 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://creativecommons.org/ns#" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="16" - height="16" - viewBox="0 0 15 15" - id="svg2" - version="1.1" - inkscape:version="0.92.1 r15371" - inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_collision_shape_2d.png" - inkscape:export-xdpi="90" - inkscape:export-ydpi="90" - sodipodi:docname="icon_godot_docs.svg"> - <defs - id="defs4" /> - <sodipodi:namedview - id="base" - pagecolor="#ffffff" - bordercolor="#666666" - borderopacity="1.0" - inkscape:pageopacity="0.0" - inkscape:pageshadow="2" - inkscape:zoom="22.627417" - inkscape:cx="-14.305844" - inkscape:cy="5.1981046" - inkscape:document-units="px" - inkscape:current-layer="layer1" - showgrid="false" - units="px" - inkscape:snap-bbox="true" - inkscape:bbox-paths="true" - inkscape:bbox-nodes="true" - inkscape:snap-bbox-edge-midpoints="true" - inkscape:snap-bbox-midpoints="true" - inkscape:snap-object-midpoints="true" - inkscape:snap-center="true" - inkscape:window-width="1920" - inkscape:window-height="1011" - inkscape:window-x="0" - inkscape:window-y="0" - inkscape:window-maximized="1"> - <inkscape:grid - type="xygrid" - id="grid3336" - originx="0" - originy="0" - spacingx="1" - spacingy="1" /> - </sodipodi:namedview> - <metadata - id="metadata7"> - <rdf:RDF> - <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title></dc:title> - </cc:Work> - </rdf:RDF> - </metadata> - <g - inkscape:label="Layer 1" - inkscape:groupmode="layer" - id="layer1" - transform="translate(0,-1037.3622)"> - <g - id="g78" - transform="matrix(0.06307836,0,0,-0.06307664,13.671143,1047.293)" - style="stroke-width:19.8168869"> - <path - d="m 0,0 c 0,0 -0.325,1.994 -0.515,1.976 l -36.182,-3.491 c -2.879,-0.278 -5.115,-2.574 -5.317,-5.459 l -0.994,-14.247 -27.992,-1.997 -1.904,12.912 c -0.424,2.872 -2.932,5.037 -5.835,5.037 h -38.188 c -2.902,0 -5.41,-2.165 -5.834,-5.037 l -1.905,-12.912 -27.992,1.997 -0.994,14.247 c -0.202,2.886 -2.438,5.182 -5.317,5.46 l -36.2,3.49 c -0.187,0.018 -0.324,-1.978 -0.511,-1.978 l -0.049,-7.83 30.658,-4.944 1.004,-14.374 c 0.203,-2.91 2.551,-5.263 5.463,-5.472 l 38.551,-2.75 c 0.146,-0.01 0.29,-0.016 0.434,-0.016 2.897,0 5.401,2.166 5.825,5.038 l 1.959,13.286 h 28.005 l 1.959,-13.286 c 0.423,-2.871 2.93,-5.037 5.831,-5.037 0.142,0 0.284,0.005 0.423,0.015 l 38.556,2.75 c 2.911,0.209 5.26,2.562 5.463,5.472 l 1.003,14.374 30.645,4.966 z" - style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:19.8168869" - id="path80" - inkscape:connector-curvature="0" /> - </g> - <g - id="g82-3" - transform="matrix(0.06307836,0,0,-0.06307664,1.3279404,1043.5689)" - style="stroke-width:19.8168869"> - <path - d="m 0,0 v -47.514 -6.035 -5.492 c 0.108,-0.001 0.216,-0.005 0.323,-0.015 l 36.196,-3.49 c 1.896,-0.183 3.382,-1.709 3.514,-3.609 l 1.116,-15.978 31.574,-2.253 2.175,14.747 c 0.282,1.912 1.922,3.329 3.856,3.329 h 38.188 c 1.933,0 3.573,-1.417 3.855,-3.329 l 2.175,-14.747 31.575,2.253 1.115,15.978 c 0.133,1.9 1.618,3.425 3.514,3.609 l 36.182,3.49 c 0.107,0.01 0.214,0.014 0.322,0.015 v 4.711 l 0.015,0.005 V 0 h 0.134 c 4.795,6.12 9.232,12.569 13.487,19.449 -5.651,9.62 -12.575,18.217 -19.976,26.182 -6.864,-3.455 -13.531,-7.369 -19.828,-11.534 -3.151,3.132 -6.7,5.694 -10.186,8.372 -3.425,2.751 -7.285,4.768 -10.946,7.118 1.09,8.117 1.629,16.108 1.846,24.448 -9.446,4.754 -19.519,7.906 -29.708,10.17 -4.068,-6.837 -7.788,-14.241 -11.028,-21.479 -3.842,0.642 -7.702,0.88 -11.567,0.926 v 0.006 c -0.027,0 -0.052,-0.006 -0.075,-0.006 -0.024,0 -0.049,0.006 -0.073,0.006 V 63.652 C 93.903,63.606 90.046,63.368 86.203,62.726 82.965,69.964 79.247,77.368 75.173,84.205 64.989,81.941 54.915,78.789 45.47,74.035 45.686,65.695 46.225,57.704 47.318,49.587 43.65,47.237 39.795,45.22 36.369,42.469 32.888,39.791 29.333,37.229 26.181,34.097 19.884,38.262 13.219,42.176 6.353,45.631 -1.048,37.666 -7.968,29.069 -13.621,19.449 -9.368,12.569 -4.928,6.12 -0.134,0 Z" - style="fill:#478cbf;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:19.8168869" - id="path84-6" - inkscape:connector-curvature="0" /> - </g> - <g - id="g86-7" - transform="matrix(0.06307836,0,0,-0.06307664,11.62285,1047.9836)" - style="stroke-width:19.8168869"> - <path - d="m 0,0 -1.121,-16.063 c -0.135,-1.936 -1.675,-3.477 -3.611,-3.616 l -38.555,-2.751 c -0.094,-0.007 -0.188,-0.01 -0.281,-0.01 -1.916,0 -3.569,1.406 -3.852,3.33 l -2.211,14.994 H -81.09 l -2.211,-14.994 c -0.297,-2.018 -2.101,-3.469 -4.133,-3.32 l -38.555,2.751 c -1.936,0.139 -3.476,1.68 -3.611,3.616 L -130.721,0 -163.268,3.138 c 0.015,-3.498 0.06,-7.33 0.06,-8.093 0,-34.374 43.605,-50.896 97.781,-51.086 h 0.066 0.067 c 54.176,0.19 97.766,16.712 97.766,51.086 0,0.777 0.047,4.593 0.063,8.093 z" - style="fill:#478cbf;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:19.8168869" - id="path88-5" - inkscape:connector-curvature="0" /> - </g> - <g - id="g90-3" - transform="matrix(0.06307836,0,0,-0.06307664,5.6393685,1045.0806)" - style="stroke-width:19.8168869"> - <path - d="m 0,0 c 0,-12.052 -9.765,-21.815 -21.813,-21.815 -12.042,0 -21.81,9.763 -21.81,21.815 0,12.044 9.768,21.802 21.81,21.802 C -9.765,21.802 0,12.044 0,0" - style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:19.8168869" - id="path92-5" - inkscape:connector-curvature="0" /> - </g> - <g - id="g94-6" - transform="matrix(0.06307836,0,0,-0.06307664,5.3082938,1045.1623)" - style="stroke-width:19.8168869"> - <path - d="m 0,0 c 0,-7.994 -6.479,-14.473 -14.479,-14.473 -7.996,0 -14.479,6.479 -14.479,14.473 0,7.994 6.483,14.479 14.479,14.479 C -6.479,14.479 0,7.994 0,0" - style="fill:#414042;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:19.8168869" - id="path96-2" - inkscape:connector-curvature="0" /> - </g> - <g - id="g98-9" - transform="matrix(0.06307836,0,0,-0.06307664,7.4998997,1046.5818)" - style="stroke-width:19.8168869"> - <path - d="m 0,0 c -3.878,0 -7.021,2.858 -7.021,6.381 v 20.081 c 0,3.52 3.143,6.381 7.021,6.381 3.878,0 7.028,-2.861 7.028,-6.381 V 6.381 C 7.028,2.858 3.878,0 0,0" - style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:19.8168869" - id="path100-1" - inkscape:connector-curvature="0" /> - </g> - <g - id="g102-2" - transform="matrix(0.06307836,0,0,-0.06307664,9.3606615,1045.0806)" - style="stroke-width:19.8168869"> - <path - d="m 0,0 c 0,-12.052 9.765,-21.815 21.815,-21.815 12.041,0 21.808,9.763 21.808,21.815 0,12.044 -9.767,21.802 -21.808,21.802 C 9.765,21.802 0,12.044 0,0" - style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:19.8168869" - id="path104-7" - inkscape:connector-curvature="0" /> - </g> - <g - id="g106-0" - transform="matrix(0.06307836,0,0,-0.06307664,9.6918191,1045.1623)" - style="stroke-width:19.8168869"> - <path - d="m 0,0 c 0,-7.994 6.477,-14.473 14.471,-14.473 8.002,0 14.479,6.479 14.479,14.473 0,7.994 -6.477,14.479 -14.479,14.479 C 6.477,14.479 0,7.994 0,0" - style="fill:#414042;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:19.8168869" - id="path108-9" - inkscape:connector-curvature="0" /> - </g> - <path - inkscape:connector-curvature="0" - id="path4392" - d="m 4.3227149,1042.5597 a 2.5297459,2.5296773 0 0 0 -2.5297461,2.5297 2.5297459,2.5296773 0 0 0 2.5297461,2.5297 2.5297459,2.5296773 0 0 0 2.5297463,-2.5297 2.5297459,2.5296773 0 0 0 -2.5297463,-2.5297 z m 0,0.5084 a 2.0213759,2.021321 0 0 1 2.0213758,2.0213 2.0213759,2.021321 0 0 1 -2.0213758,2.0213 2.0213759,2.021321 0 0 1 -2.0213757,-2.0213 2.0213759,2.021321 0 0 1 2.0213757,-2.0213 z" - style="opacity:1;fill:#414042;fill-opacity:1;stroke:none;stroke-width:1.94780529;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;filter:url(#filter4200);enable-background:new" /> - <path - style="opacity:1;fill:#414042;fill-opacity:1;stroke:none;stroke-width:1.94780529;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;filter:url(#filter4200);enable-background:new" - d="m 10.679126,1042.5597 a 2.5297459,2.5296773 0 0 0 -2.5297472,2.5297 2.5297459,2.5296773 0 0 0 2.5297472,2.5297 2.5297459,2.5296773 0 0 0 2.529744,-2.5297 2.5297459,2.5296773 0 0 0 -2.529744,-2.5297 z m 0,0.5084 a 2.0213759,2.021321 0 0 1 2.021373,2.0213 2.0213759,2.021321 0 0 1 -2.021373,2.0213 2.0213759,2.021321 0 0 1 -2.0213767,-2.0213 2.0213759,2.021321 0 0 1 2.0213767,-2.0213 z" - id="path4403" - inkscape:connector-curvature="0" /> - <rect - style="opacity:1;fill:#414042;fill-opacity:1;stroke:none;stroke-width:5.625;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.44162436" - id="rect4160" - width="2.3136585" - height="0.53352129" - x="6.3440895" - y="1043.9767" /> - </g> -</svg> diff --git a/editor/icons/source/icon_image_sky_box.svg b/editor/icons/source/icon_gradient.svg index 9a89c04e58..4ce1b3232f 100644 --- a/editor/icons/source/icon_image_sky_box.svg +++ b/editor/icons/source/icon_gradient.svg @@ -10,78 +10,75 @@ xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - sodipodi:docname="icon_image_sky_box.svg" - inkscape:export-ydpi="90" - inkscape:export-xdpi="90" - inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_box_shape.png" - inkscape:version="0.91 r13725" - version="1.1" - id="svg2" - viewBox="0 0 16 16" + width="16" height="16" - width="16"> - <sodipodi:namedview - inkscape:snap-smooth-nodes="true" - inkscape:object-nodes="true" - inkscape:snap-intersection-paths="false" - inkscape:object-paths="false" - inkscape:window-maximized="1" - inkscape:window-y="27" - inkscape:window-x="0" - inkscape:window-height="1016" - inkscape:window-width="1920" - inkscape:snap-center="true" - inkscape:snap-object-midpoints="true" - inkscape:snap-bbox-midpoints="true" - inkscape:snap-bbox-edge-midpoints="true" - inkscape:bbox-nodes="true" - inkscape:bbox-paths="true" - inkscape:snap-bbox="true" - units="px" - showgrid="true" - inkscape:current-layer="layer1" - inkscape:document-units="px" - inkscape:cy="9.413879" - inkscape:cx="10.701686" - inkscape:zoom="32" - inkscape:pageshadow="2" - inkscape:pageopacity="0.0" - borderopacity="1.0" - bordercolor="#666666" - pagecolor="#ffffff" - id="base" - inkscape:snap-midpoints="true"> - <inkscape:grid - id="grid3336" - type="xygrid" - empspacing="4" /> - </sodipodi:namedview> + viewBox="0 0 16 16" + id="svg2" + version="1.1" + inkscape:version="0.92+devel unknown" + inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_key.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" + sodipodi:docname="icon_gradient.svg"> <defs id="defs4"> <linearGradient inkscape:collect="always" - id="linearGradient4142"> + id="linearGradient848"> <stop - style="stop-color:#84c2ff;stop-opacity:1" + style="stop-color:#e0e0e0;stop-opacity:1;" offset="0" - id="stop4144" /> + id="stop844" /> <stop - style="stop-color:#46a3ff;stop-opacity:1" + style="stop-color:#e0e0e0;stop-opacity:0;" offset="1" - id="stop4146" /> + id="stop846" /> </linearGradient> - <radialGradient + <linearGradient inkscape:collect="always" - xlink:href="#linearGradient4142" - id="radialGradient4148" - cx="9.9399967" - cy="1051.0801" - fx="9.9399967" - fy="1051.0801" - r="7" - gradientTransform="matrix(1.3337828e-5,-1.9999995,1.5714282,2.7945105e-6,-1643.697,1071.2392)" + xlink:href="#linearGradient848" + id="linearGradient850" + x1="10" + y1="1" + x2="10" + y2="15" gradientUnits="userSpaceOnUse" /> </defs> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="32" + inkscape:cx="9.5330742" + inkscape:cy="10.782845" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="true" + units="px" + inkscape:snap-bbox="true" + inkscape:bbox-paths="true" + inkscape:bbox-nodes="true" + inkscape:snap-bbox-edge-midpoints="true" + inkscape:snap-bbox-midpoints="false" + inkscape:snap-object-midpoints="true" + inkscape:snap-center="true" + inkscape:window-width="1920" + inkscape:window-height="1016" + inkscape:window-x="0" + inkscape:window-y="27" + inkscape:window-maximized="1" + inkscape:object-paths="false" + inkscape:snap-intersection-paths="false" + inkscape:object-nodes="false" + inkscape:snap-smooth-nodes="false" + inkscape:document-rotation="0"> + <inkscape:grid + type="xygrid" + id="grid3336" /> + </sodipodi:namedview> <metadata id="metadata7"> <rdf:RDF> @@ -90,27 +87,21 @@ <dc:format>image/svg+xml</dc:format> <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title /> + <dc:title></dc:title> </cc:Work> </rdf:RDF> </metadata> <g - transform="translate(0,-1036.3622)" - id="layer1" + inkscape:label="Layer 1" inkscape:groupmode="layer" - inkscape:label="Layer 1"> - <rect - style="opacity:1;fill:url(#radialGradient4148);fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect4140" - width="14" - height="13.999983" - x="1" - y="1037.3622" - ry="2.0000174" /> + id="layer1" + transform="translate(0,-1036.3622)"> <path - style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - d="M 6 4 A 1 1 0 0 0 5 5 A 1 1 0 0 0 6 6 A 1 1 0 0 0 7 5 A 1 1 0 0 0 6 4 z M 11 5 A 2 2 0 0 0 9 7 A 1 1 0 0 0 8 8 A 1 1 0 0 0 9 9 L 13 9 A 1 1 0 0 0 14 8 A 1 1 0 0 0 13 7 A 2 2 0 0 0 11 5 z M 3 9 A 1 1 0 0 0 2 10 A 1 1 0 0 0 3 11 L 5 11 A 1 1 0 0 0 4 12 A 1 1 0 0 0 5 13 L 8 13 A 1 1 0 0 0 9 12 A 1 1 0 0 0 8 11 L 6 11 A 1 1 0 0 0 7 10 A 1 1 0 0 0 6 9 L 3 9 z " + style="opacity:1;fill:url(#linearGradient850);fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843" + d="M 2,1 C 1.4477153,1 1,1.4477153 1,2 v 12 c 0,0.552285 0.4477153,1 1,1 h 12 c 0.552285,0 1,-0.447715 1,-1 V 2 C 15,1.4477153 14.552285,1 14,1 Z" transform="translate(0,1036.3622)" - id="path4150" /> + id="rect4156" + inkscape:connector-curvature="0" + sodipodi:nodetypes="sssssssss" /> </g> </svg> diff --git a/editor/icons/source/icon_grid_map.svg b/editor/icons/source/icon_grid_map.svg index 5bbea0ff2c..83b831abd4 100644 --- a/editor/icons/source/icon_grid_map.svg +++ b/editor/icons/source/icon_grid_map.svg @@ -14,7 +14,7 @@ viewBox="0 0 16 16" id="svg2" version="1.1" - inkscape:version="0.91 r13725" + inkscape:version="0.92.1 r" inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_collision_shape_2d.png" inkscape:export-xdpi="90" inkscape:export-ydpi="90" @@ -28,9 +28,9 @@ borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" - inkscape:zoom="32" - inkscape:cx="9.49128" - inkscape:cy="9.6074202" + inkscape:zoom="16" + inkscape:cx="10.766846" + inkscape:cy="6.0751122" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="true" @@ -42,8 +42,8 @@ inkscape:snap-bbox-midpoints="true" inkscape:snap-object-midpoints="true" inkscape:snap-center="true" - inkscape:window-width="1920" - inkscape:window-height="1016" + inkscape:window-width="1600" + inkscape:window-height="836" inkscape:window-x="0" inkscape:window-y="27" inkscape:window-maximized="1"> @@ -59,7 +59,7 @@ <dc:format>image/svg+xml</dc:format> <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title></dc:title> + <dc:title /> </cc:Work> </rdf:RDF> </metadata> @@ -68,68 +68,10 @@ inkscape:groupmode="layer" id="layer1" transform="translate(0,-1036.3622)"> - <rect - style="opacity:1;fill:#fc9c9c;fill-opacity:0.99607843;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect4170" - width="4" - height="4.0000172" - x="1" - y="1037.3622" /> - <rect - y="1037.3622" - x="11" - height="4.0000172" - width="4" - id="rect4172" - style="opacity:1;fill:#fc9c9c;fill-opacity:0.99607843;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#fc9c9c;fill-opacity:0.99607843;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect4174" - width="4" - height="4.0000172" - x="6" - y="1037.3622" /> - <rect - y="1042.3622" - x="1" - height="4.0000172" - width="4" - id="rect4176" - style="opacity:1;fill:#fc9c9c;fill-opacity:0.99607843;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#fc9c9c;fill-opacity:0.99607843;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect4178" - width="4" - height="4.0000172" - x="11" - y="1042.3622" /> - <rect - y="1042.3622" - x="6" - height="4.0000172" - width="4" - id="rect4180" - style="opacity:1;fill:#fc9c9c;fill-opacity:0.99607843;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#fc9c9c;fill-opacity:0.99607843;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect4182" - width="4" - height="4.0000172" - x="1" - y="1047.3622" /> - <rect - y="1047.3622" - x="11" - height="4.0000172" - width="4" - id="rect4184" - style="opacity:1;fill:#fc9c9c;fill-opacity:0.99607843;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#fc9c9c;fill-opacity:0.99607843;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect4186" - width="4" - height="4.0000172" - x="6" - y="1047.3622" /> + <path + style="fill:#fc9c9c;fill-opacity:0.99607843;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + d="M 8 1 L 6 2 L 4 3 L 2 4 L 2 6 L 2 8 L 2 10 L 2 12 L 4 13 L 6 14 L 8 15 L 10 14 L 12 13 L 14 12 L 14 10 L 12 9 L 10 10 L 8 11 L 6 10 L 6 8 L 6 6 L 8 5 L 8 3 L 10 2 L 8 1 z M 12 3 L 10 4 L 10 6 L 12 7 L 14 6 L 14 4 L 12 3 z " + transform="translate(0,1036.3622)" + id="path1047" /> </g> </svg> diff --git a/editor/icons/source/icon_h_button_array.svg b/editor/icons/source/icon_h_button_array.svg index 9470aeb370..0dad9ee8b8 100644 --- a/editor/icons/source/icon_h_button_array.svg +++ b/editor/icons/source/icon_h_button_array.svg @@ -14,7 +14,7 @@ viewBox="0 0 16 16" id="svg2" version="1.1" - inkscape:version="0.91 r13725" + inkscape:version="0.92.1 r" inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_button.png" inkscape:export-xdpi="90" inkscape:export-ydpi="90" @@ -28,9 +28,9 @@ borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" - inkscape:zoom="32" - inkscape:cx="12.020131" - inkscape:cy="9.3264403" + inkscape:zoom="16" + inkscape:cx="13.231578" + inkscape:cy="12.996902" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="true" @@ -42,11 +42,15 @@ inkscape:snap-bbox-midpoints="true" inkscape:snap-object-midpoints="true" inkscape:snap-center="true" - inkscape:window-width="1920" - inkscape:window-height="1016" + inkscape:window-width="1600" + inkscape:window-height="836" inkscape:window-x="0" inkscape:window-y="27" - inkscape:window-maximized="1"> + inkscape:window-maximized="1" + inkscape:snap-intersection-paths="true" + inkscape:object-paths="true" + inkscape:snap-smooth-nodes="true" + inkscape:snap-midpoints="true"> <inkscape:grid type="xygrid" id="grid3336" @@ -60,7 +64,7 @@ <dc:format>image/svg+xml</dc:format> <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title></dc:title> + <dc:title /> </cc:Work> </rdf:RDF> </metadata> @@ -69,29 +73,21 @@ inkscape:groupmode="layer" id="layer1" transform="translate(0,-1036.3622)"> - <rect - style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect4156" - width="6" - height="5.9999828" - x="2" - y="1041.3622" /> + <g + id="layer1-7" + inkscape:label="Layer 1" + transform="translate(9,-1.9999826)" + style="fill:#a5efac;fill-opacity:1" /> <path - style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - d="m 10,1041.3622 0,6 4,0 -1,-2 1,-2 -1,-2 -3,0 z" - id="rect4158" + style="fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 12,1041.3622 v 2 h -2 v 2 h 2 v 2 h 2 v -2 h 2 v -2 h -2 v -2 z" + id="rect836" inkscape:connector-curvature="0" /> - <rect - y="1046.3622" - x="2" - height="0.99996543" - width="6" - id="rect4161" - style="opacity:1;fill:#98dc9f;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> <path - style="opacity:1;fill:#98dc9f;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - d="m 10,1046.3622 0,1 4,0 -0.5,-1 -3.5,0 z" - id="rect4163" - inkscape:connector-curvature="0" /> + style="fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 4,1037.3622 v 3.1328 l -1.445312,-0.9648 -1.109376,1.664 3,2 c 0.335902,0.2239 0.773474,0.2239 1.109376,0 l 3,-2 -1.109376,-1.664 L 6,1040.495 v -3.1328 z m -0.5,8 c -0.831,0 -1.5,0.669 -1.5,1.5 v 0.5 1 H 1 v 2 h 8 v -2 H 8 v -1 -0.5 c 0,-0.831 -0.669,-1.5 -1.5,-1.5 z" + id="rect829-9" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cccccccccccssccccccccsss" /> </g> </svg> diff --git a/editor/icons/source/icon_h_scroll_bar.svg b/editor/icons/source/icon_h_scroll_bar.svg index 2f007c7c94..fbcee056b3 100644 --- a/editor/icons/source/icon_h_scroll_bar.svg +++ b/editor/icons/source/icon_h_scroll_bar.svg @@ -14,7 +14,7 @@ viewBox="0 0 16 16" id="svg2" version="1.1" - inkscape:version="0.91 r13725" + inkscape:version="0.92.1 r" inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_center_container.png" inkscape:export-xdpi="90" inkscape:export-ydpi="90" @@ -29,7 +29,7 @@ inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="32" - inkscape:cx="9.1371771" + inkscape:cx="2.7934271" inkscape:cy="7.8450604" inkscape:document-units="px" inkscape:current-layer="layer1" @@ -42,8 +42,8 @@ inkscape:snap-bbox-midpoints="true" inkscape:snap-object-midpoints="true" inkscape:snap-center="true" - inkscape:window-width="1920" - inkscape:window-height="1016" + inkscape:window-width="1600" + inkscape:window-height="836" inkscape:window-x="0" inkscape:window-y="27" inkscape:window-maximized="1" @@ -63,7 +63,7 @@ <dc:format>image/svg+xml</dc:format> <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title></dc:title> + <dc:title /> </cc:Work> </rdf:RDF> </metadata> @@ -73,25 +73,9 @@ id="layer1" transform="translate(0,-1036.3622)"> <path - style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - d="M 3,3 C 1.8954305,3 1,3.8954305 1,5 l 0,6 c 0,1.104569 0.8954305,2 2,2 l 10,0 c 1.104569,0 2,-0.895431 2,-2 L 15,5 C 15,3.8954305 14.104569,3 13,3 Z m 0,2 10,0 0,6 -10,0 z" - transform="translate(0,1036.3622)" - id="rect4140" inkscape:connector-curvature="0" - sodipodi:nodetypes="sssssssssccccc" /> - <rect - style="opacity:1;fill:none;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843" - id="rect4181" - width="4" - height="4" - x="4" - y="1042.3622" /> - <rect - style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843" - id="rect4187" - width="4" - height="4" - x="4" - y="1042.3622" /> + style="fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 15,1041.3622 c 0,-1.108 -0.892,-2 -2,-2 H 3 c -1.108,0 -2,0.892 -2,2 v 6 c 0,1.108 0.892,2 2,2 h 10 c 1.108,0 2,-0.892 2,-2 z m -1,2.9883 a 1.0001,1.0001 0 0 1 -0.168,0.5664 l -2,3 a 1.0001,1.0001 0 1 1 -1.664,-1.1094 l 1.6289,-2.4453 -1.6289,-2.4453 a 1.0001,1.0001 0 1 1 1.664,-1.1094 l 2,3 a 1.0001,1.0001 0 0 1 0.168,0.543 z m -7.9922,-2.9981 a 1.0001,1.0001 0 0 1 -0.1758,0.5645 l -1.6308,2.4453 1.6308,2.4453 a 1.0001,1.0001 0 1 1 -1.664,1.1094 l -2,-3 a 1.0001,1.0001 0 0 1 0,-1.1094 l 2,-3 a 1.0001,1.0001 0 0 1 1.8398,0.5449 z" + id="rect825" /> </g> </svg> diff --git a/editor/icons/source/icon_h_slider.svg b/editor/icons/source/icon_h_slider.svg index beee5f8b6a..b3e8a956da 100644 --- a/editor/icons/source/icon_h_slider.svg +++ b/editor/icons/source/icon_h_slider.svg @@ -14,7 +14,7 @@ viewBox="0 0 16 16" id="svg2" version="1.1" - inkscape:version="0.91 r13725" + inkscape:version="0.92.1 r" inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_center_container.png" inkscape:export-xdpi="90" inkscape:export-ydpi="90" @@ -28,9 +28,9 @@ borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" - inkscape:zoom="32" - inkscape:cx="9.3533577" - inkscape:cy="8.3875011" + inkscape:zoom="22.627417" + inkscape:cx="7.7094459" + inkscape:cy="9.5190595" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="true" @@ -42,8 +42,8 @@ inkscape:snap-bbox-midpoints="true" inkscape:snap-object-midpoints="true" inkscape:snap-center="true" - inkscape:window-width="1920" - inkscape:window-height="1016" + inkscape:window-width="1600" + inkscape:window-height="836" inkscape:window-x="0" inkscape:window-y="27" inkscape:window-maximized="1" @@ -63,7 +63,7 @@ <dc:format>image/svg+xml</dc:format> <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title></dc:title> + <dc:title /> </cc:Work> </rdf:RDF> </metadata> @@ -73,27 +73,38 @@ id="layer1" transform="translate(0,-1036.3622)"> <path - style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - d="M 2 7 L 2 9 L 5.1738281 9 A 3 3 0 0 1 5 8 A 3 3 0 0 1 5.1757812 7 L 2 7 z M 10.826172 7 A 3 3 0 0 1 11 8 A 3 3 0 0 1 10.824219 9 L 14 9 L 14 7 L 10.826172 7 z " - transform="translate(0,1036.3622)" - id="rect4157" /> - <circle - style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843" - id="path4159" - cx="2" - cy="1044.3622" - r="1" /> + style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#a5efac;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" + d="m 2,1046.3622 a 1.0001,1.0001 0 1 0 0,2 h 2.1308594 a 4,4 0 0 1 -0.1308594,-1 4,4 0 0 1 0.1328125,-1 z m 9.869141,0 a 4,4 0 0 1 0.130859,1 4,4 0 0 1 -0.132812,1 H 14 a 1.0001,1.0001 0 1 0 0,-2 z" + id="path817" + inkscape:connector-curvature="0" /> <circle - r="1" - cy="1044.3622" - cx="14" - id="circle4161" - style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843" /> - <circle - style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843" - id="path4167" - cx="8" - cy="1044.3622" + style="fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="path824" + cx="13" + cy="1047.3622" r="2" /> + <path + style="fill:none;stroke:#a5efac;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 2,1040.3622 v 2" + id="path835" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cc" /> + <path + style="fill:none;stroke:#a5efac;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 8,1041.3622 v 0" + id="path837" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cc" /> + <path + style="fill:none;stroke:#a5efac;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 14,1040.3622 v 2" + id="path839" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cc" /> + <path + style="fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="M 3 10 L 3 12 L 9.1308594 12 A 4 4 0 0 1 9 11 A 4 4 0 0 1 9.1328125 10 L 3 10 z " + transform="translate(0,1036.3622)" + id="rect841" /> </g> </svg> diff --git a/editor/icons/source/icon_hslider_bg.svg b/editor/icons/source/icon_hslider_bg.svg deleted file mode 100644 index 10bea12ab8..0000000000 --- a/editor/icons/source/icon_hslider_bg.svg +++ /dev/null @@ -1,79 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://creativecommons.org/ns#" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="16" - height="16" - viewBox="0 0 16 15.999999" - id="svg2" - version="1.1" - inkscape:version="0.92.1 unknown" - sodipodi:docname="icon_hslider_bg.svg" - inkscape:export-filename="/mnt/2TB/Development/godot_dev/editor/icons/2x/icon_hslider_bg.png" - inkscape:export-xdpi="96" - inkscape:export-ydpi="96"> - <defs - id="defs4" /> - <sodipodi:namedview - id="base" - pagecolor="#ffffff" - bordercolor="#666666" - borderopacity="1.0" - inkscape:pageopacity="0.0" - inkscape:pageshadow="2" - inkscape:zoom="32" - inkscape:cx="4.166346" - inkscape:cy="6.5721301" - inkscape:document-units="px" - inkscape:current-layer="layer1" - showgrid="true" - units="px" - inkscape:object-paths="false" - inkscape:snap-intersection-paths="false" - inkscape:snap-bbox="true" - inkscape:bbox-paths="true" - inkscape:bbox-nodes="true" - inkscape:snap-bbox-edge-midpoints="true" - inkscape:window-width="929" - inkscape:window-height="897" - inkscape:window-x="436" - inkscape:window-y="155" - inkscape:window-maximized="0" - inkscape:snap-smooth-nodes="true" - inkscape:object-nodes="true"> - <inkscape:grid - type="xygrid" - id="grid4136" - empspacing="4" /> - </sodipodi:namedview> - <metadata - id="metadata7"> - <rdf:RDF> - <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title /> - </cc:Work> - </rdf:RDF> - </metadata> - <g - inkscape:label="Layer 1" - inkscape:groupmode="layer" - id="layer1" - transform="translate(0,-1036.3623)"> - <path - style="fill:#000000;fill-opacity:0.19607843;stroke:none;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - d="M 4 5 A 3 3 0 0 0 1 8 A 3 3 0 0 0 4 11 L 12 11 A 3 3 0 0 0 15 8 A 3 3 0 0 0 12 5 L 4 5 z " - transform="translate(0,1036.3623)" - id="path814" /> - </g> -</svg> diff --git a/editor/icons/source/icon_hsplitter.svg b/editor/icons/source/icon_hsplitter.svg deleted file mode 100644 index 01c893fc56..0000000000 --- a/editor/icons/source/icon_hsplitter.svg +++ /dev/null @@ -1,79 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://creativecommons.org/ns#" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="8" - height="64" - viewBox="0 0 8 64" - id="svg2" - version="1.1" - inkscape:version="0.92.1 r" - inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_collapse.png" - inkscape:export-xdpi="45" - inkscape:export-ydpi="45" - sodipodi:docname="hsplitter.svg"> - <defs - id="defs4" /> - <sodipodi:namedview - id="base" - pagecolor="#ffffff" - bordercolor="#666666" - borderopacity="1.0" - inkscape:pageopacity="0.0" - inkscape:pageshadow="2" - inkscape:zoom="11.313709" - inkscape:cx="-2.0338296" - inkscape:cy="39.22669" - inkscape:document-units="px" - inkscape:current-layer="layer1" - showgrid="true" - units="px" - inkscape:snap-bbox="true" - inkscape:bbox-paths="true" - inkscape:bbox-nodes="true" - inkscape:snap-bbox-edge-midpoints="true" - inkscape:snap-bbox-midpoints="false" - inkscape:snap-object-midpoints="true" - inkscape:snap-center="true" - inkscape:window-width="1600" - inkscape:window-height="836" - inkscape:window-x="0" - inkscape:window-y="27" - inkscape:window-maximized="1" - inkscape:snap-smooth-nodes="true" - inkscape:object-nodes="true"> - <inkscape:grid - type="xygrid" - id="grid3336" /> - </sodipodi:namedview> - <metadata - id="metadata7"> - <rdf:RDF> - <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title /> - </cc:Work> - </rdf:RDF> - </metadata> - <g - inkscape:label="Layer 1" - inkscape:groupmode="layer" - id="layer1" - transform="translate(0,-988.3622)"> - <path - style="fill:none;stroke:#ffffff;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:0.39215687;stroke-miterlimit:4;stroke-dasharray:none" - d="m 4,990.3622 v 60" - id="path814" - inkscape:connector-curvature="0" /> - </g> -</svg> diff --git a/editor/icons/source/icon_line_edit.svg b/editor/icons/source/icon_line_edit.svg index 61ba1ebe7e..ccd94b92ed 100644 --- a/editor/icons/source/icon_line_edit.svg +++ b/editor/icons/source/icon_line_edit.svg @@ -14,7 +14,7 @@ viewBox="0 0 16 16" id="svg2" version="1.1" - inkscape:version="0.91 r13725" + inkscape:version="0.92.1 r" inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_center_container.png" inkscape:export-xdpi="90" inkscape:export-ydpi="90" @@ -28,9 +28,9 @@ borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" - inkscape:zoom="45.254834" - inkscape:cx="4.4635244" - inkscape:cy="8.6660933" + inkscape:zoom="32" + inkscape:cx="10.632447" + inkscape:cy="9.3208726" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="true" @@ -42,8 +42,8 @@ inkscape:snap-bbox-midpoints="true" inkscape:snap-object-midpoints="true" inkscape:snap-center="true" - inkscape:window-width="1920" - inkscape:window-height="1016" + inkscape:window-width="1600" + inkscape:window-height="836" inkscape:window-x="0" inkscape:window-y="27" inkscape:window-maximized="1" @@ -63,7 +63,7 @@ <dc:format>image/svg+xml</dc:format> <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title></dc:title> + <dc:title /> </cc:Work> </rdf:RDF> </metadata> @@ -74,17 +74,15 @@ transform="translate(0,-1036.3622)"> <path style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - d="M 3,3 C 1.8954305,3 1,3.8954305 1,5 l 0,6 c 0,1.104569 0.8954305,2 2,2 l 10,0 c 1.104569,0 2,-0.895431 2,-2 L 15,5 C 15,3.8954305 14.104569,3 13,3 Z m 0,2 10,0 0,6 -10,0 z" + d="M 1 11 C 1 12.104569 1.8954305 13 3 13 L 13 13 C 14.104569 13 15 12.104569 15 11 L 13 11 L 3 11 L 1 11 z " transform="translate(0,1036.3622)" - id="rect4140" - inkscape:connector-curvature="0" - sodipodi:nodetypes="sssssssssccccc" /> + id="rect4140" /> <rect - style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:3.16227078;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" id="rect4167" - width="1" - height="4.0000172" - x="4" - y="1042.3622" /> + width="2" + height="5" + x="2" + y="1040.3622" /> </g> </svg> diff --git a/editor/icons/source/icon_mini_matrix32.svg b/editor/icons/source/icon_mini_matrix32.svg deleted file mode 100644 index 5159ea0b87..0000000000 --- a/editor/icons/source/icon_mini_matrix32.svg +++ /dev/null @@ -1,145 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://creativecommons.org/ns#" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="16" - height="12" - viewBox="0 0 16 12" - id="svg2" - version="1.1" - inkscape:version="0.91 r13725" - inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_add_track.png" - inkscape:export-xdpi="45" - inkscape:export-ydpi="45" - sodipodi:docname="icon_mini_matrix32.svg"> - <defs - id="defs4" /> - <sodipodi:namedview - id="base" - pagecolor="#ffffff" - bordercolor="#666666" - borderopacity="1.0" - inkscape:pageopacity="0.0" - inkscape:pageshadow="2" - inkscape:zoom="32.000001" - inkscape:cx="1.5471383" - inkscape:cy="5.978497" - inkscape:document-units="px" - inkscape:current-layer="layer1" - showgrid="true" - units="px" - inkscape:snap-bbox="true" - inkscape:bbox-paths="true" - inkscape:bbox-nodes="true" - inkscape:snap-bbox-edge-midpoints="true" - inkscape:snap-bbox-midpoints="false" - inkscape:snap-object-midpoints="true" - inkscape:snap-center="true" - inkscape:window-width="1920" - inkscape:window-height="1016" - inkscape:window-x="0" - inkscape:window-y="27" - inkscape:window-maximized="1" - inkscape:object-nodes="true" - inkscape:snap-smooth-nodes="true"> - <inkscape:grid - type="xygrid" - id="grid3336" /> - </sodipodi:namedview> - <metadata - id="metadata7"> - <rdf:RDF> - <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title /> - </cc:Work> - </rdf:RDF> - </metadata> - <g - inkscape:label="Layer 1" - inkscape:groupmode="layer" - id="layer1" - transform="translate(0,-1040.3622)"> - <path - style="fill:#ddf4aa;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - d="M 8 2 L 8 4 L 9 4 L 10 4 A 1 1 0 0 1 9 5 L 9 7 A 1 1 0 0 1 10 8 A 1 1 0 0 1 9 9 L 8 9 L 8 11 L 9 11 A 3 3 0 0 0 11.597656 9.5 A 3 3 0 0 0 11.597656 6.5 A 3 3 0 0 0 11.232422 5.9980469 A 3 3 0 0 0 11.597656 5.5 A 3 3 0 0 0 11.994141 4 L 12 4 L 12 2 L 9 2 L 8 2 z " - transform="translate(0,1040.3622)" - id="path4753" /> - <rect - y="1048.3622" - x="11" - height="2" - width="5" - id="rect4763" - style="fill:#c4ec69;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <path - sodipodi:open="true" - d="m 13,1050.3622 a 2,2 0 0 1 -1.732051,-1 2,2 0 0 1 0,-2 2,2 0 0 1 1.732051,-1" - sodipodi:end="4.712389" - sodipodi:start="1.5707963" - sodipodi:ry="2" - sodipodi:rx="2" - sodipodi:cy="1048.3622" - sodipodi:cx="13" - sodipodi:type="arc" - id="path4765" - style="fill:#c4ec69;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <path - inkscape:connector-curvature="0" - id="path4767" - d="m 13,1042.3622 0,2 a 1,1 0 0 1 1,1 1,1 0 0 1 -1,1 l 0,2 a 3,3 0 0 0 2.597656,-1.5 3,3 0 0 0 0,-3 3,3 0 0 0 -2.597656,-1.5 z" - style="fill:#c4ec69;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <path - style="fill:#c4ec69;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - d="m 2,1044.3622 a 3,3 0 0 1 3,3 l -2,0 a 1.0000174,1.0000174 0 0 0 -1,-1 l 0,-2 z" - id="path4771" - inkscape:connector-curvature="0" /> - <rect - y="-1050.3622" - x="3" - height="3" - width="2" - id="rect4773" - style="fill:#c4ec69;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - transform="scale(1,-1)" /> - <rect - style="fill:#c4ec69;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect4775" - width="2" - height="5.9999828" - x="0" - y="-1050.3622" - transform="scale(1,-1)" /> - <rect - transform="scale(1,-1)" - y="-1050.3622" - x="3" - height="5.9999828" - width="2" - id="rect4777" - style="fill:#c4ec69;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <path - inkscape:connector-curvature="0" - id="path4779" - d="m 5,1044.3622 a 3,3 0 0 1 3,3 l -2,0 a 1.0000174,1.0000174 0 0 0 -1,-1 l 0,-2 z" - style="fill:#c4ec69;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="fill:#c4ec69;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect4781" - width="2" - height="3.0000002" - x="6" - y="-1050.3622" - transform="scale(1,-1)" /> - </g> -</svg> diff --git a/editor/icons/source/icon_multi_script.svg b/editor/icons/source/icon_multi_script.svg new file mode 100644 index 0000000000..07c49383a9 --- /dev/null +++ b/editor/icons/source/icon_multi_script.svg @@ -0,0 +1,83 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="16" + height="16" + viewBox="0 0 16 16" + id="svg2" + version="1.1" + inkscape:version="0.92.1 r" + inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_g_d_script.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" + sodipodi:docname="icon_multi_script.svg"> + <defs + id="defs4" /> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="32" + inkscape:cx="8.3086348" + inkscape:cy="8.7213858" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="true" + units="px" + inkscape:snap-bbox="true" + inkscape:bbox-paths="true" + inkscape:bbox-nodes="true" + inkscape:snap-bbox-edge-midpoints="true" + inkscape:snap-bbox-midpoints="true" + inkscape:snap-object-midpoints="true" + inkscape:snap-center="true" + inkscape:window-width="1600" + inkscape:window-height="836" + inkscape:window-x="0" + inkscape:window-y="27" + inkscape:window-maximized="1"> + <inkscape:grid + type="xygrid" + id="grid3336" /> + </sodipodi:namedview> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title /> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1" + transform="translate(0,-1036.3622)"> + <path + style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:3;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + d="M 7 1 L 6.4355469 3.2578125 A 5.0000172 5.0000172 0 0 0 5.7460938 3.5371094 L 3.7578125 2.34375 L 2.34375 3.7578125 L 3.5390625 5.7519531 A 5.0000172 5.0000172 0 0 0 3.2539062 6.4375 L 1 7 L 1 9 L 3.2578125 9.5644531 A 5.0000172 5.0000172 0 0 0 3.5371094 10.251953 L 2.34375 12.242188 L 3.7578125 13.65625 L 5 12.912109 L 5 8 L 6 8 A 2.0000174 2.0000174 0 0 1 8 6 L 8 5 L 12.912109 5 L 13.65625 3.7578125 L 12.242188 2.34375 L 10.248047 3.5390625 A 5.0000172 5.0000172 0 0 0 9.5625 3.2539062 L 9 1 L 7 1 z " + transform="translate(0,1036.3622)" + id="path4176" /> + <path + style="fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:0.99999714;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 10,1043.3622 v 3 H 7 v 2 h 3 v 3 h 2 v -3 h 3 v -2 h -3 v -3 z" + id="rect817" + inkscape:connector-curvature="0" + sodipodi:nodetypes="ccccccccccccc" /> + </g> +</svg> diff --git a/editor/icons/source/icon_nine_patch_rect.svg b/editor/icons/source/icon_nine_patch_rect.svg index f12789c19e..0a6b94094a 100644 --- a/editor/icons/source/icon_nine_patch_rect.svg +++ b/editor/icons/source/icon_nine_patch_rect.svg @@ -14,11 +14,11 @@ viewBox="0 0 16 16" id="svg2" version="1.1" - inkscape:version="0.91 r13725" + inkscape:version="0.92.1 r" inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_center_container.png" inkscape:export-xdpi="90" inkscape:export-ydpi="90" - sodipodi:docname="icon_patch_9_frame.svg"> + sodipodi:docname="icon_nine_patch_rect.svg"> <defs id="defs4" /> <sodipodi:namedview @@ -29,8 +29,8 @@ inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="32" - inkscape:cx="10.35114" - inkscape:cy="9.1140348" + inkscape:cx="8.03864" + inkscape:cy="8.0827848" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="true" @@ -42,8 +42,8 @@ inkscape:snap-bbox-midpoints="true" inkscape:snap-object-midpoints="true" inkscape:snap-center="true" - inkscape:window-width="1920" - inkscape:window-height="1016" + inkscape:window-width="1600" + inkscape:window-height="836" inkscape:window-x="0" inkscape:window-y="27" inkscape:window-maximized="1"> @@ -69,35 +69,35 @@ id="layer1" transform="translate(0,-1036.3622)"> <rect - style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2.82842708;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" id="rect4154" - width="1" + width="2" height="14" x="1" y="1037.3622" /> <rect - y="1050.3622" + y="1049.3622" x="1" - height="0.9999826" + height="1.9999652" width="14" id="rect4156" - style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2.82842708;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> <rect - style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2.82846403;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" id="rect4158" width="14" - height="0.9999826" + height="2.0000174" x="1" y="1037.3622" /> <rect y="1037.3622" - x="14" + x="13" height="14" - width="1" + width="2" id="rect4160" - style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2.82842708;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> <rect - y="1040.3622" + y="1041.3622" x="1" height="0.9999826" width="14" @@ -109,18 +109,18 @@ width="14" height="0.9999826" x="1" - y="1047.3622" /> + y="1046.3622" /> <rect style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" id="rect4166" width="14" height="0.9999826" x="1037.3622" - y="-5" - transform="matrix(0,1,-1,0,0,0)" /> + y="-6" + transform="rotate(90)" /> <rect - transform="matrix(0,1,-1,0,0,0)" - y="-12" + transform="rotate(90)" + y="-10.999983" x="1037.3622" height="0.9999826" width="14" diff --git a/editor/icons/source/icon_option_arrow.svg b/editor/icons/source/icon_option_arrow.svg deleted file mode 100644 index 5cd943e9e3..0000000000 --- a/editor/icons/source/icon_option_arrow.svg +++ /dev/null @@ -1,80 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://creativecommons.org/ns#" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="12" - height="12" - viewBox="0 0 12 12" - id="svg2" - version="1.1" - inkscape:version="0.92.1 r" - inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_collapse.png" - inkscape:export-xdpi="45" - inkscape:export-ydpi="45" - sodipodi:docname="option_arrow.svg"> - <defs - id="defs4" /> - <sodipodi:namedview - id="base" - pagecolor="#ffffff" - bordercolor="#666666" - borderopacity="1.0" - inkscape:pageopacity="0.0" - inkscape:pageshadow="2" - inkscape:zoom="45.254834" - inkscape:cx="3.1667338" - inkscape:cy="5.9875884" - inkscape:document-units="px" - inkscape:current-layer="layer1" - showgrid="true" - units="px" - inkscape:snap-bbox="true" - inkscape:bbox-paths="true" - inkscape:bbox-nodes="true" - inkscape:snap-bbox-edge-midpoints="true" - inkscape:snap-bbox-midpoints="false" - inkscape:snap-object-midpoints="true" - inkscape:snap-center="true" - inkscape:window-width="1600" - inkscape:window-height="836" - inkscape:window-x="0" - inkscape:window-y="27" - inkscape:window-maximized="1" - inkscape:snap-smooth-nodes="true" - inkscape:object-nodes="true"> - <inkscape:grid - type="xygrid" - id="grid3336" /> - </sodipodi:namedview> - <metadata - id="metadata7"> - <rdf:RDF> - <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title /> - </cc:Work> - </rdf:RDF> - </metadata> - <g - inkscape:label="Layer 1" - inkscape:groupmode="layer" - id="layer1" - transform="translate(0,-1040.3622)"> - <path - inkscape:connector-curvature="0" - style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#ffffff;fill-opacity:0.78431374;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" - d="m 9.9999996,1043.3583 c -0.2637796,0.01 -0.5144012,0.1165 -0.697265,0.3067 l -3.292969,3.2929 -3.2929688,-3.2929 C 2.5285367,1043.4714 2.2700113,1043.3622 2,1043.3622 c -0.8974208,2e-4 -1.34038281,1.0909 -0.6972656,1.7168 l 4,4 c 0.3905299,0.3904 1.0235325,0.3904 1.4140624,0 l 4.0000002,-4 c 0.657344,-0.6321 0.194906,-1.7422 -0.7167974,-1.7207 z" - id="path4484" - sodipodi:nodetypes="cccccccccc" /> - </g> -</svg> diff --git a/editor/icons/source/icon_option_button.svg b/editor/icons/source/icon_option_button.svg index 4537b14616..a58d3d9c06 100644 --- a/editor/icons/source/icon_option_button.svg +++ b/editor/icons/source/icon_option_button.svg @@ -14,7 +14,7 @@ viewBox="0 0 16 16" id="svg2" version="1.1" - inkscape:version="0.91 r13725" + inkscape:version="0.92.1 r" inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_center_container.png" inkscape:export-xdpi="90" inkscape:export-ydpi="90" @@ -29,8 +29,8 @@ inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="32" - inkscape:cx="3.751238" - inkscape:cy="7.999659" + inkscape:cx="10.188738" + inkscape:cy="6.593409" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="true" @@ -42,8 +42,8 @@ inkscape:snap-bbox-midpoints="true" inkscape:snap-object-midpoints="true" inkscape:snap-center="true" - inkscape:window-width="1920" - inkscape:window-height="1016" + inkscape:window-width="1600" + inkscape:window-height="836" inkscape:window-x="0" inkscape:window-y="27" inkscape:window-maximized="1" @@ -63,7 +63,7 @@ <dc:format>image/svg+xml</dc:format> <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title></dc:title> + <dc:title /> </cc:Work> </rdf:RDF> </metadata> @@ -74,11 +74,9 @@ transform="translate(0,-1036.3622)"> <path style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - d="M 3,3 C 1.8954305,3 1,3.8954305 1,5 l 0,6 c 0,1.104569 0.8954305,2 2,2 L 9,13 9,3 Z m 7,0 0,10 3,0 c 1.104569,0 2,-0.895431 2,-2 L 15,5 C 15,3.8954305 14.104569,3 13,3 Z m 1,4 3,0 -1.5,2 z" - id="rect4140" + d="M 3 3 C 1.8954305 3 1 3.8954305 1 5 L 1 11 C 1 12.104569 1.8954305 13 3 13 L 8 13 L 9 13 L 10 13 L 12 13 L 13 13 C 14.104569 13 15 12.104569 15 11 L 15 5 C 15 3.8954305 14.104569 3 13 3 L 12 3 L 10 3 L 9 3 L 8 3 L 3 3 z M 11 5.9863281 A 1.0001 1.0001 0 0 1 11.716797 7.7070312 L 8.7167969 10.707031 A 1.0001 1.0001 0 0 1 7.3027344 10.707031 L 4.3027344 7.7070312 A 1.0001 1.0001 0 0 1 5 5.9902344 A 1.0001 1.0001 0 0 1 5.7167969 6.2929688 L 8.0097656 8.5859375 L 10.302734 6.2929688 A 1.0001 1.0001 0 0 1 11 5.9863281 z " transform="translate(0,1036.3622)" - inkscape:connector-curvature="0" - sodipodi:nodetypes="ssssccsccssssccccc" /> + id="rect4140" /> <rect style="opacity:1;fill:none;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843" id="rect4181" diff --git a/editor/icons/source/icon_panorama_sky.svg b/editor/icons/source/icon_panorama_sky.svg new file mode 100644 index 0000000000..32a5253fe3 --- /dev/null +++ b/editor/icons/source/icon_panorama_sky.svg @@ -0,0 +1,131 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="16" + height="16" + viewBox="0 0 16 16" + id="svg2" + version="1.1" + inkscape:version="0.92+devel unknown" + inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_confirmation_dialog.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" + sodipodi:docname="icon_panorama_sky.svg"> + <defs + id="defs4"> + <linearGradient + inkscape:collect="always" + id="linearGradient4291"> + <stop + style="stop-color:#1ec3ff;stop-opacity:1" + offset="0" + id="stop4287" /> + <stop + style="stop-color:#b2e1ff;stop-opacity:1" + offset="1" + id="stop4289" /> + </linearGradient> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient4291" + id="linearGradient4293" + x1="8" + y1="1038.3622" + x2="8" + y2="1050.3622" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(1.0096153,0,0,1.0227214,-0.00961532,-22.593074)" /> + </defs> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="45.254834" + inkscape:cx="8.0139922" + inkscape:cy="7.7749171" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="true" + units="px" + inkscape:snap-bbox="true" + inkscape:bbox-paths="true" + inkscape:bbox-nodes="true" + inkscape:snap-bbox-edge-midpoints="true" + inkscape:snap-bbox-midpoints="true" + inkscape:snap-object-midpoints="true" + inkscape:snap-center="true" + inkscape:window-width="1920" + inkscape:window-height="1016" + inkscape:window-x="0" + inkscape:window-y="27" + inkscape:window-maximized="1" + inkscape:document-rotation="0"> + <inkscape:grid + type="xygrid" + id="grid3336" + originx="0" + originy="0" + spacingx="1" + spacingy="1" /> + </sodipodi:namedview> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1" + transform="translate(0,-1037.3622)"> + <path + style="fill:url(#linearGradient4293);fill-opacity:1;stroke-width:15.24220753" + d="m 1,1039.3622 c 4.2748686,2.6091 10.764971,2.7449 14,0 v 12 c -3.58489,-2.6849 -9.7929096,-2.6544 -14,0 z" + id="rect4285" + inkscape:connector-curvature="0" + sodipodi:nodetypes="ccccc" /> + <rect + style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:0.3254902" + id="rect4273" + width="3" + height="2" + x="2" + y="1046.3622" + ry="1" /> + <rect + style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:0.3254902" + id="rect4275" + width="4" + height="2" + x="8" + y="1044.3622" + ry="1" /> + <rect + style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:0.3254902" + id="rect4277" + width="4" + height="2" + x="10" + y="1043.3622" + ry="1" /> + </g> +</svg> diff --git a/editor/icons/source/icon_particles_shader.svg b/editor/icons/source/icon_particles_shader.svg deleted file mode 100644 index b4c2ef7ccd..0000000000 --- a/editor/icons/source/icon_particles_shader.svg +++ /dev/null @@ -1,159 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://creativecommons.org/ns#" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="16" - height="16" - viewBox="0 0 16 16" - id="svg2" - version="1.1" - inkscape:version="0.91 r13725" - inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_node_2d.png" - inkscape:export-xdpi="90" - inkscape:export-ydpi="90" - sodipodi:docname="icon_particles_shader.svg"> - <defs - id="defs4"> - <clipPath - clipPathUnits="userSpaceOnUse" - id="clipPath4253"> - <path - style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - d="m 16.458984,1024.37 a 12.000027,12.000027 0 0 0 -3.564453,0.4004 12.000027,12.000027 0 0 0 -8.4863279,14.6973 12.000027,12.000027 0 0 0 14.6972659,8.4863 12.000027,12.000027 0 0 0 8.486328,-14.6973 12.000027,12.000027 0 0 0 -11.132813,-8.8867 z M 16.25,1029.8212 a 6.5451717,6.5451717 0 0 1 6.072266,4.8476 6.5451717,6.5451717 0 0 1 -4.628907,8.0157 6.5451717,6.5451717 0 0 1 -8.0156246,-4.6289 6.5451717,6.5451717 0 0 1 4.6289066,-8.0157 6.5451717,6.5451717 0 0 1 1.943359,-0.2187 z" - id="path4255" - inkscape:connector-curvature="0" /> - </clipPath> - <clipPath - clipPathUnits="userSpaceOnUse" - id="clipPath4199"> - <path - inkscape:connector-curvature="0" - id="path4201" - d="m 16.5,1025.8622 a 11.8125,10.499999 0 0 0 -11.8125001,10.5 11.8125,10.499999 0 0 0 11.8125001,10.5 11.8125,10.499999 0 0 0 11.8125,-10.5 11.8125,10.499999 0 0 0 -11.8125,-10.5 z m -3.375,3 a 3.375,2.9999997 0 0 1 3.375,3 3.375,2.9999997 0 0 1 -3.375,3 3.375,2.9999997 0 0 1 -3.3750001,-3 3.375,2.9999997 0 0 1 3.3750001,-3 z" - style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> - </clipPath> - <clipPath - clipPathUnits="userSpaceOnUse" - id="clipPath4208"> - <path - style="opacity:1;fill:#a5b7f5;fill-opacity:0.98823529;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843" - d="M 8,1037.3622 A 4.4999948,4.9999847 0 0 0 3.5859375,1041.3934 3,3 0 0 0 1,1044.3622 a 3,3 0 0 0 3,3 l 8,0 a 3,3 0 0 0 3,-3 3,3 0 0 0 -2.589844,-2.9668 A 4.4999948,4.9999847 0 0 0 8,1037.3622 Z m -4,11 a 1,1 0 0 0 -1,1 1,1 0 0 0 1,1 1,1 0 0 0 1,-1 1,1 0 0 0 -1,-1 z m 8,0 a 1,1 0 0 0 -1,1 1,1 0 0 0 1,1 1,1 0 0 0 1,-1 1,1 0 0 0 -1,-1 z m -4,1 a 1,1 0 0 0 -1,1 1,1 0 0 0 1,1 1,1 0 0 0 1,-1 1,1 0 0 0 -1,-1 z" - id="path4210" - inkscape:connector-curvature="0" /> - </clipPath> - </defs> - <sodipodi:namedview - id="base" - pagecolor="#ffffff" - bordercolor="#666666" - borderopacity="1.0" - inkscape:pageopacity="0.0" - inkscape:pageshadow="2" - inkscape:zoom="15.999999" - inkscape:cx="8.2922739" - inkscape:cy="6.6952763" - inkscape:document-units="px" - inkscape:current-layer="layer1" - showgrid="true" - units="px" - inkscape:snap-bbox="true" - inkscape:bbox-paths="true" - inkscape:bbox-nodes="true" - inkscape:snap-bbox-edge-midpoints="true" - inkscape:snap-bbox-midpoints="true" - inkscape:snap-object-midpoints="true" - inkscape:snap-center="true" - inkscape:window-width="1920" - inkscape:window-height="1016" - inkscape:window-x="0" - inkscape:window-y="27" - inkscape:window-maximized="1" - inkscape:object-paths="true" - inkscape:snap-intersection-paths="true" - inkscape:object-nodes="true" - inkscape:snap-smooth-nodes="true"> - <inkscape:grid - type="xygrid" - id="grid3336" - empspacing="4" /> - </sodipodi:namedview> - <metadata - id="metadata7"> - <rdf:RDF> - <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title></dc:title> - </cc:Work> - </rdf:RDF> - </metadata> - <g - inkscape:label="Layer 1" - inkscape:groupmode="layer" - id="layer1" - transform="translate(0,-1036.3622)"> - <g - id="g4271" - clip-path="url(#clipPath4208)" - transform="translate(0,1.8694115e-5)"> - <rect - y="1037.3622" - x="0" - height="2.0000031" - width="16" - id="rect4159" - style="fill:#ff7070;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="fill:#ffeb70;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect4161" - width="16" - height="2.0000029" - x="0" - y="1039.3622" /> - <rect - style="fill:#9dff70;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect4163" - width="16" - height="1.9999999" - x="0" - y="1041.3622" /> - <rect - y="1043.3622" - x="0" - height="2.0000024" - width="16" - id="rect4165" - style="fill:#70ffb9;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - y="1045.3622" - x="0" - height="2.0000021" - width="16" - id="rect4167" - style="fill:#70deff;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="fill:#ff70ac;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect4169" - width="16" - height="1.9999987" - x="0" - y="1049.3622" /> - <rect - style="fill:#9f70ff;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect4146" - width="16" - height="2.0000021" - x="0" - y="1047.3622" /> - </g> - </g> -</svg> diff --git a/editor/icons/source/icon_patch_9_rect.svg b/editor/icons/source/icon_patch_9_rect.svg deleted file mode 100644 index c5a09603a6..0000000000 --- a/editor/icons/source/icon_patch_9_rect.svg +++ /dev/null @@ -1,130 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://creativecommons.org/ns#" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="16" - height="16" - viewBox="0 0 16 16" - id="svg2" - version="1.1" - inkscape:version="0.91 r13725" - inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_center_container.png" - inkscape:export-xdpi="90" - inkscape:export-ydpi="90" - sodipodi:docname="icon_patch_9_rect.svg"> - <defs - id="defs4" /> - <sodipodi:namedview - id="base" - pagecolor="#ffffff" - bordercolor="#666666" - borderopacity="1.0" - inkscape:pageopacity="0.0" - inkscape:pageshadow="2" - inkscape:zoom="32" - inkscape:cx="10.35114" - inkscape:cy="9.1140348" - inkscape:document-units="px" - inkscape:current-layer="layer1" - showgrid="true" - units="px" - inkscape:snap-bbox="true" - inkscape:bbox-paths="true" - inkscape:bbox-nodes="true" - inkscape:snap-bbox-edge-midpoints="true" - inkscape:snap-bbox-midpoints="true" - inkscape:snap-object-midpoints="true" - inkscape:snap-center="true" - inkscape:window-width="1920" - inkscape:window-height="1016" - inkscape:window-x="0" - inkscape:window-y="27" - inkscape:window-maximized="1"> - <inkscape:grid - type="xygrid" - id="grid3336" /> - </sodipodi:namedview> - <metadata - id="metadata7"> - <rdf:RDF> - <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title /> - </cc:Work> - </rdf:RDF> - </metadata> - <g - inkscape:label="Layer 1" - inkscape:groupmode="layer" - id="layer1" - transform="translate(0,-1036.3622)"> - <rect - style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect4154" - width="1" - height="14" - x="1" - y="1037.3622" /> - <rect - y="1050.3622" - x="1" - height="0.9999826" - width="14" - id="rect4156" - style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect4158" - width="14" - height="0.9999826" - x="1" - y="1037.3622" /> - <rect - y="1037.3622" - x="14" - height="14" - width="1" - id="rect4160" - style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> - <rect - y="1040.3622" - x="1" - height="0.9999826" - width="14" - id="rect4162" - style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect4164" - width="14" - height="0.9999826" - x="1" - y="1047.3622" /> - <rect - style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect4166" - width="14" - height="0.9999826" - x="1037.3622" - y="-5" - transform="matrix(0,1,-1,0,0,0)" /> - <rect - transform="matrix(0,1,-1,0,0,0)" - y="-12" - x="1037.3622" - height="0.9999826" - width="14" - id="rect4168" - style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> - </g> -</svg> diff --git a/editor/icons/source/icon_sample_player.svg b/editor/icons/source/icon_plane_mesh.svg index 2254718a9b..5273900606 100644 --- a/editor/icons/source/icon_sample_player.svg +++ b/editor/icons/source/icon_plane_mesh.svg @@ -14,11 +14,11 @@ viewBox="0 0 16 16" id="svg2" version="1.1" - inkscape:version="0.91 r13725" + inkscape:version="0.92+devel unknown" inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_node_2d.png" inkscape:export-xdpi="90" inkscape:export-ydpi="90" - sodipodi:docname="icon_sample_player.svg"> + sodipodi:docname="icon_quad_mesh.svg"> <defs id="defs4" /> <sodipodi:namedview @@ -29,8 +29,8 @@ inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="31.999999" - inkscape:cx="10.445016" - inkscape:cy="6.2884774" + inkscape:cx="13.201653" + inkscape:cy="9.702363" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="true" @@ -46,7 +46,8 @@ inkscape:window-height="1016" inkscape:window-x="0" inkscape:window-y="27" - inkscape:window-maximized="1"> + inkscape:window-maximized="1" + inkscape:document-rotation="0"> <inkscape:grid type="xygrid" id="grid3336" @@ -60,7 +61,7 @@ <dc:format>image/svg+xml</dc:format> <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title></dc:title> + <dc:title /> </cc:Work> </rdf:RDF> </metadata> @@ -70,9 +71,9 @@ id="layer1" transform="translate(0,-1036.3622)"> <path - style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843" - d="M 8 1 L 4 6 L 1 6 L 1 10 L 4 10 L 8 15 L 8 1 z M 13 3 L 13 13 L 14 13 L 14 3 L 13 3 z M 10 6 L 10 11 L 11 11 L 11 6 L 10 6 z " - transform="translate(0,1036.3622)" - id="rect4154" /> + style="fill:none;stroke:#ffd684;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none" + d="m 2,1048.3622 h 12 l -3,-8 H 5 Z" + id="path4266" + inkscape:connector-curvature="0" /> </g> </svg> diff --git a/editor/icons/source/icon_play_button_group.svg b/editor/icons/source/icon_play_button_group.svg deleted file mode 100644 index 84bdb00505..0000000000 --- a/editor/icons/source/icon_play_button_group.svg +++ /dev/null @@ -1,78 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://creativecommons.org/ns#" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="32" - height="32" - viewBox="0 0 32 31.999998" - id="svg2" - version="1.1" - inkscape:version="0.92.1 r" - sodipodi:docname="button_group.svg" - inkscape:export-filename="/home/djrm/Projects/godot/scene/resources/default_theme/button_disabled.png" - inkscape:export-xdpi="90" - inkscape:export-ydpi="90"> - <defs - id="defs4" /> - <sodipodi:namedview - id="base" - pagecolor="#ffffff" - bordercolor="#666666" - borderopacity="1.0" - inkscape:pageopacity="0.0" - inkscape:pageshadow="2" - inkscape:zoom="16" - inkscape:cx="15.144473" - inkscape:cy="14.499068" - inkscape:document-units="px" - inkscape:current-layer="layer1" - showgrid="true" - units="px" - inkscape:object-paths="false" - inkscape:snap-intersection-paths="false" - inkscape:snap-bbox="true" - inkscape:bbox-paths="true" - inkscape:bbox-nodes="true" - inkscape:snap-bbox-edge-midpoints="true" - inkscape:window-width="1600" - inkscape:window-height="836" - inkscape:window-x="0" - inkscape:window-y="27" - inkscape:window-maximized="1"> - <inkscape:grid - type="xygrid" - id="grid4136" - empspacing="4" /> - </sodipodi:namedview> - <metadata - id="metadata7"> - <rdf:RDF> - <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title></dc:title> - </cc:Work> - </rdf:RDF> - </metadata> - <g - inkscape:label="Layer 1" - inkscape:groupmode="layer" - id="layer1" - transform="translate(0,-1020.3623)"> - <circle - style="fill:#000000;fill-opacity:0.19607843;stroke:none;stroke-width:2.54545379;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="path4503" - cx="16" - cy="1036.3623" - r="13.999995" /> - </g> -</svg> diff --git a/editor/icons/source/icon_prism_mesh.svg b/editor/icons/source/icon_prism_mesh.svg new file mode 100644 index 0000000000..310d8f1a28 --- /dev/null +++ b/editor/icons/source/icon_prism_mesh.svg @@ -0,0 +1,79 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="16" + height="16" + viewBox="0 0 16 16" + id="svg2" + version="1.1" + inkscape:version="0.92+devel unknown" + inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_node_2d.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" + sodipodi:docname="icon_prism_mesh.svg"> + <defs + id="defs4" /> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="31.999999" + inkscape:cx="9.3129802" + inkscape:cy="9.9193702" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="true" + units="px" + inkscape:snap-bbox="true" + inkscape:bbox-paths="true" + inkscape:bbox-nodes="true" + inkscape:snap-bbox-edge-midpoints="true" + inkscape:snap-bbox-midpoints="true" + inkscape:snap-object-midpoints="true" + inkscape:snap-center="true" + inkscape:window-width="1920" + inkscape:window-height="1016" + inkscape:window-x="0" + inkscape:window-y="27" + inkscape:window-maximized="1" + inkscape:document-rotation="0"> + <inkscape:grid + type="xygrid" + id="grid3336" + empspacing="4" /> + </sodipodi:namedview> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1" + transform="translate(0,-1036.3622)"> + <path + style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-variant-east-asian:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#ffd684;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;filter-blend-mode:normal;filter-gaussianBlur-deviation:0;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate;opacity:1" + d="M 7.9824219 1.0019531 A 1.0001 1.0001 0 0 0 7.1679688 1.4453125 L 1.1953125 10.40625 L 1.1679688 10.445312 A 1 1 0 0 0 1.1054688 10.552734 A 1 1 0 0 0 1.5527344 11.894531 L 7.5527344 14.894531 A 1.0001 1.0001 0 0 0 8.4472656 14.894531 L 14.447266 11.894531 A 1 1 0 0 0 14.894531 10.552734 A 1 1 0 0 0 14.832031 10.445312 L 8.8320312 1.4453125 A 1.0001 1.0001 0 0 0 7.9824219 1.0019531 z M 7 5.3027344 L 7 12.382812 L 3.4609375 10.611328 L 7 5.3027344 z M 9 5.3027344 L 12.539062 10.611328 L 9 12.382812 L 9 5.3027344 z " + transform="translate(0,1036.3622)" + id="path4309" /> + </g> +</svg> diff --git a/editor/icons/source/icon_procedural_sky.svg b/editor/icons/source/icon_procedural_sky.svg new file mode 100644 index 0000000000..97162f3efa --- /dev/null +++ b/editor/icons/source/icon_procedural_sky.svg @@ -0,0 +1,129 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="16" + height="16" + viewBox="0 0 16 16" + id="svg2" + version="1.1" + inkscape:version="0.92+devel unknown" + inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_confirmation_dialog.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" + sodipodi:docname="icon_procedural_sky.svg"> + <defs + id="defs4"> + <linearGradient + inkscape:collect="always" + id="linearGradient4291"> + <stop + style="stop-color:#1ec3ff;stop-opacity:1" + offset="0" + id="stop4287" /> + <stop + style="stop-color:#b2e1ff;stop-opacity:1" + offset="1" + id="stop4289" /> + </linearGradient> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient4291" + id="linearGradient4303" + x1="8" + y1="1040.3622" + x2="8" + y2="1050.3622" + gradientUnits="userSpaceOnUse" /> + </defs> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="45.254834" + inkscape:cx="12.704839" + inkscape:cy="7.3549048" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="true" + units="px" + inkscape:snap-bbox="true" + inkscape:bbox-paths="true" + inkscape:bbox-nodes="true" + inkscape:snap-bbox-edge-midpoints="true" + inkscape:snap-bbox-midpoints="true" + inkscape:snap-object-midpoints="true" + inkscape:snap-center="true" + inkscape:window-width="1920" + inkscape:window-height="1016" + inkscape:window-x="0" + inkscape:window-y="27" + inkscape:window-maximized="1" + inkscape:document-rotation="0"> + <inkscape:grid + type="xygrid" + id="grid3336" + originx="0" + originy="0" + spacingx="1" + spacingy="1" /> + </sodipodi:namedview> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1" + transform="translate(0,-1037.3622)"> + <path + style="fill:url(#linearGradient4303);fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:0.3254902" + d="m 8,1040.3622 a 7,7 0 0 0 -7,7 7,7 0 0 0 0.6855469,3 H 14.316406 a 7,7 0 0 0 0.683594,-3 7,7 0 0 0 -7,-7 z" + id="path4292" + inkscape:connector-curvature="0" /> + <rect + style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:0.3254902" + id="rect4305" + width="3" + height="2" + x="2" + y="1047.3622" + ry="1" /> + <rect + style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:0.3254902" + id="rect4307" + width="4" + height="2" + x="7" + y="1045.3622" + ry="1" /> + <rect + style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:square;stroke-linejoin:round;stroke-opacity:0.3254902" + id="rect4309" + width="4" + height="2" + x="9" + y="1044.3622" + ry="1" /> + </g> +</svg> diff --git a/editor/icons/source/icon_quad_mesh.svg b/editor/icons/source/icon_quad_mesh.svg new file mode 100644 index 0000000000..f511dd8a12 --- /dev/null +++ b/editor/icons/source/icon_quad_mesh.svg @@ -0,0 +1,79 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="16" + height="16" + viewBox="0 0 16 16" + id="svg2" + version="1.1" + inkscape:version="0.92+devel unknown" + inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_node_2d.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" + sodipodi:docname="icon_quad_mesh.svg"> + <defs + id="defs4" /> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="31.999999" + inkscape:cx="11.701653" + inkscape:cy="9.702363" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="true" + units="px" + inkscape:snap-bbox="true" + inkscape:bbox-paths="true" + inkscape:bbox-nodes="true" + inkscape:snap-bbox-edge-midpoints="true" + inkscape:snap-bbox-midpoints="true" + inkscape:snap-object-midpoints="true" + inkscape:snap-center="true" + inkscape:window-width="1920" + inkscape:window-height="1016" + inkscape:window-x="0" + inkscape:window-y="27" + inkscape:window-maximized="1" + inkscape:document-rotation="0"> + <inkscape:grid + type="xygrid" + id="grid3336" + empspacing="4" /> + </sodipodi:namedview> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title /> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1" + transform="translate(0,-1036.3622)"> + <path + style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-variant-east-asian:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#ffd684;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" + d="m 15,1037.3622 v 1 13 H 1 v -14 z m -2,2 H 4.414062 L 13,1047.9481 Z m -10,1.4141 v 8.5859 h 8.585938 z" + id="path4276" + inkscape:connector-curvature="0" /> + </g> +</svg> diff --git a/editor/icons/source/icon_reference_rect.svg b/editor/icons/source/icon_reference_rect.svg index cee814360d..ace9a48a23 100644 --- a/editor/icons/source/icon_reference_rect.svg +++ b/editor/icons/source/icon_reference_rect.svg @@ -14,7 +14,7 @@ viewBox="0 0 16 16" id="svg2" version="1.1" - inkscape:version="0.91 r13725" + inkscape:version="0.92.1 r" inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_center_container.png" inkscape:export-xdpi="90" inkscape:export-ydpi="90" @@ -29,8 +29,8 @@ inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="32" - inkscape:cx="4.94489" - inkscape:cy="9.0515348" + inkscape:cx="8.97614" + inkscape:cy="8.6140348" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="true" @@ -42,8 +42,8 @@ inkscape:snap-bbox-midpoints="true" inkscape:snap-object-midpoints="true" inkscape:snap-center="true" - inkscape:window-width="1920" - inkscape:window-height="1016" + inkscape:window-width="1600" + inkscape:window-height="836" inkscape:window-x="0" inkscape:window-y="27" inkscape:window-maximized="1"> @@ -59,7 +59,7 @@ <dc:format>image/svg+xml</dc:format> <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title></dc:title> + <dc:title /> </cc:Work> </rdf:RDF> </metadata> @@ -69,32 +69,62 @@ id="layer1" transform="translate(0,-1036.3622)"> <rect - style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect4154" - width="1" - height="14" + style="fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:0;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.99607843" + id="rect817" + width="2" + height="2" x="1" y="1037.3622" /> <rect - y="1050.3622" - x="1" - height="0.9999826" - width="14" - id="rect4156" - style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + y="1037.3622" + x="13" + height="2" + width="2" + id="rect819" + style="fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:0;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.99607843" /> <rect - style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect4158" - width="14" - height="0.9999826" - x="1" + style="fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:0;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.99607843" + id="rect821" + width="8" + height="2" + x="4" y="1037.3622" /> <rect - y="1037.3622" - x="14" - height="14" - width="1" - id="rect4160" - style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + y="1049.3622" + x="4" + height="2" + width="8" + id="rect823" + style="fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:0;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.99607843" /> + <rect + style="fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:0;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.99607843" + id="rect825" + width="2" + height="2" + x="13" + y="1049.3622" /> + <rect + y="1049.3622" + x="1" + height="2" + width="2" + id="rect827" + style="fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:0;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.99607843" /> + <rect + style="fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:0;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.99607843" + id="rect829" + width="8" + height="2" + x="1040.3622" + y="-3" + transform="rotate(90)" /> + <rect + transform="rotate(90)" + y="-15" + x="1040.3622" + height="2" + width="8" + id="rect831" + style="fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:0;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.99607843" /> </g> </svg> diff --git a/editor/icons/source/icon_remote_transform.svg b/editor/icons/source/icon_remote_transform.svg index fbbfacf629..814384297e 100644 --- a/editor/icons/source/icon_remote_transform.svg +++ b/editor/icons/source/icon_remote_transform.svg @@ -14,7 +14,7 @@ viewBox="0 0 16 16" id="svg2" version="1.1" - inkscape:version="0.91 r13725" + inkscape:version="0.92.1 r" inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_node_2d.png" inkscape:export-xdpi="90" inkscape:export-ydpi="90" @@ -29,8 +29,8 @@ inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="16" - inkscape:cx="7.0691739" - inkscape:cy="9.3738931" + inkscape:cx="10.542126" + inkscape:cy="9.6951879" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="true" @@ -42,10 +42,10 @@ inkscape:snap-bbox-midpoints="true" inkscape:snap-object-midpoints="true" inkscape:snap-center="true" - inkscape:window-width="1680" - inkscape:window-height="1050" - inkscape:window-x="1366" - inkscape:window-y="0" + inkscape:window-width="1600" + inkscape:window-height="836" + inkscape:window-x="0" + inkscape:window-y="27" inkscape:window-maximized="1" inkscape:object-paths="true" inkscape:snap-intersection-paths="true" @@ -64,7 +64,7 @@ <dc:format>image/svg+xml</dc:format> <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title></dc:title> + <dc:title /> </cc:Work> </rdf:RDF> </metadata> @@ -74,51 +74,53 @@ id="layer1" transform="translate(0,-1036.3622)"> <path - style="opacity:1;fill:#fc9c9c;fill-opacity:0.99607843;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="path4155" + style="fill:#fc9c9c;fill-opacity:1;stroke:none;stroke-width:2.66666675;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="path834" sodipodi:type="arc" - sodipodi:cx="744.13245" - sodipodi:cy="734.23291" + sodipodi:cx="8" + sodipodi:cy="1047.3622" sodipodi:rx="4" sodipodi:ry="4" sodipodi:start="0" sodipodi:end="3.1415927" - d="m 748.13245,734.23291 a 4,4 0 0 1 -2,3.4641 4,4 0 0 1 -4,0 4,4 0 0 1 -2,-3.4641 l 4,0 z" - inkscape:transform-center-y="0.58575321" - transform="matrix(0.70710678,0.70710678,-0.70710678,0.70710678,0,0)" - inkscape:transform-center-x="0.58575732" /> - <circle - style="opacity:1;fill:#fc9c9c;fill-opacity:0.99607843;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="path4159" - cx="7" - cy="1045.3622" - r="1" /> - <path - style="opacity:1;fill:#fc9c9c;fill-opacity:0.99607843;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - d="m 13.242641,1039.1196 a 6.0000172,6.0000172 0 0 0 -8.4852817,0 l 0.7071068,0.7071 a 5.0000172,5.0000172 0 0 1 7.0710679,0 5.0000172,5.0000172 0 0 1 0,7.071 l 0.707107,0.7071 a 6.0000172,6.0000172 0 0 0 0,-8.4852 z" - id="circle4163" - inkscape:connector-curvature="0" - inkscape:transform-center-y="-0.87867618" - inkscape:transform-center-x="-0.8786559" /> + d="m 12,1047.3622 a 4,4 0 0 1 -2.0000001,3.4641 4,4 0 0 1 -4,0 A 4,4 0 0 1 4,1047.3622 l 4,0 z" /> + <rect + style="fill:#fc9c9c;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect836" + width="2" + height="4" + x="7" + y="1045.3622" + ry="1" /> <path - style="opacity:1;fill:#fc9c9c;fill-opacity:0.99607843;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - d="m 11.828427,1040.5338 a 4.0000172,4.0000172 0 0 0 -5.6568541,0 l 0.7071068,0.7071 a 3.0000174,3.0000174 0 0 1 4.2426403,0 3.0000174,3.0000174 0 0 1 0,4.2426 l 0.707107,0.7071 a 4.0000172,4.0000172 0 0 0 0,-5.6568 z" - id="circle4168" - inkscape:connector-curvature="0" - inkscape:transform-center-y="-0.58578284" - inkscape:transform-center-x="-0.58576926" /> + style="fill:none;fill-opacity:1;stroke:#fc9c9c;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="path838" + sodipodi:type="arc" + sodipodi:cx="8" + sodipodi:cy="1045.3622" + sodipodi:rx="7.0000172" + sodipodi:ry="7.0000172" + sodipodi:start="3.6651914" + sodipodi:end="5.7595865" + d="m 1.9378072,1041.8622 a 7.0000172,7.0000172 0 0 1 6.0621926,-3.5 7.0000172,7.0000172 0 0 1 6.0621932,3.5" + sodipodi:open="true" /> <path - style="opacity:1;fill:#fc9c9c;fill-opacity:0.99607843;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - d="m 10.414214,1041.948 a 2,2 0 0 0 -2.8284276,0 l 0.7071068,0.7071 a 1.0000174,1.0000174 0 0 1 1.4142136,0 1.0000174,1.0000174 0 0 1 0,1.4142 l 0.7071072,0.7071 a 2,2 0 0 0 0,-2.8284 z" - id="circle4172" - inkscape:connector-curvature="0" - inkscape:transform-center-y="-0.29289334" - inkscape:transform-center-x="-0.29288664" /> + r="3.645746" + cy="1045.3622" + cx="8" + id="path846" + style="fill:#fc9c9c;fill-opacity:1;stroke:#000000;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> <path - style="fill:#fc9c9c;fill-opacity:0.99607843;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="m 1,1051.3622 4,-5 1,0 0,5 z" - id="path4181" - inkscape:connector-curvature="0" - sodipodi:nodetypes="ccccc" /> + id="circle848" + style="fill:none;fill-opacity:1;stroke:#fc9c9c;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + sodipodi:type="arc" + sodipodi:cx="8" + sodipodi:cy="1045.3622" + sodipodi:rx="2.9999826" + sodipodi:ry="2.9999826" + sodipodi:start="3.403392" + sodipodi:end="6.0213859" + d="m 5.1022393,1044.5857 a 2.9999826,2.9999826 0 0 1 2.8977606,-2.2235 2.9999826,2.9999826 0 0 1 2.8977611,2.2235" + sodipodi:open="true" /> </g> </svg> diff --git a/editor/icons/source/icon_remote_transform_2d.svg b/editor/icons/source/icon_remote_transform_2d.svg index 479cc0eb25..7976937a17 100644 --- a/editor/icons/source/icon_remote_transform_2d.svg +++ b/editor/icons/source/icon_remote_transform_2d.svg @@ -14,11 +14,11 @@ viewBox="0 0 16 16" id="svg2" version="1.1" - inkscape:version="0.91 r13725" + inkscape:version="0.92.1 r" inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_node_2d.png" inkscape:export-xdpi="90" inkscape:export-ydpi="90" - sodipodi:docname="icon_remote_transform.svg"> + sodipodi:docname="icon_remote_transform_2d.svg"> <defs id="defs4" /> <sodipodi:namedview @@ -29,8 +29,8 @@ inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="16" - inkscape:cx="6.9441739" - inkscape:cy="9.4988931" + inkscape:cx="-4.711526" + inkscape:cy="5.1371642" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="true" @@ -42,8 +42,8 @@ inkscape:snap-bbox-midpoints="true" inkscape:snap-object-midpoints="true" inkscape:snap-center="true" - inkscape:window-width="1920" - inkscape:window-height="1016" + inkscape:window-width="1600" + inkscape:window-height="836" inkscape:window-x="0" inkscape:window-y="27" inkscape:window-maximized="1" @@ -64,7 +64,7 @@ <dc:format>image/svg+xml</dc:format> <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title></dc:title> + <dc:title /> </cc:Work> </rdf:RDF> </metadata> @@ -74,51 +74,47 @@ id="layer1" transform="translate(0,-1036.3622)"> <path - style="opacity:1;fill:#a5b7f6;fill-opacity:0.98823529;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="path4155" + style="fill:#a5b7f7;fill-opacity:0.98823529;stroke:none;stroke-width:2.66666675;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="path834" sodipodi:type="arc" - sodipodi:cx="744.13245" - sodipodi:cy="734.23291" + sodipodi:cx="8" + sodipodi:cy="1047.3622" sodipodi:rx="4" sodipodi:ry="4" sodipodi:start="0" sodipodi:end="3.1415927" - d="m 748.13245,734.23291 a 4,4 0 0 1 -2,3.4641 4,4 0 0 1 -4,0 4,4 0 0 1 -2,-3.4641 l 4,0 z" - inkscape:transform-center-y="0.58575321" - transform="matrix(0.70710678,0.70710678,-0.70710678,0.70710678,0,0)" - inkscape:transform-center-x="0.58575732" /> - <circle - style="opacity:1;fill:#a5b7f6;fill-opacity:0.98823529;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="path4159" - cx="7" - cy="1045.3622" - r="1" /> + d="m 12,1047.3622 a 4,4 0 0 1 -2.0000001,3.4641 4,4 0 0 1 -4,0 A 4,4 0 0 1 4,1047.3622 l 4,0 z" /> + <rect + style="fill:#a5b7f7;fill-opacity:0.98823529;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect836" + width="2" + height="4" + x="7" + y="1045.3622" + ry="1" /> <path - style="opacity:1;fill:#a5b7f6;fill-opacity:0.98823529;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - d="m 13.242641,1039.1196 a 6.0000172,6.0000172 0 0 0 -8.4852817,0 l 0.7071068,0.7071 a 5.0000172,5.0000172 0 0 1 7.0710679,0 5.0000172,5.0000172 0 0 1 0,7.071 l 0.707107,0.7071 a 6.0000172,6.0000172 0 0 0 0,-8.4852 z" - id="circle4163" - inkscape:connector-curvature="0" - inkscape:transform-center-y="-0.87867618" - inkscape:transform-center-x="-0.8786559" /> - <path - style="opacity:1;fill:#a5b7f6;fill-opacity:0.98823529;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - d="m 11.828427,1040.5338 a 4.0000172,4.0000172 0 0 0 -5.6568541,0 l 0.7071068,0.7071 a 3.0000174,3.0000174 0 0 1 4.2426403,0 3.0000174,3.0000174 0 0 1 0,4.2426 l 0.707107,0.7071 a 4.0000172,4.0000172 0 0 0 0,-5.6568 z" - id="circle4168" - inkscape:connector-curvature="0" - inkscape:transform-center-y="-0.58578284" - inkscape:transform-center-x="-0.58576926" /> - <path - style="opacity:1;fill:#a5b7f6;fill-opacity:0.98823529;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - d="m 10.414214,1041.948 a 2,2 0 0 0 -2.8284276,0 l 0.7071068,0.7071 a 1.0000174,1.0000174 0 0 1 1.4142136,0 1.0000174,1.0000174 0 0 1 0,1.4142 l 0.7071072,0.7071 a 2,2 0 0 0 0,-2.8284 z" - id="circle4172" - inkscape:connector-curvature="0" - inkscape:transform-center-y="-0.29289334" - inkscape:transform-center-x="-0.29288664" /> + style="fill:none;fill-opacity:1;stroke:#a5b7f7;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="path838" + sodipodi:type="arc" + sodipodi:cx="8" + sodipodi:cy="1045.3622" + sodipodi:rx="7.0000172" + sodipodi:ry="7.0000172" + sodipodi:start="3.6651914" + sodipodi:end="5.7595865" + d="m 1.9378072,1041.8622 a 7.0000172,7.0000172 0 0 1 6.0621926,-3.5 7.0000172,7.0000172 0 0 1 6.0621932,3.5" + sodipodi:open="true" /> <path - style="fill:#a5b7f6;fill-opacity:0.98823529;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="m 1,1051.3622 4,-5 1,0 0,5 z" - id="path4181" - inkscape:connector-curvature="0" - sodipodi:nodetypes="ccccc" /> + id="circle848" + style="fill:none;fill-opacity:1;stroke:#a5b7f7;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + sodipodi:type="arc" + sodipodi:cx="8" + sodipodi:cy="1045.3622" + sodipodi:rx="2.9999826" + sodipodi:ry="2.9999826" + sodipodi:start="3.403392" + sodipodi:end="6.0213859" + d="m 5.1022393,1044.5857 a 2.9999826,2.9999826 0 0 1 2.8977606,-2.2235 2.9999826,2.9999826 0 0 1 2.8977611,2.2235" + sodipodi:open="true" /> </g> </svg> diff --git a/editor/icons/source/icon_sample.svg b/editor/icons/source/icon_sample.svg deleted file mode 100644 index 782e07a012..0000000000 --- a/editor/icons/source/icon_sample.svg +++ /dev/null @@ -1,128 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://creativecommons.org/ns#" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="16" - height="16" - viewBox="0 0 16 16" - id="svg2" - version="1.1" - inkscape:version="0.91 r13725" - inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_dependency_changed_hl.png" - inkscape:export-xdpi="45" - inkscape:export-ydpi="45" - sodipodi:docname="icon_sample.svg"> - <defs - id="defs4" /> - <sodipodi:namedview - id="base" - pagecolor="#ffffff" - bordercolor="#666666" - borderopacity="1.0" - inkscape:pageopacity="0.0" - inkscape:pageshadow="2" - inkscape:zoom="30.700696" - inkscape:cx="10.421269" - inkscape:cy="6.7982798" - inkscape:document-units="px" - inkscape:current-layer="layer1" - showgrid="true" - units="px" - inkscape:snap-bbox="true" - inkscape:bbox-paths="true" - inkscape:bbox-nodes="true" - inkscape:snap-bbox-edge-midpoints="true" - inkscape:snap-bbox-midpoints="false" - inkscape:snap-object-midpoints="true" - inkscape:snap-center="true" - inkscape:window-width="1920" - inkscape:window-height="1016" - inkscape:window-x="0" - inkscape:window-y="27" - inkscape:window-maximized="1"> - <inkscape:grid - type="xygrid" - id="grid3336" /> - </sodipodi:namedview> - <metadata - id="metadata7"> - <rdf:RDF> - <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title></dc:title> - </cc:Work> - </rdf:RDF> - </metadata> - <g - inkscape:label="Layer 1" - inkscape:groupmode="layer" - id="layer1" - transform="translate(0,-1036.3622)"> - <rect - style="opacity:1;fill:#ff8484;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843" - id="rect4156" - width="1" - height="1.999948" - x="-14" - y="1043.3622" - transform="scale(-1,1)" /> - <rect - y="1039.3622" - x="-12" - height="10.000017" - width="1" - id="rect4158" - style="opacity:1;fill:#ff8484;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843" - transform="scale(-1,1)" /> - <rect - style="opacity:1;fill:#ff8484;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843" - id="rect4160" - width="1" - height="7.9999475" - x="-10" - y="1040.3622" - transform="scale(-1,1)" /> - <rect - y="1037.3622" - x="-8" - height="13.999949" - width="1" - id="rect4162" - style="opacity:1;fill:#ff8484;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843" - transform="scale(-1,1)" /> - <rect - style="opacity:1;fill:#ff8484;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843" - id="rect4164" - width="1" - height="12.000017" - x="-6" - y="1038.3622" - transform="scale(-1,1)" /> - <rect - y="1041.3622" - x="-4" - height="6.0000172" - width="1" - id="rect4166" - style="opacity:1;fill:#ff8484;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843" - transform="scale(-1,1)" /> - <rect - style="opacity:1;fill:#ff8484;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843" - id="rect4168" - width="1" - height="1.9999824" - x="-2" - y="1043.3622" - transform="scale(-1,1)" /> - </g> -</svg> diff --git a/editor/icons/source/icon_scroll_bg.svg b/editor/icons/source/icon_scroll_bg.svg deleted file mode 100644 index 29604b9e14..0000000000 --- a/editor/icons/source/icon_scroll_bg.svg +++ /dev/null @@ -1,71 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://creativecommons.org/ns#" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="12" - height="12" - viewBox="0 0 12 11.999999" - id="svg2" - version="1.1" - inkscape:version="0.92.1 r" - sodipodi:docname="scroll_bg.svg" - inkscape:export-filename="/home/djrm/Projects/godot/scene/resources/default_theme/panel_bg.png" - inkscape:export-xdpi="90" - inkscape:export-ydpi="90"> - <defs - id="defs4" /> - <sodipodi:namedview - id="base" - pagecolor="#ffffff" - bordercolor="#666666" - borderopacity="1.0" - inkscape:pageopacity="0.0" - inkscape:pageshadow="2" - inkscape:zoom="45.254836" - inkscape:cx="4.4464273" - inkscape:cy="6.9717582" - inkscape:document-units="px" - inkscape:current-layer="layer1" - showgrid="true" - units="px" - inkscape:object-paths="true" - inkscape:snap-intersection-paths="true" - inkscape:snap-bbox="true" - inkscape:bbox-paths="true" - inkscape:bbox-nodes="true" - inkscape:snap-bbox-edge-midpoints="true" - inkscape:window-width="1600" - inkscape:window-height="836" - inkscape:window-x="0" - inkscape:window-y="27" - inkscape:window-maximized="1"> - <inkscape:grid - type="xygrid" - id="grid4136" - empspacing="4" /> - </sodipodi:namedview> - <metadata - id="metadata7"> - <rdf:RDF> - <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title /> - </cc:Work> - </rdf:RDF> - </metadata> - <g - inkscape:label="Layer 1" - inkscape:groupmode="layer" - id="layer1" - transform="translate(0,-1040.3623)" /> -</svg> diff --git a/editor/icons/source/icon_scroll_grabber.svg b/editor/icons/source/icon_scroll_grabber.svg deleted file mode 100644 index b9d2bbbec0..0000000000 --- a/editor/icons/source/icon_scroll_grabber.svg +++ /dev/null @@ -1,78 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://creativecommons.org/ns#" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="12" - height="12" - viewBox="0 0 12 11.999999" - id="svg2" - version="1.1" - inkscape:version="0.92.1 r" - sodipodi:docname="scroll_grabber.svg" - inkscape:export-filename="/home/djrm/Projects/godot/scene/resources/default_theme/panel_bg.png" - inkscape:export-xdpi="90" - inkscape:export-ydpi="90"> - <defs - id="defs4" /> - <sodipodi:namedview - id="base" - pagecolor="#ffffff" - bordercolor="#666666" - borderopacity="1.0" - inkscape:pageopacity="0.0" - inkscape:pageshadow="2" - inkscape:zoom="45.254836" - inkscape:cx="1.3086411" - inkscape:cy="6.9275641" - inkscape:document-units="px" - inkscape:current-layer="layer1" - showgrid="true" - units="px" - inkscape:object-paths="true" - inkscape:snap-intersection-paths="true" - inkscape:snap-bbox="true" - inkscape:bbox-paths="true" - inkscape:bbox-nodes="true" - inkscape:snap-bbox-edge-midpoints="true" - inkscape:window-width="1600" - inkscape:window-height="836" - inkscape:window-x="0" - inkscape:window-y="27" - inkscape:window-maximized="1"> - <inkscape:grid - type="xygrid" - id="grid4136" - empspacing="4" /> - </sodipodi:namedview> - <metadata - id="metadata7"> - <rdf:RDF> - <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title /> - </cc:Work> - </rdf:RDF> - </metadata> - <g - inkscape:label="Layer 1" - inkscape:groupmode="layer" - id="layer1" - transform="translate(0,-1040.3623)"> - <circle - style="opacity:1;fill:#ffffff;fill-opacity:0.27450982;stroke:none;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="path4239" - cx="6" - cy="1046.3623" - r="2" /> - </g> -</svg> diff --git a/editor/icons/source/icon_scroll_grabber_hl.svg b/editor/icons/source/icon_scroll_grabber_hl.svg deleted file mode 100644 index ce9a66c5bc..0000000000 --- a/editor/icons/source/icon_scroll_grabber_hl.svg +++ /dev/null @@ -1,82 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://creativecommons.org/ns#" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="12" - height="12" - viewBox="0 0 12 11.999999" - id="svg2" - version="1.1" - inkscape:version="0.92.1 unknown" - sodipodi:docname="icon_scroll_grabber_hl.svg" - inkscape:export-filename="/mnt/2TB/Development/godot_dev/editor/icons/icon_scroll_grabber_hl.png" - inkscape:export-xdpi="90" - inkscape:export-ydpi="90"> - <defs - id="defs4" /> - <sodipodi:namedview - id="base" - pagecolor="#ffffff" - bordercolor="#666666" - borderopacity="1.0" - inkscape:pageopacity="0.0" - inkscape:pageshadow="2" - inkscape:zoom="45.254836" - inkscape:cx="3.0874565" - inkscape:cy="5.7564185" - inkscape:document-units="px" - inkscape:current-layer="layer1" - showgrid="true" - units="px" - inkscape:object-paths="true" - inkscape:snap-intersection-paths="true" - inkscape:snap-bbox="true" - inkscape:bbox-paths="true" - inkscape:bbox-nodes="true" - inkscape:snap-bbox-edge-midpoints="true" - inkscape:window-width="1097" - inkscape:window-height="1076" - inkscape:window-x="161" - inkscape:window-y="200" - inkscape:window-maximized="0" - inkscape:snap-nodes="false"> - <inkscape:grid - type="xygrid" - id="grid4136" - empspacing="4" /> - </sodipodi:namedview> - <metadata - id="metadata7"> - <rdf:RDF> - <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title></dc:title> - </cc:Work> - </rdf:RDF> - </metadata> - <g - inkscape:label="Layer 1" - inkscape:groupmode="layer" - id="layer1" - transform="translate(0,-1040.3623)"> - <circle - style="opacity:1;fill:#f9f9f9;fill-opacity:0.73000002;stroke:none;stroke-width:2.24999642;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="path4239" - cx="6" - cy="1046.3623" - r="2.9999952" - inkscape:export-filename="/mnt/2TB/Development/godot_dev/editor/icons/icon_scroll_grabber_hl.png" - inkscape:export-xdpi="96" - inkscape:export-ydpi="96" /> - </g> -</svg> diff --git a/editor/icons/source/icon_slider_grabber.svg b/editor/icons/source/icon_slider_grabber.svg deleted file mode 100644 index b13ca5d1a9..0000000000 --- a/editor/icons/source/icon_slider_grabber.svg +++ /dev/null @@ -1,80 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://creativecommons.org/ns#" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="16" - height="16" - viewBox="0 0 16 15.999999" - id="svg2" - version="1.1" - inkscape:version="0.92.1 unknown" - sodipodi:docname="icon_slider_grabber.svg" - inkscape:export-filename="/home/djrm/Projects/godot/scene/resources/default_theme/checked.png" - inkscape:export-xdpi="90" - inkscape:export-ydpi="90"> - <defs - id="defs4" /> - <sodipodi:namedview - id="base" - pagecolor="#ffffff" - bordercolor="#666666" - borderopacity="1.0" - inkscape:pageopacity="0.0" - inkscape:pageshadow="2" - inkscape:zoom="32" - inkscape:cx="3.7828436" - inkscape:cy="7.4986644" - inkscape:document-units="px" - inkscape:current-layer="layer1" - showgrid="true" - units="px" - inkscape:object-paths="false" - inkscape:snap-intersection-paths="false" - inkscape:snap-bbox="true" - inkscape:bbox-paths="true" - inkscape:bbox-nodes="true" - inkscape:snap-bbox-edge-midpoints="true" - inkscape:window-width="1195" - inkscape:window-height="722" - inkscape:window-x="91" - inkscape:window-y="633" - inkscape:window-maximized="0" - inkscape:snap-smooth-nodes="true" - inkscape:object-nodes="true"> - <inkscape:grid - type="xygrid" - id="grid4136" - empspacing="4" /> - </sodipodi:namedview> - <metadata - id="metadata7"> - <rdf:RDF> - <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title></dc:title> - </cc:Work> - </rdf:RDF> - </metadata> - <g - inkscape:label="Layer 1" - inkscape:groupmode="layer" - id="layer1" - transform="translate(0,-1036.3623)"> - <circle - r="6.9999943" - cy="1044.3623" - cx="8.0000057" - id="circle4262" - style="fill:#d3d3d3;fill-opacity:1;stroke:none;stroke-width:20;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - </g> -</svg> diff --git a/editor/icons/source/icon_slider_grabber_hl.svg b/editor/icons/source/icon_slider_grabber_hl.svg deleted file mode 100644 index 5d53811c55..0000000000 --- a/editor/icons/source/icon_slider_grabber_hl.svg +++ /dev/null @@ -1,80 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://creativecommons.org/ns#" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="16" - height="16" - viewBox="0 0 16 15.999999" - id="svg2" - version="1.1" - inkscape:version="0.92.1 unknown" - sodipodi:docname="icon_slider_grabber_hl.svg" - inkscape:export-filename="/mnt/2TB/Development/godot_dev/editor/icons/2x/icon_slider_grabber_hl.png" - inkscape:export-xdpi="192" - inkscape:export-ydpi="192"> - <defs - id="defs4" /> - <sodipodi:namedview - id="base" - pagecolor="#ffffff" - bordercolor="#666666" - borderopacity="1.0" - inkscape:pageopacity="0.0" - inkscape:pageshadow="2" - inkscape:zoom="32" - inkscape:cx="7.6841863" - inkscape:cy="6.0120089" - inkscape:document-units="px" - inkscape:current-layer="layer1" - showgrid="true" - units="px" - inkscape:object-paths="false" - inkscape:snap-intersection-paths="false" - inkscape:snap-bbox="true" - inkscape:bbox-paths="true" - inkscape:bbox-nodes="true" - inkscape:snap-bbox-edge-midpoints="true" - inkscape:window-width="1092" - inkscape:window-height="880" - inkscape:window-x="92" - inkscape:window-y="49" - inkscape:window-maximized="0" - inkscape:snap-smooth-nodes="true" - inkscape:object-nodes="true"> - <inkscape:grid - type="xygrid" - id="grid4136" - empspacing="4" /> - </sodipodi:namedview> - <metadata - id="metadata7"> - <rdf:RDF> - <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title></dc:title> - </cc:Work> - </rdf:RDF> - </metadata> - <g - inkscape:label="Layer 1" - inkscape:groupmode="layer" - id="layer1" - transform="translate(0,-1036.3623)"> - <circle - r="6.9999943" - cy="1044.3623" - cx="8.0000057" - id="circle4262" - style="fill:#f9f9f9;fill-opacity:1;stroke:none;stroke-width:20;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - </g> -</svg> diff --git a/editor/icons/source/icon_slider_joint.svg b/editor/icons/source/icon_slider_joint.svg index 021a295186..25bccca831 100644 --- a/editor/icons/source/icon_slider_joint.svg +++ b/editor/icons/source/icon_slider_joint.svg @@ -14,7 +14,7 @@ viewBox="0 0 16 16" id="svg2" version="1.1" - inkscape:version="0.91 r13725" + inkscape:version="0.92.1 r" inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_collision_shape_2d.png" inkscape:export-xdpi="90" inkscape:export-ydpi="90" @@ -29,8 +29,8 @@ inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="22.627417" - inkscape:cx="3.8333359" - inkscape:cy="8.8668138" + inkscape:cx="8.5719521" + inkscape:cy="9.4331459" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="true" @@ -42,8 +42,8 @@ inkscape:snap-bbox-midpoints="true" inkscape:snap-object-midpoints="true" inkscape:snap-center="true" - inkscape:window-width="1920" - inkscape:window-height="1016" + inkscape:window-width="1600" + inkscape:window-height="836" inkscape:window-x="0" inkscape:window-y="27" inkscape:window-maximized="1"> @@ -59,7 +59,7 @@ <dc:format>image/svg+xml</dc:format> <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title></dc:title> + <dc:title /> </cc:Work> </rdf:RDF> </metadata> @@ -69,9 +69,36 @@ id="layer1" transform="translate(0,-1036.3622)"> <path - style="opacity:1;fill:#fc9c9c;fill-opacity:0.99607843;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - d="m 15,1037.3622 -5,0 0,6 -5,0 0,2 5,0 0,6 5,0 0,-14 z m -7,0 -5,0 -2,0 0,4 0,10 2,0 5,0 0,-4 -5,0 0,-6 5,0 0,-4 z" - id="rect4161" + inkscape:connector-curvature="0" + id="path840" + d="m 3,1051.3622 h 5 l -1,-4 z" + style="fill:#fc9c9c;fill-opacity:0.99607843;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + sodipodi:nodetypes="cccc" /> + <path + style="fill:#fb9b9b;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;fill-opacity:1" + d="m 6,1048.3622 9,-9 v 3 l -8,8 z" + id="path842" + inkscape:connector-curvature="0" /> + <path + inkscape:connector-curvature="0" + id="path844" + d="m 10,1040.3622 -9,9 v -3 l 8,-8 z" + style="fill:#fb9b9b;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> + <path + sodipodi:nodetypes="cccc" + style="fill:#fc9c9c;fill-opacity:0.99607843;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + d="M 13,1037.3622 H 8 l 1,4 z" + id="path846" inkscape:connector-curvature="0" /> + <path + style="fill:none;stroke:#fb9b9b;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none" + d="M 10,1038.3622 H 5" + id="path850" + inkscape:connector-curvature="0" /> + <path + inkscape:connector-curvature="0" + id="path852" + d="M 11,1050.3622 H 6" + style="fill:none;stroke:#fb9b9b;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> </g> </svg> diff --git a/editor/icons/source/icon_spatial_shader.svg b/editor/icons/source/icon_spatial_shader.svg deleted file mode 100644 index 329354b716..0000000000 --- a/editor/icons/source/icon_spatial_shader.svg +++ /dev/null @@ -1,165 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://creativecommons.org/ns#" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="16" - height="16" - viewBox="0 0 16 16" - id="svg2" - version="1.1" - inkscape:version="0.91 r13725" - inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_collision_shape.png" - inkscape:export-xdpi="90" - inkscape:export-ydpi="90" - sodipodi:docname="icon_spatial_shader.svg"> - <defs - id="defs4"> - <clipPath - id="clipPath4253" - clipPathUnits="userSpaceOnUse"> - <path - inkscape:connector-curvature="0" - id="path4255" - d="m 16.458984,1024.37 a 12.000027,12.000027 0 0 0 -3.564453,0.4004 12.000027,12.000027 0 0 0 -8.4863279,14.6973 12.000027,12.000027 0 0 0 14.6972659,8.4863 12.000027,12.000027 0 0 0 8.486328,-14.6973 12.000027,12.000027 0 0 0 -11.132813,-8.8867 z M 16.25,1029.8212 a 6.5451717,6.5451717 0 0 1 6.072266,4.8476 6.5451717,6.5451717 0 0 1 -4.628907,8.0157 6.5451717,6.5451717 0 0 1 -8.0156246,-4.6289 6.5451717,6.5451717 0 0 1 4.6289066,-8.0157 6.5451717,6.5451717 0 0 1 1.943359,-0.2187 z" - style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - </clipPath> - <clipPath - id="clipPath4199" - clipPathUnits="userSpaceOnUse"> - <path - style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - d="m 16.5,1025.8622 a 11.8125,10.499999 0 0 0 -11.8125001,10.5 11.8125,10.499999 0 0 0 11.8125001,10.5 11.8125,10.499999 0 0 0 11.8125,-10.5 11.8125,10.499999 0 0 0 -11.8125,-10.5 z m -3.375,3 a 3.375,2.9999997 0 0 1 3.375,3 3.375,2.9999997 0 0 1 -3.375,3 3.375,2.9999997 0 0 1 -3.3750001,-3 3.375,2.9999997 0 0 1 3.3750001,-3 z" - id="path4201" - inkscape:connector-curvature="0" /> - </clipPath> - <clipPath - clipPathUnits="userSpaceOnUse" - id="clipPath4280"> - <g - id="g4282" - inkscape:label="Layer 1" - transform="translate(0,1.1802001e-5)" - style="stroke:#fc9c9c;stroke-opacity:0.99607843"> - <path - style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#fc9c9c;fill-opacity:0.99607843;fill-rule:evenodd;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" - d="M 7.9628906,1.0019531 A 1.0001,1.0001 0 0 0 7.5527344,1.1054688 l -6,3 A 1.0001,1.0001 0 0 0 1,5 l 0,6 a 1.0001,1.0001 0 0 0 0.5527344,0.894531 l 6,3 a 1.0001,1.0001 0 0 0 0.8945312,0 l 6.0000004,-3 A 1.0001,1.0001 0 0 0 15,11 L 15,5 A 1.0001,1.0001 0 0 0 14.447266,4.1054688 l -6.0000004,-3 A 1.0001,1.0001 0 0 0 7.9628906,1.0019531 Z M 8,3.1191406 11.763672,5 8,6.8828125 4.2363281,5 8,3.1191406 Z m -5,3.5 4,2 0,3.7636714 -4,-2 0,-3.7636714 z m 10,0 0,3.7636714 -4,2 0,-3.7636714 4,-2 z" - transform="translate(0,1036.3622)" - id="path4284" - inkscape:connector-curvature="0" /> - </g> - </clipPath> - </defs> - <sodipodi:namedview - id="base" - pagecolor="#ffffff" - bordercolor="#666666" - borderopacity="1.0" - inkscape:pageopacity="0.0" - inkscape:pageshadow="2" - inkscape:zoom="22.627417" - inkscape:cx="7.8442401" - inkscape:cy="13.929239" - inkscape:document-units="px" - inkscape:current-layer="layer1" - showgrid="true" - units="px" - inkscape:snap-bbox="true" - inkscape:bbox-paths="true" - inkscape:bbox-nodes="true" - inkscape:snap-bbox-edge-midpoints="true" - inkscape:snap-bbox-midpoints="true" - inkscape:snap-object-midpoints="true" - inkscape:snap-center="true" - inkscape:window-width="1920" - inkscape:window-height="1016" - inkscape:window-x="0" - inkscape:window-y="27" - inkscape:window-maximized="1" - inkscape:object-paths="false" - inkscape:snap-intersection-paths="false" - inkscape:object-nodes="false" - inkscape:snap-smooth-nodes="false" - inkscape:snap-midpoints="true"> - <inkscape:grid - type="xygrid" - id="grid3336" /> - </sodipodi:namedview> - <metadata - id="metadata7"> - <rdf:RDF> - <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title></dc:title> - </cc:Work> - </rdf:RDF> - </metadata> - <g - inkscape:label="Layer 1" - inkscape:groupmode="layer" - id="layer1" - transform="translate(0,-1036.3622)"> - <g - id="g4271" - clip-path="url(#clipPath4280)"> - <rect - y="1037.3622" - x="0" - height="2.0000031" - width="16" - id="rect4159" - style="fill:#ff7070;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="fill:#ffeb70;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect4161" - width="16" - height="2.0000029" - x="0" - y="1039.3622" /> - <rect - style="fill:#9dff70;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect4163" - width="16" - height="1.9999999" - x="0" - y="1041.3622" /> - <rect - y="1043.3622" - x="0" - height="2.0000024" - width="16" - id="rect4165" - style="fill:#70ffb9;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - y="1045.3622" - x="0" - height="2.0000021" - width="16" - id="rect4167" - style="fill:#70deff;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="fill:#ff70ac;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect4169" - width="16" - height="1.9999987" - x="0" - y="1049.3622" /> - <rect - style="fill:#9f70ff;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect4146" - width="16" - height="2.0000021" - x="0" - y="1047.3622" /> - </g> - </g> -</svg> diff --git a/editor/icons/source/icon_sphere_mesh.svg b/editor/icons/source/icon_sphere_mesh.svg new file mode 100644 index 0000000000..1264ca3984 --- /dev/null +++ b/editor/icons/source/icon_sphere_mesh.svg @@ -0,0 +1,79 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="16" + height="16" + viewBox="0 0 16 16" + id="svg2" + version="1.1" + inkscape:version="0.92+devel unknown" + inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_node_2d.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" + sodipodi:docname="icon_sphere_mesh.svg"> + <defs + id="defs4" /> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="22.627416" + inkscape:cx="10.188774" + inkscape:cy="7.9201751" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="true" + units="px" + inkscape:snap-bbox="true" + inkscape:bbox-paths="true" + inkscape:bbox-nodes="true" + inkscape:snap-bbox-edge-midpoints="true" + inkscape:snap-bbox-midpoints="true" + inkscape:snap-object-midpoints="true" + inkscape:snap-center="true" + inkscape:window-width="1920" + inkscape:window-height="1016" + inkscape:window-x="0" + inkscape:window-y="27" + inkscape:window-maximized="1" + inkscape:document-rotation="0"> + <inkscape:grid + type="xygrid" + id="grid3336" + empspacing="4" /> + </sodipodi:namedview> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1" + transform="translate(0,-1036.3622)"> + <path + style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-variant-east-asian:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#ffd684;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;filter-blend-mode:normal;filter-gaussianBlur-deviation:0;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate;opacity:1" + d="M 8 1 C 4.1458514 1 1 4.1459 1 8 C 1 11.8542 4.1458514 15 8 15 C 11.854149 15 15 11.8542 15 8 C 15 4.1459 11.854149 1 8 1 z M 7 3.0976562 L 7 7.96875 C 5.7068959 7.8974081 4.3938983 7.6705607 3.0566406 7.2773438 C 3.3574503 5.1795086 4.9418857 3.5108322 7 3.0976562 z M 9 3.0976562 C 11.05489 3.5101849 12.637036 5.1743816 12.941406 7.2675781 C 11.636828 7.6343492 10.325593 7.8701693 9 7.9550781 L 9 3.0976562 z M 12.785156 9.3789062 C 12.276517 11.157679 10.835259 12.531968 9 12.900391 L 9 9.9492188 C 10.27916 9.876918 11.541917 9.6821761 12.785156 9.3789062 z M 3.2207031 9.3964844 C 4.4939533 9.7154019 5.7543858 9.8986297 7 9.9589844 L 7 12.900391 C 5.170884 12.533201 3.7340013 11.166534 3.2207031 9.3964844 z " + transform="translate(0,1036.3622)" + id="path4309" /> + </g> +</svg> diff --git a/editor/icons/source/icon_texture.svg b/editor/icons/source/icon_texture.svg deleted file mode 100644 index 39e88e592b..0000000000 --- a/editor/icons/source/icon_texture.svg +++ /dev/null @@ -1,137 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://creativecommons.org/ns#" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="16" - height="16" - viewBox="0 0 16 16" - id="svg2" - version="1.1" - inkscape:version="0.91 r13725" - inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_key.png" - inkscape:export-xdpi="90" - inkscape:export-ydpi="90" - sodipodi:docname="icon_image_texture.svg"> - <defs - id="defs4" /> - <sodipodi:namedview - id="base" - pagecolor="#ffffff" - bordercolor="#666666" - borderopacity="1.0" - inkscape:pageopacity="0.0" - inkscape:pageshadow="2" - inkscape:zoom="32" - inkscape:cx="9.9365814" - inkscape:cy="6.4466253" - inkscape:document-units="px" - inkscape:current-layer="layer1" - showgrid="true" - units="px" - inkscape:snap-bbox="true" - inkscape:bbox-paths="true" - inkscape:bbox-nodes="true" - inkscape:snap-bbox-edge-midpoints="true" - inkscape:snap-bbox-midpoints="false" - inkscape:snap-object-midpoints="true" - inkscape:snap-center="true" - inkscape:window-width="1920" - inkscape:window-height="1016" - inkscape:window-x="0" - inkscape:window-y="27" - inkscape:window-maximized="1" - inkscape:object-paths="false" - inkscape:snap-intersection-paths="false" - inkscape:object-nodes="false" - inkscape:snap-smooth-nodes="false"> - <inkscape:grid - type="xygrid" - id="grid3336" /> - </sodipodi:namedview> - <metadata - id="metadata7"> - <rdf:RDF> - <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title></dc:title> - </cc:Work> - </rdf:RDF> - </metadata> - <g - inkscape:label="Layer 1" - inkscape:groupmode="layer" - id="layer1" - transform="translate(0,-1036.3622)"> - <path - style="opacity:1;fill:#e0e0e0;fill-opacity:0.99607843;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843" - d="M 2 1 A 1 1 0 0 0 1 2 L 1 14 A 1 1 0 0 0 2 15 L 14 15 A 1 1 0 0 0 15 14 L 15 2 A 1 1 0 0 0 14 1 L 2 1 z M 3 3 L 13 3 L 13 11 L 3 11 L 3 3 z " - transform="translate(0,1036.3622)" - id="rect4156" /> - <rect - y="1043.3622" - x="6" - height="1" - width="2" - id="rect4197" - style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843" /> - <rect - style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843" - id="rect4199" - width="2" - height="2.0000174" - x="6" - y="1044.3622" /> - <rect - y="1045.3622" - x="4" - height="1" - width="2" - id="rect4201" - style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843" /> - <rect - style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843" - id="rect4203" - width="2" - height="2.0000174" - x="8" - y="1044.3622" /> - <rect - y="1044.3622" - x="10" - height="2.0000174" - width="2" - id="rect4205" - style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843" /> - <rect - style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843" - id="rect4207" - width="3" - height="2.0000174" - x="8" - y="1042.3622" /> - <rect - y="1041.3622" - x="9" - height="1" - width="1" - id="rect4217" - style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843" /> - <rect - style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843" - id="rect4219" - width="1" - height="1" - x="5" - y="1044.3622" /> - </g> -</svg> diff --git a/editor/icons/source/icon_texture_rect.svg b/editor/icons/source/icon_texture_rect.svg index 88d9b4081f..e02882812c 100644 --- a/editor/icons/source/icon_texture_rect.svg +++ b/editor/icons/source/icon_texture_rect.svg @@ -14,7 +14,7 @@ viewBox="0 0 16 16" id="svg2" version="1.1" - inkscape:version="0.91 r13725" + inkscape:version="0.92.1 r" inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_center_container.png" inkscape:export-xdpi="90" inkscape:export-ydpi="90" @@ -29,7 +29,7 @@ inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="32" - inkscape:cx="14.395168" + inkscape:cx="8.051418" inkscape:cy="9.9171316" inkscape:document-units="px" inkscape:current-layer="layer1" @@ -42,8 +42,8 @@ inkscape:snap-bbox-midpoints="true" inkscape:snap-object-midpoints="true" inkscape:snap-center="true" - inkscape:window-width="1920" - inkscape:window-height="1016" + inkscape:window-width="1600" + inkscape:window-height="836" inkscape:window-x="0" inkscape:window-y="27" inkscape:window-maximized="1"> @@ -59,7 +59,7 @@ <dc:format>image/svg+xml</dc:format> <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title></dc:title> + <dc:title /> </cc:Work> </rdf:RDF> </metadata> @@ -69,33 +69,12 @@ id="layer1" transform="translate(0,-1036.3622)"> <rect - style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect4154" - width="1" - height="14" - x="1" - y="1037.3622" /> - <rect - y="1050.3622" - x="1" - height="0.9999826" - width="14" - id="rect4156" - style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect4158" - width="14" - height="0.9999826" - x="1" - y="1037.3622" /> - <rect - y="1037.3622" - x="14" - height="14" - width="1" - id="rect4160" - style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + style="fill:none;fill-opacity:1;stroke:#a5efac;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect818" + width="12" + height="12" + x="2" + y="1038.3622" /> <path inkscape:connector-curvature="0" id="rect4197" diff --git a/editor/icons/source/icon_timer.svg b/editor/icons/source/icon_timer.svg index 0615ab865a..f156414686 100644 --- a/editor/icons/source/icon_timer.svg +++ b/editor/icons/source/icon_timer.svg @@ -14,7 +14,7 @@ viewBox="0 0 16 16" id="svg2" version="1.1" - inkscape:version="0.91 r13725" + inkscape:version="0.92.1 r" inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_sprite.png" inkscape:export-xdpi="45" inkscape:export-ydpi="45" @@ -28,9 +28,9 @@ borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" - inkscape:zoom="32" - inkscape:cx="4.6045193" - inkscape:cy="8.1915618" + inkscape:zoom="16" + inkscape:cx="4.3214346" + inkscape:cy="13.122944" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="true" @@ -42,8 +42,8 @@ inkscape:snap-bbox-midpoints="true" inkscape:snap-object-midpoints="true" inkscape:snap-center="true" - inkscape:window-width="1920" - inkscape:window-height="1016" + inkscape:window-width="1600" + inkscape:window-height="836" inkscape:window-x="0" inkscape:window-y="27" inkscape:window-maximized="1" @@ -62,7 +62,7 @@ <dc:format>image/svg+xml</dc:format> <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title></dc:title> + <dc:title /> </cc:Work> </rdf:RDF> </metadata> @@ -72,37 +72,32 @@ id="layer1" transform="translate(0,-1036.3622)"> <rect - style="opacity:1;fill:#fefeff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843" - id="rect4175" - width="1" - height="1" - x="20" - y="1042.3622" /> + style="fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:1.85164022;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect818" + width="12" + height="2" + x="2" + y="1037.3622" + ry="1" /> <rect - y="1042.3622" - x="29" - height="1" - width="1" - id="rect4177" - style="opacity:1;fill:#fefeff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843" /> + ry="1" + y="1049.3622" + x="2" + height="2" + width="12" + id="rect820" + style="fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:1.85164022;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> <path - style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843" - d="M 8 1 A 7.0000172 7.0000172 0 0 0 1 8 A 7.0000172 7.0000172 0 0 0 8 15 A 7.0000172 7.0000172 0 0 0 15 8 A 7.0000172 7.0000172 0 0 0 8 1 z M 8 3 A 5.0000172 5.0000172 0 0 1 13 8 A 5.0000172 5.0000172 0 0 1 8 13 A 5.0000172 5.0000172 0 0 1 3 8 A 5.0000172 5.0000172 0 0 1 8 3 z " - transform="translate(0,1036.3622)" - id="path4156" /> - <rect - style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843" - id="rect4161" - width="2" - height="3.9999826" - x="7" - y="1041.3622" /> - <rect - y="1043.3622" - x="7" - height="1.9999826" - width="4" - id="rect4163" - style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843" /> + style="fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + d="m 3,1050.3622 h 10 l -3,-6 H 6 Z" + id="path838" + inkscape:connector-curvature="0" + sodipodi:nodetypes="ccccc" /> + <path + style="fill:none;stroke:#e0e0e0;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 3,1038.3622 h 10 c 0,2 -3,4 -4,6 1,2 4,4 4,6 H 3 c 0,-2 3,-4 4,-6 -1,-2 -4,-4 -4,-6 z" + id="path840" + inkscape:connector-curvature="0" + sodipodi:nodetypes="ccccccc" /> </g> </svg> diff --git a/editor/icons/source/icon_tool_button.svg b/editor/icons/source/icon_tool_button.svg index 1c5176c8c9..6fb580bc7f 100644 --- a/editor/icons/source/icon_tool_button.svg +++ b/editor/icons/source/icon_tool_button.svg @@ -14,7 +14,7 @@ viewBox="0 0 16 16" id="svg2" version="1.1" - inkscape:version="0.91 r13725" + inkscape:version="0.92.1 r" inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_button.png" inkscape:export-xdpi="90" inkscape:export-ydpi="90" @@ -29,8 +29,8 @@ inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="32" - inkscape:cx="8.173168" - inkscape:cy="9.7479984" + inkscape:cx="7.704418" + inkscape:cy="7.4979984" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="true" @@ -42,8 +42,8 @@ inkscape:snap-bbox-midpoints="true" inkscape:snap-object-midpoints="true" inkscape:snap-center="true" - inkscape:window-width="1920" - inkscape:window-height="1016" + inkscape:window-width="1600" + inkscape:window-height="836" inkscape:window-x="0" inkscape:window-y="27" inkscape:window-maximized="1"> @@ -60,7 +60,7 @@ <dc:format>image/svg+xml</dc:format> <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title></dc:title> + <dc:title /> </cc:Work> </rdf:RDF> </metadata> @@ -69,26 +69,44 @@ inkscape:groupmode="layer" id="layer1" transform="translate(0,-1036.3622)"> - <path - style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - d="M 1 3 L 1 11 L 15 11 L 15 3 L 1 3 z M 11 4 A 3 3 0 0 1 13.826172 6 L 11 6 A 1 1 0 0 0 10 7 A 1 1 0 0 0 11 8 L 13.824219 8 A 3 3 0 0 1 11 10 A 3 3 0 0 1 8.1757812 8 L 3 8 A 1 1 0 0 1 2 7 A 1 1 0 0 1 3 6 L 8.1738281 6 A 3 3 0 0 1 11 4 z " - transform="translate(0,1036.3622)" - id="rect4139" /> <rect - transform="scale(1,-1)" - style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect4160" - width="14" - height="2.0000522" - x="1" - y="-1049.3622" /> + style="fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect829" + width="6" + height="4" + x="2" + y="1047.3622" + ry="1.5" /> <rect - y="-1049.3622" + style="fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:1.71867573;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect825" + width="8" + height="2.0000174" x="1" - height="2.0000522" - width="14" - id="rect4142" - style="opacity:1;fill:#000000;fill-opacity:0.07843138;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - transform="scale(1,-1)" /> + y="1049.3622" + ry="0" /> + <path + style="fill:none;stroke:#a5efac;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 2,1042.3622 3,2 3,-2" + id="path831" + inkscape:connector-curvature="0" /> + <path + style="fill:none;stroke:#a5efac;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 5,1039.3622 v 5" + id="path833" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cc" /> + <g + id="layer1-7" + inkscape:label="Layer 1" + transform="translate(9,-1)" + style="fill:#a5efac;fill-opacity:1"> + <path + id="path828" + d="m 2,1038.536 c -1.1978593,0.4235 -1.9990448,1.5557 -2,2.8262 9.552e-4,1.2705 0.8021407,2.4027 2,2.8262 v 6.1738 1 c 0,0.554 0.446,1 1,1 0.554,0 1,-0.446 1,-1 v -4 -3.1758 c 1.197184,-0.4232 1.998218,-1.5544 2,-2.8242 -0.00178,-1.2698 -0.802816,-2.401 -2,-2.8242 v 2.8242 c 0,0.5523 -0.447715,1 -1,1 -0.552285,0 -1,-0.4477 -1,-1 z" + style="fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + inkscape:connector-curvature="0" + sodipodi:nodetypes="ccccsssccccsssc" /> + </g> </g> </svg> diff --git a/editor/icons/source/icon_tools.svg b/editor/icons/source/icon_tools.svg index f2b8cd9343..030d38f6cf 100644 --- a/editor/icons/source/icon_tools.svg +++ b/editor/icons/source/icon_tools.svg @@ -14,11 +14,11 @@ viewBox="0 0 16 16" id="svg2" version="1.1" - inkscape:version="0.91 r13725" + inkscape:version="0.92.1 r" inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_g_d_script.png" inkscape:export-xdpi="90" inkscape:export-ydpi="90" - sodipodi:docname="icon_g_d_script.svg"> + sodipodi:docname="icon_tools.svg"> <defs id="defs4" /> <sodipodi:namedview @@ -28,9 +28,9 @@ borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" - inkscape:zoom="32" - inkscape:cx="6.7306265" - inkscape:cy="9.0071681" + inkscape:zoom="22.627417" + inkscape:cx="17.67723" + inkscape:cy="10.600994" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="true" @@ -42,8 +42,8 @@ inkscape:snap-bbox-midpoints="true" inkscape:snap-object-midpoints="true" inkscape:snap-center="true" - inkscape:window-width="1920" - inkscape:window-height="1016" + inkscape:window-width="1600" + inkscape:window-height="836" inkscape:window-x="0" inkscape:window-y="27" inkscape:window-maximized="1"> @@ -59,7 +59,7 @@ <dc:format>image/svg+xml</dc:format> <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title></dc:title> + <dc:title /> </cc:Work> </rdf:RDF> </metadata> @@ -69,9 +69,9 @@ id="layer1" transform="translate(0,-1036.3622)"> <path - style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:3;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - d="M 7 1 L 6.4355469 3.2578125 A 5.0000172 5.0000172 0 0 0 5.7460938 3.5371094 L 3.7578125 2.34375 L 2.34375 3.7578125 L 3.5390625 5.7519531 A 5.0000172 5.0000172 0 0 0 3.2539062 6.4375 L 1 7 L 1 9 L 3.2578125 9.5644531 A 5.0000172 5.0000172 0 0 0 3.5371094 10.251953 L 2.34375 12.242188 L 3.7578125 13.65625 L 5.7519531 12.460938 A 5.0000172 5.0000172 0 0 0 6.4375 12.746094 L 7 15 L 9 15 L 9.5644531 12.742188 A 5.0000172 5.0000172 0 0 0 10.251953 12.462891 L 12.242188 13.65625 L 13.65625 12.242188 L 12.460938 10.248047 A 5.0000172 5.0000172 0 0 0 12.746094 9.5625 L 15 9 L 15 7 L 12.742188 6.4355469 A 5.0000172 5.0000172 0 0 0 12.462891 5.7480469 L 13.65625 3.7578125 L 12.242188 2.34375 L 10.248047 3.5390625 A 5.0000172 5.0000172 0 0 0 9.5625 3.2539062 L 9 1 L 7 1 z M 8 6 A 2.0000174 2.0000174 0 0 1 10 8 A 2.0000174 2.0000174 0 0 1 8 10 A 2.0000174 2.0000174 0 0 1 6 8 A 2.0000174 2.0000174 0 0 1 8 6 z " + style="fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="M 4 1 L 3 3 L 4 5 L 4 9 L 2 9 L 2 12 L 2 12.5 C 2 13.885 3.115 15 4.5 15 C 5.885 15 7 13.885 7 12.5 L 7 11.5 L 7 9 L 5 9 L 5 5 L 6 3 L 5 1 L 4 1 z M 10 1.1738281 A 3 3 0 0 0 8 4 A 3 3 0 0 0 10 6.8261719 L 10 13 L 10 14 C 10 14.554 10.446 15 11 15 C 11.554 15 12 14.554 12 14 L 12 10 L 12 6.8242188 A 3 3 0 0 0 14 4 A 3 3 0 0 0 12 1.1757812 L 12 4 A 1 1 0 0 1 11 5 A 1 1 0 0 1 10 4 L 10 1.1738281 z " transform="translate(0,1036.3622)" - id="path4176" /> + id="path828" /> </g> </svg> diff --git a/editor/icons/source/icon_tree.svg b/editor/icons/source/icon_tree.svg index b31fd38097..0c2b20f458 100644 --- a/editor/icons/source/icon_tree.svg +++ b/editor/icons/source/icon_tree.svg @@ -14,7 +14,7 @@ viewBox="0 0 16 16" id="svg2" version="1.1" - inkscape:version="0.91 r13725" + inkscape:version="0.92.1 r" inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_sprite.png" inkscape:export-xdpi="45" inkscape:export-ydpi="45" @@ -28,9 +28,9 @@ borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" - inkscape:zoom="45.254834" - inkscape:cx="10.885344" - inkscape:cy="6.8775392" + inkscape:zoom="22.627417" + inkscape:cx="7.8708755" + inkscape:cy="9.6521385" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="true" @@ -42,8 +42,8 @@ inkscape:snap-bbox-midpoints="true" inkscape:snap-object-midpoints="true" inkscape:snap-center="true" - inkscape:window-width="1920" - inkscape:window-height="1016" + inkscape:window-width="1600" + inkscape:window-height="836" inkscape:window-x="0" inkscape:window-y="27" inkscape:window-maximized="1" @@ -62,7 +62,7 @@ <dc:format>image/svg+xml</dc:format> <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title></dc:title> + <dc:title /> </cc:Work> </rdf:RDF> </metadata> @@ -85,45 +85,48 @@ width="1" id="rect4177" style="opacity:1;fill:#fefeff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843" /> - <path - style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843" - d="M 3 1 A 2 2 0 0 0 1.5859375 1.5859375 A 2 2 0 0 0 1 3 L 1 13 A 2 2 0 0 0 1.5859375 14.414062 A 2 2 0 0 0 3 15 L 13 15 A 2 2 0 0 0 15 13 L 15 3 A 2 2 0 0 0 13 1 L 3 1 z M 3 2 L 13 2 A 1.0000174 1.0000174 0 0 1 14 3 L 14 13 A 1.0000174 1.0000174 0 0 1 13 14 L 3 14 A 1.0000174 1.0000174 0 0 1 2 13 L 2 3 A 1.0000174 1.0000174 0 0 1 3 2 z " - transform="translate(0,1036.3622)" - id="rect4179" /> <rect - style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843" - id="rect4173" - width="1" - height="5.0000172" - x="4" - y="1040.3622" /> + style="fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect821" + width="14" + height="2" + x="1" + y="1037.3622" /> <rect y="1041.3622" - x="4" - height="1.0000174" - width="8" - id="rect4176" - style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843" /> + x="6" + height="2" + width="9" + id="rect823" + style="fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:1.60356748;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> <rect - style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843" - id="rect4178" - width="7" - height="1.0000174" - x="5" - y="1044.3622" /> - <rect - y="1045.3622" + style="fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:1.51185787;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect825" + width="8" + height="2" x="7" - height="3.0000174" - width="1" - id="rect4180" - style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843" /> + y="1045.3622" /> <rect - style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843" - id="rect4191" - width="5" - height="1" + y="1049.3622" x="7" - y="1047.3622" /> + height="2" + width="8" + id="rect827" + style="fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:1.51185787;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + <path + style="fill:none;stroke:#a5efac;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none" + d="m 2,1038.3622 v 4 h 4" + id="path829" + inkscape:connector-curvature="0" /> + <path + style="fill:none;stroke:#a5efac;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 6,1042.3622 v 4 h 3" + id="path831" + inkscape:connector-curvature="0" /> + <path + style="fill:none;stroke:#a5efac;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none" + d="m 2,1040.3622 v 10 h 7" + id="path833" + inkscape:connector-curvature="0" /> </g> </svg> diff --git a/editor/icons/source/icon_unchecked.svg b/editor/icons/source/icon_unchecked.svg deleted file mode 100644 index 053cbe6de5..0000000000 --- a/editor/icons/source/icon_unchecked.svg +++ /dev/null @@ -1,77 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://creativecommons.org/ns#" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="16" - height="16" - viewBox="0 0 16 15.999999" - id="svg2" - version="1.1" - inkscape:version="0.92.1 r" - sodipodi:docname="unchecked.svg" - inkscape:export-filename="/home/djrm/Projects/godot/scene/resources/default_theme/unchecked.png" - inkscape:export-xdpi="90" - inkscape:export-ydpi="90"> - <defs - id="defs4" /> - <sodipodi:namedview - id="base" - pagecolor="#ffffff" - bordercolor="#666666" - borderopacity="1.0" - inkscape:pageopacity="0.0" - inkscape:pageshadow="2" - inkscape:zoom="32" - inkscape:cx="4.8224661" - inkscape:cy="8.2065809" - inkscape:document-units="px" - inkscape:current-layer="layer1" - showgrid="true" - units="px" - inkscape:object-paths="false" - inkscape:snap-intersection-paths="false" - inkscape:snap-bbox="true" - inkscape:bbox-paths="true" - inkscape:bbox-nodes="true" - inkscape:snap-bbox-edge-midpoints="true" - inkscape:window-width="1600" - inkscape:window-height="836" - inkscape:window-x="0" - inkscape:window-y="27" - inkscape:window-maximized="1"> - <inkscape:grid - type="xygrid" - id="grid4136" - empspacing="4" /> - </sodipodi:namedview> - <metadata - id="metadata7"> - <rdf:RDF> - <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title /> - </cc:Work> - </rdf:RDF> - </metadata> - <g - inkscape:label="Layer 1" - inkscape:groupmode="layer" - id="layer1" - transform="translate(0,-1036.3623)"> - <path - style="opacity:1;fill:#e0e0e0;fill-opacity:0.78431374;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - d="M 4 2 A 2 2 0 0 0 2 4 L 2 12 A 2 2 0 0 0 4 14 L 12 14 A 2 2 0 0 0 14 12 L 14 4 A 2 2 0 0 0 12 2 L 4 2 z M 4.8007812 4 L 11.199219 4 A 0.8000012 0.8000012 0 0 1 12 4.8007812 L 12 11.199219 A 0.8000012 0.8000012 0 0 1 11.199219 12 L 4.8007812 12 A 0.8000012 0.8000012 0 0 1 4 11.199219 L 4 4.8007812 A 0.8000012 0.8000012 0 0 1 4.8007812 4 z " - transform="translate(0,1036.3623)" - id="circle4178" /> - </g> -</svg> diff --git a/editor/icons/source/icon_v_button_array.svg b/editor/icons/source/icon_v_button_array.svg index aded4b401b..08fc7d7614 100644 --- a/editor/icons/source/icon_v_button_array.svg +++ b/editor/icons/source/icon_v_button_array.svg @@ -14,7 +14,7 @@ viewBox="0 0 16 16" id="svg2" version="1.1" - inkscape:version="0.91 r13725" + inkscape:version="0.92.1 r" inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_button.png" inkscape:export-xdpi="90" inkscape:export-ydpi="90" @@ -28,9 +28,9 @@ borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" - inkscape:zoom="32" - inkscape:cx="5.9547041" - inkscape:cy="8.9802416" + inkscape:zoom="22.627417" + inkscape:cx="8.7528394" + inkscape:cy="11.065221" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="true" @@ -42,8 +42,8 @@ inkscape:snap-bbox-midpoints="true" inkscape:snap-object-midpoints="true" inkscape:snap-center="true" - inkscape:window-width="1920" - inkscape:window-height="1016" + inkscape:window-width="1600" + inkscape:window-height="836" inkscape:window-x="0" inkscape:window-y="27" inkscape:window-maximized="1" @@ -63,7 +63,7 @@ <dc:format>image/svg+xml</dc:format> <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title></dc:title> + <dc:title /> </cc:Work> </rdf:RDF> </metadata> @@ -72,29 +72,20 @@ inkscape:groupmode="layer" id="layer1" transform="translate(0,-1036.3622)"> - <rect - style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect4156" - width="14" - height="6.0000172" - x="1" - y="1037.3622" /> - <rect - y="1042.3622" - x="1" - height="0.99996543" - width="14" - id="rect4161" - style="opacity:1;fill:#98dc9f;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + <g + id="layer1-7" + inkscape:label="Layer 1" + transform="translate(11.5,-2.9999826)" + style="fill:#a5efac;fill-opacity:1" /> <path - style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - d="M 1 9 L 1 15 L 3 13 L 5 15 L 7 13 L 9 15 L 11 13 L 13 15 L 15 13 L 15 9 L 1 9 z " + style="fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="M 7 1 L 7 3.1328125 L 5.5546875 2.1679688 L 4.4453125 3.8320312 L 7.4453125 5.8320312 C 7.7812145 6.0559312 8.2187855 6.0559313 8.5546875 5.8320312 L 11.554688 3.8320312 L 10.445312 2.1679688 L 9 3.1328125 L 9 1 L 7 1 z M 6.5 7 C 5.669 7 5 7.669 5 8.5 L 5 9 L 4 9 L 4 11 L 6 11 L 6 9 L 10 9 L 10 11 L 12 11 L 12 9 L 11 9 L 11 8.5 C 11 7.669 10.331 7 9.5 7 L 6.5 7 z " transform="translate(0,1036.3622)" - id="rect4157" /> + id="rect829-9" /> <path - style="opacity:1;fill:#98dc9f;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - d="M 1 14 L 1 15 L 2 14 L 1 14 z M 4 14 L 5 15 L 6 14 L 4 14 z M 8 14 L 9 15 L 10 14 L 8 14 z M 12 14 L 13 15 L 14 14 L 12 14 z " - transform="translate(0,1036.3622)" - id="rect4159" /> + style="fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 7,1046.3622 v 2 H 5 v 2 h 2 v 2 h 2 v -2 h 2 v -2 H 9 v -2 z" + id="rect836" + inkscape:connector-curvature="0" /> </g> </svg> diff --git a/editor/icons/source/icon_v_scroll_bar.svg b/editor/icons/source/icon_v_scroll_bar.svg index 659dc39b0b..8ad6baa5b3 100644 --- a/editor/icons/source/icon_v_scroll_bar.svg +++ b/editor/icons/source/icon_v_scroll_bar.svg @@ -14,7 +14,7 @@ viewBox="0 0 16 16" id="svg2" version="1.1" - inkscape:version="0.91 r13725" + inkscape:version="0.92.1 r" inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_center_container.png" inkscape:export-xdpi="90" inkscape:export-ydpi="90" @@ -29,7 +29,7 @@ inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="32" - inkscape:cx="10.543346" + inkscape:cx="4.199596" inkscape:cy="9.3134214" inkscape:document-units="px" inkscape:current-layer="layer1" @@ -42,8 +42,8 @@ inkscape:snap-bbox-midpoints="true" inkscape:snap-object-midpoints="true" inkscape:snap-center="true" - inkscape:window-width="1920" - inkscape:window-height="1016" + inkscape:window-width="1600" + inkscape:window-height="836" inkscape:window-x="0" inkscape:window-y="27" inkscape:window-maximized="1" @@ -63,7 +63,7 @@ <dc:format>image/svg+xml</dc:format> <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title></dc:title> + <dc:title /> </cc:Work> </rdf:RDF> </metadata> @@ -73,26 +73,9 @@ id="layer1" transform="translate(0,-1036.3622)"> <path - style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - d="m 13,1039.3622 c 0,-1.1046 -0.89543,-2 -2,-2 l -6,0 c -1.104569,0 -2,0.8954 -2,2 l 0,10 c 0,1.1046 0.895431,2 2,2 l 6,0 c 1.10457,0 2,-0.8954 2,-2 z m -2,0 0,10 -6,0 0,-10 z" - id="rect4140" - inkscape:connector-curvature="0" - sodipodi:nodetypes="sssssssssccccc" /> - <rect - style="opacity:1;fill:none;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843" - id="rect4181" - width="4" - height="4" - x="1042.3622" - y="-8" - transform="matrix(0,1,-1,0,0,0)" /> - <rect - style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843" - id="rect4187" - width="4" - height="4" - x="1040.3622" - y="-10" - transform="matrix(0,1,-1,0,0,0)" /> + style="fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="M 5 1 C 3.8919904 1 3 1.8919904 3 3 L 3 13 C 3 14.10801 3.8919904 15 5 15 L 11 15 C 12.10801 15 13 14.10801 13 13 L 13 3 C 13 1.8919904 12.10801 1 11 1 L 5 1 z M 7.9882812 2 A 1.0001 1.0001 0 0 1 8.5546875 2.1679688 L 11.554688 4.1679688 A 1.0001 1.0001 0 1 1 10.445312 5.8320312 L 8 4.203125 L 5.5546875 5.8320312 A 1.0001 1.0001 0 1 1 4.4453125 4.1679688 L 7.4453125 2.1679688 A 1.0001 1.0001 0 0 1 7.9882812 2 z M 4.9902344 9.9921875 A 1.0001 1.0001 0 0 1 5.5546875 10.167969 L 8 11.798828 L 10.445312 10.167969 A 1.0001 1.0001 0 1 1 11.554688 11.832031 L 8.5546875 13.832031 A 1.0001 1.0001 0 0 1 7.4453125 13.832031 L 4.4453125 11.832031 A 1.0001 1.0001 0 0 1 4.9902344 9.9921875 z " + transform="translate(0,1036.3622)" + id="rect825" /> </g> </svg> diff --git a/editor/icons/source/icon_v_slider.svg b/editor/icons/source/icon_v_slider.svg index 74b59cfce5..e13c008d3a 100644 --- a/editor/icons/source/icon_v_slider.svg +++ b/editor/icons/source/icon_v_slider.svg @@ -14,7 +14,7 @@ viewBox="0 0 16 16" id="svg2" version="1.1" - inkscape:version="0.91 r13725" + inkscape:version="0.92.1 r" inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_center_container.png" inkscape:export-xdpi="90" inkscape:export-ydpi="90" @@ -29,8 +29,8 @@ inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="32" - inkscape:cx="9.3533577" - inkscape:cy="8.3875011" + inkscape:cx="2.2553429" + inkscape:cy="8.5533887" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="true" @@ -42,8 +42,8 @@ inkscape:snap-bbox-midpoints="true" inkscape:snap-object-midpoints="true" inkscape:snap-center="true" - inkscape:window-width="1920" - inkscape:window-height="1016" + inkscape:window-width="1600" + inkscape:window-height="836" inkscape:window-x="0" inkscape:window-y="27" inkscape:window-maximized="1" @@ -63,7 +63,7 @@ <dc:format>image/svg+xml</dc:format> <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title></dc:title> + <dc:title /> </cc:Work> </rdf:RDF> </metadata> @@ -73,15 +73,39 @@ id="layer1" transform="translate(0,-1036.3622)"> <path - style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - d="m 9,1038.3622 a 1,1 0 0 0 -1,-1 1,1 0 0 0 -1,1 l 0,3.1738 a 3,3 0 0 1 1,-0.1738 3,3 0 0 1 1,0.1758 l 0,-3.1758 z m 0,8.8262 a 3,3 0 0 1 -1,0.1738 3,3 0 0 1 -1,-0.1758 l 0,3.1758 a 1,1 0 0 0 1,1 1,1 0 0 0 1,-1 l 0,-3.1738 z" - id="rect4157" + style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#a5efac;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" + d="m 5.99995,1050.3623 a 1.0001,1.0001 0 1 1 -2,0 v -2.1308 a 4,4 0 0 0 1,0.1308 4,4 0 0 0 1,-0.1328 z m 0,-9.8691 a 4,4 0 0 0 -1,-0.1309 4,4 0 0 0 -1,0.1329 v -2.1329 a 1.0001,1.0001 0 1 1 2,0 z" + id="path817" inkscape:connector-curvature="0" /> <circle - style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843" - id="path4167" - cx="8" - cy="1044.3622" - r="2" /> + style="fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="path824" + cx="-1039.3623" + cy="-4.9999676" + r="2" + transform="matrix(0,-1,-1,0,0,0)" /> + <path + style="fill:none;stroke:#a5efac;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 11.99995,1038.3623 h -2" + id="path835" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cc" /> + <path + style="fill:none;stroke:#a5efac;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 10.99995,1044.3623 v 0" + id="path837" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cc" /> + <path + style="fill:none;stroke:#a5efac;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 11.99995,1050.3623 h -2" + id="path839" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cc" /> + <path + inkscape:connector-curvature="0" + style="fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 5.99995,1049.3623 h -2 v -6.1308 a 4,4 0 0 0 1,0.1308 4,4 0 0 0 1,-0.1328 z" + id="rect841" /> </g> </svg> diff --git a/editor/icons/source/icon_video_player.svg b/editor/icons/source/icon_video_player.svg index bfb499518b..a049791930 100644 --- a/editor/icons/source/icon_video_player.svg +++ b/editor/icons/source/icon_video_player.svg @@ -14,7 +14,7 @@ viewBox="0 0 16 16" id="svg2" version="1.1" - inkscape:version="0.91 r13725" + inkscape:version="0.92.1 r" inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_sprite.png" inkscape:export-xdpi="45" inkscape:export-ydpi="45" @@ -28,9 +28,9 @@ borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" - inkscape:zoom="16" - inkscape:cx="4.9323208" - inkscape:cy="11.020342" + inkscape:zoom="22.627417" + inkscape:cx="6.7289895" + inkscape:cy="10.226546" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="true" @@ -42,8 +42,8 @@ inkscape:snap-bbox-midpoints="true" inkscape:snap-object-midpoints="true" inkscape:snap-center="true" - inkscape:window-width="1920" - inkscape:window-height="1016" + inkscape:window-width="1600" + inkscape:window-height="836" inkscape:window-x="0" inkscape:window-y="27" inkscape:window-maximized="1" @@ -62,7 +62,7 @@ <dc:format>image/svg+xml</dc:format> <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title></dc:title> + <dc:title /> </cc:Work> </rdf:RDF> </metadata> @@ -72,29 +72,26 @@ id="layer1" transform="translate(0,-1036.3622)"> <rect - style="opacity:1;fill:#fefeff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843" - id="rect4175" - width="1" - height="1" - x="20" - y="1042.3622" /> - <rect - y="1042.3622" - x="29" - height="1" - width="1" - id="rect4177" - style="opacity:1;fill:#fefeff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843" /> - <path - style="opacity:1;fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843" - d="M 3 1 A 2 2 0 0 0 1.5859375 1.5859375 A 2 2 0 0 0 1 3 L 1 13 A 2 2 0 0 0 1.5859375 14.414062 A 2 2 0 0 0 3 15 L 13 15 A 2 2 0 0 0 15 13 L 15 3 A 2 2 0 0 0 13 1 L 3 1 z M 3 2 L 13 2 A 1.0000174 1.0000174 0 0 1 14 3 L 14 13 A 1.0000174 1.0000174 0 0 1 13 14 L 3 14 A 1.0000174 1.0000174 0 0 1 2 13 L 2 3 A 1.0000174 1.0000174 0 0 1 3 2 z " - transform="translate(0,1036.3622)" - id="rect4179" /> + style="fill:none;fill-opacity:1;stroke:#a5efac;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect819" + width="12" + height="12" + x="2" + y="1038.3622" + ry="1.0000174" /> <path style="fill:#a5efac;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="m 6,1047.3622 0,-6 5,3 z" + d="m 6,1045.3622 v -4 l 4,2 z" id="path4180" inkscape:connector-curvature="0" sodipodi:nodetypes="cccc" /> + <rect + style="fill:#a5efac;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect821" + width="10" + height="2" + x="3" + y="1047.3622" + ry="0" /> </g> </svg> diff --git a/editor/icons/source/icon_visual_script.svg b/editor/icons/source/icon_visual_script.svg index be4b47ca54..d82cb36cb5 100644 --- a/editor/icons/source/icon_visual_script.svg +++ b/editor/icons/source/icon_visual_script.svg @@ -14,7 +14,7 @@ viewBox="0 0 16 16" id="svg2" version="1.1" - inkscape:version="0.91 r13725" + inkscape:version="0.92.1 r" inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_canvas_item_shader_graph.png" inkscape:export-xdpi="90" inkscape:export-ydpi="90" @@ -28,9 +28,9 @@ borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" - inkscape:zoom="15.999999" - inkscape:cx="2.7930637" - inkscape:cy="10.792256" + inkscape:zoom="22.627416" + inkscape:cx="9.8155367" + inkscape:cy="10.356948" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="true" @@ -42,8 +42,8 @@ inkscape:snap-bbox-midpoints="true" inkscape:snap-object-midpoints="true" inkscape:snap-center="true" - inkscape:window-width="1920" - inkscape:window-height="1016" + inkscape:window-width="1600" + inkscape:window-height="836" inkscape:window-x="0" inkscape:window-y="27" inkscape:window-maximized="1" @@ -61,7 +61,7 @@ <dc:format>image/svg+xml</dc:format> <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title></dc:title> + <dc:title /> </cc:Work> </rdf:RDF> </metadata> @@ -70,11 +70,6 @@ inkscape:groupmode="layer" id="layer1" transform="translate(0,-1036.3622)"> - <path - style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - d="M 3 1 A 2 2 0 0 0 1 3 A 2 2 0 0 0 2 4.7304688 L 2 11.271484 A 2 2 0 0 0 1 13 A 2 2 0 0 0 3 15 A 2 2 0 0 0 5 13 A 2 2 0 0 0 4 11.269531 L 4 5.4140625 L 6.2929688 7.7070312 L 7.7070312 6.2929688 L 5.4140625 4 L 11.271484 4 A 2 2 0 0 0 13 5 A 2 2 0 0 0 15 3 A 2 2 0 0 0 13 1 A 2 2 0 0 0 11.269531 2 L 4.7285156 2 A 2 2 0 0 0 3 1 z " - transform="translate(0,1036.3622)" - id="path4198" /> <ellipse r="2" style="opacity:1;fill:#6e6e6e;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" @@ -82,10 +77,9 @@ cx="3" cy="1039.3622" /> <path - style="fill:none;fill-rule:evenodd;stroke:#e0e0e0;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;fill-opacity:1" - d="m 11,1050.3622 3,-3 -3,-3" - id="path3378" - inkscape:connector-curvature="0" - sodipodi:nodetypes="ccc" /> + style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:3;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + d="M 7 1 L 6.4355469 3.2578125 A 5.0000172 5.0000172 0 0 0 5.7460938 3.5371094 L 3.7578125 2.34375 L 2.34375 3.7578125 L 3.5390625 5.7519531 A 5.0000172 5.0000172 0 0 0 3.2539062 6.4375 L 1 7 L 1 9 L 6.2714844 9 A 2.0000174 2.0000174 0 0 1 6 8 A 2.0000174 2.0000174 0 0 1 8 6 A 2.0000174 2.0000174 0 0 1 10 8 A 2.0000174 2.0000174 0 0 1 9.7304688 9 L 15 9 L 15 7 L 12.742188 6.4355469 A 5.0000172 5.0000172 0 0 0 12.462891 5.7480469 L 13.65625 3.7578125 L 12.242188 2.34375 L 10.248047 3.5390625 A 5.0000172 5.0000172 0 0 0 9.5625 3.2539062 L 9 1 L 7 1 z M 3 10 L 3 16 L 5 16 A 3 3 0 0 0 8 13 L 8 10 L 6 10 L 6 13 A 1.0000174 1.0000174 0 0 1 5 14 L 5 10 L 3 10 z M 11 10 A 2 2 0 0 0 9.2675781 11 A 2 2 0 0 0 9.2675781 13 A 2 2 0 0 0 11 14 L 9 14 L 9 16 L 11 16 A 2 2 0 0 0 12.732422 15 A 2 2 0 0 0 12.732422 13 A 2 2 0 0 0 11 12 L 13 12 L 13 10 L 11 10 z " + transform="translate(0,1036.3622)" + id="path4176" /> </g> </svg> diff --git a/editor/icons/source/icon_vslider_bg.svg b/editor/icons/source/icon_vslider_bg.svg deleted file mode 100644 index b34dddc2d0..0000000000 --- a/editor/icons/source/icon_vslider_bg.svg +++ /dev/null @@ -1,85 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://creativecommons.org/ns#" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="16" - height="16" - viewBox="0 0 16 15.999999" - id="svg2" - version="1.1" - inkscape:version="0.92.1 r" - sodipodi:docname="vslider_bg.svg" - inkscape:export-filename="/home/djrm/Projects/godot/scene/resources/default_theme/checked.png" - inkscape:export-xdpi="90" - inkscape:export-ydpi="90"> - <defs - id="defs4" /> - <sodipodi:namedview - id="base" - pagecolor="#ffffff" - bordercolor="#666666" - borderopacity="1.0" - inkscape:pageopacity="0.0" - inkscape:pageshadow="2" - inkscape:zoom="22.627417" - inkscape:cx="10.537518" - inkscape:cy="7.6498812" - inkscape:document-units="px" - inkscape:current-layer="layer1" - showgrid="true" - units="px" - inkscape:object-paths="false" - inkscape:snap-intersection-paths="false" - inkscape:snap-bbox="true" - inkscape:bbox-paths="true" - inkscape:bbox-nodes="true" - inkscape:snap-bbox-edge-midpoints="true" - inkscape:window-width="1600" - inkscape:window-height="836" - inkscape:window-x="0" - inkscape:window-y="27" - inkscape:window-maximized="1" - inkscape:snap-smooth-nodes="true" - inkscape:object-nodes="true"> - <inkscape:grid - type="xygrid" - id="grid4136" - empspacing="4" /> - </sodipodi:namedview> - <metadata - id="metadata7"> - <rdf:RDF> - <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title /> - </cc:Work> - </rdf:RDF> - </metadata> - <g - inkscape:label="Layer 1" - inkscape:groupmode="layer" - id="layer1" - transform="translate(0,-1036.3623)"> - <g - id="layer1-5" - inkscape:label="Layer 1" - transform="rotate(90,8,1044.3623)"> - <path - id="path814" - transform="translate(0,1036.3623)" - d="m 4,5 a 3,3 0 0 0 -3,3 3,3 0 0 0 3,3 h 8 A 3,3 0 0 0 15,8 3,3 0 0 0 12,5 Z" - style="fill:#000000;fill-opacity:0.19607843;stroke:none;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - inkscape:connector-curvature="0" /> - </g> - </g> -</svg> diff --git a/editor/icons/source/icon_vsplit_bg.svg b/editor/icons/source/icon_vsplit_bg.svg deleted file mode 100644 index e11940cf53..0000000000 --- a/editor/icons/source/icon_vsplit_bg.svg +++ /dev/null @@ -1,79 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://creativecommons.org/ns#" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="8" - height="8" - viewBox="0 0 8 7.9999995" - id="svg2" - version="1.1" - inkscape:version="0.91 r13725" - sodipodi:docname="vsplit_bg.svg" - inkscape:export-filename="/home/djrm/Projects/godot/scene/resources/default_theme/panel_bg.png" - inkscape:export-xdpi="90" - inkscape:export-ydpi="90"> - <defs - id="defs4" /> - <sodipodi:namedview - id="base" - pagecolor="#ffffff" - bordercolor="#666666" - borderopacity="1.0" - inkscape:pageopacity="0.0" - inkscape:pageshadow="2" - inkscape:zoom="64.000003" - inkscape:cx="-1.1524794" - inkscape:cy="3.8847002" - inkscape:document-units="px" - inkscape:current-layer="layer1" - showgrid="true" - units="px" - inkscape:object-paths="true" - inkscape:snap-intersection-paths="true" - inkscape:snap-bbox="true" - inkscape:bbox-paths="true" - inkscape:bbox-nodes="true" - inkscape:snap-bbox-edge-midpoints="true" - inkscape:window-width="1920" - inkscape:window-height="1016" - inkscape:window-x="0" - inkscape:window-y="27" - inkscape:window-maximized="1"> - <inkscape:grid - type="xygrid" - id="grid4136" - empspacing="4" /> - </sodipodi:namedview> - <metadata - id="metadata7"> - <rdf:RDF> - <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title /> - </cc:Work> - </rdf:RDF> - </metadata> - <g - inkscape:label="Layer 1" - inkscape:groupmode="layer" - id="layer1" - transform="translate(0,-1044.3623)"> - <rect - style="opacity:1;fill:#000000;fill-opacity:0.09803922;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect4213" - width="8" - height="7.999999" - x="0" - y="1044.3623" /> - </g> -</svg> diff --git a/editor/icons/source/icon_vsplitter.svg b/editor/icons/source/icon_vsplitter.svg deleted file mode 100644 index 80f7c2ce12..0000000000 --- a/editor/icons/source/icon_vsplitter.svg +++ /dev/null @@ -1,79 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://creativecommons.org/ns#" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="64" - height="8" - viewBox="0 0 64 8" - id="svg2" - version="1.1" - inkscape:version="0.92.1 r" - inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_collapse.png" - inkscape:export-xdpi="45" - inkscape:export-ydpi="45" - sodipodi:docname="vsplitter.svg"> - <defs - id="defs4" /> - <sodipodi:namedview - id="base" - pagecolor="#ffffff" - bordercolor="#666666" - borderopacity="1.0" - inkscape:pageopacity="0.0" - inkscape:pageshadow="2" - inkscape:zoom="32.000001" - inkscape:cx="59.744611" - inkscape:cy="0.46378871" - inkscape:document-units="px" - inkscape:current-layer="layer1" - showgrid="true" - units="px" - inkscape:snap-bbox="true" - inkscape:bbox-paths="true" - inkscape:bbox-nodes="true" - inkscape:snap-bbox-edge-midpoints="true" - inkscape:snap-bbox-midpoints="false" - inkscape:snap-object-midpoints="true" - inkscape:snap-center="true" - inkscape:window-width="1600" - inkscape:window-height="836" - inkscape:window-x="0" - inkscape:window-y="27" - inkscape:window-maximized="1" - inkscape:snap-smooth-nodes="true" - inkscape:object-nodes="true"> - <inkscape:grid - type="xygrid" - id="grid3336" /> - </sodipodi:namedview> - <metadata - id="metadata7"> - <rdf:RDF> - <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title /> - </cc:Work> - </rdf:RDF> - </metadata> - <g - inkscape:label="Layer 1" - inkscape:groupmode="layer" - id="layer1" - transform="translate(0,-1044.3622)"> - <path - style="fill:none;stroke:#ffffff;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:0.39215687;stroke-miterlimit:4;stroke-dasharray:none" - d="M 2,1048.3622 H 62" - id="path814" - inkscape:connector-curvature="0" /> - </g> -</svg> diff --git a/editor/icons/source/icon_world_environment.svg b/editor/icons/source/icon_world_environment.svg index 912e348c81..33e7f86137 100644 --- a/editor/icons/source/icon_world_environment.svg +++ b/editor/icons/source/icon_world_environment.svg @@ -14,7 +14,7 @@ viewBox="0 0 16 16" id="svg2" version="1.1" - inkscape:version="0.91 r13725" + inkscape:version="0.92.1 r" inkscape:export-filename="/home/djrm/icon_node_2d.png" inkscape:export-xdpi="90" inkscape:export-ydpi="90" @@ -28,9 +28,9 @@ borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" - inkscape:zoom="31.999999" - inkscape:cx="2.4346197" - inkscape:cy="8.8876091" + inkscape:zoom="22.627416" + inkscape:cx="13.590088" + inkscape:cy="8.7617352" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="true" @@ -42,8 +42,8 @@ inkscape:snap-bbox-midpoints="true" inkscape:snap-object-midpoints="true" inkscape:snap-center="true" - inkscape:window-width="1920" - inkscape:window-height="1016" + inkscape:window-width="1600" + inkscape:window-height="836" inkscape:window-x="0" inkscape:window-y="27" inkscape:window-maximized="1" @@ -64,7 +64,7 @@ <dc:format>image/svg+xml</dc:format> <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title></dc:title> + <dc:title /> </cc:Work> </rdf:RDF> </metadata> @@ -73,36 +73,29 @@ inkscape:groupmode="layer" id="layer1" transform="translate(0,-1036.3622)"> + <circle + style="fill:none;fill-opacity:1;stroke:#fc9c9c;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.99607843" + id="path814" + cx="8" + cy="1044.3622" + r="6" /> <path - style="opacity:1;fill:#fc9c9c;fill-opacity:0.99607843;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843" - d="M 8 1 A 7 7 0 0 0 1 8 A 7 7 0 0 0 8 15 A 7 7 0 0 0 15 8 A 7 7 0 0 0 8 1 z M 8 2 A 6 6 0 0 1 14 8 A 6 6 0 0 1 8 14 A 6 6 0 0 1 2 8 A 6 6 0 0 1 8 2 z " - transform="translate(0,1036.3622)" - id="path4158" /> - <rect - style="opacity:1;fill:#fc9c9c;fill-opacity:0.99607843;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843" - id="rect4163" - width="12" - height="1" - x="2" - y="1041.3622" /> - <rect - y="1046.3622" - x="2" - height="1" - width="12" - id="rect4165" - style="opacity:1;fill:#fc9c9c;fill-opacity:0.99607843;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843" /> + style="fill:none;stroke:#fc9c9c;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.99607843" + d="m 2,1044.3622 c 4.5932382,1.582 8.398513,1.0627 12,0" + id="path816" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cc" /> <path - style="fill:none;fill-rule:evenodd;stroke:#fc9c9c;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0.99607843" - d="m 8,1038.3622 c 0,0 -3.5,2 -3.5,6 0,4 3.5,6 3.5,6" - id="path4167" + sodipodi:nodetypes="cc" inkscape:connector-curvature="0" - sodipodi:nodetypes="czc" /> + id="path820" + d="m 8,1038.3622 c -3,4 -3,8 0,12" + style="fill:none;stroke:#fc9c9c;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.99607843" /> <path - sodipodi:nodetypes="czc" + style="fill:none;stroke:#fc9c9c;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.99607843" + d="m 8,1038.3622 c 3,4 3,8 0,12" + id="path822" inkscape:connector-curvature="0" - id="path4169" - d="m 8,1038.3622 c 0,0 3.5,2 3.5,6 0,4 -3.5,6 -3.5,6" - style="fill:none;fill-rule:evenodd;stroke:#fc9c9c;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0.99607843" /> + sodipodi:nodetypes="cc" /> </g> </svg> diff --git a/editor/import/resource_importer_scene.cpp b/editor/import/resource_importer_scene.cpp index 2ccbd36e18..dbf7a1bea5 100644 --- a/editor/import/resource_importer_scene.cpp +++ b/editor/import/resource_importer_scene.cpp @@ -33,7 +33,7 @@ #include "io/resource_saver.h" #include "scene/resources/packed_scene.h" -#include "scene/3d/body_shape.h" +#include "scene/3d/collision_shape.h" #include "scene/3d/mesh_instance.h" #include "scene/3d/navigation.h" #include "scene/3d/physics_body.h" @@ -369,10 +369,8 @@ Node *ResourceImporterScene::_fix_node(Node *p_node, Node *p_root, Map<Ref<Array p_node = col; StaticBody *sb = col->cast_to<StaticBody>(); - CollisionShape *colshape = memnew(CollisionShape); - colshape->set_shape(sb->get_shape(0)); + CollisionShape *colshape = sb->get_child(0)->cast_to<CollisionShape>(); colshape->set_name("shape"); - sb->add_child(colshape); colshape->set_owner(p_node->get_owner()); } else if (p_node->has_meta("empty_draw_type")) { String empty_draw_type = String(p_node->get_meta("empty_draw_type")); @@ -463,8 +461,7 @@ Node *ResourceImporterScene::_fix_node(Node *p_node, Node *p_root, Map<Ref<Array p_node->add_child(col); StaticBody *sb = col->cast_to<StaticBody>(); - CollisionShape *colshape = memnew(CollisionShape); - colshape->set_shape(sb->get_shape(0)); + CollisionShape *colshape = sb->get_child(0)->cast_to<CollisionShape>(); colshape->set_name("shape"); col->add_child(colshape); colshape->set_owner(p_node->get_owner()); diff --git a/editor/plugins/collision_polygon_editor_plugin.cpp b/editor/plugins/collision_polygon_editor_plugin.cpp index c89e6f59a4..5b364ed2c1 100644 --- a/editor/plugins/collision_polygon_editor_plugin.cpp +++ b/editor/plugins/collision_polygon_editor_plugin.cpp @@ -35,339 +35,304 @@ #include "scene/3d/camera.h" #include "spatial_editor_plugin.h" -#if 0 - void CollisionPolygonEditor::_notification(int p_what) { - switch(p_what) { + switch (p_what) { case NOTIFICATION_READY: { - button_create->set_icon( get_icon("Edit","EditorIcons")); - button_edit->set_icon( get_icon("MovePoint","EditorIcons")); + button_create->set_icon(get_icon("Edit", "EditorIcons")); + button_edit->set_icon(get_icon("MovePoint", "EditorIcons")); button_edit->set_pressed(true); - get_tree()->connect("node_removed",this,"_node_removed"); - + get_tree()->connect("node_removed", this, "_node_removed"); } break; case NOTIFICATION_PROCESS: { if (node->get_depth() != prev_depth) { _polygon_draw(); - prev_depth=node->get_depth(); + prev_depth = node->get_depth(); } } break; } - } void CollisionPolygonEditor::_node_removed(Node *p_node) { - if(p_node==node) { - node=NULL; - if (imgeom->get_parent()==p_node) + if (p_node == node) { + node = NULL; + if (imgeom->get_parent() == p_node) p_node->remove_child(imgeom); hide(); set_process(false); } - } - void CollisionPolygonEditor::_menu_option(int p_option) { - switch(p_option) { + switch (p_option) { case MODE_CREATE: { - mode=MODE_CREATE; + mode = MODE_CREATE; button_create->set_pressed(true); button_edit->set_pressed(false); } break; case MODE_EDIT: { - mode=MODE_EDIT; + mode = MODE_EDIT; button_create->set_pressed(false); button_edit->set_pressed(true); } break; - } } void CollisionPolygonEditor::_wip_close() { undo_redo->create_action(TTR("Create Poly3D")); - undo_redo->add_undo_method(node,"set_polygon",node->get_polygon()); - undo_redo->add_do_method(node,"set_polygon",wip); - undo_redo->add_do_method(this,"_polygon_draw"); - undo_redo->add_undo_method(this,"_polygon_draw"); + undo_redo->add_undo_method(node, "set_polygon", node->get_polygon()); + undo_redo->add_do_method(node, "set_polygon", wip); + undo_redo->add_do_method(this, "_polygon_draw"); + undo_redo->add_undo_method(this, "_polygon_draw"); wip.clear(); - wip_active=false; - mode=MODE_EDIT; + wip_active = false; + mode = MODE_EDIT; button_edit->set_pressed(true); button_create->set_pressed(false); - edited_point=-1; + edited_point = -1; undo_redo->commit_action(); - } -bool CollisionPolygonEditor::forward_spatial_gui_input(Camera* p_camera,const InputEvent& p_event) { +bool CollisionPolygonEditor::forward_spatial_gui_input(Camera *p_camera, const Ref<InputEvent> &p_event) { if (!node) return false; Transform gt = node->get_global_transform(); Transform gi = gt.affine_inverse(); - float depth = node->get_depth()*0.5; + float depth = node->get_depth() * 0.5; Vector3 n = gt.basis.get_axis(2).normalized(); - Plane p(gt.origin+n*depth,n); - - - switch(p_event.type) { + Plane p(gt.origin + n * depth, n); - case InputEvent::MOUSE_BUTTON: { + Ref<InputEventMouseButton> mb = p_event; - const InputEventMouseButton &mb=p_event.mouse_button; + if (mb.is_valid()) { + Vector2 gpoint = mb->get_position(); + Vector3 ray_from = p_camera->project_ray_origin(gpoint); + Vector3 ray_dir = p_camera->project_ray_normal(gpoint); + Vector3 spoint; - Vector2 gpoint=Point2(mb->get_pos().x,mb->get_pos().y); - Vector3 ray_from = p_camera->project_ray_origin(gpoint); - Vector3 ray_dir = p_camera->project_ray_normal(gpoint); - - Vector3 spoint; - - if (!p.intersects_ray(ray_from,ray_dir,&spoint)) - break; + if (!p.intersects_ray(ray_from, ray_dir, &spoint)) + return false; - spoint = gi.xform(spoint); + spoint = gi.xform(spoint); - Vector2 cpoint(spoint.x,spoint.y); + Vector2 cpoint(spoint.x, spoint.y); - cpoint=CanvasItemEditor::get_singleton()->snap_point(cpoint); + cpoint = CanvasItemEditor::get_singleton()->snap_point(cpoint); - Vector<Vector2> poly = node->get_polygon(); + Vector<Vector2> poly = node->get_polygon(); - //first check if a point is to be added (segment split) - real_t grab_treshold=EDITOR_DEF("editors/poly_editor/point_grab_radius",8); + //first check if a point is to be added (segment split) + real_t grab_treshold = EDITOR_DEF("editors/poly_editor/point_grab_radius", 8); - switch(mode) { + switch (mode) { + case MODE_CREATE: { - case MODE_CREATE: { + if (mb->get_button_index() == BUTTON_LEFT && mb->is_pressed()) { - if (mb->get_button_index()==BUTTON_LEFT && mb->is_pressed()) { + if (!wip_active) { + wip.clear(); + wip.push_back(cpoint); + wip_active = true; + edited_point_pos = cpoint; + _polygon_draw(); + edited_point = 1; + return true; + } else { - if (!wip_active) { + if (wip.size() > 1 && p_camera->unproject_position(gt.xform(Vector3(wip[0].x, wip[0].y, depth))).distance_to(gpoint) < grab_treshold) { + //wip closed + _wip_close(); - wip.clear(); - wip.push_back( cpoint ); - wip_active=true; - edited_point_pos=cpoint; - _polygon_draw(); - edited_point=1; return true; } else { - - if (wip.size()>1 && p_camera->unproject_position(gt.xform(Vector3(wip[0].x,wip[0].y,depth))).distance_to(gpoint)<grab_treshold) { - //wip closed - _wip_close(); - - return true; - } else { - - wip.push_back( cpoint ); - edited_point=wip.size(); - _polygon_draw(); - return true; - - //add wip point - } + wip.push_back(cpoint); + edited_point = wip.size(); + _polygon_draw(); + return true; } - } else if (mb->get_button_index()==BUTTON_RIGHT && mb->is_pressed() && wip_active) { - _wip_close(); } + } else if (mb->get_button_index() == BUTTON_RIGHT && mb->is_pressed() && wip_active) { + _wip_close(); + } + } break; + case MODE_EDIT: { - } break; + if (mb->get_button_index() == BUTTON_LEFT) { + if (mb->is_pressed()) { - case MODE_EDIT: { + if (mb->get_control()) { - if (mb->get_button_index()==BUTTON_LEFT) { - if (mb->is_pressed()) { + if (poly.size() < 3) { - if (mb->get_control()) { - - - if (poly.size() < 3) { - - undo_redo->create_action(TTR("Edit Poly")); - undo_redo->add_undo_method(node,"set_polygon",poly); - poly.push_back(cpoint); - undo_redo->add_do_method(node,"set_polygon",poly); - undo_redo->add_do_method(this,"_polygon_draw"); - undo_redo->add_undo_method(this,"_polygon_draw"); - undo_redo->commit_action(); - return true; - } - - //search edges - int closest_idx=-1; - Vector2 closest_pos; - real_t closest_dist=1e10; - for(int i=0;i<poly.size();i++) { - - Vector2 points[2] ={ - p_camera->unproject_position(gt.xform(Vector3(poly[i].x,poly[i].y,depth))), - p_camera->unproject_position(gt.xform(Vector3(poly[(i+1)%poly.size()].x,poly[(i+1)%poly.size()].y,depth))) - }; - - Vector2 cp = Geometry::get_closest_point_to_segment_2d(gpoint,points); - if (cp.distance_squared_to(points[0])<CMP_EPSILON2 || cp.distance_squared_to(points[1])<CMP_EPSILON2) - continue; //not valid to reuse point - - real_t d = cp.distance_to(gpoint); - if (d<closest_dist && d<grab_treshold) { - closest_dist=d; - closest_pos=cp; - closest_idx=i; - } - - - } - - if (closest_idx>=0) { - - pre_move_edit=poly; - poly.insert(closest_idx+1,cpoint); - edited_point=closest_idx+1; - edited_point_pos=cpoint; - node->set_polygon(poly); - _polygon_draw(); - return true; - } - } else { - - //look for points to move - - int closest_idx=-1; - Vector2 closest_pos; - real_t closest_dist=1e10; - for(int i=0;i<poly.size();i++) { - - Vector2 cp = p_camera->unproject_position(gt.xform(Vector3(poly[i].x,poly[i].y,depth))); - - real_t d = cp.distance_to(gpoint); - if (d<closest_dist && d<grab_treshold) { - closest_dist=d; - closest_pos=cp; - closest_idx=i; - } + undo_redo->create_action(TTR("Edit Poly")); + undo_redo->add_undo_method(node, "set_polygon", poly); + poly.push_back(cpoint); + undo_redo->add_do_method(node, "set_polygon", poly); + undo_redo->add_do_method(this, "_polygon_draw"); + undo_redo->add_undo_method(this, "_polygon_draw"); + undo_redo->commit_action(); + return true; + } + //search edges + int closest_idx = -1; + Vector2 closest_pos; + real_t closest_dist = 1e10; + for (int i = 0; i < poly.size(); i++) { + + Vector2 points[2] = { + p_camera->unproject_position(gt.xform(Vector3(poly[i].x, poly[i].y, depth))), + p_camera->unproject_position(gt.xform(Vector3(poly[(i + 1) % poly.size()].x, poly[(i + 1) % poly.size()].y, depth))) + }; + + Vector2 cp = Geometry::get_closest_point_to_segment_2d(gpoint, points); + if (cp.distance_squared_to(points[0]) < CMP_EPSILON2 || cp.distance_squared_to(points[1]) < CMP_EPSILON2) + continue; //not valid to reuse point + + real_t d = cp.distance_to(gpoint); + if (d < closest_dist && d < grab_treshold) { + closest_dist = d; + closest_pos = cp; + closest_idx = i; } + } - if (closest_idx>=0) { + if (closest_idx >= 0) { - pre_move_edit=poly; - edited_point=closest_idx; - edited_point_pos=poly[closest_idx]; - _polygon_draw(); - return true; - } + pre_move_edit = poly; + poly.insert(closest_idx + 1, cpoint); + edited_point = closest_idx + 1; + edited_point_pos = cpoint; + node->set_polygon(poly); + _polygon_draw(); + return true; } } else { - if (edited_point!=-1) { + //look for points to move - //apply + int closest_idx = -1; + Vector2 closest_pos; + real_t closest_dist = 1e10; + for (int i = 0; i < poly.size(); i++) { - ERR_FAIL_INDEX_V(edited_point,poly.size(),false); - poly[edited_point]=edited_point_pos; - undo_redo->create_action(TTR("Edit Poly")); - undo_redo->add_do_method(node,"set_polygon",poly); - undo_redo->add_undo_method(node,"set_polygon",pre_move_edit); - undo_redo->add_do_method(this,"_polygon_draw"); - undo_redo->add_undo_method(this,"_polygon_draw"); - undo_redo->commit_action(); + Vector2 cp = p_camera->unproject_position(gt.xform(Vector3(poly[i].x, poly[i].y, depth))); - edited_point=-1; - return true; + real_t d = cp.distance_to(gpoint); + if (d < closest_dist && d < grab_treshold) { + closest_dist = d; + closest_pos = cp; + closest_idx = i; + } } - } - } if (mb->get_button_index()==BUTTON_RIGHT && mb->is_pressed() && edited_point==-1) { - + if (closest_idx >= 0) { - int closest_idx=-1; - Vector2 closest_pos; - real_t closest_dist=1e10; - for(int i=0;i<poly.size();i++) { - - Vector2 cp = p_camera->unproject_position(gt.xform(Vector3(poly[i].x,poly[i].y,depth))); - - real_t d = cp.distance_to(gpoint); - if (d<closest_dist && d<grab_treshold) { - closest_dist=d; - closest_pos=cp; - closest_idx=i; + pre_move_edit = poly; + edited_point = closest_idx; + edited_point_pos = poly[closest_idx]; + _polygon_draw(); + return true; } - } + } else { - if (closest_idx>=0) { + if (edited_point != -1) { + //apply - undo_redo->create_action(TTR("Edit Poly (Remove Point)")); - undo_redo->add_undo_method(node,"set_polygon",poly); - poly.remove(closest_idx); - undo_redo->add_do_method(node,"set_polygon",poly); - undo_redo->add_do_method(this,"_polygon_draw"); - undo_redo->add_undo_method(this,"_polygon_draw"); + ERR_FAIL_INDEX_V(edited_point, poly.size(), false); + poly[edited_point] = edited_point_pos; + undo_redo->create_action(TTR("Edit Poly")); + undo_redo->add_do_method(node, "set_polygon", poly); + undo_redo->add_undo_method(node, "set_polygon", pre_move_edit); + undo_redo->add_do_method(this, "_polygon_draw"); + undo_redo->add_undo_method(this, "_polygon_draw"); undo_redo->commit_action(); + + edited_point = -1; return true; } - } + } + if (mb->get_button_index() == BUTTON_RIGHT && mb->is_pressed() && edited_point == -1) { + int closest_idx = -1; + Vector2 closest_pos; + real_t closest_dist = 1e10; + for (int i = 0; i < poly.size(); i++) { + Vector2 cp = p_camera->unproject_position(gt.xform(Vector3(poly[i].x, poly[i].y, depth))); - } break; - } - + real_t d = cp.distance_to(gpoint); + if (d < closest_dist && d < grab_treshold) { + closest_dist = d; + closest_pos = cp; + closest_idx = i; + } + } + if (closest_idx >= 0) { - } break; - case InputEvent::MOUSE_MOTION: { + undo_redo->create_action(TTR("Edit Poly (Remove Point)")); + undo_redo->add_undo_method(node, "set_polygon", poly); + poly.remove(closest_idx); + undo_redo->add_do_method(node, "set_polygon", poly); + undo_redo->add_do_method(this, "_polygon_draw"); + undo_redo->add_undo_method(this, "_polygon_draw"); + undo_redo->commit_action(); + return true; + } + } - const InputEventMouseMotion &mm=p_event.mouse_motion; + } break; + } + } - if (edited_point!=-1 && (wip_active || mm->get_button_mask()&BUTTON_MASK_LEFT)) { + Ref<InputEventMouseMotion> mm = p_event; - Vector2 gpoint = Point2(mm.x,mm.y); + if (mm.is_valid()) { - Vector3 ray_from = p_camera->project_ray_origin(gpoint); - Vector3 ray_dir = p_camera->project_ray_normal(gpoint); + if (edited_point != -1 && (wip_active || mm->get_button_mask() & BUTTON_MASK_LEFT)) { - Vector3 spoint; + Vector2 gpoint = mm->get_position(); - if (!p.intersects_ray(ray_from,ray_dir,&spoint)) - break; + Vector3 ray_from = p_camera->project_ray_origin(gpoint); + Vector3 ray_dir = p_camera->project_ray_normal(gpoint); - spoint = gi.xform(spoint); + Vector3 spoint; - Vector2 cpoint(spoint.x,spoint.y); + if (!p.intersects_ray(ray_from, ray_dir, &spoint)) + return false; - cpoint=CanvasItemEditor::get_singleton()->snap_point(cpoint); - edited_point_pos = cpoint; + spoint = gi.xform(spoint); - _polygon_draw(); + Vector2 cpoint(spoint.x, spoint.y); - } + cpoint = CanvasItemEditor::get_singleton()->snap_point(cpoint); + edited_point_pos = cpoint; - } break; + _polygon_draw(); + } } return false; @@ -380,41 +345,38 @@ void CollisionPolygonEditor::_polygon_draw() { Vector<Vector2> poly; if (wip_active) - poly=wip; + poly = wip; else - poly=node->get_polygon(); - + poly = node->get_polygon(); - float depth = node->get_depth()*0.5; + float depth = node->get_depth() * 0.5; imgeom->clear(); imgeom->set_material_override(line_material); - imgeom->begin(Mesh::PRIMITIVE_LINES,Ref<Texture>()); - + imgeom->begin(Mesh::PRIMITIVE_LINES, Ref<Texture>()); Rect2 rect; - for(int i=0;i<poly.size();i++) { - + for (int i = 0; i < poly.size(); i++) { - Vector2 p,p2; - p = i==edited_point ? edited_point_pos : poly[i]; - if ((wip_active && i==poly.size()-1) || (((i+1)%poly.size())==edited_point)) - p2=edited_point_pos; + Vector2 p, p2; + p = i == edited_point ? edited_point_pos : poly[i]; + if ((wip_active && i == poly.size() - 1) || (((i + 1) % poly.size()) == edited_point)) + p2 = edited_point_pos; else - p2 = poly[(i+1)%poly.size()]; + p2 = poly[(i + 1) % poly.size()]; - if (i==0) - rect.pos=p; + if (i == 0) + rect.position = p; else rect.expand_to(p); - Vector3 point = Vector3(p.x,p.y,depth); - Vector3 next_point = Vector3(p2.x,p2.y,depth); + Vector3 point = Vector3(p.x, p.y, depth); + Vector3 next_point = Vector3(p2.x, p2.y, depth); - imgeom->set_color(Color(1,0.3,0.1,0.8)); + imgeom->set_color(Color(1, 0.3, 0.1, 0.8)); imgeom->add_vertex(point); - imgeom->set_color(Color(1,0.3,0.1,0.8)); + imgeom->set_color(Color(1, 0.3, 0.1, 0.8)); imgeom->add_vertex(next_point); //Color col=Color(1,0.3,0.1,0.8); @@ -422,60 +384,59 @@ void CollisionPolygonEditor::_polygon_draw() { //vpc->draw_texture(handle,point-handle->get_size()*0.5); } - rect=rect.grow(1); - - AABB r; - r.pos.x=rect.pos.x; - r.pos.y=rect.pos.y; - r.pos.z=depth; - r.size.x=rect.size.x; - r.size.y=rect.size.y; - r.size.z=0; - - imgeom->set_color(Color(0.8,0.8,0.8,0.2)); - imgeom->add_vertex(r.pos); - imgeom->set_color(Color(0.8,0.8,0.8,0.2)); - imgeom->add_vertex(r.pos+Vector3(0.3,0,0)); - imgeom->set_color(Color(0.8,0.8,0.8,0.2)); - imgeom->add_vertex(r.pos); - imgeom->set_color(Color(0.8,0.8,0.8,0.2)); - imgeom->add_vertex(r.pos+Vector3(0.0,0.3,0)); - - imgeom->set_color(Color(0.8,0.8,0.8,0.2)); - imgeom->add_vertex(r.pos+Vector3(r.size.x,0,0)); - imgeom->set_color(Color(0.8,0.8,0.8,0.2)); - imgeom->add_vertex(r.pos+Vector3(r.size.x,0,0)-Vector3(0.3,0,0)); - imgeom->set_color(Color(0.8,0.8,0.8,0.2)); - imgeom->add_vertex(r.pos+Vector3(r.size.x,0,0)); - imgeom->set_color(Color(0.8,0.8,0.8,0.2)); - imgeom->add_vertex(r.pos+Vector3(r.size.x,0,0)+Vector3(0,0.3,0)); - - imgeom->set_color(Color(0.8,0.8,0.8,0.2)); - imgeom->add_vertex(r.pos+Vector3(0,r.size.y,0)); - imgeom->set_color(Color(0.8,0.8,0.8,0.2)); - imgeom->add_vertex(r.pos+Vector3(0,r.size.y,0)-Vector3(0,0.3,0)); - imgeom->set_color(Color(0.8,0.8,0.8,0.2)); - imgeom->add_vertex(r.pos+Vector3(0,r.size.y,0)); - imgeom->set_color(Color(0.8,0.8,0.8,0.2)); - imgeom->add_vertex(r.pos+Vector3(0,r.size.y,0)+Vector3(0.3,0,0)); - - imgeom->set_color(Color(0.8,0.8,0.8,0.2)); - imgeom->add_vertex(r.pos+r.size); - imgeom->set_color(Color(0.8,0.8,0.8,0.2)); - imgeom->add_vertex(r.pos+r.size-Vector3(0.3,0,0)); - imgeom->set_color(Color(0.8,0.8,0.8,0.2)); - imgeom->add_vertex(r.pos+r.size); - imgeom->set_color(Color(0.8,0.8,0.8,0.2)); - imgeom->add_vertex(r.pos+r.size-Vector3(0.0,0.3,0)); + rect = rect.grow(1); + + Rect3 r; + r.position.x = rect.position.x; + r.position.y = rect.position.y; + r.position.z = depth; + r.size.x = rect.size.x; + r.size.y = rect.size.y; + r.size.z = 0; + + imgeom->set_color(Color(0.8, 0.8, 0.8, 0.2)); + imgeom->add_vertex(r.position); + imgeom->set_color(Color(0.8, 0.8, 0.8, 0.2)); + imgeom->add_vertex(r.position + Vector3(0.3, 0, 0)); + imgeom->set_color(Color(0.8, 0.8, 0.8, 0.2)); + imgeom->add_vertex(r.position); + imgeom->set_color(Color(0.8, 0.8, 0.8, 0.2)); + imgeom->add_vertex(r.position + Vector3(0.0, 0.3, 0)); + + imgeom->set_color(Color(0.8, 0.8, 0.8, 0.2)); + imgeom->add_vertex(r.position + Vector3(r.size.x, 0, 0)); + imgeom->set_color(Color(0.8, 0.8, 0.8, 0.2)); + imgeom->add_vertex(r.position + Vector3(r.size.x, 0, 0) - Vector3(0.3, 0, 0)); + imgeom->set_color(Color(0.8, 0.8, 0.8, 0.2)); + imgeom->add_vertex(r.position + Vector3(r.size.x, 0, 0)); + imgeom->set_color(Color(0.8, 0.8, 0.8, 0.2)); + imgeom->add_vertex(r.position + Vector3(r.size.x, 0, 0) + Vector3(0, 0.3, 0)); + + imgeom->set_color(Color(0.8, 0.8, 0.8, 0.2)); + imgeom->add_vertex(r.position + Vector3(0, r.size.y, 0)); + imgeom->set_color(Color(0.8, 0.8, 0.8, 0.2)); + imgeom->add_vertex(r.position + Vector3(0, r.size.y, 0) - Vector3(0, 0.3, 0)); + imgeom->set_color(Color(0.8, 0.8, 0.8, 0.2)); + imgeom->add_vertex(r.position + Vector3(0, r.size.y, 0)); + imgeom->set_color(Color(0.8, 0.8, 0.8, 0.2)); + imgeom->add_vertex(r.position + Vector3(0, r.size.y, 0) + Vector3(0.3, 0, 0)); + + imgeom->set_color(Color(0.8, 0.8, 0.8, 0.2)); + imgeom->add_vertex(r.position + r.size); + imgeom->set_color(Color(0.8, 0.8, 0.8, 0.2)); + imgeom->add_vertex(r.position + r.size - Vector3(0.3, 0, 0)); + imgeom->set_color(Color(0.8, 0.8, 0.8, 0.2)); + imgeom->add_vertex(r.position + r.size); + imgeom->set_color(Color(0.8, 0.8, 0.8, 0.2)); + imgeom->add_vertex(r.position + r.size - Vector3(0.0, 0.3, 0)); imgeom->end(); - - while(m->get_surface_count()) { + while (m->get_surface_count()) { m->surface_remove(0); } - if (poly.size()==0) + if (poly.size() == 0) return; Array a; @@ -484,78 +445,69 @@ void CollisionPolygonEditor::_polygon_draw() { { va.resize(poly.size()); - PoolVector<Vector3>::Write w=va.write(); - for(int i=0;i<poly.size();i++) { - + PoolVector<Vector3>::Write w = va.write(); + for (int i = 0; i < poly.size(); i++) { - Vector2 p,p2; - p = i==edited_point ? edited_point_pos : poly[i]; + Vector2 p, p2; + p = i == edited_point ? edited_point_pos : poly[i]; - Vector3 point = Vector3(p.x,p.y,depth); - w[i]=point; + Vector3 point = Vector3(p.x, p.y, depth); + w[i] = point; } } - a[Mesh::ARRAY_VERTEX]=va; - m->add_surface(Mesh::PRIMITIVE_POINTS,a); - m->surface_set_material(0,handle_material); - + a[Mesh::ARRAY_VERTEX] = va; + m->add_surface_from_arrays(Mesh::PRIMITIVE_POINTS, a); + m->surface_set_material(0, handle_material); } - - void CollisionPolygonEditor::edit(Node *p_collision_polygon) { - - if (p_collision_polygon) { - node=p_collision_polygon->cast_to<CollisionPolygon>(); + node = p_collision_polygon->cast_to<CollisionPolygon>(); wip.clear(); - wip_active=false; - edited_point=-1; + wip_active = false; + edited_point = -1; p_collision_polygon->add_child(imgeom); _polygon_draw(); set_process(true); - prev_depth=-1; + prev_depth = -1; } else { - node=NULL; + node = NULL; if (imgeom->get_parent()) imgeom->get_parent()->remove_child(imgeom); set_process(false); } - } void CollisionPolygonEditor::_bind_methods() { - ClassDB::bind_method(D_METHOD("_menu_option"),&CollisionPolygonEditor::_menu_option); - ClassDB::bind_method(D_METHOD("_polygon_draw"),&CollisionPolygonEditor::_polygon_draw); - ClassDB::bind_method(D_METHOD("_node_removed"),&CollisionPolygonEditor::_node_removed); - + ClassDB::bind_method(D_METHOD("_menu_option"), &CollisionPolygonEditor::_menu_option); + ClassDB::bind_method(D_METHOD("_polygon_draw"), &CollisionPolygonEditor::_polygon_draw); + ClassDB::bind_method(D_METHOD("_node_removed"), &CollisionPolygonEditor::_node_removed); } CollisionPolygonEditor::CollisionPolygonEditor(EditorNode *p_editor) { - - node=NULL; - editor=p_editor; + node = NULL; + editor = p_editor; undo_redo = editor->get_undo_redo(); - add_child( memnew( VSeparator )); - button_create = memnew( ToolButton ); + add_child(memnew(VSeparator)); + button_create = memnew(ToolButton); add_child(button_create); - button_create->connect("pressed",this,"_menu_option",varray(MODE_CREATE)); + button_create->connect("pressed", this, "_menu_option", varray(MODE_CREATE)); button_create->set_toggle_mode(true); - button_edit = memnew( ToolButton ); + button_edit = memnew(ToolButton); add_child(button_edit); - button_edit->connect("pressed",this,"_menu_option",varray(MODE_EDIT)); + button_edit->connect("pressed", this, "_menu_option", varray(MODE_EDIT)); button_edit->set_toggle_mode(true); - //add_constant_override("separation",0); +//add_constant_override("separation",0); #if 0 options = memnew( MenuButton ); @@ -567,46 +519,40 @@ CollisionPolygonEditor::CollisionPolygonEditor(EditorNode *p_editor) { #endif mode = MODE_EDIT; - wip_active=false; - imgeom = memnew( ImmediateGeometry ); - imgeom->set_transform(Transform(Matrix3(),Vector3(0,0,0.00001))); - + wip_active = false; + imgeom = memnew(ImmediateGeometry); + imgeom->set_transform(Transform(Basis(), Vector3(0, 0, 0.00001))); - line_material = Ref<SpatialMaterial>( memnew( SpatialMaterial )); - line_material->set_flag(Material::FLAG_UNSHADED, true); + line_material = Ref<SpatialMaterial>(memnew(SpatialMaterial)); + line_material->set_flag(SpatialMaterial::FLAG_UNSHADED, true); line_material->set_line_width(3.0); - line_material->set_fixed_flag(SpatialMaterial::FLAG_USE_ALPHA, true); - line_material->set_fixed_flag(SpatialMaterial::FLAG_USE_COLOR_ARRAY, true); - line_material->set_parameter(SpatialMaterial::PARAM_DIFFUSE,Color(1,1,1)); - - - - - handle_material = Ref<SpatialMaterial>( memnew( SpatialMaterial )); - handle_material->set_flag(Material::FLAG_UNSHADED, true); - handle_material->set_fixed_flag(SpatialMaterial::FLAG_USE_POINT_SIZE, true); - handle_material->set_parameter(SpatialMaterial::PARAM_DIFFUSE,Color(1,1,1)); - handle_material->set_fixed_flag(SpatialMaterial::FLAG_USE_ALPHA, true); - handle_material->set_fixed_flag(SpatialMaterial::FLAG_USE_COLOR_ARRAY, false); - Ref<Texture> handle=editor->get_gui_base()->get_icon("Editor3DHandle","EditorIcons"); + line_material->set_feature(SpatialMaterial::FEATURE_TRANSPARENT, true); + line_material->set_flag(SpatialMaterial::FLAG_ALBEDO_FROM_VERTEX_COLOR, true); + line_material->set_flag(SpatialMaterial::FLAG_SRGB_VERTEX_COLOR, true); + line_material->set_albedo(Color(1, 1, 1)); + + handle_material = Ref<SpatialMaterial>(memnew(SpatialMaterial)); + handle_material->set_flag(SpatialMaterial::FLAG_UNSHADED, true); + handle_material->set_flag(SpatialMaterial::FLAG_USE_POINT_SIZE, true); + handle_material->set_feature(SpatialMaterial::FEATURE_TRANSPARENT, true); + handle_material->set_flag(SpatialMaterial::FLAG_ALBEDO_FROM_VERTEX_COLOR, true); + handle_material->set_flag(SpatialMaterial::FLAG_SRGB_VERTEX_COLOR, true); + Ref<Texture> handle = editor->get_gui_base()->get_icon("Editor3DHandle", "EditorIcons"); handle_material->set_point_size(handle->get_width()); - handle_material->set_texture(SpatialMaterial::PARAM_DIFFUSE,handle); + handle_material->set_texture(SpatialMaterial::TEXTURE_ALBEDO, handle); - pointsm = memnew( MeshInstance ); + pointsm = memnew(MeshInstance); imgeom->add_child(pointsm); - m = Ref<Mesh>( memnew( Mesh ) ); + m.instance(); pointsm->set_mesh(m); - pointsm->set_transform(Transform(Matrix3(),Vector3(0,0,0.00001))); - - + pointsm->set_transform(Transform(Basis(), Vector3(0, 0, 0.00001))); } CollisionPolygonEditor::~CollisionPolygonEditor() { - memdelete( imgeom ); + memdelete(imgeom); } - void CollisionPolygonEditorPlugin::edit(Object *p_object) { collision_polygon_editor->edit(p_object->cast_to<Node>()); @@ -614,7 +560,7 @@ void CollisionPolygonEditorPlugin::edit(Object *p_object) { bool CollisionPolygonEditorPlugin::handles(Object *p_object) const { - return p_object->is_type("CollisionPolygon"); + return p_object->is_class("CollisionPolygon"); } void CollisionPolygonEditorPlugin::make_visible(bool p_visible) { @@ -626,24 +572,16 @@ void CollisionPolygonEditorPlugin::make_visible(bool p_visible) { collision_polygon_editor->hide(); collision_polygon_editor->edit(NULL); } - } CollisionPolygonEditorPlugin::CollisionPolygonEditorPlugin(EditorNode *p_node) { - editor=p_node; - collision_polygon_editor = memnew( CollisionPolygonEditor(p_node) ); + editor = p_node; + collision_polygon_editor = memnew(CollisionPolygonEditor(p_node)); SpatialEditor::get_singleton()->add_control_to_menu_panel(collision_polygon_editor); collision_polygon_editor->hide(); - - - } - -CollisionPolygonEditorPlugin::~CollisionPolygonEditorPlugin() -{ +CollisionPolygonEditorPlugin::~CollisionPolygonEditorPlugin() { } - -#endif diff --git a/editor/plugins/collision_polygon_editor_plugin.h b/editor/plugins/collision_polygon_editor_plugin.h index 995f2224bf..3a8428fc62 100644 --- a/editor/plugins/collision_polygon_editor_plugin.h +++ b/editor/plugins/collision_polygon_editor_plugin.h @@ -42,12 +42,11 @@ @author Juan Linietsky <reduzio@gmail.com> */ -#if 0 class CanvasItemEditor; class CollisionPolygonEditor : public HBoxContainer { - GDCLASS(CollisionPolygonEditor, HBoxContainer ); + GDCLASS(CollisionPolygonEditor, HBoxContainer); UndoRedo *undo_redo; enum Mode { @@ -62,7 +61,6 @@ class CollisionPolygonEditor : public HBoxContainer { ToolButton *button_create; ToolButton *button_edit; - Ref<SpatialMaterial> line_material; Ref<SpatialMaterial> handle_material; @@ -71,7 +69,7 @@ class CollisionPolygonEditor : public HBoxContainer { CollisionPolygon *node; ImmediateGeometry *imgeom; MeshInstance *pointsm; - Ref<Mesh> m; + Ref<ArrayMesh> m; MenuButton *options; @@ -91,9 +89,9 @@ protected: void _notification(int p_what); void _node_removed(Node *p_node); static void _bind_methods(); -public: - virtual bool forward_spatial_gui_input(Camera* p_camera,const InputEvent& p_event); +public: + virtual bool forward_spatial_gui_input(Camera *p_camera, const Ref<InputEvent> &p_event); void edit(Node *p_collision_polygon); CollisionPolygonEditor(EditorNode *p_editor); ~CollisionPolygonEditor(); @@ -101,14 +99,13 @@ public: class CollisionPolygonEditorPlugin : public EditorPlugin { - GDCLASS( CollisionPolygonEditorPlugin, EditorPlugin ); + GDCLASS(CollisionPolygonEditorPlugin, EditorPlugin); CollisionPolygonEditor *collision_polygon_editor; EditorNode *editor; public: - - virtual bool forward_spatial_gui_input(Camera* p_camera,const InputEvent& p_event) { return collision_polygon_editor->forward_spatial_gui_input(p_camera,p_event); } + virtual bool forward_spatial_gui_input(Camera *p_camera, const Ref<InputEvent> &p_event) { return collision_polygon_editor->forward_spatial_gui_input(p_camera, p_event); } virtual String get_name() const { return "CollisionPolygon"; } bool has_main_screen() const { return false; } @@ -118,7 +115,6 @@ public: CollisionPolygonEditorPlugin(EditorNode *p_node); ~CollisionPolygonEditorPlugin(); - }; -#endif + #endif // COLLISION_POLYGON_EDITOR_PLUGIN_H diff --git a/editor/plugins/mesh_instance_editor_plugin.cpp b/editor/plugins/mesh_instance_editor_plugin.cpp index ab09d0dd96..49498d0fa0 100644 --- a/editor/plugins/mesh_instance_editor_plugin.cpp +++ b/editor/plugins/mesh_instance_editor_plugin.cpp @@ -29,7 +29,7 @@ /*************************************************************************/ #include "mesh_instance_editor_plugin.h" -#include "scene/3d/body_shape.h" +#include "scene/3d/collision_shape.h" #include "scene/3d/navigation_mesh.h" #include "scene/3d/physics_body.h" #include "scene/gui/box_container.h" diff --git a/editor/plugins/path_2d_editor_plugin.cpp b/editor/plugins/path_2d_editor_plugin.cpp index f9f16fea16..3a210f3fe0 100644 --- a/editor/plugins/path_2d_editor_plugin.cpp +++ b/editor/plugins/path_2d_editor_plugin.cpp @@ -248,7 +248,7 @@ bool Path2DEditor::forward_gui_input(const Ref<InputEvent> &p_event) { edited_point=1; return true; } else { - if (wip.size()>1 && xform.xform(wip[0]).distance_to(gpoint)<grab_treshold) { + if (wip.size()>1 && xform.xform(wip[0]).distance_to(gpoint)<grab_threshold) { //wip closed _wip_close(); @@ -307,7 +307,7 @@ bool Path2DEditor::forward_gui_input(const Ref<InputEvent> &p_event) { continue; //not valid to reuse point real_t d = cp.distance_to(gpoint); - if (d<closest_dist && d<grab_treshold) { + if (d<closest_dist && d<grab_threshold) { closest_dist=d; closest_pos=cp; closest_idx=i; @@ -343,7 +343,7 @@ bool Path2DEditor::forward_gui_input(const Ref<InputEvent> &p_event) { Vector2 cp =xform.xform(poly[i]); real_t d = cp.distance_to(gpoint); - if (d<closest_dist && d<grab_treshold) { + if (d<closest_dist && d<grab_threshold) { closest_dist=d; closest_pos=cp; closest_idx=i; @@ -396,7 +396,7 @@ bool Path2DEditor::forward_gui_input(const Ref<InputEvent> &p_event) { Vector2 cp =xform.xform(poly[i]); real_t d = cp.distance_to(gpoint); - if (d<closest_dist && d<grab_treshold) { + if (d<closest_dist && d<grab_threshold) { closest_dist=d; closest_pos=cp; closest_idx=i; diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index aedc96d20e..dc2eddda39 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -876,6 +876,9 @@ void ScriptEditor::_menu_option(int p_option) { bool debug_with_external_editor = !debug_menu->get_popup()->is_item_checked(debug_menu->get_popup()->get_item_index(DEBUG_WITH_EXTERNAL_EDITOR)); debugger->set_debug_with_external_editor(debug_with_external_editor); debug_menu->get_popup()->set_item_checked(debug_menu->get_popup()->get_item_index(DEBUG_WITH_EXTERNAL_EDITOR), debug_with_external_editor); + } break; + case TOGGLE_SCRIPTS_PANEL: { + list_split->set_visible(!list_split->is_visible()); } } @@ -2235,6 +2238,8 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) { file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/close_docs", TTR("Close Docs")), CLOSE_DOCS); file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/close_file", TTR("Close"), KEY_MASK_CMD | KEY_W), FILE_CLOSE); file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/close_all", TTR("Close All")), CLOSE_ALL); + file_menu->get_popup()->add_separator(); + file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/toggle_scripts_panel", TTR("Toggle Scripts Panel"), KEY_MASK_CMD | KEY_BACKSLASH), TOGGLE_SCRIPTS_PANEL); file_menu->get_popup()->connect("id_pressed", this, "_menu_option"); script_search_menu = memnew(MenuButton); diff --git a/editor/plugins/script_editor_plugin.h b/editor/plugins/script_editor_plugin.h index da8248a1a7..7f17365931 100644 --- a/editor/plugins/script_editor_plugin.h +++ b/editor/plugins/script_editor_plugin.h @@ -134,6 +134,7 @@ class ScriptEditor : public VBoxContainer { FILE_CLOSE, CLOSE_DOCS, CLOSE_ALL, + TOGGLE_SCRIPTS_PANEL, FILE_TOOL_RELOAD, FILE_TOOL_RELOAD_SOFT, DEBUG_NEXT, diff --git a/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/spatial_editor_plugin.cpp index 995d13f6a8..d7f4781e89 100644 --- a/editor/plugins/spatial_editor_plugin.cpp +++ b/editor/plugins/spatial_editor_plugin.cpp @@ -2025,6 +2025,15 @@ void SpatialEditorViewport::_menu_option(int p_option) { view_menu->get_popup()->set_item_checked(idx, current); } break; + case VIEW_AUDIO_DOPPLER: { + + int idx = view_menu->get_popup()->get_item_index(VIEW_AUDIO_DOPPLER); + bool current = view_menu->get_popup()->is_item_checked(idx); + current = !current; + camera->set_doppler_tracking(current ? Camera::DOPPLER_TRACKING_IDLE_STEP : Camera::DOPPLER_TRACKING_DISABLED); + view_menu->get_popup()->set_item_checked(idx, current); + + } break; case VIEW_GIZMOS: { int idx = view_menu->get_popup()->get_item_index(VIEW_GIZMOS); @@ -2237,6 +2246,13 @@ void SpatialEditorViewport::set_state(const Dictionary &p_state) { viewport->set_as_audio_listener(listener); view_menu->get_popup()->set_item_checked(idx, listener); } + if (p_state.has("doppler")) { + bool doppler = p_state["doppler"]; + + int idx = view_menu->get_popup()->get_item_index(VIEW_AUDIO_DOPPLER); + camera->set_doppler_tracking(doppler ? Camera::DOPPLER_TRACKING_IDLE_STEP : Camera::DOPPLER_TRACKING_DISABLED); + view_menu->get_popup()->set_item_checked(idx, doppler); + } if (p_state.has("previewing")) { Node *pv = EditorNode::get_singleton()->get_edited_scene()->get_node(p_state["previewing"]); @@ -2395,6 +2411,7 @@ SpatialEditorViewport::SpatialEditorViewport(SpatialEditor *p_spatial_editor, Ed view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(VIEW_ENVIRONMENT), true); view_menu->get_popup()->add_separator(); view_menu->get_popup()->add_check_shortcut(ED_SHORTCUT("spatial_editor/view_audio_listener", TTR("Audio Listener")), VIEW_AUDIO_LISTENER); + view_menu->get_popup()->add_check_shortcut(ED_SHORTCUT("spatial_editor/view_audio_doppler", TTR("Doppler Enable")), VIEW_AUDIO_DOPPLER); view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(VIEW_GIZMOS), true); view_menu->get_popup()->add_separator(); diff --git a/editor/plugins/spatial_editor_plugin.h b/editor/plugins/spatial_editor_plugin.h index 6b05a8b370..9b626054c0 100644 --- a/editor/plugins/spatial_editor_plugin.h +++ b/editor/plugins/spatial_editor_plugin.h @@ -83,6 +83,7 @@ class SpatialEditorViewport : public Control { VIEW_ENVIRONMENT, VIEW_ORTHOGONAL, VIEW_AUDIO_LISTENER, + VIEW_AUDIO_DOPPLER, VIEW_GIZMOS, VIEW_INFORMATION, VIEW_DISPLAY_NORMAL, diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp index a3d3d42110..e3f22c833e 100644 --- a/editor/project_manager.cpp +++ b/editor/project_manager.cpp @@ -49,6 +49,7 @@ #include "scene/gui/texture_rect.h" #include "scene/gui/tool_button.h" #include "version.h" +#include "version_hash.gen.h" class NewProjectDialog : public ConfirmationDialog { @@ -1244,7 +1245,10 @@ ProjectManager::ProjectManager() { top_hb->add_child(ccl); top_hb->add_spacer(); l = memnew(Label); - l->set_text("v" VERSION_MKSTRING); + String hash = String(VERSION_HASH); + if (hash.length() != 0) + hash = "." + hash.left(7); + l->set_text("v" VERSION_MKSTRING "" + hash); //l->add_font_override("font",get_font("bold","Fonts")); l->set_align(Label::ALIGN_CENTER); top_hb->add_child(l); diff --git a/editor/project_settings.cpp b/editor/project_settings.cpp index 4000b3e05c..17a35282de 100644 --- a/editor/project_settings.cpp +++ b/editor/project_settings.cpp @@ -78,7 +78,7 @@ void ProjectSettings::_notification(int p_what) { case NOTIFICATION_ENTER_TREE: { globals_editor->edit(GlobalConfig::get_singleton()); - search_button->set_icon(get_icon("Zoom", "EditorIcons")); + search_button->set_icon(get_icon("Search", "EditorIcons")); clear_button->set_icon(get_icon("Close", "EditorIcons")); translation_list->connect("button_pressed", this, "_translation_delete"); diff --git a/editor/property_editor.cpp b/editor/property_editor.cpp index ad9b3607e9..8a9fd2cde5 100644 --- a/editor/property_editor.cpp +++ b/editor/property_editor.cpp @@ -4462,7 +4462,7 @@ class SectionedPropertyEditorFilter : public Object { continue; if (sp == -1) { - pi.name = "Global/" + pi.name; + pi.name = "global/" + pi.name; } if (pi.name.begins_with(section + "/")) { diff --git a/editor/scene_tree_editor.cpp b/editor/scene_tree_editor.cpp index d12d8b5528..94c94e126d 100644 --- a/editor/scene_tree_editor.cpp +++ b/editor/scene_tree_editor.cpp @@ -161,7 +161,7 @@ bool SceneTreeEditor::_add_nodes(Node *p_node, TreeItem *p_parent) { item->set_selectable(0, true); if (can_rename) { -#ifdef ENABLE_DEPRECATED +#ifndef DISABLE_DEPRECATED if (p_node->has_meta("_editor_collapsed")) { //remove previous way of storing folding, which did not get along with scene inheritance and instancing if ((bool)p_node->get_meta("_editor_collapsed")) diff --git a/editor/script_create_dialog.cpp b/editor/script_create_dialog.cpp index 47675bcffe..4a9b64639b 100644 --- a/editor/script_create_dialog.cpp +++ b/editor/script_create_dialog.cpp @@ -58,7 +58,6 @@ void ScriptCreateDialog::config(const String &p_base_name, const String &p_base_ file_path->set_text(""); } _lang_changed(current_language); - _template_changed(template_menu->get_selected()); _parent_name_changed(parent_name->get_text()); _class_name_changed(""); _path_changed(file_path->get_text()); @@ -246,25 +245,31 @@ void ScriptCreateDialog::_lang_changed(int l) { bool use_templates = language->is_using_templates(); template_menu->set_disabled(!use_templates); + template_menu->clear(); if (use_templates) { + template_list = EditorSettings::get_singleton()->get_script_templates(language->get_extension()); String last_lang = EditorSettings::get_singleton()->get_project_metadata("script_setup", "last_selected_language", ""); String last_template = EditorSettings::get_singleton()->get_project_metadata("script_setup", "last_selected_template", ""); - template_menu->clear(); template_menu->add_item(TTR("Default")); for (int i = 0; i < template_list.size(); i++) { String s = template_list[i].capitalize(); template_menu->add_item(s); - if (language_menu->get_item_text(l) == last_lang && last_template == s) { + if (language_menu->get_item_text(language_menu->get_selected()) == last_lang && last_template == s) { template_menu->select(i + 1); } } - _template_changed(template_menu->get_selected()); - EditorSettings::get_singleton()->set_project_metadata("script_setup", "last_selected_language", language_menu->get_item_text(l)); + } else { + + template_menu->add_item(TTR("N/A")); + script_template = ""; } + _template_changed(template_menu->get_selected()); + EditorSettings::get_singleton()->set_project_metadata("script_setup", "last_selected_language", language_menu->get_item_text(language_menu->get_selected())); + _update_dialog(); } diff --git a/editor/spatial_editor_gizmos.cpp b/editor/spatial_editor_gizmos.cpp index 62fa93ac23..faf9dee5d0 100644 --- a/editor/spatial_editor_gizmos.cpp +++ b/editor/spatial_editor_gizmos.cpp @@ -867,6 +867,127 @@ LightSpatialGizmo::LightSpatialGizmo(Light *p_light) { ////// +//// player gizmo + +String AudioStreamPlayer3DSpatialGizmo::get_handle_name(int p_idx) const { + + return "Emission Radius"; +} + +Variant AudioStreamPlayer3DSpatialGizmo::get_handle_value(int p_idx) const { + + return player->get_emission_angle(); +} + +void AudioStreamPlayer3DSpatialGizmo::set_handle(int p_idx, Camera *p_camera, const Point2 &p_point) { + + Transform gt = player->get_global_transform(); + gt.orthonormalize(); + Transform gi = gt.affine_inverse(); + + Vector3 ray_from = p_camera->project_ray_origin(p_point); + Vector3 ray_dir = p_camera->project_ray_normal(p_point); + Vector3 ray_to = ray_from + ray_dir * 4096; + + ray_from = gi.xform(ray_from); + ray_to = gi.xform(ray_to); + + float closest_dist = 1e20; + float closest_angle = 1e20; + + for (int i = 0; i < 180; i++) { + + float a = i * Math_PI / 180.0; + float an = (i + 1) * Math_PI / 180.0; + + Vector3 from(Math::sin(a), 0, -Math::cos(a)); + Vector3 to(Math::sin(an), 0, -Math::cos(an)); + + Vector3 r1, r2; + Geometry::get_closest_points_between_segments(from, to, ray_from, ray_to, r1, r2); + float d = r1.distance_to(r2); + if (d < closest_dist) { + closest_dist = d; + closest_angle = i; + } + } + + if (closest_angle < 91) { + player->set_emission_angle(closest_angle); + } +} + +void AudioStreamPlayer3DSpatialGizmo::commit_handle(int p_idx, const Variant &p_restore, bool p_cancel) { + + if (p_cancel) { + + player->set_emission_angle(p_restore); + + } else { + + UndoRedo *ur = SpatialEditor::get_singleton()->get_undo_redo(); + ur->create_action(TTR("Change AudioStreamPlayer3D Emission Angle")); + ur->add_do_method(player, "set_emission_angle", player->get_emission_angle()); + ur->add_undo_method(player, "set_emission_angle", p_restore); + ur->commit_action(); + } +} + +void AudioStreamPlayer3DSpatialGizmo::redraw() { + + clear(); + + if (player->is_emission_angle_enabled()) { + float pc = player->get_emission_angle(); + + Vector<Vector3> points; + points.resize(208); + + float ofs = -Math::cos(Math::deg2rad(pc)); + float radius = Math::sin(Math::deg2rad(pc)); + + for (int i = 0; i < 100; i++) { + + float a = i * 2.0 * Math_PI / 100.0; + float an = (i + 1) * 2.0 * Math_PI / 100.0; + + Vector3 from(Math::sin(a) * radius, Math::cos(a) * radius, ofs); + Vector3 to(Math::sin(an) * radius, Math::cos(an) * radius, ofs); + + points[i * 2 + 0] = from; + points[i * 2 + 1] = to; + } + + for (int i = 0; i < 4; i++) { + + float a = i * 2.0 * Math_PI / 4.0; + + Vector3 from(Math::sin(a) * radius, Math::cos(a) * radius, ofs); + + points[200 + i * 2 + 0] = from; + points[200 + i * 2 + 1] = Vector3(); + } + + add_lines(points, SpatialEditorGizmos::singleton->car_wheel_material); + add_collision_segments(points); + + Vector<Vector3> handles; + float ha = Math::deg2rad(player->get_emission_angle()); + handles.push_back(Vector3(Math::sin(ha), 0, -Math::cos(ha))); + add_handles(handles); + } + + add_unscaled_billboard(SpatialEditorGizmos::singleton->sample_player_icon, 0.05); +} + +AudioStreamPlayer3DSpatialGizmo::AudioStreamPlayer3DSpatialGizmo(AudioStreamPlayer3D *p_player) { + + player = p_player; + set_spatial_node(p_player); +} + +////// + String CameraSpatialGizmo::get_handle_name(int p_idx) const { if (camera->get_projection() == Camera::PROJECTION_PERSPECTIVE) { @@ -3101,6 +3222,12 @@ Ref<SpatialEditorGizmo> SpatialEditorGizmos::get_gizmo(Spatial *p_spatial) { return misg; } + if (p_spatial->cast_to<AudioStreamPlayer3D>()) { + + Ref<AudioStreamPlayer3DSpatialGizmo> misg = memnew(AudioStreamPlayer3DSpatialGizmo(p_spatial->cast_to<AudioStreamPlayer3D>())); + return misg; + } + return Ref<SpatialEditorGizmo>(); } diff --git a/editor/spatial_editor_gizmos.h b/editor/spatial_editor_gizmos.h index a8ace87530..469a2d594a 100644 --- a/editor/spatial_editor_gizmos.h +++ b/editor/spatial_editor_gizmos.h @@ -31,9 +31,10 @@ #define SPATIAL_EDITOR_GIZMOS_H #include "editor/plugins/spatial_editor_plugin.h" -#include "scene/3d/body_shape.h" +#include "scene/3d/audio_stream_player_3d.h" #include "scene/3d/camera.h" #include "scene/3d/collision_polygon.h" +#include "scene/3d/collision_shape.h" #include "scene/3d/gi_probe.h" #include "scene/3d/light.h" #include "scene/3d/listener.h" @@ -137,6 +138,22 @@ public: LightSpatialGizmo(Light *p_light = NULL); }; +class AudioStreamPlayer3DSpatialGizmo : public EditorSpatialGizmo { + + GDCLASS(AudioStreamPlayer3DSpatialGizmo, EditorSpatialGizmo); + + AudioStreamPlayer3D *player; + +public: + virtual String get_handle_name(int p_idx) const; + virtual Variant get_handle_value(int p_idx) const; + virtual void set_handle(int p_idx, Camera *p_camera, const Point2 &p_point); + virtual void commit_handle(int p_idx, const Variant &p_restore, bool p_cancel = false); + + void redraw(); + AudioStreamPlayer3DSpatialGizmo(AudioStreamPlayer3D *p_player = NULL); +}; + class CameraSpatialGizmo : public EditorSpatialGizmo { GDCLASS(CameraSpatialGizmo, EditorSpatialGizmo); diff --git a/main/input_default.cpp b/main/input_default.cpp index bde1e84926..3361aa0678 100644 --- a/main/input_default.cpp +++ b/main/input_default.cpp @@ -770,6 +770,7 @@ static const char *s_ControllerMappings[] = { "4e564944494120436f72706f72617469,NVIDIA Controller,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,", "532e542e442e20496e74657261637420,3dfx InterAct HammerHead FX,leftx:a0,lefty:a1,dpdown:h0.4,rightstick:b25,rightshoulder:b27,rightx:a2,start:b31,righty:a3,dpleft:h0.8,lefttrigger:b28,x:b20,dpup:h0.1,back:b30,leftstick:b22,leftshoulder:b26,y:b21,a:b23,dpright:h0.2,righttrigger:b29,b:b24,", "506572666f726d616e63652044657369,PDP Rock Candy Wireless Controller for PS3,leftx:a0,lefty:a1,dpdown:h0.4,rightstick:b6,rightshoulder:b18,rightx:a2,start:b16,righty:a3,dpleft:h0.8,lefttrigger:b9,x:b0,dpup:h0.1,back:h0.2,leftstick:b4,leftshoulder:b3,y:b2,a:b1,dpright:h0.2,righttrigger:b10,b:b17,", + "4f5559412047616d6520436f6e74726f,OUYA Game Controller,leftx:a0,lefty:a1,dpdown:b9,rightstick:b7,rightshoulder:b5,rightx:a3,start:b16,righty:a4,dpleft:b10,lefttrigger:b12,x:b1,dpup:b8,back:b14,leftstick:b6,leftshoulder:b4,y:b2,a:b0,dpright:b11,righttrigger:b13,b:b3,", #endif #ifdef JAVASCRIPT_ENABLED diff --git a/main/main.cpp b/main/main.cpp index 218321ef25..e292a20982 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -1525,11 +1525,15 @@ static uint64_t idle_process_max = 0; bool Main::iteration() { uint64_t ticks = OS::get_singleton()->get_ticks_usec(); + Engine::get_singleton()->_frame_ticks = ticks; + uint64_t ticks_elapsed = ticks - last_ticks; double step = (double)ticks_elapsed / 1000000.0; float frame_slice = 1.0 / Engine::get_singleton()->get_iterations_per_second(); + Engine::get_singleton()->_frame_step = step; + /* if (time_accum+step < frame_slice) return false; diff --git a/methods.py b/methods.py index 4d3d5ae343..abd87c07d7 100644 --- a/methods.py +++ b/methods.py @@ -1176,6 +1176,20 @@ def update_version(): f.write("#define VERSION_STATUS " + str(version.status) + "\n") import datetime f.write("#define VERSION_YEAR " + str(datetime.datetime.now().year) + "\n") + f.close() + + fhash = open("core/version_hash.gen.h", "wb") + githash = "" + if os.path.isfile(".git/HEAD"): + head = open(".git/HEAD", "rb").readline().strip() + if head.startswith("ref: "): + head = ".git/" + head[5:] + if os.path.isfile(head): + githash = open(head, "rb").readline().strip() + else: + githash = head + fhash.write("#define VERSION_HASH \"" + githash + "\"") + fhash.close() def parse_cg_file(fname, uniforms, sizes, conditionals): diff --git a/misc/scripts/svgs_2_pngs.py b/misc/scripts/svgs_2_pngs.py index b24324dcd7..ff6d6d851f 100644 --- a/misc/scripts/svgs_2_pngs.py +++ b/misc/scripts/svgs_2_pngs.py @@ -16,7 +16,7 @@ last_svg_data = None SCRIPT_FOLDER = dirname(realpath(__file__)) + '/' theme_dir_base = SCRIPT_FOLDER + '../../scene/resources/default_theme/' theme_dir_source = theme_dir_base + 'source/' -icons_dir_base = SCRIPT_FOLDER + '../editor/icons/' +icons_dir_base = SCRIPT_FOLDER + '../../editor/icons/' icons_dir_2x = icons_dir_base + '2x/' icons_dir_source = icons_dir_base + 'source/' @@ -108,8 +108,10 @@ special_icons = { theme_output_names=['icon_reload'] ), 'icon_multi_edit': dict(output_names=['icon_multi_node_edit']), + 'icon_load': dict( + output_names=['icon_open'] + ), 'icon_folder': dict( - output_names=['icon_load', 'icon_open'], theme_output_names=['icon_folder'] ), 'icon_file_list': dict(output_names=['icon_enum']), diff --git a/modules/gdnative/godot/godot_dictionary.cpp b/modules/gdnative/godot/godot_dictionary.cpp index 12c40f0564..a14a86248b 100644 --- a/modules/gdnative/godot/godot_dictionary.cpp +++ b/modules/gdnative/godot/godot_dictionary.cpp @@ -124,11 +124,17 @@ void GDAPI godot_dictionary_set(godot_dictionary *p_self, const godot_variant *p } godot_variant GDAPI *godot_dictionary_operator_index(godot_dictionary *p_self, const godot_variant *p_key) { - Array *self = (Array *)p_self; + Dictionary *self = (Dictionary *)p_self; const Variant *key = (const Variant *)p_key; return (godot_variant *)&self->operator[](*key); } +godot_variant GDAPI *godot_dictionary_next(const godot_dictionary *p_self, const godot_variant *p_key) { + Dictionary *self = (Dictionary *)p_self; + const Variant *key = (const Variant *)p_key; + return (godot_variant *)self->next(key); +} + godot_bool GDAPI godot_dictionary_operator_equal(const godot_dictionary *p_self, const godot_dictionary *p_b) { const Dictionary *self = (const Dictionary *)p_self; const Dictionary *b = (const Dictionary *)p_b; diff --git a/modules/gdnative/godot/godot_dictionary.h b/modules/gdnative/godot/godot_dictionary.h index 0325670b15..4ded0d38da 100644 --- a/modules/gdnative/godot/godot_dictionary.h +++ b/modules/gdnative/godot/godot_dictionary.h @@ -74,6 +74,8 @@ void GDAPI godot_dictionary_set(godot_dictionary *p_self, const godot_variant *p godot_variant GDAPI *godot_dictionary_operator_index(godot_dictionary *p_self, const godot_variant *p_key); +godot_variant GDAPI *godot_dictionary_next(const godot_dictionary *p_self, const godot_variant *p_key); + godot_bool GDAPI godot_dictionary_operator_equal(const godot_dictionary *p_self, const godot_dictionary *p_b); godot_string GDAPI godot_dictionary_to_json(const godot_dictionary *p_self); diff --git a/modules/gdscript/gd_function.cpp b/modules/gdscript/gd_function.cpp index e8a8e20927..795371af60 100644 --- a/modules/gdscript/gd_function.cpp +++ b/modules/gdscript/gd_function.cpp @@ -1428,8 +1428,24 @@ Variant GDFunctionState::_signal_callback(const Variant **p_args, int p_argcount state.result = arg; Variant ret = function->call(NULL, NULL, 0, r_error, &state); + + bool completed = true; + + // If the return value is a GDFunctionState reference, + // then the function did yield again after resuming. + if (ret.is_ref()) { + GDFunctionState *gdfs = ret.operator Object *()->cast_to<GDFunctionState>(); + if (gdfs && gdfs->function == function) + completed = false; + } + function = NULL; //cleaned up; state.result = Variant(); + + if (completed) { + emit_signal("completed", ret); + } + return ret; } @@ -1468,8 +1484,24 @@ Variant GDFunctionState::resume(const Variant &p_arg) { state.result = p_arg; Variant::CallError err; Variant ret = function->call(NULL, NULL, 0, err, &state); + + bool completed = true; + + // If the return value is a GDFunctionState reference, + // then the function did yield again after resuming. + if (ret.is_ref()) { + GDFunctionState *gdfs = ret.operator Object *()->cast_to<GDFunctionState>(); + if (gdfs && gdfs->function == function) + completed = false; + } + function = NULL; //cleaned up; state.result = Variant(); + + if (completed) { + emit_signal("completed", ret); + } + return ret; } @@ -1478,6 +1510,8 @@ void GDFunctionState::_bind_methods() { ClassDB::bind_method(D_METHOD("resume:Variant", "arg"), &GDFunctionState::resume, DEFVAL(Variant())); ClassDB::bind_method(D_METHOD("is_valid", "extended_check"), &GDFunctionState::is_valid, DEFVAL(false)); ClassDB::bind_vararg_method(METHOD_FLAGS_DEFAULT, "_signal_callback", &GDFunctionState::_signal_callback, MethodInfo("_signal_callback")); + + ADD_SIGNAL(MethodInfo("completed", PropertyInfo(Variant::NIL, "result"))); } GDFunctionState::GDFunctionState() { diff --git a/modules/gridmap/grid_map.cpp b/modules/gridmap/grid_map.cpp index 9d3da8227c..8c2c2ea345 100644 --- a/modules/gridmap/grid_map.cpp +++ b/modules/gridmap/grid_map.cpp @@ -380,6 +380,7 @@ void GridMap::set_cell_item(int p_x, int p_y, int p_z, int p_item, int p_rot) { ii.multimesh->set_mesh(ii.mesh); ii.multimesh_instance = VS::get_singleton()->instance_create(); VS::get_singleton()->instance_set_base(ii.multimesh_instance, ii.multimesh->get_rid()); + VS::get_singleton()->instance_geometry_set_flag(ii.multimesh_instance, VS::INSTANCE_FLAG_USE_BAKED_LIGHT, true); g.items[p_item] = ii; } diff --git a/modules/visual_script/visual_script_flow_control.cpp b/modules/visual_script/visual_script_flow_control.cpp index 28622bed47..b53a21c53b 100644 --- a/modules/visual_script/visual_script_flow_control.cpp +++ b/modules/visual_script/visual_script_flow_control.cpp @@ -944,7 +944,7 @@ bool VisualScriptInputFilter::_set(const StringName &p_name, const Variant &p_va filters[idx] = Ref<InputEvent>(); filters[idx].type = Ref<InputEvent>::Type(int(p_value)); if (filters[idx].type == Ref<InputEvent>::JOYPAD_MOTION) { - filters[idx].joy_motion.axis_value = 0.5; //for treshold + filters[idx].joy_motion.axis_value = 0.5; //for threshold } else if (filters[idx].type == Ref<InputEvent>::KEY) { filters[idx]->is_pressed() = true; //put these as true to make it more user friendly } else if (filters[idx].type == Ref<InputEvent>::MOUSE_BUTTON) { @@ -1071,7 +1071,7 @@ bool VisualScriptInputFilter::_set(const StringName &p_name, const Variant &p_va filters[idx].joy_motion.axis = int(p_value) << 1 | filters[idx].joy_motion.axis; } else if (what == "mode") { filters[idx].joy_motion.axis |= int(p_value); - } else if (what == "treshold") { + } else if (what == "threshold") { filters[idx].joy_motion.axis_value = p_value; } else { return false; @@ -1281,7 +1281,7 @@ bool VisualScriptInputFilter::_get(const StringName &p_name, Variant &r_ret) con r_ret = filters[idx].joy_motion.axis >> 1; } else if (what == "mode") { r_ret = filters[idx].joy_motion.axis & 1; - } else if (what == "treshold") { + } else if (what == "threshold") { r_ret = filters[idx].joy_motion.axis_value; } else { return false; @@ -1434,7 +1434,7 @@ void VisualScriptInputFilter::_get_property_list(List<PropertyInfo> *p_list) con p_list->push_back(PropertyInfo(Variant::INT, base + "axis_index")); p_list->push_back(PropertyInfo(Variant::INT, base + "mode", PROPERTY_HINT_ENUM, "Min,Max")); - p_list->push_back(PropertyInfo(Variant::REAL, base + "treshold", PROPERTY_HINT_RANGE, "0,1,0.01")); + p_list->push_back(PropertyInfo(Variant::REAL, base + "threshold", PROPERTY_HINT_RANGE, "0,1,0.01")); } break; case Ref<InputEvent>::JOYPAD_BUTTON: { p_list->push_back(PropertyInfo(Variant::INT, base + "button_index")); diff --git a/modules/visual_script/visual_script_nodes.cpp b/modules/visual_script/visual_script_nodes.cpp index f707471405..5f24bcc2c3 100644 --- a/modules/visual_script/visual_script_nodes.cpp +++ b/modules/visual_script/visual_script_nodes.cpp @@ -1076,7 +1076,7 @@ void VisualScriptConstant::_bind_methods() { ClassDB::bind_method(D_METHOD("get_constant_type"), &VisualScriptConstant::get_constant_type); ClassDB::bind_method(D_METHOD("set_constant_value", "value"), &VisualScriptConstant::set_constant_value); - ClassDB::bind_method(D_METHOD("get_constant_value"), &VisualScriptConstant::get_constant_value); + ClassDB::bind_method(D_METHOD("get_constant_value:Variant"), &VisualScriptConstant::get_constant_value); String argt = "Null"; for (int i = 1; i < Variant::VARIANT_MAX; i++) { diff --git a/platform/uwp/detect.py b/platform/uwp/detect.py index ca469d0056..64dac93f1f 100644 --- a/platform/uwp/detect.py +++ b/platform/uwp/detect.py @@ -115,7 +115,6 @@ def configure(env): angle_build_cmd += "Win32" - env.Append(CPPFLAGS=['/DPNG_ABORT=abort']) env.Append(LINKFLAGS=['/MACHINE:X86']) env.Append(LIBPATH=[vc_base_path + 'lib/store']) env.Append(LIBPATH=[angle_root + '/winrt/10/src/Release_Win32/lib']) @@ -141,7 +140,7 @@ def configure(env): winver = "0x0602" # Windows 8 is the minimum target for UWP build env.Append(CCFLAGS=['/DWINVER=%s' % winver, '/D_WIN32_WINNT=%s' % winver]) - env.Append(CPPFLAGS=['/D', '__WRL_NO_DEFAULT_LIB__', '/D', 'WIN32']) + env.Append(CPPFLAGS=['/D', '__WRL_NO_DEFAULT_LIB__', '/D', 'WIN32', '/DPNG_ABORT=abort']) env.Append(CPPFLAGS=['/AI', vc_base_path + 'lib/store/references']) env.Append(CPPFLAGS=['/AI', vc_base_path + 'lib/x86/store/references']) diff --git a/platform/uwp/export/export.cpp b/platform/uwp/export/export.cpp index 976e6208ee..92a7b2c112 100644 --- a/platform/uwp/export/export.cpp +++ b/platform/uwp/export/export.cpp @@ -28,55 +28,16 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -/************************************************************************* - * The code for signing the package was ported from fb-util-for-appx - * available at https://github.com/facebook/fb-util-for-appx - * and distributed also under the following license: - -BSD License - -For fb-util-for-appx software - -Copyright (c) 2016, Facebook, Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - * Neither the name Facebook nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -*************************************************************************/ - -#if 0 #include "export.h" #include "bind/core_bind.h" -#include "editor/editor_import_export.h" +#include "editor/editor_export.h" #include "editor/editor_node.h" #include "global_config.h" #include "io/marshalls.h" #include "io/zip_io.h" #include "object.h" #include "os/file_access.h" -#include "platform/uwp/logo.h" +#include "platform/uwp/logo.gen.h" #include "version.h" #include "thirdparty/minizip/unzip.h" @@ -87,7 +48,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include <zlib.h> // Capabilities -static const char* uwp_capabilities[] = { +static const char *uwp_capabilities[] = { "allJoyn", "codeGeneration", "internetClient", @@ -95,7 +56,7 @@ static const char* uwp_capabilities[] = { "privateNetworkClientServer", NULL }; -static const char* uwp_uap_capabilities[] = { +static const char *uwp_uap_capabilities[] = { "appointments", "blockedChatMessages", "chat", @@ -112,7 +73,7 @@ static const char* uwp_uap_capabilities[] = { "voipCall", NULL }; -static const char* uwp_device_capabilites[] = { +static const char *uwp_device_capabilites[] = { "bluetooth", "location", "microphone", @@ -121,166 +82,6 @@ static const char* uwp_device_capabilites[] = { NULL }; -#ifdef OPENSSL_ENABLED -#include <openssl/asn1.h> -#include <openssl/asn1t.h> -#include <openssl/bio.h> -#include <openssl/err.h> -#include <openssl/ossl_typ.h> -#include <openssl/pkcs12.h> -#include <openssl/pkcs7.h> -#include <openssl/x509.h> - -namespace asn1 { - // https://msdn.microsoft.com/en-us/gg463180.aspx - - struct SPCStatementType { - ASN1_OBJECT *type; - }; - DECLARE_ASN1_FUNCTIONS(SPCStatementType) - - struct SPCSpOpusInfo { - ASN1_TYPE *programName; - ASN1_TYPE *moreInfo; - }; - DECLARE_ASN1_FUNCTIONS(SPCSpOpusInfo) - - struct DigestInfo { - X509_ALGOR *digestAlgorithm; - ASN1_OCTET_STRING *digest; - }; - DECLARE_ASN1_FUNCTIONS(DigestInfo) - - struct SPCAttributeTypeAndOptionalValue { - ASN1_OBJECT *type; - ASN1_TYPE *value; // SPCInfoValue - }; - DECLARE_ASN1_FUNCTIONS(SPCAttributeTypeAndOptionalValue) - - // Undocumented. - struct SPCInfoValue { - ASN1_INTEGER *i1; - ASN1_OCTET_STRING *s1; - ASN1_INTEGER *i2; - ASN1_INTEGER *i3; - ASN1_INTEGER *i4; - ASN1_INTEGER *i5; - ASN1_INTEGER *i6; - }; - DECLARE_ASN1_FUNCTIONS(SPCInfoValue) - - struct SPCIndirectDataContent { - SPCAttributeTypeAndOptionalValue *data; - DigestInfo *messageDigest; - }; - DECLARE_ASN1_FUNCTIONS(SPCIndirectDataContent) - - IMPLEMENT_ASN1_FUNCTIONS(SPCIndirectDataContent) - ASN1_SEQUENCE(SPCIndirectDataContent) = { - ASN1_SIMPLE(SPCIndirectDataContent, data, - SPCAttributeTypeAndOptionalValue), - ASN1_SIMPLE(SPCIndirectDataContent, messageDigest, DigestInfo), - } ASN1_SEQUENCE_END(SPCIndirectDataContent) - - IMPLEMENT_ASN1_FUNCTIONS(SPCAttributeTypeAndOptionalValue) - ASN1_SEQUENCE(SPCAttributeTypeAndOptionalValue) = { - ASN1_SIMPLE(SPCAttributeTypeAndOptionalValue, type, - ASN1_OBJECT), - ASN1_OPT(SPCAttributeTypeAndOptionalValue, value, ASN1_ANY), - } ASN1_SEQUENCE_END(SPCAttributeTypeAndOptionalValue) - - IMPLEMENT_ASN1_FUNCTIONS(SPCInfoValue) - ASN1_SEQUENCE(SPCInfoValue) = { - ASN1_SIMPLE(SPCInfoValue, i1, ASN1_INTEGER), - ASN1_SIMPLE(SPCInfoValue, s1, ASN1_OCTET_STRING), - ASN1_SIMPLE(SPCInfoValue, i2, ASN1_INTEGER), - ASN1_SIMPLE(SPCInfoValue, i3, ASN1_INTEGER), - ASN1_SIMPLE(SPCInfoValue, i4, ASN1_INTEGER), - ASN1_SIMPLE(SPCInfoValue, i5, ASN1_INTEGER), - ASN1_SIMPLE(SPCInfoValue, i6, ASN1_INTEGER), - } ASN1_SEQUENCE_END(SPCInfoValue) - - IMPLEMENT_ASN1_FUNCTIONS(DigestInfo) - ASN1_SEQUENCE(DigestInfo) = { - ASN1_SIMPLE(DigestInfo, digestAlgorithm, X509_ALGOR), - ASN1_SIMPLE(DigestInfo, digest, ASN1_OCTET_STRING), - } ASN1_SEQUENCE_END(DigestInfo) - - ASN1_SEQUENCE(SPCSpOpusInfo) = { - ASN1_OPT(SPCSpOpusInfo, programName, ASN1_ANY), - ASN1_OPT(SPCSpOpusInfo, moreInfo, ASN1_ANY), - } ASN1_SEQUENCE_END(SPCSpOpusInfo) - IMPLEMENT_ASN1_FUNCTIONS(SPCSpOpusInfo) - - ASN1_SEQUENCE(SPCStatementType) = { - ASN1_SIMPLE(SPCStatementType, type, ASN1_OBJECT), - } ASN1_SEQUENCE_END(SPCStatementType) - IMPLEMENT_ASN1_FUNCTIONS(SPCStatementType) -} - -class EncodedASN1 { - - uint8_t* i_data; - size_t i_size; - - EncodedASN1(uint8_t** p_data, size_t p_size) { - - i_data = *p_data; - i_size = p_size; - } - -public: - - template <typename T, int(*TEncode)(T *, uint8_t **)> - static EncodedASN1 FromItem(T *item) { - uint8_t *dataRaw = NULL; - int size = TEncode(item, &dataRaw); - - return EncodedASN1(&dataRaw, size); - } - - const uint8_t *data() const { - return i_data; - } - - size_t size() const { - return i_size; - } - - // Assumes the encoded ASN.1 represents a SEQUENCE and puts it into - // an ASN1_STRING. - // - // The returned object holds a copy of this object's data. - ASN1_STRING* ToSequenceString() { - ASN1_STRING* string = ASN1_STRING_new(); - if (!string) { - return NULL; - } - if (!ASN1_STRING_set(string, i_data, i_size)) { - return NULL; - } - return string; - } - - // Assumes the encoded ASN.1 represents a SEQUENCE and puts it into - // an ASN1_TYPE. - // - // The returned object holds a copy of this object's data. - ASN1_TYPE* ToSequenceType() { - ASN1_STRING* string = ToSequenceString(); - ASN1_TYPE* type = ASN1_TYPE_new(); - if (!type) { - return NULL; - } - type->type = V_ASN1_SEQUENCE; - type->value.sequence = string; - return type; - } - -}; - -#endif // OPENSSL_ENABLED - class AppxPackager { enum { @@ -336,34 +137,33 @@ class AppxPackager { ZPOS64_T end_of_central_dir_offset; Vector<uint8_t> central_dir_data; - String hash_block(uint8_t* p_block_data, size_t p_block_len); + String hash_block(uint8_t *p_block_data, size_t p_block_len); void make_block_map(); void make_content_types(); - - _FORCE_INLINE_ unsigned int buf_put_int16(uint16_t p_val, uint8_t * p_buf) { + _FORCE_INLINE_ unsigned int buf_put_int16(uint16_t p_val, uint8_t *p_buf) { for (int i = 0; i < 2; i++) { *p_buf++ = (p_val >> (i * 8)) & 0xFF; } return 2; } - _FORCE_INLINE_ unsigned int buf_put_int32(uint32_t p_val, uint8_t * p_buf) { + _FORCE_INLINE_ unsigned int buf_put_int32(uint32_t p_val, uint8_t *p_buf) { for (int i = 0; i < 4; i++) { *p_buf++ = (p_val >> (i * 8)) & 0xFF; } return 4; } - _FORCE_INLINE_ unsigned int buf_put_int64(uint64_t p_val, uint8_t * p_buf) { + _FORCE_INLINE_ unsigned int buf_put_int64(uint64_t p_val, uint8_t *p_buf) { for (int i = 0; i < 8; i++) { *p_buf++ = (p_val >> (i * 8)) & 0xFF; } return 8; } - _FORCE_INLINE_ unsigned int buf_put_string(String p_val, uint8_t * p_buf) { + _FORCE_INLINE_ unsigned int buf_put_string(String p_val, uint8_t *p_buf) { for (int i = 0; i < p_val.length(); i++) { *p_buf++ = p_val.utf8().get(i); } @@ -376,168 +176,19 @@ class AppxPackager { String content_type(String p_extension); -#ifdef OPENSSL_ENABLED - - // Signing methods and structs: - - String certificate_path; - String certificate_pass; - bool sign_package; - - struct CertFile { - - EVP_PKEY* private_key; - X509* certificate; - }; - - SHA256_CTX axpc_context; // SHA256 context for ZIP file entries - SHA256_CTX axcd_context; // SHA256 context for ZIP directory entries - - struct AppxDigests { - - uint8_t axpc[SHA256_DIGEST_LENGTH]; // ZIP file entries - uint8_t axcd[SHA256_DIGEST_LENGTH]; // ZIP directory entry - uint8_t axct[SHA256_DIGEST_LENGTH]; // Content types XML - uint8_t axbm[SHA256_DIGEST_LENGTH]; // Block map XML - uint8_t axci[SHA256_DIGEST_LENGTH]; // Code Integrity file (optional) - }; - - CertFile cert_file; - AppxDigests digests; - - void MakeSPCInfoValue(asn1::SPCInfoValue &info); - Error MakeIndirectDataContent(asn1::SPCIndirectDataContent &idc); - Error add_attributes(PKCS7_SIGNER_INFO *signerInfo); - void make_digests(); - void write_digest(Vector<uint8_t> &p_out_buffer); - - Error openssl_error(unsigned long p_err); - Error read_cert_file(const String &p_path, const String &p_password, CertFile* p_out_cf); - Error sign(const CertFile &p_cert, const AppxDigests &digests, PKCS7* p_out_signature); - -#endif // OPENSSL_ENABLED - public: - - enum SignOption { - - SIGN, - DONT_SIGN, - }; - void set_progress_task(String p_task) { progress_task = p_task; } - void init(FileAccess* p_fa, SignOption p_sign, String &p_certificate_path, String &p_certificate_password); - void add_file(String p_file_name, const uint8_t* p_buffer, size_t p_len, int p_file_no, int p_total_files, bool p_compress = false); + void init(FileAccess *p_fa); + void add_file(String p_file_name, const uint8_t *p_buffer, size_t p_len, int p_file_no, int p_total_files, bool p_compress = false); void finish(); AppxPackager(); ~AppxPackager(); }; -class EditorExportPlatformUWP : public EditorExportPlatform { - - GDCLASS(EditorExportPlatformUWP, EditorExportPlatform); - - Ref<ImageTexture> logo; - - enum Platform { - ARM, - X86, - X64 - } arch; - - bool is_debug; - - String custom_release_package; - String custom_debug_package; - - String cmdline; - - String display_name; - String short_name; - String unique_name; - String description; - String publisher; - String publisher_display_name; - - String product_guid; - String publisher_guid; - - int version_major; - int version_minor; - int version_build; - int version_revision; - - bool orientation_landscape; - bool orientation_portrait; - bool orientation_landscape_flipped; - bool orientation_portrait_flipped; - - String background_color; - Ref<ImageTexture> store_logo; - Ref<ImageTexture> square44; - Ref<ImageTexture> square71; - Ref<ImageTexture> square150; - Ref<ImageTexture> square310; - Ref<ImageTexture> wide310; - Ref<ImageTexture> splash; - - bool name_on_square150; - bool name_on_square310; - bool name_on_wide; - - Set<String> capabilities; - Set<String> uap_capabilities; - Set<String> device_capabilities; - - bool sign_package; - String certificate_path; - String certificate_pass; - - _FORCE_INLINE_ bool array_has(const char** p_array, const char* p_value) const { - while (*p_array) { - if (String(*p_array) == String(p_value)) return true; - p_array++; - } - return false; - } - - bool _valid_resource_name(const String &p_name) const; - bool _valid_guid(const String &p_guid) const; - bool _valid_bgcolor(const String &p_color) const; - bool _valid_image(const Ref<ImageTexture> p_image, int p_width, int p_height) const; - - Vector<uint8_t> _fix_manifest(const Vector<uint8_t> &p_template, bool p_give_internet) const; - Vector<uint8_t> _get_image_data(const String &p_path); - - static Error save_appx_file(void *p_userdata, const String& p_path, const Vector<uint8_t>& p_data, int p_file, int p_total); - static bool _should_compress_asset(const String& p_path, const Vector<uint8_t>& p_data); - -protected: - - bool _set(const StringName& p_name, const Variant& p_value); - bool _get(const StringName& p_name, Variant &r_ret) const; - void _get_property_list(List<PropertyInfo> *p_list) const; - -public: - - virtual String get_name() const { return "Windows Universal"; } - virtual ImageCompression get_image_compression() const { return IMAGE_COMPRESSION_ETC1; } - virtual Ref<Texture> get_logo() const { return logo; } - - virtual bool can_export(String *r_error = NULL) const; - virtual String get_binary_extension() const { return "appx"; } - - virtual Error export_project(const String& p_path, bool p_debug, int p_flags = 0); - - EditorExportPlatformUWP(); - ~EditorExportPlatformUWP(); -}; - - /////////////////////////////////////////////////////////////////////////// -String AppxPackager::hash_block(uint8_t * p_block_data, size_t p_block_len) { +String AppxPackager::hash_block(uint8_t *p_block_data, size_t p_block_len) { char hash[32]; char base64[45]; @@ -545,7 +196,7 @@ String AppxPackager::hash_block(uint8_t * p_block_data, size_t p_block_len) { sha256_context ctx; sha256_init(&ctx); sha256_hash(&ctx, p_block_data, p_block_len); - sha256_done(&ctx, (uint8_t*)hash); + sha256_done(&ctx, (uint8_t *)hash); base64_encode(base64, hash, 32); base64[44] = '\0'; @@ -555,7 +206,7 @@ String AppxPackager::hash_block(uint8_t * p_block_data, size_t p_block_len) { void AppxPackager::make_block_map() { - FileAccess* tmp_file = FileAccess::open(tmp_blockmap_file_path, FileAccess::WRITE); + FileAccess *tmp_file = FileAccess::open(tmp_blockmap_file_path, FileAccess::WRITE); tmp_file->store_string("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>"); tmp_file->store_string("<BlockMap xmlns=\"http://schemas.microsoft.com/appx/2010/blockmap\" HashMethod=\"http://www.w3.org/2001/04/xmlenc#sha256\">"); @@ -565,15 +216,11 @@ void AppxPackager::make_block_map() { FileMeta file = file_metadata[i]; tmp_file->store_string( - "<File Name=\"" + file.name.replace("/", "\\") - + "\" Size=\"" + itos(file.uncompressed_size) - + "\" LfhSize=\"" + itos(file.lfh_size) + "\">"); - + "<File Name=\"" + file.name.replace("/", "\\") + "\" Size=\"" + itos(file.uncompressed_size) + "\" LfhSize=\"" + itos(file.lfh_size) + "\">"); for (int j = 0; j < file.hashes.size(); j++) { - tmp_file->store_string("<Block Hash=\"" - + file.hashes[j].base64_hash + "\" "); + tmp_file->store_string("<Block Hash=\"" + file.hashes[j].base64_hash + "\" "); if (file.compressed) tmp_file->store_string("Size=\"" + itos(file.hashes[j].compressed_size) + "\" "); tmp_file->store_string("/>"); @@ -605,12 +252,12 @@ String AppxPackager::content_type(String p_extension) { void AppxPackager::make_content_types() { - FileAccess* tmp_file = FileAccess::open(tmp_content_types_file_path, FileAccess::WRITE); + FileAccess *tmp_file = FileAccess::open(tmp_content_types_file_path, FileAccess::WRITE); tmp_file->store_string("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); tmp_file->store_string("<Types xmlns=\"http://schemas.openxmlformats.org/package/2006/content-types\">"); - Map<String, String> types; + Map<String, String> types; for (int i = 0; i < file_metadata.size(); i++) { @@ -688,7 +335,6 @@ void AppxPackager::store_central_dir_header(const FileMeta p_file, bool p_do_has int offs = buf.size(); buf.resize(buf.size() + BASE_CENTRAL_DIR_SIZE + p_file.name.length()); - // Write magic offs += buf_put_int32(CENTRAL_DIR_MAGIC, &buf[offs]); @@ -732,12 +378,6 @@ void AppxPackager::store_central_dir_header(const FileMeta p_file, bool p_do_has // File name offs += buf_put_string(p_file.name, &buf[offs]); -#ifdef OPENSSL_ENABLED - // Calculate the hash for signing - if (p_do_hash) - SHA256_Update(&axcd_context, buf.ptr(), buf.size()); -#endif // OPENSSL_ENABLED - // Done! } @@ -811,23 +451,16 @@ Vector<uint8_t> AppxPackager::make_end_of_central_record() { return buf; } -void AppxPackager::init(FileAccess * p_fa, SignOption p_sign, String &p_certificate_path, String &p_certificate_password) { +void AppxPackager::init(FileAccess *p_fa) { package = p_fa; central_dir_offset = 0; end_of_central_dir_offset = 0; tmp_blockmap_file_path = EditorSettings::get_singleton()->get_settings_path() + "/tmp/tmpblockmap.xml"; tmp_content_types_file_path = EditorSettings::get_singleton()->get_settings_path() + "/tmp/tmpcontenttypes.xml"; -#ifdef OPENSSL_ENABLED - certificate_path = p_certificate_path; - certificate_pass = p_certificate_password; - sign_package = p_sign == SIGN; - SHA256_Init(&axpc_context); - SHA256_Init(&axcd_context); -#endif // OPENSSL_ENABLED } -void AppxPackager::add_file(String p_file_name, const uint8_t * p_buffer, size_t p_len, int p_file_no, int p_total_files, bool p_compress) { +void AppxPackager::add_file(String p_file_name, const uint8_t *p_buffer, size_t p_len, int p_file_no, int p_total_files, bool p_compress) { if (p_file_no >= 1 && p_total_files >= 1) { EditorNode::progress_task_step(progress_task, "File: " + p_file_name, (p_file_no * 100) / p_total_files); @@ -846,7 +479,7 @@ void AppxPackager::add_file(String p_file_name, const uint8_t * p_buffer, size_t // Data for compression z_stream strm; - FileAccess* strm_f = NULL; + FileAccess *strm_f = NULL; Vector<uint8_t> strm_in; strm_in.resize(BLOCK_SIZE); Vector<uint8_t> strm_out; @@ -892,11 +525,6 @@ void AppxPackager::add_file(String p_file_name, const uint8_t * p_buffer, size_t file_buffer.resize(file_buffer.size() + bh.compressed_size); for (int i = 0; i < bh.compressed_size; i++) file_buffer[start + i] = strm_out[i]; -#ifdef OPENSSL_ENABLED - if (do_hash) - SHA256_Update(&axpc_context, strm_out.ptr(), strm.total_out - total_out_before); -#endif // OPENSSL_ENABLED - } else { bh.compressed_size = block_size; //package->store_buffer(strm_in.ptr(), block_size); @@ -904,10 +532,6 @@ void AppxPackager::add_file(String p_file_name, const uint8_t * p_buffer, size_t file_buffer.resize(file_buffer.size() + block_size); for (int i = 0; i < bh.compressed_size; i++) file_buffer[start + i] = strm_in[i]; -#ifdef OPENSSL_ENABLED - if (do_hash) - SHA256_Update(&axpc_context, strm_in.ptr(), block_size); -#endif // OPENSSL_ENABLED } meta.hashes.push_back(bh); @@ -931,10 +555,6 @@ void AppxPackager::add_file(String p_file_name, const uint8_t * p_buffer, size_t file_buffer.resize(file_buffer.size() + (strm.total_out - total_out_before)); for (int i = 0; i < (strm.total_out - total_out_before); i++) file_buffer[start + i] = strm_out[i]; -#ifdef OPENSSL_ENABLED - if (do_hash) - SHA256_Update(&axpc_context, strm_out.ptr(), strm.total_out - total_out_before); -#endif // OPENSSL_ENABLED deflateEnd(&strm); meta.compressed_size = strm.total_out; @@ -953,14 +573,6 @@ void AppxPackager::add_file(String p_file_name, const uint8_t * p_buffer, size_t Vector<uint8_t> file_header = make_file_header(meta); meta.lfh_size = file_header.size(); -#ifdef OPENSSL_ENABLED - // Hash the data for signing - if (do_hash) { - SHA256_Update(&axpc_context, file_header.ptr(), file_header.size()); - SHA256_Update(&axpc_context, file_buffer.ptr(), file_buffer.size()); - } -#endif // OPENSSL_ENABLED - // Store the header and file; package->store_buffer(file_header.ptr(), file_header.size()); package->store_buffer(file_buffer.ptr(), file_buffer.size()); @@ -974,22 +586,12 @@ void AppxPackager::finish() { EditorNode::progress_task_step("export", "Creating block map...", 4); make_block_map(); - FileAccess* blockmap_file = FileAccess::open(tmp_blockmap_file_path, FileAccess::READ); + FileAccess *blockmap_file = FileAccess::open(tmp_blockmap_file_path, FileAccess::READ); Vector<uint8_t> blockmap_buffer; blockmap_buffer.resize(blockmap_file->get_len()); blockmap_file->get_buffer(blockmap_buffer.ptr(), blockmap_buffer.size()); -#ifdef OPENSSL_ENABLED - // Hash the file for signing - if (sign_package) { - SHA256_CTX axbm_context; - SHA256_Init(&axbm_context); - SHA256_Update(&axbm_context, blockmap_buffer.ptr(), blockmap_buffer.size()); - SHA256_Final(digests.axbm, &axbm_context); - } -#endif // OPENSSL_ENABLED - add_file("AppxBlockMap.xml", blockmap_buffer.ptr(), blockmap_buffer.size(), -1, -1, true); blockmap_file->close(); @@ -1000,22 +602,12 @@ void AppxPackager::finish() { EditorNode::progress_task_step("export", "Setting content types...", 5); make_content_types(); - FileAccess* types_file = FileAccess::open(tmp_content_types_file_path, FileAccess::READ); + FileAccess *types_file = FileAccess::open(tmp_content_types_file_path, FileAccess::READ); Vector<uint8_t> types_buffer; types_buffer.resize(types_file->get_len()); types_file->get_buffer(types_buffer.ptr(), types_buffer.size()); -#ifdef OPENSSL_ENABLED - if (sign_package) { - // Hash the file for signing - SHA256_CTX axct_context; - SHA256_Init(&axct_context); - SHA256_Update(&axct_context, types_buffer.ptr(), types_buffer.size()); - SHA256_Final(digests.axct, &axct_context); - } -#endif // OPENSSL_ENABLED - add_file("[Content_Types].xml", types_buffer.ptr(), types_buffer.size(), -1, -1, true); types_file->close(); @@ -1027,76 +619,6 @@ void AppxPackager::finish() { store_central_dir_header(file_metadata[i]); } -#ifdef OPENSSL_ENABLED - // Create the signature file - if (sign_package) { - - Error err = read_cert_file(certificate_path, certificate_pass, &cert_file); - - if (err != OK) { - EditorNode::add_io_error(TTR("Couldn't read the certificate file. Are the path and password both correct?")); - package->close(); - memdelete(package); - package = NULL; - return; - } - - - // Make a temp end of the zip for hashing - central_dir_offset = package->get_pos(); - end_of_central_dir_offset = central_dir_offset + central_dir_data.size(); - Vector<uint8_t> zip_end_dir = make_end_of_central_record(); - - // Hash the end directory - SHA256_Update(&axcd_context, zip_end_dir.ptr(), zip_end_dir.size()); - - // Finish the hashes - make_digests(); - - PKCS7* signature = PKCS7_new(); - if (!signature) { - EditorNode::add_io_error(TTR("Error creating the signature object.")); - package->close(); - memdelete(package); - package = NULL; - return; - } - - err = sign(cert_file, digests, signature); - - if (err != OK) { - EditorNode::add_io_error(TTR("Error creating the package signature.")); - package->close(); - memdelete(package); - package = NULL; - return; - } - - // Read the signature as bytes - BIO* bio_out = BIO_new(BIO_s_mem()); - i2d_PKCS7_bio(bio_out, signature); - - BIO_flush(bio_out); - - uint8_t* bio_ptr; - size_t bio_size = BIO_get_mem_data(bio_out, &bio_ptr); - - // Create the signature buffer with magic number - Vector<uint8_t> signature_file; - signature_file.resize(4 + bio_size); - buf_put_int32(P7X_SIGNATURE, signature_file.ptr()); - for (int i = 0; i < bio_size; i++) - signature_file[i + 4] = bio_ptr[i]; - - // Add the signature to the package - add_file("AppxSignature.p7x", signature_file.ptr(), signature_file.size(), -1, -1, true); - - // Add central directory entry - store_central_dir_header(file_metadata[file_metadata.size() - 1], false); - } -#endif // OPENSSL_ENABLED - - // Write central directory EditorNode::progress_task_step("export", "Finishing package...", 6); central_dir_offset = package->get_pos(); @@ -1112,1284 +634,749 @@ void AppxPackager::finish() { package = NULL; } -#ifdef OPENSSL_ENABLED -// https://support.microsoft.com/en-us/kb/287547 -const char SPC_INDIRECT_DATA_OBJID[] = "1.3.6.1.4.1.311.2.1.4"; -const char SPC_STATEMENT_TYPE_OBJID[] = "1.3.6.1.4.1.311.2.1.11"; -const char SPC_SP_OPUS_INFO_OBJID[] = "1.3.6.1.4.1.311.2.1.12"; -const char SPC_SIPINFO_OBJID[] = "1.3.6.1.4.1.311.2.1.30"; -#endif // OPENSSL_ENABLED - AppxPackager::AppxPackager() {} AppxPackager::~AppxPackager() {} - //////////////////////////////////////////////////////////////////// -#ifdef OPENSSL_ENABLED -Error AppxPackager::openssl_error(unsigned long p_err) { +class EditorExportUWP : public EditorExportPlatform { - ERR_load_crypto_strings(); + GDCLASS(EditorExportUWP, EditorExportPlatform); - char buffer[256]; - ERR_error_string_n(p_err, buffer, sizeof(buffer)); - - String err(buffer); - - ERR_EXPLAIN(err); - ERR_FAIL_V(FAILED); -} - -void AppxPackager::MakeSPCInfoValue(asn1::SPCInfoValue &info) { + Ref<ImageTexture> logo; - // I have no idea what these numbers mean. - static uint8_t s1Magic[] = { - 0x4B, 0xDF, 0xC5, 0x0A, 0x07, 0xCE, 0xE2, 0x4D, - 0xB7, 0x6E, 0x23, 0xC8, 0x39, 0xA0, 0x9F, 0xD1, + enum Platform { + ARM, + X86, + X64 }; - ASN1_INTEGER_set(info.i1, 0x01010000); - ASN1_OCTET_STRING_set(info.s1, s1Magic, sizeof(s1Magic)); - ASN1_INTEGER_set(info.i2, 0x00000000); - ASN1_INTEGER_set(info.i3, 0x00000000); - ASN1_INTEGER_set(info.i4, 0x00000000); - ASN1_INTEGER_set(info.i5, 0x00000000); - ASN1_INTEGER_set(info.i6, 0x00000000); -} -Error AppxPackager::MakeIndirectDataContent(asn1::SPCIndirectDataContent &idc) { + bool _valid_resource_name(const String &p_name) const { - using namespace asn1; + if (p_name.empty()) return false; + if (p_name.ends_with(".")) return false; - ASN1_TYPE* algorithmParameter = ASN1_TYPE_new(); - if (!algorithmParameter) { - return openssl_error(ERR_peek_last_error()); - } - algorithmParameter->type = V_ASN1_NULL; - - SPCInfoValue* infoValue = SPCInfoValue_new(); - if (!infoValue) { - return openssl_error(ERR_peek_last_error()); - } - MakeSPCInfoValue(*infoValue); + static const char *invalid_names[] = { + "CON", "PRN", "AUX", "NUL", "COM1", "COM2", "COM3", "COM4", "COM5", "COM6", "COM7", + "COM8", "COM9", "LPT1", "LPT2", "LPT3", "LPT4", "LPT5", "LPT6", "LPT7", "LPT8", "LPT9", + NULL + }; - ASN1_TYPE* value = - EncodedASN1::FromItem<asn1::SPCInfoValue, - asn1::i2d_SPCInfoValue>(infoValue) - .ToSequenceType(); - - { - Vector<uint8_t> digest; - write_digest(digest); - if (!ASN1_OCTET_STRING_set(idc.messageDigest->digest, - digest.ptr(), digest.size())) { - - return openssl_error(ERR_peek_last_error()); + const char **t = invalid_names; + while (*t) { + if (p_name == *t) return false; + t++; } - } - - idc.data->type = OBJ_txt2obj(SPC_SIPINFO_OBJID, 1); - idc.data->value = value; - idc.messageDigest->digestAlgorithm->algorithm = OBJ_nid2obj(NID_sha256); - idc.messageDigest->digestAlgorithm->parameter = algorithmParameter; - - return OK; -} - -Error AppxPackager::add_attributes(PKCS7_SIGNER_INFO * p_signer_info) { - - // Add opus attribute - asn1::SPCSpOpusInfo* opus = asn1::SPCSpOpusInfo_new(); - if (!opus) return openssl_error(ERR_peek_last_error()); - - ASN1_STRING* opus_value = - EncodedASN1::FromItem<asn1::SPCSpOpusInfo, - asn1::i2d_SPCSpOpusInfo>(opus) - .ToSequenceString(); - - if (!PKCS7_add_signed_attribute( - p_signer_info, - OBJ_txt2nid(SPC_SP_OPUS_INFO_OBJID), - V_ASN1_SEQUENCE, - opus_value - )) { - - asn1::SPCSpOpusInfo_free(opus); - - ASN1_STRING_free(opus_value); - return openssl_error(ERR_peek_last_error()); - } - - // Add content type attribute - if (!PKCS7_add_signed_attribute( - p_signer_info, - NID_pkcs9_contentType, - V_ASN1_OBJECT, - OBJ_txt2obj(SPC_INDIRECT_DATA_OBJID, 1) - )) { - - asn1::SPCSpOpusInfo_free(opus); - ASN1_STRING_free(opus_value); - return openssl_error(ERR_peek_last_error()); - } - - // Add statement type attribute - asn1::SPCStatementType* statement_type = asn1::SPCStatementType_new(); - if (!statement_type) return openssl_error(ERR_peek_last_error()); - - statement_type->type = OBJ_nid2obj(NID_ms_code_ind); - ASN1_STRING* statement_type_value = - EncodedASN1::FromItem<asn1::SPCStatementType, - asn1::i2d_SPCStatementType>(statement_type) - .ToSequenceString(); - - if (!PKCS7_add_signed_attribute( - p_signer_info, - OBJ_txt2nid(SPC_STATEMENT_TYPE_OBJID), - V_ASN1_SEQUENCE, - statement_type_value - )) { - - ASN1_STRING_free(opus_value); - asn1::SPCStatementType_free(statement_type); - ASN1_STRING_free(statement_type_value); - - return openssl_error(ERR_peek_last_error()); - } - - return OK; - -} - -void AppxPackager::make_digests() { - - // AXPC - SHA256_Final(digests.axpc, &axpc_context); - - // AXCD - SHA256_Final(digests.axcd, &axcd_context); - - // AXCI - for (int i = 0; i < SHA256_DIGEST_LENGTH; i++) - digests.axci[i] = 0; - -} - -void AppxPackager::write_digest(Vector<uint8_t>& p_out_buffer) { - - // Size of digests plus 6 32-bit magic numbers - p_out_buffer.resize((SHA256_DIGEST_LENGTH * 5) + (6 * 4)); - - int offs = 0; - - // APPX - uint32_t sig = 0x58505041; - offs += buf_put_int32(sig, &p_out_buffer[offs]); - - // AXPC - uint32_t axpc_sig = 0x43505841; - offs += buf_put_int32(axpc_sig, &p_out_buffer[offs]); - for (int i = 0; i < SHA256_DIGEST_LENGTH; i++) { - p_out_buffer[offs++] = digests.axpc[i]; - } - - // AXCD - uint32_t axcd_sig = 0x44435841; - offs += buf_put_int32(axcd_sig, &p_out_buffer[offs]); - for (int i = 0; i < SHA256_DIGEST_LENGTH; i++) { - p_out_buffer[offs++] = digests.axcd[i]; - } - - // AXCT - uint32_t axct_sig = 0x54435841; - offs += buf_put_int32(axct_sig, &p_out_buffer[offs]); - for (int i = 0; i < SHA256_DIGEST_LENGTH; i++) { - p_out_buffer[offs++] = digests.axct[i]; - } - - // AXBM - uint32_t axbm_sig = 0x4D425841; - offs += buf_put_int32(axbm_sig, &p_out_buffer[offs]); - for (int i = 0; i < SHA256_DIGEST_LENGTH; i++) { - p_out_buffer[offs++] = digests.axbm[i]; - } - - // AXCI - uint32_t axci_sig = 0x49435841; - offs += buf_put_int32(axci_sig, &p_out_buffer[offs]); - for (int i = 0; i < SHA256_DIGEST_LENGTH; i++) { - p_out_buffer[offs++] = digests.axci[i]; - } - - // Done! -} - -Error AppxPackager::read_cert_file(const String & p_path, const String &p_password, CertFile* p_out_cf) { - - ERR_FAIL_COND_V(!p_out_cf, ERR_INVALID_PARAMETER); - - BIO* bio = BIO_new_file(p_path.utf8().get_data(), "rb"); - if (!bio) { - return openssl_error(ERR_peek_last_error()); - } - - PKCS12* data = d2i_PKCS12_bio(bio, NULL); - if (!data) { - BIO_free(bio); - return openssl_error(ERR_peek_last_error()); - } - - /* Fails to link with GCC, need to solve when implement signing - if (!PKCS12_parse(data, p_password.utf8().get_data(), &p_out_cf->private_key, &p_out_cf->certificate, NULL)) { - PKCS12_free(data); - BIO_free(bio); - return openssl_error(ERR_peek_last_error()); - }*/ - - if (!p_out_cf->private_key) { - PKCS12_free(data); - BIO_free(bio); - return openssl_error(ERR_peek_last_error()); - } - - if (!p_out_cf->certificate) { - PKCS12_free(data); - BIO_free(bio); - return openssl_error(ERR_peek_last_error()); - } - - PKCS12_free(data); - BIO_free(bio); - - return OK; -} - -Error AppxPackager::sign(const CertFile & p_cert, const AppxDigests & digests, PKCS7 * p_out_signature) { - - OpenSSL_add_all_algorithms(); - - // Register object IDs - OBJ_create_and_add_object(SPC_INDIRECT_DATA_OBJID, NULL, NULL); - OBJ_create_and_add_object(SPC_SIPINFO_OBJID, NULL, NULL); - OBJ_create_and_add_object(SPC_SP_OPUS_INFO_OBJID, NULL, NULL); - OBJ_create_and_add_object(SPC_STATEMENT_TYPE_OBJID, NULL, NULL); - - if (!PKCS7_set_type(p_out_signature, NID_pkcs7_signed)) { - return openssl_error(ERR_peek_last_error()); - } - - PKCS7_SIGNER_INFO *signer_info = PKCS7_add_signature(p_out_signature, p_cert.certificate, p_cert.private_key, EVP_sha256()); - if (!signer_info) return openssl_error(ERR_peek_last_error()); - - add_attributes(signer_info); - - if (!PKCS7_content_new(p_out_signature, NID_pkcs7_data)) { + return true; + } + + bool _valid_guid(const String &p_guid) const { + + Vector<String> parts = p_guid.split("-"); + + if (parts.size() != 5) return false; + if (parts[0].length() != 8) return false; + for (int i = 1; i < 4; i++) + if (parts[i].length() != 4) return false; + if (parts[4].length() != 12) return false; + + return true; + } + + bool _valid_bgcolor(const String &p_color) const { + + if (p_color.empty()) return true; + if (p_color.begins_with("#") && p_color.is_valid_html_color()) return true; + + // Colors from https://msdn.microsoft.com/en-us/library/windows/apps/dn934817.aspx + static const char *valid_colors[] = { + "aliceBlue", "antiqueWhite", "aqua", "aquamarine", "azure", "beige", + "bisque", "black", "blanchedAlmond", "blue", "blueViolet", "brown", + "burlyWood", "cadetBlue", "chartreuse", "chocolate", "coral", "cornflowerBlue", + "cornsilk", "crimson", "cyan", "darkBlue", "darkCyan", "darkGoldenrod", + "darkGray", "darkGreen", "darkKhaki", "darkMagenta", "darkOliveGreen", "darkOrange", + "darkOrchid", "darkRed", "darkSalmon", "darkSeaGreen", "darkSlateBlue", "darkSlateGray", + "darkTurquoise", "darkViolet", "deepPink", "deepSkyBlue", "dimGray", "dodgerBlue", + "firebrick", "floralWhite", "forestGreen", "fuchsia", "gainsboro", "ghostWhite", + "gold", "goldenrod", "gray", "green", "greenYellow", "honeydew", + "hotPink", "indianRed", "indigo", "ivory", "khaki", "lavender", + "lavenderBlush", "lawnGreen", "lemonChiffon", "lightBlue", "lightCoral", "lightCyan", + "lightGoldenrodYellow", "lightGreen", "lightGray", "lightPink", "lightSalmon", "lightSeaGreen", + "lightSkyBlue", "lightSlateGray", "lightSteelBlue", "lightYellow", "lime", "limeGreen", + "linen", "magenta", "maroon", "mediumAquamarine", "mediumBlue", "mediumOrchid", + "mediumPurple", "mediumSeaGreen", "mediumSlateBlue", "mediumSpringGreen", "mediumTurquoise", "mediumVioletRed", + "midnightBlue", "mintCream", "mistyRose", "moccasin", "navajoWhite", "navy", + "oldLace", "olive", "oliveDrab", "orange", "orangeRed", "orchid", + "paleGoldenrod", "paleGreen", "paleTurquoise", "paleVioletRed", "papayaWhip", "peachPuff", + "peru", "pink", "plum", "powderBlue", "purple", "red", + "rosyBrown", "royalBlue", "saddleBrown", "salmon", "sandyBrown", "seaGreen", + "seaShell", "sienna", "silver", "skyBlue", "slateBlue", "slateGray", + "snow", "springGreen", "steelBlue", "tan", "teal", "thistle", + "tomato", "transparent", "turquoise", "violet", "wheat", "white", + "whiteSmoke", "yellow", "yellowGreen", + NULL + }; + + const char **color = valid_colors; + + while (*color) { + if (p_color == *color) return true; + color++; + } - return openssl_error(ERR_peek_last_error()); + return false; } - if (!PKCS7_add_certificate(p_out_signature, p_cert.certificate)) { + bool _valid_image(const StreamTexture *p_image, int p_width, int p_height) const { - return openssl_error(ERR_peek_last_error()); - } + if (!p_image) { + return false; + } - asn1::SPCIndirectDataContent* idc = asn1::SPCIndirectDataContent_new(); + // TODO: Add resource creation or image rescaling to enable other scales: + // 1.25, 1.5, 2.0 + real_t scales[] = { 1.0 }; + bool valid_w = false; + bool valid_h = false; - MakeIndirectDataContent(*idc); - EncodedASN1 idc_encoded = - EncodedASN1::FromItem<asn1::SPCIndirectDataContent, asn1::i2d_SPCIndirectDataContent>(idc); + for (int i = 0; i < 1; i++) { - BIO* signed_data = PKCS7_dataInit(p_out_signature, NULL); + int w = ceil(p_width * scales[i]); + int h = ceil(p_height * scales[i]); - if (idc_encoded.size() < 2) { + if (w == p_image->get_width()) + valid_w = true; + if (h == p_image->get_height()) + valid_h = true; + } - ERR_EXPLAIN("Invalid encoded size"); - ERR_FAIL_V(FAILED); + return valid_w && valid_h; } - if ((idc_encoded.data()[1] & 0x80) == 0x00) { + Vector<uint8_t> _fix_manifest(const Ref<EditorExportPreset> &p_preset, const Vector<uint8_t> &p_template, bool p_give_internet) const { - ERR_EXPLAIN("Invalid encoded data"); - ERR_FAIL_V(FAILED); - } + String result = String::utf8((const char *)p_template.ptr(), p_template.size()); - size_t skip = 4; + result = result.replace("$godot_version$", VERSION_FULL_NAME); - if (BIO_write(signed_data, idc_encoded.data() + skip, idc_encoded.size() - skip) - != idc_encoded.size() - skip) { + result = result.replace("$identity_name$", p_preset->get("package/unique_name")); + result = result.replace("$publisher$", p_preset->get("package/publisher")); - return openssl_error(ERR_peek_last_error()); - } - if (BIO_flush(signed_data) != 1) { + result = result.replace("$product_guid$", p_preset->get("identity/product_guid")); + result = result.replace("$publisher_guid$", p_preset->get("identity/publisher_guid")); - return openssl_error(ERR_peek_last_error()); - } + String version = itos(p_preset->get("version/major")) + "." + itos(p_preset->get("version/minor")) + "." + itos(p_preset->get("version/build")) + "." + itos(p_preset->get("version/revision")); + result = result.replace("$version_string$", version); - if (!PKCS7_dataFinal(p_out_signature, signed_data)) { + Platform arch = (Platform)(int)p_preset->get("architecture/target"); + String architecture = arch == ARM ? "ARM" : arch == X86 ? "x86" : "x64"; + result = result.replace("$architecture$", architecture); - return openssl_error(ERR_peek_last_error()); - } + result = result.replace("$display_name$", String(p_preset->get("package/display_name")).empty() ? (String)GlobalConfig::get_singleton()->get("application/name") : String(p_preset->get("package/display_name"))); + result = result.replace("$publisher_display_name$", p_preset->get("package/publisher_display_name")); + result = result.replace("$app_description$", p_preset->get("package/description")); + result = result.replace("$bg_color$", p_preset->get("images/background_color")); + result = result.replace("$short_name$", p_preset->get("package/short_name")); - PKCS7* content = PKCS7_new(); - if (!content) { + String name_on_tiles = ""; + if ((bool)p_preset->get("tiles/show_name_on_square150x150")) { + name_on_tiles += " <uap:ShowOn Tile=\"square150x150Logo\" />\n"; + } + if ((bool)p_preset->get("tiles/show_name_on_wide310x150")) { + name_on_tiles += " <uap:ShowOn Tile=\"wide310x150Logo\" />\n"; + } + if ((bool)p_preset->get("tiles/show_name_on_square310x310")) { + name_on_tiles += " <uap:ShowOn Tile=\"square310x310Logo\" />\n"; + } - return openssl_error(ERR_peek_last_error()); - } + String show_name_on_tiles = ""; + if (!name_on_tiles.empty()) { + show_name_on_tiles = "<uap:ShowNameOnTiles>\n" + name_on_tiles + " </uap:ShowNameOnTiles>"; + } - content->type = OBJ_txt2obj(SPC_INDIRECT_DATA_OBJID, 1); + result = result.replace("$name_on_tiles$", name_on_tiles); - ASN1_TYPE* idc_sequence = idc_encoded.ToSequenceType(); - content->d.other = idc_sequence; + String rotations = ""; + if ((bool)p_preset->get("orientation/landscape")) { + rotations += " <uap:Rotation Preference=\"landscape\" />\n"; + } + if ((bool)p_preset->get("orientation/portrait")) { + rotations += " <uap:Rotation Preference=\"portrait\" />\n"; + } + if ((bool)p_preset->get("orientation/landscape_flipped")) { + rotations += " <uap:Rotation Preference=\"landscapeFlipped\" />\n"; + } + if ((bool)p_preset->get("orientation/portrait_flipped")) { + rotations += " <uap:Rotation Preference=\"portraitFlipped\" />\n"; + } - if (!PKCS7_set_content(p_out_signature, content)) { + String rotation_preference = ""; + if (!rotations.empty()) { + rotation_preference = "<uap:InitialRotationPreference>\n" + rotations + " </uap:InitialRotationPreference>"; + } - return openssl_error(ERR_peek_last_error()); - } + result = result.replace("$rotation_preference$", rotation_preference); - return OK; -} - -#endif // OPENSSL_ENABLED + String capabilities_elements = ""; + const char **basic = uwp_capabilities; + while (*basic) { + if ((bool)p_preset->get("capabilities/" + String(*basic))) { + capabilities_elements += " <Capability Name=\"" + String(*basic) + "\" />\n"; + } + basic++; + } + const char **uap = uwp_uap_capabilities; + while (*uap) { + if ((bool)p_preset->get("capabilities/" + String(*uap))) { + capabilities_elements += " <uap:Capability Name=\"" + String(*uap) + "\" />\n"; + } + uap++; + } + const char **device = uwp_device_capabilites; + while (*device) { + if ((bool)p_preset->get("capabilities/" + String(*device))) { + capabilities_elements += " <DeviceCapability Name=\"" + String(*device) + "\" />\n"; + } + device++; + } -//////////////////////////////////////////////////////////////////// + if (!((bool)p_preset->get("capabilities/internetClient")) && p_give_internet) { + capabilities_elements += " <Capability Name=\"internetClient\" />\n"; + } + String capabilities_string = "<Capabilities />"; + if (!capabilities_elements.empty()) { + capabilities_string = "<Capabilities>\n" + capabilities_elements + " </Capabilities>"; + } -bool EditorExportPlatformUWP::_valid_resource_name(const String &p_name) const { + result = result.replace("$capabilities_place$", capabilities_string); - if (p_name.empty()) return false; - if (p_name.ends_with(".")) return false; + Vector<uint8_t> r_ret; + r_ret.resize(result.length()); - static const char* invalid_names[] = { - "CON","PRN","AUX","NUL","COM1","COM2","COM3","COM4","COM5","COM6","COM7", - "COM8","COM9","LPT1","LPT2","LPT3","LPT4","LPT5","LPT6","LPT7","LPT8","LPT9", - NULL - }; + for (int i = 0; i < result.length(); i++) + r_ret[i] = result.utf8().get(i); - const char** t = invalid_names; - while (*t) { - if (p_name == *t) return false; - t++; + return r_ret; } - return true; -} - -bool EditorExportPlatformUWP::_valid_guid(const String & p_guid) const { + Vector<uint8_t> _get_image_data(const Ref<EditorExportPreset> &p_preset, const String &p_path) { - Vector<String> parts = p_guid.split("-"); - - if (parts.size() != 5) return false; - if (parts[0].length() != 8) return false; - for (int i = 1; i < 4; i++) - if (parts[i].length() != 4) return false; - if (parts[4].length() != 12) return false; - - return true; -} - -bool EditorExportPlatformUWP::_valid_bgcolor(const String & p_color) const { - - if (p_color.empty()) return true; - if (p_color.begins_with("#") && p_color.is_valid_html_color()) return true; - - // Colors from https://msdn.microsoft.com/en-us/library/windows/apps/dn934817.aspx - static const char* valid_colors[] = { - "aliceBlue","antiqueWhite","aqua","aquamarine","azure","beige", - "bisque","black","blanchedAlmond","blue","blueViolet","brown", - "burlyWood","cadetBlue","chartreuse","chocolate","coral","cornflowerBlue", - "cornsilk","crimson","cyan","darkBlue","darkCyan","darkGoldenrod", - "darkGray","darkGreen","darkKhaki","darkMagenta","darkOliveGreen","darkOrange", - "darkOrchid","darkRed","darkSalmon","darkSeaGreen","darkSlateBlue","darkSlateGray", - "darkTurquoise","darkViolet","deepPink","deepSkyBlue","dimGray","dodgerBlue", - "firebrick","floralWhite","forestGreen","fuchsia","gainsboro","ghostWhite", - "gold","goldenrod","gray","green","greenYellow","honeydew", - "hotPink","indianRed","indigo","ivory","khaki","lavender", - "lavenderBlush","lawnGreen","lemonChiffon","lightBlue","lightCoral","lightCyan", - "lightGoldenrodYellow","lightGreen","lightGray","lightPink","lightSalmon","lightSeaGreen", - "lightSkyBlue","lightSlateGray","lightSteelBlue","lightYellow","lime","limeGreen", - "linen","magenta","maroon","mediumAquamarine","mediumBlue","mediumOrchid", - "mediumPurple","mediumSeaGreen","mediumSlateBlue","mediumSpringGreen","mediumTurquoise","mediumVioletRed", - "midnightBlue","mintCream","mistyRose","moccasin","navajoWhite","navy", - "oldLace","olive","oliveDrab","orange","orangeRed","orchid", - "paleGoldenrod","paleGreen","paleTurquoise","paleVioletRed","papayaWhip","peachPuff", - "peru","pink","plum","powderBlue","purple","red", - "rosyBrown","royalBlue","saddleBrown","salmon","sandyBrown","seaGreen", - "seaShell","sienna","silver","skyBlue","slateBlue","slateGray", - "snow","springGreen","steelBlue","tan","teal","thistle", - "tomato","transparent","turquoise","violet","wheat","white", - "whiteSmoke","yellow","yellowGreen", - NULL - }; - - const char** color = valid_colors; + Vector<uint8_t> data; + StreamTexture *image; + + if (p_path.find("StoreLogo") != -1) { + image = p_preset->get("images/store_logo").is_zero() ? NULL : ((Object *)p_preset->get("images/store_logo"))->cast_to<StreamTexture>(); + } else if (p_path.find("Square44x44Logo") != -1) { + image = p_preset->get("images/square44x44_logo").is_zero() ? NULL : ((Object *)p_preset->get("images/square44x44_logo"))->cast_to<StreamTexture>(); + } else if (p_path.find("Square71x71Logo") != -1) { + image = p_preset->get("images/square71x71_logo").is_zero() ? NULL : ((Object *)p_preset->get("images/square71x71_logo"))->cast_to<StreamTexture>(); + } else if (p_path.find("Square150x150Logo") != -1) { + image = p_preset->get("images/square150x150_logo").is_zero() ? NULL : ((Object *)p_preset->get("images/square150x150_logo"))->cast_to<StreamTexture>(); + } else if (p_path.find("Square310x310Logo") != -1) { + image = p_preset->get("images/square310x310_logo").is_zero() ? NULL : ((Object *)p_preset->get("images/square310x310_logo"))->cast_to<StreamTexture>(); + } else if (p_path.find("Wide310x150Logo") != -1) { + image = p_preset->get("images/wide310x150_logo").is_zero() ? NULL : ((Object *)p_preset->get("images/wide310x150_logo"))->cast_to<StreamTexture>(); + } else if (p_path.find("SplashScreen") != -1) { + image = p_preset->get("images/splash_screen").is_zero() ? NULL : ((Object *)p_preset->get("images/splash_screen"))->cast_to<StreamTexture>(); + } - while(*color) { - if (p_color == *color) return true; - color++; - } + if (!image) return data; - return false; -} + String tmp_path = EditorSettings::get_singleton()->get_settings_path().plus_file("tmp/uwp_tmp_logo.png"); -bool EditorExportPlatformUWP::_valid_image(const Ref<ImageTexture> p_image, int p_width, int p_height) const { + Error err = image->get_data()->save_png(tmp_path); - if (!p_image.is_valid()) return false; + if (err != OK) { - // TODO: Add resource creation or image rescaling to enable other scales: - // 1.25, 1.5, 2.0 - real_t scales[] = { 1.0 }; - bool valid_w = false; - bool valid_h = false; + String err_string = "Couldn't save temp logo file."; - for (int i = 0; i < 1; i++) { + EditorNode::add_io_error(err_string); + ERR_EXPLAIN(err_string); + ERR_FAIL_V(data); + } - int w = ceil(p_width * scales[i]); - int h = ceil(p_height * scales[i]); + FileAccess *f = FileAccess::open(tmp_path, FileAccess::READ, &err); - if (w == p_image->get_width()) - valid_w = true; - if (h == p_image->get_height()) - valid_h = true; - } + if (err != OK) { - return valid_w && valid_h; -} + String err_string = "Couldn't open temp logo file."; -Vector<uint8_t> EditorExportPlatformUWP::_fix_manifest(const Vector<uint8_t> &p_template, bool p_give_internet) const { + EditorNode::add_io_error(err_string); + ERR_EXPLAIN(err_string); + ERR_FAIL_V(data); + } - String result = String::utf8((const char*)p_template.ptr(), p_template.size()); + data.resize(f->get_len()); + f->get_buffer(data.ptr(), data.size()); - result = result.replace("$godot_version$", VERSION_FULL_NAME); + f->close(); + memdelete(f); - result = result.replace("$identity_name$", unique_name); - result = result.replace("$publisher$", publisher); + // Delete temp file + DirAccess *dir = DirAccess::open(tmp_path.get_base_dir(), &err); - result = result.replace("$product_guid$", product_guid); - result = result.replace("$publisher_guid$", publisher_guid); + if (err != OK) { - String version = itos(version_major) + "." + itos(version_minor) + "." + itos(version_build) + "." + itos(version_revision); - result = result.replace("$version_string$", version); + String err_string = "Couldn't open temp path to remove temp logo file."; - String architecture = arch == ARM ? "ARM" : arch == X86 ? "x86" : "x64"; - result = result.replace("$architecture$", architecture); + EditorNode::add_io_error(err_string); + ERR_EXPLAIN(err_string); + ERR_FAIL_V(data); + } - result = result.replace("$display_name$", display_name.empty() ? (String)GlobalConfig::get_singleton()->get("application/name") : display_name); - result = result.replace("$publisher_display_name$", publisher_display_name); - result = result.replace("$app_description$", description); - result = result.replace("$bg_color$", background_color); - result = result.replace("$short_name$", short_name); + err = dir->remove(tmp_path); - String name_on_tiles = ""; - if (name_on_square150) { - name_on_tiles += " <uap:ShowOn Tile=\"square150x150Logo\" />\n"; - } - if (name_on_wide) { - name_on_tiles += " <uap:ShowOn Tile=\"wide310x150Logo\" />\n"; - } - if (name_on_square310) { - name_on_tiles += " <uap:ShowOn Tile=\"square310x310Logo\" />\n"; - } + memdelete(dir); - String show_name_on_tiles = ""; - if (!name_on_tiles.empty()) { - show_name_on_tiles = "<uap:ShowNameOnTiles>\n" + name_on_tiles + " </uap:ShowNameOnTiles>"; - } + if (err != OK) { - result = result.replace("$name_on_tiles$", name_on_tiles); + String err_string = "Couldn't remove temp logo file."; - String rotations = ""; - if (orientation_landscape) { - rotations += " <uap:Rotation Preference=\"landscape\" />\n"; - } - if (orientation_portrait) { - rotations += " <uap:Rotation Preference=\"portrait\" />\n"; - } - if (orientation_landscape_flipped) { - rotations += " <uap:Rotation Preference=\"landscapeFlipped\" />\n"; - } - if (orientation_portrait_flipped) { - rotations += " <uap:Rotation Preference=\"portraitFlipped\" />\n"; - } + EditorNode::add_io_error(err_string); + ERR_EXPLAIN(err_string); + ERR_FAIL_V(data); + } - String rotation_preference = ""; - if (!rotations.empty()) { - rotation_preference = "<uap:InitialRotationPreference>\n" + rotations + " </uap:InitialRotationPreference>"; - } + return data; + } + + static bool _should_compress_asset(const String &p_path, const Vector<uint8_t> &p_data) { + + /* TODO: This was copied verbatim from Android export. It should be + * refactored to the parent class and also be used for .zip export. + */ + + /* + * By not compressing files with little or not benefit in doing so, + * a performance gain is expected at runtime. Moreover, if the APK is + * zip-aligned, assets stored as they are can be efficiently read by + * Android by memory-mapping them. + */ + + // -- Unconditional uncompress to mimic AAPT plus some other + + static const char *unconditional_compress_ext[] = { + // From https://github.com/android/platform_frameworks_base/blob/master/tools/aapt/Package.cpp + // These formats are already compressed, or don't compress well: + ".jpg", ".jpeg", ".png", ".gif", + ".wav", ".mp2", ".mp3", ".ogg", ".aac", + ".mpg", ".mpeg", ".mid", ".midi", ".smf", ".jet", + ".rtttl", ".imy", ".xmf", ".mp4", ".m4a", + ".m4v", ".3gp", ".3gpp", ".3g2", ".3gpp2", + ".amr", ".awb", ".wma", ".wmv", + // Godot-specific: + ".webp", // Same reasoning as .png + ".cfb", // Don't let small config files slow-down startup + ".scn", // Binary scenes are usually already compressed + ".stex", // Streamable textures are usually already compressed + // Trailer for easier processing + NULL + }; + + for (const char **ext = unconditional_compress_ext; *ext; ++ext) { + if (p_path.to_lower().ends_with(String(*ext))) { + return false; + } + } - result = result.replace("$rotation_preference$", rotation_preference); + // -- Compressed resource? - String capabilities_elements = ""; - const char **basic = uwp_capabilities; - while (*basic) { - if (capabilities.has(*basic)) { - capabilities_elements += " <Capability Name=\"" + String(*basic) + "\" />\n"; - } - basic++; - } - const char **uap = uwp_uap_capabilities; - while (*uap) { - if (uap_capabilities.has(*uap)) { - capabilities_elements += " <uap:Capability Name=\"" + String(*uap) + "\" />\n"; - } - uap++; - } - const char **device = uwp_device_capabilites; - while (*device) { - if (uap_capabilities.has(*device)) { - capabilities_elements += " <DeviceCapability Name=\"" + String(*device) + "\" />\n"; + if (p_data.size() >= 4 && p_data[0] == 'R' && p_data[1] == 'S' && p_data[2] == 'C' && p_data[3] == 'C') { + // Already compressed + return false; } - device++; - } - if (!capabilities.has("internetClient") && p_give_internet) { - capabilities_elements += " <Capability Name=\"internetClient\" />\n"; - } + // --- TODO: Decide on texture resources according to their image compression setting - String capabilities_string = "<Capabilities />"; - if (!capabilities_elements.empty()) { - capabilities_string = "<Capabilities>\n" + capabilities_elements + " </Capabilities>"; + return true; } - result = result.replace("$capabilities_place$", capabilities_string); + static Error save_appx_file(void *p_userdata, const String &p_path, const Vector<uint8_t> &p_data, int p_file, int p_total) { - Vector<uint8_t> r_ret; - r_ret.resize(result.length()); + AppxPackager *packager = (AppxPackager *)p_userdata; + String dst_path = p_path.replace_first("res://", "game/"); - for (int i = 0; i < result.length(); i++) - r_ret[i] = result.utf8().get(i); + packager->add_file(dst_path, p_data.ptr(), p_data.size(), p_file, p_total, _should_compress_asset(p_path, p_data)); - return r_ret; -} - -Vector<uint8_t> EditorExportPlatformUWP::_get_image_data(const String & p_path) { - - Vector<uint8_t> data; - Ref<ImageTexture> ref; - - if (p_path.find("StoreLogo") != -1) { - ref = store_logo; - } else if (p_path.find("Square44x44Logo") != -1) { - ref = square44; - } else if (p_path.find("Square71x71Logo") != -1) { - ref = square71; - } else if (p_path.find("Square150x150Logo") != -1) { - ref = square150; - } else if (p_path.find("Square310x310Logo") != -1) { - ref = square310; - } else if (p_path.find("Wide310x150Logo") != -1) { - ref = wide310; - } else if (p_path.find("SplashScreen") != -1) { - ref = splash; + return OK; } - if (!ref.is_valid()) return data; - - - String tmp_path = EditorSettings::get_singleton()->get_settings_path().plus_file("tmp/uwp_tmp_logo.png"); - - Error err = ref->get_data().save_png(tmp_path); - - if (err != OK) { - - String err_string = "Couldn't save temp logo file."; - - EditorNode::add_io_error(err_string); - ERR_EXPLAIN(err_string); - ERR_FAIL_V(data); +public: + virtual String get_name() const { + return "Windows Universal"; } - FileAccess* f = FileAccess::open(tmp_path, FileAccess::READ, &err); - - if (err != OK) { - - String err_string = "Couldn't open temp logo file."; - - EditorNode::add_io_error(err_string); - ERR_EXPLAIN(err_string); - ERR_FAIL_V(data); + virtual String get_binary_extension() const { + return "appx"; } - data.resize(f->get_len()); - f->get_buffer(data.ptr(), data.size()); - - f->close(); - memdelete(f); - - // Delete temp file - DirAccess* dir = DirAccess::open(tmp_path.get_base_dir(), &err); - - if (err != OK) { - - String err_string = "Couldn't open temp path to remove temp logo file."; - - EditorNode::add_io_error(err_string); - ERR_EXPLAIN(err_string); - ERR_FAIL_V(data); + virtual Ref<Texture> get_logo() const { + return logo; } - err = dir->remove(tmp_path); - - memdelete(dir); + virtual void get_preset_features(const Ref<EditorExportPreset> &p_preset, List<String> *r_features) { + r_features->push_back("s3tc"); + r_features->push_back("etc"); + } - if (err != OK) { + virtual void get_export_options(List<ExportOption> *r_options) { + r_options->push_back(ExportOption(PropertyInfo(Variant::INT, "architecture/target", PROPERTY_HINT_ENUM, "ARM,x86,x64"), 1)); - String err_string = "Couldn't remove temp logo file."; + r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "command_line/extra_args"), "")); - EditorNode::add_io_error(err_string); - ERR_EXPLAIN(err_string); - ERR_FAIL_V(data); - } + r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "package/display_name"), "")); + r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "package/short_name"), "Godot")); + r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "package/unique_name"), "Godot.Engine")); + r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "package/description"), "Godot Engine")); + r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "package/publisher"), "CN=GodotEngine")); + r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "package/publisher_display_name"), "Godot Engine")); - return data; -} + r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "identity/product_guid"), "00000000-0000-0000-0000-000000000000")); + r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "identity/publisher_guid"), "00000000-0000-0000-0000-000000000000")); -Error EditorExportPlatformUWP::save_appx_file(void * p_userdata, const String & p_path, const Vector<uint8_t>& p_data, int p_file, int p_total) { + r_options->push_back(ExportOption(PropertyInfo(Variant::INT, "version/major"), 1)); + r_options->push_back(ExportOption(PropertyInfo(Variant::INT, "version/minor"), 0)); + r_options->push_back(ExportOption(PropertyInfo(Variant::INT, "version/build"), 0)); + r_options->push_back(ExportOption(PropertyInfo(Variant::INT, "version/revision"), 0)); - AppxPackager *packager = (AppxPackager*)p_userdata; - String dst_path = p_path.replace_first("res://", "game/"); + r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "orientation/landscape"), true)); + r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "orientation/portrait"), true)); + r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "orientation/landscape_flipped"), true)); + r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "orientation/portrait_flipped"), true)); - packager->add_file(dst_path, p_data.ptr(), p_data.size(), p_file, p_total, _should_compress_asset(p_path, p_data)); + r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "images/background_color"), "transparent")); + r_options->push_back(ExportOption(PropertyInfo(Variant::OBJECT, "images/store_logo", PROPERTY_HINT_RESOURCE_TYPE, "StreamTexture"), Variant())); + r_options->push_back(ExportOption(PropertyInfo(Variant::OBJECT, "images/square44x44_logo", PROPERTY_HINT_RESOURCE_TYPE, "StreamTexture"), Variant())); + r_options->push_back(ExportOption(PropertyInfo(Variant::OBJECT, "images/square71x71_logo", PROPERTY_HINT_RESOURCE_TYPE, "StreamTexture"), Variant())); + r_options->push_back(ExportOption(PropertyInfo(Variant::OBJECT, "images/square150x150_logo", PROPERTY_HINT_RESOURCE_TYPE, "StreamTexture"), Variant())); + r_options->push_back(ExportOption(PropertyInfo(Variant::OBJECT, "images/square310x310_logo", PROPERTY_HINT_RESOURCE_TYPE, "StreamTexture"), Variant())); + r_options->push_back(ExportOption(PropertyInfo(Variant::OBJECT, "images/wide310x150_logo", PROPERTY_HINT_RESOURCE_TYPE, "StreamTexture"), Variant())); + r_options->push_back(ExportOption(PropertyInfo(Variant::OBJECT, "images/splash_screen", PROPERTY_HINT_RESOURCE_TYPE, "StreamTexture"), Variant())); - return OK; -} + r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "tiles/show_name_on_square150x150"), false)); + r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "tiles/show_name_on_wide310x150"), false)); + r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "tiles/show_name_on_square310x310"), false)); -bool EditorExportPlatformUWP::_should_compress_asset(const String & p_path, const Vector<uint8_t>& p_data) { - - /* TODO: This was copied verbatim from Android export. It should be - * refactored to the parent class and also be used for .zip export. - */ - - /* - * By not compressing files with little or not benefit in doing so, - * a performance gain is expected at runtime. Moreover, if the APK is - * zip-aligned, assets stored as they are can be efficiently read by - * Android by memory-mapping them. - */ - - // -- Unconditional uncompress to mimic AAPT plus some other - - static const char* unconditional_compress_ext[] = { - // From https://github.com/android/platform_frameworks_base/blob/master/tools/aapt/Package.cpp - // These formats are already compressed, or don't compress well: - ".jpg", ".jpeg", ".png", ".gif", - ".wav", ".mp2", ".mp3", ".ogg", ".aac", - ".mpg", ".mpeg", ".mid", ".midi", ".smf", ".jet", - ".rtttl", ".imy", ".xmf", ".mp4", ".m4a", - ".m4v", ".3gp", ".3gpp", ".3g2", ".3gpp2", - ".amr", ".awb", ".wma", ".wmv", - // Godot-specific: - ".webp", // Same reasoning as .png - ".cfb", // Don't let small config files slow-down startup - // Trailer for easier processing - NULL - }; + r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "custom_template/debug", PROPERTY_HINT_GLOBAL_FILE, "zip"), "")); + r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "custom_template/release", PROPERTY_HINT_GLOBAL_FILE, "zip"), "")); - for (const char** ext = unconditional_compress_ext; *ext; ++ext) { - if (p_path.to_lower().ends_with(String(*ext))) { - return false; + // Capabilites + const char **basic = uwp_capabilities; + while (*basic) { + r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "capabilities/" + String(*basic).camelcase_to_underscore(false)), false)); + basic++; } - } - // -- Compressed resource? + const char **uap = uwp_uap_capabilities; + while (*uap) { + r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "capabilities/" + String(*uap).camelcase_to_underscore(false)), false)); + uap++; + } - if (p_data.size() >= 4 && p_data[0] == 'R' && p_data[1] == 'S' && p_data[2] == 'C' && p_data[3] == 'C') { - // Already compressed - return false; + const char **device = uwp_device_capabilites; + while (*device) { + r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "capabilities/" + String(*device).camelcase_to_underscore(false)), false)); + device++; + } } - // --- TODO: Decide on texture resources according to their image compression setting - - return true; -} - -bool EditorExportPlatformUWP::_set(const StringName& p_name, const Variant& p_value) { - - String n = p_name; - - if (n == "architecture/target") - arch = (Platform)((int)p_value); - else if (n == "custom_package/debug") - custom_debug_package = p_value; - else if (n == "custom_package/release") - custom_release_package = p_value; - else if (n == "command_line/extra_args") - cmdline = p_value; - else if (n == "package/display_name") - display_name = p_value; - else if (n == "package/short_name") - short_name = p_value; - else if (n == "package/unique_name") - unique_name = p_value; - else if (n == "package/description") - description = p_value; - else if (n == "package/publisher") - publisher = p_value; - else if (n == "package/publisher_display_name") - publisher_display_name = p_value; - else if (n == "identity/product_guid") - product_guid = p_value; - else if (n == "identity/publisher_guid") - publisher_guid = p_value; - else if (n == "version/major") - version_major = p_value; - else if (n == "version/minor") - version_minor = p_value; - else if (n == "version/build") - version_build = p_value; - else if (n == "version/revision") - version_revision = p_value; - else if (n == "orientation/landscape") - orientation_landscape = p_value; - else if (n == "orientation/portrait") - orientation_portrait = p_value; - else if (n == "orientation/landscape_flipped") - orientation_landscape_flipped = p_value; - else if (n == "orientation/portrait_flipped") - orientation_portrait_flipped = p_value; - else if (n == "images/background_color") - background_color = p_value; - else if (n == "images/store_logo") - store_logo = p_value; - else if (n == "images/square44x44_logo") - square44 = p_value; - else if (n == "images/square71x71_logo") - square71 = p_value; - else if (n == "images/square150x150_logo") - square150 = p_value; - else if (n == "images/square310x310_logo") - square310 = p_value; - else if (n == "images/wide310x150_logo") - wide310 = p_value; - else if (n == "images/splash_screen") - splash = p_value; - else if (n == "tiles/show_name_on_square150x150") - name_on_square150 = p_value; - else if (n == "tiles/show_name_on_wide310x150") - name_on_wide = p_value; - else if (n == "tiles/show_name_on_square310x310") - name_on_square310 = p_value; - -#if 0 // Signing disabled - else if (n == "signing/sign") - sign_package = p_value; - else if (n == "signing/certificate_file") - certificate_path = p_value; - else if (n == "signing/certificate_password") - certificate_pass = p_value; -#endif - else if (n.begins_with("capabilities/")) { - - String what = n.get_slice("/", 1).replace("_", ""); - bool enable = p_value; - - if (array_has(uwp_capabilities, what.utf8().get_data())) { - - if (enable) - capabilities.insert(what); - else - capabilities.erase(what); - - } else if (array_has(uwp_uap_capabilities, what.utf8().get_data())) { - - if (enable) - uap_capabilities.insert(what); - else - uap_capabilities.erase(what); - - } else if (array_has(uwp_device_capabilites, what.utf8().get_data())) { - - if (enable) - device_capabilities.insert(what); - else - device_capabilities.erase(what); + virtual bool can_export(const Ref<EditorExportPreset> &p_preset, String &r_error, bool &r_missing_templates) const { + String err; + bool valid = true; + Platform arch = (Platform)(int)(p_preset->get("architecture/target")); + + String custom_debug_binary = p_preset->get("custom_template/debug"); + String custom_release_binary = p_preset->get("custom_template/release"); + + String platform_infix; + + switch (arch) { + case EditorExportUWP::ARM: { + platform_infix = "arm"; + } break; + case EditorExportUWP::X86: { + platform_infix = "x86"; + } break; + case EditorExportUWP::X64: { + platform_infix = "x64"; + } break; } - } else return false; - return true; -} - -bool EditorExportPlatformUWP::_get(const StringName& p_name, Variant &r_ret) const { - - String n = p_name; - - if (n == "architecture/target") - r_ret = (int)arch; - else if (n == "custom_package/debug") - r_ret = custom_debug_package; - else if (n == "custom_package/release") - r_ret = custom_release_package; - else if (n == "command_line/extra_args") - r_ret = cmdline; - else if (n == "package/display_name") - r_ret = display_name; - else if (n == "package/short_name") - r_ret = short_name; - else if (n == "package/unique_name") - r_ret = unique_name; - else if (n == "package/description") - r_ret = description; - else if (n == "package/publisher") - r_ret = publisher; - else if (n == "package/publisher_display_name") - r_ret = publisher_display_name; - else if (n == "identity/product_guid") - r_ret = product_guid; - else if (n == "identity/publisher_guid") - r_ret = publisher_guid; - else if (n == "version/major") - r_ret = version_major; - else if (n == "version/minor") - r_ret = version_minor; - else if (n == "version/build") - r_ret = version_build; - else if (n == "version/revision") - r_ret = version_revision; - else if (n == "orientation/landscape") - r_ret = orientation_landscape; - else if (n == "orientation/portrait") - r_ret = orientation_portrait; - else if (n == "orientation/landscape_flipped") - r_ret = orientation_landscape_flipped; - else if (n == "orientation/portrait_flipped") - r_ret = orientation_portrait_flipped; - else if (n == "images/background_color") - r_ret = background_color; - else if (n == "images/store_logo") - r_ret = store_logo; - else if (n == "images/square44x44_logo") - r_ret = square44; - else if (n == "images/square71x71_logo") - r_ret = square71; - else if (n == "images/square150x150_logo") - r_ret = square150; - else if (n == "images/square310x310_logo") - r_ret = square310; - else if (n == "images/wide310x150_logo") - r_ret = wide310; - else if (n == "images/splash_screen") - r_ret = splash; - else if (n == "tiles/show_name_on_square150x150") - r_ret = name_on_square150; - else if (n == "tiles/show_name_on_wide310x150") - r_ret = name_on_wide; - else if (n == "tiles/show_name_on_square310x310") - r_ret = name_on_square310; - -#if 0 // Signing disabled - else if (n == "signing/sign") - r_ret = sign_package; - else if (n == "signing/certificate_file") - r_ret = certificate_path; - else if (n == "signing/certificate_password") - r_ret = certificate_pass; -#endif - else if (n.begins_with("capabilities/")) { - - String what = n.get_slice("/", 1).replace("_", ""); - - if (array_has(uwp_capabilities, what.utf8().get_data())) { - - r_ret = capabilities.has(what); - - } else if (array_has(uwp_uap_capabilities, what.utf8().get_data())) { - - r_ret = uap_capabilities.has(what); - - } else if (array_has(uwp_device_capabilites, what.utf8().get_data())) { - - r_ret = device_capabilities.has(what); + if (!exists_export_template("uwp_" + platform_infix + "_debug.zip", &err) || !exists_export_template("uwp_" + platform_infix + "_debug.zip", &err)) { + valid = false; + r_missing_templates = true; } - } else return false; - - return true; -} - -void EditorExportPlatformUWP::_get_property_list(List<PropertyInfo>* p_list) const { - - p_list->push_back(PropertyInfo(Variant::STRING, "custom_package/debug", PROPERTY_HINT_GLOBAL_FILE, "appx")); - p_list->push_back(PropertyInfo(Variant::STRING, "custom_package/release", PROPERTY_HINT_GLOBAL_FILE, "appx")); - - p_list->push_back(PropertyInfo(Variant::INT, "architecture/target", PROPERTY_HINT_ENUM, "ARM,x86,x64")); - - p_list->push_back(PropertyInfo(Variant::STRING, "command_line/extra_args")); - - p_list->push_back(PropertyInfo(Variant::STRING, "package/display_name")); - p_list->push_back(PropertyInfo(Variant::STRING, "package/short_name")); - p_list->push_back(PropertyInfo(Variant::STRING, "package/unique_name")); - p_list->push_back(PropertyInfo(Variant::STRING, "package/description")); - p_list->push_back(PropertyInfo(Variant::STRING, "package/publisher")); - p_list->push_back(PropertyInfo(Variant::STRING, "package/publisher_display_name")); - - p_list->push_back(PropertyInfo(Variant::STRING, "identity/product_guid")); - p_list->push_back(PropertyInfo(Variant::STRING, "identity/publisher_guid")); - - p_list->push_back(PropertyInfo(Variant::INT, "version/major")); - p_list->push_back(PropertyInfo(Variant::INT, "version/minor")); - p_list->push_back(PropertyInfo(Variant::INT, "version/build")); - p_list->push_back(PropertyInfo(Variant::INT, "version/revision")); - - p_list->push_back(PropertyInfo(Variant::BOOL, "orientation/landscape")); - p_list->push_back(PropertyInfo(Variant::BOOL, "orientation/portrait")); - p_list->push_back(PropertyInfo(Variant::BOOL, "orientation/landscape_flipped")); - p_list->push_back(PropertyInfo(Variant::BOOL, "orientation/portrait_flipped")); - - p_list->push_back(PropertyInfo(Variant::STRING, "images/background_color")); - p_list->push_back(PropertyInfo(Variant::OBJECT, "images/store_logo", PROPERTY_HINT_RESOURCE_TYPE, "ImageTexture")); - p_list->push_back(PropertyInfo(Variant::OBJECT, "images/square44x44_logo", PROPERTY_HINT_RESOURCE_TYPE, "ImageTexture")); - p_list->push_back(PropertyInfo(Variant::OBJECT, "images/square71x71_logo", PROPERTY_HINT_RESOURCE_TYPE, "ImageTexture")); - p_list->push_back(PropertyInfo(Variant::OBJECT, "images/square150x150_logo", PROPERTY_HINT_RESOURCE_TYPE, "ImageTexture")); - p_list->push_back(PropertyInfo(Variant::OBJECT, "images/square310x310_logo", PROPERTY_HINT_RESOURCE_TYPE, "ImageTexture")); - p_list->push_back(PropertyInfo(Variant::OBJECT, "images/wide310x150_logo", PROPERTY_HINT_RESOURCE_TYPE, "ImageTexture")); - p_list->push_back(PropertyInfo(Variant::OBJECT, "images/splash_screen", PROPERTY_HINT_RESOURCE_TYPE, "ImageTexture")); - - p_list->push_back(PropertyInfo(Variant::BOOL, "tiles/show_name_on_square150x150")); - p_list->push_back(PropertyInfo(Variant::BOOL, "tiles/show_name_on_wide310x150")); - p_list->push_back(PropertyInfo(Variant::BOOL, "tiles/show_name_on_square310x310")); - -#if 0 // Signing does not work :( disabling for now - p_list->push_back(PropertyInfo(Variant::BOOL, "signing/sign")); - p_list->push_back(PropertyInfo(Variant::STRING, "signing/certificate_file", PROPERTY_HINT_GLOBAL_FILE, "pfx")); - p_list->push_back(PropertyInfo(Variant::STRING, "signing/certificate_password")); -#endif - - // Capabilites - const char **basic = uwp_capabilities; - while (*basic) { - p_list->push_back(PropertyInfo(Variant::BOOL, "capabilities/" + String(*basic).camelcase_to_underscore(false))); - basic++; - } - const char **uap = uwp_uap_capabilities; - while (*uap) { - p_list->push_back(PropertyInfo(Variant::BOOL, "capabilities/" + String(*uap).camelcase_to_underscore(false))); - uap++; - } - - const char **device = uwp_device_capabilites; - while (*device) { - p_list->push_back(PropertyInfo(Variant::BOOL, "capabilities/" + String(*device).camelcase_to_underscore(false))); - device++; - } + if (!valid && custom_debug_binary == "" && custom_release_binary == "") { + if (!err.empty()) { + r_error = err; + } + return valid; + } -} + bool dvalid = true; + bool rvalid = true; -bool EditorExportPlatformUWP::can_export(String * r_error) const { + if (!FileAccess::exists(custom_debug_binary)) { + dvalid = false; + err = "\nCustom debug binary not found."; + } - String err; - bool valid = true; + if (!FileAccess::exists(custom_release_binary)) { + rvalid = false; + err += "\nCustom release binary not found."; + } - if (!exists_export_template("uwp_x86_debug.zip") || !exists_export_template("uwp_x86_release.zip") - || !exists_export_template("uwp_arm_debug.zip") || !exists_export_template("uwp_arm_release.zip") - || !exists_export_template("uwp_x64_debug.zip") || !exists_export_template("uwp_x64_release.zip")) { - valid = false; - err += TTR("No export templates found.\nDownload and install export templates.") + "\n"; - } + if (dvalid || rvalid) + valid = true; - if (custom_debug_package != "" && !FileAccess::exists(custom_debug_package)) { - valid = false; - err += TTR("Custom debug package not found.") + "\n"; - } + if (!valid) { + r_error = err; + return valid; + } - if (custom_release_package != "" && !FileAccess::exists(custom_release_package)) { - valid = false; - err += TTR("Custom release package not found.") + "\n"; - } + if (!_valid_resource_name(p_preset->get("package/unique_name"))) { + valid = false; + err += "\nInvalid unique name."; + } - if (!_valid_resource_name(unique_name)) { - valid = false; - err += TTR("Invalid unique name.") + "\n"; - } + if (!_valid_guid(p_preset->get("identity/product_guid"))) { + valid = false; + err += "\nInvalid product GUID."; + } - if (!_valid_guid(product_guid)) { - valid = false; - err += TTR("Invalid product GUID.") + "\n"; - } + if (!_valid_guid(p_preset->get("identity/publisher_guid"))) { + valid = false; + err += "\nInvalid publisher GUID."; + } - if (!_valid_guid(publisher_guid)) { - valid = false; - err += TTR("Invalid publisher GUID.") + "\n"; - } + if (!_valid_bgcolor(p_preset->get("images/background_color"))) { + valid = false; + err += "\nInvalid background color."; + } - if (!_valid_bgcolor(background_color)) { - valid = false; - err += TTR("Invalid background color.") + "\n"; - } + if (!p_preset->get("images/store_logo").is_zero() && !_valid_image(((Object *)p_preset->get("images/store_logo"))->cast_to<StreamTexture>(), 50, 50)) { + valid = false; + err += "\nInvalid Store Logo image dimensions (should be 50x50)."; + } - if (store_logo.is_valid() && !_valid_image(store_logo, 50, 50)) { - valid = false; - err += TTR("Invalid Store Logo image dimensions (should be 50x50).") + "\n"; - } + if (!p_preset->get("images/square44x44_logo").is_zero() && !_valid_image(((Object *)p_preset->get("images/square44x44_logo"))->cast_to<StreamTexture>(), 44, 44)) { + valid = false; + err += "\nInvalid square 44x44 logo image dimensions (should be 44x44)."; + } - if (square44.is_valid() && !_valid_image(square44, 44, 44)) { - valid = false; - err += TTR("Invalid square 44x44 logo image dimensions (should be 44x44).") + "\n"; - } + if (!p_preset->get("images/square71x71_logo").is_zero() && !_valid_image(((Object *)p_preset->get("images/square71x71_logo"))->cast_to<StreamTexture>(), 71, 71)) { + valid = false; + err += "\nInvalid square 71x71 logo image dimensions (should be 71x71)."; + } - if (square71.is_valid() && !_valid_image(square71, 71, 71)) { - valid = false; - err += TTR("Invalid square 71x71 logo image dimensions (should be 71x71).") + "\n"; - } + if (!p_preset->get("images/square150x150_logo").is_zero() && !_valid_image(((Object *)p_preset->get("images/square150x150_logo"))->cast_to<StreamTexture>(), 150, 0)) { + valid = false; + err += "\nInvalid square 150x150 logo image dimensions (should be 150x150)."; + } - if (square150.is_valid() && !_valid_image(square150, 150, 150)) { - valid = false; - err += TTR("Invalid square 150x150 logo image dimensions (should be 150x150).") + "\n"; - } + if (!p_preset->get("images/square310x310_logo").is_zero() && !_valid_image(((Object *)p_preset->get("images/square310x310_logo"))->cast_to<StreamTexture>(), 310, 310)) { + valid = false; + err += "\nInvalid square 310x310 logo image dimensions (should be 310x310)."; + } - if (square310.is_valid() && !_valid_image(square310, 310, 310)) { - valid = false; - err += TTR("Invalid square 310x310 logo image dimensions (should be 310x310).") + "\n"; - } + if (!p_preset->get("images/wide310x150_logo").is_zero() && !_valid_image(((Object *)p_preset->get("images/wide310x150_logo"))->cast_to<StreamTexture>(), 310, 150)) { + valid = false; + err += "\nInvalid wide 310x150 logo image dimensions (should be 310x150)."; + } - if (wide310.is_valid() && !_valid_image(wide310, 310, 150)) { - valid = false; - err += TTR("Invalid wide 310x150 logo image dimensions (should be 310x150).") + "\n"; - } + if (!p_preset->get("images/splash_screen").is_zero() && !_valid_image(((Object *)p_preset->get("images/splash_screen"))->cast_to<StreamTexture>(), 620, 300)) { + valid = false; + err += "\nInvalid splash screen image dimensions (should be 620x300)."; + } - if (splash.is_valid() && !_valid_image(splash, 620, 300)) { - valid = false; - err += TTR("Invalid splash screen image dimensions (should be 620x300).") + "\n"; + r_error = err; + return valid; } - if (r_error) - *r_error = err; + virtual Error export_project(const Ref<EditorExportPreset> &p_preset, bool p_debug, const String &p_path, int p_flags = 0) { - return valid; -} + String src_appx; -Error EditorExportPlatformUWP::export_project(const String & p_path, bool p_debug, int p_flags) { + EditorProgress ep("export", "Exporting for Windows Universal", 7); - String src_appx; + if (p_debug) + src_appx = p_preset->get("custom_template/debug"); + else + src_appx = p_preset->get("custom_template/release"); - EditorProgress ep("export", "Exporting for Windows Universal", 7); + src_appx = src_appx.strip_edges(); - if (is_debug) - src_appx = custom_debug_package; - else - src_appx = custom_release_package; + Platform arch = (Platform)(int)p_preset->get("architecture/target"); - if (src_appx == "") { - String err; - if (p_debug) { + if (src_appx == "") { + String err, infix; switch (arch) { - case X86: { - src_appx = find_export_template("uwp_x86_debug.zip", &err); - break; - } - case X64: { - src_appx = find_export_template("uwp_x64_debug.zip", &err); - break; - } case ARM: { - src_appx = find_export_template("uwp_arm_debug.zip", &err); - break; - } - } - } else { - switch (arch) { + infix = "_arm_"; + } break; case X86: { - src_appx = find_export_template("uwp_x86_release.zip", &err); - break; - } + infix = "_x86_"; + } break; case X64: { - src_appx = find_export_template("uwp_x64_release.zip", &err); - break; - } - case ARM: { - src_appx = find_export_template("uwp_arm_release.zip", &err); - break; - } + infix = "_x64_"; + } break; + } + if (p_debug) { + src_appx = find_export_template("uwp" + infix + "debug.zip", &err); + } else { + src_appx = find_export_template("uwp" + infix + "release.zip", &err); + } + if (src_appx == "") { + EditorNode::add_io_error(err); + return ERR_FILE_NOT_FOUND; } } - if (src_appx == "") { - EditorNode::add_io_error(err); - return ERR_FILE_NOT_FOUND; - } - } - - Error err = OK; - - FileAccess *fa_pack = FileAccess::open(p_path, FileAccess::WRITE, &err); - ERR_FAIL_COND_V(err != OK, ERR_CANT_CREATE); - AppxPackager packager; - packager.init(fa_pack, sign_package ? AppxPackager::SIGN : AppxPackager::DONT_SIGN, certificate_path, certificate_pass); + Error err = OK; - FileAccess *src_f = NULL; - zlib_filefunc_def io = zipio_create_io_from_file(&src_f); + FileAccess *fa_pack = FileAccess::open(p_path, FileAccess::WRITE, &err); + ERR_FAIL_COND_V(err != OK, ERR_CANT_CREATE); - ep.step("Creating package...", 0); + AppxPackager packager; + packager.init(fa_pack); - unzFile pkg = unzOpen2(src_appx.utf8().get_data(), &io); - - if (!pkg) { - - EditorNode::add_io_error("Could not find template appx to export:\n" + src_appx); - return ERR_FILE_NOT_FOUND; - } - - int ret = unzGoToFirstFile(pkg); - - ep.step("Copying template files...", 1); - - EditorNode::progress_add_task("template_files", "Template files", 100); - packager.set_progress_task("template_files"); - - int template_files_amount = 9; - int template_file_no = 1; - - while (ret == UNZ_OK) { - - // get file name - unz_file_info info; - char fname[16834]; - ret = unzGetCurrentFileInfo(pkg, &info, fname, 16834, NULL, 0, NULL, 0); - - String path = fname; - - if (path.ends_with("/")) { - // Ignore directories - ret = unzGoToNextFile(pkg); - continue; - } + FileAccess *src_f = NULL; + zlib_filefunc_def io = zipio_create_io_from_file(&src_f); - Vector<uint8_t> data; - bool do_read = true; + ep.step("Creating package...", 0); - if (path.begins_with("Assets/")) { + unzFile pkg = unzOpen2(src_appx.utf8().get_data(), &io); - path = path.replace(".scale-100", ""); + if (!pkg) { - data = _get_image_data(path); - if (data.size() > 0) do_read = false; + EditorNode::add_io_error("Could not find template appx to export:\n" + src_appx); + return ERR_FILE_NOT_FOUND; } - //read - if (do_read) { - data.resize(info.uncompressed_size); - unzOpenCurrentFile(pkg); - unzReadCurrentFile(pkg, data.ptr(), data.size()); - unzCloseCurrentFile(pkg); - } + int ret = unzGoToFirstFile(pkg); - if (path == "AppxManifest.xml") { + ep.step("Copying template files...", 1); - data = _fix_manifest(data, p_flags&(EXPORT_DUMB_CLIENT | EXPORT_REMOTE_DEBUG)); - } + EditorNode::progress_add_task("template_files", "Template files", 100); + packager.set_progress_task("template_files"); - print_line("ADDING: " + path); + int template_files_amount = 9; + int template_file_no = 1; - packager.add_file(path, data.ptr(), data.size(), template_file_no++, template_files_amount, _should_compress_asset(path, data)); + while (ret == UNZ_OK) { - ret = unzGoToNextFile(pkg); - } + // get file name + unz_file_info info; + char fname[16834]; + ret = unzGetCurrentFileInfo(pkg, &info, fname, 16834, NULL, 0, NULL, 0); - EditorNode::progress_end_task("template_files"); + String path = fname; - ep.step("Creating command line...", 2); + if (path.ends_with("/")) { + // Ignore directories + ret = unzGoToNextFile(pkg); + continue; + } - Vector<String> cl = cmdline.strip_edges().split(" "); - for (int i = 0;i<cl.size();i++) { - if (cl[i].strip_edges().length() == 0) { - cl.remove(i); - i--; - } - } + Vector<uint8_t> data; + bool do_read = true; - if (!(p_flags & EXPORT_DUMB_CLIENT)) { - cl.push_back("-path"); - cl.push_back("game"); - } + if (path.begins_with("Assets/")) { - gen_export_flags(cl, p_flags); + path = path.replace(".scale-100", ""); - // Command line file - Vector<uint8_t> clf; + data = _get_image_data(p_preset, path); + if (data.size() > 0) do_read = false; + } - // Argc - clf.resize(4); - encode_uint32(cl.size(), clf.ptr()); + //read + if (do_read) { + data.resize(info.uncompressed_size); + unzOpenCurrentFile(pkg); + unzReadCurrentFile(pkg, data.ptr(), data.size()); + unzCloseCurrentFile(pkg); + } - for (int i = 0; i < cl.size(); i++) { + if (path == "AppxManifest.xml") { - CharString txt = cl[i].utf8(); - int base = clf.size(); - clf.resize(base + 4 + txt.length()); - encode_uint32(txt.length(), &clf[base]); - copymem(&clf[base + 4], txt.ptr(), txt.length()); - print_line(itos(i) + " param: " + cl[i]); - } + data = _fix_manifest(p_preset, data, p_flags & (DEBUG_FLAG_DUMB_CLIENT | DEBUG_FLAG_REMOTE_DEBUG)); + } - packager.add_file("__cl__.cl", clf.ptr(), clf.size(), -1, -1, false); + print_line("ADDING: " + path); - ep.step("Adding project files...", 3); + packager.add_file(path, data.ptr(), data.size(), template_file_no++, template_files_amount, _should_compress_asset(path, data)); - EditorNode::progress_add_task("project_files", "Project Files", 100); - packager.set_progress_task("project_files"); + ret = unzGoToNextFile(pkg); + } - err = export_project_files(save_appx_file, &packager, false); + EditorNode::progress_end_task("template_files"); - EditorNode::progress_end_task("project_files"); + ep.step("Creating command line...", 2); - ep.step("Closing package...", 7); + Vector<String> cl = ((String)p_preset->get("command_line/extra_args")).strip_edges().split(" "); + for (int i = 0; i < cl.size(); i++) { + if (cl[i].strip_edges().length() == 0) { + cl.remove(i); + i--; + } + } - unzClose(pkg); + if (!(p_flags & DEBUG_FLAG_DUMB_CLIENT)) { + cl.push_back("-path"); + cl.push_back("game"); + } - packager.finish(); + gen_export_flags(cl, p_flags); - return OK; -} + // Command line file + Vector<uint8_t> clf; -EditorExportPlatformUWP::EditorExportPlatformUWP() { + // Argc + clf.resize(4); + encode_uint32(cl.size(), clf.ptr()); - Image img(_uwp_logo); - logo = Ref<ImageTexture>(memnew(ImageTexture)); - logo->create_from_image(img); + for (int i = 0; i < cl.size(); i++) { - is_debug = true; + CharString txt = cl[i].utf8(); + int base = clf.size(); + clf.resize(base + 4 + txt.length()); + encode_uint32(txt.length(), &clf[base]); + copymem(&clf[base + 4], txt.ptr(), txt.length()); + print_line(itos(i) + " param: " + cl[i]); + } - custom_release_package = ""; - custom_debug_package = ""; + packager.add_file("__cl__.cl", clf.ptr(), clf.size(), -1, -1, false); - arch = X86; + ep.step("Adding project files...", 3); - display_name = ""; - short_name = "Godot"; - unique_name = "Godot.Engine"; - description = "Godot Engine"; - publisher = "CN=GodotEngine"; - publisher_display_name = "Godot Engine"; + EditorNode::progress_add_task("project_files", "Project Files", 100); + packager.set_progress_task("project_files"); - product_guid = "00000000-0000-0000-0000-000000000000"; - publisher_guid = "00000000-0000-0000-0000-000000000000"; + err = export_project_files(p_preset, save_appx_file, &packager); - version_major = 1; - version_minor = 0; - version_build = 0; - version_revision = 0; + EditorNode::progress_end_task("project_files"); - orientation_landscape = true; - orientation_portrait = true; - orientation_landscape_flipped = true; - orientation_portrait_flipped = true; + ep.step("Closing package...", 7); - background_color = "transparent"; + unzClose(pkg); - name_on_square150 = false; - name_on_square310 = false; - name_on_wide = false; + packager.finish(); - sign_package = false; - certificate_path = ""; - certificate_pass = ""; -} + return OK; + } -EditorExportPlatformUWP::~EditorExportPlatformUWP() {} + EditorExportUWP() { + Ref<Image> img = memnew(Image(_uwp_logo)); + logo.instance(); + logo->create_from_image(img); + } +}; -#endif void register_uwp_exporter() { -#if 0 - Ref<EditorExportPlatformUWP> exporter = Ref<EditorExportPlatformUWP>(memnew(EditorExportPlatformUWP)); - EditorImportExport::get_singleton()->add_export_platform(exporter); -#endif + Ref<EditorExportUWP> exporter = Ref<EditorExportUWP>(memnew(EditorExportUWP)); + EditorExport::get_singleton()->add_export_platform(exporter); } diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index e94529dd94..2daf580c0d 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -1410,28 +1410,21 @@ void OS_Windows::set_window_size(const Size2 p_size) { return; } - RECT crect; - GetClientRect(hWnd, &crect); + int w = p_size.width; + int h = p_size.height; RECT rect; GetWindowRect(hWnd, &rect); - int dx = (rect.right - rect.left) - (crect.right - crect.left); - int dy = (rect.bottom - rect.top) - (crect.bottom - crect.top); - rect.right = rect.left + p_size.width + dx; - rect.bottom = rect.top + p_size.height + dy; + if (video_mode.borderless_window == false) { + RECT crect; + GetClientRect(hWnd, &crect); - //print_line("PRE: "+itos(rect.left)+","+itos(rect.top)+","+itos(rect.right-rect.left)+","+itos(rect.bottom-rect.top)); - - /*if (video_mode.resizable) { - AdjustWindowRect(&rect, WS_OVERLAPPEDWINDOW, FALSE); - } else { - AdjustWindowRect(&rect, WS_CAPTION | WS_POPUPWINDOW, FALSE); - }*/ - - //print_line("POST: "+itos(rect.left)+","+itos(rect.top)+","+itos(rect.right-rect.left)+","+itos(rect.bottom-rect.top)); + w += (rect.right - rect.left) - (crect.right - crect.left); + h += (rect.bottom - rect.top) - (crect.bottom - crect.top); + } - MoveWindow(hWnd, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, TRUE); + MoveWindow(hWnd, rect.left, rect.top, w, h, TRUE); } void OS_Windows::set_window_fullscreen(bool p_enabled) { @@ -1451,21 +1444,18 @@ void OS_Windows::set_window_fullscreen(bool p_enabled) { Point2 pos = get_screen_position(cs); Size2 size = get_screen_size(cs); - /* r.left = pos.x; - r.top = pos.y; - r.bottom = pos.y+size.y; - r.right = pos.x+size.x; -*/ - SetWindowLongPtr(hWnd, GWL_STYLE, - WS_SYSMENU | WS_POPUP | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_VISIBLE); - MoveWindow(hWnd, pos.x, pos.y, size.width, size.height, TRUE); - video_mode.fullscreen = true; + _update_window_style(false); + + MoveWindow(hWnd, pos.x, pos.y, size.width, size.height, TRUE); + } else { RECT rect; + video_mode.fullscreen = false; + if (pre_fs_valid) { rect = pre_fs_rect; } else { @@ -1475,35 +1465,12 @@ void OS_Windows::set_window_fullscreen(bool p_enabled) { rect.bottom = video_mode.height; } - if (video_mode.resizable) { - - SetWindowLongPtr(hWnd, GWL_STYLE, WS_OVERLAPPEDWINDOW | WS_VISIBLE); - //AdjustWindowRect(&rect, WS_OVERLAPPEDWINDOW, FALSE); - MoveWindow(hWnd, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, TRUE); - } else { + _update_window_style(false); - SetWindowLongPtr(hWnd, GWL_STYLE, WS_CAPTION | WS_POPUPWINDOW | WS_VISIBLE); - //AdjustWindowRect(&rect, WS_CAPTION | WS_POPUPWINDOW, FALSE); - MoveWindow(hWnd, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, TRUE); - } + MoveWindow(hWnd, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, TRUE); - video_mode.fullscreen = false; pre_fs_valid = true; - /* - DWORD dwExStyle=WS_EX_APPWINDOW | WS_EX_WINDOWEDGE; - DWORD dwStyle=WS_OVERLAPPEDWINDOW; - if (!video_mode.resizable) { - dwStyle &= ~WS_THICKFRAME; - dwStyle &= ~WS_MAXIMIZEBOX; - } - AdjustWindowRectEx(&pre_fs_rect, dwStyle, FALSE, dwExStyle); - video_mode.fullscreen=false; - video_mode.width=pre_fs_rect.right-pre_fs_rect.left; - video_mode.height=pre_fs_rect.bottom-pre_fs_rect.top; -*/ } - - //MoveWindow(hWnd,r.left,r.top,p_size.x,p_size.y,TRUE); } bool OS_Windows::is_window_fullscreen() const { @@ -1513,30 +1480,10 @@ void OS_Windows::set_window_resizable(bool p_enabled) { if (video_mode.resizable == p_enabled) return; - /* - GetWindowRect(hWnd,&pre_fs_rect); - DWORD dwExStyle=WS_EX_APPWINDOW | WS_EX_WINDOWEDGE; - DWORD dwStyle=WS_OVERLAPPEDWINDOW; - if (!p_enabled) { - dwStyle &= ~WS_THICKFRAME; - dwStyle &= ~WS_MAXIMIZEBOX; - } - AdjustWindowRectEx(&pre_fs_rect, dwStyle, FALSE, dwExStyle); - */ - - if (!video_mode.fullscreen) { - if (p_enabled) { - SetWindowLongPtr(hWnd, GWL_STYLE, WS_OVERLAPPEDWINDOW | WS_VISIBLE); - } else { - SetWindowLongPtr(hWnd, GWL_STYLE, WS_CAPTION | WS_MINIMIZEBOX | WS_POPUPWINDOW | WS_VISIBLE); - } - - RECT rect; - GetWindowRect(hWnd, &rect); - MoveWindow(hWnd, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, TRUE); - } video_mode.resizable = p_enabled; + + _update_window_style(); } bool OS_Windows::is_window_resizable() const { @@ -1576,13 +1523,36 @@ bool OS_Windows::is_window_maximized() const { } void OS_Windows::set_borderless_window(int p_borderless) { + if (video_mode.borderless_window == p_borderless) + return; + video_mode.borderless_window = p_borderless; + + _update_window_style(); } bool OS_Windows::get_borderless_window() { return video_mode.borderless_window; } +void OS_Windows::_update_window_style(bool repaint) { + if (video_mode.fullscreen || video_mode.borderless_window) { + SetWindowLongPtr(hWnd, GWL_STYLE, WS_SYSMENU | WS_POPUP | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_VISIBLE); + } else { + if (video_mode.resizable) { + SetWindowLongPtr(hWnd, GWL_STYLE, WS_OVERLAPPEDWINDOW | WS_VISIBLE); + } else { + SetWindowLongPtr(hWnd, GWL_STYLE, WS_CAPTION | WS_MINIMIZEBOX | WS_POPUPWINDOW | WS_VISIBLE); + } + } + + if (repaint) { + RECT rect; + GetWindowRect(hWnd, &rect); + MoveWindow(hWnd, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, TRUE); + } +} + Error OS_Windows::open_dynamic_library(const String p_path, void *&p_library_handle) { p_library_handle = (void *)LoadLibrary(p_path.utf8().get_data()); if (!p_library_handle) { diff --git a/platform/windows/os_windows.h b/platform/windows/os_windows.h index 6cbdd58830..835141145f 100644 --- a/platform/windows/os_windows.h +++ b/platform/windows/os_windows.h @@ -133,6 +133,8 @@ class OS_Windows : public OS { void _drag_event(int p_x, int p_y, int idx); void _touch_event(bool p_pressed, int p_x, int p_y, int idx); + void _update_window_style(bool repaint = true); + // functions used by main to initialize/deintialize the OS protected: virtual int get_video_driver_count() const; diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp index 790182794e..04f41b2e89 100644 --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -508,22 +508,17 @@ void OS_X11::xim_destroy_callback(::XIM im, ::XPointer client_data, os->xic = NULL; } -void OS_X11::set_ime_position(short x, short y) { +void OS_X11::set_ime_position(const Point2 &p_pos) { - if (!xic) { + if (!xic) return; - } + ::XPoint spot; - spot.x = x; - spot.y = y; - XVaNestedList preedit_attr = XVaCreateNestedList(0, - XNSpotLocation, &spot, - NULL); - XSetICValues(xic, - XNPreeditAttributes, preedit_attr, - NULL); + spot.x = short(p_pos.x); + spot.y = short(p_pos.y); + XVaNestedList preedit_attr = XVaCreateNestedList(0, XNSpotLocation, &spot, NULL); + XSetICValues(xic, XNPreeditAttributes, preedit_attr, NULL); XFree(preedit_attr); - return; } void OS_X11::finalize() { @@ -691,6 +686,16 @@ void OS_X11::get_fullscreen_mode_list(List<VideoMode> *p_list, int p_screen) con } void OS_X11::set_wm_fullscreen(bool p_enabled) { + if (p_enabled && !is_window_resizable()) { + // Set the window as resizable to prevent window managers to ignore the fullscreen state flag. + XSizeHints *xsh; + + xsh = XAllocSizeHints(); + xsh->flags = 0L; + XSetWMNormalHints(x11_display, x11_window, xsh); + XFree(xsh); + } + // Using EWMH -- Extened Window Manager Hints XEvent xev; Atom wm_state = XInternAtom(x11_display, "_NET_WM_STATE", False); @@ -706,6 +711,23 @@ void OS_X11::set_wm_fullscreen(bool p_enabled) { xev.xclient.data.l[2] = 0; XSendEvent(x11_display, DefaultRootWindow(x11_display), False, SubstructureRedirectMask | SubstructureNotifyMask, &xev); + XFlush(x11_display); + + if (!p_enabled && !is_window_resizable()) { + // Reset the non-resizable flags if we un-set these before. + Size2 size = get_window_size(); + XSizeHints *xsh; + + xsh = XAllocSizeHints(); + xsh->flags = PMinSize | PMaxSize; + xsh->min_width = size.x; + xsh->max_width = size.x; + xsh->min_height = size.y; + xsh->max_height = size.y; + + XSetWMNormalHints(x11_display, x11_window, xsh); + XFree(xsh); + } } int OS_X11::get_screen_count() const { @@ -1489,7 +1511,7 @@ void OS_X11::process_xevents() { case ConfigureNotify: if (xic) { // Not portable. - set_ime_position(0, 1); + set_ime_position(Point2(0, 1)); } /* call resizeGLScene only if our window-size changed */ diff --git a/platform/x11/os_x11.h b/platform/x11/os_x11.h index 39c512b6bd..12e4bbb086 100644 --- a/platform/x11/os_x11.h +++ b/platform/x11/os_x11.h @@ -115,7 +115,6 @@ class OS_X11 : public OS_Unix { ::XIMStyle xim_style; static void xim_destroy_callback(::XIM im, ::XPointer client_data, ::XPointer call_data); - void set_ime_position(short x, short y); Point2i last_mouse_pos; bool last_mouse_pos_valid; @@ -253,6 +252,7 @@ public: virtual void set_borderless_window(int p_borderless); virtual bool get_borderless_window(); + virtual void set_ime_position(const Point2 &p_pos); virtual void move_window_to_foreground(); virtual void alert(const String &p_alert, const String &p_title = "ALERT!"); diff --git a/scene/2d/area_2d.cpp b/scene/2d/area_2d.cpp index db22a38cec..841e2ef7d3 100644 --- a/scene/2d/area_2d.cpp +++ b/scene/2d/area_2d.cpp @@ -331,7 +331,10 @@ void Area2D::_clear_monitoring() { Object *obj = ObjectDB::get_instance(E->key()); Node *node = obj ? obj->cast_to<Node>() : NULL; - ERR_CONTINUE(!node); + + if (!node) //node may have been deleted in previous frame or at other legiminate point + continue; + //ERR_CONTINUE(!node); node->disconnect(SceneStringNames::get_singleton()->tree_entered, this, SceneStringNames::get_singleton()->_body_enter_tree); node->disconnect(SceneStringNames::get_singleton()->tree_exited, this, SceneStringNames::get_singleton()->_body_exit_tree); @@ -359,7 +362,7 @@ void Area2D::_clear_monitoring() { Object *obj = ObjectDB::get_instance(E->key()); Node *node = obj ? obj->cast_to<Node>() : NULL; - if (!node) //node may have been deleted in previous frame, this should not be an error + if (!node) //node may have been deleted in previous frame or at other legiminate point continue; //ERR_CONTINUE(!node); diff --git a/scene/2d/remote_transform_2d.cpp b/scene/2d/remote_transform_2d.cpp index 3cb9ebb5b5..4298377499 100644 --- a/scene/2d/remote_transform_2d.cpp +++ b/scene/2d/remote_transform_2d.cpp @@ -63,7 +63,50 @@ void RemoteTransform2D::_update_remote() { return; //todo make faster - n->set_global_transform(get_global_transform()); + if (use_global_coordinates) { + + if (update_remote_position && update_remote_rotation && update_remote_scale) { + n->set_global_transform(get_global_transform()); + } else { + Transform2D n_trans = n->get_global_transform(); + Transform2D our_trans = get_global_transform(); + Vector2 n_scale = n->get_global_scale(); + + if (!update_remote_position) + our_trans.set_origin(n_trans.get_origin()); + if (!update_remote_rotation) + our_trans.set_rotation(n_trans.get_rotation()); + + n->set_global_transform(our_trans); + + if (update_remote_scale) + n->set_scale(get_global_scale()); + else + n->set_scale(n_scale); + } + + } else { + + if (update_remote_position && update_remote_rotation && update_remote_scale) { + n->set_transform(get_transform()); + } else { + Transform2D n_trans = n->get_transform(); + Transform2D our_trans = get_transform(); + Vector2 n_scale = n->get_scale(); + + if (!update_remote_position) + our_trans.set_origin(n_trans.get_origin()); + if (!update_remote_rotation) + our_trans.set_rotation(n_trans.get_rotation()); + + n->set_transform(our_trans); + + if (update_remote_scale) + n->set_scale(get_scale()); + else + n->set_scale(n_scale); + } + } } void RemoteTransform2D::_notification(int p_what) { @@ -102,6 +145,41 @@ NodePath RemoteTransform2D::get_remote_node() const { return remote_node; } +void RemoteTransform2D::set_use_global_coordinates(const bool p_enable) { + use_global_coordinates = p_enable; +} + +bool RemoteTransform2D::get_use_global_coordinates() const { + return use_global_coordinates; +} + +void RemoteTransform2D::set_update_position(const bool p_update) { + update_remote_position = p_update; + _update_remote(); +} + +bool RemoteTransform2D::get_update_position() const { + return update_remote_position; +} + +void RemoteTransform2D::set_update_rotation(const bool p_update) { + update_remote_rotation = p_update; + _update_remote(); +} + +bool RemoteTransform2D::get_update_rotation() const { + return update_remote_rotation; +} + +void RemoteTransform2D::set_update_scale(const bool p_update) { + update_remote_scale = p_update; + _update_remote(); +} + +bool RemoteTransform2D::get_update_scale() const { + return update_remote_scale; +} + String RemoteTransform2D::get_configuration_warning() const { if (!has_node(remote_node) || !get_node(remote_node) || !get_node(remote_node)->cast_to<Node2D>()) { @@ -116,11 +194,32 @@ void RemoteTransform2D::_bind_methods() { ClassDB::bind_method(D_METHOD("set_remote_node", "path"), &RemoteTransform2D::set_remote_node); ClassDB::bind_method(D_METHOD("get_remote_node"), &RemoteTransform2D::get_remote_node); + ClassDB::bind_method(D_METHOD("set_use_global_coordinates", "use_global_coordinates"), &RemoteTransform2D::set_use_global_coordinates); + ClassDB::bind_method(D_METHOD("get_use_global_coordinates"), &RemoteTransform2D::get_use_global_coordinates); + + ClassDB::bind_method(D_METHOD("set_update_position", "update_remote_position"), &RemoteTransform2D::set_update_position); + ClassDB::bind_method(D_METHOD("get_update_position"), &RemoteTransform2D::get_update_position); + ClassDB::bind_method(D_METHOD("set_update_rotation", "update_remote_rotation"), &RemoteTransform2D::set_update_rotation); + ClassDB::bind_method(D_METHOD("get_update_rotation"), &RemoteTransform2D::get_update_rotation); + ClassDB::bind_method(D_METHOD("set_update_scale", "update_remote_scale"), &RemoteTransform2D::set_update_scale); + ClassDB::bind_method(D_METHOD("get_update_scale"), &RemoteTransform2D::get_update_scale); + ADD_PROPERTY(PropertyInfo(Variant::NODE_PATH, "remote_path"), "set_remote_node", "get_remote_node"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "use_global_coordinates"), "set_use_global_coordinates", "get_use_global_coordinates"); + + ADD_GROUP("Update", "update_"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "update_position"), "set_update_position", "get_update_position"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "update_rotation"), "set_update_rotation", "get_update_rotation"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "update_scale"), "set_update_scale", "get_update_scale"); } RemoteTransform2D::RemoteTransform2D() { + use_global_coordinates = true; + update_remote_position = true; + update_remote_rotation = true; + update_remote_scale = true; + cache = 0; set_notify_transform(true); } diff --git a/scene/2d/remote_transform_2d.h b/scene/2d/remote_transform_2d.h index 375efabf2f..d58ec14a95 100644 --- a/scene/2d/remote_transform_2d.h +++ b/scene/2d/remote_transform_2d.h @@ -37,6 +37,11 @@ class RemoteTransform2D : public Node2D { ObjectID cache; + bool use_global_coordinates; + bool update_remote_position; + bool update_remote_rotation; + bool update_remote_scale; + void _update_remote(); void _update_cache(); //void _node_exited_scene(); @@ -48,6 +53,18 @@ public: void set_remote_node(const NodePath &p_remote_node); NodePath get_remote_node() const; + void set_use_global_coordinates(const bool p_enable); + bool get_use_global_coordinates() const; + + void set_update_position(const bool p_update); + bool get_update_position() const; + + void set_update_rotation(const bool p_update); + bool get_update_rotation() const; + + void set_update_scale(const bool p_update); + bool get_update_scale() const; + virtual String get_configuration_warning() const; RemoteTransform2D(); diff --git a/scene/3d/area.cpp b/scene/3d/area.cpp index 39a4e926b2..59227070b3 100644 --- a/scene/3d/area.cpp +++ b/scene/3d/area.cpp @@ -29,7 +29,9 @@ /*************************************************************************/ #include "area.h" #include "scene/scene_string_names.h" +#include "servers/audio_server.h" #include "servers/physics_server.h" + void Area::set_space_override_mode(SpaceOverride p_mode) { space_override = p_mode; @@ -227,7 +229,11 @@ void Area::_clear_monitoring() { Object *obj = ObjectDB::get_instance(E->key()); Node *node = obj ? obj->cast_to<Node>() : NULL; - ERR_CONTINUE(!node); + + if (!node) //node may have been deleted in previous frame or at other legiminate point + continue; + //ERR_CONTINUE(!node); + if (!E->get().in_tree) continue; @@ -253,7 +259,11 @@ void Area::_clear_monitoring() { Object *obj = ObjectDB::get_instance(E->key()); Node *node = obj ? obj->cast_to<Node>() : NULL; - ERR_CONTINUE(!node); + + if (!node) //node may have been deleted in previous frame or at other legiminate point + continue; + //ERR_CONTINUE(!node); + if (!E->get().in_tree) continue; @@ -530,6 +540,87 @@ bool Area::get_collision_layer_bit(int p_bit) const { return get_collision_layer() & (1 << p_bit); } +void Area::set_audio_bus_override(bool p_override) { + + audio_bus_override = p_override; +} + +bool Area::is_overriding_audio_bus() const { + + return audio_bus_override; +} + +void Area::set_audio_bus(const StringName &p_audio_bus) { + + audio_bus = p_audio_bus; +} +StringName Area::get_audio_bus() const { + + for (int i = 0; i < AudioServer::get_singleton()->get_bus_count(); i++) { + if (AudioServer::get_singleton()->get_bus_name(i) == audio_bus) { + return audio_bus; + } + } + return "Master"; +} + +void Area::set_use_reverb_bus(bool p_enable) { + + use_reverb_bus = p_enable; +} +bool Area::is_using_reverb_bus() const { + + return use_reverb_bus; +} + +void Area::set_reverb_bus(const StringName &p_audio_bus) { + + reverb_bus = p_audio_bus; +} +StringName Area::get_reverb_bus() const { + + for (int i = 0; i < AudioServer::get_singleton()->get_bus_count(); i++) { + if (AudioServer::get_singleton()->get_bus_name(i) == reverb_bus) { + return reverb_bus; + } + } + return "Master"; +} + +void Area::set_reverb_amount(float p_amount) { + + reverb_amount = p_amount; +} +float Area::get_reverb_amount() const { + + return reverb_amount; +} + +void Area::set_reverb_uniformity(float p_uniformity) { + + reverb_uniformity = p_uniformity; +} +float Area::get_reverb_uniformity() const { + + return reverb_uniformity; +} + +void Area::_validate_property(PropertyInfo &property) const { + + if (property.name == "audio_bus_name" || property.name == "reverb_bus_name") { + + String options; + for (int i = 0; i < AudioServer::get_singleton()->get_bus_count(); i++) { + if (i > 0) + options += ","; + String name = AudioServer::get_singleton()->get_bus_name(i); + options += name; + } + + property.hint_string = options; + } +} + void Area::_bind_methods() { ClassDB::bind_method(D_METHOD("_body_enter_tree", "id"), &Area::_body_enter_tree); @@ -589,6 +680,24 @@ void Area::_bind_methods() { ClassDB::bind_method(D_METHOD("_body_inout"), &Area::_body_inout); ClassDB::bind_method(D_METHOD("_area_inout"), &Area::_area_inout); + ClassDB::bind_method(D_METHOD("set_audio_bus_override", "enable"), &Area::set_audio_bus_override); + ClassDB::bind_method(D_METHOD("is_overriding_audio_bus"), &Area::is_overriding_audio_bus); + + ClassDB::bind_method(D_METHOD("set_audio_bus", "name"), &Area::set_audio_bus); + ClassDB::bind_method(D_METHOD("get_audio_bus"), &Area::get_audio_bus); + + ClassDB::bind_method(D_METHOD("set_use_reverb_bus", "enable"), &Area::set_use_reverb_bus); + ClassDB::bind_method(D_METHOD("is_using_reverb_bus"), &Area::is_using_reverb_bus); + + ClassDB::bind_method(D_METHOD("set_reverb_bus", "name"), &Area::set_reverb_bus); + ClassDB::bind_method(D_METHOD("get_reverb_bus"), &Area::get_reverb_bus); + + ClassDB::bind_method(D_METHOD("set_reverb_amount", "amount"), &Area::set_reverb_amount); + ClassDB::bind_method(D_METHOD("get_reverb_amount"), &Area::get_reverb_amount); + + ClassDB::bind_method(D_METHOD("set_reverb_uniformity", "amount"), &Area::set_reverb_uniformity); + ClassDB::bind_method(D_METHOD("get_reverb_uniformity"), &Area::get_reverb_uniformity); + ADD_SIGNAL(MethodInfo("body_shape_entered", PropertyInfo(Variant::INT, "body_id"), PropertyInfo(Variant::OBJECT, "body"), PropertyInfo(Variant::INT, "body_shape"), PropertyInfo(Variant::INT, "area_shape"))); ADD_SIGNAL(MethodInfo("body_shape_exited", PropertyInfo(Variant::INT, "body_id"), PropertyInfo(Variant::OBJECT, "body"), PropertyInfo(Variant::INT, "body_shape"), PropertyInfo(Variant::INT, "area_shape"))); ADD_SIGNAL(MethodInfo("body_entered", PropertyInfo(Variant::OBJECT, "body"))); @@ -612,6 +721,14 @@ void Area::_bind_methods() { ADD_GROUP("Collision", "collision_"); ADD_PROPERTY(PropertyInfo(Variant::INT, "collision_layer", PROPERTY_HINT_LAYERS_3D_PHYSICS), "set_collision_layer", "get_collision_layer"); ADD_PROPERTY(PropertyInfo(Variant::INT, "collision_mask", PROPERTY_HINT_LAYERS_3D_PHYSICS), "set_collision_mask", "get_collision_mask"); + ADD_GROUP("Audio Bus", "audio_bus_"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "audio_bus_override"), "set_audio_bus_override", "is_overriding_audio_bus"); + ADD_PROPERTY(PropertyInfo(Variant::STRING, "audio_bus_name", PROPERTY_HINT_ENUM, ""), "set_audio_bus", "get_audio_bus"); + ADD_GROUP("Reverb Bus", "reverb_bus_"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "reverb_bus_enable"), "set_use_reverb_bus", "is_using_reverb_bus"); + ADD_PROPERTY(PropertyInfo(Variant::STRING, "reverb_bus_name", PROPERTY_HINT_ENUM, ""), "set_reverb_bus", "get_reverb_bus"); + ADD_PROPERTY(PropertyInfo(Variant::REAL, "reverb_bus_amount", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_reverb_amount", "get_reverb_amount"); + ADD_PROPERTY(PropertyInfo(Variant::REAL, "reverb_bus_uniformity", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_reverb_uniformity", "get_reverb_uniformity"); } Area::Area() @@ -632,6 +749,14 @@ Area::Area() set_ray_pickable(false); set_monitoring(true); set_monitorable(true); + + audio_bus_override = false; + audio_bus = "Master"; + + use_reverb_bus = false; + reverb_bus = "Master"; + reverb_amount = 0.0; + reverb_uniformity = 0.0; } Area::~Area() { diff --git a/scene/3d/area.h b/scene/3d/area.h index 279a52ee69..5df308fc47 100644 --- a/scene/3d/area.h +++ b/scene/3d/area.h @@ -126,6 +126,16 @@ private: Map<ObjectID, AreaState> area_map; void _clear_monitoring(); + bool audio_bus_override; + StringName audio_bus; + + bool use_reverb_bus; + StringName reverb_bus; + float reverb_amount; + float reverb_uniformity; + + void _validate_property(PropertyInfo &property) const; + protected: void _notification(int p_what); static void _bind_methods(); @@ -179,6 +189,24 @@ public: bool overlaps_area(Node *p_area) const; bool overlaps_body(Node *p_body) const; + void set_audio_bus_override(bool p_override); + bool is_overriding_audio_bus() const; + + void set_audio_bus(const StringName &p_audio_bus); + StringName get_audio_bus() const; + + void set_use_reverb_bus(bool p_enable); + bool is_using_reverb_bus() const; + + void set_reverb_bus(const StringName &p_audio_bus); + StringName get_reverb_bus() const; + + void set_reverb_amount(float p_amount); + float get_reverb_amount() const; + + void set_reverb_uniformity(float p_uniformity); + float get_reverb_uniformity() const; + Area(); ~Area(); }; diff --git a/scene/3d/audio_stream_player_3d.cpp b/scene/3d/audio_stream_player_3d.cpp new file mode 100644 index 0000000000..87ea018425 --- /dev/null +++ b/scene/3d/audio_stream_player_3d.cpp @@ -0,0 +1,930 @@ +#include "audio_stream_player_3d.h" +#include "engine.h" +#include "scene/3d/area.h" +#include "scene/3d/camera.h" +#include "scene/main/viewport.h" +void AudioStreamPlayer3D::_mix_audio() { + + if (!stream_playback.is_valid()) { + return; + } + + if (!active) { + return; + } + + bool started = false; + if (setseek >= 0.0) { + stream_playback->start(setseek); + setseek = -1.0; //reset seek + started = true; + } + + //get data + AudioFrame *buffer = mix_buffer.ptr(); + int buffer_size = mix_buffer.size(); + + //mix + if (output_count > 0 || out_of_range_mode == OUT_OF_RANGE_MIX) { + + float pitch_scale = 0.0; + if (output_count) { + //used for doppler, not realistic but good enough + for (int i = 0; i < output_count; i++) { + pitch_scale += outputs[i].pitch_scale; + } + pitch_scale /= float(output_count); + } else { + pitch_scale = 1.0; + } + + stream_playback->mix(buffer, pitch_scale, buffer_size); + } + + //write all outputs + for (int i = 0; i < output_count; i++) { + + Output current = outputs[i]; + + //see if current output exists, to keep volume ramp + bool found = false; + for (int j = i; j < prev_output_count; j++) { + if (prev_outputs[j].viewport == current.viewport) { + if (j != i) { + SWAP(prev_outputs[j], prev_outputs[i]); + } + found = true; + break; + } + } + + bool interpolate_filter = !started; + ; + if (!found) { + //create new if was not used before + if (prev_output_count < MAX_OUTPUTS) { + prev_outputs[prev_output_count] = prev_outputs[i]; //may be owned by another viewport + prev_output_count++; + } + prev_outputs[i] = current; + interpolate_filter = false; + } + + //mix! + + int buffers = 0; + int first = 0; + + switch (AudioServer::get_singleton()->get_speaker_mode()) { + + case AudioServer::SPEAKER_MODE_STEREO: { + buffers = 1; + first = 0; + + } break; + case AudioServer::SPEAKER_SURROUND_51: { + buffers = 2; + first = 1; + + } break; + case AudioServer::SPEAKER_SURROUND_71: { + + buffers = 3; + first = 1; + + } break; + } + + for (int k = 0; k < buffers; k++) { + AudioFrame vol_inc = (current.vol[k] - prev_outputs[i].vol[k]) / float(buffer_size); + AudioFrame vol = current.vol[k]; + + AudioFrame *target = AudioServer::get_singleton()->thread_get_channel_mix_buffer(current.bus_index, first + k); + + current.filter.set_mode(AudioFilterSW::HIGHSHELF); + current.filter.set_sampling_rate(AudioServer::get_singleton()->get_mix_rate()); + current.filter.set_cutoff(attenuation_filter_cutoff_hz); + current.filter.set_resonance(1); + current.filter.set_stages(1); + current.filter.set_gain(current.filter_gain); + + if (interpolate_filter) { + + current.filter_process[k * 2 + 0] = prev_outputs[i].filter_process[k * 2 + 0]; + current.filter_process[k * 2 + 1] = prev_outputs[i].filter_process[k * 2 + 1]; + + current.filter_process[k * 2 + 0].set_filter(¤t.filter, false); + current.filter_process[k * 2 + 1].set_filter(¤t.filter, false); + + current.filter_process[k * 2 + 0].update_coeffs(buffer_size); + current.filter_process[k * 2 + 1].update_coeffs(buffer_size); + for (int j = 0; j < buffer_size; j++) { + + AudioFrame f = buffer[j] * vol; + current.filter_process[k * 2 + 0].process_one_interp(f.l); + current.filter_process[k * 2 + 1].process_one_interp(f.r); + + target[j] += f; + vol += vol_inc; + } + } else { + current.filter_process[k * 2 + 0].set_filter(¤t.filter); + current.filter_process[k * 2 + 1].set_filter(¤t.filter); + + current.filter_process[k * 2 + 0].update_coeffs(); + current.filter_process[k * 2 + 1].update_coeffs(); + for (int j = 0; j < buffer_size; j++) { + + AudioFrame f = buffer[j] * vol; + current.filter_process[k * 2 + 0].process_one(f.l); + current.filter_process[k * 2 + 1].process_one(f.r); + + target[j] += f; + vol += vol_inc; + } + } + + if (current.reverb_bus_index >= 0) { + + AudioFrame *rtarget = AudioServer::get_singleton()->thread_get_channel_mix_buffer(current.reverb_bus_index, first + k); + + if (current.reverb_bus_index == prev_outputs[i].reverb_bus_index) { + AudioFrame rvol_inc = (current.reverb_vol[k] - prev_outputs[i].reverb_vol[k]) / float(buffer_size); + AudioFrame rvol = prev_outputs[i].reverb_vol[k]; + + for (int j = 0; j < buffer_size; j++) { + + rtarget[j] += buffer[j] * rvol; + rvol += rvol_inc; + } + } else { + + AudioFrame rvol = current.reverb_vol[k]; + for (int j = 0; j < buffer_size; j++) { + + rtarget[j] += buffer[j] * rvol; + } + } + } + } + + prev_outputs[i] = current; + } + + prev_output_count = output_count; + + //stream is no longer active, disable this. + if (!stream_playback->is_playing()) { + active = false; + } + + output_ready = false; +} + +float AudioStreamPlayer3D::_get_attenuation_db(float p_distance) const { + + float att; + switch (attenuation_model) { + case ATTENUATION_INVERSE_DISTANCE: { + att = Math::linear2db(1.0 / ((p_distance / unit_size) + 000001)); + } break; + case ATTENUATION_INVERSE_SQUARE_DISTANCE: { + float d = (p_distance / unit_size); + d *= d; + att = Math::linear2db(1.0 / (d + 0.00001)); + } break; + case ATTENUATION_LOGARITHMIC: { + att = -20 * Math::log(p_distance / unit_size + 000001); + } break; + } + + att += unit_db; + if (att > max_db) { + att = max_db; + } + + return att; +} + +void _update_sound() { +} + +void AudioStreamPlayer3D::_notification(int p_what) { + + if (p_what == NOTIFICATION_ENTER_TREE) { + + velocity_tracker->reset(get_global_transform().origin); + AudioServer::get_singleton()->add_callback(_mix_audios, this); + if (autoplay && !get_tree()->is_editor_hint()) { + play(); + } + } + + if (p_what == NOTIFICATION_EXIT_TREE) { + + AudioServer::get_singleton()->remove_callback(_mix_audios, this); + } + if (p_what == NOTIFICATION_TRANSFORM_CHANGED) { + + if (doppler_tracking != DOPPLER_TRACKING_DISABLED) { + velocity_tracker->update_position(get_global_transform().origin); + } + } + + if (p_what == NOTIFICATION_INTERNAL_FIXED_PROCESS) { + + //update anything related to position first, if possible of course + + if (!output_ready) { + + Vector3 linear_velocity; + + //compute linear velocity for doppler + if (doppler_tracking != DOPPLER_TRACKING_DISABLED) { + linear_velocity = velocity_tracker->get_tracked_linear_velocity(); + } + + Ref<World> world = get_world(); + ERR_FAIL_COND(world.is_null()); + + int new_output_count = 0; + + Vector3 global_pos = get_global_transform().origin; + + int bus_index = AudioServer::get_singleton()->thread_find_bus_index(bus); + + //check if any area is diverting sound into a bus + + PhysicsDirectSpaceState *space_state = PhysicsServer::get_singleton()->space_get_direct_state(world->get_space()); + + PhysicsDirectSpaceState::ShapeResult sr[MAX_INTERSECT_AREAS]; + + int areas = space_state->intersect_point(global_pos, sr, MAX_INTERSECT_AREAS, Set<RID>(), area_mask, PhysicsDirectSpaceState::TYPE_MASK_AREA); + Area *area = NULL; + + for (int i = 0; i < areas; i++) { + if (!sr[i].collider) + continue; + + Area *tarea = sr[i].collider->cast_to<Area>(); + if (!tarea) + continue; + + if (!tarea->is_overriding_audio_bus() && !tarea->is_using_reverb_bus()) + continue; + + area = tarea; + break; + } + + List<Camera *> cameras; + world->get_camera_list(&cameras); + + for (List<Camera *>::Element *E = cameras.front(); E; E = E->next()) { + + Camera *camera = E->get(); + Viewport *vp = camera->get_viewport(); + if (!vp->is_audio_listener()) + continue; + + Vector3 local_pos = camera->get_global_transform().orthonormalized().affine_inverse().xform(global_pos); + + float dist = local_pos.length(); + + Vector3 area_sound_pos; + Vector3 cam_area_pos; + + if (area && area->is_using_reverb_bus() && area->get_reverb_uniformity() > 0) { + area_sound_pos = space_state->get_closest_point_to_object_volume(area->get_rid(), camera->get_global_transform().origin); + cam_area_pos = camera->get_global_transform().affine_inverse().xform(area_sound_pos); + } + + if (max_distance > 0) { + + float total_max = max_distance; + + if (area && area->is_using_reverb_bus() && area->get_reverb_uniformity() > 0) { + total_max = MAX(total_max, cam_area_pos.length()); + } + if (total_max > max_distance) { + continue; //cant hear this sound in this camera + } + } + + float multiplier = Math::db2linear(_get_attenuation_db(dist)); + if (max_distance > 0) { + multiplier *= MAX(0, 1.0 - (dist / max_distance)); + } + + Output output; + output.bus_index = bus_index; + output.reverb_bus_index = -1; //no reverb by default + output.viewport = vp; + + float db_att = (1.0 - MIN(1.0, multiplier)) * attenuation_filter_db; + + if (emission_angle_enabled) { + Vector3 camtopos = global_pos - camera->get_global_transform().origin; + float c = camtopos.normalized().dot(get_global_transform().basis.get_axis(2).normalized()); //it's z negative + float angle = Math::rad2deg(Math::acos(c)); + if (angle > emission_angle) + db_att -= -emission_angle_filter_attenuation_db; + } + + output.filter_gain = Math::db2linear(db_att); + + Vector3 flat_pos = local_pos; + flat_pos.y = 0; + flat_pos.normalize(); + + switch (AudioServer::get_singleton()->get_speaker_mode()) { + + case AudioServer::SPEAKER_MODE_STEREO: { + + float c = flat_pos.x * 0.5 + 0.5; + output.vol[0].l = 1.0 - c; + output.vol[0].r = c; + + output.vol[0] *= multiplier; + + } break; + case AudioServer::SPEAKER_SURROUND_51: { + + float xl = Vector3(-1, 0, -1).normalized().dot(flat_pos) * 0.5 + 0.5; + float xr = Vector3(1, 0, -1).normalized().dot(flat_pos) * 0.5 + 0.5; + + output.vol[0].l = xl; + output.vol[1].r = 1.0 - xl; + output.vol[0].r = xr; + output.vol[1].l = 1.0 - xr; + + output.vol[0] *= multiplier; + output.vol[1] *= multiplier; + } break; + case AudioServer::SPEAKER_SURROUND_71: { + + float xl = Vector3(-1, 0, -1).normalized().dot(flat_pos) * 0.5 + 0.5; + float xr = Vector3(1, 0, -1).normalized().dot(flat_pos) * 0.5 + 0.5; + + output.vol[0].l = xl; + output.vol[1].r = 1.0 - xl; + output.vol[0].r = xr; + output.vol[1].l = 1.0 - xr; + + float c = flat_pos.x * 0.5 + 0.5; + output.vol[2].l = 1.0 - c; + output.vol[2].r = c; + + output.vol[0] *= multiplier; + output.vol[1] *= multiplier; + output.vol[2] *= multiplier; + + } break; + } + + bool filled_reverb = false; + int vol_index_max = AudioServer::get_singleton()->get_speaker_mode() + 1; + + if (area) { + + if (area->is_overriding_audio_bus()) { + //override audio bus + StringName bus_name = area->get_audio_bus(); + output.bus_index = AudioServer::get_singleton()->thread_find_bus_index(bus_name); + } + + if (area->is_using_reverb_bus()) { + + filled_reverb = true; + StringName bus_name = area->get_reverb_bus(); + output.reverb_bus_index = AudioServer::get_singleton()->thread_find_bus_index(bus_name); + + float uniformity = area->get_reverb_uniformity(); + float area_send = area->get_reverb_amount(); + + if (uniformity > 0.0) { + + float distance = cam_area_pos.length(); + float attenuation = Math::db2linear(_get_attenuation_db(distance)); + + //float dist_att_db = -20 * Math::log(dist + 0.00001); //logarithmic attenuation, like in real life + + float center_val[3] = { 0.5, 0.25, 0.16666 }; + AudioFrame center_frame(center_val[vol_index_max - 1], center_val[vol_index_max - 1]); + + if (attenuation < 1.0) { + //pan the uniform sound + Vector3 rev_pos = cam_area_pos; + rev_pos.y = 0; + rev_pos.normalize(); + + switch (AudioServer::get_singleton()->get_speaker_mode()) { + + case AudioServer::SPEAKER_MODE_STEREO: { + + float c = rev_pos.x * 0.5 + 0.5; + output.reverb_vol[0].l = 1.0 - c; + output.reverb_vol[0].r = c; + + } break; + case AudioServer::SPEAKER_SURROUND_51: { + + float xl = Vector3(-1, 0, -1).normalized().dot(rev_pos) * 0.5 + 0.5; + float xr = Vector3(1, 0, -1).normalized().dot(rev_pos) * 0.5 + 0.5; + + output.reverb_vol[0].l = xl; + output.reverb_vol[1].r = 1.0 - xl; + output.reverb_vol[0].r = xr; + output.reverb_vol[1].l = 1.0 - xr; + + } break; + case AudioServer::SPEAKER_SURROUND_71: { + + float xl = Vector3(-1, 0, -1).normalized().dot(rev_pos) * 0.5 + 0.5; + float xr = Vector3(1, 0, -1).normalized().dot(rev_pos) * 0.5 + 0.5; + + output.reverb_vol[0].l = xl; + output.reverb_vol[1].r = 1.0 - xl; + output.reverb_vol[0].r = xr; + output.reverb_vol[1].l = 1.0 - xr; + + float c = rev_pos.x * 0.5 + 0.5; + output.reverb_vol[2].l = 1.0 - c; + output.reverb_vol[2].r = c; + + } break; + } + + for (int i = 0; i < vol_index_max; i++) { + + output.reverb_vol[i] = output.reverb_vol[i].linear_interpolate(center_frame, attenuation); + } + } else { + for (int i = 0; i < vol_index_max; i++) { + + output.reverb_vol[i] = center_frame; + } + } + + for (int i = 0; i < vol_index_max; i++) { + + output.reverb_vol[i] = output.vol[i].linear_interpolate(output.reverb_vol[i] * attenuation, uniformity); + output.reverb_vol[i] *= area_send; + } + + } else { + + for (int i = 0; i < vol_index_max; i++) { + + output.reverb_vol[i] = output.vol[i] * area_send; + } + } + } + } + + if (doppler_tracking != DOPPLER_TRACKING_DISABLED) { + + Vector3 camera_velocity = camera->get_doppler_tracked_velocity(); + + Vector3 local_velocity = camera->get_global_transform().orthonormalized().basis.xform_inv(linear_velocity - camera_velocity); + + if (local_velocity == Vector3()) { + output.pitch_scale = 1.0; + } else { + float approaching = local_pos.normalized().dot(local_velocity.normalized()); + float velocity = local_velocity.length(); + float speed_of_sound = 343.0; + + output.pitch_scale = speed_of_sound / (speed_of_sound + velocity * approaching); + output.pitch_scale = CLAMP(output.pitch_scale, (1 / 8.0), 8.0); //avoid crazy stuff + } + + } else { + output.pitch_scale = 1.0; + } + + if (!filled_reverb) { + + for (int i = 0; i < vol_index_max; i++) { + + output.reverb_vol[i] = AudioFrame(0, 0); + } + } + + outputs[new_output_count] = output; + new_output_count++; + if (new_output_count == MAX_OUTPUTS) + break; + } + + output_count = new_output_count; + output_ready = true; + } + + //start playing if requested + if (setplay >= 0.0) { + setseek = setplay; + active = true; + setplay = -1; + _change_notify("playing"); //update property in editor + } + + //stop playing if no longer active + if (!active) { + set_fixed_process_internal(false); + _change_notify("playing"); //update property in editor + } + } +} + +void AudioStreamPlayer3D::set_stream(Ref<AudioStream> p_stream) { + + ERR_FAIL_COND(!p_stream.is_valid()); + AudioServer::get_singleton()->lock(); + + mix_buffer.resize(AudioServer::get_singleton()->thread_get_mix_buffer_size()); + + if (stream_playback.is_valid()) { + stream_playback.unref(); + stream.unref(); + active = false; + setseek = -1; + } + + stream = p_stream; + stream_playback = p_stream->instance_playback(); + + if (stream_playback.is_null()) { + stream.unref(); + ERR_FAIL_COND(stream_playback.is_null()); + } + + AudioServer::get_singleton()->unlock(); +} + +Ref<AudioStream> AudioStreamPlayer3D::get_stream() const { + + return stream; +} + +void AudioStreamPlayer3D::set_unit_db(float p_volume) { + + unit_db = p_volume; +} +float AudioStreamPlayer3D::get_unit_db() const { + + return unit_db; +} + +void AudioStreamPlayer3D::set_unit_size(float p_volume) { + + unit_size = p_volume; +} +float AudioStreamPlayer3D::get_unit_size() const { + + return unit_size; +} + +void AudioStreamPlayer3D::set_max_db(float p_boost) { + + max_db = p_boost; +} +float AudioStreamPlayer3D::get_max_db() const { + + return max_db; +} + +void AudioStreamPlayer3D::play(float p_from_pos) { + + if (stream_playback.is_valid()) { + setplay = p_from_pos; + output_ready = false; + set_fixed_process_internal(true); + } +} + +void AudioStreamPlayer3D::seek(float p_seconds) { + + if (stream_playback.is_valid()) { + setseek = p_seconds; + } +} + +void AudioStreamPlayer3D::stop() { + + if (stream_playback.is_valid()) { + active = false; + set_fixed_process_internal(false); + setplay = -1; + } +} + +bool AudioStreamPlayer3D::is_playing() const { + + if (stream_playback.is_valid()) { + return active; // && stream_playback->is_playing(); + } + + return false; +} + +float AudioStreamPlayer3D::get_pos() { + + if (stream_playback.is_valid()) { + return stream_playback->get_pos(); + } + + return 0; +} + +void AudioStreamPlayer3D::set_bus(const StringName &p_bus) { + + //if audio is active, must lock this + AudioServer::get_singleton()->lock(); + bus = p_bus; + AudioServer::get_singleton()->unlock(); +} +StringName AudioStreamPlayer3D::get_bus() const { + + for (int i = 0; i < AudioServer::get_singleton()->get_bus_count(); i++) { + if (AudioServer::get_singleton()->get_bus_name(i) == bus) { + return bus; + } + } + return "Master"; +} + +void AudioStreamPlayer3D::set_autoplay(bool p_enable) { + + autoplay = p_enable; +} +bool AudioStreamPlayer3D::is_autoplay_enabled() { + + return autoplay; +} + +void AudioStreamPlayer3D::_set_playing(bool p_enable) { + + if (p_enable) + play(); + else + stop(); +} +bool AudioStreamPlayer3D::_is_active() const { + + return active; +} + +void AudioStreamPlayer3D::_validate_property(PropertyInfo &property) const { + + if (property.name == "bus") { + + String options; + for (int i = 0; i < AudioServer::get_singleton()->get_bus_count(); i++) { + if (i > 0) + options += ","; + String name = AudioServer::get_singleton()->get_bus_name(i); + options += name; + } + + property.hint_string = options; + } +} + +void AudioStreamPlayer3D::_bus_layout_changed() { + + _change_notify(); +} + +void AudioStreamPlayer3D::set_max_distance(float p_metres) { + + ERR_FAIL_COND(p_metres < 0.0); + max_distance = p_metres; +} + +float AudioStreamPlayer3D::get_max_distance() const { + + return max_distance; +} + +void AudioStreamPlayer3D::set_area_mask(uint32_t p_mask) { + + area_mask = p_mask; +} + +uint32_t AudioStreamPlayer3D::get_area_mask() const { + + return area_mask; +} + +void AudioStreamPlayer3D::set_emission_angle_enabled(bool p_enable) { + emission_angle_enabled = p_enable; + update_gizmo(); +} + +bool AudioStreamPlayer3D::is_emission_angle_enabled() const { + return emission_angle_enabled; +} + +void AudioStreamPlayer3D::set_emission_angle(float p_angle) { + ERR_FAIL_COND(p_angle < 0 || p_angle > 90); + emission_angle = p_angle; + update_gizmo(); +} + +float AudioStreamPlayer3D::get_emission_angle() const { + return emission_angle; +} + +void AudioStreamPlayer3D::set_emission_angle_filter_attenuation_db(float p_angle_attenuation_db) { + + emission_angle_filter_attenuation_db = p_angle_attenuation_db; +} + +float AudioStreamPlayer3D::get_emission_angle_filter_attenuation_db() const { + + return emission_angle_filter_attenuation_db; +} + +void AudioStreamPlayer3D::set_attenuation_filter_cutoff_hz(float p_hz) { + + attenuation_filter_cutoff_hz = p_hz; +} +float AudioStreamPlayer3D::get_attenuation_filter_cutoff_hz() const { + + return attenuation_filter_cutoff_hz; +} + +void AudioStreamPlayer3D::set_attenuation_filter_db(float p_db) { + + attenuation_filter_db = p_db; +} +float AudioStreamPlayer3D::get_attenuation_filter_db() const { + + return attenuation_filter_db; +} + +void AudioStreamPlayer3D::set_attenuation_model(AttenuationModel p_model) { + ERR_FAIL_INDEX(p_model, 3); + attenuation_model = p_model; +} + +AudioStreamPlayer3D::AttenuationModel AudioStreamPlayer3D::get_attenuation_model() const { + return attenuation_model; +} + +void AudioStreamPlayer3D::set_out_of_range_mode(OutOfRangeMode p_mode) { + + ERR_FAIL_INDEX(p_mode, 2); + out_of_range_mode = p_mode; +} + +AudioStreamPlayer3D::OutOfRangeMode AudioStreamPlayer3D::get_out_of_range_mode() const { + + return out_of_range_mode; +} + +void AudioStreamPlayer3D::set_doppler_tracking(DopplerTracking p_tracking) { + + if (doppler_tracking == p_tracking) + return; + + doppler_tracking = p_tracking; + + if (doppler_tracking != DOPPLER_TRACKING_DISABLED) { + set_notify_transform(true); + velocity_tracker->set_track_fixed_step(doppler_tracking == DOPPLER_TRACKING_FIXED_STEP); + velocity_tracker->reset(get_global_transform().origin); + } else { + set_notify_transform(false); + } +} + +AudioStreamPlayer3D::DopplerTracking AudioStreamPlayer3D::get_doppler_tracking() const { + + return doppler_tracking; +} + +void AudioStreamPlayer3D::_bind_methods() { + + ClassDB::bind_method(D_METHOD("set_stream", "stream:AudioStream"), &AudioStreamPlayer3D::set_stream); + ClassDB::bind_method(D_METHOD("get_stream"), &AudioStreamPlayer3D::get_stream); + + ClassDB::bind_method(D_METHOD("set_unit_db", "unit_db"), &AudioStreamPlayer3D::set_unit_db); + ClassDB::bind_method(D_METHOD("get_unit_db"), &AudioStreamPlayer3D::get_unit_db); + + ClassDB::bind_method(D_METHOD("set_unit_size", "unit_size"), &AudioStreamPlayer3D::set_unit_size); + ClassDB::bind_method(D_METHOD("get_unit_size"), &AudioStreamPlayer3D::get_unit_size); + + ClassDB::bind_method(D_METHOD("set_max_db", "max_db"), &AudioStreamPlayer3D::set_max_db); + ClassDB::bind_method(D_METHOD("get_max_db"), &AudioStreamPlayer3D::get_max_db); + + ClassDB::bind_method(D_METHOD("play", "from_pos"), &AudioStreamPlayer3D::play, DEFVAL(0.0)); + ClassDB::bind_method(D_METHOD("seek", "to_pos"), &AudioStreamPlayer3D::seek); + ClassDB::bind_method(D_METHOD("stop"), &AudioStreamPlayer3D::stop); + + ClassDB::bind_method(D_METHOD("is_playing"), &AudioStreamPlayer3D::is_playing); + ClassDB::bind_method(D_METHOD("get_pos"), &AudioStreamPlayer3D::get_pos); + + ClassDB::bind_method(D_METHOD("set_bus", "bus"), &AudioStreamPlayer3D::set_bus); + ClassDB::bind_method(D_METHOD("get_bus"), &AudioStreamPlayer3D::get_bus); + + ClassDB::bind_method(D_METHOD("set_autoplay", "enable"), &AudioStreamPlayer3D::set_autoplay); + ClassDB::bind_method(D_METHOD("is_autoplay_enabled"), &AudioStreamPlayer3D::is_autoplay_enabled); + + ClassDB::bind_method(D_METHOD("_set_playing", "enable"), &AudioStreamPlayer3D::_set_playing); + ClassDB::bind_method(D_METHOD("_is_active"), &AudioStreamPlayer3D::_is_active); + + ClassDB::bind_method(D_METHOD("set_max_distance", "metres"), &AudioStreamPlayer3D::set_max_distance); + ClassDB::bind_method(D_METHOD("get_max_distance"), &AudioStreamPlayer3D::get_max_distance); + + ClassDB::bind_method(D_METHOD("set_area_mask", "mask"), &AudioStreamPlayer3D::set_area_mask); + ClassDB::bind_method(D_METHOD("get_area_mask"), &AudioStreamPlayer3D::get_area_mask); + + ClassDB::bind_method(D_METHOD("set_emission_angle", "degrees"), &AudioStreamPlayer3D::set_emission_angle); + ClassDB::bind_method(D_METHOD("get_emission_angle"), &AudioStreamPlayer3D::get_emission_angle); + + ClassDB::bind_method(D_METHOD("set_emission_angle_enabled", "enabled"), &AudioStreamPlayer3D::set_emission_angle_enabled); + ClassDB::bind_method(D_METHOD("is_emission_angle_enabled"), &AudioStreamPlayer3D::is_emission_angle_enabled); + + ClassDB::bind_method(D_METHOD("set_emission_angle_filter_attenuation_db", "db"), &AudioStreamPlayer3D::set_emission_angle_filter_attenuation_db); + ClassDB::bind_method(D_METHOD("get_emission_angle_filter_attenuation_db"), &AudioStreamPlayer3D::get_emission_angle_filter_attenuation_db); + + ClassDB::bind_method(D_METHOD("set_attenuation_filter_cutoff_hz", "degrees"), &AudioStreamPlayer3D::set_attenuation_filter_cutoff_hz); + ClassDB::bind_method(D_METHOD("get_attenuation_filter_cutoff_hz"), &AudioStreamPlayer3D::get_attenuation_filter_cutoff_hz); + + ClassDB::bind_method(D_METHOD("set_attenuation_filter_db", "db"), &AudioStreamPlayer3D::set_attenuation_filter_db); + ClassDB::bind_method(D_METHOD("get_attenuation_filter_db"), &AudioStreamPlayer3D::get_attenuation_filter_db); + + ClassDB::bind_method(D_METHOD("set_attenuation_model", "model"), &AudioStreamPlayer3D::set_attenuation_model); + ClassDB::bind_method(D_METHOD("get_attenuation_model"), &AudioStreamPlayer3D::get_attenuation_model); + + ClassDB::bind_method(D_METHOD("set_out_of_range_mode", "mode"), &AudioStreamPlayer3D::set_out_of_range_mode); + ClassDB::bind_method(D_METHOD("get_out_of_range_mode"), &AudioStreamPlayer3D::get_out_of_range_mode); + + ClassDB::bind_method(D_METHOD("set_doppler_tracking", "mode"), &AudioStreamPlayer3D::set_doppler_tracking); + ClassDB::bind_method(D_METHOD("get_doppler_tracking"), &AudioStreamPlayer3D::get_doppler_tracking); + + ClassDB::bind_method(D_METHOD("_bus_layout_changed"), &AudioStreamPlayer3D::_bus_layout_changed); + + ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "stream", PROPERTY_HINT_RESOURCE_TYPE, "AudioStream"), "set_stream", "get_stream"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "attenuation_model", PROPERTY_HINT_ENUM, "Inverse,InverseSquare,Log"), "set_attenuation_model", "get_attenuation_model"); + ADD_PROPERTY(PropertyInfo(Variant::REAL, "unit_db", PROPERTY_HINT_RANGE, "-80,80"), "set_unit_db", "get_unit_db"); + ADD_PROPERTY(PropertyInfo(Variant::REAL, "unit_size", PROPERTY_HINT_RANGE, "0.1,100,0.1"), "set_unit_size", "get_unit_size"); + ADD_PROPERTY(PropertyInfo(Variant::REAL, "max_db", PROPERTY_HINT_RANGE, "-24,6"), "set_max_db", "get_max_db"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "playing", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR), "_set_playing", "_is_active"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "autoplay"), "set_autoplay", "is_autoplay_enabled"); + ADD_PROPERTY(PropertyInfo(Variant::REAL, "max_distance", PROPERTY_HINT_RANGE, "0,65536,1"), "set_max_distance", "get_max_distance"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "out_of_range_mode", PROPERTY_HINT_ENUM, "Mix,Pause"), "set_out_of_range_mode", "get_out_of_range_mode"); + ADD_PROPERTY(PropertyInfo(Variant::STRING, "bus", PROPERTY_HINT_ENUM, ""), "set_bus", "get_bus"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "area_mask", PROPERTY_HINT_LAYERS_2D_PHYSICS), "set_area_mask", "get_area_mask"); + ADD_GROUP("Emission Angle", "emission_angle"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "emission_angle_enabled"), "set_emission_angle_enabled", "is_emission_angle_enabled"); + ADD_PROPERTY(PropertyInfo(Variant::REAL, "emission_angle_degrees", PROPERTY_HINT_RANGE, "0.1,90,0.1"), "set_emission_angle", "get_emission_angle"); + ADD_PROPERTY(PropertyInfo(Variant::REAL, "emission_angle_filter_attenuation_db", PROPERTY_HINT_RANGE, "-80,0,0.1"), "set_emission_angle_filter_attenuation_db", "get_emission_angle_filter_attenuation_db"); + ADD_GROUP("Attenuation Filter", "attenuation_filter_"); + ADD_PROPERTY(PropertyInfo(Variant::REAL, "attenuation_filter_cutoff_hz", PROPERTY_HINT_RANGE, "50,50000,1"), "set_attenuation_filter_cutoff_hz", "get_attenuation_filter_cutoff_hz"); + ADD_PROPERTY(PropertyInfo(Variant::REAL, "attenuation_filter_db", PROPERTY_HINT_RANGE, "-80,0,0.1"), "set_attenuation_filter_db", "get_attenuation_filter_db"); + ADD_GROUP("Doppler", "doppler_"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "doppler_tracking", PROPERTY_HINT_ENUM, "Disabled,Idle,Fixed"), "set_doppler_tracking", "get_doppler_tracking"); + + BIND_CONSTANT(ATTENUATION_INVERSE_DISTANCE); + BIND_CONSTANT(ATTENUATION_INVERSE_SQUARE_DISTANCE); + BIND_CONSTANT(ATTENUATION_LOGARITHMIC); + + BIND_CONSTANT(OUT_OF_RANGE_MIX); + BIND_CONSTANT(OUT_OF_RANGE_PAUSE); + + BIND_CONSTANT(DOPPLER_TRACKING_DISABLED); + BIND_CONSTANT(DOPPLER_TRACKING_IDLE_STEP); + BIND_CONSTANT(DOPPLER_TRACKING_FIXED_STEP); +} + +AudioStreamPlayer3D::AudioStreamPlayer3D() { + + unit_db = 0; + unit_size = 1; + attenuation_model = ATTENUATION_INVERSE_DISTANCE; + max_db = 3; + autoplay = false; + setseek = -1; + active = false; + output_count = 0; + prev_output_count = 0; + max_distance = 0; + setplay = -1; + output_ready = false; + area_mask = 1; + emission_angle = 45; + emission_angle_enabled = false; + emission_angle_filter_attenuation_db = -12; + attenuation_filter_cutoff_hz = 5000; + attenuation_filter_db = -24; + out_of_range_mode = OUT_OF_RANGE_MIX; + doppler_tracking = DOPPLER_TRACKING_DISABLED; + + velocity_tracker.instance(); + AudioServer::get_singleton()->connect("bus_layout_changed", this, "_bus_layout_changed"); +} +AudioStreamPlayer3D::~AudioStreamPlayer3D() { +} diff --git a/scene/3d/audio_stream_player_3d.h b/scene/3d/audio_stream_player_3d.h new file mode 100644 index 0000000000..8603cab5a4 --- /dev/null +++ b/scene/3d/audio_stream_player_3d.h @@ -0,0 +1,175 @@ +#ifndef AUDIO_STREAM_PLAYER_3D_H +#define AUDIO_STREAM_PLAYER_3D_H + +#include "scene/3d/spatial.h" +#include "scene/3d/spatial_velocity_tracker.h" +#include "servers/audio/audio_filter_sw.h" +#include "servers/audio/audio_stream.h" +#include "servers/audio_server.h" + +class Camera; +class AudioStreamPlayer3D : public Spatial { + + GDCLASS(AudioStreamPlayer3D, Spatial) +public: + enum AttenuationModel { + ATTENUATION_INVERSE_DISTANCE, + ATTENUATION_INVERSE_SQUARE_DISTANCE, + ATTENUATION_LOGARITHMIC, + }; + + enum OutOfRangeMode { + OUT_OF_RANGE_MIX, + OUT_OF_RANGE_PAUSE, + }; + + enum DopplerTracking { + DOPPLER_TRACKING_DISABLED, + DOPPLER_TRACKING_IDLE_STEP, + DOPPLER_TRACKING_FIXED_STEP + }; + +private: + enum { + MAX_OUTPUTS = 8, + MAX_INTERSECT_AREAS = 32 + + }; + + struct Output { + + AudioFilterSW filter; + AudioFilterSW::Processor filter_process[6]; + AudioFrame vol[3]; + float filter_gain; + float pitch_scale; + int bus_index; + int reverb_bus_index; + AudioFrame reverb_vol[3]; + Viewport *viewport; //pointer only used for reference to previous mix + + Output() { + filter_gain = 0; + viewport = NULL; + reverb_bus_index = -1; + bus_index = -1; + } + }; + + Output outputs[MAX_OUTPUTS]; + volatile int output_count; + volatile bool output_ready; + + //these are used by audio thread to have a reference of previous volumes (for ramping volume and avoiding clicks) + Output prev_outputs[MAX_OUTPUTS]; + int prev_output_count; + + Ref<AudioStreamPlayback> stream_playback; + Ref<AudioStream> stream; + Vector<AudioFrame> mix_buffer; + + volatile float setseek; + volatile bool active; + volatile float setplay; + + AttenuationModel attenuation_model; + float unit_db; + float unit_size; + float max_db; + bool autoplay; + StringName bus; + + void _mix_audio(); + static void _mix_audios(void *self) { reinterpret_cast<AudioStreamPlayer3D *>(self)->_mix_audio(); } + + void _set_playing(bool p_enable); + bool _is_active() const; + + void _bus_layout_changed(); + + uint32_t area_mask; + + bool emission_angle_enabled; + float emission_angle; + float emission_angle_filter_attenuation_db; + float attenuation_filter_cutoff_hz; + float attenuation_filter_db; + + float max_distance; + + Ref<SpatialVelocityTracker> velocity_tracker; + + DopplerTracking doppler_tracking; + + OutOfRangeMode out_of_range_mode; + + float _get_attenuation_db(float p_distance) const; + +protected: + void _validate_property(PropertyInfo &property) const; + void _notification(int p_what); + static void _bind_methods(); + +public: + void set_stream(Ref<AudioStream> p_stream); + Ref<AudioStream> get_stream() const; + + void set_unit_db(float p_volume); + float get_unit_db() const; + + void set_unit_size(float p_volume); + float get_unit_size() const; + + void set_max_db(float p_boost); + float get_max_db() const; + + void play(float p_from_pos = 0.0); + void seek(float p_seconds); + void stop(); + bool is_playing() const; + float get_pos(); + + void set_bus(const StringName &p_bus); + StringName get_bus() const; + + void set_autoplay(bool p_enable); + bool is_autoplay_enabled(); + + void set_max_distance(float p_metres); + float get_max_distance() const; + + void set_area_mask(uint32_t p_mask); + uint32_t get_area_mask() const; + + void set_emission_angle_enabled(bool p_enable); + bool is_emission_angle_enabled() const; + + void set_emission_angle(float p_angle); + float get_emission_angle() const; + + void set_emission_angle_filter_attenuation_db(float p_angle_attenuation_db); + float get_emission_angle_filter_attenuation_db() const; + + void set_attenuation_filter_cutoff_hz(float p_hz); + float get_attenuation_filter_cutoff_hz() const; + + void set_attenuation_filter_db(float p_db); + float get_attenuation_filter_db() const; + + void set_attenuation_model(AttenuationModel p_model); + AttenuationModel get_attenuation_model() const; + + void set_out_of_range_mode(OutOfRangeMode p_mode); + OutOfRangeMode get_out_of_range_mode() const; + + void set_doppler_tracking(DopplerTracking p_tracking); + DopplerTracking get_doppler_tracking() const; + + AudioStreamPlayer3D(); + ~AudioStreamPlayer3D(); +}; + +VARIANT_ENUM_CAST(AudioStreamPlayer3D::AttenuationModel) +VARIANT_ENUM_CAST(AudioStreamPlayer3D::OutOfRangeMode) +VARIANT_ENUM_CAST(AudioStreamPlayer3D::DopplerTracking) +#endif // AUDIO_STREAM_PLAYER_3D_H diff --git a/scene/3d/body_shape.cpp b/scene/3d/body_shape.cpp deleted file mode 100644 index 68f166c5b9..0000000000 --- a/scene/3d/body_shape.cpp +++ /dev/null @@ -1,920 +0,0 @@ -/*************************************************************************/ -/* body_shape.cpp */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* http://www.godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ -/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ -#include "body_shape.h" -#include "scene/resources/box_shape.h" -#include "scene/resources/capsule_shape.h" -#include "scene/resources/concave_polygon_shape.h" -#include "scene/resources/convex_polygon_shape.h" -#include "scene/resources/plane_shape.h" -#include "scene/resources/ray_shape.h" -#include "scene/resources/sphere_shape.h" -#include "servers/visual_server.h" -//TODO: Implement CylinderShape and HeightMapShape? -#include "mesh_instance.h" -#include "physics_body.h" -#include "quick_hull.h" - -void CollisionShape::_update_body() { - - if (!is_inside_tree() || !can_update_body) - return; - if (!get_tree()->is_editor_hint()) - return; - if (get_parent() && get_parent()->cast_to<CollisionObject>()) - get_parent()->cast_to<CollisionObject>()->_update_shapes_from_children(); -} - -void CollisionShape::make_convex_from_brothers() { - - Node *p = get_parent(); - if (!p) - return; - - for (int i = 0; i < p->get_child_count(); i++) { - - Node *n = p->get_child(i); - if (n->cast_to<MeshInstance>()) { - - MeshInstance *mi = n->cast_to<MeshInstance>(); - Ref<Mesh> m = mi->get_mesh(); - if (m.is_valid()) { - - Ref<Shape> s = m->create_convex_shape(); - set_shape(s); - } - } - } -} -/* - -void CollisionShape::_update_indicator() { - - while (VisualServer::get_singleton()->mesh_get_surface_count(indicator)) - VisualServer::get_singleton()->mesh_remove_surface(indicator,0); - - if (shape.is_null()) - return; - - PoolVector<Vector3> points; - PoolVector<Vector3> normals; - - VS::PrimitiveType pt = VS::PRIMITIVE_TRIANGLES; - - if (shape->cast_to<RayShape>()) { - - RayShape *rs = shape->cast_to<RayShape>(); - points.push_back(Vector3()); - points.push_back(Vector3(0,0,rs->get_length())); - pt = VS::PRIMITIVE_LINES; - } else if (shape->cast_to<SphereShape>()) { - - //VisualServer *vs=VisualServer::get_singleton(); - SphereShape *shapeptr=shape->cast_to<SphereShape>(); - - - Color col(0.4,1.0,1.0,0.5); - - int lats=6; - int lons=12; - float size=shapeptr->get_radius(); - - - for(int i = 1; i <= lats; i++) { - double lat0 = Math_PI * (-0.5 + (double) (i - 1) / lats); - double z0 = Math::sin(lat0); - double zr0 = Math::cos(lat0); - - double lat1 = Math_PI * (-0.5 + (double) i / lats); - double z1 = Math::sin(lat1); - double zr1 = Math::cos(lat1); - - for(int j = lons; j >= 1; j--) { - - double lng0 = 2 * Math_PI * (double) (j - 1) / lons; - double x0 = Math::cos(lng0); - double y0 = Math::sin(lng0); - - double lng1 = 2 * Math_PI * (double) (j) / lons; - double x1 = Math::cos(lng1); - double y1 = Math::sin(lng1); - - Vector3 v4=Vector3(x0 * zr0, z0, y0 *zr0)*size; - Vector3 v3=Vector3(x0 * zr1, z1, y0 *zr1)*size; - Vector3 v2=Vector3(x1 * zr1, z1, y1 *zr1)*size; - Vector3 v1=Vector3(x1 * zr0, z0, y1 *zr0)*size; - - Vector<Vector3> line; - line.push_back(v1); - line.push_back(v2); - line.push_back(v3); - line.push_back(v4); - - - points.push_back(v1); - points.push_back(v2); - points.push_back(v3); - - points.push_back(v1); - points.push_back(v3); - points.push_back(v4); - - normals.push_back(v1.normalized()); - normals.push_back(v2.normalized()); - normals.push_back(v3.normalized()); - - normals.push_back(v1.normalized()); - normals.push_back(v3.normalized()); - normals.push_back(v4.normalized()); - - } - } - } else if (shape->cast_to<BoxShape>()) { - - BoxShape *shapeptr=shape->cast_to<BoxShape>(); - - for (int i=0;i<6;i++) { - - - Vector3 face_points[4]; - - - for (int j=0;j<4;j++) { - - float v[3]; - v[0]=1.0; - v[1]=1-2*((j>>1)&1); - v[2]=v[1]*(1-2*(j&1)); - - for (int k=0;k<3;k++) { - - if (i<3) - face_points[j][(i+k)%3]=v[k]*(i>=3?-1:1); - else - face_points[3-j][(i+k)%3]=v[k]*(i>=3?-1:1); - } - } - Vector3 normal; - normal[i%3]=(i>=3?-1:1); - - for(int j=0;j<4;j++) - face_points[j]*=shapeptr->get_extents(); - - points.push_back(face_points[0]); - points.push_back(face_points[1]); - points.push_back(face_points[2]); - - points.push_back(face_points[0]); - points.push_back(face_points[2]); - points.push_back(face_points[3]); - - for(int n=0;n<6;n++) - normals.push_back(normal); - - } - - } else if (shape->cast_to<ConvexPolygonShape>()) { - - ConvexPolygonShape *shapeptr=shape->cast_to<ConvexPolygonShape>(); - - Geometry::MeshData md; - QuickHull::build(Variant(shapeptr->get_points()),md); - - for(int i=0;i<md.faces.size();i++) { - - for(int j=2;j<md.faces[i].indices.size();j++) { - points.push_back(md.vertices[md.faces[i].indices[0]]); - points.push_back(md.vertices[md.faces[i].indices[j-1]]); - points.push_back(md.vertices[md.faces[i].indices[j]]); - normals.push_back(md.faces[i].plane.normal); - normals.push_back(md.faces[i].plane.normal); - normals.push_back(md.faces[i].plane.normal); - } - } - } else if (shape->cast_to<ConcavePolygonShape>()) { - - ConcavePolygonShape *shapeptr=shape->cast_to<ConcavePolygonShape>(); - - points = shapeptr->get_faces(); - for(int i=0;i<points.size()/3;i++) { - - Vector3 n = Plane( points[i*3+0],points[i*3+1],points[i*3+2] ).normal; - normals.push_back(n); - normals.push_back(n); - normals.push_back(n); - } - - } else if (shape->cast_to<CapsuleShape>()) { - - CapsuleShape *shapeptr=shape->cast_to<CapsuleShape>(); - - PoolVector<Plane> planes = Geometry::build_capsule_planes(shapeptr->get_radius(), shapeptr->get_height()/2.0, 12, Vector3::AXIS_Z); - Geometry::MeshData md = Geometry::build_convex_mesh(planes); - - for(int i=0;i<md.faces.size();i++) { - - for(int j=2;j<md.faces[i].indices.size();j++) { - points.push_back(md.vertices[md.faces[i].indices[0]]); - points.push_back(md.vertices[md.faces[i].indices[j-1]]); - points.push_back(md.vertices[md.faces[i].indices[j]]); - normals.push_back(md.faces[i].plane.normal); - normals.push_back(md.faces[i].plane.normal); - normals.push_back(md.faces[i].plane.normal); - - } - } - - } else if (shape->cast_to<PlaneShape>()) { - - PlaneShape *shapeptr=shape->cast_to<PlaneShape>(); - - Plane p = shapeptr->get_plane(); - Vector3 n1 = p.get_any_perpendicular_normal(); - Vector3 n2 = p.normal.cross(n1).normalized(); - - Vector3 pface[4]={ - p.normal*p.d+n1*100.0+n2*100.0, - p.normal*p.d+n1*100.0+n2*-100.0, - p.normal*p.d+n1*-100.0+n2*-100.0, - p.normal*p.d+n1*-100.0+n2*100.0, - }; - - points.push_back(pface[0]); - points.push_back(pface[1]); - points.push_back(pface[2]); - - points.push_back(pface[0]); - points.push_back(pface[2]); - points.push_back(pface[3]); - - normals.push_back(p.normal); - normals.push_back(p.normal); - normals.push_back(p.normal); - normals.push_back(p.normal); - normals.push_back(p.normal); - normals.push_back(p.normal); - - } - - if (!points.size()) - return; - RID material = VisualServer::get_singleton()->fixed_material_create(); - VisualServer::get_singleton()->fixed_material_set_param(material,VS::FIXED_MATERIAL_PARAM_DIFFUSE,Color(0,0.6,0.7,0.3)); - VisualServer::get_singleton()->fixed_material_set_param(material,VS::FIXED_MATERIAL_PARAM_EMISSION,0.7); - if (normals.size()==0) - VisualServer::get_singleton()->material_set_flag(material,VS::MATERIAL_FLAG_UNSHADED,true); - VisualServer::get_singleton()->material_set_flag(material,VS::MATERIAL_FLAG_DOUBLE_SIDED,true); - Array d; - d.resize(VS::ARRAY_MAX); - d[VS::ARRAY_VERTEX]=points; - if (normals.size()) - d[VS::ARRAY_NORMAL]=normals; - VisualServer::get_singleton()->mesh_add_surface(indicator,pt,d); - VisualServer::get_singleton()->mesh_surface_set_material(indicator,0,material,true); - -} - -*/ -void CollisionShape::_add_to_collision_object(Object *p_cshape) { - - if (unparenting) - return; - - CollisionObject *co = p_cshape->cast_to<CollisionObject>(); - ERR_FAIL_COND(!co); - - if (shape.is_valid()) { - - update_shape_index = co->get_shape_count(); - co->add_shape(shape, get_transform()); - if (trigger) - co->set_shape_as_trigger(co->get_shape_count() - 1, true); - } else { - update_shape_index = -1; - } -} - -void CollisionShape::_notification(int p_what) { - - switch (p_what) { - - case NOTIFICATION_ENTER_TREE: { - unparenting = false; - can_update_body = get_tree()->is_editor_hint(); - set_notify_local_transform(!can_update_body); - - if (get_tree()->is_debugging_collisions_hint()) { - _create_debug_shape(); - } - - //indicator_instance = VisualServer::get_singleton()->instance_create2(indicator,get_world()->get_scenario()); - } break; - case NOTIFICATION_TRANSFORM_CHANGED: { - //VisualServer::get_singleton()->instance_set_transform(indicator_instance,get_global_transform()); - if (can_update_body && updating_body) { - _update_body(); - } - } break; - case NOTIFICATION_EXIT_TREE: { - /* if (indicator_instance.is_valid()) { - VisualServer::get_singleton()->free(indicator_instance); - indicator_instance=RID(); - }*/ - can_update_body = false; - set_notify_local_transform(false); - if (debug_shape) { - debug_shape->queue_delete(); - debug_shape = NULL; - } - } break; - case NOTIFICATION_UNPARENTED: { - unparenting = true; - if (can_update_body && updating_body) - _update_body(); - } break; - case NOTIFICATION_PARENTED: { - if (can_update_body && updating_body) - _update_body(); - } break; - case NOTIFICATION_LOCAL_TRANSFORM_CHANGED: { - - if (!can_update_body && update_shape_index >= 0) { - - CollisionObject *co = get_parent()->cast_to<CollisionObject>(); - if (co) { - co->set_shape_transform(update_shape_index, get_transform()); - } - } - - } break; - } -} - -void CollisionShape::resource_changed(RES res) { - - update_gizmo(); -} - -void CollisionShape::_set_update_shape_index(int p_index) { - - update_shape_index = p_index; -} - -int CollisionShape::_get_update_shape_index() const { - - return update_shape_index; -} - -String CollisionShape::get_configuration_warning() const { - - if (!get_parent()->cast_to<CollisionObject>()) { - return TTR("CollisionShape only serves to provide a collision shape to a CollisionObject derived node. Please only use it as a child of Area, StaticBody, RigidBody, KinematicBody, etc. to give them a shape."); - } - - if (!shape.is_valid()) { - return TTR("A shape must be provided for CollisionShape to function. Please create a shape resource for it!"); - } - - return String(); -} - -void CollisionShape::_bind_methods() { - - //not sure if this should do anything - ClassDB::bind_method(D_METHOD("resource_changed", "resource"), &CollisionShape::resource_changed); - ClassDB::bind_method(D_METHOD("set_shape", "shape"), &CollisionShape::set_shape); - ClassDB::bind_method(D_METHOD("get_shape"), &CollisionShape::get_shape); - ClassDB::bind_method(D_METHOD("_add_to_collision_object"), &CollisionShape::_add_to_collision_object); - ClassDB::bind_method(D_METHOD("set_trigger", "enable"), &CollisionShape::set_trigger); - ClassDB::bind_method(D_METHOD("is_trigger"), &CollisionShape::is_trigger); - ClassDB::bind_method(D_METHOD("make_convex_from_brothers"), &CollisionShape::make_convex_from_brothers); - ClassDB::set_method_flags("CollisionShape", "make_convex_from_brothers", METHOD_FLAGS_DEFAULT | METHOD_FLAG_EDITOR); - ClassDB::bind_method(D_METHOD("_set_update_shape_index", "index"), &CollisionShape::_set_update_shape_index); - ClassDB::bind_method(D_METHOD("_get_update_shape_index"), &CollisionShape::_get_update_shape_index); - - ClassDB::bind_method(D_METHOD("get_collision_object_shape_index"), &CollisionShape::get_collision_object_shape_index); - - ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "shape", PROPERTY_HINT_RESOURCE_TYPE, "Shape"), "set_shape", "get_shape"); - ADD_PROPERTY(PropertyInfo(Variant::BOOL, "trigger"), "set_trigger", "is_trigger"); - ADD_PROPERTY(PropertyInfo(Variant::INT, "_update_shape_index", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "_set_update_shape_index", "_get_update_shape_index"); -} - -void CollisionShape::set_shape(const Ref<Shape> &p_shape) { - - if (!shape.is_null()) - shape->unregister_owner(this); - shape = p_shape; - if (!shape.is_null()) - shape->register_owner(this); - update_gizmo(); - if (updating_body) { - _update_body(); - } else if (can_update_body && update_shape_index >= 0 && is_inside_tree()) { - CollisionObject *co = get_parent()->cast_to<CollisionObject>(); - if (co) { - co->set_shape(update_shape_index, p_shape); - } - } -} - -Ref<Shape> CollisionShape::get_shape() const { - - return shape; -} - -void CollisionShape::set_updating_body(bool p_update) { - updating_body = p_update; -} - -bool CollisionShape::is_updating_body() const { - - return updating_body; -} - -void CollisionShape::set_trigger(bool p_trigger) { - - trigger = p_trigger; - if (updating_body) { - _update_body(); - } else if (can_update_body && update_shape_index >= 0 && is_inside_tree()) { - CollisionObject *co = get_parent()->cast_to<CollisionObject>(); - if (co) { - co->set_shape_as_trigger(update_shape_index, p_trigger); - } - } -} - -bool CollisionShape::is_trigger() const { - - return trigger; -} - -CollisionShape::CollisionShape() { - - //indicator = VisualServer::get_singleton()->mesh_create(); - updating_body = true; - unparenting = false; - update_shape_index = -1; - trigger = false; - can_update_body = false; - debug_shape = NULL; -} - -CollisionShape::~CollisionShape() { - if (!shape.is_null()) - shape->unregister_owner(this); - //VisualServer::get_singleton()->free(indicator); -} - -void CollisionShape::_create_debug_shape() { - - if (debug_shape) { - debug_shape->queue_delete(); - debug_shape = NULL; - } - - Ref<Shape> s = get_shape(); - - if (s.is_null()) - return; - - Ref<Mesh> mesh = s->get_debug_mesh(); - - MeshInstance *mi = memnew(MeshInstance); - mi->set_mesh(mesh); - - add_child(mi); - debug_shape = mi; -} - -#if 0 -#include "body_volume.h" - -#include "geometry.h" -#include "scene/3d/physics_body.h" - -#define ADD_TRIANGLE(m_a, m_b, m_c, m_color) \ - { \ - Vector<Vector3> points; \ - points.resize(3); \ - points[0] = m_a; \ - points[1] = m_b; \ - points[2] = m_c; \ - Vector<Color> colors; \ - colors.resize(3); \ - colors[0] = m_color; \ - colors[1] = m_color; \ - colors[2] = m_color; \ - vs->poly_add_primitive(p_indicator, points, Vector<Vector3>(), colors, Vector<Vector3>()); \ - } - - -void CollisionShape::_notification(int p_what) { - - switch (p_what) { - case NOTIFICATION_ENTER_SCENE: { - - - if (get_root_node()->get_editor() && !indicator.is_valid()) { - - indicator=VisualServer::get_singleton()->poly_create(); - RID mat=VisualServer::get_singleton()->fixed_material_create(); - VisualServer::get_singleton()->material_set_flag( mat, VisualServer::MATERIAL_FLAG_UNSHADED, true ); - VisualServer::get_singleton()->material_set_flag( mat, VisualServer::MATERIAL_FLAG_WIREFRAME, true ); - VisualServer::get_singleton()->material_set_flag( mat, VisualServer::MATERIAL_FLAG_DOUBLE_SIDED, true ); - VisualServer::get_singleton()->material_set_line_width( mat, 3 ); - - VisualServer::get_singleton()->poly_set_material(indicator,mat,true); - - update_indicator(indicator); - } - - if (indicator.is_valid()) { - - indicator_instance=VisualServer::get_singleton()->instance_create2(indicator,get_world()->get_scenario()); - VisualServer::get_singleton()->instance_attach_object_instance_ID(indicator_instance,get_instance_ID()); - } - volume_changed(); - } break; - case NOTIFICATION_EXIT_SCENE: { - - if (indicator_instance.is_valid()) { - - VisualServer::get_singleton()->free(indicator_instance); - } - volume_changed(); - } break; - case NOTIFICATION_TRANSFORM_CHANGED: { - - if (indicator_instance.is_valid()) { - - VisualServer::get_singleton()->instance_set_transform(indicator_instance,get_global_transform()); - } - volume_changed(); - } break; - default: {} - } -} - -void CollisionShape::volume_changed() { - - if (indicator.is_valid()) - update_indicator(indicator); - - Object *parent=get_parent(); - if (!parent) - return; - PhysicsBody *physics_body=parent->cast_to<PhysicsBody>(); - - ERR_EXPLAIN("CollisionShape parent is not of type PhysicsBody"); - ERR_FAIL_COND(!physics_body); - - physics_body->recompute_child_volumes(); - -} - -RID CollisionShape::_get_visual_instance_rid() const { - - return indicator_instance; - -} - -void CollisionShape::_bind_methods() { - - ClassDB::bind_method("_get_visual_instance_rid",&CollisionShape::_get_visual_instance_rid); -} - -CollisionShape::CollisionShape() { - -} - -CollisionShape::~CollisionShape() { - - if (indicator.is_valid()) { - - VisualServer::get_singleton()->free(indicator); - } - -} - -void CollisionShapeSphere::_set(const String& p_name, const Variant& p_value) { - - if (p_name=="radius") { - radius=p_value; - volume_changed(); - } - -} - -Variant CollisionShapeSphere::_get(const String& p_name) const { - - if (p_name=="radius") { - return radius; - } - - return Variant(); -} - -void CollisionShapeSphere::_get_property_list( List<PropertyInfo> *p_list) const { - - p_list->push_back( PropertyInfo(Variant::REAL,"radius",PROPERTY_HINT_RANGE,"0.01,16384,0.01") ); -} - -void CollisionShapeSphere::update_indicator(RID p_indicator) { - - VisualServer *vs=VisualServer::get_singleton(); - - vs->poly_clear(p_indicator); - Color col(0.4,1.0,1.0,0.5); - - int lats=6; - int lons=12; - float size=radius; - - for(int i = 1; i <= lats; i++) { - double lat0 = Math_PI * (-0.5 + (double) (i - 1) / lats); - double z0 = Math::sin(lat0); - double zr0 = Math::cos(lat0); - - double lat1 = Math_PI * (-0.5 + (double) i / lats); - double z1 = Math::sin(lat1); - double zr1 = Math::cos(lat1); - - for(int j = lons; j >= 1; j--) { - - double lng0 = 2 * Math_PI * (double) (j - 1) / lons; - double x0 = Math::cos(lng0); - double y0 = Math::sin(lng0); - - double lng1 = 2 * Math_PI * (double) (j) / lons; - double x1 = Math::cos(lng1); - double y1 = Math::sin(lng1); - - Vector3 v4=Vector3(x0 * zr0, z0, y0 *zr0)*size; - Vector3 v3=Vector3(x0 * zr1, z1, y0 *zr1)*size; - Vector3 v2=Vector3(x1 * zr1, z1, y1 *zr1)*size; - Vector3 v1=Vector3(x1 * zr0, z0, y1 *zr0)*size; - - Vector<Vector3> line; - line.push_back(v1); - line.push_back(v2); - line.push_back(v3); - line.push_back(v4); - - Vector<Color> cols; - cols.push_back(col); - cols.push_back(col); - cols.push_back(col); - cols.push_back(col); - - - VisualServer::get_singleton()->poly_add_primitive(p_indicator,line,Vector<Vector3>(),cols,Vector<Vector3>()); - } - } -} - -void CollisionShapeSphere::append_to_volume(Ref<Shape> p_volume) { - - p_volume->add_sphere_shape(radius,get_transform()); -} - - -CollisionShapeSphere::CollisionShapeSphere() { - - radius=1.0; -} - -/* BOX */ - - -void CollisionShapeBox::_set(const String& p_name, const Variant& p_value) { - - if (p_name=="half_extents") { - half_extents=p_value; - volume_changed(); - } - -} - -Variant CollisionShapeBox::_get(const String& p_name) const { - - if (p_name=="half_extents") { - return half_extents; - } - - return Variant(); -} - -void CollisionShapeBox::_get_property_list( List<PropertyInfo> *p_list) const { - - p_list->push_back( PropertyInfo(Variant::VECTOR3,"half_extents" ) ); -} - - -void CollisionShapeBox::update_indicator(RID p_indicator) { - - VisualServer *vs=VisualServer::get_singleton(); - - vs->poly_clear(p_indicator); - Color col(0.4,1.0,1.0,0.5); - - - for (int i=0;i<6;i++) { - - - Vector3 face_points[4]; - - for (int j=0;j<4;j++) { - - float v[3]; - v[0]=1.0; - v[1]=1-2*((j>>1)&1); - v[2]=v[1]*(1-2*(j&1)); - - for (int k=0;k<3;k++) { - - if (i<3) - face_points[j][(i+k)%3]=v[k]*(i>=3?-1:1); - else - face_points[3-j][(i+k)%3]=v[k]*(i>=3?-1:1); - } - } - - for(int j=0;j<4;j++) - face_points[i]*=half_extents; - - ADD_TRIANGLE(face_points[0],face_points[1],face_points[2],col); - ADD_TRIANGLE(face_points[2],face_points[3],face_points[0],col); - - } -} - -void CollisionShapeBox::append_to_volume(Ref<Shape> p_volume) { - - p_volume->add_box_shape(half_extents,get_transform()); -} - - -CollisionShapeBox::CollisionShapeBox() { - - half_extents=Vector3(1,1,1); -} - -/* CYLINDER */ - - -void CollisionShapeCylinder::_set(const String& p_name, const Variant& p_value) { - - if (p_name=="radius") { - radius=p_value; - volume_changed(); - } - if (p_name=="height") { - height=p_value; - volume_changed(); - } - -} - -Variant CollisionShapeCylinder::_get(const String& p_name) const { - - if (p_name=="radius") { - return radius; - } - if (p_name=="height") { - return height; - } - return Variant(); -} - -void CollisionShapeCylinder::_get_property_list( List<PropertyInfo> *p_list) const { - - p_list->push_back( PropertyInfo(Variant::REAL,"radius",PROPERTY_HINT_RANGE,"0.01,16384,0.01") ); - p_list->push_back( PropertyInfo(Variant::REAL,"height",PROPERTY_HINT_RANGE,"0.01,16384,0.01") ); -} - - -void CollisionShapeCylinder::update_indicator(RID p_indicator) { - - VisualServer *vs=VisualServer::get_singleton(); - - vs->poly_clear(p_indicator); - Color col(0.4,1.0,1.0,0.5); - - PoolVector<Plane> planes = Geometry::build_cylinder_planes(radius, height, 12, Vector3::AXIS_Z); - Geometry::MeshData md = Geometry::build_convex_mesh(planes); - - for(int i=0;i<md.faces.size();i++) { - - for(int j=2;j<md.faces[i].indices.size();j++) { - ADD_TRIANGLE(md.vertices[md.faces[i].indices[0]],md.vertices[md.faces[i].indices[j-1]],md.vertices[md.faces[i].indices[j]],col); - } - } - -} - -void CollisionShapeCylinder::append_to_volume(Ref<Shape> p_volume) { - - p_volume->add_cylinder_shape(radius,height*2.0,get_transform()); -} - - -CollisionShapeCylinder::CollisionShapeCylinder() { - - height=1; - radius=1; -} - -/* CAPSULE */ - - -void CollisionShapeCapsule::_set(const String& p_name, const Variant& p_value) { - - if (p_name=="radius") { - radius=p_value; - volume_changed(); - } - - if (p_name=="height") { - height=p_value; - volume_changed(); - } - -} - -Variant CollisionShapeCapsule::_get(const String& p_name) const { - - if (p_name=="radius") { - return radius; - } - if (p_name=="height") { - return height; - } - return Variant(); -} - -void CollisionShapeCapsule::_get_property_list( List<PropertyInfo> *p_list) const { - - p_list->push_back( PropertyInfo(Variant::REAL,"radius",PROPERTY_HINT_RANGE,"0.01,16384,0.01") ); - p_list->push_back( PropertyInfo(Variant::REAL,"height",PROPERTY_HINT_RANGE,"0.01,16384,0.01") ); -} - - -void CollisionShapeCapsule::update_indicator(RID p_indicator) { - - VisualServer *vs=VisualServer::get_singleton(); - - vs->poly_clear(p_indicator); - Color col(0.4,1.0,1.0,0.5); - - PoolVector<Plane> planes = Geometry::build_capsule_planes(radius, height, 12, 3, Vector3::AXIS_Z); - Geometry::MeshData md = Geometry::build_convex_mesh(planes); - - for(int i=0;i<md.faces.size();i++) { - - for(int j=2;j<md.faces[i].indices.size();j++) { - ADD_TRIANGLE(md.vertices[md.faces[i].indices[0]],md.vertices[md.faces[i].indices[j-1]],md.vertices[md.faces[i].indices[j]],col); - } - } - -} - -void CollisionShapeCapsule::append_to_volume(Ref<Shape> p_volume) { - - - p_volume->add_capsule_shape(radius,height,get_transform()); -} - - -CollisionShapeCapsule::CollisionShapeCapsule() { - - height=1; - radius=1; -} -#endif diff --git a/scene/3d/camera.cpp b/scene/3d/camera.cpp index 0f4378acdd..697d91c863 100644 --- a/scene/3d/camera.cpp +++ b/scene/3d/camera.cpp @@ -94,6 +94,8 @@ bool Camera::_set(const StringName &p_name, const Variant &p_value) { set_cull_mask(p_value); } else if (p_name == "environment") { set_environment(p_value); + } else if (p_name == "doppler/tracking") { + set_doppler_tracking(DopplerTracking(int(p_value))); } else return false; @@ -131,6 +133,8 @@ bool Camera::_get(const StringName &p_name, Variant &r_ret) const { r_ret = get_v_offset(); } else if (p_name == "environment") { r_ret = get_environment(); + } else if (p_name == "doppler/tracking") { + r_ret = get_doppler_tracking(); } else return false; @@ -171,6 +175,7 @@ void Camera::_get_property_list(List<PropertyInfo> *p_list) const { p_list->push_back(PropertyInfo(Variant::OBJECT, "environment", PROPERTY_HINT_RESOURCE_TYPE, "Environment")); p_list->push_back(PropertyInfo(Variant::REAL, "h_offset")); p_list->push_back(PropertyInfo(Variant::REAL, "v_offset")); + p_list->push_back(PropertyInfo(Variant::INT, "doppler/tracking", PROPERTY_HINT_ENUM, "Disabled,Idle,Fixed")); } void Camera::_update_camera() { @@ -209,6 +214,9 @@ void Camera::_notification(int p_what) { case NOTIFICATION_TRANSFORM_CHANGED: { _request_camera_update(); + if (doppler_tracking != DOPPLER_TRACKING_DISABLED) { + velocity_tracker->update_position(get_global_transform().origin); + } } break; case NOTIFICATION_EXIT_WORLD: { @@ -507,6 +515,22 @@ Camera::KeepAspect Camera::get_keep_aspect_mode() const { return keep_aspect; } +void Camera::set_doppler_tracking(DopplerTracking p_tracking) { + + if (doppler_tracking == p_tracking) + return; + + doppler_tracking = p_tracking; + if (p_tracking != DOPPLER_TRACKING_DISABLED) { + velocity_tracker->set_track_fixed_step(doppler_tracking == DOPPLER_TRACKING_FIXED_STEP); + velocity_tracker->reset(get_global_transform().origin); + } +} + +Camera::DopplerTracking Camera::get_doppler_tracking() const { + return doppler_tracking; +} + void Camera::_bind_methods() { ClassDB::bind_method(D_METHOD("project_ray_normal", "screen_point"), &Camera::project_ray_normal); @@ -536,6 +560,8 @@ void Camera::_bind_methods() { ClassDB::bind_method(D_METHOD("get_environment:Environment"), &Camera::get_environment); ClassDB::bind_method(D_METHOD("set_keep_aspect_mode", "mode"), &Camera::set_keep_aspect_mode); ClassDB::bind_method(D_METHOD("get_keep_aspect_mode"), &Camera::get_keep_aspect_mode); + ClassDB::bind_method(D_METHOD("set_doppler_tracking", "mode"), &Camera::set_doppler_tracking); + ClassDB::bind_method(D_METHOD("get_doppler_tracking"), &Camera::get_doppler_tracking); //ClassDB::bind_method(D_METHOD("_camera_make_current"),&Camera::_camera_make_current ); BIND_CONSTANT(PROJECTION_PERSPECTIVE); @@ -543,6 +569,10 @@ void Camera::_bind_methods() { BIND_CONSTANT(KEEP_WIDTH); BIND_CONSTANT(KEEP_HEIGHT); + + BIND_CONSTANT(DOPPLER_TRACKING_DISABLED) + BIND_CONSTANT(DOPPLER_TRACKING_IDLE_STEP) + BIND_CONSTANT(DOPPLER_TRACKING_FIXED_STEP) } float Camera::get_fov() const { @@ -616,6 +646,14 @@ float Camera::get_h_offset() const { return h_offset; } +Vector3 Camera::get_doppler_tracked_velocity() const { + + if (doppler_tracking != DOPPLER_TRACKING_DISABLED) { + return velocity_tracker->get_tracked_linear_velocity(); + } else { + return Vector3(); + } +} Camera::Camera() { camera = VisualServer::get_singleton()->camera_create(); @@ -633,6 +671,8 @@ Camera::Camera() { h_offset = 0; VisualServer::get_singleton()->camera_set_cull_mask(camera, layers); //active=false; + velocity_tracker.instance(); + doppler_tracking = DOPPLER_TRACKING_DISABLED; set_notify_transform(true); } diff --git a/scene/3d/camera.h b/scene/3d/camera.h index 472cfaa008..43975892b4 100644 --- a/scene/3d/camera.h +++ b/scene/3d/camera.h @@ -31,6 +31,7 @@ #define CAMERA_H #include "scene/3d/spatial.h" +#include "scene/3d/spatial_velocity_tracker.h" #include "scene/main/viewport.h" #include "scene/resources/environment.h" /** @@ -52,6 +53,12 @@ public: KEEP_HEIGHT }; + enum DopplerTracking { + DOPPLER_TRACKING_DISABLED, + DOPPLER_TRACKING_IDLE_STEP, + DOPPLER_TRACKING_FIXED_STEP + }; + private: bool force_change; bool current; @@ -80,6 +87,9 @@ private: friend class Viewport; void _update_audio_listener_state(); + DopplerTracking doppler_tracking; + Ref<SpatialVelocityTracker> velocity_tracker; + protected: void _update_camera(); virtual void _request_camera_update(); @@ -140,11 +150,17 @@ public: void set_h_offset(float p_offset); float get_h_offset() const; + void set_doppler_tracking(DopplerTracking p_tracking); + DopplerTracking get_doppler_tracking() const; + + Vector3 get_doppler_tracked_velocity() const; + Camera(); ~Camera(); }; VARIANT_ENUM_CAST(Camera::Projection); VARIANT_ENUM_CAST(Camera::KeepAspect); +VARIANT_ENUM_CAST(Camera::DopplerTracking); #endif diff --git a/scene/3d/collision_object.cpp b/scene/3d/collision_object.cpp index 1b27313d3b..874e5f01ea 100644 --- a/scene/3d/collision_object.cpp +++ b/scene/3d/collision_object.cpp @@ -30,17 +30,6 @@ #include "collision_object.h" #include "scene/scene_string_names.h" #include "servers/physics_server.h" -void CollisionObject::_update_shapes_from_children() { - - shapes.clear(); - for (int i = 0; i < get_child_count(); i++) { - - Node *n = get_child(i); - n->call("_add_to_collision_object", this); - } - - _update_shapes(); -} void CollisionObject::_notification(int p_what) { @@ -87,91 +76,6 @@ void CollisionObject::_notification(int p_what) { } } -void CollisionObject::_update_shapes() { - - if (!rid.is_valid()) - return; - - if (area) - PhysicsServer::get_singleton()->area_clear_shapes(rid); - else - PhysicsServer::get_singleton()->body_clear_shapes(rid); - - for (int i = 0; i < shapes.size(); i++) { - - if (shapes[i].shape.is_null()) - continue; - if (area) - PhysicsServer::get_singleton()->area_add_shape(rid, shapes[i].shape->get_rid(), shapes[i].xform); - else { - PhysicsServer::get_singleton()->body_add_shape(rid, shapes[i].shape->get_rid(), shapes[i].xform); - if (shapes[i].trigger) - PhysicsServer::get_singleton()->body_set_shape_as_trigger(rid, i, shapes[i].trigger); - } - } -} - -bool CollisionObject::_set(const StringName &p_name, const Variant &p_value) { - String name = p_name; - - if (name == "shape_count") { - - shapes.resize(p_value); - _update_shapes(); - _change_notify(); - - } else if (name.begins_with("shapes/")) { - - int idx = name.get_slicec('/', 1).to_int(); - String what = name.get_slicec('/', 2); - if (what == "shape") - set_shape(idx, RefPtr(p_value)); - else if (what == "transform") - set_shape_transform(idx, p_value); - else if (what == "trigger") - set_shape_as_trigger(idx, p_value); - - } else - return false; - - return true; -} - -bool CollisionObject::_get(const StringName &p_name, Variant &r_ret) const { - - String name = p_name; - - if (name == "shape_count") { - r_ret = shapes.size(); - } else if (name.begins_with("shapes/")) { - - int idx = name.get_slicec('/', 1).to_int(); - String what = name.get_slicec('/', 2); - if (what == "shape") - r_ret = get_shape(idx); - else if (what == "transform") - r_ret = get_shape_transform(idx); - else if (what == "trigger") - r_ret = is_shape_set_as_trigger(idx); - - } else - return false; - - return true; -} - -void CollisionObject::_get_property_list(List<PropertyInfo> *p_list) const { - - p_list->push_back(PropertyInfo(Variant::INT, "shape_count", PROPERTY_HINT_RANGE, "0,256,1", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_NO_INSTANCE_STATE)); - - for (int i = 0; i < shapes.size(); i++) { - String path = "shapes/" + itos(i) + "/"; - p_list->push_back(PropertyInfo(Variant::OBJECT, path + "shape", PROPERTY_HINT_RESOURCE_TYPE, "Shape", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_NO_INSTANCE_STATE)); - p_list->push_back(PropertyInfo(Variant::TRANSFORM, path + "transform", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_NO_INSTANCE_STATE)); - p_list->push_back(PropertyInfo(Variant::BOOL, path + "trigger", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_NO_INSTANCE_STATE)); - } -} - void CollisionObject::_input_event(Node *p_camera, const Ref<InputEvent> &p_input_event, const Vector3 &p_pos, const Vector3 &p_normal, int p_shape) { if (get_script_instance()) { @@ -219,17 +123,6 @@ bool CollisionObject::is_ray_pickable() const { void CollisionObject::_bind_methods() { - ClassDB::bind_method(D_METHOD("add_shape", "shape:Shape", "transform"), &CollisionObject::add_shape, DEFVAL(Transform())); - ClassDB::bind_method(D_METHOD("get_shape_count"), &CollisionObject::get_shape_count); - ClassDB::bind_method(D_METHOD("set_shape", "shape_idx", "shape:Shape"), &CollisionObject::set_shape); - ClassDB::bind_method(D_METHOD("set_shape_transform", "shape_idx", "transform"), &CollisionObject::set_shape_transform); - // ClassDB::bind_method(D_METHOD("set_shape_transform","shape_idx","transform"),&CollisionObject::set_shape_transform); - ClassDB::bind_method(D_METHOD("set_shape_as_trigger", "shape_idx", "enable"), &CollisionObject::set_shape_as_trigger); - ClassDB::bind_method(D_METHOD("is_shape_set_as_trigger", "shape_idx"), &CollisionObject::is_shape_set_as_trigger); - ClassDB::bind_method(D_METHOD("get_shape:Shape", "shape_idx"), &CollisionObject::get_shape); - ClassDB::bind_method(D_METHOD("get_shape_transform", "shape_idx"), &CollisionObject::get_shape_transform); - ClassDB::bind_method(D_METHOD("remove_shape", "shape_idx"), &CollisionObject::remove_shape); - ClassDB::bind_method(D_METHOD("clear_shapes"), &CollisionObject::clear_shapes); ClassDB::bind_method(D_METHOD("set_ray_pickable", "ray_pickable"), &CollisionObject::set_ray_pickable); ClassDB::bind_method(D_METHOD("is_ray_pickable"), &CollisionObject::is_ray_pickable); ClassDB::bind_method(D_METHOD("set_capture_input_on_drag", "enable"), &CollisionObject::set_capture_input_on_drag); @@ -245,72 +138,176 @@ void CollisionObject::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::BOOL, "input_capture_on_drag"), "set_capture_input_on_drag", "get_capture_input_on_drag"); } -void CollisionObject::add_shape(const Ref<Shape> &p_shape, const Transform &p_transform) { +uint32_t CollisionObject::create_shape_owner(Object *p_owner) { + + ShapeData sd; + uint32_t id; + + if (shapes.size() == 0) { + id = 1; + } else { + id = shapes.back()->key() + 1; + } + + sd.owner = p_owner; + + shapes[id] = sd; - ShapeData sdata; - sdata.shape = p_shape; - sdata.xform = p_transform; - shapes.push_back(sdata); - _update_shapes(); + return id; } -int CollisionObject::get_shape_count() const { - return shapes.size(); +void CollisionObject::remove_shape_owner(uint32_t owner) { + + ERR_FAIL_COND(!shapes.has(owner)); + + shape_owner_clear_shapes(owner); + + shapes.erase(owner); } -void CollisionObject::set_shape(int p_shape_idx, const Ref<Shape> &p_shape) { - ERR_FAIL_INDEX(p_shape_idx, shapes.size()); - shapes[p_shape_idx].shape = p_shape; - _update_shapes(); +void CollisionObject::shape_owner_set_disabled(uint32_t p_owner, bool p_disabled) { + ERR_FAIL_COND(!shapes.has(p_owner)); + + ShapeData &sd = shapes[p_owner]; + sd.disabled = p_disabled; + for (int i = 0; i < sd.shapes.size(); i++) { + if (area) { + PhysicsServer::get_singleton()->area_set_shape_disabled(rid, sd.shapes[i].index, p_disabled); + } else { + PhysicsServer::get_singleton()->body_set_shape_disabled(rid, sd.shapes[i].index, p_disabled); + } + } } -void CollisionObject::set_shape_transform(int p_shape_idx, const Transform &p_transform) { +bool CollisionObject::is_shape_owner_disabled(uint32_t p_owner) const { - ERR_FAIL_INDEX(p_shape_idx, shapes.size()); - shapes[p_shape_idx].xform = p_transform; + ERR_FAIL_COND_V(!shapes.has(p_owner), false); - _update_shapes(); + return shapes[p_owner].disabled; } -Ref<Shape> CollisionObject::get_shape(int p_shape_idx) const { +void CollisionObject::get_shape_owners(List<uint32_t> *r_owners) { - ERR_FAIL_INDEX_V(p_shape_idx, shapes.size(), Ref<Shape>()); - return shapes[p_shape_idx].shape; + for (Map<uint32_t, ShapeData>::Element *E = shapes.front(); E; E = E->next()) { + r_owners->push_back(E->key()); + } } -Transform CollisionObject::get_shape_transform(int p_shape_idx) const { - ERR_FAIL_INDEX_V(p_shape_idx, shapes.size(), Transform()); - return shapes[p_shape_idx].xform; +void CollisionObject::shape_owner_set_transform(uint32_t p_owner, const Transform &p_transform) { + + ERR_FAIL_COND(!shapes.has(p_owner)); + + ShapeData &sd = shapes[p_owner]; + sd.xform = p_transform; + for (int i = 0; i < sd.shapes.size(); i++) { + if (area) { + PhysicsServer::get_singleton()->area_set_shape_transform(rid, sd.shapes[i].index, p_transform); + } else { + PhysicsServer::get_singleton()->body_set_shape_transform(rid, sd.shapes[i].index, p_transform); + } + } } -void CollisionObject::remove_shape(int p_shape_idx) { +Transform CollisionObject::shape_owner_get_transform(uint32_t p_owner) const { - ERR_FAIL_INDEX(p_shape_idx, shapes.size()); - shapes.remove(p_shape_idx); + ERR_FAIL_COND_V(!shapes.has(p_owner), Transform()); - _update_shapes(); + return shapes[p_owner].xform; } -void CollisionObject::clear_shapes() { +Object *CollisionObject::shape_owner_get_owner(uint32_t p_owner) const { - shapes.clear(); + ERR_FAIL_COND_V(!shapes.has(p_owner), NULL); - _update_shapes(); + return shapes[p_owner].owner; } -void CollisionObject::set_shape_as_trigger(int p_shape_idx, bool p_trigger) { +void CollisionObject::shape_owner_add_shape(uint32_t p_owner, const Ref<Shape> &p_shape) { - ERR_FAIL_INDEX(p_shape_idx, shapes.size()); - shapes[p_shape_idx].trigger = p_trigger; - if (!area && rid.is_valid()) { + ERR_FAIL_COND(!shapes.has(p_owner)); + ERR_FAIL_COND(p_shape.is_null()); - PhysicsServer::get_singleton()->body_set_shape_as_trigger(rid, p_shape_idx, p_trigger); + ShapeData &sd = shapes[p_owner]; + ShapeData::ShapeBase s; + s.index = total_subshapes; + s.shape = p_shape; + if (area) { + PhysicsServer::get_singleton()->area_add_shape(rid, p_shape->get_rid(), sd.xform); + } else { + PhysicsServer::get_singleton()->body_add_shape(rid, p_shape->get_rid(), sd.xform); } + sd.shapes.push_back(s); + + total_subshapes++; } +int CollisionObject::shape_owner_get_shape_count(uint32_t p_owner) const { -bool CollisionObject::is_shape_set_as_trigger(int p_shape_idx) const { + ERR_FAIL_COND_V(!shapes.has(p_owner), 0); - ERR_FAIL_INDEX_V(p_shape_idx, shapes.size(), false); - return shapes[p_shape_idx].trigger; + return shapes[p_owner].shapes.size(); +} +Ref<Shape> CollisionObject::shape_owner_get_shape(uint32_t p_owner, int p_shape) const { + + ERR_FAIL_COND_V(!shapes.has(p_owner), Ref<Shape>()); + ERR_FAIL_INDEX_V(p_shape, shapes[p_owner].shapes.size(), Ref<Shape>()); + + return shapes[p_owner].shapes[p_shape].shape; +} +int CollisionObject::shape_owner_get_shape_index(uint32_t p_owner, int p_shape) const { + + ERR_FAIL_COND_V(!shapes.has(p_owner), -1); + ERR_FAIL_INDEX_V(p_shape, shapes[p_owner].shapes.size(), -1); + + return shapes[p_owner].shapes[p_shape].index; +} + +void CollisionObject::shape_owner_remove_shape(uint32_t p_owner, int p_shape) { + + ERR_FAIL_COND(!shapes.has(p_owner)); + ERR_FAIL_INDEX(p_shape, shapes[p_owner].shapes.size()); + + int index_to_remove = shapes[p_owner].shapes[p_shape].index; + if (area) { + PhysicsServer::get_singleton()->area_remove_shape(rid, index_to_remove); + } else { + PhysicsServer::get_singleton()->body_remove_shape(rid, index_to_remove); + } + + shapes[p_owner].shapes.remove(p_shape); + + for (Map<uint32_t, ShapeData>::Element *E = shapes.front(); E; E = E->next()) { + for (int i = 0; i < E->get().shapes.size(); i++) { + if (E->get().shapes[i].index > index_to_remove) { + E->get().shapes[i].index -= 1; + } + } + } + + total_subshapes--; +} + +void CollisionObject::shape_owner_clear_shapes(uint32_t p_owner) { + + ERR_FAIL_COND(!shapes.has(p_owner)); + + while (shape_owner_get_shape_count(p_owner) > 0) { + shape_owner_remove_shape(p_owner, 0); + } +} + +uint32_t CollisionObject::shape_find_owner(int p_shape_index) const { + + ERR_FAIL_INDEX_V(p_shape_index, total_subshapes, 0); + + for (const Map<uint32_t, ShapeData>::Element *E = shapes.front(); E; E = E->next()) { + for (int i = 0; i < E->get().shapes.size(); i++) { + if (E->get().shapes[i].index == p_shape_index) { + return E->key(); + } + } + } + + //in theory it should be unreachable + return 0; } CollisionObject::CollisionObject(RID p_rid, bool p_area) { @@ -320,6 +317,8 @@ CollisionObject::CollisionObject(RID p_rid, bool p_area) { capture_input_on_drag = false; ray_pickable = true; set_notify_transform(true); + total_subshapes = 0; + if (p_area) { PhysicsServer::get_singleton()->area_attach_object_instance_ID(rid, get_instance_ID()); } else { diff --git a/scene/3d/collision_object.h b/scene/3d/collision_object.h index 3822fb0d5a..fac05b6e8c 100644 --- a/scene/3d/collision_object.h +++ b/scene/3d/collision_object.h @@ -41,33 +41,36 @@ class CollisionObject : public Spatial { RID rid; struct ShapeData { + + Object *owner; Transform xform; - Ref<Shape> shape; - bool trigger; + struct ShapeBase { + Ref<Shape> shape; + int index; + }; + + Vector<ShapeBase> shapes; + bool disabled; ShapeData() { - trigger = false; + disabled = false; + owner = NULL; } }; + int total_subshapes; + + Map<uint32_t, ShapeData> shapes; + bool capture_input_on_drag; bool ray_pickable; - Vector<ShapeData> shapes; void _update_pickable(); - void _update_shapes(); - - friend class CollisionShape; - friend class CollisionPolygon; - void _update_shapes_from_children(); protected: CollisionObject(RID p_rid, bool p_area); void _notification(int p_what); - bool _set(const StringName &p_name, const Variant &p_value); - bool _get(const StringName &p_name, Variant &r_ret) const; - void _get_property_list(List<PropertyInfo> *p_list) const; static void _bind_methods(); friend class Viewport; virtual void _input_event(Node *p_camera, const Ref<InputEvent> &p_input_event, const Vector3 &p_pos, const Vector3 &p_normal, int p_shape); @@ -75,16 +78,26 @@ protected: virtual void _mouse_exit(); public: - void add_shape(const Ref<Shape> &p_shape, const Transform &p_transform = Transform()); - int get_shape_count() const; - void set_shape(int p_shape_idx, const Ref<Shape> &p_shape); - void set_shape_transform(int p_shape_idx, const Transform &p_transform); - Ref<Shape> get_shape(int p_shape_idx) const; - Transform get_shape_transform(int p_shape_idx) const; - void remove_shape(int p_shape_idx); - void clear_shapes(); - void set_shape_as_trigger(int p_shape_idx, bool p_trigger); - bool is_shape_set_as_trigger(int p_shape_idx) const; + uint32_t create_shape_owner(Object *p_owner); + void remove_shape_owner(uint32_t owner); + void get_shape_owners(List<uint32_t> *r_owners); + + void shape_owner_set_transform(uint32_t p_owner, const Transform &p_transform); + Transform shape_owner_get_transform(uint32_t p_owner) const; + Object *shape_owner_get_owner(uint32_t p_owner) const; + + void shape_owner_set_disabled(uint32_t p_owner, bool p_disabled); + bool is_shape_owner_disabled(uint32_t p_owner) const; + + void shape_owner_add_shape(uint32_t p_owner, const Ref<Shape> &p_shape); + int shape_owner_get_shape_count(uint32_t p_owner) const; + Ref<Shape> shape_owner_get_shape(uint32_t p_owner, int p_shape) const; + int shape_owner_get_shape_index(uint32_t p_owner, int p_shape) const; + + void shape_owner_remove_shape(uint32_t p_owner, int p_shape); + void shape_owner_clear_shapes(uint32_t p_owner); + + uint32_t shape_find_owner(int p_shape_index) const; void set_ray_pickable(bool p_ray_pickable); bool is_ray_pickable() const; diff --git a/scene/3d/collision_polygon.cpp b/scene/3d/collision_polygon.cpp index d9321f7134..0c61c96d07 100644 --- a/scene/3d/collision_polygon.cpp +++ b/scene/3d/collision_polygon.cpp @@ -33,186 +33,82 @@ #include "scene/resources/concave_polygon_shape.h" #include "scene/resources/convex_polygon_shape.h" -void CollisionPolygon::_add_to_collision_object(Object *p_obj) { +void CollisionPolygon::_build_polygon() { - if (!can_update_body) + if (!parent) return; - CollisionObject *co = p_obj->cast_to<CollisionObject>(); - ERR_FAIL_COND(!co); + parent->shape_owner_clear_shapes(owner_id); if (polygon.size() == 0) return; - bool solids = build_mode == BUILD_SOLIDS; - Vector<Vector<Vector2> > decomp = Geometry::decompose_polygon(polygon); if (decomp.size() == 0) return; - if (true || solids) { - - //here comes the sun, lalalala - //decompose concave into multiple convex polygons and add them - shape_from = co->get_shape_count(); - for (int i = 0; i < decomp.size(); i++) { - Ref<ConvexPolygonShape> convex = memnew(ConvexPolygonShape); - PoolVector<Vector3> cp; - int cs = decomp[i].size(); - cp.resize(cs * 2); - { - PoolVector<Vector3>::Write w = cp.write(); - int idx = 0; - for (int j = 0; j < cs; j++) { - - Vector2 d = decomp[i][j]; - w[idx++] = Vector3(d.x, d.y, depth * 0.5); - w[idx++] = Vector3(d.x, d.y, -depth * 0.5); - } + //here comes the sun, lalalala + //decompose concave into multiple convex polygons and add them + + for (int i = 0; i < decomp.size(); i++) { + Ref<ConvexPolygonShape> convex = memnew(ConvexPolygonShape); + PoolVector<Vector3> cp; + int cs = decomp[i].size(); + cp.resize(cs * 2); + { + PoolVector<Vector3>::Write w = cp.write(); + int idx = 0; + for (int j = 0; j < cs; j++) { + + Vector2 d = decomp[i][j]; + w[idx++] = Vector3(d.x, d.y, depth * 0.5); + w[idx++] = Vector3(d.x, d.y, -depth * 0.5); } - - convex->set_points(cp); - co->add_shape(convex, get_transform()); - } - shape_to = co->get_shape_count() - 1; - if (shape_to < shape_from) { - shape_from = -1; - shape_to = -1; - } - - } else { -#if 0 - Ref<ConcavePolygonShape> concave = memnew( ConcavePolygonShape ); - - PoolVector<Vector2> segments; - segments.resize(polygon.size()*2); - PoolVector<Vector2>::Write w=segments.write(); - - for(int i=0;i<polygon.size();i++) { - w[(i<<1)+0]=polygon[i]; - w[(i<<1)+1]=polygon[(i+1)%polygon.size()]; } - w=PoolVector<Vector2>::Write(); - concave->set_segments(segments); - - co->add_shape(concave,get_transform()); -#endif + convex->set_points(cp); + parent->shape_owner_add_shape(owner_id, convex); + parent->shape_owner_set_disabled(owner_id, disabled); } - - //co->add_shape(shape,get_transform()); -} - -void CollisionPolygon::_update_parent() { - - if (!can_update_body) - return; - - Node *parent = get_parent(); - if (!parent) - return; - CollisionObject *co = parent->cast_to<CollisionObject>(); - if (!co) - return; - co->_update_shapes_from_children(); -} - -void CollisionPolygon::_set_shape_range(const Vector2 &p_range) { - - shape_from = p_range.x; - shape_to = p_range.y; -} - -Vector2 CollisionPolygon::_get_shape_range() const { - - return Vector2(shape_from, shape_to); } void CollisionPolygon::_notification(int p_what) { switch (p_what) { - case NOTIFICATION_ENTER_TREE: { - can_update_body = get_tree()->is_editor_hint(); - set_notify_local_transform(!can_update_body); - //indicator_instance = VisualServer::get_singleton()->instance_create2(indicator,get_world()->get_scenario()); - } break; - case NOTIFICATION_EXIT_TREE: { - can_update_body = false; - set_notify_local_transform(false); - } break; - case NOTIFICATION_TRANSFORM_CHANGED: { - - if (!is_inside_tree()) - break; - if (can_update_body) { - _update_parent(); + case NOTIFICATION_PARENTED: { + parent = get_parent()->cast_to<CollisionObject>(); + if (parent) { + owner_id = parent->create_shape_owner(this); + _build_polygon(); + parent->shape_owner_set_transform(owner_id, get_transform()); + parent->shape_owner_set_disabled(owner_id, disabled); } - } break; case NOTIFICATION_LOCAL_TRANSFORM_CHANGED: { - if (!can_update_body && shape_from >= 0 && shape_to >= 0) { - - CollisionObject *co = get_parent()->cast_to<CollisionObject>(); - if (co) { - for (int i = shape_from; i <= shape_to; i++) { - co->set_shape_transform(i, get_transform()); - } - } - } - } break; -#if 0 - case NOTIFICATION_DRAW: { - for(int i=0;i<polygon.size();i++) { - - Vector2 p = polygon[i]; - Vector2 n = polygon[(i+1)%polygon.size()]; - draw_line(p,n,Color(0,0.6,0.7,0.5),3); + if (parent) { + parent->shape_owner_set_transform(owner_id, get_transform()); } - Vector< Vector<Vector2> > decomp = Geometry::decompose_polygon(polygon); -#define DEBUG_DECOMPOSE -#ifdef DEBUG_DECOMPOSE - Color c(0.4,0.9,0.1); - for(int i=0;i<decomp.size();i++) { - - c.set_hsv( Math::fmod(c.get_h() + 0.738,1),c.get_s(),c.get_v(),0.5); - draw_colored_polygon(decomp[i],c); + } break; + case NOTIFICATION_UNPARENTED: { + if (parent) { + parent->remove_shape_owner(owner_id); } -#endif - + owner_id = 0; + parent = NULL; } break; -#endif } } void CollisionPolygon::set_polygon(const Vector<Point2> &p_polygon) { polygon = p_polygon; - if (can_update_body) { - - for (int i = 0; i < polygon.size(); i++) { - - Vector3 p1(polygon[i].x, polygon[i].y, depth * 0.5); - - if (i == 0) - aabb = Rect3(p1, Vector3()); - else - aabb.expand_to(p1); - - Vector3 p2(polygon[i].x, polygon[i].y, -depth * 0.5); - aabb.expand_to(p2); - } - if (aabb == Rect3()) { - - aabb = Rect3(Vector3(-1, -1, -1), Vector3(2, 2, 2)); - } else { - aabb.position -= aabb.size * 0.3; - aabb.size += aabb.size * 0.6; - } - _update_parent(); + if (parent) { + _build_polygon(); } + update_configuration_warning(); update_gizmo(); } @@ -221,20 +117,6 @@ Vector<Point2> CollisionPolygon::get_polygon() const { return polygon; } -void CollisionPolygon::set_build_mode(BuildMode p_mode) { - - ERR_FAIL_INDEX(p_mode, 2); - build_mode = p_mode; - if (!can_update_body) - return; - _update_parent(); -} - -CollisionPolygon::BuildMode CollisionPolygon::get_build_mode() const { - - return build_mode; -} - Rect3 CollisionPolygon::get_item_rect() const { return aabb; @@ -243,9 +125,7 @@ Rect3 CollisionPolygon::get_item_rect() const { void CollisionPolygon::set_depth(float p_depth) { depth = p_depth; - if (!can_update_body) - return; - _update_parent(); + _build_polygon(); update_gizmo(); } @@ -254,6 +134,17 @@ float CollisionPolygon::get_depth() const { return depth; } +void CollisionPolygon::set_disabled(bool p_disabled) { + disabled = p_disabled; + if (parent) { + parent->shape_owner_set_disabled(owner_id, p_disabled); + } +} + +bool CollisionPolygon::is_disabled() const { + return disabled; +} + String CollisionPolygon::get_configuration_warning() const { if (!get_parent()->cast_to<CollisionObject>()) { @@ -269,36 +160,26 @@ String CollisionPolygon::get_configuration_warning() const { void CollisionPolygon::_bind_methods() { - ClassDB::bind_method(D_METHOD("_add_to_collision_object"), &CollisionPolygon::_add_to_collision_object); - - ClassDB::bind_method(D_METHOD("set_build_mode", "build_mode"), &CollisionPolygon::set_build_mode); - ClassDB::bind_method(D_METHOD("get_build_mode"), &CollisionPolygon::get_build_mode); - ClassDB::bind_method(D_METHOD("set_depth", "depth"), &CollisionPolygon::set_depth); ClassDB::bind_method(D_METHOD("get_depth"), &CollisionPolygon::get_depth); ClassDB::bind_method(D_METHOD("set_polygon", "polygon"), &CollisionPolygon::set_polygon); ClassDB::bind_method(D_METHOD("get_polygon"), &CollisionPolygon::get_polygon); - ClassDB::bind_method(D_METHOD("_set_shape_range", "shape_range"), &CollisionPolygon::_set_shape_range); - ClassDB::bind_method(D_METHOD("_get_shape_range"), &CollisionPolygon::_get_shape_range); - - ClassDB::bind_method(D_METHOD("get_collision_object_first_shape"), &CollisionPolygon::get_collision_object_first_shape); - ClassDB::bind_method(D_METHOD("get_collision_object_last_shape"), &CollisionPolygon::get_collision_object_last_shape); + ClassDB::bind_method(D_METHOD("set_disabled", "disabled"), &CollisionPolygon::set_disabled); + ClassDB::bind_method(D_METHOD("is_disabled"), &CollisionPolygon::is_disabled); - ADD_PROPERTY(PropertyInfo(Variant::INT, "build_mode", PROPERTY_HINT_ENUM, "Solids,Triangles"), "set_build_mode", "get_build_mode"); ADD_PROPERTY(PropertyInfo(Variant::REAL, "depth"), "set_depth", "get_depth"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "disabled"), "set_disabled", "is_disabled"); ADD_PROPERTY(PropertyInfo(Variant::POOL_VECTOR2_ARRAY, "polygon"), "set_polygon", "get_polygon"); - ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "shape_range", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "_set_shape_range", "_get_shape_range"); } CollisionPolygon::CollisionPolygon() { - shape_from = -1; - shape_to = -1; - can_update_body = false; - aabb = Rect3(Vector3(-1, -1, -1), Vector3(2, 2, 2)); - build_mode = BUILD_SOLIDS; depth = 1.0; + set_notify_local_transform(true); + parent = NULL; + owner_id = 0; + disabled = false; } diff --git a/scene/3d/collision_polygon.h b/scene/3d/collision_polygon.h index d45b4738ae..beefae182c 100644 --- a/scene/3d/collision_polygon.h +++ b/scene/3d/collision_polygon.h @@ -33,55 +33,42 @@ #include "scene/3d/spatial.h" #include "scene/resources/shape.h" +class CollisionObject; class CollisionPolygon : public Spatial { GDCLASS(CollisionPolygon, Spatial); -public: - enum BuildMode { - BUILD_SOLIDS, - BUILD_TRIANGLES, - }; - protected: float depth; Rect3 aabb; - BuildMode build_mode; Vector<Point2> polygon; - void _add_to_collision_object(Object *p_obj); - void _update_parent(); + uint32_t owner_id; + CollisionObject *parent; - bool can_update_body; - int shape_from; - int shape_to; + bool disabled; - void _set_shape_range(const Vector2 &p_range); - Vector2 _get_shape_range() const; + void _build_polygon(); protected: void _notification(int p_what); static void _bind_methods(); public: - void set_build_mode(BuildMode p_mode); - BuildMode get_build_mode() const; - void set_depth(float p_depth); float get_depth() const; void set_polygon(const Vector<Point2> &p_polygon); Vector<Point2> get_polygon() const; - virtual Rect3 get_item_rect() const; + void set_disabled(bool p_disabled); + bool is_disabled() const; - int get_collision_object_first_shape() const { return shape_from; } - int get_collision_object_last_shape() const { return shape_to; } + virtual Rect3 get_item_rect() const; String get_configuration_warning() const; CollisionPolygon(); }; -VARIANT_ENUM_CAST(CollisionPolygon::BuildMode); #endif // COLLISION_POLYGON_H diff --git a/scene/3d/collision_shape.cpp b/scene/3d/collision_shape.cpp new file mode 100644 index 0000000000..4fd215bd1a --- /dev/null +++ b/scene/3d/collision_shape.cpp @@ -0,0 +1,214 @@ +/*************************************************************************/ +/* body_shape.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ +#include "collision_shape.h" +#include "scene/resources/box_shape.h" +#include "scene/resources/capsule_shape.h" +#include "scene/resources/concave_polygon_shape.h" +#include "scene/resources/convex_polygon_shape.h" +#include "scene/resources/plane_shape.h" +#include "scene/resources/ray_shape.h" +#include "scene/resources/sphere_shape.h" +#include "servers/visual_server.h" +//TODO: Implement CylinderShape and HeightMapShape? +#include "mesh_instance.h" +#include "physics_body.h" +#include "quick_hull.h" + +void CollisionShape::make_convex_from_brothers() { + + Node *p = get_parent(); + if (!p) + return; + + for (int i = 0; i < p->get_child_count(); i++) { + + Node *n = p->get_child(i); + if (n->cast_to<MeshInstance>()) { + + MeshInstance *mi = n->cast_to<MeshInstance>(); + Ref<Mesh> m = mi->get_mesh(); + if (m.is_valid()) { + + Ref<Shape> s = m->create_convex_shape(); + set_shape(s); + } + } + } +} + +void CollisionShape::_notification(int p_what) { + + switch (p_what) { + + case NOTIFICATION_PARENTED: { + parent = get_parent()->cast_to<CollisionObject>(); + if (parent) { + owner_id = parent->create_shape_owner(this); + if (shape.is_valid()) { + parent->shape_owner_add_shape(owner_id, shape); + } + parent->shape_owner_set_transform(owner_id, get_transform()); + parent->shape_owner_set_disabled(owner_id, disabled); + } + } break; + case NOTIFICATION_ENTER_TREE: { + if (get_tree()->is_debugging_collisions_hint()) { + _create_debug_shape(); + } + + } break; + case NOTIFICATION_LOCAL_TRANSFORM_CHANGED: { + if (parent) { + parent->shape_owner_set_transform(owner_id, get_transform()); + } + } break; + case NOTIFICATION_EXIT_TREE: { + if (parent) { + parent->remove_shape_owner(owner_id); + } + owner_id = 0; + parent = NULL; + } break; + case NOTIFICATION_UNPARENTED: { + if (parent) { + parent->remove_shape_owner(owner_id); + } + owner_id = 0; + parent = NULL; + } break; + } +} + +void CollisionShape::resource_changed(RES res) { + + update_gizmo(); +} + +String CollisionShape::get_configuration_warning() const { + + if (!get_parent()->cast_to<CollisionObject>()) { + return TTR("CollisionShape only serves to provide a collision shape to a CollisionObject derived node. Please only use it as a child of Area, StaticBody, RigidBody, KinematicBody, etc. to give them a shape."); + } + + if (!shape.is_valid()) { + return TTR("A shape must be provided for CollisionShape to function. Please create a shape resource for it!"); + } + + return String(); +} + +void CollisionShape::_bind_methods() { + + //not sure if this should do anything + ClassDB::bind_method(D_METHOD("resource_changed", "resource"), &CollisionShape::resource_changed); + ClassDB::bind_method(D_METHOD("set_shape", "shape"), &CollisionShape::set_shape); + ClassDB::bind_method(D_METHOD("get_shape"), &CollisionShape::get_shape); + ClassDB::bind_method(D_METHOD("set_disabled", "enable"), &CollisionShape::set_disabled); + ClassDB::bind_method(D_METHOD("is_disabled"), &CollisionShape::is_disabled); + ClassDB::bind_method(D_METHOD("make_convex_from_brothers"), &CollisionShape::make_convex_from_brothers); + ClassDB::set_method_flags("CollisionShape", "make_convex_from_brothers", METHOD_FLAGS_DEFAULT | METHOD_FLAG_EDITOR); + + ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "shape", PROPERTY_HINT_RESOURCE_TYPE, "Shape"), "set_shape", "get_shape"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "disabled"), "set_disabled", "is_disabled"); +} + +void CollisionShape::set_shape(const Ref<Shape> &p_shape) { + + if (!shape.is_null()) + shape->unregister_owner(this); + shape = p_shape; + if (!shape.is_null()) + shape->register_owner(this); + update_gizmo(); + if (parent) { + parent->shape_owner_clear_shapes(owner_id); + if (shape.is_valid()) { + parent->shape_owner_add_shape(owner_id, shape); + } + } + + update_configuration_warning(); +} + +Ref<Shape> CollisionShape::get_shape() const { + + return shape; +} + +void CollisionShape::set_disabled(bool p_disabled) { + + disabled = p_disabled; + update_gizmo(); + if (parent) { + parent->shape_owner_set_disabled(owner_id, p_disabled); + } +} + +bool CollisionShape::is_disabled() const { + + return disabled; +} + +CollisionShape::CollisionShape() { + + //indicator = VisualServer::get_singleton()->mesh_create(); + disabled = false; + debug_shape = NULL; + parent = NULL; + owner_id = 0; + set_notify_local_transform(true); +} + +CollisionShape::~CollisionShape() { + if (!shape.is_null()) + shape->unregister_owner(this); + //VisualServer::get_singleton()->free(indicator); +} + +void CollisionShape::_create_debug_shape() { + + if (debug_shape) { + debug_shape->queue_delete(); + debug_shape = NULL; + } + + Ref<Shape> s = get_shape(); + + if (s.is_null()) + return; + + Ref<Mesh> mesh = s->get_debug_mesh(); + + MeshInstance *mi = memnew(MeshInstance); + mi->set_mesh(mesh); + + add_child(mi); + debug_shape = mi; +} diff --git a/scene/3d/body_shape.h b/scene/3d/collision_shape.h index f4392dda62..277e0dfa77 100644 --- a/scene/3d/body_shape.h +++ b/scene/3d/collision_shape.h @@ -32,7 +32,7 @@ #include "scene/3d/spatial.h" #include "scene/resources/shape.h" - +class CollisionObject; class CollisionShape : public Spatial { GDCLASS(CollisionShape, Spatial); @@ -40,34 +40,13 @@ class CollisionShape : public Spatial { Ref<Shape> shape; - /* - RID _get_visual_instance_rid() const; - - - void _update_indicator(); - - RID material; - RID indicator; - RID indicator_instance; - */ + uint32_t owner_id; + CollisionObject *parent; Node *debug_shape; void resource_changed(RES res); - - bool updating_body; - bool unparenting; - bool trigger; - - bool can_update_body; - - int update_shape_index; - - void _update_body(); - void _add_to_collision_object(Object *p_cshape); - - void _set_update_shape_index(int p_index); - int _get_update_shape_index() const; + bool disabled; void _create_debug_shape(); @@ -81,13 +60,8 @@ public: void set_shape(const Ref<Shape> &p_shape); Ref<Shape> get_shape() const; - void set_updating_body(bool p_update); - bool is_updating_body() const; - - void set_trigger(bool p_trigger); - bool is_trigger() const; - - int get_collision_object_shape_index() const { return _get_update_shape_index(); } + void set_disabled(bool p_disabled); + bool is_disabled() const; String get_configuration_warning() const; diff --git a/scene/3d/gi_probe.cpp b/scene/3d/gi_probe.cpp index adca1492c3..581dfb32c8 100644 --- a/scene/3d/gi_probe.cpp +++ b/scene/3d/gi_probe.cpp @@ -95,6 +95,16 @@ float GIProbeData::get_bias() const { return VS::get_singleton()->gi_probe_get_bias(probe); } +void GIProbeData::set_normal_bias(float p_range) { + + VS::get_singleton()->gi_probe_set_normal_bias(probe, p_range); +} + +float GIProbeData::get_normal_bias() const { + + return VS::get_singleton()->gi_probe_get_normal_bias(probe); +} + void GIProbeData::set_propagation(float p_range) { VS::get_singleton()->gi_probe_set_propagation(probe, p_range); @@ -158,6 +168,9 @@ void GIProbeData::_bind_methods() { ClassDB::bind_method(D_METHOD("set_bias", "bias"), &GIProbeData::set_bias); ClassDB::bind_method(D_METHOD("get_bias"), &GIProbeData::get_bias); + ClassDB::bind_method(D_METHOD("set_normal_bias", "bias"), &GIProbeData::set_normal_bias); + ClassDB::bind_method(D_METHOD("get_normal_bias"), &GIProbeData::get_normal_bias); + ClassDB::bind_method(D_METHOD("set_propagation", "propagation"), &GIProbeData::set_propagation); ClassDB::bind_method(D_METHOD("get_propagation"), &GIProbeData::get_propagation); @@ -175,6 +188,7 @@ void GIProbeData::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::INT, "dynamic_range", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_dynamic_range", "get_dynamic_range"); ADD_PROPERTY(PropertyInfo(Variant::REAL, "energy", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_energy", "get_energy"); ADD_PROPERTY(PropertyInfo(Variant::REAL, "bias", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_bias", "get_bias"); + ADD_PROPERTY(PropertyInfo(Variant::REAL, "normal_bias", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_normal_bias", "get_normal_bias"); ADD_PROPERTY(PropertyInfo(Variant::REAL, "propagation", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_propagation", "get_propagation"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "interior", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_interior", "is_interior"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "compress", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_compress", "is_compressed"); @@ -265,6 +279,18 @@ float GIProbe::get_bias() const { return bias; } +void GIProbe::set_normal_bias(float p_normal_bias) { + + normal_bias = p_normal_bias; + if (probe_data.is_valid()) { + probe_data->set_normal_bias(normal_bias); + } +} +float GIProbe::get_normal_bias() const { + + return normal_bias; +} + void GIProbe::set_propagation(float p_propagation) { propagation = p_propagation; @@ -1261,6 +1287,7 @@ void GIProbe::bake(Node *p_from_node, bool p_create_visual_debug) { probe_data->set_dynamic_range(dynamic_range); probe_data->set_energy(energy); probe_data->set_bias(bias); + probe_data->set_normal_bias(normal_bias); probe_data->set_propagation(propagation); probe_data->set_interior(interior); probe_data->set_compress(compress); @@ -1434,6 +1461,9 @@ void GIProbe::_bind_methods() { ClassDB::bind_method(D_METHOD("set_bias", "max"), &GIProbe::set_bias); ClassDB::bind_method(D_METHOD("get_bias"), &GIProbe::get_bias); + ClassDB::bind_method(D_METHOD("set_normal_bias", "max"), &GIProbe::set_normal_bias); + ClassDB::bind_method(D_METHOD("get_normal_bias"), &GIProbe::get_normal_bias); + ClassDB::bind_method(D_METHOD("set_propagation", "max"), &GIProbe::set_propagation); ClassDB::bind_method(D_METHOD("get_propagation"), &GIProbe::get_propagation); @@ -1453,6 +1483,7 @@ void GIProbe::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::REAL, "energy", PROPERTY_HINT_RANGE, "0,16,0.01"), "set_energy", "get_energy"); ADD_PROPERTY(PropertyInfo(Variant::REAL, "propagation", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_propagation", "get_propagation"); ADD_PROPERTY(PropertyInfo(Variant::REAL, "bias", PROPERTY_HINT_RANGE, "0,4,0.001"), "set_bias", "get_bias"); + ADD_PROPERTY(PropertyInfo(Variant::REAL, "normal_bias", PROPERTY_HINT_RANGE, "0,4,0.001"), "set_normal_bias", "get_normal_bias"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "interior"), "set_interior", "is_interior"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "compress"), "set_compress", "is_compressed"); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "data", PROPERTY_HINT_RESOURCE_TYPE, "GIProbeData"), "set_probe_data", "get_probe_data"); @@ -1468,7 +1499,8 @@ GIProbe::GIProbe() { subdiv = SUBDIV_128; dynamic_range = 4; energy = 1.0; - bias = 1.8; + bias = 0.0; + normal_bias = 0.8; propagation = 1.0; extents = Vector3(10, 10, 10); color_scan_cell_width = 4; diff --git a/scene/3d/gi_probe.h b/scene/3d/gi_probe.h index b5ee86455e..3f5a50a560 100644 --- a/scene/3d/gi_probe.h +++ b/scene/3d/gi_probe.h @@ -67,6 +67,9 @@ public: void set_bias(float p_range); float get_bias() const; + void set_normal_bias(float p_range); + float get_normal_bias() const; + void set_interior(bool p_enable); bool is_interior() const; @@ -163,6 +166,7 @@ private: int dynamic_range; float energy; float bias; + float normal_bias; float propagation; bool interior; bool compress; @@ -204,6 +208,9 @@ public: void set_bias(float p_bias); float get_bias() const; + void set_normal_bias(float p_normal_bias); + float get_normal_bias() const; + void set_propagation(float p_propagation); float get_propagation() const; diff --git a/scene/3d/mesh_instance.cpp b/scene/3d/mesh_instance.cpp index 62e1a95209..558932ceb9 100644 --- a/scene/3d/mesh_instance.cpp +++ b/scene/3d/mesh_instance.cpp @@ -29,7 +29,7 @@ /*************************************************************************/ #include "mesh_instance.h" -#include "body_shape.h" +#include "collision_shape.h" #include "core_string_names.h" #include "physics_body.h" #include "scene/resources/material.h" @@ -194,7 +194,9 @@ Node *MeshInstance::create_trimesh_collision_node() { return NULL; StaticBody *static_body = memnew(StaticBody); - static_body->add_shape(shape); + CollisionShape *cshape = memnew(CollisionShape); + cshape->set_shape(shape); + static_body->add_child(cshape); return static_body; } @@ -205,13 +207,11 @@ void MeshInstance::create_trimesh_collision() { static_body->set_name(String(get_name()) + "_col"); add_child(static_body); - if (get_owner()) + if (get_owner()) { + CollisionShape *cshape = static_body->get_child(0)->cast_to<CollisionShape>(); static_body->set_owner(get_owner()); - CollisionShape *cshape = memnew(CollisionShape); - cshape->set_shape(static_body->get_shape(0)); - static_body->add_child(cshape); - if (get_owner()) cshape->set_owner(get_owner()); + } } Node *MeshInstance::create_convex_collision_node() { @@ -224,7 +224,9 @@ Node *MeshInstance::create_convex_collision_node() { return NULL; StaticBody *static_body = memnew(StaticBody); - static_body->add_shape(shape); + CollisionShape *cshape = memnew(CollisionShape); + cshape->set_shape(shape); + static_body->add_child(cshape); return static_body; } @@ -235,13 +237,11 @@ void MeshInstance::create_convex_collision() { static_body->set_name(String(get_name()) + "_col"); add_child(static_body); - if (get_owner()) + if (get_owner()) { + CollisionShape *cshape = static_body->get_child(0)->cast_to<CollisionShape>(); static_body->set_owner(get_owner()); - CollisionShape *cshape = memnew(CollisionShape); - cshape->set_shape(static_body->get_shape(0)); - static_body->add_child(cshape); - if (get_owner()) cshape->set_owner(get_owner()); + } } void MeshInstance::_notification(int p_what) { diff --git a/scene/3d/physics_body.cpp b/scene/3d/physics_body.cpp index 718daab75a..7e599ce2f5 100644 --- a/scene/3d/physics_body.cpp +++ b/scene/3d/physics_body.cpp @@ -879,313 +879,105 @@ RigidBody::~RigidBody() { ////////////////////////////////////////////////////// ////////////////////////// -Variant KinematicBody::_get_collider() const { - - ObjectID oid = get_collider(); - if (oid == 0) - return Variant(); - Object *obj = ObjectDB::get_instance(oid); - if (!obj) - return Variant(); - - Reference *ref = obj->cast_to<Reference>(); - if (ref) { - return Ref<Reference>(ref); - } +Dictionary KinematicBody::_move(const Vector3 &p_motion) { + + Collision col; + if (move(p_motion, col)) { + Dictionary d; + d["position"] = col.collision; + d["normal"] = col.collision; + d["local_shape"] = col.local_shape; + d["travel"] = col.travel; + d["remainder"] = col.remainder; + d["collider_id"] = col.collider; + if (col.collider) { + d["collider"] = ObjectDB::get_instance(col.collider); + } else { + d["collider"] = Variant(); + } - return obj; -} + d["collider_shape_index"] = col.collider_shape; + d["collider_metadata"] = col.collider_metadata; -bool KinematicBody::_ignores_mode(PhysicsServer::BodyMode p_mode) const { + return d; - switch (p_mode) { - case PhysicsServer::BODY_MODE_STATIC: return !collide_static; - case PhysicsServer::BODY_MODE_KINEMATIC: return !collide_kinematic; - case PhysicsServer::BODY_MODE_RIGID: return !collide_rigid; - case PhysicsServer::BODY_MODE_CHARACTER: return !collide_character; + } else { + return Dictionary(); } - - return true; } -void KinematicBody::revert_motion() { +bool KinematicBody::move(const Vector3 &p_motion, Collision &r_collision) { Transform gt = get_global_transform(); - gt.origin -= travel; //I do hope this is correct. - travel = Vector3(); - set_global_transform(gt); -} - -Vector3 KinematicBody::get_travel() const { - - return travel; -} - -Vector3 KinematicBody::move(const Vector3 &p_motion) { - - //give me back regular physics engine logic - //this is madness - //and most people using this function will think - //what it does is simpler than using physics - //this took about a week to get right.. - //but is it right? who knows at this point.. - - colliding = false; - ERR_FAIL_COND_V(!is_inside_tree(), Vector3()); - PhysicsDirectSpaceState *dss = PhysicsServer::get_singleton()->space_get_direct_state(get_world()->get_space()); - ERR_FAIL_COND_V(!dss, Vector3()); - const int max_shapes = 32; - Vector3 sr[max_shapes * 2]; - int res_shapes; - - Set<RID> exclude; - exclude.insert(get_rid()); - - //recover first - int recover_attempts = 4; - - bool collided = false; - uint32_t mask = 0; - if (collide_static) - mask |= PhysicsDirectSpaceState::TYPE_MASK_STATIC_BODY; - if (collide_kinematic) - mask |= PhysicsDirectSpaceState::TYPE_MASK_KINEMATIC_BODY; - if (collide_rigid) - mask |= PhysicsDirectSpaceState::TYPE_MASK_RIGID_BODY; - if (collide_character) - mask |= PhysicsDirectSpaceState::TYPE_MASK_CHARACTER_BODY; - - //print_line("motion: "+p_motion+" margin: "+rtos(margin)); - - //print_line("margin: "+rtos(margin)); - - float m = margin; - //m=0.001; - - do { - - //motion recover - for (int i = 0; i < get_shape_count(); i++) { - - if (is_shape_set_as_trigger(i)) - continue; - - if (dss->collide_shape(get_shape(i)->get_rid(), get_global_transform() * get_shape_transform(i), m, sr, max_shapes, res_shapes, exclude, get_collision_layer(), mask)) { - collided = true; - } - } - - if (!collided) - break; - - //print_line("have to recover"); - Vector3 recover_motion; - bool all_outside = true; - for (int j = 0; j < 8; j++) { - for (int i = 0; i < res_shapes; i++) { - - Vector3 a = sr[i * 2 + 0]; - Vector3 b = sr[i * 2 + 1]; -//print_line(String()+a+" -> "+b); -#if 0 - float d = a.distance_to(b); - - /* - if (d<margin) - continue; - */ - recover_motion+=(b-a)*0.2; -#else - float dist = a.distance_to(b); - if (dist > CMP_EPSILON) { - Vector3 norm = (b - a).normalized(); - if (dist > margin * 0.5) - all_outside = false; - float adv = norm.dot(recover_motion); - //print_line(itos(i)+" dist: "+rtos(dist)+" adv: "+rtos(adv)); - recover_motion += norm * MAX(dist - adv, 0) * 0.4; - } -#endif - } - } - - if (recover_motion == Vector3()) { - collided = false; - break; - } - - //print_line("**** RECOVER: "+recover_motion); - - Transform gt = get_global_transform(); - gt.origin += recover_motion; - set_global_transform(gt); - - recover_attempts--; - - if (all_outside) - break; - - } while (recover_attempts); - - //move second - float safe = 1.0; - float unsafe = 1.0; - int best_shape = -1; - - PhysicsDirectSpaceState::ShapeRestInfo rest; - - //print_line("pos: "+get_global_transform().origin); - //print_line("motion: "+p_motion); - - for (int i = 0; i < get_shape_count(); i++) { - - if (is_shape_set_as_trigger(i)) - continue; - - float lsafe, lunsafe; - PhysicsDirectSpaceState::ShapeRestInfo lrest; - bool valid = dss->cast_motion(get_shape(i)->get_rid(), get_global_transform() * get_shape_transform(i), p_motion, 0, lsafe, lunsafe, exclude, get_collision_layer(), mask, &lrest); - //print_line("shape: "+itos(i)+" travel:"+rtos(ltravel)); - if (!valid) { - safe = 0; - unsafe = 0; - best_shape = i; //sadly it's the best - //print_line("initial stuck"); - - break; - } - if (lsafe == 1.0) { - //print_line("initial free"); - continue; - } - if (lsafe < safe) { - - //print_line("initial at "+rtos(lsafe)); - safe = lsafe; - safe = MAX(0, lsafe - 0.01); - unsafe = lunsafe; - best_shape = i; - rest = lrest; - } - } - - //print_line("best shape: "+itos(best_shape)+" motion "+p_motion); - - if (safe >= 1) { - //not collided - colliding = false; - } else { - - colliding = true; - - if (true || (safe == 0 && unsafe == 0)) { //use it always because it's more precise than GJK - //no advance, use rest info from collision - Transform ugt = get_global_transform(); - ugt.origin += p_motion * unsafe; - - PhysicsDirectSpaceState::ShapeRestInfo rest_info; - bool c2 = dss->rest_info(get_shape(best_shape)->get_rid(), ugt * get_shape_transform(best_shape), m, &rest, exclude, get_collision_layer(), mask); - if (!c2) { - //should not happen, but floating point precision is so weird.. - colliding = false; - } - - //print_line("Rest Travel: "+rest.normal); - } - - if (colliding) { - - collision = rest.point; - normal = rest.normal; - collider = rest.collider_id; - collider_vel = rest.linear_velocity; - collider_shape = rest.shape; - } + PhysicsServer::MotionResult result; + bool colliding = PhysicsServer::get_singleton()->body_test_motion(get_rid(), gt, p_motion, margin, &result); + + if (colliding) { + r_collision.collider_metadata = result.collider_metadata; + r_collision.collider_shape = result.collider_shape; + r_collision.collider_vel = result.collider_velocity; + r_collision.collision = result.collision_point; + r_collision.normal = result.collision_normal; + r_collision.collider = result.collider_id; + r_collision.travel = result.motion; + r_collision.remainder = result.remainder; + r_collision.local_shape = result.collision_local_shape; } - Vector3 motion = p_motion * safe; - /* - if (colliding) - motion+=normal*0.001; - */ - Transform gt = get_global_transform(); - gt.origin += motion; + gt.origin += result.motion; set_global_transform(gt); - travel = motion; - return p_motion - motion; + return colliding; } -Vector3 KinematicBody::move_and_slide(const Vector3 &p_linear_velocity, const Vector3 &p_floor_direction, const Vector3 &p_ceil_direction, float p_slope_stop_min_velocity, int p_max_bounces, float p_floor_max_angle, float p_ceil_max_angle) { - - /* - Things to note: - 1. This function is basically the KinematicBody2D function ported over. - 2. The 'travel' variable and stuff relating to it exists more or less for this function's sake. - 3. Someone is going to have to document this, so here's an example for them: - vel = move_and_slide(vel, Vector3(0, 1, 0), Vector3(0, -1, 0), 0.1); - Very useful for FPS controllers so long as you control horizontal motion properly - even for Quake-style AABB colliders. - The slope stop system is... rather weird, and it's correct operation depends on what scale your game is built on, - but as far as I can tell in theory it's suppposed to be a way of turning impassable slopes into invisible walls. - It can also be a pain, since there's a better-known way of defining such things: "let gravity do the work". - If you don't like it, set it to positive infinity. - 4. Might be a bug somewhere else in physics: When there are two CollisionShape nodes with a shared Shape, only one is considered, I think. - Test this further. - */ +Vector3 KinematicBody::move_and_slide(const Vector3 &p_linear_velocity, const Vector3 &p_floor_direction, float p_slope_stop_min_velocity, int p_max_bounces, float p_floor_max_angle) { - Vector3 motion = (move_and_slide_floor_velocity + p_linear_velocity) * get_fixed_process_delta_time(); + Vector3 motion = (floor_velocity + p_linear_velocity) * get_fixed_process_delta_time(); Vector3 lv = p_linear_velocity; - move_and_slide_on_floor = false; - move_and_slide_on_ceiling = false; - move_and_slide_on_wall = false; - move_and_slide_colliders.clear(); - move_and_slide_floor_velocity = Vector3(); + on_floor = false; + on_ceiling = false; + on_wall = false; + colliders.clear(); + floor_velocity = Vector3(); while (p_max_bounces) { - motion = move(motion); + Collision collision; - if (is_colliding()) { + bool collided = move(motion, collision); - bool hit_horizontal = false; //hit floor or ceiling + if (collided) { - if (p_floor_direction != Vector3()) { - if (get_collision_normal().dot(p_floor_direction) >= Math::cos(p_floor_max_angle)) { //floor + motion = collision.remainder; - hit_horizontal = true; - move_and_slide_on_floor = true; - move_and_slide_floor_velocity = get_collider_velocity(); + if (p_floor_direction == Vector3()) { + //all is a wall + on_wall = true; + } else { + if (collision.normal.dot(p_floor_direction) >= Math::cos(p_floor_max_angle)) { //floor - //Note: These two lines are the only lines that really changed between 3D/2D, see if it can't be reused somehow??? - Vector2 hz_velocity = Vector2(lv.x - move_and_slide_floor_velocity.x, lv.z - move_and_slide_floor_velocity.z); - if (get_travel().length() < 1 && hz_velocity.length() < p_slope_stop_min_velocity) { - revert_motion(); - return Vector3(); - } - } - } + on_floor = true; + floor_velocity = collision.collider_vel; - if (p_ceil_direction != Vector3()) { - if (get_collision_normal().dot(p_ceil_direction) >= Math::cos(p_ceil_max_angle)) { //ceiling - hit_horizontal = true; - move_and_slide_on_ceiling = true; + /*if (collision.travel.length() < 0.01 && ABS((lv.x - floor_velocity.x)) < p_slope_stop_min_velocity) { + Transform gt = get_global_transform(); + gt.elements[2] -= collision.travel; + set_global_transform(gt); + return Vector3(); + }*/ + } else if (collision.normal.dot(-p_floor_direction) >= Math::cos(p_floor_max_angle)) { //ceiling + on_ceiling = true; + } else { + on_wall = true; } } - //if it hit something but didn't hit a floor or ceiling, it is by default a wall - //(this imitates the pre-specifiable-ceiling logic more or less, except ceiling is optional) - if (!hit_horizontal) { - move_and_slide_on_wall = true; - } - - Vector3 n = get_collision_normal(); + Vector3 n = collision.normal; motion = motion.slide(n); lv = lv.slide(n); - Variant collider = _get_collider(); - if (collider.get_type() != Variant::NIL) { - move_and_slide_colliders.push_back(collider); - } + + colliders.push_back(collision); } else { break; @@ -1199,199 +991,148 @@ Vector3 KinematicBody::move_and_slide(const Vector3 &p_linear_velocity, const Ve return lv; } -bool KinematicBody::is_move_and_slide_on_floor() const { - - return move_and_slide_on_floor; -} -bool KinematicBody::is_move_and_slide_on_wall() const { +bool KinematicBody::is_on_floor() const { - return move_and_slide_on_wall; + return on_floor; } -bool KinematicBody::is_move_and_slide_on_ceiling() const { +bool KinematicBody::is_on_wall() const { - return move_and_slide_on_ceiling; + return on_wall; } -Array KinematicBody::get_move_and_slide_colliders() const { +bool KinematicBody::is_on_ceiling() const { - return move_and_slide_colliders; + return on_ceiling; } -Vector3 KinematicBody::move_to(const Vector3 &p_position) { +Vector3 KinematicBody::get_floor_velocity() const { - return move(p_position - get_global_transform().origin); + return floor_velocity; } -bool KinematicBody::can_teleport_to(const Vector3 &p_position) { +bool KinematicBody::test_move(const Transform &p_from, const Vector3 &p_motion) { ERR_FAIL_COND_V(!is_inside_tree(), false); - PhysicsDirectSpaceState *dss = PhysicsServer::get_singleton()->space_get_direct_state(get_world()->get_space()); - ERR_FAIL_COND_V(!dss, false); - - uint32_t mask = 0; - if (collide_static) - mask |= PhysicsDirectSpaceState::TYPE_MASK_STATIC_BODY; - if (collide_kinematic) - mask |= PhysicsDirectSpaceState::TYPE_MASK_KINEMATIC_BODY; - if (collide_rigid) - mask |= PhysicsDirectSpaceState::TYPE_MASK_RIGID_BODY; - if (collide_character) - mask |= PhysicsDirectSpaceState::TYPE_MASK_CHARACTER_BODY; - - Transform xform = get_global_transform(); - xform.origin = p_position; - - Set<RID> exclude; - exclude.insert(get_rid()); - - for (int i = 0; i < get_shape_count(); i++) { - - if (is_shape_set_as_trigger(i)) - continue; - - bool col = dss->intersect_shape(get_shape(i)->get_rid(), xform * get_shape_transform(i), 0, NULL, 1, exclude, get_collision_layer(), mask); - if (col) - return false; - } - return true; + return PhysicsServer::get_singleton()->body_test_motion(get_rid(), p_from, p_motion, margin); } -bool KinematicBody::is_colliding() const { +void KinematicBody::set_safe_margin(float p_margin) { - ERR_FAIL_COND_V(!is_inside_tree(), false); - - return colliding; + margin = p_margin; } -Vector3 KinematicBody::get_collision_pos() const { - ERR_FAIL_COND_V(!colliding, Vector3()); - return collision; -} -Vector3 KinematicBody::get_collision_normal() const { +float KinematicBody::get_safe_margin() const { - ERR_FAIL_COND_V(!colliding, Vector3()); - return normal; + return margin; } -Vector3 KinematicBody::get_collider_velocity() const { +int KinematicBody::get_collision_count() const { - return collider_vel; + return colliders.size(); } +Vector3 KinematicBody::get_collision_position(int p_collision) const { -ObjectID KinematicBody::get_collider() const { - - ERR_FAIL_COND_V(!colliding, 0); - return collider; -} -int KinematicBody::get_collider_shape() const { + ERR_FAIL_INDEX_V(p_collision, colliders.size(), Vector3()); - ERR_FAIL_COND_V(!colliding, -1); - return collider_shape; + return colliders[p_collision].collision; } -void KinematicBody::set_collide_with_static_bodies(bool p_enable) { - - collide_static = p_enable; +Vector3 KinematicBody::get_collision_normal(int p_collision) const { + ERR_FAIL_INDEX_V(p_collision, colliders.size(), Vector3()); + return colliders[p_collision].normal; } -bool KinematicBody::can_collide_with_static_bodies() const { - return collide_static; +Vector3 KinematicBody::get_collision_travel(int p_collision) const { + ERR_FAIL_INDEX_V(p_collision, colliders.size(), Vector3()); + return colliders[p_collision].travel; } - -void KinematicBody::set_collide_with_rigid_bodies(bool p_enable) { - - collide_rigid = p_enable; +Vector3 KinematicBody::get_collision_remainder(int p_collision) const { + ERR_FAIL_INDEX_V(p_collision, colliders.size(), Vector3()); + return colliders[p_collision].remainder; } -bool KinematicBody::can_collide_with_rigid_bodies() const { - - return collide_rigid; +Object *KinematicBody::get_collision_local_shape(int p_collision) const { + ERR_FAIL_INDEX_V(p_collision, colliders.size(), NULL); + uint32_t owner = shape_find_owner(colliders[p_collision].local_shape); + return shape_owner_get_owner(owner); } +Object *KinematicBody::get_collision_collider(int p_collision) const { + ERR_FAIL_INDEX_V(p_collision, colliders.size(), NULL); -void KinematicBody::set_collide_with_kinematic_bodies(bool p_enable) { + if (colliders[p_collision].collider) { + return ObjectDB::get_instance(colliders[p_collision].collider); + } - collide_kinematic = p_enable; + return NULL; } -bool KinematicBody::can_collide_with_kinematic_bodies() const { +ObjectID KinematicBody::get_collision_collider_id(int p_collision) const { + ERR_FAIL_INDEX_V(p_collision, colliders.size(), 0); - return collide_kinematic; + return colliders[p_collision].collider; } +Object *KinematicBody::get_collision_collider_shape(int p_collision) const { + ERR_FAIL_INDEX_V(p_collision, colliders.size(), NULL); + Object *collider = get_collision_collider(p_collision); + if (collider) { + CollisionObject *obj2d = collider->cast_to<CollisionObject>(); + if (obj2d) { + uint32_t owner = shape_find_owner(colliders[p_collision].collider_shape); + return obj2d->shape_owner_get_owner(owner); + } + } -void KinematicBody::set_collide_with_character_bodies(bool p_enable) { - - collide_character = p_enable; + return NULL; } -bool KinematicBody::can_collide_with_character_bodies() const { - - return collide_character; +int KinematicBody::get_collision_collider_shape_index(int p_collision) const { + ERR_FAIL_INDEX_V(p_collision, colliders.size(), -1); + return colliders[p_collision].collider_shape; } - -void KinematicBody::set_collision_margin(float p_margin) { - - margin = p_margin; +Vector3 KinematicBody::get_collision_collider_velocity(int p_collision) const { + ERR_FAIL_INDEX_V(p_collision, colliders.size(), Vector3()); + return colliders[p_collision].collider_vel; } - -float KinematicBody::get_collision_margin() const { - - return margin; +Variant KinematicBody::get_collision_collider_metadata(int p_collision) const { + ERR_FAIL_INDEX_V(p_collision, colliders.size(), Variant()); + return colliders[p_collision].collider_metadata; } void KinematicBody::_bind_methods() { - ClassDB::bind_method(D_METHOD("move", "rel_vec"), &KinematicBody::move); - ClassDB::bind_method(D_METHOD("move_to", "position"), &KinematicBody::move_to); - ClassDB::bind_method(D_METHOD("move_and_slide", "linear_velocity", "floor_normal", "ceil_normal", "slope_stop_min_velocity", "max_bounces", "floor_max_angle", "ceil_max_angle"), &KinematicBody::move_and_slide, DEFVAL(Vector3(0, 0, 0)), DEFVAL(Vector3(0, 0, 0)), DEFVAL(5), DEFVAL(4), DEFVAL(Math::deg2rad((float)45)), DEFVAL(Math::deg2rad((float)45))); - - ClassDB::bind_method(D_METHOD("can_teleport_to", "position"), &KinematicBody::can_teleport_to); + ClassDB::bind_method(D_METHOD("move", "rel_vec"), &KinematicBody::_move); + ClassDB::bind_method(D_METHOD("move_and_slide", "linear_velocity", "floor_normal", "slope_stop_min_velocity", "max_bounces", "floor_max_angle"), &KinematicBody::move_and_slide, DEFVAL(Vector3(0, 0, 0)), DEFVAL(0.05), DEFVAL(4), DEFVAL(Math::deg2rad((float)45))); - ClassDB::bind_method(D_METHOD("is_colliding"), &KinematicBody::is_colliding); + ClassDB::bind_method(D_METHOD("test_move", "from", "rel_vec"), &KinematicBody::test_move); - ClassDB::bind_method(D_METHOD("get_collision_pos"), &KinematicBody::get_collision_pos); - ClassDB::bind_method(D_METHOD("get_collision_normal"), &KinematicBody::get_collision_normal); - ClassDB::bind_method(D_METHOD("get_collider_velocity"), &KinematicBody::get_collider_velocity); - ClassDB::bind_method(D_METHOD("get_collider:Variant"), &KinematicBody::_get_collider); - ClassDB::bind_method(D_METHOD("get_collider_shape"), &KinematicBody::get_collider_shape); + ClassDB::bind_method(D_METHOD("is_on_floor"), &KinematicBody::is_on_floor); + ClassDB::bind_method(D_METHOD("is_on_ceiling"), &KinematicBody::is_on_ceiling); + ClassDB::bind_method(D_METHOD("is_on_wall"), &KinematicBody::is_on_wall); + ClassDB::bind_method(D_METHOD("get_floor_velocity"), &KinematicBody::get_floor_velocity); - ClassDB::bind_method(D_METHOD("set_collide_with_static_bodies", "enable"), &KinematicBody::set_collide_with_static_bodies); - ClassDB::bind_method(D_METHOD("can_collide_with_static_bodies"), &KinematicBody::can_collide_with_static_bodies); + ClassDB::bind_method(D_METHOD("set_safe_margin", "pixels"), &KinematicBody::set_safe_margin); + ClassDB::bind_method(D_METHOD("get_safe_margin", "pixels"), &KinematicBody::get_safe_margin); - ClassDB::bind_method(D_METHOD("set_collide_with_kinematic_bodies", "enable"), &KinematicBody::set_collide_with_kinematic_bodies); - ClassDB::bind_method(D_METHOD("can_collide_with_kinematic_bodies"), &KinematicBody::can_collide_with_kinematic_bodies); + ClassDB::bind_method(D_METHOD("get_collision_count"), &KinematicBody::get_collision_count); + ClassDB::bind_method(D_METHOD("get_collision_position", "collision"), &KinematicBody::get_collision_position); + ClassDB::bind_method(D_METHOD("get_collision_normal", "collision"), &KinematicBody::get_collision_normal); + ClassDB::bind_method(D_METHOD("get_collision_travel", "collision"), &KinematicBody::get_collision_travel); + ClassDB::bind_method(D_METHOD("get_collision_remainder", "collision"), &KinematicBody::get_collision_remainder); + ClassDB::bind_method(D_METHOD("get_collision_local_shape", "collision"), &KinematicBody::get_collision_local_shape); + ClassDB::bind_method(D_METHOD("get_collision_collider", "collision"), &KinematicBody::get_collision_collider); + ClassDB::bind_method(D_METHOD("get_collision_collider_id", "collision"), &KinematicBody::get_collision_collider_id); + ClassDB::bind_method(D_METHOD("get_collision_collider_shape", "collision"), &KinematicBody::get_collision_collider_shape); + ClassDB::bind_method(D_METHOD("get_collision_collider_shape_index", "collision"), &KinematicBody::get_collision_collider_shape_index); + ClassDB::bind_method(D_METHOD("get_collision_collider_velocity", "collision"), &KinematicBody::get_collision_collider_velocity); + ClassDB::bind_method(D_METHOD("get_collision_collider_metadata", "collision"), &KinematicBody::get_collision_collider_metadata); - ClassDB::bind_method(D_METHOD("set_collide_with_rigid_bodies", "enable"), &KinematicBody::set_collide_with_rigid_bodies); - ClassDB::bind_method(D_METHOD("can_collide_with_rigid_bodies"), &KinematicBody::can_collide_with_rigid_bodies); - - ClassDB::bind_method(D_METHOD("set_collide_with_character_bodies", "enable"), &KinematicBody::set_collide_with_character_bodies); - ClassDB::bind_method(D_METHOD("can_collide_with_character_bodies"), &KinematicBody::can_collide_with_character_bodies); - - ClassDB::bind_method(D_METHOD("set_collision_margin", "pixels"), &KinematicBody::set_collision_margin); - ClassDB::bind_method(D_METHOD("get_collision_margin", "pixels"), &KinematicBody::get_collision_margin); - - ClassDB::bind_method(D_METHOD("get_travel"), &KinematicBody::get_travel); - ClassDB::bind_method(D_METHOD("revert_motion"), &KinematicBody::revert_motion); - - ClassDB::bind_method(D_METHOD("get_move_and_slide_colliders"), &KinematicBody::get_move_and_slide_colliders); - ClassDB::bind_method(D_METHOD("is_move_and_slide_on_floor"), &KinematicBody::is_move_and_slide_on_floor); - ClassDB::bind_method(D_METHOD("is_move_and_slide_on_ceiling"), &KinematicBody::is_move_and_slide_on_ceiling); - ClassDB::bind_method(D_METHOD("is_move_and_slide_on_wall"), &KinematicBody::is_move_and_slide_on_wall); - - ADD_PROPERTY(PropertyInfo(Variant::BOOL, "collide_with/static"), "set_collide_with_static_bodies", "can_collide_with_static_bodies"); - ADD_PROPERTY(PropertyInfo(Variant::BOOL, "collide_with/kinematic"), "set_collide_with_kinematic_bodies", "can_collide_with_kinematic_bodies"); - ADD_PROPERTY(PropertyInfo(Variant::BOOL, "collide_with/rigid"), "set_collide_with_rigid_bodies", "can_collide_with_rigid_bodies"); - ADD_PROPERTY(PropertyInfo(Variant::BOOL, "collide_with/character"), "set_collide_with_character_bodies", "can_collide_with_character_bodies"); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "collision/margin", PROPERTY_HINT_RANGE, "0.001,256,0.001"), "set_collision_margin", "get_collision_margin"); + ADD_PROPERTY(PropertyInfo(Variant::REAL, "collision/safe_margin", PROPERTY_HINT_RANGE, "0.001,256,0.001"), "set_safe_margin", "get_safe_margin"); } KinematicBody::KinematicBody() : PhysicsBody(PhysicsServer::BODY_MODE_KINEMATIC) { - collide_static = true; - collide_rigid = true; - collide_kinematic = true; - collide_character = true; - - colliding = false; - collider = 0; margin = 0.001; - collider_shape = 0; + + on_floor = false; + on_ceiling = false; + on_wall = false; } KinematicBody::~KinematicBody() { } diff --git a/scene/3d/physics_body.h b/scene/3d/physics_body.h index db4147f8f6..f86d7d957f 100644 --- a/scene/3d/physics_body.h +++ b/scene/3d/physics_body.h @@ -263,75 +263,60 @@ class KinematicBody : public PhysicsBody { GDCLASS(KinematicBody, PhysicsBody); - float margin; - bool collide_static; - bool collide_rigid; - bool collide_kinematic; - bool collide_character; - - bool colliding; - Vector3 collision; - Vector3 normal; - Vector3 collider_vel; - ObjectID collider; - int collider_shape; - Vector3 travel; - - Vector3 move_and_slide_floor_velocity; - bool move_and_slide_on_floor; - bool move_and_slide_on_ceiling; - bool move_and_slide_on_wall; - Array move_and_slide_colliders; - - Variant _get_collider() const; - - _FORCE_INLINE_ bool _ignores_mode(PhysicsServer::BodyMode) const; - -protected: - static void _bind_methods(); - public: - enum { - SLIDE_FLAG_FLOOR, - SLIDE_FLAG_WALL, - SLIDE_FLAG_ROOF + struct Collision { + Vector3 collision; + Vector3 normal; + Vector3 collider_vel; + ObjectID collider; + int collider_shape; + Variant collider_metadata; + Vector3 remainder; + Vector3 travel; + int local_shape; }; - Vector3 move(const Vector3 &p_motion); - Vector3 move_to(const Vector3 &p_position); - - bool can_teleport_to(const Vector3 &p_position); - bool is_colliding() const; - - Vector3 get_travel() const; // Set by move and others. Consider unreliable except immediately after a move call. - void revert_motion(); - - Vector3 get_collision_pos() const; - Vector3 get_collision_normal() const; - Vector3 get_collider_velocity() const; - ObjectID get_collider() const; - int get_collider_shape() const; - - void set_collide_with_static_bodies(bool p_enable); - bool can_collide_with_static_bodies() const; +private: + float margin; - void set_collide_with_rigid_bodies(bool p_enable); - bool can_collide_with_rigid_bodies() const; + Vector3 floor_velocity; + bool on_floor; + bool on_ceiling; + bool on_wall; + Vector<Collision> colliders; - void set_collide_with_kinematic_bodies(bool p_enable); - bool can_collide_with_kinematic_bodies() const; + _FORCE_INLINE_ bool _ignores_mode(PhysicsServer::BodyMode) const; - void set_collide_with_character_bodies(bool p_enable); - bool can_collide_with_character_bodies() const; + Dictionary _move(const Vector3 &p_motion); - void set_collision_margin(float p_margin); - float get_collision_margin() const; +protected: + static void _bind_methods(); - Vector3 move_and_slide(const Vector3 &p_linear_velocity, const Vector3 &p_floor_direction = Vector3(0, 0, 0), const Vector3 &p_ceil_direction = Vector3(0, 0, 0), float p_slope_stop_min_velocity = 5, int p_max_bounces = 4, float p_floor_max_angle = Math::deg2rad((float)45), float p_ceil_max_angle = Math::deg2rad((float)45)); - bool is_move_and_slide_on_floor() const; - bool is_move_and_slide_on_wall() const; - bool is_move_and_slide_on_ceiling() const; - Array get_move_and_slide_colliders() const; +public: + bool move(const Vector3 &p_motion, Collision &r_collision); + bool test_move(const Transform &p_from, const Vector3 &p_motion); + + void set_safe_margin(float p_margin); + float get_safe_margin() const; + + Vector3 move_and_slide(const Vector3 &p_linear_velocity, const Vector3 &p_floor_direction = Vector3(0, 0, 0), float p_slope_stop_min_velocity = 0.05, int p_max_bounces = 4, float p_floor_max_angle = Math::deg2rad((float)45)); + bool is_on_floor() const; + bool is_on_wall() const; + bool is_on_ceiling() const; + Vector3 get_floor_velocity() const; + + int get_collision_count() const; + Vector3 get_collision_position(int p_collision) const; + Vector3 get_collision_normal(int p_collision) const; + Vector3 get_collision_travel(int p_collision) const; + Vector3 get_collision_remainder(int p_collision) const; + Object *get_collision_local_shape(int p_collision) const; + Object *get_collision_collider(int p_collision) const; + ObjectID get_collision_collider_id(int p_collision) const; + Object *get_collision_collider_shape(int p_collision) const; + int get_collision_collider_shape_index(int p_collision) const; + Vector3 get_collision_collider_velocity(int p_collision) const; + Variant get_collision_collider_metadata(int p_collision) const; KinematicBody(); ~KinematicBody(); diff --git a/scene/3d/reflection_probe.cpp b/scene/3d/reflection_probe.cpp index 86a62bec97..0dc5b58e45 100644 --- a/scene/3d/reflection_probe.cpp +++ b/scene/3d/reflection_probe.cpp @@ -162,7 +162,7 @@ bool ReflectionProbe::are_shadows_enabled() const { void ReflectionProbe::set_cull_mask(uint32_t p_layers) { cull_mask = p_layers; - VS::get_singleton()->reflection_probe_set_enable_shadows(probe, p_layers); + VS::get_singleton()->reflection_probe_set_cull_mask(probe, p_layers); } uint32_t ReflectionProbe::get_cull_mask() const { diff --git a/scene/3d/remote_transform.cpp b/scene/3d/remote_transform.cpp index b36f444bea..4dcfb5f94e 100644 --- a/scene/3d/remote_transform.cpp +++ b/scene/3d/remote_transform.cpp @@ -63,7 +63,45 @@ void RemoteTransform::_update_remote() { return; //todo make faster - n->set_global_transform(get_global_transform()); + if (use_global_coordinates) { + + if (update_remote_position && update_remote_rotation && update_remote_scale) { + n->set_global_transform(get_global_transform()); + } else { + Transform n_trans = n->get_global_transform(); + Transform our_trans = get_global_transform(); + + if (!update_remote_position) + our_trans.set_origin(n_trans.get_origin()); + + n->set_global_transform(our_trans); + + if (!update_remote_rotation) + n->set_rotation(n_trans.basis.get_rotation()); + + if (!update_remote_scale) + n->set_scale(n_trans.basis.get_scale()); + } + + } else { + if (update_remote_position && update_remote_rotation && update_remote_scale) { + n->set_global_transform(get_global_transform()); + } else { + Transform n_trans = n->get_transform(); + Transform our_trans = get_transform(); + + if (!update_remote_position) + our_trans.set_origin(n_trans.get_origin()); + + n->set_transform(our_trans); + + if (!update_remote_rotation) + n->set_rotation(n_trans.basis.get_rotation()); + + if (!update_remote_scale) + n->set_scale(n_trans.basis.get_scale()); + } + } } void RemoteTransform::_notification(int p_what) { @@ -102,6 +140,41 @@ NodePath RemoteTransform::get_remote_node() const { return remote_node; } +void RemoteTransform::set_use_global_coordinates(const bool p_enable) { + use_global_coordinates = p_enable; +} + +bool RemoteTransform::get_use_global_coordinates() const { + return use_global_coordinates; +} + +void RemoteTransform::set_update_position(const bool p_update) { + update_remote_position = p_update; + _update_remote(); +} + +bool RemoteTransform::get_update_position() const { + return update_remote_position; +} + +void RemoteTransform::set_update_rotation(const bool p_update) { + update_remote_rotation = p_update; + _update_remote(); +} + +bool RemoteTransform::get_update_rotation() const { + return update_remote_rotation; +} + +void RemoteTransform::set_update_scale(const bool p_update) { + update_remote_scale = p_update; + _update_remote(); +} + +bool RemoteTransform::get_update_scale() const { + return update_remote_scale; +} + String RemoteTransform::get_configuration_warning() const { if (!has_node(remote_node) || !get_node(remote_node) || !get_node(remote_node)->cast_to<Spatial>()) { @@ -116,11 +189,32 @@ void RemoteTransform::_bind_methods() { ClassDB::bind_method(D_METHOD("set_remote_node", "path"), &RemoteTransform::set_remote_node); ClassDB::bind_method(D_METHOD("get_remote_node"), &RemoteTransform::get_remote_node); + ClassDB::bind_method(D_METHOD("set_use_global_coordinates", "use_global_coordinates"), &RemoteTransform::set_use_global_coordinates); + ClassDB::bind_method(D_METHOD("get_use_global_coordinates"), &RemoteTransform::get_use_global_coordinates); + + ClassDB::bind_method(D_METHOD("set_update_position", "update_remote_position"), &RemoteTransform::set_update_position); + ClassDB::bind_method(D_METHOD("get_update_position"), &RemoteTransform::get_update_position); + ClassDB::bind_method(D_METHOD("set_update_rotation", "update_remote_rotation"), &RemoteTransform::set_update_rotation); + ClassDB::bind_method(D_METHOD("get_update_rotation"), &RemoteTransform::get_update_rotation); + ClassDB::bind_method(D_METHOD("set_update_scale", "update_remote_scale"), &RemoteTransform::set_update_scale); + ClassDB::bind_method(D_METHOD("get_update_scale"), &RemoteTransform::get_update_scale); + ADD_PROPERTY(PropertyInfo(Variant::NODE_PATH, "remote_path"), "set_remote_node", "get_remote_node"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "use_global_coordinates"), "set_use_global_coordinates", "get_use_global_coordinates"); + + ADD_GROUP("Update", "update_"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "update_position"), "set_update_position", "get_update_position"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "update_rotation"), "set_update_rotation", "get_update_rotation"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "update_scale"), "set_update_scale", "get_update_scale"); } RemoteTransform::RemoteTransform() { + use_global_coordinates = true; + update_remote_position = true; + update_remote_rotation = true; + update_remote_scale = true; + cache = 0; set_notify_transform(true); } diff --git a/scene/3d/remote_transform.h b/scene/3d/remote_transform.h index 9fa3011185..c25b57966e 100644 --- a/scene/3d/remote_transform.h +++ b/scene/3d/remote_transform.h @@ -39,6 +39,11 @@ class RemoteTransform : public Spatial { ObjectID cache; + bool use_global_coordinates; + bool update_remote_position; + bool update_remote_rotation; + bool update_remote_scale; + void _update_remote(); void _update_cache(); @@ -50,6 +55,18 @@ public: void set_remote_node(const NodePath &p_remote_node); NodePath get_remote_node() const; + void set_use_global_coordinates(const bool p_enable); + bool get_use_global_coordinates() const; + + void set_update_position(const bool p_update); + bool get_update_position() const; + + void set_update_rotation(const bool p_update); + bool get_update_rotation() const; + + void set_update_scale(const bool p_update); + bool get_update_scale() const; + virtual String get_configuration_warning() const; RemoteTransform(); diff --git a/scene/3d/spatial_velocity_tracker.cpp b/scene/3d/spatial_velocity_tracker.cpp new file mode 100644 index 0000000000..dc822d0446 --- /dev/null +++ b/scene/3d/spatial_velocity_tracker.cpp @@ -0,0 +1,104 @@ +#include "spatial_velocity_tracker.h" +#include "engine.h" + +void SpatialVelocityTracker::set_track_fixed_step(bool p_track_fixed_step) { + + fixed_step = p_track_fixed_step; +} + +bool SpatialVelocityTracker::is_tracking_fixed_step() const { + + return fixed_step; +} +void SpatialVelocityTracker::update_position(const Vector3 &p_position) { + + PositionHistory ph; + ph.position = p_position; + if (fixed_step) { + ph.frame = Engine::get_singleton()->get_fixed_frames(); + } else { + ph.frame = Engine::get_singleton()->get_idle_frame_ticks(); + } + + if (position_history_len == 0 || position_history[0].frame != ph.frame) { //in same frame, use latest + position_history_len = MIN(position_history.size(), position_history_len + 1); + for (int i = position_history_len - 1; i > 0; i--) { + position_history[i] = position_history[i - 1]; + } + } + + position_history[0] = ph; +} +Vector3 SpatialVelocityTracker::get_tracked_linear_velocity() const { + + Vector3 linear_velocity; + + float max_time = 1 / 5.0; //maximum time to interpolate a velocity + + Vector3 distance_accum; + float time_accum = 0.0; + float base_time = 0.0; + + if (position_history_len) { + if (fixed_step) { + uint64_t base = Engine::get_singleton()->get_fixed_frames(); + base_time = float(base - position_history[0].frame) / Engine::get_singleton()->get_iterations_per_second(); + } else { + uint64_t base = Engine::get_singleton()->get_idle_frame_ticks(); + base_time = double(base - position_history[0].frame) / 1000000.0; + } + } + + for (int i = 0; i < position_history_len - 1; i++) { + float delta = 0.0; + uint64_t diff = position_history[i].frame - position_history[i + 1].frame; + Vector3 distance = position_history[i].position - position_history[i + 1].position; + + if (fixed_step) { + delta = float(diff) / Engine::get_singleton()->get_iterations_per_second(); + } else { + delta = double(diff) / 1000000.0; + } + + if (base_time + time_accum + delta > max_time) + break; + + distance_accum += distance; + time_accum += delta; + } + + if (time_accum) { + linear_velocity = distance_accum / time_accum; + } + + return linear_velocity; +} + +void SpatialVelocityTracker::reset(const Vector3 &p_new_pos) { + + PositionHistory ph; + ph.position = p_new_pos; + if (fixed_step) { + ph.frame = Engine::get_singleton()->get_fixed_frames(); + } else { + ph.frame = Engine::get_singleton()->get_idle_frame_ticks(); + } + + position_history[0] = ph; + position_history_len = 1; +} + +void SpatialVelocityTracker::_bind_methods() { + + ClassDB::bind_method(D_METHOD("set_track_fixed_step", "enable"), &SpatialVelocityTracker::set_track_fixed_step); + ClassDB::bind_method(D_METHOD("is_tracking_fixed_step"), &SpatialVelocityTracker::is_tracking_fixed_step); + ClassDB::bind_method(D_METHOD("update_position", "position"), &SpatialVelocityTracker::update_position); + ClassDB::bind_method(D_METHOD("get_tracked_linear_velocity"), &SpatialVelocityTracker::get_tracked_linear_velocity); + ClassDB::bind_method(D_METHOD("reset", "position"), &SpatialVelocityTracker::reset); +} + +SpatialVelocityTracker::SpatialVelocityTracker() { + position_history.resize(4); // should be configurable + position_history_len = 0; + fixed_step = false; +} diff --git a/scene/3d/spatial_velocity_tracker.h b/scene/3d/spatial_velocity_tracker.h new file mode 100644 index 0000000000..65f3eaca93 --- /dev/null +++ b/scene/3d/spatial_velocity_tracker.h @@ -0,0 +1,31 @@ +#ifndef SPATIAL_VELOCITY_TRACKER_H +#define SPATIAL_VELOCITY_TRACKER_H + +#include "scene/3d/spatial.h" + +class SpatialVelocityTracker : public Reference { + GDCLASS(SpatialVelocityTracker, Reference) + + struct PositionHistory { + uint64_t frame; + Vector3 position; + }; + + bool fixed_step; + Vector<PositionHistory> position_history; + int position_history_len; + +protected: + static void _bind_methods(); + +public: + void reset(const Vector3 &p_new_pos); + void set_track_fixed_step(bool p_use_fixed_step); + bool is_tracking_fixed_step() const; + void update_position(const Vector3 &p_position); + Vector3 get_tracked_linear_velocity() const; + + SpatialVelocityTracker(); +}; + +#endif // SPATIAL_VELOCITY_TRACKER_H diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index bf8d81d4a6..a9034b738b 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -1229,8 +1229,8 @@ void Control::_size_changed() { } } - Point2 new_pos_cache = Point2(margin_pos[0], margin_pos[1]).floor(); - Size2 new_size_cache = Point2(margin_pos[2], margin_pos[3]).floor() - new_pos_cache; + Point2 new_pos_cache = Point2(margin_pos[0], margin_pos[1]); + Size2 new_size_cache = Point2(margin_pos[2], margin_pos[3]) - new_pos_cache; Size2 minimum_size = get_combined_minimum_size(); @@ -2534,8 +2534,8 @@ void Control::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::INT, "mouse_filter", PROPERTY_HINT_ENUM, "Stop,Pass,Ignore"), "set_mouse_filter", "get_mouse_filter"); ADD_GROUP("Size Flags", "size_flags_"); - ADD_PROPERTYNO(PropertyInfo(Variant::INT, "size_flags_horizontal", PROPERTY_HINT_FLAGS, "Fill,Expand,Shrink Center,Shrink End"), "set_h_size_flags", "get_h_size_flags"); - ADD_PROPERTYNO(PropertyInfo(Variant::INT, "size_flags_vertical", PROPERTY_HINT_FLAGS, "Fill,Expand,Shrink Center,Shrink End"), "set_v_size_flags", "get_v_size_flags"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "size_flags_horizontal", PROPERTY_HINT_FLAGS, "Fill,Expand,Shrink Center,Shrink End"), "set_h_size_flags", "get_h_size_flags"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "size_flags_vertical", PROPERTY_HINT_FLAGS, "Fill,Expand,Shrink Center,Shrink End"), "set_v_size_flags", "get_v_size_flags"); ADD_PROPERTYNO(PropertyInfo(Variant::INT, "size_flags_stretch_ratio", PROPERTY_HINT_RANGE, "1,128,0.01"), "set_stretch_ratio", "get_stretch_ratio"); ADD_GROUP("Theme", ""); ADD_PROPERTYNZ(PropertyInfo(Variant::OBJECT, "theme", PROPERTY_HINT_RESOURCE_TYPE, "Theme"), "set_theme", "get_theme"); diff --git a/scene/gui/dialogs.cpp b/scene/gui/dialogs.cpp index 60d1350405..d5e852f840 100644 --- a/scene/gui/dialogs.cpp +++ b/scene/gui/dialogs.cpp @@ -357,6 +357,9 @@ void AcceptDialog::_notification(int p_what) { if (p_what == NOTIFICATION_MODAL_CLOSE) { cancel_pressed(); + } else if (p_what == NOTIFICATION_READY) { + + _update_child_rects(); } else if (p_what == NOTIFICATION_RESIZED) { _update_child_rects(); diff --git a/scene/gui/item_list.cpp b/scene/gui/item_list.cpp index 160b7b151a..19768d344a 100644 --- a/scene/gui/item_list.cpp +++ b/scene/gui/item_list.cpp @@ -1274,7 +1274,7 @@ void ItemList::_bind_methods() { ClassDB::bind_method(D_METHOD("is_item_disabled", "idx"), &ItemList::is_item_disabled); ClassDB::bind_method(D_METHOD("set_item_metadata", "idx", "metadata"), &ItemList::set_item_metadata); - ClassDB::bind_method(D_METHOD("get_item_metadata", "idx"), &ItemList::get_item_metadata); + ClassDB::bind_method(D_METHOD("get_item_metadata:Variant", "idx"), &ItemList::get_item_metadata); ClassDB::bind_method(D_METHOD("set_item_custom_bg_color", "idx", "custom_bg_color"), &ItemList::set_item_custom_bg_color); ClassDB::bind_method(D_METHOD("get_item_custom_bg_color", "idx"), &ItemList::get_item_custom_bg_color); diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp index bc579020bd..8d3271ca8c 100644 --- a/scene/gui/line_edit.cpp +++ b/scene/gui/line_edit.cpp @@ -660,6 +660,11 @@ void LineEdit::_notification(int p_what) { Point2(x_ofs, y_ofs), Size2(1, caret_height)), cursor_color); } + + if (has_focus()) { + + OS::get_singleton()->set_ime_position(get_global_position() + Point2(x_ofs, y_ofs + caret_height)); + } } break; case NOTIFICATION_FOCUS_ENTER: { @@ -667,12 +672,17 @@ void LineEdit::_notification(int p_what) { draw_caret = true; } + Point2 cursor_pos = Point2(get_cursor_pos(), 1) * get_minimum_size().height; + OS::get_singleton()->set_ime_position(get_global_position() + cursor_pos); + if (OS::get_singleton()->has_virtual_keyboard()) OS::get_singleton()->show_virtual_keyboard(text, get_global_rect()); } break; case NOTIFICATION_FOCUS_EXIT: { + OS::get_singleton()->set_ime_position(Point2()); + if (OS::get_singleton()->has_virtual_keyboard()) OS::get_singleton()->hide_virtual_keyboard(); diff --git a/scene/gui/option_button.cpp b/scene/gui/option_button.cpp index 0806d35d48..f75e0986c1 100644 --- a/scene/gui/option_button.cpp +++ b/scene/gui/option_button.cpp @@ -283,7 +283,7 @@ void OptionButton::_bind_methods() { ClassDB::bind_method(D_METHOD("get_item_text", "idx"), &OptionButton::get_item_text); ClassDB::bind_method(D_METHOD("get_item_icon:Texture", "idx"), &OptionButton::get_item_icon); ClassDB::bind_method(D_METHOD("get_item_ID", "idx"), &OptionButton::get_item_ID); - ClassDB::bind_method(D_METHOD("get_item_metadata", "idx"), &OptionButton::get_item_metadata); + ClassDB::bind_method(D_METHOD("get_item_metadata:Variant", "idx"), &OptionButton::get_item_metadata); ClassDB::bind_method(D_METHOD("is_item_disabled", "idx"), &OptionButton::is_item_disabled); ClassDB::bind_method(D_METHOD("get_item_count"), &OptionButton::get_item_count); ClassDB::bind_method(D_METHOD("add_separator"), &OptionButton::add_separator); @@ -291,7 +291,7 @@ void OptionButton::_bind_methods() { ClassDB::bind_method(D_METHOD("select", "idx"), &OptionButton::select); ClassDB::bind_method(D_METHOD("get_selected"), &OptionButton::get_selected); ClassDB::bind_method(D_METHOD("get_selected_ID"), &OptionButton::get_selected_ID); - ClassDB::bind_method(D_METHOD("get_selected_metadata"), &OptionButton::get_selected_metadata); + ClassDB::bind_method(D_METHOD("get_selected_metadata:Variant"), &OptionButton::get_selected_metadata); ClassDB::bind_method(D_METHOD("remove_item", "idx"), &OptionButton::remove_item); ClassDB::bind_method(D_METHOD("_select_int"), &OptionButton::_select_int); diff --git a/scene/gui/popup_menu.cpp b/scene/gui/popup_menu.cpp index 74b26da580..072e90df3a 100644 --- a/scene/gui/popup_menu.cpp +++ b/scene/gui/popup_menu.cpp @@ -1096,7 +1096,7 @@ void PopupMenu::_bind_methods() { ClassDB::bind_method(D_METHOD("get_item_ID", "idx"), &PopupMenu::get_item_ID); ClassDB::bind_method(D_METHOD("get_item_index", "id"), &PopupMenu::get_item_index); ClassDB::bind_method(D_METHOD("get_item_accelerator", "idx"), &PopupMenu::get_item_accelerator); - ClassDB::bind_method(D_METHOD("get_item_metadata", "idx"), &PopupMenu::get_item_metadata); + ClassDB::bind_method(D_METHOD("get_item_metadata:Variant", "idx"), &PopupMenu::get_item_metadata); ClassDB::bind_method(D_METHOD("is_item_disabled", "idx"), &PopupMenu::is_item_disabled); ClassDB::bind_method(D_METHOD("get_item_submenu", "idx"), &PopupMenu::get_item_submenu); ClassDB::bind_method(D_METHOD("is_item_separator", "idx"), &PopupMenu::is_item_separator); diff --git a/scene/gui/slider.cpp b/scene/gui/slider.cpp index d0e708bf73..c84608ef2e 100644 --- a/scene/gui/slider.cpp +++ b/scene/gui/slider.cpp @@ -39,6 +39,10 @@ Size2 Slider::get_minimum_size() const { void Slider::_gui_input(Ref<InputEvent> p_event) { + if (!editable) { + return; + } + Ref<InputEventMouseButton> mb = p_event; if (mb.is_valid()) { @@ -158,7 +162,7 @@ void Slider::_notification(int p_what) { Size2i size = get_size(); Ref<StyleBox> style = get_stylebox("slider"); Ref<StyleBox> focus = get_stylebox("focus"); - Ref<Texture> grabber = get_icon(mouse_inside || has_focus() ? "grabber_highlight" : "grabber"); + Ref<Texture> grabber = get_icon(editable ? ((mouse_inside || has_focus()) ? "grabber_highlight" : "grabber") : "grabber_disabled"); Ref<Texture> tick = get_icon("tick"); if (orientation == VERTICAL) { @@ -231,6 +235,17 @@ void Slider::set_ticks_on_borders(bool _tob) { update(); } +void Slider::set_editable(bool p_editable) { + + editable = p_editable; + update(); +} + +bool Slider::is_editable() const { + + return editable; +} + void Slider::_bind_methods() { ClassDB::bind_method(D_METHOD("_gui_input"), &Slider::_gui_input); @@ -240,6 +255,10 @@ void Slider::_bind_methods() { ClassDB::bind_method(D_METHOD("get_ticks_on_borders"), &Slider::get_ticks_on_borders); ClassDB::bind_method(D_METHOD("set_ticks_on_borders", "ticks_on_border"), &Slider::set_ticks_on_borders); + ClassDB::bind_method(D_METHOD("set_editable", "editable"), &Slider::set_editable); + ClassDB::bind_method(D_METHOD("is_editable"), &Slider::is_editable); + + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "editable"), "set_editable", "is_editable"); ADD_PROPERTY(PropertyInfo(Variant::INT, "tick_count", PROPERTY_HINT_RANGE, "0,4096,1"), "set_ticks", "get_ticks"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "ticks_on_borders"), "set_ticks_on_borders", "get_ticks_on_borders"); ADD_PROPERTY(PropertyInfo(Variant::INT, "focus_mode", PROPERTY_HINT_ENUM, "None,Click,All"), "set_focus_mode", "get_focus_mode"); @@ -251,5 +270,6 @@ Slider::Slider(Orientation p_orientation) { grab.active = false; ticks = 0; custom_step = -1; + editable = true; set_focus_mode(FOCUS_ALL); } diff --git a/scene/gui/slider.h b/scene/gui/slider.h index 7194484058..f3cf3c6f48 100644 --- a/scene/gui/slider.h +++ b/scene/gui/slider.h @@ -46,6 +46,7 @@ class Slider : public Range { bool mouse_inside; Orientation orientation; float custom_step; + bool editable; protected: void _gui_input(Ref<InputEvent> p_event); @@ -65,6 +66,9 @@ public: void set_ticks_on_borders(bool); bool get_ticks_on_borders() const; + void set_editable(bool p_editable); + bool is_editable() const; + Slider(Orientation p_orientation = VERTICAL); }; diff --git a/scene/gui/tabs.cpp b/scene/gui/tabs.cpp index 600493b439..4316f06a53 100644 --- a/scene/gui/tabs.cpp +++ b/scene/gui/tabs.cpp @@ -593,6 +593,41 @@ void Tabs::remove_tab(int p_idx) { _ensure_no_over_offset(); } +Variant Tabs::get_drag_data(const Point2 &p_point) { + + return get_tab_idx_at_point(p_point); +} + +bool Tabs::can_drop_data(const Point2 &p_point, const Variant &p_data) const { + + return get_tab_idx_at_point(p_point) > -1; +} + +void Tabs::drop_data(const Point2 &p_point, const Variant &p_data) { + + int hover_now = get_tab_idx_at_point(p_point); + + ERR_FAIL_INDEX(hover_now, tabs.size()); + emit_signal("reposition_active_tab_request", hover_now); +} + +int Tabs::get_tab_idx_at_point(const Point2 &p_point) const { + + int hover_now = -1; + for (int i = 0; i < tabs.size(); i++) { + + if (i < offset) + continue; + + Rect2 rect = get_tab_rect(i); + if (rect.has_point(p_point)) { + hover_now = i; + } + } + + return hover_now; +} + void Tabs::set_tab_align(TabAlign p_align) { tab_align = p_align; @@ -708,7 +743,7 @@ void Tabs::ensure_tab_visible(int p_idx) { } } -Rect2 Tabs::get_tab_rect(int p_tab) { +Rect2 Tabs::get_tab_rect(int p_tab) const { return Rect2(tabs[p_tab].ofs_cache, 0, tabs[p_tab].size_cache, get_size().height); } @@ -743,6 +778,7 @@ void Tabs::_bind_methods() { ADD_SIGNAL(MethodInfo("right_button_pressed", PropertyInfo(Variant::INT, "tab"))); ADD_SIGNAL(MethodInfo("tab_close", PropertyInfo(Variant::INT, "tab"))); ADD_SIGNAL(MethodInfo("tab_hover", PropertyInfo(Variant::INT, "tab"))); + ADD_SIGNAL(MethodInfo("reposition_active_tab_request", PropertyInfo(Variant::INT, "idx_to"))); ADD_PROPERTY(PropertyInfo(Variant::INT, "current_tab", PROPERTY_HINT_RANGE, "-1,4096,1", PROPERTY_USAGE_EDITOR), "set_current_tab", "get_current_tab"); diff --git a/scene/gui/tabs.h b/scene/gui/tabs.h index 65d409c410..613c604b12 100644 --- a/scene/gui/tabs.h +++ b/scene/gui/tabs.h @@ -96,6 +96,11 @@ protected: void _notification(int p_what); static void _bind_methods(); + Variant get_drag_data(const Point2 &p_point); + bool can_drop_data(const Point2 &p_point, const Variant &p_data) const; + void drop_data(const Point2 &p_point, const Variant &p_data); + int get_tab_idx_at_point(const Point2 &p_point) const; + public: void add_tab(const String &p_str = "", const Ref<Texture> &p_icon = Ref<Texture>()); @@ -128,7 +133,7 @@ public: void ensure_tab_visible(int p_idx); void set_min_width(int p_width); - Rect2 get_tab_rect(int p_tab); + Rect2 get_tab_rect(int p_tab) const; Size2 get_minimum_size() const; Tabs(); diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index 936a9b77f8..ffa23ce771 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -1191,12 +1191,19 @@ void TextEdit::_notification(int p_what) { } } + if (has_focus()) { + OS::get_singleton()->set_ime_position(get_global_position() + cursor_pos + Point2(0, get_row_height())); + } } break; case NOTIFICATION_FOCUS_ENTER: { if (!caret_blink_enabled) { draw_caret = true; } + + Point2 cursor_pos = Point2(cursor_get_column(), cursor_get_line()) * get_row_height(); + OS::get_singleton()->set_ime_position(get_global_position() + cursor_pos); + if (OS::get_singleton()->has_virtual_keyboard()) OS::get_singleton()->show_virtual_keyboard(get_text(), get_global_rect()); if (raised_from_completion) { @@ -1206,6 +1213,8 @@ void TextEdit::_notification(int p_what) { } break; case NOTIFICATION_FOCUS_EXIT: { + OS::get_singleton()->set_ime_position(Point2()); + if (OS::get_singleton()->has_virtual_keyboard()) OS::get_singleton()->hide_virtual_keyboard(); if (raised_from_completion) { diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index d8788b4eca..44f71a2c4e 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -1953,6 +1953,14 @@ void Tree::text_editor_enter(String p_text) { c.val = evaluator->eval(p_text); else c.val = p_text.to_double(); + + if (c.step > 0) + c.val = Math::stepify(c.val, c.step); + if (c.val < c.min) + c.val = c.min; + else if (c.val > c.max) + c.val = c.max; + } break; default: { ERR_FAIL(); } } diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index 3a9968d126..824f968c49 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -2057,6 +2057,10 @@ void Viewport::_gui_input_event(Ref<InputEvent> p_event) { //keyboard focus //if (from && p_event->is_pressed() && !p_event->get_alt() && !p_event->get_metakey() && !p_event->key->get_command()) { + Ref<InputEventKey> k = p_event; + //need to check for mods, otherwise any combination of alt/ctrl/shift+<up/down/left/righ/etc> is handled here when it shouldn't be. + bool mods = k.is_valid() && (k->get_control() || k->get_alt() || k->get_shift() || k->get_metakey()); + if (from && p_event->is_pressed()) { Control *next = NULL; @@ -2070,22 +2074,22 @@ void Viewport::_gui_input_event(Ref<InputEvent> p_event) { next = from->find_prev_valid_focus(); } - if (p_event->is_action("ui_up")) { + if (!mods && p_event->is_action("ui_up")) { next = from->_get_focus_neighbour(MARGIN_TOP); } - if (p_event->is_action("ui_left")) { + if (!mods && p_event->is_action("ui_left")) { next = from->_get_focus_neighbour(MARGIN_LEFT); } - if (p_event->is_action("ui_right")) { + if (!mods && p_event->is_action("ui_right")) { next = from->_get_focus_neighbour(MARGIN_RIGHT); } - if (p_event->is_action("ui_down")) { + if (!mods && p_event->is_action("ui_down")) { next = from->_get_focus_neighbour(MARGIN_BOTTOM); } @@ -2352,7 +2356,7 @@ void Viewport::unhandled_input(const Ref<InputEvent> &p_event) { if (physics_object_picking && !get_tree()->input_handled) { - if (p_event->cast_to<InputEventMouseButton>() || p_event->cast_to<InputEventMouseMotion>() || p_event->cast_to<InputEventScreenDrag>() || p_event->cast_to<InputEventScreenTouch>()) { + if (Input::get_singleton()->get_mouse_mode() != Input::MOUSE_MODE_CAPTURED && (p_event->cast_to<InputEventMouseButton>() || p_event->cast_to<InputEventMouseMotion>() || p_event->cast_to<InputEventScreenDrag>() || p_event->cast_to<InputEventScreenTouch>())) { physics_picking_events.push_back(p_event); } } diff --git a/scene/register_scene_types.cpp b/scene/register_scene_types.cpp index 76e07db93d..c6d26f4d4c 100644 --- a/scene/register_scene_types.cpp +++ b/scene/register_scene_types.cpp @@ -164,7 +164,7 @@ #include "scene/resources/polygon_path_finder.h" //#include "scene/resources/sample.h" -//#include "scene/audio/sample_player.h" +#include "scene/3d/audio_stream_player_3d.h" #include "scene/resources/material.h" #include "scene/resources/mesh.h" #include "scene/resources/room.h" @@ -212,7 +212,7 @@ #include "scene/3d/area.h" -#include "scene/3d/body_shape.h" +#include "scene/3d/collision_shape.h" #include "scene/3d/immediate_geometry.h" #include "scene/3d/multimesh_instance.h" #include "scene/3d/physics_joint.h" @@ -532,8 +532,6 @@ void register_scene_types() { ClassDB::register_class<SphereMesh>(); ClassDB::register_virtual_class<Material>(); ClassDB::register_class<SpatialMaterial>(); - ClassDB::add_compatibility_class("FixedSpatialMaterial", "SpatialMaterial"); - ClassDB::add_compatibility_class("Mesh", "ArrayMesh"); SceneTree::add_idle_callback(SpatialMaterial::flush_changes); SpatialMaterial::init_shaders(); @@ -562,6 +560,7 @@ void register_scene_types() { OS::get_singleton()->yield(); //may take time to init + ClassDB::register_class<SpatialVelocityTracker>(); #endif ClassDB::register_class<World>(); ClassDB::register_class<Environment>(); @@ -598,6 +597,7 @@ void register_scene_types() { ClassDB::register_class<AudioStreamPlayer>(); ClassDB::register_class<AudioStreamPlayer2D>(); + ClassDB::register_class<AudioStreamPlayer3D>(); ClassDB::register_virtual_class<VideoStream>(); ClassDB::register_class<AudioStreamSample>(); @@ -628,6 +628,13 @@ void register_scene_types() { ClassDB::register_class<SceneTree>(); ClassDB::register_virtual_class<SceneTreeTimer>(); //sorry, you can't create it +#ifndef DISABLE_DEPRECATED + ClassDB::add_compatibility_class("ImageSkyBox", "PanoramaSky"); + ClassDB::add_compatibility_class("FixedSpatialMaterial", "SpatialMaterial"); + ClassDB::add_compatibility_class("Mesh", "ArrayMesh"); + +#endif + OS::get_singleton()->yield(); //may take time to init resource_saver_text = memnew(ResourceFormatSaverText); diff --git a/scene/resources/audio_stream_sample.cpp b/scene/resources/audio_stream_sample.cpp index f12e231074..c8f6007e60 100644 --- a/scene/resources/audio_stream_sample.cpp +++ b/scene/resources/audio_stream_sample.cpp @@ -231,7 +231,7 @@ void AudioStreamPlaybackSample::mix(AudioFrame *p_buffer, float p_rate_scale, in /* some 64-bit fixed point precaches */ - int64_t loop_begin_fp = ((int64_t)len << MIX_FRAC_BITS); + int64_t loop_begin_fp = ((int64_t)base->loop_begin << MIX_FRAC_BITS); int64_t loop_end_fp = ((int64_t)base->loop_end << MIX_FRAC_BITS); int64_t length_fp = ((int64_t)len << MIX_FRAC_BITS); int64_t begin_limit = (base->loop_mode != AudioStreamSample::LOOP_DISABLED) ? loop_begin_fp : 0; diff --git a/scene/resources/default_theme/default_theme.cpp b/scene/resources/default_theme/default_theme.cpp index 668a8ff66f..d70d91a17e 100644 --- a/scene/resources/default_theme/default_theme.cpp +++ b/scene/resources/default_theme/default_theme.cpp @@ -510,20 +510,24 @@ void fill_default_theme(Ref<Theme> &t, const Ref<Font> &default_font, const Ref< t->set_stylebox("slider", "HSlider", make_stylebox(hslider_bg_png, 4, 4, 4, 4)); t->set_stylebox("grabber_highlight", "HSlider", make_stylebox(hslider_grabber_hl_png, 6, 6, 6, 6)); + t->set_stylebox("grabber_disabled", "HSlider", make_stylebox(hslider_grabber_disabled_png, 6, 6, 6, 6)); t->set_stylebox("focus", "HSlider", focus); t->set_icon("grabber", "HSlider", make_icon(hslider_grabber_png)); t->set_icon("grabber_highlight", "HSlider", make_icon(hslider_grabber_hl_png)); + t->set_icon("grabber_disabled", "HSlider", make_icon(hslider_grabber_disabled_png)); t->set_icon("tick", "HSlider", make_icon(hslider_tick_png)); // VSlider t->set_stylebox("slider", "VSlider", make_stylebox(vslider_bg_png, 4, 4, 4, 4)); t->set_stylebox("grabber_highlight", "VSlider", make_stylebox(vslider_grabber_hl_png, 6, 6, 6, 6)); + t->set_stylebox("grabber_disabled", "VSlider", make_stylebox(vslider_grabber_disabled_png, 6, 6, 6, 6)); t->set_stylebox("focus", "HSlider", focus); t->set_icon("grabber", "VSlider", make_icon(vslider_grabber_png)); t->set_icon("grabber_highlight", "VSlider", make_icon(vslider_grabber_hl_png)); + t->set_icon("grabber_disabled", "VSlider", make_icon(vslider_grabber_disabled_png)); t->set_icon("tick", "VSlider", make_icon(vslider_tick_png)); // SpinBox diff --git a/scene/resources/default_theme/hslider_grabber_disabled.png b/scene/resources/default_theme/hslider_grabber_disabled.png Binary files differnew file mode 100644 index 0000000000..0d75182b8f --- /dev/null +++ b/scene/resources/default_theme/hslider_grabber_disabled.png diff --git a/scene/resources/default_theme/theme_data.h b/scene/resources/default_theme/theme_data.h index b9c401525a..70a8ad12cb 100644 --- a/scene/resources/default_theme/theme_data.h +++ b/scene/resources/default_theme/theme_data.h @@ -138,6 +138,10 @@ static const unsigned char hslider_grabber_png[] = { 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0x10, 0x0, 0x0, 0x0, 0x10, 0x8, 0x4, 0x0, 0x0, 0x0, 0xb5, 0xfa, 0x37, 0xea, 0x0, 0x0, 0x0, 0x4, 0x67, 0x41, 0x4d, 0x41, 0x0, 0x0, 0xb1, 0x8f, 0xb, 0xfc, 0x61, 0x5, 0x0, 0x0, 0x0, 0x20, 0x63, 0x48, 0x52, 0x4d, 0x0, 0x0, 0x7a, 0x26, 0x0, 0x0, 0x80, 0x84, 0x0, 0x0, 0xfa, 0x0, 0x0, 0x0, 0x80, 0xe8, 0x0, 0x0, 0x75, 0x30, 0x0, 0x0, 0xea, 0x60, 0x0, 0x0, 0x3a, 0x98, 0x0, 0x0, 0x17, 0x70, 0x9c, 0xba, 0x51, 0x3c, 0x0, 0x0, 0x0, 0x2, 0x62, 0x4b, 0x47, 0x44, 0x0, 0xff, 0x87, 0x8f, 0xcc, 0xbf, 0x0, 0x0, 0x0, 0x9, 0x70, 0x48, 0x59, 0x73, 0x0, 0x0, 0xb, 0x13, 0x0, 0x0, 0xb, 0x13, 0x1, 0x0, 0x9a, 0x9c, 0x18, 0x0, 0x0, 0x0, 0x7, 0x74, 0x49, 0x4d, 0x45, 0x7, 0xe0, 0x6, 0x16, 0x12, 0x2b, 0x5, 0x39, 0x1a, 0x32, 0x39, 0x0, 0x0, 0x1, 0x1d, 0x49, 0x44, 0x41, 0x54, 0x28, 0xcf, 0x85, 0xd1, 0x3f, 0x4b, 0xc3, 0x40, 0x18, 0xc7, 0xf1, 0xef, 0x25, 0xad, 0x89, 0xa9, 0x70, 0x83, 0x43, 0x5d, 0xc4, 0x21, 0x6e, 0x4a, 0x7, 0x47, 0xdf, 0x83, 0x53, 0x16, 0x17, 0xd7, 0x4e, 0xbe, 0x2, 0x5f, 0x85, 0x83, 0xa0, 0xb8, 0x38, 0xb8, 0x88, 0xd0, 0x51, 0x5d, 0x1c, 0x1c, 0x1c, 0x1c, 0x2a, 0xa2, 0xe8, 0x22, 0x2d, 0x82, 0x2d, 0x88, 0x54, 0xed, 0x3f, 0x1b, 0x9a, 0x78, 0x49, 0x1c, 0x9a, 0x54, 0x4f, 0x5, 0x6f, 0x3a, 0xee, 0xf9, 0xf0, 0x3c, 0x3f, 0x9e, 0x83, 0x7f, 0x8e, 0x18, 0xdf, 0x4c, 0x1c, 0x24, 0x5, 0x60, 0x40, 0x17, 0x9f, 0x48, 0x7, 0x26, 0xd3, 0xe5, 0x55, 0xd7, 0x93, 0x25, 0xe8, 0xde, 0xd4, 0x2b, 0xbb, 0x7, 0xbc, 0x8e, 0x88, 0x99, 0x82, 0xa9, 0xf2, 0xda, 0xe2, 0x86, 0x58, 0x78, 0xb7, 0x87, 0xf6, 0xc4, 0xdc, 0xcc, 0xd2, 0x6c, 0xfb, 0xf2, 0x8e, 0x10, 0xc0, 0x48, 0x81, 0x74, 0x3d, 0x55, 0xf4, 0x51, 0x28, 0x7c, 0x54, 0xd1, 0xf5, 0x90, 0xa3, 0x42, 0x6, 0xa, 0xb2, 0x14, 0x90, 0x0, 0x90, 0x10, 0x20, 0x4b, 0x14, 0x74, 0x20, 0x62, 0xf1, 0x3d, 0x7b, 0x24, 0xb2, 0x74, 0x19, 0x8, 0x83, 0x96, 0x39, 0x2e, 0xb, 0x82, 0x37, 0x94, 0xe, 0x6, 0xbd, 0xdb, 0xfc, 0x18, 0xe4, 0x49, 0x9e, 0xf0, 0x75, 0xd0, 0xbf, 0x3e, 0xb6, 0x22, 0x23, 0x7d, 0x9a, 0x4c, 0xce, 0xf6, 0xe8, 0xe9, 0x20, 0xb8, 0xaa, 0x6, 0xcd, 0x1c, 0x0, 0x39, 0x3e, 0x1e, 0x4f, 0xce, 0x7f, 0x76, 0x88, 0x1f, 0x1a, 0xcf, 0xa7, 0xe, 0x6, 0x6, 0xe, 0x8d, 0x23, 0xd5, 0x22, 0xd6, 0x41, 0x42, 0x77, 0x6b, 0x33, 0xaa, 0x59, 0x58, 0xc4, 0xf5, 0x9d, 0xed, 0x6c, 0xc0, 0xd7, 0x26, 0x21, 0xe, 0x7, 0x9d, 0xda, 0xf2, 0x8a, 0x1d, 0x1f, 0xae, 0xdf, 0x57, 0x19, 0xfe, 0x6, 0xa0, 0x9a, 0x2f, 0xf3, 0xed, 0xfe, 0xc5, 0x7e, 0x85, 0xce, 0x5f, 0xbf, 0x39, 0xca, 0x67, 0x21, 0x18, 0x66, 0x3b, 0x0, 0xf8, 0x4, 0x7e, 0x5c, 0x62, 0x33, 0x51, 0xf0, 0xbb, 0xff, 0x0, 0x0, 0x0, 0x19, 0x74, 0x45, 0x58, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x0, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x47, 0x49, 0x4d, 0x50, 0x57, 0x81, 0xe, 0x17, 0x0, 0x0, 0x0, 0x25, 0x74, 0x45, 0x58, 0x74, 0x64, 0x61, 0x74, 0x65, 0x3a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x0, 0x32, 0x30, 0x31, 0x36, 0x2d, 0x30, 0x36, 0x2d, 0x32, 0x32, 0x54, 0x32, 0x30, 0x3a, 0x33, 0x39, 0x3a, 0x32, 0x36, 0x2b, 0x30, 0x32, 0x3a, 0x30, 0x30, 0xc9, 0xad, 0xc8, 0x52, 0x0, 0x0, 0x0, 0x25, 0x74, 0x45, 0x58, 0x74, 0x64, 0x61, 0x74, 0x65, 0x3a, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x0, 0x32, 0x30, 0x31, 0x36, 0x2d, 0x30, 0x36, 0x2d, 0x32, 0x32, 0x54, 0x32, 0x30, 0x3a, 0x33, 0x39, 0x3a, 0x32, 0x36, 0x2b, 0x30, 0x32, 0x3a, 0x30, 0x30, 0xb8, 0xf0, 0x70, 0xee, 0x0, 0x0, 0x0, 0x0, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82 }; +static const unsigned char hslider_grabber_disabled_png[] = { + 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0x10, 0x0, 0x0, 0x0, 0x10, 0x8, 0x4, 0x0, 0x0, 0x0, 0xb5, 0xfa, 0x37, 0xea, 0x0, 0x0, 0x0, 0x2, 0x62, 0x4b, 0x47, 0x44, 0x0, 0xff, 0x87, 0x8f, 0xcc, 0xbf, 0x0, 0x0, 0x0, 0x9, 0x70, 0x48, 0x59, 0x73, 0x0, 0x0, 0xb, 0x13, 0x0, 0x0, 0xb, 0x13, 0x1, 0x0, 0x9a, 0x9c, 0x18, 0x0, 0x0, 0x0, 0x7, 0x74, 0x49, 0x4d, 0x45, 0x7, 0xe1, 0x7, 0xa, 0x13, 0x2f, 0x7, 0x5e, 0x49, 0xee, 0x14, 0x0, 0x0, 0x0, 0x1d, 0x69, 0x54, 0x58, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x0, 0x0, 0x0, 0x0, 0x0, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x47, 0x49, 0x4d, 0x50, 0x64, 0x2e, 0x65, 0x7, 0x0, 0x0, 0x0, 0xea, 0x49, 0x44, 0x41, 0x54, 0x28, 0xcf, 0x63, 0x60, 0x20, 0x1a, 0x30, 0x33, 0xf0, 0x32, 0xc8, 0x30, 0xa8, 0x3, 0xa1, 0xc, 0x90, 0xc5, 0x8c, 0x29, 0x2d, 0x66, 0x9c, 0xe7, 0x7a, 0xd0, 0xe7, 0xbd, 0xcf, 0x7b, 0xd7, 0x83, 0xc6, 0x79, 0xc, 0x62, 0xe8, 0x4a, 0x78, 0x8d, 0xf3, 0x3c, 0x5f, 0xb8, 0xff, 0x77, 0x1, 0x42, 0xf7, 0xff, 0x9e, 0x2f, 0x80, 0x4a, 0x78, 0x51, 0x15, 0xc8, 0xb8, 0x1e, 0x74, 0xff, 0xef, 0x4, 0x85, 0xee, 0xff, 0x5d, 0xf, 0x2, 0x2d, 0x42, 0x1, 0xea, 0x3e, 0xef, 0x5d, 0xe0, 0xa, 0x5c, 0xfe, 0xfb, 0xbc, 0x7, 0xba, 0x5, 0x5, 0x68, 0x78, 0x7f, 0x40, 0x56, 0xe0, 0xfd, 0x81, 0x41, 0x3, 0x55, 0x81, 0x92, 0xc7, 0x6d, 0x57, 0x24, 0x5, 0xee, 0xf7, 0x18, 0x54, 0x50, 0x15, 0x88, 0x3b, 0xae, 0xf7, 0x40, 0x72, 0x83, 0xfb, 0x51, 0x6, 0x29, 0x54, 0x5, 0x5c, 0x9a, 0xa9, 0xde, 0x7f, 0x9c, 0xc1, 0xd2, 0xce, 0xff, 0xbd, 0xff, 0xa9, 0xa7, 0x30, 0xf0, 0xa0, 0x85, 0x83, 0xa0, 0xa1, 0xc7, 0x3, 0x88, 0x25, 0xae, 0xff, 0x3d, 0x1f, 0x30, 0x69, 0x30, 0x30, 0xa1, 0x2a, 0x60, 0x64, 0x10, 0xb1, 0x99, 0xe3, 0x5, 0xd4, 0xed, 0xfc, 0xdf, 0xeb, 0xbf, 0xd5, 0x54, 0x6, 0x61, 0xcc, 0xa0, 0x66, 0x65, 0xd3, 0xf1, 0xb8, 0xed, 0xf6, 0xdf, 0xed, 0xbf, 0xe7, 0x1d, 0x36, 0x1d, 0x6, 0x56, 0x6c, 0xb1, 0xc1, 0x2d, 0xe3, 0xef, 0xf7, 0xc5, 0xef, 0xbb, 0x42, 0x28, 0xba, 0xfd, 0x48, 0xd6, 0x58, 0x16, 0xdb, 0xd6, 0x2, 0xe3, 0x81, 0x11, 0x57, 0x8c, 0xb2, 0x30, 0x70, 0x3, 0x75, 0xb3, 0x20, 0xb, 0x1, 0x0, 0x4, 0x5c, 0x63, 0x9b, 0x17, 0x86, 0x76, 0xe0, 0x0, 0x0, 0x0, 0x0, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82 +}; + static const unsigned char hslider_grabber_hl_png[] = { 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0x10, 0x0, 0x0, 0x0, 0x10, 0x8, 0x3, 0x0, 0x0, 0x0, 0x28, 0x2d, 0xf, 0x53, 0x0, 0x0, 0x0, 0x4, 0x67, 0x41, 0x4d, 0x41, 0x0, 0x0, 0xb1, 0x8f, 0xb, 0xfc, 0x61, 0x5, 0x0, 0x0, 0x0, 0x20, 0x63, 0x48, 0x52, 0x4d, 0x0, 0x0, 0x7a, 0x26, 0x0, 0x0, 0x80, 0x84, 0x0, 0x0, 0xfa, 0x0, 0x0, 0x0, 0x80, 0xe8, 0x0, 0x0, 0x75, 0x30, 0x0, 0x0, 0xea, 0x60, 0x0, 0x0, 0x3a, 0x98, 0x0, 0x0, 0x17, 0x70, 0x9c, 0xba, 0x51, 0x3c, 0x0, 0x0, 0x0, 0xc6, 0x50, 0x4c, 0x54, 0x45, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x48, 0x83, 0x83, 0x60, 0xaf, 0xb1, 0x65, 0xbb, 0xca, 0x61, 0xb3, 0xc2, 0x0, 0x0, 0x0, 0x63, 0xb7, 0xc8, 0x63, 0xb7, 0xc7, 0x0, 0x0, 0x0, 0x61, 0xb3, 0xbc, 0x60, 0xb1, 0xbc, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x5b, 0xa6, 0xa5, 0x63, 0xb4, 0xb6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3a, 0x69, 0x69, 0x5e, 0xb1, 0xcd, 0x5e, 0xb0, 0xcd, 0x36, 0x63, 0x63, 0x0, 0x0, 0x0, 0x17, 0x2a, 0x29, 0x60, 0xb2, 0xbd, 0x62, 0xb3, 0xbf, 0x3, 0x5, 0x5, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x55, 0x9b, 0x9a, 0x52, 0x96, 0x95, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x8, 0xf, 0xf, 0x62, 0xb4, 0xbd, 0x63, 0xb7, 0xbf, 0x0, 0x0, 0x0, 0x27, 0x48, 0x47, 0x68, 0xc0, 0xcf, 0x68, 0xc1, 0xcf, 0x2d, 0x52, 0x52, 0x51, 0x93, 0x92, 0x56, 0x9d, 0x9c, 0x0, 0x0, 0x0, 0x54, 0xa2, 0xc8, 0x4c, 0x94, 0xc2, 0x48, 0x8e, 0xc0, 0x47, 0x8c, 0xbf, 0x4b, 0x93, 0xc2, 0x4b, 0x92, 0xc2, 0x4f, 0x98, 0xc4, 0x4d, 0x96, 0xc3, 0x55, 0xa3, 0xc8, 0x53, 0x9f, 0xc7, 0x49, 0x8f, 0xc0, 0x4e, 0x97, 0xc4, 0x5a, 0xab, 0xcb, 0x5a, 0xac, 0xcc, 0x52, 0x9e, 0xc6, 0x51, 0x9d, 0xc6, 0xff, 0xff, 0xff, 0x6b, 0x1e, 0xb5, 0x61, 0x0, 0x0, 0x0, 0x31, 0x74, 0x52, 0x4e, 0x53, 0x0, 0x3, 0xd, 0x1c, 0x27, 0x16, 0x6e, 0xc1, 0xef, 0xe8, 0x28, 0xf0, 0xf0, 0x22, 0xdb, 0xde, 0x24, 0x17, 0xaf, 0xc5, 0x1a, 0xa, 0x65, 0xfc, 0xfe, 0x64, 0xc, 0x31, 0xe0, 0xe0, 0x28, 0x2, 0x1, 0x14, 0x9c, 0x95, 0x13, 0x5, 0x2c, 0xdb, 0xdc, 0xb, 0x4f, 0xf4, 0xf7, 0x55, 0x73, 0x7d, 0x4, 0x28, 0xf1, 0xfd, 0xa1, 0x0, 0x0, 0x0, 0x1, 0x62, 0x4b, 0x47, 0x44, 0x41, 0x89, 0xde, 0x6c, 0x4e, 0x0, 0x0, 0x0, 0x9, 0x70, 0x48, 0x59, 0x73, 0x0, 0x0, 0xb, 0x13, 0x0, 0x0, 0xb, 0x13, 0x1, 0x0, 0x9a, 0x9c, 0x18, 0x0, 0x0, 0x0, 0x7, 0x74, 0x49, 0x4d, 0x45, 0x7, 0xe0, 0x6, 0x16, 0x12, 0x2b, 0x4, 0x4e, 0x1d, 0x2, 0xaf, 0x0, 0x0, 0x0, 0x9e, 0x49, 0x44, 0x41, 0x54, 0x18, 0xd3, 0x6d, 0xcf, 0xd7, 0x12, 0x82, 0x30, 0x10, 0x5, 0x50, 0x48, 0x42, 0x12, 0xb0, 0x77, 0x8d, 0xd, 0xb, 0x28, 0x56, 0x12, 0x62, 0xd, 0x96, 0xff, 0xff, 0x2a, 0x61, 0xc, 0xe0, 0x83, 0xfb, 0xb4, 0xf7, 0xcc, 0xec, 0xcc, 0x5d, 0xc3, 0xf8, 0x37, 0x26, 0x80, 0x8, 0x41, 0x60, 0xe6, 0xd9, 0xc2, 0x84, 0x52, 0x82, 0xad, 0x4c, 0x0, 0xb6, 0xb9, 0x10, 0xdc, 0xc6, 0x40, 0x3, 0x24, 0x3c, 0x92, 0x32, 0xe2, 0x4, 0x6a, 0x40, 0x54, 0xc8, 0x64, 0x4, 0x45, 0x1a, 0x9c, 0xd2, 0x29, 0x85, 0x73, 0xd9, 0xd1, 0x50, 0xa9, 0x5e, 0x52, 0xb8, 0xd6, 0xea, 0x1a, 0x1a, 0xcd, 0x5b, 0xa, 0xf7, 0x56, 0x5b, 0x43, 0xa7, 0xdb, 0x53, 0x52, 0xaa, 0xfe, 0x80, 0x65, 0x3d, 0x86, 0xa3, 0x58, 0xca, 0x78, 0x3c, 0x99, 0x6a, 0x70, 0x67, 0xf3, 0x87, 0x52, 0xcf, 0xc5, 0x32, 0xaf, 0xee, 0xf9, 0xab, 0xd7, 0x7b, 0xed, 0x7b, 0xc5, 0x33, 0xc1, 0x66, 0xbb, 0xdb, 0xb3, 0x22, 0x27, 0x47, 0x87, 0xa3, 0xe5, 0xfe, 0xfe, 0x1b, 0x6, 0x2c, 0xfc, 0x6e, 0x1f, 0x93, 0x2a, 0x10, 0x62, 0x3, 0x21, 0x32, 0x75, 0x0, 0x0, 0x0, 0x19, 0x74, 0x45, 0x58, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x0, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x47, 0x49, 0x4d, 0x50, 0x57, 0x81, 0xe, 0x17, 0x0, 0x0, 0x0, 0x25, 0x74, 0x45, 0x58, 0x74, 0x64, 0x61, 0x74, 0x65, 0x3a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x0, 0x32, 0x30, 0x31, 0x36, 0x2d, 0x30, 0x36, 0x2d, 0x32, 0x32, 0x54, 0x32, 0x30, 0x3a, 0x33, 0x39, 0x3a, 0x32, 0x36, 0x2b, 0x30, 0x32, 0x3a, 0x30, 0x30, 0xc9, 0xad, 0xc8, 0x52, 0x0, 0x0, 0x0, 0x25, 0x74, 0x45, 0x58, 0x74, 0x64, 0x61, 0x74, 0x65, 0x3a, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x0, 0x32, 0x30, 0x31, 0x36, 0x2d, 0x30, 0x36, 0x2d, 0x32, 0x32, 0x54, 0x32, 0x30, 0x3a, 0x33, 0x39, 0x3a, 0x32, 0x36, 0x2b, 0x30, 0x32, 0x3a, 0x30, 0x30, 0xb8, 0xf0, 0x70, 0xee, 0x0, 0x0, 0x0, 0x0, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82 }; @@ -434,6 +438,10 @@ static const unsigned char vslider_grabber_png[] = { 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0x10, 0x0, 0x0, 0x0, 0x10, 0x8, 0x4, 0x0, 0x0, 0x0, 0xb5, 0xfa, 0x37, 0xea, 0x0, 0x0, 0x0, 0x2, 0x62, 0x4b, 0x47, 0x44, 0x0, 0xb7, 0xff, 0x88, 0x5, 0x1d, 0x0, 0x0, 0x0, 0x9, 0x70, 0x48, 0x59, 0x73, 0x0, 0x0, 0xb, 0x13, 0x0, 0x0, 0xb, 0x13, 0x1, 0x0, 0x9a, 0x9c, 0x18, 0x0, 0x0, 0x0, 0x7, 0x74, 0x49, 0x4d, 0x45, 0x7, 0xe1, 0x1, 0x12, 0x1, 0x36, 0x8, 0x50, 0xb9, 0xa7, 0x53, 0x0, 0x0, 0x0, 0x19, 0x74, 0x45, 0x58, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x0, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x47, 0x49, 0x4d, 0x50, 0x57, 0x81, 0xe, 0x17, 0x0, 0x0, 0x0, 0xf6, 0x49, 0x44, 0x41, 0x54, 0x28, 0xcf, 0xbd, 0x90, 0xb1, 0x4a, 0x42, 0x51, 0x0, 0x86, 0xbf, 0x73, 0x8e, 0x71, 0xe5, 0x9a, 0x5c, 0x41, 0xd0, 0x66, 0x6b, 0x33, 0x1c, 0x7c, 0x80, 0xa0, 0xa5, 0x17, 0x8, 0xa2, 0x2d, 0x84, 0xf0, 0x1, 0xa2, 0x25, 0xf1, 0x9, 0x9a, 0x1c, 0xda, 0x5b, 0xb2, 0x47, 0xa8, 0xa5, 0xc1, 0xa0, 0x51, 0x88, 0xa2, 0x29, 0xa, 0xc1, 0x84, 0x8, 0x43, 0xf4, 0x96, 0x17, 0xcf, 0xed, 0xde, 0x73, 0x9c, 0xcc, 0x5c, 0xda, 0xea, 0x9f, 0x3f, 0xfe, 0x9f, 0xef, 0x87, 0x3f, 0x8f, 0x0, 0x40, 0xe1, 0xe2, 0x91, 0x42, 0x10, 0x32, 0xe6, 0x3, 0x8d, 0xc1, 0xce, 0x1, 0x45, 0xb6, 0xba, 0xbb, 0xba, 0xed, 0x95, 0x8c, 0xd0, 0x7d, 0xff, 0xe1, 0xee, 0xe2, 0xb6, 0xdd, 0x79, 0x61, 0xc4, 0xd7, 0xc, 0x48, 0x57, 0x2b, 0xeb, 0xb5, 0x28, 0xaf, 0x1, 0xc5, 0x12, 0x4e, 0xac, 0x7b, 0x6f, 0x57, 0x27, 0x8d, 0xcf, 0xe, 0x1, 0x56, 0x1, 0xb9, 0x9d, 0xba, 0x28, 0x6, 0x18, 0xc, 0x31, 0x21, 0x5a, 0xda, 0x4c, 0xb6, 0xbc, 0xb9, 0x35, 0x7c, 0xea, 0xbd, 0x13, 0x4a, 0x20, 0xe5, 0x95, 0xf4, 0x6c, 0x12, 0x30, 0x84, 0xf8, 0x44, 0x6b, 0xfb, 0xcd, 0x83, 0x3d, 0x1c, 0xf9, 0x8b, 0x80, 0x4a, 0xba, 0x88, 0x4, 0x30, 0x1e, 0xdd, 0x3b, 0x1b, 0xf1, 0x77, 0x87, 0x24, 0x81, 0x8b, 0x79, 0x3e, 0x3b, 0x6a, 0x5d, 0x33, 0x51, 0x80, 0x2d, 0x38, 0x2b, 0x65, 0xb5, 0x6c, 0x91, 0x28, 0x92, 0xa4, 0xad, 0xec, 0x76, 0xcf, 0x8f, 0xf, 0x1f, 0xdb, 0xc, 0x31, 0xb, 0x9a, 0xb1, 0xd0, 0x3, 0xfb, 0xda, 0x3a, 0xbd, 0xbc, 0x89, 0xfa, 0xf8, 0x73, 0xcd, 0x9f, 0x47, 0x45, 0x4, 0xf8, 0x4, 0x18, 0xfe, 0x2f, 0x53, 0x8, 0x62, 0x5c, 0xcf, 0x1f, 0x5f, 0xcb, 0x2c, 0x0, 0x0, 0x0, 0x0, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82 }; +static const unsigned char vslider_grabber_disabled_png[] = { + 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0x10, 0x0, 0x0, 0x0, 0x10, 0x8, 0x4, 0x0, 0x0, 0x0, 0xb5, 0xfa, 0x37, 0xea, 0x0, 0x0, 0x0, 0x2, 0x62, 0x4b, 0x47, 0x44, 0x0, 0xff, 0x87, 0x8f, 0xcc, 0xbf, 0x0, 0x0, 0x0, 0x9, 0x70, 0x48, 0x59, 0x73, 0x0, 0x0, 0xb, 0x13, 0x0, 0x0, 0xb, 0x13, 0x1, 0x0, 0x9a, 0x9c, 0x18, 0x0, 0x0, 0x0, 0x7, 0x74, 0x49, 0x4d, 0x45, 0x7, 0xe1, 0x7, 0xa, 0x13, 0x2e, 0x39, 0x86, 0x33, 0xc2, 0xfe, 0x0, 0x0, 0x0, 0x1d, 0x69, 0x54, 0x58, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x0, 0x0, 0x0, 0x0, 0x0, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x47, 0x49, 0x4d, 0x50, 0x64, 0x2e, 0x65, 0x7, 0x0, 0x0, 0x0, 0xb7, 0x49, 0x44, 0x41, 0x54, 0x28, 0xcf, 0x63, 0x60, 0xa0, 0x13, 0x60, 0x66, 0xe0, 0x65, 0x90, 0x61, 0x50, 0x67, 0xd0, 0x60, 0x50, 0x62, 0x10, 0x67, 0xe0, 0x2, 0xf2, 0x19, 0x51, 0xa5, 0xc5, 0x8c, 0xf3, 0x5c, 0xf, 0xfa, 0xbc, 0xf7, 0xfe, 0xe0, 0x71, 0xdb, 0x71, 0xbd, 0x66, 0xaa, 0xa0, 0x21, 0x83, 0x8, 0x3, 0x2b, 0x42, 0x1, 0xaf, 0x71, 0x9e, 0xe7, 0xb, 0xf7, 0xff, 0x2e, 0x40, 0xe8, 0xfa, 0xdf, 0xe3, 0xbf, 0xf7, 0x1f, 0x8f, 0x7, 0x36, 0x73, 0xd8, 0x74, 0x18, 0xb8, 0x61, 0xe6, 0xc8, 0xb8, 0x1e, 0x74, 0xff, 0xef, 0x4, 0x87, 0xce, 0x40, 0x65, 0x5e, 0xff, 0x3d, 0x6e, 0xcb, 0xf8, 0x3, 0xcd, 0x61, 0x1, 0x29, 0x50, 0xf7, 0x79, 0xef, 0x82, 0xa4, 0x0, 0xa2, 0xc8, 0xed, 0xbf, 0xdf, 0x17, 0xcb, 0x62, 0xa0, 0x29, 0x78, 0x14, 0x7c, 0xb7, 0xad, 0x65, 0xe0, 0xc1, 0x69, 0x85, 0xe7, 0x1d, 0x85, 0x50, 0x6, 0x31, 0x88, 0x15, 0x48, 0x8e, 0x74, 0xf9, 0xef, 0xfe, 0xdf, 0xfb, 0x9f, 0xe7, 0x3, 0xab, 0xa9, 0x40, 0x47, 0xf2, 0xc0, 0x1c, 0x89, 0xe4, 0x4d, 0xf7, 0x7b, 0xee, 0x47, 0xd5, 0x53, 0x98, 0x34, 0x18, 0x84, 0x91, 0xbd, 0x89, 0x1c, 0x50, 0x2a, 0xc, 0x52, 0x40, 0x9d, 0x4c, 0xc, 0xf4, 0x4, 0x0, 0xf1, 0x9, 0x63, 0x9b, 0x3e, 0x2a, 0x19, 0x52, 0x0, 0x0, 0x0, 0x0, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82 +}; + static const unsigned char vslider_grabber_hl_png[] = { 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 0x0, 0x0, 0x0, 0xd, 0x49, 0x48, 0x44, 0x52, 0x0, 0x0, 0x0, 0x10, 0x0, 0x0, 0x0, 0x10, 0x8, 0x3, 0x0, 0x0, 0x0, 0x28, 0x2d, 0xf, 0x53, 0x0, 0x0, 0x0, 0xc3, 0x50, 0x4c, 0x54, 0x45, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x17, 0x2a, 0x29, 0x3a, 0x69, 0x69, 0x5b, 0xa6, 0xa5, 0x61, 0xb3, 0xbc, 0x63, 0xb7, 0xc8, 0x65, 0xbb, 0xca, 0x60, 0xaf, 0xb1, 0x48, 0x83, 0x83, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x8, 0xf, 0xf, 0x55, 0x9b, 0x9a, 0x60, 0xb2, 0xbd, 0x5e, 0xb1, 0xcd, 0x61, 0xb3, 0xc2, 0x0, 0x0, 0x0, 0x27, 0x48, 0x47, 0x62, 0xb4, 0xbd, 0x51, 0x93, 0x92, 0x68, 0xc0, 0xcf, 0x0, 0x0, 0x0, 0x56, 0x9d, 0x9c, 0x68, 0xc1, 0xcf, 0x2d, 0x52, 0x52, 0x63, 0xb7, 0xbf, 0x52, 0x96, 0x95, 0x62, 0xb3, 0xbf, 0x5e, 0xb0, 0xcd, 0x0, 0x0, 0x0, 0x3, 0x5, 0x5, 0x36, 0x63, 0x63, 0x63, 0xb4, 0xb6, 0x60, 0xb1, 0xbc, 0x63, 0xb7, 0xc7, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x55, 0xa3, 0xc8, 0x4f, 0x98, 0xc4, 0x4b, 0x93, 0xc2, 0x4c, 0x94, 0xc2, 0x54, 0xa2, 0xc8, 0x5a, 0xab, 0xcb, 0x4e, 0x97, 0xc4, 0x49, 0x8f, 0xc0, 0x47, 0x8c, 0xbf, 0x48, 0x8e, 0xc0, 0x52, 0x9e, 0xc6, 0x51, 0x9d, 0xc6, 0x5a, 0xac, 0xcc, 0x53, 0x9f, 0xc7, 0x4d, 0x96, 0xc3, 0x4b, 0x92, 0xc2, 0xff, 0xff, 0xff, 0x76, 0xbd, 0x27, 0x7a, 0x0, 0x0, 0x0, 0x1, 0x74, 0x52, 0x4e, 0x53, 0x0, 0x40, 0xe6, 0xd8, 0x66, 0x0, 0x0, 0x0, 0x1, 0x62, 0x4b, 0x47, 0x44, 0x0, 0x88, 0x5, 0x1d, 0x48, 0x0, 0x0, 0x0, 0x9, 0x70, 0x48, 0x59, 0x73, 0x0, 0x0, 0xb, 0x13, 0x0, 0x0, 0xb, 0x13, 0x1, 0x0, 0x9a, 0x9c, 0x18, 0x0, 0x0, 0x0, 0x7, 0x74, 0x49, 0x4d, 0x45, 0x7, 0xe1, 0x1, 0x12, 0x1, 0x36, 0x11, 0x34, 0xd2, 0xf, 0x93, 0x0, 0x0, 0x0, 0x19, 0x74, 0x45, 0x58, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x0, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x47, 0x49, 0x4d, 0x50, 0x57, 0x81, 0xe, 0x17, 0x0, 0x0, 0x0, 0x48, 0x49, 0x44, 0x41, 0x54, 0x18, 0xd3, 0x63, 0x60, 0xa0, 0x12, 0x10, 0x14, 0xe0, 0xe7, 0xe3, 0x45, 0xe2, 0x4b, 0x9a, 0x18, 0x1b, 0x19, 0x1a, 0x48, 0x88, 0x8b, 0xc1, 0xe4, 0x4d, 0x2c, 0x2d, 0x80, 0xc0, 0xdc, 0xcc, 0x54, 0x6, 0x22, 0x20, 0x60, 0x6c, 0x1, 0x1, 0xe6, 0x56, 0x72, 0x68, 0x2, 0xd6, 0x8a, 0xa8, 0x5a, 0x6c, 0x94, 0x11, 0x86, 0xda, 0xdb, 0xd9, 0xaa, 0xa9, 0xaa, 0x20, 0x59, 0xab, 0xa3, 0xad, 0xc5, 0x40, 0x3d, 0x0, 0x0, 0xbf, 0x8e, 0xc, 0xed, 0xed, 0xc7, 0x67, 0x72, 0x0, 0x0, 0x0, 0x0, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82 }; diff --git a/scene/resources/default_theme/vslider_grabber_disabled.png b/scene/resources/default_theme/vslider_grabber_disabled.png Binary files differnew file mode 100644 index 0000000000..c830359f45 --- /dev/null +++ b/scene/resources/default_theme/vslider_grabber_disabled.png diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp index 705702b8be..a0b192259b 100644 --- a/scene/resources/material.cpp +++ b/scene/resources/material.cpp @@ -163,7 +163,7 @@ void ShaderMaterial::_bind_methods() { ClassDB::bind_method(D_METHOD("set_shader", "shader:Shader"), &ShaderMaterial::set_shader); ClassDB::bind_method(D_METHOD("get_shader:Shader"), &ShaderMaterial::get_shader); ClassDB::bind_method(D_METHOD("set_shader_param", "param", "value"), &ShaderMaterial::set_shader_param); - ClassDB::bind_method(D_METHOD("get_shader_param", "param"), &ShaderMaterial::get_shader_param); + ClassDB::bind_method(D_METHOD("get_shader_param:Variant", "param"), &ShaderMaterial::get_shader_param); } void ShaderMaterial::get_argument_options(const StringName &p_function, int p_idx, List<String> *r_options) const { diff --git a/scene/resources/mesh_data_tool.cpp b/scene/resources/mesh_data_tool.cpp index dc3713fb57..bf1b3d40be 100644 --- a/scene/resources/mesh_data_tool.cpp +++ b/scene/resources/mesh_data_tool.cpp @@ -554,7 +554,7 @@ void MeshDataTool::_bind_methods() { ClassDB::bind_method(D_METHOD("get_vertex_weights", "idx"), &MeshDataTool::get_vertex_weights); ClassDB::bind_method(D_METHOD("set_vertex_meta", "idx", "meta"), &MeshDataTool::set_vertex_meta); - ClassDB::bind_method(D_METHOD("get_vertex_meta", "idx"), &MeshDataTool::get_vertex_meta); + ClassDB::bind_method(D_METHOD("get_vertex_meta:Variant", "idx"), &MeshDataTool::get_vertex_meta); ClassDB::bind_method(D_METHOD("get_vertex_edges", "idx"), &MeshDataTool::get_vertex_edges); ClassDB::bind_method(D_METHOD("get_vertex_faces", "idx"), &MeshDataTool::get_vertex_faces); @@ -563,13 +563,13 @@ void MeshDataTool::_bind_methods() { ClassDB::bind_method(D_METHOD("get_edge_faces", "idx", "faces"), &MeshDataTool::get_edge_faces); ClassDB::bind_method(D_METHOD("set_edge_meta", "idx", "meta"), &MeshDataTool::set_edge_meta); - ClassDB::bind_method(D_METHOD("get_edge_meta", "idx"), &MeshDataTool::get_edge_meta); + ClassDB::bind_method(D_METHOD("get_edge_meta:Variant", "idx"), &MeshDataTool::get_edge_meta); ClassDB::bind_method(D_METHOD("get_face_vertex", "idx", "vertex"), &MeshDataTool::get_face_vertex); ClassDB::bind_method(D_METHOD("get_face_edge", "idx", "edge"), &MeshDataTool::get_face_edge); ClassDB::bind_method(D_METHOD("set_face_meta", "idx", "meta"), &MeshDataTool::set_face_meta); - ClassDB::bind_method(D_METHOD("get_face_meta", "idx"), &MeshDataTool::get_face_meta); + ClassDB::bind_method(D_METHOD("get_face_meta:Variant", "idx"), &MeshDataTool::get_face_meta); ClassDB::bind_method(D_METHOD("get_face_normal", "idx"), &MeshDataTool::get_face_normal); diff --git a/scene/resources/packed_scene.cpp b/scene/resources/packed_scene.cpp index 50fbb6a162..1afaed2284 100644 --- a/scene/resources/packed_scene.cpp +++ b/scene/resources/packed_scene.cpp @@ -1671,7 +1671,7 @@ void SceneState::_bind_methods() { ClassDB::bind_method(D_METHOD("get_node_groups", "idx"), &SceneState::_get_node_groups); ClassDB::bind_method(D_METHOD("get_node_property_count", "idx"), &SceneState::get_node_property_count); ClassDB::bind_method(D_METHOD("get_node_property_name", "idx", "prop_idx"), &SceneState::get_node_property_name); - ClassDB::bind_method(D_METHOD("get_node_property_value", "idx", "prop_idx"), &SceneState::get_node_property_value); + ClassDB::bind_method(D_METHOD("get_node_property_value:Variant", "idx", "prop_idx"), &SceneState::get_node_property_value); ClassDB::bind_method(D_METHOD("get_connection_count"), &SceneState::get_connection_count); ClassDB::bind_method(D_METHOD("get_connection_source", "idx"), &SceneState::get_connection_source); ClassDB::bind_method(D_METHOD("get_connection_signal", "idx"), &SceneState::get_connection_signal); diff --git a/scene/resources/world.cpp b/scene/resources/world.cpp index 24551e9135..b84cc9563e 100644 --- a/scene/resources/world.cpp +++ b/scene/resources/world.cpp @@ -299,6 +299,13 @@ PhysicsDirectSpaceState *World::get_direct_space_state() { return PhysicsServer::get_singleton()->space_get_direct_state(space); } +void World::get_camera_list(List<Camera *> *r_cameras) { + + for (Map<Camera *, SpatialIndexer::CameraData>::Element *E = indexer->cameras.front(); E; E = E->next()) { + r_cameras->push_back(E->key()); + } +} + void World::_bind_methods() { ClassDB::bind_method(D_METHOD("get_space"), &World::get_space); diff --git a/scene/resources/world.h b/scene/resources/world.h index 5291b3974b..158086974c 100644 --- a/scene/resources/world.h +++ b/scene/resources/world.h @@ -76,6 +76,8 @@ public: void set_fallback_environment(const Ref<Environment> &p_environment); Ref<Environment> get_fallback_environment() const; + void get_camera_list(List<Camera *> *r_cameras); + PhysicsDirectSpaceState *get_direct_space_state(); World(); diff --git a/servers/audio/audio_filter_sw.cpp b/servers/audio/audio_filter_sw.cpp index 1210312ac5..4bf1cebf12 100644 --- a/servers/audio/audio_filter_sw.cpp +++ b/servers/audio/audio_filter_sw.cpp @@ -242,28 +242,49 @@ AudioFilterSW::Processor::Processor() { set_filter(NULL); } -void AudioFilterSW::Processor::set_filter(AudioFilterSW *p_filter) { +void AudioFilterSW::Processor::set_filter(AudioFilterSW *p_filter, bool p_clear_history) { - ha1 = ha2 = hb1 = hb2 = 0; + if (p_clear_history) { + ha1 = ha2 = hb1 = hb2 = 0; + } filter = p_filter; } -void AudioFilterSW::Processor::update_coeffs() { +void AudioFilterSW::Processor::update_coeffs(int p_interp_buffer_len) { if (!filter) return; - filter->prepare_coefficients(&coeffs); + if (p_interp_buffer_len) { //interpolate + Coeffs old_coeffs = coeffs; + filter->prepare_coefficients(&coeffs); + incr_coeffs.a1 = (coeffs.a1 - old_coeffs.a1) / p_interp_buffer_len; + incr_coeffs.a2 = (coeffs.a2 - old_coeffs.a2) / p_interp_buffer_len; + incr_coeffs.b0 = (coeffs.b0 - old_coeffs.b0) / p_interp_buffer_len; + incr_coeffs.b1 = (coeffs.b1 - old_coeffs.b1) / p_interp_buffer_len; + incr_coeffs.b2 = (coeffs.b2 - old_coeffs.b2) / p_interp_buffer_len; + coeffs = old_coeffs; + } else { + filter->prepare_coefficients(&coeffs); + } } -void AudioFilterSW::Processor::process(float *p_samples, int p_amount, int p_stride) { +void AudioFilterSW::Processor::process(float *p_samples, int p_amount, int p_stride, bool p_interpolate) { if (!filter) return; - for (int i = 0; i < p_amount; i++) { + if (p_interpolate) { + for (int i = 0; i < p_amount; i++) { + + process_one_interp(*p_samples); + p_samples += p_stride; + } + } else { + for (int i = 0; i < p_amount; i++) { - process_one(*p_samples); - p_samples += p_stride; + process_one(*p_samples); + p_samples += p_stride; + } } } diff --git a/servers/audio/audio_filter_sw.h b/servers/audio/audio_filter_sw.h index e1dd5e5c0e..f5a07c4c8f 100644 --- a/servers/audio/audio_filter_sw.h +++ b/servers/audio/audio_filter_sw.h @@ -60,11 +60,14 @@ public: AudioFilterSW *filter; Coeffs coeffs; float ha1, ha2, hb1, hb2; //history + Coeffs incr_coeffs; + public: - void set_filter(AudioFilterSW *p_filter); - void process(float *p_samples, int p_amount, int p_stride = 1); - void update_coeffs(); + void set_filter(AudioFilterSW *p_filter, bool p_clear_history = true); + void process(float *p_samples, int p_amount, int p_stride = 1, bool p_interpolate = false); + void update_coeffs(int p_interp_buffer_len = 0); _ALWAYS_INLINE_ void process_one(float &p_sample); + _ALWAYS_INLINE_ void process_one_interp(float &p_sample); Processor(); }; @@ -104,4 +107,20 @@ void AudioFilterSW::Processor::process_one(float &p_val) { ha1 = p_val; } +void AudioFilterSW::Processor::process_one_interp(float &p_val) { + + float pre = p_val; + p_val = (p_val * coeffs.b0 + hb1 * coeffs.b1 + hb2 * coeffs.b2 + ha1 * coeffs.a1 + ha2 * coeffs.a2); + ha2 = ha1; + hb2 = hb1; + hb1 = pre; + ha1 = p_val; + + coeffs.b0 += incr_coeffs.b0; + coeffs.b1 += incr_coeffs.b1; + coeffs.b2 += incr_coeffs.b2; + coeffs.a1 += incr_coeffs.a1; + coeffs.a2 += incr_coeffs.a2; +} + #endif // AUDIO_FILTER_SW_H diff --git a/servers/audio/audio_stream.cpp b/servers/audio/audio_stream.cpp index 14a091e27c..aa498cccad 100644 --- a/servers/audio/audio_stream.cpp +++ b/servers/audio/audio_stream.cpp @@ -81,3 +81,134 @@ void AudioStreamPlaybackResampled::mix(AudioFrame *p_buffer, float p_rate_scale, } } } +//////////////////////////////// + +void AudioStreamRandomPitch::set_audio_stream(const Ref<AudioStream> &p_audio_stream) { + + audio_stream = p_audio_stream; + if (audio_stream.is_valid()) { + for (Set<AudioStreamPlaybackRandomPitch *>::Element *E = playbacks.front(); E; E = E->next()) { + E->get()->playback = audio_stream->instance_playback(); + } + } +} + +Ref<AudioStream> AudioStreamRandomPitch::get_audio_stream() const { + + return audio_stream; +} + +void AudioStreamRandomPitch::set_random_pitch(float p_pitch) { + + if (p_pitch < 1) + p_pitch = 1; + random_pitch = p_pitch; +} + +float AudioStreamRandomPitch::get_random_pitch() const { + return random_pitch; +} + +Ref<AudioStreamPlayback> AudioStreamRandomPitch::instance_playback() { + Ref<AudioStreamPlaybackRandomPitch> playback; + playback.instance(); + if (audio_stream.is_valid()) + playback->playback = audio_stream->instance_playback(); + + playbacks.insert(playback.ptr()); + playback->random_pitch = Ref<AudioStreamRandomPitch>((AudioStreamRandomPitch *)this); + return playback; +} + +String AudioStreamRandomPitch::get_stream_name() const { + + if (audio_stream.is_valid()) { + return "Random: " + audio_stream->get_name(); + } + return "RandomPitch"; +} + +void AudioStreamRandomPitch::_bind_methods() { + + ClassDB::bind_method(D_METHOD("set_audio_stream", "stream"), &AudioStreamRandomPitch::set_audio_stream); + ClassDB::bind_method(D_METHOD("get_audio_stream"), &AudioStreamRandomPitch::get_audio_stream); + + ClassDB::bind_method(D_METHOD("set_random_pitch", "scale"), &AudioStreamRandomPitch::set_random_pitch); + ClassDB::bind_method(D_METHOD("get_random_pitch"), &AudioStreamRandomPitch::get_random_pitch); + + ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "audio_stream", PROPERTY_HINT_RESOURCE_TYPE, "AudioStream"), "set_audio_stream", "get_audio_stream"); + ADD_PROPERTY(PropertyInfo(Variant::REAL, "random_pitch", PROPERTY_HINT_RANGE, "1,16,0.01"), "set_random_pitch", "get_random_pitch"); +} + +AudioStreamRandomPitch::AudioStreamRandomPitch() { + random_pitch = 1.1; +} + +void AudioStreamPlaybackRandomPitch::start(float p_from_pos) { + playing = playback; + float range_from = 1.0 / random_pitch->random_pitch; + float range_to = random_pitch->random_pitch; + + pitch_scale = range_from + Math::randf() * (range_to - range_from); + + if (playing.is_valid()) { + playing->start(p_from_pos); + } +} + +void AudioStreamPlaybackRandomPitch::stop() { + if (playing.is_valid()) { + playing->stop(); + ; + } +} +bool AudioStreamPlaybackRandomPitch::is_playing() const { + if (playing.is_valid()) { + return playing->is_playing(); + } + + return false; +} + +int AudioStreamPlaybackRandomPitch::get_loop_count() const { + if (playing.is_valid()) { + return playing->get_loop_count(); + } + + return 0; +} + +float AudioStreamPlaybackRandomPitch::get_pos() const { + if (playing.is_valid()) { + return playing->get_pos(); + } + + return 0; +} +void AudioStreamPlaybackRandomPitch::seek_pos(float p_time) { + if (playing.is_valid()) { + playing->seek_pos(p_time); + } +} + +void AudioStreamPlaybackRandomPitch::mix(AudioFrame *p_bufer, float p_rate_scale, int p_frames) { + if (playing.is_valid()) { + playing->mix(p_bufer, p_rate_scale * pitch_scale, p_frames); + } else { + for (int i = 0; i < p_frames; i++) { + p_bufer[i] = AudioFrame(0, 0); + } + } +} + +float AudioStreamPlaybackRandomPitch::get_length() const { + if (playing.is_valid()) { + return playing->get_length(); + } + + return 0; +} + +AudioStreamPlaybackRandomPitch::~AudioStreamPlaybackRandomPitch() { + random_pitch->playbacks.erase(this); +} diff --git a/servers/audio/audio_stream.h b/servers/audio/audio_stream.h index 1cf3cd294d..a35826be21 100644 --- a/servers/audio/audio_stream.h +++ b/servers/audio/audio_stream.h @@ -31,6 +31,7 @@ #define AUDIO_STREAM_H #include "resource.h" +#include "servers/audio/audio_filter_sw.h" #include "servers/audio_server.h" class AudioStreamPlayback : public Reference { @@ -88,4 +89,58 @@ public: virtual String get_stream_name() const = 0; }; +class AudioStreamPlaybackRandomPitch; + +class AudioStreamRandomPitch : public AudioStream { + + GDCLASS(AudioStreamRandomPitch, AudioStream) + friend class AudioStreamPlaybackRandomPitch; + + Set<AudioStreamPlaybackRandomPitch *> playbacks; + Ref<AudioStream> audio_stream; + float random_pitch; + +protected: + static void _bind_methods(); + +public: + void set_audio_stream(const Ref<AudioStream> &audio_stream); + Ref<AudioStream> get_audio_stream() const; + + void set_random_pitch(float p_pitch); + float get_random_pitch() const; + + virtual Ref<AudioStreamPlayback> instance_playback(); + virtual String get_stream_name() const; + + AudioStreamRandomPitch(); +}; + +class AudioStreamPlaybackRandomPitch : public AudioStreamPlayback { + + GDCLASS(AudioStreamPlaybackRandomPitch, AudioStreamPlayback) + friend class AudioStreamRandomPitch; + + Ref<AudioStreamRandomPitch> random_pitch; + Ref<AudioStreamPlayback> playback; + Ref<AudioStreamPlayback> playing; + float pitch_scale; + +public: + virtual void start(float p_from_pos = 0.0); + virtual void stop(); + virtual bool is_playing() const; + + virtual int get_loop_count() const; //times it looped + + virtual float get_pos() const; + virtual void seek_pos(float p_time); + + virtual void mix(AudioFrame *p_bufer, float p_rate_scale, int p_frames); + + virtual float get_length() const; //if supported, otherwise return 0 + + ~AudioStreamPlaybackRandomPitch(); +}; + #endif // AUDIO_STREAM_H diff --git a/servers/audio_server.cpp b/servers/audio_server.cpp index f32784343c..43f1175c79 100644 --- a/servers/audio_server.cpp +++ b/servers/audio_server.cpp @@ -515,6 +515,15 @@ String AudioServer::get_bus_name(int p_bus) const { return buses[p_bus]->name; } +int AudioServer::get_bus_index(const StringName &p_bus_name) const { + for (int i = 0; i < buses.size(); ++i) { + if (buses[i]->name == p_bus_name) { + return i; + } + } + return -1; +} + void AudioServer::set_bus_volume_db(int p_bus, float p_volume_db) { ERR_FAIL_INDEX(p_bus, buses.size()); @@ -958,6 +967,7 @@ void AudioServer::_bind_methods() { ClassDB::bind_method(D_METHOD("set_bus_name", "bus_idx", "name"), &AudioServer::set_bus_name); ClassDB::bind_method(D_METHOD("get_bus_name", "bus_idx"), &AudioServer::get_bus_name); + ClassDB::bind_method(D_METHOD("get_bus_index", "bus_name"), &AudioServer::get_bus_index); ClassDB::bind_method(D_METHOD("set_bus_volume_db", "bus_idx", "volume_db"), &AudioServer::set_bus_volume_db); ClassDB::bind_method(D_METHOD("get_bus_volume_db", "bus_idx"), &AudioServer::get_bus_volume_db); diff --git a/servers/audio_server.h b/servers/audio_server.h index e3b4a3021c..caa07891f7 100644 --- a/servers/audio_server.h +++ b/servers/audio_server.h @@ -215,6 +215,7 @@ public: void set_bus_name(int p_bus, const String &p_name); String get_bus_name(int p_bus) const; + int get_bus_index(const StringName &p_bus_name) const; void set_bus_volume_db(int p_bus, float p_volume_db); float get_bus_volume_db(int p_bus) const; diff --git a/servers/physics/area_pair_sw.cpp b/servers/physics/area_pair_sw.cpp index 8ec001709d..5c418c473f 100644 --- a/servers/physics/area_pair_sw.cpp +++ b/servers/physics/area_pair_sw.cpp @@ -32,12 +32,13 @@ bool AreaPairSW::setup(real_t p_step) { - if (!area->test_collision_mask(body)) { - colliding = false; - return false; - } + bool result = false; - bool result = CollisionSolverSW::solve_static(body->get_shape(body_shape), body->get_transform() * body->get_shape_transform(body_shape), area->get_shape(area_shape), area->get_transform() * area->get_shape_transform(area_shape), NULL, this); + if (area->is_shape_set_as_disabled(area_shape) || body->is_shape_set_as_disabled(body_shape)) { + result = false; + } else if (area->test_collision_mask(body) && CollisionSolverSW::solve_static(body->get_shape(body_shape), body->get_transform() * body->get_shape_transform(body_shape), area->get_shape(area_shape), area->get_transform() * area->get_shape_transform(area_shape), NULL, this)) { + result = true; + } if (result != colliding) { @@ -95,14 +96,13 @@ AreaPairSW::~AreaPairSW() { bool Area2PairSW::setup(real_t p_step) { - if (!area_a->test_collision_mask(area_b)) { - colliding = false; - return false; + bool result = false; + if (area_a->is_shape_set_as_disabled(shape_a) || area_b->is_shape_set_as_disabled(shape_b)) { + result = false; + } else if (area_a->test_collision_mask(area_b) && CollisionSolverSW::solve_static(area_a->get_shape(shape_a), area_a->get_transform() * area_a->get_shape_transform(shape_a), area_b->get_shape(shape_b), area_b->get_transform() * area_b->get_shape_transform(shape_b), NULL, this)) { + result = true; } - //bool result = area_a->test_collision_mask(area_b) && CollisionSolverSW::solve(area_a->get_shape(shape_a),area_a->get_transform() * area_a->get_shape_transform(shape_a),Vector2(),area_b->get_shape(shape_b),area_b->get_transform() * area_b->get_shape_transform(shape_b),Vector2(),NULL,this); - bool result = CollisionSolverSW::solve_static(area_a->get_shape(shape_a), area_a->get_transform() * area_a->get_shape_transform(shape_a), area_b->get_shape(shape_b), area_b->get_transform() * area_b->get_shape_transform(shape_b), NULL, this); - if (result != colliding) { if (result) { diff --git a/servers/physics/body_pair_sw.cpp b/servers/physics/body_pair_sw.cpp index d740d3c384..9ada1fbc50 100644 --- a/servers/physics/body_pair_sw.cpp +++ b/servers/physics/body_pair_sw.cpp @@ -214,6 +214,11 @@ bool BodyPairSW::setup(real_t p_step) { return false; } + if (A->is_shape_set_as_disabled(shape_A) || B->is_shape_set_as_disabled(shape_B)) { + collided = false; + return false; + } + offset_B = B->get_transform().get_origin() - A->get_transform().get_origin(); validate_contacts(); @@ -313,12 +318,6 @@ bool BodyPairSW::setup(real_t p_step) { B->add_contact(global_B, c.normal, depth, shape_B, global_A, shape_A, A->get_instance_id(), A->get_self(), crB); } - if (A->is_shape_set_as_trigger(shape_A) || B->is_shape_set_as_trigger(shape_B) || (A->get_mode() <= PhysicsServer::BODY_MODE_KINEMATIC && B->get_mode() <= PhysicsServer::BODY_MODE_KINEMATIC)) { - c.active = false; - collided = false; - continue; - } - c.active = true; // Precompute normal mass, tangent mass, and bias. diff --git a/servers/physics/broad_phase_basic.cpp b/servers/physics/broad_phase_basic.cpp index 77d8538574..679b9a31fc 100644 --- a/servers/physics/broad_phase_basic.cpp +++ b/servers/physics/broad_phase_basic.cpp @@ -105,6 +105,26 @@ int BroadPhaseBasic::get_subindex(ID p_id) const { return E->get().subindex; } +int BroadPhaseBasic::cull_point(const Vector3 &p_point, CollisionObjectSW **p_results, int p_max_results, int *p_result_indices) { + + int rc = 0; + + for (Map<ID, Element>::Element *E = element_map.front(); E; E = E->next()) { + + const Rect3 aabb = E->get().aabb; + if (aabb.has_point(p_point)) { + + p_results[rc] = E->get().owner; + p_result_indices[rc] = E->get().subindex; + rc++; + if (rc >= p_max_results) + break; + } + } + + return rc; +} + int BroadPhaseBasic::cull_segment(const Vector3 &p_from, const Vector3 &p_to, CollisionObjectSW **p_results, int p_max_results, int *p_result_indices) { int rc = 0; diff --git a/servers/physics/broad_phase_basic.h b/servers/physics/broad_phase_basic.h index a285204a32..8dabf72f11 100644 --- a/servers/physics/broad_phase_basic.h +++ b/servers/physics/broad_phase_basic.h @@ -91,6 +91,7 @@ public: virtual bool is_static(ID p_id) const; virtual int get_subindex(ID p_id) const; + virtual int cull_point(const Vector3 &p_point, CollisionObjectSW **p_results, int p_max_results, int *p_result_indices = NULL); virtual int cull_segment(const Vector3 &p_from, const Vector3 &p_to, CollisionObjectSW **p_results, int p_max_results, int *p_result_indices = NULL); virtual int cull_aabb(const Rect3 &p_aabb, CollisionObjectSW **p_results, int p_max_results, int *p_result_indices = NULL); diff --git a/servers/physics/broad_phase_octree.cpp b/servers/physics/broad_phase_octree.cpp index d18da1b238..2439fbeae9 100644 --- a/servers/physics/broad_phase_octree.cpp +++ b/servers/physics/broad_phase_octree.cpp @@ -66,6 +66,11 @@ int BroadPhaseOctree::get_subindex(ID p_id) const { return octree.get_subindex(p_id); } +int BroadPhaseOctree::cull_point(const Vector3 &p_point, CollisionObjectSW **p_results, int p_max_results, int *p_result_indices) { + + return octree.cull_point(p_point, p_results, p_max_results, p_result_indices); +} + int BroadPhaseOctree::cull_segment(const Vector3 &p_from, const Vector3 &p_to, CollisionObjectSW **p_results, int p_max_results, int *p_result_indices) { return octree.cull_segment(p_from, p_to, p_results, p_max_results, p_result_indices); diff --git a/servers/physics/broad_phase_octree.h b/servers/physics/broad_phase_octree.h index 086fb0a1a3..88d72a2bd8 100644 --- a/servers/physics/broad_phase_octree.h +++ b/servers/physics/broad_phase_octree.h @@ -56,6 +56,7 @@ public: virtual bool is_static(ID p_id) const; virtual int get_subindex(ID p_id) const; + virtual int cull_point(const Vector3 &p_point, CollisionObjectSW **p_results, int p_max_results, int *p_result_indices = NULL); virtual int cull_segment(const Vector3 &p_from, const Vector3 &p_to, CollisionObjectSW **p_results, int p_max_results, int *p_result_indices = NULL); virtual int cull_aabb(const Rect3 &p_aabb, CollisionObjectSW **p_results, int p_max_results, int *p_result_indices = NULL); diff --git a/servers/physics/broad_phase_sw.h b/servers/physics/broad_phase_sw.h index 8fe901c8ef..5564cf5077 100644 --- a/servers/physics/broad_phase_sw.h +++ b/servers/physics/broad_phase_sw.h @@ -57,6 +57,7 @@ public: virtual bool is_static(ID p_id) const = 0; virtual int get_subindex(ID p_id) const = 0; + virtual int cull_point(const Vector3 &p_point, CollisionObjectSW **p_results, int p_max_results, int *p_result_indices = NULL) = 0; virtual int cull_segment(const Vector3 &p_from, const Vector3 &p_to, CollisionObjectSW **p_results, int p_max_results, int *p_result_indices = NULL) = 0; virtual int cull_aabb(const Rect3 &p_aabb, CollisionObjectSW **p_results, int p_max_results, int *p_result_indices = NULL) = 0; diff --git a/servers/physics/collision_object_sw.h b/servers/physics/collision_object_sw.h index 15082a0551..a56253e33d 100644 --- a/servers/physics/collision_object_sw.h +++ b/servers/physics/collision_object_sw.h @@ -64,9 +64,9 @@ private: Rect3 aabb_cache; //for rayqueries real_t area_cache; ShapeSW *shape; - bool trigger; + bool disabled; - Shape() { trigger = false; } + Shape() { disabled = false; } }; Vector<Shape> shapes; @@ -131,8 +131,8 @@ public: _FORCE_INLINE_ void set_ray_pickable(bool p_enable) { ray_pickable = p_enable; } _FORCE_INLINE_ bool is_ray_pickable() const { return ray_pickable; } - _FORCE_INLINE_ void set_shape_as_trigger(int p_idx, bool p_enable) { shapes[p_idx].trigger = p_enable; } - _FORCE_INLINE_ bool is_shape_set_as_trigger(int p_idx) const { return shapes[p_idx].trigger; } + _FORCE_INLINE_ void set_shape_as_disabled(int p_idx, bool p_enable) { shapes[p_idx].disabled = p_enable; } + _FORCE_INLINE_ bool is_shape_set_as_disabled(int p_idx) const { return shapes[p_idx].disabled; } _FORCE_INLINE_ void set_collision_layer(uint32_t p_layer) { collision_layer = p_layer; } _FORCE_INLINE_ uint32_t get_collision_layer() const { return collision_layer; } diff --git a/servers/physics/physics_server_sw.cpp b/servers/physics/physics_server_sw.cpp index 733bd5b63b..101bd4b185 100644 --- a/servers/physics/physics_server_sw.cpp +++ b/servers/physics/physics_server_sw.cpp @@ -330,6 +330,14 @@ void PhysicsServerSW::area_clear_shapes(RID p_area) { area->remove_shape(0); } +void PhysicsServerSW::area_set_shape_disabled(RID p_area, int p_shape_idx, bool p_disabled) { + + AreaSW *area = area_owner.get(p_area); + ERR_FAIL_COND(!area); + ERR_FAIL_INDEX(p_shape_idx, area->get_shape_count()); + area->set_shape_as_disabled(p_shape_idx, p_disabled); +} + void PhysicsServerSW::area_attach_object_instance_ID(RID p_area, ObjectID p_ID) { if (space_owner.owns(p_area)) { @@ -551,21 +559,12 @@ RID PhysicsServerSW::body_get_shape(RID p_body, int p_shape_idx) const { return shape->get_self(); } -void PhysicsServerSW::body_set_shape_as_trigger(RID p_body, int p_shape_idx, bool p_enable) { +void PhysicsServerSW::body_set_shape_disabled(RID p_body, int p_shape_idx, bool p_disabled) { BodySW *body = body_owner.get(p_body); ERR_FAIL_COND(!body); ERR_FAIL_INDEX(p_shape_idx, body->get_shape_count()); - body->set_shape_as_trigger(p_shape_idx, p_enable); -} - -bool PhysicsServerSW::body_is_shape_set_as_trigger(RID p_body, int p_shape_idx) const { - - BodySW *body = body_owner.get(p_body); - ERR_FAIL_COND_V(!body, false); - ERR_FAIL_INDEX_V(p_shape_idx, body->get_shape_count(), false); - - return body->is_shape_set_as_trigger(p_shape_idx); + body->set_shape_as_disabled(p_shape_idx, p_disabled); } Transform PhysicsServerSW::body_get_shape_transform(RID p_body, int p_shape_idx) const { @@ -875,6 +874,16 @@ bool PhysicsServerSW::body_is_ray_pickable(RID p_body) const { return body->is_ray_pickable(); } +bool PhysicsServerSW::body_test_motion(RID p_body, const Transform &p_from, const Vector3 &p_motion, float p_margin, MotionResult *r_result) { + + BodySW *body = body_owner.get(p_body); + ERR_FAIL_COND_V(!body, false); + ERR_FAIL_COND_V(!body->get_space(), false); + ERR_FAIL_COND_V(body->get_space()->is_locked(), false); + + return body->get_space()->test_body_motion(body, p_from, p_motion, p_margin, r_result); +} + /* JOINT API */ RID PhysicsServerSW::joint_create_pin(RID p_body_A, const Vector3 &p_local_A, RID p_body_B, const Vector3 &p_local_B) { @@ -1530,8 +1539,9 @@ void PhysicsServerSW::_shape_col_cbk(const Vector3 &p_point_A, const Vector3 &p_ } } +PhysicsServerSW *PhysicsServerSW::singleton = NULL; PhysicsServerSW::PhysicsServerSW() { - + singleton = this; BroadPhaseSW::create_func = BroadPhaseOctree::_create; island_count = 0; active_objects = 0; diff --git a/servers/physics/physics_server_sw.h b/servers/physics/physics_server_sw.h index a0a1bcf963..591fe4af46 100644 --- a/servers/physics/physics_server_sw.h +++ b/servers/physics/physics_server_sw.h @@ -63,6 +63,8 @@ class PhysicsServerSW : public PhysicsServer { //void _clear_query(QuerySW *p_query); public: + static PhysicsServerSW *singleton; + struct CollCbkData { int max; @@ -117,6 +119,8 @@ public: virtual void area_remove_shape(RID p_area, int p_shape_idx); virtual void area_clear_shapes(RID p_area); + virtual void area_set_shape_disabled(RID p_area, int p_shape_idx, bool p_disabled); + virtual void area_attach_object_instance_ID(RID p_area, ObjectID p_ID); virtual ObjectID area_get_object_instance_ID(RID p_area) const; @@ -156,8 +160,7 @@ public: virtual RID body_get_shape(RID p_body, int p_shape_idx) const; virtual Transform body_get_shape_transform(RID p_body, int p_shape_idx) const; - virtual void body_set_shape_as_trigger(RID p_body, int p_shape_idx, bool p_enable); - virtual bool body_is_shape_set_as_trigger(RID p_body, int p_shape_idx) const; + virtual void body_set_shape_disabled(RID p_body, int p_shape_idx, bool p_disabled); virtual void body_remove_shape(RID p_body, int p_shape_idx); virtual void body_clear_shapes(RID p_body); @@ -214,6 +217,8 @@ public: virtual void body_set_ray_pickable(RID p_body, bool p_enable); virtual bool body_is_ray_pickable(RID p_body) const; + virtual bool body_test_motion(RID p_body, const Transform &p_from, const Vector3 &p_motion, float p_margin = 0.001, MotionResult *r_result = NULL); + /* JOINT API */ virtual RID joint_create_pin(RID p_body_A, const Vector3 &p_local_A, RID p_body_B, const Vector3 &p_local_B); diff --git a/servers/physics/shape_sw.cpp b/servers/physics/shape_sw.cpp index a5cea8aff7..b4004c8c94 100644 --- a/servers/physics/shape_sw.cpp +++ b/servers/physics/shape_sw.cpp @@ -117,6 +117,20 @@ bool PlaneShapeSW::intersect_segment(const Vector3 &p_begin, const Vector3 &p_en return inters; } +bool PlaneShapeSW::intersect_point(const Vector3 &p_point) const { + + return plane.distance_to(p_point) < 0; +} + +Vector3 PlaneShapeSW::get_closest_point_to(const Vector3 &p_point) const { + + if (plane.is_point_over(p_point)) { + return plane.project(p_point); + } else { + return p_point; + } +} + Vector3 PlaneShapeSW::get_moment_of_inertia(real_t p_mass) const { return Vector3(); //wtf @@ -184,6 +198,21 @@ bool RayShapeSW::intersect_segment(const Vector3 &p_begin, const Vector3 &p_end, return false; //simply not possible } +bool RayShapeSW::intersect_point(const Vector3 &p_point) const { + + return false; //simply not possible +} + +Vector3 RayShapeSW::get_closest_point_to(const Vector3 &p_point) const { + + Vector3 s[2] = { + Vector3(0, 0, 0), + Vector3(0, 0, length) + }; + + return Geometry::get_closest_point_to_segment(p_point, s); +} + Vector3 RayShapeSW::get_moment_of_inertia(real_t p_mass) const { return Vector3(); @@ -245,6 +274,20 @@ bool SphereShapeSW::intersect_segment(const Vector3 &p_begin, const Vector3 &p_e return Geometry::segment_intersects_sphere(p_begin, p_end, Vector3(), radius, &r_result, &r_normal); } +bool SphereShapeSW::intersect_point(const Vector3 &p_point) const { + + return p_point.length() < radius; +} + +Vector3 SphereShapeSW::get_closest_point_to(const Vector3 &p_point) const { + + Vector3 p = p_point; + float l = p.length(); + if (l < radius) + return p_point; + return (p / l) * radius; +} + Vector3 SphereShapeSW::get_moment_of_inertia(real_t p_mass) const { real_t s = 0.4 * p_mass * radius * radius; @@ -390,6 +433,62 @@ bool BoxShapeSW::intersect_segment(const Vector3 &p_begin, const Vector3 &p_end, return aabb.intersects_segment(p_begin, p_end, &r_result, &r_normal); } +bool BoxShapeSW::intersect_point(const Vector3 &p_point) const { + + return (Math::abs(p_point.x) < half_extents.x && Math::abs(p_point.y) < half_extents.y && Math::abs(p_point.z) < half_extents.z); +} + +Vector3 BoxShapeSW::get_closest_point_to(const Vector3 &p_point) const { + + int outside = 0; + Vector3 min_point; + + for (int i = 0; i < 3; i++) { + + if (Math::abs(p_point[i]) > half_extents[i]) { + outside++; + if (outside == 1) { + //use plane if only one side matches + Vector3 n; + n[i] = SGN(p_point[i]); + + Plane p(n, half_extents[i]); + min_point = p.project(p_point); + } + } + } + + if (!outside) + return p_point; //it's inside, don't do anything else + + if (outside == 1) //if only above one plane, this plane clearly wins + return min_point; + + //check segments + float min_distance = 1e20; + Vector3 closest_vertex = half_extents * p_point.sign(); + Vector3 s[2] = { + closest_vertex, + closest_vertex + }; + + for (int i = 0; i < 3; i++) { + + s[1] = closest_vertex; + s[1][i] = -s[1][i]; //edge + + Vector3 closest_edge = Geometry::get_closest_point_to_segment(p_point, s); + + float d = p_point.distance_to(closest_edge); + if (d < min_distance) { + min_point = closest_edge; + min_distance = d; + } + } + + return min_point; +} + Vector3 BoxShapeSW::get_moment_of_inertia(real_t p_mass) const { real_t lx = half_extents.x; @@ -542,6 +641,32 @@ bool CapsuleShapeSW::intersect_segment(const Vector3 &p_begin, const Vector3 &p_ return collision; } +bool CapsuleShapeSW::intersect_point(const Vector3 &p_point) const { + + if (Math::abs(p_point.z) < height * 0.5) { + return Vector3(p_point.x, p_point.y, 0).length() < radius; + } else { + Vector3 p = p_point; + p.z = Math::abs(p.z) - height * 0.5; + return p.length() < radius; + } +} + +Vector3 CapsuleShapeSW::get_closest_point_to(const Vector3 &p_point) const { + + Vector3 s[2] = { + Vector3(0, 0, -height * 0.5), + Vector3(0, 0, height * 0.5), + }; + + Vector3 p = Geometry::get_closest_point_to_segment(p_point, s); + + if (p.distance_to(p_point) < radius) + return p_point; + + return p + (p_point - p).normalized() * radius; +} + Vector3 CapsuleShapeSW::get_moment_of_inertia(real_t p_mass) const { // use crappy AABB approximation @@ -738,6 +863,81 @@ bool ConvexPolygonShapeSW::intersect_segment(const Vector3 &p_begin, const Vecto return col; } +bool ConvexPolygonShapeSW::intersect_point(const Vector3 &p_point) const { + + const Geometry::MeshData::Face *faces = mesh.faces.ptr(); + int fc = mesh.faces.size(); + + for (int i = 0; i < fc; i++) { + + if (faces[i].plane.distance_to(p_point) >= 0) + return false; + } + + return true; +} + +Vector3 ConvexPolygonShapeSW::get_closest_point_to(const Vector3 &p_point) const { + + const Geometry::MeshData::Face *faces = mesh.faces.ptr(); + int fc = mesh.faces.size(); + const Vector3 *vertices = mesh.vertices.ptr(); + + bool all_inside = true; + for (int i = 0; i < fc; i++) { + + if (!faces[i].plane.is_point_over(p_point)) + continue; + + all_inside = false; + bool is_inside = true; + int ic = faces[i].indices.size(); + const int *indices = faces[i].indices.ptr(); + + for (int j = 0; j < ic; j++) { + + Vector3 a = vertices[indices[j]]; + Vector3 b = vertices[indices[(j + 1) % ic]]; + Vector3 n = (a - b).cross(faces[i].plane.normal).normalized(); + if (Plane(a, n).is_point_over(p_point)) { + is_inside = false; + break; + } + } + + if (is_inside) { + return faces[i].plane.project(p_point); + } + } + + if (all_inside) { + return p_point; + } + + float min_distance = 1e20; + Vector3 min_point; + + //check edges + const Geometry::MeshData::Edge *edges = mesh.edges.ptr(); + int ec = mesh.edges.size(); + for (int i = 0; i < ec; i++) { + + Vector3 s[2] = { + vertices[edges[i].a], + vertices[edges[i].b] + }; + + Vector3 closest = Geometry::get_closest_point_to_segment(p_point, s); + float d = closest.distance_to(p_point); + if (d < min_distance) { + min_distance = d; + min_point = closest; + } + } + + return min_point; +} + Vector3 ConvexPolygonShapeSW::get_moment_of_inertia(real_t p_mass) const { // use crappy AABB approximation @@ -880,6 +1080,16 @@ bool FaceShapeSW::intersect_segment(const Vector3 &p_begin, const Vector3 &p_end return c; } +bool FaceShapeSW::intersect_point(const Vector3 &p_point) const { + + return false; //face is flat +} + +Vector3 FaceShapeSW::get_closest_point_to(const Vector3 &p_point) const { + + return Face3(vertex[0], vertex[1], vertex[2]).get_closest_point_to(p_point); +} + Vector3 FaceShapeSW::get_moment_of_inertia(real_t p_mass) const { return Vector3(); // Sorry, but i don't think anyone cares, FaceShape! @@ -1046,6 +1256,16 @@ bool ConcavePolygonShapeSW::intersect_segment(const Vector3 &p_begin, const Vect } } +bool ConcavePolygonShapeSW::intersect_point(const Vector3 &p_point) const { + + return false; //face is flat +} + +Vector3 ConcavePolygonShapeSW::get_closest_point_to(const Vector3 &p_point) const { + + return Vector3(); +} + void ConcavePolygonShapeSW::_cull(int p_idx, _CullParams *p_params) const { const BVH *bvh = &p_params->bvh[p_idx]; @@ -1471,6 +1691,15 @@ bool HeightMapShapeSW::intersect_segment(const Vector3 &p_begin, const Vector3 & return false; } +bool HeightMapShapeSW::intersect_point(const Vector3 &p_point) const { + return false; +} + +Vector3 HeightMapShapeSW::get_closest_point_to(const Vector3 &p_point) const { + + return Vector3(); +} + void HeightMapShapeSW::cull(const Rect3 &p_local_aabb, Callback p_callback, void *p_userdata) const { } diff --git a/servers/physics/shape_sw.h b/servers/physics/shape_sw.h index 808ff0a3a1..aa1975b655 100644 --- a/servers/physics/shape_sw.h +++ b/servers/physics/shape_sw.h @@ -87,8 +87,9 @@ public: virtual void project_range(const Vector3 &p_normal, const Transform &p_transform, real_t &r_min, real_t &r_max) const = 0; virtual Vector3 get_support(const Vector3 &p_normal) const; virtual void get_supports(const Vector3 &p_normal, int p_max, Vector3 *r_supports, int &r_amount) const = 0; - + virtual Vector3 get_closest_point_to(const Vector3 &p_point) const = 0; virtual bool intersect_segment(const Vector3 &p_begin, const Vector3 &p_end, Vector3 &r_point, Vector3 &r_normal) const = 0; + virtual bool intersect_point(const Vector3 &p_point) const = 0; virtual Vector3 get_moment_of_inertia(real_t p_mass) const = 0; virtual void set_data(const Variant &p_data) = 0; @@ -134,7 +135,8 @@ public: virtual void get_supports(const Vector3 &p_normal, int p_max, Vector3 *r_supports, int &r_amount) const { r_amount = 0; } virtual bool intersect_segment(const Vector3 &p_begin, const Vector3 &p_end, Vector3 &r_result, Vector3 &r_normal) const; - + virtual bool intersect_point(const Vector3 &p_point) const; + virtual Vector3 get_closest_point_to(const Vector3 &p_point) const; virtual Vector3 get_moment_of_inertia(real_t p_mass) const; virtual void set_data(const Variant &p_data); @@ -159,6 +161,8 @@ public: virtual void get_supports(const Vector3 &p_normal, int p_max, Vector3 *r_supports, int &r_amount) const; virtual bool intersect_segment(const Vector3 &p_begin, const Vector3 &p_end, Vector3 &r_result, Vector3 &r_normal) const; + virtual bool intersect_point(const Vector3 &p_point) const; + virtual Vector3 get_closest_point_to(const Vector3 &p_point) const; virtual Vector3 get_moment_of_inertia(real_t p_mass) const; @@ -185,6 +189,8 @@ public: virtual Vector3 get_support(const Vector3 &p_normal) const; virtual void get_supports(const Vector3 &p_normal, int p_max, Vector3 *r_supports, int &r_amount) const; virtual bool intersect_segment(const Vector3 &p_begin, const Vector3 &p_end, Vector3 &r_result, Vector3 &r_normal) const; + virtual bool intersect_point(const Vector3 &p_point) const; + virtual Vector3 get_closest_point_to(const Vector3 &p_point) const; virtual Vector3 get_moment_of_inertia(real_t p_mass) const; @@ -209,6 +215,8 @@ public: virtual Vector3 get_support(const Vector3 &p_normal) const; virtual void get_supports(const Vector3 &p_normal, int p_max, Vector3 *r_supports, int &r_amount) const; virtual bool intersect_segment(const Vector3 &p_begin, const Vector3 &p_end, Vector3 &r_result, Vector3 &r_normal) const; + virtual bool intersect_point(const Vector3 &p_point) const; + virtual Vector3 get_closest_point_to(const Vector3 &p_point) const; virtual Vector3 get_moment_of_inertia(real_t p_mass) const; @@ -237,6 +245,8 @@ public: virtual Vector3 get_support(const Vector3 &p_normal) const; virtual void get_supports(const Vector3 &p_normal, int p_max, Vector3 *r_supports, int &r_amount) const; virtual bool intersect_segment(const Vector3 &p_begin, const Vector3 &p_end, Vector3 &r_result, Vector3 &r_normal) const; + virtual bool intersect_point(const Vector3 &p_point) const; + virtual Vector3 get_closest_point_to(const Vector3 &p_point) const; virtual Vector3 get_moment_of_inertia(real_t p_mass) const; @@ -261,6 +271,8 @@ public: virtual Vector3 get_support(const Vector3 &p_normal) const; virtual void get_supports(const Vector3 &p_normal, int p_max, Vector3 *r_supports, int &r_amount) const; virtual bool intersect_segment(const Vector3 &p_begin, const Vector3 &p_end, Vector3 &r_result, Vector3 &r_normal) const; + virtual bool intersect_point(const Vector3 &p_point) const; + virtual Vector3 get_closest_point_to(const Vector3 &p_point) const; virtual Vector3 get_moment_of_inertia(real_t p_mass) const; @@ -338,6 +350,8 @@ public: virtual Vector3 get_support(const Vector3 &p_normal) const; virtual bool intersect_segment(const Vector3 &p_begin, const Vector3 &p_end, Vector3 &r_result, Vector3 &r_normal) const; + virtual bool intersect_point(const Vector3 &p_point) const; + virtual Vector3 get_closest_point_to(const Vector3 &p_point) const; virtual void cull(const Rect3 &p_local_aabb, Callback p_callback, void *p_userdata) const; @@ -372,7 +386,9 @@ public: virtual void project_range(const Vector3 &p_normal, const Transform &p_transform, real_t &r_min, real_t &r_max) const; virtual Vector3 get_support(const Vector3 &p_normal) const; virtual bool intersect_segment(const Vector3 &p_begin, const Vector3 &p_end, Vector3 &r_result, Vector3 &r_normal) const; + virtual bool intersect_point(const Vector3 &p_point) const; + virtual Vector3 get_closest_point_to(const Vector3 &p_point) const; virtual void cull(const Rect3 &p_local_aabb, Callback p_callback, void *p_userdata) const; virtual Vector3 get_moment_of_inertia(real_t p_mass) const; @@ -397,6 +413,8 @@ struct FaceShapeSW : public ShapeSW { Vector3 get_support(const Vector3 &p_normal) const; virtual void get_supports(const Vector3 &p_normal, int p_max, Vector3 *r_supports, int &r_amount) const; bool intersect_segment(const Vector3 &p_begin, const Vector3 &p_end, Vector3 &r_result, Vector3 &r_normal) const; + virtual bool intersect_point(const Vector3 &p_point) const; + virtual Vector3 get_closest_point_to(const Vector3 &p_point) const; Vector3 get_moment_of_inertia(real_t p_mass) const; @@ -436,6 +454,8 @@ struct MotionShapeSW : public ShapeSW { } virtual void get_supports(const Vector3 &p_normal, int p_max, Vector3 *r_supports, int &r_amount) const { r_amount = 0; } bool intersect_segment(const Vector3 &p_begin, const Vector3 &p_end, Vector3 &r_result, Vector3 &r_normal) const { return false; } + virtual bool intersect_point(const Vector3 &p_point) const { return false; } + virtual Vector3 get_closest_point_to(const Vector3 &p_point) const { return p_point; } Vector3 get_moment_of_inertia(real_t p_mass) const { return Vector3(); } diff --git a/servers/physics/space_sw.cpp b/servers/physics/space_sw.cpp index 2bf98cecfa..2d71fd6061 100644 --- a/servers/physics/space_sw.cpp +++ b/servers/physics/space_sw.cpp @@ -45,6 +45,50 @@ _FORCE_INLINE_ static bool _match_object_type_query(CollisionObjectSW *p_object, return (1 << body->get_mode()) & p_type_mask; } +int PhysicsDirectSpaceStateSW::intersect_point(const Vector3 &p_point, ShapeResult *r_results, int p_result_max, const Set<RID> &p_exclude, uint32_t p_collision_layer, uint32_t p_object_type_mask) { + + ERR_FAIL_COND_V(space->locked, false); + int amount = space->broadphase->cull_point(p_point, space->intersection_query_results, SpaceSW::INTERSECTION_QUERY_MAX, space->intersection_query_subindex_results); + int cc = 0; + + //Transform ai = p_xform.affine_inverse(); + + for (int i = 0; i < amount; i++) { + + if (cc >= p_result_max) + break; + + if (!_match_object_type_query(space->intersection_query_results[i], p_collision_layer, p_object_type_mask)) + continue; + + //area can't be picked by ray (default) + + if (p_exclude.has(space->intersection_query_results[i]->get_self())) + continue; + + const CollisionObjectSW *col_obj = space->intersection_query_results[i]; + int shape_idx = space->intersection_query_subindex_results[i]; + + Transform inv_xform = col_obj->get_transform() * col_obj->get_shape_transform(shape_idx); + inv_xform.affine_invert(); + + if (!col_obj->get_shape(shape_idx)->intersect_point(inv_xform.xform(p_point))) + continue; + + r_results[cc].collider_id = col_obj->get_instance_id(); + if (r_results[cc].collider_id != 0) + r_results[cc].collider = ObjectDB::get_instance(r_results[cc].collider_id); + else + r_results[cc].collider = NULL; + r_results[cc].rid = col_obj->get_self(); + r_results[cc].shape = shape_idx; + + cc++; + } + + return cc; +} + bool PhysicsDirectSpaceStateSW::intersect_ray(const Vector3 &p_from, const Vector3 &p_to, RayResult &r_result, const Set<RID> &p_exclude, uint32_t p_collision_layer, uint32_t p_object_type_mask, bool p_pick_ray) { ERR_FAIL_COND_V(space->locked, false); @@ -428,6 +472,48 @@ bool PhysicsDirectSpaceStateSW::rest_info(RID p_shape, const Transform &p_shape_ return true; } +Vector3 PhysicsDirectSpaceStateSW::get_closest_point_to_object_volume(RID p_object, const Vector3 p_point) const { + + CollisionObjectSW *obj = NULL; + obj = PhysicsServerSW::singleton->area_owner.getornull(p_object); + if (!obj) { + obj = PhysicsServerSW::singleton->body_owner.getornull(p_object); + } + ERR_FAIL_COND_V(!obj, Vector3()); + + ERR_FAIL_COND_V(obj->get_space() != space, Vector3()); + + float min_distance = 1e20; + Vector3 min_point; + + bool shapes_found = false; + + for (int i = 0; i < obj->get_shape_count(); i++) { + + if (obj->is_shape_set_as_disabled(i)) + continue; + + Transform shape_xform = obj->get_transform() * obj->get_shape_transform(i); + ShapeSW *shape = obj->get_shape(i); + + Vector3 point = shape->get_closest_point_to(shape_xform.affine_inverse().xform(p_point)); + point = shape_xform.xform(point); + + float dist = point.distance_to(p_point); + if (dist < min_distance) { + min_distance = dist; + min_point = point; + } + shapes_found = true; + } + + if (!shapes_found) { + return obj->get_transform().origin; //no shapes found, use distance to origin. + } else { + return min_point; + } +} + PhysicsDirectSpaceStateSW::PhysicsDirectSpaceStateSW() { space = NULL; @@ -435,6 +521,337 @@ PhysicsDirectSpaceStateSW::PhysicsDirectSpaceStateSW() { //////////////////////////////////////////////////////////////////////////////////////////////////////////// +int SpaceSW::_cull_aabb_for_body(BodySW *p_body, const Rect3 &p_aabb) { + + int amount = broadphase->cull_aabb(p_aabb, intersection_query_results, INTERSECTION_QUERY_MAX, intersection_query_subindex_results); + + for (int i = 0; i < amount; i++) { + + bool keep = true; + + if (intersection_query_results[i] == p_body) + keep = false; + else if (intersection_query_results[i]->get_type() == CollisionObjectSW::TYPE_AREA) + keep = false; + else if ((static_cast<BodySW *>(intersection_query_results[i])->test_collision_mask(p_body)) == 0) + keep = false; + else if (static_cast<BodySW *>(intersection_query_results[i])->has_exception(p_body->get_self()) || p_body->has_exception(intersection_query_results[i]->get_self())) + keep = false; + else if (static_cast<BodySW *>(intersection_query_results[i])->is_shape_set_as_disabled(intersection_query_subindex_results[i])) + keep = false; + + if (!keep) { + + if (i < amount - 1) { + SWAP(intersection_query_results[i], intersection_query_results[amount - 1]); + SWAP(intersection_query_subindex_results[i], intersection_query_subindex_results[amount - 1]); + } + + amount--; + i--; + } + } + + return amount; +} + +bool SpaceSW::test_body_motion(BodySW *p_body, const Transform &p_from, const Vector3 &p_motion, real_t p_margin, PhysicsServer::MotionResult *r_result) { + + //give me back regular physics engine logic + //this is madness + //and most people using this function will think + //what it does is simpler than using physics + //this took about a week to get right.. + //but is it right? who knows at this point.. + + if (r_result) { + r_result->collider_id = 0; + r_result->collider_shape = 0; + } + Rect3 body_aabb; + + for (int i = 0; i < p_body->get_shape_count(); i++) { + + if (i == 0) + body_aabb = p_body->get_shape_aabb(i); + else + body_aabb = body_aabb.merge(p_body->get_shape_aabb(i)); + } + + // Undo the currently transform the physics server is aware of and apply the provided one + body_aabb = p_from.xform(p_body->get_inv_transform().xform(body_aabb)); + body_aabb = body_aabb.grow(p_margin); + + Transform body_transform = p_from; + + { + //STEP 1, FREE BODY IF STUCK + + const int max_results = 32; + int recover_attempts = 4; + Vector3 sr[max_results * 2]; + + do { + + PhysicsServerSW::CollCbkData cbk; + cbk.max = max_results; + cbk.amount = 0; + cbk.ptr = sr; + + CollisionSolverSW::CallbackResult cbkres = NULL; + + PhysicsServerSW::CollCbkData *cbkptr = NULL; + cbkptr = &cbk; + cbkres = PhysicsServerSW::_shape_col_cbk; + + bool collided = false; + + int amount = _cull_aabb_for_body(p_body, body_aabb); + + for (int j = 0; j < p_body->get_shape_count(); j++) { + if (p_body->is_shape_set_as_disabled(j)) + continue; + + Transform body_shape_xform = body_transform * p_body->get_shape_transform(j); + ShapeSW *body_shape = p_body->get_shape(j); + for (int i = 0; i < amount; i++) { + + const CollisionObjectSW *col_obj = intersection_query_results[i]; + int shape_idx = intersection_query_subindex_results[i]; + + if (CollisionSolverSW::solve_static(body_shape, body_shape_xform, col_obj->get_shape(shape_idx), col_obj->get_transform() * col_obj->get_shape_transform(shape_idx), cbkres, cbkptr, NULL, p_margin)) { + collided = cbk.amount > 0; + } + } + } + + if (!collided) { + break; + } + + Vector3 recover_motion; + + for (int i = 0; i < cbk.amount; i++) { + + Vector3 a = sr[i * 2 + 0]; + Vector3 b = sr[i * 2 + 1]; + +#if 0 + Vector3 rel = b-a; + real_t d = rel.length(); + if (d==0) + continue; + + Vector3 n = rel/d; + real_t traveled = n.dot(recover_motion); + a+=n*traveled; + + real_t d = a.distance_to(b); + if (d<margin) + continue; +#endif + recover_motion += (b - a) * 0.4; + } + + if (recover_motion == Vector3()) { + collided = false; + break; + } + + body_transform.origin += recover_motion; + body_aabb.position += recover_motion; + + recover_attempts--; + + } while (recover_attempts); + } + + real_t safe = 1.0; + real_t unsafe = 1.0; + int best_shape = -1; + + { + // STEP 2 ATTEMPT MOTION + + Rect3 motion_aabb = body_aabb; + motion_aabb.position += p_motion; + motion_aabb = motion_aabb.merge(body_aabb); + + int amount = _cull_aabb_for_body(p_body, motion_aabb); + + for (int j = 0; j < p_body->get_shape_count(); j++) { + + if (p_body->is_shape_set_as_disabled(j)) + continue; + + Transform body_shape_xform = body_transform * p_body->get_shape_transform(j); + ShapeSW *body_shape = p_body->get_shape(j); + + Transform body_shape_xform_inv = body_shape_xform.affine_inverse(); + MotionShapeSW mshape; + mshape.shape = body_shape; + mshape.motion = body_shape_xform_inv.basis.xform(p_motion); + + bool stuck = false; + + real_t best_safe = 1; + real_t best_unsafe = 1; + + for (int i = 0; i < amount; i++) { + + const CollisionObjectSW *col_obj = intersection_query_results[i]; + int shape_idx = intersection_query_subindex_results[i]; + + //test initial overlap, does it collide if going all the way? + Vector3 point_A, point_B; + Vector3 sep_axis = p_motion.normalized(); + + Transform col_obj_xform = col_obj->get_transform() * col_obj->get_shape_transform(shape_idx); + //test initial overlap, does it collide if going all the way? + if (CollisionSolverSW::solve_distance(&mshape, body_shape_xform, col_obj->get_shape(shape_idx), col_obj_xform, point_A, point_B, motion_aabb, &sep_axis)) { + //print_line("failed motion cast (no collision)"); + continue; + } + sep_axis = p_motion.normalized(); + + if (!CollisionSolverSW::solve_distance(body_shape, body_shape_xform, col_obj->get_shape(shape_idx), col_obj_xform, point_A, point_B, motion_aabb, &sep_axis)) { + //print_line("failed motion cast (no collision)"); + stuck = true; + break; + } + + //just do kinematic solving + real_t low = 0; + real_t hi = 1; + Vector3 mnormal = p_motion.normalized(); + + for (int i = 0; i < 8; i++) { //steps should be customizable.. + + real_t ofs = (low + hi) * 0.5; + + Vector3 sep = mnormal; //important optimization for this to work fast enough + + mshape.motion = body_shape_xform_inv.basis.xform(p_motion * ofs); + + Vector3 lA, lB; + + bool collided = !CollisionSolverSW::solve_distance(&mshape, body_shape_xform, col_obj->get_shape(shape_idx), col_obj_xform, lA, lB, motion_aabb, &sep); + + if (collided) { + + //print_line(itos(i)+": "+rtos(ofs)); + hi = ofs; + } else { + + point_A = lA; + point_B = lB; + low = ofs; + } + } + + if (low < best_safe) { + best_safe = low; + best_unsafe = hi; + } + } + + if (stuck) { + + safe = 0; + unsafe = 0; + best_shape = j; //sadly it's the best + break; + } + if (best_safe == 1.0) { + continue; + } + if (best_safe < safe) { + + safe = best_safe; + unsafe = best_unsafe; + best_shape = j; + } + } + } + + bool collided = false; + if (safe >= 1) { + //not collided + collided = false; + if (r_result) { + + r_result->motion = p_motion; + r_result->remainder = Vector3(); + r_result->motion += (body_transform.get_origin() - p_from.get_origin()); + } + + } else { + + //it collided, let's get the rest info in unsafe advance + Transform ugt = body_transform; + ugt.origin += p_motion * unsafe; + + _RestCallbackData rcd; + rcd.best_len = 0; + rcd.best_object = NULL; + rcd.best_shape = 0; + + Transform body_shape_xform = ugt * p_body->get_shape_transform(best_shape); + ShapeSW *body_shape = p_body->get_shape(best_shape); + + body_aabb.position += p_motion * unsafe; + + int amount = _cull_aabb_for_body(p_body, body_aabb); + + for (int i = 0; i < amount; i++) { + + const CollisionObjectSW *col_obj = intersection_query_results[i]; + int shape_idx = intersection_query_subindex_results[i]; + + rcd.object = col_obj; + rcd.shape = shape_idx; + bool sc = CollisionSolverSW::solve_static(body_shape, body_shape_xform, col_obj->get_shape(shape_idx), col_obj->get_transform() * col_obj->get_shape_transform(shape_idx), _rest_cbk_result, &rcd, NULL, p_margin); + if (!sc) + continue; + } + + if (rcd.best_len != 0) { + + if (r_result) { + r_result->collider = rcd.best_object->get_self(); + r_result->collider_id = rcd.best_object->get_instance_id(); + r_result->collider_shape = rcd.best_shape; + r_result->collision_local_shape = best_shape; + r_result->collision_normal = rcd.best_normal; + r_result->collision_point = rcd.best_contact; + //r_result->collider_metadata = rcd.best_object->get_shape_metadata(rcd.best_shape); + + const BodySW *body = static_cast<const BodySW *>(rcd.best_object); + //Vector3 rel_vec = r_result->collision_point - body->get_transform().get_origin(); + // r_result->collider_velocity = Vector3(-body->get_angular_velocity() * rel_vec.y, body->get_angular_velocity() * rel_vec.x) + body->get_linear_velocity(); + r_result->collider_velocity = body->get_linear_velocity() + (body->get_angular_velocity()).cross(body->get_transform().origin - rcd.best_contact); // * mPos); + + r_result->motion = safe * p_motion; + r_result->remainder = p_motion - safe * p_motion; + r_result->motion += (body_transform.get_origin() - p_from.get_origin()); + } + + collided = true; + } else { + if (r_result) { + + r_result->motion = p_motion; + r_result->remainder = Vector3(); + r_result->motion += (body_transform.get_origin() - p_from.get_origin()); + } + + collided = false; + } + } + + return collided; +} + void *SpaceSW::_broadphase_pair(CollisionObjectSW *A, int p_subindex_A, CollisionObjectSW *B, int p_subindex_B, void *p_self) { CollisionObjectSW::Type type_A = A->get_type(); diff --git a/servers/physics/space_sw.h b/servers/physics/space_sw.h index b0e54f647c..6ef12dbeae 100644 --- a/servers/physics/space_sw.h +++ b/servers/physics/space_sw.h @@ -47,11 +47,13 @@ class PhysicsDirectSpaceStateSW : public PhysicsDirectSpaceState { public: SpaceSW *space; + virtual int intersect_point(const Vector3 &p_point, ShapeResult *r_results, int p_result_max, const Set<RID> &p_exclude = Set<RID>(), uint32_t p_collision_layer = 0xFFFFFFFF, uint32_t p_object_type_mask = TYPE_MASK_COLLISION); virtual bool intersect_ray(const Vector3 &p_from, const Vector3 &p_to, RayResult &r_result, const Set<RID> &p_exclude = Set<RID>(), uint32_t p_collision_layer = 0xFFFFFFFF, uint32_t p_object_type_mask = TYPE_MASK_COLLISION, bool p_pick_ray = false); virtual int intersect_shape(const RID &p_shape, const Transform &p_xform, real_t p_margin, ShapeResult *r_results, int p_result_max, const Set<RID> &p_exclude = Set<RID>(), uint32_t p_collision_layer = 0xFFFFFFFF, uint32_t p_object_type_mask = TYPE_MASK_COLLISION); virtual bool cast_motion(const RID &p_shape, const Transform &p_xform, const Vector3 &p_motion, real_t p_margin, real_t &p_closest_safe, real_t &p_closest_unsafe, const Set<RID> &p_exclude = Set<RID>(), uint32_t p_collision_layer = 0xFFFFFFFF, uint32_t p_object_type_mask = TYPE_MASK_COLLISION, ShapeRestInfo *r_info = NULL); virtual bool collide_shape(RID p_shape, const Transform &p_shape_xform, real_t p_margin, Vector3 *r_results, int p_result_max, int &r_result_count, const Set<RID> &p_exclude = Set<RID>(), uint32_t p_collision_layer = 0xFFFFFFFF, uint32_t p_object_type_mask = TYPE_MASK_COLLISION); virtual bool rest_info(RID p_shape, const Transform &p_shape_xform, real_t p_margin, ShapeRestInfo *r_info, const Set<RID> &p_exclude = Set<RID>(), uint32_t p_collision_layer = 0xFFFFFFFF, uint32_t p_object_type_mask = TYPE_MASK_COLLISION); + virtual Vector3 get_closest_point_to_object_volume(RID p_object, const Vector3 p_point) const; PhysicsDirectSpaceStateSW(); }; @@ -120,6 +122,8 @@ private: friend class PhysicsDirectSpaceStateSW; + int _cull_aabb_for_body(BodySW *p_body, const Rect3 &p_aabb); + public: _FORCE_INLINE_ void set_self(const RID &p_self) { self = p_self; } _FORCE_INLINE_ RID get_self() const { return self; } @@ -192,6 +196,8 @@ public: void set_elapsed_time(ElapsedTime p_time, uint64_t p_msec) { elapsed_time[p_time] = p_msec; } uint64_t get_elapsed_time(ElapsedTime p_time) const { return elapsed_time[p_time]; } + bool test_body_motion(BodySW *p_body, const Transform &p_from, const Vector3 &p_motion, real_t p_margin, PhysicsServer::MotionResult *r_result); + SpaceSW(); ~SpaceSW(); }; diff --git a/servers/physics_2d/space_2d_sw.cpp b/servers/physics_2d/space_2d_sw.cpp index 7049a9cf34..c407a17bc6 100644 --- a/servers/physics_2d/space_2d_sw.cpp +++ b/servers/physics_2d/space_2d_sw.cpp @@ -809,162 +809,6 @@ bool Space2DSW::test_body_motion(Body2DSW *p_body, const Transform2D &p_from, co } return collided; - -#if 0 - //give me back regular physics engine logic - //this is madness - //and most people using this function will think - //what it does is simpler than using physics - //this took about a week to get right.. - //but is it right? who knows at this point.. - - - colliding=false; - ERR_FAIL_COND_V(!is_inside_tree(),Vector2()); - Physics2DDirectSpaceState *dss = Physics2DServer::get_singleton()->space_get_direct_state(get_world_2d()->get_space()); - ERR_FAIL_COND_V(!dss,Vector2()); - const int max_shapes=32; - Vector2 sr[max_shapes*2]; - int res_shapes; - - Set<RID> exclude; - exclude.insert(get_rid()); - - - //recover first - int recover_attempts=4; - - bool collided=false; - uint32_t mask=0; - if (collide_static) - mask|=Physics2DDirectSpaceState::TYPE_MASK_STATIC_BODY; - if (collide_kinematic) - mask|=Physics2DDirectSpaceState::TYPE_MASK_KINEMATIC_BODY; - if (collide_rigid) - mask|=Physics2DDirectSpaceState::TYPE_MASK_RIGID_BODY; - if (collide_character) - mask|=Physics2DDirectSpaceState::TYPE_MASK_CHARACTER_BODY; - - //print_line("motion: "+p_motion+" margin: "+rtos(margin)); - - //print_line("margin: "+rtos(margin)); - do { - - //motion recover - for(int i=0;i<get_shape_count();i++) { - - if (is_shape_set_as_trigger(i)) - continue; - if (dss->collide_shape(get_shape(i)->get_rid(), get_global_transform() * get_shape_transform(i),Vector2(),margin,sr,max_shapes,res_shapes,exclude,get_layer_mask(),mask)) - collided=true; - - } - - if (!collided) - break; - - Vector2 recover_motion; - - for(int i=0;i<res_shapes;i++) { - - Vector2 a = sr[i*2+0]; - Vector2 b = sr[i*2+1]; - - real_t d = a.distance_to(b); - - /* - if (d<margin) - continue; - */ - recover_motion+=(b-a)*0.4; - } - - if (recover_motion==Vector2()) { - collided=false; - break; - } - - Matrix32 gt = get_global_transform(); - gt.elements[2]+=recover_motion; - set_global_transform(gt); - - recover_attempts--; - - } while (recover_attempts); - - - //move second - real_t safe = 1.0; - real_t unsafe = 1.0; - int best_shape=-1; - - for(int i=0;i<get_shape_count();i++) { - - if (is_shape_set_as_trigger(i)) - continue; - - real_t lsafe,lunsafe; - bool valid = dss->cast_motion(get_shape(i)->get_rid(), get_global_transform() * get_shape_transform(i), p_motion, 0,lsafe,lunsafe,exclude,get_layer_mask(),mask); - //print_line("shape: "+itos(i)+" travel:"+rtos(ltravel)); - if (!valid) { - - safe=0; - unsafe=0; - best_shape=i; //sadly it's the best - break; - } - if (lsafe==1.0) { - continue; - } - if (lsafe < safe) { - - safe=lsafe; - unsafe=lunsafe; - best_shape=i; - } - } - - - //print_line("best shape: "+itos(best_shape)+" motion "+p_motion); - - if (safe>=1) { - //not collided - colliding=false; - } else { - - //it collided, let's get the rest info in unsafe advance - Matrix32 ugt = get_global_transform(); - ugt.elements[2]+=p_motion*unsafe; - Physics2DDirectSpaceState::ShapeRestInfo rest_info; - bool c2 = dss->rest_info(get_shape(best_shape)->get_rid(), ugt*get_shape_transform(best_shape), Vector2(), margin,&rest_info,exclude,get_layer_mask(),mask); - if (!c2) { - //should not happen, but floating point precision is so weird.. - - colliding=false; - } else { - - - //print_line("Travel: "+rtos(travel)); - colliding=true; - collision=rest_info.point; - normal=rest_info.normal; - collider=rest_info.collider_id; - collider_vel=rest_info.linear_velocity; - collider_shape=rest_info.shape; - collider_metadata=rest_info.metadata; - } - - } - - Vector2 motion=p_motion*safe; - Matrix32 gt = get_global_transform(); - gt.elements[2]+=motion; - set_global_transform(gt); - - return p_motion-motion; - -#endif - return false; } void *Space2DSW::_broadphase_pair(CollisionObject2DSW *A, int p_subindex_A, CollisionObject2DSW *B, int p_subindex_B, void *p_self) { @@ -1186,7 +1030,7 @@ Space2DSW::Space2DSW() { contact_max_allowed_penetration = 0.3; constraint_bias = 0.2; - body_linear_velocity_sleep_threshold = GLOBAL_DEF("physics/2d/sleep_threashold_linear", 2.0); + body_linear_velocity_sleep_threshold = GLOBAL_DEF("physics/2d/sleep_threshold_linear", 2.0); body_angular_velocity_sleep_threshold = GLOBAL_DEF("physics/2d/sleep_threshold_angular", (8.0 / 180.0 * Math_PI)); body_time_to_sleep = GLOBAL_DEF("physics/2d/time_before_sleep", 0.5); diff --git a/servers/physics_server.h b/servers/physics_server.h index 21c65a74d0..0f07fca637 100644 --- a/servers/physics_server.h +++ b/servers/physics_server.h @@ -156,26 +156,28 @@ protected: static void _bind_methods(); public: - struct RayResult { + struct ShapeResult { - Vector3 position; - Vector3 normal; RID rid; ObjectID collider_id; Object *collider; int shape; }; - virtual bool intersect_ray(const Vector3 &p_from, const Vector3 &p_to, RayResult &r_result, const Set<RID> &p_exclude = Set<RID>(), uint32_t p_collision_layer = 0xFFFFFFFF, uint32_t p_object_type_mask = TYPE_MASK_COLLISION, bool p_pick_ray = false) = 0; + virtual int intersect_point(const Vector3 &p_point, ShapeResult *r_results, int p_result_max, const Set<RID> &p_exclude = Set<RID>(), uint32_t p_collision_layer = 0xFFFFFFFF, uint32_t p_object_type_mask = TYPE_MASK_COLLISION) = 0; - struct ShapeResult { + struct RayResult { + Vector3 position; + Vector3 normal; RID rid; ObjectID collider_id; Object *collider; int shape; }; + virtual bool intersect_ray(const Vector3 &p_from, const Vector3 &p_to, RayResult &r_result, const Set<RID> &p_exclude = Set<RID>(), uint32_t p_collision_layer = 0xFFFFFFFF, uint32_t p_object_type_mask = TYPE_MASK_COLLISION, bool p_pick_ray = false) = 0; + virtual int intersect_shape(const RID &p_shape, const Transform &p_xform, float p_margin, ShapeResult *r_results, int p_result_max, const Set<RID> &p_exclude = Set<RID>(), uint32_t p_collision_layer = 0xFFFFFFFF, uint32_t p_object_type_mask = TYPE_MASK_COLLISION) = 0; struct ShapeRestInfo { @@ -194,6 +196,8 @@ public: virtual bool rest_info(RID p_shape, const Transform &p_shape_xform, float p_margin, ShapeRestInfo *r_info, const Set<RID> &p_exclude = Set<RID>(), uint32_t p_collision_layer = 0xFFFFFFFF, uint32_t p_object_type_mask = TYPE_MASK_COLLISION) = 0; + virtual Vector3 get_closest_point_to_object_volume(RID p_object, const Vector3 p_point) const = 0; + PhysicsDirectSpaceState(); }; @@ -322,6 +326,8 @@ public: virtual void area_remove_shape(RID p_area, int p_shape_idx) = 0; virtual void area_clear_shapes(RID p_area) = 0; + virtual void area_set_shape_disabled(RID p_area, int p_shape_idx, bool p_disabled) = 0; + virtual void area_attach_object_instance_ID(RID p_area, ObjectID p_ID) = 0; virtual ObjectID area_get_object_instance_ID(RID p_area) const = 0; @@ -370,12 +376,11 @@ public: virtual RID body_get_shape(RID p_body, int p_shape_idx) const = 0; virtual Transform body_get_shape_transform(RID p_body, int p_shape_idx) const = 0; - virtual void body_set_shape_as_trigger(RID p_body, int p_shape_idx, bool p_enable) = 0; - virtual bool body_is_shape_set_as_trigger(RID p_body, int p_shape_idx) const = 0; - virtual void body_remove_shape(RID p_body, int p_shape_idx) = 0; virtual void body_clear_shapes(RID p_body) = 0; + virtual void body_set_shape_disabled(RID p_body, int p_shape_idx, bool p_disabled) = 0; + virtual void body_attach_object_instance_ID(RID p_body, uint32_t p_ID) = 0; virtual uint32_t body_get_object_instance_ID(RID p_body) const = 0; @@ -458,6 +463,23 @@ public: virtual void body_set_ray_pickable(RID p_body, bool p_enable) = 0; virtual bool body_is_ray_pickable(RID p_body) const = 0; + struct MotionResult { + + Vector3 motion; + Vector3 remainder; + + Vector3 collision_point; + Vector3 collision_normal; + Vector3 collider_velocity; + int collision_local_shape; + ObjectID collider_id; + RID collider; + int collider_shape; + Variant collider_metadata; + }; + + virtual bool body_test_motion(RID p_body, const Transform &p_from, const Vector3 &p_motion, float p_margin = 0.001, MotionResult *r_result = NULL) = 0; + /* JOINT API */ enum JointType { diff --git a/servers/register_server_types.cpp b/servers/register_server_types.cpp index 79b994dd27..e97a6baeba 100644 --- a/servers/register_server_types.cpp +++ b/servers/register_server_types.cpp @@ -84,6 +84,7 @@ void register_server_types() { ClassDB::register_virtual_class<AudioStream>(); ClassDB::register_virtual_class<AudioStreamPlayback>(); + ClassDB::register_class<AudioStreamRandomPitch>(); ClassDB::register_virtual_class<AudioEffect>(); ClassDB::register_class<AudioBusLayout>(); diff --git a/servers/visual/rasterizer.h b/servers/visual/rasterizer.h index ca80d5e457..9c264ead49 100644 --- a/servers/visual/rasterizer.h +++ b/servers/visual/rasterizer.h @@ -109,19 +109,20 @@ public: bool mirror : 8; bool receive_shadows : 8; bool visible : 8; + bool baked_light : 8; //this flag is only to know if it actually did use baked light float depth; //used for sorting SelfList<InstanceBase> dependency_item; - InstanceBase *baked_light; //baked light to use - SelfList<InstanceBase> baked_light_item; + //InstanceBase *baked_light; //baked light to use + //SelfList<InstanceBase> baked_light_item; virtual void base_removed() = 0; virtual void base_changed() = 0; virtual void base_material_changed() = 0; InstanceBase() - : dependency_item(this), baked_light_item(this) { + : dependency_item(this) { base_type = VS::INSTANCE_NONE; cast_shadows = VS::SHADOW_CASTING_SETTING_ON; @@ -129,7 +130,7 @@ public: visible = true; depth_layer = 0; layer_mask = 1; - baked_light = NULL; + baked_light = false; } }; @@ -422,6 +423,9 @@ public: virtual void gi_probe_set_bias(RID p_probe, float p_range) = 0; virtual float gi_probe_get_bias(RID p_probe) const = 0; + virtual void gi_probe_set_normal_bias(RID p_probe, float p_range) = 0; + virtual float gi_probe_get_normal_bias(RID p_probe) const = 0; + virtual void gi_probe_set_propagation(RID p_probe, float p_range) = 0; virtual float gi_probe_get_propagation(RID p_probe) const = 0; diff --git a/servers/visual/visual_server_raster.h b/servers/visual/visual_server_raster.h index 1573116c50..58481fc3f6 100644 --- a/servers/visual/visual_server_raster.h +++ b/servers/visual/visual_server_raster.h @@ -844,6 +844,9 @@ public: BIND2(gi_probe_set_bias, RID, float) BIND1RC(float, gi_probe_get_bias, RID) + BIND2(gi_probe_set_normal_bias, RID, float) + BIND1RC(float, gi_probe_get_normal_bias, RID) + BIND2(gi_probe_set_propagation, RID, float) BIND1RC(float, gi_probe_get_propagation, RID) diff --git a/servers/visual/visual_server_scene.cpp b/servers/visual/visual_server_scene.cpp index fb1c66d0b9..97583dc849 100644 --- a/servers/visual/visual_server_scene.cpp +++ b/servers/visual/visual_server_scene.cpp @@ -993,6 +993,11 @@ void VisualServerScene::instance_geometry_set_flag(RID p_instance, VS::InstanceF instance->visible_in_all_rooms = p_enabled; } break; + case VS::INSTANCE_FLAG_USE_BAKED_LIGHT: { + + instance->baked_light = p_enabled; + + } break; } } void VisualServerScene::instance_geometry_set_cast_shadows_setting(RID p_instance, VS::ShadowCastingSetting p_shadow_casting_setting) { @@ -1482,6 +1487,8 @@ void VisualServerScene::_light_instance_update_shadow(Instance *p_instance, cons // a pre pass will need to be needed to determine the actual z-near to be used + Plane near_plane(p_instance->transform.origin, -p_instance->transform.basis.get_axis(2)); + for (int j = 0; j < cull_count; j++) { float min, max; @@ -1494,6 +1501,8 @@ void VisualServerScene::_light_instance_update_shadow(Instance *p_instance, cons } instance->transformed_aabb.project_range_in_plane(Plane(z_vec, 0), min, max); + instance->depth = near_plane.distance_to(instance->transform.origin); + instance->depth_layer = 0; if (max > z_max) z_max = max; } @@ -1539,6 +1548,7 @@ void VisualServerScene::_light_instance_update_shadow(Instance *p_instance, cons planes[4] = p_instance->transform.xform(Plane(Vector3(0, -1, z).normalized(), radius)); int cull_count = p_scenario->octree.cull_convex(planes, instance_shadow_cull_result, MAX_INSTANCE_CULL, VS::INSTANCE_GEOMETRY_MASK); + Plane near_plane(p_instance->transform.origin, p_instance->transform.basis.get_axis(2) * z); for (int j = 0; j < cull_count; j++) { @@ -1547,6 +1557,9 @@ void VisualServerScene::_light_instance_update_shadow(Instance *p_instance, cons cull_count--; SWAP(instance_shadow_cull_result[j], instance_shadow_cull_result[cull_count]); j--; + } else { + instance->depth = near_plane.distance_to(instance->transform.origin); + instance->depth_layer = 0; } } @@ -1587,6 +1600,7 @@ void VisualServerScene::_light_instance_update_shadow(Instance *p_instance, cons int cull_count = p_scenario->octree.cull_convex(planes, instance_shadow_cull_result, MAX_INSTANCE_CULL, VS::INSTANCE_GEOMETRY_MASK); + Plane near_plane(xform.origin, -xform.basis.get_axis(2)); for (int j = 0; j < cull_count; j++) { Instance *instance = instance_shadow_cull_result[j]; @@ -1594,6 +1608,9 @@ void VisualServerScene::_light_instance_update_shadow(Instance *p_instance, cons cull_count--; SWAP(instance_shadow_cull_result[j], instance_shadow_cull_result[cull_count]); j--; + } else { + instance->depth = near_plane.distance_to(instance->transform.origin); + instance->depth_layer = 0; } } @@ -1619,6 +1636,7 @@ void VisualServerScene::_light_instance_update_shadow(Instance *p_instance, cons Vector<Plane> planes = cm.get_projection_planes(p_instance->transform); int cull_count = p_scenario->octree.cull_convex(planes, instance_shadow_cull_result, MAX_INSTANCE_CULL, VS::INSTANCE_GEOMETRY_MASK); + Plane near_plane(p_instance->transform.origin, -p_instance->transform.basis.get_axis(2)); for (int j = 0; j < cull_count; j++) { Instance *instance = instance_shadow_cull_result[j]; @@ -1626,6 +1644,9 @@ void VisualServerScene::_light_instance_update_shadow(Instance *p_instance, cons cull_count--; SWAP(instance_shadow_cull_result[j], instance_shadow_cull_result[cull_count]); j--; + } else { + instance->depth = near_plane.distance_to(instance->transform.origin); + instance->depth_layer = 0; } } @@ -1833,7 +1854,7 @@ void VisualServerScene::_render_scene(const Transform p_cam_transform, const Cam if (reflection_probe->reflection_dirty || VSG::scene_render->reflection_probe_instance_needs_redraw(reflection_probe->instance)) { if (!reflection_probe->update_list.in_list()) { reflection_probe->render_step = 0; - reflection_probe_render_list.add(&reflection_probe->update_list); + reflection_probe_render_list.add_last(&reflection_probe->update_list); } reflection_probe->reflection_dirty = false; @@ -3344,6 +3365,8 @@ void VisualServerScene::_update_dirty_instance(Instance *p_instance) { for (int i = 0; i < dp; i++) { RID mesh = VSG::storage->particles_get_draw_pass_mesh(p_instance->base, i); + if (!mesh.is_valid()) + continue; int sc = VSG::storage->mesh_get_surface_count(mesh); for (int j = 0; j < sc; j++) { diff --git a/servers/visual/visual_server_wrap_mt.h b/servers/visual/visual_server_wrap_mt.h index 6a1b0f7e46..4567d87706 100644 --- a/servers/visual/visual_server_wrap_mt.h +++ b/servers/visual/visual_server_wrap_mt.h @@ -288,6 +288,9 @@ public: FUNC2(gi_probe_set_bias, RID, float) FUNC1RC(float, gi_probe_get_bias, RID) + FUNC2(gi_probe_set_normal_bias, RID, float) + FUNC1RC(float, gi_probe_get_normal_bias, RID) + FUNC2(gi_probe_set_propagation, RID, float) FUNC1RC(float, gi_probe_get_propagation, RID) diff --git a/servers/visual_server.h b/servers/visual_server.h index fbd7fc16ac..f515a7b990 100644 --- a/servers/visual_server.h +++ b/servers/visual_server.h @@ -463,6 +463,9 @@ public: virtual void gi_probe_set_bias(RID p_probe, float p_range) = 0; virtual float gi_probe_get_bias(RID p_probe) const = 0; + virtual void gi_probe_set_normal_bias(RID p_probe, float p_range) = 0; + virtual float gi_probe_get_normal_bias(RID p_probe) const = 0; + virtual void gi_probe_set_propagation(RID p_probe, float p_range) = 0; virtual float gi_probe_get_propagation(RID p_probe) const = 0; diff --git a/thirdparty/README.md b/thirdparty/README.md index ef4f83d4ad..0067f0ff26 100644 --- a/thirdparty/README.md +++ b/thirdparty/README.md @@ -107,7 +107,7 @@ Files extracted from upstream source: ## libpng - Upstream: http://libpng.org/pub/png/libpng.html -- Version: 1.6.28 +- Version: 1.6.30 - License: libpng/zlib Files extracted from upstream source: diff --git a/thirdparty/libpng/png.c b/thirdparty/libpng/png.c index 2c9fea2123..40688be123 100644 --- a/thirdparty/libpng/png.c +++ b/thirdparty/libpng/png.c @@ -1,7 +1,7 @@ /* png.c - location for general purpose libpng functions * - * Last changed in libpng 1.6.29 [March 16, 2017] + * Last changed in libpng 1.6.30 [(PENDING RELEASE)] * Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) @@ -14,7 +14,7 @@ #include "pngpriv.h" /* Generate a compiler error if there is an old png.h in the search path. */ -typedef png_libpng_version_1_6_29 Your_png_h_is_not_version_1_6_29; +typedef png_libpng_version_1_6_30 Your_png_h_is_not_version_1_6_30; /* Tells libpng that we have already handled the first "num_bytes" bytes * of the PNG file signature. If the PNG data is embedded into another @@ -776,14 +776,14 @@ png_get_copyright(png_const_structrp png_ptr) #else # ifdef __STDC__ return PNG_STRING_NEWLINE \ - "libpng version 1.6.29 - March 16, 2017" PNG_STRING_NEWLINE \ + "libpng version 1.6.30 - June 28, 2017" PNG_STRING_NEWLINE \ "Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson" \ PNG_STRING_NEWLINE \ "Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \ "Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc." \ PNG_STRING_NEWLINE; # else - return "libpng version 1.6.29 - March 16, 2017\ + return "libpng version 1.6.30 - June 28, 2017\ Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson\ Copyright (c) 1996-1997 Andreas Dilger\ Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc."; @@ -2832,7 +2832,7 @@ png_pow10(int power) if (power < 0) { if (power < DBL_MIN_10_EXP) return 0; - recip = 1, power = -power; + recip = 1; power = -power; } if (power > 0) @@ -2910,7 +2910,9 @@ png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, png_size_t size, double test = png_pow10(exp_b10+1); if (test <= DBL_MAX) - ++exp_b10, base = test; + { + ++exp_b10; base = test; + } else break; @@ -2924,7 +2926,10 @@ png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, png_size_t size, * test on DBL_MAX above. */ fp /= base; - while (fp >= 1) fp /= 10, ++exp_b10; + while (fp >= 1) + { + fp /= 10; ++exp_b10; + } /* Because of the code above fp may, at this point, be * less than .1, this is ok because the code below can @@ -2975,7 +2980,7 @@ png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, png_size_t size, /* Rounding up to 10, handle that here. */ if (czero > 0) { - --czero, d = 1; + --czero; d = 1; if (cdigits == 0) --clead; } else @@ -2989,7 +2994,7 @@ png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, png_size_t size, else if (ch == 46) { - ch = *--ascii, ++size; + ch = *--ascii; ++size; /* Advance exp_b10 to '1', so that the * decimal point happens after the * previous digit. @@ -3016,7 +3021,9 @@ png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, png_size_t size, int ch = *--ascii; if (ch == 46) - ++size, exp_b10 = 1; + { + ++size; exp_b10 = 1; + } /* Else lost a leading zero, so 'exp_b10' is * still ok at (-1) @@ -3052,21 +3059,26 @@ png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, png_size_t size, */ if (exp_b10 != (-1)) { - if (exp_b10 == 0) *ascii++ = 46, --size; + if (exp_b10 == 0) + { + *ascii++ = 46; --size; + } /* PLUS 1: TOTAL 4 */ --exp_b10; } - *ascii++ = 48, --czero; + *ascii++ = 48; --czero; } if (exp_b10 != (-1)) { if (exp_b10 == 0) - *ascii++ = 46, --size; /* counted above */ + { + *ascii++ = 46; --size; /* counted above */ + } --exp_b10; } - *ascii++ = (char)(48 + (int)d), ++cdigits; + *ascii++ = (char)(48 + (int)d); ++cdigits; } } while (cdigits+czero < precision+clead && fp > DBL_MIN); @@ -3107,7 +3119,7 @@ png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, png_size_t size, */ size -= cdigits; - *ascii++ = 69, --size; /* 'E': PLUS 1 TOTAL 2+precision */ + *ascii++ = 69; --size; /* 'E': PLUS 1 TOTAL 2+precision */ /* The following use of an unsigned temporary avoids ambiguities in * the signed arithmetic on exp_b10 and permits GCC at least to do @@ -3118,7 +3130,7 @@ png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, png_size_t size, if (exp_b10 < 0) { - *ascii++ = 45, --size; /* '-': PLUS 1 TOTAL 3+precision */ + *ascii++ = 45; --size; /* '-': PLUS 1 TOTAL 3+precision */ uexp_b10 = (unsigned int)(-exp_b10); } @@ -3185,7 +3197,9 @@ png_ascii_from_fixed(png_const_structrp png_ptr, png_charp ascii, /* Avoid overflow here on the minimum integer. */ if (fp < 0) - *ascii++ = 45, num = (png_uint_32)(-fp); + { + *ascii++ = 45; num = (png_uint_32)(-fp); + } else num = (png_uint_32)fp; @@ -3223,7 +3237,10 @@ png_ascii_from_fixed(png_const_structrp png_ptr, png_charp ascii, * then ndigits digits to first: */ i = 5; - while (ndigits < i) *ascii++ = 48, --i; + while (ndigits < i) + { + *ascii++ = 48; --i; + } while (ndigits >= first) *ascii++ = digits[--ndigits]; /* Don't output the trailing zeros! */ } @@ -4278,7 +4295,7 @@ png_set_option(png_structrp png_ptr, int option, int onoff) defined(PNG_SIMPLIFIED_WRITE_SUPPORTED) /* sRGB conversion tables; these are machine generated with the code in * contrib/tools/makesRGB.c. The actual sRGB transfer curve defined in the - * specification (see the article at http://en.wikipedia.org/wiki/SRGB) + * specification (see the article at https://en.wikipedia.org/wiki/SRGB) * is used, not the gamma=1/2.2 approximation use elsewhere in libpng. * The sRGB to linear table is exact (to the nearest 16-bit linear fraction). * The inverse (linear to sRGB) table has accuracies as follows: diff --git a/thirdparty/libpng/png.h b/thirdparty/libpng/png.h index 2431e0dfc0..c2c4fdf251 100644 --- a/thirdparty/libpng/png.h +++ b/thirdparty/libpng/png.h @@ -1,7 +1,7 @@ /* png.h - header file for PNG reference library * - * libpng version 1.6.29, March 16, 2017 + * libpng version 1.6.30, June 28, 2017 * * Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) @@ -12,7 +12,7 @@ * Authors and maintainers: * libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat * libpng versions 0.89, June 1996, through 0.96, May 1997: Andreas Dilger - * libpng versions 0.97, January 1998, through 1.6.29, March 16, 2017: + * libpng versions 0.97, January 1998, through 1.6.30, June 28, 2017: * Glenn Randers-Pehrson. * See also "Contributing Authors", below. */ @@ -25,7 +25,7 @@ * * This code is released under the libpng license. * - * libpng versions 1.0.7, July 1, 2000 through 1.6.29, March 16, 2017 are + * libpng versions 1.0.7, July 1, 2000 through 1.6.30, June 28, 2017 are * Copyright (c) 2000-2002, 2004, 2006-2017 Glenn Randers-Pehrson, are * derived from libpng-1.0.6, and are distributed according to the same * disclaimer and license as libpng-1.0.6 with the following individuals @@ -213,7 +213,7 @@ * ... * 1.5.28 15 10527 15.so.15.28[.0] * ... - * 1.6.29 16 10629 16.so.16.29[.0] + * 1.6.30 16 10630 16.so.16.30[.0] * * Henceforth the source version will match the shared-library major * and minor numbers; the shared-library major version number will be @@ -234,20 +234,20 @@ * * See libpng.txt or libpng.3 for more information. The PNG specification * is available as a W3C Recommendation and as an ISO Specification, - * <http://www.w3.org/TR/2003/REC-PNG-20031110/ + * <https://www.w3.org/TR/2003/REC-PNG-20031110/ */ /* * Y2K compliance in libpng: * ========================= * - * March 16, 2017 + * June 28, 2017 * * Since the PNG Development group is an ad-hoc body, we can't make * an official declaration. * * This is your unofficial assurance that libpng from version 0.71 and - * upward through 1.6.29 are Y2K compliant. It is my belief that + * upward through 1.6.30 are Y2K compliant. It is my belief that * earlier versions were also Y2K compliant. * * Libpng only has two year fields. One is a 2-byte unsigned integer @@ -309,8 +309,8 @@ */ /* Version information for png.h - this should match the version in png.c */ -#define PNG_LIBPNG_VER_STRING "1.6.29" -#define PNG_HEADER_VERSION_STRING " libpng version 1.6.29 - March 16, 2017\n" +#define PNG_LIBPNG_VER_STRING "1.6.30" +#define PNG_HEADER_VERSION_STRING " libpng version 1.6.30 - June 28, 2017\n" #define PNG_LIBPNG_VER_SONUM 16 #define PNG_LIBPNG_VER_DLLNUM 16 @@ -318,7 +318,7 @@ /* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */ #define PNG_LIBPNG_VER_MAJOR 1 #define PNG_LIBPNG_VER_MINOR 6 -#define PNG_LIBPNG_VER_RELEASE 29 +#define PNG_LIBPNG_VER_RELEASE 30 /* This should match the numeric part of the final component of * PNG_LIBPNG_VER_STRING, omitting any leading zero: @@ -349,7 +349,7 @@ * version 1.0.0 was mis-numbered 100 instead of 10000). From * version 1.0.1 it's xxyyzz, where x=major, y=minor, z=release */ -#define PNG_LIBPNG_VER 10629 /* 1.6.29 */ +#define PNG_LIBPNG_VER 10630 /* 1.6.30 */ /* Library configuration: these options cannot be changed after * the library has been built. @@ -459,7 +459,7 @@ extern "C" { /* This triggers a compiler error in png.c, if png.c and png.h * do not agree upon the version number. */ -typedef char* png_libpng_version_1_6_29; +typedef char* png_libpng_version_1_6_30; /* Basic control structions. Read libpng-manual.txt or libpng.3 for more info. * @@ -2753,7 +2753,7 @@ typedef struct * * When the simplified API needs to convert between sRGB and linear colorspaces, * the actual sRGB transfer curve defined in the sRGB specification (see the - * article at http://en.wikipedia.org/wiki/SRGB) is used, not the gamma=1/2.2 + * article at https://en.wikipedia.org/wiki/SRGB) is used, not the gamma=1/2.2 * approximation used elsewhere in libpng. * * When an alpha channel is present it is expected to denote pixel coverage diff --git a/thirdparty/libpng/pngconf.h b/thirdparty/libpng/pngconf.h index 78d8b92b0e..f64592acd7 100644 --- a/thirdparty/libpng/pngconf.h +++ b/thirdparty/libpng/pngconf.h @@ -1,7 +1,7 @@ /* pngconf.h - machine configurable file for libpng * - * libpng version 1.6.29, March 16, 2017 + * libpng version 1.6.30, June 28, 2017 * * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) diff --git a/thirdparty/libpng/pnglibconf.h b/thirdparty/libpng/pnglibconf.h index 82f6ba4619..da3d8359f4 100644 --- a/thirdparty/libpng/pnglibconf.h +++ b/thirdparty/libpng/pnglibconf.h @@ -1,10 +1,10 @@ -/* libpng 1.6.29 STANDARD API DEFINITION */ +/* libpng 1.6.30 STANDARD API DEFINITION */ /* pnglibconf.h - library build configuration */ -/* Libpng version 1.6.29 - March 16, 2017 */ +/* Libpng version 1.6.30 - June 28, 2017 */ -/* Copyright (c) 1998-2015 Glenn Randers-Pehrson */ +/* Copyright (c) 1998-2017 Glenn Randers-Pehrson */ /* This code is released under the libpng license. */ /* For conditions of distribution and use, see the disclaimer */ diff --git a/thirdparty/libpng/pngpriv.h b/thirdparty/libpng/pngpriv.h index 6d2e424d2e..a062a8da16 100644 --- a/thirdparty/libpng/pngpriv.h +++ b/thirdparty/libpng/pngpriv.h @@ -1,7 +1,7 @@ /* pngpriv.h - private declarations for use inside libpng * - * Last changed in libpng 1.6.29 [March 16, 2017] + * Last changed in libpng 1.6.30 [(PENDING RELEASE)] * Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) @@ -466,7 +466,16 @@ static_cast<type>(static_cast<const void*>(value)) #else # define png_voidcast(type, value) (value) -# define png_constcast(type, value) ((type)(value)) +# ifdef _WIN64 +# ifdef __GNUC__ + typedef unsigned long long png_ptruint; +# else + typedef unsigned __int64 png_ptruint; +# endif +# else + typedef unsigned long png_ptruint; +# endif +# define png_constcast(type, value) ((type)(png_ptruint)(const void*)(value)) # define png_aligncast(type, value) ((void*)(value)) # define png_aligncastconst(type, value) ((const void*)(value)) #endif /* __cplusplus */ diff --git a/thirdparty/libpng/pngrtran.c b/thirdparty/libpng/pngrtran.c index 16c1ed6086..3886833af0 100644 --- a/thirdparty/libpng/pngrtran.c +++ b/thirdparty/libpng/pngrtran.c @@ -1,7 +1,7 @@ /* pngrtran.c - transforms the data in a row for PNG readers * - * Last changed in libpng 1.6.29 [March 16, 2017] + * Last changed in libpng 1.6.30 [(PENDING RELEASE)] * Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) @@ -2934,7 +2934,7 @@ png_do_gray_to_rgb(png_row_infop row_info, png_bytep row) * using the equation given in Poynton's ColorFAQ of 1998-01-04 at * <http://www.inforamp.net/~poynton/> (THIS LINK IS DEAD June 2008 but * versions dated 1998 through November 2002 have been archived at - * http://web.archive.org/web/20000816232553/http://www.inforamp.net/ + * https://web.archive.org/web/20000816232553/www.inforamp.net/ * ~poynton/notes/colour_and_gamma/ColorFAQ.txt ) * Charles Poynton poynton at poynton.com * @@ -4601,7 +4601,9 @@ png_do_expand_16(png_row_infop row_info, png_bytep row) png_byte *sp = row + row_info->rowbytes; /* source, last byte + 1 */ png_byte *dp = sp + row_info->rowbytes; /* destination, end + 1 */ while (dp > sp) - dp[-2] = dp[-1] = *--sp, dp -= 2; + { + dp[-2] = dp[-1] = *--sp; dp -= 2; + } row_info->rowbytes *= 2; row_info->bit_depth = 16; diff --git a/thirdparty/libpng/pngrutil.c b/thirdparty/libpng/pngrutil.c index 76f079a69f..f60545bf90 100644 --- a/thirdparty/libpng/pngrutil.c +++ b/thirdparty/libpng/pngrutil.c @@ -1,7 +1,7 @@ /* pngrutil.c - utilities to read a PNG file * - * Last changed in libpng 1.6.29 [March 16, 2017] + * Last changed in libpng 1.6.30 [(PENDING RELEASE)] * Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) @@ -2537,6 +2537,9 @@ png_handle_zTXt(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length) if ((png_ptr->mode & PNG_HAVE_IDAT) != 0) png_ptr->mode |= PNG_AFTER_IDAT; + /* Note, "length" is sufficient here; we won't be adding + * a null terminator later. + */ buffer = png_read_buffer(png_ptr, length, 2/*silent*/); if (buffer == NULL) @@ -3377,7 +3380,7 @@ png_combine_row(png_const_structrp png_ptr, png_bytep dp, int display) */ do { - dp[0] = sp[0], dp[1] = sp[1]; + dp[0] = sp[0]; dp[1] = sp[1]; if (row_width <= bytes_to_jump) return; @@ -3398,7 +3401,7 @@ png_combine_row(png_const_structrp png_ptr, png_bytep dp, int display) */ for (;;) { - dp[0] = sp[0], dp[1] = sp[1], dp[2] = sp[2]; + dp[0] = sp[0]; dp[1] = sp[1]; dp[2] = sp[2]; if (row_width <= bytes_to_jump) return; @@ -3887,7 +3890,10 @@ png_read_filter_row_paeth_1byte_pixel(png_row_infop row_info, png_bytep row, /* Find the best predictor, the least of pa, pb, pc favoring the earlier * ones in the case of a tie. */ - if (pb < pa) pa = pb, a = b; + if (pb < pa) + { + pa = pb; a = b; + } if (pc < pa) a = c; /* Calculate the current pixel in a, and move the previous row pixel to c @@ -3939,7 +3945,10 @@ png_read_filter_row_paeth_multibyte_pixel(png_row_infop row_info, png_bytep row, pc = (p + pc) < 0 ? -(p + pc) : p + pc; #endif - if (pb < pa) pa = pb, a = b; + if (pb < pa) + { + pa = pb; a = b; + } if (pc < pa) a = c; a += *row; diff --git a/thirdparty/libpng/pngset.c b/thirdparty/libpng/pngset.c index 28ff3a064d..fb495ac3fb 100644 --- a/thirdparty/libpng/pngset.c +++ b/thirdparty/libpng/pngset.c @@ -1,8 +1,8 @@ /* pngset.c - storage of image information into info struct * - * Last changed in libpng 1.6.26 [October 20, 2016] - * Copyright (c) 1998-2016 Glenn Randers-Pehrson + * Last changed in libpng 1.6.30 [(PENDING RELEASE)] + * Copyright (c) 1998-2017 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * @@ -1102,8 +1102,9 @@ png_set_sPLT(png_const_structrp png_ptr, info_ptr->valid |= PNG_INFO_sPLT; ++(info_ptr->splt_palettes_num); ++np; + ++entries; } - while (++entries, --nentries); + while (--nentries); if (nentries > 0) png_chunk_report(png_ptr, "sPLT out of memory", PNG_CHUNK_WRITE_ERROR); @@ -1696,14 +1697,16 @@ png_check_keyword(png_structrp png_ptr, png_const_charp key, png_bytep new_key) png_byte ch = (png_byte)*key++; if ((ch > 32 && ch <= 126) || (ch >= 161 /*&& ch <= 255*/)) - *new_key++ = ch, ++key_len, space = 0; + { + *new_key++ = ch; ++key_len; space = 0; + } else if (space == 0) { /* A space or an invalid character when one wasn't seen immediately * before; output just a space. */ - *new_key++ = 32, ++key_len, space = 1; + *new_key++ = 32; ++key_len; space = 1; /* If the character was not a space then it is invalid. */ if (ch != 32) @@ -1716,7 +1719,7 @@ png_check_keyword(png_structrp png_ptr, png_const_charp key, png_bytep new_key) if (key_len > 0 && space != 0) /* trailing space */ { - --key_len, --new_key; + --key_len; --new_key; if (bad_character == 0) bad_character = 32; } diff --git a/thirdparty/libpng/pngtrans.c b/thirdparty/libpng/pngtrans.c index da7413fb80..6c8c646239 100644 --- a/thirdparty/libpng/pngtrans.c +++ b/thirdparty/libpng/pngtrans.c @@ -1,8 +1,8 @@ /* pngtrans.c - transforms the data in a row (used by both readers and writers) * - * Last changed in libpng 1.6.26 [October 20, 2016] - * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson + * Last changed in libpng 1.6.30 [(PENDING RELEASE)] + * Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * @@ -514,11 +514,15 @@ png_do_strip_channel(png_row_infop row_info, png_bytep row, int at_start) if (at_start != 0) /* Skip initial filler */ ++sp; else /* Skip initial channel and, for sp, the filler */ - sp += 2, ++dp; + { + sp += 2; ++dp; + } /* For a 1 pixel wide image there is nothing to do */ while (sp < ep) - *dp++ = *sp, sp += 2; + { + *dp++ = *sp; sp += 2; + } row_info->pixel_depth = 8; } @@ -528,10 +532,14 @@ png_do_strip_channel(png_row_infop row_info, png_bytep row, int at_start) if (at_start != 0) /* Skip initial filler */ sp += 2; else /* Skip initial channel and, for sp, the filler */ - sp += 4, dp += 2; + { + sp += 4; dp += 2; + } while (sp < ep) - *dp++ = *sp++, *dp++ = *sp, sp += 3; + { + *dp++ = *sp++; *dp++ = *sp; sp += 3; + } row_info->pixel_depth = 16; } @@ -554,11 +562,15 @@ png_do_strip_channel(png_row_infop row_info, png_bytep row, int at_start) if (at_start != 0) /* Skip initial filler */ ++sp; else /* Skip initial channels and, for sp, the filler */ - sp += 4, dp += 3; + { + sp += 4; dp += 3; + } /* Note that the loop adds 3 to dp and 4 to sp each time. */ while (sp < ep) - *dp++ = *sp++, *dp++ = *sp++, *dp++ = *sp, sp += 2; + { + *dp++ = *sp++; *dp++ = *sp++; *dp++ = *sp; sp += 2; + } row_info->pixel_depth = 24; } @@ -568,14 +580,16 @@ png_do_strip_channel(png_row_infop row_info, png_bytep row, int at_start) if (at_start != 0) /* Skip initial filler */ sp += 2; else /* Skip initial channels and, for sp, the filler */ - sp += 8, dp += 6; + { + sp += 8; dp += 6; + } while (sp < ep) { /* Copy 6 bytes, skip 2 */ - *dp++ = *sp++, *dp++ = *sp++; - *dp++ = *sp++, *dp++ = *sp++; - *dp++ = *sp++, *dp++ = *sp, sp += 3; + *dp++ = *sp++; *dp++ = *sp++; + *dp++ = *sp++; *dp++ = *sp++; + *dp++ = *sp++; *dp++ = *sp; sp += 3; } row_info->pixel_depth = 48; diff --git a/thirdparty/libpng/pngwutil.c b/thirdparty/libpng/pngwutil.c index 0f98d582da..dd800586be 100644 --- a/thirdparty/libpng/pngwutil.c +++ b/thirdparty/libpng/pngwutil.c @@ -1003,7 +1003,8 @@ png_compress_IDAT(png_structrp png_ptr, png_const_bytep input, optimize_cmf(data, png_image_size(png_ptr)); #endif - png_write_complete_chunk(png_ptr, png_IDAT, data, size); + if (size > 0) + png_write_complete_chunk(png_ptr, png_IDAT, data, size); png_ptr->mode |= PNG_HAVE_IDAT; png_ptr->zstream.next_out = data; @@ -1049,7 +1050,8 @@ png_compress_IDAT(png_structrp png_ptr, png_const_bytep input, optimize_cmf(data, png_image_size(png_ptr)); #endif - png_write_complete_chunk(png_ptr, png_IDAT, data, size); + if (size > 0) + png_write_complete_chunk(png_ptr, png_IDAT, data, size); png_ptr->zstream.avail_out = 0; png_ptr->zstream.next_out = NULL; png_ptr->mode |= PNG_HAVE_IDAT | PNG_AFTER_IDAT; |