diff options
393 files changed, 19070 insertions, 13759 deletions
diff --git a/SConstruct b/SConstruct index 28395227d2..50cb43b218 100644 --- a/SConstruct +++ b/SConstruct @@ -788,7 +788,8 @@ if selected_platform in platform_list: SConscript("core/SCsub") SConscript("servers/SCsub") SConscript("scene/SCsub") - SConscript("editor/SCsub") + if env["tools"]: + SConscript("editor/SCsub") SConscript("drivers/SCsub") SConscript("platform/SCsub") diff --git a/core/core_bind.cpp b/core/core_bind.cpp index 24b27d2692..26ecd41353 100644 --- a/core/core_bind.cpp +++ b/core/core_bind.cpp @@ -147,7 +147,7 @@ void ResourceLoader::_bind_methods() { ////// ResourceSaver ////// -Error ResourceSaver::save(const String &p_path, const Ref<Resource> &p_resource, uint32_t p_flags) { +Error ResourceSaver::save(const String &p_path, const Ref<Resource> &p_resource, BitField<SaverFlags> p_flags) { ERR_FAIL_COND_V_MSG(p_resource.is_null(), ERR_INVALID_PARAMETER, "Can't save empty resource to path '" + String(p_path) + "'."); return ::ResourceSaver::save(p_path, p_resource, p_flags); } @@ -179,14 +179,14 @@ void ResourceSaver::_bind_methods() { ClassDB::bind_method(D_METHOD("add_resource_format_saver", "format_saver", "at_front"), &ResourceSaver::add_resource_format_saver, DEFVAL(false)); ClassDB::bind_method(D_METHOD("remove_resource_format_saver", "format_saver"), &ResourceSaver::remove_resource_format_saver); - BIND_ENUM_CONSTANT(FLAG_NONE); - BIND_ENUM_CONSTANT(FLAG_RELATIVE_PATHS); - BIND_ENUM_CONSTANT(FLAG_BUNDLE_RESOURCES); - BIND_ENUM_CONSTANT(FLAG_CHANGE_PATH); - BIND_ENUM_CONSTANT(FLAG_OMIT_EDITOR_PROPERTIES); - BIND_ENUM_CONSTANT(FLAG_SAVE_BIG_ENDIAN); - BIND_ENUM_CONSTANT(FLAG_COMPRESS); - BIND_ENUM_CONSTANT(FLAG_REPLACE_SUBRESOURCE_PATHS); + BIND_BITFIELD_FLAG(FLAG_NONE); + BIND_BITFIELD_FLAG(FLAG_RELATIVE_PATHS); + BIND_BITFIELD_FLAG(FLAG_BUNDLE_RESOURCES); + BIND_BITFIELD_FLAG(FLAG_CHANGE_PATH); + BIND_BITFIELD_FLAG(FLAG_OMIT_EDITOR_PROPERTIES); + BIND_BITFIELD_FLAG(FLAG_SAVE_BIG_ENDIAN); + BIND_BITFIELD_FLAG(FLAG_COMPRESS); + BIND_BITFIELD_FLAG(FLAG_REPLACE_SUBRESOURCE_PATHS); } ////// OS ////// diff --git a/core/core_bind.h b/core/core_bind.h index 99e14a75f5..c116ac4986 100644 --- a/core/core_bind.h +++ b/core/core_bind.h @@ -109,7 +109,7 @@ public: static ResourceSaver *get_singleton() { return singleton; } - Error save(const String &p_path, const Ref<Resource> &p_resource, uint32_t p_flags); + Error save(const String &p_path, const Ref<Resource> &p_resource, BitField<SaverFlags> p_flags); Vector<String> get_recognized_extensions(const Ref<Resource> &p_resource); void add_resource_format_saver(Ref<ResourceFormatSaver> p_format_saver, bool p_at_front); void remove_resource_format_saver(Ref<ResourceFormatSaver> p_format_saver); @@ -719,7 +719,7 @@ public: VARIANT_ENUM_CAST(core_bind::ResourceLoader::ThreadLoadStatus); VARIANT_ENUM_CAST(core_bind::ResourceLoader::CacheMode); -VARIANT_ENUM_CAST(core_bind::ResourceSaver::SaverFlags); +VARIANT_BITFIELD_CAST(core_bind::ResourceSaver::SaverFlags); VARIANT_ENUM_CAST(core_bind::OS::VideoDriver); VARIANT_ENUM_CAST(core_bind::OS::Weekday); diff --git a/core/doc_data.cpp b/core/doc_data.cpp index 1e72ad1090..89e7a8dc71 100644 --- a/core/doc_data.cpp +++ b/core/doc_data.cpp @@ -38,7 +38,7 @@ void DocData::return_doc_from_retinfo(DocData::MethodDoc &p_method, const Proper } else { p_method.return_type += "*"; } - } else if (p_retinfo.type == Variant::INT && p_retinfo.usage & PROPERTY_USAGE_CLASS_IS_ENUM) { + } else if (p_retinfo.type == Variant::INT && p_retinfo.usage & (PROPERTY_USAGE_CLASS_IS_ENUM | PROPERTY_USAGE_CLASS_IS_BITFIELD)) { p_method.return_enum = p_retinfo.class_name; if (p_method.return_enum.begins_with("_")) { //proxy class p_method.return_enum = p_method.return_enum.substr(1, p_method.return_enum.length()); @@ -69,7 +69,7 @@ void DocData::argument_doc_from_arginfo(DocData::ArgumentDoc &p_argument, const } else { p_argument.type += "*"; } - } else if (p_arginfo.type == Variant::INT && p_arginfo.usage & PROPERTY_USAGE_CLASS_IS_ENUM) { + } else if (p_arginfo.type == Variant::INT && p_arginfo.usage & (PROPERTY_USAGE_CLASS_IS_ENUM | PROPERTY_USAGE_CLASS_IS_BITFIELD)) { p_argument.enumeration = p_arginfo.class_name; if (p_argument.enumeration.begins_with("_")) { //proxy class p_argument.enumeration = p_argument.enumeration.substr(1, p_argument.enumeration.length()); diff --git a/core/doc_data.h b/core/doc_data.h index af20b717d7..1d8d2483e0 100644 --- a/core/doc_data.h +++ b/core/doc_data.h @@ -103,6 +103,7 @@ public: String value; bool is_value_valid = false; String enumeration; + bool is_bitfield = false; String description; bool operator<(const ConstantDoc &p_const) const { return name < p_const.name; @@ -111,6 +112,7 @@ public: struct EnumDoc { String name = "@unnamed_enum"; + bool is_bitfield = false; String description; Vector<DocData::ConstantDoc> values; }; @@ -163,6 +165,7 @@ public: Vector<ConstantDoc> constants; HashMap<String, String> enums; Vector<PropertyDoc> properties; + Vector<MethodDoc> annotations; Vector<ThemeItemDoc> theme_properties; bool is_script_doc = false; String script_path; diff --git a/core/extension/extension_api_dump.cpp b/core/extension/extension_api_dump.cpp index 9d846f87c2..d5c49b01e9 100644 --- a/core/extension/extension_api_dump.cpp +++ b/core/extension/extension_api_dump.cpp @@ -46,7 +46,7 @@ static String get_type_name(const PropertyInfo &p_info) { return p_info.hint_string + "*"; } } - if (p_info.type == Variant::INT && (p_info.usage & PROPERTY_USAGE_CLASS_IS_ENUM)) { + if (p_info.type == Variant::INT && (p_info.usage & (PROPERTY_USAGE_CLASS_IS_ENUM | PROPERTY_USAGE_CLASS_IS_BITFIELD))) { return String("enum::") + String(p_info.class_name); } if (p_info.class_name != StringName()) { @@ -665,6 +665,7 @@ Dictionary NativeExtensionAPIDump::generate_extension_api() { for (const StringName &F : enum_list) { Dictionary d2; d2["name"] = String(F); + d2["is_bitfield"] = ClassDB::is_enum_bitfield(class_name, F); Array values; List<StringName> enum_constant_list; diff --git a/core/io/file_access.cpp b/core/io/file_access.cpp index 7d8da1b11c..da25f23917 100644 --- a/core/io/file_access.cpp +++ b/core/io/file_access.cpp @@ -388,9 +388,7 @@ String FileAccess::get_as_utf8_string() const { w[len] = 0; String s; - if (s.parse_utf8((const char *)w)) { - return String(); - } + s.parse_utf8((const char *)w); return s; } @@ -516,7 +514,6 @@ String FileAccess::get_pascal_string() { String ret; ret.parse_utf8(cs.ptr()); - return ret; } diff --git a/core/io/marshalls.cpp b/core/io/marshalls.cpp index f71ea5c39e..8ee19f274e 100644 --- a/core/io/marshalls.cpp +++ b/core/io/marshalls.cpp @@ -78,7 +78,7 @@ static Error _decode_string(const uint8_t *&buf, int &len, int *r_len, String &r ERR_FAIL_COND_V(strlen < 0 || strlen + pad > len, ERR_FILE_EOF); String str; - ERR_FAIL_COND_V(str.parse_utf8((const char *)buf, strlen), ERR_INVALID_DATA); + ERR_FAIL_COND_V(str.parse_utf8((const char *)buf, strlen) != OK, ERR_INVALID_DATA); r_string = str; // Add padding diff --git a/core/math/octree.h b/core/math/octree.h deleted file mode 100644 index 8dd103f109..0000000000 --- a/core/math/octree.h +++ /dev/null @@ -1,1271 +0,0 @@ -/*************************************************************************/ -/* octree.h */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* https://godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur. */ -/* Copyright (c) 2014-2022 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. */ -/*************************************************************************/ - -#ifndef OCTREE_H -#define OCTREE_H - -#include "core/math/aabb.h" -#include "core/math/geometry_3d.h" -#include "core/math/vector3.h" -#include "core/string/print_string.h" -#include "core/templates/list.h" -#include "core/templates/rb_map.h" -#include "core/variant/variant.h" - -typedef uint32_t OctreeElementID; - -#define OCTREE_ELEMENT_INVALID_ID 0 -#define OCTREE_SIZE_LIMIT 1e15 - -template <class T, bool use_pairs = false, class AL = DefaultAllocator> -class Octree { -public: - typedef void *(*PairCallback)(void *, OctreeElementID, T *, int, OctreeElementID, T *, int); - typedef void (*UnpairCallback)(void *, OctreeElementID, T *, int, OctreeElementID, T *, int, void *); - -private: - enum { - NEG = 0, - POS = 1, - }; - - enum { - OCTANT_NX_NY_NZ, - OCTANT_PX_NY_NZ, - OCTANT_NX_PY_NZ, - OCTANT_PX_PY_NZ, - OCTANT_NX_NY_PZ, - OCTANT_PX_NY_PZ, - OCTANT_NX_PY_PZ, - OCTANT_PX_PY_PZ - }; - - struct PairKey { - union { - struct { - OctreeElementID A; - OctreeElementID B; - }; - uint64_t key; - }; - - _FORCE_INLINE_ bool operator<(const PairKey &p_pair) const { - return key < p_pair.key; - } - - _FORCE_INLINE_ PairKey(OctreeElementID p_A, OctreeElementID p_B) { - if (p_A < p_B) { - A = p_A; - B = p_B; - } else { - B = p_A; - A = p_B; - } - } - - _FORCE_INLINE_ PairKey() {} - }; - - struct Element; - - struct Octant { - // cached for FAST plane check - AABB aabb; - - uint64_t last_pass = 0; - Octant *parent = nullptr; - Octant *children[8] = { nullptr }; - - int children_count = 0; // cache for amount of children (fast check for removal) - int parent_index = -1; // cache for parent index (fast check for removal) - - List<Element *, AL> pairable_elements; - List<Element *, AL> elements; - - Octant() {} - ~Octant() {} - }; - - struct PairData; - - struct Element { - Octree *octree = nullptr; - - T *userdata = nullptr; - int subindex = 0; - bool pairable = false; - uint32_t pairable_mask = 0; - uint32_t pairable_type = 0; - - uint64_t last_pass = 0; - OctreeElementID _id = 0; - Octant *common_parent = nullptr; - - AABB aabb; - AABB container_aabb; - - List<PairData *, AL> pair_list; - - struct OctantOwner { - Octant *octant = nullptr; - typename List<Element *, AL>::Element *E; - }; // an element can be in max 8 octants - - List<OctantOwner, AL> octant_owners; - - Element() {} - }; - - struct PairData { - int refcount; - bool intersect; - Element *A, *B; - void *ud = nullptr; - typename List<PairData *, AL>::Element *eA, *eB; - }; - - typedef HashMap<OctreeElementID, Element, Comparator<OctreeElementID>, AL> ElementMap; - typedef HashMap<PairKey, PairData, Comparator<PairKey>, AL> PairMap; - ElementMap element_map; - PairMap pair_map; - - PairCallback pair_callback = nullptr; - UnpairCallback unpair_callback = nullptr; - void *pair_callback_userdata = nullptr; - void *unpair_callback_userdata = nullptr; - - OctreeElementID last_element_id = 1; - uint64_t pass = 1; - - real_t unit_size = 1.0; - Octant *root = nullptr; - int octant_count = 0; - int pair_count = 0; - - _FORCE_INLINE_ void _pair_check(PairData *p_pair) { - bool intersect = p_pair->A->aabb.intersects_inclusive(p_pair->B->aabb); - - if (intersect != p_pair->intersect) { - if (intersect) { - if (pair_callback) { - p_pair->ud = pair_callback(pair_callback_userdata, p_pair->A->_id, p_pair->A->userdata, p_pair->A->subindex, p_pair->B->_id, p_pair->B->userdata, p_pair->B->subindex); - } - pair_count++; - } else { - if (unpair_callback) { - unpair_callback(pair_callback_userdata, p_pair->A->_id, p_pair->A->userdata, p_pair->A->subindex, p_pair->B->_id, p_pair->B->userdata, p_pair->B->subindex, p_pair->ud); - } - pair_count--; - } - - p_pair->intersect = intersect; - } - } - - _FORCE_INLINE_ void _pair_reference(Element *p_A, Element *p_B) { - if (p_A == p_B || (p_A->userdata == p_B->userdata && p_A->userdata)) { - return; - } - - if (!(p_A->pairable_type & p_B->pairable_mask) && - !(p_B->pairable_type & p_A->pairable_mask)) { - return; // none can pair with none - } - - PairKey key(p_A->_id, p_B->_id); - typename PairMap::Element *E = pair_map.find(key); - - if (!E) { - PairData pdata; - pdata.refcount = 1; - pdata.A = p_A; - pdata.B = p_B; - pdata.intersect = false; - E = pair_map.insert(key, pdata); - E->get().eA = p_A->pair_list.push_back(&E->get()); - E->get().eB = p_B->pair_list.push_back(&E->get()); - } else { - E->get().refcount++; - } - } - - _FORCE_INLINE_ void _pair_unreference(Element *p_A, Element *p_B) { - if (p_A == p_B) { - return; - } - - PairKey key(p_A->_id, p_B->_id); - typename PairMap::Element *E = pair_map.find(key); - if (!E) { - return; // no pair - } - - E->get().refcount--; - - if (E->get().refcount == 0) { - // bye pair - - if (E->get().intersect) { - if (unpair_callback) { - unpair_callback(pair_callback_userdata, p_A->_id, p_A->userdata, p_A->subindex, p_B->_id, p_B->userdata, p_B->subindex, E->get().ud); - } - - pair_count--; - } - - if (p_A == E->get().B) { - //may be reaching inverted - SWAP(p_A, p_B); - } - - p_A->pair_list.erase(E->get().eA); - p_B->pair_list.erase(E->get().eB); - pair_map.erase(E); - } - } - - _FORCE_INLINE_ void _element_check_pairs(Element *p_element) { - typename List<PairData *, AL>::Element *E = p_element->pair_list.front(); - while (E) { - _pair_check(E->get()); - E = E->next(); - } - } - - _FORCE_INLINE_ void _optimize() { - while (root && root->children_count < 2 && !root->elements.size() && !(use_pairs && root->pairable_elements.size())) { - Octant *new_root = nullptr; - if (root->children_count == 1) { - for (int i = 0; i < 8; i++) { - if (root->children[i]) { - new_root = root->children[i]; - root->children[i] = nullptr; - break; - } - } - ERR_FAIL_COND(!new_root); - new_root->parent = nullptr; - new_root->parent_index = -1; - } - - memdelete_allocator<Octant, AL>(root); - octant_count--; - root = new_root; - } - } - - void _insert_element(Element *p_element, Octant *p_octant); - void _ensure_valid_root(const AABB &p_aabb); - bool _remove_element_from_octant(Element *p_element, Octant *p_octant, Octant *p_limit = nullptr); - void _remove_element(Element *p_element); - void _pair_element(Element *p_element, Octant *p_octant); - void _unpair_element(Element *p_element, Octant *p_octant); - - struct _CullConvexData { - const Plane *planes; - int plane_count; - const Vector3 *points; - int point_count; - T **result_array; - int *result_idx = nullptr; - int result_max; - uint32_t mask; - }; - - void _cull_convex(Octant *p_octant, _CullConvexData *p_cull); - void _cull_aabb(Octant *p_octant, const AABB &p_aabb, T **p_result_array, int *p_result_idx, int p_result_max, int *p_subindex_array, uint32_t p_mask); - void _cull_segment(Octant *p_octant, const Vector3 &p_from, const Vector3 &p_to, T **p_result_array, int *p_result_idx, int p_result_max, int *p_subindex_array, uint32_t p_mask); - void _cull_point(Octant *p_octant, const Vector3 &p_point, T **p_result_array, int *p_result_idx, int p_result_max, int *p_subindex_array, uint32_t p_mask); - - void _remove_tree(Octant *p_octant) { - if (!p_octant) { - return; - } - - for (int i = 0; i < 8; i++) { - if (p_octant->children[i]) { - _remove_tree(p_octant->children[i]); - } - } - - memdelete_allocator<Octant, AL>(p_octant); - } - -public: - OctreeElementID create(T *p_userdata, const AABB &p_aabb = AABB(), int p_subindex = 0, bool p_pairable = false, uint32_t p_pairable_type = 0, uint32_t pairable_mask = 1); - void move(OctreeElementID p_id, const AABB &p_aabb); - void set_pairable(OctreeElementID p_id, bool p_pairable = false, uint32_t p_pairable_type = 0, uint32_t pairable_mask = 1); - void erase(OctreeElementID p_id); - - bool is_pairable(OctreeElementID p_id) const; - T *get(OctreeElementID p_id) const; - int get_subindex(OctreeElementID p_id) const; - - int cull_convex(const Vector<Plane> &p_convex, T **p_result_array, int p_result_max, uint32_t p_mask = 0xFFFFFFFF); - int cull_aabb(const AABB &p_aabb, T **p_result_array, int p_result_max, int *p_subindex_array = nullptr, uint32_t p_mask = 0xFFFFFFFF); - int cull_segment(const Vector3 &p_from, const Vector3 &p_to, T **p_result_array, int p_result_max, int *p_subindex_array = nullptr, uint32_t p_mask = 0xFFFFFFFF); - - int cull_point(const Vector3 &p_point, T **p_result_array, int p_result_max, int *p_subindex_array = nullptr, uint32_t p_mask = 0xFFFFFFFF); - - void set_pair_callback(PairCallback p_callback, void *p_userdata); - void set_unpair_callback(UnpairCallback p_callback, void *p_userdata); - - int get_octant_count() const { return octant_count; } - int get_pair_count() const { return pair_count; } - Octree(real_t p_unit_size = 1.0); - ~Octree() { _remove_tree(root); } -}; - -/* PRIVATE FUNCTIONS */ - -template <class T, bool use_pairs, class AL> -T *Octree<T, use_pairs, AL>::get(OctreeElementID p_id) const { - const typename ElementMap::Element *E = element_map.find(p_id); - ERR_FAIL_COND_V(!E, nullptr); - return E->get().userdata; -} - -template <class T, bool use_pairs, class AL> -bool Octree<T, use_pairs, AL>::is_pairable(OctreeElementID p_id) const { - const typename ElementMap::Element *E = element_map.find(p_id); - ERR_FAIL_COND_V(!E, false); - return E->get().pairable; -} - -template <class T, bool use_pairs, class AL> -int Octree<T, use_pairs, AL>::get_subindex(OctreeElementID p_id) const { - const typename ElementMap::Element *E = element_map.find(p_id); - ERR_FAIL_COND_V(!E, -1); - return E->get().subindex; -} - -#define OCTREE_DIVISOR 4 - -template <class T, bool use_pairs, class AL> -void Octree<T, use_pairs, AL>::_insert_element(Element *p_element, Octant *p_octant) { - real_t element_size = p_element->aabb.get_longest_axis_size() * 1.01; // avoid precision issues - - if (p_octant->aabb.size.x / OCTREE_DIVISOR < element_size) { - //if (p_octant->aabb.size.x*0.5 < element_size) { - /* at smallest possible size for the element */ - typename Element::OctantOwner owner; - owner.octant = p_octant; - - if (use_pairs && p_element->pairable) { - p_octant->pairable_elements.push_back(p_element); - owner.E = p_octant->pairable_elements.back(); - } else { - p_octant->elements.push_back(p_element); - owner.E = p_octant->elements.back(); - } - - p_element->octant_owners.push_back(owner); - - if (p_element->common_parent == nullptr) { - p_element->common_parent = p_octant; - p_element->container_aabb = p_octant->aabb; - } else { - p_element->container_aabb.merge_with(p_octant->aabb); - } - - if (use_pairs && p_octant->children_count > 0) { - pass++; //elements below this only get ONE reference added - - for (int i = 0; i < 8; i++) { - if (p_octant->children[i]) { - _pair_element(p_element, p_octant->children[i]); - } - } - } - } else { - /* not big enough, send it to subitems */ - int splits = 0; - bool candidate = p_element->common_parent == nullptr; - - for (int i = 0; i < 8; i++) { - if (p_octant->children[i]) { - /* element exists, go straight to it */ - if (p_octant->children[i]->aabb.intersects_inclusive(p_element->aabb)) { - _insert_element(p_element, p_octant->children[i]); - splits++; - } - } else { - /* check against AABB where child should be */ - - AABB aabb = p_octant->aabb; - aabb.size *= 0.5; - - if (i & 1) { - aabb.position.x += aabb.size.x; - } - if (i & 2) { - aabb.position.y += aabb.size.y; - } - if (i & 4) { - aabb.position.z += aabb.size.z; - } - - if (aabb.intersects_inclusive(p_element->aabb)) { - /* if actually intersects, create the child */ - - Octant *child = memnew_allocator(Octant, AL); - p_octant->children[i] = child; - child->parent = p_octant; - child->parent_index = i; - - child->aabb = aabb; - - p_octant->children_count++; - - _insert_element(p_element, child); - octant_count++; - splits++; - } - } - } - - if (candidate && splits > 1) { - p_element->common_parent = p_octant; - } - } - - if (use_pairs) { - typename List<Element *, AL>::Element *E = p_octant->pairable_elements.front(); - - while (E) { - _pair_reference(p_element, E->get()); - E = E->next(); - } - - if (p_element->pairable) { - // and always test non-pairable if element is pairable - E = p_octant->elements.front(); - while (E) { - _pair_reference(p_element, E->get()); - E = E->next(); - } - } - } -} - -template <class T, bool use_pairs, class AL> -void Octree<T, use_pairs, AL>::_ensure_valid_root(const AABB &p_aabb) { - if (!root) { - // octre is empty - - AABB base(Vector3(), Vector3(1.0, 1.0, 1.0) * unit_size); - - while (!base.encloses(p_aabb)) { - if (ABS(base.position.x + base.size.x) <= ABS(base.position.x)) { - /* grow towards positive */ - base.size *= 2.0; - } else { - base.position -= base.size; - base.size *= 2.0; - } - } - - root = memnew_allocator(Octant, AL); - - root->parent = nullptr; - root->parent_index = -1; - root->aabb = base; - - octant_count++; - - } else { - AABB base = root->aabb; - - while (!base.encloses(p_aabb)) { - ERR_FAIL_COND_MSG(base.size.x > OCTREE_SIZE_LIMIT, "Octree upper size limit reached, does the AABB supplied contain NAN?"); - - Octant *gp = memnew_allocator(Octant, AL); - octant_count++; - root->parent = gp; - - if (ABS(base.position.x + base.size.x) <= ABS(base.position.x)) { - /* grow towards positive */ - base.size *= 2.0; - gp->aabb = base; - gp->children[0] = root; - root->parent_index = 0; - } else { - base.position -= base.size; - base.size *= 2.0; - gp->aabb = base; - gp->children[(1 << 0) | (1 << 1) | (1 << 2)] = root; // add at all-positive - root->parent_index = (1 << 0) | (1 << 1) | (1 << 2); - } - - gp->children_count = 1; - root = gp; - } - } -} - -template <class T, bool use_pairs, class AL> -bool Octree<T, use_pairs, AL>::_remove_element_from_octant(Element *p_element, Octant *p_octant, Octant *p_limit) { - bool octant_removed = false; - - while (true) { - // check all exit conditions - - if (p_octant == p_limit) { // reached limit, nothing to erase, exit - return octant_removed; - } - - bool unpaired = false; - - if (use_pairs && p_octant->last_pass != pass) { - // check whether we should unpair stuff - // always test pairable - typename List<Element *, AL>::Element *E = p_octant->pairable_elements.front(); - while (E) { - _pair_unreference(p_element, E->get()); - E = E->next(); - } - if (p_element->pairable) { - // and always test non-pairable if element is pairable - E = p_octant->elements.front(); - while (E) { - _pair_unreference(p_element, E->get()); - E = E->next(); - } - } - p_octant->last_pass = pass; - unpaired = true; - } - - bool removed = false; - - Octant *parent = p_octant->parent; - - if (p_octant->children_count == 0 && p_octant->elements.is_empty() && p_octant->pairable_elements.is_empty()) { - // erase octant - - if (p_octant == root) { // won't have a parent, just erase - - root = nullptr; - } else { - ERR_FAIL_INDEX_V(p_octant->parent_index, 8, octant_removed); - - parent->children[p_octant->parent_index] = nullptr; - parent->children_count--; - } - - memdelete_allocator<Octant, AL>(p_octant); - octant_count--; - removed = true; - octant_removed = true; - } - - if (!removed && !unpaired) { - return octant_removed; // no reason to keep going up anymore! was already visited and was not removed - } - - p_octant = parent; - } - - return octant_removed; -} - -template <class T, bool use_pairs, class AL> -void Octree<T, use_pairs, AL>::_unpair_element(Element *p_element, Octant *p_octant) { - // always test pairable - typename List<Element *, AL>::Element *E = p_octant->pairable_elements.front(); - while (E) { - if (E->get()->last_pass != pass) { // only remove ONE reference - _pair_unreference(p_element, E->get()); - E->get()->last_pass = pass; - } - E = E->next(); - } - - if (p_element->pairable) { - // and always test non-pairable if element is pairable - E = p_octant->elements.front(); - while (E) { - if (E->get()->last_pass != pass) { // only remove ONE reference - _pair_unreference(p_element, E->get()); - E->get()->last_pass = pass; - } - E = E->next(); - } - } - - p_octant->last_pass = pass; - - if (p_octant->children_count == 0) { - return; // small optimization for leafs - } - - for (int i = 0; i < 8; i++) { - if (p_octant->children[i]) { - _unpair_element(p_element, p_octant->children[i]); - } - } -} - -template <class T, bool use_pairs, class AL> -void Octree<T, use_pairs, AL>::_pair_element(Element *p_element, Octant *p_octant) { - // always test pairable - - typename List<Element *, AL>::Element *E = p_octant->pairable_elements.front(); - - while (E) { - if (E->get()->last_pass != pass) { // only get ONE reference - _pair_reference(p_element, E->get()); - E->get()->last_pass = pass; - } - E = E->next(); - } - - if (p_element->pairable) { - // and always test non-pairable if element is pairable - E = p_octant->elements.front(); - while (E) { - if (E->get()->last_pass != pass) { // only get ONE reference - _pair_reference(p_element, E->get()); - E->get()->last_pass = pass; - } - E = E->next(); - } - } - p_octant->last_pass = pass; - - if (p_octant->children_count == 0) { - return; // small optimization for leafs - } - - for (int i = 0; i < 8; i++) { - if (p_octant->children[i]) { - _pair_element(p_element, p_octant->children[i]); - } - } -} - -template <class T, bool use_pairs, class AL> -void Octree<T, use_pairs, AL>::_remove_element(Element *p_element) { - pass++; // will do a new pass for this - - typename List<typename Element::OctantOwner, AL>::Element *I = p_element->octant_owners.front(); - - /* FIRST remove going up normally */ - for (; I; I = I->next()) { - Octant *o = I->get().octant; - - if (!use_pairs) { // small speedup - o->elements.erase(I->get().E); - } - - _remove_element_from_octant(p_element, o); - } - - /* THEN remove going down */ - - I = p_element->octant_owners.front(); - - if (use_pairs) { - for (; I; I = I->next()) { - Octant *o = I->get().octant; - - // erase children pairs, they are erased ONCE even if repeated - pass++; - for (int i = 0; i < 8; i++) { - if (o->children[i]) { - _unpair_element(p_element, o->children[i]); - } - } - - if (p_element->pairable) { - o->pairable_elements.erase(I->get().E); - } else { - o->elements.erase(I->get().E); - } - } - } - - p_element->octant_owners.clear(); - - if (use_pairs) { - int remaining = p_element->pair_list.size(); - //p_element->pair_list.clear(); - ERR_FAIL_COND(remaining); - } -} - -template <class T, bool use_pairs, class AL> -OctreeElementID Octree<T, use_pairs, AL>::create(T *p_userdata, const AABB &p_aabb, int p_subindex, bool p_pairable, uint32_t p_pairable_type, uint32_t p_pairable_mask) { -// check for AABB validity -#ifdef DEBUG_ENABLED - ERR_FAIL_COND_V(p_aabb.position.x > 1e15 || p_aabb.position.x < -1e15, 0); - ERR_FAIL_COND_V(p_aabb.position.y > 1e15 || p_aabb.position.y < -1e15, 0); - ERR_FAIL_COND_V(p_aabb.position.z > 1e15 || p_aabb.position.z < -1e15, 0); - ERR_FAIL_COND_V(p_aabb.size.x > 1e15 || p_aabb.size.x < 0.0, 0); - ERR_FAIL_COND_V(p_aabb.size.y > 1e15 || p_aabb.size.y < 0.0, 0); - ERR_FAIL_COND_V(p_aabb.size.z > 1e15 || p_aabb.size.z < 0.0, 0); - ERR_FAIL_COND_V(Math::is_nan(p_aabb.size.x), 0); - ERR_FAIL_COND_V(Math::is_nan(p_aabb.size.y), 0); - ERR_FAIL_COND_V(Math::is_nan(p_aabb.size.z), 0); - -#endif - typename ElementMap::Element *E = element_map.insert(last_element_id++, - Element()); - Element &e = E->get(); - - e.aabb = p_aabb; - e.userdata = p_userdata; - e.subindex = p_subindex; - e.last_pass = 0; - e.octree = this; - e.pairable = p_pairable; - e.pairable_type = p_pairable_type; - e.pairable_mask = p_pairable_mask; - e._id = last_element_id - 1; - - if (!e.aabb.has_no_surface()) { - _ensure_valid_root(p_aabb); - _insert_element(&e, root); - if (use_pairs) { - _element_check_pairs(&e); - } - } - - return last_element_id - 1; -} - -template <class T, bool use_pairs, class AL> -void Octree<T, use_pairs, AL>::move(OctreeElementID p_id, const AABB &p_aabb) { -#ifdef DEBUG_ENABLED - // check for AABB validity - ERR_FAIL_COND(p_aabb.position.x > 1e15 || p_aabb.position.x < -1e15); - ERR_FAIL_COND(p_aabb.position.y > 1e15 || p_aabb.position.y < -1e15); - ERR_FAIL_COND(p_aabb.position.z > 1e15 || p_aabb.position.z < -1e15); - ERR_FAIL_COND(p_aabb.size.x > 1e15 || p_aabb.size.x < 0.0); - ERR_FAIL_COND(p_aabb.size.y > 1e15 || p_aabb.size.y < 0.0); - ERR_FAIL_COND(p_aabb.size.z > 1e15 || p_aabb.size.z < 0.0); - ERR_FAIL_COND(Math::is_nan(p_aabb.size.x)); - ERR_FAIL_COND(Math::is_nan(p_aabb.size.y)); - ERR_FAIL_COND(Math::is_nan(p_aabb.size.z)); -#endif - typename ElementMap::Element *E = element_map.find(p_id); - ERR_FAIL_COND(!E); - Element &e = E->get(); - - bool old_has_surf = !e.aabb.has_no_surface(); - bool new_has_surf = !p_aabb.has_no_surface(); - - if (old_has_surf != new_has_surf) { - if (old_has_surf) { - _remove_element(&e); // removing - e.common_parent = nullptr; - e.aabb = AABB(); - _optimize(); - } else { - _ensure_valid_root(p_aabb); // inserting - e.common_parent = nullptr; - e.aabb = p_aabb; - _insert_element(&e, root); - if (use_pairs) { - _element_check_pairs(&e); - } - } - - return; - } - - if (!old_has_surf) { // doing nothing - return; - } - - // it still is enclosed in the same AABB it was assigned to - if (e.container_aabb.encloses(p_aabb)) { - e.aabb = p_aabb; - if (use_pairs) { - _element_check_pairs(&e); // must check pairs anyway - } - - return; - } - - AABB combined = e.aabb; - combined.merge_with(p_aabb); - _ensure_valid_root(combined); - - ERR_FAIL_COND(e.octant_owners.front() == nullptr); - - /* FIND COMMON PARENT */ - - List<typename Element::OctantOwner, AL> owners = e.octant_owners; // save the octant owners - Octant *common_parent = e.common_parent; - ERR_FAIL_COND(!common_parent); - - //src is now the place towards where insertion is going to happen - pass++; - - while (common_parent && !common_parent->aabb.encloses(p_aabb)) { - common_parent = common_parent->parent; - } - - ERR_FAIL_COND(!common_parent); - - //prepare for reinsert - e.octant_owners.clear(); - e.common_parent = nullptr; - e.aabb = p_aabb; - - _insert_element(&e, common_parent); // reinsert from this point - - pass++; - - for (typename List<typename Element::OctantOwner, AL>::Element *F = owners.front(); F;) { - Octant *o = F->get().octant; - typename List<typename Element::OctantOwner, AL>::Element *N = F->next(); - - if (use_pairs && e.pairable) { - o->pairable_elements.erase(F->get().E); - } else { - o->elements.erase(F->get().E); - } - - if (_remove_element_from_octant(&e, o, common_parent->parent)) { - owners.erase(F); - } - - F = N; - } - - if (use_pairs) { - //unpair child elements in anything that survived - for (typename List<typename Element::OctantOwner, AL>::Element *F = owners.front(); F; F = F->next()) { - Octant *o = F->get().octant; - - // erase children pairs, unref ONCE - pass++; - for (int i = 0; i < 8; i++) { - if (o->children[i]) { - _unpair_element(&e, o->children[i]); - } - } - } - - _element_check_pairs(&e); - } - - _optimize(); -} - -template <class T, bool use_pairs, class AL> -void Octree<T, use_pairs, AL>::set_pairable(OctreeElementID p_id, bool p_pairable, uint32_t p_pairable_type, uint32_t p_pairable_mask) { - typename ElementMap::Element *E = element_map.find(p_id); - ERR_FAIL_COND(!E); - - Element &e = E->get(); - - if (p_pairable == e.pairable && e.pairable_type == p_pairable_type && e.pairable_mask == p_pairable_mask) { - return; // no changes, return - } - - if (!e.aabb.has_no_surface()) { - _remove_element(&e); - } - - e.pairable = p_pairable; - e.pairable_type = p_pairable_type; - e.pairable_mask = p_pairable_mask; - e.common_parent = nullptr; - - if (!e.aabb.has_no_surface()) { - _ensure_valid_root(e.aabb); - _insert_element(&e, root); - if (use_pairs) { - _element_check_pairs(&e); - } - } -} - -template <class T, bool use_pairs, class AL> -void Octree<T, use_pairs, AL>::erase(OctreeElementID p_id) { - typename ElementMap::Element *E = element_map.find(p_id); - ERR_FAIL_COND(!E); - - Element &e = E->get(); - - if (!e.aabb.has_no_surface()) { - _remove_element(&e); - } - - element_map.erase(p_id); - _optimize(); -} - -template <class T, bool use_pairs, class AL> -void Octree<T, use_pairs, AL>::_cull_convex(Octant *p_octant, _CullConvexData *p_cull) { - if (*p_cull->result_idx == p_cull->result_max) { - return; //pointless - } - - if (!p_octant->elements.is_empty()) { - typename List<Element *, AL>::Element *I; - I = p_octant->elements.front(); - - for (; I; I = I->next()) { - Element *e = I->get(); - - if (e->last_pass == pass || (use_pairs && !(e->pairable_type & p_cull->mask))) { - continue; - } - e->last_pass = pass; - - if (e->aabb.intersects_convex_shape(p_cull->planes, p_cull->plane_count, p_cull->points, p_cull->point_count)) { - if (*p_cull->result_idx < p_cull->result_max) { - p_cull->result_array[*p_cull->result_idx] = e->userdata; - (*p_cull->result_idx)++; - } else { - return; // pointless to continue - } - } - } - } - - if (use_pairs && !p_octant->pairable_elements.is_empty()) { - typename List<Element *, AL>::Element *I; - I = p_octant->pairable_elements.front(); - - for (; I; I = I->next()) { - Element *e = I->get(); - - if (e->last_pass == pass || (use_pairs && !(e->pairable_type & p_cull->mask))) { - continue; - } - e->last_pass = pass; - - if (e->aabb.intersects_convex_shape(p_cull->planes, p_cull->plane_count, p_cull->points, p_cull->point_count)) { - if (*p_cull->result_idx < p_cull->result_max) { - p_cull->result_array[*p_cull->result_idx] = e->userdata; - (*p_cull->result_idx)++; - } else { - return; // pointless to continue - } - } - } - } - - for (int i = 0; i < 8; i++) { - if (p_octant->children[i] && p_octant->children[i]->aabb.intersects_convex_shape(p_cull->planes, p_cull->plane_count, p_cull->points, p_cull->point_count)) { - _cull_convex(p_octant->children[i], p_cull); - } - } -} - -template <class T, bool use_pairs, class AL> -void Octree<T, use_pairs, AL>::_cull_aabb(Octant *p_octant, const AABB &p_aabb, T **p_result_array, int *p_result_idx, int p_result_max, int *p_subindex_array, uint32_t p_mask) { - if (*p_result_idx == p_result_max) { - return; //pointless - } - - if (!p_octant->elements.is_empty()) { - typename List<Element *, AL>::Element *I; - I = p_octant->elements.front(); - for (; I; I = I->next()) { - Element *e = I->get(); - - if (e->last_pass == pass || (use_pairs && !(e->pairable_type & p_mask))) { - continue; - } - e->last_pass = pass; - - if (p_aabb.intersects_inclusive(e->aabb)) { - if (*p_result_idx < p_result_max) { - p_result_array[*p_result_idx] = e->userdata; - if (p_subindex_array) { - p_subindex_array[*p_result_idx] = e->subindex; - } - - (*p_result_idx)++; - } else { - return; // pointless to continue - } - } - } - } - - if (use_pairs && !p_octant->pairable_elements.is_empty()) { - typename List<Element *, AL>::Element *I; - I = p_octant->pairable_elements.front(); - for (; I; I = I->next()) { - Element *e = I->get(); - - if (e->last_pass == pass || (use_pairs && !(e->pairable_type & p_mask))) { - continue; - } - e->last_pass = pass; - - if (p_aabb.intersects_inclusive(e->aabb)) { - if (*p_result_idx < p_result_max) { - p_result_array[*p_result_idx] = e->userdata; - if (p_subindex_array) { - p_subindex_array[*p_result_idx] = e->subindex; - } - (*p_result_idx)++; - } else { - return; // pointless to continue - } - } - } - } - - for (int i = 0; i < 8; i++) { - if (p_octant->children[i] && p_octant->children[i]->aabb.intersects_inclusive(p_aabb)) { - _cull_aabb(p_octant->children[i], p_aabb, p_result_array, p_result_idx, p_result_max, p_subindex_array, p_mask); - } - } -} - -template <class T, bool use_pairs, class AL> -void Octree<T, use_pairs, AL>::_cull_segment(Octant *p_octant, const Vector3 &p_from, const Vector3 &p_to, T **p_result_array, int *p_result_idx, int p_result_max, int *p_subindex_array, uint32_t p_mask) { - if (*p_result_idx == p_result_max) { - return; //pointless - } - - if (!p_octant->elements.is_empty()) { - typename List<Element *, AL>::Element *I; - I = p_octant->elements.front(); - for (; I; I = I->next()) { - Element *e = I->get(); - - if (e->last_pass == pass || (use_pairs && !(e->pairable_type & p_mask))) { - continue; - } - e->last_pass = pass; - - if (e->aabb.intersects_segment(p_from, p_to)) { - if (*p_result_idx < p_result_max) { - p_result_array[*p_result_idx] = e->userdata; - if (p_subindex_array) { - p_subindex_array[*p_result_idx] = e->subindex; - } - (*p_result_idx)++; - - } else { - return; // pointless to continue - } - } - } - } - - if (use_pairs && !p_octant->pairable_elements.is_empty()) { - typename List<Element *, AL>::Element *I; - I = p_octant->pairable_elements.front(); - for (; I; I = I->next()) { - Element *e = I->get(); - - if (e->last_pass == pass || (use_pairs && !(e->pairable_type & p_mask))) { - continue; - } - - e->last_pass = pass; - - if (e->aabb.intersects_segment(p_from, p_to)) { - if (*p_result_idx < p_result_max) { - p_result_array[*p_result_idx] = e->userdata; - if (p_subindex_array) { - p_subindex_array[*p_result_idx] = e->subindex; - } - - (*p_result_idx)++; - - } else { - return; // pointless to continue - } - } - } - } - - for (int i = 0; i < 8; i++) { - if (p_octant->children[i] && p_octant->children[i]->aabb.intersects_segment(p_from, p_to)) { - _cull_segment(p_octant->children[i], p_from, p_to, p_result_array, p_result_idx, p_result_max, p_subindex_array, p_mask); - } - } -} - -template <class T, bool use_pairs, class AL> -void Octree<T, use_pairs, AL>::_cull_point(Octant *p_octant, const Vector3 &p_point, T **p_result_array, int *p_result_idx, int p_result_max, int *p_subindex_array, uint32_t p_mask) { - if (*p_result_idx == p_result_max) { - return; //pointless - } - - if (!p_octant->elements.is_empty()) { - typename List<Element *, AL>::Element *I; - I = p_octant->elements.front(); - for (; I; I = I->next()) { - Element *e = I->get(); - - if (e->last_pass == pass || (use_pairs && !(e->pairable_type & p_mask))) { - continue; - } - e->last_pass = pass; - - if (e->aabb.has_point(p_point)) { - if (*p_result_idx < p_result_max) { - p_result_array[*p_result_idx] = e->userdata; - if (p_subindex_array) { - p_subindex_array[*p_result_idx] = e->subindex; - } - (*p_result_idx)++; - - } else { - return; // pointless to continue - } - } - } - } - - if (use_pairs && !p_octant->pairable_elements.is_empty()) { - typename List<Element *, AL>::Element *I; - I = p_octant->pairable_elements.front(); - for (; I; I = I->next()) { - Element *e = I->get(); - - if (e->last_pass == pass || (use_pairs && !(e->pairable_type & p_mask))) { - continue; - } - - e->last_pass = pass; - - if (e->aabb.has_point(p_point)) { - if (*p_result_idx < p_result_max) { - p_result_array[*p_result_idx] = e->userdata; - if (p_subindex_array) { - p_subindex_array[*p_result_idx] = e->subindex; - } - - (*p_result_idx)++; - - } else { - return; // pointless to continue - } - } - } - } - - for (int i = 0; i < 8; i++) { - //could be optimized.. - if (p_octant->children[i] && p_octant->children[i]->aabb.has_point(p_point)) { - _cull_point(p_octant->children[i], p_point, p_result_array, p_result_idx, p_result_max, p_subindex_array, p_mask); - } - } -} - -template <class T, bool use_pairs, class AL> -int Octree<T, use_pairs, AL>::cull_convex(const Vector<Plane> &p_convex, T **p_result_array, int p_result_max, uint32_t p_mask) { - if (!root || p_convex.size() == 0) { - return 0; - } - - Vector<Vector3> convex_points = Geometry3D::compute_convex_mesh_points(&p_convex[0], p_convex.size()); - if (convex_points.size() == 0) { - return 0; - } - - int result_count = 0; - pass++; - _CullConvexData cdata; - cdata.planes = &p_convex[0]; - cdata.plane_count = p_convex.size(); - cdata.points = &convex_points[0]; - cdata.point_count = convex_points.size(); - cdata.result_array = p_result_array; - cdata.result_max = p_result_max; - cdata.result_idx = &result_count; - cdata.mask = p_mask; - - _cull_convex(root, &cdata); - - return result_count; -} - -template <class T, bool use_pairs, class AL> -int Octree<T, use_pairs, AL>::cull_aabb(const AABB &p_aabb, T **p_result_array, int p_result_max, int *p_subindex_array, uint32_t p_mask) { - if (!root) { - return 0; - } - - int result_count = 0; - pass++; - _cull_aabb(root, p_aabb, p_result_array, &result_count, p_result_max, p_subindex_array, p_mask); - - return result_count; -} - -template <class T, bool use_pairs, class AL> -int Octree<T, use_pairs, AL>::cull_segment(const Vector3 &p_from, const Vector3 &p_to, T **p_result_array, int p_result_max, int *p_subindex_array, uint32_t p_mask) { - if (!root) { - return 0; - } - - int result_count = 0; - pass++; - _cull_segment(root, p_from, p_to, p_result_array, &result_count, p_result_max, p_subindex_array, p_mask); - - return result_count; -} - -template <class T, bool use_pairs, class AL> -int Octree<T, use_pairs, AL>::cull_point(const Vector3 &p_point, T **p_result_array, int p_result_max, int *p_subindex_array, uint32_t p_mask) { - if (!root) { - return 0; - } - - int result_count = 0; - pass++; - _cull_point(root, p_point, p_result_array, &result_count, p_result_max, p_subindex_array, p_mask); - - return result_count; -} - -template <class T, bool use_pairs, class AL> -void Octree<T, use_pairs, AL>::set_pair_callback(PairCallback p_callback, void *p_userdata) { - pair_callback = p_callback; - pair_callback_userdata = p_userdata; -} - -template <class T, bool use_pairs, class AL> -void Octree<T, use_pairs, AL>::set_unpair_callback(UnpairCallback p_callback, void *p_userdata) { - unpair_callback = p_callback; - unpair_callback_userdata = p_userdata; -} - -template <class T, bool use_pairs, class AL> -Octree<T, use_pairs, AL>::Octree(real_t p_unit_size) { - unit_size = p_unit_size; -} - -#endif // OCTREE_H diff --git a/core/object/class_db.cpp b/core/object/class_db.cpp index 3c9f373d12..ac008dad88 100644 --- a/core/object/class_db.cpp +++ b/core/object/class_db.cpp @@ -536,7 +536,7 @@ MethodBind *ClassDB::get_method(const StringName &p_class, const StringName &p_n return nullptr; } -void ClassDB::bind_integer_constant(const StringName &p_class, const StringName &p_enum, const StringName &p_name, int64_t p_constant) { +void ClassDB::bind_integer_constant(const StringName &p_class, const StringName &p_enum, const StringName &p_name, int64_t p_constant, bool p_is_bitfield) { OBJTYPE_WLOCK; ClassInfo *type = classes.getptr(p_class); @@ -555,13 +555,15 @@ void ClassDB::bind_integer_constant(const StringName &p_class, const StringName enum_name = enum_name.get_slicec('.', 1); } - List<StringName> *constants_list = type->enum_map.getptr(enum_name); + ClassInfo::EnumInfo *constants_list = type->enum_map.getptr(enum_name); if (constants_list) { - constants_list->push_back(p_name); + constants_list->constants.push_back(p_name); + constants_list->is_bitfield = p_is_bitfield; } else { - List<StringName> new_list; - new_list.push_back(p_name); + ClassInfo::EnumInfo new_list; + new_list.is_bitfield = p_is_bitfield; + new_list.constants.push_back(p_name); type->enum_map[enum_name] = new_list; } } @@ -645,8 +647,8 @@ StringName ClassDB::get_integer_constant_enum(const StringName &p_class, const S ClassInfo *type = classes.getptr(p_class); while (type) { - for (KeyValue<StringName, List<StringName>> &E : type->enum_map) { - List<StringName> &constants_list = E.value; + for (KeyValue<StringName, ClassInfo::EnumInfo> &E : type->enum_map) { + List<StringName> &constants_list = E.value.constants; const List<StringName>::Element *found = constants_list.find(p_name); if (found) { return E.key; @@ -669,7 +671,7 @@ void ClassDB::get_enum_list(const StringName &p_class, List<StringName> *p_enums ClassInfo *type = classes.getptr(p_class); while (type) { - for (KeyValue<StringName, List<StringName>> &E : type->enum_map) { + for (KeyValue<StringName, ClassInfo::EnumInfo> &E : type->enum_map) { p_enums->push_back(E.key); } @@ -687,10 +689,10 @@ void ClassDB::get_enum_constants(const StringName &p_class, const StringName &p_ ClassInfo *type = classes.getptr(p_class); while (type) { - const List<StringName> *constants = type->enum_map.getptr(p_enum); + const ClassInfo::EnumInfo *constants = type->enum_map.getptr(p_enum); if (constants) { - for (const List<StringName>::Element *E = constants->front(); E; E = E->next()) { + for (const List<StringName>::Element *E = constants->constants.front(); E; E = E->next()) { p_constants->push_back(E->get()); } } @@ -748,6 +750,25 @@ bool ClassDB::has_enum(const StringName &p_class, const StringName &p_name, bool return false; } +bool ClassDB::is_enum_bitfield(const StringName &p_class, const StringName &p_name, bool p_no_inheritance) { + OBJTYPE_RLOCK; + + ClassInfo *type = classes.getptr(p_class); + + while (type) { + if (type->enum_map.has(p_name) && type->enum_map[p_name].is_bitfield) { + return true; + } + if (p_no_inheritance) { + return false; + } + + type = type->inherits_ptr; + } + + return false; +} + void ClassDB::add_signal(const StringName &p_class, const MethodInfo &p_signal) { OBJTYPE_WLOCK; diff --git a/core/object/class_db.h b/core/object/class_db.h index f2f73dc674..1d26eb18f1 100644 --- a/core/object/class_db.h +++ b/core/object/class_db.h @@ -104,7 +104,12 @@ public: HashMap<StringName, MethodBind *> method_map; HashMap<StringName, int64_t> constant_map; - HashMap<StringName, List<StringName>> enum_map; + struct EnumInfo { + List<StringName> constants; + bool is_bitfield = false; + }; + + HashMap<StringName, EnumInfo> enum_map; HashMap<StringName, MethodInfo> signal_map; List<PropertyInfo> property_list; HashMap<StringName, PropertyInfo> property_map; @@ -325,15 +330,17 @@ public: static void add_virtual_method(const StringName &p_class, const MethodInfo &p_method, bool p_virtual = true, const Vector<String> &p_arg_names = Vector<String>(), bool p_object_core = false); static void get_virtual_methods(const StringName &p_class, List<MethodInfo> *p_methods, bool p_no_inheritance = false); - static void bind_integer_constant(const StringName &p_class, const StringName &p_enum, const StringName &p_name, int64_t p_constant); + static void bind_integer_constant(const StringName &p_class, const StringName &p_enum, const StringName &p_name, int64_t p_constant, bool p_is_bitfield = false); static void get_integer_constant_list(const StringName &p_class, List<String> *p_constants, bool p_no_inheritance = false); static int64_t get_integer_constant(const StringName &p_class, const StringName &p_name, bool *p_success = nullptr); static bool has_integer_constant(const StringName &p_class, const StringName &p_name, bool p_no_inheritance = false); static StringName get_integer_constant_enum(const StringName &p_class, const StringName &p_name, bool p_no_inheritance = false); + static StringName get_integer_constant_bitfield(const StringName &p_class, const StringName &p_name, bool p_no_inheritance = false); static void get_enum_list(const StringName &p_class, List<StringName> *p_enums, bool p_no_inheritance = false); static void get_enum_constants(const StringName &p_class, const StringName &p_enum, List<StringName> *p_constants, bool p_no_inheritance = false); static bool has_enum(const StringName &p_class, const StringName &p_name, bool p_no_inheritance = false); + static bool is_enum_bitfield(const StringName &p_class, const StringName &p_name, bool p_no_inheritance = false); static void set_method_error_return_values(const StringName &p_class, const StringName &p_method, const Vector<Error> &p_values); static Vector<Error> get_method_error_return_values(const StringName &p_class, const StringName &p_method); @@ -370,6 +377,9 @@ public: #define BIND_ENUM_CONSTANT(m_constant) \ ::ClassDB::bind_integer_constant(get_class_static(), __constant_get_enum_name(m_constant, #m_constant), #m_constant, m_constant); +#define BIND_BITFIELD_FLAG(m_constant) \ + ::ClassDB::bind_integer_constant(get_class_static(), __constant_get_bitfield_name(m_constant, #m_constant), #m_constant, m_constant, true); + _FORCE_INLINE_ void errarray_add_str(Vector<Error> &arr) { } @@ -401,6 +411,9 @@ _FORCE_INLINE_ Vector<Error> errarray(P... p_args) { #define BIND_ENUM_CONSTANT(m_constant) \ ::ClassDB::bind_integer_constant(get_class_static(), StringName(), #m_constant, m_constant); +#define BIND_BITFIELD_FLAG(m_constant) \ + ::ClassDB::bind_integer_constant(get_class_static(), StringName(), #m_constant, m_constant, true); + #define BIND_METHOD_ERR_RETURN_DOC(m_method, ...) #endif diff --git a/core/object/object.h b/core/object/object.h index 1f6386e6b4..87d042dd7e 100644 --- a/core/object/object.h +++ b/core/object/object.h @@ -109,6 +109,7 @@ enum PropertyUsageFlags { PROPERTY_USAGE_GROUP = 128, //used for grouping props in the editor PROPERTY_USAGE_CATEGORY = 256, PROPERTY_USAGE_SUBGROUP = 512, + PROPERTY_USAGE_CLASS_IS_BITFIELD = 1024, PROPERTY_USAGE_NO_INSTANCE_STATE = 2048, PROPERTY_USAGE_RESTART_IF_CHANGED = 4096, PROPERTY_USAGE_SCRIPT_VARIABLE = 8192, diff --git a/core/object/script_language.h b/core/object/script_language.h index 776a9bfaab..686ab5b8d3 100644 --- a/core/object/script_language.h +++ b/core/object/script_language.h @@ -350,6 +350,7 @@ public: LOOKUP_RESULT_CLASS_SIGNAL, LOOKUP_RESULT_CLASS_ENUM, LOOKUP_RESULT_CLASS_TBD_GLOBALSCOPE, + LOOKUP_RESULT_CLASS_ANNOTATION, LOOKUP_RESULT_MAX }; @@ -402,6 +403,7 @@ public: virtual void get_recognized_extensions(List<String> *p_extensions) const = 0; virtual void get_public_functions(List<MethodInfo> *p_functions) const = 0; virtual void get_public_constants(List<Pair<String, Variant>> *p_constants) const = 0; + virtual void get_public_annotations(List<MethodInfo> *p_annotations) const = 0; struct ProfilingInfo { StringName signature; diff --git a/core/object/script_language_extension.cpp b/core/object/script_language_extension.cpp index 5af79bbea3..ab8dd6d1ee 100644 --- a/core/object/script_language_extension.cpp +++ b/core/object/script_language_extension.cpp @@ -134,6 +134,7 @@ void ScriptLanguageExtension::_bind_methods() { GDVIRTUAL_BIND(_get_recognized_extensions); GDVIRTUAL_BIND(_get_public_functions); GDVIRTUAL_BIND(_get_public_constants); + GDVIRTUAL_BIND(_get_public_annotations); GDVIRTUAL_BIND(_profiling_start); GDVIRTUAL_BIND(_profiling_stop); @@ -160,6 +161,7 @@ void ScriptLanguageExtension::_bind_methods() { BIND_ENUM_CONSTANT(LOOKUP_RESULT_CLASS_SIGNAL); BIND_ENUM_CONSTANT(LOOKUP_RESULT_CLASS_ENUM); BIND_ENUM_CONSTANT(LOOKUP_RESULT_CLASS_TBD_GLOBALSCOPE); + BIND_ENUM_CONSTANT(LOOKUP_RESULT_CLASS_ANNOTATION); BIND_ENUM_CONSTANT(LOOKUP_RESULT_MAX); BIND_ENUM_CONSTANT(LOCATION_LOCAL); diff --git a/core/object/script_language_extension.h b/core/object/script_language_extension.h index 7eea48370e..2c53139ec2 100644 --- a/core/object/script_language_extension.h +++ b/core/object/script_language_extension.h @@ -580,6 +580,15 @@ public: p_constants->push_back(Pair<String, Variant>(d["name"], d["value"])); } } + GDVIRTUAL0RC(TypedArray<Dictionary>, _get_public_annotations) + virtual void get_public_annotations(List<MethodInfo> *p_annotations) const override { + TypedArray<Dictionary> ret; + GDVIRTUAL_REQUIRED_CALL(_get_public_annotations, ret); + for (int i = 0; i < ret.size(); i++) { + MethodInfo mi = MethodInfo::from_dict(ret[i]); + p_annotations->push_back(mi); + } + } EXBIND0(profiling_start) EXBIND0(profiling_stop) diff --git a/core/os/os.h b/core/os/os.h index af6c38cbe0..0428f6df2a 100644 --- a/core/os/os.h +++ b/core/os/os.h @@ -160,6 +160,7 @@ public: virtual String get_name() const = 0; virtual List<String> get_cmdline_args() const { return _cmdline; } + virtual List<String> get_cmdline_platform_args() const { return List<String>(); } virtual String get_model_name() const; bool is_layered_allowed() const { return _allow_layered; } diff --git a/core/string/ustring.cpp b/core/string/ustring.cpp index df1aae5370..beefe54faf 100644 --- a/core/string/ustring.cpp +++ b/core/string/ustring.cpp @@ -323,7 +323,13 @@ void String::copy_from(const char *p_cstr) { char32_t *dst = this->ptrw(); for (size_t i = 0; i <= len; i++) { - dst[i] = p_cstr[i]; + uint8_t c = p_cstr[i] >= 0 ? p_cstr[i] : uint8_t(256 + p_cstr[i]); + if (c == 0 && i < len) { + print_unicode_error("NUL character", true); + dst[i] = 0x20; + } else { + dst[i] = c; + } } } @@ -350,7 +356,13 @@ void String::copy_from(const char *p_cstr, const int p_clip_to) { char32_t *dst = this->ptrw(); for (int i = 0; i < len; i++) { - dst[i] = p_cstr[i]; + uint8_t c = p_cstr[i] >= 0 ? p_cstr[i] : uint8_t(256 + p_cstr[i]); + if (c == 0) { + print_unicode_error("NUL character", true); + dst[i] = 0x20; + } else { + dst[i] = c; + } } dst[len] = 0; } @@ -376,14 +388,21 @@ void String::copy_from(const wchar_t *p_cstr, const int p_clip_to) { } void String::copy_from(const char32_t &p_char) { + if (p_char == 0) { + print_unicode_error("NUL character", true); + return; + } + if ((p_char & 0xfffff800) == 0xd800) { + print_unicode_error(vformat("Unpaired surrogate (%x)", (uint32_t)p_char)); + } + if (p_char > 0x10ffff) { + print_unicode_error(vformat("Invalid unicode codepoint (%x)", (uint32_t)p_char)); + } + resize(2); + char32_t *dst = ptrw(); - if ((p_char >= 0xd800 && p_char <= 0xdfff) || (p_char > 0x10ffff)) { - print_error("Unicode parsing error: Invalid unicode codepoint " + num_int64(p_char, 16) + "."); - dst[0] = 0xfffd; - } else { - dst[0] = p_char; - } + dst[0] = p_char; dst[1] = 0; } @@ -437,12 +456,18 @@ void String::copy_from_unchecked(const char32_t *p_char, const int p_length) { dst[p_length] = 0; for (int i = 0; i < p_length; i++) { - if ((p_char[i] >= 0xd800 && p_char[i] <= 0xdfff) || (p_char[i] > 0x10ffff)) { - print_error("Unicode parsing error: Invalid unicode codepoint " + num_int64(p_char[i], 16) + "."); - dst[i] = 0xfffd; - } else { - dst[i] = p_char[i]; + if (p_char[i] == 0) { + print_unicode_error("NUL character", true); + dst[i] = 0x20; + continue; + } + if ((p_char[i] & 0xfffff800) == 0xd800) { + print_unicode_error(vformat("Unpaired surrogate (%x)", (uint32_t)p_char[i])); } + if (p_char[i] > 0x10ffff) { + print_unicode_error(vformat("Invalid unicode codepoint (%x)", (uint32_t)p_char[i])); + } + dst[i] = p_char[i]; } } @@ -481,7 +506,7 @@ String operator+(const wchar_t *p_chr, const String &p_str) { // wchar_t is 16-bit String tmp = String::utf16((const char16_t *)p_chr); #else - // wchar_t is 32-bi + // wchar_t is 32-bit String tmp = (const char32_t *)p_chr; #endif tmp += p_str; @@ -527,7 +552,13 @@ String &String::operator+=(const char *p_str) { char32_t *dst = ptrw() + lhs_len; for (size_t i = 0; i <= rhs_len; i++) { - dst[i] = p_str[i]; + uint8_t c = p_str[i] >= 0 ? p_str[i] : uint8_t(256 + p_str[i]); + if (c == 0 && i < rhs_len) { + print_unicode_error("NUL character", true); + dst[i] = 0x20; + } else { + dst[i] = c; + } } return *this; @@ -550,15 +581,21 @@ String &String::operator+=(const char32_t *p_str) { } String &String::operator+=(char32_t p_char) { + if (p_char == 0) { + print_unicode_error("NUL character", true); + return *this; + } + if ((p_char & 0xfffff800) == 0xd800) { + print_unicode_error(vformat("Unpaired surrogate (%x)", (uint32_t)p_char)); + } + if (p_char > 0x10ffff) { + print_unicode_error(vformat("Invalid unicode codepoint (%x)", (uint32_t)p_char)); + } + const int lhs_len = length(); resize(lhs_len + 2); char32_t *dst = ptrw(); - if ((p_char >= 0xd800 && p_char <= 0xdfff) || (p_char > 0x10ffff)) { - print_error("Unicode parsing error: Invalid unicode codepoint " + num_int64(p_char, 16) + "."); - dst[lhs_len] = 0xfffd; - } else { - dst[lhs_len] = p_char; - } + dst[lhs_len] = p_char; dst[lhs_len + 1] = 0; return *this; @@ -1583,6 +1620,14 @@ String String::hex_encode_buffer(const uint8_t *p_buffer, int p_len) { return ret; } +void String::print_unicode_error(const String &p_message, bool p_critical) const { + if (p_critical) { + print_error(vformat("Unicode parsing error, some characters were replaced with spaces: %s", p_message)); + } else { + print_error(vformat("Unicode parsing error: %s", p_message)); + } +} + CharString String::ascii(bool p_allow_extended) const { if (!length()) { return CharString(); @@ -1596,7 +1641,7 @@ CharString String::ascii(bool p_allow_extended) const { if ((c <= 0x7f) || (c <= 0xff && p_allow_extended)) { cs[i] = c; } else { - print_error("Unicode parsing error: Cannot represent " + num_int64(c, 16) + " as ASCII/Latin-1 character."); + print_unicode_error(vformat("Invalid unicode codepoint (%x), cannot represent as ASCII/Latin-1", (uint32_t)c)); cs[i] = 0x20; } } @@ -1611,11 +1656,9 @@ String String::utf8(const char *p_utf8, int p_len) { return ret; } -bool String::parse_utf8(const char *p_utf8, int p_len) { -#define UNICERROR(m_err) print_error("Unicode parsing error: " + String(m_err) + ". Is the string valid UTF-8?"); - +Error String::parse_utf8(const char *p_utf8, int p_len) { if (!p_utf8) { - return true; + return ERR_INVALID_DATA; } String aux; @@ -1635,14 +1678,17 @@ bool String::parse_utf8(const char *p_utf8, int p_len) { } } + bool decode_error = false; + bool decode_failed = false; { const char *ptrtmp = p_utf8; const char *ptrtmp_limit = &p_utf8[p_len]; int skip = 0; + uint8_t c_start = 0; while (ptrtmp != ptrtmp_limit && *ptrtmp) { - if (skip == 0) { - uint8_t c = *ptrtmp >= 0 ? *ptrtmp : uint8_t(256 + *ptrtmp); + uint8_t c = *ptrtmp >= 0 ? *ptrtmp : uint8_t(256 + *ptrtmp); + if (skip == 0) { /* Determine the number of characters in sequence */ if ((c & 0x80) == 0) { skip = 0; @@ -1652,20 +1698,34 @@ bool String::parse_utf8(const char *p_utf8, int p_len) { skip = 2; } else if ((c & 0xf8) == 0xf0) { skip = 3; + } else if ((c & 0xfc) == 0xf8) { + skip = 4; + } else if ((c & 0xfe) == 0xfc) { + skip = 5; } else { - UNICERROR("invalid skip at " + num_int64(cstr_size)); - return true; //invalid utf8 + skip = 0; + print_unicode_error(vformat("Invalid UTF-8 leading byte (%x)", c), true); + decode_failed = true; } + c_start = c; if (skip == 1 && (c & 0x1e) == 0) { - UNICERROR("overlong rejected at " + num_int64(cstr_size)); - return true; //reject overlong + print_unicode_error(vformat("Overlong encoding (%x ...)", c)); + decode_error = true; } - str_size++; - } else { - --skip; + if ((c_start == 0xe0 && skip == 2 && c < 0xa0) || (c_start == 0xf0 && skip == 3 && c < 0x90) || (c_start == 0xf8 && skip == 4 && c < 0x88) || (c_start == 0xfc && skip == 5 && c < 0x84)) { + print_unicode_error(vformat("Overlong encoding (%x %x ...)", c_start, c)); + decode_error = true; + } + if (c < 0x80 || c > 0xbf) { + print_unicode_error(vformat("Invalid UTF-8 continuation byte (%x ... %x ...)", c_start, c), true); + decode_failed = true; + skip = 0; + } else { + --skip; + } } cstr_size++; @@ -1673,80 +1733,91 @@ bool String::parse_utf8(const char *p_utf8, int p_len) { } if (skip) { - UNICERROR("no space left"); - return true; //not enough space + print_unicode_error(vformat("Missing %d UTF-8 continuation byte(s)", skip), true); + decode_failed = true; } } if (str_size == 0) { clear(); - return false; + return OK; // empty string } resize(str_size + 1); char32_t *dst = ptrw(); dst[str_size] = 0; + int skip = 0; + uint32_t unichar = 0; while (cstr_size) { - int len = 0; - - /* Determine the number of characters in sequence */ - if ((*p_utf8 & 0x80) == 0) { - len = 1; - } else if ((*p_utf8 & 0xe0) == 0xc0) { - len = 2; - } else if ((*p_utf8 & 0xf0) == 0xe0) { - len = 3; - } else if ((*p_utf8 & 0xf8) == 0xf0) { - len = 4; - } else { - UNICERROR("invalid len"); - return true; //invalid UTF8 - } - - if (len > cstr_size) { - UNICERROR("no space left"); - return true; //not enough space - } - - if (len == 2 && (*p_utf8 & 0x1E) == 0) { - UNICERROR("no space left"); - return true; //reject overlong - } - - /* Convert the first character */ - - uint32_t unichar = 0; - - if (len == 1) { - unichar = *p_utf8; + uint8_t c = *p_utf8 >= 0 ? *p_utf8 : uint8_t(256 + *p_utf8); + + if (skip == 0) { + /* Determine the number of characters in sequence */ + if ((c & 0x80) == 0) { + *(dst++) = c; + unichar = 0; + skip = 0; + } else if ((c & 0xe0) == 0xc0) { + unichar = (0xff >> 3) & c; + skip = 1; + } else if ((c & 0xf0) == 0xe0) { + unichar = (0xff >> 4) & c; + skip = 2; + } else if ((c & 0xf8) == 0xf0) { + unichar = (0xff >> 5) & c; + skip = 3; + } else if ((c & 0xfc) == 0xf8) { + unichar = (0xff >> 6) & c; + skip = 4; + } else if ((c & 0xfe) == 0xfc) { + unichar = (0xff >> 7) & c; + skip = 5; + } else { + *(dst++) = 0x20; + unichar = 0; + skip = 0; + } } else { - unichar = (0xff >> (len + 1)) & *p_utf8; - - for (int i = 1; i < len; i++) { - if ((p_utf8[i] & 0xc0) != 0x80) { - UNICERROR("invalid utf8"); - return true; //invalid utf8 - } - if (unichar == 0 && i == 2 && ((p_utf8[i] & 0x7f) >> (7 - len)) == 0) { - UNICERROR("invalid utf8 overlong"); - return true; //no overlong + if (c < 0x80 || c > 0xbf) { + *(dst++) = 0x20; + skip = 0; + } else { + unichar = (unichar << 6) | (c & 0x3f); + --skip; + if (skip == 0) { + if (unichar == 0) { + print_unicode_error("NUL character", true); + decode_failed = true; + unichar = 0x20; + } + if ((unichar & 0xfffff800) == 0xd800) { + print_unicode_error(vformat("Unpaired surrogate (%x)", unichar)); + decode_error = true; + } + if (unichar > 0x10ffff) { + print_unicode_error(vformat("Invalid unicode codepoint (%x)", unichar)); + decode_error = true; + } + *(dst++) = unichar; } - unichar = (unichar << 6) | (p_utf8[i] & 0x3f); } } - if (unichar >= 0xd800 && unichar <= 0xdfff) { - UNICERROR("invalid code point"); - return CharString(); - } - *(dst++) = unichar; - cstr_size -= len; - p_utf8 += len; + cstr_size--; + p_utf8++; + } + if (skip) { + *(dst++) = 0x20; } - return false; -#undef UNICERROR + if (decode_failed) { + return ERR_INVALID_DATA; + } else if (decode_error) { + return ERR_PARSE_ERROR; + } else { + return OK; + } } CharString String::utf8() const { @@ -1765,15 +1836,17 @@ CharString String::utf8() const { fl += 2; } else if (c <= 0xffff) { // 16 bits fl += 3; - } else if (c <= 0x0010ffff) { // 21 bits + } else if (c <= 0x001fffff) { // 21 bits fl += 4; + } else if (c <= 0x03ffffff) { // 26 bits + fl += 5; + print_unicode_error(vformat("Invalid unicode codepoint (%x)", c)); + } else if (c <= 0x7fffffff) { // 31 bits + fl += 6; + print_unicode_error(vformat("Invalid unicode codepoint (%x)", c)); } else { - print_error("Unicode parsing error: Invalid unicode codepoint " + num_int64(c, 16) + "."); - return CharString(); - } - if (c >= 0xd800 && c <= 0xdfff) { - print_error("Unicode parsing error: Invalid unicode codepoint " + num_int64(c, 16) + "."); - return CharString(); + fl += 1; + print_unicode_error(vformat("Invalid unicode codepoint (%x), cannot represent as UTF-8", c), true); } } @@ -1799,11 +1872,26 @@ CharString String::utf8() const { APPEND_CHAR(uint32_t(0xe0 | ((c >> 12) & 0x0f))); // Top 4 bits. APPEND_CHAR(uint32_t(0x80 | ((c >> 6) & 0x3f))); // Middle 6 bits. APPEND_CHAR(uint32_t(0x80 | (c & 0x3f))); // Bottom 6 bits. - } else { // 21 bits + } else if (c <= 0x001fffff) { // 21 bits APPEND_CHAR(uint32_t(0xf0 | ((c >> 18) & 0x07))); // Top 3 bits. APPEND_CHAR(uint32_t(0x80 | ((c >> 12) & 0x3f))); // Upper middle 6 bits. APPEND_CHAR(uint32_t(0x80 | ((c >> 6) & 0x3f))); // Lower middle 6 bits. APPEND_CHAR(uint32_t(0x80 | (c & 0x3f))); // Bottom 6 bits. + } else if (c <= 0x03ffffff) { // 26 bits + APPEND_CHAR(uint32_t(0xf8 | ((c >> 24) & 0x03))); // Top 2 bits. + APPEND_CHAR(uint32_t(0x80 | ((c >> 18) & 0x3f))); // Upper middle 6 bits. + APPEND_CHAR(uint32_t(0x80 | ((c >> 12) & 0x3f))); // middle 6 bits. + APPEND_CHAR(uint32_t(0x80 | ((c >> 6) & 0x3f))); // Lower middle 6 bits. + APPEND_CHAR(uint32_t(0x80 | (c & 0x3f))); // Bottom 6 bits. + } else if (c <= 0x7fffffff) { // 31 bits + APPEND_CHAR(uint32_t(0xfc | ((c >> 30) & 0x01))); // Top 1 bit. + APPEND_CHAR(uint32_t(0x80 | ((c >> 24) & 0x3f))); // Upper upper middle 6 bits. + APPEND_CHAR(uint32_t(0x80 | ((c >> 18) & 0x3f))); // Lower upper middle 6 bits. + APPEND_CHAR(uint32_t(0x80 | ((c >> 12) & 0x3f))); // Upper lower middle 6 bits. + APPEND_CHAR(uint32_t(0x80 | ((c >> 6) & 0x3f))); // Lower lower middle 6 bits. + APPEND_CHAR(uint32_t(0x80 | (c & 0x3f))); // Bottom 6 bits. + } else { + APPEND_CHAR(0x20); } } #undef APPEND_CHAR @@ -1819,11 +1907,9 @@ String String::utf16(const char16_t *p_utf16, int p_len) { return ret; } -bool String::parse_utf16(const char16_t *p_utf16, int p_len) { -#define UNICERROR(m_err) print_error("Unicode parsing error: " + String(m_err) + ". Is the string valid UTF-16?"); - +Error String::parse_utf16(const char16_t *p_utf16, int p_len) { if (!p_utf16) { - return true; + return ERR_INVALID_DATA; } String aux; @@ -1850,80 +1936,90 @@ bool String::parse_utf16(const char16_t *p_utf16, int p_len) { } } + bool decode_error = false; { const char16_t *ptrtmp = p_utf16; const char16_t *ptrtmp_limit = &p_utf16[p_len]; - int skip = 0; + uint32_t c_prev = 0; + bool skip = false; while (ptrtmp != ptrtmp_limit && *ptrtmp) { uint32_t c = (byteswap) ? BSWAP16(*ptrtmp) : *ptrtmp; - if (skip == 0) { - if ((c & 0xfffffc00) == 0xd800) { - skip = 1; // lead surrogate - } else if ((c & 0xfffffc00) == 0xdc00) { - UNICERROR("invalid utf16 surrogate at " + num_int64(cstr_size)); - return true; // invalid UTF16 - } else { - skip = 0; + + if ((c & 0xfffffc00) == 0xd800) { // lead surrogate + if (skip) { + print_unicode_error(vformat("Unpaired lead surrogate (%x [trail?] %x)", c_prev, c)); + decode_error = true; } - str_size++; - } else { - if ((c & 0xfffffc00) == 0xdc00) { // trail surrogate - --skip; + skip = true; + } else if ((c & 0xfffffc00) == 0xdc00) { // trail surrogate + if (skip) { + str_size--; } else { - UNICERROR("invalid utf16 surrogate at " + num_int64(cstr_size)); - return true; // invalid UTF16 + print_unicode_error(vformat("Unpaired trail surrogate (%x [lead?] %x)", c_prev, c)); + decode_error = true; } + skip = false; + } else { + skip = false; } + c_prev = c; + str_size++; cstr_size++; ptrtmp++; } if (skip) { - UNICERROR("no space left"); - return true; // not enough space + print_unicode_error(vformat("Unpaired lead surrogate (%x [eol])", c_prev)); + decode_error = true; } } if (str_size == 0) { clear(); - return false; + return OK; // empty string } resize(str_size + 1); char32_t *dst = ptrw(); dst[str_size] = 0; + bool skip = false; + uint32_t c_prev = 0; while (cstr_size) { - int len = 0; uint32_t c = (byteswap) ? BSWAP16(*p_utf16) : *p_utf16; - if ((c & 0xfffffc00) == 0xd800) { - len = 2; + if ((c & 0xfffffc00) == 0xd800) { // lead surrogate + if (skip) { + *(dst++) = c_prev; // unpaired, store as is + } + skip = true; + } else if ((c & 0xfffffc00) == 0xdc00) { // trail surrogate + if (skip) { + *(dst++) = (c_prev << 10UL) + c - ((0xd800 << 10UL) + 0xdc00 - 0x10000); // decode pair + } else { + *(dst++) = c; // unpaired, store as is + } + skip = false; } else { - len = 1; + *(dst++) = c; + skip = false; } - if (len > cstr_size) { - UNICERROR("no space left"); - return true; //not enough space - } - - uint32_t unichar = 0; - if (len == 1) { - unichar = c; - } else { - uint32_t c2 = (byteswap) ? BSWAP16(p_utf16[1]) : p_utf16[1]; - unichar = (c << 10UL) + c2 - ((0xd800 << 10UL) + 0xdc00 - 0x10000); - } + cstr_size--; + p_utf16++; + c_prev = c; + } - *(dst++) = unichar; - cstr_size -= len; - p_utf16 += len; + if (skip) { + *(dst++) = c_prev; } - return false; -#undef UNICERROR + if (decode_error) { + return ERR_PARSE_ERROR; + } else { + return OK; + } } Char16String String::utf16() const { @@ -1938,15 +2034,14 @@ Char16String String::utf16() const { uint32_t c = d[i]; if (c <= 0xffff) { // 16 bits. fl += 1; + if ((c & 0xfffff800) == 0xd800) { + print_unicode_error(vformat("Unpaired surrogate (%x)", c)); + } } else if (c <= 0x10ffff) { // 32 bits. fl += 2; } else { - print_error("Unicode parsing error: Invalid unicode codepoint " + num_int64(c, 16) + "."); - return Char16String(); - } - if (c >= 0xd800 && c <= 0xdfff) { - print_error("Unicode parsing error: Invalid unicode codepoint " + num_int64(c, 16) + "."); - return Char16String(); + print_unicode_error(vformat("Invalid unicode codepoint (%x), cannot represent as UTF-16", c), true); + fl += 1; } } @@ -1965,9 +2060,11 @@ Char16String String::utf16() const { if (c <= 0xffff) { // 16 bits. APPEND_CHAR(c); - } else { // 32 bits. + } else if (c <= 0x10ffff) { // 32 bits. APPEND_CHAR(uint32_t((c >> 10) + 0xd7c0)); // lead surrogate. APPEND_CHAR(uint32_t((c & 0x3ff) | 0xdc00)); // trail surrogate. + } else { + APPEND_CHAR(0x20); } } #undef APPEND_CHAR diff --git a/core/string/ustring.h b/core/string/ustring.h index 11d0974381..1b8bf3d234 100644 --- a/core/string/ustring.h +++ b/core/string/ustring.h @@ -271,6 +271,9 @@ public: bool is_valid_string() const; + /* debug, error messages */ + void print_unicode_error(const String &p_message, bool p_critical = false) const; + /* complex helpers */ String substr(int p_from, int p_chars = -1) const; int find(const String &p_str, int p_from = 0) const; ///< return <0 if failed @@ -373,11 +376,11 @@ public: CharString ascii(bool p_allow_extended = false) const; CharString utf8() const; - bool parse_utf8(const char *p_utf8, int p_len = -1); //return true on error + Error parse_utf8(const char *p_utf8, int p_len = -1); static String utf8(const char *p_utf8, int p_len = -1); Char16String utf16() const; - bool parse_utf16(const char16_t *p_utf16, int p_len = -1); //return true on error + Error parse_utf16(const char16_t *p_utf16, int p_len = -1); static String utf16(const char16_t *p_utf16, int p_len = -1); static uint32_t hash(const char32_t *p_cstr, int p_len); /* hash the string */ diff --git a/core/templates/lru.h b/core/templates/lru.h index 55130cbeb0..b08b6455b6 100644 --- a/core/templates/lru.h +++ b/core/templates/lru.h @@ -102,6 +102,7 @@ public: } _FORCE_INLINE_ size_t get_capacity() const { return capacity; } + _FORCE_INLINE_ size_t get_size() const { return _map.size(); } void set_capacity(size_t p_capacity) { if (capacity > 0) { diff --git a/core/variant/binder_common.h b/core/variant/binder_common.h index 22a13b0fab..84f894dcbf 100644 --- a/core/variant/binder_common.h +++ b/core/variant/binder_common.h @@ -106,6 +106,29 @@ struct VariantCaster<const T &> { static void initialize(m_enum &value) { value = (m_enum)0; } \ }; +#define VARIANT_BITFIELD_CAST(m_enum) \ + MAKE_BITFIELD_TYPE_INFO(m_enum) \ + template <> \ + struct VariantCaster<BitField<m_enum>> { \ + static _FORCE_INLINE_ BitField<m_enum> cast(const Variant &p_variant) { \ + return BitField<m_enum>(p_variant.operator int64_t()); \ + } \ + }; \ + template <> \ + struct PtrToArg<BitField<m_enum>> { \ + _FORCE_INLINE_ static BitField<m_enum> convert(const void *p_ptr) { \ + return BitField<m_enum>(*reinterpret_cast<const int64_t *>(p_ptr)); \ + } \ + typedef int64_t EncodeT; \ + _FORCE_INLINE_ static void encode(BitField<m_enum> p_val, const void *p_ptr) { \ + *(int64_t *)p_ptr = p_val; \ + } \ + }; \ + template <> \ + struct ZeroInitializer<BitField<m_enum>> { \ + static void initialize(BitField<m_enum> &value) { value = 0; } \ + }; + // Object enum casts must go here VARIANT_ENUM_CAST(Object::ConnectFlags); diff --git a/core/variant/type_info.h b/core/variant/type_info.h index bacd0d19ce..794274dd77 100644 --- a/core/variant/type_info.h +++ b/core/variant/type_info.h @@ -279,6 +279,51 @@ inline StringName __constant_get_enum_name(T param, const String &p_constant) { return GetTypeInfo<T>::get_class_info().class_name; } +template <class T> +class BitField { + uint32_t value = 0; + +public: + _FORCE_INLINE_ void set_flag(T p_flag) { value |= p_flag; } + _FORCE_INLINE_ bool has_flag(T p_flag) const { return value & p_flag; } + _FORCE_INLINE_ void clear_flag(T p_flag) { return value &= ~p_flag; } + _FORCE_INLINE_ BitField(uint32_t p_value) { value = p_value; } + _FORCE_INLINE_ operator uint32_t() const { return value; } +}; + +#define TEMPL_MAKE_BITFIELD_TYPE_INFO(m_enum, m_impl) \ + template <> \ + struct GetTypeInfo<m_impl> { \ + static const Variant::Type VARIANT_TYPE = Variant::INT; \ + static const GodotTypeInfo::Metadata METADATA = GodotTypeInfo::METADATA_NONE; \ + static inline PropertyInfo get_class_info() { \ + return PropertyInfo(Variant::INT, String(), PROPERTY_HINT_NONE, String(), PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_CLASS_IS_BITFIELD, \ + godot::details::enum_qualified_name_to_class_info_name(String(#m_enum))); \ + } \ + }; \ + template <> \ + struct GetTypeInfo<BitField<m_impl>> { \ + static const Variant::Type VARIANT_TYPE = Variant::INT; \ + static const GodotTypeInfo::Metadata METADATA = GodotTypeInfo::METADATA_NONE; \ + static inline PropertyInfo get_class_info() { \ + return PropertyInfo(Variant::INT, String(), PROPERTY_HINT_NONE, String(), PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_CLASS_IS_BITFIELD, \ + godot::details::enum_qualified_name_to_class_info_name(String(#m_enum))); \ + } \ + }; + +#define MAKE_BITFIELD_TYPE_INFO(m_enum) \ + TEMPL_MAKE_BITFIELD_TYPE_INFO(m_enum, m_enum) \ + TEMPL_MAKE_BITFIELD_TYPE_INFO(m_enum, m_enum const) \ + TEMPL_MAKE_BITFIELD_TYPE_INFO(m_enum, m_enum &) \ + TEMPL_MAKE_BITFIELD_TYPE_INFO(m_enum, const m_enum &) + +template <typename T> +inline StringName __constant_get_bitfield_name(T param, const String &p_constant) { + if (GetTypeInfo<T>::VARIANT_TYPE == Variant::NIL) { + ERR_PRINT("Missing VARIANT_ENUM_CAST for constant's bitfield: " + p_constant); + } + return GetTypeInfo<BitField<T>>::get_class_info().class_name; +} #define CLASS_INFO(m_type) (GetTypeInfo<m_type *>::get_class_info()) template <typename T> diff --git a/doc/class.xsd b/doc/class.xsd index 498c930d6f..70c0323464 100644 --- a/doc/class.xsd +++ b/doc/class.xsd @@ -155,6 +155,7 @@ <xs:attribute type="xs:string" name="name" /> <xs:attribute type="xs:string" name="value" /> <xs:attribute type="xs:string" name="enum" use="optional" /> + <xs:attribute type="xs:boolean" name="is_bitfield" use="optional" /> </xs:extension> </xs:simpleContent> </xs:complexType> @@ -162,6 +163,42 @@ </xs:sequence> </xs:complexType> </xs:element> + <xs:element name="annotations" minOccurs="0"> + <xs:complexType> + <xs:sequence> + <xs:element name="annotation" maxOccurs="unbounded" minOccurs="0"> + <xs:complexType> + <xs:sequence> + <xs:element name="return" minOccurs="0"> + <xs:complexType> + <xs:sequence> + <xs:sequence /> + </xs:sequence> + <xs:attribute type="xs:string" name="type" /> + <xs:attribute type="xs:string" name="enum" use="optional" /> + </xs:complexType> + </xs:element> + <xs:element name="argument" maxOccurs="unbounded" minOccurs="0"> + <xs:complexType> + <xs:sequence> + <xs:sequence /> + </xs:sequence> + <xs:attribute type="xs:byte" name="index" /> + <xs:attribute type="xs:string" name="name" /> + <xs:attribute type="xs:string" name="type" /> + <xs:attribute type="xs:string" name="enum" use="optional" /> + <xs:attribute type="xs:string" name="default" use="optional" /> + </xs:complexType> + </xs:element> + <xs:element type="xs:string" name="description" /> + </xs:sequence> + <xs:attribute type="xs:string" name="name" use="optional" /> + <xs:attribute type="xs:string" name="qualifiers" use="optional" /> + </xs:complexType> + </xs:element> + </xs:sequence> + </xs:complexType> + </xs:element> <xs:element name="theme_items" minOccurs="0"> <xs:complexType> <xs:sequence> diff --git a/doc/classes/Button.xml b/doc/classes/Button.xml index 1e0b685795..1cd9ca0afb 100644 --- a/doc/classes/Button.xml +++ b/doc/classes/Button.xml @@ -40,29 +40,6 @@ <link title="2D Dodge The Creeps Demo">https://godotengine.org/asset-library/asset/515</link> <link title="OS Test Demo">https://godotengine.org/asset-library/asset/677</link> </tutorials> - <methods> - <method name="clear_opentype_features"> - <return type="void" /> - <description> - Removes all OpenType features. - </description> - </method> - <method name="get_opentype_feature" qualifiers="const"> - <return type="int" /> - <argument index="0" name="tag" type="String" /> - <description> - Returns OpenType feature [code]tag[/code]. - </description> - </method> - <method name="set_opentype_feature"> - <return type="void" /> - <argument index="0" name="tag" type="String" /> - <argument index="1" name="value" type="int" /> - <description> - Sets OpenType feature [code]tag[/code]. More info: [url=https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags]OpenType feature tags[/url]. - </description> - </method> - </methods> <members> <member name="alignment" type="int" setter="set_text_alignment" getter="get_text_alignment" enum="HorizontalAlignment" default="1"> Text alignment policy for the button's text, use one of the [enum @GlobalScope.HorizontalAlignment] constants. diff --git a/doc/classes/CanvasItem.xml b/doc/classes/CanvasItem.xml index 98a498d719..acf08414d0 100644 --- a/doc/classes/CanvasItem.xml +++ b/doc/classes/CanvasItem.xml @@ -48,17 +48,26 @@ </description> </method> <method name="draw_char" qualifiers="const"> - <return type="float" /> + <return type="void" /> + <argument index="0" name="font" type="Font" /> + <argument index="1" name="pos" type="Vector2" /> + <argument index="2" name="char" type="String" /> + <argument index="3" name="font_size" type="int" default="16" /> + <argument index="4" name="modulate" type="Color" default="Color(1, 1, 1, 1)" /> + <description> + Draws a string first character using a custom font. + </description> + </method> + <method name="draw_char_outline" qualifiers="const"> + <return type="void" /> <argument index="0" name="font" type="Font" /> <argument index="1" name="pos" type="Vector2" /> <argument index="2" name="char" type="String" /> - <argument index="3" name="next" type="String" default="""" /> - <argument index="4" name="size" type="int" default="16" /> + <argument index="3" name="font_size" type="int" default="16" /> + <argument index="4" name="size" type="int" default="-1" /> <argument index="5" name="modulate" type="Color" default="Color(1, 1, 1, 1)" /> - <argument index="6" name="outline_size" type="int" default="0" /> - <argument index="7" name="outline_modulate" type="Color" default="Color(1, 1, 1, 0)" /> <description> - Draws a string character using a custom font. Returns the advance, depending on the character width and kerning with an optional next character. + Draws a string first character outline using a custom font. </description> </method> <method name="draw_circle"> @@ -127,7 +136,7 @@ <argument index="4" name="outline" type="float" default="0.0" /> <argument index="5" name="pixel_range" type="float" default="4.0" /> <description> - Draws a textured rectangle region of the multi-channel signed distance field texture at a given position, optionally modulated by a color. See [member FontData.multichannel_signed_distance_field] for more information and caveats about MSDF font rendering. + Draws a textured rectangle region of the multi-channel signed distance field texture at a given position, optionally modulated by a color. See [member FontFile.multichannel_signed_distance_field] for more information and caveats about MSDF font rendering. If [code]outline[/code] is positive, each alpha channel value of pixel in region is set to maximum value of true distance in the [code]outline[/code] radius. Value of the [code]pixel_range[/code] should the same that was used during distance field texture generation. </description> @@ -157,16 +166,34 @@ <argument index="2" name="text" type="String" /> <argument index="3" name="alignment" type="int" enum="HorizontalAlignment" default="0" /> <argument index="4" name="width" type="float" default="-1" /> - <argument index="5" name="max_lines" type="int" default="-1" /> - <argument index="6" name="size" type="int" default="16" /> + <argument index="5" name="font_size" type="int" default="16" /> + <argument index="6" name="max_lines" type="int" default="-1" /> <argument index="7" name="modulate" type="Color" default="Color(1, 1, 1, 1)" /> - <argument index="8" name="outline_size" type="int" default="0" /> - <argument index="9" name="outline_modulate" type="Color" default="Color(1, 1, 1, 0)" /> - <argument index="10" name="flags" type="int" default="99" /> + <argument index="8" name="flags" type="int" default="99" /> + <argument index="9" name="direction" type="int" enum="TextServer.Direction" default="0" /> + <argument index="10" name="orientation" type="int" enum="TextServer.Orientation" default="0" /> <description> Breaks [code]text[/code] to the lines and draws it using the specified [code]font[/code] at the [code]position[/code] (top-left corner). The text will have its color multiplied by [code]modulate[/code]. If [code]clip_w[/code] is greater than or equal to 0, the text will be clipped if it exceeds the specified width. </description> </method> + <method name="draw_multiline_string_outline" qualifiers="const"> + <return type="void" /> + <argument index="0" name="font" type="Font" /> + <argument index="1" name="pos" type="Vector2" /> + <argument index="2" name="text" type="String" /> + <argument index="3" name="alignment" type="int" enum="HorizontalAlignment" default="0" /> + <argument index="4" name="width" type="float" default="-1" /> + <argument index="5" name="font_size" type="int" default="16" /> + <argument index="6" name="max_lines" type="int" default="-1" /> + <argument index="7" name="size" type="int" default="1" /> + <argument index="8" name="modulate" type="Color" default="Color(1, 1, 1, 1)" /> + <argument index="9" name="flags" type="int" default="99" /> + <argument index="10" name="direction" type="int" enum="TextServer.Direction" default="0" /> + <argument index="11" name="orientation" type="int" enum="TextServer.Orientation" default="0" /> + <description> + Breaks [code]text[/code] to the lines and draws text outline using the specified [code]font[/code] at the [code]position[/code] (top-left corner). The text will have its color multiplied by [code]modulate[/code]. If [code]clip_w[/code] is greater than or equal to 0, the text will be clipped if it exceeds the specified width. + </description> + </method> <method name="draw_multimesh"> <return type="void" /> <argument index="0" name="multimesh" type="MultiMesh" /> @@ -250,11 +277,11 @@ <argument index="2" name="text" type="String" /> <argument index="3" name="alignment" type="int" enum="HorizontalAlignment" default="0" /> <argument index="4" name="width" type="float" default="-1" /> - <argument index="5" name="size" type="int" default="16" /> + <argument index="5" name="font_size" type="int" default="16" /> <argument index="6" name="modulate" type="Color" default="Color(1, 1, 1, 1)" /> - <argument index="7" name="outline_size" type="int" default="0" /> - <argument index="8" name="outline_modulate" type="Color" default="Color(1, 1, 1, 0)" /> - <argument index="9" name="flags" type="int" default="3" /> + <argument index="7" name="flags" type="int" default="3" /> + <argument index="8" name="direction" type="int" enum="TextServer.Direction" default="0" /> + <argument index="9" name="orientation" type="int" enum="TextServer.Orientation" default="0" /> <description> Draws [code]text[/code] using the specified [code]font[/code] at the [code]position[/code] (bottom-left corner using the baseline of the font). The text will have its color multiplied by [code]modulate[/code]. If [code]clip_w[/code] is greater than or equal to 0, the text will be clipped if it exceeds the specified width. [b]Example using the default project font:[/b] @@ -279,6 +306,23 @@ See also [method Font.draw_string]. </description> </method> + <method name="draw_string_outline" qualifiers="const"> + <return type="void" /> + <argument index="0" name="font" type="Font" /> + <argument index="1" name="pos" type="Vector2" /> + <argument index="2" name="text" type="String" /> + <argument index="3" name="alignment" type="int" enum="HorizontalAlignment" default="0" /> + <argument index="4" name="width" type="float" default="-1" /> + <argument index="5" name="font_size" type="int" default="16" /> + <argument index="6" name="size" type="int" default="1" /> + <argument index="7" name="modulate" type="Color" default="Color(1, 1, 1, 1)" /> + <argument index="8" name="flags" type="int" default="3" /> + <argument index="9" name="direction" type="int" enum="TextServer.Direction" default="0" /> + <argument index="10" name="orientation" type="int" enum="TextServer.Orientation" default="0" /> + <description> + Draws [code]text[/code] outline using the specified [code]font[/code] at the [code]position[/code] (bottom-left corner using the baseline of the font). The text will have its color multiplied by [code]modulate[/code]. If [code]clip_w[/code] is greater than or equal to 0, the text will be clipped if it exceeds the specified width. + </description> + </method> <method name="draw_style_box"> <return type="void" /> <argument index="0" name="style_box" type="StyleBox" /> diff --git a/doc/classes/Font.xml b/doc/classes/Font.xml index dae42ddf34..b19386b398 100644 --- a/doc/classes/Font.xml +++ b/doc/classes/Font.xml @@ -1,93 +1,36 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="Font" inherits="Resource" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> - Font class is set of font data sources used to draw text. + Base class for fonts and font variations. </brief_description> <description> - Font contains a set of glyphs to represent Unicode characters, as well as the ability to draw it with variable width, ascent, descent and kerning. - [b]Note:[/b] A character is a symbol that represents an item (letter, digit etc.) in an abstract way. - [b]Note:[/b] A glyph is a bitmap or shape used to draw a one or more characters in a context-dependent manner. Glyph indices are bound to the specific font data source. - [b]Note:[/b] If a non of the font data sources contain glyphs for a character used in a string, the character in question will be replaced with a box displaying its hexadecimal code. - [codeblocks] - [gdscript] - var font = Font.new() - font.add_data(load("res://BarlowCondensed-Bold.ttf")) - $"Label".set("custom_fonts/font", font) - $"Label".set("custom_fonts/font_size", 64) - [/gdscript] - [csharp] - var font = new Font(); - font.AddData(ResourceLoader.Load<FontData>("res://BarlowCondensed-Bold.ttf")); - GetNode("Label").Set("custom_fonts/font", font); - GetNode("Label").Set("custom_font_sizes/font_size", 64); - [/csharp] - [/codeblocks] - To control font substitution priority use [FontData] language and script support. - Use language overrides to use same [Font] stack for multiple languages: - [codeblocks] - [gdscript] - # Use Naskh font for Persian and Nastaʼlīq font for Urdu text. - var font_data_fa = load("res://NotoNaskhArabicUI_Regular.ttf"); - font_data_fa.set_language_support_override("fa", true); - font_data_fa.set_language_support_override("ur", false); - - var font_data_ur = load("res://NotoNastaliqUrdu_Regular.ttf"); - font_data_ur.set_language_support_override("fa", false); - font_data_ur.set_language_support_override("ur", true); - [/gdscript] - [csharp] - // Use Naskh font for Persian and Nastaʼlīq font for Urdu text. - var fontDataFA = ResourceLoader.Load<FontData>("res://NotoNaskhArabicUI_Regular.ttf"); - fontDataFA.SetLanguageSupportOverride("fa", true); - fontDataFA.SetLanguageSupportOverride("ur", false); - - var fontDataUR = ResourceLoader.Load<FontData>("res://NotoNastaliqUrdu_Regular.ttf"); - fontDataUR.SetLanguageSupportOverride("fa", false); - fontDataUR.SetLanguageSupportOverride("ur", true); - [/csharp] - [/codeblocks] - Use script overrides to specify supported scripts for bitmap font or for less common scripts not directly supported by TrueType format: - [codeblocks] - [gdscript] - # Use specified font for Egyptian hieroglyphs. - var font_data = load("res://unifont.ttf"); - font_data.set_script_support_override("Egyp", true); - [/gdscript] - [csharp] - // Use specified font for Egyptian hieroglyphs. - var fontData = ResourceLoader.Load<FontData>("res://unifont.ttf"); - fontData.SetScriptSupportOverride("Egyp", true); - [/csharp] - [/codeblocks] + Font is the abstract base class for font, so it shouldn't be used directly. Other types of fonts inherit from it. </description> <tutorials> </tutorials> <methods> - <method name="add_data"> - <return type="void" /> - <argument index="0" name="data" type="FontData" /> - <description> - Add font data source to the set. - </description> - </method> - <method name="clear_data"> - <return type="void" /> + <method name="draw_char" qualifiers="const"> + <return type="float" /> + <argument index="0" name="canvas_item" type="RID" /> + <argument index="1" name="pos" type="Vector2" /> + <argument index="2" name="char" type="int" /> + <argument index="3" name="modulate" type="int" /> + <argument index="4" name="arg4" type="Color" default="Color(1, 1, 1, 1)" /> <description> - Removes all font data sourcers for the set. + Draw a single Unicode character [code]char[/code] into a canvas item using the font, at a given position, with [code]modulate[/code] color. [code]position[/code] specifies the baseline, not the top. To draw from the top, [i]ascent[/i] must be added to the Y axis. + [b]Note:[/b] Do not use this function to draw strings character by character, use [method draw_string] or [TextLine] instead. </description> </method> - <method name="draw_char" qualifiers="const"> + <method name="draw_char_outline" qualifiers="const"> <return type="float" /> <argument index="0" name="canvas_item" type="RID" /> <argument index="1" name="pos" type="Vector2" /> <argument index="2" name="char" type="int" /> - <argument index="3" name="next" type="int" default="0" /> - <argument index="4" name="size" type="int" default="16" /> - <argument index="5" name="modulate" type="Color" default="Color(1, 1, 1, 1)" /> - <argument index="6" name="outline_size" type="int" default="0" /> - <argument index="7" name="outline_modulate" type="Color" default="Color(1, 1, 1, 0)" /> + <argument index="3" name="size" type="int" /> + <argument index="4" name="modulate" type="int" default="-1" /> + <argument index="5" name="arg5" type="Color" default="Color(1, 1, 1, 1)" /> <description> - Draw a single Unicode character [code]char[/code] into a canvas item using the font, at a given position, with [code]modulate[/code] color, and optionally kerning if [code]next[/code] is passed. [code]position[/code] specifies the baseline, not the top. To draw from the top, [i]ascent[/i] must be added to the Y axis. + Draw a single Unicode character [code]char[/code] outline into a canvas item using the font, at a given position, with [code]modulate[/code] color and [code]size[/code] outline size. [code]position[/code] specifies the baseline, not the top. To draw from the top, [i]ascent[/i] must be added to the Y axis. [b]Note:[/b] Do not use this function to draw strings character by character, use [method draw_string] or [TextLine] instead. </description> </method> @@ -98,17 +41,36 @@ <argument index="2" name="text" type="String" /> <argument index="3" name="alignment" type="int" enum="HorizontalAlignment" default="0" /> <argument index="4" name="width" type="float" default="-1" /> - <argument index="5" name="max_lines" type="int" default="-1" /> - <argument index="6" name="size" type="int" default="16" /> + <argument index="5" name="font_size" type="int" default="16" /> + <argument index="6" name="max_lines" type="int" default="-1" /> <argument index="7" name="modulate" type="Color" default="Color(1, 1, 1, 1)" /> - <argument index="8" name="outline_size" type="int" default="0" /> - <argument index="9" name="outline_modulate" type="Color" default="Color(1, 1, 1, 0)" /> - <argument index="10" name="flags" type="int" default="99" /> + <argument index="8" name="flags" type="int" default="99" /> + <argument index="9" name="direction" type="int" enum="TextServer.Direction" default="0" /> + <argument index="10" name="orientation" type="int" enum="TextServer.Orientation" default="0" /> <description> Breaks [code]text[/code] to the lines using rules specified by [code]flags[/code] and draws it into a canvas item using the font, at a given position, with [code]modulate[/code] color, optionally clipping the width and aligning horizontally. [code]position[/code] specifies the baseline of the first line, not the top. To draw from the top, [i]ascent[/i] must be added to the Y axis. See also [method CanvasItem.draw_multiline_string]. </description> </method> + <method name="draw_multiline_string_outline" qualifiers="const"> + <return type="void" /> + <argument index="0" name="canvas_item" type="RID" /> + <argument index="1" name="pos" type="Vector2" /> + <argument index="2" name="text" type="String" /> + <argument index="3" name="alignment" type="int" enum="HorizontalAlignment" default="0" /> + <argument index="4" name="width" type="float" default="-1" /> + <argument index="5" name="font_size" type="int" default="16" /> + <argument index="6" name="max_lines" type="int" default="-1" /> + <argument index="7" name="size" type="int" default="1" /> + <argument index="8" name="modulate" type="Color" default="Color(1, 1, 1, 1)" /> + <argument index="9" name="flags" type="int" default="99" /> + <argument index="10" name="direction" type="int" enum="TextServer.Direction" default="0" /> + <argument index="11" name="orientation" type="int" enum="TextServer.Orientation" default="0" /> + <description> + Breaks [code]text[/code] to the lines using rules specified by [code]flags[/code] and draws text outline into a canvas item using the font, at a given position, with [code]modulate[/code] color and [code]size[/code] outline size, optionally clipping the width and aligning horizontally. [code]position[/code] specifies the baseline of the first line, not the top. To draw from the top, [i]ascent[/i] must be added to the Y axis. + See also [method CanvasItem.draw_multiline_string_outline]. + </description> + </method> <method name="draw_string" qualifiers="const"> <return type="void" /> <argument index="0" name="canvas_item" type="RID" /> @@ -116,19 +78,47 @@ <argument index="2" name="text" type="String" /> <argument index="3" name="alignment" type="int" enum="HorizontalAlignment" default="0" /> <argument index="4" name="width" type="float" default="-1" /> - <argument index="5" name="size" type="int" default="16" /> + <argument index="5" name="font_size" type="int" default="16" /> <argument index="6" name="modulate" type="Color" default="Color(1, 1, 1, 1)" /> - <argument index="7" name="outline_size" type="int" default="0" /> - <argument index="8" name="outline_modulate" type="Color" default="Color(1, 1, 1, 0)" /> - <argument index="9" name="flags" type="int" default="3" /> + <argument index="7" name="flags" type="int" default="3" /> + <argument index="8" name="direction" type="int" enum="TextServer.Direction" default="0" /> + <argument index="9" name="orientation" type="int" enum="TextServer.Orientation" default="0" /> <description> Draw [code]text[/code] into a canvas item using the font, at a given position, with [code]modulate[/code] color, optionally clipping the width and aligning horizontally. [code]position[/code] specifies the baseline, not the top. To draw from the top, [i]ascent[/i] must be added to the Y axis. See also [method CanvasItem.draw_string]. </description> </method> + <method name="draw_string_outline" qualifiers="const"> + <return type="void" /> + <argument index="0" name="canvas_item" type="RID" /> + <argument index="1" name="pos" type="Vector2" /> + <argument index="2" name="text" type="String" /> + <argument index="3" name="alignment" type="int" enum="HorizontalAlignment" default="0" /> + <argument index="4" name="width" type="float" default="-1" /> + <argument index="5" name="font_size" type="int" default="16" /> + <argument index="6" name="size" type="int" default="1" /> + <argument index="7" name="modulate" type="Color" default="Color(1, 1, 1, 1)" /> + <argument index="8" name="flags" type="int" default="3" /> + <argument index="9" name="direction" type="int" enum="TextServer.Direction" default="0" /> + <argument index="10" name="orientation" type="int" enum="TextServer.Orientation" default="0" /> + <description> + Draw [code]text[/code] outline into a canvas item using the font, at a given position, with [code]modulate[/code] color and [code]size[/code] outline size, optionally clipping the width and aligning horizontally. [code]position[/code] specifies the baseline, not the top. To draw from the top, [i]ascent[/i] must be added to the Y axis. + See also [method CanvasItem.draw_string_outline]. + </description> + </method> + <method name="find_variation" qualifiers="const"> + <return type="RID" /> + <argument index="0" name="variation_coordinates" type="Dictionary" /> + <argument index="1" name="face_index" type="int" default="0" /> + <argument index="2" name="strength" type="float" default="0.0" /> + <argument index="3" name="transform" type="Transform2D" default="Transform2D(1, 0, 0, 1, 0, 0)" /> + <description> + Returns [TextServer] RID of the font cache for specific variation. + </description> + </method> <method name="get_ascent" qualifiers="const"> <return type="float" /> - <argument index="0" name="size" type="int" default="16" /> + <argument index="0" name="font_size" type="int" default="16" /> <description> Returns the average font ascent (number of pixels above the baseline). [b]Note:[/b] Real ascent of the string is context-dependent and can be significantly different from the value returned by this function. Use it only as rough estimate (e.g. as the ascent of empty line). @@ -137,44 +127,53 @@ <method name="get_char_size" qualifiers="const"> <return type="Vector2" /> <argument index="0" name="char" type="int" /> - <argument index="1" name="next" type="int" default="0" /> - <argument index="2" name="size" type="int" default="16" /> + <argument index="1" name="arg1" type="int" /> <description> Returns the size of a character, optionally taking kerning into account if the next character is provided. [b]Note:[/b] Do not use this function to calculate width of the string character by character, use [method get_string_size] or [TextLine] instead. The height returned is the font height (see also [method get_height]) and has no relation to the glyph height. </description> </method> - <method name="get_data" qualifiers="const"> - <return type="FontData" /> - <argument index="0" name="idx" type="int" /> + <method name="get_descent" qualifiers="const"> + <return type="float" /> + <argument index="0" name="font_size" type="int" default="16" /> <description> - Returns the font data source at index [code]idx[/code]. If the index does not exist, returns [code]null[/code]. + Returns the average font descent (number of pixels below the baseline). + [b]Note:[/b] Real descent of the string is context-dependent and can be significantly different from the value returned by this function. Use it only as rough estimate (e.g. as the descent of empty line). </description> </method> - <method name="get_data_count" qualifiers="const"> + <method name="get_face_count" qualifiers="const"> <return type="int" /> <description> - Returns the number of font data sources. + Returns number of faces in the TrueType / OpenType collection. </description> </method> - <method name="get_data_rid" qualifiers="const"> - <return type="RID" /> - <argument index="0" name="idx" type="int" /> + <method name="get_fallbacks" qualifiers="const"> + <return type="Font[]" /> <description> - Returns TextServer RID of the font data resources. + Returns array of fallback [Font]s. </description> </method> - <method name="get_descent" qualifiers="const"> - <return type="float" /> - <argument index="0" name="size" type="int" default="16" /> + <method name="get_font_name" qualifiers="const"> + <return type="String" /> <description> - Returns the average font descent (number of pixels below the baseline). - [b]Note:[/b] Real descent of the string is context-dependent and can be significantly different from the value returned by this function. Use it only as rough estimate (e.g. as the descent of empty line). + Returns font family name. + </description> + </method> + <method name="get_font_style" qualifiers="const"> + <return type="int" /> + <description> + Returns font style flags, see [enum TextServer.FontStyle]. + </description> + </method> + <method name="get_font_style_name" qualifiers="const"> + <return type="String" /> + <description> + Returns font style name. </description> </method> <method name="get_height" qualifiers="const"> <return type="float" /> - <argument index="0" name="size" type="int" default="16" /> + <argument index="0" name="font_size" type="int" default="16" /> <description> Returns the total average font height (ascent plus descent) in pixels. [b]Note:[/b] Real height of the string is context-dependent and can be significantly different from the value returned by this function. Use it only as rough estimate (e.g. as the height of empty line). @@ -183,18 +182,28 @@ <method name="get_multiline_string_size" qualifiers="const"> <return type="Vector2" /> <argument index="0" name="text" type="String" /> - <argument index="1" name="width" type="float" default="-1" /> - <argument index="2" name="size" type="int" default="16" /> - <argument index="3" name="flags" type="int" default="96" /> + <argument index="1" name="alignment" type="int" enum="HorizontalAlignment" default="0" /> + <argument index="2" name="width" type="float" default="-1" /> + <argument index="3" name="font_size" type="int" default="16" /> + <argument index="4" name="max_lines" type="int" default="-1" /> + <argument index="5" name="flags" type="int" default="96" /> + <argument index="6" name="direction" type="int" enum="TextServer.Direction" default="0" /> + <argument index="7" name="orientation" type="int" enum="TextServer.Orientation" default="0" /> <description> Returns the size of a bounding box of a string broken into the lines, taking kerning and advance into account. See also [method draw_multiline_string]. </description> </method> + <method name="get_opentype_features" qualifiers="const"> + <return type="Dictionary" /> + <description> + Returns a set of OpenType feature tags. More info: [url=https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags]OpenType feature tags[/url]. + </description> + </method> <method name="get_rids" qualifiers="const"> - <return type="Array" /> + <return type="RID[]" /> <description> - Returns [Array] of valid [FontData] [RID]s, which can be passed to the [TextServer] methods. + Returns [Array] of valid [Font] [RID]s, which can be passed to the [TextServer] methods. </description> </method> <method name="get_spacing" qualifiers="const"> @@ -207,10 +216,12 @@ <method name="get_string_size" qualifiers="const"> <return type="Vector2" /> <argument index="0" name="text" type="String" /> - <argument index="1" name="size" type="int" default="16" /> - <argument index="2" name="alignment" type="int" enum="HorizontalAlignment" default="0" /> - <argument index="3" name="width" type="float" default="-1" /> + <argument index="1" name="alignment" type="int" enum="HorizontalAlignment" default="0" /> + <argument index="2" name="width" type="float" default="-1" /> + <argument index="3" name="font_size" type="int" default="16" /> <argument index="4" name="flags" type="int" default="3" /> + <argument index="5" name="direction" type="int" enum="TextServer.Direction" default="0" /> + <argument index="6" name="orientation" type="int" enum="TextServer.Orientation" default="0" /> <description> Returns the size of a bounding box of a string, taking kerning and advance into account. [b]Note:[/b] Real height of the string is context-dependent and can be significantly different from the value returned by [method get_height]. @@ -224,9 +235,22 @@ If a given character is included in more than one font data source, it appears only once in the returned string. </description> </method> + <method name="get_supported_feature_list" qualifiers="const"> + <return type="Dictionary" /> + <description> + Returns list of OpenType features supported by font. + </description> + </method> + <method name="get_supported_variation_list" qualifiers="const"> + <return type="Dictionary" /> + <description> + Returns list of supported [url=https://docs.microsoft.com/en-us/typography/opentype/spec/dvaraxisreg]variation coordinates[/url], each coordinate is returned as [code]tag: Vector3i(min_value,max_value,default_value)[/code]. + Font variations allow for continuous change of glyph characteristics along some given design axis, such as weight, width or slant. + </description> + </method> <method name="get_underline_position" qualifiers="const"> <return type="float" /> - <argument index="0" name="size" type="int" default="16" /> + <argument index="0" name="font_size" type="int" default="16" /> <description> Returns average pixel offset of the underline below the baseline. [b]Note:[/b] Real underline position of the string is context-dependent and can be significantly different from the value returned by this function. Use it only as rough estimate. @@ -234,7 +258,7 @@ </method> <method name="get_underline_thickness" qualifiers="const"> <return type="float" /> - <argument index="0" name="size" type="int" default="16" /> + <argument index="0" name="font_size" type="int" default="16" /> <description> Returns average thickness of the underline. [b]Note:[/b] Real underline thickness of the string is context-dependent and can be significantly different from the value returned by this function. Use it only as rough estimate. @@ -247,45 +271,34 @@ Returns [code]true[/code] if a Unicode [code]char[/code] is available in the font. </description> </method> - <method name="remove_data"> - <return type="void" /> - <argument index="0" name="idx" type="int" /> + <method name="is_language_supported" qualifiers="const"> + <return type="bool" /> + <argument index="0" name="language" type="String" /> <description> - Removes the font data source at index [code]idx[/code]. If the index does not exist, nothing happens. + Returns [code]true[/code], if font supports given language ([url=https://en.wikipedia.org/wiki/ISO_639-1]ISO 639[/url] code). </description> </method> - <method name="set_data"> - <return type="void" /> - <argument index="0" name="idx" type="int" /> - <argument index="1" name="data" type="FontData" /> + <method name="is_script_supported" qualifiers="const"> + <return type="bool" /> + <argument index="0" name="script" type="String" /> <description> - Sets the font data source at index [code]idx[/code]. If the index does not exist, nothing happens. + Returns [code]true[/code], if font supports given script ([url=https://en.wikipedia.org/wiki/ISO_15924]ISO 15924[/url] code). </description> </method> - <method name="set_spacing"> + <method name="set_cache_capacity"> <return type="void" /> - <argument index="0" name="spacing" type="int" enum="TextServer.SpacingType" /> - <argument index="1" name="value" type="int" /> + <argument index="0" name="single_line" type="int" /> + <argument index="1" name="multi_line" type="int" /> <description> - Sets the spacing for [code]type[/code] (see [enum TextServer.SpacingType]) to [code]value[/code] in pixels (not relative to the font size). + Sets LRU cache capacity for [code]draw_*[/code] methods. </description> </method> - <method name="update_changes"> + <method name="set_fallbacks"> <return type="void" /> + <argument index="0" name="fallbacks" type="Font[]" /> <description> - After editing a font (changing data sources, etc.). Call this function to propagate changes to controls that might use it. + Sets array of fallback [Font]s. </description> </method> </methods> - <members> - <member name="spacing_bottom" type="int" setter="set_spacing" getter="get_spacing" default="0"> - Extra spacing at the bottom of the line in pixels. - </member> - <member name="spacing_top" type="int" setter="set_spacing" getter="get_spacing" default="0"> - Extra spacing at the top of the line in pixels. - </member> - <member name="variation_coordinates" type="Dictionary" setter="set_variation_coordinates" getter="get_variation_coordinates" default="{}"> - Default font [url=https://docs.microsoft.com/en-us/typography/opentype/spec/dvaraxisreg]variation coordinates[/url]. - </member> - </members> </class> diff --git a/doc/classes/FontData.xml b/doc/classes/FontFile.xml index d32e7b3a94..98abc87b84 100644 --- a/doc/classes/FontData.xml +++ b/doc/classes/FontFile.xml @@ -1,13 +1,32 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="FontData" inherits="Resource" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> +<class name="FontFile" inherits="Font" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> - Font source data and prerendered glyph cache, imported from dynamic or bitmap font. + FontFile source data and prerendered glyph cache, imported from dynamic or bitmap font. + </brief_description> + <description> + [FontFile] contains a set of glyphs to represent Unicode characters imported from a font file, as well as a cache of rasterized glyphs, and a set of fallback [Font]s to use. + Use [FontVariation] to access specific OpenType variation of the font, create simulated bold / slanted version, and draw lines of text. + For more complex text processing, use [FontVariation] in conjunction with [TextLine] or [TextParagraph]. Supported font formats: - Dynamic font importer: TrueType (.ttf), TrueType collection (.ttc), OpenType (.otf), OpenType collection (.otc), WOFF (.woff), WOFF2 (.woff2), Type 1 (.pfb, .pfm). - Bitmap font importer: AngelCode BMFont (.fnt, .font), text and binary (version 3) format variants. - Monospace image font importer: All supported image formats. - </brief_description> - <description> + [b]Note:[/b] A character is a symbol that represents an item (letter, digit etc.) in an abstract way. + [b]Note:[/b] A glyph is a bitmap or shape used to draw a one or more characters in a context-dependent manner. Glyph indices are bound to the specific font data source. + [b]Note:[/b] If a none of the font data sources contain glyphs for a character used in a string, the character in question will be replaced with a box displaying its hexadecimal code. + + [codeblocks] + [gdscript] + var f = load("res://BarlowCondensed-Bold.ttf") + $"Label".set("custom_fonts/font", f) + $"Label".set("custom_fonts/font_size", 64) + [/gdscript] + [csharp] + var f = ResourceLoader.Load<FontFile>("res://BarlowCondensed-Bold.ttf"); + GetNode("Label").Set("custom_fonts/font", f); + GetNode("Label").Set("custom_font_sizes/font_size", 64); + [/csharp] + [/codeblocks] </description> <tutorials> </tutorials> @@ -51,14 +70,7 @@ [b]Note:[/b] This function will not remove glyphs associated with the texture, use [method remove_glyph] to remove them manually. </description> </method> - <method name="find_cache" qualifiers="const"> - <return type="RID" /> - <argument index="0" name="variation_coordinates" type="Dictionary" /> - <description> - Returns existing or creates a new font cache entry for the specified variation coordinates. - </description> - </method> - <method name="get_ascent" qualifiers="const"> + <method name="get_cache_ascent" qualifiers="const"> <return type="float" /> <argument index="0" name="cache_index" type="int" /> <argument index="1" name="size" type="int" /> @@ -72,25 +84,46 @@ Returns number of the font cache entries. </description> </method> - <method name="get_cache_rid" qualifiers="const"> - <return type="RID" /> + <method name="get_cache_descent" qualifiers="const"> + <return type="float" /> + <argument index="0" name="cache_index" type="int" /> + <argument index="1" name="size" type="int" /> + <description> + </description> + </method> + <method name="get_cache_scale" qualifiers="const"> + <return type="float" /> + <argument index="0" name="cache_index" type="int" /> + <argument index="1" name="size" type="int" /> + <description> + </description> + </method> + <method name="get_cache_underline_position" qualifiers="const"> + <return type="float" /> <argument index="0" name="cache_index" type="int" /> + <argument index="1" name="size" type="int" /> <description> - Returns text server font cache entry resource id. </description> </method> - <method name="get_descent" qualifiers="const"> + <method name="get_cache_underline_thickness" qualifiers="const"> <return type="float" /> <argument index="0" name="cache_index" type="int" /> <argument index="1" name="size" type="int" /> <description> - Returns font descent (number of pixels below the baseline). </description> </method> - <method name="get_face_count" qualifiers="const"> + <method name="get_embolden" qualifiers="const"> + <return type="float" /> + <argument index="0" name="cache_index" type="int" /> + <description> + Returns embolden strength, if is not equal to zero, emboldens the font outlines. Negative values reduce the outline thickness. + </description> + </method> + <method name="get_face_index" qualifiers="const"> <return type="int" /> + <argument index="0" name="cache_index" type="int" /> <description> - Returns number of faces in the TrueType / OpenType collection. + Recturns an active face index in the TrueType / OpenType collection. </description> </method> <method name="get_glyph_advance" qualifiers="const"> @@ -186,14 +219,6 @@ Returns list of language support overrides. </description> </method> - <method name="get_scale" qualifiers="const"> - <return type="float" /> - <argument index="0" name="cache_index" type="int" /> - <argument index="1" name="size" type="int" /> - <description> - Returns scaling factor of the color bitmap font. - </description> - </method> <method name="get_script_support_override" qualifiers="const"> <return type="bool" /> <argument index="0" name="script" type="String" /> @@ -214,34 +239,6 @@ Returns list of the font sizes in the cache. Each size is [code]Vector2i[/code] with font size and outline size. </description> </method> - <method name="get_spacing" qualifiers="const"> - <return type="int" /> - <argument index="0" name="cache_index" type="int" /> - <argument index="1" name="size" type="int" /> - <argument index="2" name="spacing_type" type="int" enum="TextServer.SpacingType" /> - <description> - Returns extra spacing added between glyphs in pixels. - </description> - </method> - <method name="get_supported_chars" qualifiers="const"> - <return type="String" /> - <description> - Returns a string containing all the characters available in the font. - </description> - </method> - <method name="get_supported_feature_list" qualifiers="const"> - <return type="Dictionary" /> - <description> - Returns list of OpenType features supported by font. - </description> - </method> - <method name="get_supported_variation_list" qualifiers="const"> - <return type="Dictionary" /> - <description> - Returns list of supported [url=https://docs.microsoft.com/en-us/typography/opentype/spec/dvaraxisreg]variation coordinates[/url], each coordinate is returned as [code]tag: Vector3i(min_value,max_value,default_value)[/code]. - Font variations allow for continuous change of glyph characteristics along some given design axis, such as weight, width or slant. - </description> - </method> <method name="get_texture_count" qualifiers="const"> <return type="int" /> <argument index="0" name="cache_index" type="int" /> @@ -268,48 +265,18 @@ Returns a copy of the array containing the first free pixel in the each column of texture. Should be the same size as texture width or empty. </description> </method> - <method name="get_underline_position" qualifiers="const"> - <return type="float" /> - <argument index="0" name="cache_index" type="int" /> - <argument index="1" name="size" type="int" /> - <description> - Returns pixel offset of the underline below the baseline. - </description> - </method> - <method name="get_underline_thickness" qualifiers="const"> - <return type="float" /> + <method name="get_transform" qualifiers="const"> + <return type="Transform2D" /> <argument index="0" name="cache_index" type="int" /> - <argument index="1" name="size" type="int" /> <description> - Returns thickness of the underline in pixels. + Returns 2D transform, applied to the font outlines, can be used for slanting, flipping and rotating glyphs. </description> </method> <method name="get_variation_coordinates" qualifiers="const"> <return type="Dictionary" /> <argument index="0" name="cache_index" type="int" /> <description> - Returns variation coordinates for the specified font cache entry. See [method get_supported_variation_list] for more info. - </description> - </method> - <method name="has_char" qualifiers="const"> - <return type="bool" /> - <argument index="0" name="char" type="int" /> - <description> - Returns [code]true[/code] if a Unicode [code]char[/code] is available in the font. - </description> - </method> - <method name="is_language_supported" qualifiers="const"> - <return type="bool" /> - <argument index="0" name="language" type="String" /> - <description> - Returns [code]true[/code], if font supports given language ([url=https://en.wikipedia.org/wiki/ISO_639-1]ISO 639[/url] code). - </description> - </method> - <method name="is_script_supported" qualifiers="const"> - <return type="bool" /> - <argument index="0" name="script" type="String" /> - <description> - Returns [code]true[/code], if font supports given script ([url=https://en.wikipedia.org/wiki/ISO_15924]ISO 15924[/url] code). + Returns variation coordinates for the specified font cache entry. See [method Font.get_supported_variation_list] for more info. </description> </method> <method name="load_bitmap_font"> @@ -324,8 +291,7 @@ <return type="int" enum="Error" /> <argument index="0" name="path" type="String" /> <description> - Loads a TrueType (.ttf), TrueType collection (.ttc), OpenType (.otf), OpenType collection (.otc), WOFF (.woff), WOFF2 (.woff2) or Type 1 (.pfb, .pfm) dynamic font from file [code]path[/code]. - [b]Note:[/b] Use [member face_index] to select specific face from the collection file. + Loads a TrueType (.ttf), OpenType (.otf), WOFF (.woff), WOFF2 (.woff2) or Type 1 (.pfb, .pfm) dynamic font from file [code]path[/code]. [b]Warning:[/b] This method should only be used in the editor or in cases when you need to load external fonts at run-time, such as fonts located at the [code]user://[/code] directory. </description> </method> @@ -383,8 +349,8 @@ <argument index="1" name="size" type="Vector2i" /> <argument index="2" name="texture_index" type="int" /> <description> - Removes specified texture from font cache entry. - [b]Note:[/b] This function will not remove glyphs associated with the texture, remove them manually, using [method remove_glyph]. + Removes specified texture from the cache entry. + [b]Note:[/b] This function will not remove glyphs associated with the texture. Remove them manually using [method remove_glyph]. </description> </method> <method name="render_glyph"> @@ -393,7 +359,7 @@ <argument index="1" name="size" type="Vector2i" /> <argument index="2" name="index" type="int" /> <description> - Renders specified glyph the the font cache texture. + Renders specified glyph to the font cache texture. </description> </method> <method name="render_range"> @@ -406,22 +372,60 @@ Renders the range of characters to the font cache texture. </description> </method> - <method name="set_ascent"> + <method name="set_cache_ascent"> <return type="void" /> <argument index="0" name="cache_index" type="int" /> <argument index="1" name="size" type="int" /> <argument index="2" name="ascent" type="float" /> <description> - Sets the font ascent (number of pixels above the baseline). </description> </method> - <method name="set_descent"> + <method name="set_cache_descent"> <return type="void" /> <argument index="0" name="cache_index" type="int" /> <argument index="1" name="size" type="int" /> <argument index="2" name="descent" type="float" /> <description> - Sets the font descent (number of pixels below the baseline). + </description> + </method> + <method name="set_cache_scale"> + <return type="void" /> + <argument index="0" name="cache_index" type="int" /> + <argument index="1" name="size" type="int" /> + <argument index="2" name="scale" type="float" /> + <description> + </description> + </method> + <method name="set_cache_underline_position"> + <return type="void" /> + <argument index="0" name="cache_index" type="int" /> + <argument index="1" name="size" type="int" /> + <argument index="2" name="underline_position" type="float" /> + <description> + </description> + </method> + <method name="set_cache_underline_thickness"> + <return type="void" /> + <argument index="0" name="cache_index" type="int" /> + <argument index="1" name="size" type="int" /> + <argument index="2" name="underline_thickness" type="float" /> + <description> + </description> + </method> + <method name="set_embolden"> + <return type="void" /> + <argument index="0" name="cache_index" type="int" /> + <argument index="1" name="strength" type="float" /> + <description> + Sets embolden strength, if is not equal to zero, emboldens the font outlines. Negative values reduce the outline thickness. + </description> + </method> + <method name="set_face_index"> + <return type="void" /> + <argument index="0" name="cache_index" type="int" /> + <argument index="1" name="face_index" type="int" /> + <description> + Sets an active face index in the TrueType / OpenType collection. </description> </method> <method name="set_glyph_advance"> @@ -490,16 +494,7 @@ <argument index="0" name="language" type="String" /> <argument index="1" name="supported" type="bool" /> <description> - Adds override for [method is_language_supported]. - </description> - </method> - <method name="set_scale"> - <return type="void" /> - <argument index="0" name="cache_index" type="int" /> - <argument index="1" name="size" type="int" /> - <argument index="2" name="scale" type="float" /> - <description> - Sets scaling factor of the color bitmap font. + Adds override for [method Font.is_language_supported]. </description> </method> <method name="set_script_support_override"> @@ -507,17 +502,7 @@ <argument index="0" name="script" type="String" /> <argument index="1" name="supported" type="bool" /> <description> - Adds override for [method is_script_supported]. - </description> - </method> - <method name="set_spacing"> - <return type="void" /> - <argument index="0" name="cache_index" type="int" /> - <argument index="1" name="size" type="int" /> - <argument index="2" name="spacing_type" type="int" enum="TextServer.SpacingType" /> - <argument index="3" name="value" type="int" /> - <description> - Sets extra spacing added between glyphs in pixels. + Adds override for [method Font.is_script_supported]. </description> </method> <method name="set_texture_image"> @@ -540,22 +525,12 @@ Sets array containing the first free pixel in the each column of texture. Should be the same size as texture width or empty (for the fonts without dynamic glyph generation support). </description> </method> - <method name="set_underline_position"> + <method name="set_transform"> <return type="void" /> <argument index="0" name="cache_index" type="int" /> - <argument index="1" name="size" type="int" /> - <argument index="2" name="underline_position" type="float" /> + <argument index="1" name="transform" type="Transform2D" /> <description> - Sets pixel offset of the underline below the baseline. - </description> - </method> - <method name="set_underline_thickness"> - <return type="void" /> - <argument index="0" name="cache_index" type="int" /> - <argument index="1" name="size" type="int" /> - <argument index="2" name="underline_thickness" type="float" /> - <description> - Sets thickness of the underline in pixels. + Sets 2D transform, applied to the font outlines, can be used for slanting, flipping and rotating glyphs. </description> </method> <method name="set_variation_coordinates"> @@ -563,7 +538,7 @@ <argument index="0" name="cache_index" type="int" /> <argument index="1" name="variation_coordinates" type="Dictionary" /> <description> - Sets variation coordinates for the specified font cache entry. See [method get_supported_variation_list] for more info. + Sets variation coordinates for the specified font cache entry. See [method Font.get_supported_variation_list] for more info. </description> </method> </methods> @@ -574,11 +549,8 @@ <member name="data" type="PackedByteArray" setter="set_data" getter="get_data" default="PackedByteArray()"> Contents of the dynamic font source file. </member> - <member name="embolden" type="float" setter="set_embolden" getter="get_embolden" default="0.0"> - If is not equal to zero, emboldens the font outlines. Negative values reduce the outline thickness. - </member> - <member name="face_index" type="int" setter="set_face_index" getter="get_face_index" default="0"> - Active face index in the TrueType / OpenType collection file. + <member name="fallbacks" type="Font[]" setter="set_fallbacks" getter="get_fallbacks" default="[]"> + Array of fallback [Font]s. </member> <member name="fixed_size" type="int" setter="set_fixed_size" getter="get_fixed_size" default="0"> Font size, used only for the bitmap fonts. @@ -619,9 +591,5 @@ <member name="subpixel_positioning" type="int" setter="set_subpixel_positioning" getter="get_subpixel_positioning" enum="TextServer.SubpixelPositioning" default="1"> Font glyph sub-pixel positioning mode. Subpixel positioning provides shaper text and better kerning for smaller font sizes, at the cost of memory usage and font rasterization speed. Use [constant TextServer.SUBPIXEL_POSITIONING_AUTO] to automatically enable it based on the font size. </member> - <member name="transform" type="Transform2D" setter="set_transform" getter="get_transform" default="Transform2D(1, 0, 0, 1, 0, 0)"> - 2D transform, applied to the font outlines, can be used for slanting, flipping and rotating glyphs. - For example, to simulate italic typeface by slanting, apply the following transform [code]Transform2D(1.0, slant, 0.0, 1.0, 0.0, 0.0)[/code]. - </member> </members> </class> diff --git a/doc/classes/FontVariation.xml b/doc/classes/FontVariation.xml new file mode 100644 index 0000000000..a1b96fb137 --- /dev/null +++ b/doc/classes/FontVariation.xml @@ -0,0 +1,76 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="FontVariation" inherits="Font" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> + <brief_description> + Variation of the [Font]. + </brief_description> + <description> + OpenType variations, simulated bold / slant, and additional font settings like OpenType features and extra spacing. + + To use simulated bold font variant: + [codeblocks] + [gdscript] + var fv = FontVariation.new() + fv.set_base_font(load("res://BarlowCondensed-Regular.ttf")) + fv.set_variation_embolden(1.2); + $"Label".set("custom_fonts/font", fv) + $"Label".set("custom_fonts/font_size", 64) + [/gdscript] + [csharp] + var fv = new FontVariation(); + fv.SetBaseFont(ResourceLoader.Load<FontFile>("res://BarlowCondensed-Regular.ttf")); + fv.SetVariationEmbolden(1.2); + GetNode("Label").Set("custom_fonts/font", fv); + GetNode("Label").Set("custom_font_sizes/font_size", 64); + [/csharp] + [/codeblocks] + </description> + <tutorials> + </tutorials> + <methods> + <method name="set_spacing"> + <return type="void" /> + <argument index="0" name="spacing" type="int" enum="TextServer.SpacingType" /> + <argument index="1" name="value" type="int" /> + <description> + Sets the spacing for [code]type[/code] (see [enum TextServer.SpacingType]) to [code]value[/code] in pixels (not relative to the font size). + </description> + </method> + </methods> + <members> + <member name="base_font" type="Font" setter="set_base_font" getter="get_base_font"> + Base font used to create a variation. If not set, default [Theme] font is used. + </member> + <member name="fallbacks" type="Font[]" setter="set_fallbacks" getter="get_fallbacks" default="[]"> + Array of fallback [Font]s. If not set [member base_font] fallback are ussed. + </member> + <member name="opentype_features" type="Dictionary" setter="set_opentype_features" getter="get_opentype_features" default="{}"> + A set of OpenType feature tags. More info: [url=https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags]OpenType feature tags[/url]. + </member> + <member name="spacing_bottom" type="int" setter="set_spacing" getter="get_spacing" default="0"> + Extra spacing at the bottom of the line in pixels. + </member> + <member name="spacing_glyph" type="int" setter="set_spacing" getter="get_spacing" default="0"> + Extra spacing between graphical glyphs + </member> + <member name="spacing_space" type="int" setter="set_spacing" getter="get_spacing" default="0"> + Extra width of the space glyphs. + </member> + <member name="spacing_top" type="int" setter="set_spacing" getter="get_spacing" default="0"> + Extra spacing at the top of the line in pixels. + </member> + <member name="variation_embolden" type="float" setter="set_variation_embolden" getter="get_variation_embolden" default="0.0"> + If is not equal to zero, emboldens the font outlines. Negative values reduce the outline thickness. + [b]Note:[/b] Emboldened fonts might have self-intersecting outlines, which will prevent MSDF fonts and [TextMesh] from working correctly. + </member> + <member name="variation_face_index" type="int" setter="set_variation_face_index" getter="get_variation_face_index" default="0"> + Active face index in the TrueType / OpenType collection file. + </member> + <member name="variation_opentype" type="Dictionary" setter="set_variation_opentype" getter="get_variation_opentype" default="{}"> + Font OpenType variation coordinates. More info: [url=https://docs.microsoft.com/en-us/typography/opentype/spec/dvaraxisreg]OpenType variation tags[/url]. + </member> + <member name="variation_transform" type="Transform2D" setter="set_variation_transform" getter="get_variation_transform" default="Transform2D(1, 0, 0, 1, 0, 0)"> + 2D transform, applied to the font outlines, can be used for slanting, flipping and rotating glyphs. + For example, to simulate italic typeface by slanting, apply the following transform [code]Transform2D(1.0, slant, 0.0, 1.0, 0.0, 0.0)[/code]. + </member> + </members> +</class> diff --git a/doc/classes/GraphNode.xml b/doc/classes/GraphNode.xml index f261da8413..36dbae1d74 100644 --- a/doc/classes/GraphNode.xml +++ b/doc/classes/GraphNode.xml @@ -17,12 +17,6 @@ Disables all input and output slots of the GraphNode. </description> </method> - <method name="clear_opentype_features"> - <return type="void" /> - <description> - Removes all OpenType features. - </description> - </method> <method name="clear_slot"> <return type="void" /> <argument index="0" name="idx" type="int" /> @@ -98,13 +92,6 @@ Returns the type of the output connection [code]idx[/code]. </description> </method> - <method name="get_opentype_feature" qualifiers="const"> - <return type="int" /> - <argument index="0" name="tag" type="String" /> - <description> - Returns OpenType feature [code]tag[/code]. - </description> - </method> <method name="get_slot_color_left" qualifiers="const"> <return type="Color" /> <argument index="0" name="idx" type="int" /> @@ -154,14 +141,6 @@ Returns [code]true[/code] if right (output) side of the slot [code]idx[/code] is enabled. </description> </method> - <method name="set_opentype_feature"> - <return type="void" /> - <argument index="0" name="tag" type="String" /> - <argument index="1" name="value" type="int" /> - <description> - Sets OpenType feature [code]tag[/code]. More info: [url=https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags]OpenType feature tags[/url]. - </description> - </method> <method name="set_slot"> <return type="void" /> <argument index="0" name="idx" type="int" /> diff --git a/doc/classes/ItemList.xml b/doc/classes/ItemList.xml index d52234e9ac..15c97b0838 100644 --- a/doc/classes/ItemList.xml +++ b/doc/classes/ItemList.xml @@ -38,13 +38,6 @@ Removes all items from the list. </description> </method> - <method name="clear_item_opentype_features"> - <return type="void" /> - <argument index="0" name="idx" type="int" /> - <description> - Removes all OpenType features from the item's text. - </description> - </method> <method name="deselect"> <return type="void" /> <argument index="0" name="idx" type="int" /> @@ -122,14 +115,6 @@ Returns the metadata value of the specified index. </description> </method> - <method name="get_item_opentype_feature" qualifiers="const"> - <return type="int" /> - <argument index="0" name="idx" type="int" /> - <argument index="1" name="tag" type="String" /> - <description> - Returns OpenType feature [code]tag[/code] of the item's text. - </description> - </method> <method name="get_item_text" qualifiers="const"> <return type="String" /> <argument index="0" name="idx" type="int" /> @@ -302,15 +287,6 @@ Sets a value (of any type) to be stored with the item associated with the specified index. </description> </method> - <method name="set_item_opentype_feature"> - <return type="void" /> - <argument index="0" name="idx" type="int" /> - <argument index="1" name="tag" type="String" /> - <argument index="2" name="value" type="int" /> - <description> - Sets OpenType feature [code]tag[/code] for the item's text. More info: [url=https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags]OpenType feature tags[/url]. - </description> - </method> <method name="set_item_selectable"> <return type="void" /> <argument index="0" name="idx" type="int" /> diff --git a/doc/classes/Label.xml b/doc/classes/Label.xml index b5f045621b..1eac58b9f2 100644 --- a/doc/classes/Label.xml +++ b/doc/classes/Label.xml @@ -11,12 +11,6 @@ <link title="2D Dodge The Creeps Demo">https://godotengine.org/asset-library/asset/515</link> </tutorials> <methods> - <method name="clear_opentype_features"> - <return type="void" /> - <description> - Removes all OpenType features. - </description> - </method> <method name="get_line_count" qualifiers="const"> <return type="int" /> <description> @@ -32,13 +26,6 @@ If there're no lines returns font size in pixels. </description> </method> - <method name="get_opentype_feature" qualifiers="const"> - <return type="int" /> - <argument index="0" name="tag" type="String" /> - <description> - Returns OpenType feature [code]tag[/code]. - </description> - </method> <method name="get_total_character_count" qualifiers="const"> <return type="int" /> <description> @@ -51,14 +38,6 @@ Returns the number of lines shown. Useful if the [Label]'s height cannot currently display all lines. </description> </method> - <method name="set_opentype_feature"> - <return type="void" /> - <argument index="0" name="tag" type="String" /> - <argument index="1" name="value" type="int" /> - <description> - Returns OpenType feature [code]tag[/code]. More info: [url=https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags]OpenType feature tags[/url]. - </description> - </method> </methods> <members> <member name="autowrap_mode" type="int" setter="set_autowrap_mode" getter="get_autowrap_mode" enum="TextServer.AutowrapMode" default="0"> @@ -119,7 +98,7 @@ Default text [Color] of the [Label]. </theme_item> <theme_item name="font_outline_color" data_type="color" type="Color" default="Color(1, 1, 1, 1)"> - The tint of [Font]'s outline. + The tint of text outline. </theme_item> <theme_item name="font_shadow_color" data_type="color" type="Color" default="Color(0, 0, 0, 0)"> [Color] of the text's shadow effect. diff --git a/doc/classes/Label3D.xml b/doc/classes/Label3D.xml index 47126575f7..2c3c27079a 100644 --- a/doc/classes/Label3D.xml +++ b/doc/classes/Label3D.xml @@ -9,12 +9,6 @@ <tutorials> </tutorials> <methods> - <method name="clear_opentype_features"> - <return type="void" /> - <description> - Removes all OpenType features. - </description> - </method> <method name="generate_triangle_mesh" qualifiers="const"> <return type="TriangleMesh" /> <description> @@ -28,13 +22,6 @@ Returns the value of the specified flag. </description> </method> - <method name="get_opentype_feature" qualifiers="const"> - <return type="int" /> - <argument index="0" name="tag" type="String" /> - <description> - Returns OpenType feature [code]tag[/code]. - </description> - </method> <method name="set_draw_flag"> <return type="void" /> <argument index="0" name="flag" type="int" enum="Label3D.DrawFlags" /> @@ -43,14 +30,6 @@ If [code]true[/code], the specified flag will be enabled. See [enum Label3D.DrawFlags] for a list of flags. </description> </method> - <method name="set_opentype_feature"> - <return type="void" /> - <argument index="0" name="tag" type="String" /> - <argument index="1" name="value" type="int" /> - <description> - Returns OpenType feature [code]tag[/code]. More info: [url=https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags]OpenType feature tags[/url]. - </description> - </method> </methods> <members> <member name="alpha_cut" type="int" setter="set_alpha_cut_mode" getter="get_alpha_cut_mode" enum="Label3D.AlphaCutMode" default="0"> @@ -72,7 +51,7 @@ If [code]true[/code], the label is rendered at the same size regardless of distance. </member> <member name="font" type="Font" setter="set_font" getter="get_font"> - [Font] used for the [Label3D]'s text. + Font configuration used to display text. </member> <member name="font_size" type="int" setter="set_font_size" getter="get_font_size" default="16"> Font size of the [Label3D]'s text. @@ -96,7 +75,7 @@ The text drawing offset (in pixels). </member> <member name="outline_modulate" type="Color" setter="set_outline_modulate" getter="get_outline_modulate" default="Color(0, 0, 0, 1)"> - The tint of [Font]'s outline. + The tint of text outline. </member> <member name="outline_render_priority" type="int" setter="set_outline_render_priority" getter="get_outline_render_priority" default="-1"> Sets the render priority for the text outline. Higher priority objects will be sorted in front of lower priority objects. diff --git a/doc/classes/LineEdit.xml b/doc/classes/LineEdit.xml index 55e012ee0c..84471bafc0 100644 --- a/doc/classes/LineEdit.xml +++ b/doc/classes/LineEdit.xml @@ -37,12 +37,6 @@ Erases the [LineEdit]'s [member text]. </description> </method> - <method name="clear_opentype_features"> - <return type="void" /> - <description> - Removes all OpenType features. - </description> - </method> <method name="delete_char_at_caret"> <return type="void" /> <description> @@ -70,13 +64,6 @@ [b]Warning:[/b] This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their [member Window.visible] property. </description> </method> - <method name="get_opentype_feature" qualifiers="const"> - <return type="int" /> - <argument index="0" name="tag" type="String" /> - <description> - Returns OpenType feature [code]tag[/code]. - </description> - </method> <method name="get_scroll_offset" qualifiers="const"> <return type="int" /> <description> @@ -149,14 +136,6 @@ Selects the whole [String]. </description> </method> - <method name="set_opentype_feature"> - <return type="void" /> - <argument index="0" name="tag" type="String" /> - <argument index="1" name="value" type="int" /> - <description> - Returns OpenType feature [code]tag[/code]. More info: [url=https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags]OpenType feature tags[/url]. - </description> - </method> </methods> <members> <member name="alignment" type="int" setter="set_horizontal_alignment" getter="get_horizontal_alignment" enum="HorizontalAlignment" default="0"> diff --git a/doc/classes/LinkButton.xml b/doc/classes/LinkButton.xml index ba80504caf..7c6ff2d4e1 100644 --- a/doc/classes/LinkButton.xml +++ b/doc/classes/LinkButton.xml @@ -9,29 +9,6 @@ </description> <tutorials> </tutorials> - <methods> - <method name="clear_opentype_features"> - <return type="void" /> - <description> - Removes all OpenType features. - </description> - </method> - <method name="get_opentype_feature" qualifiers="const"> - <return type="int" /> - <argument index="0" name="tag" type="String" /> - <description> - Returns OpenType feature [code]tag[/code]. - </description> - </method> - <method name="set_opentype_feature"> - <return type="void" /> - <argument index="0" name="tag" type="String" /> - <argument index="1" name="value" type="int" /> - <description> - Returns OpenType feature [code]tag[/code]. More info: [url=https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags]OpenType feature tags[/url]. - </description> - </method> - </methods> <members> <member name="language" type="String" setter="set_language" getter="get_language" default=""""> Language code used for line-breaking and text shaping algorithms, if left empty current locale is used instead. diff --git a/doc/classes/PopupMenu.xml b/doc/classes/PopupMenu.xml index 73413b379e..5da2196f29 100644 --- a/doc/classes/PopupMenu.xml +++ b/doc/classes/PopupMenu.xml @@ -182,13 +182,6 @@ Removes all items from the [PopupMenu]. </description> </method> - <method name="clear_item_opentype_features"> - <return type="void" /> - <argument index="0" name="index" type="int" /> - <description> - Removes all OpenType features form the item's text. - </description> - </method> <method name="get_current_index" qualifiers="const"> <return type="int" /> <description> @@ -244,14 +237,6 @@ Returns the metadata of the specified item, which might be of any type. You can set it with [method set_item_metadata], which provides a simple way of assigning context data to items. </description> </method> - <method name="get_item_opentype_feature" qualifiers="const"> - <return type="int" /> - <argument index="0" name="index" type="int" /> - <argument index="1" name="tag" type="String" /> - <description> - Returns OpenType feature [code]tag[/code] of the item's text. - </description> - </method> <method name="get_item_shortcut" qualifiers="const"> <return type="Shortcut" /> <argument index="0" name="index" type="int" /> @@ -452,15 +437,6 @@ Sets the state of a multistate item. See [method add_multistate_item] for details. </description> </method> - <method name="set_item_opentype_feature"> - <return type="void" /> - <argument index="0" name="index" type="int" /> - <argument index="1" name="tag" type="String" /> - <argument index="2" name="value" type="int" /> - <description> - Sets OpenType feature [code]tag[/code] for the item's text. More info: [url=https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags]OpenType feature tags[/url]. - </description> - </method> <method name="set_item_shortcut"> <return type="void" /> <argument index="0" name="index" type="int" /> diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml index 553005c4c4..7c378f33fe 100644 --- a/doc/classes/ProjectSettings.xml +++ b/doc/classes/ProjectSettings.xml @@ -628,7 +628,7 @@ Path to a custom [Font] resource to use as default for all GUI elements of the project. </member> <member name="gui/theme/default_font_antialiased" type="bool" setter="" getter="" default="true"> - If set to [code]true[/code], default font uses 8-bit anitialiased glyph rendering. See [member FontData.antialiased]. + If set to [code]true[/code], default font uses 8-bit anitialiased glyph rendering. See [member FontFile.antialiased]. </member> <member name="gui/theme/default_font_generate_mipmaps" type="bool" setter="" getter="" default="false"> If set to [code]true[/code], the default font will have mipmaps generated. This prevents text from looking grainy when a [Control] is scaled down, or when a [Label3D] is viewed from a long distance (if [member Label3D.texture_filter] is set to a mode that displays mipmaps). @@ -636,7 +636,7 @@ [b]Note:[/b] This setting does not affect custom [Font]s used within the project. </member> <member name="gui/theme/default_font_hinting" type="int" setter="" getter="" default="1"> - Default font hinting mode. See [member FontData.hinting]. + Default font hinting mode. See [member FontFile.hinting]. </member> <member name="gui/theme/default_font_multichannel_signed_distance_field" type="bool" setter="" getter="" default="false"> If set to [code]true[/code], the default font will use multichannel signed distance field (MSDF) for crisp rendering at any size. Since this approach does not rely on rasterizing the font every time its size changes, this allows for resizing the font in real-time without any performance penalty. Text will also not look grainy for [Control]s that are scaled down (or for [Label3D]s viewed from a long distance). @@ -644,7 +644,7 @@ [b]Note:[/b] This setting does not affect custom [Font]s used within the project. </member> <member name="gui/theme/default_font_subpixel_positioning" type="int" setter="" getter="" default="1"> - Default font glyph sub-pixel positioning mode. See [member FontData.subpixel_positioning]. + Default font glyph sub-pixel positioning mode. See [member FontFile.subpixel_positioning]. </member> <member name="gui/theme/default_theme_scale" type="float" setter="" getter="" default="1.0"> </member> diff --git a/doc/classes/ResourceSaver.xml b/doc/classes/ResourceSaver.xml index 815c7e8813..213d8c585a 100644 --- a/doc/classes/ResourceSaver.xml +++ b/doc/classes/ResourceSaver.xml @@ -37,7 +37,7 @@ <return type="int" enum="Error" /> <argument index="0" name="path" type="String" /> <argument index="1" name="resource" type="Resource" /> - <argument index="2" name="flags" type="int" default="0" /> + <argument index="2" name="flags" type="int" enum="ResourceSaver.SaverFlags" default="0" /> <description> Saves a resource to disk to the given path, using a [ResourceFormatSaver] that recognizes the resource object. The [code]flags[/code] bitmask can be specified to customize the save behavior using [enum SaverFlags] flags. @@ -46,28 +46,28 @@ </method> </methods> <constants> - <constant name="FLAG_NONE" value="0" enum="SaverFlags"> + <constant name="FLAG_NONE" value="0" enum="SaverFlags" is_bitfield="true"> No resource saving option. </constant> - <constant name="FLAG_RELATIVE_PATHS" value="1" enum="SaverFlags"> + <constant name="FLAG_RELATIVE_PATHS" value="1" enum="SaverFlags" is_bitfield="true"> Save the resource with a path relative to the scene which uses it. </constant> - <constant name="FLAG_BUNDLE_RESOURCES" value="2" enum="SaverFlags"> + <constant name="FLAG_BUNDLE_RESOURCES" value="2" enum="SaverFlags" is_bitfield="true"> Bundles external resources. </constant> - <constant name="FLAG_CHANGE_PATH" value="4" enum="SaverFlags"> + <constant name="FLAG_CHANGE_PATH" value="4" enum="SaverFlags" is_bitfield="true"> Changes the [member Resource.resource_path] of the saved resource to match its new location. </constant> - <constant name="FLAG_OMIT_EDITOR_PROPERTIES" value="8" enum="SaverFlags"> + <constant name="FLAG_OMIT_EDITOR_PROPERTIES" value="8" enum="SaverFlags" is_bitfield="true"> Do not save editor-specific metadata (identified by their [code]__editor[/code] prefix). </constant> - <constant name="FLAG_SAVE_BIG_ENDIAN" value="16" enum="SaverFlags"> + <constant name="FLAG_SAVE_BIG_ENDIAN" value="16" enum="SaverFlags" is_bitfield="true"> Save as big endian (see [member File.big_endian]). </constant> - <constant name="FLAG_COMPRESS" value="32" enum="SaverFlags"> + <constant name="FLAG_COMPRESS" value="32" enum="SaverFlags" is_bitfield="true"> Compress the resource on save using [constant File.COMPRESSION_ZSTD]. Only available for binary resource types. </constant> - <constant name="FLAG_REPLACE_SUBRESOURCE_PATHS" value="64" enum="SaverFlags"> + <constant name="FLAG_REPLACE_SUBRESOURCE_PATHS" value="64" enum="SaverFlags" is_bitfield="true"> Take over the paths of the saved subresources (see [method Resource.take_over_path]). </constant> </constants> diff --git a/doc/classes/RichTextLabel.xml b/doc/classes/RichTextLabel.xml index 1294e5b58a..3c9e9b1bfc 100644 --- a/doc/classes/RichTextLabel.xml +++ b/doc/classes/RichTextLabel.xml @@ -276,18 +276,10 @@ Adds a [code][font][/code] tag to the tag stack. Overrides default fonts for its duration. </description> </method> - <method name="push_font_features"> - <return type="void" /> - <argument index="0" name="opentype_features" type="Dictionary" /> - <description> - Adds a [code][ot_feature][/code] tag to the tag stack. Overrides default OpenType font feature for its duration. - </description> - </method> <method name="push_font_size"> <return type="void" /> <argument index="0" name="font_size" type="int" /> <description> - Adds a [code][font_size][/code] tag to the tag stack. Overrides default font size for its duration. </description> </method> <method name="push_hint"> diff --git a/doc/classes/ScriptLanguageExtension.xml b/doc/classes/ScriptLanguageExtension.xml index 0f757cf806..45d4cf44fa 100644 --- a/doc/classes/ScriptLanguageExtension.xml +++ b/doc/classes/ScriptLanguageExtension.xml @@ -174,6 +174,11 @@ <description> </description> </method> + <method name="_get_public_annotations" qualifiers="virtual const"> + <return type="Dictionary[]" /> + <description> + </description> + </method> <method name="_get_public_constants" qualifiers="virtual const"> <return type="Dictionary" /> <description> @@ -378,7 +383,9 @@ </constant> <constant name="LOOKUP_RESULT_CLASS_TBD_GLOBALSCOPE" value="7" enum="LookupResultType"> </constant> - <constant name="LOOKUP_RESULT_MAX" value="8" enum="LookupResultType"> + <constant name="LOOKUP_RESULT_CLASS_ANNOTATION" value="8" enum="LookupResultType"> + </constant> + <constant name="LOOKUP_RESULT_MAX" value="9" enum="LookupResultType"> </constant> <constant name="LOCATION_LOCAL" value="0" enum="CodeCompletionLocation"> The option is local to the location of the code completion query - e.g. a local variable. diff --git a/doc/classes/TabBar.xml b/doc/classes/TabBar.xml index a8ed0d4286..79d52b70fb 100644 --- a/doc/classes/TabBar.xml +++ b/doc/classes/TabBar.xml @@ -17,13 +17,6 @@ Adds a new tab. </description> </method> - <method name="clear_tab_opentype_features"> - <return type="void" /> - <argument index="0" name="tab_idx" type="int" /> - <description> - Removes all OpenType features from the tab title. - </description> - </method> <method name="ensure_tab_visible"> <return type="void" /> <argument index="0" name="idx" type="int" /> @@ -77,14 +70,6 @@ Returns the number of hidden tabs offsetted to the left. </description> </method> - <method name="get_tab_opentype_feature" qualifiers="const"> - <return type="int" /> - <argument index="0" name="tab_idx" type="int" /> - <argument index="1" name="tag" type="String" /> - <description> - Returns OpenType feature [code]tag[/code] of the tab title. - </description> - </method> <method name="get_tab_rect" qualifiers="const"> <return type="Rect2" /> <argument index="0" name="tab_idx" type="int" /> @@ -175,15 +160,6 @@ Sets language code of tab title used for line-breaking and text shaping algorithms, if left empty current locale is used instead. </description> </method> - <method name="set_tab_opentype_feature"> - <return type="void" /> - <argument index="0" name="tab_idx" type="int" /> - <argument index="1" name="tag" type="String" /> - <argument index="2" name="values" type="int" /> - <description> - Sets OpenType feature [code]tag[/code] for the tab title. More info: [url=https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags]OpenType feature tags[/url]. - </description> - </method> <method name="set_tab_text_direction"> <return type="void" /> <argument index="0" name="tab_idx" type="int" /> diff --git a/doc/classes/TextEdit.xml b/doc/classes/TextEdit.xml index 62a1be030d..18a4893f03 100644 --- a/doc/classes/TextEdit.xml +++ b/doc/classes/TextEdit.xml @@ -85,12 +85,6 @@ Performs a full reset of [TextEdit], including undo history. </description> </method> - <method name="clear_opentype_features"> - <return type="void" /> - <description> - Removes all OpenType features. - </description> - </method> <method name="clear_undo_history"> <return type="void" /> <description> @@ -355,13 +349,6 @@ Returns the count to the next visible line from [code]line[/code] to [code]line + visible_amount[/code]. Can also count backwards. For example if a [TextEdit] has 5 lines with lines 2 and 3 hidden, calling this with [code]line = 1, visible_amount = 1[/code] would return 3. </description> </method> - <method name="get_opentype_feature" qualifiers="const"> - <return type="int" /> - <argument index="0" name="tag" type="String" /> - <description> - Returns OpenType feature [code]tag[/code]. - </description> - </method> <method name="get_pos_at_line_column" qualifiers="const"> <return type="Vector2i" /> <argument index="0" name="line" type="int" /> @@ -859,14 +846,6 @@ Sets the text for [code]gutter[/code] on [code]line[/code]. </description> </method> - <method name="set_opentype_feature"> - <return type="void" /> - <argument index="0" name="tag" type="String" /> - <argument index="1" name="value" type="int" /> - <description> - Sets OpenType feature [code]tag[/code]. More info: [url=https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags]OpenType feature tags[/url]. - </description> - </method> <method name="set_overtype_mode_enabled"> <return type="void" /> <argument index="0" name="enabled" type="bool" /> diff --git a/doc/classes/TextLine.xml b/doc/classes/TextLine.xml index f154cbbe9a..c3574980b1 100644 --- a/doc/classes/TextLine.xml +++ b/doc/classes/TextLine.xml @@ -22,11 +22,10 @@ <method name="add_string"> <return type="bool" /> <argument index="0" name="text" type="String" /> - <argument index="1" name="fonts" type="Font" /> - <argument index="2" name="size" type="int" /> - <argument index="3" name="opentype_features" type="Dictionary" default="{}" /> - <argument index="4" name="language" type="String" default="""" /> - <argument index="5" name="meta" type="Variant" default="null" /> + <argument index="1" name="font" type="Font" /> + <argument index="2" name="font_size" type="int" /> + <argument index="3" name="language" type="String" default="""" /> + <argument index="4" name="meta" type="Variant" default="null" /> <description> Adds text span and font to draw it. </description> diff --git a/doc/classes/TextMesh.xml b/doc/classes/TextMesh.xml index 5a1501d2ca..17a0ca32e4 100644 --- a/doc/classes/TextMesh.xml +++ b/doc/classes/TextMesh.xml @@ -10,29 +10,6 @@ </description> <tutorials> </tutorials> - <methods> - <method name="clear_opentype_features"> - <return type="void" /> - <description> - Removes all OpenType features. - </description> - </method> - <method name="get_opentype_feature" qualifiers="const"> - <return type="int" /> - <argument index="0" name="tag" type="String" /> - <description> - Returns OpenType feature [code]tag[/code]. - </description> - </method> - <method name="set_opentype_feature"> - <return type="void" /> - <argument index="0" name="tag" type="String" /> - <argument index="1" name="value" type="int" /> - <description> - Returns OpenType feature [code]tag[/code]. More info: [url=https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags]OpenType feature tags[/url]. - </description> - </method> - </methods> <members> <member name="curve_step" type="float" setter="set_curve_step" getter="get_curve_step" default="0.5"> Step (in pixels) used to approximate Bézier curves. @@ -41,7 +18,7 @@ Depths of the mesh, if set to [code]0.0[/code] only front surface, is generated, and UV layout is changed to use full texture for the front face only. </member> <member name="font" type="Font" setter="set_font" getter="get_font"> - [Font] used for the [TextMesh]'s text. + Font configuration used to display text. </member> <member name="font_size" type="int" setter="set_font_size" getter="get_font_size" default="16"> Font size of the [TextMesh]'s text. diff --git a/doc/classes/TextParagraph.xml b/doc/classes/TextParagraph.xml index aaaacfe3ac..6d615bd404 100644 --- a/doc/classes/TextParagraph.xml +++ b/doc/classes/TextParagraph.xml @@ -22,11 +22,10 @@ <method name="add_string"> <return type="bool" /> <argument index="0" name="text" type="String" /> - <argument index="1" name="fonts" type="Font" /> - <argument index="2" name="size" type="int" /> - <argument index="3" name="opentype_features" type="Dictionary" default="{}" /> - <argument index="4" name="language" type="String" default="""" /> - <argument index="5" name="meta" type="Variant" default="null" /> + <argument index="1" name="font" type="Font" /> + <argument index="2" name="font_size" type="int" /> + <argument index="3" name="language" type="String" default="""" /> + <argument index="4" name="meta" type="Variant" default="null" /> <description> Adds text span and font to draw it. </description> @@ -217,18 +216,6 @@ Returns the size of the bounding box of the paragraph. </description> </method> - <method name="get_spacing_bottom" qualifiers="const"> - <return type="int" /> - <description> - Returns extra spacing at the bottom of the line. See [member Font.spacing_bottom]. - </description> - </method> - <method name="get_spacing_top" qualifiers="const"> - <return type="int" /> - <description> - Returns extra spacing at the top of the line. See [member Font.spacing_top]. - </description> - </method> <method name="hit_test" qualifiers="const"> <return type="int" /> <argument index="0" name="coords" type="Vector2" /> @@ -256,11 +243,10 @@ <method name="set_dropcap"> <return type="bool" /> <argument index="0" name="text" type="String" /> - <argument index="1" name="fonts" type="Font" /> - <argument index="2" name="size" type="int" /> + <argument index="1" name="font" type="Font" /> + <argument index="2" name="font_size" type="int" /> <argument index="3" name="dropcap_margins" type="Rect2" default="Rect2(0, 0, 0, 0)" /> - <argument index="4" name="opentype_features" type="Dictionary" default="{}" /> - <argument index="5" name="language" type="String" default="""" /> + <argument index="4" name="language" type="String" default="""" /> <description> Sets drop cap, overrides previously set drop cap. Drop cap (dropped capital) is a decorative element at the beginning of a paragraph that is larger than the rest of the text. </description> diff --git a/doc/classes/TextServer.xml b/doc/classes/TextServer.xml index ca1aec19ea..4c8cf3982e 100644 --- a/doc/classes/TextServer.xml +++ b/doc/classes/TextServer.xml @@ -355,15 +355,6 @@ Returns list of the font sizes in the cache. Each size is [code]Vector2i[/code] with font size and outline size. </description> </method> - <method name="font_get_spacing" qualifiers="const"> - <return type="int" /> - <argument index="0" name="font_rid" type="RID" /> - <argument index="1" name="size" type="int" /> - <argument index="2" name="spacing" type="int" enum="TextServer.SpacingType" /> - <description> - Returns extra spacing added between glyphs in pixels. - </description> - </method> <method name="font_get_style" qualifiers="const"> <return type="int" /> <argument index="0" name="font_rid" type="RID" /> @@ -542,7 +533,7 @@ <argument index="1" name="size" type="Vector2i" /> <argument index="2" name="texture_index" type="int" /> <description> - Removes specified texture from font cache entry. + Removes specified texture from the cache entry. [b]Note:[/b] This function will not remove glyphs associated with the texture, remove them manually, using [method font_remove_glyph]. </description> </method> @@ -792,16 +783,6 @@ Adds override for [method font_is_script_supported]. </description> </method> - <method name="font_set_spacing"> - <return type="void" /> - <argument index="0" name="font_rid" type="RID" /> - <argument index="1" name="size" type="int" /> - <argument index="2" name="spacing" type="int" enum="TextServer.SpacingType" /> - <argument index="3" name="value" type="int" /> - <description> - Sets extra spacing added between glyphs in pixels. - </description> - </method> <method name="font_set_style"> <return type="void" /> <argument index="0" name="font_rid" type="RID" /> @@ -1286,6 +1267,14 @@ Returns size of the text. </description> </method> + <method name="shaped_text_get_spacing" qualifiers="const"> + <return type="int" /> + <argument index="0" name="shaped" type="RID" /> + <argument index="1" name="spacing" type="int" enum="TextServer.SpacingType" /> + <description> + Returns extra spacing added between glyphs or lines in pixels. + </description> + </method> <method name="shaped_text_get_trim_pos" qualifiers="const"> <return type="int" /> <argument index="0" name="shaped" type="RID" /> @@ -1431,6 +1420,15 @@ If set to [code]true[/code] text buffer will display invalid characters as hexadecimal codes, otherwise nothing is displayed. </description> </method> + <method name="shaped_text_set_spacing"> + <return type="void" /> + <argument index="0" name="shaped" type="RID" /> + <argument index="1" name="spacing" type="int" enum="TextServer.SpacingType" /> + <argument index="2" name="value" type="int" /> + <description> + Sets extra spacing added between glyphs or lines in pixels. + </description> + </method> <method name="shaped_text_shape"> <return type="bool" /> <argument index="0" name="shaped" type="RID" /> diff --git a/doc/classes/TextServerExtension.xml b/doc/classes/TextServerExtension.xml index b3be858ca1..2f7b31b663 100644 --- a/doc/classes/TextServerExtension.xml +++ b/doc/classes/TextServerExtension.xml @@ -345,15 +345,6 @@ Returns list of the font sizes in the cache. Each size is [code]Vector2i[/code] with font size and outline size. </description> </method> - <method name="font_get_spacing" qualifiers="virtual const"> - <return type="int" /> - <argument index="0" name="font_rid" type="RID" /> - <argument index="1" name="size" type="int" /> - <argument index="2" name="spacing" type="int" enum="TextServer.SpacingType" /> - <description> - Returns extra spacing added between glyphs in pixels. - </description> - </method> <method name="font_get_style" qualifiers="virtual const"> <return type="int" /> <argument index="0" name="font_rid" type="RID" /> @@ -531,7 +522,7 @@ <argument index="1" name="size" type="Vector2i" /> <argument index="2" name="texture_index" type="int" /> <description> - Removes specified texture from font cache entry. + Removes specified texture from the cache entry. </description> </method> <method name="font_render_glyph" qualifiers="virtual"> @@ -788,16 +779,6 @@ Adds override for [method font_is_script_supported]. </description> </method> - <method name="font_set_spacing" qualifiers="virtual"> - <return type="void" /> - <argument index="0" name="font_rid" type="RID" /> - <argument index="1" name="size" type="int" /> - <argument index="2" name="spacing" type="int" enum="TextServer.SpacingType" /> - <argument index="3" name="value" type="int" /> - <description> - Sets extra spacing added between glyphs in pixels. - </description> - </method> <method name="font_set_style" qualifiers="virtual"> <return type="void" /> <argument index="0" name="font_rid" type="RID" /> @@ -1288,6 +1269,14 @@ Returns size of the text. </description> </method> + <method name="shaped_text_get_spacing" qualifiers="virtual const"> + <return type="int" /> + <argument index="0" name="shaped" type="RID" /> + <argument index="1" name="spacing" type="int" enum="TextServer.SpacingType" /> + <description> + Returns extra spacing added between glyphs or lines in pixels. + </description> + </method> <method name="shaped_text_get_trim_pos" qualifiers="virtual const"> <return type="int" /> <argument index="0" name="shaped" type="RID" /> @@ -1436,6 +1425,15 @@ If set to [code]true[/code] text buffer will display invalid characters as hexadecimal codes, otherwise nothing is displayed. </description> </method> + <method name="shaped_text_set_spacing" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="shaped" type="RID" /> + <argument index="1" name="spacing" type="int" enum="TextServer.SpacingType" /> + <argument index="2" name="value" type="int" /> + <description> + Sets extra spacing added between glyphs or lines in pixels. + </description> + </method> <method name="shaped_text_shape" qualifiers="virtual"> <return type="bool" /> <argument index="0" name="shaped" type="RID" /> diff --git a/doc/classes/Theme.xml b/doc/classes/Theme.xml index 5270da9588..7f4e0645c8 100644 --- a/doc/classes/Theme.xml +++ b/doc/classes/Theme.xml @@ -334,8 +334,8 @@ <argument index="0" name="name" type="StringName" /> <argument index="1" name="theme_type" type="StringName" /> <description> - Returns [code]true[/code] if the font size property defined by [code]name[/code] and [code]theme_type[/code] exists, or if the default theme font size is set up (see [method has_default_font_size]). - Returns [code]false[/code] if neither exist. Use [method set_font_size] to define the property. + Returns [code]true[/code] if [member default_font_size] has a valid value. + Returns [code]false[/code] if it doesn't. The value must be greater than [code]0[/code] to be considered valid. </description> </method> <method name="has_icon" qualifiers="const"> @@ -426,8 +426,8 @@ <argument index="1" name="name" type="StringName" /> <argument index="2" name="theme_type" type="StringName" /> <description> - Renames the font size property defined by [code]old_name[/code] and [code]theme_type[/code] to [code]name[/code], if it exists. - Fails if it doesn't exist, or if a similar property with the new name already exists. Use [method has_font_size] to check for existence, and [method clear_font_size] to remove the existing property. + Returns [code]true[/code] if the font size property defined by [code]name[/code] and [code]theme_type[/code] exists, or if the default theme font size is set up (see [method has_default_font_size]). + Returns [code]false[/code] if neither exist. Use [method set_font_size] to define the property. </description> </method> <method name="rename_icon"> @@ -495,7 +495,8 @@ <argument index="1" name="theme_type" type="StringName" /> <argument index="2" name="font_size" type="int" /> <description> - Creates or changes the value of the font size property defined by [code]name[/code] and [code]theme_type[/code]. Use [method clear_font_size] to remove the property. + Renames the font size property defined by [code]old_name[/code] and [code]theme_type[/code] to [code]name[/code], if it exists. + Fails if it doesn't exist, or if a similar property with the new name already exists. Use [method has_font_size] to check for existence, and [method clear_font_size] to remove the existing property. </description> </method> <method name="set_icon"> diff --git a/doc/classes/Tree.xml b/doc/classes/Tree.xml index 8a30364ebe..b06be0cf99 100644 --- a/doc/classes/Tree.xml +++ b/doc/classes/Tree.xml @@ -42,13 +42,6 @@ Clears the tree. This removes all items. </description> </method> - <method name="clear_column_title_opentype_features"> - <return type="void" /> - <argument index="0" name="column" type="int" /> - <description> - Removes all OpenType features from the item's text. - </description> - </method> <method name="create_item"> <return type="TreeItem" /> <argument index="0" name="parent" type="TreeItem" default="null" /> @@ -114,14 +107,6 @@ Returns column title language code. </description> </method> - <method name="get_column_title_opentype_feature" qualifiers="const"> - <return type="int" /> - <argument index="0" name="column" type="int" /> - <argument index="1" name="tag" type="String" /> - <description> - Returns OpenType feature [code]tag[/code] of the column title. - </description> - </method> <method name="get_column_width" qualifiers="const"> <return type="int" /> <argument index="0" name="column" type="int" /> @@ -308,15 +293,6 @@ Sets language code of column title used for line-breaking and text shaping algorithms, if left empty current locale is used instead. </description> </method> - <method name="set_column_title_opentype_feature"> - <return type="void" /> - <argument index="0" name="column" type="int" /> - <argument index="1" name="tag" type="String" /> - <argument index="2" name="value" type="int" /> - <description> - Sets OpenType feature [code]tag[/code] for the column title. - </description> - </method> </methods> <members> <member name="allow_reselect" type="bool" setter="set_allow_reselect" getter="get_allow_reselect" default="false"> diff --git a/doc/classes/TreeItem.xml b/doc/classes/TreeItem.xml index 0a680b9627..804b8dddd9 100644 --- a/doc/classes/TreeItem.xml +++ b/doc/classes/TreeItem.xml @@ -42,13 +42,6 @@ Resets the color for the given column to default. </description> </method> - <method name="clear_opentype_features"> - <return type="void" /> - <argument index="0" name="column" type="int" /> - <description> - Removes all OpenType features. - </description> - </method> <method name="create_child"> <return type="TreeItem" /> <argument index="0" name="idx" type="int" default="-1" /> @@ -241,14 +234,6 @@ If [code]wrap[/code] is enabled, the method will wrap around to the first visible element in the tree when called on the last visible element, otherwise it returns [code]null[/code]. </description> </method> - <method name="get_opentype_feature" qualifiers="const"> - <return type="int" /> - <argument index="0" name="column" type="int" /> - <argument index="1" name="tag" type="String" /> - <description> - Returns OpenType feature [code]tag[/code] of the item's text. - </description> - </method> <method name="get_parent" qualifiers="const"> <return type="TreeItem" /> <description> @@ -580,15 +565,6 @@ Sets the metadata value for the given column, which can be retrieved later using [method get_metadata]. This can be used, for example, to store a reference to the original data. </description> </method> - <method name="set_opentype_feature"> - <return type="void" /> - <argument index="0" name="column" type="int" /> - <argument index="1" name="tag" type="String" /> - <argument index="2" name="value" type="int" /> - <description> - Sets OpenType feature [code]tag[/code] for the item's text. - </description> - </method> <method name="set_range"> <return type="void" /> <argument index="0" name="column" type="int" /> diff --git a/doc/classes/VideoStreamPlayer.xml b/doc/classes/VideoStreamPlayer.xml index 092a754a39..f6594ff9e7 100644 --- a/doc/classes/VideoStreamPlayer.xml +++ b/doc/classes/VideoStreamPlayer.xml @@ -58,7 +58,7 @@ <member name="bus" type="StringName" setter="set_bus" getter="get_bus" default="&"Master""> Audio bus to use for sound playback. </member> - <member name="expand" type="bool" setter="set_expand" getter="has_expand" default="true"> + <member name="expand" type="bool" setter="set_expand" getter="has_expand" default="false"> If [code]true[/code], the video scales to the control size. Otherwise, the control minimum size will be automatically adjusted to match the video stream's dimensions. </member> <member name="paused" type="bool" setter="set_paused" getter="is_paused" default="false"> diff --git a/doc/tools/make_rst.py b/doc/tools/make_rst.py index ce09361dfa..312dffc7ee 100755 --- a/doc/tools/make_rst.py +++ b/doc/tools/make_rst.py @@ -36,6 +36,7 @@ BASE_STRINGS = [ "Signals", "Enumerations", "Constants", + "Annotations", "Property Descriptions", "Constructor Descriptions", "Method Descriptions", @@ -122,16 +123,18 @@ class MethodDef: class ConstantDef: - def __init__(self, name, value, text): # type: (str, str, Optional[str]) -> None + def __init__(self, name, value, text, bitfield): # type: (str, str, Optional[str], Optional[bool]) -> None self.name = name self.value = value self.text = text + self.is_bitfield = bitfield class EnumDef: - def __init__(self, name): # type: (str) -> None + def __init__(self, name, bitfield): # type: (str, Optional[bool]) -> None self.name = name self.values = OrderedDict() # type: OrderedDict[str, ConstantDef] + self.is_bitfield = bitfield class ThemeItemDef: @@ -155,6 +158,7 @@ class ClassDef: self.methods = OrderedDict() # type: OrderedDict[str, List[MethodDef]] self.operators = OrderedDict() # type: OrderedDict[str, List[MethodDef]] self.signals = OrderedDict() # type: OrderedDict[str, SignalDef] + self.annotations = OrderedDict() # type: OrderedDict[str, List[MethodDef]] self.theme_items = OrderedDict() # type: OrderedDict[str, ThemeItemDef] self.inherits = None # type: Optional[str] self.brief_description = None # type: Optional[str] @@ -305,7 +309,8 @@ class State: constant_name = constant.attrib["name"] value = constant.attrib["value"] enum = constant.get("enum") - constant_def = ConstantDef(constant_name, value, constant.text) + is_bitfield = constant.get("is_bitfield") or False + constant_def = ConstantDef(constant_name, value, constant.text, is_bitfield) if enum is None: if constant_name in class_def.constants: print_error('{}.xml: Duplicate constant "{}".'.format(class_name, constant_name), self) @@ -318,11 +323,32 @@ class State: enum_def = class_def.enums[enum] else: - enum_def = EnumDef(enum) + enum_def = EnumDef(enum, is_bitfield) class_def.enums[enum] = enum_def enum_def.values[constant_name] = constant_def + annotations = class_root.find("annotations") + if annotations is not None: + for annotation in annotations: + assert annotation.tag == "annotation" + + annotation_name = annotation.attrib["name"] + qualifiers = annotation.get("qualifiers") + + params = parse_arguments(annotation) + + desc_element = annotation.find("description") + annotation_desc = None + if desc_element is not None: + annotation_desc = desc_element.text + + annotation_def = MethodDef(annotation_name, return_type, params, annotation_desc, qualifiers) + if annotation_name not in class_def.annotations: + class_def.annotations[annotation_name] = [] + + class_def.annotations[annotation_name].append(annotation_def) + signals = class_root.find("signals") if signals is not None: for signal in signals: @@ -706,7 +732,11 @@ def make_rst_class(class_def, state, dry_run, output_dir): # type: (ClassDef, S for value in e.values.values(): f.write(".. _class_{}_constant_{}:\n\n".format(class_name, value.name)) - f.write("enum **{}**:\n\n".format(e.name)) + if e.is_bitfield: + f.write("flags **{}**:\n\n".format(e.name)) + else: + f.write("enum **{}**:\n\n".format(e.name)) + for value in e.values.values(): f.write("- **{}** = **{}**".format(value.name, value.value)) if value.text is not None and value.text.strip() != "": @@ -732,6 +762,26 @@ def make_rst_class(class_def, state, dry_run, output_dir): # type: (ClassDef, S f.write("\n\n") + if len(class_def.annotations) > 0: + f.write(make_heading("Annotations", "-")) + index = 0 + + for method_list in class_def.annotations.values(): + for i, m in enumerate(method_list): + if index != 0: + f.write("----\n\n") + + if i == 0: + f.write(".. _class_{}_annotation_{}:\n\n".format(class_name, m.name.strip("@"))) + + ret_type, signature = make_method_signature(class_def, m, "", state) + f.write("- {} {}\n\n".format(ret_type, signature)) + + if m.description is not None and m.description.strip() != "": + f.write(rstize_text(m.description.strip(), state) + "\n\n") + + index += 1 + # Property descriptions if any(not p.overrides for p in class_def.properties.values()) > 0: f.write(make_heading("Property Descriptions", "-")) @@ -1065,6 +1115,11 @@ def rstize_text(text, state): # type: (str, State) -> str print_error('{}.xml: Unresolved signal "{}".'.format(state.current_class, param), state) ref_type = "_signal" + elif cmd.startswith("annotation"): + if method_param not in class_def.annotations: + print_error('{}.xml: Unresolved annotation "{}".'.format(state.current_class, param), state) + ref_type = "_annotation" + elif cmd.startswith("constant"): found = False diff --git a/doc/translations/ar.po b/doc/translations/ar.po index dcfbccb71c..b21374a37f 100644 --- a/doc/translations/ar.po +++ b/doc/translations/ar.po @@ -12308,10 +12308,12 @@ msgid "" msgstr "" #: doc/classes/Camera2D.xml doc/classes/ClippedCamera.xml +#: doc/classes/InterpolatedCamera.xml msgid "The camera updates with the [code]_physics_process[/code] callback." msgstr "" #: doc/classes/Camera2D.xml doc/classes/ClippedCamera.xml +#: doc/classes/InterpolatedCamera.xml msgid "The camera updates with the [code]_process[/code] callback." msgstr "" @@ -19607,13 +19609,17 @@ msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "Amount of extra bias for shadow splits that are far away. If self-shadowing " -"occurs only on the splits far away, increasing this value can fix them." +"occurs only on the splits far away, increasing this value can fix them. This " +"is ignored when [member directional_shadow_mode] is [constant " +"SHADOW_ORTHOGONAL]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "If [code]true[/code], shadow detail is sacrificed in exchange for smoother " -"transitions between splits." +"transitions between splits. Enabling shadow blend splitting also has a " +"moderate performance cost. This is ignored when [member " +"directional_shadow_mode] is [constant SHADOW_ORTHOGONAL]." msgstr "" #: doc/classes/DirectionalLight.xml @@ -19623,7 +19629,11 @@ msgid "" msgstr "" #: doc/classes/DirectionalLight.xml -msgid "The maximum distance for shadow splits." +msgid "" +"The maximum distance for shadow splits. Increasing this value will make " +"directional shadows visible from further away, at the cost of lower overall " +"shadow detail and performance (since more objects need to be included in the " +"directional shadow rendering)." msgstr "" #: doc/classes/DirectionalLight.xml @@ -19640,23 +19650,23 @@ msgstr "" msgid "" "The distance from camera to shadow split 1. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or " -"[code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_2_SPLITS] or [constant " +"SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "The distance from shadow split 1 to split 2. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or " -"[code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_2_SPLITS] or [constant " +"SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "The distance from shadow split 2 to split 3. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml @@ -30018,7 +30028,10 @@ msgid "" "input at the cost of increased CPU usage. In applications where drawing " "freehand lines is required, input accumulation should generally be disabled " "while the user is drawing the line to get results that closely follow the " -"actual input." +"actual input.\n" +"[b]Note:[/b] Input accumulation is [i]disabled[/i] by default for backward " +"compatibility reasons. It is however recommended to enable it for games " +"which don't require very reactive input, as this will decrease CPU usage." msgstr "" #: doc/classes/Input.xml @@ -30592,10 +30605,11 @@ msgstr "" msgid "" "Contains mouse and pen motion information. Supports relative, absolute " "positions and speed. See [method Node._input].\n" -"[b]Note:[/b] By default, this event is only emitted once per frame rendered " -"at most. If you need more precise input reporting, set [member Input." -"use_accumulated_input] to [code]false[/code] to make events emitted as often " -"as possible. If you use InputEventMouseMotion to draw lines, consider " +"[b]Note:[/b] By default, this event can be emitted multiple times per frame " +"rendered, allowing for precise input reporting, at the expense of CPU usage. " +"You can set [member Input.use_accumulated_input] to [code]true[/code] to let " +"multiple events merge into a single emitted event per frame.\n" +"[b]Note:[/b] If you use InputEventMouseMotion to draw lines, consider " "implementing [url=https://en.wikipedia.org/wiki/" "Bresenham%27s_line_algorithm]Bresenham's line algorithm[/url] as well to " "avoid visible gaps in lines if the user is moving the mouse quickly." @@ -30919,6 +30933,11 @@ msgstr "" #: doc/classes/InterpolatedCamera.xml msgid "" +"The camera's process callback. See [enum InterpolatedCameraProcessMode]." +msgstr "" + +#: doc/classes/InterpolatedCamera.xml +msgid "" "How quickly the camera moves toward its target. Higher values will result in " "tighter camera motion." msgstr "" @@ -36350,7 +36369,7 @@ msgid "" "maximum distance is exceeded, it recalculates the ideal path." msgstr "" -#: doc/classes/NavigationAgent.xml doc/classes/NavigationAgent2D.xml +#: doc/classes/NavigationAgent.xml msgid "" "The radius of the avoidance agent. This is the \"body\" of the avoidance " "agent and not the avoidance maneuver starting radius (which is controlled by " @@ -36463,6 +36482,14 @@ msgid "" "least one matching layer." msgstr "" +#: doc/classes/NavigationAgent2D.xml +msgid "" +"The radius of the avoidance agent. This is the \"body\" of the avoidance " +"agent and not the avoidance maneuver starting radius (which is controlled by " +"[member neighbor_dist]).\n" +"Does not affect normal pathfinding." +msgstr "" + #: doc/classes/NavigationMesh.xml msgid "A mesh to approximate the walkable areas and obstacles." msgstr "" @@ -50081,8 +50108,8 @@ msgstr "" #: doc/classes/ProjectSettings.xml msgid "" -"Size for shadow atlas (used for OmniLights and SpotLights). See " -"documentation." +"Size for shadow atlas (used for OmniLights and SpotLights). The value will " +"be rounded up to the nearest power of 2. See shadow mapping documentation." msgstr "" #: doc/classes/ProjectSettings.xml @@ -58455,7 +58482,31 @@ msgstr "" #: doc/classes/String.xml msgid "" "Formats the string by replacing all occurrences of [code]placeholder[/code] " -"with [code]values[/code]." +"with the elements of [code]values[/code].\n" +"[code]values[/code] can be a [Dictionary] or an [Array]. Any underscores in " +"[code]placeholder[/code] will be replaced with the corresponding keys in " +"advance. Array elements use their index as keys.\n" +"[codeblock]\n" +"# Prints: Waiting for Godot is a play by Samuel Beckett, and Godot Engine is " +"named after it.\n" +"var use_array_values = \"Waiting for {0} is a play by {1}, and {0} Engine is " +"named after it.\"\n" +"print(use_array_values.format([\"Godot\", \"Samuel Beckett\"]))\n" +"\n" +"# Prints: User 42 is Godot.\n" +"print(\"User {id} is {name}.\".format({\"id\": 42, \"name\": \"Godot\"}))\n" +"[/codeblock]\n" +"Some additional handling is performed when [code]values[/code] is an array. " +"If [code]placeholder[/code] does not contain an underscore, the elements of " +"the array will be used to replace one occurrence of the placeholder in turn; " +"If an array element is another 2-element array, it'll be interpreted as a " +"key-value pair.\n" +"[codeblock]\n" +"# Prints: User 42 is Godot.\n" +"print(\"User {} is {}.\".format([42, \"Godot\"], \"{}\"))\n" +"print(\"User {id} is {name}.\".format([[\"id\", 42], [\"name\", " +"\"Godot\"]]))\n" +"[/codeblock]" msgstr "" #: doc/classes/String.xml @@ -59052,9 +59103,11 @@ msgstr "" #: doc/classes/StyleBox.xml msgid "" -"Draws this stylebox using a [CanvasItem] with given [RID].\n" -"You can get a [RID] value using [method Object.get_instance_id] on a " -"[CanvasItem]-derived node." +"Draws this stylebox using a canvas item identified by the given [RID].\n" +"The [RID] value can either be the result of [method CanvasItem." +"get_canvas_item] called on an existing [CanvasItem]-derived node, or " +"directly from creating a canvas item in the [VisualServer] with [method " +"VisualServer.canvas_item_create]." msgstr "" #: doc/classes/StyleBox.xml @@ -60599,6 +60652,11 @@ msgid "If [code]true[/code], a right-click displays the context menu." msgstr "" #: doc/classes/TextEdit.xml +#, fuzzy +msgid "If [code]true[/code], allow drag and drop of selected text." +msgstr "يُرجع جيب التمام \"cosine \" لقيمة المَعلم." + +#: doc/classes/TextEdit.xml msgid "" "If [code]true[/code], the \"space\" character will have a visible " "representation." @@ -66687,9 +66745,10 @@ msgstr "" msgid "" "The shadow atlas' resolution (used for omni and spot lights). The value will " "be rounded up to the nearest power of 2.\n" -"[b]Note:[/b] If this is set to 0, shadows won't be visible. Since user-" -"created viewports default to a value of 0, this value must be set above 0 " -"manually." +"[b]Note:[/b] If this is set to [code]0[/code], both point [i]and[/i] " +"directional shadows won't be visible. Since user-created viewports default " +"to a value of [code]0[/code], this value must be set above [code]0[/code] " +"manually (typically at least [code]256[/code])." msgstr "" #: doc/classes/Viewport.xml @@ -66718,7 +66777,11 @@ msgid "" msgstr "" #: doc/classes/Viewport.xml -msgid "The rendering mode of viewport." +msgid "" +"The rendering mode of viewport.\n" +"[b]Note:[/b] If set to [constant USAGE_2D] or [constant " +"USAGE_2D_NO_SAMPLING], [member hdr] will have no effect when enabled since " +"HDR is not supported for 2D." msgstr "" #: doc/classes/Viewport.xml diff --git a/doc/translations/ca.po b/doc/translations/ca.po index 8576fd5bf3..0e33b91074 100644 --- a/doc/translations/ca.po +++ b/doc/translations/ca.po @@ -12252,10 +12252,12 @@ msgid "" msgstr "" #: doc/classes/Camera2D.xml doc/classes/ClippedCamera.xml +#: doc/classes/InterpolatedCamera.xml msgid "The camera updates with the [code]_physics_process[/code] callback." msgstr "" #: doc/classes/Camera2D.xml doc/classes/ClippedCamera.xml +#: doc/classes/InterpolatedCamera.xml msgid "The camera updates with the [code]_process[/code] callback." msgstr "" @@ -19537,13 +19539,17 @@ msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "Amount of extra bias for shadow splits that are far away. If self-shadowing " -"occurs only on the splits far away, increasing this value can fix them." +"occurs only on the splits far away, increasing this value can fix them. This " +"is ignored when [member directional_shadow_mode] is [constant " +"SHADOW_ORTHOGONAL]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "If [code]true[/code], shadow detail is sacrificed in exchange for smoother " -"transitions between splits." +"transitions between splits. Enabling shadow blend splitting also has a " +"moderate performance cost. This is ignored when [member " +"directional_shadow_mode] is [constant SHADOW_ORTHOGONAL]." msgstr "" #: doc/classes/DirectionalLight.xml @@ -19553,7 +19559,11 @@ msgid "" msgstr "" #: doc/classes/DirectionalLight.xml -msgid "The maximum distance for shadow splits." +msgid "" +"The maximum distance for shadow splits. Increasing this value will make " +"directional shadows visible from further away, at the cost of lower overall " +"shadow detail and performance (since more objects need to be included in the " +"directional shadow rendering)." msgstr "" #: doc/classes/DirectionalLight.xml @@ -19570,23 +19580,23 @@ msgstr "" msgid "" "The distance from camera to shadow split 1. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or " -"[code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_2_SPLITS] or [constant " +"SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "The distance from shadow split 1 to split 2. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or " -"[code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_2_SPLITS] or [constant " +"SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "The distance from shadow split 2 to split 3. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml @@ -29935,7 +29945,10 @@ msgid "" "input at the cost of increased CPU usage. In applications where drawing " "freehand lines is required, input accumulation should generally be disabled " "while the user is drawing the line to get results that closely follow the " -"actual input." +"actual input.\n" +"[b]Note:[/b] Input accumulation is [i]disabled[/i] by default for backward " +"compatibility reasons. It is however recommended to enable it for games " +"which don't require very reactive input, as this will decrease CPU usage." msgstr "" #: doc/classes/Input.xml @@ -30509,10 +30522,11 @@ msgstr "" msgid "" "Contains mouse and pen motion information. Supports relative, absolute " "positions and speed. See [method Node._input].\n" -"[b]Note:[/b] By default, this event is only emitted once per frame rendered " -"at most. If you need more precise input reporting, set [member Input." -"use_accumulated_input] to [code]false[/code] to make events emitted as often " -"as possible. If you use InputEventMouseMotion to draw lines, consider " +"[b]Note:[/b] By default, this event can be emitted multiple times per frame " +"rendered, allowing for precise input reporting, at the expense of CPU usage. " +"You can set [member Input.use_accumulated_input] to [code]true[/code] to let " +"multiple events merge into a single emitted event per frame.\n" +"[b]Note:[/b] If you use InputEventMouseMotion to draw lines, consider " "implementing [url=https://en.wikipedia.org/wiki/" "Bresenham%27s_line_algorithm]Bresenham's line algorithm[/url] as well to " "avoid visible gaps in lines if the user is moving the mouse quickly." @@ -30835,6 +30849,11 @@ msgstr "" #: doc/classes/InterpolatedCamera.xml msgid "" +"The camera's process callback. See [enum InterpolatedCameraProcessMode]." +msgstr "" + +#: doc/classes/InterpolatedCamera.xml +msgid "" "How quickly the camera moves toward its target. Higher values will result in " "tighter camera motion." msgstr "" @@ -36235,7 +36254,7 @@ msgid "" "maximum distance is exceeded, it recalculates the ideal path." msgstr "" -#: doc/classes/NavigationAgent.xml doc/classes/NavigationAgent2D.xml +#: doc/classes/NavigationAgent.xml msgid "" "The radius of the avoidance agent. This is the \"body\" of the avoidance " "agent and not the avoidance maneuver starting radius (which is controlled by " @@ -36346,6 +36365,14 @@ msgid "" "least one matching layer." msgstr "" +#: doc/classes/NavigationAgent2D.xml +msgid "" +"The radius of the avoidance agent. This is the \"body\" of the avoidance " +"agent and not the avoidance maneuver starting radius (which is controlled by " +"[member neighbor_dist]).\n" +"Does not affect normal pathfinding." +msgstr "" + #: doc/classes/NavigationMesh.xml msgid "A mesh to approximate the walkable areas and obstacles." msgstr "" @@ -49925,8 +49952,8 @@ msgstr "" #: doc/classes/ProjectSettings.xml msgid "" -"Size for shadow atlas (used for OmniLights and SpotLights). See " -"documentation." +"Size for shadow atlas (used for OmniLights and SpotLights). The value will " +"be rounded up to the nearest power of 2. See shadow mapping documentation." msgstr "" #: doc/classes/ProjectSettings.xml @@ -58295,7 +58322,31 @@ msgstr "" #: doc/classes/String.xml msgid "" "Formats the string by replacing all occurrences of [code]placeholder[/code] " -"with [code]values[/code]." +"with the elements of [code]values[/code].\n" +"[code]values[/code] can be a [Dictionary] or an [Array]. Any underscores in " +"[code]placeholder[/code] will be replaced with the corresponding keys in " +"advance. Array elements use their index as keys.\n" +"[codeblock]\n" +"# Prints: Waiting for Godot is a play by Samuel Beckett, and Godot Engine is " +"named after it.\n" +"var use_array_values = \"Waiting for {0} is a play by {1}, and {0} Engine is " +"named after it.\"\n" +"print(use_array_values.format([\"Godot\", \"Samuel Beckett\"]))\n" +"\n" +"# Prints: User 42 is Godot.\n" +"print(\"User {id} is {name}.\".format({\"id\": 42, \"name\": \"Godot\"}))\n" +"[/codeblock]\n" +"Some additional handling is performed when [code]values[/code] is an array. " +"If [code]placeholder[/code] does not contain an underscore, the elements of " +"the array will be used to replace one occurrence of the placeholder in turn; " +"If an array element is another 2-element array, it'll be interpreted as a " +"key-value pair.\n" +"[codeblock]\n" +"# Prints: User 42 is Godot.\n" +"print(\"User {} is {}.\".format([42, \"Godot\"], \"{}\"))\n" +"print(\"User {id} is {name}.\".format([[\"id\", 42], [\"name\", " +"\"Godot\"]]))\n" +"[/codeblock]" msgstr "" #: doc/classes/String.xml @@ -58892,9 +58943,11 @@ msgstr "" #: doc/classes/StyleBox.xml msgid "" -"Draws this stylebox using a [CanvasItem] with given [RID].\n" -"You can get a [RID] value using [method Object.get_instance_id] on a " -"[CanvasItem]-derived node." +"Draws this stylebox using a canvas item identified by the given [RID].\n" +"The [RID] value can either be the result of [method CanvasItem." +"get_canvas_item] called on an existing [CanvasItem]-derived node, or " +"directly from creating a canvas item in the [VisualServer] with [method " +"VisualServer.canvas_item_create]." msgstr "" #: doc/classes/StyleBox.xml @@ -60431,6 +60484,10 @@ msgid "If [code]true[/code], a right-click displays the context menu." msgstr "" #: doc/classes/TextEdit.xml +msgid "If [code]true[/code], allow drag and drop of selected text." +msgstr "" + +#: doc/classes/TextEdit.xml msgid "" "If [code]true[/code], the \"space\" character will have a visible " "representation." @@ -66505,9 +66562,10 @@ msgstr "" msgid "" "The shadow atlas' resolution (used for omni and spot lights). The value will " "be rounded up to the nearest power of 2.\n" -"[b]Note:[/b] If this is set to 0, shadows won't be visible. Since user-" -"created viewports default to a value of 0, this value must be set above 0 " -"manually." +"[b]Note:[/b] If this is set to [code]0[/code], both point [i]and[/i] " +"directional shadows won't be visible. Since user-created viewports default " +"to a value of [code]0[/code], this value must be set above [code]0[/code] " +"manually (typically at least [code]256[/code])." msgstr "" #: doc/classes/Viewport.xml @@ -66536,7 +66594,11 @@ msgid "" msgstr "" #: doc/classes/Viewport.xml -msgid "The rendering mode of viewport." +msgid "" +"The rendering mode of viewport.\n" +"[b]Note:[/b] If set to [constant USAGE_2D] or [constant " +"USAGE_2D_NO_SAMPLING], [member hdr] will have no effect when enabled since " +"HDR is not supported for 2D." msgstr "" #: doc/classes/Viewport.xml diff --git a/doc/translations/classes.pot b/doc/translations/classes.pot index dba0a87744..8d833031fe 100644 --- a/doc/translations/classes.pot +++ b/doc/translations/classes.pot @@ -12132,10 +12132,12 @@ msgid "" msgstr "" #: doc/classes/Camera2D.xml doc/classes/ClippedCamera.xml +#: doc/classes/InterpolatedCamera.xml msgid "The camera updates with the [code]_physics_process[/code] callback." msgstr "" #: doc/classes/Camera2D.xml doc/classes/ClippedCamera.xml +#: doc/classes/InterpolatedCamera.xml msgid "The camera updates with the [code]_process[/code] callback." msgstr "" @@ -19417,13 +19419,17 @@ msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "Amount of extra bias for shadow splits that are far away. If self-shadowing " -"occurs only on the splits far away, increasing this value can fix them." +"occurs only on the splits far away, increasing this value can fix them. This " +"is ignored when [member directional_shadow_mode] is [constant " +"SHADOW_ORTHOGONAL]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "If [code]true[/code], shadow detail is sacrificed in exchange for smoother " -"transitions between splits." +"transitions between splits. Enabling shadow blend splitting also has a " +"moderate performance cost. This is ignored when [member " +"directional_shadow_mode] is [constant SHADOW_ORTHOGONAL]." msgstr "" #: doc/classes/DirectionalLight.xml @@ -19433,7 +19439,11 @@ msgid "" msgstr "" #: doc/classes/DirectionalLight.xml -msgid "The maximum distance for shadow splits." +msgid "" +"The maximum distance for shadow splits. Increasing this value will make " +"directional shadows visible from further away, at the cost of lower overall " +"shadow detail and performance (since more objects need to be included in the " +"directional shadow rendering)." msgstr "" #: doc/classes/DirectionalLight.xml @@ -19450,23 +19460,23 @@ msgstr "" msgid "" "The distance from camera to shadow split 1. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or " -"[code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_2_SPLITS] or [constant " +"SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "The distance from shadow split 1 to split 2. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or " -"[code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_2_SPLITS] or [constant " +"SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "The distance from shadow split 2 to split 3. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml @@ -29812,7 +29822,10 @@ msgid "" "input at the cost of increased CPU usage. In applications where drawing " "freehand lines is required, input accumulation should generally be disabled " "while the user is drawing the line to get results that closely follow the " -"actual input." +"actual input.\n" +"[b]Note:[/b] Input accumulation is [i]disabled[/i] by default for backward " +"compatibility reasons. It is however recommended to enable it for games " +"which don't require very reactive input, as this will decrease CPU usage." msgstr "" #: doc/classes/Input.xml @@ -30386,10 +30399,11 @@ msgstr "" msgid "" "Contains mouse and pen motion information. Supports relative, absolute " "positions and speed. See [method Node._input].\n" -"[b]Note:[/b] By default, this event is only emitted once per frame rendered " -"at most. If you need more precise input reporting, set [member Input." -"use_accumulated_input] to [code]false[/code] to make events emitted as often " -"as possible. If you use InputEventMouseMotion to draw lines, consider " +"[b]Note:[/b] By default, this event can be emitted multiple times per frame " +"rendered, allowing for precise input reporting, at the expense of CPU usage. " +"You can set [member Input.use_accumulated_input] to [code]true[/code] to let " +"multiple events merge into a single emitted event per frame.\n" +"[b]Note:[/b] If you use InputEventMouseMotion to draw lines, consider " "implementing [url=https://en.wikipedia.org/wiki/" "Bresenham%27s_line_algorithm]Bresenham's line algorithm[/url] as well to " "avoid visible gaps in lines if the user is moving the mouse quickly." @@ -30712,6 +30726,11 @@ msgstr "" #: doc/classes/InterpolatedCamera.xml msgid "" +"The camera's process callback. See [enum InterpolatedCameraProcessMode]." +msgstr "" + +#: doc/classes/InterpolatedCamera.xml +msgid "" "How quickly the camera moves toward its target. Higher values will result in " "tighter camera motion." msgstr "" @@ -36112,7 +36131,7 @@ msgid "" "maximum distance is exceeded, it recalculates the ideal path." msgstr "" -#: doc/classes/NavigationAgent.xml doc/classes/NavigationAgent2D.xml +#: doc/classes/NavigationAgent.xml msgid "" "The radius of the avoidance agent. This is the \"body\" of the avoidance " "agent and not the avoidance maneuver starting radius (which is controlled by " @@ -36223,6 +36242,14 @@ msgid "" "least one matching layer." msgstr "" +#: doc/classes/NavigationAgent2D.xml +msgid "" +"The radius of the avoidance agent. This is the \"body\" of the avoidance " +"agent and not the avoidance maneuver starting radius (which is controlled by " +"[member neighbor_dist]).\n" +"Does not affect normal pathfinding." +msgstr "" + #: doc/classes/NavigationMesh.xml msgid "A mesh to approximate the walkable areas and obstacles." msgstr "" @@ -49802,8 +49829,8 @@ msgstr "" #: doc/classes/ProjectSettings.xml msgid "" -"Size for shadow atlas (used for OmniLights and SpotLights). See " -"documentation." +"Size for shadow atlas (used for OmniLights and SpotLights). The value will " +"be rounded up to the nearest power of 2. See shadow mapping documentation." msgstr "" #: doc/classes/ProjectSettings.xml @@ -58172,7 +58199,31 @@ msgstr "" #: doc/classes/String.xml msgid "" "Formats the string by replacing all occurrences of [code]placeholder[/code] " -"with [code]values[/code]." +"with the elements of [code]values[/code].\n" +"[code]values[/code] can be a [Dictionary] or an [Array]. Any underscores in " +"[code]placeholder[/code] will be replaced with the corresponding keys in " +"advance. Array elements use their index as keys.\n" +"[codeblock]\n" +"# Prints: Waiting for Godot is a play by Samuel Beckett, and Godot Engine is " +"named after it.\n" +"var use_array_values = \"Waiting for {0} is a play by {1}, and {0} Engine is " +"named after it.\"\n" +"print(use_array_values.format([\"Godot\", \"Samuel Beckett\"]))\n" +"\n" +"# Prints: User 42 is Godot.\n" +"print(\"User {id} is {name}.\".format({\"id\": 42, \"name\": \"Godot\"}))\n" +"[/codeblock]\n" +"Some additional handling is performed when [code]values[/code] is an array. " +"If [code]placeholder[/code] does not contain an underscore, the elements of " +"the array will be used to replace one occurrence of the placeholder in turn; " +"If an array element is another 2-element array, it'll be interpreted as a " +"key-value pair.\n" +"[codeblock]\n" +"# Prints: User 42 is Godot.\n" +"print(\"User {} is {}.\".format([42, \"Godot\"], \"{}\"))\n" +"print(\"User {id} is {name}.\".format([[\"id\", 42], [\"name\", " +"\"Godot\"]]))\n" +"[/codeblock]" msgstr "" #: doc/classes/String.xml @@ -58769,9 +58820,11 @@ msgstr "" #: doc/classes/StyleBox.xml msgid "" -"Draws this stylebox using a [CanvasItem] with given [RID].\n" -"You can get a [RID] value using [method Object.get_instance_id] on a " -"[CanvasItem]-derived node." +"Draws this stylebox using a canvas item identified by the given [RID].\n" +"The [RID] value can either be the result of [method CanvasItem." +"get_canvas_item] called on an existing [CanvasItem]-derived node, or " +"directly from creating a canvas item in the [VisualServer] with [method " +"VisualServer.canvas_item_create]." msgstr "" #: doc/classes/StyleBox.xml @@ -60308,6 +60361,10 @@ msgid "If [code]true[/code], a right-click displays the context menu." msgstr "" #: doc/classes/TextEdit.xml +msgid "If [code]true[/code], allow drag and drop of selected text." +msgstr "" + +#: doc/classes/TextEdit.xml msgid "" "If [code]true[/code], the \"space\" character will have a visible " "representation." @@ -66382,9 +66439,10 @@ msgstr "" msgid "" "The shadow atlas' resolution (used for omni and spot lights). The value will " "be rounded up to the nearest power of 2.\n" -"[b]Note:[/b] If this is set to 0, shadows won't be visible. Since user-" -"created viewports default to a value of 0, this value must be set above 0 " -"manually." +"[b]Note:[/b] If this is set to [code]0[/code], both point [i]and[/i] " +"directional shadows won't be visible. Since user-created viewports default " +"to a value of [code]0[/code], this value must be set above [code]0[/code] " +"manually (typically at least [code]256[/code])." msgstr "" #: doc/classes/Viewport.xml @@ -66413,7 +66471,11 @@ msgid "" msgstr "" #: doc/classes/Viewport.xml -msgid "The rendering mode of viewport." +msgid "" +"The rendering mode of viewport.\n" +"[b]Note:[/b] If set to [constant USAGE_2D] or [constant " +"USAGE_2D_NO_SAMPLING], [member hdr] will have no effect when enabled since " +"HDR is not supported for 2D." msgstr "" #: doc/classes/Viewport.xml diff --git a/doc/translations/cs.po b/doc/translations/cs.po index e6d0fc8c49..85a9d50b28 100644 --- a/doc/translations/cs.po +++ b/doc/translations/cs.po @@ -12653,10 +12653,12 @@ msgid "" msgstr "" #: doc/classes/Camera2D.xml doc/classes/ClippedCamera.xml +#: doc/classes/InterpolatedCamera.xml msgid "The camera updates with the [code]_physics_process[/code] callback." msgstr "" #: doc/classes/Camera2D.xml doc/classes/ClippedCamera.xml +#: doc/classes/InterpolatedCamera.xml msgid "The camera updates with the [code]_process[/code] callback." msgstr "" @@ -19985,13 +19987,17 @@ msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "Amount of extra bias for shadow splits that are far away. If self-shadowing " -"occurs only on the splits far away, increasing this value can fix them." +"occurs only on the splits far away, increasing this value can fix them. This " +"is ignored when [member directional_shadow_mode] is [constant " +"SHADOW_ORTHOGONAL]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "If [code]true[/code], shadow detail is sacrificed in exchange for smoother " -"transitions between splits." +"transitions between splits. Enabling shadow blend splitting also has a " +"moderate performance cost. This is ignored when [member " +"directional_shadow_mode] is [constant SHADOW_ORTHOGONAL]." msgstr "" #: doc/classes/DirectionalLight.xml @@ -20001,7 +20007,11 @@ msgid "" msgstr "" #: doc/classes/DirectionalLight.xml -msgid "The maximum distance for shadow splits." +msgid "" +"The maximum distance for shadow splits. Increasing this value will make " +"directional shadows visible from further away, at the cost of lower overall " +"shadow detail and performance (since more objects need to be included in the " +"directional shadow rendering)." msgstr "" #: doc/classes/DirectionalLight.xml @@ -20018,23 +20028,23 @@ msgstr "" msgid "" "The distance from camera to shadow split 1. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or " -"[code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_2_SPLITS] or [constant " +"SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "The distance from shadow split 1 to split 2. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or " -"[code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_2_SPLITS] or [constant " +"SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "The distance from shadow split 2 to split 3. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml @@ -30408,7 +30418,10 @@ msgid "" "input at the cost of increased CPU usage. In applications where drawing " "freehand lines is required, input accumulation should generally be disabled " "while the user is drawing the line to get results that closely follow the " -"actual input." +"actual input.\n" +"[b]Note:[/b] Input accumulation is [i]disabled[/i] by default for backward " +"compatibility reasons. It is however recommended to enable it for games " +"which don't require very reactive input, as this will decrease CPU usage." msgstr "" #: doc/classes/Input.xml @@ -30982,10 +30995,11 @@ msgstr "" msgid "" "Contains mouse and pen motion information. Supports relative, absolute " "positions and speed. See [method Node._input].\n" -"[b]Note:[/b] By default, this event is only emitted once per frame rendered " -"at most. If you need more precise input reporting, set [member Input." -"use_accumulated_input] to [code]false[/code] to make events emitted as often " -"as possible. If you use InputEventMouseMotion to draw lines, consider " +"[b]Note:[/b] By default, this event can be emitted multiple times per frame " +"rendered, allowing for precise input reporting, at the expense of CPU usage. " +"You can set [member Input.use_accumulated_input] to [code]true[/code] to let " +"multiple events merge into a single emitted event per frame.\n" +"[b]Note:[/b] If you use InputEventMouseMotion to draw lines, consider " "implementing [url=https://en.wikipedia.org/wiki/" "Bresenham%27s_line_algorithm]Bresenham's line algorithm[/url] as well to " "avoid visible gaps in lines if the user is moving the mouse quickly." @@ -31309,6 +31323,11 @@ msgstr "" #: doc/classes/InterpolatedCamera.xml msgid "" +"The camera's process callback. See [enum InterpolatedCameraProcessMode]." +msgstr "" + +#: doc/classes/InterpolatedCamera.xml +msgid "" "How quickly the camera moves toward its target. Higher values will result in " "tighter camera motion." msgstr "" @@ -36749,7 +36768,7 @@ msgid "" "maximum distance is exceeded, it recalculates the ideal path." msgstr "" -#: doc/classes/NavigationAgent.xml doc/classes/NavigationAgent2D.xml +#: doc/classes/NavigationAgent.xml msgid "" "The radius of the avoidance agent. This is the \"body\" of the avoidance " "agent and not the avoidance maneuver starting radius (which is controlled by " @@ -36862,6 +36881,14 @@ msgid "" "least one matching layer." msgstr "" +#: doc/classes/NavigationAgent2D.xml +msgid "" +"The radius of the avoidance agent. This is the \"body\" of the avoidance " +"agent and not the avoidance maneuver starting radius (which is controlled by " +"[member neighbor_dist]).\n" +"Does not affect normal pathfinding." +msgstr "" + #: doc/classes/NavigationMesh.xml msgid "A mesh to approximate the walkable areas and obstacles." msgstr "" @@ -50499,8 +50526,8 @@ msgstr "" #: doc/classes/ProjectSettings.xml msgid "" -"Size for shadow atlas (used for OmniLights and SpotLights). See " -"documentation." +"Size for shadow atlas (used for OmniLights and SpotLights). The value will " +"be rounded up to the nearest power of 2. See shadow mapping documentation." msgstr "" #: doc/classes/ProjectSettings.xml @@ -58889,7 +58916,31 @@ msgstr "" #: doc/classes/String.xml msgid "" "Formats the string by replacing all occurrences of [code]placeholder[/code] " -"with [code]values[/code]." +"with the elements of [code]values[/code].\n" +"[code]values[/code] can be a [Dictionary] or an [Array]. Any underscores in " +"[code]placeholder[/code] will be replaced with the corresponding keys in " +"advance. Array elements use their index as keys.\n" +"[codeblock]\n" +"# Prints: Waiting for Godot is a play by Samuel Beckett, and Godot Engine is " +"named after it.\n" +"var use_array_values = \"Waiting for {0} is a play by {1}, and {0} Engine is " +"named after it.\"\n" +"print(use_array_values.format([\"Godot\", \"Samuel Beckett\"]))\n" +"\n" +"# Prints: User 42 is Godot.\n" +"print(\"User {id} is {name}.\".format({\"id\": 42, \"name\": \"Godot\"}))\n" +"[/codeblock]\n" +"Some additional handling is performed when [code]values[/code] is an array. " +"If [code]placeholder[/code] does not contain an underscore, the elements of " +"the array will be used to replace one occurrence of the placeholder in turn; " +"If an array element is another 2-element array, it'll be interpreted as a " +"key-value pair.\n" +"[codeblock]\n" +"# Prints: User 42 is Godot.\n" +"print(\"User {} is {}.\".format([42, \"Godot\"], \"{}\"))\n" +"print(\"User {id} is {name}.\".format([[\"id\", 42], [\"name\", " +"\"Godot\"]]))\n" +"[/codeblock]" msgstr "" #: doc/classes/String.xml @@ -59486,9 +59537,11 @@ msgstr "" #: doc/classes/StyleBox.xml msgid "" -"Draws this stylebox using a [CanvasItem] with given [RID].\n" -"You can get a [RID] value using [method Object.get_instance_id] on a " -"[CanvasItem]-derived node." +"Draws this stylebox using a canvas item identified by the given [RID].\n" +"The [RID] value can either be the result of [method CanvasItem." +"get_canvas_item] called on an existing [CanvasItem]-derived node, or " +"directly from creating a canvas item in the [VisualServer] with [method " +"VisualServer.canvas_item_create]." msgstr "" #: doc/classes/StyleBox.xml @@ -61043,6 +61096,11 @@ msgid "If [code]true[/code], a right-click displays the context menu." msgstr "" #: doc/classes/TextEdit.xml +#, fuzzy +msgid "If [code]true[/code], allow drag and drop of selected text." +msgstr "Vrátí [code] true [/code], pokud je vektor normalizován, jinak false." + +#: doc/classes/TextEdit.xml msgid "" "If [code]true[/code], the \"space\" character will have a visible " "representation." @@ -67164,9 +67222,10 @@ msgstr "" msgid "" "The shadow atlas' resolution (used for omni and spot lights). The value will " "be rounded up to the nearest power of 2.\n" -"[b]Note:[/b] If this is set to 0, shadows won't be visible. Since user-" -"created viewports default to a value of 0, this value must be set above 0 " -"manually." +"[b]Note:[/b] If this is set to [code]0[/code], both point [i]and[/i] " +"directional shadows won't be visible. Since user-created viewports default " +"to a value of [code]0[/code], this value must be set above [code]0[/code] " +"manually (typically at least [code]256[/code])." msgstr "" #: doc/classes/Viewport.xml @@ -67195,7 +67254,11 @@ msgid "" msgstr "" #: doc/classes/Viewport.xml -msgid "The rendering mode of viewport." +msgid "" +"The rendering mode of viewport.\n" +"[b]Note:[/b] If set to [constant USAGE_2D] or [constant " +"USAGE_2D_NO_SAMPLING], [member hdr] will have no effect when enabled since " +"HDR is not supported for 2D." msgstr "" #: doc/classes/Viewport.xml diff --git a/doc/translations/de.po b/doc/translations/de.po index 14a4d14da6..ae8d8f2165 100644 --- a/doc/translations/de.po +++ b/doc/translations/de.po @@ -14222,10 +14222,12 @@ msgid "" msgstr "" #: doc/classes/Camera2D.xml doc/classes/ClippedCamera.xml +#: doc/classes/InterpolatedCamera.xml msgid "The camera updates with the [code]_physics_process[/code] callback." msgstr "" #: doc/classes/Camera2D.xml doc/classes/ClippedCamera.xml +#: doc/classes/InterpolatedCamera.xml msgid "The camera updates with the [code]_process[/code] callback." msgstr "" @@ -21703,13 +21705,17 @@ msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "Amount of extra bias for shadow splits that are far away. If self-shadowing " -"occurs only on the splits far away, increasing this value can fix them." +"occurs only on the splits far away, increasing this value can fix them. This " +"is ignored when [member directional_shadow_mode] is [constant " +"SHADOW_ORTHOGONAL]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "If [code]true[/code], shadow detail is sacrificed in exchange for smoother " -"transitions between splits." +"transitions between splits. Enabling shadow blend splitting also has a " +"moderate performance cost. This is ignored when [member " +"directional_shadow_mode] is [constant SHADOW_ORTHOGONAL]." msgstr "" #: doc/classes/DirectionalLight.xml @@ -21719,7 +21725,11 @@ msgid "" msgstr "" #: doc/classes/DirectionalLight.xml -msgid "The maximum distance for shadow splits." +msgid "" +"The maximum distance for shadow splits. Increasing this value will make " +"directional shadows visible from further away, at the cost of lower overall " +"shadow detail and performance (since more objects need to be included in the " +"directional shadow rendering)." msgstr "" #: doc/classes/DirectionalLight.xml @@ -21736,23 +21746,23 @@ msgstr "" msgid "" "The distance from camera to shadow split 1. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or " -"[code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_2_SPLITS] or [constant " +"SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "The distance from shadow split 1 to split 2. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or " -"[code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_2_SPLITS] or [constant " +"SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "The distance from shadow split 2 to split 3. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml @@ -32199,7 +32209,10 @@ msgid "" "input at the cost of increased CPU usage. In applications where drawing " "freehand lines is required, input accumulation should generally be disabled " "while the user is drawing the line to get results that closely follow the " -"actual input." +"actual input.\n" +"[b]Note:[/b] Input accumulation is [i]disabled[/i] by default for backward " +"compatibility reasons. It is however recommended to enable it for games " +"which don't require very reactive input, as this will decrease CPU usage." msgstr "" #: doc/classes/Input.xml @@ -32773,10 +32786,11 @@ msgstr "" msgid "" "Contains mouse and pen motion information. Supports relative, absolute " "positions and speed. See [method Node._input].\n" -"[b]Note:[/b] By default, this event is only emitted once per frame rendered " -"at most. If you need more precise input reporting, set [member Input." -"use_accumulated_input] to [code]false[/code] to make events emitted as often " -"as possible. If you use InputEventMouseMotion to draw lines, consider " +"[b]Note:[/b] By default, this event can be emitted multiple times per frame " +"rendered, allowing for precise input reporting, at the expense of CPU usage. " +"You can set [member Input.use_accumulated_input] to [code]true[/code] to let " +"multiple events merge into a single emitted event per frame.\n" +"[b]Note:[/b] If you use InputEventMouseMotion to draw lines, consider " "implementing [url=https://en.wikipedia.org/wiki/" "Bresenham%27s_line_algorithm]Bresenham's line algorithm[/url] as well to " "avoid visible gaps in lines if the user is moving the mouse quickly." @@ -33104,6 +33118,11 @@ msgstr "" #: doc/classes/InterpolatedCamera.xml msgid "" +"The camera's process callback. See [enum InterpolatedCameraProcessMode]." +msgstr "" + +#: doc/classes/InterpolatedCamera.xml +msgid "" "How quickly the camera moves toward its target. Higher values will result in " "tighter camera motion." msgstr "" @@ -38619,7 +38638,7 @@ msgid "" "maximum distance is exceeded, it recalculates the ideal path." msgstr "" -#: doc/classes/NavigationAgent.xml doc/classes/NavigationAgent2D.xml +#: doc/classes/NavigationAgent.xml msgid "" "The radius of the avoidance agent. This is the \"body\" of the avoidance " "agent and not the avoidance maneuver starting radius (which is controlled by " @@ -38734,6 +38753,14 @@ msgid "" "least one matching layer." msgstr "" +#: doc/classes/NavigationAgent2D.xml +msgid "" +"The radius of the avoidance agent. This is the \"body\" of the avoidance " +"agent and not the avoidance maneuver starting radius (which is controlled by " +"[member neighbor_dist]).\n" +"Does not affect normal pathfinding." +msgstr "" + #: doc/classes/NavigationMesh.xml msgid "A mesh to approximate the walkable areas and obstacles." msgstr "" @@ -52484,8 +52511,8 @@ msgstr "" #: doc/classes/ProjectSettings.xml msgid "" -"Size for shadow atlas (used for OmniLights and SpotLights). See " -"documentation." +"Size for shadow atlas (used for OmniLights and SpotLights). The value will " +"be rounded up to the nearest power of 2. See shadow mapping documentation." msgstr "" #: doc/classes/ProjectSettings.xml @@ -60981,7 +61008,31 @@ msgstr "" #: doc/classes/String.xml msgid "" "Formats the string by replacing all occurrences of [code]placeholder[/code] " -"with [code]values[/code]." +"with the elements of [code]values[/code].\n" +"[code]values[/code] can be a [Dictionary] or an [Array]. Any underscores in " +"[code]placeholder[/code] will be replaced with the corresponding keys in " +"advance. Array elements use their index as keys.\n" +"[codeblock]\n" +"# Prints: Waiting for Godot is a play by Samuel Beckett, and Godot Engine is " +"named after it.\n" +"var use_array_values = \"Waiting for {0} is a play by {1}, and {0} Engine is " +"named after it.\"\n" +"print(use_array_values.format([\"Godot\", \"Samuel Beckett\"]))\n" +"\n" +"# Prints: User 42 is Godot.\n" +"print(\"User {id} is {name}.\".format({\"id\": 42, \"name\": \"Godot\"}))\n" +"[/codeblock]\n" +"Some additional handling is performed when [code]values[/code] is an array. " +"If [code]placeholder[/code] does not contain an underscore, the elements of " +"the array will be used to replace one occurrence of the placeholder in turn; " +"If an array element is another 2-element array, it'll be interpreted as a " +"key-value pair.\n" +"[codeblock]\n" +"# Prints: User 42 is Godot.\n" +"print(\"User {} is {}.\".format([42, \"Godot\"], \"{}\"))\n" +"print(\"User {id} is {name}.\".format([[\"id\", 42], [\"name\", " +"\"Godot\"]]))\n" +"[/codeblock]" msgstr "" #: doc/classes/String.xml @@ -61582,9 +61633,11 @@ msgstr "" #: doc/classes/StyleBox.xml msgid "" -"Draws this stylebox using a [CanvasItem] with given [RID].\n" -"You can get a [RID] value using [method Object.get_instance_id] on a " -"[CanvasItem]-derived node." +"Draws this stylebox using a canvas item identified by the given [RID].\n" +"The [RID] value can either be the result of [method CanvasItem." +"get_canvas_item] called on an existing [CanvasItem]-derived node, or " +"directly from creating a canvas item in the [VisualServer] with [method " +"VisualServer.canvas_item_create]." msgstr "" #: doc/classes/StyleBox.xml @@ -63158,6 +63211,11 @@ msgid "If [code]true[/code], a right-click displays the context menu." msgstr "" #: doc/classes/TextEdit.xml +#, fuzzy +msgid "If [code]true[/code], allow drag and drop of selected text." +msgstr "Wenn [code]true[/code], wird die Textur zentriert." + +#: doc/classes/TextEdit.xml msgid "" "If [code]true[/code], the \"space\" character will have a visible " "representation." @@ -69471,9 +69529,10 @@ msgstr "" msgid "" "The shadow atlas' resolution (used for omni and spot lights). The value will " "be rounded up to the nearest power of 2.\n" -"[b]Note:[/b] If this is set to 0, shadows won't be visible. Since user-" -"created viewports default to a value of 0, this value must be set above 0 " -"manually." +"[b]Note:[/b] If this is set to [code]0[/code], both point [i]and[/i] " +"directional shadows won't be visible. Since user-created viewports default " +"to a value of [code]0[/code], this value must be set above [code]0[/code] " +"manually (typically at least [code]256[/code])." msgstr "" #: doc/classes/Viewport.xml @@ -69505,7 +69564,11 @@ msgid "" msgstr "" #: doc/classes/Viewport.xml -msgid "The rendering mode of viewport." +msgid "" +"The rendering mode of viewport.\n" +"[b]Note:[/b] If set to [constant USAGE_2D] or [constant " +"USAGE_2D_NO_SAMPLING], [member hdr] will have no effect when enabled since " +"HDR is not supported for 2D." msgstr "" #: doc/classes/Viewport.xml diff --git a/doc/translations/el.po b/doc/translations/el.po index 782205fcfa..d3cbf69925 100644 --- a/doc/translations/el.po +++ b/doc/translations/el.po @@ -12152,10 +12152,12 @@ msgid "" msgstr "" #: doc/classes/Camera2D.xml doc/classes/ClippedCamera.xml +#: doc/classes/InterpolatedCamera.xml msgid "The camera updates with the [code]_physics_process[/code] callback." msgstr "" #: doc/classes/Camera2D.xml doc/classes/ClippedCamera.xml +#: doc/classes/InterpolatedCamera.xml msgid "The camera updates with the [code]_process[/code] callback." msgstr "" @@ -19452,13 +19454,17 @@ msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "Amount of extra bias for shadow splits that are far away. If self-shadowing " -"occurs only on the splits far away, increasing this value can fix them." +"occurs only on the splits far away, increasing this value can fix them. This " +"is ignored when [member directional_shadow_mode] is [constant " +"SHADOW_ORTHOGONAL]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "If [code]true[/code], shadow detail is sacrificed in exchange for smoother " -"transitions between splits." +"transitions between splits. Enabling shadow blend splitting also has a " +"moderate performance cost. This is ignored when [member " +"directional_shadow_mode] is [constant SHADOW_ORTHOGONAL]." msgstr "" #: doc/classes/DirectionalLight.xml @@ -19468,7 +19474,11 @@ msgid "" msgstr "" #: doc/classes/DirectionalLight.xml -msgid "The maximum distance for shadow splits." +msgid "" +"The maximum distance for shadow splits. Increasing this value will make " +"directional shadows visible from further away, at the cost of lower overall " +"shadow detail and performance (since more objects need to be included in the " +"directional shadow rendering)." msgstr "" #: doc/classes/DirectionalLight.xml @@ -19485,23 +19495,23 @@ msgstr "" msgid "" "The distance from camera to shadow split 1. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or " -"[code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_2_SPLITS] or [constant " +"SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "The distance from shadow split 1 to split 2. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or " -"[code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_2_SPLITS] or [constant " +"SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "The distance from shadow split 2 to split 3. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml @@ -29863,7 +29873,10 @@ msgid "" "input at the cost of increased CPU usage. In applications where drawing " "freehand lines is required, input accumulation should generally be disabled " "while the user is drawing the line to get results that closely follow the " -"actual input." +"actual input.\n" +"[b]Note:[/b] Input accumulation is [i]disabled[/i] by default for backward " +"compatibility reasons. It is however recommended to enable it for games " +"which don't require very reactive input, as this will decrease CPU usage." msgstr "" #: doc/classes/Input.xml @@ -30437,10 +30450,11 @@ msgstr "" msgid "" "Contains mouse and pen motion information. Supports relative, absolute " "positions and speed. See [method Node._input].\n" -"[b]Note:[/b] By default, this event is only emitted once per frame rendered " -"at most. If you need more precise input reporting, set [member Input." -"use_accumulated_input] to [code]false[/code] to make events emitted as often " -"as possible. If you use InputEventMouseMotion to draw lines, consider " +"[b]Note:[/b] By default, this event can be emitted multiple times per frame " +"rendered, allowing for precise input reporting, at the expense of CPU usage. " +"You can set [member Input.use_accumulated_input] to [code]true[/code] to let " +"multiple events merge into a single emitted event per frame.\n" +"[b]Note:[/b] If you use InputEventMouseMotion to draw lines, consider " "implementing [url=https://en.wikipedia.org/wiki/" "Bresenham%27s_line_algorithm]Bresenham's line algorithm[/url] as well to " "avoid visible gaps in lines if the user is moving the mouse quickly." @@ -30764,6 +30778,11 @@ msgstr "" #: doc/classes/InterpolatedCamera.xml msgid "" +"The camera's process callback. See [enum InterpolatedCameraProcessMode]." +msgstr "" + +#: doc/classes/InterpolatedCamera.xml +msgid "" "How quickly the camera moves toward its target. Higher values will result in " "tighter camera motion." msgstr "" @@ -36189,7 +36208,7 @@ msgid "" "maximum distance is exceeded, it recalculates the ideal path." msgstr "" -#: doc/classes/NavigationAgent.xml doc/classes/NavigationAgent2D.xml +#: doc/classes/NavigationAgent.xml msgid "" "The radius of the avoidance agent. This is the \"body\" of the avoidance " "agent and not the avoidance maneuver starting radius (which is controlled by " @@ -36302,6 +36321,14 @@ msgid "" "least one matching layer." msgstr "" +#: doc/classes/NavigationAgent2D.xml +msgid "" +"The radius of the avoidance agent. This is the \"body\" of the avoidance " +"agent and not the avoidance maneuver starting radius (which is controlled by " +"[member neighbor_dist]).\n" +"Does not affect normal pathfinding." +msgstr "" + #: doc/classes/NavigationMesh.xml msgid "A mesh to approximate the walkable areas and obstacles." msgstr "" @@ -49907,8 +49934,8 @@ msgstr "" #: doc/classes/ProjectSettings.xml msgid "" -"Size for shadow atlas (used for OmniLights and SpotLights). See " -"documentation." +"Size for shadow atlas (used for OmniLights and SpotLights). The value will " +"be rounded up to the nearest power of 2. See shadow mapping documentation." msgstr "" #: doc/classes/ProjectSettings.xml @@ -58281,7 +58308,31 @@ msgstr "" #: doc/classes/String.xml msgid "" "Formats the string by replacing all occurrences of [code]placeholder[/code] " -"with [code]values[/code]." +"with the elements of [code]values[/code].\n" +"[code]values[/code] can be a [Dictionary] or an [Array]. Any underscores in " +"[code]placeholder[/code] will be replaced with the corresponding keys in " +"advance. Array elements use their index as keys.\n" +"[codeblock]\n" +"# Prints: Waiting for Godot is a play by Samuel Beckett, and Godot Engine is " +"named after it.\n" +"var use_array_values = \"Waiting for {0} is a play by {1}, and {0} Engine is " +"named after it.\"\n" +"print(use_array_values.format([\"Godot\", \"Samuel Beckett\"]))\n" +"\n" +"# Prints: User 42 is Godot.\n" +"print(\"User {id} is {name}.\".format({\"id\": 42, \"name\": \"Godot\"}))\n" +"[/codeblock]\n" +"Some additional handling is performed when [code]values[/code] is an array. " +"If [code]placeholder[/code] does not contain an underscore, the elements of " +"the array will be used to replace one occurrence of the placeholder in turn; " +"If an array element is another 2-element array, it'll be interpreted as a " +"key-value pair.\n" +"[codeblock]\n" +"# Prints: User 42 is Godot.\n" +"print(\"User {} is {}.\".format([42, \"Godot\"], \"{}\"))\n" +"print(\"User {id} is {name}.\".format([[\"id\", 42], [\"name\", " +"\"Godot\"]]))\n" +"[/codeblock]" msgstr "" #: doc/classes/String.xml @@ -58878,9 +58929,11 @@ msgstr "" #: doc/classes/StyleBox.xml msgid "" -"Draws this stylebox using a [CanvasItem] with given [RID].\n" -"You can get a [RID] value using [method Object.get_instance_id] on a " -"[CanvasItem]-derived node." +"Draws this stylebox using a canvas item identified by the given [RID].\n" +"The [RID] value can either be the result of [method CanvasItem." +"get_canvas_item] called on an existing [CanvasItem]-derived node, or " +"directly from creating a canvas item in the [VisualServer] with [method " +"VisualServer.canvas_item_create]." msgstr "" #: doc/classes/StyleBox.xml @@ -60425,6 +60478,11 @@ msgid "If [code]true[/code], a right-click displays the context menu." msgstr "" #: doc/classes/TextEdit.xml +#, fuzzy +msgid "If [code]true[/code], allow drag and drop of selected text." +msgstr "Επιστρέφει το συνημίτονο της παραμέτρου." + +#: doc/classes/TextEdit.xml msgid "" "If [code]true[/code], the \"space\" character will have a visible " "representation." @@ -66513,9 +66571,10 @@ msgstr "" msgid "" "The shadow atlas' resolution (used for omni and spot lights). The value will " "be rounded up to the nearest power of 2.\n" -"[b]Note:[/b] If this is set to 0, shadows won't be visible. Since user-" -"created viewports default to a value of 0, this value must be set above 0 " -"manually." +"[b]Note:[/b] If this is set to [code]0[/code], both point [i]and[/i] " +"directional shadows won't be visible. Since user-created viewports default " +"to a value of [code]0[/code], this value must be set above [code]0[/code] " +"manually (typically at least [code]256[/code])." msgstr "" #: doc/classes/Viewport.xml @@ -66544,7 +66603,11 @@ msgid "" msgstr "" #: doc/classes/Viewport.xml -msgid "The rendering mode of viewport." +msgid "" +"The rendering mode of viewport.\n" +"[b]Note:[/b] If set to [constant USAGE_2D] or [constant " +"USAGE_2D_NO_SAMPLING], [member hdr] will have no effect when enabled since " +"HDR is not supported for 2D." msgstr "" #: doc/classes/Viewport.xml diff --git a/doc/translations/es.po b/doc/translations/es.po index 242710fe39..e38eb521c0 100644 --- a/doc/translations/es.po +++ b/doc/translations/es.po @@ -15915,10 +15915,12 @@ msgstr "" "horizontales y el tamaño de la pantalla." #: doc/classes/Camera2D.xml doc/classes/ClippedCamera.xml +#: doc/classes/InterpolatedCamera.xml msgid "The camera updates with the [code]_physics_process[/code] callback." msgstr "La cámara se actualiza con la llamada [code]_physics_process[/code]." #: doc/classes/Camera2D.xml doc/classes/ClippedCamera.xml +#: doc/classes/InterpolatedCamera.xml msgid "The camera updates with the [code]_process[/code] callback." msgstr "La cámara se actualiza con la llamada de [code]_process[/code]." @@ -25571,16 +25573,18 @@ msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "Amount of extra bias for shadow splits that are far away. If self-shadowing " -"occurs only on the splits far away, increasing this value can fix them." +"occurs only on the splits far away, increasing this value can fix them. This " +"is ignored when [member directional_shadow_mode] is [constant " +"SHADOW_ORTHOGONAL]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "If [code]true[/code], shadow detail is sacrificed in exchange for smoother " -"transitions between splits." +"transitions between splits. Enabling shadow blend splitting also has a " +"moderate performance cost. This is ignored when [member " +"directional_shadow_mode] is [constant SHADOW_ORTHOGONAL]." msgstr "" -"Si [code]true[/code], el detalle de la sombra se sacrifica a cambio de " -"transiciones más suaves entre las divisiones." #: doc/classes/DirectionalLight.xml msgid "" @@ -25591,8 +25595,12 @@ msgstr "" "movimiento. Ver [enum ShadowDepthRange]." #: doc/classes/DirectionalLight.xml -msgid "The maximum distance for shadow splits." -msgstr "La distancia máxima para las divisiones de la sombra." +msgid "" +"The maximum distance for shadow splits. Increasing this value will make " +"directional shadows visible from further away, at the cost of lower overall " +"shadow detail and performance (since more objects need to be included in the " +"directional shadow rendering)." +msgstr "" #: doc/classes/DirectionalLight.xml msgid "The light's shadow rendering algorithm. See [enum ShadowMode]." @@ -25606,11 +25614,12 @@ msgid "" msgstr "" #: doc/classes/DirectionalLight.xml +#, fuzzy msgid "" "The distance from camera to shadow split 1. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or " -"[code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_2_SPLITS] or [constant " +"SHADOW_PARALLEL_4_SPLITS]." msgstr "" "La distancia de la cámara a la sombra se divide en 1. Relativo a [member " "directional_shadow_max_distance]. Sólo se utiliza cuando [member " @@ -25618,11 +25627,12 @@ msgstr "" "[code]SHADOW_PARALLEL_4_SPLITS[/code]." #: doc/classes/DirectionalLight.xml +#, fuzzy msgid "" "The distance from shadow split 1 to split 2. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or " -"[code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_2_SPLITS] or [constant " +"SHADOW_PARALLEL_4_SPLITS]." msgstr "" "La distancia de la sombra se divide en dos. Relativo a [member " "directional_shadow_max_distance]. Sólo se utiliza cuando [member " @@ -25630,10 +25640,11 @@ msgstr "" "[code]SHADOW_PARALLEL_4_SPLITS[/code]." #: doc/classes/DirectionalLight.xml +#, fuzzy msgid "" "The distance from shadow split 2 to split 3. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_4_SPLITS]." msgstr "" "La distancia de la sombra se divide en dos y tres. Relativo a [member " "directional_shadow_max_distance]. Sólo se usa cuando [member " @@ -39542,7 +39553,10 @@ msgid "" "input at the cost of increased CPU usage. In applications where drawing " "freehand lines is required, input accumulation should generally be disabled " "while the user is drawing the line to get results that closely follow the " -"actual input." +"actual input.\n" +"[b]Note:[/b] Input accumulation is [i]disabled[/i] by default for backward " +"compatibility reasons. It is however recommended to enable it for games " +"which don't require very reactive input, as this will decrease CPU usage." msgstr "" "Habilita o deshabilita la acumulación de eventos de entrada similares " "enviados por el sistema operativo. Cuando la acumulación de entrada está " @@ -40301,10 +40315,11 @@ msgstr "Tipo de evento de entrada para los eventos de movimiento del ratón." msgid "" "Contains mouse and pen motion information. Supports relative, absolute " "positions and speed. See [method Node._input].\n" -"[b]Note:[/b] By default, this event is only emitted once per frame rendered " -"at most. If you need more precise input reporting, set [member Input." -"use_accumulated_input] to [code]false[/code] to make events emitted as often " -"as possible. If you use InputEventMouseMotion to draw lines, consider " +"[b]Note:[/b] By default, this event can be emitted multiple times per frame " +"rendered, allowing for precise input reporting, at the expense of CPU usage. " +"You can set [member Input.use_accumulated_input] to [code]true[/code] to let " +"multiple events merge into a single emitted event per frame.\n" +"[b]Note:[/b] If you use InputEventMouseMotion to draw lines, consider " "implementing [url=https://en.wikipedia.org/wiki/" "Bresenham%27s_line_algorithm]Bresenham's line algorithm[/url] as well to " "avoid visible gaps in lines if the user is moving the mouse quickly." @@ -40745,6 +40760,12 @@ msgstr "" "automáticamente el nuevo contenido." #: doc/classes/InterpolatedCamera.xml +#, fuzzy +msgid "" +"The camera's process callback. See [enum InterpolatedCameraProcessMode]." +msgstr "La llamada al proceso de la cámara. Ver [enum Camera2DProcessMode]." + +#: doc/classes/InterpolatedCamera.xml msgid "" "How quickly the camera moves toward its target. Higher values will result in " "tighter camera motion." @@ -47706,7 +47727,7 @@ msgid "" "maximum distance is exceeded, it recalculates the ideal path." msgstr "" -#: doc/classes/NavigationAgent.xml doc/classes/NavigationAgent2D.xml +#: doc/classes/NavigationAgent.xml msgid "" "The radius of the avoidance agent. This is the \"body\" of the avoidance " "agent and not the avoidance maneuver starting radius (which is controlled by " @@ -47821,6 +47842,14 @@ msgid "" "least one matching layer." msgstr "" +#: doc/classes/NavigationAgent2D.xml +msgid "" +"The radius of the avoidance agent. This is the \"body\" of the avoidance " +"agent and not the avoidance maneuver starting radius (which is controlled by " +"[member neighbor_dist]).\n" +"Does not affect normal pathfinding." +msgstr "" + #: doc/classes/NavigationMesh.xml msgid "A mesh to approximate the walkable areas and obstacles." msgstr "" @@ -65718,12 +65747,13 @@ msgstr "" "documentación del mapeo de sombras." #: doc/classes/ProjectSettings.xml +#, fuzzy msgid "" -"Size for shadow atlas (used for OmniLights and SpotLights). See " -"documentation." +"Size for shadow atlas (used for OmniLights and SpotLights). The value will " +"be rounded up to the nearest power of 2. See shadow mapping documentation." msgstr "" -"Tamaño para el atlas de sombras (usado para OmniLights y SpotLights). Vea la " -"documentación." +"Establece el tamaño de las imágenes del atlas de sombras (usado para omni y " +"focos). El valor se redondeará a la potencia más cercana de 2." #: doc/classes/ProjectSettings.xml msgid "" @@ -76413,10 +76443,32 @@ msgstr "" #: doc/classes/String.xml msgid "" "Formats the string by replacing all occurrences of [code]placeholder[/code] " -"with [code]values[/code]." +"with the elements of [code]values[/code].\n" +"[code]values[/code] can be a [Dictionary] or an [Array]. Any underscores in " +"[code]placeholder[/code] will be replaced with the corresponding keys in " +"advance. Array elements use their index as keys.\n" +"[codeblock]\n" +"# Prints: Waiting for Godot is a play by Samuel Beckett, and Godot Engine is " +"named after it.\n" +"var use_array_values = \"Waiting for {0} is a play by {1}, and {0} Engine is " +"named after it.\"\n" +"print(use_array_values.format([\"Godot\", \"Samuel Beckett\"]))\n" +"\n" +"# Prints: User 42 is Godot.\n" +"print(\"User {id} is {name}.\".format({\"id\": 42, \"name\": \"Godot\"}))\n" +"[/codeblock]\n" +"Some additional handling is performed when [code]values[/code] is an array. " +"If [code]placeholder[/code] does not contain an underscore, the elements of " +"the array will be used to replace one occurrence of the placeholder in turn; " +"If an array element is another 2-element array, it'll be interpreted as a " +"key-value pair.\n" +"[codeblock]\n" +"# Prints: User 42 is Godot.\n" +"print(\"User {} is {}.\".format([42, \"Godot\"], \"{}\"))\n" +"print(\"User {id} is {name}.\".format([[\"id\", 42], [\"name\", " +"\"Godot\"]]))\n" +"[/codeblock]" msgstr "" -"Formatea la string reemplazando todas las ocurrencias de [code]placeholder[/" -"code] por [code]values[/code]." #: doc/classes/String.xml msgid "If the string is a valid file path, returns the base directory name." @@ -77186,13 +77238,12 @@ msgstr "" #: doc/classes/StyleBox.xml msgid "" -"Draws this stylebox using a [CanvasItem] with given [RID].\n" -"You can get a [RID] value using [method Object.get_instance_id] on a " -"[CanvasItem]-derived node." +"Draws this stylebox using a canvas item identified by the given [RID].\n" +"The [RID] value can either be the result of [method CanvasItem." +"get_canvas_item] called on an existing [CanvasItem]-derived node, or " +"directly from creating a canvas item in the [VisualServer] with [method " +"VisualServer.canvas_item_create]." msgstr "" -"Dibuja este cuadro de estilo usando un [CanvasItem] con un [RID] dado.\n" -"Puedes obtener un valor [RID] usando el [method Object.get_instance_id] en " -"un nodo derivado de [CanvasItem]." #: doc/classes/StyleBox.xml msgid "Returns the size of this [StyleBox] without the margins." @@ -79173,6 +79224,11 @@ msgstr "" "contextual." #: doc/classes/TextEdit.xml +#, fuzzy +msgid "If [code]true[/code], allow drag and drop of selected text." +msgstr "Si [code]true[/code], el cuerpo puede ser detectado por los rayos." + +#: doc/classes/TextEdit.xml msgid "" "If [code]true[/code], the \"space\" character will have a visible " "representation." @@ -87155,12 +87211,14 @@ msgstr "" "La cantidad de subdivisión del cuarto cuadrante en el atlas de las sombras." #: doc/classes/Viewport.xml +#, fuzzy msgid "" "The shadow atlas' resolution (used for omni and spot lights). The value will " "be rounded up to the nearest power of 2.\n" -"[b]Note:[/b] If this is set to 0, shadows won't be visible. Since user-" -"created viewports default to a value of 0, this value must be set above 0 " -"manually." +"[b]Note:[/b] If this is set to [code]0[/code], both point [i]and[/i] " +"directional shadows won't be visible. Since user-created viewports default " +"to a value of [code]0[/code], this value must be set above [code]0[/code] " +"manually (typically at least [code]256[/code])." msgstr "" "La resolución del atlas de las sombras (usado para luces omni y spot). El " "valor se redondeará a la potencia más cercana de 2.\n" @@ -87197,9 +87255,12 @@ msgid "" msgstr "Si [code]true[/code], el viewport debería hacer su fondo transparente." #: doc/classes/Viewport.xml -#, fuzzy -msgid "The rendering mode of viewport." -msgstr "El modo de selección a utilizar." +msgid "" +"The rendering mode of viewport.\n" +"[b]Note:[/b] If set to [constant USAGE_2D] or [constant " +"USAGE_2D_NO_SAMPLING], [member hdr] will have no effect when enabled since " +"HDR is not supported for 2D." +msgstr "" #: doc/classes/Viewport.xml msgid "" diff --git a/doc/translations/fa.po b/doc/translations/fa.po index a8972b49a5..db8018d209 100644 --- a/doc/translations/fa.po +++ b/doc/translations/fa.po @@ -12573,10 +12573,12 @@ msgid "" msgstr "" #: doc/classes/Camera2D.xml doc/classes/ClippedCamera.xml +#: doc/classes/InterpolatedCamera.xml msgid "The camera updates with the [code]_physics_process[/code] callback." msgstr "" #: doc/classes/Camera2D.xml doc/classes/ClippedCamera.xml +#: doc/classes/InterpolatedCamera.xml msgid "The camera updates with the [code]_process[/code] callback." msgstr "" @@ -19858,13 +19860,17 @@ msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "Amount of extra bias for shadow splits that are far away. If self-shadowing " -"occurs only on the splits far away, increasing this value can fix them." +"occurs only on the splits far away, increasing this value can fix them. This " +"is ignored when [member directional_shadow_mode] is [constant " +"SHADOW_ORTHOGONAL]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "If [code]true[/code], shadow detail is sacrificed in exchange for smoother " -"transitions between splits." +"transitions between splits. Enabling shadow blend splitting also has a " +"moderate performance cost. This is ignored when [member " +"directional_shadow_mode] is [constant SHADOW_ORTHOGONAL]." msgstr "" #: doc/classes/DirectionalLight.xml @@ -19874,7 +19880,11 @@ msgid "" msgstr "" #: doc/classes/DirectionalLight.xml -msgid "The maximum distance for shadow splits." +msgid "" +"The maximum distance for shadow splits. Increasing this value will make " +"directional shadows visible from further away, at the cost of lower overall " +"shadow detail and performance (since more objects need to be included in the " +"directional shadow rendering)." msgstr "" #: doc/classes/DirectionalLight.xml @@ -19891,23 +19901,23 @@ msgstr "" msgid "" "The distance from camera to shadow split 1. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or " -"[code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_2_SPLITS] or [constant " +"SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "The distance from shadow split 1 to split 2. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or " -"[code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_2_SPLITS] or [constant " +"SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "The distance from shadow split 2 to split 3. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml @@ -30256,7 +30266,10 @@ msgid "" "input at the cost of increased CPU usage. In applications where drawing " "freehand lines is required, input accumulation should generally be disabled " "while the user is drawing the line to get results that closely follow the " -"actual input." +"actual input.\n" +"[b]Note:[/b] Input accumulation is [i]disabled[/i] by default for backward " +"compatibility reasons. It is however recommended to enable it for games " +"which don't require very reactive input, as this will decrease CPU usage." msgstr "" #: doc/classes/Input.xml @@ -30830,10 +30843,11 @@ msgstr "" msgid "" "Contains mouse and pen motion information. Supports relative, absolute " "positions and speed. See [method Node._input].\n" -"[b]Note:[/b] By default, this event is only emitted once per frame rendered " -"at most. If you need more precise input reporting, set [member Input." -"use_accumulated_input] to [code]false[/code] to make events emitted as often " -"as possible. If you use InputEventMouseMotion to draw lines, consider " +"[b]Note:[/b] By default, this event can be emitted multiple times per frame " +"rendered, allowing for precise input reporting, at the expense of CPU usage. " +"You can set [member Input.use_accumulated_input] to [code]true[/code] to let " +"multiple events merge into a single emitted event per frame.\n" +"[b]Note:[/b] If you use InputEventMouseMotion to draw lines, consider " "implementing [url=https://en.wikipedia.org/wiki/" "Bresenham%27s_line_algorithm]Bresenham's line algorithm[/url] as well to " "avoid visible gaps in lines if the user is moving the mouse quickly." @@ -31156,6 +31170,11 @@ msgstr "" #: doc/classes/InterpolatedCamera.xml msgid "" +"The camera's process callback. See [enum InterpolatedCameraProcessMode]." +msgstr "" + +#: doc/classes/InterpolatedCamera.xml +msgid "" "How quickly the camera moves toward its target. Higher values will result in " "tighter camera motion." msgstr "" @@ -36562,7 +36581,7 @@ msgid "" "maximum distance is exceeded, it recalculates the ideal path." msgstr "" -#: doc/classes/NavigationAgent.xml doc/classes/NavigationAgent2D.xml +#: doc/classes/NavigationAgent.xml msgid "" "The radius of the avoidance agent. This is the \"body\" of the avoidance " "agent and not the avoidance maneuver starting radius (which is controlled by " @@ -36673,6 +36692,14 @@ msgid "" "least one matching layer." msgstr "" +#: doc/classes/NavigationAgent2D.xml +msgid "" +"The radius of the avoidance agent. This is the \"body\" of the avoidance " +"agent and not the avoidance maneuver starting radius (which is controlled by " +"[member neighbor_dist]).\n" +"Does not affect normal pathfinding." +msgstr "" + #: doc/classes/NavigationMesh.xml msgid "A mesh to approximate the walkable areas and obstacles." msgstr "" @@ -50264,8 +50291,8 @@ msgstr "" #: doc/classes/ProjectSettings.xml msgid "" -"Size for shadow atlas (used for OmniLights and SpotLights). See " -"documentation." +"Size for shadow atlas (used for OmniLights and SpotLights). The value will " +"be rounded up to the nearest power of 2. See shadow mapping documentation." msgstr "" #: doc/classes/ProjectSettings.xml @@ -58638,7 +58665,31 @@ msgstr "" #: doc/classes/String.xml msgid "" "Formats the string by replacing all occurrences of [code]placeholder[/code] " -"with [code]values[/code]." +"with the elements of [code]values[/code].\n" +"[code]values[/code] can be a [Dictionary] or an [Array]. Any underscores in " +"[code]placeholder[/code] will be replaced with the corresponding keys in " +"advance. Array elements use their index as keys.\n" +"[codeblock]\n" +"# Prints: Waiting for Godot is a play by Samuel Beckett, and Godot Engine is " +"named after it.\n" +"var use_array_values = \"Waiting for {0} is a play by {1}, and {0} Engine is " +"named after it.\"\n" +"print(use_array_values.format([\"Godot\", \"Samuel Beckett\"]))\n" +"\n" +"# Prints: User 42 is Godot.\n" +"print(\"User {id} is {name}.\".format({\"id\": 42, \"name\": \"Godot\"}))\n" +"[/codeblock]\n" +"Some additional handling is performed when [code]values[/code] is an array. " +"If [code]placeholder[/code] does not contain an underscore, the elements of " +"the array will be used to replace one occurrence of the placeholder in turn; " +"If an array element is another 2-element array, it'll be interpreted as a " +"key-value pair.\n" +"[codeblock]\n" +"# Prints: User 42 is Godot.\n" +"print(\"User {} is {}.\".format([42, \"Godot\"], \"{}\"))\n" +"print(\"User {id} is {name}.\".format([[\"id\", 42], [\"name\", " +"\"Godot\"]]))\n" +"[/codeblock]" msgstr "" #: doc/classes/String.xml @@ -59235,9 +59286,11 @@ msgstr "" #: doc/classes/StyleBox.xml msgid "" -"Draws this stylebox using a [CanvasItem] with given [RID].\n" -"You can get a [RID] value using [method Object.get_instance_id] on a " -"[CanvasItem]-derived node." +"Draws this stylebox using a canvas item identified by the given [RID].\n" +"The [RID] value can either be the result of [method CanvasItem." +"get_canvas_item] called on an existing [CanvasItem]-derived node, or " +"directly from creating a canvas item in the [VisualServer] with [method " +"VisualServer.canvas_item_create]." msgstr "" #: doc/classes/StyleBox.xml @@ -60774,6 +60827,10 @@ msgid "If [code]true[/code], a right-click displays the context menu." msgstr "" #: doc/classes/TextEdit.xml +msgid "If [code]true[/code], allow drag and drop of selected text." +msgstr "" + +#: doc/classes/TextEdit.xml msgid "" "If [code]true[/code], the \"space\" character will have a visible " "representation." @@ -66848,9 +66905,10 @@ msgstr "" msgid "" "The shadow atlas' resolution (used for omni and spot lights). The value will " "be rounded up to the nearest power of 2.\n" -"[b]Note:[/b] If this is set to 0, shadows won't be visible. Since user-" -"created viewports default to a value of 0, this value must be set above 0 " -"manually." +"[b]Note:[/b] If this is set to [code]0[/code], both point [i]and[/i] " +"directional shadows won't be visible. Since user-created viewports default " +"to a value of [code]0[/code], this value must be set above [code]0[/code] " +"manually (typically at least [code]256[/code])." msgstr "" #: doc/classes/Viewport.xml @@ -66879,7 +66937,11 @@ msgid "" msgstr "" #: doc/classes/Viewport.xml -msgid "The rendering mode of viewport." +msgid "" +"The rendering mode of viewport.\n" +"[b]Note:[/b] If set to [constant USAGE_2D] or [constant " +"USAGE_2D_NO_SAMPLING], [member hdr] will have no effect when enabled since " +"HDR is not supported for 2D." msgstr "" #: doc/classes/Viewport.xml diff --git a/doc/translations/fi.po b/doc/translations/fi.po index 9c41935f5e..9317c255a7 100644 --- a/doc/translations/fi.po +++ b/doc/translations/fi.po @@ -12226,10 +12226,12 @@ msgid "" msgstr "" #: doc/classes/Camera2D.xml doc/classes/ClippedCamera.xml +#: doc/classes/InterpolatedCamera.xml msgid "The camera updates with the [code]_physics_process[/code] callback." msgstr "" #: doc/classes/Camera2D.xml doc/classes/ClippedCamera.xml +#: doc/classes/InterpolatedCamera.xml msgid "The camera updates with the [code]_process[/code] callback." msgstr "" @@ -19528,13 +19530,17 @@ msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "Amount of extra bias for shadow splits that are far away. If self-shadowing " -"occurs only on the splits far away, increasing this value can fix them." +"occurs only on the splits far away, increasing this value can fix them. This " +"is ignored when [member directional_shadow_mode] is [constant " +"SHADOW_ORTHOGONAL]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "If [code]true[/code], shadow detail is sacrificed in exchange for smoother " -"transitions between splits." +"transitions between splits. Enabling shadow blend splitting also has a " +"moderate performance cost. This is ignored when [member " +"directional_shadow_mode] is [constant SHADOW_ORTHOGONAL]." msgstr "" #: doc/classes/DirectionalLight.xml @@ -19544,7 +19550,11 @@ msgid "" msgstr "" #: doc/classes/DirectionalLight.xml -msgid "The maximum distance for shadow splits." +msgid "" +"The maximum distance for shadow splits. Increasing this value will make " +"directional shadows visible from further away, at the cost of lower overall " +"shadow detail and performance (since more objects need to be included in the " +"directional shadow rendering)." msgstr "" #: doc/classes/DirectionalLight.xml @@ -19561,23 +19571,23 @@ msgstr "" msgid "" "The distance from camera to shadow split 1. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or " -"[code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_2_SPLITS] or [constant " +"SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "The distance from shadow split 1 to split 2. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or " -"[code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_2_SPLITS] or [constant " +"SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "The distance from shadow split 2 to split 3. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml @@ -29946,7 +29956,10 @@ msgid "" "input at the cost of increased CPU usage. In applications where drawing " "freehand lines is required, input accumulation should generally be disabled " "while the user is drawing the line to get results that closely follow the " -"actual input." +"actual input.\n" +"[b]Note:[/b] Input accumulation is [i]disabled[/i] by default for backward " +"compatibility reasons. It is however recommended to enable it for games " +"which don't require very reactive input, as this will decrease CPU usage." msgstr "" #: doc/classes/Input.xml @@ -30520,10 +30533,11 @@ msgstr "" msgid "" "Contains mouse and pen motion information. Supports relative, absolute " "positions and speed. See [method Node._input].\n" -"[b]Note:[/b] By default, this event is only emitted once per frame rendered " -"at most. If you need more precise input reporting, set [member Input." -"use_accumulated_input] to [code]false[/code] to make events emitted as often " -"as possible. If you use InputEventMouseMotion to draw lines, consider " +"[b]Note:[/b] By default, this event can be emitted multiple times per frame " +"rendered, allowing for precise input reporting, at the expense of CPU usage. " +"You can set [member Input.use_accumulated_input] to [code]true[/code] to let " +"multiple events merge into a single emitted event per frame.\n" +"[b]Note:[/b] If you use InputEventMouseMotion to draw lines, consider " "implementing [url=https://en.wikipedia.org/wiki/" "Bresenham%27s_line_algorithm]Bresenham's line algorithm[/url] as well to " "avoid visible gaps in lines if the user is moving the mouse quickly." @@ -30847,6 +30861,11 @@ msgstr "" #: doc/classes/InterpolatedCamera.xml msgid "" +"The camera's process callback. See [enum InterpolatedCameraProcessMode]." +msgstr "" + +#: doc/classes/InterpolatedCamera.xml +msgid "" "How quickly the camera moves toward its target. Higher values will result in " "tighter camera motion." msgstr "" @@ -36274,7 +36293,7 @@ msgid "" "maximum distance is exceeded, it recalculates the ideal path." msgstr "" -#: doc/classes/NavigationAgent.xml doc/classes/NavigationAgent2D.xml +#: doc/classes/NavigationAgent.xml msgid "" "The radius of the avoidance agent. This is the \"body\" of the avoidance " "agent and not the avoidance maneuver starting radius (which is controlled by " @@ -36387,6 +36406,14 @@ msgid "" "least one matching layer." msgstr "" +#: doc/classes/NavigationAgent2D.xml +msgid "" +"The radius of the avoidance agent. This is the \"body\" of the avoidance " +"agent and not the avoidance maneuver starting radius (which is controlled by " +"[member neighbor_dist]).\n" +"Does not affect normal pathfinding." +msgstr "" + #: doc/classes/NavigationMesh.xml msgid "A mesh to approximate the walkable areas and obstacles." msgstr "" @@ -49992,8 +50019,8 @@ msgstr "" #: doc/classes/ProjectSettings.xml msgid "" -"Size for shadow atlas (used for OmniLights and SpotLights). See " -"documentation." +"Size for shadow atlas (used for OmniLights and SpotLights). The value will " +"be rounded up to the nearest power of 2. See shadow mapping documentation." msgstr "" #: doc/classes/ProjectSettings.xml @@ -58368,7 +58395,31 @@ msgstr "" #: doc/classes/String.xml msgid "" "Formats the string by replacing all occurrences of [code]placeholder[/code] " -"with [code]values[/code]." +"with the elements of [code]values[/code].\n" +"[code]values[/code] can be a [Dictionary] or an [Array]. Any underscores in " +"[code]placeholder[/code] will be replaced with the corresponding keys in " +"advance. Array elements use their index as keys.\n" +"[codeblock]\n" +"# Prints: Waiting for Godot is a play by Samuel Beckett, and Godot Engine is " +"named after it.\n" +"var use_array_values = \"Waiting for {0} is a play by {1}, and {0} Engine is " +"named after it.\"\n" +"print(use_array_values.format([\"Godot\", \"Samuel Beckett\"]))\n" +"\n" +"# Prints: User 42 is Godot.\n" +"print(\"User {id} is {name}.\".format({\"id\": 42, \"name\": \"Godot\"}))\n" +"[/codeblock]\n" +"Some additional handling is performed when [code]values[/code] is an array. " +"If [code]placeholder[/code] does not contain an underscore, the elements of " +"the array will be used to replace one occurrence of the placeholder in turn; " +"If an array element is another 2-element array, it'll be interpreted as a " +"key-value pair.\n" +"[codeblock]\n" +"# Prints: User 42 is Godot.\n" +"print(\"User {} is {}.\".format([42, \"Godot\"], \"{}\"))\n" +"print(\"User {id} is {name}.\".format([[\"id\", 42], [\"name\", " +"\"Godot\"]]))\n" +"[/codeblock]" msgstr "" #: doc/classes/String.xml @@ -58965,9 +59016,11 @@ msgstr "" #: doc/classes/StyleBox.xml msgid "" -"Draws this stylebox using a [CanvasItem] with given [RID].\n" -"You can get a [RID] value using [method Object.get_instance_id] on a " -"[CanvasItem]-derived node." +"Draws this stylebox using a canvas item identified by the given [RID].\n" +"The [RID] value can either be the result of [method CanvasItem." +"get_canvas_item] called on an existing [CanvasItem]-derived node, or " +"directly from creating a canvas item in the [VisualServer] with [method " +"VisualServer.canvas_item_create]." msgstr "" #: doc/classes/StyleBox.xml @@ -60513,6 +60566,11 @@ msgid "If [code]true[/code], a right-click displays the context menu." msgstr "" #: doc/classes/TextEdit.xml +#, fuzzy +msgid "If [code]true[/code], allow drag and drop of selected text." +msgstr "Palauttaa parametrin kosinin." + +#: doc/classes/TextEdit.xml msgid "" "If [code]true[/code], the \"space\" character will have a visible " "representation." @@ -66606,9 +66664,10 @@ msgstr "" msgid "" "The shadow atlas' resolution (used for omni and spot lights). The value will " "be rounded up to the nearest power of 2.\n" -"[b]Note:[/b] If this is set to 0, shadows won't be visible. Since user-" -"created viewports default to a value of 0, this value must be set above 0 " -"manually." +"[b]Note:[/b] If this is set to [code]0[/code], both point [i]and[/i] " +"directional shadows won't be visible. Since user-created viewports default " +"to a value of [code]0[/code], this value must be set above [code]0[/code] " +"manually (typically at least [code]256[/code])." msgstr "" #: doc/classes/Viewport.xml @@ -66637,7 +66696,11 @@ msgid "" msgstr "" #: doc/classes/Viewport.xml -msgid "The rendering mode of viewport." +msgid "" +"The rendering mode of viewport.\n" +"[b]Note:[/b] If set to [constant USAGE_2D] or [constant " +"USAGE_2D_NO_SAMPLING], [member hdr] will have no effect when enabled since " +"HDR is not supported for 2D." msgstr "" #: doc/classes/Viewport.xml diff --git a/doc/translations/fil.po b/doc/translations/fil.po index 1ae1d0b02b..f7a8c0fd9b 100644 --- a/doc/translations/fil.po +++ b/doc/translations/fil.po @@ -12148,10 +12148,12 @@ msgid "" msgstr "" #: doc/classes/Camera2D.xml doc/classes/ClippedCamera.xml +#: doc/classes/InterpolatedCamera.xml msgid "The camera updates with the [code]_physics_process[/code] callback." msgstr "" #: doc/classes/Camera2D.xml doc/classes/ClippedCamera.xml +#: doc/classes/InterpolatedCamera.xml msgid "The camera updates with the [code]_process[/code] callback." msgstr "" @@ -19433,13 +19435,17 @@ msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "Amount of extra bias for shadow splits that are far away. If self-shadowing " -"occurs only on the splits far away, increasing this value can fix them." +"occurs only on the splits far away, increasing this value can fix them. This " +"is ignored when [member directional_shadow_mode] is [constant " +"SHADOW_ORTHOGONAL]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "If [code]true[/code], shadow detail is sacrificed in exchange for smoother " -"transitions between splits." +"transitions between splits. Enabling shadow blend splitting also has a " +"moderate performance cost. This is ignored when [member " +"directional_shadow_mode] is [constant SHADOW_ORTHOGONAL]." msgstr "" #: doc/classes/DirectionalLight.xml @@ -19449,7 +19455,11 @@ msgid "" msgstr "" #: doc/classes/DirectionalLight.xml -msgid "The maximum distance for shadow splits." +msgid "" +"The maximum distance for shadow splits. Increasing this value will make " +"directional shadows visible from further away, at the cost of lower overall " +"shadow detail and performance (since more objects need to be included in the " +"directional shadow rendering)." msgstr "" #: doc/classes/DirectionalLight.xml @@ -19466,23 +19476,23 @@ msgstr "" msgid "" "The distance from camera to shadow split 1. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or " -"[code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_2_SPLITS] or [constant " +"SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "The distance from shadow split 1 to split 2. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or " -"[code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_2_SPLITS] or [constant " +"SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "The distance from shadow split 2 to split 3. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml @@ -29831,7 +29841,10 @@ msgid "" "input at the cost of increased CPU usage. In applications where drawing " "freehand lines is required, input accumulation should generally be disabled " "while the user is drawing the line to get results that closely follow the " -"actual input." +"actual input.\n" +"[b]Note:[/b] Input accumulation is [i]disabled[/i] by default for backward " +"compatibility reasons. It is however recommended to enable it for games " +"which don't require very reactive input, as this will decrease CPU usage." msgstr "" #: doc/classes/Input.xml @@ -30405,10 +30418,11 @@ msgstr "" msgid "" "Contains mouse and pen motion information. Supports relative, absolute " "positions and speed. See [method Node._input].\n" -"[b]Note:[/b] By default, this event is only emitted once per frame rendered " -"at most. If you need more precise input reporting, set [member Input." -"use_accumulated_input] to [code]false[/code] to make events emitted as often " -"as possible. If you use InputEventMouseMotion to draw lines, consider " +"[b]Note:[/b] By default, this event can be emitted multiple times per frame " +"rendered, allowing for precise input reporting, at the expense of CPU usage. " +"You can set [member Input.use_accumulated_input] to [code]true[/code] to let " +"multiple events merge into a single emitted event per frame.\n" +"[b]Note:[/b] If you use InputEventMouseMotion to draw lines, consider " "implementing [url=https://en.wikipedia.org/wiki/" "Bresenham%27s_line_algorithm]Bresenham's line algorithm[/url] as well to " "avoid visible gaps in lines if the user is moving the mouse quickly." @@ -30731,6 +30745,11 @@ msgstr "" #: doc/classes/InterpolatedCamera.xml msgid "" +"The camera's process callback. See [enum InterpolatedCameraProcessMode]." +msgstr "" + +#: doc/classes/InterpolatedCamera.xml +msgid "" "How quickly the camera moves toward its target. Higher values will result in " "tighter camera motion." msgstr "" @@ -36131,7 +36150,7 @@ msgid "" "maximum distance is exceeded, it recalculates the ideal path." msgstr "" -#: doc/classes/NavigationAgent.xml doc/classes/NavigationAgent2D.xml +#: doc/classes/NavigationAgent.xml msgid "" "The radius of the avoidance agent. This is the \"body\" of the avoidance " "agent and not the avoidance maneuver starting radius (which is controlled by " @@ -36242,6 +36261,14 @@ msgid "" "least one matching layer." msgstr "" +#: doc/classes/NavigationAgent2D.xml +msgid "" +"The radius of the avoidance agent. This is the \"body\" of the avoidance " +"agent and not the avoidance maneuver starting radius (which is controlled by " +"[member neighbor_dist]).\n" +"Does not affect normal pathfinding." +msgstr "" + #: doc/classes/NavigationMesh.xml msgid "A mesh to approximate the walkable areas and obstacles." msgstr "" @@ -49821,8 +49848,8 @@ msgstr "" #: doc/classes/ProjectSettings.xml msgid "" -"Size for shadow atlas (used for OmniLights and SpotLights). See " -"documentation." +"Size for shadow atlas (used for OmniLights and SpotLights). The value will " +"be rounded up to the nearest power of 2. See shadow mapping documentation." msgstr "" #: doc/classes/ProjectSettings.xml @@ -58191,7 +58218,31 @@ msgstr "" #: doc/classes/String.xml msgid "" "Formats the string by replacing all occurrences of [code]placeholder[/code] " -"with [code]values[/code]." +"with the elements of [code]values[/code].\n" +"[code]values[/code] can be a [Dictionary] or an [Array]. Any underscores in " +"[code]placeholder[/code] will be replaced with the corresponding keys in " +"advance. Array elements use their index as keys.\n" +"[codeblock]\n" +"# Prints: Waiting for Godot is a play by Samuel Beckett, and Godot Engine is " +"named after it.\n" +"var use_array_values = \"Waiting for {0} is a play by {1}, and {0} Engine is " +"named after it.\"\n" +"print(use_array_values.format([\"Godot\", \"Samuel Beckett\"]))\n" +"\n" +"# Prints: User 42 is Godot.\n" +"print(\"User {id} is {name}.\".format({\"id\": 42, \"name\": \"Godot\"}))\n" +"[/codeblock]\n" +"Some additional handling is performed when [code]values[/code] is an array. " +"If [code]placeholder[/code] does not contain an underscore, the elements of " +"the array will be used to replace one occurrence of the placeholder in turn; " +"If an array element is another 2-element array, it'll be interpreted as a " +"key-value pair.\n" +"[codeblock]\n" +"# Prints: User 42 is Godot.\n" +"print(\"User {} is {}.\".format([42, \"Godot\"], \"{}\"))\n" +"print(\"User {id} is {name}.\".format([[\"id\", 42], [\"name\", " +"\"Godot\"]]))\n" +"[/codeblock]" msgstr "" #: doc/classes/String.xml @@ -58788,9 +58839,11 @@ msgstr "" #: doc/classes/StyleBox.xml msgid "" -"Draws this stylebox using a [CanvasItem] with given [RID].\n" -"You can get a [RID] value using [method Object.get_instance_id] on a " -"[CanvasItem]-derived node." +"Draws this stylebox using a canvas item identified by the given [RID].\n" +"The [RID] value can either be the result of [method CanvasItem." +"get_canvas_item] called on an existing [CanvasItem]-derived node, or " +"directly from creating a canvas item in the [VisualServer] with [method " +"VisualServer.canvas_item_create]." msgstr "" #: doc/classes/StyleBox.xml @@ -60327,6 +60380,10 @@ msgid "If [code]true[/code], a right-click displays the context menu." msgstr "" #: doc/classes/TextEdit.xml +msgid "If [code]true[/code], allow drag and drop of selected text." +msgstr "" + +#: doc/classes/TextEdit.xml msgid "" "If [code]true[/code], the \"space\" character will have a visible " "representation." @@ -66401,9 +66458,10 @@ msgstr "" msgid "" "The shadow atlas' resolution (used for omni and spot lights). The value will " "be rounded up to the nearest power of 2.\n" -"[b]Note:[/b] If this is set to 0, shadows won't be visible. Since user-" -"created viewports default to a value of 0, this value must be set above 0 " -"manually." +"[b]Note:[/b] If this is set to [code]0[/code], both point [i]and[/i] " +"directional shadows won't be visible. Since user-created viewports default " +"to a value of [code]0[/code], this value must be set above [code]0[/code] " +"manually (typically at least [code]256[/code])." msgstr "" #: doc/classes/Viewport.xml @@ -66432,7 +66490,11 @@ msgid "" msgstr "" #: doc/classes/Viewport.xml -msgid "The rendering mode of viewport." +msgid "" +"The rendering mode of viewport.\n" +"[b]Note:[/b] If set to [constant USAGE_2D] or [constant " +"USAGE_2D_NO_SAMPLING], [member hdr] will have no effect when enabled since " +"HDR is not supported for 2D." msgstr "" #: doc/classes/Viewport.xml diff --git a/doc/translations/fr.po b/doc/translations/fr.po index 2dcac4940b..7b3d3c7435 100644 --- a/doc/translations/fr.po +++ b/doc/translations/fr.po @@ -61,7 +61,7 @@ msgstr "" "Project-Id-Version: Godot Engine class reference\n" "Report-Msgid-Bugs-To: https://github.com/godotengine/godot\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2022-06-28 04:52+0000\n" +"PO-Revision-Date: 2022-07-06 04:47+0000\n" "Last-Translator: Maxime Leroy <lisacintosh@gmail.com>\n" "Language-Team: French <https://hosted.weblate.org/projects/godot-engine/" "godot-class-reference/fr/>\n" @@ -985,7 +985,6 @@ msgstr "" "[/codeblock]" #: modules/gdscript/doc_classes/@GDScript.xml -#, fuzzy msgid "" "Linearly interpolates between two values by the factor defined in " "[code]weight[/code]. To perform interpolation, [code]weight[/code] should be " @@ -1005,13 +1004,16 @@ msgid "" "To perform eased interpolation with [method lerp], combine it with [method " "ease] or [method smoothstep]." msgstr "" -"Interpolation linéaire entre deux valeurs par une valeur normalisée. C'est " -"l'inverse de [method inverse_lerp].\n" +"L'interpolation linéaire entre deux valeurs avec un facteur défini par " +"[code]weight[/code]. Pour faire une interpolation, [code]weight[/code] doit " +"être entre [code]0.0[/code] et [code]1.0[/code] (inclus). Pour autant, des " +"valeurs en dehors de cet intervalle sont autorisés pour faire une " +"[i]extrapolation[/i].\n" "Si les arguments [code]from[/code] et [code]to[/code] sont de type [int] ou " -"[float], la valeur de retour est un [float].\n" +"[float], la valeur retournée est un [float].\n" "Si les deux sont du même type de vecteur ([Vector2], [Vector3] ou [Color]), " -"la valeur de retour sera du même type ([code]lerp[/code] appelle alors la " -"méthode du type de vecteur [code]linear_interpolate[/code]).\n" +"la valeur de retour sera du même type (puisque [code]lerp[/code] appelle " +"alors la méthode [code]linear_interpolate[/code] du même type).\n" "[codeblock]\n" "lerp(0, 4, 0.75) # Retourne 3.0\n" "lerp(Vector2(1, 5), Vector2(3, 2), 0.5) # Retourne Vector2(2, 3.5)\n" @@ -4060,6 +4062,10 @@ msgid "" "down on the key after it \"bottoms out\". This message is different from " "polyphonic after-touch as it indicates the highest pressure across all keys." msgstr "" +"Le message de pression de canal MIDI. Ce message est le plus souvent envoyé " +"en appuyant sur la touche après qu'il « se retire » . Ce message est " +"différent de l'après-touche polyphonique car il indique la plus haute " +"pression sur toutes les clés." #: doc/classes/@GlobalScope.xml msgid "" @@ -4074,6 +4080,9 @@ msgid "" "MIDI system exclusive message. This has behavior exclusive to the device " "you're receiving input from. Getting this data is not implemented in Godot." msgstr "" +"Le message exclusif du système MIDI. Cela a un comportement exclusif à " +"l'appareil dont vous recevez l'entrée. Obtenir cette donnée n'est pas " +"implémenté dans Godot." #: doc/classes/@GlobalScope.xml msgid "" @@ -4086,30 +4095,43 @@ msgid "" "MIDI song position pointer message. Gives the number of 16th notes since the " "start of the song. Getting this data is not implemented in Godot." msgstr "" +"Le message de position de chanson MIDI. Donne le nombre de seizième de note " +"depuis le début de la chanson. Obtenir cette donnée n'est pas implémenté " +"dans Godot." #: doc/classes/@GlobalScope.xml msgid "" "MIDI song select message. Specifies which sequence or song is to be played. " "Getting this data is not implemented in Godot." msgstr "" +"Le message de sélectionne de la chanson. Spécifie quelle séquence ou quelle " +"chanson doit être jouée. Obtenir cette donnée n'est pas implémenté dans " +"Godot." #: doc/classes/@GlobalScope.xml msgid "" "MIDI tune request message. Upon receiving a tune request, all analog " "synthesizers should tune their oscillators." msgstr "" +"Le message de requête d'accordage MIDI. À la réception d'une requête " +"d'accordage, tous les synthétiseurs analogiques devraient accorder leurs " +"oscillateurs." #: doc/classes/@GlobalScope.xml msgid "" "MIDI timing clock message. Sent 24 times per quarter note when " "synchronization is required." msgstr "" +"Le message d'horloge MIDI. Envoyé 24 fois par quart de note lorsque la " +"synchronisation est requise." #: doc/classes/@GlobalScope.xml msgid "" "MIDI start message. Start the current sequence playing. This message will be " "followed with Timing Clocks." msgstr "" +"Le message de démarrage MIDI. Commence la séquence actuelle. Ce message sera " +"suivi avec un message d'horloge." #: doc/classes/@GlobalScope.xml msgid "MIDI continue message. Continue at the point the sequence was stopped." @@ -5206,7 +5228,6 @@ msgstr "" "entrée, le dialogue sera accepté." #: doc/classes/AcceptDialog.xml -#, fuzzy msgid "" "Removes the [code]button[/code] from the dialog. Does NOT free the " "[code]button[/code]. The [code]button[/code] must be a [Button] added with " @@ -5214,9 +5235,11 @@ msgid "" "the [code]button[/code] will no longer emit this dialog's [signal " "custom_action] signal or cancel this dialog." msgstr "" -"Enlever le [code]bouton[/code] de la boite de la boîte de dialogue. Ne " -"libère PAS le bouton. Le bouton dois être un [Button] ajouté avec la méthode " -"[method add_button] ou [method add_cancel] ." +"Retire le [code]button[/code] de la boite de dialogue. Ne libère PAS le " +"[code]button[/code]. Le [code]button[/code] doit être un [Button] ajouté " +"avec la méthode [method add_button] ou [method add_cancel]. Après être " +"retiré, appuyer sur [code]button[/code] n'émettra plus le signal [signal " +"custom_action] du dialogue ni ne l'annulera." #: doc/classes/AcceptDialog.xml msgid "Sets autowrapping for the text in the dialog." @@ -8408,6 +8431,10 @@ msgid "" "binds animations to animation nodes.\n" "Once set, [Animation] nodes can be added to the [AnimationTreePlayer]." msgstr "" +"Le chemin vers le [AnimationPlayer] d'où cette [AnimationTreePlayer] " +"connecte les animations aux nœuds d'animation.\n" +"Une fois défini, les nœuds [Animation] peuvent être ajoutés au " +"[AnimationTreePlayer]." #: doc/classes/AnimationTreePlayer.xml msgid "The thread in which to update animations." @@ -8592,6 +8619,10 @@ msgid "" "See [member ProjectSettings.physics/3d/default_linear_damp] for more details " "about damping." msgstr "" +"La vitesse à laquelle les objets arrêtent de se déplacer dans cette zone. " +"Représente la vitesse linéaire perdue par seconde.\n" +"Voir [member ProjectSettings.physics/3d/default_linear_damp] pour plus de " +"détails sur l'amortissement." #: doc/classes/Area.xml doc/classes/Area2D.xml msgid "If [code]true[/code], other monitoring areas can detect this area." @@ -10832,6 +10863,9 @@ msgid "" "the AR/VR eyes to [VisualServer]. The value comes from an internal call to " "[method OS.get_ticks_usec]." msgstr "" +"Retourne l'horodatage absolu (en μs) de la dernière mise à jour des yeux AR/" +"VR du [ARVRServer] envoyée au [VisualServer]. La valeur est récupérée via un " +"appel interne à [method OS.get_ticks_usec]" #: doc/classes/ARVRServer.xml msgid "" @@ -10839,6 +10873,9 @@ msgid "" "difference between [method get_last_commit_usec] and [method " "get_last_process_usec] when committing." msgstr "" +"Retourne la durée (en μs) de la dernière trame. Ceci est calculé comme la " +"différence entre [method get_last_commit_usec] et [method " +"get_last_process_usec] lorsque vous commettez." #: doc/classes/ARVRServer.xml msgid "" @@ -10846,6 +10883,9 @@ msgid "" "callback. The value comes from an internal call to [method OS." "get_ticks_usec]." msgstr "" +"Retourne l'horodatage absolu (en μs) du dernier appel de mise à jour du " +"[ARVRServer]. La valeur vient est récupérée via un appel interne à [method " +"OS.get_ticks_usec]" #: doc/classes/ARVRServer.xml msgid "" @@ -12137,6 +12177,8 @@ msgid "" "High-pass filter, in Hz. Frequencies higher than this value will not be " "affected by the distortion. Value can range from 1 to 20000." msgstr "" +"Le filtre passe-haut, en Hz. Les fréquences supérieures à cette valeur ne " +"seront pas affectées par la distorsion. La valeur peut aller de 1 à 20000 Hz." #: doc/classes/AudioEffectDistortion.xml msgid "Distortion type." @@ -12147,12 +12189,16 @@ msgid "" "Increases or decreases the volume after the effect. Value can range from -80 " "to 24." msgstr "" +"Augmente ou diminue le volume sonore après l'application de l'effet. La " +"valeur peut aller de -80 à 24 dB." #: doc/classes/AudioEffectDistortion.xml msgid "" "Increases or decreases the volume before the effect. Value can range from " "-60 to 60." msgstr "" +"Augmente ou diminue le volume sonore avant l'application de l'effet. La " +"valeur peut aller de -60 à 60 dB." #: doc/classes/AudioEffectDistortion.xml msgid "" @@ -12165,6 +12211,8 @@ msgid "" "Low-resolution digital distortion effect. You can use it to emulate the " "sound of early digital audio devices." msgstr "" +"Effet de distorsion numérique à basse résolution. Vous pouvez l'utiliser " +"pour émuler le son des tous premiers périphériques audio numériques." #: doc/classes/AudioEffectDistortion.xml msgid "" @@ -12530,6 +12578,10 @@ msgid "" "are more demanding on the CPU and may cause audio cracking if the CPU can't " "keep up." msgstr "" +"Le facteur de suréchantillonnage à utiliser. Des valeurs plus élevées " +"entraînent une meilleure qualité, mais nécessitent plus de puissance du CPU " +"et peuvent provoquer des craquements audibles si le CPU n'est pas assez " +"puissant." #: doc/classes/AudioEffectPitchShift.xml msgid "" @@ -12818,6 +12870,8 @@ msgid "" "Returns the [AudioEffectInstance] assigned to the given bus and effect " "indices (and optionally channel)." msgstr "" +"Retourne le [AudioEffectInstance] assigné au bus et aux indices de l'effet " +"donnés (et le canal en option)." #: doc/classes/AudioServer.xml msgid "Returns the index of the bus with the name [code]bus_name[/code]." @@ -12832,26 +12886,32 @@ msgid "" "Returns the peak volume of the left speaker at bus index [code]bus_idx[/" "code] and channel index [code]channel[/code]." msgstr "" +"Retourne le volume de crête du haut-parleur gauche à l'index du bus " +"[code]bus_idx[/code] et l'index du canal [code]canal[/code]." #: doc/classes/AudioServer.xml msgid "" "Returns the peak volume of the right speaker at bus index [code]bus_idx[/" "code] and channel index [code]channel[/code]." msgstr "" +"Retourne le volume de crête du haut-parleur droit à l'index de bus " +"[code]bus_idx[/code] et l'index de canal [code]canal[/code]." #: doc/classes/AudioServer.xml msgid "" "Returns the name of the bus that the bus at index [code]bus_idx[/code] sends " "to." msgstr "" +"Retourne le nom du bus vers lequel le bus à l'index [code]bus_idx[/code] " +"envoie l'audio." #: doc/classes/AudioServer.xml msgid "Returns the volume of the bus at index [code]bus_idx[/code] in dB." -msgstr "" +msgstr "Retourne le volume du bus à l'index [code]bus_idx[/code] en dB." #: doc/classes/AudioServer.xml msgid "Returns the names of all audio devices detected on the system." -msgstr "" +msgstr "Retourne les noms de tous les appareils audio détectés sur le système." #: doc/classes/AudioServer.xml #, fuzzy @@ -12887,6 +12947,8 @@ msgid "" "If [code]true[/code], the effect at index [code]effect_idx[/code] on the bus " "at index [code]bus_idx[/code] is enabled." msgstr "" +"Si [code]true[/code], l'effet à l'index [code]effect_idx[/code] sur le bus à " +"l'index [code]bus_idx[/code] est activé." #: doc/classes/AudioServer.xml msgid "If [code]true[/code], the bus at index [code]bus_idx[/code] is muted." @@ -12897,12 +12959,15 @@ msgstr "" msgid "" "If [code]true[/code], the bus at index [code]bus_idx[/code] is in solo mode." msgstr "" +"Si [code]true[/code], le bus à l'index [code]bus_idx[/code] est en mode solo." #: doc/classes/AudioServer.xml msgid "" "Locks the audio driver's main loop.\n" "[b]Note:[/b] Remember to unlock it afterwards." msgstr "" +"Verrouille la boucle principale du pilote audio.\n" +"[b]Note :[/b] Il est important de la déverrouiller après utilisation." #: doc/classes/AudioServer.xml msgid "" @@ -12930,6 +12995,7 @@ msgstr "Remplace le [AudioBusLayout] actuellement utilisé." msgid "" "Sets the name of the bus at index [code]bus_idx[/code] to [code]name[/code]." msgstr "" +"Définit le nom du bus à l'index [code]bus_idx[/code] avec [code]name[/code]." #: doc/classes/AudioServer.xml msgid "" @@ -12944,6 +13010,8 @@ msgid "" "Sets the volume of the bus at index [code]bus_idx[/code] to [code]volume_db[/" "code]." msgstr "" +"Définit le volume du bus à l'index [code]bus_idx[/code] à [code]volume_db[/" +"code]." #: doc/classes/AudioServer.xml msgid "Swaps the position of two effects in bus [code]bus_idx[/code]." @@ -12954,6 +13022,8 @@ msgid "" "Unlocks the audio driver's main loop. (After locking it, you should always " "unlock it.)" msgstr "" +"Déverrouille la boucle principale du pilote audio. (Après le verrouillage, " +"vous devriez toujours le déverrouiller.)" #: doc/classes/AudioServer.xml msgid "Number of available audio buses." @@ -12998,6 +13068,8 @@ msgid "" "Scales the rate at which audio is played (i.e. setting it to [code]0.5[/" "code] will make the audio be played twice as fast)." msgstr "" +"Mets à l'échelle la fréquence à laquelle l'audio est joué (c'est-à-dire que " +"la valeur [code]0.5[/code] jouera l'audio deux fois plus vite)." #: doc/classes/AudioServer.xml msgid "Emitted when the [AudioBusLayout] changes." @@ -13029,6 +13101,9 @@ msgid "" "music playback, and support WAV (via [AudioStreamSample]) and OGG (via " "[AudioStreamOGGVorbis]) file formats." msgstr "" +"La classe de base pour les flux audio. Les flux audio sont utilisés pour les " +"effets sonores et la lecture de musique, et supportent les formats de " +"fichiers WAV (via [AudioStreamSample)] et OGG (via [AudioStreamOGGVorbis)]." #: doc/classes/AudioStream.xml doc/classes/AudioStreamPlayer.xml msgid "Audio streams" @@ -13060,6 +13135,15 @@ msgid "" "class from GDScript, consider using a lower [member mix_rate] such as 11,025 " "Hz or 22,050 Hz." msgstr "" +"Ce flux audio ne joue pas de sons par défaut, les données audio doivent être " +"générées à partir d'un script. Voir aussi [AudioStreamGeneratorPlayback].\n" +"Voir aussi [AudioEffectSpectrumAnalyzer] pour l'analyse spectrale de l'audio " +"en temps réel.\n" +"[b]Note :[/b] En raison des contraintes de performance, il est préférable " +"d'utiliser cette classe à partir de code C# ou d'un langage compilée via " +"GDNative. Si vous souhaitez tout de même utiliser cette classe avec " +"GDScript, envisagez d'utiliser une fréquence [member mix_rate] plus faible " +"comme 11025 Hz ou 22050 Hz." #: doc/classes/AudioStreamGenerator.xml msgid "" @@ -13068,6 +13152,11 @@ msgid "" "resulting in increased CPU usage and more risk for audio cracking if the CPU " "can't keep up." msgstr "" +"La longueur de la mémoire tampon à générer (en secondes). Les valeurs " +"inférieures entraînent moins de latence, mais exigent que le script génère " +"les données audio plus rapidement, ce qui entraîne une utilisation plus " +"important du CPU et plus de risques de craquements audio si le CPU n'est pas " +"assez puissant." #: doc/classes/AudioStreamGenerator.xml msgid "" @@ -13130,6 +13219,11 @@ msgid "" "added again. Therefore, make sure your script can always generate and push " "new audio frames fast enough to avoid audio cracking." msgstr "" +"Retourne le nombre de frames de données audio restantes à jouer. Si ce " +"nombre atteint [code]0[/code], l'audio cessera de jouer jusqu'à ce que de " +"nouvelles frames soient ajoutés. Par conséquent, assurez-vous que votre " +"script peut toujours générer et pousser de nouveaux frames audio assez " +"rapidement pour éviter les craquements audio." #: doc/classes/AudioStreamGeneratorPlayback.xml msgid "" @@ -13137,6 +13231,10 @@ msgid "" "efficient than [method push_frame] in C# and compiled languages via " "GDNative, but [method push_buffer] may be [i]less[/i] efficient in GDScript." msgstr "" +"Ajoute plusieurs frames de données audio dans la mémoire tampon. Ceci est " +"généralement plus efficace que [method push_frame] pour le C# et les " +"langages compilés avec GDNative, mais [method push_buffer] peut être " +"[i]moins[/i] efficace avec GDScript." #: doc/classes/AudioStreamGeneratorPlayback.xml msgid "" @@ -13144,6 +13242,10 @@ msgid "" "efficient than [method push_buffer] in C# and compiled languages via " "GDNative, but [method push_frame] may be [i]more[/i] efficient in GDScript." msgstr "" +"Ajouter une seule frame de données audio dans la mémoire tampon. Ceci est " +"généralement moins efficace que [method push_buffer] pour le C# et les " +"langages compilés avec GDNative, mais [method push_frame] peut être " +"[i]moins[/i] efficace avec GDScript." #: modules/minimp3/doc_classes/AudioStreamMP3.xml #, fuzzy @@ -13167,7 +13269,7 @@ msgstr "" #: modules/minimp3/doc_classes/AudioStreamMP3.xml #: modules/stb_vorbis/doc_classes/AudioStreamOGGVorbis.xml msgid "Time in seconds at which the stream starts after being looped." -msgstr "" +msgstr "Le temps en secondes où le flux commence après avoir bouclé." #: modules/stb_vorbis/doc_classes/AudioStreamOGGVorbis.xml msgid "OGG Vorbis audio stream driver." @@ -13182,6 +13284,8 @@ msgid "" "Can play, loop, pause a scroll through audio. See [AudioStream] and " "[AudioStreamOGGVorbis] for usage." msgstr "" +"Peut jouer, boucler, faire pause dans l'audio. Voir [AudioStream] et " +"[AudioStreamOGGVorbis] pour l'utilisation." #: doc/classes/AudioStreamPlayer.xml msgid "Plays back audio non-positionally." @@ -13193,6 +13297,9 @@ msgid "" "To play audio positionally, use [AudioStreamPlayer2D] or " "[AudioStreamPlayer3D] instead of [AudioStreamPlayer]." msgstr "" +"Joue un flux audio indépendamment de la position.\n" +"Pour jouer audio en fonction de la position, utilisez [AudioStreamPlayer2D] " +"ou [AudioStreamPlayer3D] au lieu de [AudioStreamPlayer]." #: doc/classes/AudioStreamPlayer.xml msgid "Returns the position in the [AudioStream] in seconds." @@ -13281,6 +13388,7 @@ msgstr "L'audio sera joué sur tous les canaux surround." msgid "" "The audio will be played on the second channel, which is usually the center." msgstr "" +"L'audio sera joué sur le deuxième canal, qui est généralement le centre." #: doc/classes/AudioStreamPlayer2D.xml msgid "Plays positional sound in 2D space." @@ -13295,6 +13403,13 @@ msgid "" "[member volume_db] to a very low value like [code]-100[/code] (which isn't " "audible to human hearing)." msgstr "" +"Joue l'audio étant amortit suivan la distance du centre d'écran.\n" +"Voir aussi [AudioStreamPlayer] pour jouer un son indépendemment de la " +"position.\n" +"[b]Note :[/b] Masquer un nœud [AudioStreamPlayer2D] ne désactive pas sa " +"sortie audio. Pour désactiver temporairement la sortie audio d'un " +"[AudioStreamPlayer2D], choisissez une valeur très basse pour [member " +"volume_db] comme [code]-100[/code] (qui n'est pas audible humainement)." #: doc/classes/AudioStreamPlayer2D.xml doc/classes/AudioStreamPlayer3D.xml msgid "Returns the position in the [AudioStream]." @@ -13324,6 +13439,12 @@ msgid "" "\"water\" area so that sounds played in the water are redirected through an " "audio bus to make them sound like they are being played underwater." msgstr "" +"Détermine quelles calques du [Area2D] affectent le son pour les effets de " +"réverbération et du bus audio. Les zones peuvent être utilisées pour " +"rediriger le [AudioStream] afin qu'ils soient joués dans un certain bus " +"audio. Un exemple de la façon dont vous pouvez utiliser ceci est de faire " +"une zone \"eau\" de sorte que les sons joués dans l'eau sont redirigés par " +"un bus audio pour les faire sonner comme ils étaient joués sous l'eau." #: doc/classes/AudioStreamPlayer2D.xml msgid "Dampens audio over distance with this as an exponent." @@ -13399,6 +13520,10 @@ msgid "" "disable the dampening effect entirely, set this to [code]20500[/code] as " "this frequency is above the human hearing limit." msgstr "" +"Amortit l'audio en utilisant un filtre passe-bas au-dessus de la fréquence " +"spécifiée, en Hz. Pour désactiver entièrement l'effet d'amortissement, " +"définissez la fréquence à [code]20500[/code] car cette fréquence est " +"supérieure à la limite de l'audition humaine." #: doc/classes/AudioStreamPlayer3D.xml msgid "Amount how much the filter affects the loudness, in decibels." @@ -13579,6 +13704,13 @@ msgid "" "This class can also be used to store dynamically-generated PCM audio data. " "See also [AudioStreamGenerator] for procedural audio generation." msgstr "" +"AudioStreamSample stocke des échantillons sonores chargés depuis des " +"fichiers WAV. Pour jouer le son enregistré, utilisez un [AudioStreamPlayer] " +"(pour l'audio indépendamment de la position) ou AudioStreamPlayer2D]/" +"[AudioStreamPlayer3D (en fonction de la position). Le son peut être bouclé.\n" +"Cette classe peut également être utilisée pour stocker des données audio " +"dynamiques au format PCM. Voir aussi [AudioStreamGenerator] pour la " +"génération audio procédurale." #: doc/classes/AudioStreamSample.xml msgid "" @@ -13587,6 +13719,11 @@ msgid "" "[b]Note:[/b] A [code].wav[/code] extension is automatically appended to " "[code]path[/code] if it is missing." msgstr "" +"Enregistre le AudioStreamSample dans un fichier WAV à l'emplacement " +"[code]path[/code]. Les échantillons au format IMA ADPCM peuvent être " +"enregistrés.\n" +"[b]Note :[/b] L'extension [code].wav[/code] est automatiquement ajoutée au " +"[code]path[/code] si elle manque." #: doc/classes/AudioStreamSample.xml msgid "" @@ -13594,6 +13731,10 @@ msgid "" "[b]Note:[/b] This property expects signed PCM8 data. To convert unsigned " "PCM8 to signed PCM8, subtract 128 from each byte." msgstr "" +"Contient les données audio en octets.\n" +"[b]Note :[/b] Cette propriété s'attend à des données PCM8 signées. Pour " +"convertir des PCM8 non signés en PCM8, il faut soustraire 128 de chaque " +"octet." #: doc/classes/AudioStreamSample.xml msgid "Audio format. See [enum Format] constants for values." @@ -13607,6 +13748,9 @@ msgid "" "sample). This information will be imported automatically from the WAV file " "if present." msgstr "" +"Le point de départ de la boucle (en nombre de frames depuis le début de " +"l'échantillon). Ces informations seront automatiquement importées depuis le " +"fichier WAV si elles y sont présentes." #: doc/classes/AudioStreamSample.xml msgid "" @@ -13614,12 +13758,18 @@ msgid "" "sample). This information will be imported automatically from the WAV file " "if present." msgstr "" +"Le point de fin de la boucle (en nombre de frames depuis le début de " +"l'échantillon). Ces informations seront automatiquement importées depuis le " +"fichier WAV si elles y sont présentes." #: doc/classes/AudioStreamSample.xml msgid "" "The loop mode. This information will be imported automatically from the WAV " "file if present. See [enum LoopMode] constants for values." msgstr "" +"Le mode de boucle. Ces informations seront automatiquement importées depuis " +"fichier WAV si elles y sont présentes. Voir les constantes [enum LoopMode] " +"pour les valeurs possibles." #: doc/classes/AudioStreamSample.xml msgid "" @@ -13683,6 +13833,8 @@ msgid "" "Audio loops the data between [member loop_begin] and [member loop_end], " "playing back and forth." msgstr "" +"Les données audio bouclent entre [member loop_begin] et [member loop_end], " +"jouant en arrière puis en avant." #: doc/classes/AudioStreamSample.xml msgid "" @@ -13698,6 +13850,9 @@ msgid "" "accessed in your shader scripts through the " "[code]texture(SCREEN_TEXTURE, ...)[/code] function." msgstr "" +"Copie une région de l'écran (ou l'écran entier) vers une mémoire tampon afin " +"qu'il puisse être accédé dans vos shaders avec la fonction " +"[code]texture(SCREEN_TEXTURE, ...)[/code]." #: doc/classes/BackBufferCopy.xml msgid "" @@ -13801,6 +13956,17 @@ msgid "" "[b]Note:[/b] [member bounce_indirect_energy] only has an effect if [member " "bounces] is set to a value greater than or equal to [code]1[/code]." msgstr "" +"Le multiplicateur d'énergie à chaque rebond. Des valeurs plus élevées " +"rendront l'éclairage indirect plus lumineux. Une valeur de [code]1.0[/code] " +"représente un comportement physiquement réaliste, mais des valeurs plus " +"élevées peuvent être utilisées pour rendre l'éclairage indirect plus visible " +"avec un faible nombre de rebonds. Cela peut être utilisé pour accélérer les " +"temps de calcul des lumières en réduisant le nombre de [member bounces] puis " +"en augmentant [member bounce_indirect_energy]. Contrairement à [member " +"BakedLightmapData.energy], cette propriété n'affecte pas l'éclairage direct " +"émis par les lumières, les matériaux avec émission et l'environnement.\n" +"[b]Note :[/b] [member bounce_indirect_energy] a seulement un effet si " +"[member bounces] est à une valeur supérieure ou égale à [code]1[/code]." #: doc/classes/BakedLightmap.xml msgid "" @@ -13850,6 +14016,9 @@ msgid "" "[constant ENVIRONMENT_MODE_CUSTOM_COLOR] or [constant " "ENVIRONMENT_MODE_CUSTOM_SKY]." msgstr "" +"Le facteur d'énergie lorsque [member environment_mode] est défini à " +"[constant ENVIRONMENT_MODE_CUSTOM_COLOR] ou [constant " +"ENVIRONMENT_MODE_CUSTOM_SKY]." #: doc/classes/BakedLightmap.xml msgid "" @@ -14027,17 +14196,25 @@ msgid "" "directly (it doesn't display anything). Other types of buttons inherit from " "it." msgstr "" +"BaseButton est la classe de base abstraite pour les boutons, elle ne doit " +"donc pas être utilisée directement (elle ne montre rien du tout). D'autres " +"types de boutons héritent de cette classe." #: doc/classes/BaseButton.xml msgid "" "Called when the button is pressed. If you need to know the button's pressed " "state (and [member toggle_mode] is active), use [method _toggled] instead." msgstr "" +"Appelé quand le bouton est pressé. Si vous avez besoin de connaître l'état " +"du bouton activé (et que [member toggle_mode] est actif), utilisez plutôt " +"[méthode _toggled]." #: doc/classes/BaseButton.xml msgid "" "Called when the button is toggled (only if [member toggle_mode] is active)." msgstr "" +"Appelé quand un bouton est basculé (seulement si [member toggle_mode] est " +"actif)." #: doc/classes/BaseButton.xml msgid "" @@ -14046,6 +14223,10 @@ msgid "" "to \"draw\" signal. The visual state of the button is defined by the [enum " "DrawMode] enum." msgstr "" +"Retourne l'état visuel utilisé pour dessiner le bouton. Ceci est utile " +"surtout pour implémenter votre propre code d'affichage en surchargeant " +"_draw() ou en se connectant au signal \"draw\". L'état visuel du bouton est " +"défini par l'enumération [enum DrawMode]." #: doc/classes/BaseButton.xml #, fuzzy @@ -14065,6 +14246,13 @@ msgid "" "[b]Note:[/b] This method doesn't unpress other buttons in its button [member " "group]." msgstr "" +"Change l'état [member pressed] du bouton, sans émettre le signal [signal " +"toggled]. Utilisez lorsque vous voulez simplement changer l'état du bouton " +"sans envoyer l'événement quand il est manuellement pressé (par exemple au " +"moment de l'initialisation de la scène). Fonctionne seulement si [member " +"toggle_mode] est [code]true[/code].\n" +"[b]Note :[/b] Cette méthode ne déselectionne pas les autres boutons dans son " +"[member group]." #: doc/classes/BaseButton.xml msgid "" @@ -14080,12 +14268,18 @@ msgid "" "To allow both left-click and right-click, use [code]BUTTON_MASK_LEFT | " "BUTTON_MASK_RIGHT[/code]." msgstr "" +"La masque binaire pour choisir quels boutons de clic de la souris permet " +"d'appuyer sur ce bouton.\n" +"Pour permettre à la fois le clic gauche et le clic droit, utilisez " +"[code]BUTTON_MASK_LEFT | BUTTON_MASK_RIGHT[/code]." #: doc/classes/BaseButton.xml msgid "" "If [code]true[/code], the button is in disabled state and can't be clicked " "or toggled." msgstr "" +"Si [code]true[/code], le bouton est désactivé et il ne peut donc pas être " +"appuyé ou basculé." #: doc/classes/BaseButton.xml msgid "" @@ -14093,6 +14287,9 @@ msgid "" "will be removed in Godot 4.0. This property no longer has any effect when " "set. Please use [member Control.focus_mode] instead." msgstr "" +"[i]Obsolète.[/i] Cette propriété est obsolète en raison de sa redondance et " +"sera enlevée dans Godot 4.0. Cette propriété n'a plus d'effet quand elle est " +"définie. Veuillez plutôt utiliser [member Control.focus_mode]." #: doc/classes/BaseButton.xml msgid "[ButtonGroup] associated to the button." @@ -14106,6 +14303,11 @@ msgid "" "Signals will be emitted at the same moment regardless of this property's " "value." msgstr "" +"Si [code]true[/code], le bouton reste pressé quand le clic est maintenu mais " +"que le curseur est déplacé en dehors du bouton.\n" +"[b]Note :[/b] Cette propriété n'affecte que l'aspect visuel du bouton. Les " +"signaux seront toujours émis au même moment, peu importe la valeur de cette " +"propriété." #: doc/classes/BaseButton.xml msgid "" @@ -14116,6 +14318,12 @@ msgid "" "emitted. If you want to change the pressed state without emitting that " "signal, use [method set_pressed_no_signal]." msgstr "" +"Si [code]true[/code], l'état du bouton est appuyé. Ce qui signifie que le " +"bouton est soit appuyé ou basculé (si [member toggle_mode] est actif). Ne " +"fonctionne que si [member toggle_mode] est [code]true[/code].\n" +"[b]Note :[/b] Activer [member pressed] émettra le signal [signal toggled]. " +"Si vous voulez changer l'état pressé sans émettre ce signal, utilisez plutôt " +"[method set_pressed_no_signal]." #: doc/classes/BaseButton.xml msgid "[ShortCut] associated to the button." @@ -14164,6 +14372,8 @@ msgid "" "The normal state (i.e. not pressed, not hovered, not toggled and enabled) of " "buttons." msgstr "" +"L'état normal (c'est-à-dire non pressé, non survolé, non basculé ni activé) " +"des boutons." #: doc/classes/BaseButton.xml msgid "The state of buttons are pressed." @@ -14210,6 +14420,17 @@ msgid "" "For more information, read the \"Matrices and transforms\" documentation " "article." msgstr "" +"Une matrice 3×3 utilisée pour la rotation et la mise à l'échelle en 3D. " +"Presque toujours utilisé comme base orthogonale pour une Transform.\n" +"Contient 3 champs vectoriels X, Y et Z qui composent ses colonnes, qui sont " +"généralement interprétées comme les vecteurs de base locaux d'une " +"transformation. Pour une telle utilisation, c'est composé d'une mise à " +"l'échelle et d'une matrice de rotation, dans cet ordre (M = R.S)\n" +"Peut également être accessible comme un tableau de vecteurs 3D. Ces vecteurs " +"sont normalement orthogonaux l'un avec l'autre, mais ne sont pas " +"nécessairement normalisés (en raison de la mise à l'échelle).\n" +"Pour plus d'informations, lisez l'article de documentation « Matrices et " +"transformations »." #: doc/classes/Basis.xml doc/classes/Transform.xml doc/classes/Transform2D.xml msgid "Matrices and transforms" @@ -14221,7 +14442,6 @@ msgstr "Utiliser les transformations 3D" #: doc/classes/Basis.xml doc/classes/Line2D.xml doc/classes/Transform.xml #: doc/classes/Transform2D.xml doc/classes/Vector2.xml doc/classes/Vector3.xml -#, fuzzy msgid "Matrix Transform Demo" msgstr "Démo de transformation matricielle" @@ -14256,16 +14476,21 @@ msgid "" "Consider using the [Quat] constructor instead, which uses a quaternion " "instead of Euler angles." msgstr "" +"Construit une matrice de base de rotation pure à partir des angles d'Euler " +"spécifiés (suivant la convention YXZ : lors de la *composition*, d'abord Y, " +"puis X, et enfin Z), qui sont donnés dans un vecteur comme (angle X, angle " +"Y, angle Z).\n" +"Vous pouvez considérer l'utilisation du constructeur [Quat], qui utilise un " +"quaternion au lieu des angles d'Euler." #: doc/classes/Basis.xml -#, fuzzy msgid "" "Constructs a pure rotation basis matrix, rotated around the given " "[code]axis[/code] by [code]angle[/code] (in radians). The axis must be a " "normalized vector." msgstr "" -"Construit un quaternion qui tournera autour de l'axe donné selon l'angle " -"spécifié. L'axe doit être un vecteur normalisé." +"Construit un quaternion qui tournera autour de l'axe [code]axis[/code] par " +"[code]angle[/code] (en radians). L'axe doit être un vecteur normalisé." #: doc/classes/Basis.xml msgid "Constructs a basis matrix from 3 axis vectors (matrix columns)." @@ -14387,18 +14612,24 @@ msgid "" "The basis matrix's X vector (column 0). Equivalent to array index [code]0[/" "code]." msgstr "" +"Le vecteur X (la colonne 0) de la matrice de la base. Équivalent à l'index " +"de tableau [code]0[/code]." #: doc/classes/Basis.xml doc/classes/Transform2D.xml msgid "" "The basis matrix's Y vector (column 1). Equivalent to array index [code]1[/" "code]." msgstr "" +"Le vecteur Y (la colonne 1) de la matrice de la base. Équivalent à l'index " +"de tableau [code]1[/code]." #: doc/classes/Basis.xml msgid "" "The basis matrix's Z vector (column 2). Equivalent to array index [code]2[/" "code]." msgstr "" +"Le vecteur Z (la colonne 2) de la matrice de la base. Équivalent à l'index " +"de tableau [code]2[/code]." #: doc/classes/Basis.xml msgid "" @@ -14407,24 +14638,34 @@ msgid "" "This constant can be used to make your code clearer, and for consistency " "with C#." msgstr "" +"La base d'identité, sans rotation ni mise à l'échelle.\n" +"Ceci est identique à [code]Basis()[/code] sans aucun paramètre. Cette " +"constante peut être utilisée pour que votre code soit plus clair, et pour la " +"cohérence avec C#." #: doc/classes/Basis.xml msgid "" "The basis that will flip something along the X axis when used in a " "transformation." msgstr "" +"La base qui appliquera un effet miroir suivant l'axe X lorsqu'elle est " +"utilisée dans une transformation." #: doc/classes/Basis.xml msgid "" "The basis that will flip something along the Y axis when used in a " "transformation." msgstr "" +"La base qui appliquera un effet miroir suivant l'axe Y lorsqu'elle est " +"utilisée dans une transformation." #: doc/classes/Basis.xml msgid "" "The basis that will flip something along the Z axis when used in a " "transformation." msgstr "" +"La base qui appliquera un effet miroir suivant l'axe Z lorsqu'elle est " +"utilisée dans une transformation." #: doc/classes/BitMap.xml msgid "Boolean matrix." @@ -14436,6 +14677,10 @@ msgid "" "a binary matrix (every matrix element takes only one bit) and query the " "values using natural cartesian coordinates." msgstr "" +"Un tableau bidimensionnel de valeurs booléennes, peut être utilisé pour " +"stocker efficacement une matrice binaire (chaque élément matrice ne contient " +"qu'un bit) et faire des requêtes sur ces valeurs à l'aide de coordonnées " +"naturelles cartésiennes." #: doc/classes/BitMap.xml msgid "" @@ -14444,6 +14689,10 @@ msgid "" "are being converted into white pixels, and [code]false[/code] bits into " "black." msgstr "" +"Retourne une image de la même taille que la bitmap au format [enum.Format] " +"du type [code]FORMAT_L8[/code]. Les valeurs [code]true[/code] de l'image " +"seront converties en pixels blancs, et les valeurs [code]false[/code] en " +"noir." #: doc/classes/BitMap.xml msgid "" @@ -14459,6 +14708,10 @@ msgid "" "that position is equal to [code]threshold[/code] or less, and [code]true[/" "code] in other case." msgstr "" +"Crée un bitmap qui correspond aux dimensions de l'image donnée, chaque " +"élément du bitmap sera remplacé par [code]false[/code] si l'opacité de ce " +"pixel est inférieur ou égal à [code]threshold[/code], et [code]true[/code] " +"sinon." #: doc/classes/BitMap.xml msgid "Returns bitmap's value at the specified position." @@ -14481,6 +14734,12 @@ msgid "" "area where the morphological operation is applied. Pixels located outside " "the [code]rect[/code] are unaffected by [method grow_mask]." msgstr "" +"Applique une dilatation ou une érosion morphologique du bitmap. Si " +"[code]pixels[/code] est positif, une dilatation est appliquée au bitmap. Si " +"[code]pixels[/code] est négatif, une érosion est appliquée. [code]rect[/" +"code] définit la zone où l'opération morphologique est appliquée. Les pixels " +"situés à l'extérieur du [code]rect[/code] ne sont pas affectés par [method " +"grow_mask]." #: doc/classes/BitMap.xml msgid "Resizes the image to [code]new_size[/code]." @@ -14607,6 +14866,9 @@ msgid "" "Returns the node's [member rest] [code]Transform2D[/code] if it doesn't have " "a parent, or its rest pose relative to its parent." msgstr "" +"Retourne la [code]Transform2D[/code] du nœud pour la position de repos " +"[member rest] s'il n'a pas de parent, ou si sa position de repos est " +"relative à son parent." #: doc/classes/Bone2D.xml msgid "" @@ -14633,6 +14895,9 @@ msgid "" "for this node to attach to. The BoneAttachment node will copy the transform " "of the selected bone." msgstr "" +"Ce nœud doit être l'enfant d'un nœud [Skeleton]. Vous pouvez alors " +"sélectionner un os pour que ce nœud soit attaché. Le nœud BoneAttachment " +"copiera la transformation de l'os sélectionné." #: doc/classes/BoneAttachment.xml msgid "The name of the attached bone." @@ -14767,6 +15032,11 @@ msgid "" "Examples: [code]bool(\"False\")[/code] returns [code]true[/code], " "[code]bool(\"\")[/code] returns [code]false[/code]." msgstr "" +"Convertit une valeur [String] en valeur booléenne, cette méthode retournera " +"[code]false[/code] si [code]\"\"[/code] est donné, et [code]true[/code] pour " +"toute chaîne non vide.\n" +"Exemples : [code]bool(\"False\")[/code] retourne [code]true[/code], " +"[code]bool(\"\")[/code] retourne [code]false[/code]." #: doc/classes/BoxContainer.xml msgid "Base class for box containers." @@ -14777,12 +15047,16 @@ msgid "" "Arranges child controls vertically or horizontally, and rearranges the " "controls automatically when their minimum size changes." msgstr "" +"Arrange les contrôles enfants verticalement ou horizontalement, et " +"réorganise les contrôles automatiquement lorsque leur taille minimale change." #: doc/classes/BoxContainer.xml msgid "" "Adds a control to the box as a spacer. If [code]true[/code], [code]begin[/" "code] will insert the spacer control in front of other children." msgstr "" +"Ajoute un contrôle à la boîte comme espace. Si [code]true[/code], " +"[code]begin[/code] insérera le contrôle d'espace devant les autres enfants." #: doc/classes/BoxContainer.xml msgid "" @@ -14819,20 +15093,22 @@ msgstr "" #: doc/classes/RigidBody.xml doc/classes/SphereShape.xml #: doc/classes/StaticBody.xml msgid "3D Physics Tests Demo" -msgstr "" +msgstr "Démo des tests de physique 3D" #: doc/classes/BoxShape.xml doc/classes/CollisionShape.xml #: modules/gridmap/doc_classes/GridMap.xml doc/classes/KinematicBody.xml #: doc/classes/Mesh.xml doc/classes/MeshInstance.xml #: doc/classes/MeshLibrary.xml msgid "3D Kinematic Character Demo" -msgstr "" +msgstr "Démo de caractère cinématique 3D" #: doc/classes/BoxShape.xml msgid "" "The box's half extents. The width, height and depth of this shape is twice " "the half extents." msgstr "" +"La demi-étendue de la boîte. La largeur, la hauteur et la profondeur de " +"cette forme sont deux fois plus larges." #: doc/classes/Button.xml msgid "Standard themed Button." @@ -14893,7 +15169,7 @@ msgstr "" #: doc/classes/PoolStringArray.xml doc/classes/ProjectSettings.xml #: doc/classes/ResourceLoader.xml doc/classes/RichTextLabel.xml msgid "OS Test Demo" -msgstr "" +msgstr "Démo de test de système d'exploitation" #: doc/classes/Button.xml msgid "" @@ -14909,12 +15185,17 @@ msgid "" "clipped, when disabled the Button will always be wide enough to hold the " "text." msgstr "" +"Lorsque cette propriété est activée, un texte trop grand pour ce bouton sera " +"tronqué, et lorsque le bouton est désactivé, il sera toujours assez grand " +"pour contenir tout le texte." #: doc/classes/Button.xml msgid "" "When enabled, the button's icon will expand/shrink to fit the button's size " "while keeping its aspect." msgstr "" +"Lorsque actif, l'icône du bouton s'étendra/se réduira selon la taille du " +"bouton et gardera son aspect." #: doc/classes/Button.xml msgid "Flat buttons don't display decoration." @@ -14927,6 +15208,11 @@ msgid "" "property of [Button] and [code]content_margin_*[/code] properties of the " "used [StyleBox]es." msgstr "" +"L'icône du bouton, si le texte est présent, l'icône sera placée avant le " +"texte.\n" +"Pour modifier la marge et l'espacement de l'icône, utilisez la propriété " +"[code]hseparation[/code] du thème pour le [Button] et les propriétés " +"[code]content_margin_*[/code] de la [StyleBox] utilisée." #: doc/classes/Button.xml msgid "" @@ -14934,6 +15220,10 @@ msgid "" "button. Uses the same [enum TextAlign] constants as the text alignment. If " "centered, text will draw on top of the icon." msgstr "" +"Spécifie si l'icône doit être alignée sur la gauche, la droite ou au centre " +"d'un bouton. Utilisez les mêmes constantes [enum TextAlign] que pour " +"l'alignement du texte. Si l'icône est centrée, elle sera affichée sous le " +"texte." #: doc/classes/Button.xml doc/classes/LinkButton.xml msgid "The button's text that will be displayed inside the button's area." @@ -14965,6 +15255,9 @@ msgid "" "text color of the button. Disabled, hovered, and pressed states take " "precedence over this color." msgstr "" +"La [Color] du texte utilisée lorsque le [Button] a le focus. Ne fait que " +"remplacer la couleur normale du texte du bouton. Les couleurs définies pour " +"les états désactivé, survolé et pressé sont prioritaires sur cette couleur." #: doc/classes/Button.xml msgid "Text [Color] used when the [Button] is being hovered." @@ -14992,6 +15285,9 @@ msgid "" "current [StyleBox], so using [StyleBoxEmpty] will just disable the focus " "visual effect." msgstr "" +"La [StyleBox] utilisée lorsque le [Button] a le focus. Elle est affichée par " +"dessus la [StyleBox] actuelle, donc en utilisant [StyleBoxEmpty], ne fera " +"que désactiver l'effet visuel quand le bouton a le focus." #: doc/classes/Button.xml msgid "[StyleBox] used when the [Button] is being hovered." @@ -15015,6 +15311,10 @@ msgid "" "Only one allows being pressed.\n" "[member BaseButton.toggle_mode] should be [code]true[/code]." msgstr "" +"Un groupe de [Button]. Tous les boutons enfants directs et indirects " +"deviennent des boutons radios. Un seul de ces boutons peut être pressé à la " +"fois.\n" +"[member BaseButton.toggle_mode] devrait être [code]true[/code]." #: doc/classes/ButtonGroup.xml msgid "" @@ -15098,6 +15398,9 @@ msgid "" "[code]enable_next[/code] is [code]true[/code], request to make the next " "camera current, if any." msgstr "" +"Si c'est la caméra actuelle, elle ne sera plus l'actuelle. Si " +"[code]enable_next[/code] est [code]true[/code], passe à la caméra suivante " +"pour la rendre actuelle, s'il y en a une." #: doc/classes/Camera.xml msgid "Returns the camera's RID from the [VisualServer]." @@ -15110,6 +15413,10 @@ msgid "" "to the position and orientation of the camera by subclassed cameras such as " "[ClippedCamera], [InterpolatedCamera] and [ARVRCamera]." msgstr "" +"Retourne la transformation de la caméra avec les décalages vertical ([member " +"v_offset]) et horizontal ([member h_offset]) ; et tout autre ajustement " +"apporté à la position et à l'orientation de la caméra par les sous-classes " +"de caméra comme [ClippedCamera], [InterpolatedCamera] et [ARVRCamera]." #: doc/classes/Camera.xml msgid "" @@ -15539,6 +15846,9 @@ msgid "" "The custom [Viewport] node attached to the [Camera2D]. If [code]null[/code] " "or not a [Viewport], uses the default viewport instead." msgstr "" +"Le nœud [Viewport] personnalisé attaché à la [Camera2D]. Si [code]null[/" +"code] ou que ça n'est pas un [Viewport], ça utilise la fenêtre d'affichage " +"par défaut à la place." #: doc/classes/Camera2D.xml msgid "" @@ -15627,6 +15937,13 @@ msgid "" "without smoothing, even with this setting enabled, invoke [method " "reset_smoothing]." msgstr "" +"Si [code]true[/code], la caméra s'arrête en douceur quand elle atteint ses " +"limites.\n" +"Cette propriété n'a aucun effet si [member smoothing_enabled] est " +"[code]false[/code].\n" +"[b]Note :[/b] Pour mettre immédiatement à jour la position de la caméra " +"activée sans ralenti, même avec ce réglage activé, appelez [method " +"reset_smoothing]." #: doc/classes/Camera2D.xml msgid "" @@ -15679,6 +15996,8 @@ msgid "" "Speed in pixels per second of the camera's smoothing effect when [member " "smoothing_enabled] is [code]true[/code]." msgstr "" +"La vitesse en pixels par seconde de l'effet de ralenti de la caméra quand " +"[member smoothing_enabled] est [code]true[/code]." #: doc/classes/Camera2D.xml msgid "" @@ -15687,6 +16006,10 @@ msgid "" "example, use [code]Vector2(0.5, 0.5)[/code] for a 2× zoom-in, and " "[code]Vector2(4, 4)[/code] for a 4× zoom-out." msgstr "" +"Le zoom de l'appareil photo relatif à la fenêtre d'affichage. Les valeurs " +"supérieures à [code]Vector2(1, 1)[/code] font un zoom arrière et les valeurs " +"plus petites un zoom avant. Par exemple, utilisez [code]Vector2(0.5, 0.5)[/" +"code] pour un zoom à 50%, et [code]Vector2(4, 4)[/code] pour un zoom 4×." #: doc/classes/Camera2D.xml msgid "" @@ -15705,10 +16028,12 @@ msgstr "" "et la taille de l'écran." #: doc/classes/Camera2D.xml doc/classes/ClippedCamera.xml +#: doc/classes/InterpolatedCamera.xml msgid "The camera updates with the [code]_physics_process[/code] callback." msgstr "La caméra se met à jour avec le rappel [code]_physics_process[/code]." #: doc/classes/Camera2D.xml doc/classes/ClippedCamera.xml +#: doc/classes/InterpolatedCamera.xml msgid "The camera updates with the [code]_process[/code] callback." msgstr "La caméra se met à jour durant l'appel de [code]_process[/code]." @@ -16082,6 +16407,8 @@ msgid "" "Draws a [Mesh] in 2D, using the provided texture. See [MeshInstance2D] for " "related documentation." msgstr "" +"Dessine un [Mesh] en 2D, en utilisant la texture spécifiée. Voir " +"[MeshInstance2D] pour la documentation en rapport." #: doc/classes/CanvasItem.xml msgid "" @@ -16143,6 +16470,8 @@ msgid "" "Draws a [MultiMesh] in 2D with the provided texture. See " "[MultiMeshInstance2D] for related documentation." msgstr "" +"Dessine un [MultiMesh] en 2D avec la texture spécifiée. Voir " +"[MultiMeshInstance2D] pour la documentation en rapport." #: doc/classes/CanvasItem.xml msgid "" @@ -16381,6 +16710,8 @@ msgid "" "Returns the mouse's position in the [CanvasLayer] that this [CanvasItem] is " "in using the coordinate system of the [CanvasLayer]." msgstr "" +"Retourne la position de la souris dans le [CanvasLayer] que ce [CanvasItem] " +"utilise suivant le système de coordonnées du [CanvasLayer]." #: doc/classes/CanvasItem.xml msgid "Returns the global transform matrix of this item." @@ -16398,6 +16729,8 @@ msgid "" "Returns the mouse's position in this [CanvasItem] using the local coordinate " "system of this [CanvasItem]." msgstr "" +"Retourne la position de la souris dans le [CanvasItem] en utilisant le " +"système de coordonnées local au [CanvasItem]." #: doc/classes/CanvasItem.xml msgid "Returns the transform matrix of this item." @@ -16422,6 +16755,8 @@ msgid "" "Hide the [CanvasItem] if it's currently visible. This is equivalent to " "setting [member visible] to [code]false[/code]." msgstr "" +"Cacher les [CanvasItem] s'ils sont actuellement visibles. C'est équivalent à " +"[member visible] à [code]false[/code]." #: doc/classes/CanvasItem.xml msgid "" @@ -16436,6 +16771,8 @@ msgid "" "Returns [code]true[/code] if the node is set as top-level. See [method " "set_as_toplevel]." msgstr "" +"Retourne [code]true[/code] si le nœud est défini comme de niveau supérieur. " +"Voir [méthode set_as_toplevel]." #: doc/classes/CanvasItem.xml msgid "" @@ -16452,16 +16789,24 @@ msgid "" "also visible. If any antecedent is hidden, this node will not be visible in " "the scene tree." msgstr "" +"Retourne [code]true[/code] si le nœud est présent dans le [SceneTree], que " +"sa propriété [member visible] est [code]true[/code] et que tous ses parents " +"sont également visibles. Si un parent est caché, ce nœud ne sera pas visible " +"dans l'arborescence de la scène." #: doc/classes/CanvasItem.xml msgid "Assigns [code]screen_point[/code] as this node's new local transform." msgstr "" +"Assigne [code]screen_point[/code] comme la nouvelle position locale de ce " +"nœud." #: doc/classes/CanvasItem.xml msgid "" "Transformations issued by [code]event[/code]'s inputs are applied in local " "space instead of global space." msgstr "" +"Les transformations émises par les entrées de [code]event[/code] sont " +"appliquées dans l'espace local au lieu de l'espace global." #: doc/classes/CanvasItem.xml msgid "" @@ -16503,12 +16848,18 @@ msgid "" "[Popup], the correct way to make them visible is to call one of the multiple " "[code]popup*()[/code] functions instead." msgstr "" +"Affiche le [CanvasItem] s'il est actuellement caché. Ceci est équivalent à " +"[member visible] à [code]true[/code]. Pour les contrôles hérités de [Popup], " +"appelez plutôt l'une des fonctions [code]popup*()[/code] pour le rendre " +"visible." #: doc/classes/CanvasItem.xml msgid "" "Queue the [CanvasItem] for update. [constant NOTIFICATION_DRAW] will be " "called on idle time to request redraw." msgstr "" +"Ajoute le [CanvasItem] pour être mis à jour. [constant NOTIFICATION_DRAW] " +"sera émise sur le temps inoccupé pour demander la mise à jour." #: doc/classes/CanvasItem.xml msgid "" @@ -16543,6 +16894,8 @@ msgid "" "If [code]true[/code], the parent [CanvasItem]'s [member material] property " "is used as this one's material." msgstr "" +"Si [code]true[/code], la propriété [member material] du [CanvasItem] parent " +"est utilisée comme matériau de celui-ci." #: doc/classes/CanvasItem.xml msgid "" @@ -16553,12 +16906,21 @@ msgid "" "visible is to call one of the multiple [code]popup*()[/code] functions " "instead." msgstr "" +"Si [code]true[/code], ce [CanvasItem] est affiché. Le nœud n'est visible que " +"si tous ses parents le sont également (en d'autres termes, [méthode " +"is_visible_in_tree] doit retourner [code]true[/code]).\n" +"[b]Note :[/b] Pour les contrôles qui héritent de [Popup], la bonne manière " +"de les rendre visible est plutôt d'appeler l'une des fonctions [code]popup*()" +"[/code]." #: doc/classes/CanvasItem.xml msgid "" "Emitted when the [CanvasItem] must redraw. This can only be connected " "realtime, as deferred will not allow drawing." msgstr "" +"Émis lorsque le [CanvasItem] doit être redessiné. Ça ne peut être que " +"connecté qu'en temps réel, puisque le différer peut ne pas permettre le " +"dessin." #: doc/classes/CanvasItem.xml msgid "Emitted when becoming hidden." @@ -16570,6 +16932,9 @@ msgid "" "or when an action is taking place that may have impacted these boundaries (e." "g. changing [member Sprite.texture])." msgstr "" +"Émis quand la position ou la taille du [Rect2] a changé, ou lorsqu'une " +"action a changé ces valeurs là (par exemple en changeant [member Sprite." +"texture])" #: doc/classes/CanvasItem.xml msgid "Emitted when the visibility (hidden/visible) changes." @@ -16708,6 +17073,7 @@ msgid "" "Render the material using both light and non-light sensitive material " "properties." msgstr "" +"Fait le rendu du matériau avec et sans lumière des propriétés matérielles." #: doc/classes/CanvasItemMaterial.xml msgid "Render the material as if there were no light." @@ -16751,18 +17117,24 @@ msgid "" "Hides any [CanvasItem] under this [CanvasLayer]. This is equivalent to " "setting [member visible] to [code]false[/code]." msgstr "" +"Masque tous les [CanvasItem] dans ce [CanvasLayer]. Ceci est équivalent à " +"définir [member visible] à [code]false[/code]." #: doc/classes/CanvasLayer.xml msgid "" "Shows any [CanvasItem] under this [CanvasLayer]. This is equivalent to " "setting [member visible] to [code]true[/code]." msgstr "" +"Affiche tous les [CanvasItem] dans ce [CanvasLayer]. Ceci est équivalent à " +"définir [member visible] à [code]true[/code]." #: doc/classes/CanvasLayer.xml msgid "" "The custom [Viewport] node assigned to the [CanvasLayer]. If [code]null[/" "code], uses the default viewport instead." msgstr "" +"Le nœud [Viewport] personnalisé assigné au [CanvasLayer]. Si [code]null[/" +"code], ça utilise la fenêtre d'affichage par défaut à la place." #: doc/classes/CanvasLayer.xml msgid "" @@ -16776,6 +17148,10 @@ msgid "" "into the foreground should have increasing scales, while layers moving into " "the background should have decreasing scales." msgstr "" +"Change la mise à l'échelle du calque en utilisant [member " +"follow_viewport_enable]. Les calques se déplaçant au premier plan devraient " +"avoir des mises à l'échelle croissantes, tandis que les calques se déplaçant " +"dans le fond devraient avoir des mises à l'échelle décroissantes." #: doc/classes/CanvasLayer.xml msgid "Layer index for draw order. Lower values are drawn first." @@ -16810,6 +17186,10 @@ msgid "" "Unlike [member CanvasItem.visible], visibility of a [CanvasLayer] isn't " "propagated to underlying layers." msgstr "" +"Si [code]false[/code], tous les [CanvasItem] dans ce [CanvasLayer] sont " +"cachés.\n" +"Contrairement à [member CanvasItem.visible], la visibilité d'un " +"[CanvasLayer] n'est pas propagée aux calques enfants." #: doc/classes/CanvasLayer.xml #, fuzzy @@ -16842,6 +17222,10 @@ msgid "" "[b]Note:[/b] The capsule's total height is equal to [member mid_height] + 2 " "* [member radius]." msgstr "" +"La hauteur de la partie du cylindrique au milieu de la capsule (donc sans " +"les bouts hémisphériques).\n" +"[b]Note :[/b] La hauteur totale de la capsule est égale à [member " +"mid_height] + 2 * [member radius]." #: doc/classes/CapsuleMesh.xml msgid "Number of radial segments on the capsule mesh." @@ -16880,12 +17264,16 @@ msgid "" "CenterContainer keeps children controls centered. This container keeps all " "children to their minimum size, in the center." msgstr "" +"CenterContainer garde centrés les contrôles enfants. Ce conteneur garde tous " +"les enfants à leur taille minimale, dans son centre." #: doc/classes/CenterContainer.xml msgid "" "If [code]true[/code], centers children relative to the [CenterContainer]'s " "top left corner." msgstr "" +"Si [code]true[/code], centre les enfants par rapport au coin supérieur " +"gauche du [CenterContainer])." #: doc/classes/CharFXTransform.xml msgid "" @@ -17190,6 +17578,9 @@ msgid "" "normal text color of the button. Disabled, hovered, and pressed states take " "precedence over this color." msgstr "" +"La couleur du texte du [CheckButton] quand il a le focus. Ne remplace que la " +"couleur de texte normale du bouton. Les états désactivés, survolé et pressés " +"sont prioritaire sur cette couleur." #: doc/classes/CheckButton.xml msgid "The [CheckButton] text's font color when it's hovered." @@ -17209,10 +17600,12 @@ msgstr "La couleur de la police du texte du [CheckButton] quand il est appuyé." #: doc/classes/CheckButton.xml msgid "The vertical offset used when rendering the toggle icons (in pixels)." msgstr "" +"Le décalage vertical utilisé lors du rendu des icônes de basculement (en " +"pixels)." #: doc/classes/CheckButton.xml msgid "The separation between the toggle icon and the text (in pixels)." -msgstr "" +msgstr "La séparation entre l'icône de basculement et le texte (en pixels)." #: doc/classes/CheckButton.xml msgid "The [Font] to use for the [CheckButton] text." @@ -17258,6 +17651,8 @@ msgid "" "The [StyleBox] to display as a background when the [CheckButton] is hovered " "and pressed." msgstr "" +"La [StyleBox] à afficher en fond lorsque le [CheckButton] est survolé et " +"appuyé." #: doc/classes/CheckButton.xml msgid "" @@ -17276,6 +17671,9 @@ msgid "" "small characters and its collision detection with everything else is very " "fast." msgstr "" +"Forme circulaire pour les collisions 2D. Cette forme est utile pour " +"modéliser les boules ou les petits caractères et sa détection des collisions " +"avec les autres éléments est très rapide." #: doc/classes/CircleShape2D.xml msgid "The circle's radius." @@ -17295,6 +17693,8 @@ msgid "" "Returns [code]true[/code] if you can instance objects from the specified " "[code]class[/code], [code]false[/code] in other case." msgstr "" +"Retourne [code]true[/code] si vous pouvez instancer des objets à partir de " +"[code]class[/code], [code]false[/code] dans un autre cas." #: doc/classes/ClassDB.xml msgid "Returns whether the specified [code]class[/code] is available or not." @@ -17305,12 +17705,17 @@ msgid "" "Returns a category associated with the class for use in documentation and " "the Asset Library. Debug mode required." msgstr "" +"Retourne une catégorie associée à la classe à utiliser dans la documentation " +"et la bibliothèque de ressources. Le mode débogage est nécessaire pour " +"récupérer cette information." #: doc/classes/ClassDB.xml msgid "" "Returns an array with all the keys in [code]enum[/code] of [code]class[/" "code] or its ancestry." msgstr "" +"Retourne un tableau avec toutes les clés dans l'énumeration [code]enum[/" +"code] de la [code]class[/code] ou de ses parents." #: doc/classes/ClassDB.xml #, fuzzy @@ -17335,6 +17740,8 @@ msgid "" "Returns an array with the names all the integer constants of [code]class[/" "code] or its ancestry." msgstr "" +"Retourne un tableau avec le nom de toutes les constantes entières de " +"[code]class[/code] ou de son parent." #: doc/classes/ClassDB.xml msgid "" @@ -17347,6 +17754,15 @@ msgid "" "[b]Note:[/b] In exported release builds the debug info is not available, so " "the returned dictionaries will contain only method names." msgstr "" +"Retourne un tableau avec toutes les méthodes de [code]class[/code] ou son " +"parent si [code]no_inheritance[/code] est [code]false[/code]. Chaque élément " +"du tableau est un [Dictionary] avec les clés suivantes : [code]args[/code], " +"[code]default_args[/code], [code]flags[/code], [code]id[/code], [code]name[/" +"code] et [code]return: (class_name, hint, hint_string, name, type, usage)[/" +"code].\n" +"[b]Note :[/b] Dans la version exportée, les informations de débogage ne sont " +"pas disponibles, les dictionnaires retournés ne contiendront donc que le nom " +"des méthodes." #: doc/classes/ClassDB.xml msgid "" @@ -17361,6 +17777,8 @@ msgid "" "Returns an array with all the properties of [code]class[/code] or its " "ancestry if [code]no_inheritance[/code] is [code]false[/code]." msgstr "" +"Retourne un tableau avec toutes les propriétés de [code]class[/code] ou de " +"son parent si [code]no_inheritance[/code] est [code]false[/code]." #: doc/classes/ClassDB.xml msgid "" @@ -17370,6 +17788,11 @@ msgid "" "[code]name[/code], [code]return: (class_name, hint, hint_string, name, type, " "usage)[/code]." msgstr "" +"Retourne les données [code]signal[/code] de [code]class[/code] ou de son " +"parent. La valeur retournée est un [Dictionary] avec les clés suivantes : " +"[code]args[/code], [code]default_args[/code], [code]flags[/code], [code]id[/" +"code], [code]name[/code] et [code]return: (class_name, hint, hint_string, " +"name, type, usage)[/code]." #: doc/classes/ClassDB.xml msgid "" @@ -17377,6 +17800,9 @@ msgid "" "if [code]no_inheritance[/code] is [code]false[/code]. Every element of the " "array is a [Dictionary] as described in [method class_get_signal]." msgstr "" +"Retourne un tableau avec tous les signaux de [code]class[/code] ou son " +"parent si [code]no_inheritance[/code] est [code]false[/code]. Chaque élément " +"du tableau est un [Dictionary] comme détaillé dans [method class_get_signal]." #: doc/classes/ClassDB.xml msgid "" @@ -17391,6 +17817,8 @@ msgid "" "Returns whether [code]class[/code] or its ancestry has an integer constant " "called [code]name[/code] or not." msgstr "" +"Retourne si [code]class[/code] ou son parent a une constante entière appelée " +"[code]name[/code] ou non." #: doc/classes/ClassDB.xml msgid "" @@ -17483,6 +17911,8 @@ msgid "" "Returns [code]true[/code] if the specified bit index is on.\n" "[b]Note:[/b] Bit indices range from 0-19." msgstr "" +"Retourne [code]true[/code] si l'index de bit spécifié est actif.\n" +"[b]Note :[/b] Les indices de bit vont de 0 à 19." #: doc/classes/ClippedCamera.xml msgid "Removes a collision exception with the specified node." @@ -17497,6 +17927,8 @@ msgid "" "Sets the specified bit index to the [code]value[/code].\n" "[b]Note:[/b] Bit indices range from 0-19." msgstr "" +"Définit l'index de bit spécifié à [code]valeur[/code].\n" +"[b]Note :[/b] Les indices des bit vont de 0 à 19." #: doc/classes/ClippedCamera.xml msgid "If [code]true[/code], the camera stops on contact with [Area]s." @@ -17516,6 +17948,11 @@ msgid "" "physics_introduction.html#collision-layers-and-masks]Collision layers and " "masks[/url] in the documentation for more information." msgstr "" +"Le masque de collision de la caméra. Seuls les objets dans au moins une " +"calque de collision correspondant au masque seront détectés. Voir " +"[url=$DOCS_URL/tutorials/physics/physics_introduction.html#collision-layers-" +"and-masks]Calques et masques de collision[/url] dans la documentation pour " +"plus d'informations." #: doc/classes/ClippedCamera.xml msgid "" @@ -17541,6 +17978,13 @@ msgid "" "owners are not nodes and do not appear in the editor, but are accessible " "through code using the [code]shape_owner_*[/code] methods." msgstr "" +"CollisionObject est la classe de base pour les objets physiques. Il peut " +"contenir n'importe quel nombre de formes [Shape] de collision. Chaque forme " +"doit être assignée à un [i]propriétaire de forme[ /i]. Le CollisionObject " +"peut avoir n'importe quel nombre de propriétaires de forme. Les " +"propriétaires de forme ne sont pas des nœuds et ne apparaissent pas dans " +"l'éditeur, mais sont accessibles par le code en utilisant les méthodes " +"[code]shape_owner_*[/code]." #: doc/classes/CollisionObject.xml msgid "" @@ -17550,6 +17994,11 @@ msgid "" "surface at that point. Connect to the [signal input_event] signal to easily " "pick up these events." msgstr "" +"Reçoie les [InputEvent] non traités. [code]position[/code] est la position " +"dans l'espace global du curseur de la souris sur la surface de la forme avec " +"index [code]shape_idx[/code] et [code]normal[/code] est le vecteur de " +"normale de la surface à ce point. Connectez-vous au signal [signal " +"input_event] pour récupérer facilement ces événements." #: doc/classes/CollisionObject.xml doc/classes/CollisionObject2D.xml msgid "" @@ -18001,6 +18450,13 @@ msgid "" "only helper to create shapes, use [method CollisionObject." "shape_owner_get_shape] to get the actual shape." msgstr "" +"Un élément d'aide de l'éditeur pour créer et modifier des formes de " +"collision dans l'espace 3D. Vous pouvez utiliser ce nœud pour représenter " +"toutes sortes de formes de collision, par exemple, ajoutez-le à un [Area] " +"pour lui donner une forme de détection, ou l'ajoutez-le à un [PhysicsBody] " +"pour créer un objet solide. [b]IMPORTANT[/b] : c'est une aide de l'éditeur " +"qui ne sert qu'à créer des formes, utiliser [method CollisionObject." +"shape_owner_get_shape] pour obtenir la forme réelle." #: doc/classes/CollisionShape.xml doc/classes/CollisionShape2D.xml #: doc/classes/Physics2DDirectBodyState.xml @@ -18048,6 +18504,13 @@ msgid "" "Editor-only helper to create shapes, use [method CollisionObject2D." "shape_owner_get_shape] to get the actual shape." msgstr "" +"Un élément d'aide de l'éditeur pour créer et modifier des formes de " +"collision dans l'espace 2D. Vous pouvez utiliser ce nœud pour représenter " +"toutes sortes de formes de collision, par exemple, ajoutez-le à un [Area] " +"pour lui donner une forme de détection, ou l'ajoutez-le à un [PhysicsBody] " +"pour créer un objet solide. [b]IMPORTANT[/b] : c'est une aide de l'éditeur " +"qui ne sert qu'à créer des formes, utiliser [method CollisionObject." +"shape_owner_get_shape] pour obtenir la forme réelle." #: doc/classes/CollisionShape2D.xml doc/classes/KinematicBody2D.xml #: doc/classes/RectangleShape2D.xml doc/classes/TileMap.xml @@ -18245,6 +18708,12 @@ msgid "" "var darkgreen = green.darkened(0.2) # 20% darker than regular green\n" "[/codeblock]" msgstr "" +"Retourne une nouvelle couleur à partir de cette couleur en plus foncée par " +"le pourcentage donné (de 0 à 1).\n" +"[codeblock]\n" +"var green = Couleur(0.0, 1.0, 0.0) # Vert vif\n" +"var darkgreen = vert.darkened(0.2) # 20% plus foncé que le vert vif\n" +"/[codeblock]" #: doc/classes/Color.xml msgid "" @@ -18268,6 +18737,11 @@ msgid "" "This is useful when determining light or dark color. Colors with a luminance " "smaller than 0.5 can be generally considered dark." msgstr "" +"Retourne la luminosité de la couleur dans l'intervalle [code][0.0, 1.0][/" +"code].\n" +"Ceci est utile pour déterminer si c'est une couleur claire ou foncée. Les " +"couleurs avec une luminosité inférieure à 0,5 peuvent généralement être " +"considérées comme sombres." #: doc/classes/Color.xml msgid "" @@ -18428,7 +18902,7 @@ msgid "" "[/codeblock]" msgstr "" "Retourne la chaîne de caractères avec le code hexadécimal façon HTML au " -"format ARGB (par exemple [code]ff34f822[/code)].\n" +"format ARGB (par exemple [code]ff34f822[/code]).\n" "Définir [code]with_alpha[/code] à [code]false[/code] ne retourne pas la " "valeur alpha dans le code hexadécimal retourné.\n" "[codeblock]\n" @@ -18862,7 +19336,7 @@ msgstr "Couleur marron." #: doc/classes/Color.xml #, fuzzy msgid "Medium aquamarine color." -msgstr "Couleur bleu-marin moyenne." +msgstr "Couleur bleu-marine moyenne." #: doc/classes/Color.xml msgid "Medium blue color." @@ -19089,22 +19563,18 @@ msgid "Violet color." msgstr "Couleur violette." #: doc/classes/Color.xml -#, fuzzy msgid "Web gray color." msgstr "Couleur gris Web." #: doc/classes/Color.xml -#, fuzzy msgid "Web green color." -msgstr "Couleur verte web." +msgstr "Couleur vert Web." #: doc/classes/Color.xml -#, fuzzy msgid "Web maroon color." msgstr "Couleur marron Web." #: doc/classes/Color.xml -#, fuzzy msgid "Web purple color." msgstr "Couleur violet Web." @@ -19271,6 +19741,13 @@ msgid "" "preview swatch to be visible. Make sure to set [member Control." "rect_min_size] to a big enough value to give the button enough space." msgstr "" +"Encapsule un [ColorPicker] le rendant accessible en appuyant sur un bouton. " +"En appuyant sur le bouton, le [ColorPicker] deviendra visible.\n" +"Voir aussi [BaseButton] qui contient des propriétés et des méthodes communes " +"associées à ce nœud.\n" +"[b]Note :[/b] Par défaut, le bouton peut ne pas être assez large pour que " +"les palettes de couleur soit visibles. Assurez-vous de configurer [member " +"Control.rect_min_size] avec une taille suffisante grande pour le bouton." #: doc/classes/ColorPickerButton.xml msgid "" @@ -19279,6 +19756,10 @@ msgid "" "may cause a crash. If you wish to hide it or any of its children, use their " "[member CanvasItem.visible] property." msgstr "" +"Retourne le [ColorPicker] que ce nœud bascule.\n" +"[b]Avertissement :[/b] Il s'agit d'un nœud interne requis, le retirer et le " +"supprimer peut causer un plantage. Si vous voulez le cacher ou l'un de ses " +"enfants, utilisez la propriété [member CanvasItem.visible]." #: doc/classes/ColorPickerButton.xml msgid "" @@ -19289,6 +19770,12 @@ msgid "" "may cause a crash. If you wish to hide it or any of its children, use their " "[member CanvasItem.visible] property." msgstr "" +"Retourne la commande suivante [PopupPanel] qui vous permet de vous connecter " +"aux signaux de la fenêtre surgissante. Cela vous permet de gérer les " +"événements lorsque le ColorPicker est affiché ou caché.\n" +"[b]Avertissement :[/b] Il s'agit d'un nœud interne requis, le retirer et le " +"supprimer peut causer un plantage. Si vous voulez le cacher ou l'un de ses " +"enfants, utilisez la propriété [member CanvasItem.visible]." #: doc/classes/ColorPickerButton.xml msgid "" @@ -19306,6 +19793,8 @@ msgid "" "Emitted when the [ColorPicker] is created (the button is pressed for the " "first time)." msgstr "" +"Émis lorsque le [ColorPicker] est créé (le bouton est pressé pour la " +"première fois)." #: doc/classes/ColorPickerButton.xml msgid "Emitted when the [ColorPicker] is closed." @@ -19326,6 +19815,9 @@ msgid "" "normal text color of the button. Disabled, hovered, and pressed states take " "precedence over this color." msgstr "" +"La [Color] du texte utilisée lorsque le [ColorPickerButton] a le focus. Il " +"suffit de remplacer la couleur de texte normale du bouton. Les états " +"désactivé, survolé et pressé sont prioritaires par rapport à cette couleur." #: doc/classes/ColorPickerButton.xml msgid "Text [Color] used when the [ColorPickerButton] is being hovered." @@ -19358,6 +19850,9 @@ msgid "" "over the current [StyleBox], so using [StyleBoxEmpty] will just disable the " "focus visual effect." msgstr "" +"La [StyleBox] utilisée lorsque le [ColorPickerButton] a le focus. Il est " +"affiché par dessus la [StyleBox] actuelle, donc utiliser [StyleBoxEmpty] ne " +"fera que désactiver l'effet visuel de focus." #: doc/classes/ColorPickerButton.xml msgid "[StyleBox] used when the [ColorPickerButton] is being hovered." @@ -19380,6 +19875,8 @@ msgid "" "Displays a rectangle filled with a solid [member color]. If you need to " "display the border alone, consider using [ReferenceRect] instead." msgstr "" +"Affiche un rectangle rempli de la couleur [member color]. Si vous devez " +"seulement afficher la bordure, utilisez plutôt un [ReferenceRect]." #: doc/classes/ColorRect.xml msgid "" @@ -19406,6 +19903,13 @@ msgid "" "work with static [PhysicsBody] nodes like [StaticBody] and will not work " "with [KinematicBody] or [RigidBody] with a mode other than Static." msgstr "" +"Une ressource en forme de polygone concave, qui peut être utilisée dans un " +"[PhysicsBody] ou une aire. Cette forme est créée à partir d'une liste de " +"triangles.\n" +"[b]Note :[/b] Lorsque qu'elle est utilisée pour les collisions, " +"[ConcavePolygonShape] ne fonctionnera qu'avec les nœuds statiques " +"[PhysicsBody] comme les [StaticBody] et non pas avec [KinematicBody] ou " +"[RigidBody] quand ils ne sont pas en mode Static." #: doc/classes/ConcavePolygonShape.xml msgid "Returns the faces (an array of triangles)." @@ -19432,6 +19936,18 @@ msgid "" "uses a more complex method of collision detection, and a convex one forces " "itself to be convex in order to speed up collision detection." msgstr "" +"Une ressource en forme de polygone concave pour la physique 2D. Elle est " +"composée de segments et est optimal pour les collisions complexes de " +"concaves polygonales. Cependant, il n'est pas conseillé de l'utiliser pour " +"les nœuds [RigidBody2D]. Un CollisionPolygon2D décomposé en convexes " +"(solides) ou plusieurs objets convexes sont conseillés dans ce cas. Sinon, " +"une forme en polygone concave 2D est préférable pour les collisions " +"statiques.\n" +"La principale différence entre un [ConvexPolygonShape2D] et un " +"[ConcavePolygonShape2D] est qu'un polygone concave suppose qu'il contient " +"des zones creusées à l'intérieur et doit utiliser une méthode plus complexe " +"pour détecter les collisions, alors qu'un polygone convexe n'admet aucune " +"zone creusée pour pouvoir accélérer la détection des collisions." #: doc/classes/ConcavePolygonShape2D.xml msgid "" @@ -19702,6 +20218,11 @@ msgid "" "loaded in the [ConfigFile] object which the method was called on.\n" "Returns one of the [enum Error] code constants ([code]OK[/code] on success)." msgstr "" +"Charge le fichier de configuration crypté spécifié comme paramètre, en " +"utilisant le mode de passe [code]password[/code] donné pour le décrypter. Le " +"contenu du fichier est interprété puis chargé dans l'objet [ConfigFile] sur " +"lequel la méthode a été appelée.\n" +"Retourne un des codes [enum Error] ([code]OK[/code] si c'est un succès)." #: doc/classes/ConfigFile.xml msgid "" @@ -19709,6 +20230,10 @@ msgid "" "parsed and loaded in the ConfigFile object which the method was called on.\n" "Returns one of the [enum Error] code constants ([code]OK[/code] on success)." msgstr "" +"Interprète la chaîne passée comme étant le contenu d'un fichier de " +"configuration. La chaîne est interprétée puis chargée dans l'objet " +"ConfigFile sur lequel la méthode a été appelée.\n" +"Retourne un des codes [enum Error] ([code]OK[/code] si c'est un succès)." #: doc/classes/ConfigFile.xml msgid "" @@ -19716,6 +20241,9 @@ msgid "" "parameter. The output file uses an INI-style structure.\n" "Returns one of the [enum Error] code constants ([code]OK[/code] on success)." msgstr "" +"Enregistre le contenu de l'objet [ConfigFile] au fichier spécifié en " +"paramètre. Le fichier de sortie utilise une structure de type INI.\n" +"Retourne un des codes [enum Error] ([code]OK[/code] si c'est un succès)." #: doc/classes/ConfigFile.xml msgid "" @@ -20413,6 +20941,10 @@ msgid "" "[member focus_neighbour_left], [member focus_neighbour_right] and [member " "focus_neighbour_top]." msgstr "" +"Retourne le voisin de focus identifié par la constante [code]margin[/code] " +"de l'énumération [enum Margin]. Une méthode de getter pour [member " +"focus_neighbour_bottom], [member focus_neighbour_left], [member " +"focus_neighbour_right] et [member focus_neighbour_top]." #: doc/classes/Control.xml msgid "" @@ -20427,12 +20959,18 @@ msgid "" "code].\n" "See [method get_color] for details." msgstr "" +"Retourne une [Font] du premier [Theme] correspondant dans l'arborescence si " +"ce [Theme] a une propriété de police nommée [code]name[/code] et du type de " +"thème [code]theme_type[/code].\n" +"Voir [method get_color] pour plus de détails." #: doc/classes/Control.xml msgid "" "Returns the position and size of the control relative to the top-left corner " "of the screen. See [member rect_position] and [member rect_size]." msgstr "" +"Retourne la position et la taille du contrôle par rapport au coin supérieur " +"gauche de l'écran. Voir [member rect_position] et [member rect_size]." #: doc/classes/Control.xml msgid "" @@ -20441,6 +20979,10 @@ msgid "" "code].\n" "See [method get_color] for details." msgstr "" +"Retourne une icône du premier [Theme] correspondant dans l'arborescence si " +"ce [Theme] a une propriété d'icône nommée [code]name[/code] et du type de " +"thème [code]theme_type[/code].\n" +"Voir [method get_color] pour plus de détails." #: doc/classes/Control.xml msgid "" @@ -20448,6 +20990,10 @@ msgid "" "Margin] enum. A getter method for [member margin_bottom], [member " "margin_left], [member margin_right] and [member margin_top]." msgstr "" +"Retourne l'ancre identifiée par la constante [code]margin[/code] de " +"l'énumeration [enum Margin]. Une méthode de getter pour [member " +"margin_bottom], [member margin_left], [member margin_right] et [member " +"margin_top]." #: doc/classes/Control.xml msgid "Returns the minimum size for this control. See [member rect_min_size]." @@ -20468,6 +21014,8 @@ msgid "" "Returns the position and size of the control relative to the top-left corner " "of the parent Control. See [member rect_position] and [member rect_size]." msgstr "" +"Retourne la position et la taille du contrôle par rapport au coin supérieur " +"gauche du contrôle parent. Voir [member rect_position] et [member rect_size]." #: doc/classes/Control.xml msgid "Returns the rotation (in radians)." @@ -20480,6 +21028,10 @@ msgid "" "[code]theme_type[/code].\n" "See [method get_color] for details." msgstr "" +"Retourne une [StyleBox] du premier [Theme] correspondant dans l'arborescence " +"si ce [Theme] a une propriété de boîte de style nommée [code]name[/code] et " +"du type de thème [code]theme_type[/code].\n" +"Voir [method get_color] pour plus de détails." #: doc/classes/Control.xml msgid "" @@ -20506,6 +21058,13 @@ msgid "" "be clicked instead\n" "[/codeblock]" msgstr "" +"Crée un [InputEventMouseButton] qui tente de cliquer sur le contrôle. Si " +"l'événement est bien reçu, le contrôle prend le focus.\n" +"[codeblock]\n" +"func _process(delta:)\n" +" grab_click_focus() # Lorsque vous cliquez sur un autre contrôle, ce nœud " +"sera cliqué à la place\n" +"/[codeblock]" #: doc/classes/Control.xml msgid "" @@ -20522,6 +21081,10 @@ msgid "" "code].\n" "See [method get_color] for details." msgstr "" +"Retourne [code]true[/code] s'il y a un [Theme] correspondant dans " +"l'arborescence qui a une propriété de couleur nommé [code]name[/code] et du " +"type de thème [code]theme_type[/code].\n" +"Voir [method get_color] pour plus de détails." #: doc/classes/Control.xml msgid "" @@ -20540,6 +21103,10 @@ msgid "" "[code]theme_type[/code].\n" "See [method get_color] for details." msgstr "" +"Retourne [code]true[/code] s'il y a un [Theme] correspondant dans " +"l'arborescence qui a une propriété de constante nommée [/code]name[/code] et " +"du type de thème [code]theme_type[/code].\n" +"Voir [method get_color] pour plus de détails." #: doc/classes/Control.xml msgid "" @@ -20612,6 +21179,12 @@ msgid "" "[b]Note:[/b] If you want to check if a point is inside the control, you can " "use [code]get_rect().has_point(point)[/code]." msgstr "" +"Une méthode virtuelle à implémenter par l'utilisateur. Retourne si le " +"[code]point[/code] donné est à l'intérieur de ce contrôle.\n" +"Si ce n'est pas le cas, le comportement par défaut vérifie si le point se " +"trouve dans le rectant englobant du contrôle.\n" +"[b]Note :[/b] Si vous voulez vérifier si un point est à l'intérieur du " +"contrôle, vous pouvez utiliser [code]get_rect().has_point(point[/code]." #: doc/classes/Control.xml msgid "" @@ -20746,6 +21319,11 @@ msgid "" "If [code]keep_margins[/code] is [code]true[/code], control's position will " "also be updated." msgstr "" +"Définit les ancres avec le préréglage [code]preset[/code] de l'énumeration " +"[enum Control.LayoutPreset]. C'est le code équivalent à l'utilisation du " +"menu \"Mise en page\" dans l'éditeur 2D.\n" +"Si [code]keep_margins[/code] est [code]true[/code], la position du contrôle " +"sera également mise à jour." #: doc/classes/Control.xml msgid "" @@ -20883,6 +21461,10 @@ msgid "" "margin_bottom], [member margin_left], [member margin_right] and [member " "margin_top]." msgstr "" +"Régle la marge identifiée par la constante [code]margin[/code] de " +"l'énumeration [enum Margin] à [code]offset[/code]. Une méthode de setter " +"pour [member margin_bottom], [member margin_left], [member margin_right] et " +"[member margin_top]." #: doc/classes/Control.xml msgid "" @@ -20896,6 +21478,16 @@ msgid "" "Use parameter [code]margin[/code] to determine the gap between the [Control] " "and the edges." msgstr "" +"Définit les marges avec le préréglage [code]preset[/code] de l'énumeration " +"[enum Control.LayoutPreset]. C'est le code équivalent à l'utilisation du " +"menu Layout dans l'éditeur 2D.\n" +"Utilisez le paramètre [code]resize_mode[/code] avec des constantes de [enum " +"Control.LayoutPresetMode] pour mieux déterminer la taille résultante du " +"[Control]. La taille constante sera ignorée si elle est utilisée avec des " +"préréglages qui changent la taille, par exemple [code]PRESET_LEFT_WIDE[/" +"code].\n" +"Utiliser le paramètre [code]margin[/code] pour déterminer l'écart entre le " +"[Contrôle] et les bords." #: doc/classes/Control.xml msgid "" @@ -20903,6 +21495,9 @@ msgid "" "If [code]keep_margins[/code] is [code]true[/code], control's anchors will be " "updated instead of margins." msgstr "" +"Défini le [member rect_position] à la [code]position[/code] spécifiée.\n" +"Si [code]keep_margins[/code] est [code]true[/code], les ancres du contrôle " +"sont mis à jour au lieu des marges." #: doc/classes/Control.xml msgid "Sets the rotation (in radians)." @@ -20914,6 +21509,9 @@ msgid "" "If [code]keep_margins[/code] is [code]true[/code], control's anchors will be " "updated instead of margins." msgstr "" +"Définit la taille (voir [member rect_size]).\n" +"Si [code]keep_margins[/code] est [code]true[/code], les ancres du contrôle " +"sont mis à jour au lieu des marges." #: doc/classes/Control.xml msgid "" @@ -20941,6 +21539,10 @@ msgid "" "moves or changes size. You can use one of the [enum Anchor] constants for " "convenience." msgstr "" +"L'ancre du bord du bas du nœud par rapport à l'origine, le centre, ou la fin " +"de son contrôle parent. Il modifie la mise à jour de la marge inférieure " +"lorsque le nœud se déplace ou change la taille. Vous pouvez utiliser une des " +"constantes de [enum Anchor] suivant les besoins." #: doc/classes/Control.xml msgid "" @@ -20949,6 +21551,10 @@ msgid "" "moves or changes size. You can use one of the [enum Anchor] constants for " "convenience." msgstr "" +"L'ancre du bord gauche du nœud par rapport à l'origine, le centre ou la fin " +"de son contrôle parent. Il modifie la mise à jour de la marge gauche lorsque " +"le nœud se déplace ou change la taille. Vous pouvez utiliser une des " +"constantes de [enum Anchor] suivant les besoins." #: doc/classes/Control.xml msgid "" @@ -20957,6 +21563,10 @@ msgid "" "moves or changes size. You can use one of the [enum Anchor] constants for " "convenience." msgstr "" +"L'ancre du bord droit du nœud par rapport à l'origine, le centre ou la fin " +"de son contrôle parent. Il modifie la mise à jour de la marge droite lorsque " +"le nœud se déplace ou change la taille. Vous pouvez utiliser une des " +"constantes de [enum Anchor] suivant les besoins." #: doc/classes/Control.xml msgid "" @@ -20964,6 +21574,10 @@ msgid "" "parent control. It changes how the top margin updates when the node moves or " "changes size. You can use one of the [enum Anchor] constants for convenience." msgstr "" +"L'ancre du bord du haut du nœud par rapport à l'origine, le centre ou la fin " +"de son contrôle parent. Il modifie la mise à jour de la marge supérieure " +"lorsque le nœud se déplace ou change la taille. Vous pouvez utiliser une des " +"constantes de [enum Anchor] suivant les besoins." #: doc/classes/Control.xml msgid "" @@ -21065,6 +21679,10 @@ msgid "" "grow if its horizontal minimum size is changed to be greater than its " "current size, as the control always has to be at least the minimum size." msgstr "" +"Control la direction sur l'axe horizontal selon lequel le contrôle doit " +"croître si sa taille minimale horizontale est modifiée pour être supérieure " +"à sa taille actuelle, car le contrôle doit toujours avoir au moins sa taille " +"minimale." #: doc/classes/Control.xml msgid "" @@ -21072,6 +21690,10 @@ msgid "" "if its vertical minimum size is changed to be greater than its current size, " "as the control always has to be at least the minimum size." msgstr "" +"Control la direction sur l'axe vertical selon lequel le contrôle doit " +"croître si sa taille minimale verticale est changée pour être supérieure à " +"sa taille actuelle, car le contrôle doit toujours avoir au moins sa taille " +"minimale." #: doc/classes/Control.xml msgid "" @@ -21124,6 +21746,11 @@ msgid "" "handling. The viewport first hides the modal and after marks the input as " "handled." msgstr "" +"Active quand l'entrée doit se propager lorsque vous fermez le contrôle en " +"tant que modale.\n" +"Si [code]false[/code], arrête le traitement de l'événement lors de la " +"manipulation de l'événement d'entrée de la fenêtre d'affichage. La fenêtre " +"d'affichage cache d'abord la modale et après marque l'entrée comme traitée." #: doc/classes/Control.xml msgid "" @@ -21217,12 +21844,18 @@ msgid "" "to this control's rectangle. If [code]true[/code], parts of a child which " "would be visibly outside of this control's rectangle will not be rendered." msgstr "" +"Active quand le rendu des [CanvasItem] enfants doit être limité au rectangle " +"engobant de ce contrôle. Si [code]true[/code], des parties des enfants qui " +"seraient normalement visibles en-dehors de ce rectangle des contrôles seront " +"cachées." #: doc/classes/Control.xml msgid "" "The node's global position, relative to the world (usually to the top-left " "corner of the window)." msgstr "" +"La position globale du nœud, par rapport au coordonnées globales " +"(généralement au coin haut-gauche de la fenêtre)." #: doc/classes/Control.xml msgid "" @@ -21231,6 +21864,11 @@ msgid "" "this size, even if its content is smaller. If it's set to (0, 0), the node " "sizes automatically to fit its content, be it a texture or child nodes." msgstr "" +"La taille minimale du rectangle englobant. Si vous le fixez à une valeur " +"supérieure à (0, 0), le rectangle englobant du nœud aura toujours au moins " +"cette taille, même si son contenu est plus petit. Si cette taille est à (0, " +"0), le nœud sera redimensionné automatiquement pour s'adapter à son contenu, " +"qu'il s'agisse d'une texture ou d'un nœud enfant." #: doc/classes/Control.xml msgid "" @@ -21239,6 +21877,10 @@ msgid "" "around this pivot. Set this property to [member rect_size] / 2 to pivot " "around the Control's center." msgstr "" +"Par défaut, et le pivot du nœud est son coin supérieur gauche. Lorsque vous " +"modifiez son [member rect_rotation] ou [member rect_scale], il tournera ou " +"changera d'échelle autour de ce pivot. Définir cette propriété à [member " +"rect_size] / 2 permet de pivoter autour du centre du contrôle." #: doc/classes/Control.xml msgid "" @@ -21246,12 +21888,17 @@ msgid "" "rectangle's top-left corner. The property is not affected by [member " "rect_pivot_offset]." msgstr "" +"La position du nœud, par rapport à son parent. Elle correspond au coin " +"supérieur gauche du rectangle. La propriété n'est pas affectée par [member " +"rect_pivot_offset]." #: doc/classes/Control.xml msgid "" "The node's rotation around its pivot, in degrees. See [member " "rect_pivot_offset] to change the pivot's position." msgstr "" +"La rotation du nœud autour de son pivot, en degrés. Voir [member " +"rect_pivot_offset] pour modifier la position du pivot." #: doc/classes/Control.xml msgid "" @@ -21291,6 +21938,8 @@ msgid "" "The size of the node's bounding rectangle, in pixels. [Container] nodes " "update this property automatically." msgstr "" +"La taille du rectangle englobant du nœud, en pixels. Les nœuds [Container] " +"mettent à jour cette propriété automatiquement." #: doc/classes/Control.xml msgid "" @@ -21298,6 +21947,9 @@ msgid "" "on the X axis. Use one of the [enum SizeFlags] constants to change the " "flags. See the constants to learn what each does." msgstr "" +"Signale au [Container] parent qu'il devrait redimensionner et placer le nœud " +"sur l'axe X. Utilisez l'une des constantes [enum SizeFlags] pour changer les " +"drapeaux. Voyez les constantes pour apprendre ce que chacun fait." #: doc/classes/Control.xml msgid "" @@ -21307,6 +21959,11 @@ msgid "" "its neighbour a ratio of 1, this node will take two thirds of the available " "space." msgstr "" +"Si le nœud et au moins un de ses voisins utilisent le drapeau de taille " +"[constant SIZE_EXPAND], le [Container] parent le laissera prendre plus ou " +"moins d'espace selon cette propriété. Si ce nœud a un rapport d'étirement de " +"2 et son voisin un rapport de 1, ce nœud prendra les deux tiers (deux fois " +"plus que l'autre) de l'espace disponible." #: doc/classes/Control.xml msgid "" @@ -21314,12 +21971,17 @@ msgid "" "on the Y axis. Use one of the [enum SizeFlags] constants to change the " "flags. See the constants to learn what each does." msgstr "" +"Signale au [Container] parent qu'il devrait redimensionner et placer le nœud " +"sur l'axe Y. Utilisez l'une des constantes [enum SizeFlags] pour changer les " +"drapeaux. Voyez les constantes pour apprendre ce que chacun fait." #: doc/classes/Control.xml msgid "" "Changing this property replaces the current [Theme] resource this node and " "all its [Control] children use." msgstr "" +"Changer cette propriété remplace la ressource [Theme] actuelle que ce nœud " +"et tous ses [Contrôle] enfants utilisent." #: doc/classes/Control.xml msgid "" @@ -21388,6 +22050,12 @@ msgid "" "at least until the mouse is moved to reach the parent's [code]Rect[/code] " "area." msgstr "" +"Émis lorsque la souris entre dans le [code]Rect[/code] du contrôle, à " +"condition que l'événement l'atteigne.\n" +"[b]Note :[/b] [signal mouse_entered] ne sera pas émis si la souris entre " +"dans un nœud [Control] enfant avant d'entrer dans le [code]Rect[/code], au " +"moins jusqu'à ce que la souris soit déplacée pour atteindre le [code]Rect[/" +"code] du parent." #: doc/classes/Control.xml msgid "" @@ -21428,6 +22096,8 @@ msgid "" "Emitted when one of the size flags changes. See [member " "size_flags_horizontal] and [member size_flags_vertical]." msgstr "" +"Émis lorsque l'un des drapeaux de taille change. Voir [member " +"size_flags_horizontal] et [member size_flags_vertical]." #: doc/classes/Control.xml msgid "The node cannot grab focus. Use with [member focus_mode]." @@ -21446,11 +22116,16 @@ msgid "" "The node can grab focus on mouse click or using the arrows and the Tab keys " "on the keyboard. Use with [member focus_mode]." msgstr "" +"Le nœud peut obtenir le focus lors d'un clic de souris ou en utilisant les " +"flèches et la touche de tabulation du clavier. À utiliser avec [member " +"focus_mode]." #: doc/classes/Control.xml msgid "" "Sent when the node changes size. Use [member rect_size] to get the new size." msgstr "" +"Envoyé quand le nœud change de taille. Utilisez [member rect_size] pour " +"obtenir la nouvelle taille." #: doc/classes/Control.xml msgid "Sent when the mouse pointer enters the node." @@ -21474,28 +22149,38 @@ msgid "" "control. Happens when you call one of the [code]add_*_override[/code] " "methods." msgstr "" +"Envoyé lorsque le [member theme] du nœud change, juste avant que Godot ne " +"redessine le contrôle. Ça arrive quand vous appelez l'une des méthodes " +"[code]add_*_override[/code]." #: doc/classes/Control.xml msgid "Sent when an open modal dialog closes. See [method show_modal]." msgstr "" +"Envoyé quand un dialogue modal ouvert se ferme. Voir [method show_modal]." #: doc/classes/Control.xml msgid "" "Sent when this node is inside a [ScrollContainer] which has begun being " "scrolled." msgstr "" +"Envoyé quand ce nœud est à l'intérieur d'un [ScrollContainer] qui a commencé " +"à défilé." #: doc/classes/Control.xml msgid "" "Sent when this node is inside a [ScrollContainer] which has stopped being " "scrolled." msgstr "" +"Envoyé quand ce nœud est à l'intérieur d'un [ScrollContainer] qui a cessé de " +"défilé." #: doc/classes/Control.xml msgid "" "Show the system's arrow mouse cursor when the user hovers the node. Use with " "[member mouse_default_cursor_shape]." msgstr "" +"Affiche le curseur système de la souris quand l'utilisateur survole le nœud. " +"À utiliser avec [member mouse_default_cursor_shape]." #: doc/classes/Control.xml msgid "" @@ -21623,72 +22308,98 @@ msgid "" "Show the system's vertical split mouse cursor when the user hovers the node. " "On Windows, it's the same as [constant CURSOR_VSIZE]." msgstr "" +"Affiche le curseur système de la souris avec un séparateur vertical lorsque " +"l'utilisateur survole le nœud. Sur Windows, il est identique à [constant " +"CURSOR_VSIZE]." #: doc/classes/Control.xml msgid "" "Show the system's horizontal split mouse cursor when the user hovers the " "node. On Windows, it's the same as [constant CURSOR_HSIZE]." msgstr "" +"Affiche le curseur système de la souris avec un séparateur horizontal " +"lorsque l'utilisateur survole le nœud. Sur Windows, il est identique à " +"[constant CURSOR_HSIZE]." #: doc/classes/Control.xml msgid "" "Show the system's help mouse cursor when the user hovers the node, a " "question mark." msgstr "" +"Affiche le curseur système de la souris pour l'aide lorsque l'utilisateur " +"survole le nœud, avec un point d'interrogation." #: doc/classes/Control.xml msgid "" "Snap all 4 anchors to the top-left of the parent control's bounds. Use with " "[method set_anchors_preset]." msgstr "" +"Magnétise toutes les 4 ancres jusqu'au coin gauche supérieur du rectangle " +"englobant du contrôle parent. À utiliser avec [méthod set_anchors_preset]." #: doc/classes/Control.xml msgid "" "Snap all 4 anchors to the top-right of the parent control's bounds. Use with " "[method set_anchors_preset]." msgstr "" +"Magnétise toutes les 4 ancres jusqu'au coin droit du rectangle englobant du " +"contrôle parent. À utiliser avec [méthod set_anchors_preset]." #: doc/classes/Control.xml msgid "" "Snap all 4 anchors to the bottom-left of the parent control's bounds. Use " "with [method set_anchors_preset]." msgstr "" +"Magnétise toutes les 4 ancres jusqu'au coin bas-gauche du rectangle " +"englobant du contrôle parent. À utiliser avec [méthod set_anchors_preset]." #: doc/classes/Control.xml msgid "" "Snap all 4 anchors to the bottom-right of the parent control's bounds. Use " "with [method set_anchors_preset]." msgstr "" +"Magnétise toutes les 4 ancres jusqu'au coin bas-droit du rectangle englobant " +"du contrôle parent. À utiliser avec [méthod set_anchors_preset]." #: doc/classes/Control.xml msgid "" "Snap all 4 anchors to the center of the left edge of the parent control's " "bounds. Use with [method set_anchors_preset]." msgstr "" +"Magnétise toutes les 4 ancres au centre du bord gauche du rectangle " +"englobant du contrôle parent. À utiliser avec [méthod set_anchors_preset]." #: doc/classes/Control.xml msgid "" "Snap all 4 anchors to the center of the top edge of the parent control's " "bounds. Use with [method set_anchors_preset]." msgstr "" +"Magnétise toutes les 4 ancres au centre du bord supérieur du rectangle " +"englobant du contrôle parent. À utiliser avec [méthod set_anchors_preset]." #: doc/classes/Control.xml msgid "" "Snap all 4 anchors to the center of the right edge of the parent control's " "bounds. Use with [method set_anchors_preset]." msgstr "" +"Magnétise toutes les 4 ancres au centre du bord droit du rectangle englobant " +"du contrôle parent. À utiliser avec [méthod set_anchors_preset]." #: doc/classes/Control.xml msgid "" "Snap all 4 anchors to the center of the bottom edge of the parent control's " "bounds. Use with [method set_anchors_preset]." msgstr "" +"Magnétise toutes les 4 ancres au centre du bord du bas du rectangle " +"englobant du contrôle parent. À utiliser avec [méthod set_anchors_preset]." #: doc/classes/Control.xml msgid "" "Snap all 4 anchors to the center of the parent control's bounds. Use with " "[method set_anchors_preset]." msgstr "" +"Magnétise les 4 ancres au centre du rectangle englobant de contrôle parent. " +"À utiliser avec [méthod set_anchors_preset]." #: doc/classes/Control.xml msgid "" @@ -21696,6 +22407,10 @@ msgid "" "becomes relative to the left edge and the top margin relative to the top " "left corner of the node's parent. Use with [method set_anchors_preset]." msgstr "" +"Magnétise les 4 ancres sur le bord gauche du contrôle parent. La marge " +"gauche devient alors relative au bord gauche et à la marge supérieure par " +"rapport au coin supérieur gauche du nœud parent). À utiliser avec [méthod " +"set_anchors_preset]." #: doc/classes/Control.xml msgid "" @@ -21704,6 +22419,11 @@ msgid "" "edge, and the right margin relative to the top right corner of the node's " "parent. Use with [method set_anchors_preset]." msgstr "" +"Magnétise toutes les 4 ancres sur le bord supérieur du contrôle parent. La " +"marge gauche devient alors par rapport au coin supérieur gauche, à la marge " +"supérieure par rapport au bord supérieur, et à la marge droite par rapport " +"au coin supérieur droit du nœud parent . À utiliser avec [méthod " +"set_anchors_preset]." #: doc/classes/Control.xml msgid "" @@ -21711,6 +22431,10 @@ msgid "" "becomes relative to the right edge and the top margin relative to the top " "right corner of the node's parent. Use with [method set_anchors_preset]." msgstr "" +"Magnétise les 4 ancres au bord droit du contrôle parent. La marge droite " +"devient alors par rapport au bord droit et à la marge supérieure par rapport " +"au coin supérieur droit du nœud parent. À utiliser avec [méthod " +"set_anchors_preset]." #: doc/classes/Control.xml msgid "" @@ -21719,18 +22443,26 @@ msgid "" "the bottom edge, and the right margin relative to the bottom right corner of " "the node's parent. Use with [method set_anchors_preset]." msgstr "" +"Magnétise les 4 ancres au bord inférieur du contrôle parent. La marge gauche " +"devient alors par rapport au coin inférieur gauche, à la marge inférieure " +"par rapport au bord inférieur, et à la marge droite par rapport au coin " +"inférieur droit du nœud parent. À utiliser avec [méthod set_anchors_preset]." #: doc/classes/Control.xml msgid "" "Snap all 4 anchors to a vertical line that cuts the parent control in half. " "Use with [method set_anchors_preset]." msgstr "" +"Magnétise les 4 ancres sur une ligne verticale qui coupe le contrôle parent " +"en deux. À utiliser avec [méthod set_anchors_preset]." #: doc/classes/Control.xml msgid "" "Snap all 4 anchors to a horizontal line that cuts the parent control in " "half. Use with [method set_anchors_preset]." msgstr "" +"Magnétise les 4 ancres sur une ligne horizontale qui coupe le contrôle " +"parent en deux. À utiliser avec [méthod set_anchors_preset]." #: doc/classes/Control.xml msgid "" @@ -21739,6 +22471,11 @@ msgid "" "parent control. This is equivalent to the \"Full Rect\" layout option in the " "editor. Use with [method set_anchors_preset]." msgstr "" +"Magnétise toutes les 4 ancres aux angles respectifs du contrôle parent. " +"Réglez toutes les 4 marges à 0 après avoir appliqué ce préréglage et le " +"[Control] s'adaptera à son contrôle parent. Ceci est équivalent à l'option " +"de mise en page \"Rectangle complet\" dans l'éditeur. À utiliser avec " +"[méthod set_anchors_preset]." #: doc/classes/Control.xml msgid "The control will be resized to its minimum size." @@ -21762,6 +22499,9 @@ msgid "" "the available space without pushing any other node. Use with [member " "size_flags_horizontal] and [member size_flags_vertical]." msgstr "" +"Signale au [Container] parent d'étendre les limites de ce nœud pour remplir " +"tout l'espace disponible sans pousser un autre nœud. À utiliser avec [member " +"size_flags_horizontal] et [member size_flags_vertical]." #: doc/classes/Control.xml msgid "" @@ -21771,12 +22511,19 @@ msgid "" "size_flags_stretch_ratio]. Use with [member size_flags_horizontal] and " "[member size_flags_vertical]." msgstr "" +"Signale au [Container] parent de laisser ce nœud prendre tout l'espace " +"disponible sur l'axe spécifié. Si plusieurs nœuds voisins sont prêts à " +"s'étendre, ils partagent l'espace en fonction de leur rapport d'étirement. " +"Voir [member size_flags_stretch_ratio]. À utiliser avec [member " +"size_flags_horizontal] et [member size_flags_vertical]." #: doc/classes/Control.xml msgid "" "Sets the node's size flags to both fill and expand. See the 2 constants " "above for more information." msgstr "" +"Définit les drapeaux de taille du nœud pour à la fois remplir et s'étendre. " +"Voir les 2 constantes ci-dessus pour plus d'informations." #: doc/classes/Control.xml msgid "" @@ -21882,6 +22629,10 @@ msgid "" "variables, like [member anchor_left]. To change all 4 anchors at once, use " "[method set_anchors_preset]." msgstr "" +"Magnétise l'un des 4 côtés d'ancrage à l'origine de l'ancrage [code]Rect[/" +"code], en haut à gauche. Utilisez-le avec l'une des variables membres " +"[code]anchor_[* /code], comme [member anchor_left]. Pour modifier les 4 " +"ancres à la fois, utilisez [method set_anchors_preset]." #: doc/classes/Control.xml msgid "" @@ -21890,6 +22641,10 @@ msgid "" "member variables, like [member anchor_left]. To change all 4 anchors at " "once, use [method set_anchors_preset]." msgstr "" +"Magnétise l'un des 4 côtés d'ancrage à l'extrémité de l'extrémité " +"[code]Rect[/code], en bas à droite. Utilisez-le avec l'une des variables " +"membres [code]anchor_[* /code], comme [member anchor_left]. Pour modifier " +"les 4 ancres à la fois, utilisez [method set_anchors_preset]." #: doc/classes/ConvexPolygonShape.xml msgid "Convex polygon shape for 3D physics." @@ -22110,7 +22865,6 @@ msgstr "L'amortissement varie le long de cette [Curve]." #: doc/classes/CPUParticles.xml doc/classes/CPUParticles2D.xml #: doc/classes/ParticlesMaterial.xml -#, fuzzy msgid "Damping randomness ratio." msgstr "Ratio d’amortissement aléatoire." @@ -22139,6 +22893,8 @@ msgid "" "Sets the [Color]s to modulate particles by when using [constant " "EMISSION_SHAPE_POINTS] or [constant EMISSION_SHAPE_DIRECTED_POINTS]." msgstr "" +"Définit les [Color] pour moduler les particules en utilisant [constant " +"EMISSION_SHAPE_POINTS] ou [constant EMISSION_SHAPE_DIRECTED_POINTS]." #: doc/classes/CPUParticles.xml doc/classes/CPUParticles2D.xml msgid "" @@ -22153,6 +22909,9 @@ msgid "" "Sets the initial positions to spawn particles when using [constant " "EMISSION_SHAPE_POINTS] or [constant EMISSION_SHAPE_DIRECTED_POINTS]." msgstr "" +"Définit les positions initiales pour les particules créées en utilisant " +"[constant EMISSION_SHAPE_POINTS] ou [constant " +"EMISSION_SHAPE_DIRECTED_POINTS]." #: doc/classes/CPUParticles.xml msgid "" @@ -22172,6 +22931,8 @@ msgid "" "The inner radius for the ring shaped emitter when using [constant " "EMISSION_SHAPE_RING]." msgstr "" +"Le rayon intérieur de l'émetteur en anneau quand définit à [constant " +"EMISSION_SHAPE_RING]." #: doc/classes/CPUParticles.xml msgid "" @@ -22404,6 +23165,9 @@ msgid "" "Each particle's initial direction range from [code]+spread[/code] to [code]-" "spread[/code] degrees. Applied to X/Z plane and Y/Z planes." msgstr "" +"La direction initiale de chaque particule dans l'intervalle de " +"[code]+spread[/code] à [code]-spread[/code] degrés. Appliquée aux plans sur " +"X/Z et aux plans sur Y/Z." #: doc/classes/CPUParticles.xml doc/classes/CPUParticles2D.xml #: doc/classes/ParticlesMaterial.xml @@ -22633,6 +23397,8 @@ msgid "" "The sphere's radius if [member emission_shape] is set to [constant " "EMISSION_SHAPE_SPHERE]." msgstr "" +"Le rayon de la sphère si [member emission_shape] est [constant " +"EMISSION_SHAPE_SPHERE]." #: doc/classes/CPUParticles2D.xml doc/classes/Particles.xml #: doc/classes/Particles2D.xml @@ -22682,6 +23448,8 @@ msgid "" "Particles will be emitted on the surface of a sphere flattened to two " "dimensions." msgstr "" +"Les particules seront émises à la surface d'une sphère aplatie en deux " +"dimensions." #: doc/classes/CPUParticles2D.xml msgid "Particles will be emitted in the area of a rectangle." @@ -22778,6 +23546,11 @@ msgid "" "string-comparison-with-double-hmac-strategy]this blog post[/url] for more " "information." msgstr "" +"Compare deux [PoolByteArray] pour l'égalité sans fuite temporelle " +"d'informations afin de prévenir les attaques temporelles.\n" +"Voir [url=https://paragonie.com/blog/2015/11/preventing-timing-attacks-on-" +"string-comparison-with-double-hmac-strategy]ce blog[/url] pour plus " +"d'informations." #: doc/classes/Crypto.xml msgid "" @@ -22816,6 +23589,8 @@ msgid "" "Generates an RSA [CryptoKey] that can be used for creating self-signed " "certificates and passed to [method StreamPeerSSL.accept_stream]." msgstr "" +"Génère une [CryptoKey] RSA qui peut être utilisé pour créer des certificats " +"autosignés et transmis à [method StreamPeerSSL.accept_stream]" #: doc/classes/Crypto.xml msgid "" @@ -22991,7 +23766,6 @@ msgid "" msgstr "" #: modules/csg/doc_classes/CSGCylinder.xml -#, fuzzy msgid "A CSG Cylinder shape." msgstr "Une forme de cylindre CSG." @@ -23113,12 +23887,18 @@ msgid "" "shape. If [code]false[/code] the top half of the material is repeated every " "step of the extrusion." msgstr "" +"Lorsque [member mode] est [constant MODE_PATH], par défaut, la moitié " +"supérieure du [member material] est étirée sur toute la longueur de la forme " +"extrudée. Si [code]false[/code] la partie supérieure du matériau est répétée " +"à chaque étape de l'extrusion." #: modules/csg/doc_classes/CSGPolygon.xml msgid "" "When [member mode] is [constant MODE_PATH], the path interval or ratio of " "path points to extrusions." msgstr "" +"Lorsque [member mode] est [constant MODE_PATH], l'intervalle de chemin ou le " +"rapport de chemin pointe vers les extrusions." #: modules/csg/doc_classes/CSGPolygon.xml msgid "" @@ -23126,6 +23906,10 @@ msgid "" "interval should be by distance ([constant PATH_INTERVAL_DISTANCE]) or " "subdivision fractions ([constant PATH_INTERVAL_SUBDIVIDE])." msgstr "" +"Lorsque [member mode] est [constant MODE_PATH], cela déterminera si " +"l'intervalle doit être suivant la distance ([constant " +"PATH_INTERVAL_DISTANCE]) ou suivant une fraction des sous-divisions " +"([constant PATH_INTERVAL_SUBDIVIDE])." #: modules/csg/doc_classes/CSGPolygon.xml msgid "" @@ -23133,6 +23917,9 @@ msgid "" "the path are joined, by adding an extrusion between the last and first " "points of the path." msgstr "" +"Lorsque [member mode] est [constant MODE_PATH], si [code]true[/code] les " +"extrémités du chemin sont jointes, en ajoutant une extrusion entre le " +"dernier et le premier points du chemin." #: modules/csg/doc_classes/CSGPolygon.xml msgid "" @@ -23140,24 +23927,34 @@ msgid "" "[Transform] of the [CSGPolygon] is used as the starting point for the " "extrusions, not the [Transform] of the [member path_node]." msgstr "" +"Lorsque [member mode] est [constant MODE_PATH], si [code]true[/code] la " +"[Transform] du [CSGPolygon] est utilisée comme point de départ pour les " +"extrusions, et non pas la [Transform] du [member path_node]." #: modules/csg/doc_classes/CSGPolygon.xml msgid "" "When [member mode] is [constant MODE_PATH], the location of the [Path] " "object used to extrude the [member polygon]." msgstr "" +"Lorsque [member mode] est [constant MODE_PATH], l'emplacement de l'objet " +"[Path] utilisé pour extruder le [member polygon]." #: modules/csg/doc_classes/CSGPolygon.xml msgid "" "When [member mode] is [constant MODE_PATH], the [enum PathRotation] method " "used to rotate the [member polygon] as it is extruded." msgstr "" +"Lorsque [member mode] est [constant MODE_PATH], la méthode [enum " +"PathRotation] utilisée pour faire pivoter le [member polygon] selon son " +"extrusion." #: modules/csg/doc_classes/CSGPolygon.xml msgid "" "When [member mode] is [constant MODE_PATH], extrusions that are less than " "this angle, will be merged together to reduce polygon count." msgstr "" +"Lorsque [member mode] est [constant MODE_PATH], les extrusions qui sont " +"inférieures à cet angle seront fusionnés pour réduire le nombre de polygones." #: modules/csg/doc_classes/CSGPolygon.xml msgid "" @@ -23165,6 +23962,10 @@ msgid "" "path, in meters, the texture coordinates will tile. When set to 0, texture " "coordinates will match geometry exactly with no tiling." msgstr "" +"Lorsque [member mode] est [constant MODE_PATH], c'est la distance le long du " +"chemin, en mètres, que les coordonnées de texture seront répétées. Quand à " +"0, les coordonnées de texture correspondront exactement à la géométrie sans " +"répétition." #: modules/csg/doc_classes/CSGPolygon.xml msgid "" @@ -23175,6 +23976,12 @@ msgid "" "[b]Note:[/b] If only 1 or 2 points are defined in [member polygon], no mesh " "will be generated." msgstr "" +"Le tableau de points qui définit le polygone 2D extrudé. Cela peut être un " +"polygone convexe ou concave avec 3 points ou plus. Le polygone ne doit " +"[i]pas[/i] avoir de bords qui sont des intersections. Sinon, la " +"triangulation échouera et aucun maillage ne sera généré.\n" +"[b]Note :[/b] Si seulement 1 ou 2 points sont définis dans [member polygon], " +"aucun maillage ne sera généré." #: modules/csg/doc_classes/CSGPolygon.xml #, fuzzy @@ -23216,6 +24023,9 @@ msgid "" "[b]Note:[/b] Requires the path's Z coordinates to continually decrease to " "ensure viable shapes." msgstr "" +"La forme [member polygon] n'a pas pivoté.\n" +"[b]Note :[/b] Nécessite que les coordonnées Z du chemin diminuent en " +"continue pour assurer des formes viables." #: modules/csg/doc_classes/CSGPolygon.xml msgid "" @@ -23224,12 +24034,17 @@ msgid "" "[b]Note:[/b] Requires the path's Z coordinates to continually decrease to " "ensure viable shapes." msgstr "" +"La forme [member polygon] est pivotée le long du chemin, mais elle n'est pas " +"pivotée autour de l'axe du chemin.\n" +"[b]Note :[/b] Nécessite que les coordonnées Z du chemin diminuent en " +"continue pour assurer des formes viables." #: modules/csg/doc_classes/CSGPolygon.xml msgid "" "The [member polygon] shape follows the path and its rotations around the " "path axis." msgstr "" +"La forme [member polygon] suit le chemin et pivote autour de l'axe du chemin." #: modules/csg/doc_classes/CSGPolygon.xml msgid "" @@ -23237,12 +24052,17 @@ msgid "" "will determine the distance, in meters, each interval of the path will " "extrude." msgstr "" +"Lorsque [member mode] est défini à [constant MODE_PATH], [member " +"path_interval] déterminera la distance, en mètres, entre chaque intervalle " +"où le chemin s'extrudera." #: modules/csg/doc_classes/CSGPolygon.xml msgid "" "When [member mode] is set to [constant MODE_PATH], [member path_interval] " "will subdivide the polygons along the path." msgstr "" +"Lorsque [member mode] est défini [constant MODE_PATH], [member " +"path_interval] divisera les polygones le long du chemin." #: modules/csg/doc_classes/CSGPrimitive.xml msgid "Base class for CSG primitives." @@ -23304,12 +24124,16 @@ msgid "" "Sets individual bits on the layer mask. Use this if you only need to change " "one layer's value." msgstr "" +"Définit des bits individuels sur le masque de calque. Utilisez ceci si vous " +"n'avez besoin que de changer de calque." #: modules/csg/doc_classes/CSGShape.xml doc/classes/SoftBody.xml msgid "" "Sets individual bits on the collision mask. Use this if you only need to " "change one layer's value." msgstr "" +"Définit des bits individuels sur le masque de collision. Utilisez ceci si " +"vous n'avez besoin que de changer de calque." #: modules/csg/doc_classes/CSGShape.xml msgid "" @@ -23624,6 +24448,16 @@ msgid "" "this, increase [member subdivide_depth], [member subdivide_height] and " "[member subdivide_width] until you no longer notice UV jittering." msgstr "" +"Générer un cuboïde [PrimitiveMesh] aligné sur les axes.\n" +"La projection des UV du cube est disposée selon une disposition de 3×2 qui " +"permet de placer une texture sur chaque face individuellement. Pour " +"appliquer la même texture sur toutes les faces, modifiez la propriété UV du " +"matériau actif à [code]Vector3(3, 2, 1)[/code].\n" +"[b]Note :[/b] Lors de l'utilisation d'une grande texture [CubeMesh] (par " +"exemple pour le sol), vous pouvez tomber sur des problèmes de jittering de " +"l'UV suivant l'angle de la caméra. Pour résoudre cela, augmentez [member " +"subdivide_depth], [member subdivide_height] et [member subdivide_width] " +"jusqu'à ce que vous ne remarquez plus le jittering de l'UV." #: doc/classes/CubeMesh.xml msgid "Size of the cuboid mesh." @@ -23632,14 +24466,17 @@ msgstr "Taille du maillage cuboïde." #: doc/classes/CubeMesh.xml msgid "Number of extra edge loops inserted along the Z axis." msgstr "" +"Le nombre de boucles de bord supplémentaires insérées le long de l'axe Z." #: doc/classes/CubeMesh.xml msgid "Number of extra edge loops inserted along the Y axis." msgstr "" +"Le nombre de boucles de bord supplémentaires insérées le long de l'axe Y." #: doc/classes/CubeMesh.xml msgid "Number of extra edge loops inserted along the X axis." msgstr "" +"Le nombre de boucles de bord supplémentaires insérées le long de l'axe X." #: doc/classes/CullInstance.xml msgid "Parent of all nodes that can be culled by the Portal system." @@ -23753,6 +24590,9 @@ msgid "" "ranges between [code]0[/code] and [code]1[/code] on the Y axis and positions " "points relative to the [code]0.5[/code] Y position." msgstr "" +"Une courbe qui peut être sauvegardée et réutilisée pour d'autres objets. Par " +"défaut, elle va de [code]0[/code] à [code]1[/code] selon l'axe Y et les " +"positions sont relatives à la position [code]0.5[/code] de l'axe Y." #: doc/classes/Curve.xml msgid "" @@ -23762,6 +24602,12 @@ msgid "" "assignments to the [code]*_tangent[/code] angle if [code]*_mode[/code] is " "set to [constant TANGENT_FREE]." msgstr "" +"Ajoute un point à la courbe. Pour chaque côté, si le [code]*_mode[/code] est " +"[constant TANGENT_LINEAR], l'angle [code]*_tangent[/code] (en degrés) " +"utilise la pente de la courbe définie par rapport à la demi-distance du " +"point adjacent. Permet des spécifier des tangentes personnalisées avec " +"[code]*_tangent[/code] si [code]*_mode[/code] est défini à [constant " +"TANGENT_FREE]." #: doc/classes/Curve.xml msgid "Recomputes the baked cache of points for the curve." @@ -23772,6 +24618,8 @@ msgid "" "Removes points that are closer than [code]CMP_EPSILON[/code] (0.00001) units " "to their neighbor on the curve." msgstr "" +"Retire les points qui sont plus proches que [code]CMP_EPSILON[/code] " +"(0.00001) unités à leur voisin sur la courbe." #: doc/classes/Curve.xml doc/classes/Curve2D.xml doc/classes/Curve3D.xml msgid "Removes all points from the curve." @@ -23816,6 +24664,8 @@ msgid "" "Returns the Y value for the point that would exist at the X position " "[code]offset[/code] along the curve." msgstr "" +"Retourne la valeur Y pour un point qui existerait à la position X " +"[code]offset[/code] le long de la courbe." #: doc/classes/Curve.xml msgid "" @@ -23823,6 +24673,9 @@ msgid "" "[code]offset[/code] along the curve using the baked cache. Bakes the curve's " "points if not already baked." msgstr "" +"Retourne la valeur Y pour un point qui existerait à la position X " +"[code]offset[/code] le long de la courbe en utilisant le cache précalculé. " +"Précalcule les points de la courbe suivante si ça n'a pas déjà été fait." #: doc/classes/Curve.xml msgid "Removes the point at [code]index[/code] from the curve." @@ -23897,6 +24750,8 @@ msgid "" "The curve calculates the tangent on this side of the point as the slope " "halfway towards the adjacent point." msgstr "" +"La courbe calcule la tangente de ce côté du point comme la pente avec la " +"demi-distance du point adjacent." #: doc/classes/Curve.xml msgid "The total number of available tangent modes." @@ -24696,13 +25551,17 @@ msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "Amount of extra bias for shadow splits that are far away. If self-shadowing " -"occurs only on the splits far away, increasing this value can fix them." +"occurs only on the splits far away, increasing this value can fix them. This " +"is ignored when [member directional_shadow_mode] is [constant " +"SHADOW_ORTHOGONAL]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "If [code]true[/code], shadow detail is sacrificed in exchange for smoother " -"transitions between splits." +"transitions between splits. Enabling shadow blend splitting also has a " +"moderate performance cost. This is ignored when [member " +"directional_shadow_mode] is [constant SHADOW_ORTHOGONAL]." msgstr "" #: doc/classes/DirectionalLight.xml @@ -24714,8 +25573,12 @@ msgstr "" "Voir [enum ShadowDepthRange]." #: doc/classes/DirectionalLight.xml -msgid "The maximum distance for shadow splits." -msgstr "Distance maximale pour les fractionnements d’ombre." +msgid "" +"The maximum distance for shadow splits. Increasing this value will make " +"directional shadows visible from further away, at the cost of lower overall " +"shadow detail and performance (since more objects need to be included in the " +"directional shadow rendering)." +msgstr "" #: doc/classes/DirectionalLight.xml msgid "The light's shadow rendering algorithm. See [enum ShadowMode]." @@ -24732,23 +25595,23 @@ msgstr "" msgid "" "The distance from camera to shadow split 1. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or " -"[code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_2_SPLITS] or [constant " +"SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "The distance from shadow split 1 to split 2. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or " -"[code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_2_SPLITS] or [constant " +"SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "The distance from shadow split 2 to split 3. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml @@ -33073,9 +33936,8 @@ msgstr "" "[Gradient]." #: doc/classes/GradientTexture2D.xml -#, fuzzy msgid "Gradient-filled 2D texture." -msgstr "Texture remplie de gradients." +msgstr "Texture de gradient 2D." #: doc/classes/GradientTexture2D.xml msgid "" @@ -34350,9 +35212,8 @@ msgstr "" "valeur redimensionnera [member map_data]." #: doc/classes/HFlowContainer.xml -#, fuzzy msgid "Horizontal flow container." -msgstr "Conteneur de boîte horizontale." +msgstr "Conteneur de flux horizontal." #: doc/classes/HFlowContainer.xml msgid "Horizontal version of [FlowContainer]." @@ -36022,7 +36883,6 @@ msgstr "" "max_redirects]." #: doc/classes/Image.xml -#, fuzzy msgid "Image datatype." msgstr "Type de données d’image." @@ -37515,7 +38375,10 @@ msgid "" "input at the cost of increased CPU usage. In applications where drawing " "freehand lines is required, input accumulation should generally be disabled " "while the user is drawing the line to get results that closely follow the " -"actual input." +"actual input.\n" +"[b]Note:[/b] Input accumulation is [i]disabled[/i] by default for backward " +"compatibility reasons. It is however recommended to enable it for games " +"which don't require very reactive input, as this will decrease CPU usage." msgstr "" #: doc/classes/Input.xml @@ -38155,10 +39018,11 @@ msgstr "Type d’évènement d’entrée pour les évènements de mouvement de s msgid "" "Contains mouse and pen motion information. Supports relative, absolute " "positions and speed. See [method Node._input].\n" -"[b]Note:[/b] By default, this event is only emitted once per frame rendered " -"at most. If you need more precise input reporting, set [member Input." -"use_accumulated_input] to [code]false[/code] to make events emitted as often " -"as possible. If you use InputEventMouseMotion to draw lines, consider " +"[b]Note:[/b] By default, this event can be emitted multiple times per frame " +"rendered, allowing for precise input reporting, at the expense of CPU usage. " +"You can set [member Input.use_accumulated_input] to [code]true[/code] to let " +"multiple events merge into a single emitted event per frame.\n" +"[b]Note:[/b] If you use InputEventMouseMotion to draw lines, consider " "implementing [url=https://en.wikipedia.org/wiki/" "Bresenham%27s_line_algorithm]Bresenham's line algorithm[/url] as well to " "avoid visible gaps in lines if the user is moving the mouse quickly." @@ -38527,6 +39391,13 @@ msgstr "" "automatiquement." #: doc/classes/InterpolatedCamera.xml +#, fuzzy +msgid "" +"The camera's process callback. See [enum InterpolatedCameraProcessMode]." +msgstr "" +"La méthode de mise à jour de la camera. Voir [enum Camera2DProcessMode]." + +#: doc/classes/InterpolatedCamera.xml msgid "" "How quickly the camera moves toward its target. Higher values will result in " "tighter camera motion." @@ -42519,37 +43390,32 @@ msgstr "" "un tableau des sommets donc ce tableau doit être présent." #: doc/classes/Mesh.xml -#, fuzzy msgid "Mesh array contains normals." msgstr "Un maillage de points contient des normales." #: doc/classes/Mesh.xml -#, fuzzy msgid "Mesh array contains tangents." msgstr "Un maillage de points contient des tangentes." #: doc/classes/Mesh.xml -#, fuzzy msgid "Mesh array contains colors." -msgstr "Un maillage de points contient les couleurs." +msgstr "Un maillage de points contient des couleurs." #: doc/classes/Mesh.xml -#, fuzzy msgid "Mesh array contains UVs." -msgstr "Un maillage de points contient les UV." +msgstr "Un maillage de points contient des UV." #: doc/classes/Mesh.xml msgid "Mesh array contains second UV." -msgstr "Un maillage de points contient les UV secondaires." +msgstr "Un maillage de points contient des UV secondaires." #: doc/classes/Mesh.xml -#, fuzzy msgid "Mesh array contains bones." -msgstr "Un maillage de points contient les os." +msgstr "Un maillage de points contient des os." #: doc/classes/Mesh.xml msgid "Mesh array contains bone weights." -msgstr "Un maillage de points contient les poids des os." +msgstr "Un maillage de points contient des poids d'os." #: doc/classes/Mesh.xml msgid "Mesh array uses indices." @@ -44554,7 +45420,7 @@ msgid "" "maximum distance is exceeded, it recalculates the ideal path." msgstr "" -#: doc/classes/NavigationAgent.xml doc/classes/NavigationAgent2D.xml +#: doc/classes/NavigationAgent.xml msgid "" "The radius of the avoidance agent. This is the \"body\" of the avoidance " "agent and not the avoidance maneuver starting radius (which is controlled by " @@ -44667,6 +45533,14 @@ msgid "" "least one matching layer." msgstr "" +#: doc/classes/NavigationAgent2D.xml +msgid "" +"The radius of the avoidance agent. This is the \"body\" of the avoidance " +"agent and not the avoidance maneuver starting radius (which is controlled by " +"[member neighbor_dist]).\n" +"Does not affect normal pathfinding." +msgstr "" + #: doc/classes/NavigationMesh.xml msgid "A mesh to approximate the walkable areas and obstacles." msgstr "" @@ -47349,7 +48223,7 @@ msgstr "" #: doc/classes/Node2D.xml msgid "Local [Transform2D]." -msgstr "[Transform2D] local." +msgstr "[Transform2D] locale." #: doc/classes/Node2D.xml msgid "" @@ -51953,7 +52827,7 @@ msgstr "Représente la taille de l'énumération [enum Monitor]." #: doc/classes/PHashTranslation.xml msgid "Optimized translation." -msgstr "Translation optimisée." +msgstr "Traduction optimisée." #: doc/classes/PHashTranslation.xml msgid "" @@ -59564,8 +60438,8 @@ msgstr "" #: doc/classes/ProjectSettings.xml msgid "" -"Size for shadow atlas (used for OmniLights and SpotLights). See " -"documentation." +"Size for shadow atlas (used for OmniLights and SpotLights). The value will " +"be rounded up to the nearest power of 2. See shadow mapping documentation." msgstr "" #: doc/classes/ProjectSettings.xml @@ -68718,10 +69592,32 @@ msgstr "" #: doc/classes/String.xml msgid "" "Formats the string by replacing all occurrences of [code]placeholder[/code] " -"with [code]values[/code]." +"with the elements of [code]values[/code].\n" +"[code]values[/code] can be a [Dictionary] or an [Array]. Any underscores in " +"[code]placeholder[/code] will be replaced with the corresponding keys in " +"advance. Array elements use their index as keys.\n" +"[codeblock]\n" +"# Prints: Waiting for Godot is a play by Samuel Beckett, and Godot Engine is " +"named after it.\n" +"var use_array_values = \"Waiting for {0} is a play by {1}, and {0} Engine is " +"named after it.\"\n" +"print(use_array_values.format([\"Godot\", \"Samuel Beckett\"]))\n" +"\n" +"# Prints: User 42 is Godot.\n" +"print(\"User {id} is {name}.\".format({\"id\": 42, \"name\": \"Godot\"}))\n" +"[/codeblock]\n" +"Some additional handling is performed when [code]values[/code] is an array. " +"If [code]placeholder[/code] does not contain an underscore, the elements of " +"the array will be used to replace one occurrence of the placeholder in turn; " +"If an array element is another 2-element array, it'll be interpreted as a " +"key-value pair.\n" +"[codeblock]\n" +"# Prints: User 42 is Godot.\n" +"print(\"User {} is {}.\".format([42, \"Godot\"], \"{}\"))\n" +"print(\"User {id} is {name}.\".format([[\"id\", 42], [\"name\", " +"\"Godot\"]]))\n" +"[/codeblock]" msgstr "" -"Formate la chaîne de caractères en remplaçant toutes les occurences de " -"[code]placeholder[/code] par [code]values[/code]." #: doc/classes/String.xml msgid "If the string is a valid file path, returns the base directory name." @@ -69445,9 +70341,11 @@ msgstr "" #: doc/classes/StyleBox.xml msgid "" -"Draws this stylebox using a [CanvasItem] with given [RID].\n" -"You can get a [RID] value using [method Object.get_instance_id] on a " -"[CanvasItem]-derived node." +"Draws this stylebox using a canvas item identified by the given [RID].\n" +"The [RID] value can either be the result of [method CanvasItem." +"get_canvas_item] called on an existing [CanvasItem]-derived node, or " +"directly from creating a canvas item in the [VisualServer] with [method " +"VisualServer.canvas_item_create]." msgstr "" #: doc/classes/StyleBox.xml @@ -70427,12 +71325,12 @@ msgstr "" "[code]tab_idx[/code], le rendant non-interactif." #: doc/classes/TabContainer.xml -#, fuzzy msgid "" "If [code]hidden[/code] is [code]true[/code], hides the tab at index " "[code]tab_idx[/code], making it disappear from the tab area." msgstr "" -"Retourne [code]true[/code] si la piste à l'index [code]idx[/code] est active." +"Si [code]hidden[/code] est [code]true[/code], cache l'onglet à l'index " +"[code]tab_idx[/code], se faisait disparaitre de l'aire des onglets." #: doc/classes/TabContainer.xml msgid "Sets an icon for the tab at index [code]tab_idx[/code]." @@ -71236,6 +72134,11 @@ msgid "If [code]true[/code], a right-click displays the context menu." msgstr "Si [code]true[/code], un clic droit affiche le menu contextuel." #: doc/classes/TextEdit.xml +#, fuzzy +msgid "If [code]true[/code], allow drag and drop of selected text." +msgstr "Si [code]true[/code], la valeur peut être sélectionnée et modifiée." + +#: doc/classes/TextEdit.xml msgid "" "If [code]true[/code], the \"space\" character will have a visible " "representation." @@ -74138,13 +75041,13 @@ msgstr "" "matrice. L'axe [code]axis[/code] doit être normalisé." #: doc/classes/Transform.xml -#, fuzzy msgid "" "Returns a copy of the transform with its basis and origin scaled by the " "given [code]scale[/code] factor, using matrix multiplication." msgstr "" -"Met à l'échelle le transform par le facteur d'échelle donné, en utilisant la " -"multiplication matricielle." +"Retourne une copie de la transformation avec sa base et son origine mis à " +"l'échelle par le facteur [code]scale[/code], en utilisant la multiplication " +"matricielle." #: doc/classes/Transform.xml doc/classes/Transform2D.xml msgid "" @@ -77426,9 +78329,8 @@ msgid "" msgstr "" #: doc/classes/VFlowContainer.xml -#, fuzzy msgid "Vertical flow container." -msgstr "Conteneur vertical." +msgstr "Conteneur de flux vertical." #: doc/classes/VFlowContainer.xml msgid "Vertical version of [FlowContainer]." @@ -77976,9 +78878,10 @@ msgstr "" msgid "" "The shadow atlas' resolution (used for omni and spot lights). The value will " "be rounded up to the nearest power of 2.\n" -"[b]Note:[/b] If this is set to 0, shadows won't be visible. Since user-" -"created viewports default to a value of 0, this value must be set above 0 " -"manually." +"[b]Note:[/b] If this is set to [code]0[/code], both point [i]and[/i] " +"directional shadows won't be visible. Since user-created viewports default " +"to a value of [code]0[/code], this value must be set above [code]0[/code] " +"manually (typically at least [code]256[/code])." msgstr "" #: doc/classes/Viewport.xml @@ -78011,8 +78914,12 @@ msgstr "" "l'arrière-plan de manière transparente." #: doc/classes/Viewport.xml -msgid "The rendering mode of viewport." -msgstr "Le mode de rendu de la fenêtre d'affichage." +msgid "" +"The rendering mode of viewport.\n" +"[b]Note:[/b] If set to [constant USAGE_2D] or [constant " +"USAGE_2D_NO_SAMPLING], [member hdr] will have no effect when enabled since " +"HDR is not supported for 2D." +msgstr "" #: doc/classes/Viewport.xml msgid "" diff --git a/doc/translations/gl.po b/doc/translations/gl.po index 39d5ab2f2b..3273cd8f98 100644 --- a/doc/translations/gl.po +++ b/doc/translations/gl.po @@ -12140,10 +12140,12 @@ msgid "" msgstr "" #: doc/classes/Camera2D.xml doc/classes/ClippedCamera.xml +#: doc/classes/InterpolatedCamera.xml msgid "The camera updates with the [code]_physics_process[/code] callback." msgstr "" #: doc/classes/Camera2D.xml doc/classes/ClippedCamera.xml +#: doc/classes/InterpolatedCamera.xml msgid "The camera updates with the [code]_process[/code] callback." msgstr "" @@ -19425,13 +19427,17 @@ msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "Amount of extra bias for shadow splits that are far away. If self-shadowing " -"occurs only on the splits far away, increasing this value can fix them." +"occurs only on the splits far away, increasing this value can fix them. This " +"is ignored when [member directional_shadow_mode] is [constant " +"SHADOW_ORTHOGONAL]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "If [code]true[/code], shadow detail is sacrificed in exchange for smoother " -"transitions between splits." +"transitions between splits. Enabling shadow blend splitting also has a " +"moderate performance cost. This is ignored when [member " +"directional_shadow_mode] is [constant SHADOW_ORTHOGONAL]." msgstr "" #: doc/classes/DirectionalLight.xml @@ -19441,7 +19447,11 @@ msgid "" msgstr "" #: doc/classes/DirectionalLight.xml -msgid "The maximum distance for shadow splits." +msgid "" +"The maximum distance for shadow splits. Increasing this value will make " +"directional shadows visible from further away, at the cost of lower overall " +"shadow detail and performance (since more objects need to be included in the " +"directional shadow rendering)." msgstr "" #: doc/classes/DirectionalLight.xml @@ -19458,23 +19468,23 @@ msgstr "" msgid "" "The distance from camera to shadow split 1. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or " -"[code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_2_SPLITS] or [constant " +"SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "The distance from shadow split 1 to split 2. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or " -"[code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_2_SPLITS] or [constant " +"SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "The distance from shadow split 2 to split 3. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml @@ -29820,7 +29830,10 @@ msgid "" "input at the cost of increased CPU usage. In applications where drawing " "freehand lines is required, input accumulation should generally be disabled " "while the user is drawing the line to get results that closely follow the " -"actual input." +"actual input.\n" +"[b]Note:[/b] Input accumulation is [i]disabled[/i] by default for backward " +"compatibility reasons. It is however recommended to enable it for games " +"which don't require very reactive input, as this will decrease CPU usage." msgstr "" #: doc/classes/Input.xml @@ -30394,10 +30407,11 @@ msgstr "" msgid "" "Contains mouse and pen motion information. Supports relative, absolute " "positions and speed. See [method Node._input].\n" -"[b]Note:[/b] By default, this event is only emitted once per frame rendered " -"at most. If you need more precise input reporting, set [member Input." -"use_accumulated_input] to [code]false[/code] to make events emitted as often " -"as possible. If you use InputEventMouseMotion to draw lines, consider " +"[b]Note:[/b] By default, this event can be emitted multiple times per frame " +"rendered, allowing for precise input reporting, at the expense of CPU usage. " +"You can set [member Input.use_accumulated_input] to [code]true[/code] to let " +"multiple events merge into a single emitted event per frame.\n" +"[b]Note:[/b] If you use InputEventMouseMotion to draw lines, consider " "implementing [url=https://en.wikipedia.org/wiki/" "Bresenham%27s_line_algorithm]Bresenham's line algorithm[/url] as well to " "avoid visible gaps in lines if the user is moving the mouse quickly." @@ -30720,6 +30734,11 @@ msgstr "" #: doc/classes/InterpolatedCamera.xml msgid "" +"The camera's process callback. See [enum InterpolatedCameraProcessMode]." +msgstr "" + +#: doc/classes/InterpolatedCamera.xml +msgid "" "How quickly the camera moves toward its target. Higher values will result in " "tighter camera motion." msgstr "" @@ -36120,7 +36139,7 @@ msgid "" "maximum distance is exceeded, it recalculates the ideal path." msgstr "" -#: doc/classes/NavigationAgent.xml doc/classes/NavigationAgent2D.xml +#: doc/classes/NavigationAgent.xml msgid "" "The radius of the avoidance agent. This is the \"body\" of the avoidance " "agent and not the avoidance maneuver starting radius (which is controlled by " @@ -36231,6 +36250,14 @@ msgid "" "least one matching layer." msgstr "" +#: doc/classes/NavigationAgent2D.xml +msgid "" +"The radius of the avoidance agent. This is the \"body\" of the avoidance " +"agent and not the avoidance maneuver starting radius (which is controlled by " +"[member neighbor_dist]).\n" +"Does not affect normal pathfinding." +msgstr "" + #: doc/classes/NavigationMesh.xml msgid "A mesh to approximate the walkable areas and obstacles." msgstr "" @@ -49810,8 +49837,8 @@ msgstr "" #: doc/classes/ProjectSettings.xml msgid "" -"Size for shadow atlas (used for OmniLights and SpotLights). See " -"documentation." +"Size for shadow atlas (used for OmniLights and SpotLights). The value will " +"be rounded up to the nearest power of 2. See shadow mapping documentation." msgstr "" #: doc/classes/ProjectSettings.xml @@ -58180,7 +58207,31 @@ msgstr "" #: doc/classes/String.xml msgid "" "Formats the string by replacing all occurrences of [code]placeholder[/code] " -"with [code]values[/code]." +"with the elements of [code]values[/code].\n" +"[code]values[/code] can be a [Dictionary] or an [Array]. Any underscores in " +"[code]placeholder[/code] will be replaced with the corresponding keys in " +"advance. Array elements use their index as keys.\n" +"[codeblock]\n" +"# Prints: Waiting for Godot is a play by Samuel Beckett, and Godot Engine is " +"named after it.\n" +"var use_array_values = \"Waiting for {0} is a play by {1}, and {0} Engine is " +"named after it.\"\n" +"print(use_array_values.format([\"Godot\", \"Samuel Beckett\"]))\n" +"\n" +"# Prints: User 42 is Godot.\n" +"print(\"User {id} is {name}.\".format({\"id\": 42, \"name\": \"Godot\"}))\n" +"[/codeblock]\n" +"Some additional handling is performed when [code]values[/code] is an array. " +"If [code]placeholder[/code] does not contain an underscore, the elements of " +"the array will be used to replace one occurrence of the placeholder in turn; " +"If an array element is another 2-element array, it'll be interpreted as a " +"key-value pair.\n" +"[codeblock]\n" +"# Prints: User 42 is Godot.\n" +"print(\"User {} is {}.\".format([42, \"Godot\"], \"{}\"))\n" +"print(\"User {id} is {name}.\".format([[\"id\", 42], [\"name\", " +"\"Godot\"]]))\n" +"[/codeblock]" msgstr "" #: doc/classes/String.xml @@ -58777,9 +58828,11 @@ msgstr "" #: doc/classes/StyleBox.xml msgid "" -"Draws this stylebox using a [CanvasItem] with given [RID].\n" -"You can get a [RID] value using [method Object.get_instance_id] on a " -"[CanvasItem]-derived node." +"Draws this stylebox using a canvas item identified by the given [RID].\n" +"The [RID] value can either be the result of [method CanvasItem." +"get_canvas_item] called on an existing [CanvasItem]-derived node, or " +"directly from creating a canvas item in the [VisualServer] with [method " +"VisualServer.canvas_item_create]." msgstr "" #: doc/classes/StyleBox.xml @@ -60316,6 +60369,10 @@ msgid "If [code]true[/code], a right-click displays the context menu." msgstr "" #: doc/classes/TextEdit.xml +msgid "If [code]true[/code], allow drag and drop of selected text." +msgstr "" + +#: doc/classes/TextEdit.xml msgid "" "If [code]true[/code], the \"space\" character will have a visible " "representation." @@ -66390,9 +66447,10 @@ msgstr "" msgid "" "The shadow atlas' resolution (used for omni and spot lights). The value will " "be rounded up to the nearest power of 2.\n" -"[b]Note:[/b] If this is set to 0, shadows won't be visible. Since user-" -"created viewports default to a value of 0, this value must be set above 0 " -"manually." +"[b]Note:[/b] If this is set to [code]0[/code], both point [i]and[/i] " +"directional shadows won't be visible. Since user-created viewports default " +"to a value of [code]0[/code], this value must be set above [code]0[/code] " +"manually (typically at least [code]256[/code])." msgstr "" #: doc/classes/Viewport.xml @@ -66421,7 +66479,11 @@ msgid "" msgstr "" #: doc/classes/Viewport.xml -msgid "The rendering mode of viewport." +msgid "" +"The rendering mode of viewport.\n" +"[b]Note:[/b] If set to [constant USAGE_2D] or [constant " +"USAGE_2D_NO_SAMPLING], [member hdr] will have no effect when enabled since " +"HDR is not supported for 2D." msgstr "" #: doc/classes/Viewport.xml diff --git a/doc/translations/hi.po b/doc/translations/hi.po index a104e2ae6d..361c131a40 100644 --- a/doc/translations/hi.po +++ b/doc/translations/hi.po @@ -12139,10 +12139,12 @@ msgid "" msgstr "" #: doc/classes/Camera2D.xml doc/classes/ClippedCamera.xml +#: doc/classes/InterpolatedCamera.xml msgid "The camera updates with the [code]_physics_process[/code] callback." msgstr "" #: doc/classes/Camera2D.xml doc/classes/ClippedCamera.xml +#: doc/classes/InterpolatedCamera.xml msgid "The camera updates with the [code]_process[/code] callback." msgstr "" @@ -19424,13 +19426,17 @@ msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "Amount of extra bias for shadow splits that are far away. If self-shadowing " -"occurs only on the splits far away, increasing this value can fix them." +"occurs only on the splits far away, increasing this value can fix them. This " +"is ignored when [member directional_shadow_mode] is [constant " +"SHADOW_ORTHOGONAL]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "If [code]true[/code], shadow detail is sacrificed in exchange for smoother " -"transitions between splits." +"transitions between splits. Enabling shadow blend splitting also has a " +"moderate performance cost. This is ignored when [member " +"directional_shadow_mode] is [constant SHADOW_ORTHOGONAL]." msgstr "" #: doc/classes/DirectionalLight.xml @@ -19440,7 +19446,11 @@ msgid "" msgstr "" #: doc/classes/DirectionalLight.xml -msgid "The maximum distance for shadow splits." +msgid "" +"The maximum distance for shadow splits. Increasing this value will make " +"directional shadows visible from further away, at the cost of lower overall " +"shadow detail and performance (since more objects need to be included in the " +"directional shadow rendering)." msgstr "" #: doc/classes/DirectionalLight.xml @@ -19457,23 +19467,23 @@ msgstr "" msgid "" "The distance from camera to shadow split 1. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or " -"[code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_2_SPLITS] or [constant " +"SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "The distance from shadow split 1 to split 2. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or " -"[code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_2_SPLITS] or [constant " +"SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "The distance from shadow split 2 to split 3. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml @@ -29819,7 +29829,10 @@ msgid "" "input at the cost of increased CPU usage. In applications where drawing " "freehand lines is required, input accumulation should generally be disabled " "while the user is drawing the line to get results that closely follow the " -"actual input." +"actual input.\n" +"[b]Note:[/b] Input accumulation is [i]disabled[/i] by default for backward " +"compatibility reasons. It is however recommended to enable it for games " +"which don't require very reactive input, as this will decrease CPU usage." msgstr "" #: doc/classes/Input.xml @@ -30393,10 +30406,11 @@ msgstr "" msgid "" "Contains mouse and pen motion information. Supports relative, absolute " "positions and speed. See [method Node._input].\n" -"[b]Note:[/b] By default, this event is only emitted once per frame rendered " -"at most. If you need more precise input reporting, set [member Input." -"use_accumulated_input] to [code]false[/code] to make events emitted as often " -"as possible. If you use InputEventMouseMotion to draw lines, consider " +"[b]Note:[/b] By default, this event can be emitted multiple times per frame " +"rendered, allowing for precise input reporting, at the expense of CPU usage. " +"You can set [member Input.use_accumulated_input] to [code]true[/code] to let " +"multiple events merge into a single emitted event per frame.\n" +"[b]Note:[/b] If you use InputEventMouseMotion to draw lines, consider " "implementing [url=https://en.wikipedia.org/wiki/" "Bresenham%27s_line_algorithm]Bresenham's line algorithm[/url] as well to " "avoid visible gaps in lines if the user is moving the mouse quickly." @@ -30719,6 +30733,11 @@ msgstr "" #: doc/classes/InterpolatedCamera.xml msgid "" +"The camera's process callback. See [enum InterpolatedCameraProcessMode]." +msgstr "" + +#: doc/classes/InterpolatedCamera.xml +msgid "" "How quickly the camera moves toward its target. Higher values will result in " "tighter camera motion." msgstr "" @@ -36119,7 +36138,7 @@ msgid "" "maximum distance is exceeded, it recalculates the ideal path." msgstr "" -#: doc/classes/NavigationAgent.xml doc/classes/NavigationAgent2D.xml +#: doc/classes/NavigationAgent.xml msgid "" "The radius of the avoidance agent. This is the \"body\" of the avoidance " "agent and not the avoidance maneuver starting radius (which is controlled by " @@ -36230,6 +36249,14 @@ msgid "" "least one matching layer." msgstr "" +#: doc/classes/NavigationAgent2D.xml +msgid "" +"The radius of the avoidance agent. This is the \"body\" of the avoidance " +"agent and not the avoidance maneuver starting radius (which is controlled by " +"[member neighbor_dist]).\n" +"Does not affect normal pathfinding." +msgstr "" + #: doc/classes/NavigationMesh.xml msgid "A mesh to approximate the walkable areas and obstacles." msgstr "" @@ -49809,8 +49836,8 @@ msgstr "" #: doc/classes/ProjectSettings.xml msgid "" -"Size for shadow atlas (used for OmniLights and SpotLights). See " -"documentation." +"Size for shadow atlas (used for OmniLights and SpotLights). The value will " +"be rounded up to the nearest power of 2. See shadow mapping documentation." msgstr "" #: doc/classes/ProjectSettings.xml @@ -58179,7 +58206,31 @@ msgstr "" #: doc/classes/String.xml msgid "" "Formats the string by replacing all occurrences of [code]placeholder[/code] " -"with [code]values[/code]." +"with the elements of [code]values[/code].\n" +"[code]values[/code] can be a [Dictionary] or an [Array]. Any underscores in " +"[code]placeholder[/code] will be replaced with the corresponding keys in " +"advance. Array elements use their index as keys.\n" +"[codeblock]\n" +"# Prints: Waiting for Godot is a play by Samuel Beckett, and Godot Engine is " +"named after it.\n" +"var use_array_values = \"Waiting for {0} is a play by {1}, and {0} Engine is " +"named after it.\"\n" +"print(use_array_values.format([\"Godot\", \"Samuel Beckett\"]))\n" +"\n" +"# Prints: User 42 is Godot.\n" +"print(\"User {id} is {name}.\".format({\"id\": 42, \"name\": \"Godot\"}))\n" +"[/codeblock]\n" +"Some additional handling is performed when [code]values[/code] is an array. " +"If [code]placeholder[/code] does not contain an underscore, the elements of " +"the array will be used to replace one occurrence of the placeholder in turn; " +"If an array element is another 2-element array, it'll be interpreted as a " +"key-value pair.\n" +"[codeblock]\n" +"# Prints: User 42 is Godot.\n" +"print(\"User {} is {}.\".format([42, \"Godot\"], \"{}\"))\n" +"print(\"User {id} is {name}.\".format([[\"id\", 42], [\"name\", " +"\"Godot\"]]))\n" +"[/codeblock]" msgstr "" #: doc/classes/String.xml @@ -58776,9 +58827,11 @@ msgstr "" #: doc/classes/StyleBox.xml msgid "" -"Draws this stylebox using a [CanvasItem] with given [RID].\n" -"You can get a [RID] value using [method Object.get_instance_id] on a " -"[CanvasItem]-derived node." +"Draws this stylebox using a canvas item identified by the given [RID].\n" +"The [RID] value can either be the result of [method CanvasItem." +"get_canvas_item] called on an existing [CanvasItem]-derived node, or " +"directly from creating a canvas item in the [VisualServer] with [method " +"VisualServer.canvas_item_create]." msgstr "" #: doc/classes/StyleBox.xml @@ -60315,6 +60368,10 @@ msgid "If [code]true[/code], a right-click displays the context menu." msgstr "" #: doc/classes/TextEdit.xml +msgid "If [code]true[/code], allow drag and drop of selected text." +msgstr "" + +#: doc/classes/TextEdit.xml msgid "" "If [code]true[/code], the \"space\" character will have a visible " "representation." @@ -66389,9 +66446,10 @@ msgstr "" msgid "" "The shadow atlas' resolution (used for omni and spot lights). The value will " "be rounded up to the nearest power of 2.\n" -"[b]Note:[/b] If this is set to 0, shadows won't be visible. Since user-" -"created viewports default to a value of 0, this value must be set above 0 " -"manually." +"[b]Note:[/b] If this is set to [code]0[/code], both point [i]and[/i] " +"directional shadows won't be visible. Since user-created viewports default " +"to a value of [code]0[/code], this value must be set above [code]0[/code] " +"manually (typically at least [code]256[/code])." msgstr "" #: doc/classes/Viewport.xml @@ -66420,7 +66478,11 @@ msgid "" msgstr "" #: doc/classes/Viewport.xml -msgid "The rendering mode of viewport." +msgid "" +"The rendering mode of viewport.\n" +"[b]Note:[/b] If set to [constant USAGE_2D] or [constant " +"USAGE_2D_NO_SAMPLING], [member hdr] will have no effect when enabled since " +"HDR is not supported for 2D." msgstr "" #: doc/classes/Viewport.xml diff --git a/doc/translations/hu.po b/doc/translations/hu.po index 280424c8c0..2732b7b56a 100644 --- a/doc/translations/hu.po +++ b/doc/translations/hu.po @@ -12158,10 +12158,12 @@ msgid "" msgstr "" #: doc/classes/Camera2D.xml doc/classes/ClippedCamera.xml +#: doc/classes/InterpolatedCamera.xml msgid "The camera updates with the [code]_physics_process[/code] callback." msgstr "" #: doc/classes/Camera2D.xml doc/classes/ClippedCamera.xml +#: doc/classes/InterpolatedCamera.xml msgid "The camera updates with the [code]_process[/code] callback." msgstr "" @@ -19443,13 +19445,17 @@ msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "Amount of extra bias for shadow splits that are far away. If self-shadowing " -"occurs only on the splits far away, increasing this value can fix them." +"occurs only on the splits far away, increasing this value can fix them. This " +"is ignored when [member directional_shadow_mode] is [constant " +"SHADOW_ORTHOGONAL]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "If [code]true[/code], shadow detail is sacrificed in exchange for smoother " -"transitions between splits." +"transitions between splits. Enabling shadow blend splitting also has a " +"moderate performance cost. This is ignored when [member " +"directional_shadow_mode] is [constant SHADOW_ORTHOGONAL]." msgstr "" #: doc/classes/DirectionalLight.xml @@ -19459,7 +19465,11 @@ msgid "" msgstr "" #: doc/classes/DirectionalLight.xml -msgid "The maximum distance for shadow splits." +msgid "" +"The maximum distance for shadow splits. Increasing this value will make " +"directional shadows visible from further away, at the cost of lower overall " +"shadow detail and performance (since more objects need to be included in the " +"directional shadow rendering)." msgstr "" #: doc/classes/DirectionalLight.xml @@ -19476,23 +19486,23 @@ msgstr "" msgid "" "The distance from camera to shadow split 1. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or " -"[code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_2_SPLITS] or [constant " +"SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "The distance from shadow split 1 to split 2. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or " -"[code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_2_SPLITS] or [constant " +"SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "The distance from shadow split 2 to split 3. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml @@ -29838,7 +29848,10 @@ msgid "" "input at the cost of increased CPU usage. In applications where drawing " "freehand lines is required, input accumulation should generally be disabled " "while the user is drawing the line to get results that closely follow the " -"actual input." +"actual input.\n" +"[b]Note:[/b] Input accumulation is [i]disabled[/i] by default for backward " +"compatibility reasons. It is however recommended to enable it for games " +"which don't require very reactive input, as this will decrease CPU usage." msgstr "" #: doc/classes/Input.xml @@ -30412,10 +30425,11 @@ msgstr "" msgid "" "Contains mouse and pen motion information. Supports relative, absolute " "positions and speed. See [method Node._input].\n" -"[b]Note:[/b] By default, this event is only emitted once per frame rendered " -"at most. If you need more precise input reporting, set [member Input." -"use_accumulated_input] to [code]false[/code] to make events emitted as often " -"as possible. If you use InputEventMouseMotion to draw lines, consider " +"[b]Note:[/b] By default, this event can be emitted multiple times per frame " +"rendered, allowing for precise input reporting, at the expense of CPU usage. " +"You can set [member Input.use_accumulated_input] to [code]true[/code] to let " +"multiple events merge into a single emitted event per frame.\n" +"[b]Note:[/b] If you use InputEventMouseMotion to draw lines, consider " "implementing [url=https://en.wikipedia.org/wiki/" "Bresenham%27s_line_algorithm]Bresenham's line algorithm[/url] as well to " "avoid visible gaps in lines if the user is moving the mouse quickly." @@ -30738,6 +30752,11 @@ msgstr "" #: doc/classes/InterpolatedCamera.xml msgid "" +"The camera's process callback. See [enum InterpolatedCameraProcessMode]." +msgstr "" + +#: doc/classes/InterpolatedCamera.xml +msgid "" "How quickly the camera moves toward its target. Higher values will result in " "tighter camera motion." msgstr "" @@ -36138,7 +36157,7 @@ msgid "" "maximum distance is exceeded, it recalculates the ideal path." msgstr "" -#: doc/classes/NavigationAgent.xml doc/classes/NavigationAgent2D.xml +#: doc/classes/NavigationAgent.xml msgid "" "The radius of the avoidance agent. This is the \"body\" of the avoidance " "agent and not the avoidance maneuver starting radius (which is controlled by " @@ -36249,6 +36268,14 @@ msgid "" "least one matching layer." msgstr "" +#: doc/classes/NavigationAgent2D.xml +msgid "" +"The radius of the avoidance agent. This is the \"body\" of the avoidance " +"agent and not the avoidance maneuver starting radius (which is controlled by " +"[member neighbor_dist]).\n" +"Does not affect normal pathfinding." +msgstr "" + #: doc/classes/NavigationMesh.xml msgid "A mesh to approximate the walkable areas and obstacles." msgstr "" @@ -49828,8 +49855,8 @@ msgstr "" #: doc/classes/ProjectSettings.xml msgid "" -"Size for shadow atlas (used for OmniLights and SpotLights). See " -"documentation." +"Size for shadow atlas (used for OmniLights and SpotLights). The value will " +"be rounded up to the nearest power of 2. See shadow mapping documentation." msgstr "" #: doc/classes/ProjectSettings.xml @@ -58198,7 +58225,31 @@ msgstr "" #: doc/classes/String.xml msgid "" "Formats the string by replacing all occurrences of [code]placeholder[/code] " -"with [code]values[/code]." +"with the elements of [code]values[/code].\n" +"[code]values[/code] can be a [Dictionary] or an [Array]. Any underscores in " +"[code]placeholder[/code] will be replaced with the corresponding keys in " +"advance. Array elements use their index as keys.\n" +"[codeblock]\n" +"# Prints: Waiting for Godot is a play by Samuel Beckett, and Godot Engine is " +"named after it.\n" +"var use_array_values = \"Waiting for {0} is a play by {1}, and {0} Engine is " +"named after it.\"\n" +"print(use_array_values.format([\"Godot\", \"Samuel Beckett\"]))\n" +"\n" +"# Prints: User 42 is Godot.\n" +"print(\"User {id} is {name}.\".format({\"id\": 42, \"name\": \"Godot\"}))\n" +"[/codeblock]\n" +"Some additional handling is performed when [code]values[/code] is an array. " +"If [code]placeholder[/code] does not contain an underscore, the elements of " +"the array will be used to replace one occurrence of the placeholder in turn; " +"If an array element is another 2-element array, it'll be interpreted as a " +"key-value pair.\n" +"[codeblock]\n" +"# Prints: User 42 is Godot.\n" +"print(\"User {} is {}.\".format([42, \"Godot\"], \"{}\"))\n" +"print(\"User {id} is {name}.\".format([[\"id\", 42], [\"name\", " +"\"Godot\"]]))\n" +"[/codeblock]" msgstr "" #: doc/classes/String.xml @@ -58795,9 +58846,11 @@ msgstr "" #: doc/classes/StyleBox.xml msgid "" -"Draws this stylebox using a [CanvasItem] with given [RID].\n" -"You can get a [RID] value using [method Object.get_instance_id] on a " -"[CanvasItem]-derived node." +"Draws this stylebox using a canvas item identified by the given [RID].\n" +"The [RID] value can either be the result of [method CanvasItem." +"get_canvas_item] called on an existing [CanvasItem]-derived node, or " +"directly from creating a canvas item in the [VisualServer] with [method " +"VisualServer.canvas_item_create]." msgstr "" #: doc/classes/StyleBox.xml @@ -60334,6 +60387,10 @@ msgid "If [code]true[/code], a right-click displays the context menu." msgstr "" #: doc/classes/TextEdit.xml +msgid "If [code]true[/code], allow drag and drop of selected text." +msgstr "" + +#: doc/classes/TextEdit.xml msgid "" "If [code]true[/code], the \"space\" character will have a visible " "representation." @@ -66408,9 +66465,10 @@ msgstr "" msgid "" "The shadow atlas' resolution (used for omni and spot lights). The value will " "be rounded up to the nearest power of 2.\n" -"[b]Note:[/b] If this is set to 0, shadows won't be visible. Since user-" -"created viewports default to a value of 0, this value must be set above 0 " -"manually." +"[b]Note:[/b] If this is set to [code]0[/code], both point [i]and[/i] " +"directional shadows won't be visible. Since user-created viewports default " +"to a value of [code]0[/code], this value must be set above [code]0[/code] " +"manually (typically at least [code]256[/code])." msgstr "" #: doc/classes/Viewport.xml @@ -66439,7 +66497,11 @@ msgid "" msgstr "" #: doc/classes/Viewport.xml -msgid "The rendering mode of viewport." +msgid "" +"The rendering mode of viewport.\n" +"[b]Note:[/b] If set to [constant USAGE_2D] or [constant " +"USAGE_2D_NO_SAMPLING], [member hdr] will have no effect when enabled since " +"HDR is not supported for 2D." msgstr "" #: doc/classes/Viewport.xml diff --git a/doc/translations/id.po b/doc/translations/id.po index 2f741d544d..efc379cffd 100644 --- a/doc/translations/id.po +++ b/doc/translations/id.po @@ -12551,10 +12551,12 @@ msgid "" msgstr "" #: doc/classes/Camera2D.xml doc/classes/ClippedCamera.xml +#: doc/classes/InterpolatedCamera.xml msgid "The camera updates with the [code]_physics_process[/code] callback." msgstr "" #: doc/classes/Camera2D.xml doc/classes/ClippedCamera.xml +#: doc/classes/InterpolatedCamera.xml msgid "The camera updates with the [code]_process[/code] callback." msgstr "" @@ -19838,13 +19840,17 @@ msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "Amount of extra bias for shadow splits that are far away. If self-shadowing " -"occurs only on the splits far away, increasing this value can fix them." +"occurs only on the splits far away, increasing this value can fix them. This " +"is ignored when [member directional_shadow_mode] is [constant " +"SHADOW_ORTHOGONAL]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "If [code]true[/code], shadow detail is sacrificed in exchange for smoother " -"transitions between splits." +"transitions between splits. Enabling shadow blend splitting also has a " +"moderate performance cost. This is ignored when [member " +"directional_shadow_mode] is [constant SHADOW_ORTHOGONAL]." msgstr "" #: doc/classes/DirectionalLight.xml @@ -19854,7 +19860,11 @@ msgid "" msgstr "" #: doc/classes/DirectionalLight.xml -msgid "The maximum distance for shadow splits." +msgid "" +"The maximum distance for shadow splits. Increasing this value will make " +"directional shadows visible from further away, at the cost of lower overall " +"shadow detail and performance (since more objects need to be included in the " +"directional shadow rendering)." msgstr "" #: doc/classes/DirectionalLight.xml @@ -19871,23 +19881,23 @@ msgstr "" msgid "" "The distance from camera to shadow split 1. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or " -"[code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_2_SPLITS] or [constant " +"SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "The distance from shadow split 1 to split 2. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or " -"[code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_2_SPLITS] or [constant " +"SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "The distance from shadow split 2 to split 3. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml @@ -30244,7 +30254,10 @@ msgid "" "input at the cost of increased CPU usage. In applications where drawing " "freehand lines is required, input accumulation should generally be disabled " "while the user is drawing the line to get results that closely follow the " -"actual input." +"actual input.\n" +"[b]Note:[/b] Input accumulation is [i]disabled[/i] by default for backward " +"compatibility reasons. It is however recommended to enable it for games " +"which don't require very reactive input, as this will decrease CPU usage." msgstr "" #: doc/classes/Input.xml @@ -30818,10 +30831,11 @@ msgstr "" msgid "" "Contains mouse and pen motion information. Supports relative, absolute " "positions and speed. See [method Node._input].\n" -"[b]Note:[/b] By default, this event is only emitted once per frame rendered " -"at most. If you need more precise input reporting, set [member Input." -"use_accumulated_input] to [code]false[/code] to make events emitted as often " -"as possible. If you use InputEventMouseMotion to draw lines, consider " +"[b]Note:[/b] By default, this event can be emitted multiple times per frame " +"rendered, allowing for precise input reporting, at the expense of CPU usage. " +"You can set [member Input.use_accumulated_input] to [code]true[/code] to let " +"multiple events merge into a single emitted event per frame.\n" +"[b]Note:[/b] If you use InputEventMouseMotion to draw lines, consider " "implementing [url=https://en.wikipedia.org/wiki/" "Bresenham%27s_line_algorithm]Bresenham's line algorithm[/url] as well to " "avoid visible gaps in lines if the user is moving the mouse quickly." @@ -31144,6 +31158,11 @@ msgstr "" #: doc/classes/InterpolatedCamera.xml msgid "" +"The camera's process callback. See [enum InterpolatedCameraProcessMode]." +msgstr "" + +#: doc/classes/InterpolatedCamera.xml +msgid "" "How quickly the camera moves toward its target. Higher values will result in " "tighter camera motion." msgstr "" @@ -36564,7 +36583,7 @@ msgid "" "maximum distance is exceeded, it recalculates the ideal path." msgstr "" -#: doc/classes/NavigationAgent.xml doc/classes/NavigationAgent2D.xml +#: doc/classes/NavigationAgent.xml msgid "" "The radius of the avoidance agent. This is the \"body\" of the avoidance " "agent and not the avoidance maneuver starting radius (which is controlled by " @@ -36676,6 +36695,14 @@ msgid "" "least one matching layer." msgstr "" +#: doc/classes/NavigationAgent2D.xml +msgid "" +"The radius of the avoidance agent. This is the \"body\" of the avoidance " +"agent and not the avoidance maneuver starting radius (which is controlled by " +"[member neighbor_dist]).\n" +"Does not affect normal pathfinding." +msgstr "" + #: doc/classes/NavigationMesh.xml msgid "A mesh to approximate the walkable areas and obstacles." msgstr "" @@ -50277,8 +50304,8 @@ msgstr "" #: doc/classes/ProjectSettings.xml msgid "" -"Size for shadow atlas (used for OmniLights and SpotLights). See " -"documentation." +"Size for shadow atlas (used for OmniLights and SpotLights). The value will " +"be rounded up to the nearest power of 2. See shadow mapping documentation." msgstr "" #: doc/classes/ProjectSettings.xml @@ -58650,7 +58677,31 @@ msgstr "" #: doc/classes/String.xml msgid "" "Formats the string by replacing all occurrences of [code]placeholder[/code] " -"with [code]values[/code]." +"with the elements of [code]values[/code].\n" +"[code]values[/code] can be a [Dictionary] or an [Array]. Any underscores in " +"[code]placeholder[/code] will be replaced with the corresponding keys in " +"advance. Array elements use their index as keys.\n" +"[codeblock]\n" +"# Prints: Waiting for Godot is a play by Samuel Beckett, and Godot Engine is " +"named after it.\n" +"var use_array_values = \"Waiting for {0} is a play by {1}, and {0} Engine is " +"named after it.\"\n" +"print(use_array_values.format([\"Godot\", \"Samuel Beckett\"]))\n" +"\n" +"# Prints: User 42 is Godot.\n" +"print(\"User {id} is {name}.\".format({\"id\": 42, \"name\": \"Godot\"}))\n" +"[/codeblock]\n" +"Some additional handling is performed when [code]values[/code] is an array. " +"If [code]placeholder[/code] does not contain an underscore, the elements of " +"the array will be used to replace one occurrence of the placeholder in turn; " +"If an array element is another 2-element array, it'll be interpreted as a " +"key-value pair.\n" +"[codeblock]\n" +"# Prints: User 42 is Godot.\n" +"print(\"User {} is {}.\".format([42, \"Godot\"], \"{}\"))\n" +"print(\"User {id} is {name}.\".format([[\"id\", 42], [\"name\", " +"\"Godot\"]]))\n" +"[/codeblock]" msgstr "" #: doc/classes/String.xml @@ -59247,9 +59298,11 @@ msgstr "" #: doc/classes/StyleBox.xml msgid "" -"Draws this stylebox using a [CanvasItem] with given [RID].\n" -"You can get a [RID] value using [method Object.get_instance_id] on a " -"[CanvasItem]-derived node." +"Draws this stylebox using a canvas item identified by the given [RID].\n" +"The [RID] value can either be the result of [method CanvasItem." +"get_canvas_item] called on an existing [CanvasItem]-derived node, or " +"directly from creating a canvas item in the [VisualServer] with [method " +"VisualServer.canvas_item_create]." msgstr "" #: doc/classes/StyleBox.xml @@ -60790,6 +60843,10 @@ msgid "If [code]true[/code], a right-click displays the context menu." msgstr "" #: doc/classes/TextEdit.xml +msgid "If [code]true[/code], allow drag and drop of selected text." +msgstr "" + +#: doc/classes/TextEdit.xml msgid "" "If [code]true[/code], the \"space\" character will have a visible " "representation." @@ -66865,9 +66922,10 @@ msgstr "" msgid "" "The shadow atlas' resolution (used for omni and spot lights). The value will " "be rounded up to the nearest power of 2.\n" -"[b]Note:[/b] If this is set to 0, shadows won't be visible. Since user-" -"created viewports default to a value of 0, this value must be set above 0 " -"manually." +"[b]Note:[/b] If this is set to [code]0[/code], both point [i]and[/i] " +"directional shadows won't be visible. Since user-created viewports default " +"to a value of [code]0[/code], this value must be set above [code]0[/code] " +"manually (typically at least [code]256[/code])." msgstr "" #: doc/classes/Viewport.xml @@ -66896,7 +66954,11 @@ msgid "" msgstr "" #: doc/classes/Viewport.xml -msgid "The rendering mode of viewport." +msgid "" +"The rendering mode of viewport.\n" +"[b]Note:[/b] If set to [constant USAGE_2D] or [constant " +"USAGE_2D_NO_SAMPLING], [member hdr] will have no effect when enabled since " +"HDR is not supported for 2D." msgstr "" #: doc/classes/Viewport.xml diff --git a/doc/translations/is.po b/doc/translations/is.po index 4dd42d807e..bdd631ef18 100644 --- a/doc/translations/is.po +++ b/doc/translations/is.po @@ -12139,10 +12139,12 @@ msgid "" msgstr "" #: doc/classes/Camera2D.xml doc/classes/ClippedCamera.xml +#: doc/classes/InterpolatedCamera.xml msgid "The camera updates with the [code]_physics_process[/code] callback." msgstr "" #: doc/classes/Camera2D.xml doc/classes/ClippedCamera.xml +#: doc/classes/InterpolatedCamera.xml msgid "The camera updates with the [code]_process[/code] callback." msgstr "" @@ -19424,13 +19426,17 @@ msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "Amount of extra bias for shadow splits that are far away. If self-shadowing " -"occurs only on the splits far away, increasing this value can fix them." +"occurs only on the splits far away, increasing this value can fix them. This " +"is ignored when [member directional_shadow_mode] is [constant " +"SHADOW_ORTHOGONAL]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "If [code]true[/code], shadow detail is sacrificed in exchange for smoother " -"transitions between splits." +"transitions between splits. Enabling shadow blend splitting also has a " +"moderate performance cost. This is ignored when [member " +"directional_shadow_mode] is [constant SHADOW_ORTHOGONAL]." msgstr "" #: doc/classes/DirectionalLight.xml @@ -19440,7 +19446,11 @@ msgid "" msgstr "" #: doc/classes/DirectionalLight.xml -msgid "The maximum distance for shadow splits." +msgid "" +"The maximum distance for shadow splits. Increasing this value will make " +"directional shadows visible from further away, at the cost of lower overall " +"shadow detail and performance (since more objects need to be included in the " +"directional shadow rendering)." msgstr "" #: doc/classes/DirectionalLight.xml @@ -19457,23 +19467,23 @@ msgstr "" msgid "" "The distance from camera to shadow split 1. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or " -"[code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_2_SPLITS] or [constant " +"SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "The distance from shadow split 1 to split 2. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or " -"[code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_2_SPLITS] or [constant " +"SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "The distance from shadow split 2 to split 3. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml @@ -29819,7 +29829,10 @@ msgid "" "input at the cost of increased CPU usage. In applications where drawing " "freehand lines is required, input accumulation should generally be disabled " "while the user is drawing the line to get results that closely follow the " -"actual input." +"actual input.\n" +"[b]Note:[/b] Input accumulation is [i]disabled[/i] by default for backward " +"compatibility reasons. It is however recommended to enable it for games " +"which don't require very reactive input, as this will decrease CPU usage." msgstr "" #: doc/classes/Input.xml @@ -30393,10 +30406,11 @@ msgstr "" msgid "" "Contains mouse and pen motion information. Supports relative, absolute " "positions and speed. See [method Node._input].\n" -"[b]Note:[/b] By default, this event is only emitted once per frame rendered " -"at most. If you need more precise input reporting, set [member Input." -"use_accumulated_input] to [code]false[/code] to make events emitted as often " -"as possible. If you use InputEventMouseMotion to draw lines, consider " +"[b]Note:[/b] By default, this event can be emitted multiple times per frame " +"rendered, allowing for precise input reporting, at the expense of CPU usage. " +"You can set [member Input.use_accumulated_input] to [code]true[/code] to let " +"multiple events merge into a single emitted event per frame.\n" +"[b]Note:[/b] If you use InputEventMouseMotion to draw lines, consider " "implementing [url=https://en.wikipedia.org/wiki/" "Bresenham%27s_line_algorithm]Bresenham's line algorithm[/url] as well to " "avoid visible gaps in lines if the user is moving the mouse quickly." @@ -30719,6 +30733,11 @@ msgstr "" #: doc/classes/InterpolatedCamera.xml msgid "" +"The camera's process callback. See [enum InterpolatedCameraProcessMode]." +msgstr "" + +#: doc/classes/InterpolatedCamera.xml +msgid "" "How quickly the camera moves toward its target. Higher values will result in " "tighter camera motion." msgstr "" @@ -36119,7 +36138,7 @@ msgid "" "maximum distance is exceeded, it recalculates the ideal path." msgstr "" -#: doc/classes/NavigationAgent.xml doc/classes/NavigationAgent2D.xml +#: doc/classes/NavigationAgent.xml msgid "" "The radius of the avoidance agent. This is the \"body\" of the avoidance " "agent and not the avoidance maneuver starting radius (which is controlled by " @@ -36230,6 +36249,14 @@ msgid "" "least one matching layer." msgstr "" +#: doc/classes/NavigationAgent2D.xml +msgid "" +"The radius of the avoidance agent. This is the \"body\" of the avoidance " +"agent and not the avoidance maneuver starting radius (which is controlled by " +"[member neighbor_dist]).\n" +"Does not affect normal pathfinding." +msgstr "" + #: doc/classes/NavigationMesh.xml msgid "A mesh to approximate the walkable areas and obstacles." msgstr "" @@ -49809,8 +49836,8 @@ msgstr "" #: doc/classes/ProjectSettings.xml msgid "" -"Size for shadow atlas (used for OmniLights and SpotLights). See " -"documentation." +"Size for shadow atlas (used for OmniLights and SpotLights). The value will " +"be rounded up to the nearest power of 2. See shadow mapping documentation." msgstr "" #: doc/classes/ProjectSettings.xml @@ -58179,7 +58206,31 @@ msgstr "" #: doc/classes/String.xml msgid "" "Formats the string by replacing all occurrences of [code]placeholder[/code] " -"with [code]values[/code]." +"with the elements of [code]values[/code].\n" +"[code]values[/code] can be a [Dictionary] or an [Array]. Any underscores in " +"[code]placeholder[/code] will be replaced with the corresponding keys in " +"advance. Array elements use their index as keys.\n" +"[codeblock]\n" +"# Prints: Waiting for Godot is a play by Samuel Beckett, and Godot Engine is " +"named after it.\n" +"var use_array_values = \"Waiting for {0} is a play by {1}, and {0} Engine is " +"named after it.\"\n" +"print(use_array_values.format([\"Godot\", \"Samuel Beckett\"]))\n" +"\n" +"# Prints: User 42 is Godot.\n" +"print(\"User {id} is {name}.\".format({\"id\": 42, \"name\": \"Godot\"}))\n" +"[/codeblock]\n" +"Some additional handling is performed when [code]values[/code] is an array. " +"If [code]placeholder[/code] does not contain an underscore, the elements of " +"the array will be used to replace one occurrence of the placeholder in turn; " +"If an array element is another 2-element array, it'll be interpreted as a " +"key-value pair.\n" +"[codeblock]\n" +"# Prints: User 42 is Godot.\n" +"print(\"User {} is {}.\".format([42, \"Godot\"], \"{}\"))\n" +"print(\"User {id} is {name}.\".format([[\"id\", 42], [\"name\", " +"\"Godot\"]]))\n" +"[/codeblock]" msgstr "" #: doc/classes/String.xml @@ -58776,9 +58827,11 @@ msgstr "" #: doc/classes/StyleBox.xml msgid "" -"Draws this stylebox using a [CanvasItem] with given [RID].\n" -"You can get a [RID] value using [method Object.get_instance_id] on a " -"[CanvasItem]-derived node." +"Draws this stylebox using a canvas item identified by the given [RID].\n" +"The [RID] value can either be the result of [method CanvasItem." +"get_canvas_item] called on an existing [CanvasItem]-derived node, or " +"directly from creating a canvas item in the [VisualServer] with [method " +"VisualServer.canvas_item_create]." msgstr "" #: doc/classes/StyleBox.xml @@ -60315,6 +60368,10 @@ msgid "If [code]true[/code], a right-click displays the context menu." msgstr "" #: doc/classes/TextEdit.xml +msgid "If [code]true[/code], allow drag and drop of selected text." +msgstr "" + +#: doc/classes/TextEdit.xml msgid "" "If [code]true[/code], the \"space\" character will have a visible " "representation." @@ -66389,9 +66446,10 @@ msgstr "" msgid "" "The shadow atlas' resolution (used for omni and spot lights). The value will " "be rounded up to the nearest power of 2.\n" -"[b]Note:[/b] If this is set to 0, shadows won't be visible. Since user-" -"created viewports default to a value of 0, this value must be set above 0 " -"manually." +"[b]Note:[/b] If this is set to [code]0[/code], both point [i]and[/i] " +"directional shadows won't be visible. Since user-created viewports default " +"to a value of [code]0[/code], this value must be set above [code]0[/code] " +"manually (typically at least [code]256[/code])." msgstr "" #: doc/classes/Viewport.xml @@ -66420,7 +66478,11 @@ msgid "" msgstr "" #: doc/classes/Viewport.xml -msgid "The rendering mode of viewport." +msgid "" +"The rendering mode of viewport.\n" +"[b]Note:[/b] If set to [constant USAGE_2D] or [constant " +"USAGE_2D_NO_SAMPLING], [member hdr] will have no effect when enabled since " +"HDR is not supported for 2D." msgstr "" #: doc/classes/Viewport.xml diff --git a/doc/translations/it.po b/doc/translations/it.po index 9157d2ecc0..3d9cd62b30 100644 --- a/doc/translations/it.po +++ b/doc/translations/it.po @@ -13170,10 +13170,12 @@ msgid "" msgstr "" #: doc/classes/Camera2D.xml doc/classes/ClippedCamera.xml +#: doc/classes/InterpolatedCamera.xml msgid "The camera updates with the [code]_physics_process[/code] callback." msgstr "" #: doc/classes/Camera2D.xml doc/classes/ClippedCamera.xml +#: doc/classes/InterpolatedCamera.xml msgid "The camera updates with the [code]_process[/code] callback." msgstr "" @@ -20563,13 +20565,17 @@ msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "Amount of extra bias for shadow splits that are far away. If self-shadowing " -"occurs only on the splits far away, increasing this value can fix them." +"occurs only on the splits far away, increasing this value can fix them. This " +"is ignored when [member directional_shadow_mode] is [constant " +"SHADOW_ORTHOGONAL]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "If [code]true[/code], shadow detail is sacrificed in exchange for smoother " -"transitions between splits." +"transitions between splits. Enabling shadow blend splitting also has a " +"moderate performance cost. This is ignored when [member " +"directional_shadow_mode] is [constant SHADOW_ORTHOGONAL]." msgstr "" #: doc/classes/DirectionalLight.xml @@ -20579,7 +20585,11 @@ msgid "" msgstr "" #: doc/classes/DirectionalLight.xml -msgid "The maximum distance for shadow splits." +msgid "" +"The maximum distance for shadow splits. Increasing this value will make " +"directional shadows visible from further away, at the cost of lower overall " +"shadow detail and performance (since more objects need to be included in the " +"directional shadow rendering)." msgstr "" #: doc/classes/DirectionalLight.xml @@ -20596,23 +20606,23 @@ msgstr "" msgid "" "The distance from camera to shadow split 1. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or " -"[code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_2_SPLITS] or [constant " +"SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "The distance from shadow split 1 to split 2. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or " -"[code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_2_SPLITS] or [constant " +"SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "The distance from shadow split 2 to split 3. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml @@ -31009,7 +31019,10 @@ msgid "" "input at the cost of increased CPU usage. In applications where drawing " "freehand lines is required, input accumulation should generally be disabled " "while the user is drawing the line to get results that closely follow the " -"actual input." +"actual input.\n" +"[b]Note:[/b] Input accumulation is [i]disabled[/i] by default for backward " +"compatibility reasons. It is however recommended to enable it for games " +"which don't require very reactive input, as this will decrease CPU usage." msgstr "" #: doc/classes/Input.xml @@ -31584,10 +31597,11 @@ msgstr "" msgid "" "Contains mouse and pen motion information. Supports relative, absolute " "positions and speed. See [method Node._input].\n" -"[b]Note:[/b] By default, this event is only emitted once per frame rendered " -"at most. If you need more precise input reporting, set [member Input." -"use_accumulated_input] to [code]false[/code] to make events emitted as often " -"as possible. If you use InputEventMouseMotion to draw lines, consider " +"[b]Note:[/b] By default, this event can be emitted multiple times per frame " +"rendered, allowing for precise input reporting, at the expense of CPU usage. " +"You can set [member Input.use_accumulated_input] to [code]true[/code] to let " +"multiple events merge into a single emitted event per frame.\n" +"[b]Note:[/b] If you use InputEventMouseMotion to draw lines, consider " "implementing [url=https://en.wikipedia.org/wiki/" "Bresenham%27s_line_algorithm]Bresenham's line algorithm[/url] as well to " "avoid visible gaps in lines if the user is moving the mouse quickly." @@ -31914,6 +31928,11 @@ msgstr "" #: doc/classes/InterpolatedCamera.xml msgid "" +"The camera's process callback. See [enum InterpolatedCameraProcessMode]." +msgstr "" + +#: doc/classes/InterpolatedCamera.xml +msgid "" "How quickly the camera moves toward its target. Higher values will result in " "tighter camera motion." msgstr "" @@ -37368,7 +37387,7 @@ msgid "" "maximum distance is exceeded, it recalculates the ideal path." msgstr "" -#: doc/classes/NavigationAgent.xml doc/classes/NavigationAgent2D.xml +#: doc/classes/NavigationAgent.xml msgid "" "The radius of the avoidance agent. This is the \"body\" of the avoidance " "agent and not the avoidance maneuver starting radius (which is controlled by " @@ -37481,6 +37500,14 @@ msgid "" "least one matching layer." msgstr "" +#: doc/classes/NavigationAgent2D.xml +msgid "" +"The radius of the avoidance agent. This is the \"body\" of the avoidance " +"agent and not the avoidance maneuver starting radius (which is controlled by " +"[member neighbor_dist]).\n" +"Does not affect normal pathfinding." +msgstr "" + #: doc/classes/NavigationMesh.xml msgid "A mesh to approximate the walkable areas and obstacles." msgstr "" @@ -51136,8 +51163,8 @@ msgstr "" #: doc/classes/ProjectSettings.xml msgid "" -"Size for shadow atlas (used for OmniLights and SpotLights). See " -"documentation." +"Size for shadow atlas (used for OmniLights and SpotLights). The value will " +"be rounded up to the nearest power of 2. See shadow mapping documentation." msgstr "" #: doc/classes/ProjectSettings.xml @@ -59529,7 +59556,31 @@ msgstr "" #: doc/classes/String.xml msgid "" "Formats the string by replacing all occurrences of [code]placeholder[/code] " -"with [code]values[/code]." +"with the elements of [code]values[/code].\n" +"[code]values[/code] can be a [Dictionary] or an [Array]. Any underscores in " +"[code]placeholder[/code] will be replaced with the corresponding keys in " +"advance. Array elements use their index as keys.\n" +"[codeblock]\n" +"# Prints: Waiting for Godot is a play by Samuel Beckett, and Godot Engine is " +"named after it.\n" +"var use_array_values = \"Waiting for {0} is a play by {1}, and {0} Engine is " +"named after it.\"\n" +"print(use_array_values.format([\"Godot\", \"Samuel Beckett\"]))\n" +"\n" +"# Prints: User 42 is Godot.\n" +"print(\"User {id} is {name}.\".format({\"id\": 42, \"name\": \"Godot\"}))\n" +"[/codeblock]\n" +"Some additional handling is performed when [code]values[/code] is an array. " +"If [code]placeholder[/code] does not contain an underscore, the elements of " +"the array will be used to replace one occurrence of the placeholder in turn; " +"If an array element is another 2-element array, it'll be interpreted as a " +"key-value pair.\n" +"[codeblock]\n" +"# Prints: User 42 is Godot.\n" +"print(\"User {} is {}.\".format([42, \"Godot\"], \"{}\"))\n" +"print(\"User {id} is {name}.\".format([[\"id\", 42], [\"name\", " +"\"Godot\"]]))\n" +"[/codeblock]" msgstr "" #: doc/classes/String.xml @@ -60126,9 +60177,11 @@ msgstr "" #: doc/classes/StyleBox.xml msgid "" -"Draws this stylebox using a [CanvasItem] with given [RID].\n" -"You can get a [RID] value using [method Object.get_instance_id] on a " -"[CanvasItem]-derived node." +"Draws this stylebox using a canvas item identified by the given [RID].\n" +"The [RID] value can either be the result of [method CanvasItem." +"get_canvas_item] called on an existing [CanvasItem]-derived node, or " +"directly from creating a canvas item in the [VisualServer] with [method " +"VisualServer.canvas_item_create]." msgstr "" #: doc/classes/StyleBox.xml @@ -61688,6 +61741,13 @@ msgid "If [code]true[/code], a right-click displays the context menu." msgstr "" #: doc/classes/TextEdit.xml +#, fuzzy +msgid "If [code]true[/code], allow drag and drop of selected text." +msgstr "" +"Se [code] vero [/code], i nodi figli sono ordinati, altrimenti l'ordinamento " +"è disabilitato." + +#: doc/classes/TextEdit.xml msgid "" "If [code]true[/code], the \"space\" character will have a visible " "representation." @@ -67830,9 +67890,10 @@ msgstr "" msgid "" "The shadow atlas' resolution (used for omni and spot lights). The value will " "be rounded up to the nearest power of 2.\n" -"[b]Note:[/b] If this is set to 0, shadows won't be visible. Since user-" -"created viewports default to a value of 0, this value must be set above 0 " -"manually." +"[b]Note:[/b] If this is set to [code]0[/code], both point [i]and[/i] " +"directional shadows won't be visible. Since user-created viewports default " +"to a value of [code]0[/code], this value must be set above [code]0[/code] " +"manually (typically at least [code]256[/code])." msgstr "" #: doc/classes/Viewport.xml @@ -67864,7 +67925,11 @@ msgid "" msgstr "" #: doc/classes/Viewport.xml -msgid "The rendering mode of viewport." +msgid "" +"The rendering mode of viewport.\n" +"[b]Note:[/b] If set to [constant USAGE_2D] or [constant " +"USAGE_2D_NO_SAMPLING], [member hdr] will have no effect when enabled since " +"HDR is not supported for 2D." msgstr "" #: doc/classes/Viewport.xml diff --git a/doc/translations/ja.po b/doc/translations/ja.po index 75d4179693..8ace2ec0c8 100644 --- a/doc/translations/ja.po +++ b/doc/translations/ja.po @@ -15107,10 +15107,12 @@ msgid "" msgstr "" #: doc/classes/Camera2D.xml doc/classes/ClippedCamera.xml +#: doc/classes/InterpolatedCamera.xml msgid "The camera updates with the [code]_physics_process[/code] callback." msgstr "" #: doc/classes/Camera2D.xml doc/classes/ClippedCamera.xml +#: doc/classes/InterpolatedCamera.xml msgid "The camera updates with the [code]_process[/code] callback." msgstr "" @@ -22561,13 +22563,17 @@ msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "Amount of extra bias for shadow splits that are far away. If self-shadowing " -"occurs only on the splits far away, increasing this value can fix them." +"occurs only on the splits far away, increasing this value can fix them. This " +"is ignored when [member directional_shadow_mode] is [constant " +"SHADOW_ORTHOGONAL]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "If [code]true[/code], shadow detail is sacrificed in exchange for smoother " -"transitions between splits." +"transitions between splits. Enabling shadow blend splitting also has a " +"moderate performance cost. This is ignored when [member " +"directional_shadow_mode] is [constant SHADOW_ORTHOGONAL]." msgstr "" #: doc/classes/DirectionalLight.xml @@ -22577,7 +22583,11 @@ msgid "" msgstr "" #: doc/classes/DirectionalLight.xml -msgid "The maximum distance for shadow splits." +msgid "" +"The maximum distance for shadow splits. Increasing this value will make " +"directional shadows visible from further away, at the cost of lower overall " +"shadow detail and performance (since more objects need to be included in the " +"directional shadow rendering)." msgstr "" #: doc/classes/DirectionalLight.xml @@ -22594,23 +22604,23 @@ msgstr "" msgid "" "The distance from camera to shadow split 1. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or " -"[code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_2_SPLITS] or [constant " +"SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "The distance from shadow split 1 to split 2. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or " -"[code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_2_SPLITS] or [constant " +"SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "The distance from shadow split 2 to split 3. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml @@ -33071,7 +33081,10 @@ msgid "" "input at the cost of increased CPU usage. In applications where drawing " "freehand lines is required, input accumulation should generally be disabled " "while the user is drawing the line to get results that closely follow the " -"actual input." +"actual input.\n" +"[b]Note:[/b] Input accumulation is [i]disabled[/i] by default for backward " +"compatibility reasons. It is however recommended to enable it for games " +"which don't require very reactive input, as this will decrease CPU usage." msgstr "" #: doc/classes/Input.xml @@ -33645,10 +33658,11 @@ msgstr "" msgid "" "Contains mouse and pen motion information. Supports relative, absolute " "positions and speed. See [method Node._input].\n" -"[b]Note:[/b] By default, this event is only emitted once per frame rendered " -"at most. If you need more precise input reporting, set [member Input." -"use_accumulated_input] to [code]false[/code] to make events emitted as often " -"as possible. If you use InputEventMouseMotion to draw lines, consider " +"[b]Note:[/b] By default, this event can be emitted multiple times per frame " +"rendered, allowing for precise input reporting, at the expense of CPU usage. " +"You can set [member Input.use_accumulated_input] to [code]true[/code] to let " +"multiple events merge into a single emitted event per frame.\n" +"[b]Note:[/b] If you use InputEventMouseMotion to draw lines, consider " "implementing [url=https://en.wikipedia.org/wiki/" "Bresenham%27s_line_algorithm]Bresenham's line algorithm[/url] as well to " "avoid visible gaps in lines if the user is moving the mouse quickly." @@ -33977,6 +33991,11 @@ msgstr "" #: doc/classes/InterpolatedCamera.xml msgid "" +"The camera's process callback. See [enum InterpolatedCameraProcessMode]." +msgstr "" + +#: doc/classes/InterpolatedCamera.xml +msgid "" "How quickly the camera moves toward its target. Higher values will result in " "tighter camera motion." msgstr "" @@ -39508,7 +39527,7 @@ msgid "" "maximum distance is exceeded, it recalculates the ideal path." msgstr "" -#: doc/classes/NavigationAgent.xml doc/classes/NavigationAgent2D.xml +#: doc/classes/NavigationAgent.xml msgid "" "The radius of the avoidance agent. This is the \"body\" of the avoidance " "agent and not the avoidance maneuver starting radius (which is controlled by " @@ -39623,6 +39642,14 @@ msgid "" "least one matching layer." msgstr "" +#: doc/classes/NavigationAgent2D.xml +msgid "" +"The radius of the avoidance agent. This is the \"body\" of the avoidance " +"agent and not the avoidance maneuver starting radius (which is controlled by " +"[member neighbor_dist]).\n" +"Does not affect normal pathfinding." +msgstr "" + #: doc/classes/NavigationMesh.xml msgid "A mesh to approximate the walkable areas and obstacles." msgstr "" @@ -53345,8 +53372,8 @@ msgstr "" #: doc/classes/ProjectSettings.xml msgid "" -"Size for shadow atlas (used for OmniLights and SpotLights). See " -"documentation." +"Size for shadow atlas (used for OmniLights and SpotLights). The value will " +"be rounded up to the nearest power of 2. See shadow mapping documentation." msgstr "" #: doc/classes/ProjectSettings.xml @@ -62077,7 +62104,31 @@ msgstr "" #: doc/classes/String.xml msgid "" "Formats the string by replacing all occurrences of [code]placeholder[/code] " -"with [code]values[/code]." +"with the elements of [code]values[/code].\n" +"[code]values[/code] can be a [Dictionary] or an [Array]. Any underscores in " +"[code]placeholder[/code] will be replaced with the corresponding keys in " +"advance. Array elements use their index as keys.\n" +"[codeblock]\n" +"# Prints: Waiting for Godot is a play by Samuel Beckett, and Godot Engine is " +"named after it.\n" +"var use_array_values = \"Waiting for {0} is a play by {1}, and {0} Engine is " +"named after it.\"\n" +"print(use_array_values.format([\"Godot\", \"Samuel Beckett\"]))\n" +"\n" +"# Prints: User 42 is Godot.\n" +"print(\"User {id} is {name}.\".format({\"id\": 42, \"name\": \"Godot\"}))\n" +"[/codeblock]\n" +"Some additional handling is performed when [code]values[/code] is an array. " +"If [code]placeholder[/code] does not contain an underscore, the elements of " +"the array will be used to replace one occurrence of the placeholder in turn; " +"If an array element is another 2-element array, it'll be interpreted as a " +"key-value pair.\n" +"[codeblock]\n" +"# Prints: User 42 is Godot.\n" +"print(\"User {} is {}.\".format([42, \"Godot\"], \"{}\"))\n" +"print(\"User {id} is {name}.\".format([[\"id\", 42], [\"name\", " +"\"Godot\"]]))\n" +"[/codeblock]" msgstr "" #: doc/classes/String.xml @@ -62674,9 +62725,11 @@ msgstr "" #: doc/classes/StyleBox.xml msgid "" -"Draws this stylebox using a [CanvasItem] with given [RID].\n" -"You can get a [RID] value using [method Object.get_instance_id] on a " -"[CanvasItem]-derived node." +"Draws this stylebox using a canvas item identified by the given [RID].\n" +"The [RID] value can either be the result of [method CanvasItem." +"get_canvas_item] called on an existing [CanvasItem]-derived node, or " +"directly from creating a canvas item in the [VisualServer] with [method " +"VisualServer.canvas_item_create]." msgstr "" #: doc/classes/StyleBox.xml @@ -64251,6 +64304,11 @@ msgid "If [code]true[/code], a right-click displays the context menu." msgstr "" #: doc/classes/TextEdit.xml +#, fuzzy +msgid "If [code]true[/code], allow drag and drop of selected text." +msgstr "[code]true[/code] であれば、テクスチャは中央になります。" + +#: doc/classes/TextEdit.xml msgid "" "If [code]true[/code], the \"space\" character will have a visible " "representation." @@ -70432,9 +70490,10 @@ msgstr "" msgid "" "The shadow atlas' resolution (used for omni and spot lights). The value will " "be rounded up to the nearest power of 2.\n" -"[b]Note:[/b] If this is set to 0, shadows won't be visible. Since user-" -"created viewports default to a value of 0, this value must be set above 0 " -"manually." +"[b]Note:[/b] If this is set to [code]0[/code], both point [i]and[/i] " +"directional shadows won't be visible. Since user-created viewports default " +"to a value of [code]0[/code], this value must be set above [code]0[/code] " +"manually (typically at least [code]256[/code])." msgstr "" #: doc/classes/Viewport.xml @@ -70464,7 +70523,11 @@ msgid "" msgstr "" #: doc/classes/Viewport.xml -msgid "The rendering mode of viewport." +msgid "" +"The rendering mode of viewport.\n" +"[b]Note:[/b] If set to [constant USAGE_2D] or [constant " +"USAGE_2D_NO_SAMPLING], [member hdr] will have no effect when enabled since " +"HDR is not supported for 2D." msgstr "" #: doc/classes/Viewport.xml diff --git a/doc/translations/ko.po b/doc/translations/ko.po index a30a93f652..bd808074b9 100644 --- a/doc/translations/ko.po +++ b/doc/translations/ko.po @@ -15,12 +15,13 @@ # whatthesamuel <alex01763@gmail.com>, 2021. # 한수현 <shh1473@ajou.ac.kr>, 2022. # vrSono <global.sonogong@gmail.com>, 2022. +# 김태우 <ogosengi3@gmail.com>, 2022. msgid "" msgstr "" "Project-Id-Version: Godot Engine class reference\n" "Report-Msgid-Bugs-To: https://github.com/godotengine/godot\n" -"PO-Revision-Date: 2022-06-13 03:39+0000\n" -"Last-Translator: vrSono <global.sonogong@gmail.com>\n" +"PO-Revision-Date: 2022-06-29 10:30+0000\n" +"Last-Translator: 김태우 <ogosengi3@gmail.com>\n" "Language-Team: Korean <https://hosted.weblate.org/projects/godot-engine/" "godot-class-reference/ko/>\n" "Language: ko\n" @@ -28,7 +29,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8-bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Weblate 4.13-dev\n" +"X-Generator: Weblate 4.13.1-dev\n" #: doc/tools/make_rst.py msgid "Description" @@ -88,7 +89,7 @@ msgstr "(%s를 덮어씀)" #: doc/tools/make_rst.py msgid "Default" -msgstr "" +msgstr "기본값" #: doc/tools/make_rst.py msgid "Setter" @@ -96,7 +97,7 @@ msgstr "Setter" #: doc/tools/make_rst.py msgid "value" -msgstr "" +msgstr "값" #: doc/tools/make_rst.py msgid "Getter" @@ -12316,10 +12317,12 @@ msgid "" msgstr "" #: doc/classes/Camera2D.xml doc/classes/ClippedCamera.xml +#: doc/classes/InterpolatedCamera.xml msgid "The camera updates with the [code]_physics_process[/code] callback." msgstr "" #: doc/classes/Camera2D.xml doc/classes/ClippedCamera.xml +#: doc/classes/InterpolatedCamera.xml msgid "The camera updates with the [code]_process[/code] callback." msgstr "" @@ -19650,13 +19653,17 @@ msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "Amount of extra bias for shadow splits that are far away. If self-shadowing " -"occurs only on the splits far away, increasing this value can fix them." +"occurs only on the splits far away, increasing this value can fix them. This " +"is ignored when [member directional_shadow_mode] is [constant " +"SHADOW_ORTHOGONAL]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "If [code]true[/code], shadow detail is sacrificed in exchange for smoother " -"transitions between splits." +"transitions between splits. Enabling shadow blend splitting also has a " +"moderate performance cost. This is ignored when [member " +"directional_shadow_mode] is [constant SHADOW_ORTHOGONAL]." msgstr "" #: doc/classes/DirectionalLight.xml @@ -19666,7 +19673,11 @@ msgid "" msgstr "" #: doc/classes/DirectionalLight.xml -msgid "The maximum distance for shadow splits." +msgid "" +"The maximum distance for shadow splits. Increasing this value will make " +"directional shadows visible from further away, at the cost of lower overall " +"shadow detail and performance (since more objects need to be included in the " +"directional shadow rendering)." msgstr "" #: doc/classes/DirectionalLight.xml @@ -19683,23 +19694,23 @@ msgstr "" msgid "" "The distance from camera to shadow split 1. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or " -"[code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_2_SPLITS] or [constant " +"SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "The distance from shadow split 1 to split 2. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or " -"[code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_2_SPLITS] or [constant " +"SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "The distance from shadow split 2 to split 3. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml @@ -30129,7 +30140,10 @@ msgid "" "input at the cost of increased CPU usage. In applications where drawing " "freehand lines is required, input accumulation should generally be disabled " "while the user is drawing the line to get results that closely follow the " -"actual input." +"actual input.\n" +"[b]Note:[/b] Input accumulation is [i]disabled[/i] by default for backward " +"compatibility reasons. It is however recommended to enable it for games " +"which don't require very reactive input, as this will decrease CPU usage." msgstr "" #: doc/classes/Input.xml @@ -30703,10 +30717,11 @@ msgstr "" msgid "" "Contains mouse and pen motion information. Supports relative, absolute " "positions and speed. See [method Node._input].\n" -"[b]Note:[/b] By default, this event is only emitted once per frame rendered " -"at most. If you need more precise input reporting, set [member Input." -"use_accumulated_input] to [code]false[/code] to make events emitted as often " -"as possible. If you use InputEventMouseMotion to draw lines, consider " +"[b]Note:[/b] By default, this event can be emitted multiple times per frame " +"rendered, allowing for precise input reporting, at the expense of CPU usage. " +"You can set [member Input.use_accumulated_input] to [code]true[/code] to let " +"multiple events merge into a single emitted event per frame.\n" +"[b]Note:[/b] If you use InputEventMouseMotion to draw lines, consider " "implementing [url=https://en.wikipedia.org/wiki/" "Bresenham%27s_line_algorithm]Bresenham's line algorithm[/url] as well to " "avoid visible gaps in lines if the user is moving the mouse quickly." @@ -31030,6 +31045,11 @@ msgstr "" #: doc/classes/InterpolatedCamera.xml msgid "" +"The camera's process callback. See [enum InterpolatedCameraProcessMode]." +msgstr "" + +#: doc/classes/InterpolatedCamera.xml +msgid "" "How quickly the camera moves toward its target. Higher values will result in " "tighter camera motion." msgstr "" @@ -36462,7 +36482,7 @@ msgid "" "maximum distance is exceeded, it recalculates the ideal path." msgstr "" -#: doc/classes/NavigationAgent.xml doc/classes/NavigationAgent2D.xml +#: doc/classes/NavigationAgent.xml msgid "" "The radius of the avoidance agent. This is the \"body\" of the avoidance " "agent and not the avoidance maneuver starting radius (which is controlled by " @@ -36575,6 +36595,14 @@ msgid "" "least one matching layer." msgstr "" +#: doc/classes/NavigationAgent2D.xml +msgid "" +"The radius of the avoidance agent. This is the \"body\" of the avoidance " +"agent and not the avoidance maneuver starting radius (which is controlled by " +"[member neighbor_dist]).\n" +"Does not affect normal pathfinding." +msgstr "" + #: doc/classes/NavigationMesh.xml msgid "A mesh to approximate the walkable areas and obstacles." msgstr "" @@ -50318,8 +50346,8 @@ msgstr "" #: doc/classes/ProjectSettings.xml msgid "" -"Size for shadow atlas (used for OmniLights and SpotLights). See " -"documentation." +"Size for shadow atlas (used for OmniLights and SpotLights). The value will " +"be rounded up to the nearest power of 2. See shadow mapping documentation." msgstr "" #: doc/classes/ProjectSettings.xml @@ -58692,7 +58720,31 @@ msgstr "" #: doc/classes/String.xml msgid "" "Formats the string by replacing all occurrences of [code]placeholder[/code] " -"with [code]values[/code]." +"with the elements of [code]values[/code].\n" +"[code]values[/code] can be a [Dictionary] or an [Array]. Any underscores in " +"[code]placeholder[/code] will be replaced with the corresponding keys in " +"advance. Array elements use their index as keys.\n" +"[codeblock]\n" +"# Prints: Waiting for Godot is a play by Samuel Beckett, and Godot Engine is " +"named after it.\n" +"var use_array_values = \"Waiting for {0} is a play by {1}, and {0} Engine is " +"named after it.\"\n" +"print(use_array_values.format([\"Godot\", \"Samuel Beckett\"]))\n" +"\n" +"# Prints: User 42 is Godot.\n" +"print(\"User {id} is {name}.\".format({\"id\": 42, \"name\": \"Godot\"}))\n" +"[/codeblock]\n" +"Some additional handling is performed when [code]values[/code] is an array. " +"If [code]placeholder[/code] does not contain an underscore, the elements of " +"the array will be used to replace one occurrence of the placeholder in turn; " +"If an array element is another 2-element array, it'll be interpreted as a " +"key-value pair.\n" +"[codeblock]\n" +"# Prints: User 42 is Godot.\n" +"print(\"User {} is {}.\".format([42, \"Godot\"], \"{}\"))\n" +"print(\"User {id} is {name}.\".format([[\"id\", 42], [\"name\", " +"\"Godot\"]]))\n" +"[/codeblock]" msgstr "" #: doc/classes/String.xml @@ -59289,9 +59341,11 @@ msgstr "" #: doc/classes/StyleBox.xml msgid "" -"Draws this stylebox using a [CanvasItem] with given [RID].\n" -"You can get a [RID] value using [method Object.get_instance_id] on a " -"[CanvasItem]-derived node." +"Draws this stylebox using a canvas item identified by the given [RID].\n" +"The [RID] value can either be the result of [method CanvasItem." +"get_canvas_item] called on an existing [CanvasItem]-derived node, or " +"directly from creating a canvas item in the [VisualServer] with [method " +"VisualServer.canvas_item_create]." msgstr "" #: doc/classes/StyleBox.xml @@ -60836,6 +60890,11 @@ msgid "If [code]true[/code], a right-click displays the context menu." msgstr "" #: doc/classes/TextEdit.xml +#, fuzzy +msgid "If [code]true[/code], allow drag and drop of selected text." +msgstr "매개변수의 코사인 값을 반환합니다." + +#: doc/classes/TextEdit.xml msgid "" "If [code]true[/code], the \"space\" character will have a visible " "representation." @@ -66936,9 +66995,10 @@ msgstr "" msgid "" "The shadow atlas' resolution (used for omni and spot lights). The value will " "be rounded up to the nearest power of 2.\n" -"[b]Note:[/b] If this is set to 0, shadows won't be visible. Since user-" -"created viewports default to a value of 0, this value must be set above 0 " -"manually." +"[b]Note:[/b] If this is set to [code]0[/code], both point [i]and[/i] " +"directional shadows won't be visible. Since user-created viewports default " +"to a value of [code]0[/code], this value must be set above [code]0[/code] " +"manually (typically at least [code]256[/code])." msgstr "" #: doc/classes/Viewport.xml @@ -66967,7 +67027,11 @@ msgid "" msgstr "" #: doc/classes/Viewport.xml -msgid "The rendering mode of viewport." +msgid "" +"The rendering mode of viewport.\n" +"[b]Note:[/b] If set to [constant USAGE_2D] or [constant " +"USAGE_2D_NO_SAMPLING], [member hdr] will have no effect when enabled since " +"HDR is not supported for 2D." msgstr "" #: doc/classes/Viewport.xml diff --git a/doc/translations/lt.po b/doc/translations/lt.po index 1139bf4f82..2de21d55b3 100644 --- a/doc/translations/lt.po +++ b/doc/translations/lt.po @@ -12149,10 +12149,12 @@ msgid "" msgstr "" #: doc/classes/Camera2D.xml doc/classes/ClippedCamera.xml +#: doc/classes/InterpolatedCamera.xml msgid "The camera updates with the [code]_physics_process[/code] callback." msgstr "" #: doc/classes/Camera2D.xml doc/classes/ClippedCamera.xml +#: doc/classes/InterpolatedCamera.xml msgid "The camera updates with the [code]_process[/code] callback." msgstr "" @@ -19434,13 +19436,17 @@ msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "Amount of extra bias for shadow splits that are far away. If self-shadowing " -"occurs only on the splits far away, increasing this value can fix them." +"occurs only on the splits far away, increasing this value can fix them. This " +"is ignored when [member directional_shadow_mode] is [constant " +"SHADOW_ORTHOGONAL]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "If [code]true[/code], shadow detail is sacrificed in exchange for smoother " -"transitions between splits." +"transitions between splits. Enabling shadow blend splitting also has a " +"moderate performance cost. This is ignored when [member " +"directional_shadow_mode] is [constant SHADOW_ORTHOGONAL]." msgstr "" #: doc/classes/DirectionalLight.xml @@ -19450,7 +19456,11 @@ msgid "" msgstr "" #: doc/classes/DirectionalLight.xml -msgid "The maximum distance for shadow splits." +msgid "" +"The maximum distance for shadow splits. Increasing this value will make " +"directional shadows visible from further away, at the cost of lower overall " +"shadow detail and performance (since more objects need to be included in the " +"directional shadow rendering)." msgstr "" #: doc/classes/DirectionalLight.xml @@ -19467,23 +19477,23 @@ msgstr "" msgid "" "The distance from camera to shadow split 1. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or " -"[code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_2_SPLITS] or [constant " +"SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "The distance from shadow split 1 to split 2. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or " -"[code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_2_SPLITS] or [constant " +"SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "The distance from shadow split 2 to split 3. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml @@ -29829,7 +29839,10 @@ msgid "" "input at the cost of increased CPU usage. In applications where drawing " "freehand lines is required, input accumulation should generally be disabled " "while the user is drawing the line to get results that closely follow the " -"actual input." +"actual input.\n" +"[b]Note:[/b] Input accumulation is [i]disabled[/i] by default for backward " +"compatibility reasons. It is however recommended to enable it for games " +"which don't require very reactive input, as this will decrease CPU usage." msgstr "" #: doc/classes/Input.xml @@ -30403,10 +30416,11 @@ msgstr "" msgid "" "Contains mouse and pen motion information. Supports relative, absolute " "positions and speed. See [method Node._input].\n" -"[b]Note:[/b] By default, this event is only emitted once per frame rendered " -"at most. If you need more precise input reporting, set [member Input." -"use_accumulated_input] to [code]false[/code] to make events emitted as often " -"as possible. If you use InputEventMouseMotion to draw lines, consider " +"[b]Note:[/b] By default, this event can be emitted multiple times per frame " +"rendered, allowing for precise input reporting, at the expense of CPU usage. " +"You can set [member Input.use_accumulated_input] to [code]true[/code] to let " +"multiple events merge into a single emitted event per frame.\n" +"[b]Note:[/b] If you use InputEventMouseMotion to draw lines, consider " "implementing [url=https://en.wikipedia.org/wiki/" "Bresenham%27s_line_algorithm]Bresenham's line algorithm[/url] as well to " "avoid visible gaps in lines if the user is moving the mouse quickly." @@ -30729,6 +30743,11 @@ msgstr "" #: doc/classes/InterpolatedCamera.xml msgid "" +"The camera's process callback. See [enum InterpolatedCameraProcessMode]." +msgstr "" + +#: doc/classes/InterpolatedCamera.xml +msgid "" "How quickly the camera moves toward its target. Higher values will result in " "tighter camera motion." msgstr "" @@ -36129,7 +36148,7 @@ msgid "" "maximum distance is exceeded, it recalculates the ideal path." msgstr "" -#: doc/classes/NavigationAgent.xml doc/classes/NavigationAgent2D.xml +#: doc/classes/NavigationAgent.xml msgid "" "The radius of the avoidance agent. This is the \"body\" of the avoidance " "agent and not the avoidance maneuver starting radius (which is controlled by " @@ -36240,6 +36259,14 @@ msgid "" "least one matching layer." msgstr "" +#: doc/classes/NavigationAgent2D.xml +msgid "" +"The radius of the avoidance agent. This is the \"body\" of the avoidance " +"agent and not the avoidance maneuver starting radius (which is controlled by " +"[member neighbor_dist]).\n" +"Does not affect normal pathfinding." +msgstr "" + #: doc/classes/NavigationMesh.xml msgid "A mesh to approximate the walkable areas and obstacles." msgstr "" @@ -49819,8 +49846,8 @@ msgstr "" #: doc/classes/ProjectSettings.xml msgid "" -"Size for shadow atlas (used for OmniLights and SpotLights). See " -"documentation." +"Size for shadow atlas (used for OmniLights and SpotLights). The value will " +"be rounded up to the nearest power of 2. See shadow mapping documentation." msgstr "" #: doc/classes/ProjectSettings.xml @@ -58189,7 +58216,31 @@ msgstr "" #: doc/classes/String.xml msgid "" "Formats the string by replacing all occurrences of [code]placeholder[/code] " -"with [code]values[/code]." +"with the elements of [code]values[/code].\n" +"[code]values[/code] can be a [Dictionary] or an [Array]. Any underscores in " +"[code]placeholder[/code] will be replaced with the corresponding keys in " +"advance. Array elements use their index as keys.\n" +"[codeblock]\n" +"# Prints: Waiting for Godot is a play by Samuel Beckett, and Godot Engine is " +"named after it.\n" +"var use_array_values = \"Waiting for {0} is a play by {1}, and {0} Engine is " +"named after it.\"\n" +"print(use_array_values.format([\"Godot\", \"Samuel Beckett\"]))\n" +"\n" +"# Prints: User 42 is Godot.\n" +"print(\"User {id} is {name}.\".format({\"id\": 42, \"name\": \"Godot\"}))\n" +"[/codeblock]\n" +"Some additional handling is performed when [code]values[/code] is an array. " +"If [code]placeholder[/code] does not contain an underscore, the elements of " +"the array will be used to replace one occurrence of the placeholder in turn; " +"If an array element is another 2-element array, it'll be interpreted as a " +"key-value pair.\n" +"[codeblock]\n" +"# Prints: User 42 is Godot.\n" +"print(\"User {} is {}.\".format([42, \"Godot\"], \"{}\"))\n" +"print(\"User {id} is {name}.\".format([[\"id\", 42], [\"name\", " +"\"Godot\"]]))\n" +"[/codeblock]" msgstr "" #: doc/classes/String.xml @@ -58786,9 +58837,11 @@ msgstr "" #: doc/classes/StyleBox.xml msgid "" -"Draws this stylebox using a [CanvasItem] with given [RID].\n" -"You can get a [RID] value using [method Object.get_instance_id] on a " -"[CanvasItem]-derived node." +"Draws this stylebox using a canvas item identified by the given [RID].\n" +"The [RID] value can either be the result of [method CanvasItem." +"get_canvas_item] called on an existing [CanvasItem]-derived node, or " +"directly from creating a canvas item in the [VisualServer] with [method " +"VisualServer.canvas_item_create]." msgstr "" #: doc/classes/StyleBox.xml @@ -60325,6 +60378,10 @@ msgid "If [code]true[/code], a right-click displays the context menu." msgstr "" #: doc/classes/TextEdit.xml +msgid "If [code]true[/code], allow drag and drop of selected text." +msgstr "" + +#: doc/classes/TextEdit.xml msgid "" "If [code]true[/code], the \"space\" character will have a visible " "representation." @@ -66399,9 +66456,10 @@ msgstr "" msgid "" "The shadow atlas' resolution (used for omni and spot lights). The value will " "be rounded up to the nearest power of 2.\n" -"[b]Note:[/b] If this is set to 0, shadows won't be visible. Since user-" -"created viewports default to a value of 0, this value must be set above 0 " -"manually." +"[b]Note:[/b] If this is set to [code]0[/code], both point [i]and[/i] " +"directional shadows won't be visible. Since user-created viewports default " +"to a value of [code]0[/code], this value must be set above [code]0[/code] " +"manually (typically at least [code]256[/code])." msgstr "" #: doc/classes/Viewport.xml @@ -66430,7 +66488,11 @@ msgid "" msgstr "" #: doc/classes/Viewport.xml -msgid "The rendering mode of viewport." +msgid "" +"The rendering mode of viewport.\n" +"[b]Note:[/b] If set to [constant USAGE_2D] or [constant " +"USAGE_2D_NO_SAMPLING], [member hdr] will have no effect when enabled since " +"HDR is not supported for 2D." msgstr "" #: doc/classes/Viewport.xml diff --git a/doc/translations/lv.po b/doc/translations/lv.po index 627035b696..45e3188446 100644 --- a/doc/translations/lv.po +++ b/doc/translations/lv.po @@ -12154,10 +12154,12 @@ msgid "" msgstr "" #: doc/classes/Camera2D.xml doc/classes/ClippedCamera.xml +#: doc/classes/InterpolatedCamera.xml msgid "The camera updates with the [code]_physics_process[/code] callback." msgstr "" #: doc/classes/Camera2D.xml doc/classes/ClippedCamera.xml +#: doc/classes/InterpolatedCamera.xml msgid "The camera updates with the [code]_process[/code] callback." msgstr "" @@ -19439,13 +19441,17 @@ msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "Amount of extra bias for shadow splits that are far away. If self-shadowing " -"occurs only on the splits far away, increasing this value can fix them." +"occurs only on the splits far away, increasing this value can fix them. This " +"is ignored when [member directional_shadow_mode] is [constant " +"SHADOW_ORTHOGONAL]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "If [code]true[/code], shadow detail is sacrificed in exchange for smoother " -"transitions between splits." +"transitions between splits. Enabling shadow blend splitting also has a " +"moderate performance cost. This is ignored when [member " +"directional_shadow_mode] is [constant SHADOW_ORTHOGONAL]." msgstr "" #: doc/classes/DirectionalLight.xml @@ -19455,7 +19461,11 @@ msgid "" msgstr "" #: doc/classes/DirectionalLight.xml -msgid "The maximum distance for shadow splits." +msgid "" +"The maximum distance for shadow splits. Increasing this value will make " +"directional shadows visible from further away, at the cost of lower overall " +"shadow detail and performance (since more objects need to be included in the " +"directional shadow rendering)." msgstr "" #: doc/classes/DirectionalLight.xml @@ -19472,23 +19482,23 @@ msgstr "" msgid "" "The distance from camera to shadow split 1. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or " -"[code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_2_SPLITS] or [constant " +"SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "The distance from shadow split 1 to split 2. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or " -"[code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_2_SPLITS] or [constant " +"SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "The distance from shadow split 2 to split 3. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml @@ -29837,7 +29847,10 @@ msgid "" "input at the cost of increased CPU usage. In applications where drawing " "freehand lines is required, input accumulation should generally be disabled " "while the user is drawing the line to get results that closely follow the " -"actual input." +"actual input.\n" +"[b]Note:[/b] Input accumulation is [i]disabled[/i] by default for backward " +"compatibility reasons. It is however recommended to enable it for games " +"which don't require very reactive input, as this will decrease CPU usage." msgstr "" #: doc/classes/Input.xml @@ -30411,10 +30424,11 @@ msgstr "" msgid "" "Contains mouse and pen motion information. Supports relative, absolute " "positions and speed. See [method Node._input].\n" -"[b]Note:[/b] By default, this event is only emitted once per frame rendered " -"at most. If you need more precise input reporting, set [member Input." -"use_accumulated_input] to [code]false[/code] to make events emitted as often " -"as possible. If you use InputEventMouseMotion to draw lines, consider " +"[b]Note:[/b] By default, this event can be emitted multiple times per frame " +"rendered, allowing for precise input reporting, at the expense of CPU usage. " +"You can set [member Input.use_accumulated_input] to [code]true[/code] to let " +"multiple events merge into a single emitted event per frame.\n" +"[b]Note:[/b] If you use InputEventMouseMotion to draw lines, consider " "implementing [url=https://en.wikipedia.org/wiki/" "Bresenham%27s_line_algorithm]Bresenham's line algorithm[/url] as well to " "avoid visible gaps in lines if the user is moving the mouse quickly." @@ -30737,6 +30751,11 @@ msgstr "" #: doc/classes/InterpolatedCamera.xml msgid "" +"The camera's process callback. See [enum InterpolatedCameraProcessMode]." +msgstr "" + +#: doc/classes/InterpolatedCamera.xml +msgid "" "How quickly the camera moves toward its target. Higher values will result in " "tighter camera motion." msgstr "" @@ -36137,7 +36156,7 @@ msgid "" "maximum distance is exceeded, it recalculates the ideal path." msgstr "" -#: doc/classes/NavigationAgent.xml doc/classes/NavigationAgent2D.xml +#: doc/classes/NavigationAgent.xml msgid "" "The radius of the avoidance agent. This is the \"body\" of the avoidance " "agent and not the avoidance maneuver starting radius (which is controlled by " @@ -36248,6 +36267,14 @@ msgid "" "least one matching layer." msgstr "" +#: doc/classes/NavigationAgent2D.xml +msgid "" +"The radius of the avoidance agent. This is the \"body\" of the avoidance " +"agent and not the avoidance maneuver starting radius (which is controlled by " +"[member neighbor_dist]).\n" +"Does not affect normal pathfinding." +msgstr "" + #: doc/classes/NavigationMesh.xml msgid "A mesh to approximate the walkable areas and obstacles." msgstr "" @@ -49827,8 +49854,8 @@ msgstr "" #: doc/classes/ProjectSettings.xml msgid "" -"Size for shadow atlas (used for OmniLights and SpotLights). See " -"documentation." +"Size for shadow atlas (used for OmniLights and SpotLights). The value will " +"be rounded up to the nearest power of 2. See shadow mapping documentation." msgstr "" #: doc/classes/ProjectSettings.xml @@ -58197,7 +58224,31 @@ msgstr "" #: doc/classes/String.xml msgid "" "Formats the string by replacing all occurrences of [code]placeholder[/code] " -"with [code]values[/code]." +"with the elements of [code]values[/code].\n" +"[code]values[/code] can be a [Dictionary] or an [Array]. Any underscores in " +"[code]placeholder[/code] will be replaced with the corresponding keys in " +"advance. Array elements use their index as keys.\n" +"[codeblock]\n" +"# Prints: Waiting for Godot is a play by Samuel Beckett, and Godot Engine is " +"named after it.\n" +"var use_array_values = \"Waiting for {0} is a play by {1}, and {0} Engine is " +"named after it.\"\n" +"print(use_array_values.format([\"Godot\", \"Samuel Beckett\"]))\n" +"\n" +"# Prints: User 42 is Godot.\n" +"print(\"User {id} is {name}.\".format({\"id\": 42, \"name\": \"Godot\"}))\n" +"[/codeblock]\n" +"Some additional handling is performed when [code]values[/code] is an array. " +"If [code]placeholder[/code] does not contain an underscore, the elements of " +"the array will be used to replace one occurrence of the placeholder in turn; " +"If an array element is another 2-element array, it'll be interpreted as a " +"key-value pair.\n" +"[codeblock]\n" +"# Prints: User 42 is Godot.\n" +"print(\"User {} is {}.\".format([42, \"Godot\"], \"{}\"))\n" +"print(\"User {id} is {name}.\".format([[\"id\", 42], [\"name\", " +"\"Godot\"]]))\n" +"[/codeblock]" msgstr "" #: doc/classes/String.xml @@ -58794,9 +58845,11 @@ msgstr "" #: doc/classes/StyleBox.xml msgid "" -"Draws this stylebox using a [CanvasItem] with given [RID].\n" -"You can get a [RID] value using [method Object.get_instance_id] on a " -"[CanvasItem]-derived node." +"Draws this stylebox using a canvas item identified by the given [RID].\n" +"The [RID] value can either be the result of [method CanvasItem." +"get_canvas_item] called on an existing [CanvasItem]-derived node, or " +"directly from creating a canvas item in the [VisualServer] with [method " +"VisualServer.canvas_item_create]." msgstr "" #: doc/classes/StyleBox.xml @@ -60333,6 +60386,10 @@ msgid "If [code]true[/code], a right-click displays the context menu." msgstr "" #: doc/classes/TextEdit.xml +msgid "If [code]true[/code], allow drag and drop of selected text." +msgstr "" + +#: doc/classes/TextEdit.xml msgid "" "If [code]true[/code], the \"space\" character will have a visible " "representation." @@ -66407,9 +66464,10 @@ msgstr "" msgid "" "The shadow atlas' resolution (used for omni and spot lights). The value will " "be rounded up to the nearest power of 2.\n" -"[b]Note:[/b] If this is set to 0, shadows won't be visible. Since user-" -"created viewports default to a value of 0, this value must be set above 0 " -"manually." +"[b]Note:[/b] If this is set to [code]0[/code], both point [i]and[/i] " +"directional shadows won't be visible. Since user-created viewports default " +"to a value of [code]0[/code], this value must be set above [code]0[/code] " +"manually (typically at least [code]256[/code])." msgstr "" #: doc/classes/Viewport.xml @@ -66438,7 +66496,11 @@ msgid "" msgstr "" #: doc/classes/Viewport.xml -msgid "The rendering mode of viewport." +msgid "" +"The rendering mode of viewport.\n" +"[b]Note:[/b] If set to [constant USAGE_2D] or [constant " +"USAGE_2D_NO_SAMPLING], [member hdr] will have no effect when enabled since " +"HDR is not supported for 2D." msgstr "" #: doc/classes/Viewport.xml diff --git a/doc/translations/mr.po b/doc/translations/mr.po index d4e8907c1d..b943c79052 100644 --- a/doc/translations/mr.po +++ b/doc/translations/mr.po @@ -12137,10 +12137,12 @@ msgid "" msgstr "" #: doc/classes/Camera2D.xml doc/classes/ClippedCamera.xml +#: doc/classes/InterpolatedCamera.xml msgid "The camera updates with the [code]_physics_process[/code] callback." msgstr "" #: doc/classes/Camera2D.xml doc/classes/ClippedCamera.xml +#: doc/classes/InterpolatedCamera.xml msgid "The camera updates with the [code]_process[/code] callback." msgstr "" @@ -19422,13 +19424,17 @@ msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "Amount of extra bias for shadow splits that are far away. If self-shadowing " -"occurs only on the splits far away, increasing this value can fix them." +"occurs only on the splits far away, increasing this value can fix them. This " +"is ignored when [member directional_shadow_mode] is [constant " +"SHADOW_ORTHOGONAL]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "If [code]true[/code], shadow detail is sacrificed in exchange for smoother " -"transitions between splits." +"transitions between splits. Enabling shadow blend splitting also has a " +"moderate performance cost. This is ignored when [member " +"directional_shadow_mode] is [constant SHADOW_ORTHOGONAL]." msgstr "" #: doc/classes/DirectionalLight.xml @@ -19438,7 +19444,11 @@ msgid "" msgstr "" #: doc/classes/DirectionalLight.xml -msgid "The maximum distance for shadow splits." +msgid "" +"The maximum distance for shadow splits. Increasing this value will make " +"directional shadows visible from further away, at the cost of lower overall " +"shadow detail and performance (since more objects need to be included in the " +"directional shadow rendering)." msgstr "" #: doc/classes/DirectionalLight.xml @@ -19455,23 +19465,23 @@ msgstr "" msgid "" "The distance from camera to shadow split 1. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or " -"[code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_2_SPLITS] or [constant " +"SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "The distance from shadow split 1 to split 2. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or " -"[code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_2_SPLITS] or [constant " +"SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "The distance from shadow split 2 to split 3. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml @@ -29817,7 +29827,10 @@ msgid "" "input at the cost of increased CPU usage. In applications where drawing " "freehand lines is required, input accumulation should generally be disabled " "while the user is drawing the line to get results that closely follow the " -"actual input." +"actual input.\n" +"[b]Note:[/b] Input accumulation is [i]disabled[/i] by default for backward " +"compatibility reasons. It is however recommended to enable it for games " +"which don't require very reactive input, as this will decrease CPU usage." msgstr "" #: doc/classes/Input.xml @@ -30391,10 +30404,11 @@ msgstr "" msgid "" "Contains mouse and pen motion information. Supports relative, absolute " "positions and speed. See [method Node._input].\n" -"[b]Note:[/b] By default, this event is only emitted once per frame rendered " -"at most. If you need more precise input reporting, set [member Input." -"use_accumulated_input] to [code]false[/code] to make events emitted as often " -"as possible. If you use InputEventMouseMotion to draw lines, consider " +"[b]Note:[/b] By default, this event can be emitted multiple times per frame " +"rendered, allowing for precise input reporting, at the expense of CPU usage. " +"You can set [member Input.use_accumulated_input] to [code]true[/code] to let " +"multiple events merge into a single emitted event per frame.\n" +"[b]Note:[/b] If you use InputEventMouseMotion to draw lines, consider " "implementing [url=https://en.wikipedia.org/wiki/" "Bresenham%27s_line_algorithm]Bresenham's line algorithm[/url] as well to " "avoid visible gaps in lines if the user is moving the mouse quickly." @@ -30717,6 +30731,11 @@ msgstr "" #: doc/classes/InterpolatedCamera.xml msgid "" +"The camera's process callback. See [enum InterpolatedCameraProcessMode]." +msgstr "" + +#: doc/classes/InterpolatedCamera.xml +msgid "" "How quickly the camera moves toward its target. Higher values will result in " "tighter camera motion." msgstr "" @@ -36117,7 +36136,7 @@ msgid "" "maximum distance is exceeded, it recalculates the ideal path." msgstr "" -#: doc/classes/NavigationAgent.xml doc/classes/NavigationAgent2D.xml +#: doc/classes/NavigationAgent.xml msgid "" "The radius of the avoidance agent. This is the \"body\" of the avoidance " "agent and not the avoidance maneuver starting radius (which is controlled by " @@ -36228,6 +36247,14 @@ msgid "" "least one matching layer." msgstr "" +#: doc/classes/NavigationAgent2D.xml +msgid "" +"The radius of the avoidance agent. This is the \"body\" of the avoidance " +"agent and not the avoidance maneuver starting radius (which is controlled by " +"[member neighbor_dist]).\n" +"Does not affect normal pathfinding." +msgstr "" + #: doc/classes/NavigationMesh.xml msgid "A mesh to approximate the walkable areas and obstacles." msgstr "" @@ -49807,8 +49834,8 @@ msgstr "" #: doc/classes/ProjectSettings.xml msgid "" -"Size for shadow atlas (used for OmniLights and SpotLights). See " -"documentation." +"Size for shadow atlas (used for OmniLights and SpotLights). The value will " +"be rounded up to the nearest power of 2. See shadow mapping documentation." msgstr "" #: doc/classes/ProjectSettings.xml @@ -58177,7 +58204,31 @@ msgstr "" #: doc/classes/String.xml msgid "" "Formats the string by replacing all occurrences of [code]placeholder[/code] " -"with [code]values[/code]." +"with the elements of [code]values[/code].\n" +"[code]values[/code] can be a [Dictionary] or an [Array]. Any underscores in " +"[code]placeholder[/code] will be replaced with the corresponding keys in " +"advance. Array elements use their index as keys.\n" +"[codeblock]\n" +"# Prints: Waiting for Godot is a play by Samuel Beckett, and Godot Engine is " +"named after it.\n" +"var use_array_values = \"Waiting for {0} is a play by {1}, and {0} Engine is " +"named after it.\"\n" +"print(use_array_values.format([\"Godot\", \"Samuel Beckett\"]))\n" +"\n" +"# Prints: User 42 is Godot.\n" +"print(\"User {id} is {name}.\".format({\"id\": 42, \"name\": \"Godot\"}))\n" +"[/codeblock]\n" +"Some additional handling is performed when [code]values[/code] is an array. " +"If [code]placeholder[/code] does not contain an underscore, the elements of " +"the array will be used to replace one occurrence of the placeholder in turn; " +"If an array element is another 2-element array, it'll be interpreted as a " +"key-value pair.\n" +"[codeblock]\n" +"# Prints: User 42 is Godot.\n" +"print(\"User {} is {}.\".format([42, \"Godot\"], \"{}\"))\n" +"print(\"User {id} is {name}.\".format([[\"id\", 42], [\"name\", " +"\"Godot\"]]))\n" +"[/codeblock]" msgstr "" #: doc/classes/String.xml @@ -58774,9 +58825,11 @@ msgstr "" #: doc/classes/StyleBox.xml msgid "" -"Draws this stylebox using a [CanvasItem] with given [RID].\n" -"You can get a [RID] value using [method Object.get_instance_id] on a " -"[CanvasItem]-derived node." +"Draws this stylebox using a canvas item identified by the given [RID].\n" +"The [RID] value can either be the result of [method CanvasItem." +"get_canvas_item] called on an existing [CanvasItem]-derived node, or " +"directly from creating a canvas item in the [VisualServer] with [method " +"VisualServer.canvas_item_create]." msgstr "" #: doc/classes/StyleBox.xml @@ -60313,6 +60366,10 @@ msgid "If [code]true[/code], a right-click displays the context menu." msgstr "" #: doc/classes/TextEdit.xml +msgid "If [code]true[/code], allow drag and drop of selected text." +msgstr "" + +#: doc/classes/TextEdit.xml msgid "" "If [code]true[/code], the \"space\" character will have a visible " "representation." @@ -66387,9 +66444,10 @@ msgstr "" msgid "" "The shadow atlas' resolution (used for omni and spot lights). The value will " "be rounded up to the nearest power of 2.\n" -"[b]Note:[/b] If this is set to 0, shadows won't be visible. Since user-" -"created viewports default to a value of 0, this value must be set above 0 " -"manually." +"[b]Note:[/b] If this is set to [code]0[/code], both point [i]and[/i] " +"directional shadows won't be visible. Since user-created viewports default " +"to a value of [code]0[/code], this value must be set above [code]0[/code] " +"manually (typically at least [code]256[/code])." msgstr "" #: doc/classes/Viewport.xml @@ -66418,7 +66476,11 @@ msgid "" msgstr "" #: doc/classes/Viewport.xml -msgid "The rendering mode of viewport." +msgid "" +"The rendering mode of viewport.\n" +"[b]Note:[/b] If set to [constant USAGE_2D] or [constant " +"USAGE_2D_NO_SAMPLING], [member hdr] will have no effect when enabled since " +"HDR is not supported for 2D." msgstr "" #: doc/classes/Viewport.xml diff --git a/doc/translations/nb.po b/doc/translations/nb.po index 9aa8c17200..53fca58f26 100644 --- a/doc/translations/nb.po +++ b/doc/translations/nb.po @@ -12149,10 +12149,12 @@ msgid "" msgstr "" #: doc/classes/Camera2D.xml doc/classes/ClippedCamera.xml +#: doc/classes/InterpolatedCamera.xml msgid "The camera updates with the [code]_physics_process[/code] callback." msgstr "" #: doc/classes/Camera2D.xml doc/classes/ClippedCamera.xml +#: doc/classes/InterpolatedCamera.xml msgid "The camera updates with the [code]_process[/code] callback." msgstr "" @@ -19434,13 +19436,17 @@ msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "Amount of extra bias for shadow splits that are far away. If self-shadowing " -"occurs only on the splits far away, increasing this value can fix them." +"occurs only on the splits far away, increasing this value can fix them. This " +"is ignored when [member directional_shadow_mode] is [constant " +"SHADOW_ORTHOGONAL]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "If [code]true[/code], shadow detail is sacrificed in exchange for smoother " -"transitions between splits." +"transitions between splits. Enabling shadow blend splitting also has a " +"moderate performance cost. This is ignored when [member " +"directional_shadow_mode] is [constant SHADOW_ORTHOGONAL]." msgstr "" #: doc/classes/DirectionalLight.xml @@ -19450,7 +19456,11 @@ msgid "" msgstr "" #: doc/classes/DirectionalLight.xml -msgid "The maximum distance for shadow splits." +msgid "" +"The maximum distance for shadow splits. Increasing this value will make " +"directional shadows visible from further away, at the cost of lower overall " +"shadow detail and performance (since more objects need to be included in the " +"directional shadow rendering)." msgstr "" #: doc/classes/DirectionalLight.xml @@ -19467,23 +19477,23 @@ msgstr "" msgid "" "The distance from camera to shadow split 1. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or " -"[code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_2_SPLITS] or [constant " +"SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "The distance from shadow split 1 to split 2. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or " -"[code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_2_SPLITS] or [constant " +"SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "The distance from shadow split 2 to split 3. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml @@ -29829,7 +29839,10 @@ msgid "" "input at the cost of increased CPU usage. In applications where drawing " "freehand lines is required, input accumulation should generally be disabled " "while the user is drawing the line to get results that closely follow the " -"actual input." +"actual input.\n" +"[b]Note:[/b] Input accumulation is [i]disabled[/i] by default for backward " +"compatibility reasons. It is however recommended to enable it for games " +"which don't require very reactive input, as this will decrease CPU usage." msgstr "" #: doc/classes/Input.xml @@ -30403,10 +30416,11 @@ msgstr "" msgid "" "Contains mouse and pen motion information. Supports relative, absolute " "positions and speed. See [method Node._input].\n" -"[b]Note:[/b] By default, this event is only emitted once per frame rendered " -"at most. If you need more precise input reporting, set [member Input." -"use_accumulated_input] to [code]false[/code] to make events emitted as often " -"as possible. If you use InputEventMouseMotion to draw lines, consider " +"[b]Note:[/b] By default, this event can be emitted multiple times per frame " +"rendered, allowing for precise input reporting, at the expense of CPU usage. " +"You can set [member Input.use_accumulated_input] to [code]true[/code] to let " +"multiple events merge into a single emitted event per frame.\n" +"[b]Note:[/b] If you use InputEventMouseMotion to draw lines, consider " "implementing [url=https://en.wikipedia.org/wiki/" "Bresenham%27s_line_algorithm]Bresenham's line algorithm[/url] as well to " "avoid visible gaps in lines if the user is moving the mouse quickly." @@ -30729,6 +30743,11 @@ msgstr "" #: doc/classes/InterpolatedCamera.xml msgid "" +"The camera's process callback. See [enum InterpolatedCameraProcessMode]." +msgstr "" + +#: doc/classes/InterpolatedCamera.xml +msgid "" "How quickly the camera moves toward its target. Higher values will result in " "tighter camera motion." msgstr "" @@ -36129,7 +36148,7 @@ msgid "" "maximum distance is exceeded, it recalculates the ideal path." msgstr "" -#: doc/classes/NavigationAgent.xml doc/classes/NavigationAgent2D.xml +#: doc/classes/NavigationAgent.xml msgid "" "The radius of the avoidance agent. This is the \"body\" of the avoidance " "agent and not the avoidance maneuver starting radius (which is controlled by " @@ -36240,6 +36259,14 @@ msgid "" "least one matching layer." msgstr "" +#: doc/classes/NavigationAgent2D.xml +msgid "" +"The radius of the avoidance agent. This is the \"body\" of the avoidance " +"agent and not the avoidance maneuver starting radius (which is controlled by " +"[member neighbor_dist]).\n" +"Does not affect normal pathfinding." +msgstr "" + #: doc/classes/NavigationMesh.xml msgid "A mesh to approximate the walkable areas and obstacles." msgstr "" @@ -49819,8 +49846,8 @@ msgstr "" #: doc/classes/ProjectSettings.xml msgid "" -"Size for shadow atlas (used for OmniLights and SpotLights). See " -"documentation." +"Size for shadow atlas (used for OmniLights and SpotLights). The value will " +"be rounded up to the nearest power of 2. See shadow mapping documentation." msgstr "" #: doc/classes/ProjectSettings.xml @@ -58189,7 +58216,31 @@ msgstr "" #: doc/classes/String.xml msgid "" "Formats the string by replacing all occurrences of [code]placeholder[/code] " -"with [code]values[/code]." +"with the elements of [code]values[/code].\n" +"[code]values[/code] can be a [Dictionary] or an [Array]. Any underscores in " +"[code]placeholder[/code] will be replaced with the corresponding keys in " +"advance. Array elements use their index as keys.\n" +"[codeblock]\n" +"# Prints: Waiting for Godot is a play by Samuel Beckett, and Godot Engine is " +"named after it.\n" +"var use_array_values = \"Waiting for {0} is a play by {1}, and {0} Engine is " +"named after it.\"\n" +"print(use_array_values.format([\"Godot\", \"Samuel Beckett\"]))\n" +"\n" +"# Prints: User 42 is Godot.\n" +"print(\"User {id} is {name}.\".format({\"id\": 42, \"name\": \"Godot\"}))\n" +"[/codeblock]\n" +"Some additional handling is performed when [code]values[/code] is an array. " +"If [code]placeholder[/code] does not contain an underscore, the elements of " +"the array will be used to replace one occurrence of the placeholder in turn; " +"If an array element is another 2-element array, it'll be interpreted as a " +"key-value pair.\n" +"[codeblock]\n" +"# Prints: User 42 is Godot.\n" +"print(\"User {} is {}.\".format([42, \"Godot\"], \"{}\"))\n" +"print(\"User {id} is {name}.\".format([[\"id\", 42], [\"name\", " +"\"Godot\"]]))\n" +"[/codeblock]" msgstr "" #: doc/classes/String.xml @@ -58786,9 +58837,11 @@ msgstr "" #: doc/classes/StyleBox.xml msgid "" -"Draws this stylebox using a [CanvasItem] with given [RID].\n" -"You can get a [RID] value using [method Object.get_instance_id] on a " -"[CanvasItem]-derived node." +"Draws this stylebox using a canvas item identified by the given [RID].\n" +"The [RID] value can either be the result of [method CanvasItem." +"get_canvas_item] called on an existing [CanvasItem]-derived node, or " +"directly from creating a canvas item in the [VisualServer] with [method " +"VisualServer.canvas_item_create]." msgstr "" #: doc/classes/StyleBox.xml @@ -60325,6 +60378,10 @@ msgid "If [code]true[/code], a right-click displays the context menu." msgstr "" #: doc/classes/TextEdit.xml +msgid "If [code]true[/code], allow drag and drop of selected text." +msgstr "" + +#: doc/classes/TextEdit.xml msgid "" "If [code]true[/code], the \"space\" character will have a visible " "representation." @@ -66399,9 +66456,10 @@ msgstr "" msgid "" "The shadow atlas' resolution (used for omni and spot lights). The value will " "be rounded up to the nearest power of 2.\n" -"[b]Note:[/b] If this is set to 0, shadows won't be visible. Since user-" -"created viewports default to a value of 0, this value must be set above 0 " -"manually." +"[b]Note:[/b] If this is set to [code]0[/code], both point [i]and[/i] " +"directional shadows won't be visible. Since user-created viewports default " +"to a value of [code]0[/code], this value must be set above [code]0[/code] " +"manually (typically at least [code]256[/code])." msgstr "" #: doc/classes/Viewport.xml @@ -66430,7 +66488,11 @@ msgid "" msgstr "" #: doc/classes/Viewport.xml -msgid "The rendering mode of viewport." +msgid "" +"The rendering mode of viewport.\n" +"[b]Note:[/b] If set to [constant USAGE_2D] or [constant " +"USAGE_2D_NO_SAMPLING], [member hdr] will have no effect when enabled since " +"HDR is not supported for 2D." msgstr "" #: doc/classes/Viewport.xml diff --git a/doc/translations/ne.po b/doc/translations/ne.po index f129446976..24062d3cff 100644 --- a/doc/translations/ne.po +++ b/doc/translations/ne.po @@ -12137,10 +12137,12 @@ msgid "" msgstr "" #: doc/classes/Camera2D.xml doc/classes/ClippedCamera.xml +#: doc/classes/InterpolatedCamera.xml msgid "The camera updates with the [code]_physics_process[/code] callback." msgstr "" #: doc/classes/Camera2D.xml doc/classes/ClippedCamera.xml +#: doc/classes/InterpolatedCamera.xml msgid "The camera updates with the [code]_process[/code] callback." msgstr "" @@ -19422,13 +19424,17 @@ msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "Amount of extra bias for shadow splits that are far away. If self-shadowing " -"occurs only on the splits far away, increasing this value can fix them." +"occurs only on the splits far away, increasing this value can fix them. This " +"is ignored when [member directional_shadow_mode] is [constant " +"SHADOW_ORTHOGONAL]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "If [code]true[/code], shadow detail is sacrificed in exchange for smoother " -"transitions between splits." +"transitions between splits. Enabling shadow blend splitting also has a " +"moderate performance cost. This is ignored when [member " +"directional_shadow_mode] is [constant SHADOW_ORTHOGONAL]." msgstr "" #: doc/classes/DirectionalLight.xml @@ -19438,7 +19444,11 @@ msgid "" msgstr "" #: doc/classes/DirectionalLight.xml -msgid "The maximum distance for shadow splits." +msgid "" +"The maximum distance for shadow splits. Increasing this value will make " +"directional shadows visible from further away, at the cost of lower overall " +"shadow detail and performance (since more objects need to be included in the " +"directional shadow rendering)." msgstr "" #: doc/classes/DirectionalLight.xml @@ -19455,23 +19465,23 @@ msgstr "" msgid "" "The distance from camera to shadow split 1. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or " -"[code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_2_SPLITS] or [constant " +"SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "The distance from shadow split 1 to split 2. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or " -"[code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_2_SPLITS] or [constant " +"SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "The distance from shadow split 2 to split 3. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml @@ -29817,7 +29827,10 @@ msgid "" "input at the cost of increased CPU usage. In applications where drawing " "freehand lines is required, input accumulation should generally be disabled " "while the user is drawing the line to get results that closely follow the " -"actual input." +"actual input.\n" +"[b]Note:[/b] Input accumulation is [i]disabled[/i] by default for backward " +"compatibility reasons. It is however recommended to enable it for games " +"which don't require very reactive input, as this will decrease CPU usage." msgstr "" #: doc/classes/Input.xml @@ -30391,10 +30404,11 @@ msgstr "" msgid "" "Contains mouse and pen motion information. Supports relative, absolute " "positions and speed. See [method Node._input].\n" -"[b]Note:[/b] By default, this event is only emitted once per frame rendered " -"at most. If you need more precise input reporting, set [member Input." -"use_accumulated_input] to [code]false[/code] to make events emitted as often " -"as possible. If you use InputEventMouseMotion to draw lines, consider " +"[b]Note:[/b] By default, this event can be emitted multiple times per frame " +"rendered, allowing for precise input reporting, at the expense of CPU usage. " +"You can set [member Input.use_accumulated_input] to [code]true[/code] to let " +"multiple events merge into a single emitted event per frame.\n" +"[b]Note:[/b] If you use InputEventMouseMotion to draw lines, consider " "implementing [url=https://en.wikipedia.org/wiki/" "Bresenham%27s_line_algorithm]Bresenham's line algorithm[/url] as well to " "avoid visible gaps in lines if the user is moving the mouse quickly." @@ -30717,6 +30731,11 @@ msgstr "" #: doc/classes/InterpolatedCamera.xml msgid "" +"The camera's process callback. See [enum InterpolatedCameraProcessMode]." +msgstr "" + +#: doc/classes/InterpolatedCamera.xml +msgid "" "How quickly the camera moves toward its target. Higher values will result in " "tighter camera motion." msgstr "" @@ -36117,7 +36136,7 @@ msgid "" "maximum distance is exceeded, it recalculates the ideal path." msgstr "" -#: doc/classes/NavigationAgent.xml doc/classes/NavigationAgent2D.xml +#: doc/classes/NavigationAgent.xml msgid "" "The radius of the avoidance agent. This is the \"body\" of the avoidance " "agent and not the avoidance maneuver starting radius (which is controlled by " @@ -36228,6 +36247,14 @@ msgid "" "least one matching layer." msgstr "" +#: doc/classes/NavigationAgent2D.xml +msgid "" +"The radius of the avoidance agent. This is the \"body\" of the avoidance " +"agent and not the avoidance maneuver starting radius (which is controlled by " +"[member neighbor_dist]).\n" +"Does not affect normal pathfinding." +msgstr "" + #: doc/classes/NavigationMesh.xml msgid "A mesh to approximate the walkable areas and obstacles." msgstr "" @@ -49807,8 +49834,8 @@ msgstr "" #: doc/classes/ProjectSettings.xml msgid "" -"Size for shadow atlas (used for OmniLights and SpotLights). See " -"documentation." +"Size for shadow atlas (used for OmniLights and SpotLights). The value will " +"be rounded up to the nearest power of 2. See shadow mapping documentation." msgstr "" #: doc/classes/ProjectSettings.xml @@ -58177,7 +58204,31 @@ msgstr "" #: doc/classes/String.xml msgid "" "Formats the string by replacing all occurrences of [code]placeholder[/code] " -"with [code]values[/code]." +"with the elements of [code]values[/code].\n" +"[code]values[/code] can be a [Dictionary] or an [Array]. Any underscores in " +"[code]placeholder[/code] will be replaced with the corresponding keys in " +"advance. Array elements use their index as keys.\n" +"[codeblock]\n" +"# Prints: Waiting for Godot is a play by Samuel Beckett, and Godot Engine is " +"named after it.\n" +"var use_array_values = \"Waiting for {0} is a play by {1}, and {0} Engine is " +"named after it.\"\n" +"print(use_array_values.format([\"Godot\", \"Samuel Beckett\"]))\n" +"\n" +"# Prints: User 42 is Godot.\n" +"print(\"User {id} is {name}.\".format({\"id\": 42, \"name\": \"Godot\"}))\n" +"[/codeblock]\n" +"Some additional handling is performed when [code]values[/code] is an array. " +"If [code]placeholder[/code] does not contain an underscore, the elements of " +"the array will be used to replace one occurrence of the placeholder in turn; " +"If an array element is another 2-element array, it'll be interpreted as a " +"key-value pair.\n" +"[codeblock]\n" +"# Prints: User 42 is Godot.\n" +"print(\"User {} is {}.\".format([42, \"Godot\"], \"{}\"))\n" +"print(\"User {id} is {name}.\".format([[\"id\", 42], [\"name\", " +"\"Godot\"]]))\n" +"[/codeblock]" msgstr "" #: doc/classes/String.xml @@ -58774,9 +58825,11 @@ msgstr "" #: doc/classes/StyleBox.xml msgid "" -"Draws this stylebox using a [CanvasItem] with given [RID].\n" -"You can get a [RID] value using [method Object.get_instance_id] on a " -"[CanvasItem]-derived node." +"Draws this stylebox using a canvas item identified by the given [RID].\n" +"The [RID] value can either be the result of [method CanvasItem." +"get_canvas_item] called on an existing [CanvasItem]-derived node, or " +"directly from creating a canvas item in the [VisualServer] with [method " +"VisualServer.canvas_item_create]." msgstr "" #: doc/classes/StyleBox.xml @@ -60313,6 +60366,10 @@ msgid "If [code]true[/code], a right-click displays the context menu." msgstr "" #: doc/classes/TextEdit.xml +msgid "If [code]true[/code], allow drag and drop of selected text." +msgstr "" + +#: doc/classes/TextEdit.xml msgid "" "If [code]true[/code], the \"space\" character will have a visible " "representation." @@ -66387,9 +66444,10 @@ msgstr "" msgid "" "The shadow atlas' resolution (used for omni and spot lights). The value will " "be rounded up to the nearest power of 2.\n" -"[b]Note:[/b] If this is set to 0, shadows won't be visible. Since user-" -"created viewports default to a value of 0, this value must be set above 0 " -"manually." +"[b]Note:[/b] If this is set to [code]0[/code], both point [i]and[/i] " +"directional shadows won't be visible. Since user-created viewports default " +"to a value of [code]0[/code], this value must be set above [code]0[/code] " +"manually (typically at least [code]256[/code])." msgstr "" #: doc/classes/Viewport.xml @@ -66418,7 +66476,11 @@ msgid "" msgstr "" #: doc/classes/Viewport.xml -msgid "The rendering mode of viewport." +msgid "" +"The rendering mode of viewport.\n" +"[b]Note:[/b] If set to [constant USAGE_2D] or [constant " +"USAGE_2D_NO_SAMPLING], [member hdr] will have no effect when enabled since " +"HDR is not supported for 2D." msgstr "" #: doc/classes/Viewport.xml diff --git a/doc/translations/nl.po b/doc/translations/nl.po index 7a96e774df..b2066a5491 100644 --- a/doc/translations/nl.po +++ b/doc/translations/nl.po @@ -12206,10 +12206,12 @@ msgid "" msgstr "" #: doc/classes/Camera2D.xml doc/classes/ClippedCamera.xml +#: doc/classes/InterpolatedCamera.xml msgid "The camera updates with the [code]_physics_process[/code] callback." msgstr "" #: doc/classes/Camera2D.xml doc/classes/ClippedCamera.xml +#: doc/classes/InterpolatedCamera.xml msgid "The camera updates with the [code]_process[/code] callback." msgstr "" @@ -19491,13 +19493,17 @@ msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "Amount of extra bias for shadow splits that are far away. If self-shadowing " -"occurs only on the splits far away, increasing this value can fix them." +"occurs only on the splits far away, increasing this value can fix them. This " +"is ignored when [member directional_shadow_mode] is [constant " +"SHADOW_ORTHOGONAL]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "If [code]true[/code], shadow detail is sacrificed in exchange for smoother " -"transitions between splits." +"transitions between splits. Enabling shadow blend splitting also has a " +"moderate performance cost. This is ignored when [member " +"directional_shadow_mode] is [constant SHADOW_ORTHOGONAL]." msgstr "" #: doc/classes/DirectionalLight.xml @@ -19507,7 +19513,11 @@ msgid "" msgstr "" #: doc/classes/DirectionalLight.xml -msgid "The maximum distance for shadow splits." +msgid "" +"The maximum distance for shadow splits. Increasing this value will make " +"directional shadows visible from further away, at the cost of lower overall " +"shadow detail and performance (since more objects need to be included in the " +"directional shadow rendering)." msgstr "" #: doc/classes/DirectionalLight.xml @@ -19524,23 +19534,23 @@ msgstr "" msgid "" "The distance from camera to shadow split 1. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or " -"[code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_2_SPLITS] or [constant " +"SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "The distance from shadow split 1 to split 2. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or " -"[code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_2_SPLITS] or [constant " +"SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "The distance from shadow split 2 to split 3. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml @@ -29889,7 +29899,10 @@ msgid "" "input at the cost of increased CPU usage. In applications where drawing " "freehand lines is required, input accumulation should generally be disabled " "while the user is drawing the line to get results that closely follow the " -"actual input." +"actual input.\n" +"[b]Note:[/b] Input accumulation is [i]disabled[/i] by default for backward " +"compatibility reasons. It is however recommended to enable it for games " +"which don't require very reactive input, as this will decrease CPU usage." msgstr "" #: doc/classes/Input.xml @@ -30463,10 +30476,11 @@ msgstr "" msgid "" "Contains mouse and pen motion information. Supports relative, absolute " "positions and speed. See [method Node._input].\n" -"[b]Note:[/b] By default, this event is only emitted once per frame rendered " -"at most. If you need more precise input reporting, set [member Input." -"use_accumulated_input] to [code]false[/code] to make events emitted as often " -"as possible. If you use InputEventMouseMotion to draw lines, consider " +"[b]Note:[/b] By default, this event can be emitted multiple times per frame " +"rendered, allowing for precise input reporting, at the expense of CPU usage. " +"You can set [member Input.use_accumulated_input] to [code]true[/code] to let " +"multiple events merge into a single emitted event per frame.\n" +"[b]Note:[/b] If you use InputEventMouseMotion to draw lines, consider " "implementing [url=https://en.wikipedia.org/wiki/" "Bresenham%27s_line_algorithm]Bresenham's line algorithm[/url] as well to " "avoid visible gaps in lines if the user is moving the mouse quickly." @@ -30789,6 +30803,11 @@ msgstr "" #: doc/classes/InterpolatedCamera.xml msgid "" +"The camera's process callback. See [enum InterpolatedCameraProcessMode]." +msgstr "" + +#: doc/classes/InterpolatedCamera.xml +msgid "" "How quickly the camera moves toward its target. Higher values will result in " "tighter camera motion." msgstr "" @@ -36189,7 +36208,7 @@ msgid "" "maximum distance is exceeded, it recalculates the ideal path." msgstr "" -#: doc/classes/NavigationAgent.xml doc/classes/NavigationAgent2D.xml +#: doc/classes/NavigationAgent.xml msgid "" "The radius of the avoidance agent. This is the \"body\" of the avoidance " "agent and not the avoidance maneuver starting radius (which is controlled by " @@ -36300,6 +36319,14 @@ msgid "" "least one matching layer." msgstr "" +#: doc/classes/NavigationAgent2D.xml +msgid "" +"The radius of the avoidance agent. This is the \"body\" of the avoidance " +"agent and not the avoidance maneuver starting radius (which is controlled by " +"[member neighbor_dist]).\n" +"Does not affect normal pathfinding." +msgstr "" + #: doc/classes/NavigationMesh.xml msgid "A mesh to approximate the walkable areas and obstacles." msgstr "" @@ -49879,8 +49906,8 @@ msgstr "" #: doc/classes/ProjectSettings.xml msgid "" -"Size for shadow atlas (used for OmniLights and SpotLights). See " -"documentation." +"Size for shadow atlas (used for OmniLights and SpotLights). The value will " +"be rounded up to the nearest power of 2. See shadow mapping documentation." msgstr "" #: doc/classes/ProjectSettings.xml @@ -58250,7 +58277,31 @@ msgstr "" #: doc/classes/String.xml msgid "" "Formats the string by replacing all occurrences of [code]placeholder[/code] " -"with [code]values[/code]." +"with the elements of [code]values[/code].\n" +"[code]values[/code] can be a [Dictionary] or an [Array]. Any underscores in " +"[code]placeholder[/code] will be replaced with the corresponding keys in " +"advance. Array elements use their index as keys.\n" +"[codeblock]\n" +"# Prints: Waiting for Godot is a play by Samuel Beckett, and Godot Engine is " +"named after it.\n" +"var use_array_values = \"Waiting for {0} is a play by {1}, and {0} Engine is " +"named after it.\"\n" +"print(use_array_values.format([\"Godot\", \"Samuel Beckett\"]))\n" +"\n" +"# Prints: User 42 is Godot.\n" +"print(\"User {id} is {name}.\".format({\"id\": 42, \"name\": \"Godot\"}))\n" +"[/codeblock]\n" +"Some additional handling is performed when [code]values[/code] is an array. " +"If [code]placeholder[/code] does not contain an underscore, the elements of " +"the array will be used to replace one occurrence of the placeholder in turn; " +"If an array element is another 2-element array, it'll be interpreted as a " +"key-value pair.\n" +"[codeblock]\n" +"# Prints: User 42 is Godot.\n" +"print(\"User {} is {}.\".format([42, \"Godot\"], \"{}\"))\n" +"print(\"User {id} is {name}.\".format([[\"id\", 42], [\"name\", " +"\"Godot\"]]))\n" +"[/codeblock]" msgstr "" #: doc/classes/String.xml @@ -58847,9 +58898,11 @@ msgstr "" #: doc/classes/StyleBox.xml msgid "" -"Draws this stylebox using a [CanvasItem] with given [RID].\n" -"You can get a [RID] value using [method Object.get_instance_id] on a " -"[CanvasItem]-derived node." +"Draws this stylebox using a canvas item identified by the given [RID].\n" +"The [RID] value can either be the result of [method CanvasItem." +"get_canvas_item] called on an existing [CanvasItem]-derived node, or " +"directly from creating a canvas item in the [VisualServer] with [method " +"VisualServer.canvas_item_create]." msgstr "" #: doc/classes/StyleBox.xml @@ -60386,6 +60439,10 @@ msgid "If [code]true[/code], a right-click displays the context menu." msgstr "" #: doc/classes/TextEdit.xml +msgid "If [code]true[/code], allow drag and drop of selected text." +msgstr "" + +#: doc/classes/TextEdit.xml msgid "" "If [code]true[/code], the \"space\" character will have a visible " "representation." @@ -66460,9 +66517,10 @@ msgstr "" msgid "" "The shadow atlas' resolution (used for omni and spot lights). The value will " "be rounded up to the nearest power of 2.\n" -"[b]Note:[/b] If this is set to 0, shadows won't be visible. Since user-" -"created viewports default to a value of 0, this value must be set above 0 " -"manually." +"[b]Note:[/b] If this is set to [code]0[/code], both point [i]and[/i] " +"directional shadows won't be visible. Since user-created viewports default " +"to a value of [code]0[/code], this value must be set above [code]0[/code] " +"manually (typically at least [code]256[/code])." msgstr "" #: doc/classes/Viewport.xml @@ -66491,7 +66549,11 @@ msgid "" msgstr "" #: doc/classes/Viewport.xml -msgid "The rendering mode of viewport." +msgid "" +"The rendering mode of viewport.\n" +"[b]Note:[/b] If set to [constant USAGE_2D] or [constant " +"USAGE_2D_NO_SAMPLING], [member hdr] will have no effect when enabled since " +"HDR is not supported for 2D." msgstr "" #: doc/classes/Viewport.xml diff --git a/doc/translations/pl.po b/doc/translations/pl.po index 640cfea1c8..b28e575320 100644 --- a/doc/translations/pl.po +++ b/doc/translations/pl.po @@ -12651,10 +12651,12 @@ msgid "" msgstr "" #: doc/classes/Camera2D.xml doc/classes/ClippedCamera.xml +#: doc/classes/InterpolatedCamera.xml msgid "The camera updates with the [code]_physics_process[/code] callback." msgstr "" #: doc/classes/Camera2D.xml doc/classes/ClippedCamera.xml +#: doc/classes/InterpolatedCamera.xml msgid "The camera updates with the [code]_process[/code] callback." msgstr "" @@ -19963,13 +19965,17 @@ msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "Amount of extra bias for shadow splits that are far away. If self-shadowing " -"occurs only on the splits far away, increasing this value can fix them." +"occurs only on the splits far away, increasing this value can fix them. This " +"is ignored when [member directional_shadow_mode] is [constant " +"SHADOW_ORTHOGONAL]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "If [code]true[/code], shadow detail is sacrificed in exchange for smoother " -"transitions between splits." +"transitions between splits. Enabling shadow blend splitting also has a " +"moderate performance cost. This is ignored when [member " +"directional_shadow_mode] is [constant SHADOW_ORTHOGONAL]." msgstr "" #: doc/classes/DirectionalLight.xml @@ -19979,7 +19985,11 @@ msgid "" msgstr "" #: doc/classes/DirectionalLight.xml -msgid "The maximum distance for shadow splits." +msgid "" +"The maximum distance for shadow splits. Increasing this value will make " +"directional shadows visible from further away, at the cost of lower overall " +"shadow detail and performance (since more objects need to be included in the " +"directional shadow rendering)." msgstr "" #: doc/classes/DirectionalLight.xml @@ -19996,23 +20006,23 @@ msgstr "" msgid "" "The distance from camera to shadow split 1. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or " -"[code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_2_SPLITS] or [constant " +"SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "The distance from shadow split 1 to split 2. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or " -"[code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_2_SPLITS] or [constant " +"SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "The distance from shadow split 2 to split 3. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml @@ -30398,7 +30408,10 @@ msgid "" "input at the cost of increased CPU usage. In applications where drawing " "freehand lines is required, input accumulation should generally be disabled " "while the user is drawing the line to get results that closely follow the " -"actual input." +"actual input.\n" +"[b]Note:[/b] Input accumulation is [i]disabled[/i] by default for backward " +"compatibility reasons. It is however recommended to enable it for games " +"which don't require very reactive input, as this will decrease CPU usage." msgstr "" #: doc/classes/Input.xml @@ -30972,10 +30985,11 @@ msgstr "" msgid "" "Contains mouse and pen motion information. Supports relative, absolute " "positions and speed. See [method Node._input].\n" -"[b]Note:[/b] By default, this event is only emitted once per frame rendered " -"at most. If you need more precise input reporting, set [member Input." -"use_accumulated_input] to [code]false[/code] to make events emitted as often " -"as possible. If you use InputEventMouseMotion to draw lines, consider " +"[b]Note:[/b] By default, this event can be emitted multiple times per frame " +"rendered, allowing for precise input reporting, at the expense of CPU usage. " +"You can set [member Input.use_accumulated_input] to [code]true[/code] to let " +"multiple events merge into a single emitted event per frame.\n" +"[b]Note:[/b] If you use InputEventMouseMotion to draw lines, consider " "implementing [url=https://en.wikipedia.org/wiki/" "Bresenham%27s_line_algorithm]Bresenham's line algorithm[/url] as well to " "avoid visible gaps in lines if the user is moving the mouse quickly." @@ -31302,6 +31316,11 @@ msgstr "" #: doc/classes/InterpolatedCamera.xml msgid "" +"The camera's process callback. See [enum InterpolatedCameraProcessMode]." +msgstr "" + +#: doc/classes/InterpolatedCamera.xml +msgid "" "How quickly the camera moves toward its target. Higher values will result in " "tighter camera motion." msgstr "" @@ -36769,7 +36788,7 @@ msgid "" "maximum distance is exceeded, it recalculates the ideal path." msgstr "" -#: doc/classes/NavigationAgent.xml doc/classes/NavigationAgent2D.xml +#: doc/classes/NavigationAgent.xml msgid "" "The radius of the avoidance agent. This is the \"body\" of the avoidance " "agent and not the avoidance maneuver starting radius (which is controlled by " @@ -36882,6 +36901,14 @@ msgid "" "least one matching layer." msgstr "" +#: doc/classes/NavigationAgent2D.xml +msgid "" +"The radius of the avoidance agent. This is the \"body\" of the avoidance " +"agent and not the avoidance maneuver starting radius (which is controlled by " +"[member neighbor_dist]).\n" +"Does not affect normal pathfinding." +msgstr "" + #: doc/classes/NavigationMesh.xml msgid "A mesh to approximate the walkable areas and obstacles." msgstr "" @@ -50526,8 +50553,8 @@ msgstr "" #: doc/classes/ProjectSettings.xml msgid "" -"Size for shadow atlas (used for OmniLights and SpotLights). See " -"documentation." +"Size for shadow atlas (used for OmniLights and SpotLights). The value will " +"be rounded up to the nearest power of 2. See shadow mapping documentation." msgstr "" #: doc/classes/ProjectSettings.xml @@ -58915,7 +58942,31 @@ msgstr "" #: doc/classes/String.xml msgid "" "Formats the string by replacing all occurrences of [code]placeholder[/code] " -"with [code]values[/code]." +"with the elements of [code]values[/code].\n" +"[code]values[/code] can be a [Dictionary] or an [Array]. Any underscores in " +"[code]placeholder[/code] will be replaced with the corresponding keys in " +"advance. Array elements use their index as keys.\n" +"[codeblock]\n" +"# Prints: Waiting for Godot is a play by Samuel Beckett, and Godot Engine is " +"named after it.\n" +"var use_array_values = \"Waiting for {0} is a play by {1}, and {0} Engine is " +"named after it.\"\n" +"print(use_array_values.format([\"Godot\", \"Samuel Beckett\"]))\n" +"\n" +"# Prints: User 42 is Godot.\n" +"print(\"User {id} is {name}.\".format({\"id\": 42, \"name\": \"Godot\"}))\n" +"[/codeblock]\n" +"Some additional handling is performed when [code]values[/code] is an array. " +"If [code]placeholder[/code] does not contain an underscore, the elements of " +"the array will be used to replace one occurrence of the placeholder in turn; " +"If an array element is another 2-element array, it'll be interpreted as a " +"key-value pair.\n" +"[codeblock]\n" +"# Prints: User 42 is Godot.\n" +"print(\"User {} is {}.\".format([42, \"Godot\"], \"{}\"))\n" +"print(\"User {id} is {name}.\".format([[\"id\", 42], [\"name\", " +"\"Godot\"]]))\n" +"[/codeblock]" msgstr "" #: doc/classes/String.xml @@ -59512,9 +59563,11 @@ msgstr "" #: doc/classes/StyleBox.xml msgid "" -"Draws this stylebox using a [CanvasItem] with given [RID].\n" -"You can get a [RID] value using [method Object.get_instance_id] on a " -"[CanvasItem]-derived node." +"Draws this stylebox using a canvas item identified by the given [RID].\n" +"The [RID] value can either be the result of [method CanvasItem." +"get_canvas_item] called on an existing [CanvasItem]-derived node, or " +"directly from creating a canvas item in the [VisualServer] with [method " +"VisualServer.canvas_item_create]." msgstr "" #: doc/classes/StyleBox.xml @@ -61063,6 +61116,13 @@ msgid "If [code]true[/code], a right-click displays the context menu." msgstr "" #: doc/classes/TextEdit.xml +#, fuzzy +msgid "If [code]true[/code], allow drag and drop of selected text." +msgstr "" +"Jeśli [code]true[/code], potomne węzły są sortowane. W innym przypadku jest " +"wyłączone." + +#: doc/classes/TextEdit.xml msgid "" "If [code]true[/code], the \"space\" character will have a visible " "representation." @@ -67169,9 +67229,10 @@ msgstr "" msgid "" "The shadow atlas' resolution (used for omni and spot lights). The value will " "be rounded up to the nearest power of 2.\n" -"[b]Note:[/b] If this is set to 0, shadows won't be visible. Since user-" -"created viewports default to a value of 0, this value must be set above 0 " -"manually." +"[b]Note:[/b] If this is set to [code]0[/code], both point [i]and[/i] " +"directional shadows won't be visible. Since user-created viewports default " +"to a value of [code]0[/code], this value must be set above [code]0[/code] " +"manually (typically at least [code]256[/code])." msgstr "" #: doc/classes/Viewport.xml @@ -67203,7 +67264,11 @@ msgid "" msgstr "" #: doc/classes/Viewport.xml -msgid "The rendering mode of viewport." +msgid "" +"The rendering mode of viewport.\n" +"[b]Note:[/b] If set to [constant USAGE_2D] or [constant " +"USAGE_2D_NO_SAMPLING], [member hdr] will have no effect when enabled since " +"HDR is not supported for 2D." msgstr "" #: doc/classes/Viewport.xml diff --git a/doc/translations/pt.po b/doc/translations/pt.po index 54c5f5f2ef..99537cdd6b 100644 --- a/doc/translations/pt.po +++ b/doc/translations/pt.po @@ -9,12 +9,13 @@ # Renu <ifpilucas@gmail.com>, 2022. # Diogo Gomes <dgomes@graphnode.com>, 2022. # El_ExpertPlayer <xpertnathan37@gmail.com>, 2022. +# Esdras Caleb Oliveira Silva <acheicaleb@gmail.com>, 2022. msgid "" msgstr "" "Project-Id-Version: Godot Engine class reference\n" "Report-Msgid-Bugs-To: https://github.com/godotengine/godot\n" -"PO-Revision-Date: 2022-06-13 03:39+0000\n" -"Last-Translator: El_ExpertPlayer <xpertnathan37@gmail.com>\n" +"PO-Revision-Date: 2022-06-29 10:31+0000\n" +"Last-Translator: Esdras Caleb Oliveira Silva <acheicaleb@gmail.com>\n" "Language-Team: Portuguese <https://hosted.weblate.org/projects/godot-engine/" "godot-class-reference/pt/>\n" "Language: pt\n" @@ -22,7 +23,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8-bit\n" "Plural-Forms: nplurals=2; plural=n > 1;\n" -"X-Generator: Weblate 4.13-dev\n" +"X-Generator: Weblate 4.13.1-dev\n" #: doc/tools/make_rst.py msgid "Description" @@ -78,7 +79,7 @@ msgstr "Herdado por:" #: doc/tools/make_rst.py msgid "(overrides %s)" -msgstr "" +msgstr "(recopiar %s)" #: doc/tools/make_rst.py msgid "Default" @@ -86,7 +87,7 @@ msgstr "Padrão" #: doc/tools/make_rst.py msgid "Setter" -msgstr "Definidor" +msgstr "Setter" #: doc/tools/make_rst.py msgid "value" @@ -94,13 +95,13 @@ msgstr "valor" #: doc/tools/make_rst.py msgid "Getter" -msgstr "Buscador" +msgstr "Getter" #: doc/tools/make_rst.py msgid "" "This method should typically be overridden by the user to have any effect." msgstr "" -"Este método normalmente deve ser substituído pelo usuário para ter algum " +"Este método normalmente deve ser reescrito pelo usuário para que tenha algum " "efeito." #: doc/tools/make_rst.py @@ -907,7 +908,6 @@ msgstr "" "[/codeblock]" #: modules/gdscript/doc_classes/@GDScript.xml -#, fuzzy msgid "" "Linearly interpolates between two values by the factor defined in " "[code]weight[/code]. To perform interpolation, [code]weight[/code] should be " @@ -927,20 +927,25 @@ msgid "" "To perform eased interpolation with [method lerp], combine it with [method " "ease] or [method smoothstep]." msgstr "" -"Interpola linearmente entre dois valores através de um valor normalizado. " -"Este método é o oposto do método [method inverse_lerp].\n" +"Interpola linearmente entre dois valores pelo fator definido em " +"[code]weight[/code]. Para realizar a interpolação, [code]weight[/code] deve " +"estar entre [code]0.0[/code] e [code]1.0[/code] (inclusive). No entanto, " +"valores fora desse intervalo são permitidos e podem ser usados para realizar " +"[i]extrapolação[/i].\n" "Se os argumentos [code]from[/code] e [code]to[/code] forem do tipo [int] ou " -"[float], o retorno é um valor do tipo [float].\n" -"Se ambos são vetores de mesmo tipo ([Vector2], [Vector3] ou [Color]), o " -"valor retornado será do mesmo tipo ([code]lerp[/code] então chamará o método " -"[code]lerp[/code] do tipo de vetor em questão).\n" +"[float], o valor de retorno será um [float].\n" +"Se ambos forem do mesmo tipo de vetor ([Vector2], [Vector3] ou [Color]), o " +"valor de retorno será do mesmo tipo ([code]lerp[/code] então chama o método " +"[code]linear_interpolate[/code] do tipo de vetor).\n" "[codeblock]\n" -"lerp(0, 4, 0.75) # Retorna 3.0\n" -"lerp(Vector2(1, 5), Vector2(3, 2), 0.5) # Retorna Vector2(2, 3.5)\n" -"[/codeblock]" +"lerp(0, 4, 0,75) # Retorna 3,0\n" +"lerp(Vetor2(1, 5), Vetor2(3, 2), 0.5) # Retorna Vetor2(2, 3.5)\n" +"[/codeblock]\n" +"Veja também [method inverse_lerp] que realiza o inverso desta operação. Para " +"realizar a interpolação facilitada com [method lerp], combine-o com [method " +"easy] ou [method smoothstep]." #: modules/gdscript/doc_classes/@GDScript.xml -#, fuzzy msgid "" "Linearly interpolates between two angles (in radians) by a normalized " "value.\n" @@ -963,10 +968,12 @@ msgid "" "example, [code]lerp_angle(0, PI, weight)[/code] lerps counter-clockwise, " "while [code]lerp_angle(0, PI + 5 * TAU, weight)[/code] lerps clockwise." msgstr "" -"Faz a interpolação linear entre dois ângulos (em radianos) por um valor " +"Interpola linearmente entre dois ângulos (em radianos) por um valor " "normalizado.\n" -"Semelhante à [method lerp], mas faz a interpolação corretamente quando os " -"ângulos passam através de [constant @GDScript.TAU].\n" +"Semelhante a [method lerp], mas interpola corretamente quando os ângulos " +"envolvem [constant @GDScript.TAU]. Para realizar a interpolação facilitada " +"com [method lerp_angle], combine-o com [method easy] ou [method " +"smoothstep].\n" "[codeblock]\n" "extends Sprite\n" "var elapsed = 0.0\n" @@ -975,7 +982,14 @@ msgstr "" " var max_angle = deg2rad(90.0)\n" " rotation = lerp_angle(min_angle, max_angle, elapsed)\n" " elapsed += delta\n" -"[/codeblock]" +"[/codeblock]\n" +"[b]Nota:[/b] Este método lê o caminho mais curto entre [code]from[/code] e " +"[code]to[/code]. No entanto, quando esses dois ângulos estão aproximadamente " +"[code]PI + k * TAU[/code] separados para qualquer inteiro [code]k[/code], " +"não é óbvio de que maneira eles interpretam devido a erros de precisão de " +"ponto flutuante. Por exemplo, [code]lerp_angle(0, PI, weight)[/code] lê no " +"sentido anti-horário, enquanto [code]lerp_angle(0, PI + 5 * TAU, weight)[/" +"code] lê no sentido horário." #: modules/gdscript/doc_classes/@GDScript.xml msgid "" @@ -1463,7 +1477,6 @@ msgstr "" "[/codeblock]" #: modules/gdscript/doc_classes/@GDScript.xml -#, fuzzy msgid "" "Returns a random floating point value between [code]from[/code] and " "[code]to[/code] (both endpoints inclusive).\n" @@ -1472,12 +1485,12 @@ msgid "" "[/codeblock]\n" "[b]Note:[/b] This is equivalent to [code]randf() * (to - from) + from[/code]." msgstr "" -"Intervalo aleatório, retorna qualquer número real entre [code]from[/code] e " -"[code]to[/code].\n" +"Retorna um valor de ponto flutuante aleatório entre [code]from[/code] e " +"[code]to[/code] (ambos os endpoints inclusive).\n" "[codeblock]\n" -"prints(rand_range(0, 1), rand_range(0, 1)) # Imprime por exemplo 0.135591 " -"0.405263\n" -"[/codeblock]" +"prints(rand_range(0, 1), rand_range(0, 1)) # Prints e.g. 0.135591 0.405263\n" +"[/codeblock]\n" +"[b]Nota:[/b] Isso é equivalente a [code]randf() * (to - from) + from[/code]." #: modules/gdscript/doc_classes/@GDScript.xml msgid "" @@ -4579,9 +4592,8 @@ msgstr "" #: doc/classes/AABB.xml doc/classes/Rect2.xml doc/classes/Vector2.xml #: doc/classes/Vector3.xml -#, fuzzy msgid "Vector math" -msgstr "Vetor utilizado para matemática 2D." +msgstr "Matemática vetorial" #: doc/classes/AABB.xml doc/classes/Rect2.xml doc/classes/Vector2.xml #: doc/classes/Vector3.xml @@ -5798,9 +5810,8 @@ msgstr "" #: doc/classes/AnimationNodeOneShot.xml doc/classes/AnimationNodeOutput.xml #: doc/classes/AnimationNodeTimeScale.xml #: doc/classes/AnimationNodeTransition.xml -#, fuzzy msgid "AnimationTree" -msgstr "Nó de animação." +msgstr "AnimationTree" #: doc/classes/AnimationNodeAdd3.xml doc/classes/AnimationNodeAnimation.xml #: doc/classes/AnimationNodeBlend2.xml @@ -6493,9 +6504,8 @@ msgid "" msgstr "" #: doc/classes/AnimationPlayer.xml -#, fuzzy msgid "Animation tutorial index" -msgstr "Nó de animação." +msgstr "Índice do tutorial de animação" #: doc/classes/AnimationPlayer.xml msgid "" @@ -6784,9 +6794,8 @@ msgid "" msgstr "" #: doc/classes/AnimationTree.xml -#, fuzzy msgid "Using AnimationTree" -msgstr "Reseta este [AnimationTreePlayer]." +msgstr "Usando AnimationTree" #: doc/classes/AnimationTree.xml msgid "Manually advance the animations by the specified time (in seconds)." @@ -12958,10 +12967,12 @@ msgid "" msgstr "" #: doc/classes/Camera2D.xml doc/classes/ClippedCamera.xml +#: doc/classes/InterpolatedCamera.xml msgid "The camera updates with the [code]_physics_process[/code] callback." msgstr "" #: doc/classes/Camera2D.xml doc/classes/ClippedCamera.xml +#: doc/classes/InterpolatedCamera.xml msgid "The camera updates with the [code]_process[/code] callback." msgstr "" @@ -13749,9 +13760,8 @@ msgstr "" "camada -1 ou abaixo)." #: doc/classes/CanvasLayer.xml -#, fuzzy msgid "Canvas layers" -msgstr "Camada para desenhar no ecrã." +msgstr "Camadas de tela" #: doc/classes/CanvasLayer.xml msgid "Returns the RID of the canvas used by this layer." @@ -14821,9 +14831,8 @@ msgstr "" #: doc/classes/Physics2DDirectSpaceState.xml #: doc/classes/PhysicsDirectBodyState.xml #: doc/classes/PhysicsDirectSpaceState.xml doc/classes/RigidBody.xml -#, fuzzy msgid "Physics introduction" -msgstr "Interpolação cúbica." +msgstr "Introdução à física" #: doc/classes/CollisionShape.xml msgid "" @@ -16390,9 +16399,8 @@ msgid "GUI tutorial index" msgstr "" #: doc/classes/Control.xml -#, fuzzy msgid "Control node gallery" -msgstr "Tecla Control." +msgstr "Galeria de *nós* de controle" #: doc/classes/Control.xml msgid "All GUI Demos" @@ -20292,13 +20300,17 @@ msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "Amount of extra bias for shadow splits that are far away. If self-shadowing " -"occurs only on the splits far away, increasing this value can fix them." +"occurs only on the splits far away, increasing this value can fix them. This " +"is ignored when [member directional_shadow_mode] is [constant " +"SHADOW_ORTHOGONAL]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "If [code]true[/code], shadow detail is sacrificed in exchange for smoother " -"transitions between splits." +"transitions between splits. Enabling shadow blend splitting also has a " +"moderate performance cost. This is ignored when [member " +"directional_shadow_mode] is [constant SHADOW_ORTHOGONAL]." msgstr "" #: doc/classes/DirectionalLight.xml @@ -20308,7 +20320,11 @@ msgid "" msgstr "" #: doc/classes/DirectionalLight.xml -msgid "The maximum distance for shadow splits." +msgid "" +"The maximum distance for shadow splits. Increasing this value will make " +"directional shadows visible from further away, at the cost of lower overall " +"shadow detail and performance (since more objects need to be included in the " +"directional shadow rendering)." msgstr "" #: doc/classes/DirectionalLight.xml @@ -20325,23 +20341,23 @@ msgstr "" msgid "" "The distance from camera to shadow split 1. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or " -"[code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_2_SPLITS] or [constant " +"SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "The distance from shadow split 1 to split 2. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or " -"[code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_2_SPLITS] or [constant " +"SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "The distance from shadow split 2 to split 3. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml @@ -30704,7 +30720,10 @@ msgid "" "input at the cost of increased CPU usage. In applications where drawing " "freehand lines is required, input accumulation should generally be disabled " "while the user is drawing the line to get results that closely follow the " -"actual input." +"actual input.\n" +"[b]Note:[/b] Input accumulation is [i]disabled[/i] by default for backward " +"compatibility reasons. It is however recommended to enable it for games " +"which don't require very reactive input, as this will decrease CPU usage." msgstr "" #: doc/classes/Input.xml @@ -31278,10 +31297,11 @@ msgstr "" msgid "" "Contains mouse and pen motion information. Supports relative, absolute " "positions and speed. See [method Node._input].\n" -"[b]Note:[/b] By default, this event is only emitted once per frame rendered " -"at most. If you need more precise input reporting, set [member Input." -"use_accumulated_input] to [code]false[/code] to make events emitted as often " -"as possible. If you use InputEventMouseMotion to draw lines, consider " +"[b]Note:[/b] By default, this event can be emitted multiple times per frame " +"rendered, allowing for precise input reporting, at the expense of CPU usage. " +"You can set [member Input.use_accumulated_input] to [code]true[/code] to let " +"multiple events merge into a single emitted event per frame.\n" +"[b]Note:[/b] If you use InputEventMouseMotion to draw lines, consider " "implementing [url=https://en.wikipedia.org/wiki/" "Bresenham%27s_line_algorithm]Bresenham's line algorithm[/url] as well to " "avoid visible gaps in lines if the user is moving the mouse quickly." @@ -31608,6 +31628,11 @@ msgstr "" #: doc/classes/InterpolatedCamera.xml msgid "" +"The camera's process callback. See [enum InterpolatedCameraProcessMode]." +msgstr "" + +#: doc/classes/InterpolatedCamera.xml +msgid "" "How quickly the camera moves toward its target. Higher values will result in " "tighter camera motion." msgstr "" @@ -37046,7 +37071,7 @@ msgid "" "maximum distance is exceeded, it recalculates the ideal path." msgstr "" -#: doc/classes/NavigationAgent.xml doc/classes/NavigationAgent2D.xml +#: doc/classes/NavigationAgent.xml msgid "" "The radius of the avoidance agent. This is the \"body\" of the avoidance " "agent and not the avoidance maneuver starting radius (which is controlled by " @@ -37159,6 +37184,14 @@ msgid "" "least one matching layer." msgstr "" +#: doc/classes/NavigationAgent2D.xml +msgid "" +"The radius of the avoidance agent. This is the \"body\" of the avoidance " +"agent and not the avoidance maneuver starting radius (which is controlled by " +"[member neighbor_dist]).\n" +"Does not affect normal pathfinding." +msgstr "" + #: doc/classes/NavigationMesh.xml msgid "A mesh to approximate the walkable areas and obstacles." msgstr "" @@ -38441,7 +38474,7 @@ msgstr "" #: doc/classes/Node.xml msgid "Nodes and Scenes" -msgstr "" +msgstr "Nós e Cenas" #: doc/classes/Node.xml msgid "All Demos" @@ -49310,68 +49343,67 @@ msgstr "" #: doc/classes/ProjectSettings.xml msgid "Optional name for the 3D physics layer 3." -msgstr "" +msgstr "Nome opcional para a camada 3 de física 3D." #: doc/classes/ProjectSettings.xml msgid "Optional name for the 3D physics layer 30." -msgstr "" +msgstr "Nome opcional para a camada 30 de física 3D." #: doc/classes/ProjectSettings.xml msgid "Optional name for the 3D physics layer 31." -msgstr "" +msgstr "Nome opcional para a camada 31 de física 3D." #: doc/classes/ProjectSettings.xml msgid "Optional name for the 3D physics layer 32." -msgstr "" +msgstr "Nome opcional para a camada 32 de física 3D." #: doc/classes/ProjectSettings.xml msgid "Optional name for the 3D physics layer 4." -msgstr "" +msgstr "Nome opcional para a camada 4 de física 3D." #: doc/classes/ProjectSettings.xml msgid "Optional name for the 3D physics layer 5." -msgstr "" +msgstr "Nome opcional para a camada 5 de física 3D." #: doc/classes/ProjectSettings.xml msgid "Optional name for the 3D physics layer 6." -msgstr "" +msgstr "Nome opcional para a camada 6 de física 3D." #: doc/classes/ProjectSettings.xml msgid "Optional name for the 3D physics layer 7." -msgstr "" +msgstr "Nome opcional para a camada 7 de física 3D." #: doc/classes/ProjectSettings.xml msgid "Optional name for the 3D physics layer 8." -msgstr "" +msgstr "Nome opcional para a camada 8 de física 3D." #: doc/classes/ProjectSettings.xml msgid "Optional name for the 3D physics layer 9." -msgstr "" +msgstr "Nome opcional para a camada 9 de física 3D." #: doc/classes/ProjectSettings.xml msgid "Optional name for the 3D render layer 1." -msgstr "Nome opcional para a camada 1 da renderização 3D." +msgstr "Nome opcional para a camada 1 de renderização 3D." #: doc/classes/ProjectSettings.xml msgid "Optional name for the 3D render layer 10." -msgstr "Nome opcional para a camada 10 da renderização 3D." +msgstr "Nome opcional para a camada 10 de renderização 3D." #: doc/classes/ProjectSettings.xml msgid "Optional name for the 3D render layer 11." -msgstr "Nome opcional para a camada 11 da renderização 3D." +msgstr "Nome opcional para a camada 11 de renderização 3D." #: doc/classes/ProjectSettings.xml msgid "Optional name for the 3D render layer 12." -msgstr "Nome opcional para a camada 12 da renderização 3D." +msgstr "Nome opcional para a camada 12 de renderização 3D." #: doc/classes/ProjectSettings.xml msgid "Optional name for the 3D render layer 13." -msgstr "Nome opcional para a camada 13 da renderização 3D." +msgstr "Nome opcional para a camada 13 de renderização 3D." #: doc/classes/ProjectSettings.xml -#, fuzzy msgid "Optional name for the 3D render layer 14." -msgstr "Nome opcional para a camada 14 da renderização 3D" +msgstr "Nome opcional para a camada 14 de renderização 3D." #: doc/classes/ProjectSettings.xml msgid "Optional name for the 3D render layer 15." @@ -49434,38 +49466,53 @@ msgid "" "The locale to fall back to if a translation isn't available in a given " "language. If left empty, [code]en[/code] (English) will be used." msgstr "" +"A localidade para retornar se uma tradução não estiver disponível em um " +"determinado idioma. Se deixado em branco, [code]en[/code] (inglês) será " +"usado." #: doc/classes/ProjectSettings.xml msgid "" "If non-empty, this locale will be used when running the project from the " "editor." msgstr "" +"Se não estiver vazio, essa localidade será usada ao executar o projeto a " +"partir do editor." #: doc/classes/ProjectSettings.xml msgid "If [code]true[/code], logs all output to files." -msgstr "" +msgstr "Se [code]true[/code], registra todas os resultados nos arquivos." #: doc/classes/ProjectSettings.xml msgid "" "Desktop override for [member logging/file_logging/enable_file_logging], as " "log files are not readily accessible on mobile/Web platforms." msgstr "" +"Substituição da área de trabalho para [member logging/file_logging/" +"enable_file_logging], pois os arquivos de log não são facilmente acessíveis " +"em plataformas móveis/Web." #: doc/classes/ProjectSettings.xml msgid "" "Path to logs within the project. Using an [code]user://[/code] path is " "recommended." msgstr "" +"Caminho para logs dentro do projeto. Recomenda se utilizar um caminho " +"[code]user://[/code]." #: doc/classes/ProjectSettings.xml msgid "Specifies the maximum amount of log files allowed (used for rotation)." msgstr "" +"Especifica a quantidade máxima de arquivos de log permitidos (usados para " +"rotação)." #: doc/classes/ProjectSettings.xml msgid "" "Godot uses a message queue to defer some function calls. If you run out of " "space on it (you will see an error), you can increase the size here." msgstr "" +"Godot usa uma fila de mensagens para adiar algumas chamadas de função. Se " +"você ficar sem espaço nela (você verá um erro), você pode aumentar o tamanho " +"aqui." #: doc/classes/ProjectSettings.xml msgid "" @@ -49474,6 +49521,11 @@ msgid "" "on threads. If servers get stalled too often when loading resources in a " "thread, increase this number." msgstr "" +"Isso é usado por servidores quando usado no modo multi-threading (servidores " +"e visual). Os RIDs são pré-alocados para evitar a interrupção do servidor " +"que os solicita em encadeamentos. Se os servidores ficarem paralisados com " +"muita frequência ao carregar recursos em um encadeamento, aumente esse " +"número." #: doc/classes/ProjectSettings.xml msgid "" @@ -49486,6 +49538,14 @@ msgid "" "in the editor, which also includes C# [code]tool[/code] scripts running " "within the editor as well as editor plugin code." msgstr "" +"A política a ser usada para exceções Mono (C#) não tratadas. O padrão " +"\"Terminate Application\" sai do projeto assim que uma exceção não tratada é " +"lançada. Em vez disso, \"Log Error\" registra uma mensagem de erro no " +"console e não interromperá a execução do projeto quando uma exceção não " +"tratada for lançada.\n" +"[b]Observação:[/b] A política de exceção não tratada é sempre definida como " +"\"Erro de log\" no editor, que também inclui scripts C# [code]tool[/code] " +"executados no editor, bem como o código do plug-in do editor." #: doc/classes/ProjectSettings.xml msgid "" @@ -49493,42 +49553,57 @@ msgid "" "map_set_cell_height].\n" "[b]Note:[/b] Currently not implemented." msgstr "" +"Altura de célula padrão para mapas de navegação 2D. Consulte [método " +"Navigation2DServer.map_set_cell_height].\n" +"[b]Observação:[/b] atualmente não implementado." #: doc/classes/ProjectSettings.xml msgid "" "Default cell size for 2D navigation maps. See [method Navigation2DServer." "map_set_cell_size]." msgstr "" +"Tamanho de célula padrão para mapas de navegação 2D. Consulte [method " +"Navigation2DServer.map_set_cell_size]." #: doc/classes/ProjectSettings.xml msgid "" "Default edge connection margin for 2D navigation maps. See [method " "Navigation2DServer.map_set_edge_connection_margin]." msgstr "" +"Margem de conexão de borda padrão para mapas de navegação 2D. Consulte " +"[method Navigation2DServer.map_set_edge_connection_margin]." #: doc/classes/ProjectSettings.xml msgid "" "Default cell height for 3D navigation maps. See [method NavigationServer." "map_set_cell_height]." msgstr "" +"Altura de célula padrão para mapas de navegação 3D. Consulte [method " +"NavigationServer.map_set_cell_height]." #: doc/classes/ProjectSettings.xml msgid "" "Default cell size for 3D navigation maps. See [method NavigationServer." "map_set_cell_size]." msgstr "" +"Tamanho de célula padrão para mapas de navegação 3D. Consulte [method " +"NavigationServer.map_set_cell_size]." #: doc/classes/ProjectSettings.xml msgid "" "Default edge connection margin for 3D navigation maps. See [method " "NavigationServer.map_set_edge_connection_margin]." msgstr "" +"Margem de conexão de borda padrão para mapas de navegação 3D. Consulte " +"[method NavigationServer.map_set_edge_connection_margin]." #: doc/classes/ProjectSettings.xml msgid "" "Default map up vector for 3D navigation maps. See [method NavigationServer." "map_set_up]." msgstr "" +"Vetor de mapa padrão para mapas de navegação 3D. Consulte [method " +"NavigationServer.map_set_up]." #: doc/classes/ProjectSettings.xml msgid "" @@ -49536,6 +49611,9 @@ msgid "" "Over this value, content is dropped. This helps not to stall the debugger " "connection." msgstr "" +"Quantidade máxima de caracteres permitidos para enviar como saída do " +"depurador. Acima desse valor, o conteúdo é descartado. Isso ajuda a não " +"travar a conexão do depurador." #: doc/classes/ProjectSettings.xml msgid "" @@ -49543,6 +49621,9 @@ msgid "" "Over this value, content is dropped. This helps not to stall the debugger " "connection." msgstr "" +"Número máximo de erros permitidos a serem enviados como saída do depurador. " +"Acima desse valor, o conteúdo é descartado. Isso ajuda a não travar a " +"conexão do depurador." #: doc/classes/ProjectSettings.xml msgid "" @@ -49550,6 +49631,9 @@ msgid "" "this value, content is dropped. This helps not to stall the debugger " "connection." msgstr "" +"Quantidade máxima de mensagens permitidas para enviar como saída do " +"depurador. Acima desse valor, o conteúdo é descartado. Isso ajuda a não " +"travar a conexão do depurador." #: doc/classes/ProjectSettings.xml msgid "" @@ -49557,6 +49641,9 @@ msgid "" "Over this value, content is dropped. This helps not to stall the debugger " "connection." msgstr "" +"Número máximo de avisos que podem ser enviados como saída do depurador. " +"Acima desse valor, o conteúdo é descartado. Isso ajuda a não travar a " +"conexão do depurador." #: doc/classes/ProjectSettings.xml msgid "" @@ -49564,56 +49651,64 @@ msgid "" "specified as a power of two). The default value [code]16[/code] is equal to " "65,536 bytes. Over this size, data is dropped." msgstr "" +"Tamanho padrão do fluxo de pares de pacotes para desserializar dados Godot " +"(em bytes, especificado como uma potência de dois). O valor padrão [code]16[/" +"code] é igual a 65.536 bytes. Acima desse tamanho, os dados são descartados." #: doc/classes/ProjectSettings.xml msgid "Timeout (in seconds) for connection attempts using TCP." -msgstr "" +msgstr "Tempo limite (em segundos) para tentativas de conexão usando TCP." #: doc/classes/ProjectSettings.xml msgid "Maximum size (in kiB) for the [WebRTCDataChannel] input buffer." -msgstr "" +msgstr "Tamanho máximo (em kiB) para o buffer de entrada [WebRTCDataChannel]." #: doc/classes/ProjectSettings.xml msgid "Maximum size (in kiB) for the [WebSocketClient] input buffer." -msgstr "" +msgstr "Tamanho máximo (em kiB) para o buffer de entrada [WebSocketClient]." #: doc/classes/ProjectSettings.xml msgid "Maximum number of concurrent input packets for [WebSocketClient]." msgstr "" +"Número máximo de pacotes de entrada simultâneos para [WebSocketClient]." #: doc/classes/ProjectSettings.xml msgid "Maximum size (in kiB) for the [WebSocketClient] output buffer." -msgstr "" +msgstr "Tamanho máximo (em kiB) para o buffer de saída [WebSocketClient]." #: doc/classes/ProjectSettings.xml msgid "Maximum number of concurrent output packets for [WebSocketClient]." -msgstr "" +msgstr "Número máximo de pacotes de saída simultâneos para [WebSocketClient]." #: doc/classes/ProjectSettings.xml msgid "Maximum size (in kiB) for the [WebSocketServer] input buffer." -msgstr "" +msgstr "Tamanho máximo (em kiB) para o buffer de entrada [WebSocketServer]." #: doc/classes/ProjectSettings.xml msgid "Maximum number of concurrent input packets for [WebSocketServer]." msgstr "" +"Número máximo de pacotes de entrada simultâneos para [WebSocketServer]." #: doc/classes/ProjectSettings.xml msgid "Maximum size (in kiB) for the [WebSocketServer] output buffer." -msgstr "" +msgstr "Tamanho máximo (em kiB) para o buffer de saída [WebSocketServer]." #: doc/classes/ProjectSettings.xml msgid "Maximum number of concurrent output packets for [WebSocketServer]." -msgstr "" +msgstr "Número máximo de pacotes de saída simultâneos para [WebSocketServer]." #: doc/classes/ProjectSettings.xml msgid "" "Amount of read ahead used by remote filesystem. Higher values decrease the " "effects of latency at the cost of higher bandwidth usage." msgstr "" +"Quantidade de leitura antecipada usada pelo sistema de arquivos remoto. " +"Valores mais altos diminuem os efeitos da latência ao custo de maior uso de " +"largura de banda." #: doc/classes/ProjectSettings.xml msgid "Page size used by remote filesystem (in bytes)." -msgstr "" +msgstr "Tamanho da página usado pelo sistema de arquivos remoto (em bytes)." #: doc/classes/ProjectSettings.xml msgid "" @@ -50756,8 +50851,8 @@ msgstr "" #: doc/classes/ProjectSettings.xml msgid "" -"Size for shadow atlas (used for OmniLights and SpotLights). See " -"documentation." +"Size for shadow atlas (used for OmniLights and SpotLights). The value will " +"be rounded up to the nearest power of 2. See shadow mapping documentation." msgstr "" #: doc/classes/ProjectSettings.xml @@ -59151,7 +59246,31 @@ msgstr "" #: doc/classes/String.xml msgid "" "Formats the string by replacing all occurrences of [code]placeholder[/code] " -"with [code]values[/code]." +"with the elements of [code]values[/code].\n" +"[code]values[/code] can be a [Dictionary] or an [Array]. Any underscores in " +"[code]placeholder[/code] will be replaced with the corresponding keys in " +"advance. Array elements use their index as keys.\n" +"[codeblock]\n" +"# Prints: Waiting for Godot is a play by Samuel Beckett, and Godot Engine is " +"named after it.\n" +"var use_array_values = \"Waiting for {0} is a play by {1}, and {0} Engine is " +"named after it.\"\n" +"print(use_array_values.format([\"Godot\", \"Samuel Beckett\"]))\n" +"\n" +"# Prints: User 42 is Godot.\n" +"print(\"User {id} is {name}.\".format({\"id\": 42, \"name\": \"Godot\"}))\n" +"[/codeblock]\n" +"Some additional handling is performed when [code]values[/code] is an array. " +"If [code]placeholder[/code] does not contain an underscore, the elements of " +"the array will be used to replace one occurrence of the placeholder in turn; " +"If an array element is another 2-element array, it'll be interpreted as a " +"key-value pair.\n" +"[codeblock]\n" +"# Prints: User 42 is Godot.\n" +"print(\"User {} is {}.\".format([42, \"Godot\"], \"{}\"))\n" +"print(\"User {id} is {name}.\".format([[\"id\", 42], [\"name\", " +"\"Godot\"]]))\n" +"[/codeblock]" msgstr "" #: doc/classes/String.xml @@ -59748,9 +59867,11 @@ msgstr "" #: doc/classes/StyleBox.xml msgid "" -"Draws this stylebox using a [CanvasItem] with given [RID].\n" -"You can get a [RID] value using [method Object.get_instance_id] on a " -"[CanvasItem]-derived node." +"Draws this stylebox using a canvas item identified by the given [RID].\n" +"The [RID] value can either be the result of [method CanvasItem." +"get_canvas_item] called on an existing [CanvasItem]-derived node, or " +"directly from creating a canvas item in the [VisualServer] with [method " +"VisualServer.canvas_item_create]." msgstr "" #: doc/classes/StyleBox.xml @@ -61291,6 +61412,11 @@ msgid "If [code]true[/code], a right-click displays the context menu." msgstr "" #: doc/classes/TextEdit.xml +#, fuzzy +msgid "If [code]true[/code], allow drag and drop of selected text." +msgstr "Se [code]true[/code], o objeto é desenhado por cima do pai dele." + +#: doc/classes/TextEdit.xml msgid "" "If [code]true[/code], the \"space\" character will have a visible " "representation." @@ -67385,9 +67511,10 @@ msgstr "" msgid "" "The shadow atlas' resolution (used for omni and spot lights). The value will " "be rounded up to the nearest power of 2.\n" -"[b]Note:[/b] If this is set to 0, shadows won't be visible. Since user-" -"created viewports default to a value of 0, this value must be set above 0 " -"manually." +"[b]Note:[/b] If this is set to [code]0[/code], both point [i]and[/i] " +"directional shadows won't be visible. Since user-created viewports default " +"to a value of [code]0[/code], this value must be set above [code]0[/code] " +"manually (typically at least [code]256[/code])." msgstr "" #: doc/classes/Viewport.xml @@ -67416,7 +67543,11 @@ msgid "" msgstr "" #: doc/classes/Viewport.xml -msgid "The rendering mode of viewport." +msgid "" +"The rendering mode of viewport.\n" +"[b]Note:[/b] If set to [constant USAGE_2D] or [constant " +"USAGE_2D_NO_SAMPLING], [member hdr] will have no effect when enabled since " +"HDR is not supported for 2D." msgstr "" #: doc/classes/Viewport.xml diff --git a/doc/translations/pt_BR.po b/doc/translations/pt_BR.po index b32492887a..b432963519 100644 --- a/doc/translations/pt_BR.po +++ b/doc/translations/pt_BR.po @@ -13209,10 +13209,12 @@ msgid "" msgstr "" #: doc/classes/Camera2D.xml doc/classes/ClippedCamera.xml +#: doc/classes/InterpolatedCamera.xml msgid "The camera updates with the [code]_physics_process[/code] callback." msgstr "" #: doc/classes/Camera2D.xml doc/classes/ClippedCamera.xml +#: doc/classes/InterpolatedCamera.xml msgid "The camera updates with the [code]_process[/code] callback." msgstr "" @@ -20592,13 +20594,17 @@ msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "Amount of extra bias for shadow splits that are far away. If self-shadowing " -"occurs only on the splits far away, increasing this value can fix them." +"occurs only on the splits far away, increasing this value can fix them. This " +"is ignored when [member directional_shadow_mode] is [constant " +"SHADOW_ORTHOGONAL]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "If [code]true[/code], shadow detail is sacrificed in exchange for smoother " -"transitions between splits." +"transitions between splits. Enabling shadow blend splitting also has a " +"moderate performance cost. This is ignored when [member " +"directional_shadow_mode] is [constant SHADOW_ORTHOGONAL]." msgstr "" #: doc/classes/DirectionalLight.xml @@ -20608,7 +20614,11 @@ msgid "" msgstr "" #: doc/classes/DirectionalLight.xml -msgid "The maximum distance for shadow splits." +msgid "" +"The maximum distance for shadow splits. Increasing this value will make " +"directional shadows visible from further away, at the cost of lower overall " +"shadow detail and performance (since more objects need to be included in the " +"directional shadow rendering)." msgstr "" #: doc/classes/DirectionalLight.xml @@ -20625,23 +20635,23 @@ msgstr "" msgid "" "The distance from camera to shadow split 1. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or " -"[code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_2_SPLITS] or [constant " +"SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "The distance from shadow split 1 to split 2. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or " -"[code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_2_SPLITS] or [constant " +"SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "The distance from shadow split 2 to split 3. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml @@ -31043,7 +31053,10 @@ msgid "" "input at the cost of increased CPU usage. In applications where drawing " "freehand lines is required, input accumulation should generally be disabled " "while the user is drawing the line to get results that closely follow the " -"actual input." +"actual input.\n" +"[b]Note:[/b] Input accumulation is [i]disabled[/i] by default for backward " +"compatibility reasons. It is however recommended to enable it for games " +"which don't require very reactive input, as this will decrease CPU usage." msgstr "" #: doc/classes/Input.xml @@ -31617,10 +31630,11 @@ msgstr "" msgid "" "Contains mouse and pen motion information. Supports relative, absolute " "positions and speed. See [method Node._input].\n" -"[b]Note:[/b] By default, this event is only emitted once per frame rendered " -"at most. If you need more precise input reporting, set [member Input." -"use_accumulated_input] to [code]false[/code] to make events emitted as often " -"as possible. If you use InputEventMouseMotion to draw lines, consider " +"[b]Note:[/b] By default, this event can be emitted multiple times per frame " +"rendered, allowing for precise input reporting, at the expense of CPU usage. " +"You can set [member Input.use_accumulated_input] to [code]true[/code] to let " +"multiple events merge into a single emitted event per frame.\n" +"[b]Note:[/b] If you use InputEventMouseMotion to draw lines, consider " "implementing [url=https://en.wikipedia.org/wiki/" "Bresenham%27s_line_algorithm]Bresenham's line algorithm[/url] as well to " "avoid visible gaps in lines if the user is moving the mouse quickly." @@ -31951,6 +31965,11 @@ msgstr "" #: doc/classes/InterpolatedCamera.xml msgid "" +"The camera's process callback. See [enum InterpolatedCameraProcessMode]." +msgstr "" + +#: doc/classes/InterpolatedCamera.xml +msgid "" "How quickly the camera moves toward its target. Higher values will result in " "tighter camera motion." msgstr "" @@ -37411,7 +37430,7 @@ msgid "" "maximum distance is exceeded, it recalculates the ideal path." msgstr "" -#: doc/classes/NavigationAgent.xml doc/classes/NavigationAgent2D.xml +#: doc/classes/NavigationAgent.xml msgid "" "The radius of the avoidance agent. This is the \"body\" of the avoidance " "agent and not the avoidance maneuver starting radius (which is controlled by " @@ -37525,6 +37544,14 @@ msgid "" "least one matching layer." msgstr "" +#: doc/classes/NavigationAgent2D.xml +msgid "" +"The radius of the avoidance agent. This is the \"body\" of the avoidance " +"agent and not the avoidance maneuver starting radius (which is controlled by " +"[member neighbor_dist]).\n" +"Does not affect normal pathfinding." +msgstr "" + #: doc/classes/NavigationMesh.xml msgid "A mesh to approximate the walkable areas and obstacles." msgstr "" @@ -51178,8 +51205,8 @@ msgstr "" #: doc/classes/ProjectSettings.xml msgid "" -"Size for shadow atlas (used for OmniLights and SpotLights). See " -"documentation." +"Size for shadow atlas (used for OmniLights and SpotLights). The value will " +"be rounded up to the nearest power of 2. See shadow mapping documentation." msgstr "" #: doc/classes/ProjectSettings.xml @@ -59588,7 +59615,31 @@ msgstr "" #: doc/classes/String.xml msgid "" "Formats the string by replacing all occurrences of [code]placeholder[/code] " -"with [code]values[/code]." +"with the elements of [code]values[/code].\n" +"[code]values[/code] can be a [Dictionary] or an [Array]. Any underscores in " +"[code]placeholder[/code] will be replaced with the corresponding keys in " +"advance. Array elements use their index as keys.\n" +"[codeblock]\n" +"# Prints: Waiting for Godot is a play by Samuel Beckett, and Godot Engine is " +"named after it.\n" +"var use_array_values = \"Waiting for {0} is a play by {1}, and {0} Engine is " +"named after it.\"\n" +"print(use_array_values.format([\"Godot\", \"Samuel Beckett\"]))\n" +"\n" +"# Prints: User 42 is Godot.\n" +"print(\"User {id} is {name}.\".format({\"id\": 42, \"name\": \"Godot\"}))\n" +"[/codeblock]\n" +"Some additional handling is performed when [code]values[/code] is an array. " +"If [code]placeholder[/code] does not contain an underscore, the elements of " +"the array will be used to replace one occurrence of the placeholder in turn; " +"If an array element is another 2-element array, it'll be interpreted as a " +"key-value pair.\n" +"[codeblock]\n" +"# Prints: User 42 is Godot.\n" +"print(\"User {} is {}.\".format([42, \"Godot\"], \"{}\"))\n" +"print(\"User {id} is {name}.\".format([[\"id\", 42], [\"name\", " +"\"Godot\"]]))\n" +"[/codeblock]" msgstr "" #: doc/classes/String.xml @@ -60185,9 +60236,11 @@ msgstr "" #: doc/classes/StyleBox.xml msgid "" -"Draws this stylebox using a [CanvasItem] with given [RID].\n" -"You can get a [RID] value using [method Object.get_instance_id] on a " -"[CanvasItem]-derived node." +"Draws this stylebox using a canvas item identified by the given [RID].\n" +"The [RID] value can either be the result of [method CanvasItem." +"get_canvas_item] called on an existing [CanvasItem]-derived node, or " +"directly from creating a canvas item in the [VisualServer] with [method " +"VisualServer.canvas_item_create]." msgstr "" #: doc/classes/StyleBox.xml @@ -61746,6 +61799,11 @@ msgid "If [code]true[/code], a right-click displays the context menu." msgstr "" #: doc/classes/TextEdit.xml +#, fuzzy +msgid "If [code]true[/code], allow drag and drop of selected text." +msgstr "Retorna [code]true[/code] se o script pode ser instanciado." + +#: doc/classes/TextEdit.xml msgid "" "If [code]true[/code], the \"space\" character will have a visible " "representation." @@ -67861,9 +67919,10 @@ msgstr "" msgid "" "The shadow atlas' resolution (used for omni and spot lights). The value will " "be rounded up to the nearest power of 2.\n" -"[b]Note:[/b] If this is set to 0, shadows won't be visible. Since user-" -"created viewports default to a value of 0, this value must be set above 0 " -"manually." +"[b]Note:[/b] If this is set to [code]0[/code], both point [i]and[/i] " +"directional shadows won't be visible. Since user-created viewports default " +"to a value of [code]0[/code], this value must be set above [code]0[/code] " +"manually (typically at least [code]256[/code])." msgstr "" #: doc/classes/Viewport.xml @@ -67895,7 +67954,11 @@ msgid "" msgstr "" #: doc/classes/Viewport.xml -msgid "The rendering mode of viewport." +msgid "" +"The rendering mode of viewport.\n" +"[b]Note:[/b] If set to [constant USAGE_2D] or [constant " +"USAGE_2D_NO_SAMPLING], [member hdr] will have no effect when enabled since " +"HDR is not supported for 2D." msgstr "" #: doc/classes/Viewport.xml diff --git a/doc/translations/ro.po b/doc/translations/ro.po index 260a63446f..068587e37a 100644 --- a/doc/translations/ro.po +++ b/doc/translations/ro.po @@ -12169,10 +12169,12 @@ msgid "" msgstr "" #: doc/classes/Camera2D.xml doc/classes/ClippedCamera.xml +#: doc/classes/InterpolatedCamera.xml msgid "The camera updates with the [code]_physics_process[/code] callback." msgstr "" #: doc/classes/Camera2D.xml doc/classes/ClippedCamera.xml +#: doc/classes/InterpolatedCamera.xml msgid "The camera updates with the [code]_process[/code] callback." msgstr "" @@ -19454,13 +19456,17 @@ msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "Amount of extra bias for shadow splits that are far away. If self-shadowing " -"occurs only on the splits far away, increasing this value can fix them." +"occurs only on the splits far away, increasing this value can fix them. This " +"is ignored when [member directional_shadow_mode] is [constant " +"SHADOW_ORTHOGONAL]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "If [code]true[/code], shadow detail is sacrificed in exchange for smoother " -"transitions between splits." +"transitions between splits. Enabling shadow blend splitting also has a " +"moderate performance cost. This is ignored when [member " +"directional_shadow_mode] is [constant SHADOW_ORTHOGONAL]." msgstr "" #: doc/classes/DirectionalLight.xml @@ -19470,7 +19476,11 @@ msgid "" msgstr "" #: doc/classes/DirectionalLight.xml -msgid "The maximum distance for shadow splits." +msgid "" +"The maximum distance for shadow splits. Increasing this value will make " +"directional shadows visible from further away, at the cost of lower overall " +"shadow detail and performance (since more objects need to be included in the " +"directional shadow rendering)." msgstr "" #: doc/classes/DirectionalLight.xml @@ -19487,23 +19497,23 @@ msgstr "" msgid "" "The distance from camera to shadow split 1. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or " -"[code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_2_SPLITS] or [constant " +"SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "The distance from shadow split 1 to split 2. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or " -"[code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_2_SPLITS] or [constant " +"SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "The distance from shadow split 2 to split 3. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml @@ -29852,7 +29862,10 @@ msgid "" "input at the cost of increased CPU usage. In applications where drawing " "freehand lines is required, input accumulation should generally be disabled " "while the user is drawing the line to get results that closely follow the " -"actual input." +"actual input.\n" +"[b]Note:[/b] Input accumulation is [i]disabled[/i] by default for backward " +"compatibility reasons. It is however recommended to enable it for games " +"which don't require very reactive input, as this will decrease CPU usage." msgstr "" #: doc/classes/Input.xml @@ -30426,10 +30439,11 @@ msgstr "" msgid "" "Contains mouse and pen motion information. Supports relative, absolute " "positions and speed. See [method Node._input].\n" -"[b]Note:[/b] By default, this event is only emitted once per frame rendered " -"at most. If you need more precise input reporting, set [member Input." -"use_accumulated_input] to [code]false[/code] to make events emitted as often " -"as possible. If you use InputEventMouseMotion to draw lines, consider " +"[b]Note:[/b] By default, this event can be emitted multiple times per frame " +"rendered, allowing for precise input reporting, at the expense of CPU usage. " +"You can set [member Input.use_accumulated_input] to [code]true[/code] to let " +"multiple events merge into a single emitted event per frame.\n" +"[b]Note:[/b] If you use InputEventMouseMotion to draw lines, consider " "implementing [url=https://en.wikipedia.org/wiki/" "Bresenham%27s_line_algorithm]Bresenham's line algorithm[/url] as well to " "avoid visible gaps in lines if the user is moving the mouse quickly." @@ -30752,6 +30766,11 @@ msgstr "" #: doc/classes/InterpolatedCamera.xml msgid "" +"The camera's process callback. See [enum InterpolatedCameraProcessMode]." +msgstr "" + +#: doc/classes/InterpolatedCamera.xml +msgid "" "How quickly the camera moves toward its target. Higher values will result in " "tighter camera motion." msgstr "" @@ -36152,7 +36171,7 @@ msgid "" "maximum distance is exceeded, it recalculates the ideal path." msgstr "" -#: doc/classes/NavigationAgent.xml doc/classes/NavigationAgent2D.xml +#: doc/classes/NavigationAgent.xml msgid "" "The radius of the avoidance agent. This is the \"body\" of the avoidance " "agent and not the avoidance maneuver starting radius (which is controlled by " @@ -36263,6 +36282,14 @@ msgid "" "least one matching layer." msgstr "" +#: doc/classes/NavigationAgent2D.xml +msgid "" +"The radius of the avoidance agent. This is the \"body\" of the avoidance " +"agent and not the avoidance maneuver starting radius (which is controlled by " +"[member neighbor_dist]).\n" +"Does not affect normal pathfinding." +msgstr "" + #: doc/classes/NavigationMesh.xml msgid "A mesh to approximate the walkable areas and obstacles." msgstr "" @@ -49843,8 +49870,8 @@ msgstr "" #: doc/classes/ProjectSettings.xml msgid "" -"Size for shadow atlas (used for OmniLights and SpotLights). See " -"documentation." +"Size for shadow atlas (used for OmniLights and SpotLights). The value will " +"be rounded up to the nearest power of 2. See shadow mapping documentation." msgstr "" #: doc/classes/ProjectSettings.xml @@ -58213,7 +58240,31 @@ msgstr "" #: doc/classes/String.xml msgid "" "Formats the string by replacing all occurrences of [code]placeholder[/code] " -"with [code]values[/code]." +"with the elements of [code]values[/code].\n" +"[code]values[/code] can be a [Dictionary] or an [Array]. Any underscores in " +"[code]placeholder[/code] will be replaced with the corresponding keys in " +"advance. Array elements use their index as keys.\n" +"[codeblock]\n" +"# Prints: Waiting for Godot is a play by Samuel Beckett, and Godot Engine is " +"named after it.\n" +"var use_array_values = \"Waiting for {0} is a play by {1}, and {0} Engine is " +"named after it.\"\n" +"print(use_array_values.format([\"Godot\", \"Samuel Beckett\"]))\n" +"\n" +"# Prints: User 42 is Godot.\n" +"print(\"User {id} is {name}.\".format({\"id\": 42, \"name\": \"Godot\"}))\n" +"[/codeblock]\n" +"Some additional handling is performed when [code]values[/code] is an array. " +"If [code]placeholder[/code] does not contain an underscore, the elements of " +"the array will be used to replace one occurrence of the placeholder in turn; " +"If an array element is another 2-element array, it'll be interpreted as a " +"key-value pair.\n" +"[codeblock]\n" +"# Prints: User 42 is Godot.\n" +"print(\"User {} is {}.\".format([42, \"Godot\"], \"{}\"))\n" +"print(\"User {id} is {name}.\".format([[\"id\", 42], [\"name\", " +"\"Godot\"]]))\n" +"[/codeblock]" msgstr "" #: doc/classes/String.xml @@ -58810,9 +58861,11 @@ msgstr "" #: doc/classes/StyleBox.xml msgid "" -"Draws this stylebox using a [CanvasItem] with given [RID].\n" -"You can get a [RID] value using [method Object.get_instance_id] on a " -"[CanvasItem]-derived node." +"Draws this stylebox using a canvas item identified by the given [RID].\n" +"The [RID] value can either be the result of [method CanvasItem." +"get_canvas_item] called on an existing [CanvasItem]-derived node, or " +"directly from creating a canvas item in the [VisualServer] with [method " +"VisualServer.canvas_item_create]." msgstr "" #: doc/classes/StyleBox.xml @@ -60349,6 +60402,10 @@ msgid "If [code]true[/code], a right-click displays the context menu." msgstr "" #: doc/classes/TextEdit.xml +msgid "If [code]true[/code], allow drag and drop of selected text." +msgstr "" + +#: doc/classes/TextEdit.xml msgid "" "If [code]true[/code], the \"space\" character will have a visible " "representation." @@ -66423,9 +66480,10 @@ msgstr "" msgid "" "The shadow atlas' resolution (used for omni and spot lights). The value will " "be rounded up to the nearest power of 2.\n" -"[b]Note:[/b] If this is set to 0, shadows won't be visible. Since user-" -"created viewports default to a value of 0, this value must be set above 0 " -"manually." +"[b]Note:[/b] If this is set to [code]0[/code], both point [i]and[/i] " +"directional shadows won't be visible. Since user-created viewports default " +"to a value of [code]0[/code], this value must be set above [code]0[/code] " +"manually (typically at least [code]256[/code])." msgstr "" #: doc/classes/Viewport.xml @@ -66454,7 +66512,11 @@ msgid "" msgstr "" #: doc/classes/Viewport.xml -msgid "The rendering mode of viewport." +msgid "" +"The rendering mode of viewport.\n" +"[b]Note:[/b] If set to [constant USAGE_2D] or [constant " +"USAGE_2D_NO_SAMPLING], [member hdr] will have no effect when enabled since " +"HDR is not supported for 2D." msgstr "" #: doc/classes/Viewport.xml diff --git a/doc/translations/ru.po b/doc/translations/ru.po index 36dbb7d50d..6455a611e5 100644 --- a/doc/translations/ru.po +++ b/doc/translations/ru.po @@ -48,12 +48,13 @@ # Bozhko Artyom Dmitrievich <jek_sun@mail.ru>, 2022. # FuzzMix <fmwolfiechad@gmail.com>, 2022. # МАН69К <weblate@mah69k.net>, 2022. +# Vadim Mitroshkin <Vadim7540@yandex.ru>, 2022. msgid "" msgstr "" "Project-Id-Version: Godot Engine class reference\n" "Report-Msgid-Bugs-To: https://github.com/godotengine/godot\n" -"PO-Revision-Date: 2022-06-08 06:47+0000\n" -"Last-Translator: FuzzMix <fmwolfiechad@gmail.com>\n" +"PO-Revision-Date: 2022-07-03 00:44+0000\n" +"Last-Translator: Bozhko Artyom Dmitrievich <jek_sun@mail.ru>\n" "Language-Team: Russian <https://hosted.weblate.org/projects/godot-engine/" "godot-class-reference/ru/>\n" "Language: ru\n" @@ -62,7 +63,7 @@ msgstr "" "Content-Transfer-Encoding: 8-bit\n" "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && " "n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" -"X-Generator: Weblate 4.13-dev\n" +"X-Generator: Weblate 4.13.1-dev\n" #: doc/tools/make_rst.py msgid "Description" @@ -154,7 +155,8 @@ msgstr "" #: doc/tools/make_rst.py msgid "" "This method accepts any number of arguments after the ones described here." -msgstr "Этот метод принимает любое количество аргументов после описанных." +msgstr "" +"Этот метод принимает любое количество аргументов после описанных здесь." #: doc/tools/make_rst.py msgid "This method is used to construct a type." @@ -533,7 +535,6 @@ msgstr "" "[/codeblock]" #: modules/gdscript/doc_classes/@GDScript.xml -#, fuzzy msgid "" "Compares two values by checking their actual contents, recursing into any " "[Array] or [Dictionary] up to its deepest level.\n" @@ -559,9 +560,9 @@ msgstr "" "- Для [code]null[/code], [code]int[/code], [code]float[/code], [code]String[/" "code], [code]Object[/code] и [code]RID[/code], [code]deep_equal[/code] и " "[code]==[/code] работают одинаково.\n" -"- Для [code]Dictionary[/code], [code]==[/code] рассматривает равенство и " -"только если обе переменные указывают на один и тот же [code]Dictionary[/" -"code], без рекурсии или просмотра содержимого вообще.\n" +"- Для [code]Dictionary[/code], [code]==[/code] рассматривает равенство " +"тогда, и только тогда, когда обе переменные указывают на один и тот же " +"[code]Dictionary[/code], без рекурсии или просмотра содержимого вообще.\n" "- Для [code]Array[/code], [code]==[/code] считается равенством тогда, и " "только тогда, когда каждый элемент в первом [code]Array[/code] равен " "элементу во втором [code]Array[/code], как сообщает [code]==[/code]. Это " @@ -1006,7 +1007,6 @@ msgstr "" "[/codeblock]" #: modules/gdscript/doc_classes/@GDScript.xml -#, fuzzy msgid "" "Linearly interpolates between two angles (in radians) by a normalized " "value.\n" @@ -1032,7 +1032,7 @@ msgstr "" "Линейная интерполяция между двумя углами (в радианах) по нормализованному " "значению.\n" "Аналогично [методу lerp], но корректно интерполируется, когда углы " -"оборачивают вокруг [constant @GDScript.TAU]. Чтобы выполнить упрощенную " +"оборачивают вокруг [константы @GDScript.TAU]. Чтобы выполнить упрощенную " "интерполяцию с помощью [метода lerp_angle], объедините его с [методом ease] " "или [методом smoothstep].\n" "[codeblock]\n" @@ -1043,7 +1043,14 @@ msgstr "" " var max_angle = deg2rad(90.0)\n" " rotation = lerp_angle(min_angle, max_angle, elapsed)\n" " elapsed += delta\n" -"[/codeblock]" +"[/codeblock]\n" +"[b]Примечание:[/b] Этот метод проходит через кратчайший путь между " +"[code]from[/code] и [code]to[/code]. Тем не менее, если разница между этими " +"двумя углами и любым целым числом [code]k[/code] приблизительно [code]PI + " +"k * TAU[/code], неочевидно в какую сторону [/code]из-за ошибок в точности " +"чисел с плавающей точкой. Например, [code]lerp_angle(0, PI, weight)[/code] " +"оборачивается против часовой стрелки, а [code]lerp_angle(0, PI + 5 * TAU, " +"weight)[/code] оборачивается по часовой." #: modules/gdscript/doc_classes/@GDScript.xml msgid "" @@ -1292,7 +1299,6 @@ msgstr "" "координат (оси X и Y)." #: modules/gdscript/doc_classes/@GDScript.xml -#, fuzzy msgid "" "Returns the integer modulus of [code]a/b[/code] that wraps equally in " "positive and negative.\n" @@ -1314,28 +1320,21 @@ msgstr "" "Возвращает целочисленный модуль [code]a/b[/code], который одинаково " "переносится как в положительный, так и в отрицательный.\n" "[codeblock]\n" -"var i = -6\n" -"while i < 5:\n" -" prints(i, posmod(i, 3))\n" -" i += 1\n" +"for i in range(-3, 4):\n" +" print(\"%2d %2d %2d\" % [i, i % 3, posmod(i, 3)])\n" "[/codeblock]\n" "Produces:\n" "[codeblock]\n" -"-6 0\n" -"-5 1\n" -"-4 2\n" -"-3 0\n" -"-2 1\n" -"-1 2\n" -"0 0\n" -"1 1\n" -"2 2\n" -"3 0\n" -"4 1\n" +"-3 0 0\n" +"-2 -2 1\n" +"-1 -1 2\n" +" 0 0 0\n" +" 1 1 1\n" +" 2 2 2\n" +" 3 0 0\n" "[/codeblock]" #: modules/gdscript/doc_classes/@GDScript.xml -#, fuzzy msgid "" "Returns the result of [code]base[/code] raised to the power of [code]exp[/" "code].\n" @@ -1346,7 +1345,7 @@ msgstr "" "Возвращает результат возведения числа [code]x[/code] в степени [code]y[/" "code].\n" "[codeblock]\n" -"pow(2, 5) # Возвращает 32\n" +"pow(2, 5) # Возвращает 32.0\n" "[/codeblock]" #: modules/gdscript/doc_classes/@GDScript.xml @@ -1525,7 +1524,6 @@ msgstr "" "[/codeblock]" #: modules/gdscript/doc_classes/@GDScript.xml -#, fuzzy msgid "" "Converts an angle expressed in radians to degrees.\n" "[codeblock]\n" @@ -1534,7 +1532,7 @@ msgid "" msgstr "" "Преобразует угол, выраженный в радианах, в градусы.\n" "[codeblock]\n" -"rad2deg(0.523599) # Возвращает 30\n" +"rad2deg(0.523599) # Возвращает 30.0\n" "[/codeblock]" #: modules/gdscript/doc_classes/@GDScript.xml @@ -1581,7 +1579,6 @@ msgstr "" "[/codeblock]" #: modules/gdscript/doc_classes/@GDScript.xml -#, fuzzy msgid "" "Returns a random unsigned 32-bit integer. Use remainder to obtain a random " "value in the interval [code][0, N - 1][/code] (where N is smaller than " @@ -1660,6 +1657,44 @@ msgid "" "3\n" "[/codeblock]" msgstr "" +"Возвращает массив с заданным диапазоном. [метод range] может быть вызван " +"тремя способами:\n" +"[code]range(n: int)[/code]: Начинается с 0, увеличивается с шагом в 1 и " +"останавливается [i]перед[/i] [code]n[/code]. Аргумент [code]n[/code] это " +"[b]эксклюзив[/b].\n" +"[code]range(b: int, n: int)[/code]: Начинается с [code]b[/code], " +"увеличивается с шагом в 1 и останавливается [i]перед[/i] [code]n[/code]. " +"Аргументы [code]b[/code] и [code]n[/code] это [b]инклюзив[/b] и " +"[b]эксклюзив[/b], соответственно.\n" +"[code]range(b: int, n: int, s: int)[/code]: Начинается с [code]b[/code], " +"увеличивается/уменьшается с шагом [code]s[/code], и останавливается " +"[i]перед[/i] [code]n[/code]. Аргументы [code]b[/code] и [code]n[/code] это " +"[b]инклюзив[/b] и [b]эксклюзив[/b], соответственно. Аргумент [code]s[/code] " +"[b]может[/b] быть негативным, но не [code]0[/code]. Если [code]s[/code] это " +"[code]0[/code], будет выведено сообщение об ошибке.\n" +"[метод range] преобразует все аргументы в [int] перед обработкой.\n" +"[b]Примечание:[/b] Возвращает пустой массив, если ни одно значение не " +"удовлетворяет ограничению на значение (e.g. [code]range(2, 5, -1)[/code] или " +"[code]range(5, 5, 1)[/code]).\n" +"Примеры:\n" +"[codeblock]\n" +"print(range(4)) # Prints [0, 1, 2, 3]\n" +"print(range(2, 5)) # Prints [2, 3, 4]\n" +"print(range(0, 6, 2)) # Prints [0, 2, 4]\n" +"print(range(4, 1, -1)) # Prints [4, 3, 2]\n" +"[/codeblock]\n" +"Чтобы выполнить итерацию по [Array] в обратном порядке, используйте:\n" +"[codeblock]\n" +"var array = [3, 6, 9]\n" +"for i in range(array.size(), 0, -1):\n" +" print(array[i - 1])\n" +"[/codeblock]\n" +"Вывод:\n" +"[codeblock]\n" +"9\n" +"6\n" +"3\n" +"[/codeblock]" #: modules/gdscript/doc_classes/@GDScript.xml msgid "" @@ -1676,7 +1711,6 @@ msgstr "" "[/codeblock]" #: modules/gdscript/doc_classes/@GDScript.xml -#, fuzzy msgid "" "Rounds [code]s[/code] to the nearest whole number, with halfway cases " "rounded away from zero.\n" @@ -1687,11 +1721,14 @@ msgid "" "[/codeblock]\n" "See also [method floor], [method ceil], [method stepify], and [int]." msgstr "" -"Округляет [code]s[/code] к ближайшему целому числу, при этом середины " -"округляются от нуля.\n" +"Округляет [code]s[/code] к ближайшему целому числу, при этом 0.5 округляется " +"в большую сторону.\n" "[codeblock]\n" -"round(2.6) # Возвращает 3\n" -"[/codeblock]" +"a = round(2.49) # Возвращает 2.0\n" +"a = round(2.5) # Возвращает 3.0\n" +"a = round(2.51) # Возвращает 3.0\n" +"[/codeblock]\n" +"См. также[метод floor], [метод ceil], [метод stepify], и [int]." #: modules/gdscript/doc_classes/@GDScript.xml msgid "" @@ -13799,10 +13836,12 @@ msgid "" msgstr "" #: doc/classes/Camera2D.xml doc/classes/ClippedCamera.xml +#: doc/classes/InterpolatedCamera.xml msgid "The camera updates with the [code]_physics_process[/code] callback." msgstr "" #: doc/classes/Camera2D.xml doc/classes/ClippedCamera.xml +#: doc/classes/InterpolatedCamera.xml msgid "The camera updates with the [code]_process[/code] callback." msgstr "" @@ -21231,13 +21270,17 @@ msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "Amount of extra bias for shadow splits that are far away. If self-shadowing " -"occurs only on the splits far away, increasing this value can fix them." +"occurs only on the splits far away, increasing this value can fix them. This " +"is ignored when [member directional_shadow_mode] is [constant " +"SHADOW_ORTHOGONAL]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "If [code]true[/code], shadow detail is sacrificed in exchange for smoother " -"transitions between splits." +"transitions between splits. Enabling shadow blend splitting also has a " +"moderate performance cost. This is ignored when [member " +"directional_shadow_mode] is [constant SHADOW_ORTHOGONAL]." msgstr "" #: doc/classes/DirectionalLight.xml @@ -21247,7 +21290,11 @@ msgid "" msgstr "" #: doc/classes/DirectionalLight.xml -msgid "The maximum distance for shadow splits." +msgid "" +"The maximum distance for shadow splits. Increasing this value will make " +"directional shadows visible from further away, at the cost of lower overall " +"shadow detail and performance (since more objects need to be included in the " +"directional shadow rendering)." msgstr "" #: doc/classes/DirectionalLight.xml @@ -21264,23 +21311,23 @@ msgstr "" msgid "" "The distance from camera to shadow split 1. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or " -"[code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_2_SPLITS] or [constant " +"SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "The distance from shadow split 1 to split 2. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or " -"[code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_2_SPLITS] or [constant " +"SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "The distance from shadow split 2 to split 3. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml @@ -31684,7 +31731,10 @@ msgid "" "input at the cost of increased CPU usage. In applications where drawing " "freehand lines is required, input accumulation should generally be disabled " "while the user is drawing the line to get results that closely follow the " -"actual input." +"actual input.\n" +"[b]Note:[/b] Input accumulation is [i]disabled[/i] by default for backward " +"compatibility reasons. It is however recommended to enable it for games " +"which don't require very reactive input, as this will decrease CPU usage." msgstr "" #: doc/classes/Input.xml @@ -32258,10 +32308,11 @@ msgstr "" msgid "" "Contains mouse and pen motion information. Supports relative, absolute " "positions and speed. See [method Node._input].\n" -"[b]Note:[/b] By default, this event is only emitted once per frame rendered " -"at most. If you need more precise input reporting, set [member Input." -"use_accumulated_input] to [code]false[/code] to make events emitted as often " -"as possible. If you use InputEventMouseMotion to draw lines, consider " +"[b]Note:[/b] By default, this event can be emitted multiple times per frame " +"rendered, allowing for precise input reporting, at the expense of CPU usage. " +"You can set [member Input.use_accumulated_input] to [code]true[/code] to let " +"multiple events merge into a single emitted event per frame.\n" +"[b]Note:[/b] If you use InputEventMouseMotion to draw lines, consider " "implementing [url=https://en.wikipedia.org/wiki/" "Bresenham%27s_line_algorithm]Bresenham's line algorithm[/url] as well to " "avoid visible gaps in lines if the user is moving the mouse quickly." @@ -32586,6 +32637,11 @@ msgstr "Если [code]true[/code], текстура отражена по ве #: doc/classes/InterpolatedCamera.xml msgid "" +"The camera's process callback. See [enum InterpolatedCameraProcessMode]." +msgstr "" + +#: doc/classes/InterpolatedCamera.xml +msgid "" "How quickly the camera moves toward its target. Higher values will result in " "tighter camera motion." msgstr "" @@ -38070,7 +38126,7 @@ msgid "" "maximum distance is exceeded, it recalculates the ideal path." msgstr "" -#: doc/classes/NavigationAgent.xml doc/classes/NavigationAgent2D.xml +#: doc/classes/NavigationAgent.xml msgid "" "The radius of the avoidance agent. This is the \"body\" of the avoidance " "agent and not the avoidance maneuver starting radius (which is controlled by " @@ -38183,6 +38239,14 @@ msgid "" "least one matching layer." msgstr "" +#: doc/classes/NavigationAgent2D.xml +msgid "" +"The radius of the avoidance agent. This is the \"body\" of the avoidance " +"agent and not the avoidance maneuver starting radius (which is controlled by " +"[member neighbor_dist]).\n" +"Does not affect normal pathfinding." +msgstr "" + #: doc/classes/NavigationMesh.xml msgid "A mesh to approximate the walkable areas and obstacles." msgstr "" @@ -51969,8 +52033,8 @@ msgstr "" #: doc/classes/ProjectSettings.xml msgid "" -"Size for shadow atlas (used for OmniLights and SpotLights). See " -"documentation." +"Size for shadow atlas (used for OmniLights and SpotLights). The value will " +"be rounded up to the nearest power of 2. See shadow mapping documentation." msgstr "" #: doc/classes/ProjectSettings.xml @@ -60441,7 +60505,31 @@ msgstr "" #: doc/classes/String.xml msgid "" "Formats the string by replacing all occurrences of [code]placeholder[/code] " -"with [code]values[/code]." +"with the elements of [code]values[/code].\n" +"[code]values[/code] can be a [Dictionary] or an [Array]. Any underscores in " +"[code]placeholder[/code] will be replaced with the corresponding keys in " +"advance. Array elements use their index as keys.\n" +"[codeblock]\n" +"# Prints: Waiting for Godot is a play by Samuel Beckett, and Godot Engine is " +"named after it.\n" +"var use_array_values = \"Waiting for {0} is a play by {1}, and {0} Engine is " +"named after it.\"\n" +"print(use_array_values.format([\"Godot\", \"Samuel Beckett\"]))\n" +"\n" +"# Prints: User 42 is Godot.\n" +"print(\"User {id} is {name}.\".format({\"id\": 42, \"name\": \"Godot\"}))\n" +"[/codeblock]\n" +"Some additional handling is performed when [code]values[/code] is an array. " +"If [code]placeholder[/code] does not contain an underscore, the elements of " +"the array will be used to replace one occurrence of the placeholder in turn; " +"If an array element is another 2-element array, it'll be interpreted as a " +"key-value pair.\n" +"[codeblock]\n" +"# Prints: User 42 is Godot.\n" +"print(\"User {} is {}.\".format([42, \"Godot\"], \"{}\"))\n" +"print(\"User {id} is {name}.\".format([[\"id\", 42], [\"name\", " +"\"Godot\"]]))\n" +"[/codeblock]" msgstr "" #: doc/classes/String.xml @@ -61038,9 +61126,11 @@ msgstr "" #: doc/classes/StyleBox.xml msgid "" -"Draws this stylebox using a [CanvasItem] with given [RID].\n" -"You can get a [RID] value using [method Object.get_instance_id] on a " -"[CanvasItem]-derived node." +"Draws this stylebox using a canvas item identified by the given [RID].\n" +"The [RID] value can either be the result of [method CanvasItem." +"get_canvas_item] called on an existing [CanvasItem]-derived node, or " +"directly from creating a canvas item in the [VisualServer] with [method " +"VisualServer.canvas_item_create]." msgstr "" #: doc/classes/StyleBox.xml @@ -62598,6 +62688,11 @@ msgid "If [code]true[/code], a right-click displays the context menu." msgstr "" #: doc/classes/TextEdit.xml +#, fuzzy +msgid "If [code]true[/code], allow drag and drop of selected text." +msgstr "Если [code]true[/code], текстура будет центрирована." + +#: doc/classes/TextEdit.xml msgid "" "If [code]true[/code], the \"space\" character will have a visible " "representation." @@ -68866,9 +68961,10 @@ msgstr "" msgid "" "The shadow atlas' resolution (used for omni and spot lights). The value will " "be rounded up to the nearest power of 2.\n" -"[b]Note:[/b] If this is set to 0, shadows won't be visible. Since user-" -"created viewports default to a value of 0, this value must be set above 0 " -"manually." +"[b]Note:[/b] If this is set to [code]0[/code], both point [i]and[/i] " +"directional shadows won't be visible. Since user-created viewports default " +"to a value of [code]0[/code], this value must be set above [code]0[/code] " +"manually (typically at least [code]256[/code])." msgstr "" #: doc/classes/Viewport.xml @@ -68898,7 +68994,11 @@ msgid "" msgstr "" #: doc/classes/Viewport.xml -msgid "The rendering mode of viewport." +msgid "" +"The rendering mode of viewport.\n" +"[b]Note:[/b] If set to [constant USAGE_2D] or [constant " +"USAGE_2D_NO_SAMPLING], [member hdr] will have no effect when enabled since " +"HDR is not supported for 2D." msgstr "" #: doc/classes/Viewport.xml diff --git a/doc/translations/sk.po b/doc/translations/sk.po index 9fb9613f0d..4964bf3ce0 100644 --- a/doc/translations/sk.po +++ b/doc/translations/sk.po @@ -12140,10 +12140,12 @@ msgid "" msgstr "" #: doc/classes/Camera2D.xml doc/classes/ClippedCamera.xml +#: doc/classes/InterpolatedCamera.xml msgid "The camera updates with the [code]_physics_process[/code] callback." msgstr "" #: doc/classes/Camera2D.xml doc/classes/ClippedCamera.xml +#: doc/classes/InterpolatedCamera.xml msgid "The camera updates with the [code]_process[/code] callback." msgstr "" @@ -19425,13 +19427,17 @@ msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "Amount of extra bias for shadow splits that are far away. If self-shadowing " -"occurs only on the splits far away, increasing this value can fix them." +"occurs only on the splits far away, increasing this value can fix them. This " +"is ignored when [member directional_shadow_mode] is [constant " +"SHADOW_ORTHOGONAL]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "If [code]true[/code], shadow detail is sacrificed in exchange for smoother " -"transitions between splits." +"transitions between splits. Enabling shadow blend splitting also has a " +"moderate performance cost. This is ignored when [member " +"directional_shadow_mode] is [constant SHADOW_ORTHOGONAL]." msgstr "" #: doc/classes/DirectionalLight.xml @@ -19441,7 +19447,11 @@ msgid "" msgstr "" #: doc/classes/DirectionalLight.xml -msgid "The maximum distance for shadow splits." +msgid "" +"The maximum distance for shadow splits. Increasing this value will make " +"directional shadows visible from further away, at the cost of lower overall " +"shadow detail and performance (since more objects need to be included in the " +"directional shadow rendering)." msgstr "" #: doc/classes/DirectionalLight.xml @@ -19458,23 +19468,23 @@ msgstr "" msgid "" "The distance from camera to shadow split 1. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or " -"[code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_2_SPLITS] or [constant " +"SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "The distance from shadow split 1 to split 2. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or " -"[code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_2_SPLITS] or [constant " +"SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "The distance from shadow split 2 to split 3. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml @@ -29823,7 +29833,10 @@ msgid "" "input at the cost of increased CPU usage. In applications where drawing " "freehand lines is required, input accumulation should generally be disabled " "while the user is drawing the line to get results that closely follow the " -"actual input." +"actual input.\n" +"[b]Note:[/b] Input accumulation is [i]disabled[/i] by default for backward " +"compatibility reasons. It is however recommended to enable it for games " +"which don't require very reactive input, as this will decrease CPU usage." msgstr "" #: doc/classes/Input.xml @@ -30397,10 +30410,11 @@ msgstr "" msgid "" "Contains mouse and pen motion information. Supports relative, absolute " "positions and speed. See [method Node._input].\n" -"[b]Note:[/b] By default, this event is only emitted once per frame rendered " -"at most. If you need more precise input reporting, set [member Input." -"use_accumulated_input] to [code]false[/code] to make events emitted as often " -"as possible. If you use InputEventMouseMotion to draw lines, consider " +"[b]Note:[/b] By default, this event can be emitted multiple times per frame " +"rendered, allowing for precise input reporting, at the expense of CPU usage. " +"You can set [member Input.use_accumulated_input] to [code]true[/code] to let " +"multiple events merge into a single emitted event per frame.\n" +"[b]Note:[/b] If you use InputEventMouseMotion to draw lines, consider " "implementing [url=https://en.wikipedia.org/wiki/" "Bresenham%27s_line_algorithm]Bresenham's line algorithm[/url] as well to " "avoid visible gaps in lines if the user is moving the mouse quickly." @@ -30723,6 +30737,11 @@ msgstr "" #: doc/classes/InterpolatedCamera.xml msgid "" +"The camera's process callback. See [enum InterpolatedCameraProcessMode]." +msgstr "" + +#: doc/classes/InterpolatedCamera.xml +msgid "" "How quickly the camera moves toward its target. Higher values will result in " "tighter camera motion." msgstr "" @@ -36123,7 +36142,7 @@ msgid "" "maximum distance is exceeded, it recalculates the ideal path." msgstr "" -#: doc/classes/NavigationAgent.xml doc/classes/NavigationAgent2D.xml +#: doc/classes/NavigationAgent.xml msgid "" "The radius of the avoidance agent. This is the \"body\" of the avoidance " "agent and not the avoidance maneuver starting radius (which is controlled by " @@ -36234,6 +36253,14 @@ msgid "" "least one matching layer." msgstr "" +#: doc/classes/NavigationAgent2D.xml +msgid "" +"The radius of the avoidance agent. This is the \"body\" of the avoidance " +"agent and not the avoidance maneuver starting radius (which is controlled by " +"[member neighbor_dist]).\n" +"Does not affect normal pathfinding." +msgstr "" + #: doc/classes/NavigationMesh.xml msgid "A mesh to approximate the walkable areas and obstacles." msgstr "" @@ -49813,8 +49840,8 @@ msgstr "" #: doc/classes/ProjectSettings.xml msgid "" -"Size for shadow atlas (used for OmniLights and SpotLights). See " -"documentation." +"Size for shadow atlas (used for OmniLights and SpotLights). The value will " +"be rounded up to the nearest power of 2. See shadow mapping documentation." msgstr "" #: doc/classes/ProjectSettings.xml @@ -58183,7 +58210,31 @@ msgstr "" #: doc/classes/String.xml msgid "" "Formats the string by replacing all occurrences of [code]placeholder[/code] " -"with [code]values[/code]." +"with the elements of [code]values[/code].\n" +"[code]values[/code] can be a [Dictionary] or an [Array]. Any underscores in " +"[code]placeholder[/code] will be replaced with the corresponding keys in " +"advance. Array elements use their index as keys.\n" +"[codeblock]\n" +"# Prints: Waiting for Godot is a play by Samuel Beckett, and Godot Engine is " +"named after it.\n" +"var use_array_values = \"Waiting for {0} is a play by {1}, and {0} Engine is " +"named after it.\"\n" +"print(use_array_values.format([\"Godot\", \"Samuel Beckett\"]))\n" +"\n" +"# Prints: User 42 is Godot.\n" +"print(\"User {id} is {name}.\".format({\"id\": 42, \"name\": \"Godot\"}))\n" +"[/codeblock]\n" +"Some additional handling is performed when [code]values[/code] is an array. " +"If [code]placeholder[/code] does not contain an underscore, the elements of " +"the array will be used to replace one occurrence of the placeholder in turn; " +"If an array element is another 2-element array, it'll be interpreted as a " +"key-value pair.\n" +"[codeblock]\n" +"# Prints: User 42 is Godot.\n" +"print(\"User {} is {}.\".format([42, \"Godot\"], \"{}\"))\n" +"print(\"User {id} is {name}.\".format([[\"id\", 42], [\"name\", " +"\"Godot\"]]))\n" +"[/codeblock]" msgstr "" #: doc/classes/String.xml @@ -58780,9 +58831,11 @@ msgstr "" #: doc/classes/StyleBox.xml msgid "" -"Draws this stylebox using a [CanvasItem] with given [RID].\n" -"You can get a [RID] value using [method Object.get_instance_id] on a " -"[CanvasItem]-derived node." +"Draws this stylebox using a canvas item identified by the given [RID].\n" +"The [RID] value can either be the result of [method CanvasItem." +"get_canvas_item] called on an existing [CanvasItem]-derived node, or " +"directly from creating a canvas item in the [VisualServer] with [method " +"VisualServer.canvas_item_create]." msgstr "" #: doc/classes/StyleBox.xml @@ -60319,6 +60372,10 @@ msgid "If [code]true[/code], a right-click displays the context menu." msgstr "" #: doc/classes/TextEdit.xml +msgid "If [code]true[/code], allow drag and drop of selected text." +msgstr "" + +#: doc/classes/TextEdit.xml msgid "" "If [code]true[/code], the \"space\" character will have a visible " "representation." @@ -66393,9 +66450,10 @@ msgstr "" msgid "" "The shadow atlas' resolution (used for omni and spot lights). The value will " "be rounded up to the nearest power of 2.\n" -"[b]Note:[/b] If this is set to 0, shadows won't be visible. Since user-" -"created viewports default to a value of 0, this value must be set above 0 " -"manually." +"[b]Note:[/b] If this is set to [code]0[/code], both point [i]and[/i] " +"directional shadows won't be visible. Since user-created viewports default " +"to a value of [code]0[/code], this value must be set above [code]0[/code] " +"manually (typically at least [code]256[/code])." msgstr "" #: doc/classes/Viewport.xml @@ -66424,7 +66482,11 @@ msgid "" msgstr "" #: doc/classes/Viewport.xml -msgid "The rendering mode of viewport." +msgid "" +"The rendering mode of viewport.\n" +"[b]Note:[/b] If set to [constant USAGE_2D] or [constant " +"USAGE_2D_NO_SAMPLING], [member hdr] will have no effect when enabled since " +"HDR is not supported for 2D." msgstr "" #: doc/classes/Viewport.xml diff --git a/doc/translations/sr_Cyrl.po b/doc/translations/sr_Cyrl.po index 765c89be10..89efbf0d11 100644 --- a/doc/translations/sr_Cyrl.po +++ b/doc/translations/sr_Cyrl.po @@ -12151,10 +12151,12 @@ msgid "" msgstr "" #: doc/classes/Camera2D.xml doc/classes/ClippedCamera.xml +#: doc/classes/InterpolatedCamera.xml msgid "The camera updates with the [code]_physics_process[/code] callback." msgstr "" #: doc/classes/Camera2D.xml doc/classes/ClippedCamera.xml +#: doc/classes/InterpolatedCamera.xml msgid "The camera updates with the [code]_process[/code] callback." msgstr "" @@ -19436,13 +19438,17 @@ msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "Amount of extra bias for shadow splits that are far away. If self-shadowing " -"occurs only on the splits far away, increasing this value can fix them." +"occurs only on the splits far away, increasing this value can fix them. This " +"is ignored when [member directional_shadow_mode] is [constant " +"SHADOW_ORTHOGONAL]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "If [code]true[/code], shadow detail is sacrificed in exchange for smoother " -"transitions between splits." +"transitions between splits. Enabling shadow blend splitting also has a " +"moderate performance cost. This is ignored when [member " +"directional_shadow_mode] is [constant SHADOW_ORTHOGONAL]." msgstr "" #: doc/classes/DirectionalLight.xml @@ -19452,7 +19458,11 @@ msgid "" msgstr "" #: doc/classes/DirectionalLight.xml -msgid "The maximum distance for shadow splits." +msgid "" +"The maximum distance for shadow splits. Increasing this value will make " +"directional shadows visible from further away, at the cost of lower overall " +"shadow detail and performance (since more objects need to be included in the " +"directional shadow rendering)." msgstr "" #: doc/classes/DirectionalLight.xml @@ -19469,23 +19479,23 @@ msgstr "" msgid "" "The distance from camera to shadow split 1. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or " -"[code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_2_SPLITS] or [constant " +"SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "The distance from shadow split 1 to split 2. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or " -"[code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_2_SPLITS] or [constant " +"SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "The distance from shadow split 2 to split 3. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml @@ -29834,7 +29844,10 @@ msgid "" "input at the cost of increased CPU usage. In applications where drawing " "freehand lines is required, input accumulation should generally be disabled " "while the user is drawing the line to get results that closely follow the " -"actual input." +"actual input.\n" +"[b]Note:[/b] Input accumulation is [i]disabled[/i] by default for backward " +"compatibility reasons. It is however recommended to enable it for games " +"which don't require very reactive input, as this will decrease CPU usage." msgstr "" #: doc/classes/Input.xml @@ -30408,10 +30421,11 @@ msgstr "" msgid "" "Contains mouse and pen motion information. Supports relative, absolute " "positions and speed. See [method Node._input].\n" -"[b]Note:[/b] By default, this event is only emitted once per frame rendered " -"at most. If you need more precise input reporting, set [member Input." -"use_accumulated_input] to [code]false[/code] to make events emitted as often " -"as possible. If you use InputEventMouseMotion to draw lines, consider " +"[b]Note:[/b] By default, this event can be emitted multiple times per frame " +"rendered, allowing for precise input reporting, at the expense of CPU usage. " +"You can set [member Input.use_accumulated_input] to [code]true[/code] to let " +"multiple events merge into a single emitted event per frame.\n" +"[b]Note:[/b] If you use InputEventMouseMotion to draw lines, consider " "implementing [url=https://en.wikipedia.org/wiki/" "Bresenham%27s_line_algorithm]Bresenham's line algorithm[/url] as well to " "avoid visible gaps in lines if the user is moving the mouse quickly." @@ -30734,6 +30748,11 @@ msgstr "" #: doc/classes/InterpolatedCamera.xml msgid "" +"The camera's process callback. See [enum InterpolatedCameraProcessMode]." +msgstr "" + +#: doc/classes/InterpolatedCamera.xml +msgid "" "How quickly the camera moves toward its target. Higher values will result in " "tighter camera motion." msgstr "" @@ -36134,7 +36153,7 @@ msgid "" "maximum distance is exceeded, it recalculates the ideal path." msgstr "" -#: doc/classes/NavigationAgent.xml doc/classes/NavigationAgent2D.xml +#: doc/classes/NavigationAgent.xml msgid "" "The radius of the avoidance agent. This is the \"body\" of the avoidance " "agent and not the avoidance maneuver starting radius (which is controlled by " @@ -36245,6 +36264,14 @@ msgid "" "least one matching layer." msgstr "" +#: doc/classes/NavigationAgent2D.xml +msgid "" +"The radius of the avoidance agent. This is the \"body\" of the avoidance " +"agent and not the avoidance maneuver starting radius (which is controlled by " +"[member neighbor_dist]).\n" +"Does not affect normal pathfinding." +msgstr "" + #: doc/classes/NavigationMesh.xml msgid "A mesh to approximate the walkable areas and obstacles." msgstr "" @@ -49824,8 +49851,8 @@ msgstr "" #: doc/classes/ProjectSettings.xml msgid "" -"Size for shadow atlas (used for OmniLights and SpotLights). See " -"documentation." +"Size for shadow atlas (used for OmniLights and SpotLights). The value will " +"be rounded up to the nearest power of 2. See shadow mapping documentation." msgstr "" #: doc/classes/ProjectSettings.xml @@ -58194,7 +58221,31 @@ msgstr "" #: doc/classes/String.xml msgid "" "Formats the string by replacing all occurrences of [code]placeholder[/code] " -"with [code]values[/code]." +"with the elements of [code]values[/code].\n" +"[code]values[/code] can be a [Dictionary] or an [Array]. Any underscores in " +"[code]placeholder[/code] will be replaced with the corresponding keys in " +"advance. Array elements use their index as keys.\n" +"[codeblock]\n" +"# Prints: Waiting for Godot is a play by Samuel Beckett, and Godot Engine is " +"named after it.\n" +"var use_array_values = \"Waiting for {0} is a play by {1}, and {0} Engine is " +"named after it.\"\n" +"print(use_array_values.format([\"Godot\", \"Samuel Beckett\"]))\n" +"\n" +"# Prints: User 42 is Godot.\n" +"print(\"User {id} is {name}.\".format({\"id\": 42, \"name\": \"Godot\"}))\n" +"[/codeblock]\n" +"Some additional handling is performed when [code]values[/code] is an array. " +"If [code]placeholder[/code] does not contain an underscore, the elements of " +"the array will be used to replace one occurrence of the placeholder in turn; " +"If an array element is another 2-element array, it'll be interpreted as a " +"key-value pair.\n" +"[codeblock]\n" +"# Prints: User 42 is Godot.\n" +"print(\"User {} is {}.\".format([42, \"Godot\"], \"{}\"))\n" +"print(\"User {id} is {name}.\".format([[\"id\", 42], [\"name\", " +"\"Godot\"]]))\n" +"[/codeblock]" msgstr "" #: doc/classes/String.xml @@ -58791,9 +58842,11 @@ msgstr "" #: doc/classes/StyleBox.xml msgid "" -"Draws this stylebox using a [CanvasItem] with given [RID].\n" -"You can get a [RID] value using [method Object.get_instance_id] on a " -"[CanvasItem]-derived node." +"Draws this stylebox using a canvas item identified by the given [RID].\n" +"The [RID] value can either be the result of [method CanvasItem." +"get_canvas_item] called on an existing [CanvasItem]-derived node, or " +"directly from creating a canvas item in the [VisualServer] with [method " +"VisualServer.canvas_item_create]." msgstr "" #: doc/classes/StyleBox.xml @@ -60330,6 +60383,10 @@ msgid "If [code]true[/code], a right-click displays the context menu." msgstr "" #: doc/classes/TextEdit.xml +msgid "If [code]true[/code], allow drag and drop of selected text." +msgstr "" + +#: doc/classes/TextEdit.xml msgid "" "If [code]true[/code], the \"space\" character will have a visible " "representation." @@ -66404,9 +66461,10 @@ msgstr "" msgid "" "The shadow atlas' resolution (used for omni and spot lights). The value will " "be rounded up to the nearest power of 2.\n" -"[b]Note:[/b] If this is set to 0, shadows won't be visible. Since user-" -"created viewports default to a value of 0, this value must be set above 0 " -"manually." +"[b]Note:[/b] If this is set to [code]0[/code], both point [i]and[/i] " +"directional shadows won't be visible. Since user-created viewports default " +"to a value of [code]0[/code], this value must be set above [code]0[/code] " +"manually (typically at least [code]256[/code])." msgstr "" #: doc/classes/Viewport.xml @@ -66435,7 +66493,11 @@ msgid "" msgstr "" #: doc/classes/Viewport.xml -msgid "The rendering mode of viewport." +msgid "" +"The rendering mode of viewport.\n" +"[b]Note:[/b] If set to [constant USAGE_2D] or [constant " +"USAGE_2D_NO_SAMPLING], [member hdr] will have no effect when enabled since " +"HDR is not supported for 2D." msgstr "" #: doc/classes/Viewport.xml diff --git a/doc/translations/sv.po b/doc/translations/sv.po index 706b410d30..e562fe9d6f 100644 --- a/doc/translations/sv.po +++ b/doc/translations/sv.po @@ -12140,10 +12140,12 @@ msgid "" msgstr "" #: doc/classes/Camera2D.xml doc/classes/ClippedCamera.xml +#: doc/classes/InterpolatedCamera.xml msgid "The camera updates with the [code]_physics_process[/code] callback." msgstr "" #: doc/classes/Camera2D.xml doc/classes/ClippedCamera.xml +#: doc/classes/InterpolatedCamera.xml msgid "The camera updates with the [code]_process[/code] callback." msgstr "" @@ -19425,13 +19427,17 @@ msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "Amount of extra bias for shadow splits that are far away. If self-shadowing " -"occurs only on the splits far away, increasing this value can fix them." +"occurs only on the splits far away, increasing this value can fix them. This " +"is ignored when [member directional_shadow_mode] is [constant " +"SHADOW_ORTHOGONAL]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "If [code]true[/code], shadow detail is sacrificed in exchange for smoother " -"transitions between splits." +"transitions between splits. Enabling shadow blend splitting also has a " +"moderate performance cost. This is ignored when [member " +"directional_shadow_mode] is [constant SHADOW_ORTHOGONAL]." msgstr "" #: doc/classes/DirectionalLight.xml @@ -19441,7 +19447,11 @@ msgid "" msgstr "" #: doc/classes/DirectionalLight.xml -msgid "The maximum distance for shadow splits." +msgid "" +"The maximum distance for shadow splits. Increasing this value will make " +"directional shadows visible from further away, at the cost of lower overall " +"shadow detail and performance (since more objects need to be included in the " +"directional shadow rendering)." msgstr "" #: doc/classes/DirectionalLight.xml @@ -19458,23 +19468,23 @@ msgstr "" msgid "" "The distance from camera to shadow split 1. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or " -"[code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_2_SPLITS] or [constant " +"SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "The distance from shadow split 1 to split 2. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or " -"[code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_2_SPLITS] or [constant " +"SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "The distance from shadow split 2 to split 3. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml @@ -29820,7 +29830,10 @@ msgid "" "input at the cost of increased CPU usage. In applications where drawing " "freehand lines is required, input accumulation should generally be disabled " "while the user is drawing the line to get results that closely follow the " -"actual input." +"actual input.\n" +"[b]Note:[/b] Input accumulation is [i]disabled[/i] by default for backward " +"compatibility reasons. It is however recommended to enable it for games " +"which don't require very reactive input, as this will decrease CPU usage." msgstr "" #: doc/classes/Input.xml @@ -30394,10 +30407,11 @@ msgstr "" msgid "" "Contains mouse and pen motion information. Supports relative, absolute " "positions and speed. See [method Node._input].\n" -"[b]Note:[/b] By default, this event is only emitted once per frame rendered " -"at most. If you need more precise input reporting, set [member Input." -"use_accumulated_input] to [code]false[/code] to make events emitted as often " -"as possible. If you use InputEventMouseMotion to draw lines, consider " +"[b]Note:[/b] By default, this event can be emitted multiple times per frame " +"rendered, allowing for precise input reporting, at the expense of CPU usage. " +"You can set [member Input.use_accumulated_input] to [code]true[/code] to let " +"multiple events merge into a single emitted event per frame.\n" +"[b]Note:[/b] If you use InputEventMouseMotion to draw lines, consider " "implementing [url=https://en.wikipedia.org/wiki/" "Bresenham%27s_line_algorithm]Bresenham's line algorithm[/url] as well to " "avoid visible gaps in lines if the user is moving the mouse quickly." @@ -30720,6 +30734,11 @@ msgstr "" #: doc/classes/InterpolatedCamera.xml msgid "" +"The camera's process callback. See [enum InterpolatedCameraProcessMode]." +msgstr "" + +#: doc/classes/InterpolatedCamera.xml +msgid "" "How quickly the camera moves toward its target. Higher values will result in " "tighter camera motion." msgstr "" @@ -36120,7 +36139,7 @@ msgid "" "maximum distance is exceeded, it recalculates the ideal path." msgstr "" -#: doc/classes/NavigationAgent.xml doc/classes/NavigationAgent2D.xml +#: doc/classes/NavigationAgent.xml msgid "" "The radius of the avoidance agent. This is the \"body\" of the avoidance " "agent and not the avoidance maneuver starting radius (which is controlled by " @@ -36231,6 +36250,14 @@ msgid "" "least one matching layer." msgstr "" +#: doc/classes/NavigationAgent2D.xml +msgid "" +"The radius of the avoidance agent. This is the \"body\" of the avoidance " +"agent and not the avoidance maneuver starting radius (which is controlled by " +"[member neighbor_dist]).\n" +"Does not affect normal pathfinding." +msgstr "" + #: doc/classes/NavigationMesh.xml msgid "A mesh to approximate the walkable areas and obstacles." msgstr "" @@ -49810,8 +49837,8 @@ msgstr "" #: doc/classes/ProjectSettings.xml msgid "" -"Size for shadow atlas (used for OmniLights and SpotLights). See " -"documentation." +"Size for shadow atlas (used for OmniLights and SpotLights). The value will " +"be rounded up to the nearest power of 2. See shadow mapping documentation." msgstr "" #: doc/classes/ProjectSettings.xml @@ -58180,7 +58207,31 @@ msgstr "" #: doc/classes/String.xml msgid "" "Formats the string by replacing all occurrences of [code]placeholder[/code] " -"with [code]values[/code]." +"with the elements of [code]values[/code].\n" +"[code]values[/code] can be a [Dictionary] or an [Array]. Any underscores in " +"[code]placeholder[/code] will be replaced with the corresponding keys in " +"advance. Array elements use their index as keys.\n" +"[codeblock]\n" +"# Prints: Waiting for Godot is a play by Samuel Beckett, and Godot Engine is " +"named after it.\n" +"var use_array_values = \"Waiting for {0} is a play by {1}, and {0} Engine is " +"named after it.\"\n" +"print(use_array_values.format([\"Godot\", \"Samuel Beckett\"]))\n" +"\n" +"# Prints: User 42 is Godot.\n" +"print(\"User {id} is {name}.\".format({\"id\": 42, \"name\": \"Godot\"}))\n" +"[/codeblock]\n" +"Some additional handling is performed when [code]values[/code] is an array. " +"If [code]placeholder[/code] does not contain an underscore, the elements of " +"the array will be used to replace one occurrence of the placeholder in turn; " +"If an array element is another 2-element array, it'll be interpreted as a " +"key-value pair.\n" +"[codeblock]\n" +"# Prints: User 42 is Godot.\n" +"print(\"User {} is {}.\".format([42, \"Godot\"], \"{}\"))\n" +"print(\"User {id} is {name}.\".format([[\"id\", 42], [\"name\", " +"\"Godot\"]]))\n" +"[/codeblock]" msgstr "" #: doc/classes/String.xml @@ -58777,9 +58828,11 @@ msgstr "" #: doc/classes/StyleBox.xml msgid "" -"Draws this stylebox using a [CanvasItem] with given [RID].\n" -"You can get a [RID] value using [method Object.get_instance_id] on a " -"[CanvasItem]-derived node." +"Draws this stylebox using a canvas item identified by the given [RID].\n" +"The [RID] value can either be the result of [method CanvasItem." +"get_canvas_item] called on an existing [CanvasItem]-derived node, or " +"directly from creating a canvas item in the [VisualServer] with [method " +"VisualServer.canvas_item_create]." msgstr "" #: doc/classes/StyleBox.xml @@ -60316,6 +60369,10 @@ msgid "If [code]true[/code], a right-click displays the context menu." msgstr "" #: doc/classes/TextEdit.xml +msgid "If [code]true[/code], allow drag and drop of selected text." +msgstr "" + +#: doc/classes/TextEdit.xml msgid "" "If [code]true[/code], the \"space\" character will have a visible " "representation." @@ -66390,9 +66447,10 @@ msgstr "" msgid "" "The shadow atlas' resolution (used for omni and spot lights). The value will " "be rounded up to the nearest power of 2.\n" -"[b]Note:[/b] If this is set to 0, shadows won't be visible. Since user-" -"created viewports default to a value of 0, this value must be set above 0 " -"manually." +"[b]Note:[/b] If this is set to [code]0[/code], both point [i]and[/i] " +"directional shadows won't be visible. Since user-created viewports default " +"to a value of [code]0[/code], this value must be set above [code]0[/code] " +"manually (typically at least [code]256[/code])." msgstr "" #: doc/classes/Viewport.xml @@ -66421,7 +66479,11 @@ msgid "" msgstr "" #: doc/classes/Viewport.xml -msgid "The rendering mode of viewport." +msgid "" +"The rendering mode of viewport.\n" +"[b]Note:[/b] If set to [constant USAGE_2D] or [constant " +"USAGE_2D_NO_SAMPLING], [member hdr] will have no effect when enabled since " +"HDR is not supported for 2D." msgstr "" #: doc/classes/Viewport.xml diff --git a/doc/translations/th.po b/doc/translations/th.po index 68c0dd503a..097eae8507 100644 --- a/doc/translations/th.po +++ b/doc/translations/th.po @@ -12246,10 +12246,12 @@ msgid "" msgstr "" #: doc/classes/Camera2D.xml doc/classes/ClippedCamera.xml +#: doc/classes/InterpolatedCamera.xml msgid "The camera updates with the [code]_physics_process[/code] callback." msgstr "" #: doc/classes/Camera2D.xml doc/classes/ClippedCamera.xml +#: doc/classes/InterpolatedCamera.xml msgid "The camera updates with the [code]_process[/code] callback." msgstr "" @@ -19535,13 +19537,17 @@ msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "Amount of extra bias for shadow splits that are far away. If self-shadowing " -"occurs only on the splits far away, increasing this value can fix them." +"occurs only on the splits far away, increasing this value can fix them. This " +"is ignored when [member directional_shadow_mode] is [constant " +"SHADOW_ORTHOGONAL]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "If [code]true[/code], shadow detail is sacrificed in exchange for smoother " -"transitions between splits." +"transitions between splits. Enabling shadow blend splitting also has a " +"moderate performance cost. This is ignored when [member " +"directional_shadow_mode] is [constant SHADOW_ORTHOGONAL]." msgstr "" #: doc/classes/DirectionalLight.xml @@ -19551,7 +19557,11 @@ msgid "" msgstr "" #: doc/classes/DirectionalLight.xml -msgid "The maximum distance for shadow splits." +msgid "" +"The maximum distance for shadow splits. Increasing this value will make " +"directional shadows visible from further away, at the cost of lower overall " +"shadow detail and performance (since more objects need to be included in the " +"directional shadow rendering)." msgstr "" #: doc/classes/DirectionalLight.xml @@ -19568,23 +19578,23 @@ msgstr "" msgid "" "The distance from camera to shadow split 1. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or " -"[code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_2_SPLITS] or [constant " +"SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "The distance from shadow split 1 to split 2. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or " -"[code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_2_SPLITS] or [constant " +"SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "The distance from shadow split 2 to split 3. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml @@ -29961,7 +29971,10 @@ msgid "" "input at the cost of increased CPU usage. In applications where drawing " "freehand lines is required, input accumulation should generally be disabled " "while the user is drawing the line to get results that closely follow the " -"actual input." +"actual input.\n" +"[b]Note:[/b] Input accumulation is [i]disabled[/i] by default for backward " +"compatibility reasons. It is however recommended to enable it for games " +"which don't require very reactive input, as this will decrease CPU usage." msgstr "" #: doc/classes/Input.xml @@ -30551,10 +30564,11 @@ msgstr "" msgid "" "Contains mouse and pen motion information. Supports relative, absolute " "positions and speed. See [method Node._input].\n" -"[b]Note:[/b] By default, this event is only emitted once per frame rendered " -"at most. If you need more precise input reporting, set [member Input." -"use_accumulated_input] to [code]false[/code] to make events emitted as often " -"as possible. If you use InputEventMouseMotion to draw lines, consider " +"[b]Note:[/b] By default, this event can be emitted multiple times per frame " +"rendered, allowing for precise input reporting, at the expense of CPU usage. " +"You can set [member Input.use_accumulated_input] to [code]true[/code] to let " +"multiple events merge into a single emitted event per frame.\n" +"[b]Note:[/b] If you use InputEventMouseMotion to draw lines, consider " "implementing [url=https://en.wikipedia.org/wiki/" "Bresenham%27s_line_algorithm]Bresenham's line algorithm[/url] as well to " "avoid visible gaps in lines if the user is moving the mouse quickly." @@ -30881,6 +30895,11 @@ msgstr "" #: doc/classes/InterpolatedCamera.xml msgid "" +"The camera's process callback. See [enum InterpolatedCameraProcessMode]." +msgstr "" + +#: doc/classes/InterpolatedCamera.xml +msgid "" "How quickly the camera moves toward its target. Higher values will result in " "tighter camera motion." msgstr "" @@ -36308,7 +36327,7 @@ msgid "" "maximum distance is exceeded, it recalculates the ideal path." msgstr "" -#: doc/classes/NavigationAgent.xml doc/classes/NavigationAgent2D.xml +#: doc/classes/NavigationAgent.xml msgid "" "The radius of the avoidance agent. This is the \"body\" of the avoidance " "agent and not the avoidance maneuver starting radius (which is controlled by " @@ -36420,6 +36439,14 @@ msgid "" "least one matching layer." msgstr "" +#: doc/classes/NavigationAgent2D.xml +msgid "" +"The radius of the avoidance agent. This is the \"body\" of the avoidance " +"agent and not the avoidance maneuver starting radius (which is controlled by " +"[member neighbor_dist]).\n" +"Does not affect normal pathfinding." +msgstr "" + #: doc/classes/NavigationMesh.xml msgid "A mesh to approximate the walkable areas and obstacles." msgstr "" @@ -50068,8 +50095,8 @@ msgstr "" #: doc/classes/ProjectSettings.xml msgid "" -"Size for shadow atlas (used for OmniLights and SpotLights). See " -"documentation." +"Size for shadow atlas (used for OmniLights and SpotLights). The value will " +"be rounded up to the nearest power of 2. See shadow mapping documentation." msgstr "" #: doc/classes/ProjectSettings.xml @@ -58444,7 +58471,31 @@ msgstr "" #: doc/classes/String.xml msgid "" "Formats the string by replacing all occurrences of [code]placeholder[/code] " -"with [code]values[/code]." +"with the elements of [code]values[/code].\n" +"[code]values[/code] can be a [Dictionary] or an [Array]. Any underscores in " +"[code]placeholder[/code] will be replaced with the corresponding keys in " +"advance. Array elements use their index as keys.\n" +"[codeblock]\n" +"# Prints: Waiting for Godot is a play by Samuel Beckett, and Godot Engine is " +"named after it.\n" +"var use_array_values = \"Waiting for {0} is a play by {1}, and {0} Engine is " +"named after it.\"\n" +"print(use_array_values.format([\"Godot\", \"Samuel Beckett\"]))\n" +"\n" +"# Prints: User 42 is Godot.\n" +"print(\"User {id} is {name}.\".format({\"id\": 42, \"name\": \"Godot\"}))\n" +"[/codeblock]\n" +"Some additional handling is performed when [code]values[/code] is an array. " +"If [code]placeholder[/code] does not contain an underscore, the elements of " +"the array will be used to replace one occurrence of the placeholder in turn; " +"If an array element is another 2-element array, it'll be interpreted as a " +"key-value pair.\n" +"[codeblock]\n" +"# Prints: User 42 is Godot.\n" +"print(\"User {} is {}.\".format([42, \"Godot\"], \"{}\"))\n" +"print(\"User {id} is {name}.\".format([[\"id\", 42], [\"name\", " +"\"Godot\"]]))\n" +"[/codeblock]" msgstr "" #: doc/classes/String.xml @@ -59041,9 +59092,11 @@ msgstr "" #: doc/classes/StyleBox.xml msgid "" -"Draws this stylebox using a [CanvasItem] with given [RID].\n" -"You can get a [RID] value using [method Object.get_instance_id] on a " -"[CanvasItem]-derived node." +"Draws this stylebox using a canvas item identified by the given [RID].\n" +"The [RID] value can either be the result of [method CanvasItem." +"get_canvas_item] called on an existing [CanvasItem]-derived node, or " +"directly from creating a canvas item in the [VisualServer] with [method " +"VisualServer.canvas_item_create]." msgstr "" #: doc/classes/StyleBox.xml @@ -60584,6 +60637,10 @@ msgid "If [code]true[/code], a right-click displays the context menu." msgstr "" #: doc/classes/TextEdit.xml +msgid "If [code]true[/code], allow drag and drop of selected text." +msgstr "" + +#: doc/classes/TextEdit.xml msgid "" "If [code]true[/code], the \"space\" character will have a visible " "representation." @@ -66671,9 +66728,10 @@ msgstr "" msgid "" "The shadow atlas' resolution (used for omni and spot lights). The value will " "be rounded up to the nearest power of 2.\n" -"[b]Note:[/b] If this is set to 0, shadows won't be visible. Since user-" -"created viewports default to a value of 0, this value must be set above 0 " -"manually." +"[b]Note:[/b] If this is set to [code]0[/code], both point [i]and[/i] " +"directional shadows won't be visible. Since user-created viewports default " +"to a value of [code]0[/code], this value must be set above [code]0[/code] " +"manually (typically at least [code]256[/code])." msgstr "" #: doc/classes/Viewport.xml @@ -66702,7 +66760,11 @@ msgid "" msgstr "" #: doc/classes/Viewport.xml -msgid "The rendering mode of viewport." +msgid "" +"The rendering mode of viewport.\n" +"[b]Note:[/b] If set to [constant USAGE_2D] or [constant " +"USAGE_2D_NO_SAMPLING], [member hdr] will have no effect when enabled since " +"HDR is not supported for 2D." msgstr "" #: doc/classes/Viewport.xml diff --git a/doc/translations/tl.po b/doc/translations/tl.po index 4361ff7318..7473388512 100644 --- a/doc/translations/tl.po +++ b/doc/translations/tl.po @@ -12223,10 +12223,12 @@ msgid "" msgstr "" #: doc/classes/Camera2D.xml doc/classes/ClippedCamera.xml +#: doc/classes/InterpolatedCamera.xml msgid "The camera updates with the [code]_physics_process[/code] callback." msgstr "" #: doc/classes/Camera2D.xml doc/classes/ClippedCamera.xml +#: doc/classes/InterpolatedCamera.xml msgid "The camera updates with the [code]_process[/code] callback." msgstr "" @@ -19508,13 +19510,17 @@ msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "Amount of extra bias for shadow splits that are far away. If self-shadowing " -"occurs only on the splits far away, increasing this value can fix them." +"occurs only on the splits far away, increasing this value can fix them. This " +"is ignored when [member directional_shadow_mode] is [constant " +"SHADOW_ORTHOGONAL]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "If [code]true[/code], shadow detail is sacrificed in exchange for smoother " -"transitions between splits." +"transitions between splits. Enabling shadow blend splitting also has a " +"moderate performance cost. This is ignored when [member " +"directional_shadow_mode] is [constant SHADOW_ORTHOGONAL]." msgstr "" #: doc/classes/DirectionalLight.xml @@ -19524,7 +19530,11 @@ msgid "" msgstr "" #: doc/classes/DirectionalLight.xml -msgid "The maximum distance for shadow splits." +msgid "" +"The maximum distance for shadow splits. Increasing this value will make " +"directional shadows visible from further away, at the cost of lower overall " +"shadow detail and performance (since more objects need to be included in the " +"directional shadow rendering)." msgstr "" #: doc/classes/DirectionalLight.xml @@ -19541,23 +19551,23 @@ msgstr "" msgid "" "The distance from camera to shadow split 1. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or " -"[code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_2_SPLITS] or [constant " +"SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "The distance from shadow split 1 to split 2. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or " -"[code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_2_SPLITS] or [constant " +"SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "The distance from shadow split 2 to split 3. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml @@ -29909,7 +29919,10 @@ msgid "" "input at the cost of increased CPU usage. In applications where drawing " "freehand lines is required, input accumulation should generally be disabled " "while the user is drawing the line to get results that closely follow the " -"actual input." +"actual input.\n" +"[b]Note:[/b] Input accumulation is [i]disabled[/i] by default for backward " +"compatibility reasons. It is however recommended to enable it for games " +"which don't require very reactive input, as this will decrease CPU usage." msgstr "" #: doc/classes/Input.xml @@ -30483,10 +30496,11 @@ msgstr "" msgid "" "Contains mouse and pen motion information. Supports relative, absolute " "positions and speed. See [method Node._input].\n" -"[b]Note:[/b] By default, this event is only emitted once per frame rendered " -"at most. If you need more precise input reporting, set [member Input." -"use_accumulated_input] to [code]false[/code] to make events emitted as often " -"as possible. If you use InputEventMouseMotion to draw lines, consider " +"[b]Note:[/b] By default, this event can be emitted multiple times per frame " +"rendered, allowing for precise input reporting, at the expense of CPU usage. " +"You can set [member Input.use_accumulated_input] to [code]true[/code] to let " +"multiple events merge into a single emitted event per frame.\n" +"[b]Note:[/b] If you use InputEventMouseMotion to draw lines, consider " "implementing [url=https://en.wikipedia.org/wiki/" "Bresenham%27s_line_algorithm]Bresenham's line algorithm[/url] as well to " "avoid visible gaps in lines if the user is moving the mouse quickly." @@ -30809,6 +30823,11 @@ msgstr "" #: doc/classes/InterpolatedCamera.xml msgid "" +"The camera's process callback. See [enum InterpolatedCameraProcessMode]." +msgstr "" + +#: doc/classes/InterpolatedCamera.xml +msgid "" "How quickly the camera moves toward its target. Higher values will result in " "tighter camera motion." msgstr "" @@ -36233,7 +36252,7 @@ msgid "" "maximum distance is exceeded, it recalculates the ideal path." msgstr "" -#: doc/classes/NavigationAgent.xml doc/classes/NavigationAgent2D.xml +#: doc/classes/NavigationAgent.xml msgid "" "The radius of the avoidance agent. This is the \"body\" of the avoidance " "agent and not the avoidance maneuver starting radius (which is controlled by " @@ -36344,6 +36363,14 @@ msgid "" "least one matching layer." msgstr "" +#: doc/classes/NavigationAgent2D.xml +msgid "" +"The radius of the avoidance agent. This is the \"body\" of the avoidance " +"agent and not the avoidance maneuver starting radius (which is controlled by " +"[member neighbor_dist]).\n" +"Does not affect normal pathfinding." +msgstr "" + #: doc/classes/NavigationMesh.xml msgid "A mesh to approximate the walkable areas and obstacles." msgstr "" @@ -49926,8 +49953,8 @@ msgstr "" #: doc/classes/ProjectSettings.xml msgid "" -"Size for shadow atlas (used for OmniLights and SpotLights). See " -"documentation." +"Size for shadow atlas (used for OmniLights and SpotLights). The value will " +"be rounded up to the nearest power of 2. See shadow mapping documentation." msgstr "" #: doc/classes/ProjectSettings.xml @@ -58296,7 +58323,31 @@ msgstr "" #: doc/classes/String.xml msgid "" "Formats the string by replacing all occurrences of [code]placeholder[/code] " -"with [code]values[/code]." +"with the elements of [code]values[/code].\n" +"[code]values[/code] can be a [Dictionary] or an [Array]. Any underscores in " +"[code]placeholder[/code] will be replaced with the corresponding keys in " +"advance. Array elements use their index as keys.\n" +"[codeblock]\n" +"# Prints: Waiting for Godot is a play by Samuel Beckett, and Godot Engine is " +"named after it.\n" +"var use_array_values = \"Waiting for {0} is a play by {1}, and {0} Engine is " +"named after it.\"\n" +"print(use_array_values.format([\"Godot\", \"Samuel Beckett\"]))\n" +"\n" +"# Prints: User 42 is Godot.\n" +"print(\"User {id} is {name}.\".format({\"id\": 42, \"name\": \"Godot\"}))\n" +"[/codeblock]\n" +"Some additional handling is performed when [code]values[/code] is an array. " +"If [code]placeholder[/code] does not contain an underscore, the elements of " +"the array will be used to replace one occurrence of the placeholder in turn; " +"If an array element is another 2-element array, it'll be interpreted as a " +"key-value pair.\n" +"[codeblock]\n" +"# Prints: User 42 is Godot.\n" +"print(\"User {} is {}.\".format([42, \"Godot\"], \"{}\"))\n" +"print(\"User {id} is {name}.\".format([[\"id\", 42], [\"name\", " +"\"Godot\"]]))\n" +"[/codeblock]" msgstr "" #: doc/classes/String.xml @@ -58893,9 +58944,11 @@ msgstr "" #: doc/classes/StyleBox.xml msgid "" -"Draws this stylebox using a [CanvasItem] with given [RID].\n" -"You can get a [RID] value using [method Object.get_instance_id] on a " -"[CanvasItem]-derived node." +"Draws this stylebox using a canvas item identified by the given [RID].\n" +"The [RID] value can either be the result of [method CanvasItem." +"get_canvas_item] called on an existing [CanvasItem]-derived node, or " +"directly from creating a canvas item in the [VisualServer] with [method " +"VisualServer.canvas_item_create]." msgstr "" #: doc/classes/StyleBox.xml @@ -60435,6 +60488,13 @@ msgid "If [code]true[/code], a right-click displays the context menu." msgstr "" #: doc/classes/TextEdit.xml +#, fuzzy +msgid "If [code]true[/code], allow drag and drop of selected text." +msgstr "" +"Kung [code]true[/code], ang mga child nodes ay inaayos, kung hindi ang pag-" +"so-sort ay hindi pinapagana." + +#: doc/classes/TextEdit.xml msgid "" "If [code]true[/code], the \"space\" character will have a visible " "representation." @@ -66515,9 +66575,10 @@ msgstr "" msgid "" "The shadow atlas' resolution (used for omni and spot lights). The value will " "be rounded up to the nearest power of 2.\n" -"[b]Note:[/b] If this is set to 0, shadows won't be visible. Since user-" -"created viewports default to a value of 0, this value must be set above 0 " -"manually." +"[b]Note:[/b] If this is set to [code]0[/code], both point [i]and[/i] " +"directional shadows won't be visible. Since user-created viewports default " +"to a value of [code]0[/code], this value must be set above [code]0[/code] " +"manually (typically at least [code]256[/code])." msgstr "" #: doc/classes/Viewport.xml @@ -66546,7 +66607,11 @@ msgid "" msgstr "" #: doc/classes/Viewport.xml -msgid "The rendering mode of viewport." +msgid "" +"The rendering mode of viewport.\n" +"[b]Note:[/b] If set to [constant USAGE_2D] or [constant " +"USAGE_2D_NO_SAMPLING], [member hdr] will have no effect when enabled since " +"HDR is not supported for 2D." msgstr "" #: doc/classes/Viewport.xml diff --git a/doc/translations/tr.po b/doc/translations/tr.po index 01b71d7673..77fbf5f31a 100644 --- a/doc/translations/tr.po +++ b/doc/translations/tr.po @@ -18,12 +18,14 @@ # yigithan <yigithanermet38@gmail.com>, 2021. # Yusuf Yavuzyigit <yusufyavuzyigit25@gmail.com>, 2021, 2022. # Ramazan Aslan <legendraslan@gmail.com>, 2022. +# paledega <paledega@yandex.ru>, 2022. +# Yekez <yasintonge@gmail.com>, 2022. msgid "" msgstr "" "Project-Id-Version: Godot Engine class reference\n" "Report-Msgid-Bugs-To: https://github.com/godotengine/godot\n" -"PO-Revision-Date: 2022-06-13 03:39+0000\n" -"Last-Translator: Ramazan Aslan <legendraslan@gmail.com>\n" +"PO-Revision-Date: 2022-07-03 00:45+0000\n" +"Last-Translator: Yekez <yasintonge@gmail.com>\n" "Language-Team: Turkish <https://hosted.weblate.org/projects/godot-engine/" "godot-class-reference/tr/>\n" "Language: tr\n" @@ -31,7 +33,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8-bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 4.13-dev\n" +"X-Generator: Weblate 4.13.1-dev\n" #: doc/tools/make_rst.py msgid "Description" @@ -83,7 +85,7 @@ msgstr "Miras:" #: doc/tools/make_rst.py msgid "Inherited By:" -msgstr "" +msgstr "Kalıtılan:" #: doc/tools/make_rst.py msgid "(overrides %s)" @@ -91,19 +93,21 @@ msgstr "" #: doc/tools/make_rst.py msgid "Default" -msgstr "" +msgstr "Varsayılan" #: doc/tools/make_rst.py +#, fuzzy msgid "Setter" -msgstr "" +msgstr "Ayarlayıcı" #: doc/tools/make_rst.py msgid "value" msgstr "değer" #: doc/tools/make_rst.py +#, fuzzy msgid "Getter" -msgstr "" +msgstr "Alıcı" #: doc/tools/make_rst.py msgid "" @@ -129,13 +133,15 @@ msgstr "" #: doc/tools/make_rst.py msgid "This method is used to construct a type." -msgstr "" +msgstr "Bu method bir veri tipi oluşturmak için kullanılır." #: doc/tools/make_rst.py msgid "" "This method doesn't need an instance to be called, so it can be called " "directly using the class name." msgstr "" +"Bu metod çağrılmak için bir örneklemeye ihtiyaç duymaz, bu yüzden doğrudan " +"sınıf adı ile çağırılabilir." #: doc/tools/make_rst.py msgid "" @@ -12925,10 +12931,12 @@ msgid "" msgstr "" #: doc/classes/Camera2D.xml doc/classes/ClippedCamera.xml +#: doc/classes/InterpolatedCamera.xml msgid "The camera updates with the [code]_physics_process[/code] callback." msgstr "" #: doc/classes/Camera2D.xml doc/classes/ClippedCamera.xml +#: doc/classes/InterpolatedCamera.xml msgid "The camera updates with the [code]_process[/code] callback." msgstr "" @@ -20232,13 +20240,17 @@ msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "Amount of extra bias for shadow splits that are far away. If self-shadowing " -"occurs only on the splits far away, increasing this value can fix them." +"occurs only on the splits far away, increasing this value can fix them. This " +"is ignored when [member directional_shadow_mode] is [constant " +"SHADOW_ORTHOGONAL]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "If [code]true[/code], shadow detail is sacrificed in exchange for smoother " -"transitions between splits." +"transitions between splits. Enabling shadow blend splitting also has a " +"moderate performance cost. This is ignored when [member " +"directional_shadow_mode] is [constant SHADOW_ORTHOGONAL]." msgstr "" #: doc/classes/DirectionalLight.xml @@ -20248,7 +20260,11 @@ msgid "" msgstr "" #: doc/classes/DirectionalLight.xml -msgid "The maximum distance for shadow splits." +msgid "" +"The maximum distance for shadow splits. Increasing this value will make " +"directional shadows visible from further away, at the cost of lower overall " +"shadow detail and performance (since more objects need to be included in the " +"directional shadow rendering)." msgstr "" #: doc/classes/DirectionalLight.xml @@ -20265,23 +20281,23 @@ msgstr "" msgid "" "The distance from camera to shadow split 1. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or " -"[code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_2_SPLITS] or [constant " +"SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "The distance from shadow split 1 to split 2. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or " -"[code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_2_SPLITS] or [constant " +"SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "The distance from shadow split 2 to split 3. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml @@ -30657,7 +30673,10 @@ msgid "" "input at the cost of increased CPU usage. In applications where drawing " "freehand lines is required, input accumulation should generally be disabled " "while the user is drawing the line to get results that closely follow the " -"actual input." +"actual input.\n" +"[b]Note:[/b] Input accumulation is [i]disabled[/i] by default for backward " +"compatibility reasons. It is however recommended to enable it for games " +"which don't require very reactive input, as this will decrease CPU usage." msgstr "" #: doc/classes/Input.xml @@ -31231,10 +31250,11 @@ msgstr "" msgid "" "Contains mouse and pen motion information. Supports relative, absolute " "positions and speed. See [method Node._input].\n" -"[b]Note:[/b] By default, this event is only emitted once per frame rendered " -"at most. If you need more precise input reporting, set [member Input." -"use_accumulated_input] to [code]false[/code] to make events emitted as often " -"as possible. If you use InputEventMouseMotion to draw lines, consider " +"[b]Note:[/b] By default, this event can be emitted multiple times per frame " +"rendered, allowing for precise input reporting, at the expense of CPU usage. " +"You can set [member Input.use_accumulated_input] to [code]true[/code] to let " +"multiple events merge into a single emitted event per frame.\n" +"[b]Note:[/b] If you use InputEventMouseMotion to draw lines, consider " "implementing [url=https://en.wikipedia.org/wiki/" "Bresenham%27s_line_algorithm]Bresenham's line algorithm[/url] as well to " "avoid visible gaps in lines if the user is moving the mouse quickly." @@ -31560,6 +31580,11 @@ msgstr "" #: doc/classes/InterpolatedCamera.xml msgid "" +"The camera's process callback. See [enum InterpolatedCameraProcessMode]." +msgstr "" + +#: doc/classes/InterpolatedCamera.xml +msgid "" "How quickly the camera moves toward its target. Higher values will result in " "tighter camera motion." msgstr "" @@ -37003,7 +37028,7 @@ msgid "" "maximum distance is exceeded, it recalculates the ideal path." msgstr "" -#: doc/classes/NavigationAgent.xml doc/classes/NavigationAgent2D.xml +#: doc/classes/NavigationAgent.xml msgid "" "The radius of the avoidance agent. This is the \"body\" of the avoidance " "agent and not the avoidance maneuver starting radius (which is controlled by " @@ -37116,6 +37141,14 @@ msgid "" "least one matching layer." msgstr "" +#: doc/classes/NavigationAgent2D.xml +msgid "" +"The radius of the avoidance agent. This is the \"body\" of the avoidance " +"agent and not the avoidance maneuver starting radius (which is controlled by " +"[member neighbor_dist]).\n" +"Does not affect normal pathfinding." +msgstr "" + #: doc/classes/NavigationMesh.xml msgid "A mesh to approximate the walkable areas and obstacles." msgstr "" @@ -50748,8 +50781,8 @@ msgstr "" #: doc/classes/ProjectSettings.xml msgid "" -"Size for shadow atlas (used for OmniLights and SpotLights). See " -"documentation." +"Size for shadow atlas (used for OmniLights and SpotLights). The value will " +"be rounded up to the nearest power of 2. See shadow mapping documentation." msgstr "" #: doc/classes/ProjectSettings.xml @@ -59131,7 +59164,31 @@ msgstr "" #: doc/classes/String.xml msgid "" "Formats the string by replacing all occurrences of [code]placeholder[/code] " -"with [code]values[/code]." +"with the elements of [code]values[/code].\n" +"[code]values[/code] can be a [Dictionary] or an [Array]. Any underscores in " +"[code]placeholder[/code] will be replaced with the corresponding keys in " +"advance. Array elements use their index as keys.\n" +"[codeblock]\n" +"# Prints: Waiting for Godot is a play by Samuel Beckett, and Godot Engine is " +"named after it.\n" +"var use_array_values = \"Waiting for {0} is a play by {1}, and {0} Engine is " +"named after it.\"\n" +"print(use_array_values.format([\"Godot\", \"Samuel Beckett\"]))\n" +"\n" +"# Prints: User 42 is Godot.\n" +"print(\"User {id} is {name}.\".format({\"id\": 42, \"name\": \"Godot\"}))\n" +"[/codeblock]\n" +"Some additional handling is performed when [code]values[/code] is an array. " +"If [code]placeholder[/code] does not contain an underscore, the elements of " +"the array will be used to replace one occurrence of the placeholder in turn; " +"If an array element is another 2-element array, it'll be interpreted as a " +"key-value pair.\n" +"[codeblock]\n" +"# Prints: User 42 is Godot.\n" +"print(\"User {} is {}.\".format([42, \"Godot\"], \"{}\"))\n" +"print(\"User {id} is {name}.\".format([[\"id\", 42], [\"name\", " +"\"Godot\"]]))\n" +"[/codeblock]" msgstr "" #: doc/classes/String.xml @@ -59728,9 +59785,11 @@ msgstr "" #: doc/classes/StyleBox.xml msgid "" -"Draws this stylebox using a [CanvasItem] with given [RID].\n" -"You can get a [RID] value using [method Object.get_instance_id] on a " -"[CanvasItem]-derived node." +"Draws this stylebox using a canvas item identified by the given [RID].\n" +"The [RID] value can either be the result of [method CanvasItem." +"get_canvas_item] called on an existing [CanvasItem]-derived node, or " +"directly from creating a canvas item in the [VisualServer] with [method " +"VisualServer.canvas_item_create]." msgstr "" #: doc/classes/StyleBox.xml @@ -61277,6 +61336,12 @@ msgid "If [code]true[/code], a right-click displays the context menu." msgstr "" #: doc/classes/TextEdit.xml +#, fuzzy +msgid "If [code]true[/code], allow drag and drop of selected text." +msgstr "" +"Eğer [code]true[/code] ise düğümler sıraya sokulur, yoksa sıraya sokulmaz." + +#: doc/classes/TextEdit.xml msgid "" "If [code]true[/code], the \"space\" character will have a visible " "representation." @@ -67369,9 +67434,10 @@ msgstr "" msgid "" "The shadow atlas' resolution (used for omni and spot lights). The value will " "be rounded up to the nearest power of 2.\n" -"[b]Note:[/b] If this is set to 0, shadows won't be visible. Since user-" -"created viewports default to a value of 0, this value must be set above 0 " -"manually." +"[b]Note:[/b] If this is set to [code]0[/code], both point [i]and[/i] " +"directional shadows won't be visible. Since user-created viewports default " +"to a value of [code]0[/code], this value must be set above [code]0[/code] " +"manually (typically at least [code]256[/code])." msgstr "" #: doc/classes/Viewport.xml @@ -67402,7 +67468,11 @@ msgid "" msgstr "" #: doc/classes/Viewport.xml -msgid "The rendering mode of viewport." +msgid "" +"The rendering mode of viewport.\n" +"[b]Note:[/b] If set to [constant USAGE_2D] or [constant " +"USAGE_2D_NO_SAMPLING], [member hdr] will have no effect when enabled since " +"HDR is not supported for 2D." msgstr "" #: doc/classes/Viewport.xml diff --git a/doc/translations/uk.po b/doc/translations/uk.po index e943465bca..fe1ac7f153 100644 --- a/doc/translations/uk.po +++ b/doc/translations/uk.po @@ -12302,10 +12302,12 @@ msgid "" msgstr "" #: doc/classes/Camera2D.xml doc/classes/ClippedCamera.xml +#: doc/classes/InterpolatedCamera.xml msgid "The camera updates with the [code]_physics_process[/code] callback." msgstr "" #: doc/classes/Camera2D.xml doc/classes/ClippedCamera.xml +#: doc/classes/InterpolatedCamera.xml msgid "The camera updates with the [code]_process[/code] callback." msgstr "" @@ -19604,13 +19606,17 @@ msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "Amount of extra bias for shadow splits that are far away. If self-shadowing " -"occurs only on the splits far away, increasing this value can fix them." +"occurs only on the splits far away, increasing this value can fix them. This " +"is ignored when [member directional_shadow_mode] is [constant " +"SHADOW_ORTHOGONAL]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "If [code]true[/code], shadow detail is sacrificed in exchange for smoother " -"transitions between splits." +"transitions between splits. Enabling shadow blend splitting also has a " +"moderate performance cost. This is ignored when [member " +"directional_shadow_mode] is [constant SHADOW_ORTHOGONAL]." msgstr "" #: doc/classes/DirectionalLight.xml @@ -19620,7 +19626,11 @@ msgid "" msgstr "" #: doc/classes/DirectionalLight.xml -msgid "The maximum distance for shadow splits." +msgid "" +"The maximum distance for shadow splits. Increasing this value will make " +"directional shadows visible from further away, at the cost of lower overall " +"shadow detail and performance (since more objects need to be included in the " +"directional shadow rendering)." msgstr "" #: doc/classes/DirectionalLight.xml @@ -19637,23 +19647,23 @@ msgstr "" msgid "" "The distance from camera to shadow split 1. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or " -"[code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_2_SPLITS] or [constant " +"SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "The distance from shadow split 1 to split 2. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or " -"[code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_2_SPLITS] or [constant " +"SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "The distance from shadow split 2 to split 3. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml @@ -30019,7 +30029,10 @@ msgid "" "input at the cost of increased CPU usage. In applications where drawing " "freehand lines is required, input accumulation should generally be disabled " "while the user is drawing the line to get results that closely follow the " -"actual input." +"actual input.\n" +"[b]Note:[/b] Input accumulation is [i]disabled[/i] by default for backward " +"compatibility reasons. It is however recommended to enable it for games " +"which don't require very reactive input, as this will decrease CPU usage." msgstr "" #: doc/classes/Input.xml @@ -30593,10 +30606,11 @@ msgstr "" msgid "" "Contains mouse and pen motion information. Supports relative, absolute " "positions and speed. See [method Node._input].\n" -"[b]Note:[/b] By default, this event is only emitted once per frame rendered " -"at most. If you need more precise input reporting, set [member Input." -"use_accumulated_input] to [code]false[/code] to make events emitted as often " -"as possible. If you use InputEventMouseMotion to draw lines, consider " +"[b]Note:[/b] By default, this event can be emitted multiple times per frame " +"rendered, allowing for precise input reporting, at the expense of CPU usage. " +"You can set [member Input.use_accumulated_input] to [code]true[/code] to let " +"multiple events merge into a single emitted event per frame.\n" +"[b]Note:[/b] If you use InputEventMouseMotion to draw lines, consider " "implementing [url=https://en.wikipedia.org/wiki/" "Bresenham%27s_line_algorithm]Bresenham's line algorithm[/url] as well to " "avoid visible gaps in lines if the user is moving the mouse quickly." @@ -30920,6 +30934,11 @@ msgstr "" #: doc/classes/InterpolatedCamera.xml msgid "" +"The camera's process callback. See [enum InterpolatedCameraProcessMode]." +msgstr "" + +#: doc/classes/InterpolatedCamera.xml +msgid "" "How quickly the camera moves toward its target. Higher values will result in " "tighter camera motion." msgstr "" @@ -36354,7 +36373,7 @@ msgid "" "maximum distance is exceeded, it recalculates the ideal path." msgstr "" -#: doc/classes/NavigationAgent.xml doc/classes/NavigationAgent2D.xml +#: doc/classes/NavigationAgent.xml msgid "" "The radius of the avoidance agent. This is the \"body\" of the avoidance " "agent and not the avoidance maneuver starting radius (which is controlled by " @@ -36467,6 +36486,14 @@ msgid "" "least one matching layer." msgstr "" +#: doc/classes/NavigationAgent2D.xml +msgid "" +"The radius of the avoidance agent. This is the \"body\" of the avoidance " +"agent and not the avoidance maneuver starting radius (which is controlled by " +"[member neighbor_dist]).\n" +"Does not affect normal pathfinding." +msgstr "" + #: doc/classes/NavigationMesh.xml msgid "A mesh to approximate the walkable areas and obstacles." msgstr "" @@ -50086,8 +50113,8 @@ msgstr "" #: doc/classes/ProjectSettings.xml msgid "" -"Size for shadow atlas (used for OmniLights and SpotLights). See " -"documentation." +"Size for shadow atlas (used for OmniLights and SpotLights). The value will " +"be rounded up to the nearest power of 2. See shadow mapping documentation." msgstr "" #: doc/classes/ProjectSettings.xml @@ -58462,7 +58489,31 @@ msgstr "" #: doc/classes/String.xml msgid "" "Formats the string by replacing all occurrences of [code]placeholder[/code] " -"with [code]values[/code]." +"with the elements of [code]values[/code].\n" +"[code]values[/code] can be a [Dictionary] or an [Array]. Any underscores in " +"[code]placeholder[/code] will be replaced with the corresponding keys in " +"advance. Array elements use their index as keys.\n" +"[codeblock]\n" +"# Prints: Waiting for Godot is a play by Samuel Beckett, and Godot Engine is " +"named after it.\n" +"var use_array_values = \"Waiting for {0} is a play by {1}, and {0} Engine is " +"named after it.\"\n" +"print(use_array_values.format([\"Godot\", \"Samuel Beckett\"]))\n" +"\n" +"# Prints: User 42 is Godot.\n" +"print(\"User {id} is {name}.\".format({\"id\": 42, \"name\": \"Godot\"}))\n" +"[/codeblock]\n" +"Some additional handling is performed when [code]values[/code] is an array. " +"If [code]placeholder[/code] does not contain an underscore, the elements of " +"the array will be used to replace one occurrence of the placeholder in turn; " +"If an array element is another 2-element array, it'll be interpreted as a " +"key-value pair.\n" +"[codeblock]\n" +"# Prints: User 42 is Godot.\n" +"print(\"User {} is {}.\".format([42, \"Godot\"], \"{}\"))\n" +"print(\"User {id} is {name}.\".format([[\"id\", 42], [\"name\", " +"\"Godot\"]]))\n" +"[/codeblock]" msgstr "" #: doc/classes/String.xml @@ -59059,9 +59110,11 @@ msgstr "" #: doc/classes/StyleBox.xml msgid "" -"Draws this stylebox using a [CanvasItem] with given [RID].\n" -"You can get a [RID] value using [method Object.get_instance_id] on a " -"[CanvasItem]-derived node." +"Draws this stylebox using a canvas item identified by the given [RID].\n" +"The [RID] value can either be the result of [method CanvasItem." +"get_canvas_item] called on an existing [CanvasItem]-derived node, or " +"directly from creating a canvas item in the [VisualServer] with [method " +"VisualServer.canvas_item_create]." msgstr "" #: doc/classes/StyleBox.xml @@ -60607,6 +60660,11 @@ msgid "If [code]true[/code], a right-click displays the context menu." msgstr "" #: doc/classes/TextEdit.xml +#, fuzzy +msgid "If [code]true[/code], allow drag and drop of selected text." +msgstr "Повертає косинус параметра." + +#: doc/classes/TextEdit.xml msgid "" "If [code]true[/code], the \"space\" character will have a visible " "representation." @@ -66698,9 +66756,10 @@ msgstr "" msgid "" "The shadow atlas' resolution (used for omni and spot lights). The value will " "be rounded up to the nearest power of 2.\n" -"[b]Note:[/b] If this is set to 0, shadows won't be visible. Since user-" -"created viewports default to a value of 0, this value must be set above 0 " -"manually." +"[b]Note:[/b] If this is set to [code]0[/code], both point [i]and[/i] " +"directional shadows won't be visible. Since user-created viewports default " +"to a value of [code]0[/code], this value must be set above [code]0[/code] " +"manually (typically at least [code]256[/code])." msgstr "" #: doc/classes/Viewport.xml @@ -66729,7 +66788,11 @@ msgid "" msgstr "" #: doc/classes/Viewport.xml -msgid "The rendering mode of viewport." +msgid "" +"The rendering mode of viewport.\n" +"[b]Note:[/b] If set to [constant USAGE_2D] or [constant " +"USAGE_2D_NO_SAMPLING], [member hdr] will have no effect when enabled since " +"HDR is not supported for 2D." msgstr "" #: doc/classes/Viewport.xml diff --git a/doc/translations/vi.po b/doc/translations/vi.po index 81411cebb9..4dbfaf376a 100644 --- a/doc/translations/vi.po +++ b/doc/translations/vi.po @@ -12598,10 +12598,12 @@ msgid "" msgstr "" #: doc/classes/Camera2D.xml doc/classes/ClippedCamera.xml +#: doc/classes/InterpolatedCamera.xml msgid "The camera updates with the [code]_physics_process[/code] callback." msgstr "" #: doc/classes/Camera2D.xml doc/classes/ClippedCamera.xml +#: doc/classes/InterpolatedCamera.xml msgid "The camera updates with the [code]_process[/code] callback." msgstr "" @@ -19903,13 +19905,17 @@ msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "Amount of extra bias for shadow splits that are far away. If self-shadowing " -"occurs only on the splits far away, increasing this value can fix them." +"occurs only on the splits far away, increasing this value can fix them. This " +"is ignored when [member directional_shadow_mode] is [constant " +"SHADOW_ORTHOGONAL]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "If [code]true[/code], shadow detail is sacrificed in exchange for smoother " -"transitions between splits." +"transitions between splits. Enabling shadow blend splitting also has a " +"moderate performance cost. This is ignored when [member " +"directional_shadow_mode] is [constant SHADOW_ORTHOGONAL]." msgstr "" #: doc/classes/DirectionalLight.xml @@ -19919,7 +19925,11 @@ msgid "" msgstr "" #: doc/classes/DirectionalLight.xml -msgid "The maximum distance for shadow splits." +msgid "" +"The maximum distance for shadow splits. Increasing this value will make " +"directional shadows visible from further away, at the cost of lower overall " +"shadow detail and performance (since more objects need to be included in the " +"directional shadow rendering)." msgstr "" #: doc/classes/DirectionalLight.xml @@ -19936,23 +19946,23 @@ msgstr "" msgid "" "The distance from camera to shadow split 1. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or " -"[code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_2_SPLITS] or [constant " +"SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "The distance from shadow split 1 to split 2. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or " -"[code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_2_SPLITS] or [constant " +"SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "The distance from shadow split 2 to split 3. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml @@ -30317,7 +30327,10 @@ msgid "" "input at the cost of increased CPU usage. In applications where drawing " "freehand lines is required, input accumulation should generally be disabled " "while the user is drawing the line to get results that closely follow the " -"actual input." +"actual input.\n" +"[b]Note:[/b] Input accumulation is [i]disabled[/i] by default for backward " +"compatibility reasons. It is however recommended to enable it for games " +"which don't require very reactive input, as this will decrease CPU usage." msgstr "" #: doc/classes/Input.xml @@ -30891,10 +30904,11 @@ msgstr "" msgid "" "Contains mouse and pen motion information. Supports relative, absolute " "positions and speed. See [method Node._input].\n" -"[b]Note:[/b] By default, this event is only emitted once per frame rendered " -"at most. If you need more precise input reporting, set [member Input." -"use_accumulated_input] to [code]false[/code] to make events emitted as often " -"as possible. If you use InputEventMouseMotion to draw lines, consider " +"[b]Note:[/b] By default, this event can be emitted multiple times per frame " +"rendered, allowing for precise input reporting, at the expense of CPU usage. " +"You can set [member Input.use_accumulated_input] to [code]true[/code] to let " +"multiple events merge into a single emitted event per frame.\n" +"[b]Note:[/b] If you use InputEventMouseMotion to draw lines, consider " "implementing [url=https://en.wikipedia.org/wiki/" "Bresenham%27s_line_algorithm]Bresenham's line algorithm[/url] as well to " "avoid visible gaps in lines if the user is moving the mouse quickly." @@ -31219,6 +31233,11 @@ msgstr "Nếu [code]true[/code] thì lật dọc họa tiết." #: doc/classes/InterpolatedCamera.xml msgid "" +"The camera's process callback. See [enum InterpolatedCameraProcessMode]." +msgstr "" + +#: doc/classes/InterpolatedCamera.xml +msgid "" "How quickly the camera moves toward its target. Higher values will result in " "tighter camera motion." msgstr "" @@ -36655,7 +36674,7 @@ msgid "" "maximum distance is exceeded, it recalculates the ideal path." msgstr "" -#: doc/classes/NavigationAgent.xml doc/classes/NavigationAgent2D.xml +#: doc/classes/NavigationAgent.xml msgid "" "The radius of the avoidance agent. This is the \"body\" of the avoidance " "agent and not the avoidance maneuver starting radius (which is controlled by " @@ -36768,6 +36787,14 @@ msgid "" "least one matching layer." msgstr "" +#: doc/classes/NavigationAgent2D.xml +msgid "" +"The radius of the avoidance agent. This is the \"body\" of the avoidance " +"agent and not the avoidance maneuver starting radius (which is controlled by " +"[member neighbor_dist]).\n" +"Does not affect normal pathfinding." +msgstr "" + #: doc/classes/NavigationMesh.xml msgid "A mesh to approximate the walkable areas and obstacles." msgstr "" @@ -50402,8 +50429,8 @@ msgstr "" #: doc/classes/ProjectSettings.xml msgid "" -"Size for shadow atlas (used for OmniLights and SpotLights). See " -"documentation." +"Size for shadow atlas (used for OmniLights and SpotLights). The value will " +"be rounded up to the nearest power of 2. See shadow mapping documentation." msgstr "" #: doc/classes/ProjectSettings.xml @@ -58785,7 +58812,31 @@ msgstr "" #: doc/classes/String.xml msgid "" "Formats the string by replacing all occurrences of [code]placeholder[/code] " -"with [code]values[/code]." +"with the elements of [code]values[/code].\n" +"[code]values[/code] can be a [Dictionary] or an [Array]. Any underscores in " +"[code]placeholder[/code] will be replaced with the corresponding keys in " +"advance. Array elements use their index as keys.\n" +"[codeblock]\n" +"# Prints: Waiting for Godot is a play by Samuel Beckett, and Godot Engine is " +"named after it.\n" +"var use_array_values = \"Waiting for {0} is a play by {1}, and {0} Engine is " +"named after it.\"\n" +"print(use_array_values.format([\"Godot\", \"Samuel Beckett\"]))\n" +"\n" +"# Prints: User 42 is Godot.\n" +"print(\"User {id} is {name}.\".format({\"id\": 42, \"name\": \"Godot\"}))\n" +"[/codeblock]\n" +"Some additional handling is performed when [code]values[/code] is an array. " +"If [code]placeholder[/code] does not contain an underscore, the elements of " +"the array will be used to replace one occurrence of the placeholder in turn; " +"If an array element is another 2-element array, it'll be interpreted as a " +"key-value pair.\n" +"[codeblock]\n" +"# Prints: User 42 is Godot.\n" +"print(\"User {} is {}.\".format([42, \"Godot\"], \"{}\"))\n" +"print(\"User {id} is {name}.\".format([[\"id\", 42], [\"name\", " +"\"Godot\"]]))\n" +"[/codeblock]" msgstr "" #: doc/classes/String.xml @@ -59382,9 +59433,11 @@ msgstr "" #: doc/classes/StyleBox.xml msgid "" -"Draws this stylebox using a [CanvasItem] with given [RID].\n" -"You can get a [RID] value using [method Object.get_instance_id] on a " -"[CanvasItem]-derived node." +"Draws this stylebox using a canvas item identified by the given [RID].\n" +"The [RID] value can either be the result of [method CanvasItem." +"get_canvas_item] called on an existing [CanvasItem]-derived node, or " +"directly from creating a canvas item in the [VisualServer] with [method " +"VisualServer.canvas_item_create]." msgstr "" #: doc/classes/StyleBox.xml @@ -60930,6 +60983,11 @@ msgid "If [code]true[/code], a right-click displays the context menu." msgstr "" #: doc/classes/TextEdit.xml +#, fuzzy +msgid "If [code]true[/code], allow drag and drop of selected text." +msgstr "Nếu [code]true[/code], họa tiết sẽ được căn ở trung tâm." + +#: doc/classes/TextEdit.xml msgid "" "If [code]true[/code], the \"space\" character will have a visible " "representation." @@ -67026,9 +67084,10 @@ msgstr "" msgid "" "The shadow atlas' resolution (used for omni and spot lights). The value will " "be rounded up to the nearest power of 2.\n" -"[b]Note:[/b] If this is set to 0, shadows won't be visible. Since user-" -"created viewports default to a value of 0, this value must be set above 0 " -"manually." +"[b]Note:[/b] If this is set to [code]0[/code], both point [i]and[/i] " +"directional shadows won't be visible. Since user-created viewports default " +"to a value of [code]0[/code], this value must be set above [code]0[/code] " +"manually (typically at least [code]256[/code])." msgstr "" #: doc/classes/Viewport.xml @@ -67058,7 +67117,11 @@ msgid "" msgstr "" #: doc/classes/Viewport.xml -msgid "The rendering mode of viewport." +msgid "" +"The rendering mode of viewport.\n" +"[b]Note:[/b] If set to [constant USAGE_2D] or [constant " +"USAGE_2D_NO_SAMPLING], [member hdr] will have no effect when enabled since " +"HDR is not supported for 2D." msgstr "" #: doc/classes/Viewport.xml diff --git a/doc/translations/zh_CN.po b/doc/translations/zh_CN.po index e39b32f496..2888f15fd1 100644 --- a/doc/translations/zh_CN.po +++ b/doc/translations/zh_CN.po @@ -62,7 +62,7 @@ msgid "" msgstr "" "Project-Id-Version: Godot Engine class reference\n" "Report-Msgid-Bugs-To: https://github.com/godotengine/godot\n" -"PO-Revision-Date: 2022-06-23 04:30+0000\n" +"PO-Revision-Date: 2022-07-05 23:52+0000\n" "Last-Translator: Haoyu Qiu <timothyqiu32@gmail.com>\n" "Language-Team: Chinese (Simplified) <https://hosted.weblate.org/projects/" "godot-engine/godot-class-reference/zh_Hans/>\n" @@ -5171,19 +5171,19 @@ msgstr "" #: doc/classes/AnimatedSprite.xml doc/classes/SpriteBase3D.xml msgid "If [code]true[/code], texture will be centered." -msgstr "为 [code]true[/code] 时纹理将被居中。" +msgstr "如果为 [code]true[/code],纹理将被居中。" #: doc/classes/AnimatedSprite.xml doc/classes/Sprite.xml #: doc/classes/SpriteBase3D.xml doc/classes/TextureButton.xml #: doc/classes/TextureRect.xml msgid "If [code]true[/code], texture is flipped horizontally." -msgstr "为 [code]true[/code] 时纹理将被水平翻转。" +msgstr "如果为 [code]true[/code],纹理将被水平翻转。" #: doc/classes/AnimatedSprite.xml doc/classes/Sprite.xml #: doc/classes/SpriteBase3D.xml doc/classes/TextureButton.xml #: doc/classes/TextureRect.xml msgid "If [code]true[/code], texture is flipped vertically." -msgstr "为 [code]true[/code] 时纹理将被垂直翻转。" +msgstr "如果为 [code]true[/code],纹理将被垂直翻转。" #: doc/classes/AnimatedSprite.xml doc/classes/AnimatedSprite3D.xml msgid "The displayed animation frame's index." @@ -7945,7 +7945,7 @@ msgstr "该区域音频总线的名称。" #: doc/classes/Area.xml doc/classes/Area2D.xml msgid "" "If [code]true[/code], the area's audio bus overrides the default audio bus." -msgstr "为 [code]true[/code] 时该区域的音频总线将覆盖默认的音频总线。" +msgstr "如果为 [code]true[/code],该区域的音频总线将覆盖默认的音频总线。" #: doc/classes/Area.xml msgid "" @@ -7991,13 +7991,14 @@ msgstr "" #: doc/classes/Area.xml doc/classes/Area2D.xml msgid "If [code]true[/code], other monitoring areas can detect this area." -msgstr "为 [code]true[/code] 时其他监测区域可以检测到这个区域。" +msgstr "如果为 [code]true[/code],其他监测区域可以检测到这个区域。" #: doc/classes/Area.xml doc/classes/Area2D.xml msgid "" "If [code]true[/code], the area detects bodies or areas entering and exiting " "it." -msgstr "为 [code]true[/code] 时该区域能够检测到进入和退出该区域的实体或区域。" +msgstr "" +"如果为 [code]true[/code],该区域能够检测到进入和退出该区域的实体或区域。" #: doc/classes/Area.xml doc/classes/Area2D.xml msgid "The area's priority. Higher priority areas are processed first." @@ -8013,7 +8014,7 @@ msgstr "" #: doc/classes/Area.xml msgid "If [code]true[/code], the area applies reverb to its associated audio." -msgstr "为 [code]true[/code] 时该区域会将混响应用于其相关音频。" +msgstr "如果为 [code]true[/code],该区域会将混响应用于其相关音频。" #: doc/classes/Area.xml msgid "The reverb bus name to use for this area's associated audio." @@ -12370,7 +12371,7 @@ msgstr "停止音频。" #: doc/classes/AudioStreamPlayer.xml doc/classes/AudioStreamPlayer2D.xml msgid "If [code]true[/code], audio plays when added to scene tree." -msgstr "为 [code]true[/code] 时在添加到场景树时播放音频。" +msgstr "如果为 [code]true[/code],在添加到场景树时将播放音频。" #: doc/classes/AudioStreamPlayer.xml doc/classes/AudioStreamPlayer2D.xml msgid "Bus on which this audio is playing." @@ -14962,7 +14963,7 @@ msgid "" "without smoothing, even with this setting enabled, invoke [method " "reset_smoothing]." msgstr "" -"为 [code]true[/code] 时,相机会在达到极限时平滑地停止。\n" +"如果为 [code]true[/code],相机会在达到极限时平滑地停止。\n" "当 [member smoothing_enabled] 为 [code]false[/code] 时,该属性无效。\n" "[b]注意:[/b]要立即将相机的位置更新到限制范围内而不进行平滑,即使启用了此设" "置,也要调用 [method reset_smoothing]。" @@ -15003,15 +15004,15 @@ msgstr "相机的过程回调。请参阅[enum Camera2DProcessMode]。" #: doc/classes/Camera2D.xml msgid "If [code]true[/code], the camera view rotates with the target." -msgstr "为 [code]true[/code] 时,相机视图将随目标旋转。" +msgstr "如果为 [code]true[/code],相机视图将随目标旋转。" #: doc/classes/Camera2D.xml msgid "" "If [code]true[/code], the camera smoothly moves towards the target at " "[member smoothing_speed]." msgstr "" -"为 [code]true[/code] 时,相机将以 [member smoothing_speed] 的速度平滑地朝目标" -"移动。" +"如果为 [code]true[/code],相机将以 [member smoothing_speed] 的速度平滑地朝目" +"标移动。" #: doc/classes/Camera2D.xml msgid "" @@ -15045,10 +15046,12 @@ msgid "" msgstr "相机的位置要考虑垂直/水平偏移和屏幕尺寸。" #: doc/classes/Camera2D.xml doc/classes/ClippedCamera.xml +#: doc/classes/InterpolatedCamera.xml msgid "The camera updates with the [code]_physics_process[/code] callback." msgstr "相机通过 [code]_physics_process[/code] 回调进行更新。" #: doc/classes/Camera2D.xml doc/classes/ClippedCamera.xml +#: doc/classes/InterpolatedCamera.xml msgid "The camera updates with the [code]_process[/code] callback." msgstr "相机通过 [code]_process[/code] 回调进行更新。" @@ -16766,11 +16769,11 @@ msgstr "" #: doc/classes/ClippedCamera.xml msgid "If [code]true[/code], the camera stops on contact with [Area]s." -msgstr "为 [code]true[/code] 时,相机将在与 [Area] 接触时停止。" +msgstr "如果为 [code]true[/code],相机将在与 [Area] 接触时停止。" #: doc/classes/ClippedCamera.xml msgid "If [code]true[/code], the camera stops on contact with [PhysicsBody]s." -msgstr "为 [code]true[/code] 时,相机将在与 [PhysicsBody] 接触时停止。" +msgstr "如果为 [code]true[/code],相机将在与 [PhysicsBody] 接触时停止。" #: doc/classes/ClippedCamera.xml msgid "" @@ -21615,7 +21618,7 @@ msgstr "" msgid "" "The [Mesh] used for each particle. If [code]null[/code], particles will be " "spheres." -msgstr "每个粒子使用的 [Mesh]。如果[code]null[/code],则粒子将是球形。" +msgstr "每个粒子使用的 [Mesh]。如果为 [code]null[/code],则粒子将为球形。" #: doc/classes/CPUParticles.xml doc/classes/CPUParticles2D.xml #: doc/classes/Particles2D.xml @@ -21640,7 +21643,7 @@ msgstr "" #: doc/classes/CPUParticles.xml doc/classes/CPUParticles2D.xml msgid "Each particle's orbital velocity will vary along this [Curve]." -msgstr "每个粒子的轨道速度将沿此 [Curve] 变化。" +msgstr "每个粒子的轨道速度将跟随这个 [Curve] 变化。" #: doc/classes/CPUParticles.xml doc/classes/CPUParticles2D.xml #: doc/classes/ParticlesMaterial.xml @@ -21661,7 +21664,7 @@ msgstr "径向加速度应用于每个粒子。使粒子加速远离原点。" #: doc/classes/CPUParticles.xml doc/classes/CPUParticles2D.xml msgid "Each particle's radial acceleration will vary along this [Curve]." -msgstr "每个粒子的径向加速度将沿此 [Curve] 变化。" +msgstr "每个粒子的径向加速度将跟随这个 [Curve] 变化。" #: doc/classes/CPUParticles.xml doc/classes/CPUParticles2D.xml #: doc/classes/ParticlesMaterial.xml @@ -21676,31 +21679,31 @@ msgstr "发射寿命随机率。" #: doc/classes/CPUParticles.xml doc/classes/CPUParticles2D.xml #: doc/classes/ParticlesMaterial.xml msgid "Initial scale applied to each particle." -msgstr "初始比例应用于每个粒子。" +msgstr "每个粒子的初始缩放。" #: doc/classes/CPUParticles.xml doc/classes/CPUParticles2D.xml msgid "Each particle's scale will vary along this [Curve]." -msgstr "每个粒子的比例将随着 [Curve] 的变化而变化。" +msgstr "每个粒子的缩放将跟随这个 [Curve] 变化。" #: doc/classes/CPUParticles.xml doc/classes/CPUParticles2D.xml #: doc/classes/ParticlesMaterial.xml msgid "Scale randomness ratio." -msgstr "标度随机率。" +msgstr "缩放随机率。" #: doc/classes/CPUParticles.xml doc/classes/CPUParticles2D.xml #: doc/classes/Particles2D.xml msgid "" "Particle system's running speed scaling ratio. A value of [code]0[/code] can " "be used to pause the particles." -msgstr "粒子系统的运行速度缩放比例。值[code]0[/code]可用于暂停粒子。" +msgstr "粒子系统的运行速度缩放比例。将值设为 [code]0[/code] 可用于暂停粒子。" #: doc/classes/CPUParticles.xml msgid "" "Each particle's initial direction range from [code]+spread[/code] to [code]-" "spread[/code] degrees. Applied to X/Z plane and Y/Z planes." msgstr "" -"每个粒子的初始方向范围为[code]+spread[/code]至[code]-spread[/code]度。适用于" -"X/Z平面和Y/Z平面。" +"每个粒子的初始方向范围为 [code]+spread[/code] 至 [code]-spread[/code] 度。适" +"用于 X/Z 平面和 Y/Z 平面。" #: doc/classes/CPUParticles.xml doc/classes/CPUParticles2D.xml #: doc/classes/ParticlesMaterial.xml @@ -21713,7 +21716,7 @@ msgstr "" #: doc/classes/CPUParticles.xml doc/classes/CPUParticles2D.xml msgid "Each particle's tangential acceleration will vary along this [Curve]." -msgstr "每个粒子的切向加速度将沿此 [Curve] 变化。" +msgstr "每个粒子的切向加速度将跟随这个 [Curve] 变化。" #: doc/classes/CPUParticles.xml doc/classes/CPUParticles2D.xml #: doc/classes/ParticlesMaterial.xml @@ -21932,23 +21935,23 @@ msgstr "每个粒子的初始颜色。如果定义了 [member texture],它将 msgid "" "Each particle's color will vary along this [Gradient] (multiplied with " "[member color])." -msgstr "每个粒子的颜色将随着这个 [Gradient] 变化,即与 [member color] 相乘。" +msgstr "每个粒子的颜色将随着这个 [Gradient] 变化(与 [member color] 相乘)。" #: doc/classes/CPUParticles2D.xml msgid "" "The rectangle's extents if [member emission_shape] is set to [constant " "EMISSION_SHAPE_RECTANGLE]." msgstr "" -"如果 [member emission_shape] 设置为 [constant EMISSION_SHAPE_RECTANGLE],则矩" -"形的范围。" +"[member emission_shape] 设置为 [constant EMISSION_SHAPE_RECTANGLE] 时,该矩形" +"的范围。" #: doc/classes/CPUParticles2D.xml msgid "" "The sphere's radius if [member emission_shape] is set to [constant " "EMISSION_SHAPE_SPHERE]." msgstr "" -"如果 [member emission_shape] 设置为 [constant EMISSION_SHAPE_SPHERE],则球体" -"的半径。" +"[member emission_shape] 设置为 [constant EMISSION_SHAPE_SPHERE] 时,该球体的" +"半径。" #: doc/classes/CPUParticles2D.xml doc/classes/Particles.xml #: doc/classes/Particles2D.xml @@ -22070,7 +22073,7 @@ msgstr "" " key.save(\"user://generated.key\")\n" " cert.save(\"user://generated.crt\")\n" " # 加密\n" -" var data = \"Some data\"\n" +" var data = \"具体的数据\"\n" " var encrypted = crypto.encrypt(key, data.to_utf8())\n" " # 解密\n" " var decrypted = crypto.decrypt(key, encrypted)\n" @@ -24229,9 +24232,12 @@ msgstr "" "换的世界空间坐标(原点)会被忽略。只会用基来确定光线的方向。" #: doc/classes/DirectionalLight.xml +#, fuzzy msgid "" "Amount of extra bias for shadow splits that are far away. If self-shadowing " -"occurs only on the splits far away, increasing this value can fix them." +"occurs only on the splits far away, increasing this value can fix them. This " +"is ignored when [member directional_shadow_mode] is [constant " +"SHADOW_ORTHOGONAL]." msgstr "" "远处阴影分裂的额外偏置量。如果自身阴影只产生远处的分裂,增加这个值可以修复它" "们。" @@ -24239,9 +24245,10 @@ msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "If [code]true[/code], shadow detail is sacrificed in exchange for smoother " -"transitions between splits." +"transitions between splits. Enabling shadow blend splitting also has a " +"moderate performance cost. This is ignored when [member " +"directional_shadow_mode] is [constant SHADOW_ORTHOGONAL]." msgstr "" -"如果为 [code]true[/code],则会牺牲阴影细节,以换取更平滑的分割之间的过渡。" #: doc/classes/DirectionalLight.xml msgid "" @@ -24250,8 +24257,12 @@ msgid "" msgstr "优化阴影渲染的细节与运动。见 [enum ShadowDepthRange]。" #: doc/classes/DirectionalLight.xml -msgid "The maximum distance for shadow splits." -msgstr "阴影分割的最大距离。" +msgid "" +"The maximum distance for shadow splits. Increasing this value will make " +"directional shadows visible from further away, at the cost of lower overall " +"shadow detail and performance (since more objects need to be included in the " +"directional shadow rendering)." +msgstr "" #: doc/classes/DirectionalLight.xml msgid "The light's shadow rendering algorithm. See [enum ShadowMode]." @@ -24264,32 +24275,35 @@ msgid "" msgstr "当物体垂直于光线时,可用于修复自身阴影的特殊情况。" #: doc/classes/DirectionalLight.xml +#, fuzzy msgid "" "The distance from camera to shadow split 1. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or " -"[code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_2_SPLITS] or [constant " +"SHADOW_PARALLEL_4_SPLITS]." msgstr "" "相机到影子分割1的距离。相对于[member directional_shadow_max_distance]。只有当" "[member directional_shadow_mode]是[code]SHADOW_PARALLEL_2_SPLITS[/code]或" "[code]SHADOW_PARALLEL_4_SPLITS[/code]时才使用。" #: doc/classes/DirectionalLight.xml +#, fuzzy msgid "" "The distance from shadow split 1 to split 2. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or " -"[code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_2_SPLITS] or [constant " +"SHADOW_PARALLEL_4_SPLITS]." msgstr "" "阴影分割1到分割2的距离。相对于[member directional_shadow_max_distance]。仅在" "[member directional_shadow_mode]为[code]SHADOW_PARALLEL_2_SPLITS[/code]或" "[code]SHADOW_PARALLEL_4_SPLITS[/code]时使用。" #: doc/classes/DirectionalLight.xml +#, fuzzy msgid "" "The distance from shadow split 2 to split 3. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_4_SPLITS]." msgstr "" "从影子分割2到分割3的距离。相对于[member directional_shadow_max_distance]。只" "有当[member directional_shadow_mode]为[code]SHADOW_PARALLEL_4_SPLITS[/code]时" @@ -24905,9 +24919,9 @@ msgid "" "control whose size changes over time, unless a pixel art aesthetic is " "desired." msgstr "" -"为 [code]true[/code] 时将使用过滤功能。如果字体过度采样被禁用或无效,这将使字" -"体在缩放时变得模糊,而非像素化。当在尺寸随时变化的控件中使用字体时,建议启用" -"这个功能,除非是像素设计。" +"如果为 [code]true[/code],将使用过滤功能。如果字体过度采样被禁用或无效,这将" +"使字体在缩放时变得模糊,而非像素化。当在尺寸随时变化的控件中使用字体时,建议" +"启用这个功能,除非是像素设计。" #: doc/classes/DynamicFont.xml msgid "" @@ -24915,8 +24929,8 @@ msgid "" "appearance when downscaling it if font oversampling is disabled or " "ineffective." msgstr "" -"为 [code]true[/code] 时将使用 mipmap 多级渐远纹理。在字体过度采样被禁用或无效" -"时,可改善字体缩小时的表现。" +"如果为 [code]true[/code],将使用 mipmap 多级渐远纹理。在字体过度采样被禁用或" +"无效时,可改善字体缩小时的表现。" #: doc/classes/DynamicFont.xml msgid "Spacing at the top." @@ -24950,8 +24964,8 @@ msgid "" "If [code]true[/code], the font is rendered with anti-aliasing. This property " "applies both to the main font and its outline (if it has one)." msgstr "" -"为 [code]true[/code] 时将以抗锯齿方式渲染该字体。此属性既适用于主字体,也适用" -"于其轮廓(如果有)。" +"如果为 [code]true[/code],将以抗锯齿方式渲染该字体。此属性既适用于主字体,也" +"适用于其轮廓(如果有)。" #: doc/classes/DynamicFontData.xml msgid "The path to the vector font file." @@ -26310,8 +26324,8 @@ msgid "" "If [code]true[/code], enables distraction-free mode which hides side docks " "to increase the space available for the main view." msgstr "" -"为 [code]true[/code] 时将启用专注模式,该模式会隐藏侧边面板,增加主视图的可用" -"空间。" +"如果为 [code]true[/code],将启用专注模式,该模式会隐藏侧边面板,增加主视图的" +"可用空间。" #: doc/classes/EditorPlugin.xml msgid "Used by the editor to extend its functionality." @@ -26325,7 +26339,7 @@ msgid "" "editor." msgstr "" "编辑器使用插件来扩展功能。最常见的插件类型是编辑给定的节点或资源类型、导入插" -"件和导出插件。另请参阅[EditorScript]向编辑器添加函数。" +"件和导出插件。另请参阅 [EditorScript] 向编辑器添加函数。" #: doc/classes/EditorPlugin.xml msgid "" @@ -26344,7 +26358,7 @@ msgstr "" "将控件添加到底部面板(包含“输出”“调试”“动画”等)。返回对添加的按钮的引用。您" "可以根据需要隐藏/显示按钮。停用插件后,请确保使用 [method " "remove_control_from_bottom_panel] 移除自定义控件,并使用 [method Node." -"queue_free] 释放。" +"queue_free] 将其释放。" #: doc/classes/EditorPlugin.xml msgid "" @@ -26357,11 +26371,11 @@ msgid "" "with [method remove_control_from_container] and free it with [method Node." "queue_free]." msgstr "" -"将自定义控件添加到容器中(参阅 [enum CustomControlContainer])。在编辑器用户" -"界面中,有许多位置可以添加自定义控件。\n" +"将自定义控件添加到容器中(见 [enum CustomControlContainer])。在编辑器用户界" +"面中,有许多位置可以添加自定义控件。\n" "请记住,您必须自己管理您的自定义控件的可见性(并且很可能在添加后隐藏它)。\n" -"当你的插件停用时,请确保使用 [method remove_control_from_container] 删除你的" -"自定义控件,并使用 [method Node.queue_free] 释放它。" +"当你的插件被停用时,请确保使用 [method remove_control_from_container] 删除你" +"的自定义控件,并使用 [method Node.queue_free] 将其释放。" #: doc/classes/EditorPlugin.xml msgid "" @@ -26535,7 +26549,7 @@ msgstr "" msgid "" "Called by the engine when the user disables the [EditorPlugin] in the Plugin " "tab of the project settings window." -msgstr "当用户在项目设置窗口的插件选项卡中禁用[EditorPlugin]时,由引擎调用。" +msgstr "当用户在项目设置窗口的插件选项卡中禁用 [EditorPlugin] 时,由引擎调用。" #: doc/classes/EditorPlugin.xml msgid "" @@ -26569,8 +26583,8 @@ msgid "" " return false\n" "[/codeblock]" msgstr "" -"当2D编辑器的视窗被更新时,由引擎调用。使用 [code]overlay[/code] [Control] 进" -"行绘制。你可以通过调用 [method update_overlays] 手动更新视窗。\n" +"引擎会在 2D 编辑器的视区发生更新时调用。使用 [code]overlay[/code] [Control] " +"进行绘制。你可以通过调用 [method update_overlays] 手动更新视窗。\n" "[codeblock]\n" "func forward_canvas_draw_over_viewport(overlay):\n" " # 在光标位置画一个圆。\n" @@ -26661,7 +26675,7 @@ msgid "" " return false\n" "[/codeblock]" msgstr "" -"当3D编辑器的视窗被更新时,由引擎调用。使用 [code]overlay[/code] 控件 " +"引擎会在 3D 编辑器的视区发生更新时调用。使用 [code]overlay[/code] 控件 " "[Control] 进行绘制。你可以通过调用 [method update_overlays] 更新覆盖手动更新" "视窗。\n" "[codeblock]\n" @@ -26993,9 +27007,9 @@ msgid "" "inside [method forward_spatial_gui_input]. It might be especially usable if " "your plugin will want to use raycast in the scene." msgstr "" -"如果你想在[method forward_spatial_gui_input]里面接收来自3D视图屏幕的输入,请" -"使用这个方法。如果你的插件想要在场景中使用光线广播,那么这个方法可能特别有" -"用。" +"如果你想在 [method forward_spatial_gui_input] 里面接收来自 3D 视图屏幕的输" +"入,请使用这个方法。如果你的插件想要在场景中使用光线投射,那么这个方法可能特" +"别有用。" #: doc/classes/EditorPlugin.xml msgid "" @@ -28874,7 +28888,7 @@ msgid "" "the editor and when running the project from the editor, but it will " "evaluate to [code]false[/code] when the code is run from an exported project." msgstr "" -"为 [code]true[/code] 时表示该脚本目前正在编辑器内运行。这对 [code]tool[/" +"如果为 [code]true[/code],表示该脚本目前正在编辑器内运行。这对 [code]tool[/" "code] 脚本很有用,可以在特定条件下绘制编辑器辅助内容,或者防止在编辑器中意外" "地运行会影响场景状态的“游戏”代码。\n" "[codeblock]\n" @@ -37613,6 +37627,7 @@ msgid "Controls the mouse mode. See [enum MouseMode] for more information." msgstr "控制鼠标模式。详情请参阅 [enum MouseMode]。" #: doc/classes/Input.xml +#, fuzzy msgid "" "If [code]true[/code], similar input events sent by the operating system are " "accumulated. When input accumulation is enabled, all input events generated " @@ -37623,7 +37638,10 @@ msgid "" "input at the cost of increased CPU usage. In applications where drawing " "freehand lines is required, input accumulation should generally be disabled " "while the user is drawing the line to get results that closely follow the " -"actual input." +"actual input.\n" +"[b]Note:[/b] Input accumulation is [i]disabled[/i] by default for backward " +"compatibility reasons. It is however recommended to enable it for games " +"which don't require very reactive input, as this will decrease CPU usage." msgstr "" "如果为 [code]true[/code],会对操作系统发送的类似输入事件进行累积。当启用输入" "累积时,在一帧中产生的所有输入事件将被合并,并在该帧完成渲染时发出。因此,这" @@ -38355,13 +38373,15 @@ msgid "Input event type for mouse motion events." msgstr "鼠标移动事件的输入事件类型。" #: doc/classes/InputEventMouseMotion.xml +#, fuzzy msgid "" "Contains mouse and pen motion information. Supports relative, absolute " "positions and speed. See [method Node._input].\n" -"[b]Note:[/b] By default, this event is only emitted once per frame rendered " -"at most. If you need more precise input reporting, set [member Input." -"use_accumulated_input] to [code]false[/code] to make events emitted as often " -"as possible. If you use InputEventMouseMotion to draw lines, consider " +"[b]Note:[/b] By default, this event can be emitted multiple times per frame " +"rendered, allowing for precise input reporting, at the expense of CPU usage. " +"You can set [member Input.use_accumulated_input] to [code]true[/code] to let " +"multiple events merge into a single emitted event per frame.\n" +"[b]Note:[/b] If you use InputEventMouseMotion to draw lines, consider " "implementing [url=https://en.wikipedia.org/wiki/" "Bresenham%27s_line_algorithm]Bresenham's line algorithm[/url] as well to " "avoid visible gaps in lines if the user is moving the mouse quickly." @@ -38763,6 +38783,12 @@ msgid "" msgstr "如果为 [code]true[/code],并且设置了目标,相机将自动移动。" #: doc/classes/InterpolatedCamera.xml +#, fuzzy +msgid "" +"The camera's process callback. See [enum InterpolatedCameraProcessMode]." +msgstr "相机的过程回调。请参阅[enum Camera2DProcessMode]。" + +#: doc/classes/InterpolatedCamera.xml msgid "" "How quickly the camera moves toward its target. Higher values will result in " "tighter camera motion." @@ -45389,7 +45415,7 @@ msgstr "" "允许代理偏离理想路径的最大距离。可能为了防撞而产生偏离。超出最大距离时,会重" "新计算理想路径。" -#: doc/classes/NavigationAgent.xml doc/classes/NavigationAgent2D.xml +#: doc/classes/NavigationAgent.xml msgid "" "The radius of the avoidance agent. This is the \"body\" of the avoidance " "agent and not the avoidance maneuver starting radius (which is controlled by " @@ -45522,6 +45548,14 @@ msgstr "" "位域,用于决定该 [NavigationAgent2D] 所属的导航地图层。请求路径时,代理会忽略" "没有任何匹配层的导航网格。" +#: doc/classes/NavigationAgent2D.xml +msgid "" +"The radius of the avoidance agent. This is the \"body\" of the avoidance " +"agent and not the avoidance maneuver starting radius (which is controlled by " +"[member neighbor_dist]).\n" +"Does not affect normal pathfinding." +msgstr "" + #: doc/classes/NavigationMesh.xml msgid "A mesh to approximate the walkable areas and obstacles." msgstr "用于模拟可步行区域和障碍物的网格。" @@ -51787,8 +51821,8 @@ msgid "" "Shows all resources in the game. Optionally, the list can be written to a " "file by specifying a file path in [code]tofile[/code]." msgstr "" -"显示游戏中的所有资源。也可以通过在[code]tofile[/code]中指定文件路径将该列表写" -"入文件。" +"显示游戏中的所有资源。也可以通过在 [code]tofile[/code] 中指定文件路径将该列表" +"写入文件。" #: doc/classes/OS.xml msgid "Shows the list of loaded textures sorted by size in memory." @@ -51808,16 +51842,17 @@ msgid "" "Windows or bounce the dock icon on OSX.\n" "[b]Note:[/b] This method is implemented on Linux, macOS and Windows." msgstr "" -"要求用户注意该窗口。它会在Windows上闪烁任务栏按钮,或在OSX上弹出Dock图标。\n" -"[b]注意:[/b]这个方法在Linux、macOS和Windows上实现。" +"要求用户注意该窗口。它会在 Windows 上闪烁任务栏按钮,或在 OSX 上让 Dock 图标" +"弹跳。\n" +"[b]注意:[/b]这个方法在 Linux、macOS 和 Windows 上实现。" #: doc/classes/OS.xml msgid "" "At the moment this function is only used by [code]AudioDriverOpenSL[/code] " "to request permission for [code]RECORD_AUDIO[/code] on Android." msgstr "" -"目前,这个函数只被[code]AudioDriverOpenSL[/code]用来请求Android上" -"[code]RECORD_AUDIO[/code]的权限。" +"目前,这个函数只被 [code]AudioDriverOpenSL[/code] 用来请求 Android 上 " +"[code]RECORD_AUDIO[/code] 的权限。" #: doc/classes/OS.xml msgid "" @@ -51826,9 +51861,9 @@ msgid "" "applications.\n" "[b]Note:[/b] This method is implemented on Android." msgstr "" -"通过这个功能,你可以申请危险的权限,因为在Android应用程序中,正常的权限会在安" +"你可以通过这个函数申请危险的权限,因为在 Android 应用程序中,正常的权限会在安" "装时自动授予。\n" -"[b]注意:[/b]此方法在Android上实现。" +"[b]注意:[/b]这个方法在 Android 上实现。" #: doc/classes/OS.xml msgid "" @@ -51875,15 +51910,15 @@ msgstr "" "应用程序可以通过使用 [method get_ime_selection] 和 [method get_ime_text] 函数" "来检索组合状态。\n" "输入完成时提交完成的组合字符串。\n" -"[b]注意:[/b]该方法在 Linux、macOS 和 Windows 上实现。" +"[b]注意:[/b]这个方法在 Linux、macOS 和 Windows 上实现。" #: doc/classes/OS.xml msgid "" "Sets position of IME suggestion list popup (in window coordinates).\n" "[b]Note:[/b] This method is implemented on Linux, macOS and Windows." msgstr "" -"设置 IME 建议列表弹出窗口的位置(在窗口坐标中)。\n" -"[b]注意:[/b]此方法在 Linux、macOS 和 Windows 上实现。" +"设置 IME 建议列表弹出窗口的位置(使用窗口坐标)。\n" +"[b]注意:[/b]这个方法在 Linux、macOS 和 Windows 上实现。" #: doc/classes/OS.xml msgid "" @@ -51896,7 +51931,7 @@ msgstr "" "使用多尺寸平台特定图标文件设置游戏的图标(在 Windows 上是 [code]*.ico[/" "code],在 macOS 上是 [code]*.icns[/code])。\n" "适当的大小子图标用于窗口标题、任务栏/程序坞和窗口选择对话框。\n" -"[b]注意:[/b]此方法在 macOS 和 Windows 上实现。" +"[b]注意:[/b]这个方法在 macOS 和 Windows 上实现。" #: doc/classes/OS.xml msgid "Sets the name of the current thread." @@ -51904,7 +51939,7 @@ msgstr "设置当前线程的名称。" #: doc/classes/OS.xml msgid "Enables backup saves if [code]enabled[/code] is [code]true[/code]." -msgstr "如果[code]enabled[/code]为 [code]true[/code],则启用备份保存。" +msgstr "如果 [code]enabled[/code] 为 [code]true[/code],则启用备份保存。" #: doc/classes/OS.xml msgid "" @@ -51912,7 +51947,7 @@ msgid "" "[b]Note:[/b] This method is implemented on Linux, macOS and Windows." msgstr "" "设置窗口是否应始终位于顶部。\n" -"[b]注意:[/b]该方法在 Linux、macOS 和 Windows 上实现。" +"[b]注意:[/b]这个方法在 Linux、macOS 和 Windows 上实现。" #: doc/classes/OS.xml msgid "" @@ -51937,18 +51972,18 @@ msgstr "" "设置窗口的一个接受鼠标事件的多边形区域。该区域外的鼠标事件将被传递出去。\n" "传递一个空数组将禁用穿透支持(所有鼠标事件将被窗口拦截,这是默认行为)。\n" "[codeblock]\n" -"# 设置区域,使用Path2D节点。\n" -"OS.set_window_mouse_passthrough($Path2D.curve.get_baked_points() )\n" +"# 设置区域,使用 Path2D 节点。\n" +"OS.set_window_mouse_passthrough($Path2D.curve.get_baked_points())\n" "\n" -"# 设置区域,使用Polygon2D节点。\n" +"# 设置区域,使用 Polygon2D 节点。\n" "OS.set_window_mouse_passthrough($Polygon2D.polygon)\n" "\n" "# 重置区域为默认值。\n" -"OS.set_window_mouse_passthrough([] )\n" +"OS.set_window_mouse_passthrough([])\n" "[/codeblock]\n" -"[b]注意:[/b]在Windows上,位于区域外的窗口部分不会被绘制,而在Linux和macOS上" -"则会。\n" -"[b]注意:[/b]这个方法在Linux、macOS和Windows上实现。" +"[b]注意:[/b]在 Windows 上,位于区域外的窗口部分不会被绘制,而在 Linux 和 " +"macOS 上则会。\n" +"[b]注意:[/b]这个方法在 Linux、macOS 和 Windows 上实现。" #: doc/classes/OS.xml msgid "" @@ -51960,7 +51995,7 @@ msgstr "" "将窗口标题设置为指定的字符串。\n" "[b]注意:[/b]应该偶尔使用,不要每帧都设置,因为这会对某些窗口管理器的性能产生" "负面影响。\n" -"[b]注意:[/b]该方法在 HTML5、Linux、macOS 和 Windows 上实现。" +"[b]注意:[/b]这个方法在 HTML5、Linux、macOS 和 Windows 上实现。" #: doc/classes/OS.xml msgid "" @@ -51991,7 +52026,7 @@ msgstr "" "[code]mailto[/code] URL 方案[/url]。\n" "可以使用 [method ProjectSettings.globalize_path] 将 [code]res://[/code] 和 " "[code]user://[/code] 路径转换为本方法所使用的系统路径。\n" -"[b]注意:[/b]本方法在 Android、iOS、HTML5、Linux、macOS、以及 Windows 上实" +"[b]注意:[/b]这个方法在 Android、iOS、HTML5、Linux、macOS、以及 Windows 上实" "现。" #: doc/classes/OS.xml @@ -52011,7 +52046,7 @@ msgstr "" "测)。\n" "需要把 [code]multiline[/code] 参数设置为 [code]true[/code] 才能输入多行文本," "如在 [TextEdit] 中。\n" -"[b]注意:[/b]此方法在 Android、iOS 和 UWP 上实现。" +"[b]注意:[/b]这个方法在 Android、iOS 和 UWP 上实现。" #: doc/classes/OS.xml msgid "The clipboard from the host OS. Might be unavailable on some platforms." @@ -52330,27 +52365,27 @@ msgstr "" #: doc/classes/OS.xml msgid "Landscape screen orientation." -msgstr "横向屏幕方向。" +msgstr "横屏方向。" #: doc/classes/OS.xml msgid "Portrait screen orientation." -msgstr "纵向屏幕方向。" +msgstr "竖屏方向。" #: doc/classes/OS.xml msgid "Reverse landscape screen orientation." -msgstr "反转横向屏幕方向。" +msgstr "倒横屏方向。" #: doc/classes/OS.xml msgid "Reverse portrait screen orientation." -msgstr "反转纵向屏幕方向。" +msgstr "倒竖屏方向。" #: doc/classes/OS.xml msgid "Uses landscape or reverse landscape based on the hardware sensor." -msgstr "根据硬件传感器使用横向或反向横向。" +msgstr "根据硬件传感器使用横屏或倒横屏方向。" #: doc/classes/OS.xml msgid "Uses portrait or reverse portrait based on the hardware sensor." -msgstr "根据硬件传感器使用纵向或反向纵向。" +msgstr "根据硬件传感器使用竖屏或倒竖屏。" #: doc/classes/OS.xml msgid "Uses most suitable orientation based on the hardware sensor." @@ -52542,7 +52577,7 @@ msgstr "" #: doc/classes/PackedScene.xml msgid "If passed to [method instance], blocks edits to the scene state." -msgstr "如果传递给[method instance],则阻止对场景状态的编辑。" +msgstr "如果传递给 [method instance],则阻止对场景状态的编辑。" #: doc/classes/PackedScene.xml msgid "" @@ -52561,7 +52596,7 @@ msgid "" msgstr "" "如果传递给 [method instance],向本地场景提供本地场景资源。只有主场景应该接收" "主编辑状态。\n" -"[b]注意:[/b]只在编辑器构建中可用。" +"[b]注意:[/b]仅在编辑器构建中可用。" #: doc/classes/PackedScene.xml msgid "" @@ -52653,10 +52688,10 @@ msgid "" "Do not use this option if the serialized object comes from untrusted sources " "to avoid potential security threats such as remote code execution." msgstr "" -"[i]已废弃。[/i] 你应该使用 [code]get_var[/code] 和 [code]put_var[/code] 参数" -"来代替它。\n" -"如果为 [code]true[/code],多人游戏API将允许在RPC/RSETs期间对对象进行编码和解" -"码。\n" +"[i]已废弃。[/i]你应该使用 [code]get_var[/code] 和 [code]put_var[/code] 参数来" +"代替它。\n" +"如果为 [code]true[/code],多人游戏 API 将允许在 RPC/RSET 期间对对象进行编码和" +"解码。\n" "[b]警告:[/b]反序列化的对象可能包含会被执行的代码。如果序列化的对象来自不受信" "任的来源,请不要使用这个选项,以避免潜在的安全威胁,如远程代码执行。" @@ -52739,17 +52774,17 @@ msgstr "表示当前正在与远程对等方进行握手的 [PacketPeerDTLS] 的 #: doc/classes/PacketPeerDTLS.xml msgid "" "A status representing a [PacketPeerDTLS] that is connected to a remote peer." -msgstr "表示连接到远程对等方的[PacketPeerDTLS]的状态。" +msgstr "表示连接到远程对等方的 [PacketPeerDTLS] 的状态。" #: doc/classes/PacketPeerDTLS.xml msgid "A status representing a [PacketPeerDTLS] in a generic error state." -msgstr "表示处于一般错误状态的[PacketPeerDTLS]的状态。" +msgstr "表示处于一般错误状态的 [PacketPeerDTLS] 的状态。" #: doc/classes/PacketPeerDTLS.xml msgid "" "An error status that shows a mismatch in the DTLS certificate domain " "presented by the host and the domain requested for validation." -msgstr "显示主机提供的DTLS证书域与请求验证的域不匹配的错误状态。" +msgstr "显示主机提供的 DTLS 证书域与请求验证的域不匹配的错误状态。" #: doc/classes/PacketPeerStream.xml msgid "Wrapper to use a PacketPeer over a StreamPeer." @@ -52768,16 +52803,16 @@ msgstr "" #: doc/classes/PacketPeerStream.xml msgid "The wrapped [StreamPeer] object." -msgstr "被·包装的[StreamPeer]对象。" +msgstr "被包装的 [StreamPeer] 对象。" #: doc/classes/PacketPeerUDP.xml msgid "UDP packet peer." -msgstr "UDP数据包客户端。" +msgstr "UDP 数据包客户端。" #: doc/classes/PacketPeerUDP.xml msgid "" "UDP packet peer. Can be used to send raw UDP packets as well as [Variant]s." -msgstr "UDP数据包对等体。可以用来发送原始的UDP数据包以及[Variant]。" +msgstr "UDP 数据包对等体。可以用来发送原始的 UDP 数据包以及 [Variant]。" #: doc/classes/PacketPeerUDP.xml msgid "Closes the UDP socket the [PacketPeerUDP] is currently listening on." @@ -52905,9 +52940,9 @@ msgid "" "[b]Note:[/b] [method set_broadcast_enabled] must be enabled before sending " "packets to a broadcast address (e.g. [code]255.255.255.255[/code])." msgstr "" -"设置发送数据包和变量的目标地址和端口。如果需要,将使用DNS解析一个主机名。\n" +"设置发送数据包和变量的目标地址和端口。如果需要,将使用 DNS 解析主机名。\n" "[b]注意:[/b]在向广播地址(例如:[code]255.255.255.255[/code])发送数据包之" -"前,必须启用[method set_broadcast_enabled]。" +"前,必须启用 [method set_broadcast_enabled]。" #: doc/classes/PacketPeerUDP.xml msgid "" @@ -53047,8 +53082,8 @@ msgid "" "limit, the background will stop scrolling. Must be lower than [member " "scroll_limit_end] to work." msgstr "" -"开始滚动的左上角限制。如果相机超出这个限制,背景将停止滚动。必须低于[member " -"scroll_limit_end]才能工作。" +"开始滚动的左上角限制。如果相机超出这个限制,背景将停止滚动。必须低于 [member " +"scroll_limit_end] 才能工作。" #: doc/classes/ParallaxBackground.xml msgid "" @@ -53056,8 +53091,8 @@ msgid "" "limit, the background will stop scrolling. Must be higher than [member " "scroll_limit_begin] to work." msgstr "" -"右下角限制滚动结束。如果相机超出这个限制,背景将停止滚动。必须高于[member " -"scroll_limit_begin]才能工作。" +"右下角限制滚动结束。如果相机超出这个限制,背景将停止滚动。必须高于 [member " +"scroll_limit_begin] 才能工作。" #: doc/classes/ParallaxBackground.xml msgid "" @@ -53065,8 +53100,8 @@ msgid "" "[Camera2D], but can be used to manually manage scrolling when no camera is " "present." msgstr "" -"视差背景的滚动值。使用[Camera2D]时自动计算,但可用于手动管理无摄像头时的滚" -"动。" +"视差背景的滚动值。使用 [Camera2D] 时会自动计算,但也可用于手动管理无摄像机时" +"的滚动。" #: doc/classes/ParallaxLayer.xml msgid "A parallax scrolling layer to be used with [ParallaxBackground]." @@ -53092,15 +53127,15 @@ msgid "" "scrolling background. If an axis is set to [code]0[/code], the [Texture] " "will not be mirrored." msgstr "" -"视差图层的[Texture]镜像。用于创建无限滚动的背景。如果一个轴被设置为[code]0[/" -"code],[Texture]将不会被镜像。" +"视差图层的 [Texture] 镜像。用于创建无限滚动的背景。如果某个轴被设置为 " +"[code]0[/code],[Texture] 将不会被镜像。" #: doc/classes/ParallaxLayer.xml msgid "" "The ParallaxLayer's offset relative to the parent ParallaxBackground's " "[member ParallaxBackground.scroll_offset]." msgstr "" -"ParallaxLayer 相对于父 ParallaxBackground 的偏移量 [member " +"该 ParallaxLayer 的偏移量,相对于父 ParallaxBackground 的 [member " "ParallaxBackground.scroll_offset]。" #: doc/classes/ParallaxLayer.xml @@ -62852,10 +62887,13 @@ msgid "" msgstr "阴影贴图的细分象限大小。请参阅阴影映射文档。" #: doc/classes/ProjectSettings.xml +#, fuzzy msgid "" -"Size for shadow atlas (used for OmniLights and SpotLights). See " -"documentation." -msgstr "阴影图集的尺寸(用于 OmniLight 和 SpotLight)。见文档。" +"Size for shadow atlas (used for OmniLights and SpotLights). The value will " +"be rounded up to the nearest power of 2. See shadow mapping documentation." +msgstr "" +"设置阴影图集的图像大小(用于全向光和聚光)。该值将被四舍五入到最接近的 2 的" +"幂。" #: doc/classes/ProjectSettings.xml msgid "" @@ -64068,8 +64106,8 @@ msgid "" "queries are required between physics frames (or during the same frame) use " "[method force_raycast_update] after adjusting the raycast." msgstr "" -"RayCast 表示一条从原点到目标位置 [code]cast_to[/code] 的直线。它被用来查询2D" -"空间,以便沿着射线的路径找到最近的物体。\n" +"RayCast 表示一条从原点到目标位置 [code]cast_to[/code] 的直线。它被用来查询 " +"2D 空间,以便沿着射线的路径找到最近的物体。\n" "RayCast2D 可以忽略一些物体,通过 [code]add_exception[/code] 将它们添加到异常" "列表中,通过设置碰撞层进行适当的过滤,或者通过类型掩码过滤物体类型。\n" "RayCast2D 可以被配置为报告 [Area2D]([member collide_with_areas])和 " @@ -66926,11 +66964,12 @@ msgid "" "[code]body[/code] the [Node], if it exists in the tree, of the other " "[PhysicsBody2D] or [TileMap]." msgstr "" -"当与另一个[PhysicsBody2D]或[TileMap]发生碰撞时触发。需要将[member " -"contact_monitor]设置为 [code]true[/code],并且将[member contacts_reported]设" -"置得足够高以检测所有的碰撞。如果[TileSet]有碰撞[Shape2D],就会检测到[TileMap]" -"的。\n" -"[code]body[/code]是其他[PhysicsBody2D]或[TileMap]的[Node],如果它存在于树中。" +"当与另一个 [PhysicsBody2D] 或 [TileMap] 发生碰撞时触发。需要将 [member " +"contact_monitor] 设置为 [code]true[/code],并且将 [member contacts_reported] " +"设置得足够高以检测所有的碰撞。如果[TileSet] 有碰撞 [Shape2D],就会检测到 " +"[TileMap] 的。\n" +"[code]body[/code] 是其他 [PhysicsBody2D] 或 [TileMap] 的 [Node],如果它存在于" +"树中。" #: doc/classes/RigidBody2D.xml msgid "" @@ -67001,20 +67040,22 @@ msgid "" "RigidBody2D used by the [Physics2DServer]. Get the [CollisionShape2D] node " "with [code]self.shape_owner_get_owner(local_shape_index)[/code]." msgstr "" -"当这个RigidBody2D的一个[Shape2D]和另一个[PhysicsBody2D]或[TileMap]的[Shape2D]" -"之间的碰撞结束时触发。要求[member contact_monitor]设置为 [code]true[/code]," -"[member contacts_reported]设置得足够高以检测所有的碰撞。如果[TileSet]有碰撞" -"[Shape2D],就会检测到[TileMap]的。\n" -"[code]body_rid[/code] [Physics2DServer]使用的其他[PhysicsBody2D]或[TileSet]的" -"[CollisionObject2D]的 [RID]。\n" -"[code]body[/code] 另一个[PhysicsBody2D]或[TileMap]的[Node],如果它存在于树" -"中。\n" -"[code]body_shape_index[/code] 由[Physics2DServer]使用的其他[PhysicsBody2D]或" -"[TileMap]的[Shape2D]的索引。用[code]body." -"shape_owner_get_owner(body_shape_index)[/code]获得[CollisionShape2D]节点。\n" -"[code]local_shape_index[/code]这个RigidBody2D的[Shape2D]的索引,由" -"[Physics2DServer]使用。用[code]self.shape_owner_get_owner(local_shape_index)" -"[/code]获取[CollisionShape2D]节点。" +"当这个 RigidBody2D 的一个 [Shape2D] 和另一个 [PhysicsBody2D] 或 [TileMap] 的 " +"[Shape2D] 之间的碰撞结束时触发。要求 [member contact_monitor] 设置为 " +"[code]true[/code],[member contacts_reported] 设置得足够高以检测所有的碰撞。" +"如果 [TileSet] 有碰撞 [Shape2D],就会检测到 [TileMap] 的。\n" +"[code]body_rid[/code] [Physics2DServer] 使用的其他 [PhysicsBody2D] 或 " +"[TileSet] 的 [CollisionObject2D] 的 [RID]。\n" +"[code]body[/code] 另一个 [PhysicsBody2D] 或 [TileMap] 的 [Node],如果它存在于" +"树中。\n" +"[code]body_shape_index[/code] 由 [Physics2DServer] 使用的其他 " +"[PhysicsBody2D] 或 [TileMap] 的 [Shape2D]的索引。用 [code]body." +"shape_owner_get_owner(body_shape_index)[/code] 获得 [CollisionShape2D] 节" +"点。\n" +"[code]local_shape_index[/code] 这个 RigidBody2D 的 [Shape2D] 的索引,由 " +"[Physics2DServer] 使用。用 [code]self." +"shape_owner_get_owner(local_shape_index)[/code] 获取 [CollisionShape2D] 节" +"点。" #: doc/classes/RigidBody2D.xml msgid "" @@ -67032,14 +67073,14 @@ msgstr "静态模式。物体的行为就像一个[StaticBody2D],不会移动 msgid "" "Character mode. Similar to [constant MODE_RIGID], but the body can not " "rotate." -msgstr "角色模式。与[constant MODE_RIGID]类似,但主体不能旋转。" +msgstr "角色模式。与 [constant MODE_RIGID] 类似,但主体不能旋转。" #: doc/classes/RigidBody2D.xml msgid "" "Kinematic mode. The body behaves like a [KinematicBody2D], and must be moved " "by code." msgstr "" -"运动学模式。这个物体的行为就像一个[KinematicBody2D],必须通过代码来移动。" +"运动学模式。这个物体的行为就像一个 [KinematicBody2D],必须通过代码来移动。" #: doc/classes/RigidBody2D.xml msgid "" @@ -67053,14 +67094,13 @@ msgstr "" msgid "" "Continuous collision detection enabled using raycasting. This is faster than " "shapecasting but less precise." -msgstr "使用射线投射启用连续碰撞检测。这比 shapecasting 快,但精度较低。" +msgstr "使用射线投射启用连续碰撞检测。这比形状投射快,但精度较低。" #: doc/classes/RigidBody2D.xml msgid "" "Continuous collision detection enabled using shapecasting. This is the " "slowest CCD method and the most precise." -msgstr "" -"使用 shapecasting 启用连续碰撞检测。这是最慢的 CCD 方法,也是最精确的。" +msgstr "使用形状投射启用连续碰撞检测。这是最慢的 CCD 方法,也是最精确的。" #: doc/classes/Room.xml msgid "Room node, used to group objects together locally for [Portal] culling." @@ -67611,8 +67651,8 @@ msgid "" "scene as the result of [method PackedScene.get_state]." msgstr "" "维护一个与场景相关的资源、节点、导出的和重写的属性以及内置脚本的列表。\n" -"这个类不能直接实例化,它是作为[method PackedScene.get_state]的结果为一个给定" -"的场景检索的。" +"这个类不能直接实例化,它是作为 [method PackedScene.get_state] 的结果为一个给" +"定的场景检索的。" #: doc/classes/SceneState.xml msgid "" @@ -67640,7 +67680,7 @@ msgstr "" #: doc/classes/SceneState.xml msgid "Returns the method connected to the signal at [code]idx[/code]." -msgstr "返回连接到[code]idx[/code]处信号的方法。" +msgstr "返回连接到 [code]idx[/code] 处信号的方法。" #: doc/classes/SceneState.xml msgid "Returns the name of the signal at [code]idx[/code]." @@ -67720,9 +67760,9 @@ msgid "" "If [code]for_parent[/code] is [code]true[/code], returns the path of the " "[code]idx[/code] node's parent instead." msgstr "" -"返回 [code]idx[/code]处的节点的路径。\n" -"如果[code]for_parent[/code]是[code]true[/code],则返回 [code]idx[/code]节点的" -"父节点的路径。" +"返回 [code]idx[/code] 处的节点的路径。\n" +"如果 [code]for_parent[/code] 是 [code]true[/code],则返回 [code]idx[/code] 节" +"点的父节点的路径。" #: doc/classes/SceneState.xml msgid "" @@ -67757,8 +67797,8 @@ msgid "" "Returns [code]true[/code] if the node at [code]idx[/code] is an " "[InstancePlaceholder]." msgstr "" -"如果[code]idx[/code]处的节点是一个[InstancePlaceholder],返回 [code]true[/" -"code]。" +"如果 [code]idx[/code] 处的节点是一个 [InstancePlaceholder],则返回 " +"[code]true[/code]。" #: doc/classes/SceneState.xml msgid "" @@ -67958,7 +67998,7 @@ msgstr "返回此 [SceneTree] 的 [member network_peer] 的唯一对等 ID。" #: doc/classes/SceneTree.xml msgid "Returns the number of nodes in this [SceneTree]." -msgstr "返回此[SceneTree]中的节点数。" +msgstr "返回此 [SceneTree] 中的节点数。" #: doc/classes/SceneTree.xml msgid "Returns a list of all nodes assigned to the given group." @@ -67974,7 +68014,7 @@ msgstr "" #: doc/classes/SceneTree.xml msgid "Returns the sender's peer ID for the most recently received RPC call." -msgstr "返回最近收到的RPC调用的发送者的对等ID。" +msgstr "返回最近收到的 RPC 调用的发送者的对等 ID。" #: doc/classes/SceneTree.xml msgid "Returns [code]true[/code] if the given group exists." @@ -68316,23 +68356,23 @@ msgstr "当 [SceneTree] 层次结构发生变化(移动或重命名子项等 #: doc/classes/SceneTree.xml msgid "Call a group with no flags (default)." -msgstr "调用没有标志的组(默认)。" +msgstr "对组进行调用时,不使用标志(默认)。" #: doc/classes/SceneTree.xml msgid "Call a group in reverse scene order." -msgstr "以相反的场景顺序调用组。" +msgstr "对组进行调用时,使用逆场景序。" #: doc/classes/SceneTree.xml msgid "Call a group immediately (calls are normally made on idle)." -msgstr "立即调用一个组(调用通常在空闲时进行)。" +msgstr "对组进行调用时,立即执行(正常情况下是在空闲时调用的)。" #: doc/classes/SceneTree.xml msgid "Call a group only once even if the call is executed many times." -msgstr "即使调用多次执行,也只调用一次组。" +msgstr "对组进行调用时,即便执行了多次调用也只调用一次。" #: doc/classes/SceneTree.xml msgid "No stretching." -msgstr "未拉伸。" +msgstr "不拉伸。" #: doc/classes/SceneTree.xml msgid "Render stretching in higher resolution (interpolated)." @@ -68342,7 +68382,7 @@ msgstr "以更高的分辨率渲染拉伸(插值)。" msgid "" "Keep the specified display resolution. No interpolation. Content may appear " "pixelated." -msgstr "保持指定的显示分辨率。没有插值。内容可能会出现像素化。" +msgstr "保持指定的显示分辨率。不做插值。内容可能会出现像素化。" #: doc/classes/SceneTree.xml msgid "" @@ -68360,13 +68400,13 @@ msgstr "在任意轴上用黑条填充来保持相同的长宽比。这可以防 msgid "" "Expand vertically. Left/right black bars may appear if the window is too " "wide." -msgstr "垂直展开。如果窗口太宽,可能会出现左/右黑条。" +msgstr "垂直扩展。如果窗口太宽,可能会出现左/右黑条。" #: doc/classes/SceneTree.xml msgid "" "Expand horizontally. Top/bottom black bars may appear if the window is too " "tall." -msgstr "水平展开。如果窗口太高,可能会出现顶部/底部黑条。" +msgstr "水平扩展。如果窗口太高,可能会出现顶部/底部黑条。" #: doc/classes/SceneTree.xml msgid "" @@ -68393,9 +68433,9 @@ msgid "" "The timer will be dereferenced after its time elapses. To preserve the " "timer, you can keep a reference to it. See [Reference]." msgstr "" -"由场景树管理的一次性定时器,它在完成时发[signal timeout] 信号。请参阅 " +"由场景树管理的一次性定时器,它在完成时发 [signal timeout] 信号。另请参阅 " "[method SceneTree.create_timer]。\n" -"与 [Timer] 相反,它不需要实例化节点。常用于创建一次性的延迟定时器,如下面的例" +"与 [Timer] 不同,它不需要实例化节点。常用于创建一次性的延迟定时器,如下面的例" "子:\n" "[codeblock]\n" "func some_function():\n" @@ -73594,9 +73634,32 @@ msgstr "" #: doc/classes/String.xml msgid "" "Formats the string by replacing all occurrences of [code]placeholder[/code] " -"with [code]values[/code]." +"with the elements of [code]values[/code].\n" +"[code]values[/code] can be a [Dictionary] or an [Array]. Any underscores in " +"[code]placeholder[/code] will be replaced with the corresponding keys in " +"advance. Array elements use their index as keys.\n" +"[codeblock]\n" +"# Prints: Waiting for Godot is a play by Samuel Beckett, and Godot Engine is " +"named after it.\n" +"var use_array_values = \"Waiting for {0} is a play by {1}, and {0} Engine is " +"named after it.\"\n" +"print(use_array_values.format([\"Godot\", \"Samuel Beckett\"]))\n" +"\n" +"# Prints: User 42 is Godot.\n" +"print(\"User {id} is {name}.\".format({\"id\": 42, \"name\": \"Godot\"}))\n" +"[/codeblock]\n" +"Some additional handling is performed when [code]values[/code] is an array. " +"If [code]placeholder[/code] does not contain an underscore, the elements of " +"the array will be used to replace one occurrence of the placeholder in turn; " +"If an array element is another 2-element array, it'll be interpreted as a " +"key-value pair.\n" +"[codeblock]\n" +"# Prints: User 42 is Godot.\n" +"print(\"User {} is {}.\".format([42, \"Godot\"], \"{}\"))\n" +"print(\"User {id} is {name}.\".format([[\"id\", 42], [\"name\", " +"\"Godot\"]]))\n" +"[/codeblock]" msgstr "" -"格式化字符串,将所有的 [code]placeholder[/code] 替换为 [code]values[/code]。" #: doc/classes/String.xml msgid "If the string is a valid file path, returns the base directory name." @@ -74414,13 +74477,12 @@ msgstr "" #: doc/classes/StyleBox.xml msgid "" -"Draws this stylebox using a [CanvasItem] with given [RID].\n" -"You can get a [RID] value using [method Object.get_instance_id] on a " -"[CanvasItem]-derived node." +"Draws this stylebox using a canvas item identified by the given [RID].\n" +"The [RID] value can either be the result of [method CanvasItem." +"get_canvas_item] called on an existing [CanvasItem]-derived node, or " +"directly from creating a canvas item in the [VisualServer] with [method " +"VisualServer.canvas_item_create]." msgstr "" -"使用具有给定 [RID] 的 [CanvasItem] 绘制此StyleBox。\n" -"您可以在 [CanvasItem] 派生节点上使用 [method Object.get_instance_id] 获取 " -"[RID] 值。" #: doc/classes/StyleBox.xml msgid "Returns the size of this [StyleBox] without the margins." @@ -76272,6 +76334,11 @@ msgid "If [code]true[/code], a right-click displays the context menu." msgstr "为 [code]true[/code] 时右键单击会显示上下文菜单。" #: doc/classes/TextEdit.xml +#, fuzzy +msgid "If [code]true[/code], allow drag and drop of selected text." +msgstr "如果为 [code]true[/code],则可以选择和编辑该值。" + +#: doc/classes/TextEdit.xml msgid "" "If [code]true[/code], the \"space\" character will have a visible " "representation." @@ -83788,12 +83855,14 @@ msgid "The subdivision amount of the fourth quadrant on the shadow atlas." msgstr "阴影图集上第四象限的细分量。" #: doc/classes/Viewport.xml +#, fuzzy msgid "" "The shadow atlas' resolution (used for omni and spot lights). The value will " "be rounded up to the nearest power of 2.\n" -"[b]Note:[/b] If this is set to 0, shadows won't be visible. Since user-" -"created viewports default to a value of 0, this value must be set above 0 " -"manually." +"[b]Note:[/b] If this is set to [code]0[/code], both point [i]and[/i] " +"directional shadows won't be visible. Since user-created viewports default " +"to a value of [code]0[/code], this value must be set above [code]0[/code] " +"manually (typically at least [code]256[/code])." msgstr "" "阴影图集的分辨率(用于全向光和聚光)。该值将四舍五入到最接近的 2 的幂。\n" "[b]注意:[/b]如果设置为 0,阴影将不可见。由于用户创建的视区默认值为 0,因此必" @@ -83830,8 +83899,12 @@ msgid "" msgstr "如果为 [code]true[/code],该视窗应使其背景渲染为透明。" #: doc/classes/Viewport.xml -msgid "The rendering mode of viewport." -msgstr "视窗的渲染模式。" +msgid "" +"The rendering mode of viewport.\n" +"[b]Note:[/b] If set to [constant USAGE_2D] or [constant " +"USAGE_2D_NO_SAMPLING], [member hdr] will have no effect when enabled since " +"HDR is not supported for 2D." +msgstr "" #: doc/classes/Viewport.xml msgid "" diff --git a/doc/translations/zh_TW.po b/doc/translations/zh_TW.po index 84b16d22a6..63312338fc 100644 --- a/doc/translations/zh_TW.po +++ b/doc/translations/zh_TW.po @@ -12257,10 +12257,12 @@ msgid "" msgstr "" #: doc/classes/Camera2D.xml doc/classes/ClippedCamera.xml +#: doc/classes/InterpolatedCamera.xml msgid "The camera updates with the [code]_physics_process[/code] callback." msgstr "" #: doc/classes/Camera2D.xml doc/classes/ClippedCamera.xml +#: doc/classes/InterpolatedCamera.xml msgid "The camera updates with the [code]_process[/code] callback." msgstr "" @@ -19559,13 +19561,17 @@ msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "Amount of extra bias for shadow splits that are far away. If self-shadowing " -"occurs only on the splits far away, increasing this value can fix them." +"occurs only on the splits far away, increasing this value can fix them. This " +"is ignored when [member directional_shadow_mode] is [constant " +"SHADOW_ORTHOGONAL]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "If [code]true[/code], shadow detail is sacrificed in exchange for smoother " -"transitions between splits." +"transitions between splits. Enabling shadow blend splitting also has a " +"moderate performance cost. This is ignored when [member " +"directional_shadow_mode] is [constant SHADOW_ORTHOGONAL]." msgstr "" #: doc/classes/DirectionalLight.xml @@ -19575,7 +19581,11 @@ msgid "" msgstr "" #: doc/classes/DirectionalLight.xml -msgid "The maximum distance for shadow splits." +msgid "" +"The maximum distance for shadow splits. Increasing this value will make " +"directional shadows visible from further away, at the cost of lower overall " +"shadow detail and performance (since more objects need to be included in the " +"directional shadow rendering)." msgstr "" #: doc/classes/DirectionalLight.xml @@ -19592,23 +19602,23 @@ msgstr "" msgid "" "The distance from camera to shadow split 1. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or " -"[code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_2_SPLITS] or [constant " +"SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "The distance from shadow split 1 to split 2. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_2_SPLITS[/code] or " -"[code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_2_SPLITS] or [constant " +"SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml msgid "" "The distance from shadow split 2 to split 3. Relative to [member " "directional_shadow_max_distance]. Only used when [member " -"directional_shadow_mode] is [code]SHADOW_PARALLEL_4_SPLITS[/code]." +"directional_shadow_mode] is [constant SHADOW_PARALLEL_4_SPLITS]." msgstr "" #: doc/classes/DirectionalLight.xml @@ -29977,7 +29987,10 @@ msgid "" "input at the cost of increased CPU usage. In applications where drawing " "freehand lines is required, input accumulation should generally be disabled " "while the user is drawing the line to get results that closely follow the " -"actual input." +"actual input.\n" +"[b]Note:[/b] Input accumulation is [i]disabled[/i] by default for backward " +"compatibility reasons. It is however recommended to enable it for games " +"which don't require very reactive input, as this will decrease CPU usage." msgstr "" #: doc/classes/Input.xml @@ -30551,10 +30564,11 @@ msgstr "" msgid "" "Contains mouse and pen motion information. Supports relative, absolute " "positions and speed. See [method Node._input].\n" -"[b]Note:[/b] By default, this event is only emitted once per frame rendered " -"at most. If you need more precise input reporting, set [member Input." -"use_accumulated_input] to [code]false[/code] to make events emitted as often " -"as possible. If you use InputEventMouseMotion to draw lines, consider " +"[b]Note:[/b] By default, this event can be emitted multiple times per frame " +"rendered, allowing for precise input reporting, at the expense of CPU usage. " +"You can set [member Input.use_accumulated_input] to [code]true[/code] to let " +"multiple events merge into a single emitted event per frame.\n" +"[b]Note:[/b] If you use InputEventMouseMotion to draw lines, consider " "implementing [url=https://en.wikipedia.org/wiki/" "Bresenham%27s_line_algorithm]Bresenham's line algorithm[/url] as well to " "avoid visible gaps in lines if the user is moving the mouse quickly." @@ -30878,6 +30892,11 @@ msgstr "" #: doc/classes/InterpolatedCamera.xml msgid "" +"The camera's process callback. See [enum InterpolatedCameraProcessMode]." +msgstr "" + +#: doc/classes/InterpolatedCamera.xml +msgid "" "How quickly the camera moves toward its target. Higher values will result in " "tighter camera motion." msgstr "" @@ -36311,7 +36330,7 @@ msgid "" "maximum distance is exceeded, it recalculates the ideal path." msgstr "" -#: doc/classes/NavigationAgent.xml doc/classes/NavigationAgent2D.xml +#: doc/classes/NavigationAgent.xml msgid "" "The radius of the avoidance agent. This is the \"body\" of the avoidance " "agent and not the avoidance maneuver starting radius (which is controlled by " @@ -36424,6 +36443,14 @@ msgid "" "least one matching layer." msgstr "" +#: doc/classes/NavigationAgent2D.xml +msgid "" +"The radius of the avoidance agent. This is the \"body\" of the avoidance " +"agent and not the avoidance maneuver starting radius (which is controlled by " +"[member neighbor_dist]).\n" +"Does not affect normal pathfinding." +msgstr "" + #: doc/classes/NavigationMesh.xml msgid "A mesh to approximate the walkable areas and obstacles." msgstr "" @@ -50041,8 +50068,8 @@ msgstr "" #: doc/classes/ProjectSettings.xml msgid "" -"Size for shadow atlas (used for OmniLights and SpotLights). See " -"documentation." +"Size for shadow atlas (used for OmniLights and SpotLights). The value will " +"be rounded up to the nearest power of 2. See shadow mapping documentation." msgstr "" #: doc/classes/ProjectSettings.xml @@ -58417,7 +58444,31 @@ msgstr "" #: doc/classes/String.xml msgid "" "Formats the string by replacing all occurrences of [code]placeholder[/code] " -"with [code]values[/code]." +"with the elements of [code]values[/code].\n" +"[code]values[/code] can be a [Dictionary] or an [Array]. Any underscores in " +"[code]placeholder[/code] will be replaced with the corresponding keys in " +"advance. Array elements use their index as keys.\n" +"[codeblock]\n" +"# Prints: Waiting for Godot is a play by Samuel Beckett, and Godot Engine is " +"named after it.\n" +"var use_array_values = \"Waiting for {0} is a play by {1}, and {0} Engine is " +"named after it.\"\n" +"print(use_array_values.format([\"Godot\", \"Samuel Beckett\"]))\n" +"\n" +"# Prints: User 42 is Godot.\n" +"print(\"User {id} is {name}.\".format({\"id\": 42, \"name\": \"Godot\"}))\n" +"[/codeblock]\n" +"Some additional handling is performed when [code]values[/code] is an array. " +"If [code]placeholder[/code] does not contain an underscore, the elements of " +"the array will be used to replace one occurrence of the placeholder in turn; " +"If an array element is another 2-element array, it'll be interpreted as a " +"key-value pair.\n" +"[codeblock]\n" +"# Prints: User 42 is Godot.\n" +"print(\"User {} is {}.\".format([42, \"Godot\"], \"{}\"))\n" +"print(\"User {id} is {name}.\".format([[\"id\", 42], [\"name\", " +"\"Godot\"]]))\n" +"[/codeblock]" msgstr "" #: doc/classes/String.xml @@ -59014,9 +59065,11 @@ msgstr "" #: doc/classes/StyleBox.xml msgid "" -"Draws this stylebox using a [CanvasItem] with given [RID].\n" -"You can get a [RID] value using [method Object.get_instance_id] on a " -"[CanvasItem]-derived node." +"Draws this stylebox using a canvas item identified by the given [RID].\n" +"The [RID] value can either be the result of [method CanvasItem." +"get_canvas_item] called on an existing [CanvasItem]-derived node, or " +"directly from creating a canvas item in the [VisualServer] with [method " +"VisualServer.canvas_item_create]." msgstr "" #: doc/classes/StyleBox.xml @@ -60562,6 +60615,11 @@ msgid "If [code]true[/code], a right-click displays the context menu." msgstr "" #: doc/classes/TextEdit.xml +#, fuzzy +msgid "If [code]true[/code], allow drag and drop of selected text." +msgstr "回傳參數的餘弦值。" + +#: doc/classes/TextEdit.xml msgid "" "If [code]true[/code], the \"space\" character will have a visible " "representation." @@ -66655,9 +66713,10 @@ msgstr "" msgid "" "The shadow atlas' resolution (used for omni and spot lights). The value will " "be rounded up to the nearest power of 2.\n" -"[b]Note:[/b] If this is set to 0, shadows won't be visible. Since user-" -"created viewports default to a value of 0, this value must be set above 0 " -"manually." +"[b]Note:[/b] If this is set to [code]0[/code], both point [i]and[/i] " +"directional shadows won't be visible. Since user-created viewports default " +"to a value of [code]0[/code], this value must be set above [code]0[/code] " +"manually (typically at least [code]256[/code])." msgstr "" #: doc/classes/Viewport.xml @@ -66686,7 +66745,11 @@ msgid "" msgstr "" #: doc/classes/Viewport.xml -msgid "The rendering mode of viewport." +msgid "" +"The rendering mode of viewport.\n" +"[b]Note:[/b] If set to [constant USAGE_2D] or [constant " +"USAGE_2D_NO_SAMPLING], [member hdr] will have no effect when enabled since " +"HDR is not supported for 2D." msgstr "" #: doc/classes/Viewport.xml diff --git a/drivers/gles3/environment/fog.cpp b/drivers/gles3/environment/fog.cpp new file mode 100644 index 0000000000..02d88f6871 --- /dev/null +++ b/drivers/gles3/environment/fog.cpp @@ -0,0 +1,66 @@ +/*************************************************************************/ +/* fog.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2022 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. */ +/*************************************************************************/ + +#ifdef GLES3_ENABLED + +#include "fog.h" + +using namespace GLES3; + +/* FOG */ + +RID Fog::fog_volume_allocate() { + return RID(); +} + +void Fog::fog_volume_initialize(RID p_rid) { +} + +void Fog::fog_free(RID p_rid) { +} + +void Fog::fog_volume_set_shape(RID p_fog_volume, RS::FogVolumeShape p_shape) { +} + +void Fog::fog_volume_set_extents(RID p_fog_volume, const Vector3 &p_extents) { +} + +void Fog::fog_volume_set_material(RID p_fog_volume, RID p_material) { +} + +AABB Fog::fog_volume_get_aabb(RID p_fog_volume) const { + return AABB(); +} + +RS::FogVolumeShape Fog::fog_volume_get_shape(RID p_fog_volume) const { + return RS::FOG_VOLUME_SHAPE_BOX; +} + +#endif // GLES3_ENABLED diff --git a/editor/plugins/font_editor_plugin.h b/drivers/gles3/environment/fog.h index 3f0700d880..22bf3bb017 100644 --- a/editor/plugins/font_editor_plugin.h +++ b/drivers/gles3/environment/fog.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* font_editor_plugin.h */ +/* fog.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -28,50 +28,35 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#ifndef FONT_EDITOR_PLUGIN_H -#define FONT_EDITOR_PLUGIN_H +#ifndef FOG_GLES3_H +#define FOG_GLES3_H -#include "editor/editor_plugin.h" -#include "scene/resources/font.h" -#include "scene/resources/text_line.h" +#ifdef GLES3_ENABLED -class FontDataPreview : public Control { - GDCLASS(FontDataPreview, Control); +#include "core/templates/local_vector.h" +#include "core/templates/rid_owner.h" +#include "core/templates/self_list.h" +#include "servers/rendering/environment/renderer_fog.h" -protected: - void _notification(int p_what); - static void _bind_methods(); - - Ref<TextLine> line; +namespace GLES3 { +class Fog : public RendererFog { public: - virtual Size2 get_minimum_size() const override; - - void set_data(const Ref<FontData> &p_data); - - FontDataPreview(); -}; - -/*************************************************************************/ + /* FOG VOLUMES */ -class EditorInspectorPluginFont : public EditorInspectorPlugin { - GDCLASS(EditorInspectorPluginFont, EditorInspectorPlugin); + virtual RID fog_volume_allocate() override; + virtual void fog_volume_initialize(RID p_rid) override; + virtual void fog_free(RID p_rid) override; -public: - virtual bool can_handle(Object *p_object) override; - virtual void parse_begin(Object *p_object) override; - virtual bool parse_property(Object *p_object, const Variant::Type p_type, const String &p_path, const PropertyHint p_hint, const String &p_hint_text, const uint32_t p_usage, const bool p_wide = false) override; + virtual void fog_volume_set_shape(RID p_fog_volume, RS::FogVolumeShape p_shape) override; + virtual void fog_volume_set_extents(RID p_fog_volume, const Vector3 &p_extents) override; + virtual void fog_volume_set_material(RID p_fog_volume, RID p_material) override; + virtual AABB fog_volume_get_aabb(RID p_fog_volume) const override; + virtual RS::FogVolumeShape fog_volume_get_shape(RID p_fog_volume) const override; }; -/*************************************************************************/ - -class FontEditorPlugin : public EditorPlugin { - GDCLASS(FontEditorPlugin, EditorPlugin); +} // namespace GLES3 -public: - FontEditorPlugin(); - - virtual String get_name() const override { return "Font"; } -}; +#endif // GLES3_ENABLED -#endif // FONT_EDITOR_PLUGIN_H +#endif // !FOG_GLES3_H diff --git a/drivers/gles3/environment/gi.cpp b/drivers/gles3/environment/gi.cpp index 98d698b2ae..84cdb81d35 100644 --- a/drivers/gles3/environment/gi.cpp +++ b/drivers/gles3/environment/gi.cpp @@ -126,13 +126,6 @@ bool GI::voxel_gi_is_using_two_bounces(RID p_voxel_gi) const { return false; } -void GI::voxel_gi_set_anisotropy_strength(RID p_voxel_gi, float p_strength) { -} - -float GI::voxel_gi_get_anisotropy_strength(RID p_voxel_gi) const { - return 0; -} - uint32_t GI::voxel_gi_get_version(RID p_voxel_gi) const { return 0; } diff --git a/drivers/gles3/environment/gi.h b/drivers/gles3/environment/gi.h index bff482d7fa..b633520784 100644 --- a/drivers/gles3/environment/gi.h +++ b/drivers/gles3/environment/gi.h @@ -86,9 +86,6 @@ public: virtual void voxel_gi_set_use_two_bounces(RID p_voxel_gi, bool p_enable) override; virtual bool voxel_gi_is_using_two_bounces(RID p_voxel_gi) const override; - virtual void voxel_gi_set_anisotropy_strength(RID p_voxel_gi, float p_strength) override; - virtual float voxel_gi_get_anisotropy_strength(RID p_voxel_gi) const override; - virtual uint32_t voxel_gi_get_version(RID p_voxel_gi) const override; }; diff --git a/drivers/gles3/rasterizer_canvas_gles3.cpp b/drivers/gles3/rasterizer_canvas_gles3.cpp index d41c844d1d..82f7450bc2 100644 --- a/drivers/gles3/rasterizer_canvas_gles3.cpp +++ b/drivers/gles3/rasterizer_canvas_gles3.cpp @@ -34,12 +34,12 @@ #include "core/os/os.h" #include "rasterizer_scene_gles3.h" -#include "rasterizer_storage_gles3.h" #include "core/config/project_settings.h" #include "servers/rendering/rendering_server_default.h" #include "storage/config.h" #include "storage/material_storage.h" +#include "storage/mesh_storage.h" #include "storage/texture_storage.h" #ifndef GLES_OVER_GL @@ -1416,9 +1416,8 @@ RasterizerCanvasGLES3 *RasterizerCanvasGLES3::get_singleton() { return singleton; } -RasterizerCanvasGLES3::RasterizerCanvasGLES3(RasterizerStorageGLES3 *p_storage) { +RasterizerCanvasGLES3::RasterizerCanvasGLES3() { singleton = this; - storage = p_storage; GLES3::MaterialStorage *material_storage = GLES3::MaterialStorage::get_singleton(); GLES3::Config *config = GLES3::Config::get_singleton(); diff --git a/drivers/gles3/rasterizer_canvas_gles3.h b/drivers/gles3/rasterizer_canvas_gles3.h index bf13c91e1c..caf649aaf6 100644 --- a/drivers/gles3/rasterizer_canvas_gles3.h +++ b/drivers/gles3/rasterizer_canvas_gles3.h @@ -34,7 +34,6 @@ #ifdef GLES3_ENABLED #include "rasterizer_scene_gles3.h" -#include "rasterizer_storage_gles3.h" #include "servers/rendering/renderer_canvas_render.h" #include "servers/rendering/renderer_compositor.h" #include "storage/material_storage.h" @@ -204,8 +203,6 @@ public: typedef void Texture; - RasterizerStorageGLES3 *storage = nullptr; - void canvas_begin(RID p_to_render_target, bool p_to_backbuffer); //virtual void draw_window_margins(int *black_margin, RID *black_image) override; @@ -260,7 +257,7 @@ public: void set_time(double p_time); static RasterizerCanvasGLES3 *get_singleton(); - RasterizerCanvasGLES3(RasterizerStorageGLES3 *p_storage); + RasterizerCanvasGLES3(); ~RasterizerCanvasGLES3(); }; diff --git a/drivers/gles3/rasterizer_gles3.cpp b/drivers/gles3/rasterizer_gles3.cpp index 78ffb42557..613a7f37d9 100644 --- a/drivers/gles3/rasterizer_gles3.cpp +++ b/drivers/gles3/rasterizer_gles3.cpp @@ -29,6 +29,7 @@ /*************************************************************************/ #include "rasterizer_gles3.h" +#include "storage/utilities.h" #ifdef GLES3_ENABLED @@ -99,8 +100,9 @@ void RasterizerGLES3::begin_frame(double frame_step) { canvas->set_time(time_total); scene->set_time(time_total, frame_step); - storage->info.render_final = storage->info.render; - storage->info.render.reset(); + GLES3::Utilities *utilities = GLES3::Utilities::get_singleton(); + utilities->info.render_final = utilities->info.render; + utilities->info.render.reset(); //scene->iteration(); } @@ -197,14 +199,15 @@ void RasterizerGLES3::initialize() { void RasterizerGLES3::finalize() { memdelete(scene); memdelete(canvas); - memdelete(storage); memdelete(gi); + memdelete(fog); memdelete(copy_effects); memdelete(light_storage); memdelete(particles_storage); memdelete(mesh_storage); memdelete(material_storage); memdelete(texture_storage); + memdelete(utilities); memdelete(config); } @@ -265,6 +268,7 @@ RasterizerGLES3::RasterizerGLES3() { // OpenGL needs to be initialized before initializing the Rasterizers config = memnew(GLES3::Config); + utilities = memnew(GLES3::Utilities); texture_storage = memnew(GLES3::TextureStorage); material_storage = memnew(GLES3::MaterialStorage); mesh_storage = memnew(GLES3::MeshStorage); @@ -272,9 +276,9 @@ RasterizerGLES3::RasterizerGLES3() { light_storage = memnew(GLES3::LightStorage); copy_effects = memnew(GLES3::CopyEffects); gi = memnew(GLES3::GI); - storage = memnew(RasterizerStorageGLES3); - canvas = memnew(RasterizerCanvasGLES3(storage)); - scene = memnew(RasterizerSceneGLES3(storage)); + fog = memnew(GLES3::Fog); + canvas = memnew(RasterizerCanvasGLES3()); + scene = memnew(RasterizerSceneGLES3()); } RasterizerGLES3::~RasterizerGLES3() { diff --git a/drivers/gles3/rasterizer_gles3.h b/drivers/gles3/rasterizer_gles3.h index c0322dc45b..e842b6d70c 100644 --- a/drivers/gles3/rasterizer_gles3.h +++ b/drivers/gles3/rasterizer_gles3.h @@ -34,10 +34,10 @@ #ifdef GLES3_ENABLED #include "effects/copy_effects.h" +#include "environment/fog.h" #include "environment/gi.h" #include "rasterizer_canvas_gles3.h" #include "rasterizer_scene_gles3.h" -#include "rasterizer_storage_gles3.h" #include "servers/rendering/renderer_compositor.h" #include "storage/config.h" #include "storage/light_storage.h" @@ -45,6 +45,7 @@ #include "storage/mesh_storage.h" #include "storage/particles_storage.h" #include "storage/texture_storage.h" +#include "storage/utilities.h" class RasterizerGLES3 : public RendererCompositor { private: @@ -55,27 +56,29 @@ private: protected: GLES3::Config *config = nullptr; + GLES3::Utilities *utilities = nullptr; GLES3::TextureStorage *texture_storage = nullptr; GLES3::MaterialStorage *material_storage = nullptr; GLES3::MeshStorage *mesh_storage = nullptr; GLES3::ParticlesStorage *particles_storage = nullptr; GLES3::LightStorage *light_storage = nullptr; GLES3::GI *gi = nullptr; + GLES3::Fog *fog = nullptr; GLES3::CopyEffects *copy_effects = nullptr; - RasterizerStorageGLES3 *storage = nullptr; RasterizerCanvasGLES3 *canvas = nullptr; RasterizerSceneGLES3 *scene = nullptr; void _blit_render_target_to_screen(RID p_render_target, DisplayServer::WindowID p_screen, const Rect2 &p_screen_rect); public: + RendererUtilities *get_utilities() { return utilities; } RendererLightStorage *get_light_storage() { return light_storage; } RendererMaterialStorage *get_material_storage() { return material_storage; } RendererMeshStorage *get_mesh_storage() { return mesh_storage; } RendererParticlesStorage *get_particles_storage() { return particles_storage; } RendererTextureStorage *get_texture_storage() { return texture_storage; } RendererGI *get_gi() { return gi; } - RendererStorage *get_storage() { return storage; } + RendererFog *get_fog() { return fog; } RendererCanvasRender *get_canvas() { return canvas; } RendererSceneRender *get_scene() { return scene; } diff --git a/drivers/gles3/rasterizer_scene_gles3.cpp b/drivers/gles3/rasterizer_scene_gles3.cpp index 33c7b9bf32..989d0de496 100644 --- a/drivers/gles3/rasterizer_scene_gles3.cpp +++ b/drivers/gles3/rasterizer_scene_gles3.cpp @@ -33,6 +33,9 @@ #include "core/templates/sort_array.h" #include "servers/rendering/rendering_server_default.h" #include "storage/config.h" +#include "storage/light_storage.h" +#include "storage/mesh_storage.h" +#include "storage/texture_storage.h" #ifdef GLES3_ENABLED @@ -45,7 +48,7 @@ RasterizerSceneGLES3 *RasterizerSceneGLES3::get_singleton() { } RendererSceneRender::GeometryInstance *RasterizerSceneGLES3::geometry_instance_create(RID p_base) { - RS::InstanceType type = storage->get_base_type(p_base); + RS::InstanceType type = RSG::utilities->get_base_type(p_base); ERR_FAIL_COND_V(!((1 << type) & RS::INSTANCE_GEOMETRY_MASK), nullptr); GeometryInstanceGLES3 *ginstance = geometry_instance_alloc.alloc(); @@ -285,16 +288,16 @@ void RasterizerSceneGLES3::_update_dirty_geometry_instances() { } } -void RasterizerSceneGLES3::_geometry_instance_dependency_changed(RendererStorage::DependencyChangedNotification p_notification, RendererStorage::DependencyTracker *p_tracker) { +void RasterizerSceneGLES3::_geometry_instance_dependency_changed(Dependency::DependencyChangedNotification p_notification, DependencyTracker *p_tracker) { switch (p_notification) { - case RendererStorage::DEPENDENCY_CHANGED_MATERIAL: - case RendererStorage::DEPENDENCY_CHANGED_MESH: - case RendererStorage::DEPENDENCY_CHANGED_PARTICLES: - case RendererStorage::DEPENDENCY_CHANGED_MULTIMESH: - case RendererStorage::DEPENDENCY_CHANGED_SKELETON_DATA: { + case Dependency::DEPENDENCY_CHANGED_MATERIAL: + case Dependency::DEPENDENCY_CHANGED_MESH: + case Dependency::DEPENDENCY_CHANGED_PARTICLES: + case Dependency::DEPENDENCY_CHANGED_MULTIMESH: + case Dependency::DEPENDENCY_CHANGED_SKELETON_DATA: { static_cast<RasterizerSceneGLES3 *>(singleton)->_geometry_instance_mark_dirty(static_cast<GeometryInstance *>(p_tracker->userdata)); } break; - case RendererStorage::DEPENDENCY_CHANGED_MULTIMESH_VISIBLE_INSTANCES: { + case Dependency::DEPENDENCY_CHANGED_MULTIMESH_VISIBLE_INSTANCES: { GeometryInstanceGLES3 *ginstance = static_cast<GeometryInstanceGLES3 *>(p_tracker->userdata); if (ginstance->data->base_type == RS::INSTANCE_MULTIMESH) { ginstance->instance_count = GLES3::MeshStorage::get_singleton()->multimesh_get_instances_to_draw(ginstance->data->base); @@ -306,7 +309,7 @@ void RasterizerSceneGLES3::_geometry_instance_dependency_changed(RendererStorage } } -void RasterizerSceneGLES3::_geometry_instance_dependency_deleted(const RID &p_dependency, RendererStorage::DependencyTracker *p_tracker) { +void RasterizerSceneGLES3::_geometry_instance_dependency_deleted(const RID &p_dependency, DependencyTracker *p_tracker) { static_cast<RasterizerSceneGLES3 *>(singleton)->_geometry_instance_mark_dirty(static_cast<GeometryInstance *>(p_tracker->userdata)); } @@ -376,7 +379,7 @@ void RasterizerSceneGLES3::_geometry_instance_add_surface_with_material(Geometry sdcache->surface_index = p_surface; if (ginstance->data->dirty_dependencies) { - storage->base_update_dependency(p_mesh, &ginstance->data->dependency_tracker); + RSG::utilities->base_update_dependency(p_mesh, &ginstance->data->dependency_tracker); } //shadow @@ -1609,10 +1612,10 @@ void RasterizerSceneGLES3::_setup_environment(const RenderDataGLES3 *p_render_da correction.set_depth_correction(p_flip_y); CameraMatrix projection = correction * p_render_data->cam_projection; //store camera into ubo - RasterizerStorageGLES3::store_camera(projection, scene_state.ubo.projection_matrix); - RasterizerStorageGLES3::store_camera(projection.inverse(), scene_state.ubo.inv_projection_matrix); - RasterizerStorageGLES3::store_transform(p_render_data->cam_transform, scene_state.ubo.inv_view_matrix); - RasterizerStorageGLES3::store_transform(p_render_data->inv_cam_transform, scene_state.ubo.view_matrix); + GLES3::MaterialStorage::store_camera(projection, scene_state.ubo.projection_matrix); + GLES3::MaterialStorage::store_camera(projection.inverse(), scene_state.ubo.inv_projection_matrix); + GLES3::MaterialStorage::store_transform(p_render_data->cam_transform, scene_state.ubo.inv_view_matrix); + GLES3::MaterialStorage::store_transform(p_render_data->inv_cam_transform, scene_state.ubo.view_matrix); scene_state.ubo.directional_light_count = p_render_data->directional_light_count; @@ -1659,7 +1662,7 @@ void RasterizerSceneGLES3::_setup_environment(const RenderDataGLES3 *p_render_da Basis sky_transform = env->sky_orientation; sky_transform = sky_transform.inverse() * p_render_data->cam_transform.basis; - RasterizerStorageGLES3::store_transform_3x3(sky_transform, scene_state.ubo.radiance_inverse_xform); + GLES3::MaterialStorage::store_transform_3x3(sky_transform, scene_state.ubo.radiance_inverse_xform); scene_state.ubo.use_ambient_cubemap = (ambient_src == RS::ENV_AMBIENT_SOURCE_BG && env_bg == RS::ENV_BG_SKY) || ambient_src == RS::ENV_AMBIENT_SOURCE_SKY; scene_state.ubo.use_ambient_light = scene_state.ubo.use_ambient_cubemap || ambient_src == RS::ENV_AMBIENT_SOURCE_COLOR; } @@ -1974,7 +1977,7 @@ void RasterizerSceneGLES3::render_scene(RID p_render_buffers, const CameraData * if (p_render_buffers.is_valid()) { clear_color = texture_storage->render_target_get_clear_request_color(rb->render_target); } else { - clear_color = storage->get_default_clear_color(); + clear_color = texture_storage->get_default_clear_color(); } Environment *env = environment_owner.get_or_null(p_environment); @@ -2657,12 +2660,10 @@ void RasterizerSceneGLES3::decals_set_filter(RS::DecalFilter p_filter) { void RasterizerSceneGLES3::light_projectors_set_filter(RS::LightProjectorFilter p_filter) { } -RasterizerSceneGLES3::RasterizerSceneGLES3(RasterizerStorageGLES3 *p_storage) { +RasterizerSceneGLES3::RasterizerSceneGLES3() { GLES3::MaterialStorage *material_storage = GLES3::MaterialStorage::get_singleton(); GLES3::Config *config = GLES3::Config::get_singleton(); - storage = p_storage; - { // Setup Lights @@ -2870,15 +2871,15 @@ RasterizerSceneGLES3::~RasterizerSceneGLES3() { // Scene Shader GLES3::MaterialStorage::get_singleton()->shaders.scene_shader.version_free(scene_globals.shader_default_version); GLES3::MaterialStorage::get_singleton()->shaders.cubemap_filter_shader.version_free(scene_globals.cubemap_filter_shader_version); - storage->free(scene_globals.default_material); - storage->free(scene_globals.default_shader); + RSG::material_storage->material_free(scene_globals.default_material); + RSG::material_storage->shader_free(scene_globals.default_shader); // Sky Shader GLES3::MaterialStorage::get_singleton()->shaders.sky_shader.version_free(sky_globals.shader_default_version); - storage->free(sky_globals.default_material); - storage->free(sky_globals.default_shader); - storage->free(sky_globals.fog_material); - storage->free(sky_globals.fog_shader); + RSG::material_storage->material_free(sky_globals.default_material); + RSG::material_storage->shader_free(sky_globals.default_shader); + RSG::material_storage->material_free(sky_globals.fog_material); + RSG::material_storage->shader_free(sky_globals.fog_shader); glDeleteBuffers(1, &sky_globals.screen_triangle); glDeleteVertexArrays(1, &sky_globals.screen_triangle_array); glDeleteTextures(1, &sky_globals.radical_inverse_vdc_cache_tex); diff --git a/drivers/gles3/rasterizer_scene_gles3.h b/drivers/gles3/rasterizer_scene_gles3.h index 4757a3f161..53b76011fe 100644 --- a/drivers/gles3/rasterizer_scene_gles3.h +++ b/drivers/gles3/rasterizer_scene_gles3.h @@ -37,7 +37,6 @@ #include "core/templates/paged_allocator.h" #include "core/templates/rid_owner.h" #include "core/templates/self_list.h" -#include "rasterizer_storage_gles3.h" #include "scene/resources/mesh.h" #include "servers/rendering/renderer_compositor.h" #include "servers/rendering/renderer_scene_render.h" @@ -45,6 +44,8 @@ #include "shader_gles3.h" #include "shaders/cubemap_filter.glsl.gen.h" #include "shaders/sky.glsl.gen.h" +#include "storage/material_storage.h" +#include "storage/utilities.h" enum RenderListType { RENDER_LIST_OPAQUE, //used for opaque objects @@ -125,7 +126,6 @@ struct RenderDataGLES3 { RendererScene::RenderInfo *render_info = nullptr; }; -class RasterizerStorageGLES3; class RasterizerCanvasGLES3; class RasterizerSceneGLES3 : public RendererSceneRender { @@ -323,7 +323,7 @@ private: bool mirror = false; bool dirty_dependencies = false; - RendererStorage::DependencyTracker dependency_tracker; + DependencyTracker dependency_tracker; }; Data *data = nullptr; @@ -345,8 +345,8 @@ private: INSTANCE_DATA_FLAG_MULTIMESH_HAS_CUSTOM_DATA = 1 << 15, }; - static void _geometry_instance_dependency_changed(RendererStorage::DependencyChangedNotification p_notification, RendererStorage::DependencyTracker *p_tracker); - static void _geometry_instance_dependency_deleted(const RID &p_dependency, RendererStorage::DependencyTracker *p_tracker); + static void _geometry_instance_dependency_changed(Dependency::DependencyChangedNotification p_notification, DependencyTracker *p_tracker); + static void _geometry_instance_dependency_deleted(const RID &p_dependency, DependencyTracker *p_tracker); SelfList<GeometryInstanceGLES3>::List geometry_instance_dirty_list; @@ -739,7 +739,6 @@ protected: void _free_sky_data(Sky *p_sky); public: - RasterizerStorageGLES3 *storage; RasterizerCanvasGLES3 *canvas; GeometryInstance *geometry_instance_create(RID p_base) override; @@ -943,7 +942,7 @@ public: void light_projectors_set_filter(RS::LightProjectorFilter p_filter) override; static RasterizerSceneGLES3 *get_singleton(); - RasterizerSceneGLES3(RasterizerStorageGLES3 *p_storage); + RasterizerSceneGLES3(); ~RasterizerSceneGLES3(); }; diff --git a/drivers/gles3/rasterizer_storage_gles3.cpp b/drivers/gles3/rasterizer_storage_gles3.cpp deleted file mode 100644 index 3b80d88666..0000000000 --- a/drivers/gles3/rasterizer_storage_gles3.cpp +++ /dev/null @@ -1,569 +0,0 @@ -/*************************************************************************/ -/* rasterizer_storage_gles3.cpp */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* https://godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur. */ -/* Copyright (c) 2014-2022 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 "rasterizer_storage_gles3.h" - -#ifdef GLES3_ENABLED - -#include "core/config/project_settings.h" -#include "core/math/transform_3d.h" -// #include "rasterizer_canvas_gles3.h" -#include "rasterizer_scene_gles3.h" -#include "servers/rendering/shader_language.h" - -/* MISC */ - -void RasterizerStorageGLES3::base_update_dependency(RID p_base, DependencyTracker *p_instance) { - if (GLES3::MeshStorage::get_singleton()->owns_mesh(p_base)) { - GLES3::Mesh *mesh = GLES3::MeshStorage::get_singleton()->get_mesh(p_base); - p_instance->update_dependency(&mesh->dependency); - } else if (GLES3::MeshStorage::get_singleton()->owns_multimesh(p_base)) { - GLES3::MultiMesh *multimesh = GLES3::MeshStorage::get_singleton()->get_multimesh(p_base); - p_instance->update_dependency(&multimesh->dependency); - if (multimesh->mesh.is_valid()) { - base_update_dependency(multimesh->mesh, p_instance); - } - } else if (GLES3::LightStorage::get_singleton()->owns_light(p_base)) { - GLES3::Light *l = GLES3::LightStorage::get_singleton()->get_light(p_base); - p_instance->update_dependency(&l->dependency); - } -} - -Vector<uint8_t> RasterizerStorageGLES3::buffer_get_data(GLenum p_target, GLuint p_buffer, uint32_t p_buffer_size) { - Vector<uint8_t> ret; - ret.resize(p_buffer_size); - glBindBuffer(p_target, p_buffer); - -#if defined(__EMSCRIPTEN__) - { - uint8_t *w = ret.ptrw(); - glGetBufferSubData(p_target, 0, p_buffer_size, w); - } -#else - void *data = glMapBufferRange(p_target, 0, p_buffer_size, GL_MAP_READ_BIT); - ERR_FAIL_NULL_V(data, Vector<uint8_t>()); - { - uint8_t *w = ret.ptrw(); - memcpy(w, data, p_buffer_size); - } - glUnmapBuffer(p_target); -#endif - glBindBuffer(p_target, 0); - return ret; -} - -/* OCCLUDER */ - -void RasterizerStorageGLES3::occluder_set_mesh(RID p_occluder, const PackedVector3Array &p_vertices, const PackedInt32Array &p_indices) { -} - -/* FOG */ - -RID RasterizerStorageGLES3::fog_volume_allocate() { - return RID(); -} - -void RasterizerStorageGLES3::fog_volume_initialize(RID p_rid) { -} - -void RasterizerStorageGLES3::fog_volume_set_shape(RID p_fog_volume, RS::FogVolumeShape p_shape) { -} - -void RasterizerStorageGLES3::fog_volume_set_extents(RID p_fog_volume, const Vector3 &p_extents) { -} - -void RasterizerStorageGLES3::fog_volume_set_material(RID p_fog_volume, RID p_material) { -} - -AABB RasterizerStorageGLES3::fog_volume_get_aabb(RID p_fog_volume) const { - return AABB(); -} - -RS::FogVolumeShape RasterizerStorageGLES3::fog_volume_get_shape(RID p_fog_volume) const { - return RS::FOG_VOLUME_SHAPE_BOX; -} - -/* VISIBILITY NOTIFIER */ -RID RasterizerStorageGLES3::visibility_notifier_allocate() { - return RID(); -} - -void RasterizerStorageGLES3::visibility_notifier_initialize(RID p_notifier) { -} - -void RasterizerStorageGLES3::visibility_notifier_set_aabb(RID p_notifier, const AABB &p_aabb) { -} - -void RasterizerStorageGLES3::visibility_notifier_set_callbacks(RID p_notifier, const Callable &p_enter_callbable, const Callable &p_exit_callable) { -} - -AABB RasterizerStorageGLES3::visibility_notifier_get_aabb(RID p_notifier) const { - return AABB(); -} - -void RasterizerStorageGLES3::visibility_notifier_call(RID p_notifier, bool p_enter, bool p_deferred) { -} - -/* CANVAS SHADOW */ - -RID RasterizerStorageGLES3::canvas_light_shadow_buffer_create(int p_width) { - CanvasLightShadow *cls = memnew(CanvasLightShadow); - - if (p_width > config->max_texture_size) { - p_width = config->max_texture_size; - } - - cls->size = p_width; - cls->height = 16; - - glActiveTexture(GL_TEXTURE0); - - glGenFramebuffers(1, &cls->fbo); - glBindFramebuffer(GL_FRAMEBUFFER, cls->fbo); - - glGenRenderbuffers(1, &cls->depth); - glBindRenderbuffer(GL_RENDERBUFFER, cls->depth); - glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT16, cls->size, cls->height); - glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, cls->depth); - - glGenTextures(1, &cls->distance); - glBindTexture(GL_TEXTURE_2D, cls->distance); - if (config->use_rgba_2d_shadows) { - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, cls->size, cls->height, 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr); - } else { - glTexImage2D(GL_TEXTURE_2D, 0, GL_R32F, cls->size, cls->height, 0, GL_RED, GL_FLOAT, nullptr); - } - - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, cls->distance, 0); - - GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER); - //printf("errnum: %x\n",status); - glBindFramebuffer(GL_FRAMEBUFFER, GLES3::TextureStorage::system_fbo); - - if (status != GL_FRAMEBUFFER_COMPLETE) { - memdelete(cls); - ERR_FAIL_COND_V(status != GL_FRAMEBUFFER_COMPLETE, RID()); - } - - return canvas_light_shadow_owner.make_rid(cls); -} - -/* LIGHT SHADOW MAPPING */ -/* - -RID RasterizerStorageGLES3::canvas_light_occluder_create() { - CanvasOccluder *co = memnew(CanvasOccluder); - co->index_id = 0; - co->vertex_id = 0; - co->len = 0; - - return canvas_occluder_owner.make_rid(co); -} - -void RasterizerStorageGLES3::canvas_light_occluder_set_polylines(RID p_occluder, const PoolVector<Vector2> &p_lines) { - CanvasOccluder *co = canvas_occluder_owner.get(p_occluder); - ERR_FAIL_COND(!co); - - co->lines = p_lines; - - if (p_lines.size() != co->len) { - if (co->index_id) { - glDeleteBuffers(1, &co->index_id); - } if (co->vertex_id) { - glDeleteBuffers(1, &co->vertex_id); - } - - co->index_id = 0; - co->vertex_id = 0; - co->len = 0; - } - - if (p_lines.size()) { - PoolVector<float> geometry; - PoolVector<uint16_t> indices; - int lc = p_lines.size(); - - geometry.resize(lc * 6); - indices.resize(lc * 3); - - PoolVector<float>::Write vw = geometry.write(); - PoolVector<uint16_t>::Write iw = indices.write(); - - PoolVector<Vector2>::Read lr = p_lines.read(); - - const int POLY_HEIGHT = 16384; - - for (int i = 0; i < lc / 2; i++) { - vw[i * 12 + 0] = lr[i * 2 + 0].x; - vw[i * 12 + 1] = lr[i * 2 + 0].y; - vw[i * 12 + 2] = POLY_HEIGHT; - - vw[i * 12 + 3] = lr[i * 2 + 1].x; - vw[i * 12 + 4] = lr[i * 2 + 1].y; - vw[i * 12 + 5] = POLY_HEIGHT; - - vw[i * 12 + 6] = lr[i * 2 + 1].x; - vw[i * 12 + 7] = lr[i * 2 + 1].y; - vw[i * 12 + 8] = -POLY_HEIGHT; - - vw[i * 12 + 9] = lr[i * 2 + 0].x; - vw[i * 12 + 10] = lr[i * 2 + 0].y; - vw[i * 12 + 11] = -POLY_HEIGHT; - - iw[i * 6 + 0] = i * 4 + 0; - iw[i * 6 + 1] = i * 4 + 1; - iw[i * 6 + 2] = i * 4 + 2; - - iw[i * 6 + 3] = i * 4 + 2; - iw[i * 6 + 4] = i * 4 + 3; - iw[i * 6 + 5] = i * 4 + 0; - } - - //if same buffer len is being set, just use BufferSubData to avoid a pipeline flush - - if (!co->vertex_id) { - glGenBuffers(1, &co->vertex_id); - glBindBuffer(GL_ARRAY_BUFFER, co->vertex_id); - glBufferData(GL_ARRAY_BUFFER, lc * 6 * sizeof(real_t), vw.ptr(), GL_STATIC_DRAW); - } else { - glBindBuffer(GL_ARRAY_BUFFER, co->vertex_id); - glBufferSubData(GL_ARRAY_BUFFER, 0, lc * 6 * sizeof(real_t), vw.ptr()); - } - - glBindBuffer(GL_ARRAY_BUFFER, 0); //unbind - - if (!co->index_id) { - glGenBuffers(1, &co->index_id); - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, co->index_id); - glBufferData(GL_ELEMENT_ARRAY_BUFFER, lc * 3 * sizeof(uint16_t), iw.ptr(), GL_DYNAMIC_DRAW); - } else { - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, co->index_id); - glBufferSubData(GL_ELEMENT_ARRAY_BUFFER, 0, lc * 3 * sizeof(uint16_t), iw.ptr()); - } - - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); //unbind - - co->len = lc; - } -} -*/ - -RS::InstanceType RasterizerStorageGLES3::get_base_type(RID p_rid) const { - if (GLES3::MeshStorage::get_singleton()->owns_mesh(p_rid)) { - return RS::INSTANCE_MESH; - } else if (GLES3::MeshStorage::get_singleton()->owns_multimesh(p_rid)) { - return RS::INSTANCE_MULTIMESH; - } else if (GLES3::LightStorage::get_singleton()->owns_light(p_rid)) { - return RS::INSTANCE_LIGHT; - } - return RS::INSTANCE_NONE; -} - -bool RasterizerStorageGLES3::free(RID p_rid) { - if (GLES3::TextureStorage::get_singleton()->owns_render_target(p_rid)) { - GLES3::TextureStorage::get_singleton()->render_target_free(p_rid); - return true; - } else if (GLES3::TextureStorage::get_singleton()->owns_texture(p_rid)) { - GLES3::TextureStorage::get_singleton()->texture_free(p_rid); - return true; - } else if (GLES3::TextureStorage::get_singleton()->owns_canvas_texture(p_rid)) { - GLES3::TextureStorage::get_singleton()->canvas_texture_free(p_rid); - return true; - } else if (GLES3::MaterialStorage::get_singleton()->owns_shader(p_rid)) { - GLES3::MaterialStorage::get_singleton()->shader_free(p_rid); - return true; - } else if (GLES3::MaterialStorage::get_singleton()->owns_material(p_rid)) { - GLES3::MaterialStorage::get_singleton()->material_free(p_rid); - return true; - } else if (GLES3::MeshStorage::get_singleton()->owns_mesh(p_rid)) { - GLES3::MeshStorage::get_singleton()->mesh_free(p_rid); - return true; - } else if (GLES3::MeshStorage::get_singleton()->owns_multimesh(p_rid)) { - GLES3::MeshStorage::get_singleton()->multimesh_free(p_rid); - return true; - } else if (GLES3::MeshStorage::get_singleton()->owns_mesh_instance(p_rid)) { - GLES3::MeshStorage::get_singleton()->mesh_instance_free(p_rid); - return true; - } else if (GLES3::LightStorage::get_singleton()->owns_light(p_rid)) { - GLES3::LightStorage::get_singleton()->light_free(p_rid); - return true; - } else { - return false; - } - /* - else if (reflection_probe_owner.owns(p_rid)) { - // delete the texture - ReflectionProbe *reflection_probe = reflection_probe_owner.get_or_null(p_rid); - reflection_probe->instance_remove_deps(); - - reflection_probe_owner.free(p_rid); - memdelete(reflection_probe); - - return true; - } else if (lightmap_capture_data_owner.owns(p_rid)) { - // delete the texture - LightmapCapture *lightmap_capture = lightmap_capture_data_owner.get_or_null(p_rid); - lightmap_capture->instance_remove_deps(); - - lightmap_capture_data_owner.free(p_rid); - memdelete(lightmap_capture); - return true; - - } else if (canvas_occluder_owner.owns(p_rid)) { - CanvasOccluder *co = canvas_occluder_owner.get_or_null(p_rid); - if (co->index_id) { - glDeleteBuffers(1, &co->index_id); - } - if (co->vertex_id) { - glDeleteBuffers(1, &co->vertex_id); - } - - canvas_occluder_owner.free(p_rid); - memdelete(co); - - return true; - - } else if (canvas_light_shadow_owner.owns(p_rid)) { - CanvasLightShadow *cls = canvas_light_shadow_owner.get_or_null(p_rid); - glDeleteFramebuffers(1, &cls->fbo); - glDeleteRenderbuffers(1, &cls->depth); - glDeleteTextures(1, &cls->distance); - canvas_light_shadow_owner.free(p_rid); - memdelete(cls); - - return true; - */ -} - -bool RasterizerStorageGLES3::has_os_feature(const String &p_feature) const { - if (!config) { - return false; - } - - if (p_feature == "rgtc") { - return config->rgtc_supported; - } - - if (p_feature == "s3tc") { - return config->s3tc_supported; - } - - if (p_feature == "bptc") { - return config->bptc_supported; - } - - if (p_feature == "etc" || p_feature == "etc2") { - return config->etc2_supported; - } - - return false; -} - -//////////////////////////////////////////// - -void RasterizerStorageGLES3::set_debug_generate_wireframes(bool p_generate) { -} - -//void RasterizerStorageGLES3::render_info_begin_capture() { -// info.snap = info.render; -//} - -//void RasterizerStorageGLES3::render_info_end_capture() { -// info.snap.object_count = info.render.object_count - info.snap.object_count; -// info.snap.draw_call_count = info.render.draw_call_count - info.snap.draw_call_count; -// info.snap.material_switch_count = info.render.material_switch_count - info.snap.material_switch_count; -// info.snap.surface_switch_count = info.render.surface_switch_count - info.snap.surface_switch_count; -// info.snap.shader_rebind_count = info.render.shader_rebind_count - info.snap.shader_rebind_count; -// info.snap.vertices_count = info.render.vertices_count - info.snap.vertices_count; -// info.snap._2d_item_count = info.render._2d_item_count - info.snap._2d_item_count; -// info.snap._2d_draw_call_count = info.render._2d_draw_call_count - info.snap._2d_draw_call_count; -//} - -//int RasterizerStorageGLES3::get_captured_render_info(RS::RenderInfo p_info) { -// switch (p_info) { -// case RS::INFO_OBJECTS_IN_FRAME: { -// return info.snap.object_count; -// } break; -// case RS::INFO_VERTICES_IN_FRAME: { -// return info.snap.vertices_count; -// } break; -// case RS::INFO_MATERIAL_CHANGES_IN_FRAME: { -// return info.snap.material_switch_count; -// } break; -// case RS::INFO_SHADER_CHANGES_IN_FRAME: { -// return info.snap.shader_rebind_count; -// } break; -// case RS::INFO_SURFACE_CHANGES_IN_FRAME: { -// return info.snap.surface_switch_count; -// } break; -// case RS::INFO_DRAW_CALLS_IN_FRAME: { -// return info.snap.draw_call_count; -// } break; -// /* -// case RS::INFO_2D_ITEMS_IN_FRAME: { -// return info.snap._2d_item_count; -// } break; -// case RS::INFO_2D_DRAW_CALLS_IN_FRAME: { -// return info.snap._2d_draw_call_count; -// } break; -// */ -// default: { -// return get_render_info(p_info); -// } -// } -//} - -//int RasterizerStorageGLES3::get_render_info(RS::RenderInfo p_info) { -// switch (p_info) { -// case RS::INFO_OBJECTS_IN_FRAME: -// return info.render_final.object_count; -// case RS::INFO_VERTICES_IN_FRAME: -// return info.render_final.vertices_count; -// case RS::INFO_MATERIAL_CHANGES_IN_FRAME: -// return info.render_final.material_switch_count; -// case RS::INFO_SHADER_CHANGES_IN_FRAME: -// return info.render_final.shader_rebind_count; -// case RS::INFO_SURFACE_CHANGES_IN_FRAME: -// return info.render_final.surface_switch_count; -// case RS::INFO_DRAW_CALLS_IN_FRAME: -// return info.render_final.draw_call_count; -// /* -// case RS::INFO_2D_ITEMS_IN_FRAME: -// return info.render_final._2d_item_count; -// case RS::INFO_2D_DRAW_CALLS_IN_FRAME: -// return info.render_final._2d_draw_call_count; -//*/ -// case RS::INFO_USAGE_VIDEO_MEM_TOTAL: -// return 0; //no idea -// case RS::INFO_VIDEO_MEM_USED: -// return info.vertex_mem + info.texture_mem; -// case RS::INFO_TEXTURE_MEM_USED: -// return info.texture_mem; -// case RS::INFO_VERTEX_MEM_USED: -// return info.vertex_mem; -// default: -// return 0; //no idea either -// } -//} - -String RasterizerStorageGLES3::get_video_adapter_name() const { - return (const char *)glGetString(GL_RENDERER); -} - -String RasterizerStorageGLES3::get_video_adapter_vendor() const { - return (const char *)glGetString(GL_VENDOR); -} - -RenderingDevice::DeviceType RasterizerStorageGLES3::get_video_adapter_type() const { - return RenderingDevice::DeviceType::DEVICE_TYPE_OTHER; -} - -String RasterizerStorageGLES3::get_video_adapter_api_version() const { - return (const char *)glGetString(GL_VERSION); -} - -void RasterizerStorageGLES3::initialize() { - config = GLES3::Config::get_singleton(); - - // skeleton buffer - { - resources.skeleton_transform_buffer_size = 0; - glGenBuffers(1, &resources.skeleton_transform_buffer); - } - - // radical inverse vdc cache texture - // used for cubemap filtering - glGenTextures(1, &resources.radical_inverse_vdc_cache_tex); - - glActiveTexture(GL_TEXTURE0); - glBindTexture(GL_TEXTURE_2D, resources.radical_inverse_vdc_cache_tex); - /* - uint8_t radical_inverse[512]; - - for (uint32_t i = 0; i < 512; i++) { - uint32_t bits = i; - - bits = (bits << 16) | (bits >> 16); - bits = ((bits & 0x55555555) << 1) | ((bits & 0xAAAAAAAA) >> 1); - bits = ((bits & 0x33333333) << 2) | ((bits & 0xCCCCCCCC) >> 2); - bits = ((bits & 0x0F0F0F0F) << 4) | ((bits & 0xF0F0F0F0) >> 4); - bits = ((bits & 0x00FF00FF) << 8) | ((bits & 0xFF00FF00) >> 8); - - float value = float(bits) * 2.3283064365386963e-10; - radical_inverse[i] = uint8_t(CLAMP(value * 255.0, 0, 255)); - } - - //glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE, 512, 1, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, radical_inverse); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); //need this for proper sampling - */ - glBindTexture(GL_TEXTURE_2D, 0); - - { - glGenFramebuffers(1, &resources.mipmap_blur_fbo); - glGenTextures(1, &resources.mipmap_blur_color); - } - -#ifdef GLES_OVER_GL - glEnable(GL_PROGRAM_POINT_SIZE); -#endif -} - -void RasterizerStorageGLES3::finalize() { -} - -void RasterizerStorageGLES3::update_memory_info() { -} - -uint64_t RasterizerStorageGLES3::get_rendering_info(RS::RenderingInfo p_info) { - return 0; -} - -void RasterizerStorageGLES3::update_dirty_resources() { - GLES3::MaterialStorage::get_singleton()->_update_global_variables(); - GLES3::MaterialStorage::get_singleton()->_update_queued_materials(); - //GLES3::MeshStorage::get_singleton()->_update_dirty_skeletons(); - GLES3::MeshStorage::get_singleton()->_update_dirty_multimeshes(); -} - -RasterizerStorageGLES3::RasterizerStorageGLES3() { - initialize(); -} - -RasterizerStorageGLES3::~RasterizerStorageGLES3() { -} - -#endif // GLES3_ENABLED diff --git a/drivers/gles3/rasterizer_storage_gles3.h b/drivers/gles3/rasterizer_storage_gles3.h deleted file mode 100644 index c42efbce19..0000000000 --- a/drivers/gles3/rasterizer_storage_gles3.h +++ /dev/null @@ -1,266 +0,0 @@ -/*************************************************************************/ -/* rasterizer_storage_gles3.h */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* https://godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur. */ -/* Copyright (c) 2014-2022 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. */ -/*************************************************************************/ - -#ifndef RASTERIZER_STORAGE_OPENGL_H -#define RASTERIZER_STORAGE_OPENGL_H - -#ifdef GLES3_ENABLED - -#include "core/templates/local_vector.h" -#include "core/templates/rid_owner.h" -#include "core/templates/self_list.h" -#include "servers/rendering/renderer_compositor.h" -#include "servers/rendering/renderer_storage.h" -#include "servers/rendering/shader_compiler.h" -#include "servers/rendering/shader_language.h" -#include "storage/config.h" -#include "storage/light_storage.h" -#include "storage/material_storage.h" -#include "storage/mesh_storage.h" -#include "storage/texture_storage.h" - -// class RasterizerCanvasGLES3; -// class RasterizerSceneGLES3; - -class RasterizerStorageGLES3 : public RendererStorage { -public: - // RasterizerCanvasGLES3 *canvas; - // RasterizerSceneGLES3 *scene; - - GLES3::Config *config = nullptr; - - static _FORCE_INLINE_ void store_transform(const Transform3D &p_mtx, float *p_array) { - p_array[0] = p_mtx.basis.rows[0][0]; - p_array[1] = p_mtx.basis.rows[1][0]; - p_array[2] = p_mtx.basis.rows[2][0]; - p_array[3] = 0; - p_array[4] = p_mtx.basis.rows[0][1]; - p_array[5] = p_mtx.basis.rows[1][1]; - p_array[6] = p_mtx.basis.rows[2][1]; - p_array[7] = 0; - p_array[8] = p_mtx.basis.rows[0][2]; - p_array[9] = p_mtx.basis.rows[1][2]; - p_array[10] = p_mtx.basis.rows[2][2]; - p_array[11] = 0; - p_array[12] = p_mtx.origin.x; - p_array[13] = p_mtx.origin.y; - p_array[14] = p_mtx.origin.z; - p_array[15] = 1; - } - - static _FORCE_INLINE_ void store_transform_3x3(const Basis &p_mtx, float *p_array) { - p_array[0] = p_mtx.rows[0][0]; - p_array[1] = p_mtx.rows[1][0]; - p_array[2] = p_mtx.rows[2][0]; - p_array[3] = 0; - p_array[4] = p_mtx.rows[0][1]; - p_array[5] = p_mtx.rows[1][1]; - p_array[6] = p_mtx.rows[2][1]; - p_array[7] = 0; - p_array[8] = p_mtx.rows[0][2]; - p_array[9] = p_mtx.rows[1][2]; - p_array[10] = p_mtx.rows[2][2]; - p_array[11] = 0; - } - - static _FORCE_INLINE_ void store_camera(const CameraMatrix &p_mtx, float *p_array) { - for (int i = 0; i < 4; i++) { - for (int j = 0; j < 4; j++) { - p_array[i * 4 + j] = p_mtx.matrix[i][j]; - } - } - } - - // Buffer size is specified in bytes - static Vector<uint8_t> buffer_get_data(GLenum p_target, GLuint p_buffer, uint32_t p_buffer_size); - - struct Resources { - GLuint mipmap_blur_fbo; - GLuint mipmap_blur_color; - - GLuint radical_inverse_vdc_cache_tex; - bool use_rgba_2d_shadows; - - size_t skeleton_transform_buffer_size; - GLuint skeleton_transform_buffer; - LocalVector<float> skeleton_transform_cpu_buffer; - - } resources; - - struct Info { - uint64_t texture_mem = 0; - uint64_t vertex_mem = 0; - - struct Render { - uint32_t object_count; - uint32_t draw_call_count; - uint32_t material_switch_count; - uint32_t surface_switch_count; - uint32_t shader_rebind_count; - uint32_t vertices_count; - uint32_t _2d_item_count; - uint32_t _2d_draw_call_count; - - void reset() { - object_count = 0; - draw_call_count = 0; - material_switch_count = 0; - surface_switch_count = 0; - shader_rebind_count = 0; - vertices_count = 0; - _2d_item_count = 0; - _2d_draw_call_count = 0; - } - } render, render_final, snap; - - Info() { - render.reset(); - render_final.reset(); - } - - } info; - - ///////////////////////////////////////////////////////////////////////////////////////// - //////////////////////////////////API//////////////////////////////////////////////////// - ///////////////////////////////////////////////////////////////////////////////////////// - -public: - virtual void base_update_dependency(RID p_base, DependencyTracker *p_instance) override; - - /* OCCLUDER */ - - void occluder_set_mesh(RID p_occluder, const PackedVector3Array &p_vertices, const PackedInt32Array &p_indices); - - /* FOG VOLUMES */ - - RID fog_volume_allocate() override; - void fog_volume_initialize(RID p_rid) override; - - void fog_volume_set_shape(RID p_fog_volume, RS::FogVolumeShape p_shape) override; - void fog_volume_set_extents(RID p_fog_volume, const Vector3 &p_extents) override; - void fog_volume_set_material(RID p_fog_volume, RID p_material) override; - AABB fog_volume_get_aabb(RID p_fog_volume) const override; - RS::FogVolumeShape fog_volume_get_shape(RID p_fog_volume) const override; - - /* VISIBILITY NOTIFIER */ - RID visibility_notifier_allocate() override; - void visibility_notifier_initialize(RID p_notifier) override; - void visibility_notifier_set_aabb(RID p_notifier, const AABB &p_aabb) override; - void visibility_notifier_set_callbacks(RID p_notifier, const Callable &p_enter_callbable, const Callable &p_exit_callable) override; - - AABB visibility_notifier_get_aabb(RID p_notifier) const override; - void visibility_notifier_call(RID p_notifier, bool p_enter, bool p_deferred) override; - - // access from canvas - // GLES3::RenderTarget * render_target_get(RID p_render_target); - - /* CANVAS SHADOW */ - - struct CanvasLightShadow { - RID self; - int size; - int height; - GLuint fbo; - GLuint depth; - GLuint distance; //for older devices - }; - - RID_PtrOwner<CanvasLightShadow> canvas_light_shadow_owner; - - RID canvas_light_shadow_buffer_create(int p_width); - - /* LIGHT SHADOW MAPPING */ - /* - struct CanvasOccluder { - RID self; - - GLuint vertex_id; // 0 means, unconfigured - GLuint index_id; // 0 means, unconfigured - LocalVector<Vector2> lines; - int len; - }; - - RID_Owner<CanvasOccluder> canvas_occluder_owner; - - RID canvas_light_occluder_create(); - void canvas_light_occluder_set_polylines(RID p_occluder, const LocalVector<Vector2> &p_lines); -*/ - - RS::InstanceType get_base_type(RID p_rid) const override; - - bool free(RID p_rid) override; - - void initialize(); - void finalize(); - - void update_memory_info() override; - uint64_t get_rendering_info(RS::RenderingInfo p_info) override; - - bool has_os_feature(const String &p_feature) const override; - - void update_dirty_resources() override; - - void set_debug_generate_wireframes(bool p_generate) override; - - // void render_info_begin_capture() override; - // void render_info_end_capture() override; - // int get_captured_render_info(RS::RenderInfo p_info) override; - - // int get_render_info(RS::RenderInfo p_info) override; - String get_video_adapter_name() const override; - String get_video_adapter_vendor() const override; - RenderingDevice::DeviceType get_video_adapter_type() const override; - String get_video_adapter_api_version() const override; - - void capture_timestamps_begin() override {} - void capture_timestamp(const String &p_name) override {} - uint32_t get_captured_timestamps_count() const override { - return 0; - } - uint64_t get_captured_timestamps_frame() const override { - return 0; - } - uint64_t get_captured_timestamp_gpu_time(uint32_t p_index) const override { - return 0; - } - uint64_t get_captured_timestamp_cpu_time(uint32_t p_index) const override { - return 0; - } - String get_captured_timestamp_name(uint32_t p_index) const override { - return String(); - } - - RasterizerStorageGLES3(); - ~RasterizerStorageGLES3(); -}; - -#endif // GLES3_ENABLED - -#endif // RASTERIZER_STORAGE_OPENGL_H diff --git a/drivers/gles3/storage/light_storage.cpp b/drivers/gles3/storage/light_storage.cpp index 954aa11c0d..22578c9e91 100644 --- a/drivers/gles3/storage/light_storage.cpp +++ b/drivers/gles3/storage/light_storage.cpp @@ -139,12 +139,12 @@ void LightStorage::light_set_param(RID p_light, RS::LightParam p_param, float p_ case RS::LIGHT_PARAM_SHADOW_PANCAKE_SIZE: case RS::LIGHT_PARAM_SHADOW_BIAS: { light->version++; - light->dependency.changed_notify(RendererStorage::DEPENDENCY_CHANGED_LIGHT); + light->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_LIGHT); } break; case RS::LIGHT_PARAM_SIZE: { if ((light->param[p_param] > CMP_EPSILON) != (p_value > CMP_EPSILON)) { //changing from no size to size and the opposite - light->dependency.changed_notify(RendererStorage::DEPENDENCY_CHANGED_LIGHT_SOFT_SHADOW_AND_PROJECTOR); + light->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_LIGHT_SOFT_SHADOW_AND_PROJECTOR); } } break; default: { @@ -160,7 +160,7 @@ void LightStorage::light_set_shadow(RID p_light, bool p_enabled) { light->shadow = p_enabled; light->version++; - light->dependency.changed_notify(RendererStorage::DEPENDENCY_CHANGED_LIGHT); + light->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_LIGHT); } void LightStorage::light_set_projector(RID p_light, RID p_texture) { @@ -182,7 +182,7 @@ void LightStorage::light_set_projector(RID p_light, RID p_texture) { if (light->projector.is_valid()) { texture_storage->texture_add_to_decal_atlas(light->projector, light->type == RS::LIGHT_OMNI); } - light->dependency.changed_notify(RendererStorage::DEPENDENCY_CHANGED_LIGHT_SOFT_SHADOW_AND_PROJECTOR); + light->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_LIGHT_SOFT_SHADOW_AND_PROJECTOR); } } @@ -200,7 +200,7 @@ void LightStorage::light_set_cull_mask(RID p_light, uint32_t p_mask) { light->cull_mask = p_mask; light->version++; - light->dependency.changed_notify(RendererStorage::DEPENDENCY_CHANGED_LIGHT); + light->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_LIGHT); } void LightStorage::light_set_distance_fade(RID p_light, bool p_enabled, float p_begin, float p_shadow, float p_length) { @@ -220,7 +220,7 @@ void LightStorage::light_set_reverse_cull_face_mode(RID p_light, bool p_enabled) light->reverse_cull = p_enabled; light->version++; - light->dependency.changed_notify(RendererStorage::DEPENDENCY_CHANGED_LIGHT); + light->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_LIGHT); } void LightStorage::light_set_bake_mode(RID p_light, RS::LightBakeMode p_bake_mode) { @@ -230,7 +230,7 @@ void LightStorage::light_set_bake_mode(RID p_light, RS::LightBakeMode p_bake_mod light->bake_mode = p_bake_mode; light->version++; - light->dependency.changed_notify(RendererStorage::DEPENDENCY_CHANGED_LIGHT); + light->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_LIGHT); } void LightStorage::light_omni_set_shadow_mode(RID p_light, RS::LightOmniShadowMode p_mode) { @@ -240,7 +240,7 @@ void LightStorage::light_omni_set_shadow_mode(RID p_light, RS::LightOmniShadowMo light->omni_shadow_mode = p_mode; light->version++; - light->dependency.changed_notify(RendererStorage::DEPENDENCY_CHANGED_LIGHT); + light->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_LIGHT); } RS::LightOmniShadowMode LightStorage::light_omni_get_shadow_mode(RID p_light) { @@ -256,7 +256,7 @@ void LightStorage::light_directional_set_shadow_mode(RID p_light, RS::LightDirec light->directional_shadow_mode = p_mode; light->version++; - light->dependency.changed_notify(RendererStorage::DEPENDENCY_CHANGED_LIGHT); + light->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_LIGHT); } void LightStorage::light_directional_set_blend_splits(RID p_light, bool p_enable) { @@ -265,7 +265,7 @@ void LightStorage::light_directional_set_blend_splits(RID p_light, bool p_enable light->directional_blend_splits = p_enable; light->version++; - light->dependency.changed_notify(RendererStorage::DEPENDENCY_CHANGED_LIGHT); + light->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_LIGHT); } bool LightStorage::light_directional_get_blend_splits(RID p_light) const { @@ -476,4 +476,104 @@ float LightStorage::lightmap_get_probe_capture_update_speed() const { return 0; } +/* LIGHT SHADOW MAPPING */ +/* + +RID LightStorage::canvas_light_occluder_create() { + CanvasOccluder *co = memnew(CanvasOccluder); + co->index_id = 0; + co->vertex_id = 0; + co->len = 0; + + return canvas_occluder_owner.make_rid(co); +} + +void LightStorage::canvas_light_occluder_set_polylines(RID p_occluder, const PoolVector<Vector2> &p_lines) { + CanvasOccluder *co = canvas_occluder_owner.get(p_occluder); + ERR_FAIL_COND(!co); + + co->lines = p_lines; + + if (p_lines.size() != co->len) { + if (co->index_id) { + glDeleteBuffers(1, &co->index_id); + } if (co->vertex_id) { + glDeleteBuffers(1, &co->vertex_id); + } + + co->index_id = 0; + co->vertex_id = 0; + co->len = 0; + } + + if (p_lines.size()) { + PoolVector<float> geometry; + PoolVector<uint16_t> indices; + int lc = p_lines.size(); + + geometry.resize(lc * 6); + indices.resize(lc * 3); + + PoolVector<float>::Write vw = geometry.write(); + PoolVector<uint16_t>::Write iw = indices.write(); + + PoolVector<Vector2>::Read lr = p_lines.read(); + + const int POLY_HEIGHT = 16384; + + for (int i = 0; i < lc / 2; i++) { + vw[i * 12 + 0] = lr[i * 2 + 0].x; + vw[i * 12 + 1] = lr[i * 2 + 0].y; + vw[i * 12 + 2] = POLY_HEIGHT; + + vw[i * 12 + 3] = lr[i * 2 + 1].x; + vw[i * 12 + 4] = lr[i * 2 + 1].y; + vw[i * 12 + 5] = POLY_HEIGHT; + + vw[i * 12 + 6] = lr[i * 2 + 1].x; + vw[i * 12 + 7] = lr[i * 2 + 1].y; + vw[i * 12 + 8] = -POLY_HEIGHT; + + vw[i * 12 + 9] = lr[i * 2 + 0].x; + vw[i * 12 + 10] = lr[i * 2 + 0].y; + vw[i * 12 + 11] = -POLY_HEIGHT; + + iw[i * 6 + 0] = i * 4 + 0; + iw[i * 6 + 1] = i * 4 + 1; + iw[i * 6 + 2] = i * 4 + 2; + + iw[i * 6 + 3] = i * 4 + 2; + iw[i * 6 + 4] = i * 4 + 3; + iw[i * 6 + 5] = i * 4 + 0; + } + + //if same buffer len is being set, just use BufferSubData to avoid a pipeline flush + + if (!co->vertex_id) { + glGenBuffers(1, &co->vertex_id); + glBindBuffer(GL_ARRAY_BUFFER, co->vertex_id); + glBufferData(GL_ARRAY_BUFFER, lc * 6 * sizeof(real_t), vw.ptr(), GL_STATIC_DRAW); + } else { + glBindBuffer(GL_ARRAY_BUFFER, co->vertex_id); + glBufferSubData(GL_ARRAY_BUFFER, 0, lc * 6 * sizeof(real_t), vw.ptr()); + } + + glBindBuffer(GL_ARRAY_BUFFER, 0); //unbind + + if (!co->index_id) { + glGenBuffers(1, &co->index_id); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, co->index_id); + glBufferData(GL_ELEMENT_ARRAY_BUFFER, lc * 3 * sizeof(uint16_t), iw.ptr(), GL_DYNAMIC_DRAW); + } else { + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, co->index_id); + glBufferSubData(GL_ELEMENT_ARRAY_BUFFER, 0, lc * 3 * sizeof(uint16_t), iw.ptr()); + } + + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); //unbind + + co->len = lc; + } +} +*/ + #endif // !GLES3_ENABLED diff --git a/drivers/gles3/storage/light_storage.h b/drivers/gles3/storage/light_storage.h index 5acaf45aa3..575ab93eab 100644 --- a/drivers/gles3/storage/light_storage.h +++ b/drivers/gles3/storage/light_storage.h @@ -37,8 +37,8 @@ #include "core/templates/rid_owner.h" #include "core/templates/self_list.h" #include "servers/rendering/renderer_compositor.h" -#include "servers/rendering/renderer_storage.h" #include "servers/rendering/storage/light_storage.h" +#include "servers/rendering/storage/utilities.h" #include "platform_config.h" #ifndef OPENGL_INCLUDE_H @@ -72,7 +72,7 @@ struct Light { RS::LightDirectionalSkyMode directional_sky_mode = RS::LIGHT_DIRECTIONAL_SKY_MODE_LIGHT_AND_SKY; uint64_t version = 0; - RendererStorage::Dependency dependency; + Dependency dependency; }; /* REFLECTION PROBE */ @@ -93,7 +93,7 @@ struct ReflectionProbe { uint32_t cull_mask = (1 << 20) - 1; float mesh_lod_threshold = 0.01; - RendererStorage::Dependency dependency; + Dependency dependency; }; /* LIGHTMAP */ @@ -115,7 +115,7 @@ struct Lightmap { int32_t over = EMPTY_LEAF, under = EMPTY_LEAF; }; - RendererStorage::Dependency dependency; + Dependency dependency; }; class LightStorage : public RendererLightStorage { @@ -321,6 +321,23 @@ public: virtual bool lightmap_is_interior(RID p_lightmap) const override; virtual void lightmap_set_probe_capture_update_speed(float p_speed) override; virtual float lightmap_get_probe_capture_update_speed() const override; + + /* LIGHT SHADOW MAPPING */ + /* + struct CanvasOccluder { + RID self; + + GLuint vertex_id; // 0 means, unconfigured + GLuint index_id; // 0 means, unconfigured + LocalVector<Vector2> lines; + int len; + }; + + RID_Owner<CanvasOccluder> canvas_occluder_owner; + + RID canvas_light_occluder_create(); + void canvas_light_occluder_set_polylines(RID p_occluder, const LocalVector<Vector2> &p_lines); + */ }; } // namespace GLES3 diff --git a/drivers/gles3/storage/material_storage.cpp b/drivers/gles3/storage/material_storage.cpp index fd50bdedbd..aa19826953 100644 --- a/drivers/gles3/storage/material_storage.cpp +++ b/drivers/gles3/storage/material_storage.cpp @@ -2456,7 +2456,7 @@ void MaterialStorage::shader_set_code(RID p_shader, const String &p_code) { for (Material *E : shader->owners) { Material *material = E; - material->dependency.changed_notify(RendererStorage::DEPENDENCY_CHANGED_MATERIAL); + material->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_MATERIAL); _material_queue_update(material, true, true); } } @@ -2593,7 +2593,7 @@ void MaterialStorage::material_set_shader(RID p_material, RID p_shader) { } if (p_shader.is_null()) { - material->dependency.changed_notify(RendererStorage::DEPENDENCY_CHANGED_MATERIAL); + material->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_MATERIAL); material->shader_id = 0; return; } @@ -2616,7 +2616,7 @@ void MaterialStorage::material_set_shader(RID p_material, RID p_shader) { material->data->set_next_pass(material->next_pass); material->data->set_render_priority(material->priority); //updating happens later - material->dependency.changed_notify(RendererStorage::DEPENDENCY_CHANGED_MATERIAL); + material->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_MATERIAL); _material_queue_update(material, true, true); } @@ -2662,7 +2662,7 @@ void MaterialStorage::material_set_next_pass(RID p_material, RID p_next_material material->data->set_next_pass(p_next_material); } - material->dependency.changed_notify(RendererStorage::DEPENDENCY_CHANGED_MATERIAL); + material->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_MATERIAL); } void MaterialStorage::material_set_render_priority(RID p_material, int priority) { @@ -2715,7 +2715,7 @@ void MaterialStorage::material_get_instance_shader_parameters(RID p_material, Li } } -void MaterialStorage::material_update_dependency(RID p_material, RendererStorage::DependencyTracker *p_instance) { +void MaterialStorage::material_update_dependency(RID p_material, DependencyTracker *p_instance) { Material *material = material_owner.get_or_null(p_material); ERR_FAIL_COND(!material); p_instance->update_dependency(&material->dependency); diff --git a/drivers/gles3/storage/material_storage.h b/drivers/gles3/storage/material_storage.h index 09f6680bec..6ad277c2b9 100644 --- a/drivers/gles3/storage/material_storage.h +++ b/drivers/gles3/storage/material_storage.h @@ -37,10 +37,10 @@ #include "core/templates/rid_owner.h" #include "core/templates/self_list.h" #include "servers/rendering/renderer_compositor.h" -#include "servers/rendering/renderer_storage.h" #include "servers/rendering/shader_compiler.h" #include "servers/rendering/shader_language.h" #include "servers/rendering/storage/material_storage.h" +#include "servers/rendering/storage/utilities.h" #include "../shaders/canvas.glsl.gen.h" #include "../shaders/cubemap_filter.glsl.gen.h" @@ -125,7 +125,7 @@ struct Material { RID next_pass; SelfList<Material> update_element; - RendererStorage::Dependency dependency; + Dependency dependency; Material() : update_element(this) {} @@ -453,6 +453,48 @@ public: MaterialStorage(); virtual ~MaterialStorage(); + static _FORCE_INLINE_ void store_transform(const Transform3D &p_mtx, float *p_array) { + p_array[0] = p_mtx.basis.rows[0][0]; + p_array[1] = p_mtx.basis.rows[1][0]; + p_array[2] = p_mtx.basis.rows[2][0]; + p_array[3] = 0; + p_array[4] = p_mtx.basis.rows[0][1]; + p_array[5] = p_mtx.basis.rows[1][1]; + p_array[6] = p_mtx.basis.rows[2][1]; + p_array[7] = 0; + p_array[8] = p_mtx.basis.rows[0][2]; + p_array[9] = p_mtx.basis.rows[1][2]; + p_array[10] = p_mtx.basis.rows[2][2]; + p_array[11] = 0; + p_array[12] = p_mtx.origin.x; + p_array[13] = p_mtx.origin.y; + p_array[14] = p_mtx.origin.z; + p_array[15] = 1; + } + + static _FORCE_INLINE_ void store_transform_3x3(const Basis &p_mtx, float *p_array) { + p_array[0] = p_mtx.rows[0][0]; + p_array[1] = p_mtx.rows[1][0]; + p_array[2] = p_mtx.rows[2][0]; + p_array[3] = 0; + p_array[4] = p_mtx.rows[0][1]; + p_array[5] = p_mtx.rows[1][1]; + p_array[6] = p_mtx.rows[2][1]; + p_array[7] = 0; + p_array[8] = p_mtx.rows[0][2]; + p_array[9] = p_mtx.rows[1][2]; + p_array[10] = p_mtx.rows[2][2]; + p_array[11] = 0; + } + + static _FORCE_INLINE_ void store_camera(const CameraMatrix &p_mtx, float *p_array) { + for (int i = 0; i < 4; i++) { + for (int j = 0; j < 4; j++) { + p_array[i * 4 + j] = p_mtx.matrix[i][j]; + } + } + } + struct Shaders { CanvasShaderGLES3 canvas_shader; SkyShaderGLES3 sky_shader; @@ -534,7 +576,7 @@ public: virtual void material_get_instance_shader_parameters(RID p_material, List<InstanceShaderParam> *r_parameters) override; - virtual void material_update_dependency(RID p_material, RendererStorage::DependencyTracker *p_instance) override; + virtual void material_update_dependency(RID p_material, DependencyTracker *p_instance) override; _FORCE_INLINE_ uint32_t material_get_shader_id(RID p_material) { Material *material = material_owner.get_or_null(p_material); diff --git a/drivers/gles3/storage/mesh_storage.cpp b/drivers/gles3/storage/mesh_storage.cpp index 5aa82bfcc1..88b81805fa 100644 --- a/drivers/gles3/storage/mesh_storage.cpp +++ b/drivers/gles3/storage/mesh_storage.cpp @@ -31,8 +31,8 @@ #ifdef GLES3_ENABLED #include "mesh_storage.h" -#include "../rasterizer_storage_gles3.h" #include "material_storage.h" +#include "utilities.h" using namespace GLES3; @@ -64,6 +64,8 @@ void MeshStorage::mesh_free(RID p_rid) { mesh_clear(p_rid); mesh_set_shadow_mesh(p_rid, RID()); Mesh *mesh = mesh_owner.get_or_null(p_rid); + ERR_FAIL_COND(!mesh); + mesh->dependency.deleted_notify(p_rid); if (mesh->instances.size()) { ERR_PRINT("deleting mesh with active instances"); @@ -72,7 +74,7 @@ void MeshStorage::mesh_free(RID p_rid) { for (Mesh *E : mesh->shadow_owners) { Mesh *shadow_owner = E; shadow_owner->shadow_mesh = RID(); - shadow_owner->dependency.changed_notify(RendererStorage::DEPENDENCY_CHANGED_MESH); + shadow_owner->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_MESH); } } mesh_owner.free(p_rid); @@ -268,12 +270,12 @@ void MeshStorage::mesh_add_surface(RID p_mesh, const RS::SurfaceData &p_surface) _mesh_instance_add_surface(mi, mesh, mesh->surface_count - 1); } - mesh->dependency.changed_notify(RendererStorage::DEPENDENCY_CHANGED_MESH); + mesh->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_MESH); for (Mesh *E : mesh->shadow_owners) { Mesh *shadow_owner = E; shadow_owner->shadow_mesh = RID(); - shadow_owner->dependency.changed_notify(RendererStorage::DEPENDENCY_CHANGED_MESH); + shadow_owner->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_MESH); } mesh->material_cache.clear(); @@ -314,7 +316,7 @@ void MeshStorage::mesh_surface_set_material(RID p_mesh, int p_surface, RID p_mat ERR_FAIL_UNSIGNED_INDEX((uint32_t)p_surface, mesh->surface_count); mesh->surfaces[p_surface]->material = p_material; - mesh->dependency.changed_notify(RendererStorage::DEPENDENCY_CHANGED_MATERIAL); + mesh->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_MATERIAL); mesh->material_cache.clear(); } @@ -335,10 +337,10 @@ RS::SurfaceData MeshStorage::mesh_get_surface(RID p_mesh, int p_surface) const { RS::SurfaceData sd; sd.format = s.format; - sd.vertex_data = RasterizerStorageGLES3::buffer_get_data(GL_ARRAY_BUFFER, s.vertex_buffer, s.vertex_buffer_size); + sd.vertex_data = Utilities::buffer_get_data(GL_ARRAY_BUFFER, s.vertex_buffer, s.vertex_buffer_size); if (s.attribute_buffer != 0) { - sd.attribute_data = RasterizerStorageGLES3::buffer_get_data(GL_ARRAY_BUFFER, s.attribute_buffer, s.attribute_buffer_size); + sd.attribute_data = Utilities::buffer_get_data(GL_ARRAY_BUFFER, s.attribute_buffer, s.attribute_buffer_size); } sd.vertex_count = s.vertex_count; @@ -346,14 +348,14 @@ RS::SurfaceData MeshStorage::mesh_get_surface(RID p_mesh, int p_surface) const { sd.primitive = s.primitive; if (sd.index_count) { - sd.index_data = RasterizerStorageGLES3::buffer_get_data(GL_ELEMENT_ARRAY_BUFFER, s.index_buffer, s.index_buffer_size); + sd.index_data = Utilities::buffer_get_data(GL_ELEMENT_ARRAY_BUFFER, s.index_buffer, s.index_buffer_size); } sd.aabb = s.aabb; for (uint32_t i = 0; i < s.lod_count; i++) { RS::SurfaceData::LOD lod; lod.edge_length = s.lods[i].edge_length; - lod.index_data = RasterizerStorageGLES3::buffer_get_data(GL_ELEMENT_ARRAY_BUFFER, s.lods[i].index_buffer, s.lods[i].index_buffer_size); + lod.index_data = Utilities::buffer_get_data(GL_ELEMENT_ARRAY_BUFFER, s.lods[i].index_buffer, s.lods[i].index_buffer_size); sd.lods.push_back(lod); } @@ -504,7 +506,7 @@ void MeshStorage::mesh_set_shadow_mesh(RID p_mesh, RID p_shadow_mesh) { shadow_mesh->shadow_owners.insert(mesh); } - mesh->dependency.changed_notify(RendererStorage::DEPENDENCY_CHANGED_MESH); + mesh->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_MESH); } void MeshStorage::mesh_clear(RID p_mesh) { @@ -553,12 +555,12 @@ void MeshStorage::mesh_clear(RID p_mesh) { _mesh_instance_clear(mi); } mesh->has_bone_weights = false; - mesh->dependency.changed_notify(RendererStorage::DEPENDENCY_CHANGED_MESH); + mesh->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_MESH); for (Mesh *E : mesh->shadow_owners) { Mesh *shadow_owner = E; shadow_owner->shadow_mesh = RID(); - shadow_owner->dependency.changed_notify(RendererStorage::DEPENDENCY_CHANGED_MESH); + shadow_owner->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_MESH); } } @@ -899,7 +901,7 @@ void MeshStorage::multimesh_allocate_data(RID p_multimesh, int p_instances, RS:: glBindBuffer(GL_ARRAY_BUFFER, 0); } - multimesh->dependency.changed_notify(RendererStorage::DEPENDENCY_CHANGED_MULTIMESH); + multimesh->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_MULTIMESH); } int MeshStorage::multimesh_get_instance_count(RID p_multimesh) const { @@ -926,14 +928,14 @@ void MeshStorage::multimesh_set_mesh(RID p_multimesh, RID p_mesh) { } else if (multimesh->instances) { // Need to re-create AABB. Unfortunately, calling this has a penalty. if (multimesh->buffer_set) { - Vector<uint8_t> buffer = RasterizerStorageGLES3::buffer_get_data(GL_ARRAY_BUFFER, multimesh->buffer, multimesh->instances * multimesh->stride_cache * sizeof(float)); + Vector<uint8_t> buffer = Utilities::buffer_get_data(GL_ARRAY_BUFFER, multimesh->buffer, multimesh->instances * multimesh->stride_cache * sizeof(float)); const uint8_t *r = buffer.ptr(); const float *data = (const float *)r; _multimesh_re_create_aabb(multimesh, data, multimesh->instances); } } - multimesh->dependency.changed_notify(RendererStorage::DEPENDENCY_CHANGED_MESH); + multimesh->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_MESH); } #define MULTIMESH_DIRTY_REGION_SIZE 512 @@ -950,7 +952,7 @@ void MeshStorage::_multimesh_make_local(MultiMesh *multimesh) const { float *w = multimesh->data_cache.ptrw(); if (multimesh->buffer_set) { - Vector<uint8_t> buffer = RasterizerStorageGLES3::buffer_get_data(GL_ARRAY_BUFFER, multimesh->buffer, multimesh->instances * multimesh->stride_cache * sizeof(float)); + Vector<uint8_t> buffer = Utilities::buffer_get_data(GL_ARRAY_BUFFER, multimesh->buffer, multimesh->instances * multimesh->stride_cache * sizeof(float)); { const uint8_t *r = buffer.ptr(); @@ -1348,7 +1350,7 @@ void MeshStorage::multimesh_set_buffer(RID p_multimesh, const Vector<float> &p_b const float *data = multimesh->data_cache.ptr(); _multimesh_re_create_aabb(multimesh, data, multimesh->instances); - multimesh->dependency.changed_notify(RendererStorage::DEPENDENCY_CHANGED_AABB); + multimesh->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_AABB); } } @@ -1363,7 +1365,7 @@ Vector<float> MeshStorage::multimesh_get_buffer(RID p_multimesh) const { } else { // Buffer not cached, so fetch from GPU memory. This can be a stalling operation, avoid whenever possible. - Vector<uint8_t> buffer = RasterizerStorageGLES3::buffer_get_data(GL_ARRAY_BUFFER, multimesh->buffer, multimesh->instances * multimesh->stride_cache * sizeof(float)); + Vector<uint8_t> buffer = Utilities::buffer_get_data(GL_ARRAY_BUFFER, multimesh->buffer, multimesh->instances * multimesh->stride_cache * sizeof(float)); ret.resize(multimesh->instances * multimesh->stride_cache); { float *w = ret.ptrw(); @@ -1439,7 +1441,7 @@ void MeshStorage::multimesh_set_visible_instances(RID p_multimesh, int p_visible multimesh->visible_instances = p_visible; - multimesh->dependency.changed_notify(RendererStorage::DEPENDENCY_CHANGED_MULTIMESH_VISIBLE_INSTANCES); + multimesh->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_MULTIMESH_VISIBLE_INSTANCES); } int MeshStorage::multimesh_get_visible_instances(RID p_multimesh) const { @@ -1493,7 +1495,7 @@ void MeshStorage::_update_dirty_multimeshes() { if (multimesh->aabb_dirty && multimesh->mesh.is_valid()) { _multimesh_re_create_aabb(multimesh, data, visible_instances); multimesh->aabb_dirty = false; - multimesh->dependency.changed_notify(RendererStorage::DEPENDENCY_CHANGED_AABB); + multimesh->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_AABB); } } @@ -1542,7 +1544,12 @@ Transform2D MeshStorage::skeleton_bone_get_transform_2d(RID p_skeleton, int p_bo return Transform2D(); } -void MeshStorage::skeleton_update_dependency(RID p_base, RendererStorage::DependencyTracker *p_instance) { +void MeshStorage::skeleton_update_dependency(RID p_base, DependencyTracker *p_instance) { +} + +/* OCCLUDER */ + +void MeshStorage::occluder_set_mesh(RID p_occluder, const PackedVector3Array &p_vertices, const PackedInt32Array &p_indices) { } #endif // GLES3_ENABLED diff --git a/drivers/gles3/storage/mesh_storage.h b/drivers/gles3/storage/mesh_storage.h index 3bb7061413..c51cd5dcd6 100644 --- a/drivers/gles3/storage/mesh_storage.h +++ b/drivers/gles3/storage/mesh_storage.h @@ -37,6 +37,7 @@ #include "core/templates/rid_owner.h" #include "core/templates/self_list.h" #include "servers/rendering/storage/mesh_storage.h" +#include "servers/rendering/storage/utilities.h" #include "platform_config.h" #ifndef OPENGL_INCLUDE_H @@ -126,7 +127,7 @@ struct Mesh { RID shadow_mesh; HashSet<Mesh *> shadow_owners; - RendererStorage::Dependency dependency; + Dependency dependency; }; /* Mesh Instance */ @@ -179,7 +180,7 @@ struct MultiMesh { bool dirty = false; MultiMesh *dirty_list = nullptr; - RendererStorage::Dependency dependency; + Dependency dependency; }; struct Skeleton { @@ -194,7 +195,7 @@ struct Skeleton { uint64_t version = 1; - RendererStorage::Dependency dependency; + Dependency dependency; }; class MeshStorage : public RendererMeshStorage { @@ -531,7 +532,11 @@ public: virtual void skeleton_bone_set_transform_2d(RID p_skeleton, int p_bone, const Transform2D &p_transform) override; virtual Transform2D skeleton_bone_get_transform_2d(RID p_skeleton, int p_bone) const override; - virtual void skeleton_update_dependency(RID p_base, RendererStorage::DependencyTracker *p_instance) override; + virtual void skeleton_update_dependency(RID p_base, DependencyTracker *p_instance) override; + + /* OCCLUDER */ + + void occluder_set_mesh(RID p_occluder, const PackedVector3Array &p_vertices, const PackedInt32Array &p_indices); }; } // namespace GLES3 diff --git a/drivers/gles3/storage/texture_storage.cpp b/drivers/gles3/storage/texture_storage.cpp index 42c80da39a..c05f516548 100644 --- a/drivers/gles3/storage/texture_storage.cpp +++ b/drivers/gles3/storage/texture_storage.cpp @@ -183,6 +183,12 @@ TextureStorage::TextureStorage() { texture.gl_set_filter(RS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST); } } + + glBindTexture(GL_TEXTURE_2D, 0); + +#ifdef GLES_OVER_GL + glEnable(GL_PROGRAM_POINT_SIZE); +#endif } TextureStorage::~TextureStorage() { @@ -244,6 +250,55 @@ void TextureStorage::canvas_texture_set_texture_repeat(RID p_canvas_texture, RS: ct->texture_repeat = p_repeat; } +/* CANVAS SHADOW */ + +RID TextureStorage::canvas_light_shadow_buffer_create(int p_width) { + Config *config = Config::get_singleton(); + CanvasLightShadow *cls = memnew(CanvasLightShadow); + + if (p_width > config->max_texture_size) { + p_width = config->max_texture_size; + } + + cls->size = p_width; + cls->height = 16; + + glActiveTexture(GL_TEXTURE0); + + glGenFramebuffers(1, &cls->fbo); + glBindFramebuffer(GL_FRAMEBUFFER, cls->fbo); + + glGenRenderbuffers(1, &cls->depth); + glBindRenderbuffer(GL_RENDERBUFFER, cls->depth); + glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT16, cls->size, cls->height); + glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, cls->depth); + + glGenTextures(1, &cls->distance); + glBindTexture(GL_TEXTURE_2D, cls->distance); + if (config->use_rgba_2d_shadows) { + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, cls->size, cls->height, 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr); + } else { + glTexImage2D(GL_TEXTURE_2D, 0, GL_R32F, cls->size, cls->height, 0, GL_RED, GL_FLOAT, nullptr); + } + + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, cls->distance, 0); + + GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER); + //printf("errnum: %x\n",status); + glBindFramebuffer(GL_FRAMEBUFFER, GLES3::TextureStorage::system_fbo); + + if (status != GL_FRAMEBUFFER_COMPLETE) { + memdelete(cls); + ERR_FAIL_COND_V(status != GL_FRAMEBUFFER_COMPLETE, RID()); + } + + return canvas_light_shadow_owner.make_rid(cls); +} + /* Texture API */ Ref<Image> TextureStorage::_get_gl_image_and_format(const Ref<Image> &p_image, Image::Format p_format, Image::Format &r_real_format, GLenum &r_gl_format, GLenum &r_gl_internal_format, GLenum &r_gl_type, bool &r_compressed, bool p_force_decompress) const { diff --git a/drivers/gles3/storage/texture_storage.h b/drivers/gles3/storage/texture_storage.h index d6d04e45a1..de887f9184 100644 --- a/drivers/gles3/storage/texture_storage.h +++ b/drivers/gles3/storage/texture_storage.h @@ -132,6 +132,17 @@ struct CanvasTexture { bool cleared_cache = true; }; +/* CANVAS SHADOW */ + +struct CanvasLightShadow { + RID self; + int size; + int height; + GLuint fbo; + GLuint depth; + GLuint distance; //for older devices +}; + struct RenderTarget; struct Texture { @@ -364,6 +375,10 @@ private: RID_Owner<CanvasTexture, true> canvas_texture_owner; + /* CANVAS SHADOW */ + + RID_PtrOwner<CanvasLightShadow> canvas_light_shadow_owner; + /* Texture API */ mutable RID_Owner<Texture> texture_owner; @@ -403,6 +418,10 @@ public: virtual void canvas_texture_set_texture_filter(RID p_item, RS::CanvasItemTextureFilter p_filter) override; virtual void canvas_texture_set_texture_repeat(RID p_item, RS::CanvasItemTextureRepeat p_repeat) override; + /* CANVAS SHADOW */ + + RID canvas_light_shadow_buffer_create(int p_width); + /* Texture API */ Texture *get_texture(RID p_rid) { diff --git a/drivers/gles3/storage/utilities.cpp b/drivers/gles3/storage/utilities.cpp new file mode 100644 index 0000000000..a00210a2ab --- /dev/null +++ b/drivers/gles3/storage/utilities.cpp @@ -0,0 +1,353 @@ +/*************************************************************************/ +/* utilities.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2022 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. */ +/*************************************************************************/ + +#ifdef GLES3_ENABLED + +#include "utilities.h" +#include "config.h" +#include "light_storage.h" +#include "material_storage.h" +#include "mesh_storage.h" +#include "particles_storage.h" +#include "texture_storage.h" + +using namespace GLES3; + +Utilities *Utilities::singleton = nullptr; + +Utilities::Utilities() { + singleton = this; +} + +Utilities::~Utilities() { + singleton = nullptr; +} + +Vector<uint8_t> Utilities::buffer_get_data(GLenum p_target, GLuint p_buffer, uint32_t p_buffer_size) { + Vector<uint8_t> ret; + ret.resize(p_buffer_size); + glBindBuffer(p_target, p_buffer); + +#if defined(__EMSCRIPTEN__) + { + uint8_t *w = ret.ptrw(); + glGetBufferSubData(p_target, 0, p_buffer_size, w); + } +#else + void *data = glMapBufferRange(p_target, 0, p_buffer_size, GL_MAP_READ_BIT); + ERR_FAIL_NULL_V(data, Vector<uint8_t>()); + { + uint8_t *w = ret.ptrw(); + memcpy(w, data, p_buffer_size); + } + glUnmapBuffer(p_target); +#endif + glBindBuffer(p_target, 0); + return ret; +} + +/* INSTANCES */ + +RS::InstanceType Utilities::get_base_type(RID p_rid) const { + if (GLES3::MeshStorage::get_singleton()->owns_mesh(p_rid)) { + return RS::INSTANCE_MESH; + } else if (GLES3::MeshStorage::get_singleton()->owns_multimesh(p_rid)) { + return RS::INSTANCE_MULTIMESH; + } else if (GLES3::LightStorage::get_singleton()->owns_light(p_rid)) { + return RS::INSTANCE_LIGHT; + } + return RS::INSTANCE_NONE; +} + +bool Utilities::free(RID p_rid) { + if (GLES3::TextureStorage::get_singleton()->owns_render_target(p_rid)) { + GLES3::TextureStorage::get_singleton()->render_target_free(p_rid); + return true; + } else if (GLES3::TextureStorage::get_singleton()->owns_texture(p_rid)) { + GLES3::TextureStorage::get_singleton()->texture_free(p_rid); + return true; + } else if (GLES3::TextureStorage::get_singleton()->owns_canvas_texture(p_rid)) { + GLES3::TextureStorage::get_singleton()->canvas_texture_free(p_rid); + return true; + } else if (GLES3::MaterialStorage::get_singleton()->owns_shader(p_rid)) { + GLES3::MaterialStorage::get_singleton()->shader_free(p_rid); + return true; + } else if (GLES3::MaterialStorage::get_singleton()->owns_material(p_rid)) { + GLES3::MaterialStorage::get_singleton()->material_free(p_rid); + return true; + } else if (GLES3::MeshStorage::get_singleton()->owns_mesh(p_rid)) { + GLES3::MeshStorage::get_singleton()->mesh_free(p_rid); + return true; + } else if (GLES3::MeshStorage::get_singleton()->owns_multimesh(p_rid)) { + GLES3::MeshStorage::get_singleton()->multimesh_free(p_rid); + return true; + } else if (GLES3::MeshStorage::get_singleton()->owns_mesh_instance(p_rid)) { + GLES3::MeshStorage::get_singleton()->mesh_instance_free(p_rid); + return true; + } else if (GLES3::LightStorage::get_singleton()->owns_light(p_rid)) { + GLES3::LightStorage::get_singleton()->light_free(p_rid); + return true; + } else { + return false; + } + /* + else if (reflection_probe_owner.owns(p_rid)) { + // delete the texture + ReflectionProbe *reflection_probe = reflection_probe_owner.get_or_null(p_rid); + reflection_probe->instance_remove_deps(); + + reflection_probe_owner.free(p_rid); + memdelete(reflection_probe); + + return true; + } else if (lightmap_capture_data_owner.owns(p_rid)) { + // delete the texture + LightmapCapture *lightmap_capture = lightmap_capture_data_owner.get_or_null(p_rid); + lightmap_capture->instance_remove_deps(); + + lightmap_capture_data_owner.free(p_rid); + memdelete(lightmap_capture); + return true; + + } else if (canvas_occluder_owner.owns(p_rid)) { + CanvasOccluder *co = canvas_occluder_owner.get_or_null(p_rid); + if (co->index_id) { + glDeleteBuffers(1, &co->index_id); + } + if (co->vertex_id) { + glDeleteBuffers(1, &co->vertex_id); + } + + canvas_occluder_owner.free(p_rid); + memdelete(co); + + return true; + + } else if (canvas_light_shadow_owner.owns(p_rid)) { + CanvasLightShadow *cls = canvas_light_shadow_owner.get_or_null(p_rid); + glDeleteFramebuffers(1, &cls->fbo); + glDeleteRenderbuffers(1, &cls->depth); + glDeleteTextures(1, &cls->distance); + canvas_light_shadow_owner.free(p_rid); + memdelete(cls); + + return true; + } + */ +} + +/* DEPENDENCIES */ + +void Utilities::base_update_dependency(RID p_base, DependencyTracker *p_instance) { + if (MeshStorage::get_singleton()->owns_mesh(p_base)) { + Mesh *mesh = MeshStorage::get_singleton()->get_mesh(p_base); + p_instance->update_dependency(&mesh->dependency); + } else if (MeshStorage::get_singleton()->owns_multimesh(p_base)) { + MultiMesh *multimesh = MeshStorage::get_singleton()->get_multimesh(p_base); + p_instance->update_dependency(&multimesh->dependency); + if (multimesh->mesh.is_valid()) { + base_update_dependency(multimesh->mesh, p_instance); + } + } else if (LightStorage::get_singleton()->owns_light(p_base)) { + Light *l = LightStorage::get_singleton()->get_light(p_base); + p_instance->update_dependency(&l->dependency); + } +} + +/* VISIBILITY NOTIFIER */ + +RID Utilities::visibility_notifier_allocate() { + return RID(); +} + +void Utilities::visibility_notifier_initialize(RID p_notifier) { +} + +void Utilities::visibility_notifier_free(RID p_notifier) { +} + +void Utilities::visibility_notifier_set_aabb(RID p_notifier, const AABB &p_aabb) { +} + +void Utilities::visibility_notifier_set_callbacks(RID p_notifier, const Callable &p_enter_callbable, const Callable &p_exit_callable) { +} + +AABB Utilities::visibility_notifier_get_aabb(RID p_notifier) const { + return AABB(); +} + +void Utilities::visibility_notifier_call(RID p_notifier, bool p_enter, bool p_deferred) { +} + +/* TIMING */ + +//void Utilities::render_info_begin_capture() { +// info.snap = info.render; +//} + +//void Utilities::render_info_end_capture() { +// info.snap.object_count = info.render.object_count - info.snap.object_count; +// info.snap.draw_call_count = info.render.draw_call_count - info.snap.draw_call_count; +// info.snap.material_switch_count = info.render.material_switch_count - info.snap.material_switch_count; +// info.snap.surface_switch_count = info.render.surface_switch_count - info.snap.surface_switch_count; +// info.snap.shader_rebind_count = info.render.shader_rebind_count - info.snap.shader_rebind_count; +// info.snap.vertices_count = info.render.vertices_count - info.snap.vertices_count; +// info.snap._2d_item_count = info.render._2d_item_count - info.snap._2d_item_count; +// info.snap._2d_draw_call_count = info.render._2d_draw_call_count - info.snap._2d_draw_call_count; +//} + +//int Utilities::get_captured_render_info(RS::RenderInfo p_info) { +// switch (p_info) { +// case RS::INFO_OBJECTS_IN_FRAME: { +// return info.snap.object_count; +// } break; +// case RS::INFO_VERTICES_IN_FRAME: { +// return info.snap.vertices_count; +// } break; +// case RS::INFO_MATERIAL_CHANGES_IN_FRAME: { +// return info.snap.material_switch_count; +// } break; +// case RS::INFO_SHADER_CHANGES_IN_FRAME: { +// return info.snap.shader_rebind_count; +// } break; +// case RS::INFO_SURFACE_CHANGES_IN_FRAME: { +// return info.snap.surface_switch_count; +// } break; +// case RS::INFO_DRAW_CALLS_IN_FRAME: { +// return info.snap.draw_call_count; +// } break; +// /* +// case RS::INFO_2D_ITEMS_IN_FRAME: { +// return info.snap._2d_item_count; +// } break; +// case RS::INFO_2D_DRAW_CALLS_IN_FRAME: { +// return info.snap._2d_draw_call_count; +// } break; +// */ +// default: { +// return get_render_info(p_info); +// } +// } +//} + +//int Utilities::get_render_info(RS::RenderInfo p_info) { +// switch (p_info) { +// case RS::INFO_OBJECTS_IN_FRAME: +// return info.render_final.object_count; +// case RS::INFO_VERTICES_IN_FRAME: +// return info.render_final.vertices_count; +// case RS::INFO_MATERIAL_CHANGES_IN_FRAME: +// return info.render_final.material_switch_count; +// case RS::INFO_SHADER_CHANGES_IN_FRAME: +// return info.render_final.shader_rebind_count; +// case RS::INFO_SURFACE_CHANGES_IN_FRAME: +// return info.render_final.surface_switch_count; +// case RS::INFO_DRAW_CALLS_IN_FRAME: +// return info.render_final.draw_call_count; +// /* +// case RS::INFO_2D_ITEMS_IN_FRAME: +// return info.render_final._2d_item_count; +// case RS::INFO_2D_DRAW_CALLS_IN_FRAME: +// return info.render_final._2d_draw_call_count; +//*/ +// case RS::INFO_USAGE_VIDEO_MEM_TOTAL: +// return 0; //no idea +// case RS::INFO_VIDEO_MEM_USED: +// return info.vertex_mem + info.texture_mem; +// case RS::INFO_TEXTURE_MEM_USED: +// return info.texture_mem; +// case RS::INFO_VERTEX_MEM_USED: +// return info.vertex_mem; +// default: +// return 0; //no idea either +// } +//} + +/* MISC */ + +void Utilities::update_dirty_resources() { + MaterialStorage::get_singleton()->_update_global_variables(); + MaterialStorage::get_singleton()->_update_queued_materials(); + //MeshStorage::get_singleton()->_update_dirty_skeletons(); + MeshStorage::get_singleton()->_update_dirty_multimeshes(); +} + +void Utilities::set_debug_generate_wireframes(bool p_generate) { +} + +bool Utilities::has_os_feature(const String &p_feature) const { + Config *config = Config::get_singleton(); + if (!config) { + return false; + } + + if (p_feature == "rgtc") { + return config->rgtc_supported; + } + + if (p_feature == "s3tc") { + return config->s3tc_supported; + } + + if (p_feature == "bptc") { + return config->bptc_supported; + } + + if (p_feature == "etc" || p_feature == "etc2") { + return config->etc2_supported; + } + + return false; +} + +void Utilities::update_memory_info() { +} + +uint64_t Utilities::get_rendering_info(RS::RenderingInfo p_info) { + return 0; +} + +String Utilities::get_video_adapter_name() const { + return (const char *)glGetString(GL_RENDERER); +} + +String Utilities::get_video_adapter_vendor() const { + return (const char *)glGetString(GL_VENDOR); +} + +RenderingDevice::DeviceType Utilities::get_video_adapter_type() const { + return RenderingDevice::DeviceType::DEVICE_TYPE_OTHER; +} + +String Utilities::get_video_adapter_api_version() const { + return (const char *)glGetString(GL_VERSION); +} + +#endif // GLES3_ENABLED diff --git a/drivers/gles3/storage/utilities.h b/drivers/gles3/storage/utilities.h new file mode 100644 index 0000000000..523033886c --- /dev/null +++ b/drivers/gles3/storage/utilities.h @@ -0,0 +1,159 @@ +/*************************************************************************/ +/* utilities.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2022 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. */ +/*************************************************************************/ + +#ifndef UTILITIES_GLES3_H +#define UTILITIES_GLES3_H + +#ifdef GLES3_ENABLED + +#include "servers/rendering/storage/utilities.h" + +#include "platform_config.h" +#ifndef OPENGL_INCLUDE_H +#include <GLES3/gl3.h> +#else +#include OPENGL_INCLUDE_H +#endif + +namespace GLES3 { + +class Utilities : public RendererUtilities { +private: + static Utilities *singleton; + +public: + static Utilities *get_singleton() { return singleton; } + + Utilities(); + ~Utilities(); + + // Buffer size is specified in bytes + static Vector<uint8_t> buffer_get_data(GLenum p_target, GLuint p_buffer, uint32_t p_buffer_size); + + /* INSTANCES */ + + virtual RS::InstanceType get_base_type(RID p_rid) const override; + virtual bool free(RID p_rid) override; + + /* DEPENDENCIES */ + + virtual void base_update_dependency(RID p_base, DependencyTracker *p_instance) override; + + /* VISIBILITY NOTIFIER */ + virtual RID visibility_notifier_allocate() override; + virtual void visibility_notifier_initialize(RID p_notifier) override; + virtual void visibility_notifier_free(RID p_notifier) override; + + virtual void visibility_notifier_set_aabb(RID p_notifier, const AABB &p_aabb) override; + virtual void visibility_notifier_set_callbacks(RID p_notifier, const Callable &p_enter_callbable, const Callable &p_exit_callable) override; + + virtual AABB visibility_notifier_get_aabb(RID p_notifier) const override; + virtual void visibility_notifier_call(RID p_notifier, bool p_enter, bool p_deferred) override; + + /* TIMING */ + + struct Info { + uint64_t texture_mem = 0; + uint64_t vertex_mem = 0; + + struct Render { + uint32_t object_count; + uint32_t draw_call_count; + uint32_t material_switch_count; + uint32_t surface_switch_count; + uint32_t shader_rebind_count; + uint32_t vertices_count; + uint32_t _2d_item_count; + uint32_t _2d_draw_call_count; + + void reset() { + object_count = 0; + draw_call_count = 0; + material_switch_count = 0; + surface_switch_count = 0; + shader_rebind_count = 0; + vertices_count = 0; + _2d_item_count = 0; + _2d_draw_call_count = 0; + } + } render, render_final, snap; + + Info() { + render.reset(); + render_final.reset(); + } + + } info; + + virtual void capture_timestamps_begin() override {} + virtual void capture_timestamp(const String &p_name) override {} + virtual uint32_t get_captured_timestamps_count() const override { + return 0; + } + virtual uint64_t get_captured_timestamps_frame() const override { + return 0; + } + virtual uint64_t get_captured_timestamp_gpu_time(uint32_t p_index) const override { + return 0; + } + virtual uint64_t get_captured_timestamp_cpu_time(uint32_t p_index) const override { + return 0; + } + virtual String get_captured_timestamp_name(uint32_t p_index) const override { + return String(); + } + + // void render_info_begin_capture() override; + // void render_info_end_capture() override; + // int get_captured_render_info(RS::RenderInfo p_info) override; + + // int get_render_info(RS::RenderInfo p_info) override; + + /* MISC */ + + virtual void update_dirty_resources() override; + virtual void set_debug_generate_wireframes(bool p_generate) override; + + virtual bool has_os_feature(const String &p_feature) const override; + + virtual void update_memory_info() override; + + virtual uint64_t get_rendering_info(RS::RenderingInfo p_info) override; + virtual String get_video_adapter_name() const override; + virtual String get_video_adapter_vendor() const override; + virtual RenderingDevice::DeviceType get_video_adapter_type() const override; + virtual String get_video_adapter_api_version() const override; +}; + +} // namespace GLES3 + +#endif // GLES3_ENABLED + +#endif // !UTILITIES_GLES3_H diff --git a/drivers/unix/dir_access_unix.cpp b/drivers/unix/dir_access_unix.cpp index c4b42806fd..39dbadf3cd 100644 --- a/drivers/unix/dir_access_unix.cpp +++ b/drivers/unix/dir_access_unix.cpp @@ -343,7 +343,7 @@ Error DirAccessUnix::change_dir(String p_dir) { String prev_dir; char real_current_dir_name[2048]; ERR_FAIL_COND_V(getcwd(real_current_dir_name, 2048) == nullptr, ERR_BUG); - if (prev_dir.parse_utf8(real_current_dir_name)) { + if (prev_dir.parse_utf8(real_current_dir_name) != OK) { prev_dir = real_current_dir_name; //no utf8, maybe latin? } @@ -505,7 +505,7 @@ DirAccessUnix::DirAccessUnix() { // set current directory to an absolute path of the current directory char real_current_dir_name[2048]; ERR_FAIL_COND(getcwd(real_current_dir_name, 2048) == nullptr); - if (current_dir.parse_utf8(real_current_dir_name)) { + if (current_dir.parse_utf8(real_current_dir_name) != OK) { current_dir = real_current_dir_name; } diff --git a/drivers/unix/os_unix.cpp b/drivers/unix/os_unix.cpp index 52a4d538e1..091287c652 100644 --- a/drivers/unix/os_unix.cpp +++ b/drivers/unix/os_unix.cpp @@ -313,7 +313,12 @@ Error OS_Unix::execute(const String &p_path, const List<String> &p_arguments, St if (p_pipe_mutex) { p_pipe_mutex->lock(); } - (*r_pipe) += String::utf8(buf); + String pipe_out; + if (pipe_out.parse_utf8(buf) == OK) { + (*r_pipe) += pipe_out; + } else { + (*r_pipe) += String(buf); // If not valid UTF-8 try decode as Latin-1 + } if (p_pipe_mutex) { p_pipe_mutex->unlock(); } diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp index e612130041..500a3df127 100644 --- a/editor/animation_track_editor.cpp +++ b/editor/animation_track_editor.cpp @@ -1577,10 +1577,10 @@ void AnimationTimelineEdit::_notification(int p_what) { int decimals = 2; bool step_found = false; - const float period_width = font->get_char_size('.', 0, font_size).width; - float max_digit_width = font->get_char_size('0', 0, font_size).width; + const float period_width = font->get_char_size('.', font_size).width; + float max_digit_width = font->get_char_size('0', font_size).width; for (int i = 1; i <= 9; i++) { - const float digit_width = font->get_char_size('0' + i, 0, font_size).width; + const float digit_width = font->get_char_size('0' + i, font_size).width; max_digit_width = MAX(digit_width, max_digit_width); } const int max_sc = int(Math::ceil(zoomw / scale)); @@ -1628,7 +1628,7 @@ void AnimationTimelineEdit::_notification(int p_what) { draw_line(Point2(get_name_limit() + i, 0), Point2(get_name_limit() + i, h), linecolor, Math::round(EDSCALE)); draw_string(font, Point2(get_name_limit() + i + 3 * EDSCALE, (h - font->get_height(font_size)) / 2 + font->get_ascent(font_size)).floor(), itos(frame), HORIZONTAL_ALIGNMENT_LEFT, zoomw - i, font_size, sub ? color_time_dec : color_time_sec); - prev_frame_ofs = i + font->get_string_size(itos(frame), font_size).x + 5 * EDSCALE; + prev_frame_ofs = i + font->get_string_size(itos(frame), HORIZONTAL_ALIGNMENT_LEFT, -1, font_size).x + 5 * EDSCALE; } } } diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp index 272de725c8..a1979c7619 100644 --- a/editor/code_editor.cpp +++ b/editor/code_editor.cpp @@ -1636,30 +1636,35 @@ void CodeTextEditor::_apply_settings_change() { _update_text_editor_theme(); font_size = EditorSettings::get_singleton()->get("interface/editor/code_font_size"); - int ot_mode = EditorSettings::get_singleton()->get("interface/editor/code_font_contextual_ligatures"); - switch (ot_mode) { - case 1: { // Disable ligatures. - text_editor->clear_opentype_features(); - text_editor->set_opentype_feature("calt", 0); - } break; - case 2: { // Custom. - text_editor->clear_opentype_features(); - Vector<String> subtag = String(EditorSettings::get_singleton()->get("interface/editor/code_font_custom_opentype_features")).split(","); - Dictionary ftrs; - for (int i = 0; i < subtag.size(); i++) { - Vector<String> subtag_a = subtag[i].split("="); - if (subtag_a.size() == 2) { - text_editor->set_opentype_feature(subtag_a[0], subtag_a[1].to_int()); - } else if (subtag_a.size() == 1) { - text_editor->set_opentype_feature(subtag_a[0], 1); + + Ref<FontVariation> fc = text_editor->get_theme_font(SNAME("font")); + if (fc.is_valid()) { + switch (ot_mode) { + case 1: { // Disable ligatures. + Dictionary ftrs; + ftrs[TS->name_to_tag("calt")] = 0; + fc->set_opentype_features(ftrs); + } break; + case 2: { // Custom. + Vector<String> subtag = String(EditorSettings::get_singleton()->get("interface/editor/code_font_custom_opentype_features")).split(","); + Dictionary ftrs; + for (int i = 0; i < subtag.size(); i++) { + Vector<String> subtag_a = subtag[i].split("="); + if (subtag_a.size() == 2) { + ftrs[TS->name_to_tag(subtag_a[0])] = subtag_a[1].to_int(); + } else if (subtag_a.size() == 1) { + ftrs[TS->name_to_tag(subtag_a[0])] = 1; + } } - } - } break; - default: { // Default. - text_editor->clear_opentype_features(); - text_editor->set_opentype_feature("calt", 1); - } break; + fc->set_opentype_features(ftrs); + } break; + default: { // Default. + Dictionary ftrs; + ftrs[TS->name_to_tag("calt")] = 1; + fc->set_opentype_features(ftrs); + } break; + } } text_editor->set_code_hint_draw_below(EDITOR_GET("text_editor/completion/put_callhint_tooltip_below_current_line")); @@ -1862,29 +1867,35 @@ CodeTextEditor::CodeTextEditor() { text_editor->set_v_size_flags(SIZE_EXPAND_FILL); int ot_mode = EditorSettings::get_singleton()->get("interface/editor/code_font_contextual_ligatures"); - switch (ot_mode) { - case 1: { // Disable ligatures. - text_editor->clear_opentype_features(); - text_editor->set_opentype_feature("calt", 0); - } break; - case 2: { // Custom. - text_editor->clear_opentype_features(); - Vector<String> subtag = String(EditorSettings::get_singleton()->get("interface/editor/code_font_custom_opentype_features")).split(","); - Dictionary ftrs; - for (int i = 0; i < subtag.size(); i++) { - Vector<String> subtag_a = subtag[i].split("="); - if (subtag_a.size() == 2) { - text_editor->set_opentype_feature(subtag_a[0], subtag_a[1].to_int()); - } else if (subtag_a.size() == 1) { - text_editor->set_opentype_feature(subtag_a[0], 1); + Ref<FontVariation> fc = text_editor->get_theme_font(SNAME("font")); + if (fc.is_valid()) { + switch (ot_mode) { + case 1: { // Disable ligatures. + Dictionary ftrs; + ftrs[TS->name_to_tag("calt")] = 0; + fc->set_opentype_features(ftrs); + } break; + case 2: { // Custom. + Vector<String> subtag = String(EditorSettings::get_singleton()->get("interface/editor/code_font_custom_opentype_features")).split(","); + Dictionary ftrs; + for (int i = 0; i < subtag.size(); i++) { + Vector<String> subtag_a = subtag[i].split("="); + if (subtag_a.size() == 2) { + ftrs[TS->name_to_tag(subtag_a[0])] = subtag_a[1].to_int(); + } else if (subtag_a.size() == 1) { + ftrs[TS->name_to_tag(subtag_a[0])] = 1; + } } - } - } break; - default: { // Default. - text_editor->clear_opentype_features(); - text_editor->set_opentype_feature("calt", 1); - } break; + fc->set_opentype_features(ftrs); + } break; + default: { // Default. + Dictionary ftrs; + ftrs[TS->name_to_tag("calt")] = 1; + fc->set_opentype_features(ftrs); + } break; + } } + text_editor->add_theme_font_override("font", fc); text_editor->set_draw_line_numbers(true); text_editor->set_highlight_matching_braces_enabled(true); diff --git a/editor/debugger/editor_performance_profiler.cpp b/editor/debugger/editor_performance_profiler.cpp index 764e842539..50eef7b8b8 100644 --- a/editor/debugger/editor_performance_profiler.cpp +++ b/editor/debugger/editor_performance_profiler.cpp @@ -136,7 +136,7 @@ void EditorPerformanceProfiler::_monitor_draw() { monitor_draw->draw_string(graph_font, rect.position + Point2(0, graph_font->get_ascent(font_size)), current.item->get_text(0), HORIZONTAL_ALIGNMENT_LEFT, rect.size.x, font_size, draw_color); draw_color.a = 0.9f; - float value_position = rect.size.width - graph_font->get_string_size(current.item->get_text(1), font_size).width; + float value_position = rect.size.width - graph_font->get_string_size(current.item->get_text(1), HORIZONTAL_ALIGNMENT_LEFT, -1, font_size).width; if (value_position < 0) { value_position = 0; } @@ -184,7 +184,7 @@ void EditorPerformanceProfiler::_monitor_draw() { monitor_draw->draw_line(rect.position + Point2(from, 0), rect.position + Point2(from, rect.size.y), line_color, Math::round(EDSCALE)); String label = _create_label(e->get(), current.type); - Size2 size = graph_font->get_string_size(label, font_size); + Size2 size = graph_font->get_string_size(label, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size); Vector2 text_top_left_position = Vector2(from, h2) - (size + Vector2(MARKER_MARGIN, MARKER_MARGIN)); if (text_top_left_position.x < 0) { text_top_left_position.x = from + MARKER_MARGIN; diff --git a/editor/debugger/editor_visual_profiler.cpp b/editor/debugger/editor_visual_profiler.cpp index 9def646f3f..59482db674 100644 --- a/editor/debugger/editor_visual_profiler.cpp +++ b/editor/debugger/editor_visual_profiler.cpp @@ -469,7 +469,7 @@ void EditorVisualProfiler::_graph_tex_draw() { graph->draw_line(Vector2(0, frame_y), Vector2(half_width, frame_y), color * Color(1, 1, 1, 0.5)); const String limit_str = String::num(graph_limit, 2) + " ms"; - graph->draw_string(font, Vector2(half_width - font->get_string_size(limit_str, font_size).x - 2, frame_y - 2), limit_str, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, color * Color(1, 1, 1, 0.75)); + graph->draw_string(font, Vector2(half_width - font->get_string_size(limit_str, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size).x - 2, frame_y - 2), limit_str, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, color * Color(1, 1, 1, 0.75)); } if (graph_height_gpu > 0) { @@ -480,11 +480,11 @@ void EditorVisualProfiler::_graph_tex_draw() { graph->draw_line(Vector2(half_width, frame_y), Vector2(graph->get_size().x, frame_y), color * Color(1, 1, 1, 0.5)); const String limit_str = String::num(graph_limit, 2) + " ms"; - graph->draw_string(font, Vector2(half_width * 2 - font->get_string_size(limit_str, font_size).x - 2, frame_y - 2), limit_str, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, color * Color(1, 1, 1, 0.75)); + graph->draw_string(font, Vector2(half_width * 2 - font->get_string_size(limit_str, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size).x - 2, frame_y - 2), limit_str, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, color * Color(1, 1, 1, 0.75)); } - graph->draw_string(font, Vector2(font->get_string_size("X", font_size).x, font->get_ascent(font_size) + 2), "CPU:", HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, color * Color(1, 1, 1)); - graph->draw_string(font, Vector2(font->get_string_size("X", font_size).x + graph->get_size().width / 2, font->get_ascent(font_size) + 2), "GPU:", HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, color * Color(1, 1, 1)); + graph->draw_string(font, Vector2(font->get_string_size("X", HORIZONTAL_ALIGNMENT_LEFT, -1, font_size).x, font->get_ascent(font_size) + 2), "CPU:", HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, color * Color(1, 1, 1)); + graph->draw_string(font, Vector2(font->get_string_size("X", HORIZONTAL_ALIGNMENT_LEFT, -1, font_size).x + graph->get_size().width / 2, font->get_ascent(font_size) + 2), "GPU:", HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, color * Color(1, 1, 1)); } void EditorVisualProfiler::_graph_tex_mouse_exit() { diff --git a/editor/debugger/script_editor_debugger.cpp b/editor/debugger/script_editor_debugger.cpp index 408d6af022..f8b82ecc51 100644 --- a/editor/debugger/script_editor_debugger.cpp +++ b/editor/debugger/script_editor_debugger.cpp @@ -1422,6 +1422,10 @@ bool ScriptEditorDebugger::is_skip_breakpoints() { void ScriptEditorDebugger::_error_activated() { TreeItem *selected = error_tree->get_selected(); + if (!selected) { + return; + } + TreeItem *ci = selected->get_first_child(); if (ci) { selected->set_collapsed(!selected->is_collapsed()); @@ -1430,6 +1434,11 @@ void ScriptEditorDebugger::_error_activated() { void ScriptEditorDebugger::_error_selected() { TreeItem *selected = error_tree->get_selected(); + + if (!selected) { + return; + } + Array meta = selected->get_metadata(0); if (meta.size() == 0) { return; diff --git a/editor/doc_tools.cpp b/editor/doc_tools.cpp index e6cd1e0b48..a6c7970264 100644 --- a/editor/doc_tools.cpp +++ b/editor/doc_tools.cpp @@ -178,6 +178,20 @@ void DocTools::merge_from(const DocTools &p_data) { } } + for (int i = 0; i < c.annotations.size(); i++) { + DocData::MethodDoc &m = c.annotations.write[i]; + + for (int j = 0; j < cf.annotations.size(); j++) { + if (cf.annotations[j].name != m.name) { + continue; + } + const DocData::MethodDoc &mf = cf.annotations[j]; + + m.description = mf.description; + break; + } + } + for (int i = 0; i < c.properties.size(); i++) { DocData::PropertyDoc &p = c.properties.write[i]; @@ -429,7 +443,7 @@ void DocTools::generate(bool p_basic_types) { PropertyInfo retinfo = mb->get_return_info(); found_type = true; - if (retinfo.type == Variant::INT && retinfo.usage & PROPERTY_USAGE_CLASS_IS_ENUM) { + if (retinfo.type == Variant::INT && retinfo.usage & (PROPERTY_USAGE_CLASS_IS_ENUM | PROPERTY_USAGE_CLASS_IS_BITFIELD)) { prop.enumeration = retinfo.class_name; prop.type = "int"; } else if (retinfo.class_name != StringName()) { @@ -575,6 +589,7 @@ void DocTools::generate(bool p_basic_types) { constant.value = itos(ClassDB::get_integer_constant(name, E)); constant.is_value_valid = true; constant.enumeration = ClassDB::get_integer_constant_enum(name, E); + constant.is_bitfield = ClassDB::is_enum_bitfield(name, constant.enumeration); c.constants.push_back(constant); } @@ -959,8 +974,41 @@ void DocTools::generate(bool p_basic_types) { c.constants.push_back(cd); } + // Get annotations. + List<MethodInfo> ainfo; + lang->get_public_annotations(&ainfo); + + for (const MethodInfo &ai : ainfo) { + DocData::MethodDoc atd; + atd.name = ai.name; + + if (ai.flags & METHOD_FLAG_VARARG) { + if (!atd.qualifiers.is_empty()) { + atd.qualifiers += " "; + } + atd.qualifiers += "vararg"; + } + + DocData::return_doc_from_retinfo(atd, ai.return_val); + + for (int j = 0; j < ai.arguments.size(); j++) { + DocData::ArgumentDoc ad; + DocData::argument_doc_from_arginfo(ad, ai.arguments[j]); + + int darg_idx = j - (ai.arguments.size() - ai.default_arguments.size()); + if (darg_idx >= 0) { + Variant default_arg = ai.default_arguments[darg_idx]; + ad.default_value = default_arg.get_construct_string().replace("\n", " "); + } + + atd.arguments.push_back(ad); + } + + c.annotations.push_back(atd); + } + // Skip adding the lang if it doesn't expose anything (e.g. C#). - if (c.methods.is_empty() && c.constants.is_empty()) { + if (c.methods.is_empty() && c.constants.is_empty() && c.annotations.is_empty()) { continue; } @@ -1162,6 +1210,9 @@ Error DocTools::_load(Ref<XMLParser> parser) { } else if (name2 == "signals") { Error err2 = _parse_methods(parser, c.signals); ERR_FAIL_COND_V(err2, err2); + } else if (name2 == "annotations") { + Error err2 = _parse_methods(parser, c.annotations); + ERR_FAIL_COND_V(err2, err2); } else if (name2 == "members") { while (parser->read() == OK) { if (parser->get_node_type() == XMLParser::NODE_ELEMENT) { @@ -1244,6 +1295,9 @@ Error DocTools::_load(Ref<XMLParser> parser) { if (parser->has_attribute("enum")) { constant2.enumeration = parser->get_attribute_value("enum"); } + if (parser->has_attribute("is_bitfield")) { + constant2.is_bitfield = parser->get_attribute_value("is_bitfield").to_lower() == "true"; + } if (!parser->is_empty()) { parser->read(); if (parser->get_node_type() == XMLParser::NODE_TEXT) { @@ -1424,7 +1478,11 @@ Error DocTools::save_classes(const String &p_default_path, const HashMap<String, const DocData::ConstantDoc &k = c.constants[i]; if (k.is_value_valid) { if (!k.enumeration.is_empty()) { - _write_string(f, 2, "<constant name=\"" + k.name + "\" value=\"" + k.value + "\" enum=\"" + k.enumeration + "\">"); + if (k.is_bitfield) { + _write_string(f, 2, "<constant name=\"" + k.name + "\" value=\"" + k.value + "\" enum=\"" + k.enumeration + "\" is_bitfield=\"true\">"); + } else { + _write_string(f, 2, "<constant name=\"" + k.name + "\" value=\"" + k.value + "\" enum=\"" + k.enumeration + "\">"); + } } else { _write_string(f, 2, "<constant name=\"" + k.name + "\" value=\"" + k.value + "\">"); } @@ -1442,6 +1500,8 @@ Error DocTools::save_classes(const String &p_default_path, const HashMap<String, _write_string(f, 1, "</constants>"); } + _write_method_doc(f, "annotation", c.annotations); + if (!c.theme_properties.is_empty()) { c.theme_properties.sort(); diff --git a/editor/editor_audio_buses.cpp b/editor/editor_audio_buses.cpp index 89dc106717..fd121e73ab 100644 --- a/editor/editor_audio_buses.cpp +++ b/editor/editor_audio_buses.cpp @@ -1394,7 +1394,7 @@ Size2 EditorAudioMeterNotches::get_minimum_size() const { for (int i = 0; i < notches.size(); i++) { if (notches[i].render_db_value) { - width = MAX(width, font->get_string_size(String::num(Math::abs(notches[i].db_value)) + "dB", font_size).x); + width = MAX(width, font->get_string_size(String::num(Math::abs(notches[i].db_value)) + "dB", HORIZONTAL_ALIGNMENT_LEFT, -1, font_size).x); height += font_height; } } diff --git a/editor/editor_data.cpp b/editor/editor_data.cpp index 64c234a07c..e9e3320a3d 100644 --- a/editor/editor_data.cpp +++ b/editor/editor_data.cpp @@ -534,6 +534,7 @@ void EditorData::remove_scene(int p_idx) { } memdelete(edited_scene[p_idx].root); + edited_scene.write[p_idx].root = nullptr; } if (current_edited_scene > p_idx) { diff --git a/editor/editor_fonts.cpp b/editor/editor_fonts.cpp index 51d4d474c5..d58dc98f07 100644 --- a/editor/editor_fonts.cpp +++ b/editor/editor_fonts.cpp @@ -37,212 +37,8 @@ #include "scene/resources/default_theme/default_theme.h" #include "scene/resources/font.h" -#define MAKE_FALLBACKS(m_name) \ - m_name->add_data(FontArabic); \ - m_name->add_data(FontBengali); \ - m_name->add_data(FontDevanagari); \ - m_name->add_data(FontGeorgian); \ - m_name->add_data(FontHebrew); \ - m_name->add_data(FontMalayalam); \ - m_name->add_data(FontOriya); \ - m_name->add_data(FontSinhala); \ - m_name->add_data(FontTamil); \ - m_name->add_data(FontTelugu); \ - m_name->add_data(FontThai); \ - m_name->add_data(FontJapanese); \ - m_name->add_data(FontFallback); - -// Note: In some languages, the use of italic/slanted fonts is controversial. Therefore, we are limiting simulated slant to the main font (Latin, Cyrillic, and Greek) and using bold fonts for the rest. - -#define MAKE_FALLBACKS_SLANTED(m_name) \ - m_name->add_data(FontArabicBold); \ - m_name->add_data(FontBengaliBold); \ - m_name->add_data(FontDevanagariBold); \ - m_name->add_data(FontGeorgianBold); \ - m_name->add_data(FontHebrewBold); \ - m_name->add_data(FontMalayalamBold); \ - m_name->add_data(FontOriyaBold); \ - m_name->add_data(FontSinhalaBold); \ - m_name->add_data(FontTamilBold); \ - m_name->add_data(FontTeluguBold); \ - m_name->add_data(FontThaiBold); \ - m_name->add_data(FontJapaneseBold); \ - m_name->add_data(FontFallbackBold); - -#define MAKE_FALLBACKS_BOLD(m_name) \ - m_name->add_data(FontArabicBold); \ - m_name->add_data(FontBengaliBold); \ - m_name->add_data(FontDevanagariBold); \ - m_name->add_data(FontGeorgianBold); \ - m_name->add_data(FontHebrewBold); \ - m_name->add_data(FontMalayalamBold); \ - m_name->add_data(FontOriyaBold); \ - m_name->add_data(FontSinhalaBold); \ - m_name->add_data(FontTamilBold); \ - m_name->add_data(FontTeluguBold); \ - m_name->add_data(FontThaiBold); \ - m_name->add_data(FontJapaneseBold); \ - m_name->add_data(FontFallbackBold); - -#define MAKE_DEFAULT_FONT(m_name, m_variations) \ - Ref<Font> m_name; \ - m_name.instantiate(); \ - if (CustomFont.is_valid()) { \ - m_name->add_data(CustomFont); \ - m_name->add_data(DefaultFont); \ - } else { \ - m_name->add_data(DefaultFont); \ - } \ - { \ - Dictionary variations; \ - if (!m_variations.is_empty()) { \ - Vector<String> variation_tags = m_variations.split(","); \ - for (int i = 0; i < variation_tags.size(); i++) { \ - Vector<String> tokens = variation_tags[i].split("="); \ - if (tokens.size() == 2) { \ - variations[tokens[0]] = tokens[1].to_float(); \ - } \ - } \ - } \ - m_name->set_variation_coordinates(variations); \ - } \ - m_name->set_spacing(TextServer::SPACING_TOP, -EDSCALE); \ - m_name->set_spacing(TextServer::SPACING_BOTTOM, -EDSCALE); \ - MAKE_FALLBACKS(m_name); - -#define MAKE_DEFAULT_FONT_MSDF(m_name, m_variations) \ - Ref<Font> m_name; \ - m_name.instantiate(); \ - if (CustomFont.is_valid()) { \ - m_name->add_data(CustomFontMSDF); \ - m_name->add_data(DefaultFontMSDF); \ - } else { \ - m_name->add_data(DefaultFontMSDF); \ - } \ - { \ - Dictionary variations; \ - if (!m_variations.is_empty()) { \ - Vector<String> variation_tags = m_variations.split(","); \ - for (int i = 0; i < variation_tags.size(); i++) { \ - Vector<String> tokens = variation_tags[i].split("="); \ - if (tokens.size() == 2) { \ - variations[tokens[0]] = tokens[1].to_float(); \ - } \ - } \ - } \ - m_name->set_variation_coordinates(variations); \ - } \ - m_name->set_spacing(TextServer::SPACING_TOP, -EDSCALE); \ - m_name->set_spacing(TextServer::SPACING_BOTTOM, -EDSCALE); \ - MAKE_FALLBACKS(m_name); - -#define MAKE_SLANTED_FONT(m_name, m_variations) \ - Ref<Font> m_name; \ - m_name.instantiate(); \ - m_name.instantiate(); \ - if (CustomFontSlanted.is_valid()) { \ - m_name->add_data(CustomFontSlanted); \ - m_name->add_data(DefaultFontSlanted); \ - } else { \ - m_name->add_data(DefaultFontSlanted); \ - } \ - { \ - Dictionary variations; \ - if (!m_variations.is_empty()) { \ - Vector<String> variation_tags = m_variations.split(","); \ - for (int i = 0; i < variation_tags.size(); i++) { \ - Vector<String> tokens = variation_tags[i].split("="); \ - if (tokens.size() == 2) { \ - variations[tokens[0]] = tokens[1].to_float(); \ - } \ - } \ - } \ - m_name->set_variation_coordinates(variations); \ - } \ - m_name->set_spacing(TextServer::SPACING_TOP, -EDSCALE); \ - m_name->set_spacing(TextServer::SPACING_BOTTOM, -EDSCALE); \ - MAKE_FALLBACKS_SLANTED(m_name); - -#define MAKE_BOLD_FONT(m_name, m_variations) \ - Ref<Font> m_name; \ - m_name.instantiate(); \ - if (CustomFontBold.is_valid()) { \ - m_name->add_data(CustomFontBold); \ - m_name->add_data(DefaultFontBold); \ - } else { \ - m_name->add_data(DefaultFontBold); \ - } \ - { \ - Dictionary variations; \ - if (!m_variations.is_empty()) { \ - Vector<String> variation_tags = m_variations.split(","); \ - for (int i = 0; i < variation_tags.size(); i++) { \ - Vector<String> tokens = variation_tags[i].split("="); \ - if (tokens.size() == 2) { \ - variations[tokens[0]] = tokens[1].to_float(); \ - } \ - } \ - } \ - m_name->set_variation_coordinates(variations); \ - } \ - m_name->set_spacing(TextServer::SPACING_TOP, -EDSCALE); \ - m_name->set_spacing(TextServer::SPACING_BOTTOM, -EDSCALE); \ - MAKE_FALLBACKS_BOLD(m_name); - -#define MAKE_BOLD_FONT_MSDF(m_name, m_variations) \ - Ref<Font> m_name; \ - m_name.instantiate(); \ - if (CustomFontBold.is_valid()) { \ - m_name->add_data(CustomFontBoldMSDF); \ - m_name->add_data(DefaultFontBoldMSDF); \ - } else { \ - m_name->add_data(DefaultFontBoldMSDF); \ - } \ - { \ - Dictionary variations; \ - if (!m_variations.is_empty()) { \ - Vector<String> variation_tags = m_variations.split(","); \ - for (int i = 0; i < variation_tags.size(); i++) { \ - Vector<String> tokens = variation_tags[i].split("="); \ - if (tokens.size() == 2) { \ - variations[tokens[0]] = tokens[1].to_float(); \ - } \ - } \ - } \ - m_name->set_variation_coordinates(variations); \ - } \ - m_name->set_spacing(TextServer::SPACING_TOP, -EDSCALE); \ - m_name->set_spacing(TextServer::SPACING_BOTTOM, -EDSCALE); \ - MAKE_FALLBACKS_BOLD(m_name); - -#define MAKE_SOURCE_FONT(m_name, m_variations) \ - Ref<Font> m_name; \ - m_name.instantiate(); \ - if (CustomFontSource.is_valid()) { \ - m_name->add_data(CustomFontSource); \ - m_name->add_data(dfmono); \ - } else { \ - m_name->add_data(dfmono); \ - } \ - { \ - Dictionary variations; \ - if (!m_variations.is_empty()) { \ - Vector<String> variation_tags = m_variations.split(","); \ - for (int i = 0; i < variation_tags.size(); i++) { \ - Vector<String> tokens = variation_tags[i].split("="); \ - if (tokens.size() == 2) { \ - variations[tokens[0]] = tokens[1].to_float(); \ - } \ - } \ - } \ - m_name->set_variation_coordinates(variations); \ - } \ - m_name->set_spacing(TextServer::SPACING_TOP, -EDSCALE); \ - m_name->set_spacing(TextServer::SPACING_BOTTOM, -EDSCALE); \ - MAKE_FALLBACKS(m_name); - -Ref<FontData> load_cached_external_font(const String &p_path, TextServer::Hinting p_hinting, bool p_aa, bool p_autohint, TextServer::SubpixelPositioning p_font_subpixel_positioning, bool p_msdf = false) { - Ref<FontData> font; +Ref<FontFile> load_external_font(const String &p_path, TextServer::Hinting p_hinting, bool p_aa, bool p_autohint, TextServer::SubpixelPositioning p_font_subpixel_positioning, bool p_msdf = false, TypedArray<Font> *r_fallbacks = nullptr) { + Ref<FontFile> font; font.instantiate(); Vector<uint8_t> data = FileAccess::get_file_as_array(p_path); @@ -254,11 +50,15 @@ Ref<FontData> load_cached_external_font(const String &p_path, TextServer::Hintin font->set_force_autohinter(p_autohint); font->set_subpixel_positioning(p_font_subpixel_positioning); + if (r_fallbacks != nullptr) { + r_fallbacks->push_back(font); + } + return font; } -Ref<FontData> load_cached_internal_font(const uint8_t *p_data, size_t p_size, TextServer::Hinting p_hinting, bool p_aa, bool p_autohint, TextServer::SubpixelPositioning p_font_subpixel_positioning, bool p_msdf = false) { - Ref<FontData> font; +Ref<FontFile> load_internal_font(const uint8_t *p_data, size_t p_size, TextServer::Hinting p_hinting, bool p_aa, bool p_autohint, TextServer::SubpixelPositioning p_font_subpixel_positioning, bool p_msdf = false, TypedArray<Font> *r_fallbacks = nullptr) { + Ref<FontFile> font; font.instantiate(); font->set_data_ptr(p_data, p_size); @@ -268,14 +68,29 @@ Ref<FontData> load_cached_internal_font(const uint8_t *p_data, size_t p_size, Te font->set_force_autohinter(p_autohint); font->set_subpixel_positioning(p_font_subpixel_positioning); + if (r_fallbacks != nullptr) { + r_fallbacks->push_back(font); + } + return font; } +Ref<FontVariation> make_bold_font(const Ref<Font> &p_font, double p_embolden, TypedArray<Font> *r_fallbacks = nullptr) { + Ref<FontVariation> font_var; + font_var.instantiate(); + font_var->set_base_font(p_font); + font_var->set_variation_embolden(p_embolden); + + if (r_fallbacks != nullptr) { + r_fallbacks->push_back(font_var); + } + + return font_var; +} + void editor_register_fonts(Ref<Theme> p_theme) { Ref<DirAccess> dir = DirAccess::create(DirAccess::ACCESS_FILESYSTEM); - /* Custom font */ - bool font_antialiased = (bool)EditorSettings::get_singleton()->get("interface/editor/font_antialiased"); int font_hinting_setting = (int)EditorSettings::get_singleton()->get("interface/editor/font_hinting"); TextServer::SubpixelPositioning font_subpixel_positioning = (TextServer::SubpixelPositioning)(int)EditorSettings::get_singleton()->get("interface/editor/font_subpixel_positioning"); @@ -304,184 +119,268 @@ void editor_register_fonts(Ref<Theme> p_theme) { break; } + // Load built-in fonts. const int default_font_size = int(EDITOR_GET("interface/editor/main_font_size")) * EDSCALE; const float embolden_strength = 0.6; + Ref<Font> default_font = load_internal_font(_font_NotoSans_Regular, _font_NotoSans_Regular_size, font_hinting, font_antialiased, true, font_subpixel_positioning, false); + Ref<Font> default_font_msdf = load_internal_font(_font_NotoSans_Regular, _font_NotoSans_Regular_size, font_hinting, font_antialiased, true, font_subpixel_positioning, true); + + TypedArray<Font> fallbacks; + Ref<FontFile> arabic_font = load_internal_font(_font_NotoNaskhArabicUI_Regular, _font_NotoNaskhArabicUI_Regular_size, font_hinting, font_antialiased, true, font_subpixel_positioning, false, &fallbacks); + Ref<FontFile> bengali_font = load_internal_font(_font_NotoSansBengaliUI_Regular, _font_NotoSansBengaliUI_Regular_size, font_hinting, font_antialiased, true, font_subpixel_positioning, false, &fallbacks); + Ref<FontFile> devanagari_font = load_internal_font(_font_NotoSansDevanagariUI_Regular, _font_NotoSansDevanagariUI_Regular_size, font_hinting, font_antialiased, true, font_subpixel_positioning, false, &fallbacks); + Ref<FontFile> georgian_font = load_internal_font(_font_NotoSansGeorgian_Regular, _font_NotoSansGeorgian_Regular_size, font_hinting, font_antialiased, true, font_subpixel_positioning, false, &fallbacks); + Ref<FontFile> hebrew_font = load_internal_font(_font_NotoSansHebrew_Regular, _font_NotoSansHebrew_Regular_size, font_hinting, font_antialiased, true, font_subpixel_positioning, false, &fallbacks); + Ref<FontFile> malayalam_font = load_internal_font(_font_NotoSansMalayalamUI_Regular, _font_NotoSansMalayalamUI_Regular_size, font_hinting, font_antialiased, true, font_subpixel_positioning, false, &fallbacks); + Ref<FontFile> oriya_font = load_internal_font(_font_NotoSansOriyaUI_Regular, _font_NotoSansOriyaUI_Regular_size, font_hinting, font_antialiased, true, font_subpixel_positioning, false, &fallbacks); + Ref<FontFile> sinhala_font = load_internal_font(_font_NotoSansSinhalaUI_Regular, _font_NotoSansSinhalaUI_Regular_size, font_hinting, font_antialiased, true, font_subpixel_positioning, false, &fallbacks); + Ref<FontFile> tamil_font = load_internal_font(_font_NotoSansTamilUI_Regular, _font_NotoSansTamilUI_Regular_size, font_hinting, font_antialiased, true, font_subpixel_positioning, false, &fallbacks); + Ref<FontFile> telugu_font = load_internal_font(_font_NotoSansTeluguUI_Regular, _font_NotoSansTeluguUI_Regular_size, font_hinting, font_antialiased, true, font_subpixel_positioning, false, &fallbacks); + Ref<FontFile> thai_font = load_internal_font(_font_NotoSansThaiUI_Regular, _font_NotoSansThaiUI_Regular_size, font_hinting, font_antialiased, true, font_subpixel_positioning, false, &fallbacks); + Ref<FontFile> fallback_font = load_internal_font(_font_DroidSansFallback, _font_DroidSansFallback_size, font_hinting, font_antialiased, true, font_subpixel_positioning, false, &fallbacks); + Ref<FontFile> japanese_font = load_internal_font(_font_DroidSansJapanese, _font_DroidSansJapanese_size, font_hinting, font_antialiased, true, font_subpixel_positioning, false, &fallbacks); + default_font->set_fallbacks(fallbacks); + default_font_msdf->set_fallbacks(fallbacks); + + Ref<FontFile> default_font_bold = load_internal_font(_font_NotoSans_Bold, _font_NotoSans_Bold_size, font_hinting, font_antialiased, true, font_subpixel_positioning, false); + Ref<FontFile> default_font_bold_msdf = load_internal_font(_font_NotoSans_Bold, _font_NotoSans_Bold_size, font_hinting, font_antialiased, true, font_subpixel_positioning, true); + + TypedArray<Font> fallbacks_bold; + Ref<FontFile> arabic_font_bold = load_internal_font(_font_NotoNaskhArabicUI_Bold, _font_NotoNaskhArabicUI_Bold_size, font_hinting, font_antialiased, true, font_subpixel_positioning, false, &fallbacks_bold); + Ref<FontFile> bengali_font_bold = load_internal_font(_font_NotoSansBengaliUI_Bold, _font_NotoSansBengaliUI_Bold_size, font_hinting, font_antialiased, true, font_subpixel_positioning, false, &fallbacks_bold); + Ref<FontFile> devanagari_font_bold = load_internal_font(_font_NotoSansDevanagariUI_Bold, _font_NotoSansDevanagariUI_Bold_size, font_hinting, font_antialiased, true, font_subpixel_positioning, false, &fallbacks_bold); + Ref<FontFile> georgian_font_bold = load_internal_font(_font_NotoSansGeorgian_Bold, _font_NotoSansGeorgian_Bold_size, font_hinting, font_antialiased, true, font_subpixel_positioning, false, &fallbacks_bold); + Ref<FontFile> hebrew_font_bold = load_internal_font(_font_NotoSansHebrew_Bold, _font_NotoSansHebrew_Bold_size, font_hinting, font_antialiased, true, font_subpixel_positioning, false, &fallbacks_bold); + Ref<FontFile> malayalam_font_bold = load_internal_font(_font_NotoSansMalayalamUI_Bold, _font_NotoSansMalayalamUI_Bold_size, font_hinting, font_antialiased, true, font_subpixel_positioning, false, &fallbacks_bold); + Ref<FontFile> oriya_font_bold = load_internal_font(_font_NotoSansOriyaUI_Bold, _font_NotoSansOriyaUI_Bold_size, font_hinting, font_antialiased, true, font_subpixel_positioning, false, &fallbacks_bold); + Ref<FontFile> sinhala_font_bold = load_internal_font(_font_NotoSansSinhalaUI_Bold, _font_NotoSansSinhalaUI_Bold_size, font_hinting, font_antialiased, true, font_subpixel_positioning, false, &fallbacks_bold); + Ref<FontFile> tamil_font_bold = load_internal_font(_font_NotoSansTamilUI_Bold, _font_NotoSansTamilUI_Bold_size, font_hinting, font_antialiased, true, font_subpixel_positioning, false, &fallbacks_bold); + Ref<FontFile> telugu_font_bold = load_internal_font(_font_NotoSansTeluguUI_Bold, _font_NotoSansTeluguUI_Bold_size, font_hinting, font_antialiased, true, font_subpixel_positioning, false, &fallbacks_bold); + Ref<FontFile> thai_font_bold = load_internal_font(_font_NotoSansThaiUI_Bold, _font_NotoSansThaiUI_Bold_size, font_hinting, font_antialiased, true, font_subpixel_positioning, false, &fallbacks_bold); + Ref<FontVariation> fallback_font_bold = make_bold_font(fallback_font, embolden_strength, &fallbacks_bold); + Ref<FontVariation> japanese_font_bold = make_bold_font(japanese_font, embolden_strength, &fallbacks_bold); + default_font_bold->set_fallbacks(fallbacks_bold); + default_font_bold_msdf->set_fallbacks(fallbacks_bold); + + Ref<FontFile> default_font_mono = load_internal_font(_font_JetBrainsMono_Regular, _font_JetBrainsMono_Regular_size, font_hinting, font_antialiased, true, font_subpixel_positioning); + default_font_mono->set_fallbacks(fallbacks); + + // Init base font configs and load custom fonts. String custom_font_path = EditorSettings::get_singleton()->get("interface/editor/main_font"); - Ref<FontData> CustomFont; + String custom_font_path_bold = EditorSettings::get_singleton()->get("interface/editor/main_font_bold"); + String custom_font_path_source = EditorSettings::get_singleton()->get("interface/editor/code_font"); + + Ref<FontVariation> default_fc; + default_fc.instantiate(); if (custom_font_path.length() > 0 && dir->file_exists(custom_font_path)) { - CustomFont = load_cached_external_font(custom_font_path, font_hinting, font_antialiased, true, font_subpixel_positioning); + Ref<FontFile> custom_font = load_external_font(custom_font_path, font_hinting, font_antialiased, true, font_subpixel_positioning); + { + TypedArray<Font> fallback_custom; + fallback_custom.push_back(default_font); + custom_font->set_fallbacks(fallback_custom); + } + default_fc->set_base_font(custom_font); } else { EditorSettings::get_singleton()->set_manually("interface/editor/main_font", ""); + default_fc->set_base_font(default_font); } + default_fc->set_spacing(TextServer::SPACING_TOP, -EDSCALE); + default_fc->set_spacing(TextServer::SPACING_BOTTOM, -EDSCALE); - Ref<FontData> CustomFontMSDF; + Ref<FontVariation> default_fc_msdf; + default_fc_msdf.instantiate(); if (custom_font_path.length() > 0 && dir->file_exists(custom_font_path)) { - CustomFontMSDF = load_cached_external_font(custom_font_path, font_hinting, font_antialiased, true, font_subpixel_positioning, true); + Ref<FontFile> custom_font = load_external_font(custom_font_path, font_hinting, font_antialiased, true, font_subpixel_positioning); + { + TypedArray<Font> fallback_custom; + fallback_custom.push_back(default_font_msdf); + custom_font->set_fallbacks(fallback_custom); + } + default_fc_msdf->set_base_font(custom_font); } else { EditorSettings::get_singleton()->set_manually("interface/editor/main_font", ""); + default_fc_msdf->set_base_font(default_font_msdf); } + default_fc_msdf->set_spacing(TextServer::SPACING_TOP, -EDSCALE); + default_fc_msdf->set_spacing(TextServer::SPACING_BOTTOM, -EDSCALE); - Ref<FontData> CustomFontSlanted; - if (CustomFont.is_valid()) { - CustomFontSlanted = CustomFont->duplicate(); - CustomFontSlanted->set_transform(Transform2D(1.0, 0.4, 0.0, 1.0, 0.0, 0.0)); - } - - /* Custom Bold font */ - - String custom_font_path_bold = EditorSettings::get_singleton()->get("interface/editor/main_font_bold"); - Ref<FontData> CustomFontBold; + Ref<FontVariation> bold_fc; + bold_fc.instantiate(); if (custom_font_path_bold.length() > 0 && dir->file_exists(custom_font_path_bold)) { - CustomFontBold = load_cached_external_font(custom_font_path_bold, font_hinting, font_antialiased, true, font_subpixel_positioning); + Ref<FontFile> custom_font = load_external_font(custom_font_path_bold, font_hinting, font_antialiased, true, font_subpixel_positioning); + { + TypedArray<Font> fallback_custom; + fallback_custom.push_back(default_font_bold); + custom_font->set_fallbacks(fallback_custom); + } + bold_fc->set_base_font(custom_font); + } else if (custom_font_path.length() > 0 && dir->file_exists(custom_font_path)) { + Ref<FontFile> custom_font = load_external_font(custom_font_path, font_hinting, font_antialiased, true, font_subpixel_positioning); + { + TypedArray<Font> fallback_custom; + fallback_custom.push_back(default_font_bold); + custom_font->set_fallbacks(fallback_custom); + } + bold_fc->set_base_font(custom_font); + bold_fc->set_variation_embolden(embolden_strength); } else { EditorSettings::get_singleton()->set_manually("interface/editor/main_font_bold", ""); + bold_fc->set_base_font(default_font_bold); } + bold_fc->set_spacing(TextServer::SPACING_TOP, -EDSCALE); + bold_fc->set_spacing(TextServer::SPACING_BOTTOM, -EDSCALE); - if (CustomFont.is_valid() && !CustomFontBold.is_valid()) { - CustomFontBold = CustomFont->duplicate(); - CustomFontBold->set_embolden(embolden_strength); - } - - Ref<FontData> CustomFontBoldMSDF; - if (custom_font_path.length() > 0 && dir->file_exists(custom_font_path)) { - CustomFontBoldMSDF = load_cached_external_font(custom_font_path, font_hinting, font_antialiased, true, font_subpixel_positioning, true); + Ref<FontVariation> bold_fc_msdf; + bold_fc_msdf.instantiate(); + if (custom_font_path_bold.length() > 0 && dir->file_exists(custom_font_path_bold)) { + Ref<FontFile> custom_font = load_external_font(custom_font_path_bold, font_hinting, font_antialiased, true, font_subpixel_positioning); + { + TypedArray<Font> fallback_custom; + fallback_custom.push_back(default_font_bold_msdf); + custom_font->set_fallbacks(fallback_custom); + } + bold_fc_msdf->set_base_font(custom_font); + } else if (custom_font_path.length() > 0 && dir->file_exists(custom_font_path)) { + Ref<FontFile> custom_font = load_external_font(custom_font_path, font_hinting, font_antialiased, true, font_subpixel_positioning); + { + TypedArray<Font> fallback_custom; + fallback_custom.push_back(default_font_bold_msdf); + custom_font->set_fallbacks(fallback_custom); + } + bold_fc_msdf->set_base_font(custom_font); + bold_fc_msdf->set_variation_embolden(embolden_strength); } else { EditorSettings::get_singleton()->set_manually("interface/editor/main_font_bold", ""); + bold_fc_msdf->set_base_font(default_font_bold_msdf); } + bold_fc_msdf->set_spacing(TextServer::SPACING_TOP, -EDSCALE); + bold_fc_msdf->set_spacing(TextServer::SPACING_BOTTOM, -EDSCALE); - /* Custom source code font */ - - String custom_font_path_source = EditorSettings::get_singleton()->get("interface/editor/code_font"); - Ref<FontData> CustomFontSource; + Ref<FontVariation> mono_fc; + mono_fc.instantiate(); if (custom_font_path_source.length() > 0 && dir->file_exists(custom_font_path_source)) { - CustomFontSource = load_cached_external_font(custom_font_path_source, font_hinting, font_antialiased, true, font_subpixel_positioning); + Ref<FontFile> custom_font = load_external_font(custom_font_path_source, font_hinting, font_antialiased, true, font_subpixel_positioning); + { + TypedArray<Font> fallback_custom; + fallback_custom.push_back(default_font_mono); + custom_font->set_fallbacks(fallback_custom); + } + mono_fc->set_base_font(custom_font); } else { EditorSettings::get_singleton()->set_manually("interface/editor/code_font", ""); + mono_fc->set_base_font(default_font_mono); } + mono_fc->set_spacing(TextServer::SPACING_TOP, -EDSCALE); + mono_fc->set_spacing(TextServer::SPACING_BOTTOM, -EDSCALE); + + Ref<FontVariation> mono_other_fc = mono_fc->duplicate(); + + // Enable contextual alternates (coding ligatures) and custom features for the source editor font. + int ot_mode = EditorSettings::get_singleton()->get("interface/editor/code_font_contextual_ligatures"); + switch (ot_mode) { + case 1: { // Disable ligatures. + Dictionary ftrs; + ftrs[TS->name_to_tag("calt")] = 0; + mono_fc->set_opentype_features(ftrs); + } break; + case 2: { // Custom. + Vector<String> subtag = String(EditorSettings::get_singleton()->get("interface/editor/code_font_custom_opentype_features")).split(","); + Dictionary ftrs; + for (int i = 0; i < subtag.size(); i++) { + Vector<String> subtag_a = subtag[i].split("="); + if (subtag_a.size() == 2) { + ftrs[TS->name_to_tag(subtag_a[0])] = subtag_a[1].to_int(); + } else if (subtag_a.size() == 1) { + ftrs[TS->name_to_tag(subtag_a[0])] = 1; + } + } + mono_fc->set_opentype_features(ftrs); + } break; + default: { // Default. + Dictionary ftrs; + ftrs[TS->name_to_tag("calt")] = 1; + mono_fc->set_opentype_features(ftrs); + } break; + } + + { + // Disable contextual alternates (coding ligatures). + Dictionary ftrs; + ftrs[TS->name_to_tag("calt")] = 0; + mono_other_fc->set_opentype_features(ftrs); + } + + Ref<FontVariation> italic_fc = default_fc->duplicate(); + italic_fc->set_variation_transform(Transform2D(1.0, 0.2, 0.0, 1.0, 0.0, 0.0)); - /* Noto Sans */ - - Ref<FontData> DefaultFont = load_cached_internal_font(_font_NotoSans_Regular, _font_NotoSans_Regular_size, font_hinting, font_antialiased, true, font_subpixel_positioning); - Ref<FontData> DefaultFontMSDF = load_cached_internal_font(_font_NotoSans_Regular, _font_NotoSans_Regular_size, font_hinting, font_antialiased, true, font_subpixel_positioning, true); - Ref<FontData> DefaultFontBold = load_cached_internal_font(_font_NotoSans_Bold, _font_NotoSans_Bold_size, font_hinting, font_antialiased, true, font_subpixel_positioning); - Ref<FontData> DefaultFontBoldMSDF = load_cached_internal_font(_font_NotoSans_Bold, _font_NotoSans_Bold_size, font_hinting, font_antialiased, true, font_subpixel_positioning, true); - Ref<FontData> FontArabic = load_cached_internal_font(_font_NotoNaskhArabicUI_Regular, _font_NotoNaskhArabicUI_Regular_size, font_hinting, font_antialiased, true, font_subpixel_positioning); - Ref<FontData> FontArabicBold = load_cached_internal_font(_font_NotoNaskhArabicUI_Bold, _font_NotoNaskhArabicUI_Bold_size, font_hinting, font_antialiased, true, font_subpixel_positioning); - Ref<FontData> FontBengali = load_cached_internal_font(_font_NotoSansBengaliUI_Regular, _font_NotoSansBengaliUI_Regular_size, font_hinting, font_antialiased, true, font_subpixel_positioning); - Ref<FontData> FontBengaliBold = load_cached_internal_font(_font_NotoSansBengaliUI_Bold, _font_NotoSansBengaliUI_Bold_size, font_hinting, font_antialiased, true, font_subpixel_positioning); - Ref<FontData> FontDevanagari = load_cached_internal_font(_font_NotoSansDevanagariUI_Regular, _font_NotoSansDevanagariUI_Regular_size, font_hinting, font_antialiased, true, font_subpixel_positioning); - Ref<FontData> FontDevanagariBold = load_cached_internal_font(_font_NotoSansDevanagariUI_Bold, _font_NotoSansDevanagariUI_Bold_size, font_hinting, font_antialiased, true, font_subpixel_positioning); - Ref<FontData> FontGeorgian = load_cached_internal_font(_font_NotoSansGeorgian_Regular, _font_NotoSansGeorgian_Regular_size, font_hinting, font_antialiased, true, font_subpixel_positioning); - Ref<FontData> FontGeorgianBold = load_cached_internal_font(_font_NotoSansGeorgian_Bold, _font_NotoSansGeorgian_Bold_size, font_hinting, font_antialiased, true, font_subpixel_positioning); - Ref<FontData> FontHebrew = load_cached_internal_font(_font_NotoSansHebrew_Regular, _font_NotoSansHebrew_Regular_size, font_hinting, font_antialiased, true, font_subpixel_positioning); - Ref<FontData> FontHebrewBold = load_cached_internal_font(_font_NotoSansHebrew_Bold, _font_NotoSansHebrew_Bold_size, font_hinting, font_antialiased, true, font_subpixel_positioning); - Ref<FontData> FontMalayalam = load_cached_internal_font(_font_NotoSansMalayalamUI_Regular, _font_NotoSansMalayalamUI_Regular_size, font_hinting, font_antialiased, true, font_subpixel_positioning); - Ref<FontData> FontMalayalamBold = load_cached_internal_font(_font_NotoSansMalayalamUI_Bold, _font_NotoSansMalayalamUI_Bold_size, font_hinting, font_antialiased, true, font_subpixel_positioning); - Ref<FontData> FontOriya = load_cached_internal_font(_font_NotoSansOriyaUI_Regular, _font_NotoSansOriyaUI_Regular_size, font_hinting, font_antialiased, true, font_subpixel_positioning); - Ref<FontData> FontOriyaBold = load_cached_internal_font(_font_NotoSansOriyaUI_Bold, _font_NotoSansOriyaUI_Bold_size, font_hinting, font_antialiased, true, font_subpixel_positioning); - Ref<FontData> FontSinhala = load_cached_internal_font(_font_NotoSansSinhalaUI_Regular, _font_NotoSansSinhalaUI_Regular_size, font_hinting, font_antialiased, true, font_subpixel_positioning); - Ref<FontData> FontSinhalaBold = load_cached_internal_font(_font_NotoSansSinhalaUI_Bold, _font_NotoSansSinhalaUI_Bold_size, font_hinting, font_antialiased, true, font_subpixel_positioning); - Ref<FontData> FontTamil = load_cached_internal_font(_font_NotoSansTamilUI_Regular, _font_NotoSansTamilUI_Regular_size, font_hinting, font_antialiased, true, font_subpixel_positioning); - Ref<FontData> FontTamilBold = load_cached_internal_font(_font_NotoSansTamilUI_Bold, _font_NotoSansTamilUI_Bold_size, font_hinting, font_antialiased, true, font_subpixel_positioning); - Ref<FontData> FontTelugu = load_cached_internal_font(_font_NotoSansTeluguUI_Regular, _font_NotoSansTeluguUI_Regular_size, font_hinting, font_antialiased, true, font_subpixel_positioning); - Ref<FontData> FontTeluguBold = load_cached_internal_font(_font_NotoSansTeluguUI_Bold, _font_NotoSansTeluguUI_Bold_size, font_hinting, font_antialiased, true, font_subpixel_positioning); - Ref<FontData> FontThai = load_cached_internal_font(_font_NotoSansThaiUI_Regular, _font_NotoSansThaiUI_Regular_size, font_hinting, font_antialiased, true, font_subpixel_positioning); - Ref<FontData> FontThaiBold = load_cached_internal_font(_font_NotoSansThaiUI_Bold, _font_NotoSansThaiUI_Bold_size, font_hinting, font_antialiased, true, font_subpixel_positioning); - - Ref<FontData> DefaultFontSlanted = DefaultFont->duplicate(); - DefaultFontSlanted->set_transform(Transform2D(1.0, 0.3, 0.0, 1.0, 0.0, 0.0)); - - /* Droid Sans */ - - Ref<FontData> FontFallback = load_cached_internal_font(_font_DroidSansFallback, _font_DroidSansFallback_size, font_hinting, font_antialiased, true, font_subpixel_positioning); - Ref<FontData> FontJapanese = load_cached_internal_font(_font_DroidSansJapanese, _font_DroidSansJapanese_size, font_hinting, font_antialiased, true, font_subpixel_positioning); - - Ref<FontData> FontFallbackBold = FontFallback->duplicate(); - FontFallbackBold->set_embolden(embolden_strength); - Ref<FontData> FontJapaneseBold = FontJapanese->duplicate(); - FontJapaneseBold->set_embolden(embolden_strength); - - /* Hack */ - - Ref<FontData> dfmono = load_cached_internal_font(_font_JetBrainsMono_Regular, _font_JetBrainsMono_Regular_size, font_hinting, font_antialiased, true, font_subpixel_positioning); - Dictionary opentype_features; - opentype_features["calt"] = 0; - dfmono->set_opentype_feature_overrides(opentype_features); // Disable contextual alternates (coding ligatures). - - // Default font - MAKE_DEFAULT_FONT(df, String()); - p_theme->set_default_font(df); // Default theme font + // Setup theme. + + p_theme->set_default_font(default_fc); // Default theme font config. p_theme->set_default_font_size(default_font_size); - p_theme->set_font_size("main_size", "EditorFonts", default_font_size); - p_theme->set_font("main", "EditorFonts", df); + // Main font. - MAKE_DEFAULT_FONT_MSDF(df_msdf, String()); - p_theme->set_font("main_msdf", "EditorFonts", df_msdf); + p_theme->set_font("main", "EditorFonts", default_fc); + p_theme->set_font("main_msdf", "EditorFonts", default_fc_msdf); + p_theme->set_font_size("main_size", "EditorFonts", default_font_size); - // Bold font - MAKE_BOLD_FONT(df_bold, String()); - MAKE_SLANTED_FONT(df_italic, String()); + p_theme->set_font("bold", "EditorFonts", bold_fc); + p_theme->set_font("main_bold_msdf", "EditorFonts", bold_fc_msdf); p_theme->set_font_size("bold_size", "EditorFonts", default_font_size); - p_theme->set_font("bold", "EditorFonts", df_bold); - MAKE_BOLD_FONT_MSDF(df_bold_msdf, String()); - p_theme->set_font("main_bold_msdf", "EditorFonts", df_bold_msdf); + // Title font. - // Title font + p_theme->set_font("title", "EditorFonts", bold_fc); p_theme->set_font_size("title_size", "EditorFonts", default_font_size + 1 * EDSCALE); - p_theme->set_font("title", "EditorFonts", df_bold); + p_theme->set_font("main_button_font", "EditorFonts", bold_fc); p_theme->set_font_size("main_button_font_size", "EditorFonts", default_font_size + 1 * EDSCALE); - p_theme->set_font("main_button_font", "EditorFonts", df_bold); - p_theme->set_font("font", "Label", df); + p_theme->set_font("font", "Label", default_fc); p_theme->set_type_variation("HeaderSmall", "Label"); - p_theme->set_font("font", "HeaderSmall", df_bold); + p_theme->set_font("font", "HeaderSmall", bold_fc); p_theme->set_font_size("font_size", "HeaderSmall", default_font_size); p_theme->set_type_variation("HeaderMedium", "Label"); - p_theme->set_font("font", "HeaderMedium", df_bold); + p_theme->set_font("font", "HeaderMedium", bold_fc); p_theme->set_font_size("font_size", "HeaderMedium", default_font_size + 1 * EDSCALE); p_theme->set_type_variation("HeaderLarge", "Label"); - p_theme->set_font("font", "HeaderLarge", df_bold); + p_theme->set_font("font", "HeaderLarge", bold_fc); p_theme->set_font_size("font_size", "HeaderLarge", default_font_size + 3 * EDSCALE); // Documentation fonts - String code_font_custom_variations = EditorSettings::get_singleton()->get("interface/editor/code_font_custom_variations"); - MAKE_SOURCE_FONT(df_code, code_font_custom_variations); p_theme->set_font_size("doc_size", "EditorFonts", int(EDITOR_GET("text_editor/help/help_font_size")) * EDSCALE); - p_theme->set_font("doc", "EditorFonts", df); - p_theme->set_font("doc_bold", "EditorFonts", df_bold); - p_theme->set_font("doc_italic", "EditorFonts", df_italic); + p_theme->set_font("doc", "EditorFonts", default_fc); + p_theme->set_font("doc_bold", "EditorFonts", bold_fc); + p_theme->set_font("doc_italic", "EditorFonts", italic_fc); p_theme->set_font_size("doc_title_size", "EditorFonts", int(EDITOR_GET("text_editor/help/help_title_font_size")) * EDSCALE); - p_theme->set_font("doc_title", "EditorFonts", df_bold); + p_theme->set_font("doc_title", "EditorFonts", bold_fc); p_theme->set_font_size("doc_source_size", "EditorFonts", int(EDITOR_GET("text_editor/help/help_source_font_size")) * EDSCALE); - p_theme->set_font("doc_source", "EditorFonts", df_code); + p_theme->set_font("doc_source", "EditorFonts", mono_fc); p_theme->set_font_size("doc_keyboard_size", "EditorFonts", (int(EDITOR_GET("text_editor/help/help_source_font_size")) - 1) * EDSCALE); - p_theme->set_font("doc_keyboard", "EditorFonts", df_code); + p_theme->set_font("doc_keyboard", "EditorFonts", mono_fc); // Ruler font p_theme->set_font_size("rulers_size", "EditorFonts", 8 * EDSCALE); - p_theme->set_font("rulers", "EditorFonts", df); + p_theme->set_font("rulers", "EditorFonts", default_fc); // Rotation widget font p_theme->set_font_size("rotation_control_size", "EditorFonts", 14 * EDSCALE); - p_theme->set_font("rotation_control", "EditorFonts", df); + p_theme->set_font("rotation_control", "EditorFonts", default_fc); // Code font p_theme->set_font_size("source_size", "EditorFonts", int(EDITOR_GET("interface/editor/code_font_size")) * EDSCALE); - p_theme->set_font("source", "EditorFonts", df_code); + p_theme->set_font("source", "EditorFonts", mono_fc); p_theme->set_font_size("expression_size", "EditorFonts", (int(EDITOR_GET("interface/editor/code_font_size")) - 1) * EDSCALE); - p_theme->set_font("expression", "EditorFonts", df_code); + p_theme->set_font("expression", "EditorFonts", mono_other_fc); p_theme->set_font_size("output_source_size", "EditorFonts", int(EDITOR_GET("run/output/font_size")) * EDSCALE); - p_theme->set_font("output_source", "EditorFonts", df_code); + p_theme->set_font("output_source", "EditorFonts", mono_other_fc); p_theme->set_font_size("status_source_size", "EditorFonts", default_font_size); - p_theme->set_font("status_source", "EditorFonts", df_code); + p_theme->set_font("status_source", "EditorFonts", mono_other_fc); } diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp index 36360954d9..a674451d1e 100644 --- a/editor/editor_help.cpp +++ b/editor/editor_help.cpp @@ -125,6 +125,9 @@ void EditorHelp::_class_desc_select(const String &p_select) { } else if (tag == "constant") { topic = "class_constant"; table = &this->constant_line; + } else if (tag == "annotation") { + topic = "class_annotation"; + table = &this->annotation_line; } else if (tag == "theme_item") { topic = "theme_item"; table = &this->theme_property_line; @@ -183,7 +186,7 @@ void EditorHelp::_class_desc_resized(bool p_force_update_theme) { // The margins increase as the width of the editor help container increases. Ref<Font> doc_code_font = get_theme_font(SNAME("doc_source"), SNAME("EditorFonts")); int font_size = get_theme_font_size(SNAME("doc_source_size"), SNAME("EditorFonts")); - real_t char_width = doc_code_font->get_char_size('x', 0, font_size).width; + real_t char_width = doc_code_font->get_char_size('x', font_size).width; const int new_display_margin = MAX(30 * EDSCALE, get_parent_anchorable_rect().size.width - char_width * 120 * EDSCALE) * 0.5; if (display_margin != new_display_margin || p_force_update_theme) { display_margin = new_display_margin; @@ -274,7 +277,7 @@ void EditorHelp::_add_method(const DocData::MethodDoc &p_method, bool p_overview class_desc->add_text(" "); } - if (p_overview && !p_method.description.is_empty()) { + if (p_overview && !p_method.description.strip_edges().is_empty()) { class_desc->push_meta("@method " + p_method.name); } @@ -282,7 +285,7 @@ void EditorHelp::_add_method(const DocData::MethodDoc &p_method, bool p_overview _add_text(p_method.name); class_desc->pop(); - if (p_overview && !p_method.description.is_empty()) { + if (p_overview && !p_method.description.strip_edges().is_empty()) { class_desc->pop(); //meta } @@ -412,7 +415,7 @@ void EditorHelp::_update_method_list(const Vector<DocData::MethodDoc> p_methods, class_desc->pop(); //cell } - if (!m[i].description.is_empty() || m[i].errors_returned.size() > 0) { + if (!m[i].description.strip_edges().is_empty() || m[i].errors_returned.size() > 0) { r_method_descrpitons = true; } @@ -611,7 +614,7 @@ void EditorHelp::_update_doc() { class_desc->add_newline(); // Brief description - if (!cd.brief_description.is_empty()) { + if (!cd.brief_description.strip_edges().is_empty()) { class_desc->push_color(text_color); class_desc->push_font(doc_bold_font); class_desc->push_indent(1); @@ -625,7 +628,7 @@ void EditorHelp::_update_doc() { } // Class description - if (!cd.description.is_empty()) { + if (!cd.description.strip_edges().is_empty()) { section_line.push_back(Pair<String, int>(TTR("Description"), class_desc->get_paragraph_count() - 2)); description_line = class_desc->get_paragraph_count() - 2; class_desc->push_color(title_color); @@ -692,7 +695,7 @@ void EditorHelp::_update_doc() { if (cd.is_script_doc) { has_properties = false; for (int i = 0; i < cd.properties.size(); i++) { - if (cd.properties[i].name.begins_with("_") && cd.properties[i].description.is_empty()) { + if (cd.properties[i].name.begins_with("_") && cd.properties[i].description.strip_edges().is_empty()) { continue; } has_properties = true; @@ -718,7 +721,7 @@ void EditorHelp::_update_doc() { for (int i = 0; i < cd.properties.size(); i++) { // Ignore undocumented private. - if (cd.properties[i].name.begins_with("_") && cd.properties[i].description.is_empty()) { + if (cd.properties[i].name.begins_with("_") && cd.properties[i].description.strip_edges().is_empty()) { continue; } property_line[cd.properties[i].name] = class_desc->get_paragraph_count() - 2; //gets overridden if description @@ -743,7 +746,7 @@ void EditorHelp::_update_doc() { describe = true; } - if (!cd.properties[i].description.is_empty()) { + if (!cd.properties[i].description.strip_edges().is_empty()) { describe = true; } @@ -856,7 +859,7 @@ void EditorHelp::_update_doc() { } } // Ignore undocumented non virtual private. - if (cd.methods[i].name.begins_with("_") && cd.methods[i].description.is_empty() && !cd.methods[i].qualifiers.contains("virtual")) { + if (cd.methods[i].name.begins_with("_") && cd.methods[i].description.strip_edges().is_empty() && !cd.methods[i].qualifiers.contains("virtual")) { continue; } methods.push_back(cd.methods[i]); @@ -976,7 +979,7 @@ void EditorHelp::_update_doc() { class_desc->pop(); // monofont // Theme item description. - if (!cd.theme_properties[i].description.is_empty()) { + if (!cd.theme_properties[i].description.strip_edges().is_empty()) { class_desc->push_font(doc_font); class_desc->push_color(comment_color); class_desc->push_indent(1); @@ -1018,8 +1021,8 @@ void EditorHelp::_update_doc() { signal_line[cd.signals[i].name] = class_desc->get_paragraph_count() - 2; // Gets overridden if description. class_desc->push_font(doc_code_font); // monofont - class_desc->push_color(headline_color); _add_bulletpoint(); + class_desc->push_color(headline_color); _add_text(cd.signals[i].name); class_desc->pop(); class_desc->push_color(symbol_color); @@ -1048,7 +1051,7 @@ void EditorHelp::_update_doc() { class_desc->add_text(")"); class_desc->pop(); class_desc->pop(); // end monofont - if (!cd.signals[i].description.is_empty()) { + if (!cd.signals[i].description.strip_edges().is_empty()) { class_desc->push_font(doc_font); class_desc->push_color(comment_color); class_desc->push_indent(1); @@ -1079,7 +1082,7 @@ void EditorHelp::_update_doc() { enums[cd.constants[i].enumeration].push_back(cd.constants[i]); } else { // Ignore undocumented private. - if (cd.constants[i].name.begins_with("_") && cd.constants[i].description.is_empty()) { + if (cd.constants[i].name.begins_with("_") && cd.constants[i].description.strip_edges().is_empty()) { continue; } constants.push_back(cd.constants[i]); @@ -1105,7 +1108,11 @@ void EditorHelp::_update_doc() { class_desc->push_font(doc_code_font); class_desc->push_color(title_color); - class_desc->add_text("enum "); + if (E.value.size() && E.value[0].is_bitfield) { + class_desc->add_text("flags "); + } else { + class_desc->add_text("enum "); + } class_desc->pop(); String e = E.key; if ((e.get_slice_count(".") > 1) && (e.get_slice(".", 0) == edited_class)) { @@ -1151,8 +1158,8 @@ void EditorHelp::_update_doc() { constant_line[enum_list[i].name] = class_desc->get_paragraph_count() - 2; class_desc->push_font(doc_code_font); - class_desc->push_color(headline_color); _add_bulletpoint(); + class_desc->push_color(headline_color); _add_text(enum_list[i].name); class_desc->pop(); class_desc->push_color(symbol_color); @@ -1236,7 +1243,7 @@ void EditorHelp::_update_doc() { class_desc->add_newline(); - if (!constants[i].description.is_empty()) { + if (!constants[i].description.strip_edges().is_empty()) { class_desc->push_font(doc_font); class_desc->push_color(comment_color); _add_text(DTR(constants[i].description)); @@ -1255,6 +1262,112 @@ void EditorHelp::_update_doc() { } } + // Annotations + if (!cd.annotations.is_empty()) { + if (sort_methods) { + cd.annotations.sort(); + } + + section_line.push_back(Pair<String, int>(TTR("Annotations"), class_desc->get_paragraph_count() - 2)); + class_desc->push_color(title_color); + class_desc->push_font(doc_title_font); + class_desc->push_font_size(doc_title_font_size); + class_desc->add_text(TTR("Annotations")); + class_desc->pop(); // font size + class_desc->pop(); // font + class_desc->pop(); // color + + class_desc->add_newline(); + class_desc->add_newline(); + + class_desc->push_indent(1); + + for (int i = 0; i < cd.annotations.size(); i++) { + annotation_line[cd.annotations[i].name] = class_desc->get_paragraph_count() - 2; // Gets overridden if description. + + class_desc->push_font(doc_code_font); // monofont + _add_bulletpoint(); + class_desc->push_color(headline_color); + _add_text(cd.annotations[i].name); + class_desc->pop(); + + if (cd.annotations[i].arguments.size() > 0) { + class_desc->push_color(symbol_color); + class_desc->add_text("("); + class_desc->pop(); + for (int j = 0; j < cd.annotations[i].arguments.size(); j++) { + class_desc->push_color(text_color); + if (j > 0) { + class_desc->add_text(", "); + } + + _add_text(cd.annotations[i].arguments[j].name); + class_desc->add_text(": "); + _add_type(cd.annotations[i].arguments[j].type); + if (!cd.annotations[i].arguments[j].default_value.is_empty()) { + class_desc->push_color(symbol_color); + class_desc->add_text(" = "); + class_desc->pop(); + _add_text(cd.annotations[i].arguments[j].default_value); + } + + class_desc->pop(); + } + + if (cd.annotations[i].qualifiers.contains("vararg")) { + class_desc->push_color(text_color); + if (cd.annotations[i].arguments.size()) { + class_desc->add_text(", "); + } + class_desc->push_color(symbol_color); + class_desc->add_text("..."); + class_desc->pop(); + class_desc->pop(); + } + + class_desc->push_color(symbol_color); + class_desc->add_text(")"); + class_desc->pop(); + } + + if (!cd.annotations[i].qualifiers.is_empty()) { + class_desc->push_color(qualifier_color); + class_desc->add_text(" "); + _add_text(cd.annotations[i].qualifiers); + class_desc->pop(); + } + + class_desc->pop(); // end monofont + + if (!cd.annotations[i].description.strip_edges().is_empty()) { + class_desc->push_font(doc_font); + class_desc->push_color(comment_color); + class_desc->push_indent(1); + _add_text(DTR(cd.annotations[i].description)); + class_desc->pop(); // indent + class_desc->pop(); + class_desc->pop(); // font + } else { + class_desc->push_indent(1); + class_desc->add_image(get_theme_icon(SNAME("Error"), SNAME("EditorIcons"))); + class_desc->add_text(" "); + class_desc->push_color(comment_color); + if (cd.is_script_doc) { + class_desc->append_text(TTR("There is currently no description for this annotation.")); + } else { + class_desc->append_text(TTR("There is currently no description for this annotation. Please help us by [color=$color][url=$url]contributing one[/url][/color]!").replace("$url", CONTRIBUTE_URL).replace("$color", link_color_text)); + } + class_desc->pop(); + class_desc->pop(); // indent + } + class_desc->add_newline(); + class_desc->add_newline(); + } + + class_desc->pop(); + class_desc->add_newline(); + } + // Property descriptions if (property_descr) { section_line.push_back(Pair<String, int>(TTR("Property Descriptions"), class_desc->get_paragraph_count() - 2)); @@ -1501,6 +1614,10 @@ void EditorHelp::_help_callback(const String &p_topic) { if (constant_line.has(name)) { line = constant_line[name]; } + } else if (what == "class_annotation") { + if (annotation_line.has(name)) { + line = annotation_line[name]; + } } else if (what == "class_global") { if (constant_line.has(name)) { line = constant_line[name]; diff --git a/editor/editor_help.h b/editor/editor_help.h index 7f91a8102d..9f8da938f1 100644 --- a/editor/editor_help.h +++ b/editor/editor_help.h @@ -110,6 +110,7 @@ class EditorHelp : public VBoxContainer { HashMap<String, int> property_line; HashMap<String, int> theme_property_line; HashMap<String, int> constant_line; + HashMap<String, int> annotation_line; HashMap<String, int> enum_line; HashMap<String, HashMap<String, int>> enum_values_line; int description_line = 0; diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp index 2bf0cd2f20..dc47719f0a 100644 --- a/editor/editor_inspector.cpp +++ b/editor/editor_inspector.cpp @@ -322,7 +322,7 @@ void EditorProperty::_notification(int p_what) { Ref<Texture2D> pinned_icon = get_theme_icon(SNAME("Pin"), SNAME("EditorIcons")); int margin_w = get_theme_constant(SNAME("hseparator"), SNAME("Tree")) * 2; int total_icon_w = margin_w + pinned_icon->get_width(); - int text_w = font->get_string_size(label, font_size, rtl ? HORIZONTAL_ALIGNMENT_RIGHT : HORIZONTAL_ALIGNMENT_LEFT, text_limit - total_icon_w).x; + int text_w = font->get_string_size(label, rtl ? HORIZONTAL_ALIGNMENT_RIGHT : HORIZONTAL_ALIGNMENT_LEFT, text_limit - total_icon_w, font_size).x; int y = (size.height - pinned_icon->get_height()) / 2; if (rtl) { draw_texture(pinned_icon, Vector2(size.width - ofs - text_w - total_icon_w, y), color); @@ -1087,7 +1087,7 @@ void EditorInspectorCategory::_notification(int p_what) { int hs = get_theme_constant(SNAME("h_separation"), SNAME("Tree")); - int w = font->get_string_size(label, font_size).width; + int w = font->get_string_size(label, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size).width; if (icon.is_valid()) { w += hs + icon->get_width(); } @@ -3429,6 +3429,7 @@ void EditorInspector::_property_checked(const String &p_path, bool p_checked) { if (editor_property_map.has(p_path)) { for (EditorProperty *E : editor_property_map[p_path]) { + E->set_checked(p_checked); E->update_property(); E->update_revert_and_pin_status(); E->update_cache(); diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 7697bbfdf4..eafbf11df0 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -146,7 +146,7 @@ #include "editor/plugins/debugger_editor_plugin.h" #include "editor/plugins/editor_debugger_plugin.h" #include "editor/plugins/editor_preview_plugins.h" -#include "editor/plugins/font_editor_plugin.h" +#include "editor/plugins/font_config_plugin.h" #include "editor/plugins/gdextension_export_plugin.h" #include "editor/plugins/gpu_particles_2d_editor_plugin.h" #include "editor/plugins/gpu_particles_3d_editor_plugin.h" @@ -165,7 +165,6 @@ #include "editor/plugins/navigation_polygon_editor_plugin.h" #include "editor/plugins/node_3d_editor_plugin.h" #include "editor/plugins/occluder_instance_3d_editor_plugin.h" -#include "editor/plugins/ot_features_plugin.h" #include "editor/plugins/packed_scene_translation_parser_plugin.h" #include "editor/plugins/path_2d_editor_plugin.h" #include "editor/plugins/path_3d_editor_plugin.h" @@ -187,7 +186,6 @@ #include "editor/plugins/sprite_frames_editor_plugin.h" #include "editor/plugins/style_box_editor_plugin.h" #include "editor/plugins/sub_viewport_preview_editor_plugin.h" -#include "editor/plugins/text_control_editor_plugin.h" #include "editor/plugins/text_editor.h" #include "editor/plugins/texture_3d_editor_plugin.h" #include "editor/plugins/texture_editor_plugin.h" @@ -7125,7 +7123,6 @@ EditorNode::EditorNode() { add_editor_plugin(memnew(CollisionShape2DEditorPlugin)); add_editor_plugin(memnew(CurveEditorPlugin)); add_editor_plugin(memnew(FontEditorPlugin)); - add_editor_plugin(memnew(OpenTypeFeaturesEditorPlugin)); add_editor_plugin(memnew(TextureEditorPlugin)); add_editor_plugin(memnew(TextureLayeredEditorPlugin)); add_editor_plugin(memnew(Texture3DEditorPlugin)); @@ -7140,7 +7137,6 @@ EditorNode::EditorNode() { add_editor_plugin(memnew(GPUParticlesCollisionSDF3DEditorPlugin)); add_editor_plugin(memnew(InputEventEditorPlugin)); add_editor_plugin(memnew(SubViewportPreviewEditorPlugin)); - add_editor_plugin(memnew(TextControlEditorPlugin)); add_editor_plugin(memnew(ControlEditorPlugin)); add_editor_plugin(memnew(GradientTexture2DEditorPlugin)); add_editor_plugin(memnew(BitMapEditorPlugin)); diff --git a/editor/editor_resource_picker.cpp b/editor/editor_resource_picker.cpp index 4d53ddb344..77d627ab9c 100644 --- a/editor/editor_resource_picker.cpp +++ b/editor/editor_resource_picker.cpp @@ -534,8 +534,6 @@ void EditorResourcePicker::_get_allowed_types(bool p_with_convert, HashSet<Strin p_vector->insert("Texture2D"); } else if (base == "ShaderMaterial") { p_vector->insert("Shader"); - } else if (base == "Font") { - p_vector->insert("FontData"); } else if (base == "Texture2D") { p_vector->insert("Image"); } @@ -675,16 +673,6 @@ void EditorResourcePicker::drop_data_fw(const Point2 &p_point, const Variant &p_ break; } - if (at == "Font" && Ref<FontData>(dropped_resource).is_valid()) { - Ref<Font> font = edited_resource; - if (!font.is_valid()) { - font.instantiate(); - } - font->add_data(dropped_resource); - dropped_resource = font; - break; - } - if (at == "Texture2D" && Ref<Image>(dropped_resource).is_valid()) { Ref<ImageTexture> texture = edited_resource; if (!texture.is_valid()) { diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp index fbdc1c0a0c..fa8643af86 100644 --- a/editor/editor_settings.cpp +++ b/editor/editor_settings.cpp @@ -444,6 +444,7 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) { // Inspector EDITOR_SETTING(Variant::INT, PROPERTY_HINT_RANGE, "interface/inspector/max_array_dictionary_items_per_page", 20, "10,100,1") + EDITOR_SETTING(Variant::BOOL, PROPERTY_HINT_NONE, "interface/inspector/show_low_level_opentype_features", false, "") // Theme EDITOR_SETTING(Variant::STRING, PROPERTY_HINT_ENUM, "interface/theme/preset", "Default", "Default,Breeze Dark,Godot 2,Gray,Light,Solarized (Dark),Solarized (Light),Custom") diff --git a/editor/editor_spin_slider.cpp b/editor/editor_spin_slider.cpp index f23f0cf758..c651d6bf6e 100644 --- a/editor/editor_spin_slider.cpp +++ b/editor/editor_spin_slider.cpp @@ -286,7 +286,7 @@ void EditorSpinSlider::_draw_spin_slider() { int sep_base = 4 * EDSCALE; int sep = sep_base + sb->get_offset().x; //make it have the same margin on both sides, looks better - int label_width = font->get_string_size(label, font_size).width; + int label_width = font->get_string_size(label, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size).width; int number_width = size.width - sb->get_minimum_size().width - label_width - sep; Ref<Texture2D> updown = get_theme_icon(is_read_only() ? SNAME("updown_disabled") : SNAME("updown"), SNAME("SpinBox")); @@ -324,7 +324,10 @@ void EditorSpinSlider::_draw_spin_slider() { int suffix_start = numstr.length(); RID num_rid = TS->create_shaped_text(); - TS->shaped_text_add_string(num_rid, numstr + U"\u2009" + suffix, font->get_rids(), font_size); + TS->shaped_text_add_string(num_rid, numstr + U"\u2009" + suffix, font->get_rids(), font_size, font->get_opentype_features()); + for (int i = 0; i < TextServer::SPACING_MAX; i++) { + TS->shaped_text_set_spacing(num_rid, TextServer::SpacingType(i), font->get_spacing(TextServer::SpacingType(i))); + } float text_start = rtl ? Math::round(sb->get_offset().x) : Math::round(sb->get_offset().x + label_width + sep); Vector2 text_ofs = rtl ? Vector2(text_start + (number_width - TS->shaped_text_get_width(num_rid)), vofs) : Vector2(text_start, vofs); diff --git a/editor/find_in_files.cpp b/editor/find_in_files.cpp index e1c9689f73..81b71b5609 100644 --- a/editor/find_in_files.cpp +++ b/editor/find_in_files.cpp @@ -764,8 +764,8 @@ void FindInFilesPanel::draw_result_text(Object *item_obj, Rect2 rect) { int font_size = _results_display->get_theme_font_size(SNAME("font_size")); Rect2 match_rect = rect; - match_rect.position.x += font->get_string_size(item_text.left(r.begin_trimmed), font_size).x; - match_rect.size.x = font->get_string_size(_search_text_label->get_text(), font_size).x; + match_rect.position.x += font->get_string_size(item_text.left(r.begin_trimmed), HORIZONTAL_ALIGNMENT_LEFT, -1, font_size).x; + match_rect.size.x = font->get_string_size(_search_text_label->get_text(), HORIZONTAL_ALIGNMENT_LEFT, -1, font_size).x; match_rect.position.y += 1 * EDSCALE; match_rect.size.y -= 2 * EDSCALE; diff --git a/editor/icons/Font.svg b/editor/icons/Font.svg index 2c8d7cb43e..dda1aa577e 100644 --- a/editor/icons/Font.svg +++ b/editor/icons/Font.svg @@ -1 +1 @@ -<svg height="16" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"><g fill="#e0e0e0" transform="translate(0 -1036.4)"><path d="m1 1037.4h14v2h-14z"/><path d="m7 1037.4h2v14h-2z"/><path d="m5 1050.4h6v1h-6z"/><path d="m1037.4-2h4v1h-4z" transform="rotate(90)"/><path d="m1037.4-15h4v1h-4z" transform="rotate(90)"/><path d="m2 3v2a2 2 0 0 1 2-2z" transform="translate(0 1036.4)"/><path d="m12 3a2 2 0 0 1 2 2v-2z" transform="translate(0 1036.4)"/><path d="m5 1050.4a2 2 0 0 0 2-2v2z"/><path d="m11 1050.4a2 2 0 0 1 -2-2v2z"/></g></svg> +<svg height="16" width="16" xmlns="http://www.w3.org/2000/svg"><g fill="#e0e0e0"><path d="M1 1h14v2H1z"/><path d="M7 1h2v14H7z"/><path d="M5 14h6v1H5zM2 1v4H1V1zm13 0v4h-1V1zM2 3v2a2 2 0 0 1 2-2zm10 0a2 2 0 0 1 2 2V3zM5 14a2 2 0 0 0 2-2v2zm6 0a2 2 0 0 1-2-2v2z"/></g></svg> diff --git a/editor/icons/FontData.svg b/editor/icons/FontData.svg deleted file mode 100644 index 4cb6412081..0000000000 --- a/editor/icons/FontData.svg +++ /dev/null @@ -1 +0,0 @@ -<svg height="16" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"><path d="m1 1v2 1h1a1 1 0 0 1 1-1h2v6a1 1 0 0 1 -1 1v1h1 2 1v-1a1 1 0 0 1 -1-1v-6h2a1 1 0 0 1 1 1h1v-1-2h-4-2zm0 5v2h2v-2zm0 3v2h2v-2zm0 3v2h2v-2zm3 0v2h2v-2z" fill="#e0e0e0"/><path d="m4 5v2 1h1a1 1 0 0 1 1-1h2v6a1 1 0 0 1 -1 1v1h1 2 1v-1a1 1 0 0 1 -1-1v-6h2a1 1 0 0 1 1 1h1v-1-2h-4-2z" fill="#ff5f5f"/></svg> diff --git a/editor/icons/FontFile.svg b/editor/icons/FontFile.svg new file mode 100644 index 0000000000..4b94fd0d74 --- /dev/null +++ b/editor/icons/FontFile.svg @@ -0,0 +1 @@ +<svg height="16" width="16" xmlns="http://www.w3.org/2000/svg"><path d="M1.5 1v3h1a1 1 0 0 1 1-1h2v6a1 1 0 0 1-1 1v1h4v-1a1 1 0 0 1-1-1V3h2a1 1 0 0 1 1 1h1V1h-6Z" fill="#e0e0e0"/><path d="M4.5 5v3h1a1 1 0 0 1 1-1h2v6a1 1 0 0 1-1 1v1h4v-1a1 1 0 0 1-1-1V7h2a1 1 0 0 1 1 1h1V5h-6Z" fill="#ff5f5f"/></svg> diff --git a/editor/icons/FontVariation.svg b/editor/icons/FontVariation.svg new file mode 100644 index 0000000000..eaad049fce --- /dev/null +++ b/editor/icons/FontVariation.svg @@ -0,0 +1 @@ +<svg height="16" width="16" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><path d="M2.437 1 1.379 4h1A.84 1.192 50 0 1 3.73 3h2L3.615 9a.84 1.192 50 0 1-1.352 1l-.353 1h4l.353-1a.84 1.192 50 0 1-.648-1l2.116-6h2a.84 1.192 50 0 1 .648 1h1l1.058-3h-6Z" fill="#e0e0e0"/><path d="m4.621 5-.705 2-.353 1h1a.84 1.192 49.998 0 1 1.353-1h2L5.8 13a.84 1.192 49.998 0 1-1.353 1l-.353 1h4l.353-1a.84 1.192 49.998 0 1-.647-1l2.116-6h2a.84 1.192 49.998 0 1 .647 1h1l.353-1 .705-2h-6Z" fill="#ff5f5f"/></svg> diff --git a/editor/import/dynamic_font_import_settings.cpp b/editor/import/dynamic_font_import_settings.cpp index f7fe334828..fa261496f0 100644 --- a/editor/import/dynamic_font_import_settings.cpp +++ b/editor/import/dynamic_font_import_settings.cpp @@ -41,50 +41,44 @@ /* Settings data */ /*************************************************************************/ -class DynamicFontImportSettingsData : public RefCounted { - GDCLASS(DynamicFontImportSettingsData, RefCounted) - friend class DynamicFontImportSettings; - - HashMap<StringName, Variant> settings; - HashMap<StringName, Variant> defaults; - List<ResourceImporter::ImportOption> options; - DynamicFontImportSettings *owner = nullptr; - - bool _set(const StringName &p_name, const Variant &p_value) { - if (defaults.has(p_name) && defaults[p_name] == p_value) { - settings.erase(p_name); - } else { - settings[p_name] = p_value; - } - return true; +bool DynamicFontImportSettingsData::_set(const StringName &p_name, const Variant &p_value) { + if (defaults.has(p_name) && defaults[p_name] == p_value) { + settings.erase(p_name); + } else { + settings[p_name] = p_value; } + return true; +} - bool _get(const StringName &p_name, Variant &r_ret) const { - if (settings.has(p_name)) { - r_ret = settings[p_name]; - return true; - } - if (defaults.has(p_name)) { - r_ret = defaults[p_name]; - return true; - } - return false; +bool DynamicFontImportSettingsData::_get(const StringName &p_name, Variant &r_ret) const { + if (settings.has(p_name)) { + r_ret = settings[p_name]; + return true; + } + if (defaults.has(p_name)) { + r_ret = defaults[p_name]; + return true; } + return false; +} - void _get_property_list(List<PropertyInfo> *p_list) const { - for (const List<ResourceImporter::ImportOption>::Element *E = options.front(); E; E = E->next()) { - if (owner && owner->import_settings_data.is_valid()) { - if (owner->import_settings_data->get("multichannel_signed_distance_field") && (E->get().option.name == "size" || E->get().option.name == "outline_size" || E->get().option.name == "oversampling")) { - continue; - } - if (!owner->import_settings_data->get("multichannel_signed_distance_field") && (E->get().option.name == "msdf_pixel_range" || E->get().option.name == "msdf_size")) { - continue; - } +void DynamicFontImportSettingsData::_get_property_list(List<PropertyInfo> *p_list) const { + for (const List<ResourceImporter::ImportOption>::Element *E = options.front(); E; E = E->next()) { + if (owner && owner->import_settings_data.is_valid()) { + if (owner->import_settings_data->get("multichannel_signed_distance_field") && (E->get().option.name == "size" || E->get().option.name == "outline_size" || E->get().option.name == "oversampling")) { + continue; + } + if (!owner->import_settings_data->get("multichannel_signed_distance_field") && (E->get().option.name == "msdf_pixel_range" || E->get().option.name == "msdf_size")) { + continue; } - p_list->push_back(E->get().option); } + p_list->push_back(E->get().option); } -}; +} + +Ref<FontFile> DynamicFontImportSettingsData::get_font() const { + return fd; +} /*************************************************************************/ /* Glyph ranges */ @@ -454,58 +448,32 @@ void DynamicFontImportSettings::_add_glyph_range_item(int32_t p_start, int32_t p void DynamicFontImportSettings::_main_prop_changed(const String &p_edited_property) { // Update font preview. - if (p_edited_property == "face_index") { - if (font_preview->get_data_count() > 0) { - font_preview->get_data(0)->set_face_index(import_settings_data->get("face_index")); - } - } else if (p_edited_property == "antialiased") { - if (font_preview->get_data_count() > 0) { - font_preview->get_data(0)->set_antialiased(import_settings_data->get("antialiased")); - } - } else if (p_edited_property == "generate_mipmaps") { - if (font_preview->get_data_count() > 0) { - font_preview->get_data(0)->set_generate_mipmaps(import_settings_data->get("generate_mipmaps")); - } - } else if (p_edited_property == "multichannel_signed_distance_field") { - if (font_preview->get_data_count() > 0) { - font_preview->get_data(0)->set_multichannel_signed_distance_field(import_settings_data->get("multichannel_signed_distance_field")); - } - _variation_selected(); - _variations_validate(); - } else if (p_edited_property == "msdf_pixel_range") { - if (font_preview->get_data_count() > 0) { - font_preview->get_data(0)->set_msdf_pixel_range(import_settings_data->get("msdf_pixel_range")); - } - } else if (p_edited_property == "msdf_size") { - if (font_preview->get_data_count() > 0) { - font_preview->get_data(0)->set_msdf_size(import_settings_data->get("msdf_size")); - } - } else if (p_edited_property == "force_autohinter") { - if (font_preview->get_data_count() > 0) { - font_preview->get_data(0)->set_force_autohinter(import_settings_data->get("force_autohinter")); - } - } else if (p_edited_property == "hinting") { - if (font_preview->get_data_count() > 0) { - font_preview->get_data(0)->set_hinting((TextServer::Hinting)import_settings_data->get("hinting").operator int()); - } - } else if (p_edited_property == "subpixel_positioning") { - if (font_preview->get_data_count() > 0) { - font_preview->get_data(0)->set_subpixel_positioning((TextServer::SubpixelPositioning)import_settings_data->get("subpixel_positioning").operator int()); - } - } else if (p_edited_property == "embolden") { - if (font_preview->get_data_count() > 0) { - font_preview->get_data(0)->set_embolden(import_settings_data->get("embolden")); - } - } else if (p_edited_property == "transform") { - if (font_preview->get_data_count() > 0) { - font_preview->get_data(0)->set_transform(import_settings_data->get("transform")); - } - } else if (p_edited_property == "oversampling") { - if (font_preview->get_data_count() > 0) { - font_preview->get_data(0)->set_oversampling(import_settings_data->get("oversampling")); + if (font_preview.is_valid()) { + if (p_edited_property == "antialiased") { + font_preview->set_antialiased(import_settings_data->get("antialiased")); + } else if (p_edited_property == "generate_mipmaps") { + font_preview->set_generate_mipmaps(import_settings_data->get("generate_mipmaps")); + } else if (p_edited_property == "multichannel_signed_distance_field") { + font_preview->set_multichannel_signed_distance_field(import_settings_data->get("multichannel_signed_distance_field")); + _variation_selected(); + _variations_validate(); + } else if (p_edited_property == "msdf_pixel_range") { + font_preview->set_msdf_pixel_range(import_settings_data->get("msdf_pixel_range")); + } else if (p_edited_property == "msdf_size") { + font_preview->set_msdf_size(import_settings_data->get("msdf_size")); + } else if (p_edited_property == "force_autohinter") { + font_preview->set_force_autohinter(import_settings_data->get("force_autohinter")); + } else if (p_edited_property == "hinting") { + font_preview->set_hinting((TextServer::Hinting)import_settings_data->get("hinting").operator int()); + } else if (p_edited_property == "subpixel_positioning") { + font_preview->set_subpixel_positioning((TextServer::SubpixelPositioning)import_settings_data->get("subpixel_positioning").operator int()); + } else if (p_edited_property == "oversampling") { + font_preview->set_oversampling(import_settings_data->get("oversampling")); } } + font_preview_label->add_theme_font_override("font", font_preview); + font_preview_label->add_theme_font_size_override("font_size", 200 * EDSCALE); font_preview_label->update(); } @@ -534,6 +502,7 @@ void DynamicFontImportSettings::_variation_add() { import_variation_data->options = options_variations; inspector_vars->edit(import_variation_data.ptr()); import_variation_data->notify_property_list_changed(); + import_variation_data->fd = font_main; vars_item->set_metadata(0, import_variation_data); @@ -548,6 +517,10 @@ void DynamicFontImportSettings::_variation_selected() { inspector_vars->edit(import_variation_data.ptr()); import_variation_data->notify_property_list_changed(); + + label_glyphs->set_text(TTR("Preloaded glyphs: ") + itos(import_variation_data->selected_glyphs.size())); + _range_selected(); + _change_text_opts(); } } @@ -611,63 +584,91 @@ void DynamicFontImportSettings::_variations_validate() { } /*************************************************************************/ -/* Page 3 callbacks: Text to select glyphs */ +/* Page 2.1 callbacks: Text to select glyphs */ /*************************************************************************/ void DynamicFontImportSettings::_change_text_opts() { - Vector<String> ftr = ftr_edit->get_text().split(","); - for (int i = 0; i < ftr.size(); i++) { - Vector<String> tokens = ftr[i].split("="); - if (tokens.size() == 2) { - text_edit->set_opentype_feature(tokens[0], tokens[1].to_int()); - } else if (tokens.size() == 1) { - text_edit->set_opentype_feature(tokens[0], 1); - } + Ref<DynamicFontImportSettingsData> import_variation_data; + + TreeItem *vars_item = vars_list->get_selected(); + if (vars_item) { + import_variation_data = vars_item->get_metadata(0); } - text_edit->set_language(lang_edit->get_text()); + if (import_variation_data.is_null()) { + return; + } + + Ref<FontVariation> font_main_text; + font_main_text.instantiate(); + font_main_text->set_base_font(font_main); + font_main_text->set_opentype_features(text_settings_data->get("opentype_features")); + font_main_text->set_variation_opentype(import_variation_data->get("variation_opentype")); + font_main_text->set_variation_embolden(import_variation_data->get("variation_embolden")); + font_main_text->set_variation_face_index(import_variation_data->get("variation_face_index")); + font_main_text->set_variation_transform(import_variation_data->get("variation_transform")); + + text_edit->add_theme_font_override("font", font_main_text); } void DynamicFontImportSettings::_glyph_clear() { - selected_glyphs.clear(); - label_glyphs->set_text(TTR("Preloaded glyphs:") + " " + itos(selected_glyphs.size())); + Ref<DynamicFontImportSettingsData> import_variation_data; + + TreeItem *vars_item = vars_list->get_selected(); + if (vars_item) { + import_variation_data = vars_item->get_metadata(0); + } + if (import_variation_data.is_null()) { + return; + } + + import_variation_data->selected_glyphs.clear(); + label_glyphs->set_text(TTR("Preloaded glyphs:") + " " + itos(import_variation_data->selected_glyphs.size())); _range_selected(); } void DynamicFontImportSettings::_glyph_text_selected() { - Dictionary ftrs; - Vector<String> ftr = ftr_edit->get_text().split(","); - for (int i = 0; i < ftr.size(); i++) { - Vector<String> tokens = ftr[i].split("="); - if (tokens.size() == 2) { - ftrs[tokens[0]] = tokens[1].to_int(); - } else if (tokens.size() == 1) { - ftrs[tokens[0]] = 1; - } - } + Ref<DynamicFontImportSettingsData> import_variation_data; + TreeItem *vars_item = vars_list->get_selected(); + if (vars_item) { + import_variation_data = vars_item->get_metadata(0); + } + if (import_variation_data.is_null()) { + return; + } RID text_rid = TS->create_shaped_text(); if (text_rid.is_valid()) { - TS->shaped_text_add_string(text_rid, text_edit->get_text(), font_main->get_rids(), 16, ftrs, text_edit->get_language()); + TS->shaped_text_add_string(text_rid, text_edit->get_text(), font_main->get_rids(), 16, text_settings_data->get("opentype_features"), text_settings_data->get("language")); TS->shaped_text_shape(text_rid); const Glyph *gl = TS->shaped_text_get_glyphs(text_rid); const int gl_size = TS->shaped_text_get_glyph_count(text_rid); for (int i = 0; i < gl_size; i++) { if (gl[i].font_rid.is_valid() && gl[i].index != 0) { - selected_glyphs.insert(gl[i].index); + import_variation_data->selected_glyphs.insert(gl[i].index); } } TS->free_rid(text_rid); - label_glyphs->set_text(TTR("Preloaded glyphs:") + " " + itos(selected_glyphs.size())); + label_glyphs->set_text(TTR("Preloaded glyphs:") + " " + itos(import_variation_data->selected_glyphs.size())); } _range_selected(); } /*************************************************************************/ -/* Page 4 callbacks: Character map */ +/* Page 2.2 callbacks: Character map */ /*************************************************************************/ void DynamicFontImportSettings::_glyph_selected() { + Ref<DynamicFontImportSettingsData> import_variation_data; + + TreeItem *vars_item = vars_list->get_selected(); + if (vars_item) { + import_variation_data = vars_item->get_metadata(0); + } + if (import_variation_data.is_null()) { + return; + } + TreeItem *item = glyph_table->get_selected(); ERR_FAIL_NULL(item); @@ -685,7 +686,7 @@ void DynamicFontImportSettings::_glyph_selected() { item->clear_custom_bg_color(glyph_table->get_selected_column()); } } - label_glyphs->set_text(TTR("Preloaded glyphs:") + " " + itos(selected_glyphs.size())); + label_glyphs->set_text(TTR("Preloaded glyphs:") + " " + itos(import_variation_data->selected_glyphs.size())); item = glyph_tree->get_selected(); ERR_FAIL_NULL(item); @@ -698,7 +699,7 @@ void DynamicFontImportSettings::_glyph_selected() { total_chars--; } - if (selected_chars.has(i)) { + if (import_variation_data->selected_chars.has(i)) { selected_count++; } } @@ -728,6 +729,16 @@ void DynamicFontImportSettings::_range_selected() { } void DynamicFontImportSettings::_edit_range(int32_t p_start, int32_t p_end) { + Ref<DynamicFontImportSettingsData> import_variation_data; + + TreeItem *vars_item = vars_list->get_selected(); + if (vars_item) { + import_variation_data = vars_item->get_metadata(0); + } + if (import_variation_data.is_null()) { + return; + } + glyph_table->clear(); TreeItem *root = glyph_table->create_item(); @@ -740,6 +751,8 @@ void DynamicFontImportSettings::_edit_range(int32_t p_start, int32_t p_end) { TreeItem *item = nullptr; int col = 0; + Ref<Font> font_main_big = font_main->duplicate(); + for (int32_t c = p_start; c <= p_end; c++) { if (col == 0) { item = glyph_table->create_item(root); @@ -752,7 +765,7 @@ void DynamicFontImportSettings::_edit_range(int32_t p_start, int32_t p_end) { if (font_main->has_char(c)) { item->set_text(col + 1, String::chr(c)); item->set_custom_color(col + 1, Color(1, 1, 1)); - if (selected_chars.has(c) || (font_main->get_data(0).is_valid() && selected_glyphs.has(font_main->get_data(0)->get_glyph_index(get_theme_font_size(SNAME("font_size")) * 2, c)))) { + if (import_variation_data->selected_chars.has(c) || import_variation_data->selected_glyphs.has(font_main->get_glyph_index(16, c))) { item->set_custom_color(col + 1, fcol); item->set_custom_bg_color(col + 1, scol); } else { @@ -765,7 +778,8 @@ void DynamicFontImportSettings::_edit_range(int32_t p_start, int32_t p_end) { item->set_metadata(col + 1, c); item->set_text_alignment(col + 1, HORIZONTAL_ALIGNMENT_CENTER); item->set_selectable(col + 1, true); - item->set_custom_font(col + 1, font_main); + + item->set_custom_font(col + 1, font_main_big); item->set_custom_font_size(col + 1, get_theme_font_size(SNAME("font_size")) * 2); col++; @@ -773,41 +787,61 @@ void DynamicFontImportSettings::_edit_range(int32_t p_start, int32_t p_end) { col = 0; } } - label_glyphs->set_text(TTR("Preloaded glyphs:") + " " + itos(selected_glyphs.size())); + label_glyphs->set_text(TTR("Preloaded glyphs:") + " " + itos(import_variation_data->selected_glyphs.size())); } bool DynamicFontImportSettings::_char_update(int32_t p_char) { - if (selected_chars.has(p_char)) { - selected_chars.erase(p_char); + Ref<DynamicFontImportSettingsData> import_variation_data; + + TreeItem *vars_item = vars_list->get_selected(); + if (vars_item) { + import_variation_data = vars_item->get_metadata(0); + } + if (import_variation_data.is_null()) { return false; - } else if (font_main->get_data(0).is_valid() && selected_glyphs.has(font_main->get_data(0)->get_glyph_index(get_theme_font_size(SNAME("font_size")) * 2, p_char))) { - selected_glyphs.erase(font_main->get_data(0)->get_glyph_index(get_theme_font_size(SNAME("font_size")) * 2, p_char)); + } + + if (import_variation_data->selected_chars.has(p_char)) { + import_variation_data->selected_chars.erase(p_char); + return false; + } else if (font_main.is_valid() && font_main.is_valid() && import_variation_data->selected_glyphs.has(font_main->get_glyph_index(16, p_char))) { + import_variation_data->selected_glyphs.erase(font_main->get_glyph_index(16, p_char)); return false; } else { - selected_chars.insert(p_char); + import_variation_data->selected_chars.insert(p_char); return true; } } void DynamicFontImportSettings::_range_update(int32_t p_start, int32_t p_end) { + Ref<DynamicFontImportSettingsData> import_variation_data; + + TreeItem *vars_item = vars_list->get_selected(); + if (vars_item) { + import_variation_data = vars_item->get_metadata(0); + } + if (import_variation_data.is_null()) { + return; + } + bool all_selected = true; for (int32_t i = p_start; i <= p_end; i++) { if (font_main->has_char(i)) { - if (font_main->get_data(0).is_valid()) { - all_selected = all_selected && (selected_chars.has(i) || (font_main->get_data(0).is_valid() && selected_glyphs.has(font_main->get_data(0)->get_glyph_index(get_theme_font_size(SNAME("font_size")) * 2, i)))); + if (font_main.is_valid()) { + all_selected = all_selected && (import_variation_data->selected_chars.has(i) || import_variation_data->selected_glyphs.has(font_main->get_glyph_index(16, i))); } else { - all_selected = all_selected && selected_chars.has(i); + all_selected = all_selected && import_variation_data->selected_chars.has(i); } } } for (int32_t i = p_start; i <= p_end; i++) { if (font_main->has_char(i)) { if (!all_selected) { - selected_chars.insert(i); + import_variation_data->selected_chars.insert(i); } else { - selected_chars.erase(i); - if (font_main->get_data(0).is_valid()) { - selected_glyphs.erase(font_main->get_data(0)->get_glyph_index(get_theme_font_size(SNAME("font_size")) * 2, i)); + import_variation_data->selected_chars.erase(i); + if (font_main.is_valid()) { + import_variation_data->selected_glyphs.erase(font_main->get_glyph_index(16, i)); } } } @@ -820,106 +854,6 @@ void DynamicFontImportSettings::_range_update(int32_t p_start, int32_t p_end) { } /*************************************************************************/ -/* Page 5 callbacks: CMetadata override */ -/*************************************************************************/ - -void DynamicFontImportSettings::_lang_add() { - locale_select->popup_locale_dialog(); -} - -void DynamicFontImportSettings::_lang_add_item(const String &p_locale) { - TreeItem *lang_item = lang_list->create_item(lang_list_root); - ERR_FAIL_NULL(lang_item); - - lang_item->set_cell_mode(0, TreeItem::CELL_MODE_CHECK); - lang_item->set_editable(0, true); - lang_item->set_checked(0, false); - lang_item->set_text(1, p_locale); - lang_item->set_editable(1, true); - lang_item->add_button(2, lang_list->get_theme_icon(SNAME("Remove"), SNAME("EditorIcons")), BUTTON_REMOVE_VAR, false, TTR("Remove")); - lang_item->set_button_color(2, 0, Color(1, 1, 1, 0.75)); -} - -void DynamicFontImportSettings::_lang_remove(Object *p_item, int p_column, int p_id, MouseButton p_button) { - if (p_button != MouseButton::LEFT) { - return; - } - - TreeItem *lang_item = (TreeItem *)p_item; - ERR_FAIL_NULL(lang_item); - - lang_list_root->remove_child(lang_item); - memdelete(lang_item); -} - -void DynamicFontImportSettings::_ot_add() { - menu_ot->set_position(ot_list->get_screen_transform().xform(ot_list->get_local_mouse_position())); - menu_ot->set_size(Vector2(1, 1)); - menu_ot->popup(); -} - -void DynamicFontImportSettings::_ot_add_item(int p_option) { - String name = TS->tag_to_name(p_option); - for (TreeItem *ot_item = ot_list_root->get_first_child(); ot_item; ot_item = ot_item->get_next()) { - if (ot_item->get_text(0) == name) { - return; - } - } - TreeItem *ot_item = ot_list->create_item(ot_list_root); - ERR_FAIL_NULL(ot_item); - - ot_item->set_text(0, name); - ot_item->set_editable(0, false); - ot_item->set_text(1, "1"); - ot_item->set_editable(1, true); - ot_item->add_button(2, ot_list->get_theme_icon(SNAME("Remove"), SNAME("EditorIcons")), BUTTON_REMOVE_VAR, false, TTR("Remove")); - ot_item->set_button_color(2, 0, Color(1, 1, 1, 0.75)); -} - -void DynamicFontImportSettings::_ot_remove(Object *p_item, int p_column, int p_id, MouseButton p_button) { - if (p_button != MouseButton::LEFT) { - return; - } - - TreeItem *ot_item = (TreeItem *)p_item; - ERR_FAIL_NULL(ot_item); - - ot_list_root->remove_child(ot_item); - memdelete(ot_item); -} - -void DynamicFontImportSettings::_script_add() { - menu_scripts->set_position(script_list->get_screen_position() + script_list->get_local_mouse_position()); - menu_scripts->reset_size(); - menu_scripts->popup(); -} - -void DynamicFontImportSettings::_script_add_item(int p_option) { - TreeItem *script_item = script_list->create_item(script_list_root); - ERR_FAIL_NULL(script_item); - - script_item->set_cell_mode(0, TreeItem::CELL_MODE_CHECK); - script_item->set_editable(0, true); - script_item->set_checked(0, false); - script_item->set_text(1, script_codes[p_option]); - script_item->set_editable(1, true); - script_item->add_button(2, lang_list->get_theme_icon(SNAME("Remove"), SNAME("EditorIcons")), BUTTON_REMOVE_VAR, false, TTR("Remove")); - script_item->set_button_color(2, 0, Color(1, 1, 1, 0.75)); -} - -void DynamicFontImportSettings::_script_remove(Object *p_item, int p_column, int p_id, MouseButton p_button) { - if (p_button != MouseButton::LEFT) { - return; - } - - TreeItem *script_item = (TreeItem *)p_item; - ERR_FAIL_NULL(script_item); - - script_list_root->remove_child(script_item); - memdelete(script_item); -} - -/*************************************************************************/ /* Common */ /*************************************************************************/ @@ -938,10 +872,7 @@ void DynamicFontImportSettings::_notification(int p_what) { case NOTIFICATION_ENTER_TREE: case NOTIFICATION_THEME_CHANGED: { - add_lang->set_icon(add_var->get_theme_icon(SNAME("Add"), SNAME("EditorIcons"))); - add_script->set_icon(add_var->get_theme_icon(SNAME("Add"), SNAME("EditorIcons"))); add_var->set_icon(add_var->get_theme_icon(SNAME("Add"), SNAME("EditorIcons"))); - add_ot->set_icon(add_var->get_theme_icon(SNAME("Add"), SNAME("EditorIcons"))); } break; } } @@ -958,90 +889,40 @@ void DynamicFontImportSettings::_re_import() { main_settings["force_autohinter"] = import_settings_data->get("force_autohinter"); main_settings["hinting"] = import_settings_data->get("hinting"); main_settings["subpixel_positioning"] = import_settings_data->get("subpixel_positioning"); - main_settings["embolden"] = import_settings_data->get("embolden"); - main_settings["transform"] = import_settings_data->get("transform"); main_settings["oversampling"] = import_settings_data->get("oversampling"); + main_settings["fallbacks"] = import_settings_data->get("fallbacks"); main_settings["compress"] = import_settings_data->get("compress"); - Vector<String> variations; + Array configurations; for (TreeItem *vars_item = vars_list_root->get_first_child(); vars_item; vars_item = vars_item->get_next()) { - String variation; Ref<DynamicFontImportSettingsData> import_variation_data = vars_item->get_metadata(0); ERR_FAIL_NULL(import_variation_data); - String name = vars_item->get_text(0); - variation += ("name=" + name); + Dictionary preload_config; + preload_config["name"] = vars_item->get_text(0); + for (const KeyValue<StringName, Variant> &E : import_variation_data->settings) { - if (!variation.is_empty()) { - variation += ","; - } - variation += (String(E.key) + "=" + String(E.value)); - } - variations.push_back(variation); - } - main_settings["preload/configurations"] = variations; - - Vector<String> langs_enabled; - Vector<String> langs_disabled; - for (TreeItem *lang_item = lang_list_root->get_first_child(); lang_item; lang_item = lang_item->get_next()) { - bool selected = lang_item->is_checked(0); - String name = lang_item->get_text(1); - if (selected) { - langs_enabled.push_back(name); - } else { - langs_disabled.push_back(name); + preload_config[E.key] = E.value; } - } - main_settings["support_overrides/language_enabled"] = langs_enabled; - main_settings["support_overrides/language_disabled"] = langs_disabled; - - Vector<String> scripts_enabled; - Vector<String> scripts_disabled; - for (TreeItem *script_item = script_list_root->get_first_child(); script_item; script_item = script_item->get_next()) { - bool selected = script_item->is_checked(0); - String name = script_item->get_text(1); - if (selected) { - scripts_enabled.push_back(name); - } else { - scripts_disabled.push_back(name); - } - } - main_settings["support_overrides/script_enabled"] = scripts_enabled; - main_settings["support_overrides/script_disabled"] = scripts_disabled; - - if (!selected_chars.is_empty()) { - Vector<String> ranges; - char32_t start = selected_chars.front()->get(); - for (RBSet<char32_t>::Element *E = selected_chars.front()->next(); E; E = E->next()) { - if (E->prev() && ((E->prev()->get() + 1) != E->get())) { - ranges.push_back(String("0x") + String::num_int64(start, 16) + String("-0x") + String::num_int64(E->prev()->get(), 16)); - start = E->get(); - } + + Array chars; + for (const char32_t &E : import_variation_data->selected_chars) { + chars.push_back(E); } - ranges.push_back(String("0x") + String::num_int64(start, 16) + String("-0x") + String::num_int64(selected_chars.back()->get(), 16)); - main_settings["preload/char_ranges"] = ranges; - } + preload_config["chars"] = chars; - if (!selected_glyphs.is_empty()) { - Vector<String> ranges; - int32_t start = selected_glyphs.front()->get(); - for (RBSet<int32_t>::Element *E = selected_glyphs.front()->next(); E; E = E->next()) { - if (E->prev() && ((E->prev()->get() + 1) != E->get())) { - ranges.push_back(String("0x") + String::num_int64(start, 16) + String("-0x") + String::num_int64(E->prev()->get(), 16)); - start = E->get(); - } + Array glyphs; + for (const int32_t &E : import_variation_data->selected_glyphs) { + glyphs.push_back(E); } - ranges.push_back(String("0x") + String::num_int64(start, 16) + String("-0x") + String::num_int64(selected_glyphs.back()->get(), 16)); - main_settings["preload/glyph_ranges"] = ranges; - } + preload_config["glyphs"] = glyphs; - Dictionary ot_ov; - for (TreeItem *ot_item = ot_list_root->get_first_child(); ot_item; ot_item = ot_item->get_next()) { - String tag = ot_item->get_text(0); - int32_t value = ot_item->get_text(1).to_int(); - ot_ov[tag] = value; + configurations.push_back(preload_config); } - main_settings["opentype_feature_overrides"] = ot_ov; + main_settings["preload"] = configurations; + main_settings["language_support"] = import_settings_data->get("language_support"); + main_settings["script_support"] = import_settings_data->get("script_support"); + main_settings["opentype_features"] = import_settings_data->get("opentype_features"); if (OS::get_singleton()->is_stdout_verbose()) { print_line("Import settings:"); @@ -1058,33 +939,33 @@ void DynamicFontImportSettings::open_settings(const String &p_path) { Vector<uint8_t> data = FileAccess::get_file_as_array(p_path); // Load font for preview. - Ref<FontData> dfont_prev; - dfont_prev.instantiate(); - dfont_prev->set_data(data); - font_preview.instantiate(); - font_preview->add_data(dfont_prev); + font_preview->set_data(data); + String font_name = vformat("%s (%s)", font_preview->get_font_name(), font_preview->get_font_style_name()); String sample; static const String sample_base = U"12漢字ԱբΑαАбΑαאבابܐܒހށआআਆઆଆஆఆಆആආกิກິༀကႠა한글ሀᎣᐁᚁᚠᜀᜠᝀᝠកᠠᤁᥐAb😀"; for (int i = 0; i < sample_base.length(); i++) { - if (dfont_prev->has_char(sample_base[i])) { + if (font_preview->has_char(sample_base[i])) { sample += sample_base[i]; } } if (sample.is_empty()) { - sample = dfont_prev->get_supported_chars().substr(0, 6); + sample = font_preview->get_supported_chars().substr(0, 6); } font_preview_label->set_text(sample); - // Load second copy of font with MSDF disabled for the glyph table and metadata extraction. - Ref<FontData> dfont_main; - dfont_main.instantiate(); - dfont_main->set_data(data); - dfont_main->set_multichannel_signed_distance_field(false); + Ref<Font> bold_font = get_theme_font(SNAME("bold"), SNAME("EditorFonts")); + if (bold_font.is_valid() && bold_font.is_valid()) { + font_name_label->add_theme_font_override("bold_font", bold_font); + } + font_name_label->set_text(font_name); + // Load second copy of font with MSDF disabled for the glyph table and metadata extraction. font_main.instantiate(); - font_main->add_data(dfont_main); + font_main->set_data(data); + font_main->set_multichannel_signed_distance_field(false); + text_edit->add_theme_font_override("font", font_main); base_path = p_path; @@ -1092,35 +973,27 @@ void DynamicFontImportSettings::open_settings(const String &p_path) { inspector_vars->edit(nullptr); inspector_general->edit(nullptr); - int gww = get_theme_font(SNAME("font"))->get_string_size("00000", get_theme_font_size(SNAME("font_size"))).x + 50; + text_settings_data.instantiate(); + ERR_FAIL_NULL(text_settings_data); + + text_settings_data->owner = this; + + for (List<ResourceImporter::ImportOption>::Element *F = options_text.front(); F; F = F->next()) { + text_settings_data->defaults[F->get().option.name] = F->get().default_value; + } + + text_settings_data->fd = font_main; + text_settings_data->options = options_text; + + inspector_text->edit(text_settings_data.ptr()); + + int gww = get_theme_font(SNAME("font"))->get_string_size("00000").x + 50; glyph_table->set_column_custom_minimum_width(0, gww); glyph_table->clear(); vars_list->clear(); - lang_list->clear(); - script_list->clear(); - ot_list->clear(); - - selected_chars.clear(); - selected_glyphs.clear(); - text_edit->set_text(String()); vars_list_root = vars_list->create_item(); - lang_list_root = lang_list->create_item(); - script_list_root = script_list->create_item(); - ot_list_root = ot_list->create_item(); - - options_variations.clear(); - Dictionary var_list = dfont_main->get_supported_variation_list(); - for (int i = 0; i < var_list.size(); i++) { - int32_t tag = var_list.get_key_at_index(i); - Vector3i value = var_list.get_value_at_index(i); - options_variations.push_back(ResourceImporter::ImportOption(PropertyInfo(Variant::FLOAT, TS->tag_to_name(tag), PROPERTY_HINT_RANGE, itos(value.x) + "," + itos(value.y) + ",1"), value.z)); - } - options_variations.push_back(ResourceImporter::ImportOption(PropertyInfo(Variant::INT, "size", PROPERTY_HINT_RANGE, "0,127,1"), 16)); - options_variations.push_back(ResourceImporter::ImportOption(PropertyInfo(Variant::INT, "outline_size", PROPERTY_HINT_RANGE, "0,127,1"), 0)); - options_variations.push_back(ResourceImporter::ImportOption(PropertyInfo(Variant::INT, "extra_spacing_glyph"), 0)); - options_variations.push_back(ResourceImporter::ImportOption(PropertyInfo(Variant::INT, "extra_spacing_space"), 0)); import_settings_data->defaults.clear(); for (List<ResourceImporter::ImportOption>::Element *E = options_general.front(); E; E = E->next()) { @@ -1139,157 +1012,58 @@ void DynamicFontImportSettings::open_settings(const String &p_path) { for (List<String>::Element *E = keys.front(); E; E = E->next()) { String key = E->get(); print_verbose(String(" ") + key + " == " + String(config->get_value("params", key))); - if (key == "preload/char_ranges") { - Vector<String> ranges = config->get_value("params", key); - for (int i = 0; i < ranges.size(); i++) { - int32_t start, end; - Vector<String> tokens = ranges[i].split("-"); - if (tokens.size() == 2) { - if (!ResourceImporterDynamicFont::_decode_range(tokens[0], start) || !ResourceImporterDynamicFont::_decode_range(tokens[1], end)) { - WARN_PRINT("Invalid range: \"" + ranges[i] + "\""); - continue; - } - } else if (tokens.size() == 1) { - if (!ResourceImporterDynamicFont::_decode_range(tokens[0], start)) { - WARN_PRINT("Invalid range: \"" + ranges[i] + "\""); - continue; - } - end = start; - } else { - WARN_PRINT("Invalid range: \"" + ranges[i] + "\""); - continue; - } - for (int32_t j = start; j <= end; j++) { - selected_chars.insert(j); - } - } - } else if (key == "preload/glyph_ranges") { - Vector<String> ranges = config->get_value("params", key); - for (int i = 0; i < ranges.size(); i++) { - int32_t start, end; - Vector<String> tokens = ranges[i].split("-"); - if (tokens.size() == 2) { - if (!ResourceImporterDynamicFont::_decode_range(tokens[0], start) || !ResourceImporterDynamicFont::_decode_range(tokens[1], end)) { - WARN_PRINT("Invalid range: \"" + ranges[i] + "\""); - continue; - } - } else if (tokens.size() == 1) { - if (!ResourceImporterDynamicFont::_decode_range(tokens[0], start)) { - WARN_PRINT("Invalid range: \"" + ranges[i] + "\""); - continue; - } - end = start; - } else { - WARN_PRINT("Invalid range: \"" + ranges[i] + "\""); - continue; - } - for (int32_t j = start; j <= end; j++) { - selected_glyphs.insert(j); - } - } - } else if (key == "preload/configurations") { - Vector<String> variations = config->get_value("params", key); - for (int i = 0; i < variations.size(); i++) { + if (key == "preload") { + Array preload_configurations = config->get_value("params", key); + for (int i = 0; i < preload_configurations.size(); i++) { + Dictionary preload_config = preload_configurations[i]; + + Dictionary variation = preload_config.has("variation_opentype") ? preload_config["variation_opentype"].operator Dictionary() : Dictionary(); + double embolden = preload_config.has("variation_embolden") ? preload_config["variation_embolden"].operator double() : 0; + int face_index = preload_config.has("variation_face_index") ? preload_config["variation_face_index"].operator int() : 0; + Transform2D transform = preload_config.has("variation_transform") ? preload_config["variation_transform"].operator Transform2D() : Transform2D(); + Vector2i size = preload_config.has("size") ? preload_config["size"].operator Vector2i() : Vector2i(16, 0); + String cfg_name = preload_config.has("name") ? preload_config["name"].operator String() : vformat("Configuration %d", i); + TreeItem *vars_item = vars_list->create_item(vars_list_root); ERR_FAIL_NULL(vars_item); - vars_item->set_text(0, TTR("Configuration") + " " + itos(i)); + vars_item->set_text(0, cfg_name); vars_item->set_editable(0, true); vars_item->add_button(1, vars_list->get_theme_icon(SNAME("Remove"), SNAME("EditorIcons")), BUTTON_REMOVE_VAR, false, TTR("Remove Variation")); vars_item->set_button_color(1, 0, Color(1, 1, 1, 0.75)); Ref<DynamicFontImportSettingsData> import_variation_data_custom; import_variation_data_custom.instantiate(); - import_variation_data_custom->owner = this; ERR_FAIL_NULL(import_variation_data_custom); + import_variation_data_custom->owner = this; for (List<ResourceImporter::ImportOption>::Element *F = options_variations.front(); F; F = F->next()) { import_variation_data_custom->defaults[F->get().option.name] = F->get().default_value; } - import_variation_data_custom->options = options_variations; + import_variation_data_custom->fd = font_main; + import_variation_data_custom->options = options_variations; vars_item->set_metadata(0, import_variation_data_custom); - Vector<String> variation_tags = variations[i].split(","); - for (int j = 0; j < variation_tags.size(); j++) { - Vector<String> tokens = variation_tags[j].split("="); - if (tokens[0] == "name") { - vars_item->set_text(0, tokens[1]); - } else if (tokens[0] == "size" || tokens[0] == "outline_size" || tokens[0] == "extra_spacing_space" || tokens[0] == "extra_spacing_glyph") { - import_variation_data_custom->set(tokens[0], tokens[1].to_int()); - } else { - import_variation_data_custom->set(tokens[0], tokens[1].to_float()); - } + + import_variation_data_custom->set("size", size.x); + import_variation_data_custom->set("outline_size", size.y); + import_variation_data_custom->set("variation_opentype", variation); + import_variation_data_custom->set("variation_embolden", embolden); + import_variation_data_custom->set("variation_face_index", face_index); + import_variation_data_custom->set("variation_transform", transform); + + Array chars = preload_config["chars"]; + for (int j = 0; j < chars.size(); j++) { + char32_t c = chars[j].operator int(); + import_variation_data_custom->selected_chars.insert(c); } - } - } else if (key == "support_overrides/language_enabled") { - PackedStringArray _langs = config->get_value("params", key); - for (int i = 0; i < _langs.size(); i++) { - TreeItem *lang_item = lang_list->create_item(lang_list_root); - ERR_FAIL_NULL(lang_item); - - lang_item->set_cell_mode(0, TreeItem::CELL_MODE_CHECK); - lang_item->set_editable(0, true); - lang_item->set_checked(0, true); - lang_item->set_text(1, _langs[i]); - lang_item->set_editable(1, true); - lang_item->add_button(2, lang_list->get_theme_icon(SNAME("Remove"), SNAME("EditorIcons")), BUTTON_REMOVE_VAR, false, TTR("Remove")); - } - } else if (key == "support_overrides/language_disabled") { - PackedStringArray _langs = config->get_value("params", key); - for (int i = 0; i < _langs.size(); i++) { - TreeItem *lang_item = lang_list->create_item(lang_list_root); - ERR_FAIL_NULL(lang_item); - - lang_item->set_cell_mode(0, TreeItem::CELL_MODE_CHECK); - lang_item->set_editable(0, true); - lang_item->set_checked(0, false); - lang_item->set_text(1, _langs[i]); - lang_item->set_editable(1, true); - lang_item->add_button(2, lang_list->get_theme_icon(SNAME("Remove"), SNAME("EditorIcons")), BUTTON_REMOVE_VAR, false, TTR("Remove")); - } - } else if (key == "support_overrides/script_enabled") { - PackedStringArray _scripts = config->get_value("params", key); - for (int i = 0; i < _scripts.size(); i++) { - TreeItem *script_item = script_list->create_item(script_list_root); - ERR_FAIL_NULL(script_item); - - script_item->set_cell_mode(0, TreeItem::CELL_MODE_CHECK); - script_item->set_editable(0, true); - script_item->set_checked(0, true); - script_item->set_text(1, _scripts[i]); - script_item->set_editable(1, true); - script_item->add_button(2, lang_list->get_theme_icon(SNAME("Remove"), SNAME("EditorIcons")), BUTTON_REMOVE_VAR, false, TTR("Remove")); - } - } else if (key == "support_overrides/script_disabled") { - PackedStringArray _scripts = config->get_value("params", key); - for (int i = 0; i < _scripts.size(); i++) { - TreeItem *script_item = script_list->create_item(script_list_root); - ERR_FAIL_NULL(script_item); - - script_item->set_cell_mode(0, TreeItem::CELL_MODE_CHECK); - script_item->set_editable(0, true); - script_item->set_checked(0, false); - script_item->set_text(1, _scripts[i]); - script_item->set_editable(1, true); - script_item->add_button(2, lang_list->get_theme_icon(SNAME("Remove"), SNAME("EditorIcons")), BUTTON_REMOVE_VAR, false, TTR("Remove")); - } - } else if (key == "opentype_feature_overrides") { - Dictionary features = config->get_value("params", key); - for (const Variant *ftr = features.next(nullptr); ftr != nullptr; ftr = features.next(ftr)) { - TreeItem *ot_item = ot_list->create_item(ot_list_root); - ERR_FAIL_NULL(ot_item); - int32_t value = features[*ftr]; - if (ftr->get_type() == Variant::STRING) { - ot_item->set_text(0, *ftr); - } else { - ot_item->set_text(0, TS->tag_to_name(*ftr)); + + Array glyphs = preload_config["glyphs"]; + for (int j = 0; j < glyphs.size(); j++) { + int32_t c = glyphs[j]; + import_variation_data_custom->selected_glyphs.insert(c); } - ot_item->set_editable(0, false); - ot_item->set_text(1, itos(value)); - ot_item->set_editable(1, true); - ot_item->add_button(2, ot_list->get_theme_icon(SNAME("Remove"), SNAME("EditorIcons")), BUTTON_REMOVE_VAR, false, TTR("Remove")); - ot_item->set_button_color(2, 0, Color(1, 1, 1, 0.75)); } } else { Variant value = config->get_value("params", key); @@ -1297,61 +1071,26 @@ void DynamicFontImportSettings::open_settings(const String &p_path) { } } } - label_glyphs->set_text(TTR("Preloaded glyphs:") + " " + itos(selected_glyphs.size())); + import_settings_data->fd = font_main; import_settings_data->options = options_general; inspector_general->edit(import_settings_data.ptr()); import_settings_data->notify_property_list_changed(); - if (font_preview->get_data_count() > 0) { - font_preview->get_data(0)->set_face_index(import_settings_data->get("face_index")); - font_preview->get_data(0)->set_antialiased(import_settings_data->get("antialiased")); - font_preview->get_data(0)->set_multichannel_signed_distance_field(import_settings_data->get("multichannel_signed_distance_field")); - font_preview->get_data(0)->set_msdf_pixel_range(import_settings_data->get("msdf_pixel_range")); - font_preview->get_data(0)->set_msdf_size(import_settings_data->get("msdf_size")); - font_preview->get_data(0)->set_force_autohinter(import_settings_data->get("force_autohinter")); - font_preview->get_data(0)->set_hinting((TextServer::Hinting)import_settings_data->get("hinting").operator int()); - font_preview->get_data(0)->set_subpixel_positioning((TextServer::SubpixelPositioning)import_settings_data->get("subpixel_positioning").operator int()); - font_preview->get_data(0)->set_embolden(import_settings_data->get("embolden")); - font_preview->get_data(0)->set_transform(import_settings_data->get("transform")); - font_preview->get_data(0)->set_oversampling(import_settings_data->get("oversampling")); + if (font_preview.is_valid()) { + font_preview->set_antialiased(import_settings_data->get("antialiased")); + font_preview->set_multichannel_signed_distance_field(import_settings_data->get("multichannel_signed_distance_field")); + font_preview->set_msdf_pixel_range(import_settings_data->get("msdf_pixel_range")); + font_preview->set_msdf_size(import_settings_data->get("msdf_size")); + font_preview->set_force_autohinter(import_settings_data->get("force_autohinter")); + font_preview->set_hinting((TextServer::Hinting)import_settings_data->get("hinting").operator int()); + font_preview->set_subpixel_positioning((TextServer::SubpixelPositioning)import_settings_data->get("subpixel_positioning").operator int()); + font_preview->set_oversampling(import_settings_data->get("oversampling")); } font_preview_label->add_theme_font_override("font", font_preview); + font_preview_label->add_theme_font_size_override("font_size", 200 * EDSCALE); font_preview_label->update(); - menu_ot->clear(); - menu_ot_ss->clear(); - menu_ot_cv->clear(); - menu_ot_cu->clear(); - bool have_ss = false; - bool have_cv = false; - bool have_cu = false; - Dictionary features = font_preview->get_feature_list(); - for (const Variant *ftr = features.next(nullptr); ftr != nullptr; ftr = features.next(ftr)) { - String ftr_name = TS->tag_to_name(*ftr); - if (ftr_name.begins_with("stylistic_set_")) { - menu_ot_ss->add_item(ftr_name.capitalize(), (int32_t)*ftr); - have_ss = true; - } else if (ftr_name.begins_with("character_variant_")) { - menu_ot_cv->add_item(ftr_name.capitalize(), (int32_t)*ftr); - have_cv = true; - } else if (ftr_name.begins_with("custom_")) { - menu_ot_cu->add_item(ftr_name.replace("custom_", ""), (int32_t)*ftr); - have_cu = true; - } else { - menu_ot->add_item(ftr_name.capitalize(), (int32_t)*ftr); - } - } - if (have_ss) { - menu_ot->add_submenu_item(RTR("Stylistic Sets"), "SSMenu"); - } - if (have_cv) { - menu_ot->add_submenu_item(RTR("Character Variants"), "CVMenu"); - } - if (have_cu) { - menu_ot->add_submenu_item(RTR("Custom"), "CUMenu"); - } - _variations_validate(); popup_centered_ratio(); @@ -1366,7 +1105,8 @@ DynamicFontImportSettings *DynamicFontImportSettings::get_singleton() { DynamicFontImportSettings::DynamicFontImportSettings() { singleton = this; - options_general.push_back(ResourceImporter::ImportOption(PropertyInfo(Variant::INT, "face_index"), 0)); + options_general.push_back(ResourceImporter::ImportOption(PropertyInfo(Variant::NIL, "Rendering", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_GROUP), Variant())); + options_general.push_back(ResourceImporter::ImportOption(PropertyInfo(Variant::BOOL, "antialiased"), true)); options_general.push_back(ResourceImporter::ImportOption(PropertyInfo(Variant::BOOL, "generate_mipmaps"), false)); options_general.push_back(ResourceImporter::ImportOption(PropertyInfo(Variant::BOOL, "multichannel_signed_distance_field", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED), true)); @@ -1375,44 +1115,29 @@ DynamicFontImportSettings::DynamicFontImportSettings() { options_general.push_back(ResourceImporter::ImportOption(PropertyInfo(Variant::BOOL, "force_autohinter"), false)); options_general.push_back(ResourceImporter::ImportOption(PropertyInfo(Variant::INT, "hinting", PROPERTY_HINT_ENUM, "None,Light,Normal"), 1)); options_general.push_back(ResourceImporter::ImportOption(PropertyInfo(Variant::INT, "subpixel_positioning", PROPERTY_HINT_ENUM, "Disabled,Auto,One half of a pixel,One quarter of a pixel"), 1)); - options_general.push_back(ResourceImporter::ImportOption(PropertyInfo(Variant::FLOAT, "embolden", PROPERTY_HINT_RANGE, "-2,2,0.01"), 0.f)); - options_general.push_back(ResourceImporter::ImportOption(PropertyInfo(Variant::TRANSFORM2D, "transform"), Transform2D())); options_general.push_back(ResourceImporter::ImportOption(PropertyInfo(Variant::FLOAT, "oversampling", PROPERTY_HINT_RANGE, "0,10,0.1"), 0.0)); - options_general.push_back(ResourceImporter::ImportOption(PropertyInfo(Variant::BOOL, "compress", PROPERTY_HINT_NONE, ""), false)); - - // Popup menus - - locale_select = memnew(EditorLocaleDialog); - locale_select->connect("locale_selected", callable_mp(this, &DynamicFontImportSettings::_lang_add_item)); - add_child(locale_select); - menu_scripts = memnew(PopupMenu); - menu_scripts->set_name("Script"); - script_codes = TranslationServer::get_singleton()->get_all_scripts(); - for (int i = 0; i < script_codes.size(); i++) { - menu_scripts->add_item(TranslationServer::get_singleton()->get_script_name(script_codes[i]) + " (" + script_codes[i] + ")", i); - } - add_child(menu_scripts); - menu_scripts->connect("id_pressed", callable_mp(this, &DynamicFontImportSettings::_script_add_item)); + options_general.push_back(ResourceImporter::ImportOption(PropertyInfo(Variant::NIL, "Metadata Overrides", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_GROUP), Variant())); + options_general.push_back(ResourceImporter::ImportOption(PropertyInfo(Variant::DICTIONARY, "language_support"), Dictionary())); + options_general.push_back(ResourceImporter::ImportOption(PropertyInfo(Variant::DICTIONARY, "script_support"), Dictionary())); + options_general.push_back(ResourceImporter::ImportOption(PropertyInfo(Variant::DICTIONARY, "opentype_features"), Dictionary())); - menu_ot = memnew(PopupMenu); - add_child(menu_ot); - menu_ot->connect("id_pressed", callable_mp(this, &DynamicFontImportSettings::_ot_add_item)); + options_general.push_back(ResourceImporter::ImportOption(PropertyInfo(Variant::NIL, "Fallbacks", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_GROUP), Variant())); + options_general.push_back(ResourceImporter::ImportOption(PropertyInfo(Variant::ARRAY, "fallbacks", PROPERTY_HINT_ARRAY_TYPE, vformat("%s/%s:%s", Variant::OBJECT, PROPERTY_HINT_RESOURCE_TYPE, "Font")), Array())); - menu_ot_cv = memnew(PopupMenu); - menu_ot_cv->set_name("CVMenu"); - menu_ot->add_child(menu_ot_cv); - menu_ot_cv->connect("id_pressed", callable_mp(this, &DynamicFontImportSettings::_ot_add_item)); + options_general.push_back(ResourceImporter::ImportOption(PropertyInfo(Variant::NIL, "Compress", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_GROUP), Variant())); + options_general.push_back(ResourceImporter::ImportOption(PropertyInfo(Variant::BOOL, "compress", PROPERTY_HINT_NONE, ""), false)); - menu_ot_ss = memnew(PopupMenu); - menu_ot_ss->set_name("SSMenu"); - menu_ot->add_child(menu_ot_ss); - menu_ot_ss->connect("id_pressed", callable_mp(this, &DynamicFontImportSettings::_ot_add_item)); + options_text.push_back(ResourceImporter::ImportOption(PropertyInfo(Variant::DICTIONARY, "opentype_features"), Dictionary())); + options_text.push_back(ResourceImporter::ImportOption(PropertyInfo(Variant::STRING, "language", PROPERTY_HINT_LOCALE_ID, ""), "")); - menu_ot_cu = memnew(PopupMenu); - menu_ot_cu->set_name("CUMenu"); - menu_ot->add_child(menu_ot_cu); - menu_ot_cu->connect("id_pressed", callable_mp(this, &DynamicFontImportSettings::_ot_add_item)); + options_variations.push_back(ResourceImporter::ImportOption(PropertyInfo(Variant::INT, "size", PROPERTY_HINT_RANGE, "0,127,1"), 16)); + options_variations.push_back(ResourceImporter::ImportOption(PropertyInfo(Variant::INT, "outline_size", PROPERTY_HINT_RANGE, "0,127,1"), 0)); + options_variations.push_back(ResourceImporter::ImportOption(PropertyInfo(Variant::NIL, "Variation", PROPERTY_HINT_NONE, "variation", PROPERTY_USAGE_GROUP), Variant())); + options_variations.push_back(ResourceImporter::ImportOption(PropertyInfo(Variant::DICTIONARY, "variation_opentype"), Dictionary())); + options_variations.push_back(ResourceImporter::ImportOption(PropertyInfo(Variant::FLOAT, "variation_embolden", PROPERTY_HINT_RANGE, "-2,2,0.01"), 0)); + options_variations.push_back(ResourceImporter::ImportOption(PropertyInfo(Variant::INT, "variation_face_index"), 0)); + options_variations.push_back(ResourceImporter::ImportOption(PropertyInfo(Variant::TRANSFORM2D, "variation_transform"), Transform2D())); Color warn_color = (EditorNode::get_singleton()) ? EditorNode::get_singleton()->get_gui_base()->get_theme_color(SNAME("warning_color"), SNAME("Editor")) : Color(1, 1, 0); @@ -1442,7 +1167,7 @@ DynamicFontImportSettings::DynamicFontImportSettings() { main_pages->add_child(page1_vb); page1_description = memnew(Label); - page1_description->set_text(TTR("Select font rendering options:")); + page1_description->set_text(TTR("Select font rendering options, fallback font, and metadata override:")); page1_description->set_h_size_flags(Control::SIZE_EXPAND_FILL); page1_vb->add_child(page1_description); @@ -1451,15 +1176,25 @@ DynamicFontImportSettings::DynamicFontImportSettings() { page1_hb->set_h_size_flags(Control::SIZE_EXPAND_FILL); page1_vb->add_child(page1_hb); + VBoxContainer *page1_lbl_vb = memnew(VBoxContainer); + page1_lbl_vb->set_v_size_flags(Control::SIZE_EXPAND_FILL); + page1_lbl_vb->set_h_size_flags(Control::SIZE_EXPAND_FILL); + page1_hb->add_child(page1_lbl_vb); + + font_name_label = memnew(Label); + font_name_label->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER); + font_name_label->set_clip_text(true); + font_name_label->set_h_size_flags(Control::SIZE_EXPAND_FILL); + page1_lbl_vb->add_child(font_name_label); + font_preview_label = memnew(Label); - font_preview_label->add_theme_font_size_override("font_size", 200 * EDSCALE); font_preview_label->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER); font_preview_label->set_vertical_alignment(VERTICAL_ALIGNMENT_CENTER); font_preview_label->set_autowrap_mode(TextServer::AUTOWRAP_ARBITRARY); font_preview_label->set_clip_text(true); font_preview_label->set_v_size_flags(Control::SIZE_EXPAND_FILL); font_preview_label->set_h_size_flags(Control::SIZE_EXPAND_FILL); - page1_hb->add_child(font_preview_label); + page1_lbl_vb->add_child(font_preview_label); inspector_general = memnew(EditorInspector); inspector_general->set_v_size_flags(Control::SIZE_EXPAND_FILL); @@ -1469,11 +1204,11 @@ DynamicFontImportSettings::DynamicFontImportSettings() { // Page 2 layout: Configurations VBoxContainer *page2_vb = memnew(VBoxContainer); - page2_vb->set_name(TTR("Sizes and Variations")); + page2_vb->set_name(TTR("Pre-render configurations")); main_pages->add_child(page2_vb); page2_description = memnew(Label); - page2_description->set_text(TTR("Add font size, variation coordinates, and extra spacing combinations to pre-render:")); + page2_description->set_text(TTR("Add font size, and variation coordinates, and select glyphs to pre-render:")); page2_description->set_h_size_flags(Control::SIZE_EXPAND_FILL); page2_description->set_autowrap_mode(TextServer::AUTOWRAP_WORD_SMART); page2_vb->add_child(page2_description); @@ -1517,48 +1252,44 @@ DynamicFontImportSettings::DynamicFontImportSettings() { inspector_vars = memnew(EditorInspector); inspector_vars->set_v_size_flags(Control::SIZE_EXPAND_FILL); inspector_vars->connect("property_edited", callable_mp(this, &DynamicFontImportSettings::_variation_changed)); - page2_hb->add_child(inspector_vars); - - // Page 3 layout: Text to select glyphs - VBoxContainer *page3_vb = memnew(VBoxContainer); - page3_vb->set_name(TTR("Glyphs from the Text")); - main_pages->add_child(page3_vb); + page2_side_vb->add_child(inspector_vars); - page3_description = memnew(Label); - page3_description->set_text(TTR("Enter a text to shape and add all required glyphs to pre-render list:")); - page3_description->set_h_size_flags(Control::SIZE_EXPAND_FILL); - page3_description->set_autowrap_mode(TextServer::AUTOWRAP_WORD_SMART); - page3_vb->add_child(page3_description); + preload_pages = memnew(TabContainer); + preload_pages->set_tab_alignment(TabBar::ALIGNMENT_CENTER); + preload_pages->set_v_size_flags(Control::SIZE_EXPAND_FILL); + preload_pages->set_h_size_flags(Control::SIZE_EXPAND_FILL); + page2_hb->add_child(preload_pages); - HBoxContainer *ot_hb = memnew(HBoxContainer); - page3_vb->add_child(ot_hb); - ot_hb->set_h_size_flags(Control::SIZE_EXPAND_FILL); + // Page 2.1 layout: Text to select glyphs + VBoxContainer *page2_1_vb = memnew(VBoxContainer); + page2_1_vb->set_name(TTR("Glyphs from the Text")); + preload_pages->add_child(page2_1_vb); - Label *label_ed_ftr = memnew(Label); - ot_hb->add_child(label_ed_ftr); - label_ed_ftr->set_text(TTR("OpenType features:")); + page2_1_description = memnew(Label); + page2_1_description->set_text(TTR("Enter a text to shape and add all required glyphs to pre-render list:")); + page2_1_description->set_h_size_flags(Control::SIZE_EXPAND_FILL); + page2_1_description->set_autowrap_mode(TextServer::AUTOWRAP_WORD_SMART); + page2_1_vb->add_child(page2_1_description); - ftr_edit = memnew(LineEdit); - ot_hb->add_child(ftr_edit); - ftr_edit->connect("text_changed", callable_mp(this, &DynamicFontImportSettings::_change_text_opts)); - ftr_edit->set_h_size_flags(Control::SIZE_EXPAND_FILL); + HSplitContainer *page2_1_hb = memnew(HSplitContainer); + page2_1_vb->add_child(page2_1_hb); + page2_1_hb->set_h_size_flags(Control::SIZE_EXPAND_FILL); + page2_1_hb->set_v_size_flags(Control::SIZE_EXPAND_FILL); - Label *label_ed_lang = memnew(Label); - ot_hb->add_child(label_ed_lang); - label_ed_lang->set_text(TTR("Text language:")); + inspector_text = memnew(EditorInspector); - lang_edit = memnew(LineEdit); - ot_hb->add_child(lang_edit); - lang_edit->connect("text_changed", callable_mp(this, &DynamicFontImportSettings::_change_text_opts)); - lang_edit->set_h_size_flags(Control::SIZE_EXPAND_FILL); + inspector_text->set_v_size_flags(Control::SIZE_EXPAND_FILL); + inspector_text->set_custom_minimum_size(Size2(300 * EDSCALE, 250 * EDSCALE)); + inspector_text->connect("property_edited", callable_mp(this, &DynamicFontImportSettings::_change_text_opts)); + page2_1_hb->add_child(inspector_text); text_edit = memnew(TextEdit); - page3_vb->add_child(text_edit); + page2_1_hb->add_child(text_edit); text_edit->set_v_size_flags(Control::SIZE_EXPAND_FILL); text_edit->set_h_size_flags(Control::SIZE_EXPAND_FILL); HBoxContainer *text_hb = memnew(HBoxContainer); - page3_vb->add_child(text_hb); + page2_1_vb->add_child(text_hb); text_hb->set_h_size_flags(Control::SIZE_EXPAND_FILL); label_glyphs = memnew(Label); @@ -1576,21 +1307,21 @@ DynamicFontImportSettings::DynamicFontImportSettings() { btn_clear->set_text(TTR("Clear glyph list")); btn_clear->connect("pressed", callable_mp(this, &DynamicFontImportSettings::_glyph_clear)); - // Page 4 layout: Character map - VBoxContainer *page4_vb = memnew(VBoxContainer); - page4_vb->set_name(TTR("Glyphs from the Character Map")); - main_pages->add_child(page4_vb); + // Page 2.2 layout: Character map + VBoxContainer *page2_2_vb = memnew(VBoxContainer); + page2_2_vb->set_name(TTR("Glyphs from the Character Map")); + preload_pages->add_child(page2_2_vb); - page4_description = memnew(Label); - page4_description->set_text(TTR("Add or remove additional glyphs from the character map to pre-render list:\nNote: Some stylistic alternatives and glyph variants do not have one-to-one correspondence to character, and not shown in this map, use \"Glyphs from the text\" to add these.")); - page4_description->set_h_size_flags(Control::SIZE_EXPAND_FILL); - page4_description->set_autowrap_mode(TextServer::AUTOWRAP_WORD_SMART); - page4_vb->add_child(page4_description); + page2_2_description = memnew(Label); + page2_2_description->set_text(TTR("Add or remove glyphs from the character map to pre-render list:\nNote: Some stylistic alternatives and glyph variants do not have one-to-one correspondence to character, and not shown in this map, use \"Glyphs from the text\" tab to add these.")); + page2_2_description->set_h_size_flags(Control::SIZE_EXPAND_FILL); + page2_2_description->set_autowrap_mode(TextServer::AUTOWRAP_WORD_SMART); + page2_2_vb->add_child(page2_2_description); HSplitContainer *glyphs_split = memnew(HSplitContainer); glyphs_split->set_v_size_flags(Control::SIZE_EXPAND_FILL); glyphs_split->set_h_size_flags(Control::SIZE_EXPAND_FILL); - page4_vb->add_child(glyphs_split); + page2_2_vb->add_child(glyphs_split); glyph_table = memnew(Tree); glyphs_split->add_child(glyph_table); @@ -1627,101 +1358,6 @@ DynamicFontImportSettings::DynamicFontImportSettings() { _add_glyph_range_item(unicode_ranges[i].start, unicode_ranges[i].end, unicode_ranges[i].name); } - // Page 4 layout: Metadata override - VBoxContainer *page5_vb = memnew(VBoxContainer); - page5_vb->set_name(TTR("Metadata Override")); - main_pages->add_child(page5_vb); - - page5_description = memnew(Label); - page5_description->set_text(TTR("Add or remove language and script support overrides, to control fallback font selection order:")); - page5_description->set_h_size_flags(Control::SIZE_EXPAND_FILL); - page5_description->set_autowrap_mode(TextServer::AUTOWRAP_WORD_SMART); - page5_vb->add_child(page5_description); - - HBoxContainer *hb_lang = memnew(HBoxContainer); - page5_vb->add_child(hb_lang); - - label_langs = memnew(Label); - label_langs->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER); - label_langs->set_h_size_flags(Control::SIZE_EXPAND_FILL); - label_langs->set_text(TTR("Language support overrides")); - hb_lang->add_child(label_langs); - - add_lang = memnew(Button); - hb_lang->add_child(add_lang); - add_lang->set_tooltip(TTR("Add language override")); - add_lang->set_icon(add_var->get_theme_icon(SNAME("Add"), SNAME("EditorIcons"))); - add_lang->connect("pressed", callable_mp(this, &DynamicFontImportSettings::_lang_add)); - - lang_list = memnew(Tree); - page5_vb->add_child(lang_list); - lang_list->set_hide_root(true); - lang_list->set_columns(3); - lang_list->set_column_expand(0, false); // Check - lang_list->set_column_custom_minimum_width(0, 50 * EDSCALE); - lang_list->set_column_expand(1, true); - lang_list->set_column_custom_minimum_width(1, 80 * EDSCALE); - lang_list->set_column_expand(2, false); - lang_list->set_column_custom_minimum_width(2, 50 * EDSCALE); - lang_list->connect("button_clicked", callable_mp(this, &DynamicFontImportSettings::_lang_remove)); - lang_list->set_v_size_flags(Control::SIZE_EXPAND_FILL); - - HBoxContainer *hb_script = memnew(HBoxContainer); - page5_vb->add_child(hb_script); - - label_script = memnew(Label); - label_script->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER); - label_script->set_h_size_flags(Control::SIZE_EXPAND_FILL); - label_script->set_text(TTR("Script support overrides")); - hb_script->add_child(label_script); - - add_script = memnew(Button); - hb_script->add_child(add_script); - add_script->set_tooltip(TTR("Add script override")); - add_script->set_icon(add_var->get_theme_icon(SNAME("Add"), SNAME("EditorIcons"))); - add_script->connect("pressed", callable_mp(this, &DynamicFontImportSettings::_script_add)); - - script_list = memnew(Tree); - page5_vb->add_child(script_list); - script_list->set_hide_root(true); - script_list->set_columns(3); - script_list->set_column_expand(0, false); - script_list->set_column_custom_minimum_width(0, 50 * EDSCALE); - script_list->set_column_expand(1, true); - script_list->set_column_custom_minimum_width(1, 80 * EDSCALE); - script_list->set_column_expand(2, false); - script_list->set_column_custom_minimum_width(2, 50 * EDSCALE); - script_list->connect("button_clicked", callable_mp(this, &DynamicFontImportSettings::_script_remove)); - script_list->set_v_size_flags(Control::SIZE_EXPAND_FILL); - - HBoxContainer *hb_ot = memnew(HBoxContainer); - page5_vb->add_child(hb_ot); - - label_ot = memnew(Label); - label_ot->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER); - label_ot->set_h_size_flags(Control::SIZE_EXPAND_FILL); - label_ot->set_text(TTR("OpenType feature overrides")); - hb_ot->add_child(label_ot); - - add_ot = memnew(Button); - hb_ot->add_child(add_ot); - add_ot->set_tooltip(TTR("Add feature override")); - add_ot->set_icon(add_var->get_theme_icon(SNAME("Add"), SNAME("EditorIcons"))); - add_ot->connect("pressed", callable_mp(this, &DynamicFontImportSettings::_ot_add)); - - ot_list = memnew(Tree); - page5_vb->add_child(ot_list); - ot_list->set_hide_root(true); - ot_list->set_columns(3); - ot_list->set_column_expand(0, true); - ot_list->set_column_custom_minimum_width(0, 80 * EDSCALE); - ot_list->set_column_expand(1, true); - ot_list->set_column_custom_minimum_width(1, 80 * EDSCALE); - ot_list->set_column_expand(2, false); - ot_list->set_column_custom_minimum_width(2, 50 * EDSCALE); - ot_list->connect("button_clicked", callable_mp(this, &DynamicFontImportSettings::_ot_remove)); - ot_list->set_v_size_flags(Control::SIZE_EXPAND_FILL); - // Common import_settings_data.instantiate(); diff --git a/editor/import/dynamic_font_import_settings.h b/editor/import/dynamic_font_import_settings.h index ba75c98057..a1f763b445 100644 --- a/editor/import/dynamic_font_import_settings.h +++ b/editor/import/dynamic_font_import_settings.h @@ -45,7 +45,30 @@ #include "scene/resources/font.h" #include "servers/text_server.h" -class DynamicFontImportSettingsData; +class DynamicFontImportSettings; + +class DynamicFontImportSettingsData : public RefCounted { + GDCLASS(DynamicFontImportSettingsData, RefCounted) + friend class DynamicFontImportSettings; + + HashMap<StringName, Variant> settings; + HashMap<StringName, Variant> defaults; + List<ResourceImporter::ImportOption> options; + DynamicFontImportSettings *owner = nullptr; + + HashSet<char32_t> selected_chars; + HashSet<int32_t> selected_glyphs; + + Ref<FontFile> fd; + +public: + 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; + + Ref<FontFile> get_font() const; +}; + class EditorFileDialog; class EditorInspector; class EditorLocaleDialog; @@ -67,21 +90,19 @@ class DynamicFontImportSettings : public ConfirmationDialog { List<ResourceImporter::ImportOption> options_variations; List<ResourceImporter::ImportOption> options_general; - EditorLocaleDialog *locale_select = nullptr; - Vector<String> script_codes; - // Root layout Label *label_warn = nullptr; TabContainer *main_pages = nullptr; // Page 1 layout: Rendering Options Label *page1_description = nullptr; + Label *font_name_label = nullptr; Label *font_preview_label = nullptr; EditorInspector *inspector_general = nullptr; void _main_prop_changed(const String &p_edited_property); - // Page 2 layout: Configurations + // Page 2 layout: Preload Configurations Label *page2_description = nullptr; Label *label_vars = nullptr; Button *add_var = nullptr; @@ -95,19 +116,23 @@ class DynamicFontImportSettings : public ConfirmationDialog { void _variation_changed(const String &p_edited_property); void _variations_validate(); - // Page 3 layout: Text to select glyphs - Label *page3_description = nullptr; + TabContainer *preload_pages = nullptr; + + // Page 2.1 layout: Text to select glyphs + Label *page2_1_description = nullptr; Label *label_glyphs = nullptr; TextEdit *text_edit = nullptr; - LineEdit *ftr_edit = nullptr; - LineEdit *lang_edit = nullptr; + EditorInspector *inspector_text = nullptr; + + List<ResourceImporter::ImportOption> options_text; + Ref<DynamicFontImportSettingsData> text_settings_data; void _change_text_opts(); void _glyph_text_selected(); void _glyph_clear(); - // Page 4 layout: Character map - Label *page4_description = nullptr; + // Page 2.2 layout: Character map + Label *page2_2_description = nullptr; Tree *glyph_table = nullptr; Tree *glyph_tree = nullptr; TreeItem *glyph_root = nullptr; @@ -119,51 +144,12 @@ class DynamicFontImportSettings : public ConfirmationDialog { bool _char_update(int32_t p_char); void _range_update(int32_t p_start, int32_t p_end); - // Page 5 layout: Metadata override - Label *page5_description = nullptr; - Button *add_lang = nullptr; - Button *add_script = nullptr; - Button *add_ot = nullptr; - - PopupMenu *menu_scripts = nullptr; - PopupMenu *menu_ot = nullptr; - PopupMenu *menu_ot_ss = nullptr; - PopupMenu *menu_ot_cv = nullptr; - PopupMenu *menu_ot_cu = nullptr; - - Tree *lang_list = nullptr; - TreeItem *lang_list_root = nullptr; - Label *label_langs = nullptr; - - Tree *script_list = nullptr; - TreeItem *script_list_root = nullptr; - Label *label_script = nullptr; - - Tree *ot_list = nullptr; - TreeItem *ot_list_root = nullptr; - Label *label_ot = nullptr; - - void _lang_add(); - void _lang_add_item(const String &p_locale); - void _lang_remove(Object *p_item, int p_column, int p_id, MouseButton p_button); - - void _script_add(); - void _script_add_item(int p_option); - void _script_remove(Object *p_item, int p_column, int p_id, MouseButton p_button); - - void _ot_add(); - void _ot_add_item(int p_option); - void _ot_remove(Object *p_item, int p_column, int p_id, MouseButton p_button); - // Common void _add_glyph_range_item(int32_t p_start, int32_t p_end, const String &p_name); - Ref<Font> font_preview; - Ref<Font> font_main; - - RBSet<char32_t> selected_chars; - RBSet<int32_t> selected_glyphs; + Ref<FontFile> font_preview; + Ref<FontFile> font_main; void _re_import(); diff --git a/editor/import/resource_importer_bmfont.cpp b/editor/import/resource_importer_bmfont.cpp index 8a40b113b9..987ca4b911 100644 --- a/editor/import/resource_importer_bmfont.cpp +++ b/editor/import/resource_importer_bmfont.cpp @@ -52,7 +52,7 @@ String ResourceImporterBMFont::get_save_extension() const { } String ResourceImporterBMFont::get_resource_type() const { - return "FontData"; + return "FontFile"; } bool ResourceImporterBMFont::get_option_visibility(const String &p_path, const String &p_option, const HashMap<StringName, Variant> &p_options) const { @@ -60,19 +60,25 @@ bool ResourceImporterBMFont::get_option_visibility(const String &p_path, const S } void ResourceImporterBMFont::get_import_options(const String &p_path, List<ImportOption> *r_options, int p_preset) const { + r_options->push_back(ImportOption(PropertyInfo(Variant::ARRAY, "fallbacks", PROPERTY_HINT_ARRAY_TYPE, vformat("%s/%s:%s", Variant::OBJECT, PROPERTY_HINT_RESOURCE_TYPE, "Font")), Array())); + r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "compress"), true)); } Error ResourceImporterBMFont::import(const String &p_source_file, const String &p_save_path, const HashMap<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files, Variant *r_metadata) { print_verbose("Importing BMFont font from: " + p_source_file); - Ref<FontData> font; + Array fallbacks = p_options["fallbacks"]; + + Ref<FontFile> font; font.instantiate(); Error err = font->load_bitmap_font(p_source_file); ERR_FAIL_COND_V_MSG(err != OK, err, "Cannot load font to file \"" + p_source_file + "\"."); - int flg = ResourceSaver::SaverFlags::FLAG_BUNDLE_RESOURCES | ResourceSaver::FLAG_REPLACE_SUBRESOURCE_PATHS; + font->set_fallbacks(fallbacks); + + int flg = 0; if ((bool)p_options["compress"]) { flg |= ResourceSaver::SaverFlags::FLAG_COMPRESS; } diff --git a/editor/import/resource_importer_dynamic_font.cpp b/editor/import/resource_importer_dynamic_font.cpp index a92b0fe280..f1a70ff30a 100644 --- a/editor/import/resource_importer_dynamic_font.cpp +++ b/editor/import/resource_importer_dynamic_font.cpp @@ -66,7 +66,7 @@ String ResourceImporterDynamicFont::get_save_extension() const { } String ResourceImporterDynamicFont::get_resource_type() const { - return "FontData"; + return "FontFile"; } bool ResourceImporterDynamicFont::get_option_visibility(const String &p_path, const String &p_option, const HashMap<StringName, Variant> &p_options) const { @@ -103,7 +103,7 @@ String ResourceImporterDynamicFont::get_preset_name(int p_idx) const { void ResourceImporterDynamicFont::get_import_options(const String &p_path, List<ImportOption> *r_options, int p_preset) const { bool msdf = p_preset == PRESET_MSDF; - r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "face_index"), 0)); + r_options->push_back(ImportOption(PropertyInfo(Variant::NIL, "Rendering", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_GROUP), Variant())); r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "antialiased"), true)); r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "generate_mipmaps"), false)); @@ -114,63 +114,19 @@ void ResourceImporterDynamicFont::get_import_options(const String &p_path, List< r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "force_autohinter"), false)); r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "hinting", PROPERTY_HINT_ENUM, "None,Light,Normal"), 1)); r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "subpixel_positioning", PROPERTY_HINT_ENUM, "Disabled,Auto,One half of a pixel,One quarter of a pixel"), 1)); - r_options->push_back(ImportOption(PropertyInfo(Variant::FLOAT, "embolden", PROPERTY_HINT_RANGE, "-2,2,0.01"), 0.f)); - r_options->push_back(ImportOption(PropertyInfo(Variant::TRANSFORM2D, "transform"), Transform2D())); r_options->push_back(ImportOption(PropertyInfo(Variant::FLOAT, "oversampling", PROPERTY_HINT_RANGE, "0,10,0.1"), 0.0)); - r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "compress"), true)); - r_options->push_back(ImportOption(PropertyInfo(Variant::DICTIONARY, "opentype_feature_overrides"), Dictionary())); - - r_options->push_back(ImportOption(PropertyInfo(Variant::PACKED_STRING_ARRAY, "preload/char_ranges"), Vector<String>())); - r_options->push_back(ImportOption(PropertyInfo(Variant::PACKED_STRING_ARRAY, "preload/glyph_ranges"), Vector<String>())); - r_options->push_back(ImportOption(PropertyInfo(Variant::PACKED_STRING_ARRAY, "preload/configurations"), Vector<String>())); - - r_options->push_back(ImportOption(PropertyInfo(Variant::PACKED_STRING_ARRAY, "support_overrides/language_enabled"), Vector<String>())); - r_options->push_back(ImportOption(PropertyInfo(Variant::PACKED_STRING_ARRAY, "support_overrides/language_disabled"), Vector<String>())); + r_options->push_back(ImportOption(PropertyInfo(Variant::NIL, "Fallbacks", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_GROUP), Variant())); + r_options->push_back(ImportOption(PropertyInfo(Variant::ARRAY, "fallbacks", PROPERTY_HINT_ARRAY_TYPE, vformat("%s/%s:%s", Variant::OBJECT, PROPERTY_HINT_RESOURCE_TYPE, "Font")), Array())); - r_options->push_back(ImportOption(PropertyInfo(Variant::PACKED_STRING_ARRAY, "support_overrides/script_enabled"), Vector<String>())); - r_options->push_back(ImportOption(PropertyInfo(Variant::PACKED_STRING_ARRAY, "support_overrides/script_disabled"), Vector<String>())); -} + r_options->push_back(ImportOption(PropertyInfo(Variant::NIL, "Compress", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_GROUP), Variant())); + r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "compress"), true)); -bool ResourceImporterDynamicFont::_decode_variation(const String &p_token, Dictionary &r_variations, Vector2i &r_size, String &r_name, Vector2i &r_spacing) { - Vector<String> tokens = p_token.split("="); - if (tokens.size() == 2) { - if (tokens[0] == "name") { - r_name = tokens[1]; - } else if (tokens[0] == "size") { - r_size.x = tokens[1].to_int(); - } else if (tokens[0] == "outline_size") { - r_size.y = tokens[1].to_int(); - } else if (tokens[0] == "spacing_space") { - r_spacing.x = tokens[1].to_int(); - } else if (tokens[0] == "spacing_glyph") { - r_spacing.y = tokens[1].to_int(); - } else { - r_variations[tokens[0]] = tokens[1].to_float(); - } - return true; - } else { - WARN_PRINT("Invalid variation: '" + p_token + "'."); - return false; - } -} - -bool ResourceImporterDynamicFont::_decode_range(const String &p_token, int32_t &r_pos) { - if (p_token.begins_with("U+") || p_token.begins_with("u+") || p_token.begins_with("0x")) { - // Unicode character hex index. - r_pos = p_token.substr(2).hex_to_int(); - return true; - } else if (p_token.length() == 3 && p_token[0] == '\'' && p_token[2] == '\'') { - // Unicode character. - r_pos = p_token.unicode_at(1); - return true; - } else if (p_token.is_numeric()) { - // Unicode character decimal index. - r_pos = p_token.to_int(); - return true; - } else { - return false; - } + // Hide from the main UI, only for advanced import dialog. + r_options->push_back(ImportOption(PropertyInfo(Variant::ARRAY, "preload", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE), Array())); + r_options->push_back(ImportOption(PropertyInfo(Variant::DICTIONARY, "language_support", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE), Dictionary())); + r_options->push_back(ImportOption(PropertyInfo(Variant::DICTIONARY, "script_support", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE), Dictionary())); + r_options->push_back(ImportOption(PropertyInfo(Variant::DICTIONARY, "opentype_features", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE), Dictionary())); } bool ResourceImporterDynamicFont::has_advanced_options() const { @@ -183,30 +139,26 @@ void ResourceImporterDynamicFont::show_advanced_options(const String &p_path) { Error ResourceImporterDynamicFont::import(const String &p_source_file, const String &p_save_path, const HashMap<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files, Variant *r_metadata) { print_verbose("Importing dynamic font from: " + p_source_file); - int face_index = p_options["face_index"]; - bool antialiased = p_options["antialiased"]; bool generate_mipmaps = p_options["generate_mipmaps"]; bool msdf = p_options["multichannel_signed_distance_field"]; int px_range = p_options["msdf_pixel_range"]; int px_size = p_options["msdf_size"]; - Dictionary ot_ov = p_options["opentype_feature_overrides"]; + Dictionary ot_ov = p_options["opentype_features"]; bool autohinter = p_options["force_autohinter"]; int hinting = p_options["hinting"]; int subpixel_positioning = p_options["subpixel_positioning"]; real_t oversampling = p_options["oversampling"]; - real_t embolden = p_options["embolden"]; - Transform2D transform = p_options["transform"]; + Array fallbacks = p_options["fallbacks"]; // Load base font data. Vector<uint8_t> data = FileAccess::get_file_as_array(p_source_file); // Create font. - Ref<FontData> font; + Ref<FontFile> font; font.instantiate(); font->set_data(data); - font->set_face_index(face_index); font->set_antialiased(antialiased); font->set_generate_mipmaps(generate_mipmaps); font->set_multichannel_signed_distance_field(msdf); @@ -216,105 +168,52 @@ Error ResourceImporterDynamicFont::import(const String &p_source_file, const Str font->set_fixed_size(0); font->set_force_autohinter(autohinter); font->set_subpixel_positioning((TextServer::SubpixelPositioning)subpixel_positioning); - font->set_embolden(embolden); - font->set_transform(transform); font->set_hinting((TextServer::Hinting)hinting); font->set_oversampling(oversampling); + font->set_fallbacks(fallbacks); - Vector<String> lang_en = p_options["support_overrides/language_enabled"]; - for (int i = 0; i < lang_en.size(); i++) { - font->set_language_support_override(lang_en[i], true); + Dictionary langs = p_options["language_support"]; + for (int i = 0; i < langs.size(); i++) { + String key = langs.get_key_at_index(i); + bool enabled = langs.get_value_at_index(i); + font->set_language_support_override(key, enabled); } - Vector<String> lang_dis = p_options["support_overrides/language_disabled"]; - for (int i = 0; i < lang_dis.size(); i++) { - font->set_language_support_override(lang_dis[i], false); + Dictionary scripts = p_options["script_support"]; + for (int i = 0; i < scripts.size(); i++) { + String key = scripts.get_key_at_index(i); + bool enabled = scripts.get_value_at_index(i); + font->set_script_support_override(key, enabled); } - Vector<String> scr_en = p_options["support_overrides/script_enabled"]; - for (int i = 0; i < scr_en.size(); i++) { - font->set_script_support_override(scr_en[i], true); - } + Array preload_configurations = p_options["preload"]; - Vector<String> scr_dis = p_options["support_overrides/script_disabled"]; - for (int i = 0; i < scr_dis.size(); i++) { - font->set_script_support_override(scr_dis[i], false); - } + for (int i = 0; i < preload_configurations.size(); i++) { + Dictionary preload_config = preload_configurations[i]; - Vector<String> variations = p_options["preload/configurations"]; - Vector<String> char_ranges = p_options["preload/char_ranges"]; - Vector<String> gl_ranges = p_options["preload/glyph_ranges"]; - - for (int i = 0; i < variations.size(); i++) { - String name; - Dictionary var; - Vector2i size = Vector2(16, 0); - Vector2i spacing; - - Vector<String> variation_tags = variations[i].split(","); - for (int j = 0; j < variation_tags.size(); j++) { - if (!_decode_variation(variation_tags[j], var, size, name, spacing)) { - WARN_PRINT(vformat(TTR("Invalid variation: \"%s\""), variations[i])); - continue; - } - } - RID conf = font->find_cache(var); - - for (int j = 0; j < char_ranges.size(); j++) { - int32_t start, end; - Vector<String> tokens = char_ranges[j].split("-"); - if (tokens.size() == 2) { - if (!_decode_range(tokens[0], start) || !_decode_range(tokens[1], end)) { - WARN_PRINT(vformat(TTR("Invalid range: \"%s\""), char_ranges[j])); - continue; - } - } else if (tokens.size() == 1) { - if (!_decode_range(tokens[0], start)) { - WARN_PRINT(vformat(TTR("Invalid range: \"%s\""), char_ranges[j])); - continue; - } - end = start; - } else { - WARN_PRINT(vformat(TTR("Invalid range: \"%s\""), char_ranges[j])); - continue; - } - - // Preload character ranges for each variations / sizes. - print_verbose(vformat(TTR("Pre-rendering range U+%s...%s from configuration \"%s\" (%d / %d)..."), String::num_int64(start, 16), String::num_int64(end, 16), name, i + 1, variations.size())); - TS->font_render_range(conf, size, start, end); - } + Dictionary variation = preload_config.has("variation_opentype") ? preload_config["variation_opentype"].operator Dictionary() : Dictionary(); + double embolden = preload_config.has("variation_embolden") ? preload_config["variation_embolden"].operator double() : 0; + int face_index = preload_config.has("variation_face_index") ? preload_config["variation_face_index"].operator int() : 0; + Transform2D transform = preload_config.has("variation_transform") ? preload_config["variation_transform"].operator Transform2D() : Transform2D(); + Vector2i size = preload_config.has("size") ? preload_config["size"].operator Vector2i() : Vector2i(16, 0); + String name = preload_config.has("name") ? preload_config["name"].operator String() : vformat("Configuration %d", i); - for (int j = 0; j < gl_ranges.size(); j++) { - int32_t start, end; - Vector<String> tokens = gl_ranges[j].split("-"); - if (tokens.size() == 2) { - if (!_decode_range(tokens[0], start) || !_decode_range(tokens[1], end)) { - WARN_PRINT(vformat(TTR("Invalid range: \"%s\""), gl_ranges[j])); - continue; - } - } else if (tokens.size() == 1) { - if (!_decode_range(tokens[0], start)) { - WARN_PRINT(vformat(TTR("Invalid range: \"%s\""), gl_ranges[j])); - continue; - } - end = start; - } else { - WARN_PRINT(vformat(TTR("Invalid range: \"%s\""), gl_ranges[j])); - continue; - } - - // Preload glyph range for each variations / sizes. - print_verbose(vformat(TTR("Pre-rendering glyph range 0x%s...%s from configuration \"%s\" (%d / %d)..."), String::num_int64(start, 16), String::num_int64(end, 16), name, i + 1, variations.size())); - for (int32_t k = start; k <= end; k++) { - TS->font_render_glyph(conf, size, k); - } + RID conf_rid = font->find_variation(variation, face_index, embolden, transform); + + Array chars = preload_config["chars"]; + for (int j = 0; j < chars.size(); j++) { + char32_t c = chars[j].operator int(); + TS->font_render_range(conf_rid, size, c, c); } - TS->font_set_spacing(conf, size.x, TextServer::SPACING_SPACE, spacing.x); - TS->font_set_spacing(conf, size.x, TextServer::SPACING_GLYPH, spacing.y); + Array glyphs = preload_config["glyphs"]; + for (int j = 0; j < glyphs.size(); j++) { + int32_t c = glyphs[j]; + TS->font_render_glyph(conf_rid, size, c); + } } - int flg = ResourceSaver::SaverFlags::FLAG_BUNDLE_RESOURCES | ResourceSaver::FLAG_REPLACE_SUBRESOURCE_PATHS; + int flg = 0; if ((bool)p_options["compress"]) { flg |= ResourceSaver::SaverFlags::FLAG_COMPRESS; } diff --git a/editor/import/resource_importer_dynamic_font.h b/editor/import/resource_importer_dynamic_font.h index c0b6c094b0..a05c8bab05 100644 --- a/editor/import/resource_importer_dynamic_font.h +++ b/editor/import/resource_importer_dynamic_font.h @@ -43,9 +43,6 @@ class ResourceImporterDynamicFont : public ResourceImporter { }; public: - static bool _decode_range(const String &p_token, int32_t &r_pos); - static bool _decode_variation(const String &p_token, Dictionary &r_variations, Vector2i &r_size, String &r_name, Vector2i &r_spacing); - virtual String get_importer_name() const override; virtual String get_visible_name() const override; virtual void get_recognized_extensions(List<String> *p_extensions) const override; diff --git a/editor/import/resource_importer_imagefont.cpp b/editor/import/resource_importer_imagefont.cpp index 30c349d0f2..ea84d4c883 100644 --- a/editor/import/resource_importer_imagefont.cpp +++ b/editor/import/resource_importer_imagefont.cpp @@ -52,7 +52,7 @@ String ResourceImporterImageFont::get_save_extension() const { } String ResourceImporterImageFont::get_resource_type() const { - return "FontData"; + return "FontFile"; } bool ResourceImporterImageFont::get_option_visibility(const String &p_path, const String &p_option, const HashMap<StringName, Variant> &p_options) const { @@ -64,6 +64,9 @@ void ResourceImporterImageFont::get_import_options(const String &p_path, List<Im r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "columns"), 1)); r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "rows"), 1)); r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "font_size"), 14)); + + r_options->push_back(ImportOption(PropertyInfo(Variant::ARRAY, "fallbacks", PROPERTY_HINT_ARRAY_TYPE, vformat("%s/%s:%s", Variant::OBJECT, PROPERTY_HINT_RESOURCE_TYPE, "Font")), Array())); + r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "compress"), true)); } @@ -92,8 +95,9 @@ Error ResourceImporterImageFont::import(const String &p_source_file, const Strin int rows = p_options["rows"]; int base_size = p_options["font_size"]; Vector<String> ranges = p_options["character_ranges"]; + Array fallbacks = p_options["fallbacks"]; - Ref<FontData> font; + Ref<FontFile> font; font.instantiate(); font->set_antialiased(false); font->set_generate_mipmaps(false); @@ -103,6 +107,7 @@ Error ResourceImporterImageFont::import(const String &p_source_file, const Strin font->set_force_autohinter(false); font->set_hinting(TextServer::HINTING_NONE); font->set_oversampling(1.0f); + font->set_fallbacks(fallbacks); Ref<Image> img; img.instantiate(); @@ -145,10 +150,10 @@ Error ResourceImporterImageFont::import(const String &p_source_file, const Strin ERR_FAIL_COND_V_MSG(pos >= count, ERR_CANT_CREATE, "Too many characters in range."); } } - font->set_ascent(0, base_size, 0.5 * chr_height); - font->set_descent(0, base_size, 0.5 * chr_height); + font->set_cache_ascent(0, base_size, 0.5 * chr_height); + font->set_cache_descent(0, base_size, 0.5 * chr_height); - int flg = ResourceSaver::SaverFlags::FLAG_BUNDLE_RESOURCES | ResourceSaver::FLAG_REPLACE_SUBRESOURCE_PATHS; + int flg = 0; if ((bool)p_options["compress"]) { flg |= ResourceSaver::SaverFlags::FLAG_COMPRESS; } diff --git a/editor/import/resource_importer_scene.cpp b/editor/import/resource_importer_scene.cpp index a9c43e573f..860269bfcb 100644 --- a/editor/import/resource_importer_scene.cpp +++ b/editor/import/resource_importer_scene.cpp @@ -144,11 +144,11 @@ Variant EditorScenePostImportPlugin::get_option_value(const StringName &p_name) ERR_FAIL_COND_V_MSG(current_options == nullptr && current_options_dict == nullptr, Variant(), "get_option_value called from a function where option values are not available."); ERR_FAIL_COND_V_MSG(current_options && !current_options->has(p_name), Variant(), "get_option_value called with unexisting option argument: " + String(p_name)); ERR_FAIL_COND_V_MSG(current_options_dict && !current_options_dict->has(p_name), Variant(), "get_option_value called with unexisting option argument: " + String(p_name)); - if (current_options) { - (*current_options)[p_name]; + if (current_options && current_options->has(p_name)) { + return (*current_options)[p_name]; } - if (current_options_dict) { - (*current_options_dict)[p_name]; + if (current_options_dict && current_options_dict->has(p_name)) { + return (*current_options_dict)[p_name]; } return Variant(); } @@ -1972,7 +1972,7 @@ void ResourceImporterScene::_optimize_track_usage(AnimationPlayer *p_player, Ani } } -Node *ResourceImporterScene::pre_import(const String &p_source_file) { +Node *ResourceImporterScene::pre_import(const String &p_source_file, const HashMap<StringName, Variant> &p_options) { Ref<EditorSceneFormatImporter> importer; String ext = p_source_file.get_extension().to_lower(); @@ -1997,8 +1997,13 @@ Node *ResourceImporterScene::pre_import(const String &p_source_file) { ERR_FAIL_COND_V(!importer.is_valid(), nullptr); + int bake_fps = 30; + if (p_options.has(SNAME("animation/fps"))) { + bake_fps = p_options[SNAME("animation/fps")]; + } + Error err = OK; - Node *scene = importer->import_scene(p_source_file, EditorSceneFormatImporter::IMPORT_ANIMATION | EditorSceneFormatImporter::IMPORT_GENERATE_TANGENT_ARRAYS, HashMap<StringName, Variant>(), 15, nullptr, &err); + Node *scene = importer->import_scene(p_source_file, EditorSceneFormatImporter::IMPORT_ANIMATION | EditorSceneFormatImporter::IMPORT_GENERATE_TANGENT_ARRAYS, p_options, bake_fps, nullptr, &err); if (!scene || err != OK) { return nullptr; } diff --git a/editor/import/resource_importer_scene.h b/editor/import/resource_importer_scene.h index c143e86bd4..b77c1dccb4 100644 --- a/editor/import/resource_importer_scene.h +++ b/editor/import/resource_importer_scene.h @@ -281,7 +281,7 @@ public: void _optimize_animations(AnimationPlayer *anim, float p_max_lin_error, float p_max_ang_error, float p_max_angle); void _compress_animations(AnimationPlayer *anim, int p_page_size_kb); - Node *pre_import(const String &p_source_file); + Node *pre_import(const String &p_source_file, const HashMap<StringName, Variant> &p_options); virtual Error import(const String &p_source_file, const String &p_save_path, const HashMap<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files = nullptr, Variant *r_metadata = nullptr) override; virtual bool has_advanced_options() const override; diff --git a/editor/import/scene_import_settings.cpp b/editor/import/scene_import_settings.cpp index 8ae05f046e..b682407307 100644 --- a/editor/import/scene_import_settings.cpp +++ b/editor/import/scene_import_settings.cpp @@ -542,12 +542,6 @@ void SceneImportSettings::open_settings(const String &p_path, bool p_for_animati scene_import_settings_data->settings = nullptr; scene_import_settings_data->path = p_path; - scene = ResourceImporterScene::get_scene_singleton()->pre_import(p_path); // Use the scene singleton here because we want to see the full thing. - if (scene == nullptr) { - EditorNode::get_singleton()->show_warning(TTR("Error opening scene")); - return; - } - // Visibility data_mode->set_tab_hidden(1, p_for_animation); data_mode->set_tab_hidden(2, p_for_animation); @@ -593,6 +587,12 @@ void SceneImportSettings::open_settings(const String &p_path, bool p_for_animati } } + scene = ResourceImporterScene::get_scene_singleton()->pre_import(p_path, defaults); // Use the scene singleton here because we want to see the full thing. + if (scene == nullptr) { + EditorNode::get_singleton()->show_warning(TTR("Error opening scene")); + return; + } + first_aabb = true; _update_scene(); diff --git a/editor/plugins/abstract_polygon_2d_editor.cpp b/editor/plugins/abstract_polygon_2d_editor.cpp index ad6d8e6379..affe46aaae 100644 --- a/editor/plugins/abstract_polygon_2d_editor.cpp +++ b/editor/plugins/abstract_polygon_2d_editor.cpp @@ -565,7 +565,7 @@ void AbstractPolygon2DEditor::forward_canvas_draw_over_viewport(Control *p_overl Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label")); int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label")); String num = String::num(vertex.vertex); - Size2 num_size = font->get_string_size(num, font_size); + Size2 num_size = font->get_string_size(num, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size); p_overlay->draw_string(font, point - num_size * 0.5, num, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, Color(1.0, 1.0, 1.0, 0.5)); } } diff --git a/editor/plugins/animation_state_machine_editor.cpp b/editor/plugins/animation_state_machine_editor.cpp index 00cc5a6ca0..05d7a5f973 100644 --- a/editor/plugins/animation_state_machine_editor.cpp +++ b/editor/plugins/animation_state_machine_editor.cpp @@ -1224,7 +1224,7 @@ void AnimationNodeStateMachineEditor::_state_machine_draw() { Ref<StyleBox> sb = selected_nodes.has(E) ? style_selected : style; Size2 s = sb->get_minimum_size(); - int strsize = font->get_string_size(name, font_size).width; + int strsize = font->get_string_size(name, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size).width; s.width += strsize; s.height += MAX(font->get_height(font_size), play->get_height()); s.width += sep + play->get_width(); @@ -1379,7 +1379,7 @@ void AnimationNodeStateMachineEditor::_state_machine_draw() { Ref<AnimationNode> anode = state_machine->get_node(name); bool needs_editor = AnimationTreeEditor::get_singleton()->can_edit(anode); Ref<StyleBox> sb = selected_nodes.has(name) ? style_selected : style; - int strsize = font->get_string_size(name, font_size).width; + int strsize = font->get_string_size(name, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size).width; NodeRect &nr = node_rects.write[i]; Vector2 offset = nr.node.position; diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index 22788913d4..7e525a4698 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -2677,7 +2677,7 @@ void CanvasItemEditor::_draw_text_at_position(Point2 p_position, String p_string color.a = 0.8; Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label")); int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label")); - Size2 text_size = font->get_string_size(p_string, font_size); + Size2 text_size = font->get_string_size(p_string, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size); switch (p_side) { case SIDE_LEFT: p_position += Vector2(-text_size.x - 5, text_size.y / 2); @@ -2749,16 +2749,18 @@ void CanvasItemEditor::_draw_guides() { String str = TS->format_number(vformat("%d px", Math::round(xform.affine_inverse().xform(dragged_guide_pos).x))); Ref<Font> font = get_theme_font(SNAME("bold"), SNAME("EditorFonts")); int font_size = get_theme_font_size(SNAME("bold_size"), SNAME("EditorFonts")); - Size2 text_size = font->get_string_size(str, font_size); - viewport->draw_string(font, Point2(dragged_guide_pos.x + 10, RULER_WIDTH + text_size.y / 2 + 10), str, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, text_color, outline_size, outline_color); + Size2 text_size = font->get_string_size(str, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size); + viewport->draw_string_outline(font, Point2(dragged_guide_pos.x + 10, RULER_WIDTH + text_size.y / 2 + 10), str, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, outline_size, outline_color); + viewport->draw_string(font, Point2(dragged_guide_pos.x + 10, RULER_WIDTH + text_size.y / 2 + 10), str, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, text_color); viewport->draw_line(Point2(dragged_guide_pos.x, 0), Point2(dragged_guide_pos.x, viewport->get_size().y), guide_color, Math::round(EDSCALE)); } if (drag_type == DRAG_DOUBLE_GUIDE || drag_type == DRAG_H_GUIDE) { String str = TS->format_number(vformat("%d px", Math::round(xform.affine_inverse().xform(dragged_guide_pos).y))); Ref<Font> font = get_theme_font(SNAME("bold"), SNAME("EditorFonts")); int font_size = get_theme_font_size(SNAME("bold_size"), SNAME("EditorFonts")); - Size2 text_size = font->get_string_size(str, font_size); - viewport->draw_string(font, Point2(RULER_WIDTH + 10, dragged_guide_pos.y + text_size.y / 2 + 10), str, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, text_color, outline_size, outline_color); + Size2 text_size = font->get_string_size(str, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size); + viewport->draw_string_outline(font, Point2(RULER_WIDTH + 10, dragged_guide_pos.y + text_size.y / 2 + 10), str, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, outline_size, outline_color); + viewport->draw_string(font, Point2(RULER_WIDTH + 10, dragged_guide_pos.y + text_size.y / 2 + 10), str, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, text_color); viewport->draw_line(Point2(0, dragged_guide_pos.y), Point2(viewport->get_size().x, dragged_guide_pos.y), guide_color, Math::round(EDSCALE)); } } @@ -2970,13 +2972,15 @@ void CanvasItemEditor::_draw_ruler_tool() { text_pos.y = CLAMP(text_pos.y, text_height * 1.5, viewport->get_rect().size.y - text_height * 1.5); if (begin.is_equal_approx(end)) { - viewport->draw_string(font, text_pos, (String)ruler_tool_origin, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, font_color, outline_size, outline_color); + viewport->draw_string_outline(font, text_pos, (String)ruler_tool_origin, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, outline_size, outline_color); + viewport->draw_string(font, text_pos, (String)ruler_tool_origin, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, font_color); Ref<Texture2D> position_icon = get_theme_icon(SNAME("EditorPosition"), SNAME("EditorIcons")); viewport->draw_texture(get_theme_icon(SNAME("EditorPosition"), SNAME("EditorIcons")), (ruler_tool_origin - view_offset) * zoom - position_icon->get_size() / 2); return; } - viewport->draw_string(font, text_pos, TS->format_number(vformat("%.1f px", length_vector.length())), HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, font_color, outline_size, outline_color); + viewport->draw_string_outline(font, text_pos, TS->format_number(vformat("%.1f px", length_vector.length())), HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, outline_size, outline_color); + viewport->draw_string(font, text_pos, TS->format_number(vformat("%.1f px", length_vector.length())), HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, font_color); bool draw_secondary_lines = !(Math::is_equal_approx(begin.y, corner.y) || Math::is_equal_approx(end.x, corner.x)); @@ -2994,16 +2998,19 @@ void CanvasItemEditor::_draw_ruler_tool() { Point2 text_pos2 = text_pos; text_pos2.x = begin.x < text_pos.x ? MIN(text_pos.x - text_width, begin.x - text_width / 2) : MAX(text_pos.x + text_width, begin.x - text_width / 2); - viewport->draw_string(font, text_pos2, TS->format_number(vformat("%.1f px", length_vector.y)), HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, font_secondary_color, outline_size, outline_color); + viewport->draw_string_outline(font, text_pos2, TS->format_number(vformat("%.1f px", length_vector.y)), HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, outline_size, outline_color); + viewport->draw_string(font, text_pos2, TS->format_number(vformat("%.1f px", length_vector.y)), HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, font_secondary_color); Point2 v_angle_text_pos = Point2(); v_angle_text_pos.x = CLAMP(begin.x - angle_text_width / 2, angle_text_width / 2, viewport->get_rect().size.x - angle_text_width); v_angle_text_pos.y = begin.y < end.y ? MIN(text_pos2.y - 2 * text_height, begin.y - text_height * 0.5) : MAX(text_pos2.y + text_height * 3, begin.y + text_height * 1.5); - viewport->draw_string(font, v_angle_text_pos, TS->format_number(vformat(String::utf8("%d°"), vertical_angle)), HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, font_secondary_color, outline_size, outline_color); + viewport->draw_string_outline(font, v_angle_text_pos, TS->format_number(vformat(String::utf8("%d°"), vertical_angle)), HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, outline_size, outline_color); + viewport->draw_string(font, v_angle_text_pos, TS->format_number(vformat(String::utf8("%d°"), vertical_angle)), HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, font_secondary_color); text_pos2 = text_pos; text_pos2.y = end.y < text_pos.y ? MIN(text_pos.y - text_height * 2, end.y - text_height / 2) : MAX(text_pos.y + text_height * 2, end.y - text_height / 2); - viewport->draw_string(font, text_pos2, TS->format_number(vformat("%.1f px", length_vector.x)), HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, font_secondary_color, outline_size, outline_color); + viewport->draw_string_outline(font, text_pos2, TS->format_number(vformat("%.1f px", length_vector.x)), HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, outline_size, outline_color); + viewport->draw_string(font, text_pos2, TS->format_number(vformat("%.1f px", length_vector.x)), HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, font_secondary_color); Point2 h_angle_text_pos = Point2(); h_angle_text_pos.x = CLAMP(end.x - angle_text_width / 2, angle_text_width / 2, viewport->get_rect().size.x - angle_text_width); @@ -3020,7 +3027,8 @@ void CanvasItemEditor::_draw_ruler_tool() { h_angle_text_pos.y = MIN(text_pos.y - height_multiplier * text_height, MIN(end.y - text_height * 0.5, text_pos2.y - height_multiplier * text_height)); } } - viewport->draw_string(font, h_angle_text_pos, TS->format_number(vformat(String::utf8("%d°"), horizontal_angle)), HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, font_secondary_color, outline_size, outline_color); + viewport->draw_string_outline(font, h_angle_text_pos, TS->format_number(vformat(String::utf8("%d°"), horizontal_angle)), HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, outline_size, outline_color); + viewport->draw_string(font, h_angle_text_pos, TS->format_number(vformat(String::utf8("%d°"), horizontal_angle)), HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, font_secondary_color); // Angle arcs int arc_point_count = 8; @@ -3055,17 +3063,21 @@ void CanvasItemEditor::_draw_ruler_tool() { text_pos.y = CLAMP(text_pos.y, text_height * 2.5, viewport->get_rect().size.y - text_height / 2); if (draw_secondary_lines) { - viewport->draw_string(font, text_pos, TS->format_number(vformat("%.2f " + TTR("units"), (length_vector / grid_step).length())), HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, font_color, outline_size, outline_color); + viewport->draw_string_outline(font, text_pos, TS->format_number(vformat("%.2f " + TTR("units"), (length_vector / grid_step).length())), HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, outline_size, outline_color); + viewport->draw_string(font, text_pos, TS->format_number(vformat("%.2f " + TTR("units"), (length_vector / grid_step).length())), HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, font_color); Point2 text_pos2 = text_pos; text_pos2.x = begin.x < text_pos.x ? MIN(text_pos.x - text_width, begin.x - text_width / 2) : MAX(text_pos.x + text_width, begin.x - text_width / 2); - viewport->draw_string(font, text_pos2, TS->format_number(vformat("%d " + TTR("units"), roundf(length_vector.y / grid_step.y))), HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, font_secondary_color, outline_size, outline_color); + viewport->draw_string_outline(font, text_pos2, TS->format_number(vformat("%d " + TTR("units"), roundf(length_vector.y / grid_step.y))), HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, outline_size, outline_color); + viewport->draw_string(font, text_pos2, TS->format_number(vformat("%d " + TTR("units"), roundf(length_vector.y / grid_step.y))), HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, font_secondary_color); text_pos2 = text_pos; text_pos2.y = end.y < text_pos.y ? MIN(text_pos.y - text_height * 2, end.y + text_height / 2) : MAX(text_pos.y + text_height * 2, end.y + text_height / 2); - viewport->draw_string(font, text_pos2, TS->format_number(vformat("%d " + TTR("units"), roundf(length_vector.x / grid_step.x))), HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, font_secondary_color, outline_size, outline_color); + viewport->draw_string_outline(font, text_pos2, TS->format_number(vformat("%d " + TTR("units"), roundf(length_vector.x / grid_step.x))), HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, outline_size, outline_color); + viewport->draw_string(font, text_pos2, TS->format_number(vformat("%d " + TTR("units"), roundf(length_vector.x / grid_step.x))), HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, font_secondary_color); } else { - viewport->draw_string(font, text_pos, TS->format_number(vformat("%d " + TTR("units"), roundf((length_vector / grid_step).length()))), HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, font_color, outline_size, outline_color); + viewport->draw_string_outline(font, text_pos, TS->format_number(vformat("%d " + TTR("units"), roundf((length_vector / grid_step).length()))), HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, outline_size, outline_color); + viewport->draw_string(font, text_pos, TS->format_number(vformat("%d " + TTR("units"), roundf((length_vector / grid_step).length()))), HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, font_color); } } } else { @@ -3611,7 +3623,7 @@ void CanvasItemEditor::_draw_hover() { Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label")); int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label")); - Size2 node_name_size = font->get_string_size(node_name, font_size); + Size2 node_name_size = font->get_string_size(node_name, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size); Size2 item_size = Size2(node_icon->get_size().x + 4 + node_name_size.x, MAX(node_icon->get_size().y, node_name_size.y - 3)); Point2 pos = transform.xform(hovering_results[i].position) - Point2(0, item_size.y) + (Point2(node_icon->get_size().x, -node_icon->get_size().y) / 4); diff --git a/editor/plugins/editor_preview_plugins.cpp b/editor/plugins/editor_preview_plugins.cpp index bb0cfcba25..a00ed1e49a 100644 --- a/editor/plugins/editor_preview_plugins.cpp +++ b/editor/plugins/editor_preview_plugins.cpp @@ -812,19 +812,12 @@ void EditorFontPreviewPlugin::_preview_done() { } bool EditorFontPreviewPlugin::handles(const String &p_type) const { - return ClassDB::is_parent_class(p_type, "FontData") || ClassDB::is_parent_class(p_type, "Font"); + return ClassDB::is_parent_class(p_type, "Font"); } Ref<Texture2D> EditorFontPreviewPlugin::generate_from_path(const String &p_path, const Size2 &p_size) const { - Ref<Resource> res = ResourceLoader::load(p_path); - ERR_FAIL_COND_V(res.is_null(), Ref<Texture2D>()); - Ref<Font> sampled_font; - if (res->is_class("Font")) { - sampled_font = res->duplicate(); - } else if (res->is_class("FontData")) { - sampled_font.instantiate(); - sampled_font->add_data(res->duplicate()); - } + Ref<Font> sampled_font = ResourceLoader::load(p_path); + ERR_FAIL_COND_V(sampled_font.is_null(), Ref<Texture2D>()); String sample; static const String sample_base = U"12漢字ԱբΑαАбΑαאבابܐܒހށआআਆઆଆஆఆಆആආกิກິༀကႠა한글ሀᎣᐁᚁᚠᜀᜠᝀᝠកᠠᤁᥐAb😀"; @@ -836,18 +829,16 @@ Ref<Texture2D> EditorFontPreviewPlugin::generate_from_path(const String &p_path, if (sample.is_empty()) { sample = sampled_font->get_supported_chars().substr(0, 6); } - Vector2 size = sampled_font->get_string_size(sample, 50); + Vector2 size = sampled_font->get_string_size(sample, HORIZONTAL_ALIGNMENT_LEFT, -1, 50); Vector2 pos; pos.x = 64 - size.x / 2; pos.y = 80; - Ref<Font> font = sampled_font; - const Color c = GLOBAL_GET("rendering/environment/defaults/default_clear_color"); const float fg = c.get_luminance() < 0.5 ? 1.0 : 0.0; - font->draw_string(canvas_item, pos, sample, HORIZONTAL_ALIGNMENT_LEFT, -1.f, 50, Color(fg, fg, fg)); + sampled_font->draw_string(canvas_item, pos, sample, HORIZONTAL_ALIGNMENT_LEFT, -1.f, 50, Color(fg, fg, fg)); RS::get_singleton()->connect(SNAME("frame_pre_draw"), callable_mp(const_cast<EditorFontPreviewPlugin *>(this), &EditorFontPreviewPlugin::_generate_frame_started), Vector<Variant>(), Object::CONNECT_ONESHOT); diff --git a/editor/plugins/font_config_plugin.cpp b/editor/plugins/font_config_plugin.cpp new file mode 100644 index 0000000000..848fb5887d --- /dev/null +++ b/editor/plugins/font_config_plugin.cpp @@ -0,0 +1,979 @@ +/*************************************************************************/ +/* font_config_plugin.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2022 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 "font_config_plugin.h" + +#include "editor/editor_scale.h" +#include "editor/import/dynamic_font_import_settings.h" + +/*************************************************************************/ +/* EditorPropertyFontMetaObject */ +/*************************************************************************/ + +bool EditorPropertyFontMetaObject::_set(const StringName &p_name, const Variant &p_value) { + String name = p_name; + + if (name.begins_with("keys")) { + String key = name.get_slicec('/', 1); + dict[key] = p_value; + return true; + } + + return false; +} + +bool EditorPropertyFontMetaObject::_get(const StringName &p_name, Variant &r_ret) const { + String name = p_name; + + if (name.begins_with("keys")) { + String key = name.get_slicec('/', 1); + r_ret = dict[key]; + return true; + } + + return false; +} + +void EditorPropertyFontMetaObject::_bind_methods() { +} + +void EditorPropertyFontMetaObject::set_dict(const Dictionary &p_dict) { + dict = p_dict; +} + +Dictionary EditorPropertyFontMetaObject::get_dict() { + return dict; +} + +/*************************************************************************/ +/* EditorPropertyFontOTObject */ +/*************************************************************************/ + +bool EditorPropertyFontOTObject::_set(const StringName &p_name, const Variant &p_value) { + String name = p_name; + + if (name.begins_with("keys")) { + int key = name.get_slicec('/', 1).to_int(); + dict[key] = p_value; + return true; + } + + return false; +} + +bool EditorPropertyFontOTObject::_get(const StringName &p_name, Variant &r_ret) const { + String name = p_name; + + if (name.begins_with("keys")) { + int key = name.get_slicec('/', 1).to_int(); + r_ret = dict[key]; + return true; + } + + return false; +} + +void EditorPropertyFontOTObject::_bind_methods() { + ClassDB::bind_method(D_METHOD("property_can_revert", "name"), &EditorPropertyFontOTObject::property_can_revert); + ClassDB::bind_method(D_METHOD("property_get_revert", "name"), &EditorPropertyFontOTObject::property_get_revert); +} + +void EditorPropertyFontOTObject::set_dict(const Dictionary &p_dict) { + dict = p_dict; +} + +Dictionary EditorPropertyFontOTObject::get_dict() { + return dict; +} + +void EditorPropertyFontOTObject::set_defaults(const Dictionary &p_dict) { + defaults_dict = p_dict; +} + +Dictionary EditorPropertyFontOTObject::get_defaults() { + return defaults_dict; +} + +bool EditorPropertyFontOTObject::property_can_revert(const String &p_name) { + String name = p_name; + + if (name.begins_with("keys")) { + int key = name.get_slicec('/', 1).to_int(); + if (defaults_dict.has(key) && dict.has(key)) { + int value = dict[key]; + Vector3i range = defaults_dict[key]; + return range.z != value; + } + } + + return false; +} + +Variant EditorPropertyFontOTObject::property_get_revert(const String &p_name) { + String name = p_name; + + if (name.begins_with("keys")) { + int key = name.get_slicec('/', 1).to_int(); + if (defaults_dict.has(key)) { + Vector3i range = defaults_dict[key]; + return range.z; + } + } + + return Variant(); +} + +/*************************************************************************/ +/* EditorPropertyFontMetaOverride */ +/*************************************************************************/ + +void EditorPropertyFontMetaOverride::_notification(int p_what) { + switch (p_what) { + case NOTIFICATION_ENTER_TREE: + case NOTIFICATION_THEME_CHANGED: { + if (Object::cast_to<Button>(button_add)) { + button_add->set_icon(get_theme_icon(SNAME("Add"), SNAME("EditorIcons"))); + } + } break; + } +} + +void EditorPropertyFontMetaOverride::_property_changed(const String &p_property, Variant p_value, const String &p_name, bool p_changing) { + if (p_property.begins_with("keys")) { + Dictionary dict = object->get_dict(); + String key = p_property.get_slice("/", 1); + dict[key] = (bool)p_value; + + emit_changed(get_edited_property(), dict, "", true); + + dict = dict.duplicate(); // Duplicate, so undo/redo works better. + object->set_dict(dict); + } +} + +void EditorPropertyFontMetaOverride::_remove(Object *p_button, const String &p_key) { + Dictionary dict = object->get_dict(); + + dict.erase(p_key); + + emit_changed(get_edited_property(), dict, "", false); + + dict = dict.duplicate(); // Duplicate, so undo/redo works better. + object->set_dict(dict); + update_property(); +} + +void EditorPropertyFontMetaOverride::_add_menu() { + if (script_editor) { + Size2 size = get_size(); + menu->set_position(get_screen_position() + Size2(0, size.height * get_global_transform().get_scale().y)); + menu->reset_size(); + menu->popup(); + } else { + locale_select->popup_locale_dialog(); + } +} + +void EditorPropertyFontMetaOverride::_add_script(int p_option) { + Dictionary dict = object->get_dict(); + + dict[script_codes[p_option]] = true; + + emit_changed(get_edited_property(), dict, "", false); + + dict = dict.duplicate(); // Duplicate, so undo/redo works better. + object->set_dict(dict); + update_property(); +} + +void EditorPropertyFontMetaOverride::_add_lang(const String &p_locale) { + Dictionary dict = object->get_dict(); + + dict[p_locale] = true; + + emit_changed(get_edited_property(), dict, "", false); + + dict = dict.duplicate(); // Duplicate, so undo/redo works better. + object->set_dict(dict); + update_property(); +} + +void EditorPropertyFontMetaOverride::_object_id_selected(const StringName &p_property, ObjectID p_id) { + emit_signal(SNAME("object_id_selected"), p_property, p_id); +} + +void EditorPropertyFontMetaOverride::update_property() { + Variant updated_val = get_edited_object()->get(get_edited_property()); + + Dictionary dict = updated_val; + + edit->set_text(vformat(TTR("Overrides (%d)"), dict.size())); + + bool unfolded = get_edited_object()->editor_is_section_unfolded(get_edited_property()); + if (edit->is_pressed() != unfolded) { + edit->set_pressed(unfolded); + } + + if (unfolded) { + updating = true; + + if (!container) { + container = memnew(MarginContainer); + container->set_theme_type_variation("MarginContainer4px"); + add_child(container); + set_bottom_editor(container); + + VBoxContainer *vbox = memnew(VBoxContainer); + vbox->set_v_size_flags(SIZE_EXPAND_FILL); + container->add_child(vbox); + + property_vbox = memnew(VBoxContainer); + property_vbox->set_h_size_flags(SIZE_EXPAND_FILL); + vbox->add_child(property_vbox); + + paginator = memnew(EditorPaginator); + paginator->connect("page_changed", callable_mp(this, &EditorPropertyFontMetaOverride::_page_changed)); + vbox->add_child(paginator); + } else { + // Queue children for deletion, deleting immediately might cause errors. + for (int i = property_vbox->get_child_count() - 1; i >= 0; i--) { + property_vbox->get_child(i)->queue_delete(); + } + button_add = nullptr; + } + + int size = dict.size(); + + int max_page = MAX(0, size - 1) / page_length; + page_index = MIN(page_index, max_page); + + paginator->update(page_index, max_page); + paginator->set_visible(max_page > 0); + + int offset = page_index * page_length; + + int amount = MIN(size - offset, page_length); + + dict = dict.duplicate(); + object->set_dict(dict); + + for (int i = 0; i < amount; i++) { + String name = dict.get_key_at_index(i); + EditorProperty *prop = memnew(EditorPropertyCheck); + prop->set_object_and_property(object.ptr(), "keys/" + name); + + if (script_editor) { + prop->set_label(TranslationServer::get_singleton()->get_script_name(name)); + } else { + prop->set_label(TranslationServer::get_singleton()->get_locale_name(name)); + } + prop->set_tooltip(name); + prop->set_selectable(false); + + prop->connect("property_changed", callable_mp(this, &EditorPropertyFontMetaOverride::_property_changed)); + prop->connect("object_id_selected", callable_mp(this, &EditorPropertyFontMetaOverride::_object_id_selected)); + + HBoxContainer *hbox = memnew(HBoxContainer); + property_vbox->add_child(hbox); + hbox->add_child(prop); + prop->set_h_size_flags(SIZE_EXPAND_FILL); + Button *remove = memnew(Button); + remove->set_icon(get_theme_icon(SNAME("Remove"), SNAME("EditorIcons"))); + hbox->add_child(remove); + remove->connect("pressed", callable_mp(this, &EditorPropertyFontMetaOverride::_remove), varray(remove, name)); + + prop->update_property(); + } + + if (script_editor) { + button_add = EditorInspector::create_inspector_action_button(TTR("Add Script")); + } else { + button_add = EditorInspector::create_inspector_action_button(TTR("Add Locale")); + } + button_add->connect("pressed", callable_mp(this, &EditorPropertyFontMetaOverride::_add_menu)); + property_vbox->add_child(button_add); + + updating = false; + } else { + if (container) { + set_bottom_editor(nullptr); + memdelete(container); + button_add = nullptr; + container = nullptr; + } + } +} + +void EditorPropertyFontMetaOverride::_edit_pressed() { + Variant prop_val = get_edited_object()->get(get_edited_property()); + if (prop_val.get_type() == Variant::NIL) { + Callable::CallError ce; + Variant::construct(Variant::DICTIONARY, prop_val, nullptr, 0, ce); + get_edited_object()->set(get_edited_property(), prop_val); + } + + get_edited_object()->editor_set_section_unfold(get_edited_property(), edit->is_pressed()); + update_property(); +} + +void EditorPropertyFontMetaOverride::_page_changed(int p_page) { + if (updating) { + return; + } + page_index = p_page; + update_property(); +} + +EditorPropertyFontMetaOverride::EditorPropertyFontMetaOverride(bool p_script) { + script_editor = p_script; + + object.instantiate(); + page_length = int(EDITOR_GET("interface/inspector/max_array_dictionary_items_per_page")); + + edit = memnew(Button); + edit->set_h_size_flags(SIZE_EXPAND_FILL); + edit->set_clip_text(true); + edit->connect("pressed", callable_mp(this, &EditorPropertyFontMetaOverride::_edit_pressed)); + edit->set_toggle_mode(true); + add_child(edit); + add_focusable(edit); + + menu = memnew(PopupMenu); + if (script_editor) { + script_codes = TranslationServer::get_singleton()->get_all_scripts(); + for (int i = 0; i < script_codes.size(); i++) { + menu->add_item(TranslationServer::get_singleton()->get_script_name(script_codes[i]) + " (" + script_codes[i] + ")", i); + } + } + add_child(menu); + menu->connect("id_pressed", callable_mp(this, &EditorPropertyFontMetaOverride::_add_script)); + + locale_select = memnew(EditorLocaleDialog); + locale_select->connect("locale_selected", callable_mp(this, &EditorPropertyFontMetaOverride::_add_lang)); + add_child(locale_select); +} + +/*************************************************************************/ +/* EditorPropertyOTVariation */ +/*************************************************************************/ + +void EditorPropertyOTVariation::_notification(int p_what) { + switch (p_what) { + case NOTIFICATION_ENTER_TREE: + case NOTIFICATION_THEME_CHANGED: { + } break; + } +} + +void EditorPropertyOTVariation::_property_changed(const String &p_property, Variant p_value, const String &p_name, bool p_changing) { + if (p_property.begins_with("keys")) { + Dictionary dict = object->get_dict(); + Dictionary defaults_dict = object->get_defaults(); + int key = p_property.get_slice("/", 1).to_int(); + dict[key] = (int)p_value; + if (defaults_dict.has(key)) { + Vector3i range = defaults_dict[key]; + if (range.z == (int)p_value) { + dict.erase(key); + } + } + + emit_changed(get_edited_property(), dict, "", true); + + dict = dict.duplicate(); // Duplicate, so undo/redo works better. + object->set_dict(dict); + } +} + +void EditorPropertyOTVariation::_object_id_selected(const StringName &p_property, ObjectID p_id) { + emit_signal(SNAME("object_id_selected"), p_property, p_id); +} + +void EditorPropertyOTVariation::update_property() { + Variant updated_val = get_edited_object()->get(get_edited_property()); + + Dictionary dict = updated_val; + + Ref<Font> fd; + if (Object::cast_to<Font>(get_edited_object()) != nullptr) { + fd = get_edited_object(); + } else if (Object::cast_to<DynamicFontImportSettingsData>(get_edited_object()) != nullptr) { + Ref<DynamicFontImportSettingsData> imp = Object::cast_to<DynamicFontImportSettingsData>(get_edited_object()); + fd = imp->get_font(); + } + + Dictionary supported = (fd.is_valid()) ? fd->get_supported_variation_list() : Dictionary(); + + edit->set_text(vformat(TTR("Variation Coordinates (%d)"), supported.size())); + + bool unfolded = get_edited_object()->editor_is_section_unfolded(get_edited_property()); + if (edit->is_pressed() != unfolded) { + edit->set_pressed(unfolded); + } + + if (unfolded) { + updating = true; + + if (!container) { + container = memnew(MarginContainer); + container->set_theme_type_variation("MarginContainer4px"); + add_child(container); + set_bottom_editor(container); + + VBoxContainer *vbox = memnew(VBoxContainer); + vbox->set_v_size_flags(SIZE_EXPAND_FILL); + container->add_child(vbox); + + property_vbox = memnew(VBoxContainer); + property_vbox->set_h_size_flags(SIZE_EXPAND_FILL); + vbox->add_child(property_vbox); + + paginator = memnew(EditorPaginator); + paginator->connect("page_changed", callable_mp(this, &EditorPropertyOTVariation::_page_changed)); + vbox->add_child(paginator); + } else { + // Queue children for deletion, deleting immediately might cause errors. + for (int i = property_vbox->get_child_count() - 1; i >= 0; i--) { + property_vbox->get_child(i)->queue_delete(); + } + } + + int size = supported.size(); + + int max_page = MAX(0, size - 1) / page_length; + page_index = MIN(page_index, max_page); + + paginator->update(page_index, max_page); + paginator->set_visible(max_page > 0); + + int offset = page_index * page_length; + + int amount = MIN(size - offset, page_length); + + dict = dict.duplicate(); + object->set_dict(dict); + object->set_defaults(supported); + + for (int i = 0; i < amount; i++) { + int name_tag = supported.get_key_at_index(i); + Vector3i range = supported.get_value_at_index(i); + + EditorPropertyInteger *prop = memnew(EditorPropertyInteger); + prop->setup(range.x, range.y, 1, false, false); + prop->set_object_and_property(object.ptr(), "keys/" + itos(name_tag)); + + String name = TS->tag_to_name(name_tag); + prop->set_label(name.capitalize()); + prop->set_tooltip(name); + prop->set_selectable(false); + + prop->connect("property_changed", callable_mp(this, &EditorPropertyOTVariation::_property_changed)); + prop->connect("object_id_selected", callable_mp(this, &EditorPropertyOTVariation::_object_id_selected)); + + property_vbox->add_child(prop); + + prop->update_property(); + } + + updating = false; + } else { + if (container) { + set_bottom_editor(nullptr); + memdelete(container); + container = nullptr; + } + } +} + +void EditorPropertyOTVariation::_edit_pressed() { + Variant prop_val = get_edited_object()->get(get_edited_property()); + if (prop_val.get_type() == Variant::NIL) { + Callable::CallError ce; + Variant::construct(Variant::DICTIONARY, prop_val, nullptr, 0, ce); + get_edited_object()->set(get_edited_property(), prop_val); + } + + get_edited_object()->editor_set_section_unfold(get_edited_property(), edit->is_pressed()); + update_property(); +} + +void EditorPropertyOTVariation::_page_changed(int p_page) { + if (updating) { + return; + } + page_index = p_page; + update_property(); +} + +EditorPropertyOTVariation::EditorPropertyOTVariation() { + object.instantiate(); + page_length = int(EDITOR_GET("interface/inspector/max_array_dictionary_items_per_page")); + + edit = memnew(Button); + edit->set_h_size_flags(SIZE_EXPAND_FILL); + edit->set_clip_text(true); + edit->connect("pressed", callable_mp(this, &EditorPropertyOTVariation::_edit_pressed)); + edit->set_toggle_mode(true); + add_child(edit); + add_focusable(edit); +} + +/*************************************************************************/ +/* EditorPropertyOTFeatures */ +/*************************************************************************/ + +void EditorPropertyOTFeatures::_notification(int p_what) { + switch (p_what) { + case NOTIFICATION_ENTER_TREE: + case NOTIFICATION_THEME_CHANGED: { + if (Object::cast_to<Button>(button_add)) { + button_add->set_icon(get_theme_icon(SNAME("Add"), SNAME("EditorIcons"))); + } + } break; + } +} + +void EditorPropertyOTFeatures::_property_changed(const String &p_property, Variant p_value, const String &p_name, bool p_changing) { + if (p_property.begins_with("keys")) { + Dictionary dict = object->get_dict(); + int key = p_property.get_slice("/", 1).to_int(); + dict[key] = (int)p_value; + + emit_changed(get_edited_property(), dict, "", true); + + dict = dict.duplicate(); // Duplicate, so undo/redo works better. + object->set_dict(dict); + } +} + +void EditorPropertyOTFeatures::_remove(Object *p_button, int p_key) { + Dictionary dict = object->get_dict(); + + dict.erase(p_key); + + emit_changed(get_edited_property(), dict, "", false); + + dict = dict.duplicate(); // Duplicate, so undo/redo works better. + object->set_dict(dict); + update_property(); +} + +void EditorPropertyOTFeatures::_add_menu() { + Size2 size = get_size(); + menu->set_position(get_screen_position() + Size2(0, size.height * get_global_transform().get_scale().y)); + menu->reset_size(); + menu->popup(); +} + +void EditorPropertyOTFeatures::_add_feature(int p_option) { + Dictionary dict = object->get_dict(); + + dict[p_option] = 1; + + emit_changed(get_edited_property(), dict, "", false); + + dict = dict.duplicate(); // Duplicate, so undo/redo works better. + object->set_dict(dict); + update_property(); +} + +void EditorPropertyOTFeatures::_object_id_selected(const StringName &p_property, ObjectID p_id) { + emit_signal(SNAME("object_id_selected"), p_property, p_id); +} + +void EditorPropertyOTFeatures::update_property() { + Variant updated_val = get_edited_object()->get(get_edited_property()); + + Dictionary dict = updated_val; + + Ref<Font> fd; + if (Object::cast_to<FontVariation>(get_edited_object()) != nullptr) { + fd = get_edited_object(); + } else if (Object::cast_to<DynamicFontImportSettingsData>(get_edited_object()) != nullptr) { + Ref<DynamicFontImportSettingsData> imp = Object::cast_to<DynamicFontImportSettingsData>(get_edited_object()); + fd = imp->get_font(); + } + + Dictionary supported; + if (fd.is_valid()) { + supported = fd->get_supported_feature_list(); + } + + edit->set_text(vformat(TTR("Features (%d of %d set)"), dict.size(), supported.size())); + + bool unfolded = get_edited_object()->editor_is_section_unfolded(get_edited_property()); + if (edit->is_pressed() != unfolded) { + edit->set_pressed(unfolded); + } + + if (unfolded) { + updating = true; + + if (!container) { + container = memnew(MarginContainer); + container->set_theme_type_variation("MarginContainer4px"); + add_child(container); + set_bottom_editor(container); + + VBoxContainer *vbox = memnew(VBoxContainer); + vbox->set_v_size_flags(SIZE_EXPAND_FILL); + container->add_child(vbox); + + property_vbox = memnew(VBoxContainer); + property_vbox->set_h_size_flags(SIZE_EXPAND_FILL); + vbox->add_child(property_vbox); + + paginator = memnew(EditorPaginator); + paginator->connect("page_changed", callable_mp(this, &EditorPropertyOTFeatures::_page_changed)); + vbox->add_child(paginator); + } else { + // Queue children for deletion, deleting immediately might cause errors. + for (int i = property_vbox->get_child_count() - 1; i >= 0; i--) { + property_vbox->get_child(i)->queue_delete(); + } + button_add = nullptr; + } + + // Update add menu items. + menu->clear(); + bool have_sub[FGRP_MAX]; + for (int i = 0; i < FGRP_MAX; i++) { + menu_sub[i]->clear(); + have_sub[i] = false; + } + + bool show_hidden = EDITOR_GET("interface/inspector/show_low_level_opentype_features"); + + for (int i = 0; i < supported.size(); i++) { + int name_tag = supported.get_key_at_index(i); + Dictionary info = supported.get_value_at_index(i); + bool hidden = info["hidden"].operator bool(); + String name = TS->tag_to_name(name_tag); + FeatureGroups grp = FGRP_MAX; + + if (hidden && !show_hidden) { + continue; + } + + if (name.begins_with("stylistic_set_")) { + grp = FGRP_STYLISTIC_SET; + } else if (name.begins_with("character_variant_")) { + grp = FGRP_CHARACTER_VARIANT; + } else if (name.ends_with("_capitals")) { + grp = FGRP_CAPITLS; + } else if (name.ends_with("_ligatures")) { + grp = FGRP_LIGATURES; + } else if (name.ends_with("_alternates")) { + grp = FGRP_ALTERNATES; + } else if (name.ends_with("_kanji_forms") || name.begins_with("jis") || name == "simplified_forms" || name == "traditional_name_forms" || name == "traditional_forms") { + grp = FGRP_EAL; + } else if (name.ends_with("_widths")) { + grp = FGRP_EAW; + } else if (name == "tabular_figures" || name == "proportional_figures") { + grp = FGRP_NUMAL; + } else if (name.begins_with("custom_")) { + grp = FGRP_CUSTOM; + } + String disp_name = name.capitalize(); + if (info.has("label")) { + disp_name = vformat("%s (%s)", disp_name, info["label"].operator String()); + } + + if (grp == FGRP_MAX) { + menu->add_item(disp_name, name_tag); + } else { + menu_sub[grp]->add_item(disp_name, name_tag); + have_sub[grp] = true; + } + } + for (int i = 0; i < FGRP_MAX; i++) { + if (have_sub[i]) { + menu->add_submenu_item(RTR(group_names[i]), "FTRMenu_" + itos(i)); + } + } + + int size = dict.size(); + + int max_page = MAX(0, size - 1) / page_length; + page_index = MIN(page_index, max_page); + + paginator->update(page_index, max_page); + paginator->set_visible(max_page > 0); + + int offset = page_index * page_length; + + int amount = MIN(size - offset, page_length); + + dict = dict.duplicate(); + object->set_dict(dict); + + for (int i = 0; i < amount; i++) { + int name_tag = dict.get_key_at_index(i); + + if (supported.has(name_tag)) { + Dictionary info = supported[name_tag]; + Variant::Type vtype = Variant::Type(info["type"].operator int()); + bool hidden = info["hidden"].operator bool(); + if (hidden && !show_hidden) { + continue; + } + + EditorProperty *prop = nullptr; + switch (vtype) { + case Variant::NIL: { + prop = memnew(EditorPropertyNil); + } break; + case Variant::BOOL: { + prop = memnew(EditorPropertyCheck); + } break; + case Variant::INT: { + EditorPropertyInteger *editor = memnew(EditorPropertyInteger); + editor->setup(0, 255, 1, false, false); + prop = editor; + } break; + default: { + ERR_CONTINUE_MSG(true, vformat("Unsupported OT feature data type %s", Variant::get_type_name(vtype))); + } + } + prop->set_object_and_property(object.ptr(), "keys/" + itos(name_tag)); + + String name = TS->tag_to_name(name_tag); + String disp_name = name.capitalize(); + if (info.has("label")) { + disp_name = vformat("%s (%s)", disp_name, info["label"].operator String()); + } + prop->set_label(disp_name); + prop->set_tooltip(name); + prop->set_selectable(false); + + prop->connect("property_changed", callable_mp(this, &EditorPropertyOTFeatures::_property_changed)); + prop->connect("object_id_selected", callable_mp(this, &EditorPropertyOTFeatures::_object_id_selected)); + + HBoxContainer *hbox = memnew(HBoxContainer); + property_vbox->add_child(hbox); + hbox->add_child(prop); + prop->set_h_size_flags(SIZE_EXPAND_FILL); + Button *remove = memnew(Button); + remove->set_icon(get_theme_icon(SNAME("Remove"), SNAME("EditorIcons"))); + hbox->add_child(remove); + remove->connect("pressed", callable_mp(this, &EditorPropertyOTFeatures::_remove), varray(remove, name_tag)); + + prop->update_property(); + } + } + + button_add = EditorInspector::create_inspector_action_button(TTR("Add Feature")); + button_add->set_icon(get_theme_icon(SNAME("Add"), SNAME("EditorIcons"))); + button_add->connect("pressed", callable_mp(this, &EditorPropertyOTFeatures::_add_menu)); + property_vbox->add_child(button_add); + + updating = false; + } else { + if (container) { + set_bottom_editor(nullptr); + memdelete(container); + button_add = nullptr; + container = nullptr; + } + } +} + +void EditorPropertyOTFeatures::_edit_pressed() { + Variant prop_val = get_edited_object()->get(get_edited_property()); + if (prop_val.get_type() == Variant::NIL) { + Callable::CallError ce; + Variant::construct(Variant::DICTIONARY, prop_val, nullptr, 0, ce); + get_edited_object()->set(get_edited_property(), prop_val); + } + + get_edited_object()->editor_set_section_unfold(get_edited_property(), edit->is_pressed()); + update_property(); +} + +void EditorPropertyOTFeatures::_page_changed(int p_page) { + if (updating) { + return; + } + page_index = p_page; + update_property(); +} + +EditorPropertyOTFeatures::EditorPropertyOTFeatures() { + object.instantiate(); + page_length = int(EDITOR_GET("interface/inspector/max_array_dictionary_items_per_page")); + + edit = memnew(Button); + edit->set_h_size_flags(SIZE_EXPAND_FILL); + edit->set_clip_text(true); + edit->connect("pressed", callable_mp(this, &EditorPropertyOTFeatures::_edit_pressed)); + edit->set_toggle_mode(true); + add_child(edit); + add_focusable(edit); + + menu = memnew(PopupMenu); + add_child(menu); + menu->connect("id_pressed", callable_mp(this, &EditorPropertyOTFeatures::_add_feature)); + + for (int i = 0; i < FGRP_MAX; i++) { + menu_sub[i] = memnew(PopupMenu); + menu_sub[i]->set_name("FTRMenu_" + itos(i)); + menu->add_child(menu_sub[i]); + menu_sub[i]->connect("id_pressed", callable_mp(this, &EditorPropertyOTFeatures::_add_feature)); + } + + group_names[FGRP_STYLISTIC_SET] = "Stylistic Sets"; + group_names[FGRP_CHARACTER_VARIANT] = "Character Variants"; + group_names[FGRP_CAPITLS] = "Capitals"; + group_names[FGRP_LIGATURES] = "Ligatures"; + group_names[FGRP_ALTERNATES] = "Alternates"; + group_names[FGRP_EAL] = "East Asian Language"; + group_names[FGRP_EAW] = "East Asian Widths"; + group_names[FGRP_NUMAL] = "Numeral Alignment"; + group_names[FGRP_CUSTOM] = "Custom"; +} + +/*************************************************************************/ +/* EditorInspectorPluginFontVariation */ +/*************************************************************************/ + +bool EditorInspectorPluginFontVariation::can_handle(Object *p_object) { + return (Object::cast_to<FontVariation>(p_object) != nullptr) || (Object::cast_to<DynamicFontImportSettingsData>(p_object) != nullptr); +} + +bool EditorInspectorPluginFontVariation::parse_property(Object *p_object, const Variant::Type p_type, const String &p_path, const PropertyHint p_hint, const String &p_hint_text, const uint32_t p_usage, const bool p_wide) { + if (p_path == "variation_opentype") { + add_property_editor(p_path, memnew(EditorPropertyOTVariation)); + return true; + } else if (p_path == "opentype_features") { + add_property_editor(p_path, memnew(EditorPropertyOTFeatures)); + return true; + } else if (p_path == "language_support") { + add_property_editor(p_path, memnew(EditorPropertyFontMetaOverride(false))); + return true; + } else if (p_path == "script_support") { + add_property_editor(p_path, memnew(EditorPropertyFontMetaOverride(true))); + return true; + } + return false; +} + +/*************************************************************************/ +/* FontPreview */ +/*************************************************************************/ + +void FontPreview::_notification(int p_what) { + switch (p_what) { + case NOTIFICATION_DRAW: { + // Draw font name (style). + Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label")); + int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label")); + Color text_color = get_theme_color(SNAME("font_color"), SNAME("Label")); + font->draw_string(get_canvas_item(), Point2(0, font->get_height(font_size) + 2 * EDSCALE), name, HORIZONTAL_ALIGNMENT_CENTER, get_size().x, font_size, text_color); + + // Draw font preview. + Vector2 pos = Vector2(0, font->get_height(font_size)) + (get_size() - Vector2(0, font->get_height(font_size)) - line->get_size()) / 2; + line->draw(get_canvas_item(), pos, text_color); + + // Draw font baseline. + Color line_color = text_color; + line_color.a *= 0.6; + draw_line(Vector2(0, pos.y + line->get_line_ascent()), Vector2(pos.x - 5, pos.y + line->get_line_ascent()), line_color); + draw_line(Vector2(pos.x + line->get_size().x + 5, pos.y + line->get_line_ascent()), Vector2(get_size().x, pos.y + line->get_line_ascent()), line_color); + } break; + } +} + +void FontPreview::_bind_methods() {} + +Size2 FontPreview::get_minimum_size() const { + return Vector2(64, 64) * EDSCALE; +} + +void FontPreview::set_data(const Ref<Font> &p_f) { + line->clear(); + if (p_f.is_valid()) { + name = vformat("%s (%s)", p_f->get_font_name(), p_f->get_font_style_name()); + if (p_f->is_class("FontVariation")) { + name += " " + TTR(" - Variation"); + } + String sample; + static const String sample_base = U"12漢字ԱբΑαАбΑαאבابܐܒހށआআਆઆଆஆఆಆആආกิກິༀကႠა한글ሀᎣᐁᚁᚠᜀᜠᝀᝠកᠠᤁᥐAb😀"; + for (int i = 0; i < sample_base.length(); i++) { + if (p_f->has_char(sample_base[i])) { + sample += sample_base[i]; + } + } + if (sample.is_empty()) { + sample = p_f->get_supported_chars().substr(0, 6); + } + line->add_string(sample, p_f, 50); + } + + update(); +} + +FontPreview::FontPreview() { + line.instantiate(); +} + +/*************************************************************************/ +/* EditorInspectorPluginFontPreview */ +/*************************************************************************/ + +bool EditorInspectorPluginFontPreview::can_handle(Object *p_object) { + return Object::cast_to<Font>(p_object) != nullptr; +} + +void EditorInspectorPluginFontPreview::parse_begin(Object *p_object) { + Font *fd = Object::cast_to<Font>(p_object); + ERR_FAIL_COND(!fd); + + FontPreview *editor = memnew(FontPreview); + editor->set_data(fd); + add_custom_control(editor); +} + +bool EditorInspectorPluginFontPreview::parse_property(Object *p_object, const Variant::Type p_type, const String &p_path, const PropertyHint p_hint, const String &p_hint_text, const uint32_t p_usage, const bool p_wide) { + return false; +} + +/*************************************************************************/ +/* FontEditorPlugin */ +/*************************************************************************/ + +FontEditorPlugin::FontEditorPlugin() { + Ref<EditorInspectorPluginFontVariation> fc_plugin; + fc_plugin.instantiate(); + EditorInspector::add_inspector_plugin(fc_plugin); + + Ref<EditorInspectorPluginFontPreview> fp_plugin; + fp_plugin.instantiate(); + EditorInspector::add_inspector_plugin(fp_plugin); +} diff --git a/editor/plugins/font_config_plugin.h b/editor/plugins/font_config_plugin.h new file mode 100644 index 0000000000..9b7ee55870 --- /dev/null +++ b/editor/plugins/font_config_plugin.h @@ -0,0 +1,261 @@ +/*************************************************************************/ +/* font_config_plugin.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2022 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. */ +/*************************************************************************/ + +#ifndef OT_FEATURES_PLUGIN_H +#define OT_FEATURES_PLUGIN_H + +#include "core/io/marshalls.h" +#include "editor/editor_plugin.h" +#include "editor/editor_properties.h" + +/*************************************************************************/ + +class EditorPropertyFontMetaObject : public RefCounted { + GDCLASS(EditorPropertyFontMetaObject, RefCounted); + + Dictionary dict; + +protected: + bool _set(const StringName &p_name, const Variant &p_value); + bool _get(const StringName &p_name, Variant &r_ret) const; + static void _bind_methods(); + +public: + void set_dict(const Dictionary &p_dict); + Dictionary get_dict(); + + EditorPropertyFontMetaObject(){}; +}; + +/*************************************************************************/ + +class EditorPropertyFontOTObject : public RefCounted { + GDCLASS(EditorPropertyFontOTObject, RefCounted); + + Dictionary dict; + Dictionary defaults_dict; + +protected: + bool _set(const StringName &p_name, const Variant &p_value); + bool _get(const StringName &p_name, Variant &r_ret) const; + static void _bind_methods(); + +public: + void set_dict(const Dictionary &p_dict); + Dictionary get_dict(); + + void set_defaults(const Dictionary &p_dict); + Dictionary get_defaults(); + + bool property_can_revert(const String &p_name); + Variant property_get_revert(const String &p_name); + + EditorPropertyFontOTObject(){}; +}; + +/*************************************************************************/ + +class EditorPropertyFontMetaOverride : public EditorProperty { + GDCLASS(EditorPropertyFontMetaOverride, EditorProperty); + + Ref<EditorPropertyFontMetaObject> object; + + MarginContainer *container = nullptr; + VBoxContainer *property_vbox = nullptr; + + Button *button_add = nullptr; + Button *edit = nullptr; + PopupMenu *menu = nullptr; + EditorLocaleDialog *locale_select = nullptr; + + Vector<String> script_codes; + + bool script_editor = false; + bool updating = false; + int page_length = 20; + int page_index = 0; + EditorPaginator *paginator = nullptr; + +protected: + void _notification(int p_what); + static void _bind_methods(){}; + + void _edit_pressed(); + void _page_changed(int p_page); + void _property_changed(const String &p_property, Variant p_value, const String &p_name = "", bool p_changing = false); + void _remove(Object *p_button, const String &p_key); + void _add_menu(); + void _add_script(int p_option); + void _add_lang(const String &p_locale); + void _object_id_selected(const StringName &p_property, ObjectID p_id); + +public: + virtual void update_property() override; + + EditorPropertyFontMetaOverride(bool p_script); +}; + +/*************************************************************************/ + +class EditorPropertyOTVariation : public EditorProperty { + GDCLASS(EditorPropertyOTVariation, EditorProperty); + + Ref<EditorPropertyFontOTObject> object; + + MarginContainer *container = nullptr; + VBoxContainer *property_vbox = nullptr; + + Button *edit = nullptr; + + bool updating = false; + int page_length = 20; + int page_index = 0; + EditorPaginator *paginator = nullptr; + +protected: + void _notification(int p_what); + static void _bind_methods(){}; + + void _edit_pressed(); + void _page_changed(int p_page); + void _property_changed(const String &p_property, Variant p_value, const String &p_name = "", bool p_changing = false); + void _object_id_selected(const StringName &p_property, ObjectID p_id); + +public: + virtual void update_property() override; + + EditorPropertyOTVariation(); +}; + +/*************************************************************************/ + +class EditorPropertyOTFeatures : public EditorProperty { + GDCLASS(EditorPropertyOTFeatures, EditorProperty); + + enum FeatureGroups { + FGRP_STYLISTIC_SET, + FGRP_CHARACTER_VARIANT, + FGRP_CAPITLS, + FGRP_LIGATURES, + FGRP_ALTERNATES, + FGRP_EAL, + FGRP_EAW, + FGRP_NUMAL, + FGRP_CUSTOM, + FGRP_MAX, + }; + + Ref<EditorPropertyFontOTObject> object; + + MarginContainer *container = nullptr; + VBoxContainer *property_vbox = nullptr; + + Button *button_add = nullptr; + Button *edit = nullptr; + PopupMenu *menu = nullptr; + PopupMenu *menu_sub[FGRP_MAX]; + String group_names[FGRP_MAX]; + + bool updating = false; + int page_length = 20; + int page_index = 0; + EditorPaginator *paginator = nullptr; + +protected: + void _notification(int p_what); + static void _bind_methods(){}; + + void _edit_pressed(); + void _page_changed(int p_page); + void _property_changed(const String &p_property, Variant p_value, const String &p_name = "", bool p_changing = false); + void _remove(Object *p_button, int p_key); + void _add_menu(); + void _add_feature(int p_option); + void _object_id_selected(const StringName &p_property, ObjectID p_id); + +public: + virtual void update_property() override; + + EditorPropertyOTFeatures(); +}; + +/*************************************************************************/ + +class EditorInspectorPluginFontVariation : public EditorInspectorPlugin { + GDCLASS(EditorInspectorPluginFontVariation, EditorInspectorPlugin); + +public: + virtual bool can_handle(Object *p_object) override; + virtual bool parse_property(Object *p_object, const Variant::Type p_type, const String &p_path, const PropertyHint p_hint, const String &p_hint_text, const uint32_t p_usage, const bool p_wide = false) override; +}; + +/*************************************************************************/ + +class FontPreview : public Control { + GDCLASS(FontPreview, Control); + +protected: + void _notification(int p_what); + static void _bind_methods(); + + String name; + Ref<TextLine> line; + +public: + virtual Size2 get_minimum_size() const override; + + void set_data(const Ref<Font> &p_f); + + FontPreview(); +}; + +/*************************************************************************/ + +class EditorInspectorPluginFontPreview : public EditorInspectorPlugin { + GDCLASS(EditorInspectorPluginFontPreview, EditorInspectorPlugin); + +public: + virtual bool can_handle(Object *p_object) override; + virtual void parse_begin(Object *p_object) override; + virtual bool parse_property(Object *p_object, const Variant::Type p_type, const String &p_path, const PropertyHint p_hint, const String &p_hint_text, const uint32_t p_usage, const bool p_wide = false) override; +}; + +/*************************************************************************/ + +class FontEditorPlugin : public EditorPlugin { + GDCLASS(FontEditorPlugin, EditorPlugin); + +public: + FontEditorPlugin(); + + virtual String get_name() const override { return "Font"; } +}; + +#endif // OT_FEATURES_PLUGIN_H diff --git a/editor/plugins/font_editor_plugin.cpp b/editor/plugins/font_editor_plugin.cpp deleted file mode 100644 index b9de621bcb..0000000000 --- a/editor/plugins/font_editor_plugin.cpp +++ /dev/null @@ -1,106 +0,0 @@ -/*************************************************************************/ -/* font_editor_plugin.cpp */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* https://godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur. */ -/* Copyright (c) 2014-2022 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 "font_editor_plugin.h" - -#include "editor/editor_scale.h" - -void FontDataPreview::_notification(int p_what) { - switch (p_what) { - case NOTIFICATION_DRAW: { - Color text_color = get_theme_color(SNAME("font_color"), SNAME("Label")); - Color line_color = text_color; - line_color.a *= 0.6; - Vector2 pos = (get_size() - line->get_size()) / 2; - line->draw(get_canvas_item(), pos, text_color); - draw_line(Vector2(0, pos.y + line->get_line_ascent()), Vector2(pos.x - 5, pos.y + line->get_line_ascent()), line_color); - draw_line(Vector2(pos.x + line->get_size().x + 5, pos.y + line->get_line_ascent()), Vector2(get_size().x, pos.y + line->get_line_ascent()), line_color); - } break; - } -} - -void FontDataPreview::_bind_methods() {} - -Size2 FontDataPreview::get_minimum_size() const { - return Vector2(64, 64) * EDSCALE; -} - -void FontDataPreview::set_data(const Ref<FontData> &p_data) { - Ref<Font> f = memnew(Font); - f->add_data(p_data); - - line->clear(); - if (p_data.is_valid()) { - String sample; - static const String sample_base = U"12漢字ԱբΑαАбΑαאבابܐܒހށआআਆઆଆஆఆಆആආกิກິༀကႠა한글ሀᎣᐁᚁᚠᜀᜠᝀᝠកᠠᤁᥐAb😀"; - for (int i = 0; i < sample_base.length(); i++) { - if (p_data->has_char(sample_base[i])) { - sample += sample_base[i]; - } - } - if (sample.is_empty()) { - sample = p_data->get_supported_chars().substr(0, 6); - } - line->add_string(sample, f, 72); - } - - update(); -} - -FontDataPreview::FontDataPreview() { - line.instantiate(); -} - -/*************************************************************************/ - -bool EditorInspectorPluginFont::can_handle(Object *p_object) { - return Object::cast_to<FontData>(p_object) != nullptr; -} - -void EditorInspectorPluginFont::parse_begin(Object *p_object) { - FontData *fd = Object::cast_to<FontData>(p_object); - ERR_FAIL_COND(!fd); - - FontDataPreview *editor = memnew(FontDataPreview); - editor->set_data(fd); - add_custom_control(editor); -} - -bool EditorInspectorPluginFont::parse_property(Object *p_object, const Variant::Type p_type, const String &p_path, const PropertyHint p_hint, const String &p_hint_text, const uint32_t p_usage, const bool p_wide) { - return false; -} - -/*************************************************************************/ - -FontEditorPlugin::FontEditorPlugin() { - Ref<EditorInspectorPluginFont> fd_plugin; - fd_plugin.instantiate(); - EditorInspector::add_inspector_plugin(fd_plugin); -} diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp index 8d62d0a20d..99c492379d 100644 --- a/editor/plugins/node_3d_editor_plugin.cpp +++ b/editor/plugins/node_3d_editor_plugin.cpp @@ -145,7 +145,7 @@ void ViewportRotationControl::_draw_axis(const Axis2D &p_axis) { // Draw the axis letter for the positive axes. const String axis_name = direction == 0 ? "X" : (direction == 1 ? "Y" : "Z"); - draw_char(get_theme_font(SNAME("rotation_control"), SNAME("EditorFonts")), p_axis.screen_point + Vector2i(Math::round(-4.0 * EDSCALE), Math::round(5.0 * EDSCALE)), axis_name, "", get_theme_font_size(SNAME("rotation_control_size"), SNAME("EditorFonts")), Color(0.0, 0.0, 0.0, alpha)); + draw_char(get_theme_font(SNAME("rotation_control"), SNAME("EditorFonts")), p_axis.screen_point + Vector2i(Math::round(-4.0 * EDSCALE), Math::round(5.0 * EDSCALE)), axis_name, get_theme_font_size(SNAME("rotation_control_size"), SNAME("EditorFonts")), Color(0.0, 0.0, 0.0, alpha)); } else { // Draw an outline around the negative axes. draw_circle(p_axis.screen_point, AXIS_CIRCLE_RADIUS, c); @@ -2725,7 +2725,8 @@ static void draw_indicator_bar(Control &p_surface, real_t p_fill, const Ref<Text p_surface.draw_texture(p_icon, icon_pos, p_color); // Draw text below the bar (for speed/zoom information). - p_surface.draw_string(p_font, Vector2(icon_pos.x, icon_pos.y + icon_size.y + 16 * EDSCALE), p_text, HORIZONTAL_ALIGNMENT_LEFT, -1.f, p_font_size, p_color, Math::round(2 * EDSCALE), Color(0, 0, 0)); + p_surface.draw_string_outline(p_font, Vector2(icon_pos.x, icon_pos.y + icon_size.y + 16 * EDSCALE), p_text, HORIZONTAL_ALIGNMENT_LEFT, -1.f, p_font_size, Math::round(2 * EDSCALE), Color(0, 0, 0)); + p_surface.draw_string(p_font, Vector2(icon_pos.x, icon_pos.y + icon_size.y + 16 * EDSCALE), p_text, HORIZONTAL_ALIGNMENT_LEFT, -1.f, p_font_size, p_color); } void Node3DEditorViewport::_draw() { @@ -4702,7 +4703,7 @@ Node3DEditorViewport::Node3DEditorViewport(Node3DEditor *p_spatial_editor, int p frame_time_gradient->add_point(0.5, Color()); top_right_vbox = memnew(VBoxContainer); - top_right_vbox->set_anchors_and_offsets_preset(PRESET_TOP_RIGHT, PRESET_MODE_MINSIZE, 2.0 * EDSCALE); + top_right_vbox->set_anchors_and_offsets_preset(PRESET_TOP_RIGHT, PRESET_MODE_MINSIZE, 10.0 * EDSCALE); top_right_vbox->set_h_grow_direction(GROW_DIRECTION_BEGIN); // Make sure frame time labels don't touch the viewport's edge. top_right_vbox->set_custom_minimum_size(Size2(100, 0) * EDSCALE); diff --git a/editor/plugins/ot_features_plugin.cpp b/editor/plugins/ot_features_plugin.cpp deleted file mode 100644 index f8526fb715..0000000000 --- a/editor/plugins/ot_features_plugin.cpp +++ /dev/null @@ -1,235 +0,0 @@ -/*************************************************************************/ -/* ot_features_plugin.cpp */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* https://godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur. */ -/* Copyright (c) 2014-2022 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 "ot_features_plugin.h" - -#include "scene/3d/label_3d.h" -#include "scene/resources/primitive_meshes.h" - -void OpenTypeFeaturesEditor::_value_changed(double val) { - if (setting) { - return; - } - - emit_changed(get_edited_property(), spin->get_value()); -} - -void OpenTypeFeaturesEditor::update_property() { - double val = get_edited_object()->get(get_edited_property()); - setting = true; - spin->set_value(val); - setting = false; -} - -void OpenTypeFeaturesEditor::_notification(int p_what) { - switch (p_what) { - case NOTIFICATION_ENTER_TREE: - case NOTIFICATION_THEME_CHANGED: { - Color base = get_theme_color(SNAME("accent_color"), SNAME("Editor")); - - button->set_icon(get_theme_icon(SNAME("Remove"), SNAME("EditorIcons"))); - button->set_size(get_theme_icon(SNAME("Remove"), SNAME("EditorIcons"))->get_size()); - spin->add_theme_color_override("label_color", base); - } break; - } -} - -void OpenTypeFeaturesEditor::_remove_feature() { - get_edited_object()->set(get_edited_property(), -1); -} - -void OpenTypeFeaturesEditor::_bind_methods() { -} - -OpenTypeFeaturesEditor::OpenTypeFeaturesEditor() { - HBoxContainer *bc = memnew(HBoxContainer); - add_child(bc); - - spin = memnew(EditorSpinSlider); - spin->set_flat(true); - bc->add_child(spin); - add_focusable(spin); - spin->connect("value_changed", callable_mp(this, &OpenTypeFeaturesEditor::_value_changed)); - spin->set_h_size_flags(SIZE_EXPAND_FILL); - - spin->set_min(0); - spin->set_max(65536); - spin->set_step(1); - spin->set_hide_slider(false); - spin->set_allow_greater(false); - spin->set_allow_lesser(false); - - button = memnew(Button); - button->set_tooltip(RTR("Remove feature")); - button->set_flat(true); - bc->add_child(button); - - button->connect("pressed", callable_mp(this, &OpenTypeFeaturesEditor::_remove_feature)); - - setting = false; -} - -/*************************************************************************/ - -void OpenTypeFeaturesAdd::_add_feature(int p_option) { - edited_object->set("opentype_features/" + TS->tag_to_name(p_option), 1); -} - -void OpenTypeFeaturesAdd::_features_menu() { - Size2 size = get_size(); - menu->set_position(get_screen_position() + Size2(0, size.height * get_global_transform().get_scale().y)); - menu->reset_size(); - menu->popup(); -} - -void OpenTypeFeaturesAdd::setup(Object *p_object) { - edited_object = p_object; - - menu->clear(); - menu_ss->clear(); - menu_cv->clear(); - menu_cu->clear(); - bool have_ss = false; - bool have_cv = false; - bool have_cu = false; - - Ref<Font> font; - - Control *ctrl = Object::cast_to<Control>(edited_object); - if (ctrl != nullptr) { - font = ctrl->get_theme_font(SNAME("font")); - } - Label3D *l3d = Object::cast_to<Label3D>(edited_object); - if (l3d != nullptr) { - font = l3d->_get_font_or_default(); - } - TextMesh *tm = Object::cast_to<TextMesh>(edited_object); - if (tm != nullptr) { - font = tm->_get_font_or_default(); - } - - if (font.is_null()) { - return; - } - - Dictionary features = font->get_feature_list(); - - for (const Variant *ftr = features.next(nullptr); ftr != nullptr; ftr = features.next(ftr)) { - String ftr_name = TS->tag_to_name(*ftr); - if (ftr_name.begins_with("stylistic_set_")) { - menu_ss->add_item(ftr_name.capitalize(), (int32_t)*ftr); - have_ss = true; - } else if (ftr_name.begins_with("character_variant_")) { - menu_cv->add_item(ftr_name.capitalize(), (int32_t)*ftr); - have_cv = true; - } else if (ftr_name.begins_with("custom_")) { - menu_cu->add_item(ftr_name.replace("custom_", ""), (int32_t)*ftr); - have_cu = true; - } else { - menu->add_item(ftr_name.capitalize(), (int32_t)*ftr); - } - } - if (have_ss) { - menu->add_submenu_item(RTR("Stylistic Sets"), "SSMenu"); - } - if (have_cv) { - menu->add_submenu_item(RTR("Character Variants"), "CVMenu"); - } - if (have_cu) { - menu->add_submenu_item(RTR("Custom"), "CUMenu"); - } -} - -void OpenTypeFeaturesAdd::_notification(int p_what) { - switch (p_what) { - case NOTIFICATION_ENTER_TREE: { - connect("pressed", callable_mp(this, &OpenTypeFeaturesAdd::_features_menu)); - [[fallthrough]]; - } - case NOTIFICATION_THEME_CHANGED: { - set_icon(get_theme_icon(SNAME("Add"), SNAME("EditorIcons"))); - } break; - } -} - -void OpenTypeFeaturesAdd::_bind_methods() { -} - -OpenTypeFeaturesAdd::OpenTypeFeaturesAdd() { - set_text(TTR("Add Feature...")); - - menu = memnew(PopupMenu); - add_child(menu); - - menu_cv = memnew(PopupMenu); - menu_cv->set_name("CVMenu"); - menu->add_child(menu_cv); - - menu_ss = memnew(PopupMenu); - menu_ss->set_name("SSMenu"); - menu->add_child(menu_ss); - - menu_cu = memnew(PopupMenu); - menu_cu->set_name("CUMenu"); - menu->add_child(menu_cu); - - menu->connect("id_pressed", callable_mp(this, &OpenTypeFeaturesAdd::_add_feature)); - menu_cv->connect("id_pressed", callable_mp(this, &OpenTypeFeaturesAdd::_add_feature)); - menu_ss->connect("id_pressed", callable_mp(this, &OpenTypeFeaturesAdd::_add_feature)); - menu_cu->connect("id_pressed", callable_mp(this, &OpenTypeFeaturesAdd::_add_feature)); -} - -/*************************************************************************/ - -bool EditorInspectorPluginOpenTypeFeatures::can_handle(Object *p_object) { - return (Object::cast_to<Control>(p_object) != nullptr) || (Object::cast_to<Label3D>(p_object) != nullptr) || (Object::cast_to<TextMesh>(p_object) != nullptr); -} - -bool EditorInspectorPluginOpenTypeFeatures::parse_property(Object *p_object, const Variant::Type p_type, const String &p_path, const PropertyHint p_hint, const String &p_hint_text, const uint32_t p_usage, const bool p_wide) { - if (p_path == "opentype_features/_new") { - OpenTypeFeaturesAdd *editor = memnew(OpenTypeFeaturesAdd); - editor->setup(p_object); - add_custom_control(editor); - return true; - } else if (p_path.begins_with("opentype_features")) { - OpenTypeFeaturesEditor *editor = memnew(OpenTypeFeaturesEditor); - add_property_editor(p_path, editor); - return true; - } - return false; -} - -/*************************************************************************/ - -OpenTypeFeaturesEditorPlugin::OpenTypeFeaturesEditorPlugin() { - Ref<EditorInspectorPluginOpenTypeFeatures> ftr_plugin; - ftr_plugin.instantiate(); - EditorInspector::add_inspector_plugin(ftr_plugin); -} diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp index 7d4ffd1a25..7c3520c39d 100644 --- a/editor/plugins/script_text_editor.cpp +++ b/editor/plugins/script_text_editor.cpp @@ -886,6 +886,9 @@ void ScriptTextEditor::_lookup_symbol(const String &p_symbol, int p_row, int p_c emit_signal(SNAME("go_to_help"), "class_enum:" + result.class_name + ":" + result.class_member); } break; + case ScriptLanguage::LOOKUP_RESULT_CLASS_ANNOTATION: { + emit_signal(SNAME("go_to_help"), "class_annotation:" + result.class_name + ":" + result.class_member); + } break; case ScriptLanguage::LOOKUP_RESULT_CLASS_TBD_GLOBALSCOPE: { emit_signal(SNAME("go_to_help"), "class_global:" + result.class_name + ":" + result.class_member); } break; diff --git a/editor/plugins/text_control_editor_plugin.cpp b/editor/plugins/text_control_editor_plugin.cpp deleted file mode 100644 index 2a5faba4a2..0000000000 --- a/editor/plugins/text_control_editor_plugin.cpp +++ /dev/null @@ -1,660 +0,0 @@ -/*************************************************************************/ -/* text_control_editor_plugin.cpp */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* https://godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur. */ -/* Copyright (c) 2014-2022 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 "text_control_editor_plugin.h" - -#include "editor/editor_node.h" -#include "editor/editor_scale.h" -#include "editor/multi_node_edit.h" - -void TextControlEditor::_notification(int p_what) { - switch (p_what) { - case NOTIFICATION_ENTER_TREE: { - if (!EditorFileSystem::get_singleton()->is_connected("filesystem_changed", callable_mp(this, &TextControlEditor::_reload_fonts))) { - EditorFileSystem::get_singleton()->connect("filesystem_changed", callable_mp(this, &TextControlEditor::_reload_fonts), make_binds("")); - } - [[fallthrough]]; - } - case NOTIFICATION_THEME_CHANGED: { - clear_formatting->set_icon(get_theme_icon(SNAME("Remove"), SNAME("EditorIcons"))); - } break; - - case NOTIFICATION_EXIT_TREE: { - if (EditorFileSystem::get_singleton()->is_connected("filesystem_changed", callable_mp(this, &TextControlEditor::_reload_fonts))) { - EditorFileSystem::get_singleton()->disconnect("filesystem_changed", callable_mp(this, &TextControlEditor::_reload_fonts)); - } - } break; - } -} - -void TextControlEditor::_bind_methods() { - ClassDB::bind_method(D_METHOD("_update_control"), &TextControlEditor::_update_control); -} - -void TextControlEditor::_find_resources(EditorFileSystemDirectory *p_dir) { - for (int i = 0; i < p_dir->get_subdir_count(); i++) { - _find_resources(p_dir->get_subdir(i)); - } - - for (int i = 0; i < p_dir->get_file_count(); i++) { - if (p_dir->get_file_type(i) == "FontData") { - Ref<FontData> fd = ResourceLoader::load(p_dir->get_file_path(i)); - if (fd.is_valid()) { - String name = fd->get_font_name(); - String sty = fd->get_font_style_name(); - if (sty.is_empty()) { - sty = "Default"; - } - fonts[name][sty] = p_dir->get_file_path(i); - } - } - } -} - -void TextControlEditor::_reload_fonts(const String &p_path) { - fonts.clear(); - _find_resources(EditorFileSystem::get_singleton()->get_filesystem()); - _update_control(); -} - -void TextControlEditor::_update_fonts_menu() { - font_list->clear(); - font_list->add_item(TTR("[Theme Default]"), FONT_INFO_THEME_DEFAULT); - if (custom_font.is_valid()) { - font_list->add_item(TTR("[Custom Font]"), FONT_INFO_USER_CUSTOM); - } - - int id = FONT_INFO_ID; - for (const KeyValue<String, HashMap<String, String>> &E : fonts) { - font_list->add_item(E.key, id++); - } - - if (font_list->get_item_count() > 1) { - font_list->show(); - } else { - font_list->hide(); - } -} - -void TextControlEditor::_update_styles_menu() { - font_style_list->clear(); - if ((font_list->get_selected_id() >= FONT_INFO_ID)) { - const String &name = font_list->get_item_text(font_list->get_selected()); - for (KeyValue<String, String> &E : fonts[name]) { - font_style_list->add_item(E.key); - } - } else if (font_list->get_selected() >= 0) { - font_style_list->add_item("Default"); - } - - if (font_style_list->get_item_count() > 1) { - font_style_list->show(); - } else { - font_style_list->hide(); - } -} - -void TextControlEditor::_update_control() { - if (!edited_controls.is_empty()) { - String font_selected; - bool same_font = true; - String style_selected; - bool same_style = true; - int font_size = 0; - bool same_font_size = true; - int outline_size = 0; - bool same_outline_size = true; - Color font_color = Color{ 1.0f, 1.0f, 1.0f }; - bool same_font_color = true; - Color outline_color = Color{ 1.0f, 1.0f, 1.0f }; - bool same_outline_color = true; - - int count = edited_controls.size(); - for (int i = 0; i < count; ++i) { - Control *edited_control = edited_controls[i]; - - StringName edited_color; - StringName edited_font; - StringName edited_font_size; - - // Get override names. - if (Object::cast_to<RichTextLabel>(edited_control)) { - edited_color = SNAME("default_color"); - edited_font = SNAME("normal_font"); - edited_font_size = SNAME("normal_font_size"); - } else { - edited_color = SNAME("font_color"); - edited_font = SNAME("font"); - edited_font_size = SNAME("font_size"); - } - - // Get font override. - Ref<Font> font; - if (edited_control->has_theme_font_override(edited_font)) { - font = edited_control->get_theme_font(edited_font); - } - - if (font.is_valid()) { - if (font->get_data_count() != 1) { - if (i > 0) { - same_font = same_font && (custom_font == font); - } - custom_font = font; - - font_selected = TTR("[Custom Font]"); - same_style = false; - } else { - String name = font->get_data(0)->get_font_name(); - String style = font->get_data(0)->get_font_style_name(); - if (fonts.has(name) && fonts[name].has(style)) { - if (i > 0) { - same_font = same_font && (name == font_selected); - same_style = same_style && (style == style_selected); - } - font_selected = name; - style_selected = style; - } else { - if (i > 0) { - same_font = same_font && (custom_font == font); - } - custom_font = font; - - font_selected = TTR("[Custom Font]"); - same_style = false; - } - } - } else { - if (i > 0) { - same_font = same_font && (font_selected == TTR("[Theme Default]")); - } - - font_selected = TTR("[Theme Default]"); - same_style = false; - } - - int current_font_size = edited_control->get_theme_font_size(edited_font_size); - int current_outline_size = edited_control->get_theme_constant(SNAME("outline_size")); - Color current_font_color = edited_control->get_theme_color(edited_color); - Color current_outline_color = edited_control->get_theme_color(SNAME("font_outline_color")); - if (i > 0) { - same_font_size = same_font_size && (font_size == current_font_size); - same_outline_size = same_outline_size && (outline_size == current_outline_size); - same_font_color = same_font_color && (font_color == current_font_color); - same_outline_color = same_outline_color && (outline_color == current_outline_color); - } - - font_size = current_font_size; - outline_size = current_outline_size; - font_color = current_font_color; - outline_color = current_outline_color; - } - _update_fonts_menu(); - if (same_font) { - for (int j = 0; j < font_list->get_item_count(); j++) { - if (font_list->get_item_text(j) == font_selected) { - font_list->select(j); - break; - } - } - } else { - custom_font = Ref<Font>(); - font_list->select(-1); - } - - _update_styles_menu(); - if (same_style) { - for (int j = 0; j < font_style_list->get_item_count(); j++) { - if (font_style_list->get_item_text(j) == style_selected) { - font_style_list->select(j); - break; - } - } - } else { - font_style_list->select(-1); - } - - // Get other theme overrides. - font_size_list->set_block_signals(true); - if (same_font_size) { - font_size_list->get_line_edit()->set_text(String::num_uint64(font_size)); - font_size_list->set_value(font_size); - } else { - font_size_list->get_line_edit()->set_text(""); - } - font_size_list->set_block_signals(false); - - outline_size_list->set_block_signals(true); - if (same_outline_size) { - outline_size_list->get_line_edit()->set_text(String::num_uint64(outline_size)); - outline_size_list->set_value(outline_size); - } else { - outline_size_list->get_line_edit()->set_text(""); - } - outline_size_list->set_block_signals(false); - - if (!same_font_color) { - font_color = Color{ 1.0f, 1.0f, 1.0f }; - } - font_color_picker->set_pick_color(font_color); - - if (!same_outline_color) { - outline_color = Color{ 1.0f, 1.0f, 1.0f }; - } - outline_color_picker->set_pick_color(outline_color); - } -} - -void TextControlEditor::_font_selected(int p_id) { - _update_styles_menu(); - _set_font(); -} - -void TextControlEditor::_font_style_selected(int p_id) { - _set_font(); -} - -void TextControlEditor::_set_font() { - if (edited_controls.is_empty()) { - return; - } - - UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo(); - ur->create_action(TTR("Set Font")); - - int count = edited_controls.size(); - for (int i = 0; i < count; ++i) { - Control *edited_control = edited_controls[i]; - - StringName edited_font; - if (Object::cast_to<RichTextLabel>(edited_control)) { - edited_font = SNAME("normal_font"); - } else { - edited_font = SNAME("font"); - } - - if (font_list->get_selected_id() == FONT_INFO_THEME_DEFAULT) { - // Remove font override. - ur->add_do_method(edited_control, "remove_theme_font_override", edited_font); - } else if (font_list->get_selected_id() == FONT_INFO_USER_CUSTOM) { - // Restore "custom_font". - ur->add_do_method(edited_control, "add_theme_font_override", edited_font, custom_font); - } else if (font_list->get_selected() >= 0) { - // Load new font resource using selected name and style. - String name = font_list->get_item_text(font_list->get_selected()); - String style = font_style_list->get_item_text(font_style_list->get_selected()); - if (style.is_empty()) { - style = "Default"; - } - if (fonts.has(name)) { - Ref<FontData> fd = ResourceLoader::load(fonts[name][style]); - if (fd.is_valid()) { - Ref<Font> font; - font.instantiate(); - font->add_data(fd); - ur->add_do_method(edited_control, "add_theme_font_override", edited_font, font); - } - } - } - - if (edited_control->has_theme_font_override(edited_font)) { - ur->add_undo_method(edited_control, "add_theme_font_override", edited_font, edited_control->get_theme_font(edited_font)); - } else { - ur->add_undo_method(edited_control, "remove_theme_font_override", edited_font); - } - } - - ur->add_do_method(this, "_update_control"); - ur->add_undo_method(this, "_update_control"); - - ur->commit_action(); -} - -void TextControlEditor::_font_size_selected(double p_size) { - if (edited_controls.is_empty()) { - return; - } - - UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo(); - ur->create_action(TTR("Set Font Size")); - - int count = edited_controls.size(); - for (int i = 0; i < count; ++i) { - Control *edited_control = edited_controls[i]; - - StringName edited_font_size; - if (Object::cast_to<RichTextLabel>(edited_control)) { - edited_font_size = SNAME("normal_font_size"); - } else { - edited_font_size = SNAME("font_size"); - } - - ur->add_do_method(edited_control, "add_theme_font_size_override", edited_font_size, p_size); - if (edited_control->has_theme_font_size_override(edited_font_size)) { - ur->add_undo_method(edited_control, "add_theme_font_size_override", edited_font_size, edited_control->get_theme_font_size(edited_font_size)); - } else { - ur->add_undo_method(edited_control, "remove_theme_font_size_override", edited_font_size); - } - } - - ur->add_do_method(this, "_update_control"); - ur->add_undo_method(this, "_update_control"); - - ur->commit_action(); -} - -void TextControlEditor::_outline_size_selected(double p_size) { - if (edited_controls.is_empty()) { - return; - } - - UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo(); - ur->create_action(TTR("Set Font Outline Size")); - - int count = edited_controls.size(); - for (int i = 0; i < count; ++i) { - Control *edited_control = edited_controls[i]; - - ur->add_do_method(edited_control, "add_theme_constant_override", "outline_size", p_size); - if (edited_control->has_theme_constant_override("outline_size")) { - ur->add_undo_method(edited_control, "add_theme_constant_override", "outline_size", edited_control->get_theme_constant(SNAME("outline_size"))); - } else { - ur->add_undo_method(edited_control, "remove_theme_constant_override", "outline_size"); - } - } - - ur->add_do_method(this, "_update_control"); - ur->add_undo_method(this, "_update_control"); - - ur->commit_action(); -} - -void TextControlEditor::_font_color_changed(const Color &p_color) { - if (edited_controls.is_empty()) { - return; - } - - UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo(); - ur->create_action(TTR("Set Font Color"), UndoRedo::MERGE_ENDS); - - int count = edited_controls.size(); - for (int i = 0; i < count; ++i) { - Control *edited_control = edited_controls[i]; - - StringName edited_color; - if (Object::cast_to<RichTextLabel>(edited_control)) { - edited_color = SNAME("default_color"); - } else { - edited_color = SNAME("font_color"); - } - - ur->add_do_method(edited_control, "add_theme_color_override", edited_color, p_color); - if (edited_control->has_theme_color_override(edited_color)) { - ur->add_undo_method(edited_control, "add_theme_color_override", edited_color, edited_control->get_theme_color(edited_color)); - } else { - ur->add_undo_method(edited_control, "remove_theme_color_override", edited_color); - } - } - - ur->add_do_method(this, "_update_control"); - ur->add_undo_method(this, "_update_control"); - - ur->commit_action(); -} - -void TextControlEditor::_outline_color_changed(const Color &p_color) { - if (edited_controls.is_empty()) { - return; - } - - UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo(); - ur->create_action(TTR("Set Font Outline Color"), UndoRedo::MERGE_ENDS); - - int count = edited_controls.size(); - for (int i = 0; i < count; ++i) { - Control *edited_control = edited_controls[i]; - - ur->add_do_method(edited_control, "add_theme_color_override", "font_outline_color", p_color); - if (edited_control->has_theme_color_override("font_outline_color")) { - ur->add_undo_method(edited_control, "add_theme_color_override", "font_outline_color", edited_control->get_theme_color(SNAME("font_outline_color"))); - } else { - ur->add_undo_method(edited_control, "remove_theme_color_override", "font_outline_color"); - } - } - - ur->add_do_method(this, "_update_control"); - ur->add_undo_method(this, "_update_control"); - - ur->commit_action(); -} - -void TextControlEditor::_clear_formatting() { - if (edited_controls.is_empty()) { - return; - } - - UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo(); - ur->create_action(TTR("Clear Control Formatting")); - - int count = edited_controls.size(); - for (int i = 0; i < count; ++i) { - Control *edited_control = edited_controls[i]; - - StringName edited_color; - StringName edited_font; - StringName edited_font_size; - - // Get override names. - if (Object::cast_to<RichTextLabel>(edited_control)) { - edited_color = SNAME("default_color"); - edited_font = SNAME("normal_font"); - edited_font_size = SNAME("normal_font_size"); - } else { - edited_color = SNAME("font_color"); - edited_font = SNAME("font"); - edited_font_size = SNAME("font_size"); - } - - ur->add_do_method(edited_control, "begin_bulk_theme_override"); - ur->add_undo_method(edited_control, "begin_bulk_theme_override"); - - ur->add_do_method(edited_control, "remove_theme_font_override", edited_font); - if (edited_control->has_theme_font_override(edited_font)) { - ur->add_undo_method(edited_control, "add_theme_font_override", edited_font, edited_control->get_theme_font(edited_font)); - } - - ur->add_do_method(edited_control, "remove_theme_font_size_override", edited_font_size); - if (edited_control->has_theme_font_size_override(edited_font_size)) { - ur->add_undo_method(edited_control, "add_theme_font_size_override", edited_font_size, edited_control->get_theme_font_size(edited_font_size)); - } - - ur->add_do_method(edited_control, "remove_theme_color_override", edited_color); - if (edited_control->has_theme_color_override(edited_color)) { - ur->add_undo_method(edited_control, "add_theme_color_override", edited_color, edited_control->get_theme_color(edited_color)); - } - - ur->add_do_method(edited_control, "remove_theme_color_override", "font_outline_color"); - if (edited_control->has_theme_color_override("font_outline_color")) { - ur->add_undo_method(edited_control, "add_theme_color_override", "font_outline_color", edited_control->get_theme_color(SNAME("font_outline_color"))); - } - - ur->add_do_method(edited_control, "remove_theme_constant_override", "outline_size"); - if (edited_control->has_theme_constant_override("outline_size")) { - ur->add_undo_method(edited_control, "add_theme_constant_override", "outline_size", edited_control->get_theme_constant(SNAME("outline_size"))); - } - - ur->add_do_method(edited_control, "end_bulk_theme_override"); - ur->add_undo_method(edited_control, "end_bulk_theme_override"); - } - - ur->add_do_method(this, "_update_control"); - ur->add_undo_method(this, "_update_control"); - - ur->commit_action(); -} - -void TextControlEditor::edit(Object *p_object) { - Control *ctrl = Object::cast_to<Control>(p_object); - MultiNodeEdit *multi_node = Object::cast_to<MultiNodeEdit>(p_object); - - edited_controls.clear(); - custom_font = Ref<Font>(); - if (ctrl) { - edited_controls.append(ctrl); - _update_control(); - } else if (multi_node && handles(multi_node)) { - int count = multi_node->get_node_count(); - Node *scene = EditorNode::get_singleton()->get_edited_scene(); - - for (int i = 0; i < count; ++i) { - Control *child = Object::cast_to<Control>(scene->get_node(multi_node->get_node(i))); - edited_controls.append(child); - } - _update_control(); - } -} - -bool TextControlEditor::handles(Object *p_object) const { - Control *ctrl = Object::cast_to<Control>(p_object); - MultiNodeEdit *multi_node = Object::cast_to<MultiNodeEdit>(p_object); - - if (!ctrl && !multi_node) { - return false; - } else if (ctrl) { - bool valid = false; - ctrl->get("text", &valid); - return valid; - } else { - bool valid = true; - int count = multi_node->get_node_count(); - Node *scene = EditorNode::get_singleton()->get_edited_scene(); - - for (int i = 0; i < count; ++i) { - bool temp_valid = false; - Control *child = Object::cast_to<Control>(scene->get_node(multi_node->get_node(i))); - if (child) { - child->get("text", &temp_valid); - } - valid = valid && temp_valid; - - if (!valid) { - break; - } - } - - return valid; - } -} - -TextControlEditor::TextControlEditor() { - add_child(memnew(VSeparator)); - - font_list = memnew(OptionButton); - font_list->set_flat(true); - font_list->set_tooltip(TTR("Font")); - add_child(font_list); - font_list->connect("item_selected", callable_mp(this, &TextControlEditor::_font_selected)); - - font_style_list = memnew(OptionButton); - font_style_list->set_flat(true); - font_style_list->set_tooltip(TTR("Font style")); - font_style_list->set_toggle_mode(true); - add_child(font_style_list); - font_style_list->connect("item_selected", callable_mp(this, &TextControlEditor::_font_style_selected)); - - font_size_list = memnew(SpinBox); - font_size_list->set_tooltip(TTR("Font Size")); - font_size_list->get_line_edit()->add_theme_constant_override("minimum_character_width", 2); - font_size_list->set_min(6); - font_size_list->set_step(1); - font_size_list->set_max(96); - font_size_list->get_line_edit()->set_flat(true); - add_child(font_size_list); - font_size_list->connect("value_changed", callable_mp(this, &TextControlEditor::_font_size_selected)); - - font_color_picker = memnew(ColorPickerButton); - font_color_picker->set_custom_minimum_size(Size2(20, 0) * EDSCALE); - font_color_picker->set_flat(true); - font_color_picker->set_tooltip(TTR("Text Color")); - add_child(font_color_picker); - font_color_picker->connect("color_changed", callable_mp(this, &TextControlEditor::_font_color_changed)); - - add_child(memnew(VSeparator)); - - outline_size_list = memnew(SpinBox); - outline_size_list->set_tooltip(TTR("Outline Size")); - outline_size_list->get_line_edit()->add_theme_constant_override("minimum_character_width", 2); - outline_size_list->set_min(0); - outline_size_list->set_step(1); - outline_size_list->set_max(96); - outline_size_list->get_line_edit()->set_flat(true); - add_child(outline_size_list); - outline_size_list->connect("value_changed", callable_mp(this, &TextControlEditor::_outline_size_selected)); - - outline_color_picker = memnew(ColorPickerButton); - outline_color_picker->set_custom_minimum_size(Size2(20, 0) * EDSCALE); - outline_color_picker->set_flat(true); - outline_color_picker->set_tooltip(TTR("Outline Color")); - add_child(outline_color_picker); - outline_color_picker->connect("color_changed", callable_mp(this, &TextControlEditor::_outline_color_changed)); - - add_child(memnew(VSeparator)); - - clear_formatting = memnew(Button); - clear_formatting->set_flat(true); - clear_formatting->set_tooltip(TTR("Clear Formatting")); - add_child(clear_formatting); - clear_formatting->connect("pressed", callable_mp(this, &TextControlEditor::_clear_formatting)); -} - -/*************************************************************************/ - -void TextControlEditorPlugin::edit(Object *p_object) { - text_ctl_editor->edit(p_object); -} - -bool TextControlEditorPlugin::handles(Object *p_object) const { - return text_ctl_editor->handles(p_object); -} - -void TextControlEditorPlugin::make_visible(bool p_visible) { - if (p_visible) { - text_ctl_editor->show(); - } else { - text_ctl_editor->hide(); - text_ctl_editor->edit(nullptr); - } -} - -TextControlEditorPlugin::TextControlEditorPlugin() { - text_ctl_editor = memnew(TextControlEditor); - CanvasItemEditor::get_singleton()->add_control_to_menu_panel(text_ctl_editor); - - text_ctl_editor->hide(); -} diff --git a/editor/plugins/text_control_editor_plugin.h b/editor/plugins/text_control_editor_plugin.h deleted file mode 100644 index cf069338b6..0000000000 --- a/editor/plugins/text_control_editor_plugin.h +++ /dev/null @@ -1,115 +0,0 @@ -/*************************************************************************/ -/* text_control_editor_plugin.h */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* https://godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur. */ -/* Copyright (c) 2014-2022 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. */ -/*************************************************************************/ - -#ifndef TEXT_CONTROL_EDITOR_PLUGIN_H -#define TEXT_CONTROL_EDITOR_PLUGIN_H - -#include "canvas_item_editor_plugin.h" -#include "editor/editor_file_system.h" -#include "editor/editor_inspector.h" -#include "editor/editor_plugin.h" -#include "scene/gui/color_picker.h" -#include "scene/gui/color_rect.h" -#include "scene/gui/menu_button.h" -#include "scene/gui/option_button.h" -#include "scene/gui/popup_menu.h" - -/*************************************************************************/ - -class TextControlEditor : public HBoxContainer { - GDCLASS(TextControlEditor, HBoxContainer); - - enum FontInfoID { - FONT_INFO_THEME_DEFAULT = 0, - FONT_INFO_USER_CUSTOM = 1, - FONT_INFO_ID = 100, - }; - - HashMap<String, HashMap<String, String>> fonts; - - OptionButton *font_list = nullptr; - SpinBox *font_size_list = nullptr; - OptionButton *font_style_list = nullptr; - ColorPickerButton *font_color_picker = nullptr; - SpinBox *outline_size_list = nullptr; - ColorPickerButton *outline_color_picker = nullptr; - Button *clear_formatting = nullptr; - - Vector<Control *> edited_controls; - Ref<Font> custom_font; - -protected: - void _notification(int p_what); - static void _bind_methods(); - - void _find_resources(EditorFileSystemDirectory *p_dir); - void _reload_fonts(const String &p_path); - - void _update_fonts_menu(); - void _update_styles_menu(); - void _update_control(); - - void _font_selected(int p_id); - void _font_style_selected(int p_id); - void _set_font(); - - void _font_size_selected(double p_size); - void _outline_size_selected(double p_size); - - void _font_color_changed(const Color &p_color); - void _outline_color_changed(const Color &p_color); - - void _clear_formatting(); - -public: - void edit(Object *p_object); - bool handles(Object *p_object) const; - - TextControlEditor(); -}; - -/*************************************************************************/ - -class TextControlEditorPlugin : public EditorPlugin { - GDCLASS(TextControlEditorPlugin, EditorPlugin); - - TextControlEditor *text_ctl_editor = nullptr; - -public: - virtual String get_name() const override { return "TextControlFontEditor"; } - bool has_main_screen() const override { return false; } - virtual void edit(Object *p_object) override; - virtual bool handles(Object *p_object) const override; - virtual void make_visible(bool p_visible) override; - - TextControlEditorPlugin(); -}; - -#endif // TEXT_CONTROL_EDITOR_PLUGIN_H diff --git a/editor/plugins/theme_editor_plugin.cpp b/editor/plugins/theme_editor_plugin.cpp index c7dc61b3a8..b01b90cd08 100644 --- a/editor/plugins/theme_editor_plugin.cpp +++ b/editor/plugins/theme_editor_plugin.cpp @@ -2931,10 +2931,6 @@ void ThemeTypeEditor::_item_remove_cbk(int p_data_type, String p_item_name) { ur->add_undo_method(*edited_theme, "set_font", p_item_name, edited_type, Ref<Font>()); } } break; - case Theme::DATA_TYPE_FONT_SIZE: { - ur->add_do_method(*edited_theme, "clear_font_size", p_item_name, edited_type); - ur->add_undo_method(*edited_theme, "set_font_size", p_item_name, edited_type, edited_theme->get_font_size(p_item_name, edited_type)); - } break; case Theme::DATA_TYPE_ICON: { ur->add_do_method(*edited_theme, "clear_icon", p_item_name, edited_type); if (edited_theme->has_icon(p_item_name, edited_type)) { @@ -3698,7 +3694,7 @@ bool ThemeEditorPlugin::handles(Object *p_node) const { // If we are editing a theme already and this particular resource happens to belong to it, // then we just keep editing it, despite not being able to directly handle it. - // This only goes one layer deep, but if required this can be extended to support, say, FontData inside of Font. + // This only goes one layer deep, but if required this can be extended to support, say, Font inside of Font. bool belongs_to_theme = false; if (Object::cast_to<Font>(p_node)) { diff --git a/editor/plugins/theme_editor_preview.cpp b/editor/plugins/theme_editor_preview.cpp index a6e34cf5e0..826631d750 100644 --- a/editor/plugins/theme_editor_preview.cpp +++ b/editor/plugins/theme_editor_preview.cpp @@ -126,7 +126,7 @@ void ThemeEditorPreview::_draw_picker_overlay() { } Rect2 highlight_label_rect = highlight_rect; - highlight_label_rect.size = theme_cache.preview_picker_font->get_string_size(highlight_name, theme_cache.font_size); + highlight_label_rect.size = theme_cache.preview_picker_font->get_string_size(highlight_name, HORIZONTAL_ALIGNMENT_LEFT, -1, theme_cache.font_size); int margin_top = theme_cache.preview_picker_label->get_margin(SIDE_TOP); int margin_left = theme_cache.preview_picker_label->get_margin(SIDE_LEFT); diff --git a/editor/plugins/tiles/tile_data_editors.cpp b/editor/plugins/tiles/tile_data_editors.cpp index 468681c967..1263ee5758 100644 --- a/editor/plugins/tiles/tile_data_editors.cpp +++ b/editor/plugins/tiles/tile_data_editors.cpp @@ -218,7 +218,7 @@ void GenericTilePolygonEditor::_base_control_draw() { Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label")); int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label")); String text = multiple_polygon_mode ? vformat("%d:%d", tinted_polygon_index, tinted_point_index) : vformat("%d", tinted_point_index); - Size2 text_size = font->get_string_size(text, font_size); + Size2 text_size = font->get_string_size(text, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size); base_control->draw_string(font, xform.xform(polygons[tinted_polygon_index][tinted_point_index]) - text_size * 0.5, text, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, Color(1.0, 1.0, 1.0, 0.5)); } @@ -1116,8 +1116,9 @@ void TileDataDefaultEditor::draw_over_tile(CanvasItem *p_canvas_item, Transform2 } } - Vector2 string_size = font->get_string_size(text, font_size); - p_canvas_item->draw_string(font, p_transform.get_origin() + Vector2i(-string_size.x / 2, string_size.y / 2), text, HORIZONTAL_ALIGNMENT_CENTER, string_size.x, font_size, color, 1, Color(0, 0, 0, 1)); + Vector2 string_size = font->get_string_size(text, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size); + p_canvas_item->draw_string_outline(font, p_transform.get_origin() + Vector2i(-string_size.x / 2, string_size.y / 2), text, HORIZONTAL_ALIGNMENT_CENTER, string_size.x, font_size, 1, Color(0, 0, 0, 1)); + p_canvas_item->draw_string(font, p_transform.get_origin() + Vector2i(-string_size.x / 2, string_size.y / 2), text, HORIZONTAL_ALIGNMENT_CENTER, string_size.x, font_size, color); } } @@ -1727,8 +1728,9 @@ void TileDataTerrainsEditor::forward_draw_over_atlas(TileAtlasView *p_tile_atlas } else { text = "-"; } - Vector2 string_size = font->get_string_size(text, font_size); - p_canvas_item->draw_string(font, p_transform.xform(position) + Vector2i(-string_size.x / 2, string_size.y / 2), text, HORIZONTAL_ALIGNMENT_CENTER, string_size.x, font_size, color, 1, Color(0, 0, 0, 1)); + Vector2 string_size = font->get_string_size(text, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size); + p_canvas_item->draw_string_outline(font, p_transform.xform(position) + Vector2i(-string_size.x / 2, string_size.y / 2), text, HORIZONTAL_ALIGNMENT_CENTER, string_size.x, font_size, 1, Color(0, 0, 0, 1)); + p_canvas_item->draw_string(font, p_transform.xform(position) + Vector2i(-string_size.x / 2, string_size.y / 2), text, HORIZONTAL_ALIGNMENT_CENTER, string_size.x, font_size, color); } } } @@ -1918,8 +1920,9 @@ void TileDataTerrainsEditor::forward_draw_over_alternatives(TileAtlasView *p_til } else { text = "-"; } - Vector2 string_size = font->get_string_size(text, font_size); - p_canvas_item->draw_string(font, p_transform.xform(position) + Vector2i(-string_size.x / 2, string_size.y / 2), text, HORIZONTAL_ALIGNMENT_CENTER, string_size.x, font_size, color, 1, Color(0, 0, 0, 1)); + Vector2 string_size = font->get_string_size(text, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size); + p_canvas_item->draw_string_outline(font, p_transform.xform(position) + Vector2i(-string_size.x / 2, string_size.y / 2), text, HORIZONTAL_ALIGNMENT_CENTER, string_size.x, font_size, 1, Color(0, 0, 0, 1)); + p_canvas_item->draw_string(font, p_transform.xform(position) + Vector2i(-string_size.x / 2, string_size.y / 2), text, HORIZONTAL_ALIGNMENT_CENTER, string_size.x, font_size, color); } } } diff --git a/editor/project_converter_3_to_4.cpp b/editor/project_converter_3_to_4.cpp index 9ed3b72587..654ebf4573 100644 --- a/editor/project_converter_3_to_4.cpp +++ b/editor/project_converter_3_to_4.cpp @@ -1253,7 +1253,7 @@ static const char *class_renames[][2] = { { "AudioStreamRandomPitch", "AudioStreamRandomizer" }, { "BakedLightmap", "LightmapGI" }, { "BakedLightmapData", "LightmapGIData" }, - { "BitmapFont", "Font" }, + { "BitmapFont", "FontFile" }, { "BoneAttachment", "BoneAttachment3D" }, { "BoxShape", "BoxShape3D" }, { "CPUParticles", "CPUParticles3D" }, @@ -1279,8 +1279,8 @@ static const char *class_renames[][2] = { { "CubeMesh", "BoxMesh" }, { "CylinderShape", "CylinderShape3D" }, { "DirectionalLight", "DirectionalLight3D" }, - { "DynamicFont", "Font" }, - { "DynamicFontData", "FontData" }, + { "DynamicFont", "FontFile" }, + { "DynamicFontData", "FontFile" }, { "EditorNavigationMeshGenerator", "NavigationMeshGenerator" }, { "EditorSceneImporter", "EditorSceneFormatImporter" }, { "EditorSceneImporterFBX", "EditorSceneFormatImporterFBX" }, diff --git a/editor/project_export.cpp b/editor/project_export.cpp index 030337a4bc..ac32027219 100644 --- a/editor/project_export.cpp +++ b/editor/project_export.cpp @@ -366,16 +366,17 @@ void ProjectExportDialog::_update_feature_list() { } custom_feature_display->clear(); + String text; bool first = true; for (const String &E : fset) { - String f = E; if (!first) { - f += ", "; + text += ", "; } else { first = false; } - custom_feature_display->add_text(f); + text += E; } + custom_feature_display->add_text(text); } void ProjectExportDialog::_custom_features_changed(const String &p_text) { diff --git a/editor/translations/af.po b/editor/translations/af.po index 00c05287a1..db28610435 100644 --- a/editor/translations/af.po +++ b/editor/translations/af.po @@ -413,6 +413,11 @@ msgstr "" msgid "Command" msgstr "" +#: core/os/input_event.cpp +#, fuzzy +msgid "Physical" +msgstr "Aktiveer" + #: core/os/input_event.cpp scene/2d/touch_screen_button.cpp #: scene/gui/base_button.cpp scene/gui/texture_button.cpp #: scene/resources/default_theme/default_theme.cpp @@ -5556,6 +5561,11 @@ msgid "Mouse Extra Buttons Navigate History" msgstr "" #: editor/editor_settings.cpp +#, fuzzy +msgid "Drag And Drop Selection" +msgstr "Alle Seleksie" + +#: editor/editor_settings.cpp msgid "Appearance" msgstr "" @@ -18703,6 +18713,11 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Custom Build" +msgstr "Anim Dupliseer Sleutels" + +#: platform/android/export/export_plugin.cpp msgid "Use Custom Build" msgstr "" @@ -18711,6 +18726,16 @@ msgstr "" msgid "Export Format" msgstr "Anim Verander Transform" +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Min SDK" +msgstr "Afhanklikheid Bewerker" + +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Target SDK" +msgstr "Skrap" + #: platform/android/export/export_plugin.cpp platform/iphone/export/export.cpp msgid "Architectures" msgstr "" @@ -18747,16 +18772,6 @@ msgstr "" msgid "Code" msgstr "" -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Min SDK" -msgstr "Afhanklikheid Bewerker" - -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Target SDK" -msgstr "Skrap" - #: platform/android/export/export_plugin.cpp platform/uwp/export/export.cpp #, fuzzy msgid "Package" @@ -18994,12 +19009,12 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"\"Hand Tracking\" is only valid when \"Xr Mode\" is \"Oculus Mobile VrApi\" " +"\"Hand Tracking\" is only valid when \"XR Mode\" is \"Oculus Mobile VrApi\" " "or \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Passthrough\" is only valid when \"Xr Mode\" is \"OpenXR\"." +msgid "\"Passthrough\" is only valid when \"XR Mode\" is \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp @@ -19008,17 +19023,37 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Min Sdk\" is only valid when \"Use Custom Build\" is enabled." +"\"Min SDK\" can only be overridden when \"Use Custom Build\" is enabled." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Min SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Min SDK\" cannot be lower than %d, which is the version needed by the " +"Godot library." msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Target Sdk\" is only valid when \"Use Custom Build\" is " -"enabled." +"\"Target SDK\" can only be overridden when \"Use Custom Build\" is enabled." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Target Sdk\" version must be greater or equal to \"Min Sdk\" version." +msgid "" +"\"Target SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Target SDK\" %d is higher than the default version %d. This may work, but " +"wasn't tested and may be unstable." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Target SDK\" version must be greater or equal to \"Min SDK\" version." msgstr "" #: platform/android/export/export_plugin.cpp platform/osx/export/export.cpp @@ -20645,7 +20680,7 @@ msgstr "Zoem In" msgid "Custom Viewport" msgstr "" -#: scene/2d/camera_2d.cpp scene/3d/camera.cpp +#: scene/2d/camera_2d.cpp scene/3d/camera.cpp scene/3d/interpolated_camera.cpp #: scene/animation/animation_player.cpp scene/animation/animation_tree.cpp #: scene/animation/animation_tree_player.cpp scene/main/timer.cpp #, fuzzy @@ -21355,6 +21390,11 @@ msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp #, fuzzy +msgid "Pathfinding" +msgstr "Konstant" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy msgid "Path Desired Distance" msgstr "Installeer" @@ -21363,29 +21403,34 @@ msgid "Target Desired Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Neighbor Dist" +msgid "Path Max Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Max Neighbors" -msgstr "" +#, fuzzy +msgid "Avoidance" +msgstr "Aktiveer" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Time Horizon" +#, fuzzy +msgid "Avoidance Enabled" +msgstr "Aktiveer" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +msgid "Neighbor Dist" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Max Speed" +msgid "Max Neighbors" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Path Max Distance" +msgid "Time Horizon" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -#, fuzzy -msgid "Avoidance Enabled" -msgstr "Aktiveer" +msgid "Max Speed" +msgstr "" #: scene/2d/navigation_agent_2d.cpp msgid "" @@ -24563,6 +24608,11 @@ msgstr "Skep Vouer" #: scene/gui/text_edit.cpp #, fuzzy +msgid "Drag And Drop Selection Enabled" +msgstr "Slegs Seleksie" + +#: scene/gui/text_edit.cpp +#, fuzzy msgid "Hiding Enabled" msgstr "Aktiveer" @@ -24947,16 +24997,17 @@ msgstr "Fokus Pad" #: scene/main/viewport.cpp msgid "" -"This viewport is not set as render target. If you intend for it to display " -"its contents directly to the screen, make it a child of a Control so it can " -"obtain a size. Otherwise, make it a RenderTarget and assign its internal " -"texture to some node for display." +"The Viewport size must be greater than or equal to 2 pixels on both " +"dimensions to render anything." msgstr "" #: scene/main/viewport.cpp msgid "" -"The Viewport size must be greater than or equal to 2 pixels on both " -"dimensions to render anything." +"This Viewport has HDR enabled, but its Usage is set to 2D or 2D No-" +"Sampling.\n" +"HDR is only supported in Viewports that have their Usage set to 3D or 3D No-" +"Effects.\n" +"HDR will be disabled for this Viewport." msgstr "" #: scene/main/viewport.cpp diff --git a/editor/translations/ar.po b/editor/translations/ar.po index f449036b53..93bc2971e8 100644 --- a/editor/translations/ar.po +++ b/editor/translations/ar.po @@ -64,13 +64,14 @@ # ywmaa <ywmaa.personal@gmail.com>, 2022. # Awab Najim <dev.djvan@gmail.com>, 2022. # Abderrahim <abdoudido117@gmail.com>, 2022. +# Jhon Smith <jhonsmaith3@gmail.com>, 2022. msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "Report-Msgid-Bugs-To: https://github.com/godotengine/godot\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2022-06-29 10:04+0000\n" -"Last-Translator: Awab Najim <dev.djvan@gmail.com>\n" +"PO-Revision-Date: 2022-07-05 07:17+0000\n" +"Last-Translator: Jhon Smith <jhonsmaith3@gmail.com>\n" "Language-Team: Arabic <https://hosted.weblate.org/projects/godot-engine/" "godot/ar/>\n" "Language: ar\n" @@ -447,6 +448,11 @@ msgstr "المرجعية الذاتية (Meta)" msgid "Command" msgstr "مفتاح Command" +#: core/os/input_event.cpp +#, fuzzy +msgid "Physical" +msgstr " (فيزيائي)" + #: core/os/input_event.cpp scene/2d/touch_screen_button.cpp #: scene/gui/base_button.cpp scene/gui/texture_button.cpp #: scene/resources/default_theme/default_theme.cpp @@ -5592,6 +5598,11 @@ msgid "Mouse Extra Buttons Navigate History" msgstr "تنقل في سجل أزرار الماوس الإضافية" #: editor/editor_settings.cpp +#, fuzzy +msgid "Drag And Drop Selection" +msgstr "تحديد الملئ خريطة-الشبكة" + +#: editor/editor_settings.cpp msgid "Appearance" msgstr "المظهر" @@ -9672,7 +9683,7 @@ msgstr "الأيقونة" #: editor/plugins/item_list_editor_plugin.cpp msgid "ID" -msgstr "" +msgstr "بطاقة تعريف" #: editor/plugins/item_list_editor_plugin.cpp #: scene/resources/default_theme/default_theme.cpp @@ -10748,11 +10759,11 @@ msgstr "توقف" #: editor/plugins/script_editor_plugin.cpp editor/project_manager.cpp #: editor/script_editor_debugger.cpp msgid "Continue" -msgstr "استمرار" +msgstr "يكمل" #: editor/plugins/script_editor_plugin.cpp msgid "Keep Debugger Open" -msgstr "إبقاء منُقتح الأخطاء البرمجية مفتوحاً" +msgstr "إبقاء المصحح مفتوحًا" #: editor/plugins/script_editor_plugin.cpp msgid "Debug with External Editor" @@ -18844,6 +18855,11 @@ msgid "The package must have at least one '.' separator." msgstr "يجب أن تتضمن الرزمة على الأقل واحد من الفواصل '.' ." #: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Custom Build" +msgstr "قص العُقد" + +#: platform/android/export/export_plugin.cpp msgid "Use Custom Build" msgstr "" @@ -18852,6 +18868,16 @@ msgstr "" msgid "Export Format" msgstr "مسار التصدير" +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Min SDK" +msgstr "حجم الخطوط:" + +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Target SDK" +msgstr "الهدف" + #: platform/android/export/export_plugin.cpp platform/iphone/export/export.cpp #, fuzzy msgid "Architectures" @@ -18895,16 +18921,6 @@ msgstr "تفحص النمذجة السابقة" msgid "Code" msgstr "" -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Min SDK" -msgstr "حجم الخطوط:" - -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Target SDK" -msgstr "الهدف" - #: platform/android/export/export_plugin.cpp platform/uwp/export/export.cpp #, fuzzy msgid "Package" @@ -19164,7 +19180,7 @@ msgstr "يجب تفعيل \"Use Custom Build\" لإستخدام الإضافات #: platform/android/export/export_plugin.cpp #, fuzzy msgid "" -"\"Hand Tracking\" is only valid when \"Xr Mode\" is \"Oculus Mobile VrApi\" " +"\"Hand Tracking\" is only valid when \"XR Mode\" is \"Oculus Mobile VrApi\" " "or \"OpenXR\"." msgstr "" "\"Hand Tracking\" تكون صالحة فقط عندما يكون وضع ال \"Xr Mode\"هو \"Oculus " @@ -19172,7 +19188,7 @@ msgstr "" #: platform/android/export/export_plugin.cpp #, fuzzy -msgid "\"Passthrough\" is only valid when \"Xr Mode\" is \"OpenXR\"." +msgid "\"Passthrough\" is only valid when \"XR Mode\" is \"OpenXR\"." msgstr "" "\"Hand Tracking\" تكون صالحة فقط عندما يكون وضع ال \"Xr Mode\"هو \"Oculus " "Mobile VR\"." @@ -19186,22 +19202,43 @@ msgstr "" #: platform/android/export/export_plugin.cpp #, fuzzy msgid "" -"Changing the \"Min Sdk\" is only valid when \"Use Custom Build\" is enabled." +"\"Min SDK\" can only be overridden when \"Use Custom Build\" is enabled." msgstr "" "يصبح خيار \"تصدير ABB\" صالحاً فقط عندما يتم اختيار \"استعمال تصدير مخصص " "Custom Build\"." #: platform/android/export/export_plugin.cpp +msgid "\"Min SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Min SDK\" cannot be lower than %d, which is the version needed by the " +"Godot library." +msgstr "" + +#: platform/android/export/export_plugin.cpp #, fuzzy msgid "" -"Changing the \"Target Sdk\" is only valid when \"Use Custom Build\" is " -"enabled." +"\"Target SDK\" can only be overridden when \"Use Custom Build\" is enabled." msgstr "" "يصبح خيار \"تصدير ABB\" صالحاً فقط عندما يتم اختيار \"استعمال تصدير مخصص " "Custom Build\"." #: platform/android/export/export_plugin.cpp -msgid "\"Target Sdk\" version must be greater or equal to \"Min Sdk\" version." +msgid "" +"\"Target SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Target SDK\" %d is higher than the default version %d. This may work, but " +"wasn't tested and may be unstable." +msgstr "" + +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "\"Target SDK\" version must be greater or equal to \"Min SDK\" version." msgstr "" "إصدار \"حزمة التطوير البرمجية المستهدفة\" يجب أن يكون أعلى من أو يساوي إصدار " "\"Min Sdk\"." @@ -20874,7 +20911,7 @@ msgstr "تكبير" msgid "Custom Viewport" msgstr "ساحة رؤية واحدة" -#: scene/2d/camera_2d.cpp scene/3d/camera.cpp +#: scene/2d/camera_2d.cpp scene/3d/camera.cpp scene/3d/interpolated_camera.cpp #: scene/animation/animation_player.cpp scene/animation/animation_tree.cpp #: scene/animation/animation_tree_player.cpp scene/main/timer.cpp #, fuzzy @@ -21655,6 +21692,11 @@ msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp #, fuzzy +msgid "Pathfinding" +msgstr "الربط" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy msgid "Path Desired Distance" msgstr "اختر المسافة:" @@ -21663,6 +21705,21 @@ msgid "Target Desired Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Path Max Distance" +msgstr "اختر المسافة:" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Avoidance" +msgstr "إعدادات متقدمة" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Avoidance Enabled" +msgstr "تفعيل" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp msgid "Neighbor Dist" msgstr "" @@ -21680,16 +21737,6 @@ msgstr "القلب أفقياً" msgid "Max Speed" msgstr "السرعة:" -#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -#, fuzzy -msgid "Path Max Distance" -msgstr "اختر المسافة:" - -#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -#, fuzzy -msgid "Avoidance Enabled" -msgstr "تفعيل" - #: scene/2d/navigation_agent_2d.cpp msgid "" "The NavigationAgent2D can be used only under a Node2D inheriting parent node." @@ -25122,6 +25169,11 @@ msgstr "مجلد:" #: scene/gui/text_edit.cpp #, fuzzy +msgid "Drag And Drop Selection Enabled" +msgstr "المحدد فقط" + +#: scene/gui/text_edit.cpp +#, fuzzy msgid "Hiding Enabled" msgstr "تفعيل" @@ -25525,17 +25577,6 @@ msgid "Viewport Path" msgstr "مسار التصدير" #: scene/main/viewport.cpp -msgid "" -"This viewport is not set as render target. If you intend for it to display " -"its contents directly to the screen, make it a child of a Control so it can " -"obtain a size. Otherwise, make it a RenderTarget and assign its internal " -"texture to some node for display." -msgstr "" -"لم يتم تعيين منفذ العرض هذا كهدف عرض. إذا كنت تنوي عرض محتوياته مباشرة على " -"الشاشة ، اجعله تابعًا لعنصر تحكم حتى يتمكن من الحصول على الحجم. خلاف ذلك ، " -"اجعلها RenderTarget وقم بتعيين نسيجها الداخلي لبعض العقد لعرضها." - -#: scene/main/viewport.cpp #, fuzzy msgid "" "The Viewport size must be greater than or equal to 2 pixels on both " @@ -25543,6 +25584,15 @@ msgid "" msgstr "ينبغي أن يكون حجم إطار العرض أكبر من 0 ليتم الإخراج البصري لأي شيء." #: scene/main/viewport.cpp +msgid "" +"This Viewport has HDR enabled, but its Usage is set to 2D or 2D No-" +"Sampling.\n" +"HDR is only supported in Viewports that have their Usage set to 3D or 3D No-" +"Effects.\n" +"HDR will be disabled for this Viewport." +msgstr "" + +#: scene/main/viewport.cpp msgid "ARVR" msgstr "" diff --git a/editor/translations/az.po b/editor/translations/az.po index f8d5d96a7e..3701234f3d 100644 --- a/editor/translations/az.po +++ b/editor/translations/az.po @@ -407,6 +407,11 @@ msgstr "" msgid "Command" msgstr "" +#: core/os/input_event.cpp +#, fuzzy +msgid "Physical" +msgstr "Siqnalları filtirlə" + #: core/os/input_event.cpp scene/2d/touch_screen_button.cpp #: scene/gui/base_button.cpp scene/gui/texture_button.cpp #: scene/resources/default_theme/default_theme.cpp @@ -5396,6 +5401,11 @@ msgid "Mouse Extra Buttons Navigate History" msgstr "" #: editor/editor_settings.cpp +#, fuzzy +msgid "Drag And Drop Selection" +msgstr "Ölçmə seçimi" + +#: editor/editor_settings.cpp msgid "Appearance" msgstr "" @@ -18002,6 +18012,11 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Custom Build" +msgstr "Funksiyalar:" + +#: platform/android/export/export_plugin.cpp msgid "Use Custom Build" msgstr "" @@ -18010,6 +18025,14 @@ msgstr "" msgid "Export Format" msgstr "3D Transformasya izi" +#: platform/android/export/export_plugin.cpp +msgid "Min SDK" +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "Target SDK" +msgstr "" + #: platform/android/export/export_plugin.cpp platform/iphone/export/export.cpp msgid "Architectures" msgstr "" @@ -18046,14 +18069,6 @@ msgstr "" msgid "Code" msgstr "" -#: platform/android/export/export_plugin.cpp -msgid "Min SDK" -msgstr "" - -#: platform/android/export/export_plugin.cpp -msgid "Target SDK" -msgstr "" - #: platform/android/export/export_plugin.cpp platform/uwp/export/export.cpp msgid "Package" msgstr "" @@ -18279,12 +18294,12 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"\"Hand Tracking\" is only valid when \"Xr Mode\" is \"Oculus Mobile VrApi\" " +"\"Hand Tracking\" is only valid when \"XR Mode\" is \"Oculus Mobile VrApi\" " "or \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Passthrough\" is only valid when \"Xr Mode\" is \"OpenXR\"." +msgid "\"Passthrough\" is only valid when \"XR Mode\" is \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp @@ -18293,17 +18308,37 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Min Sdk\" is only valid when \"Use Custom Build\" is enabled." +"\"Min SDK\" can only be overridden when \"Use Custom Build\" is enabled." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Min SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Min SDK\" cannot be lower than %d, which is the version needed by the " +"Godot library." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Target SDK\" can only be overridden when \"Use Custom Build\" is enabled." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Target SDK\" should be a valid integer, but got \"%s\" which is invalid." msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Target Sdk\" is only valid when \"Use Custom Build\" is " -"enabled." +"\"Target SDK\" %d is higher than the default version %d. This may work, but " +"wasn't tested and may be unstable." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Target Sdk\" version must be greater or equal to \"Min Sdk\" version." +msgid "\"Target SDK\" version must be greater or equal to \"Min SDK\" version." msgstr "" #: platform/android/export/export_plugin.cpp platform/osx/export/export.cpp @@ -19848,7 +19883,7 @@ msgstr "Yaxınlaşdır" msgid "Custom Viewport" msgstr "" -#: scene/2d/camera_2d.cpp scene/3d/camera.cpp +#: scene/2d/camera_2d.cpp scene/3d/camera.cpp scene/3d/interpolated_camera.cpp #: scene/animation/animation_player.cpp scene/animation/animation_tree.cpp #: scene/animation/animation_tree_player.cpp scene/main/timer.cpp msgid "Process Mode" @@ -20529,6 +20564,10 @@ msgid "" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +msgid "Pathfinding" +msgstr "" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp #, fuzzy msgid "Path Desired Distance" msgstr "Quraşdır" @@ -20538,29 +20577,34 @@ msgid "Target Desired Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Neighbor Dist" +msgid "Path Max Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Max Neighbors" -msgstr "" +#, fuzzy +msgid "Avoidance" +msgstr "Qabaqcıl" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Time Horizon" +#, fuzzy +msgid "Avoidance Enabled" +msgstr "Siqnalları filtirlə" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +msgid "Neighbor Dist" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Max Speed" +msgid "Max Neighbors" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Path Max Distance" +msgid "Time Horizon" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -#, fuzzy -msgid "Avoidance Enabled" -msgstr "Siqnalları filtirlə" +msgid "Max Speed" +msgstr "" #: scene/2d/navigation_agent_2d.cpp msgid "" @@ -23636,6 +23680,11 @@ msgstr "" #: scene/gui/text_edit.cpp #, fuzzy +msgid "Drag And Drop Selection Enabled" +msgstr "Yalnız Seçim" + +#: scene/gui/text_edit.cpp +#, fuzzy msgid "Hiding Enabled" msgstr "Siqnalları filtirlə" @@ -24002,16 +24051,17 @@ msgstr "Yol" #: scene/main/viewport.cpp msgid "" -"This viewport is not set as render target. If you intend for it to display " -"its contents directly to the screen, make it a child of a Control so it can " -"obtain a size. Otherwise, make it a RenderTarget and assign its internal " -"texture to some node for display." +"The Viewport size must be greater than or equal to 2 pixels on both " +"dimensions to render anything." msgstr "" #: scene/main/viewport.cpp msgid "" -"The Viewport size must be greater than or equal to 2 pixels on both " -"dimensions to render anything." +"This Viewport has HDR enabled, but its Usage is set to 2D or 2D No-" +"Sampling.\n" +"HDR is only supported in Viewports that have their Usage set to 3D or 3D No-" +"Effects.\n" +"HDR will be disabled for this Viewport." msgstr "" #: scene/main/viewport.cpp diff --git a/editor/translations/bg.po b/editor/translations/bg.po index aa0fac6038..105aad00db 100644 --- a/editor/translations/bg.po +++ b/editor/translations/bg.po @@ -431,6 +431,11 @@ msgstr "Мета" msgid "Command" msgstr "Command" +#: core/os/input_event.cpp +#, fuzzy +msgid "Physical" +msgstr "Включване" + #: core/os/input_event.cpp scene/2d/touch_screen_button.cpp #: scene/gui/base_button.cpp scene/gui/texture_button.cpp #: scene/resources/default_theme/default_theme.cpp @@ -5480,6 +5485,11 @@ msgid "Mouse Extra Buttons Navigate History" msgstr "" #: editor/editor_settings.cpp +#, fuzzy +msgid "Drag And Drop Selection" +msgstr "Настройки" + +#: editor/editor_settings.cpp msgid "Appearance" msgstr "" @@ -18343,6 +18353,11 @@ msgid "The package must have at least one '.' separator." msgstr "Пакетът трябва да има поне един разделител „.“ (точка)." #: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Custom Build" +msgstr "Персонализиран обект" + +#: platform/android/export/export_plugin.cpp msgid "Use Custom Build" msgstr "" @@ -18351,6 +18366,16 @@ msgstr "" msgid "Export Format" msgstr "Път за изнасяне" +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Min SDK" +msgstr "Размер на контура:" + +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Target SDK" +msgstr "Принудително изпращане" + #: platform/android/export/export_plugin.cpp platform/iphone/export/export.cpp msgid "Architectures" msgstr "" @@ -18392,16 +18417,6 @@ msgstr "Предишен раздел" msgid "Code" msgstr "" -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Min SDK" -msgstr "Размер на контура:" - -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Target SDK" -msgstr "Принудително изпращане" - #: platform/android/export/export_plugin.cpp platform/uwp/export/export.cpp #, fuzzy msgid "Package" @@ -18647,12 +18662,12 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"\"Hand Tracking\" is only valid when \"Xr Mode\" is \"Oculus Mobile VrApi\" " +"\"Hand Tracking\" is only valid when \"XR Mode\" is \"Oculus Mobile VrApi\" " "or \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Passthrough\" is only valid when \"Xr Mode\" is \"OpenXR\"." +msgid "\"Passthrough\" is only valid when \"XR Mode\" is \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp @@ -18662,22 +18677,45 @@ msgstr "" "собствена компилация“." #: platform/android/export/export_plugin.cpp +#, fuzzy msgid "" -"Changing the \"Min Sdk\" is only valid when \"Use Custom Build\" is enabled." +"\"Min SDK\" can only be overridden when \"Use Custom Build\" is enabled." msgstr "" "„Мин. версия на SDK“ може да се променя само когато „Използване на собствена " "компилация“ е включено." #: platform/android/export/export_plugin.cpp +msgid "\"Min SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Min SDK\" cannot be lower than %d, which is the version needed by the " +"Godot library." +msgstr "" + +#: platform/android/export/export_plugin.cpp +#, fuzzy msgid "" -"Changing the \"Target Sdk\" is only valid when \"Use Custom Build\" is " -"enabled." +"\"Target SDK\" can only be overridden when \"Use Custom Build\" is enabled." msgstr "" "„Целева версия на SDK“ може да се променя само когато „Използване на " "собствена компилация“ е включено." #: platform/android/export/export_plugin.cpp -msgid "\"Target Sdk\" version must be greater or equal to \"Min Sdk\" version." +msgid "" +"\"Target SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Target SDK\" %d is higher than the default version %d. This may work, but " +"wasn't tested and may be unstable." +msgstr "" + +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "\"Target SDK\" version must be greater or equal to \"Min SDK\" version." msgstr "" "„Целева версия на SDK“ трябва да бъде по-голяма или равна на „Мин. версия на " "SDK“." @@ -20333,7 +20371,7 @@ msgstr "Приближаване" msgid "Custom Viewport" msgstr "1 прозорец за изглед" -#: scene/2d/camera_2d.cpp scene/3d/camera.cpp +#: scene/2d/camera_2d.cpp scene/3d/camera.cpp scene/3d/interpolated_camera.cpp #: scene/animation/animation_player.cpp scene/animation/animation_tree.cpp #: scene/animation/animation_tree_player.cpp scene/main/timer.cpp #, fuzzy @@ -21081,6 +21119,11 @@ msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp #, fuzzy +msgid "Pathfinding" +msgstr "Отстъп" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy msgid "Path Desired Distance" msgstr "Изберете главна сцена" @@ -21089,6 +21132,20 @@ msgid "Target Desired Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +msgid "Path Max Distance" +msgstr "" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Avoidance" +msgstr "Включване" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Avoidance Enabled" +msgstr "Включване" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp msgid "Neighbor Dist" msgstr "" @@ -21106,15 +21163,6 @@ msgstr "Хоризонтала:" msgid "Max Speed" msgstr "Скорост:" -#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Path Max Distance" -msgstr "" - -#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -#, fuzzy -msgid "Avoidance Enabled" -msgstr "Включване" - #: scene/2d/navigation_agent_2d.cpp msgid "" "The NavigationAgent2D can be used only under a Node2D inheriting parent node." @@ -24391,6 +24439,11 @@ msgstr "Папка:" #: scene/gui/text_edit.cpp #, fuzzy +msgid "Drag And Drop Selection Enabled" +msgstr "Само избраното" + +#: scene/gui/text_edit.cpp +#, fuzzy msgid "Hiding Enabled" msgstr "Включване" @@ -24788,16 +24841,17 @@ msgstr "Път за изнасяне" #: scene/main/viewport.cpp msgid "" -"This viewport is not set as render target. If you intend for it to display " -"its contents directly to the screen, make it a child of a Control so it can " -"obtain a size. Otherwise, make it a RenderTarget and assign its internal " -"texture to some node for display." +"The Viewport size must be greater than or equal to 2 pixels on both " +"dimensions to render anything." msgstr "" #: scene/main/viewport.cpp msgid "" -"The Viewport size must be greater than or equal to 2 pixels on both " -"dimensions to render anything." +"This Viewport has HDR enabled, but its Usage is set to 2D or 2D No-" +"Sampling.\n" +"HDR is only supported in Viewports that have their Usage set to 3D or 3D No-" +"Effects.\n" +"HDR will be disabled for this Viewport." msgstr "" #: scene/main/viewport.cpp diff --git a/editor/translations/bn.po b/editor/translations/bn.po index b3c338168c..0e99518ac1 100644 --- a/editor/translations/bn.po +++ b/editor/translations/bn.po @@ -421,6 +421,11 @@ msgstr "" msgid "Command" msgstr "সম্প্রদায়" +#: core/os/input_event.cpp +#, fuzzy +msgid "Physical" +msgstr "স্থির/বদ্ধ ফ্রেম %" + #: core/os/input_event.cpp scene/2d/touch_screen_button.cpp #: scene/gui/base_button.cpp scene/gui/texture_button.cpp #: scene/resources/default_theme/default_theme.cpp @@ -5807,6 +5812,11 @@ msgid "Mouse Extra Buttons Navigate History" msgstr "" #: editor/editor_settings.cpp +#, fuzzy +msgid "Drag And Drop Selection" +msgstr "নির্বাচিত সমূহ অপসারণ করুন" + +#: editor/editor_settings.cpp msgid "Appearance" msgstr "" @@ -19778,6 +19788,11 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Custom Build" +msgstr "নোড-সমূহ কর্তন/কাট করুন" + +#: platform/android/export/export_plugin.cpp msgid "Use Custom Build" msgstr "" @@ -19786,6 +19801,16 @@ msgstr "" msgid "Export Format" msgstr "এক্সপোর্টের প্রিসেট:" +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Min SDK" +msgstr "প্রান্তরেখার আকার:" + +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Target SDK" +msgstr "টার্গেট" + #: platform/android/export/export_plugin.cpp platform/iphone/export/export.cpp msgid "Architectures" msgstr "" @@ -19827,16 +19852,6 @@ msgstr "পূর্ববর্তী ইন্সট্যান্স পর msgid "Code" msgstr "" -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Min SDK" -msgstr "প্রান্তরেখার আকার:" - -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Target SDK" -msgstr "টার্গেট" - #: platform/android/export/export_plugin.cpp platform/uwp/export/export.cpp #, fuzzy msgid "Package" @@ -20083,12 +20098,12 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"\"Hand Tracking\" is only valid when \"Xr Mode\" is \"Oculus Mobile VrApi\" " +"\"Hand Tracking\" is only valid when \"XR Mode\" is \"Oculus Mobile VrApi\" " "or \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Passthrough\" is only valid when \"Xr Mode\" is \"OpenXR\"." +msgid "\"Passthrough\" is only valid when \"XR Mode\" is \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp @@ -20097,17 +20112,37 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Min Sdk\" is only valid when \"Use Custom Build\" is enabled." +"\"Min SDK\" can only be overridden when \"Use Custom Build\" is enabled." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Min SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Min SDK\" cannot be lower than %d, which is the version needed by the " +"Godot library." msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Target Sdk\" is only valid when \"Use Custom Build\" is " -"enabled." +"\"Target SDK\" can only be overridden when \"Use Custom Build\" is enabled." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Target Sdk\" version must be greater or equal to \"Min Sdk\" version." +msgid "" +"\"Target SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Target SDK\" %d is higher than the default version %d. This may work, but " +"wasn't tested and may be unstable." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Target SDK\" version must be greater or equal to \"Min SDK\" version." msgstr "" #: platform/android/export/export_plugin.cpp platform/osx/export/export.cpp @@ -21776,7 +21811,7 @@ msgstr "সম্প্রসারিত করুন (জুম্ ইন)" msgid "Custom Viewport" msgstr "১ টি Viewport" -#: scene/2d/camera_2d.cpp scene/3d/camera.cpp +#: scene/2d/camera_2d.cpp scene/3d/camera.cpp scene/3d/interpolated_camera.cpp #: scene/animation/animation_player.cpp scene/animation/animation_tree.cpp #: scene/animation/animation_tree_player.cpp scene/main/timer.cpp #, fuzzy @@ -22535,6 +22570,11 @@ msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp #, fuzzy +msgid "Pathfinding" +msgstr "যথেচ্ছ ঘূর্ণায়ন:" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy msgid "Path Desired Distance" msgstr "ইন্সট্যান্স:" @@ -22543,6 +22583,21 @@ msgid "Target Desired Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Path Max Distance" +msgstr "ইন্সট্যান্স:" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Avoidance" +msgstr "অ্যানিমেশনের সিদ্ধান্তসমূহ" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Avoidance Enabled" +msgstr "সক্রিয় করুন" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp msgid "Neighbor Dist" msgstr "" @@ -22559,16 +22614,6 @@ msgstr "" msgid "Max Speed" msgstr "গতি (FPS):" -#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -#, fuzzy -msgid "Path Max Distance" -msgstr "ইন্সট্যান্স:" - -#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -#, fuzzy -msgid "Avoidance Enabled" -msgstr "সক্রিয় করুন" - #: scene/2d/navigation_agent_2d.cpp msgid "" "The NavigationAgent2D can be used only under a Node2D inheriting parent node." @@ -25926,6 +25971,11 @@ msgstr "লাইন-এ যান" #: scene/gui/text_edit.cpp #, fuzzy +msgid "Drag And Drop Selection Enabled" +msgstr "শুধুমাত্র নির্বাচিতসমূহ" + +#: scene/gui/text_edit.cpp +#, fuzzy msgid "Hiding Enabled" msgstr "সক্রিয় করুন" @@ -26327,20 +26377,17 @@ msgstr "এক্সপোর্টের প্রিসেট:" #: scene/main/viewport.cpp msgid "" -"This viewport is not set as render target. If you intend for it to display " -"its contents directly to the screen, make it a child of a Control so it can " -"obtain a size. Otherwise, make it a RenderTarget and assign its internal " -"texture to some node for display." +"The Viewport size must be greater than or equal to 2 pixels on both " +"dimensions to render anything." msgstr "" -"এই viewport টি render target হিসেবে নির্ধারন করা নেই। আপনি যদি এর বস্তু-সামগ্রী " -"সরাসরি পর্দায় দেখাতে চান, এটিকে যেকোনো Control এর অংশভূত করুন যেনো এটি একটি " -"আকার ধারণ করতে পারে। অন্যথায়, এটিকে একটি RenderTarget করুন এবং এর অভ্যন্তরীণ " -"দৃশ্যাবলিকে (texture) দৃশ্যমান করতে কোনো নোডে হস্তান্তর করুন।" #: scene/main/viewport.cpp msgid "" -"The Viewport size must be greater than or equal to 2 pixels on both " -"dimensions to render anything." +"This Viewport has HDR enabled, but its Usage is set to 2D or 2D No-" +"Sampling.\n" +"HDR is only supported in Viewports that have their Usage set to 3D or 3D No-" +"Effects.\n" +"HDR will be disabled for this Viewport." msgstr "" #: scene/main/viewport.cpp diff --git a/editor/translations/br.po b/editor/translations/br.po index c5d979fe2f..101a0f7581 100644 --- a/editor/translations/br.po +++ b/editor/translations/br.po @@ -397,6 +397,11 @@ msgstr "" msgid "Command" msgstr "" +#: core/os/input_event.cpp +#, fuzzy +msgid "Physical" +msgstr "Aktivañ ar Roudenn" + #: core/os/input_event.cpp scene/2d/touch_screen_button.cpp #: scene/gui/base_button.cpp scene/gui/texture_button.cpp #: scene/resources/default_theme/default_theme.cpp @@ -5305,6 +5310,10 @@ msgid "Mouse Extra Buttons Navigate History" msgstr "" #: editor/editor_settings.cpp +msgid "Drag And Drop Selection" +msgstr "" + +#: editor/editor_settings.cpp msgid "Appearance" msgstr "" @@ -17814,6 +17823,11 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Custom Build" +msgstr "Fonksionoù :" + +#: platform/android/export/export_plugin.cpp msgid "Use Custom Build" msgstr "" @@ -17822,6 +17836,14 @@ msgstr "" msgid "Export Format" msgstr "Roudenn Treuzfurmadur 3D" +#: platform/android/export/export_plugin.cpp +msgid "Min SDK" +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "Target SDK" +msgstr "" + #: platform/android/export/export_plugin.cpp platform/iphone/export/export.cpp msgid "Architectures" msgstr "" @@ -17858,14 +17880,6 @@ msgstr "" msgid "Code" msgstr "" -#: platform/android/export/export_plugin.cpp -msgid "Min SDK" -msgstr "" - -#: platform/android/export/export_plugin.cpp -msgid "Target SDK" -msgstr "" - #: platform/android/export/export_plugin.cpp platform/uwp/export/export.cpp msgid "Package" msgstr "" @@ -18088,12 +18102,12 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"\"Hand Tracking\" is only valid when \"Xr Mode\" is \"Oculus Mobile VrApi\" " +"\"Hand Tracking\" is only valid when \"XR Mode\" is \"Oculus Mobile VrApi\" " "or \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Passthrough\" is only valid when \"Xr Mode\" is \"OpenXR\"." +msgid "\"Passthrough\" is only valid when \"XR Mode\" is \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp @@ -18102,17 +18116,37 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Min Sdk\" is only valid when \"Use Custom Build\" is enabled." +"\"Min SDK\" can only be overridden when \"Use Custom Build\" is enabled." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Min SDK\" should be a valid integer, but got \"%s\" which is invalid." msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Target Sdk\" is only valid when \"Use Custom Build\" is " -"enabled." +"\"Min SDK\" cannot be lower than %d, which is the version needed by the " +"Godot library." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Target Sdk\" version must be greater or equal to \"Min Sdk\" version." +msgid "" +"\"Target SDK\" can only be overridden when \"Use Custom Build\" is enabled." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Target SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Target SDK\" %d is higher than the default version %d. This may work, but " +"wasn't tested and may be unstable." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Target SDK\" version must be greater or equal to \"Min SDK\" version." msgstr "" #: platform/android/export/export_plugin.cpp platform/osx/export/export.cpp @@ -19639,7 +19673,7 @@ msgstr "" msgid "Custom Viewport" msgstr "" -#: scene/2d/camera_2d.cpp scene/3d/camera.cpp +#: scene/2d/camera_2d.cpp scene/3d/camera.cpp scene/3d/interpolated_camera.cpp #: scene/animation/animation_player.cpp scene/animation/animation_tree.cpp #: scene/animation/animation_tree_player.cpp scene/main/timer.cpp msgid "Process Mode" @@ -20311,6 +20345,10 @@ msgid "" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +msgid "Pathfinding" +msgstr "" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp msgid "Path Desired Distance" msgstr "" @@ -20319,29 +20357,34 @@ msgid "Target Desired Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Neighbor Dist" +msgid "Path Max Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Max Neighbors" -msgstr "" +#, fuzzy +msgid "Avoidance" +msgstr "Aktivañ ar Roudenn" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Time Horizon" +#, fuzzy +msgid "Avoidance Enabled" +msgstr "Aktivañ ar Roudenn" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +msgid "Neighbor Dist" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Max Speed" +msgid "Max Neighbors" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Path Max Distance" +msgid "Time Horizon" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -#, fuzzy -msgid "Avoidance Enabled" -msgstr "Aktivañ ar Roudenn" +msgid "Max Speed" +msgstr "" #: scene/2d/navigation_agent_2d.cpp msgid "" @@ -23379,6 +23422,11 @@ msgstr "" #: scene/gui/text_edit.cpp #, fuzzy +msgid "Drag And Drop Selection Enabled" +msgstr "Aktivañ ar Roudenn" + +#: scene/gui/text_edit.cpp +#, fuzzy msgid "Hiding Enabled" msgstr "Aktivañ ar Roudenn" @@ -23737,16 +23785,17 @@ msgstr "" #: scene/main/viewport.cpp msgid "" -"This viewport is not set as render target. If you intend for it to display " -"its contents directly to the screen, make it a child of a Control so it can " -"obtain a size. Otherwise, make it a RenderTarget and assign its internal " -"texture to some node for display." +"The Viewport size must be greater than or equal to 2 pixels on both " +"dimensions to render anything." msgstr "" #: scene/main/viewport.cpp msgid "" -"The Viewport size must be greater than or equal to 2 pixels on both " -"dimensions to render anything." +"This Viewport has HDR enabled, but its Usage is set to 2D or 2D No-" +"Sampling.\n" +"HDR is only supported in Viewports that have their Usage set to 3D or 3D No-" +"Effects.\n" +"HDR will be disabled for this Viewport." msgstr "" #: scene/main/viewport.cpp diff --git a/editor/translations/ca.po b/editor/translations/ca.po index 1e1ec84901..c9726505d3 100644 --- a/editor/translations/ca.po +++ b/editor/translations/ca.po @@ -409,6 +409,11 @@ msgstr "Meta" msgid "Command" msgstr "Comunitat" +#: core/os/input_event.cpp +#, fuzzy +msgid "Physical" +msgstr "Fotograma de Física %" + #: core/os/input_event.cpp scene/2d/touch_screen_button.cpp #: scene/gui/base_button.cpp scene/gui/texture_button.cpp #: scene/resources/default_theme/default_theme.cpp @@ -5616,6 +5621,11 @@ msgid "Mouse Extra Buttons Navigate History" msgstr "" #: editor/editor_settings.cpp +#, fuzzy +msgid "Drag And Drop Selection" +msgstr "Elimina la Selecció del GridMap" + +#: editor/editor_settings.cpp msgid "Appearance" msgstr "" @@ -19209,6 +19219,11 @@ msgid "The package must have at least one '.' separator." msgstr "El paquet ha de tenir com a mínim un separador '. '." #: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Custom Build" +msgstr "Talla els Nodes" + +#: platform/android/export/export_plugin.cpp msgid "Use Custom Build" msgstr "" @@ -19217,6 +19232,16 @@ msgstr "" msgid "Export Format" msgstr "Camí d'exportació" +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Min SDK" +msgstr "Mida del Contorn:" + +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Target SDK" +msgstr "Objectiu" + #: platform/android/export/export_plugin.cpp platform/iphone/export/export.cpp #, fuzzy msgid "Architectures" @@ -19259,16 +19284,6 @@ msgstr "Inspecciona la Instància anterior" msgid "Code" msgstr "" -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Min SDK" -msgstr "Mida del Contorn:" - -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Target SDK" -msgstr "Objectiu" - #: platform/android/export/export_plugin.cpp platform/uwp/export/export.cpp #, fuzzy msgid "Package" @@ -19523,12 +19538,12 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"\"Hand Tracking\" is only valid when \"Xr Mode\" is \"Oculus Mobile VrApi\" " +"\"Hand Tracking\" is only valid when \"XR Mode\" is \"Oculus Mobile VrApi\" " "or \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Passthrough\" is only valid when \"Xr Mode\" is \"OpenXR\"." +msgid "\"Passthrough\" is only valid when \"XR Mode\" is \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp @@ -19537,17 +19552,37 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Min Sdk\" is only valid when \"Use Custom Build\" is enabled." +"\"Min SDK\" can only be overridden when \"Use Custom Build\" is enabled." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Min SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Min SDK\" cannot be lower than %d, which is the version needed by the " +"Godot library." msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Target Sdk\" is only valid when \"Use Custom Build\" is " -"enabled." +"\"Target SDK\" can only be overridden when \"Use Custom Build\" is enabled." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Target Sdk\" version must be greater or equal to \"Min Sdk\" version." +msgid "" +"\"Target SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Target SDK\" %d is higher than the default version %d. This may work, but " +"wasn't tested and may be unstable." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Target SDK\" version must be greater or equal to \"Min SDK\" version." msgstr "" #: platform/android/export/export_plugin.cpp platform/osx/export/export.cpp @@ -21234,7 +21269,7 @@ msgstr "Apropa" msgid "Custom Viewport" msgstr "1 Vista" -#: scene/2d/camera_2d.cpp scene/3d/camera.cpp +#: scene/2d/camera_2d.cpp scene/3d/camera.cpp scene/3d/interpolated_camera.cpp #: scene/animation/animation_player.cpp scene/animation/animation_tree.cpp #: scene/animation/animation_tree_player.cpp scene/main/timer.cpp #, fuzzy @@ -22001,6 +22036,11 @@ msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp #, fuzzy +msgid "Pathfinding" +msgstr "Vinculació" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy msgid "Path Desired Distance" msgstr "Trieu la distància:" @@ -22009,6 +22049,21 @@ msgid "Target Desired Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Path Max Distance" +msgstr "Trieu la distància:" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Avoidance" +msgstr "Avançat" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Avoidance Enabled" +msgstr "Activar" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp msgid "Neighbor Dist" msgstr "" @@ -22026,16 +22081,6 @@ msgstr "Volteja Horitzontalment" msgid "Max Speed" msgstr "Velocitat (FPS):" -#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -#, fuzzy -msgid "Path Max Distance" -msgstr "Trieu la distància:" - -#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -#, fuzzy -msgid "Avoidance Enabled" -msgstr "Activar" - #: scene/2d/navigation_agent_2d.cpp msgid "" "The NavigationAgent2D can be used only under a Node2D inheriting parent node." @@ -25451,6 +25496,11 @@ msgstr "Directori:" #: scene/gui/text_edit.cpp #, fuzzy +msgid "Drag And Drop Selection Enabled" +msgstr "Selecció Només" + +#: scene/gui/text_edit.cpp +#, fuzzy msgid "Hiding Enabled" msgstr "Activar" @@ -25858,20 +25908,17 @@ msgstr "Camí d'exportació" #: scene/main/viewport.cpp msgid "" -"This viewport is not set as render target. If you intend for it to display " -"its contents directly to the screen, make it a child of a Control so it can " -"obtain a size. Otherwise, make it a RenderTarget and assign its internal " -"texture to some node for display." +"The Viewport size must be greater than or equal to 2 pixels on both " +"dimensions to render anything." msgstr "" -"La Vista (Viewport) no és la Destinació de Renderització (render target). " -"Per mostrar-ne el contingut, especifiqueu-la com a filla d'un Control de " -"forma per tal d'obtenir-ne la mida. Altrament, establiu-la com a Destinació " -"de Renderització i assigneu-ne la textura interna a algun node." #: scene/main/viewport.cpp msgid "" -"The Viewport size must be greater than or equal to 2 pixels on both " -"dimensions to render anything." +"This Viewport has HDR enabled, but its Usage is set to 2D or 2D No-" +"Sampling.\n" +"HDR is only supported in Viewports that have their Usage set to 3D or 3D No-" +"Effects.\n" +"HDR will be disabled for this Viewport." msgstr "" #: scene/main/viewport.cpp diff --git a/editor/translations/cs.po b/editor/translations/cs.po index ade3299077..0c0b8b63ca 100644 --- a/editor/translations/cs.po +++ b/editor/translations/cs.po @@ -452,6 +452,11 @@ msgstr "" msgid "Command" msgstr "Komunita" +#: core/os/input_event.cpp +#, fuzzy +msgid "Physical" +msgstr "Fyzická Klávesa" + #: core/os/input_event.cpp scene/2d/touch_screen_button.cpp #: scene/gui/base_button.cpp scene/gui/texture_button.cpp #: scene/resources/default_theme/default_theme.cpp @@ -5667,6 +5672,11 @@ msgid "Mouse Extra Buttons Navigate History" msgstr "" #: editor/editor_settings.cpp +#, fuzzy +msgid "Drag And Drop Selection" +msgstr "GridMap Vyplnit výběr" + +#: editor/editor_settings.cpp msgid "Appearance" msgstr "" @@ -18952,6 +18962,11 @@ msgid "The package must have at least one '.' separator." msgstr "Balíček musí mít alespoň jeden '.' oddělovač." #: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Custom Build" +msgstr "Vyjmout uzly" + +#: platform/android/export/export_plugin.cpp msgid "Use Custom Build" msgstr "" @@ -18960,6 +18975,16 @@ msgstr "" msgid "Export Format" msgstr "Exportovat cestu" +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Min SDK" +msgstr "Velikost obrysu:" + +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Target SDK" +msgstr "Cíl" + #: platform/android/export/export_plugin.cpp platform/iphone/export/export.cpp #, fuzzy msgid "Architectures" @@ -19002,16 +19027,6 @@ msgstr "Zkontrolovat předchozí instanci" msgid "Code" msgstr "" -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Min SDK" -msgstr "Velikost obrysu:" - -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Target SDK" -msgstr "Cíl" - #: platform/android/export/export_plugin.cpp platform/uwp/export/export.cpp #, fuzzy msgid "Package" @@ -19261,7 +19276,7 @@ msgstr "" #: platform/android/export/export_plugin.cpp #, fuzzy msgid "" -"\"Hand Tracking\" is only valid when \"Xr Mode\" is \"Oculus Mobile VrApi\" " +"\"Hand Tracking\" is only valid when \"XR Mode\" is \"Oculus Mobile VrApi\" " "or \"OpenXR\"." msgstr "" "\"Hand Tracking\" je platné pouze v případě, že \"Režim Xr\" má hodnotu " @@ -19269,7 +19284,7 @@ msgstr "" #: platform/android/export/export_plugin.cpp #, fuzzy -msgid "\"Passthrough\" is only valid when \"Xr Mode\" is \"OpenXR\"." +msgid "\"Passthrough\" is only valid when \"XR Mode\" is \"OpenXR\"." msgstr "" "\"Hand Tracking\" je platné pouze v případě, že \"Režim Xr\" má hodnotu " "\"Oculus Mobile VR\"." @@ -19283,22 +19298,42 @@ msgstr "" #: platform/android/export/export_plugin.cpp #, fuzzy msgid "" -"Changing the \"Min Sdk\" is only valid when \"Use Custom Build\" is enabled." +"\"Min SDK\" can only be overridden when \"Use Custom Build\" is enabled." msgstr "" "\"Export AAB\" je validní pouze v případě, že je povolena možnost \"Použít " "vlastní sestavu\"." #: platform/android/export/export_plugin.cpp +msgid "\"Min SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Min SDK\" cannot be lower than %d, which is the version needed by the " +"Godot library." +msgstr "" + +#: platform/android/export/export_plugin.cpp #, fuzzy msgid "" -"Changing the \"Target Sdk\" is only valid when \"Use Custom Build\" is " -"enabled." +"\"Target SDK\" can only be overridden when \"Use Custom Build\" is enabled." msgstr "" "\"Export AAB\" je validní pouze v případě, že je povolena možnost \"Použít " "vlastní sestavu\"." #: platform/android/export/export_plugin.cpp -msgid "\"Target Sdk\" version must be greater or equal to \"Min Sdk\" version." +msgid "" +"\"Target SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Target SDK\" %d is higher than the default version %d. This may work, but " +"wasn't tested and may be unstable." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Target SDK\" version must be greater or equal to \"Min SDK\" version." msgstr "" #: platform/android/export/export_plugin.cpp platform/osx/export/export.cpp @@ -20968,7 +21003,7 @@ msgstr "Zvětšit" msgid "Custom Viewport" msgstr "1 výřez" -#: scene/2d/camera_2d.cpp scene/3d/camera.cpp +#: scene/2d/camera_2d.cpp scene/3d/camera.cpp scene/3d/interpolated_camera.cpp #: scene/animation/animation_player.cpp scene/animation/animation_tree.cpp #: scene/animation/animation_tree_player.cpp scene/main/timer.cpp #, fuzzy @@ -21736,6 +21771,11 @@ msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp #, fuzzy +msgid "Pathfinding" +msgstr "Vazba" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy msgid "Path Desired Distance" msgstr "Vybrat vzdálenost:" @@ -21744,6 +21784,21 @@ msgid "Target Desired Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Path Max Distance" +msgstr "Vybrat vzdálenost:" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Avoidance" +msgstr "Pokročilé" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Avoidance Enabled" +msgstr "Povolit" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp msgid "Neighbor Dist" msgstr "" @@ -21761,16 +21816,6 @@ msgstr "Převrátit horizontálně" msgid "Max Speed" msgstr "Rychlost:" -#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -#, fuzzy -msgid "Path Max Distance" -msgstr "Vybrat vzdálenost:" - -#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -#, fuzzy -msgid "Avoidance Enabled" -msgstr "Povolit" - #: scene/2d/navigation_agent_2d.cpp msgid "" "The NavigationAgent2D can be used only under a Node2D inheriting parent node." @@ -25180,6 +25225,11 @@ msgstr "Složka:" #: scene/gui/text_edit.cpp #, fuzzy +msgid "Drag And Drop Selection Enabled" +msgstr "Pouze výběr" + +#: scene/gui/text_edit.cpp +#, fuzzy msgid "Hiding Enabled" msgstr "Povolit" @@ -25585,18 +25635,6 @@ msgid "Viewport Path" msgstr "Exportovat cestu" #: scene/main/viewport.cpp -msgid "" -"This viewport is not set as render target. If you intend for it to display " -"its contents directly to the screen, make it a child of a Control so it can " -"obtain a size. Otherwise, make it a RenderTarget and assign its internal " -"texture to some node for display." -msgstr "" -"Tento viewport není nastaven jako render target. Pokud chcete jeho obsah " -"zobrazit přímo na obrazovku, musíte ho nastavit jako dítě uzlu Control, aby " -"mohl získat velikost. Jinak ho nastavte jako render target a přiřaďte jeho " -"vnitřní texturu nějakému uzlu k zobrazení." - -#: scene/main/viewport.cpp #, fuzzy msgid "" "The Viewport size must be greater than or equal to 2 pixels on both " @@ -25605,6 +25643,15 @@ msgstr "" "Velikost pohledu musí být větší než 0, aby bylo možné cokoliv renderovat." #: scene/main/viewport.cpp +msgid "" +"This Viewport has HDR enabled, but its Usage is set to 2D or 2D No-" +"Sampling.\n" +"HDR is only supported in Viewports that have their Usage set to 3D or 3D No-" +"Effects.\n" +"HDR will be disabled for this Viewport." +msgstr "" + +#: scene/main/viewport.cpp msgid "ARVR" msgstr "" diff --git a/editor/translations/da.po b/editor/translations/da.po index 168f98fbf1..3b19f24ec8 100644 --- a/editor/translations/da.po +++ b/editor/translations/da.po @@ -423,6 +423,11 @@ msgstr "" msgid "Command" msgstr "Fællesskab" +#: core/os/input_event.cpp +#, fuzzy +msgid "Physical" +msgstr "Fysik Frame %" + #: core/os/input_event.cpp scene/2d/touch_screen_button.cpp #: scene/gui/base_button.cpp scene/gui/texture_button.cpp #: scene/resources/default_theme/default_theme.cpp @@ -5720,6 +5725,11 @@ msgid "Mouse Extra Buttons Navigate History" msgstr "" #: editor/editor_settings.cpp +#, fuzzy +msgid "Drag And Drop Selection" +msgstr "GridMap Slet Markerede" + +#: editor/editor_settings.cpp msgid "Appearance" msgstr "" @@ -19157,6 +19167,11 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Custom Build" +msgstr "Indsæt Node" + +#: platform/android/export/export_plugin.cpp msgid "Use Custom Build" msgstr "" @@ -19165,6 +19180,16 @@ msgstr "" msgid "Export Format" msgstr "Eksporter Projekt" +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Min SDK" +msgstr "Skrifttype Størrelse:" + +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Target SDK" +msgstr "Tidsskala Node" + #: platform/android/export/export_plugin.cpp platform/iphone/export/export.cpp msgid "Architectures" msgstr "" @@ -19203,16 +19228,6 @@ msgstr "Forrige fane" msgid "Code" msgstr "" -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Min SDK" -msgstr "Skrifttype Størrelse:" - -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Target SDK" -msgstr "Tidsskala Node" - #: platform/android/export/export_plugin.cpp platform/uwp/export/export.cpp #, fuzzy msgid "Package" @@ -19458,12 +19473,12 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"\"Hand Tracking\" is only valid when \"Xr Mode\" is \"Oculus Mobile VrApi\" " +"\"Hand Tracking\" is only valid when \"XR Mode\" is \"Oculus Mobile VrApi\" " "or \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Passthrough\" is only valid when \"Xr Mode\" is \"OpenXR\"." +msgid "\"Passthrough\" is only valid when \"XR Mode\" is \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp @@ -19472,17 +19487,37 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Min Sdk\" is only valid when \"Use Custom Build\" is enabled." +"\"Min SDK\" can only be overridden when \"Use Custom Build\" is enabled." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Min SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Min SDK\" cannot be lower than %d, which is the version needed by the " +"Godot library." msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Target Sdk\" is only valid when \"Use Custom Build\" is " -"enabled." +"\"Target SDK\" can only be overridden when \"Use Custom Build\" is enabled." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Target Sdk\" version must be greater or equal to \"Min Sdk\" version." +msgid "" +"\"Target SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Target SDK\" %d is higher than the default version %d. This may work, but " +"wasn't tested and may be unstable." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Target SDK\" version must be greater or equal to \"Min SDK\" version." msgstr "" #: platform/android/export/export_plugin.cpp platform/osx/export/export.cpp @@ -21142,7 +21177,7 @@ msgstr "Zoom Ind" msgid "Custom Viewport" msgstr "" -#: scene/2d/camera_2d.cpp scene/3d/camera.cpp +#: scene/2d/camera_2d.cpp scene/3d/camera.cpp scene/3d/interpolated_camera.cpp #: scene/animation/animation_player.cpp scene/animation/animation_tree.cpp #: scene/animation/animation_tree_player.cpp scene/main/timer.cpp #, fuzzy @@ -21875,6 +21910,11 @@ msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp #, fuzzy +msgid "Pathfinding" +msgstr "Konstant" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy msgid "Path Desired Distance" msgstr "Vælg en Main Scene" @@ -21883,29 +21923,34 @@ msgid "Target Desired Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Neighbor Dist" +msgid "Path Max Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Max Neighbors" -msgstr "" +#, fuzzy +msgid "Avoidance" +msgstr "Balanceret" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Time Horizon" +#, fuzzy +msgid "Avoidance Enabled" +msgstr "Aktivér" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +msgid "Neighbor Dist" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Max Speed" +msgid "Max Neighbors" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Path Max Distance" +msgid "Time Horizon" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -#, fuzzy -msgid "Avoidance Enabled" -msgstr "Aktivér" +msgid "Max Speed" +msgstr "" #: scene/2d/navigation_agent_2d.cpp msgid "" @@ -25177,6 +25222,11 @@ msgstr "Opret Mappe" #: scene/gui/text_edit.cpp #, fuzzy +msgid "Drag And Drop Selection Enabled" +msgstr "Kun Valgte" + +#: scene/gui/text_edit.cpp +#, fuzzy msgid "Hiding Enabled" msgstr "Aktivér" @@ -25572,20 +25622,17 @@ msgstr "Eksporter Projekt" #: scene/main/viewport.cpp msgid "" -"This viewport is not set as render target. If you intend for it to display " -"its contents directly to the screen, make it a child of a Control so it can " -"obtain a size. Otherwise, make it a RenderTarget and assign its internal " -"texture to some node for display." +"The Viewport size must be greater than or equal to 2 pixels on both " +"dimensions to render anything." msgstr "" -"Denne viewport er ikke angivet som render target. Hvis du har tænkt dig for " -"at vise dens indhold direkte til skærmen, gør det til et barn af Control, så " -"den kan opnå en størrelse. Ellers gør den til en RenderTarget og tildel dens " -"indre textur til en node så den kan vises." #: scene/main/viewport.cpp msgid "" -"The Viewport size must be greater than or equal to 2 pixels on both " -"dimensions to render anything." +"This Viewport has HDR enabled, but its Usage is set to 2D or 2D No-" +"Sampling.\n" +"HDR is only supported in Viewports that have their Usage set to 3D or 3D No-" +"Effects.\n" +"HDR will be disabled for this Viewport." msgstr "" #: scene/main/viewport.cpp diff --git a/editor/translations/de.po b/editor/translations/de.po index 61cfb48184..f0c79cda0f 100644 --- a/editor/translations/de.po +++ b/editor/translations/de.po @@ -87,7 +87,7 @@ msgstr "" "Project-Id-Version: Godot Engine editor\n" "Report-Msgid-Bugs-To: https://github.com/godotengine/godot\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2022-06-26 16:16+0000\n" +"PO-Revision-Date: 2022-06-30 16:42+0000\n" "Last-Translator: So Wieso <sowieso@dukun.de>\n" "Language-Team: German <https://hosted.weblate.org/projects/godot-engine/" "godot/de/>\n" @@ -465,6 +465,11 @@ msgstr "Meta" msgid "Command" msgstr "Befehl" +#: core/os/input_event.cpp +#, fuzzy +msgid "Physical" +msgstr " (physisch)" + #: core/os/input_event.cpp scene/2d/touch_screen_button.cpp #: scene/gui/base_button.cpp scene/gui/texture_button.cpp #: scene/resources/default_theme/default_theme.cpp @@ -5555,6 +5560,11 @@ msgid "Mouse Extra Buttons Navigate History" msgstr "Extramaustasten blättern durch Verlauf" #: editor/editor_settings.cpp +#, fuzzy +msgid "Drag And Drop Selection" +msgstr "GridMap-Auswahl" + +#: editor/editor_settings.cpp msgid "Appearance" msgstr "Aussehen" @@ -18439,6 +18449,11 @@ msgid "The package must have at least one '.' separator." msgstr "Das Paket muss mindestens einen Punkt-Unterteiler ‚.‘ haben." #: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Custom Build" +msgstr "Einen Build verwenden" + +#: platform/android/export/export_plugin.cpp msgid "Use Custom Build" msgstr "Einen Build verwenden" @@ -18446,6 +18461,14 @@ msgstr "Einen Build verwenden" msgid "Export Format" msgstr "Exportformat" +#: platform/android/export/export_plugin.cpp +msgid "Min SDK" +msgstr "Min SDK" + +#: platform/android/export/export_plugin.cpp +msgid "Target SDK" +msgstr "Ziel SDK" + #: platform/android/export/export_plugin.cpp platform/iphone/export/export.cpp msgid "Architectures" msgstr "Architekturen" @@ -18482,14 +18505,6 @@ msgstr "Vorherige Installation löschen" msgid "Code" msgstr "Code" -#: platform/android/export/export_plugin.cpp -msgid "Min SDK" -msgstr "Min SDK" - -#: platform/android/export/export_plugin.cpp -msgid "Target SDK" -msgstr "Ziel SDK" - #: platform/android/export/export_plugin.cpp platform/uwp/export/export.cpp msgid "Package" msgstr "Packet" @@ -18728,15 +18743,17 @@ msgstr "" "„Use Custom Build“ muss aktiviert werden um die Plugins nutzen zu können." #: platform/android/export/export_plugin.cpp +#, fuzzy msgid "" -"\"Hand Tracking\" is only valid when \"Xr Mode\" is \"Oculus Mobile VrApi\" " +"\"Hand Tracking\" is only valid when \"XR Mode\" is \"Oculus Mobile VrApi\" " "or \"OpenXR\"." msgstr "" "„Hand Tracking“ ist nur gültig wenn „Xr Mode“ als „Occulus Mobile VrApi“ " "oder „OpenXR“ gesetzt wurde." #: platform/android/export/export_plugin.cpp -msgid "\"Passthrough\" is only valid when \"Xr Mode\" is \"OpenXR\"." +#, fuzzy +msgid "\"Passthrough\" is only valid when \"XR Mode\" is \"OpenXR\"." msgstr "" "„Passthrough“ ist nur gültig wenn „Xr Mode“ als „OpenXR“ gesetzt wurde." @@ -18745,22 +18762,45 @@ msgid "\"Export AAB\" is only valid when \"Use Custom Build\" is enabled." msgstr "„Export AAB“ ist nur gültig wenn „Use Custom Build“ aktiviert ist." #: platform/android/export/export_plugin.cpp +#, fuzzy msgid "" -"Changing the \"Min Sdk\" is only valid when \"Use Custom Build\" is enabled." +"\"Min SDK\" can only be overridden when \"Use Custom Build\" is enabled." msgstr "" "Das „Min Sdk“ zu ändern ist nur möglich wenn „Use Custom Build“ aktiviert " "ist." #: platform/android/export/export_plugin.cpp +msgid "\"Min SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Min SDK\" cannot be lower than %d, which is the version needed by the " +"Godot library." +msgstr "" + +#: platform/android/export/export_plugin.cpp +#, fuzzy msgid "" -"Changing the \"Target Sdk\" is only valid when \"Use Custom Build\" is " -"enabled." +"\"Target SDK\" can only be overridden when \"Use Custom Build\" is enabled." msgstr "" "Das „Target Sdk“ zu ändern ist nur möglich wenn „Use Custom Build“ aktiviert " "ist." #: platform/android/export/export_plugin.cpp -msgid "\"Target Sdk\" version must be greater or equal to \"Min Sdk\" version." +msgid "" +"\"Target SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Target SDK\" %d is higher than the default version %d. This may work, but " +"wasn't tested and may be unstable." +msgstr "" + +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "\"Target SDK\" version must be greater or equal to \"Min SDK\" version." msgstr "" "Die Version des „Target Sdk“ muss größer gleich der des „Min Sdk“ sein." @@ -20354,7 +20394,7 @@ msgstr "Vergrößerung" msgid "Custom Viewport" msgstr "Eigenes Ansichtsfenster" -#: scene/2d/camera_2d.cpp scene/3d/camera.cpp +#: scene/2d/camera_2d.cpp scene/3d/camera.cpp scene/3d/interpolated_camera.cpp #: scene/animation/animation_player.cpp scene/animation/animation_tree.cpp #: scene/animation/animation_tree_player.cpp scene/main/timer.cpp msgid "Process Mode" @@ -21048,17 +21088,37 @@ msgid "" "will be removed in a future version. Use 'Navigation2DServer.map_get_path()' " "instead." msgstr "" +"‚Navigation2D‘ und ‚Navigation2D.get_simple_path()‘ sind veraltet und werden " +"in einer zukünftigen Version entfernt. Als Ersatz ist ‚Navigation2DServer." +"map_get_path()‘ zu verwenden." #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp #, fuzzy +msgid "Pathfinding" +msgstr "Zuordnung" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp msgid "Path Desired Distance" -msgstr "Gewünschte Zieldistanz" +msgstr "Gewünschte Pfaddistanz" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp msgid "Target Desired Distance" msgstr "Gewünschte Zieldistanz" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +msgid "Path Max Distance" +msgstr "Max Pfad-Distanz" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Avoidance" +msgstr "Erweitert" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +msgid "Avoidance Enabled" +msgstr "Vermeiden aktiviert" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp msgid "Neighbor Dist" msgstr "Nachbardistanz" @@ -21074,14 +21134,6 @@ msgstr "Zeithorizont" msgid "Max Speed" msgstr "Max Geschw" -#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Path Max Distance" -msgstr "Max Pfad-Distanz" - -#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Avoidance Enabled" -msgstr "Vermeiden aktiviert" - #: scene/2d/navigation_agent_2d.cpp msgid "" "The NavigationAgent2D can be used only under a Node2D inheriting parent node." @@ -22217,6 +22269,9 @@ msgid "" "be removed in a future version. Use 'NavigationServer.map_get_path()' " "instead." msgstr "" +"‚Navigation‘ und ‚Navigation.get_simple_path()‘ sind veraltet und werden in " +"einer zukünftigen Version entfernt. Als Ersatz ist ‚NavigationServer." +"map_get_path()‘ zu verwenden." #: scene/3d/navigation.cpp scene/resources/curve.cpp msgid "Up Vector" @@ -24158,6 +24213,11 @@ msgid "Fold Gutter" msgstr "Einklappenspalte" #: scene/gui/text_edit.cpp +#, fuzzy +msgid "Drag And Drop Selection Enabled" +msgstr "Textauswahl möglich" + +#: scene/gui/text_edit.cpp msgid "Hiding Enabled" msgstr "Verstecken aktiviert" @@ -24518,19 +24578,6 @@ msgstr "Ansichtsfensterpfad" #: scene/main/viewport.cpp msgid "" -"This viewport is not set as render target. If you intend for it to display " -"its contents directly to the screen, make it a child of a Control so it can " -"obtain a size. Otherwise, make it a RenderTarget and assign its internal " -"texture to some node for display." -msgstr "" -"Dieser Viewport ist nicht als Render-Ziel eingestellt. Soll sein Inhalt " -"direkt auf dem Bildschirm angezeigt werden, muss er als Unterobjekt eines " -"Controls eingehängt werden um dessen Größe zu erben. Andernfalls sollte die " -"Eigenschaft ‚Render Target‘ des Viewports aktiviert und seine Textur " -"irgendeinem Node zum Anzeigen zugewiesen werden." - -#: scene/main/viewport.cpp -msgid "" "The Viewport size must be greater than or equal to 2 pixels on both " "dimensions to render anything." msgstr "" @@ -24538,6 +24585,15 @@ msgstr "" "betragen um überhaupt irgendetwas rendern zu können." #: scene/main/viewport.cpp +msgid "" +"This Viewport has HDR enabled, but its Usage is set to 2D or 2D No-" +"Sampling.\n" +"HDR is only supported in Viewports that have their Usage set to 3D or 3D No-" +"Effects.\n" +"HDR will be disabled for this Viewport." +msgstr "" + +#: scene/main/viewport.cpp msgid "ARVR" msgstr "ARVR" @@ -26045,14 +26101,12 @@ msgid "Walkable Low Height Spans" msgstr "Ablaufbare Abstände niedriger Höhe" #: scene/resources/navigation_mesh.cpp -#, fuzzy msgid "Baking AABB" -msgstr "Erzeuge AABB" +msgstr "Backe AABB" #: scene/resources/navigation_mesh.cpp -#, fuzzy msgid "Baking AABB Offset" -msgstr "Grundversatz" +msgstr "Backe AABB-Versatz" #: scene/resources/occluder_shape.cpp msgid "Spheres" diff --git a/editor/translations/editor.pot b/editor/translations/editor.pot index 2682db8c4b..5d2d5f1cbc 100644 --- a/editor/translations/editor.pot +++ b/editor/translations/editor.pot @@ -380,6 +380,10 @@ msgstr "" msgid "Command" msgstr "" +#: core/os/input_event.cpp +msgid "Physical" +msgstr "" + #: core/os/input_event.cpp scene/2d/touch_screen_button.cpp #: scene/gui/base_button.cpp scene/gui/texture_button.cpp #: scene/resources/default_theme/default_theme.cpp @@ -5244,6 +5248,10 @@ msgid "Mouse Extra Buttons Navigate History" msgstr "" #: editor/editor_settings.cpp +msgid "Drag And Drop Selection" +msgstr "" + +#: editor/editor_settings.cpp msgid "Appearance" msgstr "" @@ -17666,6 +17674,10 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export_plugin.cpp +msgid "Custom Build" +msgstr "" + +#: platform/android/export/export_plugin.cpp msgid "Use Custom Build" msgstr "" @@ -17673,6 +17685,14 @@ msgstr "" msgid "Export Format" msgstr "" +#: platform/android/export/export_plugin.cpp +msgid "Min SDK" +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "Target SDK" +msgstr "" + #: platform/android/export/export_plugin.cpp platform/iphone/export/export.cpp msgid "Architectures" msgstr "" @@ -17709,14 +17729,6 @@ msgstr "" msgid "Code" msgstr "" -#: platform/android/export/export_plugin.cpp -msgid "Min SDK" -msgstr "" - -#: platform/android/export/export_plugin.cpp -msgid "Target SDK" -msgstr "" - #: platform/android/export/export_plugin.cpp platform/uwp/export/export.cpp msgid "Package" msgstr "" @@ -17934,12 +17946,12 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"\"Hand Tracking\" is only valid when \"Xr Mode\" is \"Oculus Mobile VrApi\" " +"\"Hand Tracking\" is only valid when \"XR Mode\" is \"Oculus Mobile VrApi\" " "or \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Passthrough\" is only valid when \"Xr Mode\" is \"OpenXR\"." +msgid "\"Passthrough\" is only valid when \"XR Mode\" is \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp @@ -17948,17 +17960,37 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Min Sdk\" is only valid when \"Use Custom Build\" is enabled." +"\"Min SDK\" can only be overridden when \"Use Custom Build\" is enabled." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Min SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Min SDK\" cannot be lower than %d, which is the version needed by the " +"Godot library." msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Target Sdk\" is only valid when \"Use Custom Build\" is " -"enabled." +"\"Target SDK\" can only be overridden when \"Use Custom Build\" is enabled." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Target Sdk\" version must be greater or equal to \"Min Sdk\" version." +msgid "" +"\"Target SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Target SDK\" %d is higher than the default version %d. This may work, but " +"wasn't tested and may be unstable." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Target SDK\" version must be greater or equal to \"Min SDK\" version." msgstr "" #: platform/android/export/export_plugin.cpp platform/osx/export/export.cpp @@ -19460,7 +19492,7 @@ msgstr "" msgid "Custom Viewport" msgstr "" -#: scene/2d/camera_2d.cpp scene/3d/camera.cpp +#: scene/2d/camera_2d.cpp scene/3d/camera.cpp scene/3d/interpolated_camera.cpp #: scene/animation/animation_player.cpp scene/animation/animation_tree.cpp #: scene/animation/animation_tree_player.cpp scene/main/timer.cpp msgid "Process Mode" @@ -20122,6 +20154,10 @@ msgid "" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +msgid "Pathfinding" +msgstr "" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp msgid "Path Desired Distance" msgstr "" @@ -20130,27 +20166,31 @@ msgid "Target Desired Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Neighbor Dist" +msgid "Path Max Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Max Neighbors" +msgid "Avoidance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Time Horizon" +msgid "Avoidance Enabled" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Max Speed" +msgid "Neighbor Dist" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Path Max Distance" +msgid "Max Neighbors" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Avoidance Enabled" +msgid "Time Horizon" +msgstr "" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +msgid "Max Speed" msgstr "" #: scene/2d/navigation_agent_2d.cpp @@ -23074,6 +23114,10 @@ msgid "Fold Gutter" msgstr "" #: scene/gui/text_edit.cpp +msgid "Drag And Drop Selection Enabled" +msgstr "" + +#: scene/gui/text_edit.cpp msgid "Hiding Enabled" msgstr "" @@ -23425,16 +23469,17 @@ msgstr "" #: scene/main/viewport.cpp msgid "" -"This viewport is not set as render target. If you intend for it to display " -"its contents directly to the screen, make it a child of a Control so it can " -"obtain a size. Otherwise, make it a RenderTarget and assign its internal " -"texture to some node for display." +"The Viewport size must be greater than or equal to 2 pixels on both " +"dimensions to render anything." msgstr "" #: scene/main/viewport.cpp msgid "" -"The Viewport size must be greater than or equal to 2 pixels on both " -"dimensions to render anything." +"This Viewport has HDR enabled, but its Usage is set to 2D or 2D No-" +"Sampling.\n" +"HDR is only supported in Viewports that have their Usage set to 3D or 3D No-" +"Effects.\n" +"HDR will be disabled for this Viewport." msgstr "" #: scene/main/viewport.cpp diff --git a/editor/translations/el.po b/editor/translations/el.po index 21f118d442..a061cc5a59 100644 --- a/editor/translations/el.po +++ b/editor/translations/el.po @@ -411,6 +411,11 @@ msgstr "Meta" msgid "Command" msgstr "Command" +#: core/os/input_event.cpp +#, fuzzy +msgid "Physical" +msgstr " (Φυσικό)" + #: core/os/input_event.cpp scene/2d/touch_screen_button.cpp #: scene/gui/base_button.cpp scene/gui/texture_button.cpp #: scene/resources/default_theme/default_theme.cpp @@ -5649,6 +5654,11 @@ msgid "Mouse Extra Buttons Navigate History" msgstr "" #: editor/editor_settings.cpp +#, fuzzy +msgid "Drag And Drop Selection" +msgstr "GridMap Γέμισμα Επιλογής" + +#: editor/editor_settings.cpp msgid "Appearance" msgstr "" @@ -19116,6 +19126,11 @@ msgid "The package must have at least one '.' separator." msgstr "Το πακέτο πρέπει να έχει τουλάχιστον έναν '.' διαχωριστή." #: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Custom Build" +msgstr "Αποκοπή κόμβων" + +#: platform/android/export/export_plugin.cpp msgid "Use Custom Build" msgstr "" @@ -19124,6 +19139,16 @@ msgstr "" msgid "Export Format" msgstr "Διαδρομή Εξαγωγής" +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Min SDK" +msgstr "Μέγεθος περιγράμματος:" + +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Target SDK" +msgstr "Στόχος" + #: platform/android/export/export_plugin.cpp platform/iphone/export/export.cpp #, fuzzy msgid "Architectures" @@ -19166,16 +19191,6 @@ msgstr "Επιθεώρηση του προηγούμενου στιγμιοτύ msgid "Code" msgstr "" -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Min SDK" -msgstr "Μέγεθος περιγράμματος:" - -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Target SDK" -msgstr "Στόχος" - #: platform/android/export/export_plugin.cpp platform/uwp/export/export.cpp #, fuzzy msgid "Package" @@ -19437,7 +19452,7 @@ msgstr "" #: platform/android/export/export_plugin.cpp #, fuzzy msgid "" -"\"Hand Tracking\" is only valid when \"Xr Mode\" is \"Oculus Mobile VrApi\" " +"\"Hand Tracking\" is only valid when \"XR Mode\" is \"Oculus Mobile VrApi\" " "or \"OpenXR\"." msgstr "" "Το «Hand Tracking» είναι έγκυρο μόνο όταν το «Xr Mode» είναι «Oculus Mobile " @@ -19445,7 +19460,7 @@ msgstr "" #: platform/android/export/export_plugin.cpp #, fuzzy -msgid "\"Passthrough\" is only valid when \"Xr Mode\" is \"OpenXR\"." +msgid "\"Passthrough\" is only valid when \"XR Mode\" is \"OpenXR\"." msgstr "" "Το «Hand Tracking» είναι έγκυρο μόνο όταν το «Xr Mode» είναι «Oculus Mobile " "VR»." @@ -19456,17 +19471,37 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Min Sdk\" is only valid when \"Use Custom Build\" is enabled." +"\"Min SDK\" can only be overridden when \"Use Custom Build\" is enabled." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Min SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Min SDK\" cannot be lower than %d, which is the version needed by the " +"Godot library." msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Target Sdk\" is only valid when \"Use Custom Build\" is " -"enabled." +"\"Target SDK\" can only be overridden when \"Use Custom Build\" is enabled." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Target Sdk\" version must be greater or equal to \"Min Sdk\" version." +msgid "" +"\"Target SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Target SDK\" %d is higher than the default version %d. This may work, but " +"wasn't tested and may be unstable." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Target SDK\" version must be greater or equal to \"Min SDK\" version." msgstr "" #: platform/android/export/export_plugin.cpp platform/osx/export/export.cpp @@ -21143,7 +21178,7 @@ msgstr "Μεγέθυνση" msgid "Custom Viewport" msgstr "1 Οπτική γωνία" -#: scene/2d/camera_2d.cpp scene/3d/camera.cpp +#: scene/2d/camera_2d.cpp scene/3d/camera.cpp scene/3d/interpolated_camera.cpp #: scene/animation/animation_player.cpp scene/animation/animation_tree.cpp #: scene/animation/animation_tree_player.cpp scene/main/timer.cpp #, fuzzy @@ -21914,6 +21949,11 @@ msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp #, fuzzy +msgid "Pathfinding" +msgstr "Δεσμός" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy msgid "Path Desired Distance" msgstr "Επιλογή απόστασης:" @@ -21922,6 +21962,21 @@ msgid "Target Desired Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Path Max Distance" +msgstr "Επιλογή απόστασης:" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Avoidance" +msgstr "Για προχωρημένους" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Avoidance Enabled" +msgstr "Ενεργοποίηση" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp msgid "Neighbor Dist" msgstr "" @@ -21939,16 +21994,6 @@ msgstr "Αναστροφή Οριζόντια" msgid "Max Speed" msgstr "Ταχύτητα:" -#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -#, fuzzy -msgid "Path Max Distance" -msgstr "Επιλογή απόστασης:" - -#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -#, fuzzy -msgid "Avoidance Enabled" -msgstr "Ενεργοποίηση" - #: scene/2d/navigation_agent_2d.cpp msgid "" "The NavigationAgent2D can be used only under a Node2D inheriting parent node." @@ -25376,6 +25421,11 @@ msgstr "Φάκελος:" #: scene/gui/text_edit.cpp #, fuzzy +msgid "Drag And Drop Selection Enabled" +msgstr "Μόνο στην επιλογή" + +#: scene/gui/text_edit.cpp +#, fuzzy msgid "Hiding Enabled" msgstr "Ενεργοποίηση" @@ -25781,18 +25831,6 @@ msgid "Viewport Path" msgstr "Διαδρομή Εξαγωγής" #: scene/main/viewport.cpp -msgid "" -"This viewport is not set as render target. If you intend for it to display " -"its contents directly to the screen, make it a child of a Control so it can " -"obtain a size. Otherwise, make it a RenderTarget and assign its internal " -"texture to some node for display." -msgstr "" -"Το Viewport δεν έχει ορισθεί ως στόχος απόδοσης. Αν σκοπεύετε να δείχνει τα " -"περιεχόμενα του, κάντε το να κληρονομεί ένα Control, ώστε να αποκτήσει " -"μέγεθος. Αλλιώς, κάντε το ένα RenderTarget και ορίστε το internal texture σε " -"έναν κόμβο για απεικόνιση." - -#: scene/main/viewport.cpp #, fuzzy msgid "" "The Viewport size must be greater than or equal to 2 pixels on both " @@ -25802,6 +25840,15 @@ msgstr "" "απόδοση." #: scene/main/viewport.cpp +msgid "" +"This Viewport has HDR enabled, but its Usage is set to 2D or 2D No-" +"Sampling.\n" +"HDR is only supported in Viewports that have their Usage set to 3D or 3D No-" +"Effects.\n" +"HDR will be disabled for this Viewport." +msgstr "" + +#: scene/main/viewport.cpp msgid "ARVR" msgstr "" diff --git a/editor/translations/en_Shaw.po b/editor/translations/en_Shaw.po index bf2aa9d387..1f648844a2 100644 --- a/editor/translations/en_Shaw.po +++ b/editor/translations/en_Shaw.po @@ -391,6 +391,11 @@ msgstr "" msgid "Command" msgstr "" +#: core/os/input_event.cpp +#, fuzzy +msgid "Physical" +msgstr "𐑑𐑪𐑜𐑩𐑤 𐑑𐑮𐑨𐑒 𐑦𐑯𐑱𐑚𐑩𐑤𐑛" + #: core/os/input_event.cpp scene/2d/touch_screen_button.cpp #: scene/gui/base_button.cpp scene/gui/texture_button.cpp #: scene/resources/default_theme/default_theme.cpp @@ -5271,6 +5276,10 @@ msgid "Mouse Extra Buttons Navigate History" msgstr "" #: editor/editor_settings.cpp +msgid "Drag And Drop Selection" +msgstr "" + +#: editor/editor_settings.cpp msgid "Appearance" msgstr "" @@ -17739,6 +17748,11 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Custom Build" +msgstr "𐑓𐑳𐑙𐑒𐑖𐑩𐑯𐑟:" + +#: platform/android/export/export_plugin.cpp msgid "Use Custom Build" msgstr "" @@ -17747,6 +17761,14 @@ msgstr "" msgid "Export Format" msgstr "3-𐑛 𐑑𐑮𐑨𐑯𐑕𐑓𐑹𐑥 𐑑𐑮𐑨𐑒" +#: platform/android/export/export_plugin.cpp +msgid "Min SDK" +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "Target SDK" +msgstr "" + #: platform/android/export/export_plugin.cpp platform/iphone/export/export.cpp msgid "Architectures" msgstr "" @@ -17783,14 +17805,6 @@ msgstr "" msgid "Code" msgstr "" -#: platform/android/export/export_plugin.cpp -msgid "Min SDK" -msgstr "" - -#: platform/android/export/export_plugin.cpp -msgid "Target SDK" -msgstr "" - #: platform/android/export/export_plugin.cpp platform/uwp/export/export.cpp msgid "Package" msgstr "" @@ -18012,12 +18026,12 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"\"Hand Tracking\" is only valid when \"Xr Mode\" is \"Oculus Mobile VrApi\" " +"\"Hand Tracking\" is only valid when \"XR Mode\" is \"Oculus Mobile VrApi\" " "or \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Passthrough\" is only valid when \"Xr Mode\" is \"OpenXR\"." +msgid "\"Passthrough\" is only valid when \"XR Mode\" is \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp @@ -18026,17 +18040,37 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Min Sdk\" is only valid when \"Use Custom Build\" is enabled." +"\"Min SDK\" can only be overridden when \"Use Custom Build\" is enabled." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Min SDK\" should be a valid integer, but got \"%s\" which is invalid." msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Target Sdk\" is only valid when \"Use Custom Build\" is " -"enabled." +"\"Min SDK\" cannot be lower than %d, which is the version needed by the " +"Godot library." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Target Sdk\" version must be greater or equal to \"Min Sdk\" version." +msgid "" +"\"Target SDK\" can only be overridden when \"Use Custom Build\" is enabled." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Target SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Target SDK\" %d is higher than the default version %d. This may work, but " +"wasn't tested and may be unstable." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Target SDK\" version must be greater or equal to \"Min SDK\" version." msgstr "" #: platform/android/export/export_plugin.cpp platform/osx/export/export.cpp @@ -19556,7 +19590,7 @@ msgstr "" msgid "Custom Viewport" msgstr "" -#: scene/2d/camera_2d.cpp scene/3d/camera.cpp +#: scene/2d/camera_2d.cpp scene/3d/camera.cpp scene/3d/interpolated_camera.cpp #: scene/animation/animation_player.cpp scene/animation/animation_tree.cpp #: scene/animation/animation_tree_player.cpp scene/main/timer.cpp msgid "Process Mode" @@ -20224,6 +20258,10 @@ msgid "" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +msgid "Pathfinding" +msgstr "" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp msgid "Path Desired Distance" msgstr "" @@ -20232,29 +20270,34 @@ msgid "Target Desired Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Neighbor Dist" +msgid "Path Max Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Max Neighbors" -msgstr "" +#, fuzzy +msgid "Avoidance" +msgstr "𐑑𐑪𐑜𐑩𐑤 𐑑𐑮𐑨𐑒 𐑦𐑯𐑱𐑚𐑩𐑤𐑛" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Time Horizon" +#, fuzzy +msgid "Avoidance Enabled" +msgstr "𐑑𐑪𐑜𐑩𐑤 𐑑𐑮𐑨𐑒 𐑦𐑯𐑱𐑚𐑩𐑤𐑛" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +msgid "Neighbor Dist" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Max Speed" +msgid "Max Neighbors" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Path Max Distance" +msgid "Time Horizon" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -#, fuzzy -msgid "Avoidance Enabled" -msgstr "𐑑𐑪𐑜𐑩𐑤 𐑑𐑮𐑨𐑒 𐑦𐑯𐑱𐑚𐑩𐑤𐑛" +msgid "Max Speed" +msgstr "" #: scene/2d/navigation_agent_2d.cpp msgid "" @@ -23269,6 +23312,11 @@ msgstr "" #: scene/gui/text_edit.cpp #, fuzzy +msgid "Drag And Drop Selection Enabled" +msgstr "𐑑𐑪𐑜𐑩𐑤 𐑑𐑮𐑨𐑒 𐑦𐑯𐑱𐑚𐑩𐑤𐑛" + +#: scene/gui/text_edit.cpp +#, fuzzy msgid "Hiding Enabled" msgstr "𐑑𐑪𐑜𐑩𐑤 𐑑𐑮𐑨𐑒 𐑦𐑯𐑱𐑚𐑩𐑤𐑛" @@ -23626,16 +23674,17 @@ msgstr "" #: scene/main/viewport.cpp msgid "" -"This viewport is not set as render target. If you intend for it to display " -"its contents directly to the screen, make it a child of a Control so it can " -"obtain a size. Otherwise, make it a RenderTarget and assign its internal " -"texture to some node for display." +"The Viewport size must be greater than or equal to 2 pixels on both " +"dimensions to render anything." msgstr "" #: scene/main/viewport.cpp msgid "" -"The Viewport size must be greater than or equal to 2 pixels on both " -"dimensions to render anything." +"This Viewport has HDR enabled, but its Usage is set to 2D or 2D No-" +"Sampling.\n" +"HDR is only supported in Viewports that have their Usage set to 3D or 3D No-" +"Effects.\n" +"HDR will be disabled for this Viewport." msgstr "" #: scene/main/viewport.cpp diff --git a/editor/translations/eo.po b/editor/translations/eo.po index 27aeb13ce0..2eef4fc0d0 100644 --- a/editor/translations/eo.po +++ b/editor/translations/eo.po @@ -431,6 +431,11 @@ msgstr "" msgid "Command" msgstr "Komunumo" +#: core/os/input_event.cpp +#, fuzzy +msgid "Physical" +msgstr "Fiziko-kadro %" + #: core/os/input_event.cpp scene/2d/touch_screen_button.cpp #: scene/gui/base_button.cpp scene/gui/texture_button.cpp #: scene/resources/default_theme/default_theme.cpp @@ -5642,6 +5647,11 @@ msgid "Mouse Extra Buttons Navigate History" msgstr "" #: editor/editor_settings.cpp +#, fuzzy +msgid "Drag And Drop Selection" +msgstr "Enkadrigi elekton" + +#: editor/editor_settings.cpp msgid "Appearance" msgstr "" @@ -18811,6 +18821,11 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Custom Build" +msgstr "Eltondi nodo(j)n" + +#: platform/android/export/export_plugin.cpp msgid "Use Custom Build" msgstr "" @@ -18819,6 +18834,16 @@ msgstr "" msgid "Export Format" msgstr "Formo" +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Min SDK" +msgstr "Grando de konturo:" + +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Target SDK" +msgstr "Celo" + #: platform/android/export/export_plugin.cpp platform/iphone/export/export.cpp msgid "Architectures" msgstr "" @@ -18858,16 +18883,6 @@ msgstr "Inspekti antaŭan ekzemplon" msgid "Code" msgstr "" -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Min SDK" -msgstr "Grando de konturo:" - -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Target SDK" -msgstr "Celo" - #: platform/android/export/export_plugin.cpp platform/uwp/export/export.cpp #, fuzzy msgid "Package" @@ -19113,12 +19128,12 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"\"Hand Tracking\" is only valid when \"Xr Mode\" is \"Oculus Mobile VrApi\" " +"\"Hand Tracking\" is only valid when \"XR Mode\" is \"Oculus Mobile VrApi\" " "or \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Passthrough\" is only valid when \"Xr Mode\" is \"OpenXR\"." +msgid "\"Passthrough\" is only valid when \"XR Mode\" is \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp @@ -19127,17 +19142,37 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Min Sdk\" is only valid when \"Use Custom Build\" is enabled." +"\"Min SDK\" can only be overridden when \"Use Custom Build\" is enabled." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Min SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Min SDK\" cannot be lower than %d, which is the version needed by the " +"Godot library." msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Target Sdk\" is only valid when \"Use Custom Build\" is " -"enabled." +"\"Target SDK\" can only be overridden when \"Use Custom Build\" is enabled." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Target Sdk\" version must be greater or equal to \"Min Sdk\" version." +msgid "" +"\"Target SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Target SDK\" %d is higher than the default version %d. This may work, but " +"wasn't tested and may be unstable." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Target SDK\" version must be greater or equal to \"Min SDK\" version." msgstr "" #: platform/android/export/export_plugin.cpp platform/osx/export/export.cpp @@ -20786,7 +20821,7 @@ msgstr "Zomi" msgid "Custom Viewport" msgstr "Montri vidujon" -#: scene/2d/camera_2d.cpp scene/3d/camera.cpp +#: scene/2d/camera_2d.cpp scene/3d/camera.cpp scene/3d/interpolated_camera.cpp #: scene/animation/animation_player.cpp scene/animation/animation_tree.cpp #: scene/animation/animation_tree_player.cpp scene/main/timer.cpp #, fuzzy @@ -21513,6 +21548,11 @@ msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp #, fuzzy +msgid "Pathfinding" +msgstr "Alglui animacion" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy msgid "Path Desired Distance" msgstr "Elektu ĉefan scenon" @@ -21521,29 +21561,34 @@ msgid "Target Desired Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Neighbor Dist" +msgid "Path Max Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Max Neighbors" -msgstr "" +#, fuzzy +msgid "Avoidance" +msgstr "Altnivela" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Time Horizon" +#, fuzzy +msgid "Avoidance Enabled" +msgstr "Ŝaltita" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +msgid "Neighbor Dist" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Max Speed" +msgid "Max Neighbors" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Path Max Distance" +msgid "Time Horizon" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -#, fuzzy -msgid "Avoidance Enabled" -msgstr "Ŝaltita" +msgid "Max Speed" +msgstr "" #: scene/2d/navigation_agent_2d.cpp msgid "" @@ -24822,6 +24867,11 @@ msgstr "Dosierujo:" #: scene/gui/text_edit.cpp #, fuzzy +msgid "Drag And Drop Selection Enabled" +msgstr "Nur Elektaro" + +#: scene/gui/text_edit.cpp +#, fuzzy msgid "Hiding Enabled" msgstr "Ŝaltita" @@ -25224,16 +25274,17 @@ msgstr "Fokusi al dosierindiko" #: scene/main/viewport.cpp msgid "" -"This viewport is not set as render target. If you intend for it to display " -"its contents directly to the screen, make it a child of a Control so it can " -"obtain a size. Otherwise, make it a RenderTarget and assign its internal " -"texture to some node for display." +"The Viewport size must be greater than or equal to 2 pixels on both " +"dimensions to render anything." msgstr "" #: scene/main/viewport.cpp msgid "" -"The Viewport size must be greater than or equal to 2 pixels on both " -"dimensions to render anything." +"This Viewport has HDR enabled, but its Usage is set to 2D or 2D No-" +"Sampling.\n" +"HDR is only supported in Viewports that have their Usage set to 3D or 3D No-" +"Effects.\n" +"HDR will be disabled for this Viewport." msgstr "" #: scene/main/viewport.cpp diff --git a/editor/translations/es.po b/editor/translations/es.po index 41b1e32779..febff41060 100644 --- a/editor/translations/es.po +++ b/editor/translations/es.po @@ -466,6 +466,11 @@ msgstr "Meta" msgid "Command" msgstr "Command" +#: core/os/input_event.cpp +#, fuzzy +msgid "Physical" +msgstr " (Física)" + #: core/os/input_event.cpp scene/2d/touch_screen_button.cpp #: scene/gui/base_button.cpp scene/gui/texture_button.cpp #: scene/resources/default_theme/default_theme.cpp @@ -5561,6 +5566,11 @@ msgid "Mouse Extra Buttons Navigate History" msgstr "Botones Extra del Ratón Navegar por el Historial" #: editor/editor_settings.cpp +#, fuzzy +msgid "Drag And Drop Selection" +msgstr "Seleccionar GridMap" + +#: editor/editor_settings.cpp msgid "Appearance" msgstr "Apariencia" @@ -18697,6 +18707,11 @@ msgid "The package must have at least one '.' separator." msgstr "El paquete debe tener al menos un '.' como separador." #: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Custom Build" +msgstr "CustomNode" + +#: platform/android/export/export_plugin.cpp msgid "Use Custom Build" msgstr "" @@ -18705,6 +18720,15 @@ msgstr "" msgid "Export Format" msgstr "Ruta de Exportación" +#: platform/android/export/export_plugin.cpp +msgid "Min SDK" +msgstr "SDK Mínimo" + +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Target SDK" +msgstr "Objetivo de FPS" + #: platform/android/export/export_plugin.cpp platform/iphone/export/export.cpp #, fuzzy msgid "Architectures" @@ -18748,15 +18772,6 @@ msgstr "Inspeccionar Instancia Anterior" msgid "Code" msgstr "" -#: platform/android/export/export_plugin.cpp -msgid "Min SDK" -msgstr "SDK Mínimo" - -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Target SDK" -msgstr "Objetivo de FPS" - #: platform/android/export/export_plugin.cpp platform/uwp/export/export.cpp #, fuzzy msgid "Package" @@ -19013,15 +19028,17 @@ msgid "\"Use Custom Build\" must be enabled to use the plugins." msgstr "\"Use Custom Build\" debe estar activado para usar los plugins." #: platform/android/export/export_plugin.cpp +#, fuzzy msgid "" -"\"Hand Tracking\" is only valid when \"Xr Mode\" is \"Oculus Mobile VrApi\" " +"\"Hand Tracking\" is only valid when \"XR Mode\" is \"Oculus Mobile VrApi\" " "or \"OpenXR\"." msgstr "" "\"Hand Tracking\" solo es válido cuando \"Xr Mode\" es \"Oculus Mobile " "VrApi\" u \"OpenXR\"." #: platform/android/export/export_plugin.cpp -msgid "\"Passthrough\" is only valid when \"Xr Mode\" is \"OpenXR\"." +#, fuzzy +msgid "\"Passthrough\" is only valid when \"XR Mode\" is \"OpenXR\"." msgstr "\"Passthrough\" solo es válido cuando \"Xr Mode\" es \"OpenXR\"." #: platform/android/export/export_plugin.cpp @@ -19030,22 +19047,45 @@ msgstr "" "\"Export AAB\" sólo es válido cuando \"Use Custom Build\" está activado." #: platform/android/export/export_plugin.cpp +#, fuzzy msgid "" -"Changing the \"Min Sdk\" is only valid when \"Use Custom Build\" is enabled." +"\"Min SDK\" can only be overridden when \"Use Custom Build\" is enabled." msgstr "" "Cambiar el \"Min Sdk\" solo es válido cuando \"Use Custom Build\" está " "activado." #: platform/android/export/export_plugin.cpp +msgid "\"Min SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Target Sdk\" is only valid when \"Use Custom Build\" is " -"enabled." +"\"Min SDK\" cannot be lower than %d, which is the version needed by the " +"Godot library." +msgstr "" + +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "" +"\"Target SDK\" can only be overridden when \"Use Custom Build\" is enabled." msgstr "" "Cambiar el \"Target Sdk\" solo es válido cuando \"Use Custom Build\" está " "activado." #: platform/android/export/export_plugin.cpp -msgid "\"Target Sdk\" version must be greater or equal to \"Min Sdk\" version." +msgid "" +"\"Target SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Target SDK\" %d is higher than the default version %d. This may work, but " +"wasn't tested and may be unstable." +msgstr "" + +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "\"Target SDK\" version must be greater or equal to \"Min SDK\" version." msgstr "" "La versión de \"Target Sdk\" debe ser mayor o igual que la versión de \"Min " "Sdk\"." @@ -20755,7 +20795,7 @@ msgstr "Acercar Zoom" msgid "Custom Viewport" msgstr "1 Viewport" -#: scene/2d/camera_2d.cpp scene/3d/camera.cpp +#: scene/2d/camera_2d.cpp scene/3d/camera.cpp scene/3d/interpolated_camera.cpp #: scene/animation/animation_player.cpp scene/animation/animation_tree.cpp #: scene/animation/animation_tree_player.cpp scene/main/timer.cpp #, fuzzy @@ -21521,6 +21561,11 @@ msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp #, fuzzy +msgid "Pathfinding" +msgstr "Vinculación" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy msgid "Path Desired Distance" msgstr "Distancia de la Ruta U" @@ -21529,6 +21574,20 @@ msgid "Target Desired Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +msgid "Path Max Distance" +msgstr "Distancia Máxima de Ruta" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Avoidance" +msgstr "Avanzado" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Avoidance Enabled" +msgstr "Activar" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp msgid "Neighbor Dist" msgstr "" @@ -21545,15 +21604,6 @@ msgstr "Voltear Horizontalmente" msgid "Max Speed" msgstr "Velocidad Máxima" -#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Path Max Distance" -msgstr "Distancia Máxima de Ruta" - -#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -#, fuzzy -msgid "Avoidance Enabled" -msgstr "Activar" - #: scene/2d/navigation_agent_2d.cpp #, fuzzy msgid "" @@ -24941,6 +24991,11 @@ msgstr "Plegar Gutter" #: scene/gui/text_edit.cpp #, fuzzy +msgid "Drag And Drop Selection Enabled" +msgstr "Sólo selección" + +#: scene/gui/text_edit.cpp +#, fuzzy msgid "Hiding Enabled" msgstr "Activar" @@ -25342,19 +25397,6 @@ msgstr "Ruta de Exportación" #: scene/main/viewport.cpp msgid "" -"This viewport is not set as render target. If you intend for it to display " -"its contents directly to the screen, make it a child of a Control so it can " -"obtain a size. Otherwise, make it a RenderTarget and assign its internal " -"texture to some node for display." -msgstr "" -"Esta ventanilla no está configurada como destino de representación. Si " -"quiere que su contenido se muestre directamente en la pantalla, hágalo un " -"elemento secundario de un control para que pueda recibir dimensiones. O " -"bien, conviértalo en un RenderTarget y asigne su textura interna a algún " -"nodo para que se muestre." - -#: scene/main/viewport.cpp -msgid "" "The Viewport size must be greater than or equal to 2 pixels on both " "dimensions to render anything." msgstr "" @@ -25362,6 +25404,15 @@ msgstr "" "dimensiones para renderizar cualquier cosa." #: scene/main/viewport.cpp +msgid "" +"This Viewport has HDR enabled, but its Usage is set to 2D or 2D No-" +"Sampling.\n" +"HDR is only supported in Viewports that have their Usage set to 3D or 3D No-" +"Effects.\n" +"HDR will be disabled for this Viewport." +msgstr "" + +#: scene/main/viewport.cpp msgid "ARVR" msgstr "" diff --git a/editor/translations/es_AR.po b/editor/translations/es_AR.po index aa0a7c6258..eeea3a9922 100644 --- a/editor/translations/es_AR.po +++ b/editor/translations/es_AR.po @@ -413,6 +413,11 @@ msgstr "Meta" msgid "Command" msgstr "Comunidad" +#: core/os/input_event.cpp +#, fuzzy +msgid "Physical" +msgstr " (Física)" + #: core/os/input_event.cpp scene/2d/touch_screen_button.cpp #: scene/gui/base_button.cpp scene/gui/texture_button.cpp #: scene/resources/default_theme/default_theme.cpp @@ -5630,6 +5635,11 @@ msgid "Mouse Extra Buttons Navigate History" msgstr "" #: editor/editor_settings.cpp +#, fuzzy +msgid "Drag And Drop Selection" +msgstr "Selección de GridMap" + +#: editor/editor_settings.cpp msgid "Appearance" msgstr "" @@ -18901,6 +18911,11 @@ msgid "The package must have at least one '.' separator." msgstr "El paquete debe tener al menos un '.' como separador." #: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Custom Build" +msgstr "CustomNode" + +#: platform/android/export/export_plugin.cpp msgid "Use Custom Build" msgstr "" @@ -18909,6 +18924,16 @@ msgstr "" msgid "Export Format" msgstr "Ruta de Exportación" +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Min SDK" +msgstr "Tamaño de Outline:" + +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Target SDK" +msgstr "Objetivo" + #: platform/android/export/export_plugin.cpp platform/iphone/export/export.cpp #, fuzzy msgid "Architectures" @@ -18952,16 +18977,6 @@ msgstr "Inspeccionar Instancia Previa" msgid "Code" msgstr "" -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Min SDK" -msgstr "Tamaño de Outline:" - -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Target SDK" -msgstr "Objetivo" - #: platform/android/export/export_plugin.cpp platform/uwp/export/export.cpp #, fuzzy msgid "Package" @@ -19213,15 +19228,17 @@ msgid "\"Use Custom Build\" must be enabled to use the plugins." msgstr "\"Use Custom Build\" debe estar activado para usar los plugins." #: platform/android/export/export_plugin.cpp +#, fuzzy msgid "" -"\"Hand Tracking\" is only valid when \"Xr Mode\" is \"Oculus Mobile VrApi\" " +"\"Hand Tracking\" is only valid when \"XR Mode\" is \"Oculus Mobile VrApi\" " "or \"OpenXR\"." msgstr "" "\"Hand Tracking\" sólo es válido cuando \"Xr Mode\" es \"Oculus Mobile " "VrApi\" o \"OpenXR\"." #: platform/android/export/export_plugin.cpp -msgid "\"Passthrough\" is only valid when \"Xr Mode\" is \"OpenXR\"." +#, fuzzy +msgid "\"Passthrough\" is only valid when \"XR Mode\" is \"OpenXR\"." msgstr "\"Passthrough\" sólo es válido cuando \"Xr Mode\" es \"OpenXR\"." #: platform/android/export/export_plugin.cpp @@ -19230,22 +19247,45 @@ msgstr "" "\"Export AAB\" sólo es válido cuando \"Use Custom Build\" está activado." #: platform/android/export/export_plugin.cpp +#, fuzzy msgid "" -"Changing the \"Min Sdk\" is only valid when \"Use Custom Build\" is enabled." +"\"Min SDK\" can only be overridden when \"Use Custom Build\" is enabled." msgstr "" "Cambiar el \"Min Sdk\" sólo es válido cuando \"Use Custom Build\" está " "activado." #: platform/android/export/export_plugin.cpp +msgid "\"Min SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Target Sdk\" is only valid when \"Use Custom Build\" is " -"enabled." +"\"Min SDK\" cannot be lower than %d, which is the version needed by the " +"Godot library." +msgstr "" + +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "" +"\"Target SDK\" can only be overridden when \"Use Custom Build\" is enabled." msgstr "" "Cambiar el \"Target Sdk\" sólo es válido cuando \"Use Custom Build\" está " "activado." #: platform/android/export/export_plugin.cpp -msgid "\"Target Sdk\" version must be greater or equal to \"Min Sdk\" version." +msgid "" +"\"Target SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Target SDK\" %d is higher than the default version %d. This may work, but " +"wasn't tested and may be unstable." +msgstr "" + +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "\"Target SDK\" version must be greater or equal to \"Min SDK\" version." msgstr "" "La versión de \"Target Sdk\" debe ser mayor o igual a la versión de \"Min " "Sdk\"." @@ -20984,7 +21024,7 @@ msgstr "Zoom In" msgid "Custom Viewport" msgstr "1 Viewport" -#: scene/2d/camera_2d.cpp scene/3d/camera.cpp +#: scene/2d/camera_2d.cpp scene/3d/camera.cpp scene/3d/interpolated_camera.cpp #: scene/animation/animation_player.cpp scene/animation/animation_tree.cpp #: scene/animation/animation_tree_player.cpp scene/main/timer.cpp #, fuzzy @@ -21762,6 +21802,11 @@ msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp #, fuzzy +msgid "Pathfinding" +msgstr "Binding" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy msgid "Path Desired Distance" msgstr "Elegir Instancia:" @@ -21770,6 +21815,21 @@ msgid "Target Desired Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Path Max Distance" +msgstr "Elegir Instancia:" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Avoidance" +msgstr "Avanzado" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Avoidance Enabled" +msgstr "Activar" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp msgid "Neighbor Dist" msgstr "" @@ -21786,16 +21846,6 @@ msgstr "Espejar Horizontalmente" msgid "Max Speed" msgstr "Velocidad Máxima" -#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -#, fuzzy -msgid "Path Max Distance" -msgstr "Elegir Instancia:" - -#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -#, fuzzy -msgid "Avoidance Enabled" -msgstr "Activar" - #: scene/2d/navigation_agent_2d.cpp msgid "" "The NavigationAgent2D can be used only under a Node2D inheriting parent node." @@ -25190,6 +25240,11 @@ msgstr "Carpeta:" #: scene/gui/text_edit.cpp #, fuzzy +msgid "Drag And Drop Selection Enabled" +msgstr "Solo Selección" + +#: scene/gui/text_edit.cpp +#, fuzzy msgid "Hiding Enabled" msgstr "Activar" @@ -25602,18 +25657,6 @@ msgstr "Ruta de Exportación" #: scene/main/viewport.cpp msgid "" -"This viewport is not set as render target. If you intend for it to display " -"its contents directly to the screen, make it a child of a Control so it can " -"obtain a size. Otherwise, make it a RenderTarget and assign its internal " -"texture to some node for display." -msgstr "" -"Este viewport no está seteado como render target. Si tienes intención de que " -"muestre contenidos directo a la pantalla, haz un hijo de un Control para que " -"pueda obtener un tamaño. Alternativamente, haz un RenderTarget y asigna su " -"textura interna a algún otro nodo para mostrar." - -#: scene/main/viewport.cpp -msgid "" "The Viewport size must be greater than or equal to 2 pixels on both " "dimensions to render anything." msgstr "" @@ -25621,6 +25664,15 @@ msgstr "" "dimensiones para renderizar cualquier cosa." #: scene/main/viewport.cpp +msgid "" +"This Viewport has HDR enabled, but its Usage is set to 2D or 2D No-" +"Sampling.\n" +"HDR is only supported in Viewports that have their Usage set to 3D or 3D No-" +"Effects.\n" +"HDR will be disabled for this Viewport." +msgstr "" + +#: scene/main/viewport.cpp msgid "ARVR" msgstr "" diff --git a/editor/translations/et.po b/editor/translations/et.po index f90543b559..b7ed666bb0 100644 --- a/editor/translations/et.po +++ b/editor/translations/et.po @@ -417,6 +417,11 @@ msgstr "" msgid "Command" msgstr "Kogukond" +#: core/os/input_event.cpp +#, fuzzy +msgid "Physical" +msgstr "Luba" + #: core/os/input_event.cpp scene/2d/touch_screen_button.cpp #: scene/gui/base_button.cpp scene/gui/texture_button.cpp #: scene/resources/default_theme/default_theme.cpp @@ -5473,6 +5478,11 @@ msgid "Mouse Extra Buttons Navigate History" msgstr "" #: editor/editor_settings.cpp +#, fuzzy +msgid "Drag And Drop Selection" +msgstr "Kopeeri valik" + +#: editor/editor_settings.cpp msgid "Appearance" msgstr "" @@ -18297,6 +18307,11 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Custom Build" +msgstr "Kustuta sõlm(ed)" + +#: platform/android/export/export_plugin.cpp msgid "Use Custom Build" msgstr "" @@ -18305,6 +18320,16 @@ msgstr "" msgid "Export Format" msgstr "Formaat" +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Min SDK" +msgstr "Suurus: " + +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Target SDK" +msgstr "Ressursi tee" + #: platform/android/export/export_plugin.cpp platform/iphone/export/export.cpp msgid "Architectures" msgstr "" @@ -18343,16 +18368,6 @@ msgstr "" msgid "Code" msgstr "" -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Min SDK" -msgstr "Suurus: " - -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Target SDK" -msgstr "Ressursi tee" - #: platform/android/export/export_plugin.cpp platform/uwp/export/export.cpp #, fuzzy msgid "Package" @@ -18591,12 +18606,12 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"\"Hand Tracking\" is only valid when \"Xr Mode\" is \"Oculus Mobile VrApi\" " +"\"Hand Tracking\" is only valid when \"XR Mode\" is \"Oculus Mobile VrApi\" " "or \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Passthrough\" is only valid when \"Xr Mode\" is \"OpenXR\"." +msgid "\"Passthrough\" is only valid when \"XR Mode\" is \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp @@ -18605,17 +18620,37 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Min Sdk\" is only valid when \"Use Custom Build\" is enabled." +"\"Min SDK\" can only be overridden when \"Use Custom Build\" is enabled." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Min SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Min SDK\" cannot be lower than %d, which is the version needed by the " +"Godot library." msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Target Sdk\" is only valid when \"Use Custom Build\" is " -"enabled." +"\"Target SDK\" can only be overridden when \"Use Custom Build\" is enabled." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Target Sdk\" version must be greater or equal to \"Min Sdk\" version." +msgid "" +"\"Target SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Target SDK\" %d is higher than the default version %d. This may work, but " +"wasn't tested and may be unstable." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Target SDK\" version must be greater or equal to \"Min SDK\" version." msgstr "" #: platform/android/export/export_plugin.cpp platform/osx/export/export.cpp @@ -20238,7 +20273,7 @@ msgstr "" msgid "Custom Viewport" msgstr "1 vaateaken" -#: scene/2d/camera_2d.cpp scene/3d/camera.cpp +#: scene/2d/camera_2d.cpp scene/3d/camera.cpp scene/3d/interpolated_camera.cpp #: scene/animation/animation_player.cpp scene/animation/animation_tree.cpp #: scene/animation/animation_tree_player.cpp scene/main/timer.cpp #, fuzzy @@ -20951,6 +20986,11 @@ msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp #, fuzzy +msgid "Pathfinding" +msgstr "Kombinatsioon" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy msgid "Path Desired Distance" msgstr "Paigalda" @@ -20959,29 +20999,34 @@ msgid "Target Desired Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Neighbor Dist" +msgid "Path Max Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Max Neighbors" -msgstr "" +#, fuzzy +msgid "Avoidance" +msgstr "Täpsem" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Time Horizon" +#, fuzzy +msgid "Avoidance Enabled" +msgstr "Luba" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +msgid "Neighbor Dist" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Max Speed" +msgid "Max Neighbors" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Path Max Distance" +msgid "Time Horizon" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -#, fuzzy -msgid "Avoidance Enabled" -msgstr "Luba" +msgid "Max Speed" +msgstr "" #: scene/2d/navigation_agent_2d.cpp msgid "" @@ -24170,6 +24215,11 @@ msgstr "" #: scene/gui/text_edit.cpp #, fuzzy +msgid "Drag And Drop Selection Enabled" +msgstr "Vali see kaust" + +#: scene/gui/text_edit.cpp +#, fuzzy msgid "Hiding Enabled" msgstr "Luba" @@ -24556,14 +24606,6 @@ msgid "Viewport Path" msgstr "1 vaateaken" #: scene/main/viewport.cpp -msgid "" -"This viewport is not set as render target. If you intend for it to display " -"its contents directly to the screen, make it a child of a Control so it can " -"obtain a size. Otherwise, make it a RenderTarget and assign its internal " -"texture to some node for display." -msgstr "" - -#: scene/main/viewport.cpp #, fuzzy msgid "" "The Viewport size must be greater than or equal to 2 pixels on both " @@ -24571,6 +24613,15 @@ msgid "" msgstr "Vaateakne suurus peab olema suurem kui 0, et kuvada." #: scene/main/viewport.cpp +msgid "" +"This Viewport has HDR enabled, but its Usage is set to 2D or 2D No-" +"Sampling.\n" +"HDR is only supported in Viewports that have their Usage set to 3D or 3D No-" +"Effects.\n" +"HDR will be disabled for this Viewport." +msgstr "" + +#: scene/main/viewport.cpp msgid "ARVR" msgstr "" diff --git a/editor/translations/eu.po b/editor/translations/eu.po index 9ffd16f336..ff9601ad57 100644 --- a/editor/translations/eu.po +++ b/editor/translations/eu.po @@ -394,6 +394,11 @@ msgstr "" msgid "Command" msgstr "Komunitatea" +#: core/os/input_event.cpp +#, fuzzy +msgid "Physical" +msgstr "Gaitu atxikitzea" + #: core/os/input_event.cpp scene/2d/touch_screen_button.cpp #: scene/gui/base_button.cpp scene/gui/texture_button.cpp #: scene/resources/default_theme/default_theme.cpp @@ -5380,6 +5385,10 @@ msgid "Mouse Extra Buttons Navigate History" msgstr "" #: editor/editor_settings.cpp +msgid "Drag And Drop Selection" +msgstr "" + +#: editor/editor_settings.cpp msgid "Appearance" msgstr "" @@ -18122,6 +18131,11 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Custom Build" +msgstr "Kendu elementu guztiak" + +#: platform/android/export/export_plugin.cpp msgid "Use Custom Build" msgstr "" @@ -18130,6 +18144,15 @@ msgstr "" msgid "Export Format" msgstr "Esportatu" +#: platform/android/export/export_plugin.cpp +msgid "Min SDK" +msgstr "" + +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Target SDK" +msgstr "Blend4 nodoa" + #: platform/android/export/export_plugin.cpp platform/iphone/export/export.cpp msgid "Architectures" msgstr "" @@ -18167,15 +18190,6 @@ msgstr "" msgid "Code" msgstr "" -#: platform/android/export/export_plugin.cpp -msgid "Min SDK" -msgstr "" - -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Target SDK" -msgstr "Blend4 nodoa" - #: platform/android/export/export_plugin.cpp platform/uwp/export/export.cpp msgid "Package" msgstr "" @@ -18413,12 +18427,12 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"\"Hand Tracking\" is only valid when \"Xr Mode\" is \"Oculus Mobile VrApi\" " +"\"Hand Tracking\" is only valid when \"XR Mode\" is \"Oculus Mobile VrApi\" " "or \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Passthrough\" is only valid when \"Xr Mode\" is \"OpenXR\"." +msgid "\"Passthrough\" is only valid when \"XR Mode\" is \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp @@ -18427,17 +18441,37 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Min Sdk\" is only valid when \"Use Custom Build\" is enabled." +"\"Min SDK\" can only be overridden when \"Use Custom Build\" is enabled." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Min SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Min SDK\" cannot be lower than %d, which is the version needed by the " +"Godot library." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Target SDK\" can only be overridden when \"Use Custom Build\" is enabled." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Target SDK\" should be a valid integer, but got \"%s\" which is invalid." msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Target Sdk\" is only valid when \"Use Custom Build\" is " -"enabled." +"\"Target SDK\" %d is higher than the default version %d. This may work, but " +"wasn't tested and may be unstable." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Target Sdk\" version must be greater or equal to \"Min Sdk\" version." +msgid "\"Target SDK\" version must be greater or equal to \"Min SDK\" version." msgstr "" #: platform/android/export/export_plugin.cpp platform/osx/export/export.cpp @@ -20032,7 +20066,7 @@ msgstr "" msgid "Custom Viewport" msgstr "" -#: scene/2d/camera_2d.cpp scene/3d/camera.cpp +#: scene/2d/camera_2d.cpp scene/3d/camera.cpp scene/3d/interpolated_camera.cpp #: scene/animation/animation_player.cpp scene/animation/animation_tree.cpp #: scene/animation/animation_tree_player.cpp scene/main/timer.cpp #, fuzzy @@ -20729,6 +20763,11 @@ msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp #, fuzzy +msgid "Pathfinding" +msgstr "Itsatsi animazioa" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy msgid "Path Desired Distance" msgstr "Instalatu" @@ -20737,29 +20776,34 @@ msgid "Target Desired Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Neighbor Dist" +msgid "Path Max Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Max Neighbors" -msgstr "" +#, fuzzy +msgid "Avoidance" +msgstr "Gaitu atxikitzea" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Time Horizon" +#, fuzzy +msgid "Avoidance Enabled" +msgstr "Gaitu atxikitzea" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +msgid "Neighbor Dist" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Max Speed" +msgid "Max Neighbors" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Path Max Distance" +msgid "Time Horizon" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -#, fuzzy -msgid "Avoidance Enabled" -msgstr "Gaitu atxikitzea" +msgid "Max Speed" +msgstr "" #: scene/2d/navigation_agent_2d.cpp msgid "" @@ -23887,6 +23931,11 @@ msgstr "" #: scene/gui/text_edit.cpp #, fuzzy +msgid "Drag And Drop Selection Enabled" +msgstr "Hautatu karpeta hau" + +#: scene/gui/text_edit.cpp +#, fuzzy msgid "Hiding Enabled" msgstr "Gaitu atxikitzea" @@ -24266,16 +24315,17 @@ msgstr "Kopiatu bidea" #: scene/main/viewport.cpp msgid "" -"This viewport is not set as render target. If you intend for it to display " -"its contents directly to the screen, make it a child of a Control so it can " -"obtain a size. Otherwise, make it a RenderTarget and assign its internal " -"texture to some node for display." +"The Viewport size must be greater than or equal to 2 pixels on both " +"dimensions to render anything." msgstr "" #: scene/main/viewport.cpp msgid "" -"The Viewport size must be greater than or equal to 2 pixels on both " -"dimensions to render anything." +"This Viewport has HDR enabled, but its Usage is set to 2D or 2D No-" +"Sampling.\n" +"HDR is only supported in Viewports that have their Usage set to 3D or 3D No-" +"Effects.\n" +"HDR will be disabled for this Viewport." msgstr "" #: scene/main/viewport.cpp diff --git a/editor/translations/fa.po b/editor/translations/fa.po index 0b7bd8cdb1..ae8a37388a 100644 --- a/editor/translations/fa.po +++ b/editor/translations/fa.po @@ -441,6 +441,11 @@ msgstr "" msgid "Command" msgstr "جامعه" +#: core/os/input_event.cpp +#, fuzzy +msgid "Physical" +msgstr "روشن" + #: core/os/input_event.cpp scene/2d/touch_screen_button.cpp #: scene/gui/base_button.cpp scene/gui/texture_button.cpp #: scene/resources/default_theme/default_theme.cpp @@ -5535,6 +5540,11 @@ msgid "Mouse Extra Buttons Navigate History" msgstr "" #: editor/editor_settings.cpp +#, fuzzy +msgid "Drag And Drop Selection" +msgstr "انتخاب شده را حذف کن" + +#: editor/editor_settings.cpp msgid "Appearance" msgstr "" @@ -19006,6 +19016,11 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Custom Build" +msgstr "ساختن گره" + +#: platform/android/export/export_plugin.cpp msgid "Use Custom Build" msgstr "" @@ -19014,6 +19029,16 @@ msgstr "" msgid "Export Format" msgstr "صدور پروژه" +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Min SDK" +msgstr "باز کردن و اجرای یک اسکریپت" + +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Target SDK" +msgstr "گره تغییر والد" + #: platform/android/export/export_plugin.cpp platform/iphone/export/export.cpp msgid "Architectures" msgstr "" @@ -19052,16 +19077,6 @@ msgstr "زبانه قبلی" msgid "Code" msgstr "" -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Min SDK" -msgstr "باز کردن و اجرای یک اسکریپت" - -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Target SDK" -msgstr "گره تغییر والد" - #: platform/android/export/export_plugin.cpp platform/uwp/export/export.cpp #, fuzzy msgid "Package" @@ -19306,12 +19321,12 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"\"Hand Tracking\" is only valid when \"Xr Mode\" is \"Oculus Mobile VrApi\" " +"\"Hand Tracking\" is only valid when \"XR Mode\" is \"Oculus Mobile VrApi\" " "or \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Passthrough\" is only valid when \"Xr Mode\" is \"OpenXR\"." +msgid "\"Passthrough\" is only valid when \"XR Mode\" is \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp @@ -19320,17 +19335,37 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Min Sdk\" is only valid when \"Use Custom Build\" is enabled." +"\"Min SDK\" can only be overridden when \"Use Custom Build\" is enabled." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Min SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Min SDK\" cannot be lower than %d, which is the version needed by the " +"Godot library." msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Target Sdk\" is only valid when \"Use Custom Build\" is " -"enabled." +"\"Target SDK\" can only be overridden when \"Use Custom Build\" is enabled." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Target Sdk\" version must be greater or equal to \"Min Sdk\" version." +msgid "" +"\"Target SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Target SDK\" %d is higher than the default version %d. This may work, but " +"wasn't tested and may be unstable." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Target SDK\" version must be greater or equal to \"Min SDK\" version." msgstr "" #: platform/android/export/export_plugin.cpp platform/osx/export/export.cpp @@ -20980,7 +21015,7 @@ msgstr "بزرگنمایی" msgid "Custom Viewport" msgstr "" -#: scene/2d/camera_2d.cpp scene/3d/camera.cpp +#: scene/2d/camera_2d.cpp scene/3d/camera.cpp scene/3d/interpolated_camera.cpp #: scene/animation/animation_player.cpp scene/animation/animation_tree.cpp #: scene/animation/animation_tree_player.cpp scene/main/timer.cpp #, fuzzy @@ -21714,6 +21749,11 @@ msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp #, fuzzy +msgid "Pathfinding" +msgstr "ثابت" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy msgid "Path Desired Distance" msgstr "نصب کردن" @@ -21722,29 +21762,34 @@ msgid "Target Desired Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Neighbor Dist" +msgid "Path Max Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Max Neighbors" -msgstr "" +#, fuzzy +msgid "Avoidance" +msgstr "پیشرفته" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Time Horizon" +#, fuzzy +msgid "Avoidance Enabled" +msgstr "روشن" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +msgid "Neighbor Dist" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Max Speed" +msgid "Max Neighbors" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Path Max Distance" +msgid "Time Horizon" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -#, fuzzy -msgid "Avoidance Enabled" -msgstr "روشن" +msgid "Max Speed" +msgstr "" #: scene/2d/navigation_agent_2d.cpp msgid "" @@ -25012,6 +25057,11 @@ msgstr "ساختن پوشه" #: scene/gui/text_edit.cpp #, fuzzy +msgid "Drag And Drop Selection Enabled" +msgstr "تنها در قسمت انتخاب شده" + +#: scene/gui/text_edit.cpp +#, fuzzy msgid "Hiding Enabled" msgstr "روشن" @@ -25408,20 +25458,17 @@ msgstr "صدور پروژه" #: scene/main/viewport.cpp msgid "" -"This viewport is not set as render target. If you intend for it to display " -"its contents directly to the screen, make it a child of a Control so it can " -"obtain a size. Otherwise, make it a RenderTarget and assign its internal " -"texture to some node for display." +"The Viewport size must be greater than or equal to 2 pixels on both " +"dimensions to render anything." msgstr "" -"این viewport به صورت render target تنظیم نیست. اگر قصد دارید که محتویاتش را " -"به صورت مستقیم در صفحهنمایش نمایش دهد، آن را یک فرزند یک Control قرار دهید " -"تا بتواند یک اندازه بگیرد. در غیر اینصورت، آن را یک RenderTarget قرار دهید و " -"بافت داخلی آن را برای نمایش به تعدادی گره تخصیص دهید." #: scene/main/viewport.cpp msgid "" -"The Viewport size must be greater than or equal to 2 pixels on both " -"dimensions to render anything." +"This Viewport has HDR enabled, but its Usage is set to 2D or 2D No-" +"Sampling.\n" +"HDR is only supported in Viewports that have their Usage set to 3D or 3D No-" +"Effects.\n" +"HDR will be disabled for this Viewport." msgstr "" #: scene/main/viewport.cpp diff --git a/editor/translations/fi.po b/editor/translations/fi.po index 24d8fd66ab..7613bdfcce 100644 --- a/editor/translations/fi.po +++ b/editor/translations/fi.po @@ -437,6 +437,11 @@ msgstr "" msgid "Command" msgstr "Yhteisö" +#: core/os/input_event.cpp +#, fuzzy +msgid "Physical" +msgstr " (fyysinen)" + #: core/os/input_event.cpp scene/2d/touch_screen_button.cpp #: scene/gui/base_button.cpp scene/gui/texture_button.cpp #: scene/resources/default_theme/default_theme.cpp @@ -5662,6 +5667,11 @@ msgid "Mouse Extra Buttons Navigate History" msgstr "" #: editor/editor_settings.cpp +#, fuzzy +msgid "Drag And Drop Selection" +msgstr "Ruudukon valinta" + +#: editor/editor_settings.cpp msgid "Appearance" msgstr "" @@ -18902,6 +18912,11 @@ msgid "The package must have at least one '.' separator." msgstr "Paketilla on oltava ainakin yksi '.' erotinmerkki." #: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Custom Build" +msgstr "Mukautettu solmu" + +#: platform/android/export/export_plugin.cpp msgid "Use Custom Build" msgstr "" @@ -18910,6 +18925,16 @@ msgstr "" msgid "Export Format" msgstr "Vientipolku" +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Min SDK" +msgstr "Ääriviivojen koko:" + +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Target SDK" +msgstr "Kohde" + #: platform/android/export/export_plugin.cpp platform/iphone/export/export.cpp #, fuzzy msgid "Architectures" @@ -18953,16 +18978,6 @@ msgstr "Tarkastele edellistä ilmentymää" msgid "Code" msgstr "" -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Min SDK" -msgstr "Ääriviivojen koko:" - -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Target SDK" -msgstr "Kohde" - #: platform/android/export/export_plugin.cpp platform/uwp/export/export.cpp #, fuzzy msgid "Package" @@ -19216,15 +19231,17 @@ msgstr "" "käyttää." #: platform/android/export/export_plugin.cpp +#, fuzzy msgid "" -"\"Hand Tracking\" is only valid when \"Xr Mode\" is \"Oculus Mobile VrApi\" " +"\"Hand Tracking\" is only valid when \"XR Mode\" is \"Oculus Mobile VrApi\" " "or \"OpenXR\"." msgstr "" "\"Hand Tracking\" on käyttökelpoinen ainoastaan kun \"Xr Mode\" asetuksen " "arvo on \"Oculus Mobile VrAPI\" tai \"OpenXR\"." #: platform/android/export/export_plugin.cpp -msgid "\"Passthrough\" is only valid when \"Xr Mode\" is \"OpenXR\"." +#, fuzzy +msgid "\"Passthrough\" is only valid when \"XR Mode\" is \"OpenXR\"." msgstr "" "\"Passthrough\" on käyttökelpoinen ainoastaan kun \"Xr Mode\" asetuksen arvo " "on \"OpenXR\"." @@ -19236,22 +19253,45 @@ msgstr "" "päällä." #: platform/android/export/export_plugin.cpp +#, fuzzy msgid "" -"Changing the \"Min Sdk\" is only valid when \"Use Custom Build\" is enabled." +"\"Min SDK\" can only be overridden when \"Use Custom Build\" is enabled." msgstr "" "\"Min Sdk\" vaihtaminen on mahdollista vain, kun \"Use Custom Build\" asetus " "on päällä." #: platform/android/export/export_plugin.cpp +msgid "\"Min SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Target Sdk\" is only valid when \"Use Custom Build\" is " -"enabled." +"\"Min SDK\" cannot be lower than %d, which is the version needed by the " +"Godot library." +msgstr "" + +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "" +"\"Target SDK\" can only be overridden when \"Use Custom Build\" is enabled." msgstr "" "\"Target Sdk\" vaihtaminen on mahdollista vain, kun \"Use Custom Build\" " "asetus on päällä." #: platform/android/export/export_plugin.cpp -msgid "\"Target Sdk\" version must be greater or equal to \"Min Sdk\" version." +msgid "" +"\"Target SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Target SDK\" %d is higher than the default version %d. This may work, but " +"wasn't tested and may be unstable." +msgstr "" + +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "\"Target SDK\" version must be greater or equal to \"Min SDK\" version." msgstr "" "\"Target Sdk\" versionumeron on oltava suurempi tai yhtä suuri kuin \"Min " "Sdk\" versionumeron." @@ -20991,7 +21031,7 @@ msgstr "Lähennä" msgid "Custom Viewport" msgstr "1 näyttöruutu" -#: scene/2d/camera_2d.cpp scene/3d/camera.cpp +#: scene/2d/camera_2d.cpp scene/3d/camera.cpp scene/3d/interpolated_camera.cpp #: scene/animation/animation_player.cpp scene/animation/animation_tree.cpp #: scene/animation/animation_tree_player.cpp scene/main/timer.cpp #, fuzzy @@ -21766,6 +21806,11 @@ msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp #, fuzzy +msgid "Pathfinding" +msgstr "Sidonta" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy msgid "Path Desired Distance" msgstr "Poimintaetäisyys:" @@ -21774,6 +21819,21 @@ msgid "Target Desired Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Path Max Distance" +msgstr "Poimintaetäisyys:" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Avoidance" +msgstr "Edistyneet" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Avoidance Enabled" +msgstr "Ota käyttöön" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp msgid "Neighbor Dist" msgstr "" @@ -21791,16 +21851,6 @@ msgstr "Käännä vaakasuorasti" msgid "Max Speed" msgstr "Nopeus:" -#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -#, fuzzy -msgid "Path Max Distance" -msgstr "Poimintaetäisyys:" - -#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -#, fuzzy -msgid "Avoidance Enabled" -msgstr "Ota käyttöön" - #: scene/2d/navigation_agent_2d.cpp #, fuzzy msgid "" @@ -25260,6 +25310,11 @@ msgstr "Kansio:" #: scene/gui/text_edit.cpp #, fuzzy +msgid "Drag And Drop Selection Enabled" +msgstr "Pelkkä valinta" + +#: scene/gui/text_edit.cpp +#, fuzzy msgid "Hiding Enabled" msgstr "Ota käyttöön" @@ -25672,18 +25727,6 @@ msgstr "Vientipolku" #: scene/main/viewport.cpp msgid "" -"This viewport is not set as render target. If you intend for it to display " -"its contents directly to the screen, make it a child of a Control so it can " -"obtain a size. Otherwise, make it a RenderTarget and assign its internal " -"texture to some node for display." -msgstr "" -"Tätä näyttöikkunaa ei ole asetettu renderöitäväksi. Jos haluat sen näyttävän " -"sisältöä suoraan näytölle, tee sitä Control solmun alisolmu, jotta se voi " -"saada koon. Muutoin tee siitä RenderTarget ja aseta sen sisäinen tekstuuri " -"johonkin solmuun näkyväksi." - -#: scene/main/viewport.cpp -msgid "" "The Viewport size must be greater than or equal to 2 pixels on both " "dimensions to render anything." msgstr "" @@ -25691,6 +25734,15 @@ msgstr "" "kummassakin suunnassa, jotta mitään renderöidään." #: scene/main/viewport.cpp +msgid "" +"This Viewport has HDR enabled, but its Usage is set to 2D or 2D No-" +"Sampling.\n" +"HDR is only supported in Viewports that have their Usage set to 3D or 3D No-" +"Effects.\n" +"HDR will be disabled for this Viewport." +msgstr "" + +#: scene/main/viewport.cpp msgid "ARVR" msgstr "" diff --git a/editor/translations/fil.po b/editor/translations/fil.po index 822a23a9b9..24a5742ef6 100644 --- a/editor/translations/fil.po +++ b/editor/translations/fil.po @@ -392,6 +392,11 @@ msgstr "Meta" msgid "Command" msgstr "Command" +#: core/os/input_event.cpp +#, fuzzy +msgid "Physical" +msgstr "Pisika" + #: core/os/input_event.cpp scene/2d/touch_screen_button.cpp #: scene/gui/base_button.cpp scene/gui/texture_button.cpp #: scene/resources/default_theme/default_theme.cpp @@ -5297,6 +5302,10 @@ msgid "Mouse Extra Buttons Navigate History" msgstr "" #: editor/editor_settings.cpp +msgid "Drag And Drop Selection" +msgstr "" + +#: editor/editor_settings.cpp msgid "Appearance" msgstr "" @@ -17868,6 +17877,11 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Custom Build" +msgstr "Ilipat Ang Mga Bezier Points" + +#: platform/android/export/export_plugin.cpp msgid "Use Custom Build" msgstr "" @@ -17876,6 +17890,14 @@ msgstr "" msgid "Export Format" msgstr "3D Transform Track" +#: platform/android/export/export_plugin.cpp +msgid "Min SDK" +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "Target SDK" +msgstr "" + #: platform/android/export/export_plugin.cpp platform/iphone/export/export.cpp msgid "Architectures" msgstr "" @@ -17912,14 +17934,6 @@ msgstr "" msgid "Code" msgstr "" -#: platform/android/export/export_plugin.cpp -msgid "Min SDK" -msgstr "" - -#: platform/android/export/export_plugin.cpp -msgid "Target SDK" -msgstr "" - #: platform/android/export/export_plugin.cpp platform/uwp/export/export.cpp msgid "Package" msgstr "" @@ -18143,12 +18157,12 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"\"Hand Tracking\" is only valid when \"Xr Mode\" is \"Oculus Mobile VrApi\" " +"\"Hand Tracking\" is only valid when \"XR Mode\" is \"Oculus Mobile VrApi\" " "or \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Passthrough\" is only valid when \"Xr Mode\" is \"OpenXR\"." +msgid "\"Passthrough\" is only valid when \"XR Mode\" is \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp @@ -18157,17 +18171,37 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Min Sdk\" is only valid when \"Use Custom Build\" is enabled." +"\"Min SDK\" can only be overridden when \"Use Custom Build\" is enabled." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Min SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Min SDK\" cannot be lower than %d, which is the version needed by the " +"Godot library." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Target SDK\" can only be overridden when \"Use Custom Build\" is enabled." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Target SDK\" should be a valid integer, but got \"%s\" which is invalid." msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Target Sdk\" is only valid when \"Use Custom Build\" is " -"enabled." +"\"Target SDK\" %d is higher than the default version %d. This may work, but " +"wasn't tested and may be unstable." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Target Sdk\" version must be greater or equal to \"Min Sdk\" version." +msgid "\"Target SDK\" version must be greater or equal to \"Min SDK\" version." msgstr "" #: platform/android/export/export_plugin.cpp platform/osx/export/export.cpp @@ -19706,7 +19740,7 @@ msgstr "" msgid "Custom Viewport" msgstr "" -#: scene/2d/camera_2d.cpp scene/3d/camera.cpp +#: scene/2d/camera_2d.cpp scene/3d/camera.cpp scene/3d/interpolated_camera.cpp #: scene/animation/animation_player.cpp scene/animation/animation_tree.cpp #: scene/animation/animation_tree_player.cpp scene/main/timer.cpp msgid "Process Mode" @@ -20383,6 +20417,10 @@ msgid "" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +msgid "Pathfinding" +msgstr "" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp msgid "Path Desired Distance" msgstr "" @@ -20391,29 +20429,34 @@ msgid "Target Desired Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Neighbor Dist" +msgid "Path Max Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Max Neighbors" -msgstr "" +#, fuzzy +msgid "Avoidance" +msgstr "Binuksan ang V-Sync" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Time Horizon" +#, fuzzy +msgid "Avoidance Enabled" +msgstr "Binuksan ang V-Sync" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +msgid "Neighbor Dist" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Max Speed" +msgid "Max Neighbors" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Path Max Distance" +msgid "Time Horizon" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -#, fuzzy -msgid "Avoidance Enabled" -msgstr "Binuksan ang V-Sync" +msgid "Max Speed" +msgstr "" #: scene/2d/navigation_agent_2d.cpp msgid "" @@ -23426,6 +23469,10 @@ msgid "Fold Gutter" msgstr "" #: scene/gui/text_edit.cpp +msgid "Drag And Drop Selection Enabled" +msgstr "" + +#: scene/gui/text_edit.cpp msgid "Hiding Enabled" msgstr "" @@ -23786,16 +23833,17 @@ msgstr "" #: scene/main/viewport.cpp msgid "" -"This viewport is not set as render target. If you intend for it to display " -"its contents directly to the screen, make it a child of a Control so it can " -"obtain a size. Otherwise, make it a RenderTarget and assign its internal " -"texture to some node for display." +"The Viewport size must be greater than or equal to 2 pixels on both " +"dimensions to render anything." msgstr "" #: scene/main/viewport.cpp msgid "" -"The Viewport size must be greater than or equal to 2 pixels on both " -"dimensions to render anything." +"This Viewport has HDR enabled, but its Usage is set to 2D or 2D No-" +"Sampling.\n" +"HDR is only supported in Viewports that have their Usage set to 3D or 3D No-" +"Effects.\n" +"HDR will be disabled for this Viewport." msgstr "" #: scene/main/viewport.cpp diff --git a/editor/translations/fr.po b/editor/translations/fr.po index 5711d32f52..8822d35687 100644 --- a/editor/translations/fr.po +++ b/editor/translations/fr.po @@ -32,7 +32,7 @@ # Przemyslaw Gasinski <gasinski.przemek@protonmail.ch>, 2017. # rafeu <duchainer@gmail.com>, 2016-2017. # rawida <rawida@tempinbox.com>, 2018. -# Rémi Verschelde <rverschelde@gmail.com>, 2016-2017. +# Rémi Verschelde <akien@godotengine.org>, 2016-2022. # Robin Arys <robinarys@hotmail.com>, 2017. # Roger BR <drai_kin@hotmail.com>, 2016. # salty64 <cedric.arrabie@univ-pau.fr>, 2018, 2020, 2021. @@ -49,7 +49,6 @@ # Brice Lobet <tempo.data@gmail.com>, 2018. # Florent Wijanto <f_wijanto@hotmail.com>, 2018. # Olivier gareau <olivier.gareau@protonmail.com>, 2018. -# Rémi Verschelde <akien@godotengine.org>, 2018, 2019, 2020, 2021. # Rémi Bintein <reminus5@hotmail.fr>, 2018, 2019. # Sylvain Corsini <sylvain.corsini@gmail.com>, 2018. # Caye Pierre <pierrecaye@laposte.net>, 2019. @@ -66,7 +65,7 @@ # Fabrice <fabricecipolla@gmail.com>, 2019. # Romain Paquet <titou.paquet@gmail.com>, 2019. # Xavier Sellier <contact@binogure-studio.com>, 2019. -# Sofiane <Sofiane-77@caramail.fr>, 2019, 2021. +# Sofiane <Sofiane-77@caramail.fr>, 2019, 2021, 2022. # Camille Mohr-Daurat <pouleyketchoup@gmail.com>, 2019. # Pierre Stempin <pierre.stempin@gmail.com>, 2019. # Pierre Caye <pierrecaye@laposte.net>, 2020, 2021, 2022. @@ -99,13 +98,14 @@ # Nathan Hamy <hamynathan92@gmail.com>, 2022. # HOUA <ninjacowzx@gmail.com>, 2022. # DinosaurHorseSword <ewenlandry@mailfence.com>, 2022. +# Arnaud Lier <arnaud@ric-rac.org>, 2022. msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "Report-Msgid-Bugs-To: https://github.com/godotengine/godot\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2022-06-29 10:04+0000\n" -"Last-Translator: DinosaurHorseSword <ewenlandry@mailfence.com>\n" +"PO-Revision-Date: 2022-07-03 00:44+0000\n" +"Last-Translator: Sofiane <Sofiane-77@caramail.fr>\n" "Language-Team: French <https://hosted.weblate.org/projects/godot-engine/" "godot/fr/>\n" "Language: fr\n" @@ -375,7 +375,7 @@ msgstr "" #: core/io/stream_peer.cpp msgid "Big Endian" -msgstr "" +msgstr "Gros-boutiste" #: core/io/stream_peer.cpp msgid "Data Array" @@ -483,6 +483,11 @@ msgstr "Méta" msgid "Command" msgstr "Commande" +#: core/os/input_event.cpp +#, fuzzy +msgid "Physical" +msgstr " (physique)" + #: core/os/input_event.cpp scene/2d/touch_screen_button.cpp #: scene/gui/base_button.cpp scene/gui/texture_button.cpp #: scene/resources/default_theme/default_theme.cpp @@ -927,7 +932,7 @@ msgstr "" #: core/register_core_types.cpp msgid "TCP" -msgstr "PCT (Protocole de Contrôle de Transmissions)" +msgstr "TCP" #: core/register_core_types.cpp msgid "Connect Timeout Seconds" @@ -5667,6 +5672,11 @@ msgid "Mouse Extra Buttons Navigate History" msgstr "" #: editor/editor_settings.cpp +#, fuzzy +msgid "Drag And Drop Selection" +msgstr "Sélection de la GridMap" + +#: editor/editor_settings.cpp msgid "Appearance" msgstr "" @@ -18914,6 +18924,11 @@ msgid "The package must have at least one '.' separator." msgstr "Le paquet doit comporter au moins un séparateur « . »." #: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Custom Build" +msgstr "Nœud Personnalisé" + +#: platform/android/export/export_plugin.cpp msgid "Use Custom Build" msgstr "" @@ -18922,6 +18937,14 @@ msgstr "" msgid "Export Format" msgstr "Chemin d'exportation" +#: platform/android/export/export_plugin.cpp +msgid "Min SDK" +msgstr "Min SDK" + +#: platform/android/export/export_plugin.cpp +msgid "Target SDK" +msgstr "Target SDK" + #: platform/android/export/export_plugin.cpp platform/iphone/export/export.cpp #, fuzzy msgid "Architectures" @@ -18965,15 +18988,6 @@ msgstr "Inspecter l'instance précédente" msgid "Code" msgstr "" -#: platform/android/export/export_plugin.cpp -msgid "Min SDK" -msgstr "SDK Minimal" - -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Target SDK" -msgstr "Cible" - #: platform/android/export/export_plugin.cpp platform/uwp/export/export.cpp #, fuzzy msgid "Package" @@ -19012,14 +19026,12 @@ msgid "OpenGL Debug" msgstr "Ouvrir" #: platform/android/export/export_plugin.cpp -#, fuzzy msgid "XR Features" -msgstr "Fonctionnalités" +msgstr "Fonctionnalités XR" #: platform/android/export/export_plugin.cpp -#, fuzzy msgid "XR Mode" -msgstr "Mode navigation" +msgstr "Mode XR" #: platform/android/export/export_plugin.cpp #, fuzzy @@ -19226,17 +19238,16 @@ msgstr "« Use Custom Build » doit être activé pour utiliser les plugins." #: platform/android/export/export_plugin.cpp msgid "" -"\"Hand Tracking\" is only valid when \"Xr Mode\" is \"Oculus Mobile VrApi\" " +"\"Hand Tracking\" is only valid when \"XR Mode\" is \"Oculus Mobile VrApi\" " "or \"OpenXR\"." msgstr "" -"« Hand Tracking » est valide uniquement lorsque le « Mode Xr » est « Oculus " +"« Hand Tracking » est valide uniquement lorsque le « Mode XR » est « Oculus " "Mobile VrApi »." #: platform/android/export/export_plugin.cpp -msgid "\"Passthrough\" is only valid when \"Xr Mode\" is \"OpenXR\"." +msgid "\"Passthrough\" is only valid when \"XR Mode\" is \"OpenXR\"." msgstr "" -"« Passthrough » est valide uniquement lorsque le « Xr Mode » est « Oculus " -"Mobile VrApi »." +"« Passthrough » est valide uniquement lorsque le « Mode XR » est « OpenXR »." #: platform/android/export/export_plugin.cpp msgid "\"Export AAB\" is only valid when \"Use Custom Build\" is enabled." @@ -19246,24 +19257,44 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Min Sdk\" is only valid when \"Use Custom Build\" is enabled." +"\"Min SDK\" can only be overridden when \"Use Custom Build\" is enabled." msgstr "" -"Changer « Min Sdk » est valide uniquement lorsque l'option « Use Custom " +"Changer « Min SDK » est valide uniquement lorsque l'option « Use Custom " "Build » est activée." #: platform/android/export/export_plugin.cpp +msgid "\"Min SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Target Sdk\" is only valid when \"Use Custom Build\" is " -"enabled." +"\"Min SDK\" cannot be lower than %d, which is the version needed by the " +"Godot library." msgstr "" -"Changer « Target Sdk » est valide uniquement lorsque l'option « Use Custom " + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Target SDK\" can only be overridden when \"Use Custom Build\" is enabled." +msgstr "" +"Changer « Target SDK » est valide uniquement lorsque l'option « Use Custom " "Build » est activée." #: platform/android/export/export_plugin.cpp -msgid "\"Target Sdk\" version must be greater or equal to \"Min Sdk\" version." +msgid "" +"\"Target SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Target SDK\" %d is higher than the default version %d. This may work, but " +"wasn't tested and may be unstable." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Target SDK\" version must be greater or equal to \"Min SDK\" version." msgstr "" -"La version « Target Sdk » doit être supérieure ou égale à la version « Min " -"Sdk »." +"La version « Target SDK » doit être supérieure ou égale à la version « Min " +"SDK »." #: platform/android/export/export_plugin.cpp platform/osx/export/export.cpp #: platform/windows/export/export.cpp @@ -20976,7 +21007,7 @@ msgstr "Zoomer" msgid "Custom Viewport" msgstr "1 vue" -#: scene/2d/camera_2d.cpp scene/3d/camera.cpp +#: scene/2d/camera_2d.cpp scene/3d/camera.cpp scene/3d/interpolated_camera.cpp #: scene/animation/animation_player.cpp scene/animation/animation_tree.cpp #: scene/animation/animation_tree_player.cpp scene/main/timer.cpp #, fuzzy @@ -21747,6 +21778,11 @@ msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp #, fuzzy +msgid "Pathfinding" +msgstr "Liaison" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy msgid "Path Desired Distance" msgstr "Choisissez distance :" @@ -21755,6 +21791,21 @@ msgid "Target Desired Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Path Max Distance" +msgstr "Choisissez distance :" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Avoidance" +msgstr "Options avancées" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Avoidance Enabled" +msgstr "Activer" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp msgid "Neighbor Dist" msgstr "" @@ -21772,16 +21823,6 @@ msgstr "Retourner horizontalement" msgid "Max Speed" msgstr "Vitesse :" -#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -#, fuzzy -msgid "Path Max Distance" -msgstr "Choisissez distance :" - -#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -#, fuzzy -msgid "Avoidance Enabled" -msgstr "Activer" - #: scene/2d/navigation_agent_2d.cpp #, fuzzy msgid "" @@ -22876,7 +22917,7 @@ msgstr "Aimanter au pixel" #: scene/3d/label_3d.cpp scene/3d/sprite_3d.cpp msgid "Billboard" -msgstr "" +msgstr "Billboard" #: scene/3d/label_3d.cpp scene/3d/sprite_3d.cpp #, fuzzy @@ -25226,6 +25267,11 @@ msgstr "Dossier :" #: scene/gui/text_edit.cpp #, fuzzy +msgid "Drag And Drop Selection Enabled" +msgstr "Sélection uniquement" + +#: scene/gui/text_edit.cpp +#, fuzzy msgid "Hiding Enabled" msgstr "Activer" @@ -25627,18 +25673,6 @@ msgstr "Chemin d'exportation" #: scene/main/viewport.cpp msgid "" -"This viewport is not set as render target. If you intend for it to display " -"its contents directly to the screen, make it a child of a Control so it can " -"obtain a size. Otherwise, make it a RenderTarget and assign its internal " -"texture to some node for display." -msgstr "" -"Ce Viewport n'est pas sélectionné comme cible de rendu. Si vous avez " -"l'intention d'afficher son contenu directement à l'écran, rattachez-le à un " -"nœud de type Control afin qu'il en obtienne une taille. Sinon, faites-en une " -"RenderTarget et assignez sa texture à un nœud pouvant l'afficher." - -#: scene/main/viewport.cpp -msgid "" "The Viewport size must be greater than or equal to 2 pixels on both " "dimensions to render anything." msgstr "" @@ -25646,6 +25680,15 @@ msgstr "" "dans les deux sens pour que le rendu soit possible." #: scene/main/viewport.cpp +msgid "" +"This Viewport has HDR enabled, but its Usage is set to 2D or 2D No-" +"Sampling.\n" +"HDR is only supported in Viewports that have their Usage set to 3D or 3D No-" +"Effects.\n" +"HDR will be disabled for this Viewport." +msgstr "" + +#: scene/main/viewport.cpp msgid "ARVR" msgstr "" @@ -27098,14 +27141,12 @@ msgid "Point Size" msgstr "Vue de devant" #: scene/resources/material.cpp -#, fuzzy msgid "Billboard Mode" -msgstr "Mode Règle" +msgstr "Mode billboard" #: scene/resources/material.cpp -#, fuzzy msgid "Billboard Keep Scale" -msgstr "Mode Règle" +msgstr "Garder l'échelle du billboard" #: scene/resources/material.cpp msgid "Grow" diff --git a/editor/translations/ga.po b/editor/translations/ga.po index 04e014ed77..65ffebf3e5 100644 --- a/editor/translations/ga.po +++ b/editor/translations/ga.po @@ -393,6 +393,11 @@ msgstr "" msgid "Command" msgstr "" +#: core/os/input_event.cpp +#, fuzzy +msgid "Physical" +msgstr "Scagairí..." + #: core/os/input_event.cpp scene/2d/touch_screen_button.cpp #: scene/gui/base_button.cpp scene/gui/texture_button.cpp #: scene/resources/default_theme/default_theme.cpp @@ -5291,6 +5296,10 @@ msgid "Mouse Extra Buttons Navigate History" msgstr "" #: editor/editor_settings.cpp +msgid "Drag And Drop Selection" +msgstr "" + +#: editor/editor_settings.cpp msgid "Appearance" msgstr "" @@ -17820,6 +17829,11 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Custom Build" +msgstr "Cruthaigh" + +#: platform/android/export/export_plugin.cpp msgid "Use Custom Build" msgstr "" @@ -17827,6 +17841,15 @@ msgstr "" msgid "Export Format" msgstr "" +#: platform/android/export/export_plugin.cpp +msgid "Min SDK" +msgstr "" + +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Target SDK" +msgstr "Nód Cumaisc2" + #: platform/android/export/export_plugin.cpp platform/iphone/export/export.cpp msgid "Architectures" msgstr "" @@ -17863,15 +17886,6 @@ msgstr "" msgid "Code" msgstr "" -#: platform/android/export/export_plugin.cpp -msgid "Min SDK" -msgstr "" - -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Target SDK" -msgstr "Nód Cumaisc2" - #: platform/android/export/export_plugin.cpp platform/uwp/export/export.cpp msgid "Package" msgstr "" @@ -18093,12 +18107,12 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"\"Hand Tracking\" is only valid when \"Xr Mode\" is \"Oculus Mobile VrApi\" " +"\"Hand Tracking\" is only valid when \"XR Mode\" is \"Oculus Mobile VrApi\" " "or \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Passthrough\" is only valid when \"Xr Mode\" is \"OpenXR\"." +msgid "\"Passthrough\" is only valid when \"XR Mode\" is \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp @@ -18107,17 +18121,37 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Min Sdk\" is only valid when \"Use Custom Build\" is enabled." +"\"Min SDK\" can only be overridden when \"Use Custom Build\" is enabled." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Min SDK\" should be a valid integer, but got \"%s\" which is invalid." msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Target Sdk\" is only valid when \"Use Custom Build\" is " -"enabled." +"\"Min SDK\" cannot be lower than %d, which is the version needed by the " +"Godot library." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Target Sdk\" version must be greater or equal to \"Min Sdk\" version." +msgid "" +"\"Target SDK\" can only be overridden when \"Use Custom Build\" is enabled." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Target SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Target SDK\" %d is higher than the default version %d. This may work, but " +"wasn't tested and may be unstable." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Target SDK\" version must be greater or equal to \"Min SDK\" version." msgstr "" #: platform/android/export/export_plugin.cpp platform/osx/export/export.cpp @@ -19656,7 +19690,7 @@ msgstr "" msgid "Custom Viewport" msgstr "" -#: scene/2d/camera_2d.cpp scene/3d/camera.cpp +#: scene/2d/camera_2d.cpp scene/3d/camera.cpp scene/3d/interpolated_camera.cpp #: scene/animation/animation_player.cpp scene/animation/animation_tree.cpp #: scene/animation/animation_tree_player.cpp scene/main/timer.cpp msgid "Process Mode" @@ -20339,6 +20373,10 @@ msgid "" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +msgid "Pathfinding" +msgstr "" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp msgid "Path Desired Distance" msgstr "" @@ -20347,29 +20385,34 @@ msgid "Target Desired Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Neighbor Dist" +msgid "Path Max Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Max Neighbors" -msgstr "" +#, fuzzy +msgid "Avoidance" +msgstr "Scagairí..." #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Time Horizon" +#, fuzzy +msgid "Avoidance Enabled" +msgstr "Scagairí..." + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +msgid "Neighbor Dist" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Max Speed" +msgid "Max Neighbors" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Path Max Distance" +msgid "Time Horizon" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -#, fuzzy -msgid "Avoidance Enabled" -msgstr "Scagairí..." +msgid "Max Speed" +msgstr "" #: scene/2d/navigation_agent_2d.cpp msgid "" @@ -23391,6 +23434,11 @@ msgstr "" #: scene/gui/text_edit.cpp #, fuzzy +msgid "Drag And Drop Selection Enabled" +msgstr "Scagairí..." + +#: scene/gui/text_edit.cpp +#, fuzzy msgid "Hiding Enabled" msgstr "Scagairí..." @@ -23752,16 +23800,17 @@ msgstr "Cosán" #: scene/main/viewport.cpp msgid "" -"This viewport is not set as render target. If you intend for it to display " -"its contents directly to the screen, make it a child of a Control so it can " -"obtain a size. Otherwise, make it a RenderTarget and assign its internal " -"texture to some node for display." +"The Viewport size must be greater than or equal to 2 pixels on both " +"dimensions to render anything." msgstr "" #: scene/main/viewport.cpp msgid "" -"The Viewport size must be greater than or equal to 2 pixels on both " -"dimensions to render anything." +"This Viewport has HDR enabled, but its Usage is set to 2D or 2D No-" +"Sampling.\n" +"HDR is only supported in Viewports that have their Usage set to 3D or 3D No-" +"Effects.\n" +"HDR will be disabled for this Viewport." msgstr "" #: scene/main/viewport.cpp diff --git a/editor/translations/gl.po b/editor/translations/gl.po index 27b15829fa..c8dd75ade3 100644 --- a/editor/translations/gl.po +++ b/editor/translations/gl.po @@ -425,6 +425,11 @@ msgstr "" msgid "Command" msgstr "Comunidade" +#: core/os/input_event.cpp +#, fuzzy +msgid "Physical" +msgstr "Fotograma de Física %" + #: core/os/input_event.cpp scene/2d/touch_screen_button.cpp #: scene/gui/base_button.cpp scene/gui/texture_button.cpp #: scene/resources/default_theme/default_theme.cpp @@ -5642,6 +5647,11 @@ msgid "Mouse Extra Buttons Navigate History" msgstr "" #: editor/editor_settings.cpp +#, fuzzy +msgid "Drag And Drop Selection" +msgstr "Encadrar Selección" + +#: editor/editor_settings.cpp msgid "Appearance" msgstr "" @@ -18796,6 +18806,11 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Custom Build" +msgstr "Cortar Nodos" + +#: platform/android/export/export_plugin.cpp msgid "Use Custom Build" msgstr "" @@ -18804,6 +18819,16 @@ msgstr "" msgid "Export Format" msgstr "Formato" +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Min SDK" +msgstr "Tamaño: " + +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Target SDK" +msgstr "Obxectivo" + #: platform/android/export/export_plugin.cpp platform/iphone/export/export.cpp msgid "Architectures" msgstr "" @@ -18843,16 +18868,6 @@ msgstr "Anterior Pestana" msgid "Code" msgstr "" -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Min SDK" -msgstr "Tamaño: " - -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Target SDK" -msgstr "Obxectivo" - #: platform/android/export/export_plugin.cpp platform/uwp/export/export.cpp #, fuzzy msgid "Package" @@ -19102,12 +19117,12 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"\"Hand Tracking\" is only valid when \"Xr Mode\" is \"Oculus Mobile VrApi\" " +"\"Hand Tracking\" is only valid when \"XR Mode\" is \"Oculus Mobile VrApi\" " "or \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Passthrough\" is only valid when \"Xr Mode\" is \"OpenXR\"." +msgid "\"Passthrough\" is only valid when \"XR Mode\" is \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp @@ -19116,17 +19131,37 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Min Sdk\" is only valid when \"Use Custom Build\" is enabled." +"\"Min SDK\" can only be overridden when \"Use Custom Build\" is enabled." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Min SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Min SDK\" cannot be lower than %d, which is the version needed by the " +"Godot library." msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Target Sdk\" is only valid when \"Use Custom Build\" is " -"enabled." +"\"Target SDK\" can only be overridden when \"Use Custom Build\" is enabled." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Target Sdk\" version must be greater or equal to \"Min Sdk\" version." +msgid "" +"\"Target SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Target SDK\" %d is higher than the default version %d. This may work, but " +"wasn't tested and may be unstable." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Target SDK\" version must be greater or equal to \"Min SDK\" version." msgstr "" #: platform/android/export/export_plugin.cpp platform/osx/export/export.cpp @@ -20782,7 +20817,7 @@ msgstr "Aumentar Zoom" msgid "Custom Viewport" msgstr "1 Ventá" -#: scene/2d/camera_2d.cpp scene/3d/camera.cpp +#: scene/2d/camera_2d.cpp scene/3d/camera.cpp scene/3d/interpolated_camera.cpp #: scene/animation/animation_player.cpp scene/animation/animation_tree.cpp #: scene/animation/animation_tree_player.cpp scene/main/timer.cpp #, fuzzy @@ -21524,6 +21559,11 @@ msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp #, fuzzy +msgid "Pathfinding" +msgstr "Pegar Animación" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy msgid "Path Desired Distance" msgstr "Elexir unha Escena Principal" @@ -21532,6 +21572,20 @@ msgid "Target Desired Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +msgid "Path Max Distance" +msgstr "" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Avoidance" +msgstr "Avanzado" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Avoidance Enabled" +msgstr "Activar" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp msgid "Neighbor Dist" msgstr "" @@ -21549,15 +21603,6 @@ msgstr "Horizontal:" msgid "Max Speed" msgstr "Velocidade:" -#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Path Max Distance" -msgstr "" - -#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -#, fuzzy -msgid "Avoidance Enabled" -msgstr "Activar" - #: scene/2d/navigation_agent_2d.cpp msgid "" "The NavigationAgent2D can be used only under a Node2D inheriting parent node." @@ -24887,6 +24932,11 @@ msgstr "Cartafol:" #: scene/gui/text_edit.cpp #, fuzzy +msgid "Drag And Drop Selection Enabled" +msgstr "Só a Selección" + +#: scene/gui/text_edit.cpp +#, fuzzy msgid "Hiding Enabled" msgstr "Activar" @@ -25283,18 +25333,6 @@ msgid "Viewport Path" msgstr "1 Ventá" #: scene/main/viewport.cpp -msgid "" -"This viewport is not set as render target. If you intend for it to display " -"its contents directly to the screen, make it a child of a Control so it can " -"obtain a size. Otherwise, make it a RenderTarget and assign its internal " -"texture to some node for display." -msgstr "" -"Esta Mini-Ventá (Viewport) no está configurada como obxectivo de " -"renderizado. Se quere que o seu contido se mostre directamente na pantalla, " -"convértao nun nodo fillo dun nodo Control para que poida recibir dimensións. " -"Ou ben, fágao un RenderTarget e asigne a súa textura a algún nodo." - -#: scene/main/viewport.cpp #, fuzzy msgid "" "The Viewport size must be greater than or equal to 2 pixels on both " @@ -25304,6 +25342,15 @@ msgstr "" "renderizar nada." #: scene/main/viewport.cpp +msgid "" +"This Viewport has HDR enabled, but its Usage is set to 2D or 2D No-" +"Sampling.\n" +"HDR is only supported in Viewports that have their Usage set to 3D or 3D No-" +"Effects.\n" +"HDR will be disabled for this Viewport." +msgstr "" + +#: scene/main/viewport.cpp msgid "ARVR" msgstr "" diff --git a/editor/translations/he.po b/editor/translations/he.po index 22cf33ba52..d37f806bb7 100644 --- a/editor/translations/he.po +++ b/editor/translations/he.po @@ -423,6 +423,11 @@ msgstr "" msgid "Command" msgstr "פיקוד" +#: core/os/input_event.cpp +#, fuzzy +msgid "Physical" +msgstr "פיזיקה" + #: core/os/input_event.cpp scene/2d/touch_screen_button.cpp #: scene/gui/base_button.cpp scene/gui/texture_button.cpp #: scene/resources/default_theme/default_theme.cpp @@ -5557,6 +5562,11 @@ msgid "Mouse Extra Buttons Navigate History" msgstr "" #: editor/editor_settings.cpp +#, fuzzy +msgid "Drag And Drop Selection" +msgstr "GridMap מילוי הבחירה" + +#: editor/editor_settings.cpp msgid "Appearance" msgstr "" @@ -18932,6 +18942,11 @@ msgid "The package must have at least one '.' separator." msgstr "החבילה חייבת לכלול לפחות מפריד '.' אחד." #: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Custom Build" +msgstr "גזירת מפרקים" + +#: platform/android/export/export_plugin.cpp msgid "Use Custom Build" msgstr "" @@ -18940,6 +18955,16 @@ msgstr "" msgid "Export Format" msgstr "ייצוא מיזם" +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Min SDK" +msgstr "מבט קדמי" + +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Target SDK" +msgstr "נתיב המשאב" + #: platform/android/export/export_plugin.cpp platform/iphone/export/export.cpp #, fuzzy msgid "Architectures" @@ -18980,16 +19005,6 @@ msgstr "בדיקת המופע הקודם" msgid "Code" msgstr "" -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Min SDK" -msgstr "מבט קדמי" - -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Target SDK" -msgstr "נתיב המשאב" - #: platform/android/export/export_plugin.cpp platform/uwp/export/export.cpp #, fuzzy msgid "Package" @@ -19244,13 +19259,13 @@ msgstr "חובה לאפשר ״שימוש בבניה מותאמת אישית״ כ #: platform/android/export/export_plugin.cpp #, fuzzy msgid "" -"\"Hand Tracking\" is only valid when \"Xr Mode\" is \"Oculus Mobile VrApi\" " +"\"Hand Tracking\" is only valid when \"XR Mode\" is \"Oculus Mobile VrApi\" " "or \"OpenXR\"." msgstr "\"Hand Tracking\" תקף רק כאשר \"מצב Xr\" הוא \"Oculus Mobile VR\"." #: platform/android/export/export_plugin.cpp #, fuzzy -msgid "\"Passthrough\" is only valid when \"Xr Mode\" is \"OpenXR\"." +msgid "\"Passthrough\" is only valid when \"XR Mode\" is \"OpenXR\"." msgstr "\"Hand Tracking\" תקף רק כאשר \"מצב Xr\" הוא \"Oculus Mobile VR\"." #: platform/android/export/export_plugin.cpp @@ -19259,17 +19274,37 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Min Sdk\" is only valid when \"Use Custom Build\" is enabled." +"\"Min SDK\" can only be overridden when \"Use Custom Build\" is enabled." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Min SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Min SDK\" cannot be lower than %d, which is the version needed by the " +"Godot library." msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Target Sdk\" is only valid when \"Use Custom Build\" is " -"enabled." +"\"Target SDK\" can only be overridden when \"Use Custom Build\" is enabled." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Target Sdk\" version must be greater or equal to \"Min Sdk\" version." +msgid "" +"\"Target SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Target SDK\" %d is higher than the default version %d. This may work, but " +"wasn't tested and may be unstable." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Target SDK\" version must be greater or equal to \"Min SDK\" version." msgstr "" #: platform/android/export/export_plugin.cpp platform/osx/export/export.cpp @@ -20942,7 +20977,7 @@ msgstr "התקרבות" msgid "Custom Viewport" msgstr "מבט תחתי" -#: scene/2d/camera_2d.cpp scene/3d/camera.cpp +#: scene/2d/camera_2d.cpp scene/3d/camera.cpp scene/3d/interpolated_camera.cpp #: scene/animation/animation_player.cpp scene/animation/animation_tree.cpp #: scene/animation/animation_tree_player.cpp scene/main/timer.cpp #, fuzzy @@ -21685,6 +21720,11 @@ msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp #, fuzzy +msgid "Pathfinding" +msgstr "קישור" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy msgid "Path Desired Distance" msgstr "בחירת מרחק:" @@ -21693,6 +21733,21 @@ msgid "Target Desired Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Path Max Distance" +msgstr "בחירת מרחק:" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Avoidance" +msgstr "מתקדם" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Avoidance Enabled" +msgstr "הפעלה" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp msgid "Neighbor Dist" msgstr "" @@ -21709,16 +21764,6 @@ msgstr "" msgid "Max Speed" msgstr "מהירות (FPS):" -#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -#, fuzzy -msgid "Path Max Distance" -msgstr "בחירת מרחק:" - -#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -#, fuzzy -msgid "Avoidance Enabled" -msgstr "הפעלה" - #: scene/2d/navigation_agent_2d.cpp msgid "" "The NavigationAgent2D can be used only under a Node2D inheriting parent node." @@ -25074,6 +25119,11 @@ msgstr "יצירת תיקייה" #: scene/gui/text_edit.cpp #, fuzzy +msgid "Drag And Drop Selection Enabled" +msgstr "בחירה בלבד" + +#: scene/gui/text_edit.cpp +#, fuzzy msgid "Hiding Enabled" msgstr "הפעלה" @@ -25476,17 +25526,6 @@ msgid "Viewport Path" msgstr "ייצוא מיזם" #: scene/main/viewport.cpp -msgid "" -"This viewport is not set as render target. If you intend for it to display " -"its contents directly to the screen, make it a child of a Control so it can " -"obtain a size. Otherwise, make it a RenderTarget and assign its internal " -"texture to some node for display." -msgstr "" -"חלון תצוגה זה אינו מוגדר כיעד עיבוד. להצגת התוכן ישירות למסך, יש להפוך אותו " -"לצאצא של בקר כדי שיקבל גודל. או להפוך אותו ל-RenderTarget ולשייך את המרקם " -"הפנימי שלו למפרק כלשהו לתצוגה." - -#: scene/main/viewport.cpp #, fuzzy msgid "" "The Viewport size must be greater than or equal to 2 pixels on both " @@ -25494,6 +25533,15 @@ msgid "" msgstr "גודל חלון התצוגה חייב להיות גדול מ-0 על מנת להציג משהו." #: scene/main/viewport.cpp +msgid "" +"This Viewport has HDR enabled, but its Usage is set to 2D or 2D No-" +"Sampling.\n" +"HDR is only supported in Viewports that have their Usage set to 3D or 3D No-" +"Effects.\n" +"HDR will be disabled for this Viewport." +msgstr "" + +#: scene/main/viewport.cpp msgid "ARVR" msgstr "" diff --git a/editor/translations/hi.po b/editor/translations/hi.po index a14fd36f4a..0e6bb551e4 100644 --- a/editor/translations/hi.po +++ b/editor/translations/hi.po @@ -406,6 +406,11 @@ msgstr "" msgid "Command" msgstr "समुदाय" +#: core/os/input_event.cpp +#, fuzzy +msgid "Physical" +msgstr "फिजिक्स फ्रेम %" + #: core/os/input_event.cpp scene/2d/touch_screen_button.cpp #: scene/gui/base_button.cpp scene/gui/texture_button.cpp #: scene/resources/default_theme/default_theme.cpp @@ -5562,6 +5567,11 @@ msgid "Mouse Extra Buttons Navigate History" msgstr "" #: editor/editor_settings.cpp +#, fuzzy +msgid "Drag And Drop Selection" +msgstr "सभी खंड" + +#: editor/editor_settings.cpp msgid "Appearance" msgstr "" @@ -18576,6 +18586,11 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Custom Build" +msgstr "प्रतिलिपि" + +#: platform/android/export/export_plugin.cpp msgid "Use Custom Build" msgstr "" @@ -18584,6 +18599,16 @@ msgstr "" msgid "Export Format" msgstr "एनीमेशन परिवर्तन परिणत" +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Min SDK" +msgstr "आकार: " + +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Target SDK" +msgstr "नोड हटाएं" + #: platform/android/export/export_plugin.cpp platform/iphone/export/export.cpp msgid "Architectures" msgstr "" @@ -18622,16 +18647,6 @@ msgstr "पिछला टैब" msgid "Code" msgstr "" -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Min SDK" -msgstr "आकार: " - -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Target SDK" -msgstr "नोड हटाएं" - #: platform/android/export/export_plugin.cpp platform/uwp/export/export.cpp #, fuzzy msgid "Package" @@ -18872,12 +18887,12 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"\"Hand Tracking\" is only valid when \"Xr Mode\" is \"Oculus Mobile VrApi\" " +"\"Hand Tracking\" is only valid when \"XR Mode\" is \"Oculus Mobile VrApi\" " "or \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Passthrough\" is only valid when \"Xr Mode\" is \"OpenXR\"." +msgid "\"Passthrough\" is only valid when \"XR Mode\" is \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp @@ -18886,17 +18901,37 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Min Sdk\" is only valid when \"Use Custom Build\" is enabled." +"\"Min SDK\" can only be overridden when \"Use Custom Build\" is enabled." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Min SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Min SDK\" cannot be lower than %d, which is the version needed by the " +"Godot library." msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Target Sdk\" is only valid when \"Use Custom Build\" is " -"enabled." +"\"Target SDK\" can only be overridden when \"Use Custom Build\" is enabled." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Target Sdk\" version must be greater or equal to \"Min Sdk\" version." +msgid "" +"\"Target SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Target SDK\" %d is higher than the default version %d. This may work, but " +"wasn't tested and may be unstable." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Target SDK\" version must be greater or equal to \"Min SDK\" version." msgstr "" #: platform/android/export/export_plugin.cpp platform/osx/export/export.cpp @@ -20534,7 +20569,7 @@ msgstr "बड़ा करो" msgid "Custom Viewport" msgstr "व्यूपोर्ट चुनें" -#: scene/2d/camera_2d.cpp scene/3d/camera.cpp +#: scene/2d/camera_2d.cpp scene/3d/camera.cpp scene/3d/interpolated_camera.cpp #: scene/animation/animation_player.cpp scene/animation/animation_tree.cpp #: scene/animation/animation_tree_player.cpp scene/main/timer.cpp #, fuzzy @@ -21247,6 +21282,11 @@ msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp #, fuzzy +msgid "Pathfinding" +msgstr "कोन्स्टन्ट" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy msgid "Path Desired Distance" msgstr "एक मुख्य दृश्य चुनें" @@ -21255,29 +21295,34 @@ msgid "Target Desired Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Neighbor Dist" +msgid "Path Max Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Max Neighbors" -msgstr "" +#, fuzzy +msgid "Avoidance" +msgstr "अग्रवर्ती" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Time Horizon" +#, fuzzy +msgid "Avoidance Enabled" +msgstr "सक्रिय करे" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +msgid "Neighbor Dist" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Max Speed" +msgid "Max Neighbors" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Path Max Distance" +msgid "Time Horizon" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -#, fuzzy -msgid "Avoidance Enabled" -msgstr "सक्रिय करे" +msgid "Max Speed" +msgstr "" #: scene/2d/navigation_agent_2d.cpp msgid "" @@ -24471,6 +24516,11 @@ msgstr "फ़ोल्डर:" #: scene/gui/text_edit.cpp #, fuzzy +msgid "Drag And Drop Selection Enabled" +msgstr "सिर्फ चयन किये हुए" + +#: scene/gui/text_edit.cpp +#, fuzzy msgid "Hiding Enabled" msgstr "सक्रिय करे" @@ -24865,16 +24915,17 @@ msgstr "फ़ोकस पाथ" #: scene/main/viewport.cpp msgid "" -"This viewport is not set as render target. If you intend for it to display " -"its contents directly to the screen, make it a child of a Control so it can " -"obtain a size. Otherwise, make it a RenderTarget and assign its internal " -"texture to some node for display." +"The Viewport size must be greater than or equal to 2 pixels on both " +"dimensions to render anything." msgstr "" #: scene/main/viewport.cpp msgid "" -"The Viewport size must be greater than or equal to 2 pixels on both " -"dimensions to render anything." +"This Viewport has HDR enabled, but its Usage is set to 2D or 2D No-" +"Sampling.\n" +"HDR is only supported in Viewports that have their Usage set to 3D or 3D No-" +"Effects.\n" +"HDR will be disabled for this Viewport." msgstr "" #: scene/main/viewport.cpp diff --git a/editor/translations/hr.po b/editor/translations/hr.po index 9a3dabefb3..c1a9a444cc 100644 --- a/editor/translations/hr.po +++ b/editor/translations/hr.po @@ -408,6 +408,11 @@ msgstr "" msgid "Command" msgstr "Zajednica" +#: core/os/input_event.cpp +#, fuzzy +msgid "Physical" +msgstr "Omogući" + #: core/os/input_event.cpp scene/2d/touch_screen_button.cpp #: scene/gui/base_button.cpp scene/gui/texture_button.cpp #: scene/resources/default_theme/default_theme.cpp @@ -5381,6 +5386,11 @@ msgid "Mouse Extra Buttons Navigate History" msgstr "" #: editor/editor_settings.cpp +#, fuzzy +msgid "Drag And Drop Selection" +msgstr "Izbriši Odabir" + +#: editor/editor_settings.cpp msgid "Appearance" msgstr "" @@ -18135,6 +18145,11 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Custom Build" +msgstr "Pomakni Bezier Točke" + +#: platform/android/export/export_plugin.cpp msgid "Use Custom Build" msgstr "" @@ -18143,6 +18158,16 @@ msgstr "" msgid "Export Format" msgstr "Izvoz" +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Min SDK" +msgstr "Glavna skripta:" + +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Target SDK" +msgstr "Premjesti čvor(node)" + #: platform/android/export/export_plugin.cpp platform/iphone/export/export.cpp msgid "Architectures" msgstr "" @@ -18179,16 +18204,6 @@ msgstr "" msgid "Code" msgstr "" -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Min SDK" -msgstr "Glavna skripta:" - -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Target SDK" -msgstr "Premjesti čvor(node)" - #: platform/android/export/export_plugin.cpp platform/uwp/export/export.cpp msgid "Package" msgstr "" @@ -18419,12 +18434,12 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"\"Hand Tracking\" is only valid when \"Xr Mode\" is \"Oculus Mobile VrApi\" " +"\"Hand Tracking\" is only valid when \"XR Mode\" is \"Oculus Mobile VrApi\" " "or \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Passthrough\" is only valid when \"Xr Mode\" is \"OpenXR\"." +msgid "\"Passthrough\" is only valid when \"XR Mode\" is \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp @@ -18433,17 +18448,37 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Min Sdk\" is only valid when \"Use Custom Build\" is enabled." +"\"Min SDK\" can only be overridden when \"Use Custom Build\" is enabled." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Min SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Min SDK\" cannot be lower than %d, which is the version needed by the " +"Godot library." msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Target Sdk\" is only valid when \"Use Custom Build\" is " -"enabled." +"\"Target SDK\" can only be overridden when \"Use Custom Build\" is enabled." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Target Sdk\" version must be greater or equal to \"Min Sdk\" version." +msgid "" +"\"Target SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Target SDK\" %d is higher than the default version %d. This may work, but " +"wasn't tested and may be unstable." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Target SDK\" version must be greater or equal to \"Min SDK\" version." msgstr "" #: platform/android/export/export_plugin.cpp platform/osx/export/export.cpp @@ -20025,7 +20060,7 @@ msgstr "Zumiraj" msgid "Custom Viewport" msgstr "" -#: scene/2d/camera_2d.cpp scene/3d/camera.cpp +#: scene/2d/camera_2d.cpp scene/3d/camera.cpp scene/3d/interpolated_camera.cpp #: scene/animation/animation_player.cpp scene/animation/animation_tree.cpp #: scene/animation/animation_tree_player.cpp scene/main/timer.cpp msgid "Process Mode" @@ -20728,6 +20763,11 @@ msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp #, fuzzy +msgid "Pathfinding" +msgstr "Zalijepi Animaciju" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy msgid "Path Desired Distance" msgstr "Instaliraj" @@ -20736,29 +20776,34 @@ msgid "Target Desired Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Neighbor Dist" +msgid "Path Max Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Max Neighbors" -msgstr "" +#, fuzzy +msgid "Avoidance" +msgstr "Napredno" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Time Horizon" +#, fuzzy +msgid "Avoidance Enabled" +msgstr "Omogući" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +msgid "Neighbor Dist" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Max Speed" +msgid "Max Neighbors" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Path Max Distance" +msgid "Time Horizon" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -#, fuzzy -msgid "Avoidance Enabled" -msgstr "Omogući" +msgid "Max Speed" +msgstr "" #: scene/2d/navigation_agent_2d.cpp msgid "" @@ -23883,6 +23928,11 @@ msgstr "" #: scene/gui/text_edit.cpp #, fuzzy +msgid "Drag And Drop Selection Enabled" +msgstr "Samo odabir" + +#: scene/gui/text_edit.cpp +#, fuzzy msgid "Hiding Enabled" msgstr "Omogući" @@ -24260,16 +24310,17 @@ msgstr "Put" #: scene/main/viewport.cpp msgid "" -"This viewport is not set as render target. If you intend for it to display " -"its contents directly to the screen, make it a child of a Control so it can " -"obtain a size. Otherwise, make it a RenderTarget and assign its internal " -"texture to some node for display." +"The Viewport size must be greater than or equal to 2 pixels on both " +"dimensions to render anything." msgstr "" #: scene/main/viewport.cpp msgid "" -"The Viewport size must be greater than or equal to 2 pixels on both " -"dimensions to render anything." +"This Viewport has HDR enabled, but its Usage is set to 2D or 2D No-" +"Sampling.\n" +"HDR is only supported in Viewports that have their Usage set to 3D or 3D No-" +"Effects.\n" +"HDR will be disabled for this Viewport." msgstr "" #: scene/main/viewport.cpp diff --git a/editor/translations/hu.po b/editor/translations/hu.po index 62f30698a3..5bfd5b0995 100644 --- a/editor/translations/hu.po +++ b/editor/translations/hu.po @@ -445,6 +445,11 @@ msgstr "" msgid "Command" msgstr "Közösség" +#: core/os/input_event.cpp +#, fuzzy +msgid "Physical" +msgstr "Fizika Keret %" + #: core/os/input_event.cpp scene/2d/touch_screen_button.cpp #: scene/gui/base_button.cpp scene/gui/texture_button.cpp #: scene/resources/default_theme/default_theme.cpp @@ -5670,6 +5675,11 @@ msgid "Mouse Extra Buttons Navigate History" msgstr "" #: editor/editor_settings.cpp +#, fuzzy +msgid "Drag And Drop Selection" +msgstr "Kijelölés Keretezése" + +#: editor/editor_settings.cpp msgid "Appearance" msgstr "" @@ -18763,6 +18773,11 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Custom Build" +msgstr "Node-ok kivágása" + +#: platform/android/export/export_plugin.cpp msgid "Use Custom Build" msgstr "" @@ -18771,6 +18786,16 @@ msgstr "" msgid "Export Format" msgstr "Exportálási Útvonal" +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Min SDK" +msgstr "Körvonal Mérete:" + +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Target SDK" +msgstr "Cél Felület:" + #: platform/android/export/export_plugin.cpp platform/iphone/export/export.cpp msgid "Architectures" msgstr "" @@ -18810,16 +18835,6 @@ msgstr "Előző lap" msgid "Code" msgstr "" -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Min SDK" -msgstr "Körvonal Mérete:" - -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Target SDK" -msgstr "Cél Felület:" - #: platform/android/export/export_plugin.cpp platform/uwp/export/export.cpp #, fuzzy msgid "Package" @@ -19065,12 +19080,12 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"\"Hand Tracking\" is only valid when \"Xr Mode\" is \"Oculus Mobile VrApi\" " +"\"Hand Tracking\" is only valid when \"XR Mode\" is \"Oculus Mobile VrApi\" " "or \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Passthrough\" is only valid when \"Xr Mode\" is \"OpenXR\"." +msgid "\"Passthrough\" is only valid when \"XR Mode\" is \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp @@ -19079,17 +19094,37 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Min Sdk\" is only valid when \"Use Custom Build\" is enabled." +"\"Min SDK\" can only be overridden when \"Use Custom Build\" is enabled." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Min SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Min SDK\" cannot be lower than %d, which is the version needed by the " +"Godot library." msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Target Sdk\" is only valid when \"Use Custom Build\" is " -"enabled." +"\"Target SDK\" can only be overridden when \"Use Custom Build\" is enabled." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Target Sdk\" version must be greater or equal to \"Min Sdk\" version." +msgid "" +"\"Target SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Target SDK\" %d is higher than the default version %d. This may work, but " +"wasn't tested and may be unstable." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Target SDK\" version must be greater or equal to \"Min SDK\" version." msgstr "" #: platform/android/export/export_plugin.cpp platform/osx/export/export.cpp @@ -20740,7 +20775,7 @@ msgstr "Nagyítás" msgid "Custom Viewport" msgstr "Nézet Megjelenítése" -#: scene/2d/camera_2d.cpp scene/3d/camera.cpp +#: scene/2d/camera_2d.cpp scene/3d/camera.cpp scene/3d/interpolated_camera.cpp #: scene/animation/animation_player.cpp scene/animation/animation_tree.cpp #: scene/animation/animation_tree_player.cpp scene/main/timer.cpp #, fuzzy @@ -21476,6 +21511,11 @@ msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp #, fuzzy +msgid "Pathfinding" +msgstr "Véletlenszerű Forgatás:" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy msgid "Path Desired Distance" msgstr "Válasszon egy Fő Jelenetet" @@ -21484,29 +21524,34 @@ msgid "Target Desired Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Neighbor Dist" +msgid "Path Max Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Max Neighbors" -msgstr "" +#, fuzzy +msgid "Avoidance" +msgstr "Speciális" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Time Horizon" +#, fuzzy +msgid "Avoidance Enabled" +msgstr "Engedélyezés" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +msgid "Neighbor Dist" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Max Speed" +msgid "Max Neighbors" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Path Max Distance" +msgid "Time Horizon" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -#, fuzzy -msgid "Avoidance Enabled" -msgstr "Engedélyezés" +msgid "Max Speed" +msgstr "" #: scene/2d/navigation_agent_2d.cpp msgid "" @@ -24797,6 +24842,11 @@ msgstr "Mappa:" #: scene/gui/text_edit.cpp #, fuzzy +msgid "Drag And Drop Selection Enabled" +msgstr "Csak kijelölés" + +#: scene/gui/text_edit.cpp +#, fuzzy msgid "Hiding Enabled" msgstr "Engedélyezés" @@ -25199,20 +25249,17 @@ msgstr "Exportálási Útvonal" #: scene/main/viewport.cpp msgid "" -"This viewport is not set as render target. If you intend for it to display " -"its contents directly to the screen, make it a child of a Control so it can " -"obtain a size. Otherwise, make it a RenderTarget and assign its internal " -"texture to some node for display." +"The Viewport size must be greater than or equal to 2 pixels on both " +"dimensions to render anything." msgstr "" -"Ez a nézetablak nincs beállítva leképezési célnak. Ha azt szeretné, hogy a " -"tartalma közvetlenül a képernyőn jelenjen meg, tegye azt egy Control " -"gyermekévé, hogy így kapjon méretet. Ellenkező esetben tegye RenderTarget-" -"té, és állítsa hozzá a belső textúráját valamilyen node-hoz kirajzolásra." #: scene/main/viewport.cpp msgid "" -"The Viewport size must be greater than or equal to 2 pixels on both " -"dimensions to render anything." +"This Viewport has HDR enabled, but its Usage is set to 2D or 2D No-" +"Sampling.\n" +"HDR is only supported in Viewports that have their Usage set to 3D or 3D No-" +"Effects.\n" +"HDR will be disabled for this Viewport." msgstr "" #: scene/main/viewport.cpp diff --git a/editor/translations/id.po b/editor/translations/id.po index 4d71521032..57c1a69e92 100644 --- a/editor/translations/id.po +++ b/editor/translations/id.po @@ -425,6 +425,11 @@ msgstr "Meta" msgid "Command" msgstr "Perintah" +#: core/os/input_event.cpp +#, fuzzy +msgid "Physical" +msgstr " (Secara fisik)" + #: core/os/input_event.cpp scene/2d/touch_screen_button.cpp #: scene/gui/base_button.cpp scene/gui/texture_button.cpp #: scene/resources/default_theme/default_theme.cpp @@ -5601,6 +5606,11 @@ msgid "Mouse Extra Buttons Navigate History" msgstr "Tombol Ekstra Mouse Navigasi Riwayat" #: editor/editor_settings.cpp +#, fuzzy +msgid "Drag And Drop Selection" +msgstr "Isi Seleksi GridMap" + +#: editor/editor_settings.cpp msgid "Appearance" msgstr "Penampilan" @@ -18874,6 +18884,11 @@ msgstr "Package setidaknya harus memiliki sebuah pemisah '.'." #: platform/android/export/export_plugin.cpp #, fuzzy +msgid "Custom Build" +msgstr "Gunakan Direktori Pengguna Kustom" + +#: platform/android/export/export_plugin.cpp +#, fuzzy msgid "Use Custom Build" msgstr "Gunakan Direktori Pengguna Kustom" @@ -18882,6 +18897,16 @@ msgstr "Gunakan Direktori Pengguna Kustom" msgid "Export Format" msgstr "Lokasi Ekspor" +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Min SDK" +msgstr "Ukuran Garis Tepi:" + +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Target SDK" +msgstr "FPS Sasaran" + #: platform/android/export/export_plugin.cpp platform/iphone/export/export.cpp #, fuzzy msgid "Architectures" @@ -18924,16 +18949,6 @@ msgstr "Inspeksi Instance Sebelumnya" msgid "Code" msgstr "Kode" -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Min SDK" -msgstr "Ukuran Garis Tepi:" - -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Target SDK" -msgstr "FPS Sasaran" - #: platform/android/export/export_plugin.cpp platform/uwp/export/export.cpp #, fuzzy msgid "Package" @@ -19174,7 +19189,7 @@ msgstr "\"Gunakan Build Custom\" harus diaktifkan untuk menggunakan plugin." #: platform/android/export/export_plugin.cpp #, fuzzy msgid "" -"\"Hand Tracking\" is only valid when \"Xr Mode\" is \"Oculus Mobile VrApi\" " +"\"Hand Tracking\" is only valid when \"XR Mode\" is \"Oculus Mobile VrApi\" " "or \"OpenXR\"." msgstr "" "\"Pelacakan Tangan\" hanya valid ketika \"Mode Xr\" bernilai \"Oculus Mobile " @@ -19182,7 +19197,7 @@ msgstr "" #: platform/android/export/export_plugin.cpp #, fuzzy -msgid "\"Passthrough\" is only valid when \"Xr Mode\" is \"OpenXR\"." +msgid "\"Passthrough\" is only valid when \"XR Mode\" is \"OpenXR\"." msgstr "" "\"Pelacakan Tangan\" hanya valid ketika \"Mode Xr\" bernilai \"Oculus Mobile " "VR\"." @@ -19195,20 +19210,41 @@ msgstr "" #: platform/android/export/export_plugin.cpp #, fuzzy msgid "" -"Changing the \"Min Sdk\" is only valid when \"Use Custom Build\" is enabled." +"\"Min SDK\" can only be overridden when \"Use Custom Build\" is enabled." msgstr "" "\"Expor AAB\" hanya bisa valid ketika \"Gunakan Build Custom\" diaktifkan." #: platform/android/export/export_plugin.cpp +msgid "\"Min SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Min SDK\" cannot be lower than %d, which is the version needed by the " +"Godot library." +msgstr "" + +#: platform/android/export/export_plugin.cpp #, fuzzy msgid "" -"Changing the \"Target Sdk\" is only valid when \"Use Custom Build\" is " -"enabled." +"\"Target SDK\" can only be overridden when \"Use Custom Build\" is enabled." msgstr "" "\"Expor AAB\" hanya bisa valid ketika \"Gunakan Build Custom\" diaktifkan." #: platform/android/export/export_plugin.cpp -msgid "\"Target Sdk\" version must be greater or equal to \"Min Sdk\" version." +msgid "" +"\"Target SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Target SDK\" %d is higher than the default version %d. This may work, but " +"wasn't tested and may be unstable." +msgstr "" + +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "\"Target SDK\" version must be greater or equal to \"Min SDK\" version." msgstr "" "Versi \"Target SDK\" harus lebih tinggi atau sama dengan versi \"Min SDK\"." @@ -20881,7 +20917,7 @@ msgstr "Perbesar Pandangan" msgid "Custom Viewport" msgstr "Penampil Kustom" -#: scene/2d/camera_2d.cpp scene/3d/camera.cpp +#: scene/2d/camera_2d.cpp scene/3d/camera.cpp scene/3d/interpolated_camera.cpp #: scene/animation/animation_player.cpp scene/animation/animation_tree.cpp #: scene/animation/animation_tree_player.cpp scene/main/timer.cpp #, fuzzy @@ -21627,6 +21663,11 @@ msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp #, fuzzy +msgid "Pathfinding" +msgstr "Mengikat" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy msgid "Path Desired Distance" msgstr "Target Jarak yang Diinginkan" @@ -21635,6 +21676,21 @@ msgid "Target Desired Distance" msgstr "Target Jarak yang Diinginkan" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Path Max Distance" +msgstr "Pilih Jarak:" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Avoidance" +msgstr "Lanjut" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Avoidance Enabled" +msgstr "Aktifkan" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp msgid "Neighbor Dist" msgstr "" @@ -21651,16 +21707,6 @@ msgstr "Balik secara Horizontal" msgid "Max Speed" msgstr "Kecepatan Maks" -#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -#, fuzzy -msgid "Path Max Distance" -msgstr "Pilih Jarak:" - -#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -#, fuzzy -msgid "Avoidance Enabled" -msgstr "Aktifkan" - #: scene/2d/navigation_agent_2d.cpp #, fuzzy msgid "" @@ -25037,6 +25083,11 @@ msgstr "Direktori:" #: scene/gui/text_edit.cpp #, fuzzy +msgid "Drag And Drop Selection Enabled" +msgstr "Hanya yang Dipilih" + +#: scene/gui/text_edit.cpp +#, fuzzy msgid "Hiding Enabled" msgstr "Aktifkan" @@ -25443,19 +25494,6 @@ msgid "Viewport Path" msgstr "Lokasi Ekspor" #: scene/main/viewport.cpp -msgid "" -"This viewport is not set as render target. If you intend for it to display " -"its contents directly to the screen, make it a child of a Control so it can " -"obtain a size. Otherwise, make it a RenderTarget and assign its internal " -"texture to some node for display." -msgstr "" -"Viewport ini tidak diatur sebagai target render. Jika anda berniat untuk " -"menampilkan konten-kontennya secara langsung ke layar, jadikan viewport ini " -"sebagai child dari sebuah Control agar ia bisa memperoleh ukuran. Jika " -"tidak, jadikan sebagai RenderTarget dan tetapkan tekstur internal nya ke " -"beberapa node untuk ditampilkan." - -#: scene/main/viewport.cpp #, fuzzy msgid "" "The Viewport size must be greater than or equal to 2 pixels on both " @@ -25463,6 +25501,15 @@ msgid "" msgstr "Ukuran viewport harus lebih besar dari 0 untuk me-render apa pun." #: scene/main/viewport.cpp +msgid "" +"This Viewport has HDR enabled, but its Usage is set to 2D or 2D No-" +"Sampling.\n" +"HDR is only supported in Viewports that have their Usage set to 3D or 3D No-" +"Effects.\n" +"HDR will be disabled for this Viewport." +msgstr "" + +#: scene/main/viewport.cpp msgid "ARVR" msgstr "" diff --git a/editor/translations/is.po b/editor/translations/is.po index 105220c71e..d5353421d4 100644 --- a/editor/translations/is.po +++ b/editor/translations/is.po @@ -401,6 +401,10 @@ msgstr "" msgid "Command" msgstr "" +#: core/os/input_event.cpp +msgid "Physical" +msgstr "" + #: core/os/input_event.cpp scene/2d/touch_screen_button.cpp #: scene/gui/base_button.cpp scene/gui/texture_button.cpp #: scene/resources/default_theme/default_theme.cpp @@ -5368,6 +5372,11 @@ msgid "Mouse Extra Buttons Navigate History" msgstr "" #: editor/editor_settings.cpp +#, fuzzy +msgid "Drag And Drop Selection" +msgstr "Allt úrvalið" + +#: editor/editor_settings.cpp msgid "Appearance" msgstr "" @@ -18081,6 +18090,11 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Custom Build" +msgstr "Tvíteknir lyklar" + +#: platform/android/export/export_plugin.cpp msgid "Use Custom Build" msgstr "" @@ -18089,6 +18103,15 @@ msgstr "" msgid "Export Format" msgstr "Breyta umbreytingu" +#: platform/android/export/export_plugin.cpp +msgid "Min SDK" +msgstr "" + +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Target SDK" +msgstr "Anim DELETE-lyklar" + #: platform/android/export/export_plugin.cpp platform/iphone/export/export.cpp msgid "Architectures" msgstr "" @@ -18125,15 +18148,6 @@ msgstr "" msgid "Code" msgstr "" -#: platform/android/export/export_plugin.cpp -msgid "Min SDK" -msgstr "" - -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Target SDK" -msgstr "Anim DELETE-lyklar" - #: platform/android/export/export_plugin.cpp platform/uwp/export/export.cpp msgid "Package" msgstr "" @@ -18361,12 +18375,12 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"\"Hand Tracking\" is only valid when \"Xr Mode\" is \"Oculus Mobile VrApi\" " +"\"Hand Tracking\" is only valid when \"XR Mode\" is \"Oculus Mobile VrApi\" " "or \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Passthrough\" is only valid when \"Xr Mode\" is \"OpenXR\"." +msgid "\"Passthrough\" is only valid when \"XR Mode\" is \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp @@ -18375,17 +18389,37 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Min Sdk\" is only valid when \"Use Custom Build\" is enabled." +"\"Min SDK\" can only be overridden when \"Use Custom Build\" is enabled." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Min SDK\" should be a valid integer, but got \"%s\" which is invalid." msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Target Sdk\" is only valid when \"Use Custom Build\" is " -"enabled." +"\"Min SDK\" cannot be lower than %d, which is the version needed by the " +"Godot library." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Target Sdk\" version must be greater or equal to \"Min Sdk\" version." +msgid "" +"\"Target SDK\" can only be overridden when \"Use Custom Build\" is enabled." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Target SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Target SDK\" %d is higher than the default version %d. This may work, but " +"wasn't tested and may be unstable." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Target SDK\" version must be greater or equal to \"Min SDK\" version." msgstr "" #: platform/android/export/export_plugin.cpp platform/osx/export/export.cpp @@ -19932,7 +19966,7 @@ msgstr "" msgid "Custom Viewport" msgstr "" -#: scene/2d/camera_2d.cpp scene/3d/camera.cpp +#: scene/2d/camera_2d.cpp scene/3d/camera.cpp scene/3d/interpolated_camera.cpp #: scene/animation/animation_player.cpp scene/animation/animation_tree.cpp #: scene/animation/animation_tree_player.cpp scene/main/timer.cpp msgid "Process Mode" @@ -20625,6 +20659,10 @@ msgid "" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +msgid "Pathfinding" +msgstr "" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp msgid "Path Desired Distance" msgstr "" @@ -20633,29 +20671,34 @@ msgid "Target Desired Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Neighbor Dist" +msgid "Path Max Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Max Neighbors" -msgstr "" +#, fuzzy +msgid "Avoidance" +msgstr "Fjarlægja val" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Time Horizon" +#, fuzzy +msgid "Avoidance Enabled" +msgstr "Fjarlægja val" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +msgid "Neighbor Dist" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Max Speed" +msgid "Max Neighbors" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Path Max Distance" +msgid "Time Horizon" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -#, fuzzy -msgid "Avoidance Enabled" -msgstr "Fjarlægja val" +msgid "Max Speed" +msgstr "" #: scene/2d/navigation_agent_2d.cpp msgid "" @@ -23706,6 +23749,11 @@ msgid "Fold Gutter" msgstr "" #: scene/gui/text_edit.cpp +#, fuzzy +msgid "Drag And Drop Selection Enabled" +msgstr "Afrita val" + +#: scene/gui/text_edit.cpp msgid "Hiding Enabled" msgstr "" @@ -24077,16 +24125,17 @@ msgstr "" #: scene/main/viewport.cpp msgid "" -"This viewport is not set as render target. If you intend for it to display " -"its contents directly to the screen, make it a child of a Control so it can " -"obtain a size. Otherwise, make it a RenderTarget and assign its internal " -"texture to some node for display." +"The Viewport size must be greater than or equal to 2 pixels on both " +"dimensions to render anything." msgstr "" #: scene/main/viewport.cpp msgid "" -"The Viewport size must be greater than or equal to 2 pixels on both " -"dimensions to render anything." +"This Viewport has HDR enabled, but its Usage is set to 2D or 2D No-" +"Sampling.\n" +"HDR is only supported in Viewports that have their Usage set to 3D or 3D No-" +"Effects.\n" +"HDR will be disabled for this Viewport." msgstr "" #: scene/main/viewport.cpp diff --git a/editor/translations/it.po b/editor/translations/it.po index 074bb4259d..e693139e21 100644 --- a/editor/translations/it.po +++ b/editor/translations/it.po @@ -68,13 +68,14 @@ # Alfonso Scarpino <alfonso.scarpino@gmail.com>, 2022. # Federico Caprini <caprinifede@gmail.com>, 2022. # Alessandro Casalino <alessandro.casalino93@gmail.com>, 2022. +# conecat <ilgrandemax190@gmail.com>, 2022. msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "Report-Msgid-Bugs-To: https://github.com/godotengine/godot\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2022-06-26 16:16+0000\n" -"Last-Translator: Mirko <miknsop@gmail.com>\n" +"PO-Revision-Date: 2022-07-04 05:16+0000\n" +"Last-Translator: conecat <ilgrandemax190@gmail.com>\n" "Language-Team: Italian <https://hosted.weblate.org/projects/godot-engine/" "godot/it/>\n" "Language: it\n" @@ -419,14 +420,12 @@ msgid "Max Size (KB)" msgstr "Dimensione Massima (KB)" #: core/os/input.cpp -#, fuzzy msgid "Mouse Mode" -msgstr "Modalità spostamento" +msgstr "Modalità Mouse" #: core/os/input.cpp -#, fuzzy msgid "Use Accumulated Input" -msgstr "Elimina Input" +msgstr "Usa Input Accumulato" #: core/os/input_event.cpp editor/project_settings_editor.cpp #: servers/audio_server.cpp @@ -453,6 +452,11 @@ msgstr "Meta" msgid "Command" msgstr "Comando" +#: core/os/input_event.cpp +#, fuzzy +msgid "Physical" +msgstr " (Fisico)" + #: core/os/input_event.cpp scene/2d/touch_screen_button.cpp #: scene/gui/base_button.cpp scene/gui/texture_button.cpp #: scene/resources/default_theme/default_theme.cpp @@ -1237,9 +1241,8 @@ msgid "Animation" msgstr "Animazione" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Easing" -msgstr "Easing" +msgstr "Allentamento" #: editor/animation_track_editor.cpp msgid "Anim Multi Change Keyframe Time" @@ -1353,14 +1356,12 @@ msgid "Time (s):" msgstr "Tempo (s):" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Position:" -msgstr "Posizione" +msgstr "Posizione:" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Rotation:" -msgstr "Rotazione" +msgstr "Rotazione:" #: editor/animation_track_editor.cpp #: editor/plugins/animation_tree_player_editor_plugin.cpp @@ -1382,9 +1383,8 @@ msgid "(Invalid, expected type: %s)" msgstr "Template di esportazione non valido:" #: editor/animation_track_editor.cpp -#, fuzzy msgid "Easing:" -msgstr "Easing" +msgstr "Allentamento:" #: editor/animation_track_editor.cpp #, fuzzy @@ -5573,6 +5573,11 @@ msgid "Mouse Extra Buttons Navigate History" msgstr "Uso dei tasti aggiuntivi del mouse per navigare la cronologia" #: editor/editor_settings.cpp +#, fuzzy +msgid "Drag And Drop Selection" +msgstr "Selezione GridMap" + +#: editor/editor_settings.cpp msgid "Appearance" msgstr "Aspetto" @@ -16241,8 +16246,9 @@ msgid "Flush stdout On Print" msgstr "Svuota stdout Alla Stampa" #: main/main.cpp servers/visual_server.cpp +#, fuzzy msgid "Logging" -msgstr "" +msgstr "Logging" #: main/main.cpp msgid "File Logging" @@ -18562,6 +18568,11 @@ msgid "The package must have at least one '.' separator." msgstr "Il pacchetto deve avere almeno un \".\" separatore." #: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Custom Build" +msgstr "Utilizza Build Personalizzata" + +#: platform/android/export/export_plugin.cpp msgid "Use Custom Build" msgstr "Utilizza Build Personalizzata" @@ -18569,6 +18580,14 @@ msgstr "Utilizza Build Personalizzata" msgid "Export Format" msgstr "Formato Esportazione" +#: platform/android/export/export_plugin.cpp +msgid "Min SDK" +msgstr "SDK Min" + +#: platform/android/export/export_plugin.cpp +msgid "Target SDK" +msgstr "Target SDK" + #: platform/android/export/export_plugin.cpp platform/iphone/export/export.cpp #, fuzzy msgid "Architectures" @@ -18607,14 +18626,6 @@ msgstr "Elimina Installazione Precedente" msgid "Code" msgstr "Codice" -#: platform/android/export/export_plugin.cpp -msgid "Min SDK" -msgstr "SDK Min" - -#: platform/android/export/export_plugin.cpp -msgid "Target SDK" -msgstr "Target SDK" - #: platform/android/export/export_plugin.cpp platform/uwp/export/export.cpp msgid "Package" msgstr "Pacchetto" @@ -18856,7 +18867,7 @@ msgstr "Per utilizzare i plugin \"Use Custom Build\" deve essere abilitato." #: platform/android/export/export_plugin.cpp #, fuzzy msgid "" -"\"Hand Tracking\" is only valid when \"Xr Mode\" is \"Oculus Mobile VrApi\" " +"\"Hand Tracking\" is only valid when \"XR Mode\" is \"Oculus Mobile VrApi\" " "or \"OpenXR\"." msgstr "" "\"Hand Tracking\" è valido solo quando \"Xr Mode\" è impostato su \"Oculus " @@ -18864,7 +18875,7 @@ msgstr "" #: platform/android/export/export_plugin.cpp #, fuzzy -msgid "\"Passthrough\" is only valid when \"Xr Mode\" is \"OpenXR\"." +msgid "\"Passthrough\" is only valid when \"XR Mode\" is \"OpenXR\"." msgstr "" "\"Hand Tracking\" è valido solo quando \"Xr Mode\" è impostato su \"Oculus " "Mobile VR\"." @@ -18877,20 +18888,40 @@ msgstr "" #: platform/android/export/export_plugin.cpp #, fuzzy msgid "" -"Changing the \"Min Sdk\" is only valid when \"Use Custom Build\" is enabled." +"\"Min SDK\" can only be overridden when \"Use Custom Build\" is enabled." msgstr "" "\"Export AAB\" è valido soltanto quanto \"Use Custom Build\" è abilitato." #: platform/android/export/export_plugin.cpp +msgid "\"Min SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Min SDK\" cannot be lower than %d, which is the version needed by the " +"Godot library." +msgstr "" + +#: platform/android/export/export_plugin.cpp #, fuzzy msgid "" -"Changing the \"Target Sdk\" is only valid when \"Use Custom Build\" is " -"enabled." +"\"Target SDK\" can only be overridden when \"Use Custom Build\" is enabled." msgstr "" "\"Export AAB\" è valido soltanto quanto \"Use Custom Build\" è abilitato." #: platform/android/export/export_plugin.cpp -msgid "\"Target Sdk\" version must be greater or equal to \"Min Sdk\" version." +msgid "" +"\"Target SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Target SDK\" %d is higher than the default version %d. This may work, but " +"wasn't tested and may be unstable." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Target SDK\" version must be greater or equal to \"Min SDK\" version." msgstr "" #: platform/android/export/export_plugin.cpp platform/osx/export/export.cpp @@ -20584,7 +20615,7 @@ msgstr "Ingrandisci" msgid "Custom Viewport" msgstr "1 Vista" -#: scene/2d/camera_2d.cpp scene/3d/camera.cpp +#: scene/2d/camera_2d.cpp scene/3d/camera.cpp scene/3d/interpolated_camera.cpp #: scene/animation/animation_player.cpp scene/animation/animation_tree.cpp #: scene/animation/animation_tree_player.cpp scene/main/timer.cpp #, fuzzy @@ -20641,13 +20672,14 @@ msgid "Smoothing" msgstr "Graduale" #: scene/2d/camera_2d.cpp +#, fuzzy msgid "H" -msgstr "" +msgstr "H" #: scene/2d/camera_2d.cpp #, fuzzy msgid "V" -msgstr "UV" +msgstr "V" #: scene/2d/camera_2d.cpp #, fuzzy @@ -20958,7 +20990,7 @@ msgstr "Propagazione" #: scene/resources/particles_material.cpp #, fuzzy msgid "Initial Velocity" -msgstr "Inizializza" +msgstr "Velocità iniziale" #: scene/2d/cpu_particles_2d.cpp scene/3d/cpu_particles.cpp #: scene/resources/particles_material.cpp @@ -20969,8 +21001,9 @@ msgstr "Velocità" #: scene/2d/cpu_particles_2d.cpp scene/3d/cpu_particles.cpp #: scene/resources/particles_material.cpp servers/physics_2d_server.cpp #: servers/physics_server.cpp +#, fuzzy msgid "Angular Velocity" -msgstr "" +msgstr "Velocità angolare" #: scene/2d/cpu_particles_2d.cpp scene/3d/cpu_particles.cpp #: scene/resources/particles_material.cpp @@ -20982,13 +21015,13 @@ msgstr "Velocità" #: scene/resources/particles_material.cpp #, fuzzy msgid "Orbit Velocity" -msgstr "Orbita la visuale a destra" +msgstr "Velocità orbitale" #: scene/2d/cpu_particles_2d.cpp scene/3d/cpu_particles.cpp #: scene/resources/particles_material.cpp #, fuzzy msgid "Linear Accel" -msgstr "Lineare" +msgstr "Accelerazione lineare" #: scene/2d/cpu_particles_2d.cpp scene/3d/cpu_particles.cpp #: scene/resources/particles_material.cpp @@ -21009,13 +21042,15 @@ msgstr "Dividi Curva" #: scene/2d/cpu_particles_2d.cpp scene/3d/cpu_particles.cpp #: scene/resources/particles_material.cpp +#, fuzzy msgid "Radial Accel" -msgstr "" +msgstr "Accelerazione radiale" #: scene/2d/cpu_particles_2d.cpp scene/3d/cpu_particles.cpp #: scene/resources/particles_material.cpp +#, fuzzy msgid "Tangential Accel" -msgstr "" +msgstr "Accelerazione tangenziale" #: scene/2d/cpu_particles_2d.cpp scene/2d/joints_2d.cpp #: scene/3d/cpu_particles.cpp scene/3d/physics_body.cpp @@ -21368,6 +21403,11 @@ msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp #, fuzzy +msgid "Pathfinding" +msgstr "Associazione" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy msgid "Path Desired Distance" msgstr "Scegli la Distanza:" @@ -21376,6 +21416,21 @@ msgid "Target Desired Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Path Max Distance" +msgstr "Scegli la Distanza:" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Avoidance" +msgstr "Opzioni avanzate" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Avoidance Enabled" +msgstr "Abilita" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp msgid "Neighbor Dist" msgstr "" @@ -21393,16 +21448,6 @@ msgstr "Ribalta orizzontalmente" msgid "Max Speed" msgstr "Velocità:" -#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -#, fuzzy -msgid "Path Max Distance" -msgstr "Scegli la Distanza:" - -#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -#, fuzzy -msgid "Avoidance Enabled" -msgstr "Abilita" - #: scene/2d/navigation_agent_2d.cpp msgid "" "The NavigationAgent2D can be used only under a Node2D inheriting parent node." @@ -21866,12 +21911,14 @@ msgstr "" "Skeleton2D e impostane una." #: scene/2d/sprite.cpp scene/3d/sprite_3d.cpp +#, fuzzy msgid "Hframes" -msgstr "" +msgstr "Hframes" #: scene/2d/sprite.cpp scene/3d/sprite_3d.cpp +#, fuzzy msgid "Vframes" -msgstr "" +msgstr "Vframes" #: scene/2d/sprite.cpp scene/3d/sprite_3d.cpp #, fuzzy @@ -22129,8 +22176,9 @@ msgstr "Impacchettando" #: scene/3d/baked_lightmap.cpp scene/3d/gi_probe.cpp #: scene/3d/reflection_probe.cpp +#, fuzzy msgid "Interior" -msgstr "" +msgstr "Interno" #: scene/3d/baked_lightmap.cpp msgid "Finding meshes and lights" @@ -22270,8 +22318,9 @@ msgid "Projection" msgstr "Proiezione" #: scene/3d/camera.cpp +#, fuzzy msgid "FOV" -msgstr "" +msgstr "FOV" #: scene/3d/camera.cpp #, fuzzy @@ -22284,8 +22333,9 @@ msgid "Near" msgstr "Vicino" #: scene/3d/camera.cpp +#, fuzzy msgid "Far" -msgstr "" +msgstr "Lontano" #: scene/3d/camera.cpp scene/3d/collision_polygon.cpp scene/3d/spring_arm.cpp #: scene/gui/control.cpp scene/resources/default_theme/default_theme.cpp @@ -22470,8 +22520,9 @@ msgstr "" "Per rimuovere questo avviso, disattiva la proprietà Compress di GIProbe." #: scene/3d/gi_probe.cpp +#, fuzzy msgid "Subdiv" -msgstr "" +msgstr "Subdiv" #: scene/3d/gi_probe.cpp #, fuzzy @@ -22622,8 +22673,9 @@ msgid "Depth Range" msgstr "Profondità" #: scene/3d/light.cpp +#, fuzzy msgid "Omni" -msgstr "" +msgstr "Omni" #: scene/3d/light.cpp #, fuzzy @@ -23363,8 +23415,9 @@ msgid "There should only be one RoomManager in the SceneTree." msgstr "Ci dovrebbe essere un solo RoomManager nello SceneTree." #: scene/3d/room_manager.cpp +#, fuzzy msgid "Main" -msgstr "" +msgstr "Principale" #: scene/3d/room_manager.cpp scene/animation/animation_blend_tree.cpp #: scene/animation/animation_player.cpp scene/animation/animation_tree.cpp @@ -23607,8 +23660,9 @@ msgid "Spring Length" msgstr "" #: scene/3d/sprite_3d.cpp scene/gui/graph_edit.cpp +#, fuzzy msgid "Opacity" -msgstr "" +msgstr "Opacità" #: scene/3d/sprite_3d.cpp scene/resources/material.cpp #, fuzzy @@ -23729,8 +23783,9 @@ msgid "Lightmap Scale" msgstr "" #: scene/3d/visual_instance.cpp +#, fuzzy msgid "LOD" -msgstr "" +msgstr "LOD" #: scene/3d/visual_instance.cpp scene/animation/skeleton_ik.cpp #: scene/resources/material.cpp @@ -24041,8 +24096,9 @@ msgid "Stretch Mode" msgstr "Modalità di Selezione" #: scene/gui/aspect_ratio_container.cpp scene/gui/box_container.cpp +#, fuzzy msgid "Alignment" -msgstr "" +msgstr "Allineamento" #: scene/gui/base_button.cpp #, fuzzy @@ -24827,6 +24883,11 @@ msgstr "Cartella:" #: scene/gui/text_edit.cpp #, fuzzy +msgid "Drag And Drop Selection Enabled" +msgstr "Solo nella selezione" + +#: scene/gui/text_edit.cpp +#, fuzzy msgid "Hiding Enabled" msgstr "Abilita" @@ -25234,19 +25295,6 @@ msgstr "Percorso di Esportazione" #: scene/main/viewport.cpp msgid "" -"This viewport is not set as render target. If you intend for it to display " -"its contents directly to the screen, make it a child of a Control so it can " -"obtain a size. Otherwise, make it a RenderTarget and assign its internal " -"texture to some node for display." -msgstr "" -"Questo viewport non è impostato come target di render. Se si vuole che il " -"suo contenuto venga direttamente visualizzato sullo schermo, renderlo figlio " -"di un Control, in modo che possa ottenere una dimensione. Altrimenti, " -"renderlo un RenderTarget e assegnare la sua texture interna a qualche nodo " -"per la visualizzazione." - -#: scene/main/viewport.cpp -msgid "" "The Viewport size must be greater than or equal to 2 pixels on both " "dimensions to render anything." msgstr "" @@ -25254,6 +25302,15 @@ msgstr "" "entrambi i lati per visualizzare qualcosa." #: scene/main/viewport.cpp +msgid "" +"This Viewport has HDR enabled, but its Usage is set to 2D or 2D No-" +"Sampling.\n" +"HDR is only supported in Viewports that have their Usage set to 3D or 3D No-" +"Effects.\n" +"HDR will be disabled for this Viewport." +msgstr "" + +#: scene/main/viewport.cpp msgid "ARVR" msgstr "" diff --git a/editor/translations/ja.po b/editor/translations/ja.po index a699aeb597..3abcd5529f 100644 --- a/editor/translations/ja.po +++ b/editor/translations/ja.po @@ -430,6 +430,11 @@ msgstr "Meta" msgid "Command" msgstr "Command" +#: core/os/input_event.cpp +#, fuzzy +msgid "Physical" +msgstr " (物理的)" + #: core/os/input_event.cpp scene/2d/touch_screen_button.cpp #: scene/gui/base_button.cpp scene/gui/texture_button.cpp #: scene/resources/default_theme/default_theme.cpp @@ -5567,6 +5572,11 @@ msgid "Mouse Extra Buttons Navigate History" msgstr "" #: editor/editor_settings.cpp +#, fuzzy +msgid "Drag And Drop Selection" +msgstr "GridMap の選択" + +#: editor/editor_settings.cpp msgid "Appearance" msgstr "外観" @@ -18661,6 +18671,11 @@ msgid "The package must have at least one '.' separator." msgstr "パッケージには一つ以上の区切り文字 '.' が必要です。" #: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Custom Build" +msgstr "ノードを切り取る" + +#: platform/android/export/export_plugin.cpp msgid "Use Custom Build" msgstr "" @@ -18669,6 +18684,15 @@ msgstr "" msgid "Export Format" msgstr "エクスポート先のパス" +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Min SDK" +msgstr "アウトラインのサイズ:" + +#: platform/android/export/export_plugin.cpp +msgid "Target SDK" +msgstr "ターゲットSDK" + #: platform/android/export/export_plugin.cpp platform/iphone/export/export.cpp #, fuzzy msgid "Architectures" @@ -18712,15 +18736,6 @@ msgstr "前のインスタンスを調べる" msgid "Code" msgstr "" -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Min SDK" -msgstr "アウトラインのサイズ:" - -#: platform/android/export/export_plugin.cpp -msgid "Target SDK" -msgstr "ターゲットSDK" - #: platform/android/export/export_plugin.cpp platform/uwp/export/export.cpp #, fuzzy msgid "Package" @@ -18968,15 +18983,17 @@ msgstr "" "になっている必要があります。" #: platform/android/export/export_plugin.cpp +#, fuzzy msgid "" -"\"Hand Tracking\" is only valid when \"Xr Mode\" is \"Oculus Mobile VrApi\" " +"\"Hand Tracking\" is only valid when \"XR Mode\" is \"Oculus Mobile VrApi\" " "or \"OpenXR\"." msgstr "" "\"Hand Tracking\" は \"Xr Mode\" が \"Oculus Mobile VrApi\" または " "\"OpenXR\" の場合にのみ有効です。" #: platform/android/export/export_plugin.cpp -msgid "\"Passthrough\" is only valid when \"Xr Mode\" is \"OpenXR\"." +#, fuzzy +msgid "\"Passthrough\" is only valid when \"XR Mode\" is \"OpenXR\"." msgstr "\"Passthrough\" は \"Xr Mode\" が \"OpenXR\" の場合にのみ有効です。" #: platform/android/export/export_plugin.cpp @@ -18985,20 +19002,43 @@ msgstr "" "\"Export AAB\" は \"Use Custom Build\" が有効である場合にのみ有効になります。" #: platform/android/export/export_plugin.cpp +#, fuzzy msgid "" -"Changing the \"Min Sdk\" is only valid when \"Use Custom Build\" is enabled." +"\"Min SDK\" can only be overridden when \"Use Custom Build\" is enabled." msgstr "" "\"Min Sdk\" の変更は \"Use Custom Build\" が有効である場合にのみ有効です。" #: platform/android/export/export_plugin.cpp +msgid "\"Min SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Target Sdk\" is only valid when \"Use Custom Build\" is " -"enabled." +"\"Min SDK\" cannot be lower than %d, which is the version needed by the " +"Godot library." +msgstr "" + +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "" +"\"Target SDK\" can only be overridden when \"Use Custom Build\" is enabled." msgstr "" "\"Target Sdk\" の変更は \"Use Custom Build\" が有効である場合にのみ有効です。" #: platform/android/export/export_plugin.cpp -msgid "\"Target Sdk\" version must be greater or equal to \"Min Sdk\" version." +msgid "" +"\"Target SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Target SDK\" %d is higher than the default version %d. This may work, but " +"wasn't tested and may be unstable." +msgstr "" + +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "\"Target SDK\" version must be greater or equal to \"Min SDK\" version." msgstr "" "\"Target Sdk\" バージョンは \"Min Sdk\" バージョン以上でなければなりません。" @@ -20681,7 +20721,7 @@ msgstr "ズーム" msgid "Custom Viewport" msgstr "1 ビューポート" -#: scene/2d/camera_2d.cpp scene/3d/camera.cpp +#: scene/2d/camera_2d.cpp scene/3d/camera.cpp scene/3d/interpolated_camera.cpp #: scene/animation/animation_player.cpp scene/animation/animation_tree.cpp #: scene/animation/animation_tree_player.cpp scene/main/timer.cpp msgid "Process Mode" @@ -21441,6 +21481,11 @@ msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp #, fuzzy +msgid "Pathfinding" +msgstr "バインド" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy msgid "Path Desired Distance" msgstr "距離を取得:" @@ -21449,6 +21494,21 @@ msgid "Target Desired Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Path Max Distance" +msgstr "距離を取得:" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Avoidance" +msgstr "高度な設定" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Avoidance Enabled" +msgstr "有効" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp msgid "Neighbor Dist" msgstr "" @@ -21466,16 +21526,6 @@ msgstr "左右反転" msgid "Max Speed" msgstr "速度:" -#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -#, fuzzy -msgid "Path Max Distance" -msgstr "距離を取得:" - -#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -#, fuzzy -msgid "Avoidance Enabled" -msgstr "有効" - #: scene/2d/navigation_agent_2d.cpp #, fuzzy msgid "" @@ -24919,6 +24969,11 @@ msgstr "フォルダー:" #: scene/gui/text_edit.cpp #, fuzzy +msgid "Drag And Drop Selection Enabled" +msgstr "選択範囲のみ" + +#: scene/gui/text_edit.cpp +#, fuzzy msgid "Hiding Enabled" msgstr "有効" @@ -25327,22 +25382,19 @@ msgstr "エクスポート先のパス" #: scene/main/viewport.cpp msgid "" -"This viewport is not set as render target. If you intend for it to display " -"its contents directly to the screen, make it a child of a Control so it can " -"obtain a size. Otherwise, make it a RenderTarget and assign its internal " -"texture to some node for display." +"The Viewport size must be greater than or equal to 2 pixels on both " +"dimensions to render anything." msgstr "" -"このビューポートはレンダー ターゲットとして設定されていません。コンテンツを画" -"面に直接表示する場合は、サイズを取得できるようにコントロールの子にします。そ" -"れ以外の場合は、RenderTarget にして、その内部テクスチャを表示するノードに割り" -"当てます。" +"レンダーするにはViewportの縦横それぞれが2ピクセル以上である必要があります。" #: scene/main/viewport.cpp msgid "" -"The Viewport size must be greater than or equal to 2 pixels on both " -"dimensions to render anything." +"This Viewport has HDR enabled, but its Usage is set to 2D or 2D No-" +"Sampling.\n" +"HDR is only supported in Viewports that have their Usage set to 3D or 3D No-" +"Effects.\n" +"HDR will be disabled for this Viewport." msgstr "" -"レンダーするにはViewportの縦横それぞれが2ピクセル以上である必要があります。" #: scene/main/viewport.cpp msgid "ARVR" diff --git a/editor/translations/ka.po b/editor/translations/ka.po index caf07e1063..14599ca68e 100644 --- a/editor/translations/ka.po +++ b/editor/translations/ka.po @@ -407,6 +407,11 @@ msgstr "" msgid "Command" msgstr "" +#: core/os/input_event.cpp +#, fuzzy +msgid "Physical" +msgstr "დამაკავშირებელი სიგნალი:" + #: core/os/input_event.cpp scene/2d/touch_screen_button.cpp #: scene/gui/base_button.cpp scene/gui/texture_button.cpp #: scene/resources/default_theme/default_theme.cpp @@ -5496,6 +5501,11 @@ msgid "Mouse Extra Buttons Navigate History" msgstr "" #: editor/editor_settings.cpp +#, fuzzy +msgid "Drag And Drop Selection" +msgstr "ყველა მონიშნვა" + +#: editor/editor_settings.cpp msgid "Appearance" msgstr "" @@ -18503,6 +18513,11 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Custom Build" +msgstr "ანიმაციის გასაღებების ასლის შექმნა" + +#: platform/android/export/export_plugin.cpp msgid "Use Custom Build" msgstr "" @@ -18511,6 +18526,16 @@ msgstr "" msgid "Export Format" msgstr "ანიმაციის გარდაქმნის ცვლილება" +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Min SDK" +msgstr "დამოკიდებულებების შემსწორებელი" + +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Target SDK" +msgstr "წაშლა" + #: platform/android/export/export_plugin.cpp platform/iphone/export/export.cpp msgid "Architectures" msgstr "" @@ -18547,16 +18572,6 @@ msgstr "" msgid "Code" msgstr "" -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Min SDK" -msgstr "დამოკიდებულებების შემსწორებელი" - -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Target SDK" -msgstr "წაშლა" - #: platform/android/export/export_plugin.cpp platform/uwp/export/export.cpp msgid "Package" msgstr "" @@ -18791,12 +18806,12 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"\"Hand Tracking\" is only valid when \"Xr Mode\" is \"Oculus Mobile VrApi\" " +"\"Hand Tracking\" is only valid when \"XR Mode\" is \"Oculus Mobile VrApi\" " "or \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Passthrough\" is only valid when \"Xr Mode\" is \"OpenXR\"." +msgid "\"Passthrough\" is only valid when \"XR Mode\" is \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp @@ -18805,17 +18820,37 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Min Sdk\" is only valid when \"Use Custom Build\" is enabled." +"\"Min SDK\" can only be overridden when \"Use Custom Build\" is enabled." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Min SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Min SDK\" cannot be lower than %d, which is the version needed by the " +"Godot library." msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Target Sdk\" is only valid when \"Use Custom Build\" is " -"enabled." +"\"Target SDK\" can only be overridden when \"Use Custom Build\" is enabled." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Target Sdk\" version must be greater or equal to \"Min Sdk\" version." +msgid "" +"\"Target SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Target SDK\" %d is higher than the default version %d. This may work, but " +"wasn't tested and may be unstable." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Target SDK\" version must be greater or equal to \"Min SDK\" version." msgstr "" #: platform/android/export/export_plugin.cpp platform/osx/export/export.cpp @@ -20411,7 +20446,7 @@ msgstr "ზუმის გაზრდა" msgid "Custom Viewport" msgstr "" -#: scene/2d/camera_2d.cpp scene/3d/camera.cpp +#: scene/2d/camera_2d.cpp scene/3d/camera.cpp scene/3d/interpolated_camera.cpp #: scene/animation/animation_player.cpp scene/animation/animation_tree.cpp #: scene/animation/animation_tree_player.cpp scene/main/timer.cpp #, fuzzy @@ -21119,6 +21154,11 @@ msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp #, fuzzy +msgid "Pathfinding" +msgstr "მუდმივი" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy msgid "Path Desired Distance" msgstr "დაყენება" @@ -21127,29 +21167,34 @@ msgid "Target Desired Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Neighbor Dist" +msgid "Path Max Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Max Neighbors" -msgstr "" +#, fuzzy +msgid "Avoidance" +msgstr "დაბალანსებული" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Time Horizon" +#, fuzzy +msgid "Avoidance Enabled" +msgstr "დამაკავშირებელი სიგნალი:" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +msgid "Neighbor Dist" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Max Speed" +msgid "Max Neighbors" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Path Max Distance" +msgid "Time Horizon" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -#, fuzzy -msgid "Avoidance Enabled" -msgstr "დამაკავშირებელი სიგნალი:" +msgid "Max Speed" +msgstr "" #: scene/2d/navigation_agent_2d.cpp msgid "" @@ -24305,6 +24350,11 @@ msgstr "" #: scene/gui/text_edit.cpp #, fuzzy +msgid "Drag And Drop Selection Enabled" +msgstr "მონიშნული მხოლოდ" + +#: scene/gui/text_edit.cpp +#, fuzzy msgid "Hiding Enabled" msgstr "დამაკავშირებელი სიგნალი:" @@ -24687,16 +24737,17 @@ msgstr "გზა" #: scene/main/viewport.cpp msgid "" -"This viewport is not set as render target. If you intend for it to display " -"its contents directly to the screen, make it a child of a Control so it can " -"obtain a size. Otherwise, make it a RenderTarget and assign its internal " -"texture to some node for display." +"The Viewport size must be greater than or equal to 2 pixels on both " +"dimensions to render anything." msgstr "" #: scene/main/viewport.cpp msgid "" -"The Viewport size must be greater than or equal to 2 pixels on both " -"dimensions to render anything." +"This Viewport has HDR enabled, but its Usage is set to 2D or 2D No-" +"Sampling.\n" +"HDR is only supported in Viewports that have their Usage set to 3D or 3D No-" +"Effects.\n" +"HDR will be disabled for this Viewport." msgstr "" #: scene/main/viewport.cpp diff --git a/editor/translations/km.po b/editor/translations/km.po index b58578c50d..32175987ef 100644 --- a/editor/translations/km.po +++ b/editor/translations/km.po @@ -385,6 +385,10 @@ msgstr "" msgid "Command" msgstr "" +#: core/os/input_event.cpp +msgid "Physical" +msgstr "" + #: core/os/input_event.cpp scene/2d/touch_screen_button.cpp #: scene/gui/base_button.cpp scene/gui/texture_button.cpp #: scene/resources/default_theme/default_theme.cpp @@ -5257,6 +5261,10 @@ msgid "Mouse Extra Buttons Navigate History" msgstr "" #: editor/editor_settings.cpp +msgid "Drag And Drop Selection" +msgstr "" + +#: editor/editor_settings.cpp msgid "Appearance" msgstr "" @@ -17719,6 +17727,11 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Custom Build" +msgstr "Anim ផ្លាស់ប្តូរ Transform" + +#: platform/android/export/export_plugin.cpp msgid "Use Custom Build" msgstr "" @@ -17726,6 +17739,14 @@ msgstr "" msgid "Export Format" msgstr "" +#: platform/android/export/export_plugin.cpp +msgid "Min SDK" +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "Target SDK" +msgstr "" + #: platform/android/export/export_plugin.cpp platform/iphone/export/export.cpp msgid "Architectures" msgstr "" @@ -17762,14 +17783,6 @@ msgstr "" msgid "Code" msgstr "" -#: platform/android/export/export_plugin.cpp -msgid "Min SDK" -msgstr "" - -#: platform/android/export/export_plugin.cpp -msgid "Target SDK" -msgstr "" - #: platform/android/export/export_plugin.cpp platform/uwp/export/export.cpp msgid "Package" msgstr "" @@ -17988,12 +18001,12 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"\"Hand Tracking\" is only valid when \"Xr Mode\" is \"Oculus Mobile VrApi\" " +"\"Hand Tracking\" is only valid when \"XR Mode\" is \"Oculus Mobile VrApi\" " "or \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Passthrough\" is only valid when \"Xr Mode\" is \"OpenXR\"." +msgid "\"Passthrough\" is only valid when \"XR Mode\" is \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp @@ -18002,17 +18015,37 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Min Sdk\" is only valid when \"Use Custom Build\" is enabled." +"\"Min SDK\" can only be overridden when \"Use Custom Build\" is enabled." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Min SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Min SDK\" cannot be lower than %d, which is the version needed by the " +"Godot library." msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Target Sdk\" is only valid when \"Use Custom Build\" is " -"enabled." +"\"Target SDK\" can only be overridden when \"Use Custom Build\" is enabled." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Target Sdk\" version must be greater or equal to \"Min Sdk\" version." +msgid "" +"\"Target SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Target SDK\" %d is higher than the default version %d. This may work, but " +"wasn't tested and may be unstable." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Target SDK\" version must be greater or equal to \"Min SDK\" version." msgstr "" #: platform/android/export/export_plugin.cpp platform/osx/export/export.cpp @@ -19520,7 +19553,7 @@ msgstr "" msgid "Custom Viewport" msgstr "" -#: scene/2d/camera_2d.cpp scene/3d/camera.cpp +#: scene/2d/camera_2d.cpp scene/3d/camera.cpp scene/3d/interpolated_camera.cpp #: scene/animation/animation_player.cpp scene/animation/animation_tree.cpp #: scene/animation/animation_tree_player.cpp scene/main/timer.cpp msgid "Process Mode" @@ -20184,6 +20217,10 @@ msgid "" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +msgid "Pathfinding" +msgstr "" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp msgid "Path Desired Distance" msgstr "" @@ -20192,27 +20229,31 @@ msgid "Target Desired Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Neighbor Dist" +msgid "Path Max Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Max Neighbors" +msgid "Avoidance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Time Horizon" +msgid "Avoidance Enabled" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Max Speed" +msgid "Neighbor Dist" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Path Max Distance" +msgid "Max Neighbors" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Avoidance Enabled" +msgid "Time Horizon" +msgstr "" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +msgid "Max Speed" msgstr "" #: scene/2d/navigation_agent_2d.cpp @@ -23152,6 +23193,10 @@ msgid "Fold Gutter" msgstr "" #: scene/gui/text_edit.cpp +msgid "Drag And Drop Selection Enabled" +msgstr "" + +#: scene/gui/text_edit.cpp msgid "Hiding Enabled" msgstr "" @@ -23504,16 +23549,17 @@ msgstr "" #: scene/main/viewport.cpp msgid "" -"This viewport is not set as render target. If you intend for it to display " -"its contents directly to the screen, make it a child of a Control so it can " -"obtain a size. Otherwise, make it a RenderTarget and assign its internal " -"texture to some node for display." +"The Viewport size must be greater than or equal to 2 pixels on both " +"dimensions to render anything." msgstr "" #: scene/main/viewport.cpp msgid "" -"The Viewport size must be greater than or equal to 2 pixels on both " -"dimensions to render anything." +"This Viewport has HDR enabled, but its Usage is set to 2D or 2D No-" +"Sampling.\n" +"HDR is only supported in Viewports that have their Usage set to 3D or 3D No-" +"Effects.\n" +"HDR will be disabled for this Viewport." msgstr "" #: scene/main/viewport.cpp diff --git a/editor/translations/ko.po b/editor/translations/ko.po index fb4bf92e30..8800745e09 100644 --- a/editor/translations/ko.po +++ b/editor/translations/ko.po @@ -421,6 +421,11 @@ msgstr "메타" msgid "Command" msgstr "명령" +#: core/os/input_event.cpp +#, fuzzy +msgid "Physical" +msgstr " (물리)" + #: core/os/input_event.cpp scene/2d/touch_screen_button.cpp #: scene/gui/base_button.cpp scene/gui/texture_button.cpp #: scene/resources/default_theme/default_theme.cpp @@ -5468,6 +5473,11 @@ msgid "Mouse Extra Buttons Navigate History" msgstr "마우스 부가 버튼으로 히스토리 둘러보기" #: editor/editor_settings.cpp +#, fuzzy +msgid "Drag And Drop Selection" +msgstr "그리드맵 선택" + +#: editor/editor_settings.cpp msgid "Appearance" msgstr "모습" @@ -18634,6 +18644,11 @@ msgid "The package must have at least one '.' separator." msgstr "패키지는 적어도 하나의 '.' 분리 기호가 있어야 합니다." #: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Custom Build" +msgstr "노드 잘라내기" + +#: platform/android/export/export_plugin.cpp msgid "Use Custom Build" msgstr "" @@ -18642,6 +18657,16 @@ msgstr "" msgid "Export Format" msgstr "경로 내보내기" +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Min SDK" +msgstr "윤곽선 크기:" + +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Target SDK" +msgstr "Target(대상)" + #: platform/android/export/export_plugin.cpp platform/iphone/export/export.cpp #, fuzzy msgid "Architectures" @@ -18684,16 +18709,6 @@ msgstr "이전 인스턴스 검사" msgid "Code" msgstr "" -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Min SDK" -msgstr "윤곽선 크기:" - -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Target SDK" -msgstr "Target(대상)" - #: platform/android/export/export_plugin.cpp platform/uwp/export/export.cpp #, fuzzy msgid "Package" @@ -18940,14 +18955,14 @@ msgstr "플러그인을 사용하려면 \"Use Custom Build\"가 활성화되어 #: platform/android/export/export_plugin.cpp #, fuzzy msgid "" -"\"Hand Tracking\" is only valid when \"Xr Mode\" is \"Oculus Mobile VrApi\" " +"\"Hand Tracking\" is only valid when \"XR Mode\" is \"Oculus Mobile VrApi\" " "or \"OpenXR\"." msgstr "" "\"손 추적\" 은 \"Xr 모드\" 가 \"Oculus Mobile VR\"일 때만 사용 가능합니다." #: platform/android/export/export_plugin.cpp #, fuzzy -msgid "\"Passthrough\" is only valid when \"Xr Mode\" is \"OpenXR\"." +msgid "\"Passthrough\" is only valid when \"XR Mode\" is \"OpenXR\"." msgstr "" "\"손 추적\" 은 \"Xr 모드\" 가 \"Oculus Mobile VR\"일 때만 사용 가능합니다." @@ -18958,18 +18973,38 @@ msgstr "\"Export AAB\"는 \"Use Custom Build\"가 활성화된 경우에만 유 #: platform/android/export/export_plugin.cpp #, fuzzy msgid "" -"Changing the \"Min Sdk\" is only valid when \"Use Custom Build\" is enabled." +"\"Min SDK\" can only be overridden when \"Use Custom Build\" is enabled." msgstr "\"Export AAB\"는 \"Use Custom Build\"가 활성화된 경우에만 유효합니다." #: platform/android/export/export_plugin.cpp +msgid "\"Min SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Min SDK\" cannot be lower than %d, which is the version needed by the " +"Godot library." +msgstr "" + +#: platform/android/export/export_plugin.cpp #, fuzzy msgid "" -"Changing the \"Target Sdk\" is only valid when \"Use Custom Build\" is " -"enabled." +"\"Target SDK\" can only be overridden when \"Use Custom Build\" is enabled." msgstr "\"Export AAB\"는 \"Use Custom Build\"가 활성화된 경우에만 유효합니다." #: platform/android/export/export_plugin.cpp -msgid "\"Target Sdk\" version must be greater or equal to \"Min Sdk\" version." +msgid "" +"\"Target SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Target SDK\" %d is higher than the default version %d. This may work, but " +"wasn't tested and may be unstable." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Target SDK\" version must be greater or equal to \"Min SDK\" version." msgstr "" #: platform/android/export/export_plugin.cpp platform/osx/export/export.cpp @@ -20653,7 +20688,7 @@ msgstr "줌 인" msgid "Custom Viewport" msgstr "뷰포트 1개" -#: scene/2d/camera_2d.cpp scene/3d/camera.cpp +#: scene/2d/camera_2d.cpp scene/3d/camera.cpp scene/3d/interpolated_camera.cpp #: scene/animation/animation_player.cpp scene/animation/animation_tree.cpp #: scene/animation/animation_tree_player.cpp scene/main/timer.cpp #, fuzzy @@ -21418,6 +21453,11 @@ msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp #, fuzzy +msgid "Pathfinding" +msgstr "바인딩" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy msgid "Path Desired Distance" msgstr "거리 선택:" @@ -21426,6 +21466,21 @@ msgid "Target Desired Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Path Max Distance" +msgstr "거리 선택:" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Avoidance" +msgstr "고급" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Avoidance Enabled" +msgstr "활성화" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp msgid "Neighbor Dist" msgstr "" @@ -21443,16 +21498,6 @@ msgstr "수평으로 뒤집기" msgid "Max Speed" msgstr "속도:" -#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -#, fuzzy -msgid "Path Max Distance" -msgstr "거리 선택:" - -#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -#, fuzzy -msgid "Avoidance Enabled" -msgstr "활성화" - #: scene/2d/navigation_agent_2d.cpp msgid "" "The NavigationAgent2D can be used only under a Node2D inheriting parent node." @@ -24875,6 +24920,11 @@ msgstr "폴더:" #: scene/gui/text_edit.cpp #, fuzzy +msgid "Drag And Drop Selection Enabled" +msgstr "선택 영역만" + +#: scene/gui/text_edit.cpp +#, fuzzy msgid "Hiding Enabled" msgstr "활성화" @@ -25285,22 +25335,19 @@ msgstr "경로 내보내기" #: scene/main/viewport.cpp msgid "" -"This viewport is not set as render target. If you intend for it to display " -"its contents directly to the screen, make it a child of a Control so it can " -"obtain a size. Otherwise, make it a RenderTarget and assign its internal " -"texture to some node for display." +"The Viewport size must be greater than or equal to 2 pixels on both " +"dimensions to render anything." msgstr "" -"뷰포트를 렌더 대상으로 설정하지 않았습니다. 뷰포트의 내용을 화면에 직접 표시" -"하려면, Control의 자식 노드로 만들어서 크기를 얻어야 합니다. 그렇지 않을 경" -"우, 화면에 표시하기 위해서는 뷰포트를 RenderTarget으로 만들고 내부적인 텍스처" -"를 다른 노드에 지정해야 합니다." +"무엇이든 렌더링하려면 뷰포트 크기가 양쪽 차원에서 2픽셀 이상이어야 합니다." #: scene/main/viewport.cpp msgid "" -"The Viewport size must be greater than or equal to 2 pixels on both " -"dimensions to render anything." +"This Viewport has HDR enabled, but its Usage is set to 2D or 2D No-" +"Sampling.\n" +"HDR is only supported in Viewports that have their Usage set to 3D or 3D No-" +"Effects.\n" +"HDR will be disabled for this Viewport." msgstr "" -"무엇이든 렌더링하려면 뷰포트 크기가 양쪽 차원에서 2픽셀 이상이어야 합니다." #: scene/main/viewport.cpp msgid "ARVR" diff --git a/editor/translations/lt.po b/editor/translations/lt.po index 350bcb0352..51428b68f4 100644 --- a/editor/translations/lt.po +++ b/editor/translations/lt.po @@ -417,6 +417,11 @@ msgstr "" msgid "Command" msgstr "Bendruomenė" +#: core/os/input_event.cpp +#, fuzzy +msgid "Physical" +msgstr "Fizikos Kadro %" + #: core/os/input_event.cpp scene/2d/touch_screen_button.cpp #: scene/gui/base_button.cpp scene/gui/texture_button.cpp #: scene/resources/default_theme/default_theme.cpp @@ -5473,6 +5478,11 @@ msgid "Mouse Extra Buttons Navigate History" msgstr "" #: editor/editor_settings.cpp +#, fuzzy +msgid "Drag And Drop Selection" +msgstr "Visas Pasirinkimas" + +#: editor/editor_settings.cpp msgid "Appearance" msgstr "" @@ -18503,6 +18513,11 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Custom Build" +msgstr "Transition Nodas" + +#: platform/android/export/export_plugin.cpp msgid "Use Custom Build" msgstr "" @@ -18511,6 +18526,16 @@ msgstr "" msgid "Export Format" msgstr "Importuoti iš Nodo:" +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Min SDK" +msgstr "Atidaryti Skriptų Editorių" + +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Target SDK" +msgstr "TimeScale Nodas" + #: platform/android/export/export_plugin.cpp platform/iphone/export/export.cpp msgid "Architectures" msgstr "" @@ -18547,16 +18572,6 @@ msgstr "" msgid "Code" msgstr "" -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Min SDK" -msgstr "Atidaryti Skriptų Editorių" - -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Target SDK" -msgstr "TimeScale Nodas" - #: platform/android/export/export_plugin.cpp platform/uwp/export/export.cpp msgid "Package" msgstr "" @@ -18793,12 +18808,12 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"\"Hand Tracking\" is only valid when \"Xr Mode\" is \"Oculus Mobile VrApi\" " +"\"Hand Tracking\" is only valid when \"XR Mode\" is \"Oculus Mobile VrApi\" " "or \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Passthrough\" is only valid when \"Xr Mode\" is \"OpenXR\"." +msgid "\"Passthrough\" is only valid when \"XR Mode\" is \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp @@ -18807,17 +18822,37 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Min Sdk\" is only valid when \"Use Custom Build\" is enabled." +"\"Min SDK\" can only be overridden when \"Use Custom Build\" is enabled." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Min SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Min SDK\" cannot be lower than %d, which is the version needed by the " +"Godot library." msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Target Sdk\" is only valid when \"Use Custom Build\" is " -"enabled." +"\"Target SDK\" can only be overridden when \"Use Custom Build\" is enabled." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Target Sdk\" version must be greater or equal to \"Min Sdk\" version." +msgid "" +"\"Target SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Target SDK\" %d is higher than the default version %d. This may work, but " +"wasn't tested and may be unstable." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Target SDK\" version must be greater or equal to \"Min SDK\" version." msgstr "" #: platform/android/export/export_plugin.cpp platform/osx/export/export.cpp @@ -20436,7 +20471,7 @@ msgstr "Priartinti" msgid "Custom Viewport" msgstr "" -#: scene/2d/camera_2d.cpp scene/3d/camera.cpp +#: scene/2d/camera_2d.cpp scene/3d/camera.cpp scene/3d/interpolated_camera.cpp #: scene/animation/animation_player.cpp scene/animation/animation_tree.cpp #: scene/animation/animation_tree_player.cpp scene/main/timer.cpp #, fuzzy @@ -21143,6 +21178,11 @@ msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp #, fuzzy +msgid "Pathfinding" +msgstr "Konstanta" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy msgid "Path Desired Distance" msgstr "Diegti" @@ -21151,29 +21191,34 @@ msgid "Target Desired Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Neighbor Dist" +msgid "Path Max Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Max Neighbors" -msgstr "" +#, fuzzy +msgid "Avoidance" +msgstr "Įgalinti" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Time Horizon" +#, fuzzy +msgid "Avoidance Enabled" +msgstr "Įgalinti" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +msgid "Neighbor Dist" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Max Speed" +msgid "Max Neighbors" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Path Max Distance" +msgid "Time Horizon" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -#, fuzzy -msgid "Avoidance Enabled" -msgstr "Įgalinti" +msgid "Max Speed" +msgstr "" #: scene/2d/navigation_agent_2d.cpp msgid "" @@ -24339,6 +24384,11 @@ msgstr "" #: scene/gui/text_edit.cpp #, fuzzy +msgid "Drag And Drop Selection Enabled" +msgstr "Pasirinkite Nodus, kuriuos norite importuoti" + +#: scene/gui/text_edit.cpp +#, fuzzy msgid "Hiding Enabled" msgstr "Įgalinti" @@ -24722,16 +24772,17 @@ msgstr "Importuoti iš Nodo:" #: scene/main/viewport.cpp msgid "" -"This viewport is not set as render target. If you intend for it to display " -"its contents directly to the screen, make it a child of a Control so it can " -"obtain a size. Otherwise, make it a RenderTarget and assign its internal " -"texture to some node for display." +"The Viewport size must be greater than or equal to 2 pixels on both " +"dimensions to render anything." msgstr "" #: scene/main/viewport.cpp msgid "" -"The Viewport size must be greater than or equal to 2 pixels on both " -"dimensions to render anything." +"This Viewport has HDR enabled, but its Usage is set to 2D or 2D No-" +"Sampling.\n" +"HDR is only supported in Viewports that have their Usage set to 3D or 3D No-" +"Effects.\n" +"HDR will be disabled for this Viewport." msgstr "" #: scene/main/viewport.cpp diff --git a/editor/translations/lv.po b/editor/translations/lv.po index c80bd29122..0d2e4afec9 100644 --- a/editor/translations/lv.po +++ b/editor/translations/lv.po @@ -419,6 +419,11 @@ msgstr "" msgid "Command" msgstr "Komūns" +#: core/os/input_event.cpp +#, fuzzy +msgid "Physical" +msgstr "Fizikas kadrs %" + #: core/os/input_event.cpp scene/2d/touch_screen_button.cpp #: scene/gui/base_button.cpp scene/gui/texture_button.cpp #: scene/resources/default_theme/default_theme.cpp @@ -5544,6 +5549,11 @@ msgid "Mouse Extra Buttons Navigate History" msgstr "" #: editor/editor_settings.cpp +#, fuzzy +msgid "Drag And Drop Selection" +msgstr "Režģkartes izvēle" + +#: editor/editor_settings.cpp msgid "Appearance" msgstr "" @@ -18309,6 +18319,11 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Custom Build" +msgstr "Izgriezt mezglu(s)" + +#: platform/android/export/export_plugin.cpp msgid "Use Custom Build" msgstr "" @@ -18317,6 +18332,16 @@ msgstr "" msgid "Export Format" msgstr "Eksportēt bibliotēku" +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Min SDK" +msgstr "Galvenais Skripts:" + +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Target SDK" +msgstr "Izdzēst Mezglu" + #: platform/android/export/export_plugin.cpp platform/iphone/export/export.cpp msgid "Architectures" msgstr "" @@ -18356,16 +18381,6 @@ msgstr "Iepriekšējā cilne" msgid "Code" msgstr "" -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Min SDK" -msgstr "Galvenais Skripts:" - -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Target SDK" -msgstr "Izdzēst Mezglu" - #: platform/android/export/export_plugin.cpp platform/uwp/export/export.cpp #, fuzzy msgid "Package" @@ -18599,12 +18614,12 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"\"Hand Tracking\" is only valid when \"Xr Mode\" is \"Oculus Mobile VrApi\" " +"\"Hand Tracking\" is only valid when \"XR Mode\" is \"Oculus Mobile VrApi\" " "or \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Passthrough\" is only valid when \"Xr Mode\" is \"OpenXR\"." +msgid "\"Passthrough\" is only valid when \"XR Mode\" is \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp @@ -18613,17 +18628,37 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Min Sdk\" is only valid when \"Use Custom Build\" is enabled." +"\"Min SDK\" can only be overridden when \"Use Custom Build\" is enabled." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Min SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Min SDK\" cannot be lower than %d, which is the version needed by the " +"Godot library." msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Target Sdk\" is only valid when \"Use Custom Build\" is " -"enabled." +"\"Target SDK\" can only be overridden when \"Use Custom Build\" is enabled." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Target Sdk\" version must be greater or equal to \"Min Sdk\" version." +msgid "" +"\"Target SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Target SDK\" %d is higher than the default version %d. This may work, but " +"wasn't tested and may be unstable." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Target SDK\" version must be greater or equal to \"Min SDK\" version." msgstr "" #: platform/android/export/export_plugin.cpp platform/osx/export/export.cpp @@ -20249,7 +20284,7 @@ msgstr "Palielināt" msgid "Custom Viewport" msgstr "" -#: scene/2d/camera_2d.cpp scene/3d/camera.cpp +#: scene/2d/camera_2d.cpp scene/3d/camera.cpp scene/3d/interpolated_camera.cpp #: scene/animation/animation_player.cpp scene/animation/animation_tree.cpp #: scene/animation/animation_tree_player.cpp scene/main/timer.cpp #, fuzzy @@ -20967,6 +21002,11 @@ msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp #, fuzzy +msgid "Pathfinding" +msgstr "Konstante" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy msgid "Path Desired Distance" msgstr "Izvēlēties galveno ainu" @@ -20975,29 +21015,34 @@ msgid "Target Desired Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Neighbor Dist" +msgid "Path Max Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Max Neighbors" -msgstr "" +#, fuzzy +msgid "Avoidance" +msgstr "Papildus" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Time Horizon" +#, fuzzy +msgid "Avoidance Enabled" +msgstr "Iespējot" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +msgid "Neighbor Dist" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Max Speed" +msgid "Max Neighbors" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Path Max Distance" +msgid "Time Horizon" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -#, fuzzy -msgid "Avoidance Enabled" -msgstr "Iespējot" +msgid "Max Speed" +msgstr "" #: scene/2d/navigation_agent_2d.cpp msgid "" @@ -24206,6 +24251,11 @@ msgstr "" #: scene/gui/text_edit.cpp #, fuzzy +msgid "Drag And Drop Selection Enabled" +msgstr "Tikai izvēlētais" + +#: scene/gui/text_edit.cpp +#, fuzzy msgid "Hiding Enabled" msgstr "Iespējot" @@ -24599,16 +24649,17 @@ msgstr "Fokusa ceļš" #: scene/main/viewport.cpp msgid "" -"This viewport is not set as render target. If you intend for it to display " -"its contents directly to the screen, make it a child of a Control so it can " -"obtain a size. Otherwise, make it a RenderTarget and assign its internal " -"texture to some node for display." +"The Viewport size must be greater than or equal to 2 pixels on both " +"dimensions to render anything." msgstr "" #: scene/main/viewport.cpp msgid "" -"The Viewport size must be greater than or equal to 2 pixels on both " -"dimensions to render anything." +"This Viewport has HDR enabled, but its Usage is set to 2D or 2D No-" +"Sampling.\n" +"HDR is only supported in Viewports that have their Usage set to 3D or 3D No-" +"Effects.\n" +"HDR will be disabled for this Viewport." msgstr "" #: scene/main/viewport.cpp diff --git a/editor/translations/mk.po b/editor/translations/mk.po index 5c3bfc87ff..b35fce0168 100644 --- a/editor/translations/mk.po +++ b/editor/translations/mk.po @@ -389,6 +389,10 @@ msgstr "" msgid "Command" msgstr "" +#: core/os/input_event.cpp +msgid "Physical" +msgstr "" + #: core/os/input_event.cpp scene/2d/touch_screen_button.cpp #: scene/gui/base_button.cpp scene/gui/texture_button.cpp #: scene/resources/default_theme/default_theme.cpp @@ -5274,6 +5278,10 @@ msgid "Mouse Extra Buttons Navigate History" msgstr "" #: editor/editor_settings.cpp +msgid "Drag And Drop Selection" +msgstr "" + +#: editor/editor_settings.cpp msgid "Appearance" msgstr "" @@ -17759,6 +17767,10 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export_plugin.cpp +msgid "Custom Build" +msgstr "" + +#: platform/android/export/export_plugin.cpp msgid "Use Custom Build" msgstr "" @@ -17766,6 +17778,15 @@ msgstr "" msgid "Export Format" msgstr "" +#: platform/android/export/export_plugin.cpp +msgid "Min SDK" +msgstr "" + +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Target SDK" +msgstr "Јазол" + #: platform/android/export/export_plugin.cpp platform/iphone/export/export.cpp msgid "Architectures" msgstr "" @@ -17802,15 +17823,6 @@ msgstr "" msgid "Code" msgstr "" -#: platform/android/export/export_plugin.cpp -msgid "Min SDK" -msgstr "" - -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Target SDK" -msgstr "Јазол" - #: platform/android/export/export_plugin.cpp platform/uwp/export/export.cpp msgid "Package" msgstr "" @@ -18031,12 +18043,12 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"\"Hand Tracking\" is only valid when \"Xr Mode\" is \"Oculus Mobile VrApi\" " +"\"Hand Tracking\" is only valid when \"XR Mode\" is \"Oculus Mobile VrApi\" " "or \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Passthrough\" is only valid when \"Xr Mode\" is \"OpenXR\"." +msgid "\"Passthrough\" is only valid when \"XR Mode\" is \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp @@ -18045,17 +18057,37 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Min Sdk\" is only valid when \"Use Custom Build\" is enabled." +"\"Min SDK\" can only be overridden when \"Use Custom Build\" is enabled." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Min SDK\" should be a valid integer, but got \"%s\" which is invalid." msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Target Sdk\" is only valid when \"Use Custom Build\" is " -"enabled." +"\"Min SDK\" cannot be lower than %d, which is the version needed by the " +"Godot library." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Target Sdk\" version must be greater or equal to \"Min Sdk\" version." +msgid "" +"\"Target SDK\" can only be overridden when \"Use Custom Build\" is enabled." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Target SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Target SDK\" %d is higher than the default version %d. This may work, but " +"wasn't tested and may be unstable." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Target SDK\" version must be greater or equal to \"Min SDK\" version." msgstr "" #: platform/android/export/export_plugin.cpp platform/osx/export/export.cpp @@ -19568,7 +19600,7 @@ msgstr "" msgid "Custom Viewport" msgstr "" -#: scene/2d/camera_2d.cpp scene/3d/camera.cpp +#: scene/2d/camera_2d.cpp scene/3d/camera.cpp scene/3d/interpolated_camera.cpp #: scene/animation/animation_player.cpp scene/animation/animation_tree.cpp #: scene/animation/animation_tree_player.cpp scene/main/timer.cpp msgid "Process Mode" @@ -20236,6 +20268,10 @@ msgid "" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +msgid "Pathfinding" +msgstr "" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp msgid "Path Desired Distance" msgstr "" @@ -20244,27 +20280,31 @@ msgid "Target Desired Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Neighbor Dist" +msgid "Path Max Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Max Neighbors" +msgid "Avoidance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Time Horizon" +msgid "Avoidance Enabled" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Max Speed" +msgid "Neighbor Dist" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Path Max Distance" +msgid "Max Neighbors" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Avoidance Enabled" +msgid "Time Horizon" +msgstr "" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +msgid "Max Speed" msgstr "" #: scene/2d/navigation_agent_2d.cpp @@ -23217,6 +23257,10 @@ msgid "Fold Gutter" msgstr "" #: scene/gui/text_edit.cpp +msgid "Drag And Drop Selection Enabled" +msgstr "" + +#: scene/gui/text_edit.cpp msgid "Hiding Enabled" msgstr "" @@ -23571,16 +23615,17 @@ msgstr "" #: scene/main/viewport.cpp msgid "" -"This viewport is not set as render target. If you intend for it to display " -"its contents directly to the screen, make it a child of a Control so it can " -"obtain a size. Otherwise, make it a RenderTarget and assign its internal " -"texture to some node for display." +"The Viewport size must be greater than or equal to 2 pixels on both " +"dimensions to render anything." msgstr "" #: scene/main/viewport.cpp msgid "" -"The Viewport size must be greater than or equal to 2 pixels on both " -"dimensions to render anything." +"This Viewport has HDR enabled, but its Usage is set to 2D or 2D No-" +"Sampling.\n" +"HDR is only supported in Viewports that have their Usage set to 3D or 3D No-" +"Effects.\n" +"HDR will be disabled for this Viewport." msgstr "" #: scene/main/viewport.cpp diff --git a/editor/translations/ml.po b/editor/translations/ml.po index 7b247d8f78..b2f6c17059 100644 --- a/editor/translations/ml.po +++ b/editor/translations/ml.po @@ -394,6 +394,10 @@ msgstr "" msgid "Command" msgstr "" +#: core/os/input_event.cpp +msgid "Physical" +msgstr "" + #: core/os/input_event.cpp scene/2d/touch_screen_button.cpp #: scene/gui/base_button.cpp scene/gui/texture_button.cpp #: scene/resources/default_theme/default_theme.cpp @@ -5290,6 +5294,10 @@ msgid "Mouse Extra Buttons Navigate History" msgstr "" #: editor/editor_settings.cpp +msgid "Drag And Drop Selection" +msgstr "" + +#: editor/editor_settings.cpp msgid "Appearance" msgstr "" @@ -17788,6 +17796,11 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Custom Build" +msgstr "പ്രവൃത്തികൾ:" + +#: platform/android/export/export_plugin.cpp msgid "Use Custom Build" msgstr "" @@ -17796,6 +17809,14 @@ msgstr "" msgid "Export Format" msgstr "ത്രിമാന പരിവർത്തനം നോക്കുക" +#: platform/android/export/export_plugin.cpp +msgid "Min SDK" +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "Target SDK" +msgstr "" + #: platform/android/export/export_plugin.cpp platform/iphone/export/export.cpp msgid "Architectures" msgstr "" @@ -17832,14 +17853,6 @@ msgstr "" msgid "Code" msgstr "" -#: platform/android/export/export_plugin.cpp -msgid "Min SDK" -msgstr "" - -#: platform/android/export/export_plugin.cpp -msgid "Target SDK" -msgstr "" - #: platform/android/export/export_plugin.cpp platform/uwp/export/export.cpp msgid "Package" msgstr "" @@ -18060,12 +18073,12 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"\"Hand Tracking\" is only valid when \"Xr Mode\" is \"Oculus Mobile VrApi\" " +"\"Hand Tracking\" is only valid when \"XR Mode\" is \"Oculus Mobile VrApi\" " "or \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Passthrough\" is only valid when \"Xr Mode\" is \"OpenXR\"." +msgid "\"Passthrough\" is only valid when \"XR Mode\" is \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp @@ -18074,17 +18087,37 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Min Sdk\" is only valid when \"Use Custom Build\" is enabled." +"\"Min SDK\" can only be overridden when \"Use Custom Build\" is enabled." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Min SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Min SDK\" cannot be lower than %d, which is the version needed by the " +"Godot library." msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Target Sdk\" is only valid when \"Use Custom Build\" is " -"enabled." +"\"Target SDK\" can only be overridden when \"Use Custom Build\" is enabled." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Target Sdk\" version must be greater or equal to \"Min Sdk\" version." +msgid "" +"\"Target SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Target SDK\" %d is higher than the default version %d. This may work, but " +"wasn't tested and may be unstable." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Target SDK\" version must be greater or equal to \"Min SDK\" version." msgstr "" #: platform/android/export/export_plugin.cpp platform/osx/export/export.cpp @@ -19608,7 +19641,7 @@ msgstr "" msgid "Custom Viewport" msgstr "" -#: scene/2d/camera_2d.cpp scene/3d/camera.cpp +#: scene/2d/camera_2d.cpp scene/3d/camera.cpp scene/3d/interpolated_camera.cpp #: scene/animation/animation_player.cpp scene/animation/animation_tree.cpp #: scene/animation/animation_tree_player.cpp scene/main/timer.cpp msgid "Process Mode" @@ -20279,6 +20312,10 @@ msgid "" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +msgid "Pathfinding" +msgstr "" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp msgid "Path Desired Distance" msgstr "" @@ -20287,27 +20324,31 @@ msgid "Target Desired Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Neighbor Dist" +msgid "Path Max Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Max Neighbors" +msgid "Avoidance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Time Horizon" +msgid "Avoidance Enabled" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Max Speed" +msgid "Neighbor Dist" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Path Max Distance" +msgid "Max Neighbors" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Avoidance Enabled" +msgid "Time Horizon" +msgstr "" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +msgid "Max Speed" msgstr "" #: scene/2d/navigation_agent_2d.cpp @@ -23295,6 +23336,10 @@ msgid "Fold Gutter" msgstr "" #: scene/gui/text_edit.cpp +msgid "Drag And Drop Selection Enabled" +msgstr "" + +#: scene/gui/text_edit.cpp msgid "Hiding Enabled" msgstr "" @@ -23650,16 +23695,17 @@ msgstr "" #: scene/main/viewport.cpp msgid "" -"This viewport is not set as render target. If you intend for it to display " -"its contents directly to the screen, make it a child of a Control so it can " -"obtain a size. Otherwise, make it a RenderTarget and assign its internal " -"texture to some node for display." +"The Viewport size must be greater than or equal to 2 pixels on both " +"dimensions to render anything." msgstr "" #: scene/main/viewport.cpp msgid "" -"The Viewport size must be greater than or equal to 2 pixels on both " -"dimensions to render anything." +"This Viewport has HDR enabled, but its Usage is set to 2D or 2D No-" +"Sampling.\n" +"HDR is only supported in Viewports that have their Usage set to 3D or 3D No-" +"Effects.\n" +"HDR will be disabled for this Viewport." msgstr "" #: scene/main/viewport.cpp diff --git a/editor/translations/mr.po b/editor/translations/mr.po index d7aa4bd1aa..d9943d0a5e 100644 --- a/editor/translations/mr.po +++ b/editor/translations/mr.po @@ -394,6 +394,10 @@ msgstr "" msgid "Command" msgstr "समुदाय" +#: core/os/input_event.cpp +msgid "Physical" +msgstr "" + #: core/os/input_event.cpp scene/2d/touch_screen_button.cpp #: scene/gui/base_button.cpp scene/gui/texture_button.cpp #: scene/resources/default_theme/default_theme.cpp @@ -5280,6 +5284,10 @@ msgid "Mouse Extra Buttons Navigate History" msgstr "" #: editor/editor_settings.cpp +msgid "Drag And Drop Selection" +msgstr "" + +#: editor/editor_settings.cpp msgid "Appearance" msgstr "" @@ -17787,6 +17795,11 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Custom Build" +msgstr "अॅनिमेशन ट्री" + +#: platform/android/export/export_plugin.cpp msgid "Use Custom Build" msgstr "" @@ -17794,6 +17807,15 @@ msgstr "" msgid "Export Format" msgstr "" +#: platform/android/export/export_plugin.cpp +msgid "Min SDK" +msgstr "" + +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Target SDK" +msgstr "नोड हलवा" + #: platform/android/export/export_plugin.cpp platform/iphone/export/export.cpp msgid "Architectures" msgstr "" @@ -17830,15 +17852,6 @@ msgstr "" msgid "Code" msgstr "" -#: platform/android/export/export_plugin.cpp -msgid "Min SDK" -msgstr "" - -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Target SDK" -msgstr "नोड हलवा" - #: platform/android/export/export_plugin.cpp platform/uwp/export/export.cpp msgid "Package" msgstr "" @@ -18061,12 +18074,12 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"\"Hand Tracking\" is only valid when \"Xr Mode\" is \"Oculus Mobile VrApi\" " +"\"Hand Tracking\" is only valid when \"XR Mode\" is \"Oculus Mobile VrApi\" " "or \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Passthrough\" is only valid when \"Xr Mode\" is \"OpenXR\"." +msgid "\"Passthrough\" is only valid when \"XR Mode\" is \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp @@ -18075,17 +18088,37 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Min Sdk\" is only valid when \"Use Custom Build\" is enabled." +"\"Min SDK\" can only be overridden when \"Use Custom Build\" is enabled." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Min SDK\" should be a valid integer, but got \"%s\" which is invalid." msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Target Sdk\" is only valid when \"Use Custom Build\" is " -"enabled." +"\"Min SDK\" cannot be lower than %d, which is the version needed by the " +"Godot library." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Target Sdk\" version must be greater or equal to \"Min Sdk\" version." +msgid "" +"\"Target SDK\" can only be overridden when \"Use Custom Build\" is enabled." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Target SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Target SDK\" %d is higher than the default version %d. This may work, but " +"wasn't tested and may be unstable." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Target SDK\" version must be greater or equal to \"Min SDK\" version." msgstr "" #: platform/android/export/export_plugin.cpp platform/osx/export/export.cpp @@ -19609,7 +19642,7 @@ msgstr "" msgid "Custom Viewport" msgstr "" -#: scene/2d/camera_2d.cpp scene/3d/camera.cpp +#: scene/2d/camera_2d.cpp scene/3d/camera.cpp scene/3d/interpolated_camera.cpp #: scene/animation/animation_player.cpp scene/animation/animation_tree.cpp #: scene/animation/animation_tree_player.cpp scene/main/timer.cpp msgid "Process Mode" @@ -20292,6 +20325,10 @@ msgid "" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +msgid "Pathfinding" +msgstr "" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp msgid "Path Desired Distance" msgstr "" @@ -20300,29 +20337,34 @@ msgid "Target Desired Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Neighbor Dist" +msgid "Path Max Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Max Neighbors" -msgstr "" +#, fuzzy +msgid "Avoidance" +msgstr "समक्रमित करा" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Time Horizon" +#, fuzzy +msgid "Avoidance Enabled" +msgstr "समक्रमित करा" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +msgid "Neighbor Dist" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Max Speed" +msgid "Max Neighbors" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Path Max Distance" +msgid "Time Horizon" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -#, fuzzy -msgid "Avoidance Enabled" -msgstr "समक्रमित करा" +msgid "Max Speed" +msgstr "" #: scene/2d/navigation_agent_2d.cpp msgid "" @@ -23322,6 +23364,10 @@ msgid "Fold Gutter" msgstr "" #: scene/gui/text_edit.cpp +msgid "Drag And Drop Selection Enabled" +msgstr "" + +#: scene/gui/text_edit.cpp msgid "Hiding Enabled" msgstr "" @@ -23678,16 +23724,17 @@ msgstr "" #: scene/main/viewport.cpp msgid "" -"This viewport is not set as render target. If you intend for it to display " -"its contents directly to the screen, make it a child of a Control so it can " -"obtain a size. Otherwise, make it a RenderTarget and assign its internal " -"texture to some node for display." +"The Viewport size must be greater than or equal to 2 pixels on both " +"dimensions to render anything." msgstr "" #: scene/main/viewport.cpp msgid "" -"The Viewport size must be greater than or equal to 2 pixels on both " -"dimensions to render anything." +"This Viewport has HDR enabled, but its Usage is set to 2D or 2D No-" +"Sampling.\n" +"HDR is only supported in Viewports that have their Usage set to 3D or 3D No-" +"Effects.\n" +"HDR will be disabled for this Viewport." msgstr "" #: scene/main/viewport.cpp diff --git a/editor/translations/ms.po b/editor/translations/ms.po index b297eb52a3..a1955bb027 100644 --- a/editor/translations/ms.po +++ b/editor/translations/ms.po @@ -395,6 +395,11 @@ msgstr "Meta" msgid "Command" msgstr "Perintah" +#: core/os/input_event.cpp +#, fuzzy +msgid "Physical" +msgstr "Fizik" + #: core/os/input_event.cpp scene/2d/touch_screen_button.cpp #: scene/gui/base_button.cpp scene/gui/texture_button.cpp #: scene/resources/default_theme/default_theme.cpp @@ -5537,6 +5542,11 @@ msgid "Mouse Extra Buttons Navigate History" msgstr "" #: editor/editor_settings.cpp +#, fuzzy +msgid "Drag And Drop Selection" +msgstr "Semua Pilihan" + +#: editor/editor_settings.cpp msgid "Appearance" msgstr "" @@ -18502,6 +18512,11 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Custom Build" +msgstr "Potong Nod" + +#: platform/android/export/export_plugin.cpp msgid "Use Custom Build" msgstr "" @@ -18510,6 +18525,16 @@ msgstr "" msgid "Export Format" msgstr "Warna seragam." +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Min SDK" +msgstr "Saiz:" + +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Target SDK" +msgstr "Cipta Nod" + #: platform/android/export/export_plugin.cpp platform/iphone/export/export.cpp msgid "Architectures" msgstr "" @@ -18548,16 +18573,6 @@ msgstr "Tab sebelumnya" msgid "Code" msgstr "" -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Min SDK" -msgstr "Saiz:" - -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Target SDK" -msgstr "Cipta Nod" - #: platform/android/export/export_plugin.cpp platform/uwp/export/export.cpp #, fuzzy msgid "Package" @@ -18800,12 +18815,12 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"\"Hand Tracking\" is only valid when \"Xr Mode\" is \"Oculus Mobile VrApi\" " +"\"Hand Tracking\" is only valid when \"XR Mode\" is \"Oculus Mobile VrApi\" " "or \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Passthrough\" is only valid when \"Xr Mode\" is \"OpenXR\"." +msgid "\"Passthrough\" is only valid when \"XR Mode\" is \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp @@ -18814,17 +18829,37 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Min Sdk\" is only valid when \"Use Custom Build\" is enabled." +"\"Min SDK\" can only be overridden when \"Use Custom Build\" is enabled." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Min SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Min SDK\" cannot be lower than %d, which is the version needed by the " +"Godot library." msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Target Sdk\" is only valid when \"Use Custom Build\" is " -"enabled." +"\"Target SDK\" can only be overridden when \"Use Custom Build\" is enabled." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Target Sdk\" version must be greater or equal to \"Min Sdk\" version." +msgid "" +"\"Target SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Target SDK\" %d is higher than the default version %d. This may work, but " +"wasn't tested and may be unstable." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Target SDK\" version must be greater or equal to \"Min SDK\" version." msgstr "" #: platform/android/export/export_plugin.cpp platform/osx/export/export.cpp @@ -20453,7 +20488,7 @@ msgstr "Zum Masuk" msgid "Custom Viewport" msgstr "Tunjukkan Viewport" -#: scene/2d/camera_2d.cpp scene/3d/camera.cpp +#: scene/2d/camera_2d.cpp scene/3d/camera.cpp scene/3d/interpolated_camera.cpp #: scene/animation/animation_player.cpp scene/animation/animation_tree.cpp #: scene/animation/animation_tree_player.cpp scene/main/timer.cpp #, fuzzy @@ -21176,6 +21211,11 @@ msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp #, fuzzy +msgid "Pathfinding" +msgstr "Tampal Animasi" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy msgid "Path Desired Distance" msgstr "Pilih Adegan Utama" @@ -21184,29 +21224,34 @@ msgid "Target Desired Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Neighbor Dist" +msgid "Path Max Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Max Neighbors" -msgstr "" +#, fuzzy +msgid "Avoidance" +msgstr "Lanjutan" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Time Horizon" +#, fuzzy +msgid "Avoidance Enabled" +msgstr "Aktifkan" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +msgid "Neighbor Dist" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Max Speed" +msgid "Max Neighbors" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Path Max Distance" +msgid "Time Horizon" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -#, fuzzy -msgid "Avoidance Enabled" -msgstr "Aktifkan" +msgid "Max Speed" +msgstr "" #: scene/2d/navigation_agent_2d.cpp msgid "" @@ -24450,6 +24495,11 @@ msgstr "Folder:" #: scene/gui/text_edit.cpp #, fuzzy +msgid "Drag And Drop Selection Enabled" +msgstr "Pilihan Sahaja" + +#: scene/gui/text_edit.cpp +#, fuzzy msgid "Hiding Enabled" msgstr "Aktifkan" @@ -24847,16 +24897,17 @@ msgstr "Laluan Fokus" #: scene/main/viewport.cpp msgid "" -"This viewport is not set as render target. If you intend for it to display " -"its contents directly to the screen, make it a child of a Control so it can " -"obtain a size. Otherwise, make it a RenderTarget and assign its internal " -"texture to some node for display." +"The Viewport size must be greater than or equal to 2 pixels on both " +"dimensions to render anything." msgstr "" #: scene/main/viewport.cpp msgid "" -"The Viewport size must be greater than or equal to 2 pixels on both " -"dimensions to render anything." +"This Viewport has HDR enabled, but its Usage is set to 2D or 2D No-" +"Sampling.\n" +"HDR is only supported in Viewports that have their Usage set to 3D or 3D No-" +"Effects.\n" +"HDR will be disabled for this Viewport." msgstr "" #: scene/main/viewport.cpp diff --git a/editor/translations/nb.po b/editor/translations/nb.po index a545e4fc83..11bf857f4b 100644 --- a/editor/translations/nb.po +++ b/editor/translations/nb.po @@ -412,6 +412,11 @@ msgstr "Meta" msgid "Command" msgstr "Kommando" +#: core/os/input_event.cpp +#, fuzzy +msgid "Physical" +msgstr "Fysikk" + #: core/os/input_event.cpp scene/2d/touch_screen_button.cpp #: scene/gui/base_button.cpp scene/gui/texture_button.cpp #: scene/resources/default_theme/default_theme.cpp @@ -5721,6 +5726,11 @@ msgid "Mouse Extra Buttons Navigate History" msgstr "" #: editor/editor_settings.cpp +#, fuzzy +msgid "Drag And Drop Selection" +msgstr "Slett Valgte" + +#: editor/editor_settings.cpp msgid "Appearance" msgstr "" @@ -19287,6 +19297,11 @@ msgstr "" #: platform/android/export/export_plugin.cpp #, fuzzy +msgid "Custom Build" +msgstr "Bruk Tilpasset Brukerkatalog" + +#: platform/android/export/export_plugin.cpp +#, fuzzy msgid "Use Custom Build" msgstr "Bruk Tilpasset Brukerkatalog" @@ -19295,6 +19310,16 @@ msgstr "Bruk Tilpasset Brukerkatalog" msgid "Export Format" msgstr "Eksporter Prosjekt" +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Min SDK" +msgstr "Størrelse:" + +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Target SDK" +msgstr "Mål FPS" + #: platform/android/export/export_plugin.cpp platform/iphone/export/export.cpp msgid "Architectures" msgstr "" @@ -19336,16 +19361,6 @@ msgstr "Forrige fane" msgid "Code" msgstr "" -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Min SDK" -msgstr "Størrelse:" - -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Target SDK" -msgstr "Mål FPS" - #: platform/android/export/export_plugin.cpp platform/uwp/export/export.cpp #, fuzzy msgid "Package" @@ -19591,12 +19606,12 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"\"Hand Tracking\" is only valid when \"Xr Mode\" is \"Oculus Mobile VrApi\" " +"\"Hand Tracking\" is only valid when \"XR Mode\" is \"Oculus Mobile VrApi\" " "or \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Passthrough\" is only valid when \"Xr Mode\" is \"OpenXR\"." +msgid "\"Passthrough\" is only valid when \"XR Mode\" is \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp @@ -19605,17 +19620,37 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Min Sdk\" is only valid when \"Use Custom Build\" is enabled." +"\"Min SDK\" can only be overridden when \"Use Custom Build\" is enabled." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Min SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Min SDK\" cannot be lower than %d, which is the version needed by the " +"Godot library." msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Target Sdk\" is only valid when \"Use Custom Build\" is " -"enabled." +"\"Target SDK\" can only be overridden when \"Use Custom Build\" is enabled." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Target Sdk\" version must be greater or equal to \"Min Sdk\" version." +msgid "" +"\"Target SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Target SDK\" %d is higher than the default version %d. This may work, but " +"wasn't tested and may be unstable." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Target SDK\" version must be greater or equal to \"Min SDK\" version." msgstr "" #: platform/android/export/export_plugin.cpp platform/osx/export/export.cpp @@ -21283,7 +21318,7 @@ msgstr "Forstørr" msgid "Custom Viewport" msgstr "Vis hjelpere" -#: scene/2d/camera_2d.cpp scene/3d/camera.cpp +#: scene/2d/camera_2d.cpp scene/3d/camera.cpp scene/3d/interpolated_camera.cpp #: scene/animation/animation_player.cpp scene/animation/animation_tree.cpp #: scene/animation/animation_tree_player.cpp scene/main/timer.cpp #, fuzzy @@ -22024,6 +22059,11 @@ msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp #, fuzzy +msgid "Pathfinding" +msgstr "Fyll" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy msgid "Path Desired Distance" msgstr "Velg en HovedScene" @@ -22032,6 +22072,20 @@ msgid "Target Desired Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +msgid "Path Max Distance" +msgstr "" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Avoidance" +msgstr "Avansert" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Avoidance Enabled" +msgstr "Aktiver" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp msgid "Neighbor Dist" msgstr "" @@ -22049,15 +22103,6 @@ msgstr "Vend horisontalt" msgid "Max Speed" msgstr "Hastighet (FPS):" -#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Path Max Distance" -msgstr "" - -#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -#, fuzzy -msgid "Avoidance Enabled" -msgstr "Aktiver" - #: scene/2d/navigation_agent_2d.cpp msgid "" "The NavigationAgent2D can be used only under a Node2D inheriting parent node." @@ -25366,6 +25411,11 @@ msgstr "Mappe:" #: scene/gui/text_edit.cpp #, fuzzy +msgid "Drag And Drop Selection Enabled" +msgstr "Kun Valgte" + +#: scene/gui/text_edit.cpp +#, fuzzy msgid "Hiding Enabled" msgstr "Aktiver" @@ -25769,16 +25819,17 @@ msgstr "Eksporter Prosjekt" #: scene/main/viewport.cpp msgid "" -"This viewport is not set as render target. If you intend for it to display " -"its contents directly to the screen, make it a child of a Control so it can " -"obtain a size. Otherwise, make it a RenderTarget and assign its internal " -"texture to some node for display." +"The Viewport size must be greater than or equal to 2 pixels on both " +"dimensions to render anything." msgstr "" #: scene/main/viewport.cpp msgid "" -"The Viewport size must be greater than or equal to 2 pixels on both " -"dimensions to render anything." +"This Viewport has HDR enabled, but its Usage is set to 2D or 2D No-" +"Sampling.\n" +"HDR is only supported in Viewports that have their Usage set to 3D or 3D No-" +"Effects.\n" +"HDR will be disabled for this Viewport." msgstr "" #: scene/main/viewport.cpp diff --git a/editor/translations/nl.po b/editor/translations/nl.po index 32d57b08b9..def707ac8b 100644 --- a/editor/translations/nl.po +++ b/editor/translations/nl.po @@ -484,6 +484,11 @@ msgstr "" msgid "Command" msgstr "Gemeenschap" +#: core/os/input_event.cpp +#, fuzzy +msgid "Physical" +msgstr "Physics Frame %" + #: core/os/input_event.cpp scene/2d/touch_screen_button.cpp #: scene/gui/base_button.cpp scene/gui/texture_button.cpp #: scene/resources/default_theme/default_theme.cpp @@ -5714,6 +5719,11 @@ msgid "Mouse Extra Buttons Navigate History" msgstr "" #: editor/editor_settings.cpp +#, fuzzy +msgid "Drag And Drop Selection" +msgstr "GridMap-selectie vullen" + +#: editor/editor_settings.cpp msgid "Appearance" msgstr "" @@ -19143,6 +19153,11 @@ msgid "The package must have at least one '.' separator." msgstr "De pakketnaam moet ten minste een '.' bevatten." #: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Custom Build" +msgstr "Knopen knippen" + +#: platform/android/export/export_plugin.cpp msgid "Use Custom Build" msgstr "" @@ -19151,6 +19166,16 @@ msgstr "" msgid "Export Format" msgstr "Export Pad" +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Min SDK" +msgstr "Omlijningsgrootte:" + +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Target SDK" +msgstr "Doel" + #: platform/android/export/export_plugin.cpp platform/iphone/export/export.cpp #, fuzzy msgid "Architectures" @@ -19194,16 +19219,6 @@ msgstr "Inspecteer vorige instantie" msgid "Code" msgstr "" -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Min SDK" -msgstr "Omlijningsgrootte:" - -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Target SDK" -msgstr "Doel" - #: platform/android/export/export_plugin.cpp platform/uwp/export/export.cpp #, fuzzy msgid "Package" @@ -19453,7 +19468,7 @@ msgstr "\"Use Custom Build\" moet geactiveerd zijn om plugins te gebruiken." #: platform/android/export/export_plugin.cpp #, fuzzy msgid "" -"\"Hand Tracking\" is only valid when \"Xr Mode\" is \"Oculus Mobile VrApi\" " +"\"Hand Tracking\" is only valid when \"XR Mode\" is \"Oculus Mobile VrApi\" " "or \"OpenXR\"." msgstr "" "\"Hand Tracking\" is alleen geldig als \"Xr Mode\" op \"Oculus Mobile VR\" " @@ -19461,7 +19476,7 @@ msgstr "" #: platform/android/export/export_plugin.cpp #, fuzzy -msgid "\"Passthrough\" is only valid when \"Xr Mode\" is \"OpenXR\"." +msgid "\"Passthrough\" is only valid when \"XR Mode\" is \"OpenXR\"." msgstr "" "\"Hand Tracking\" is alleen geldig als \"Xr Mode\" op \"Oculus Mobile VR\" " "staat." @@ -19473,18 +19488,38 @@ msgstr "\"Export AAB\" is alleen geldig als \"Use Custom Build\" aan staat." #: platform/android/export/export_plugin.cpp #, fuzzy msgid "" -"Changing the \"Min Sdk\" is only valid when \"Use Custom Build\" is enabled." +"\"Min SDK\" can only be overridden when \"Use Custom Build\" is enabled." msgstr "\"Export AAB\" is alleen geldig als \"Use Custom Build\" aan staat." #: platform/android/export/export_plugin.cpp +msgid "\"Min SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Min SDK\" cannot be lower than %d, which is the version needed by the " +"Godot library." +msgstr "" + +#: platform/android/export/export_plugin.cpp #, fuzzy msgid "" -"Changing the \"Target Sdk\" is only valid when \"Use Custom Build\" is " -"enabled." +"\"Target SDK\" can only be overridden when \"Use Custom Build\" is enabled." msgstr "\"Export AAB\" is alleen geldig als \"Use Custom Build\" aan staat." #: platform/android/export/export_plugin.cpp -msgid "\"Target Sdk\" version must be greater or equal to \"Min Sdk\" version." +msgid "" +"\"Target SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Target SDK\" %d is higher than the default version %d. This may work, but " +"wasn't tested and may be unstable." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Target SDK\" version must be greater or equal to \"Min SDK\" version." msgstr "" #: platform/android/export/export_plugin.cpp platform/osx/export/export.cpp @@ -21172,7 +21207,7 @@ msgstr "Inzoomen" msgid "Custom Viewport" msgstr "1 beeldvenster" -#: scene/2d/camera_2d.cpp scene/3d/camera.cpp +#: scene/2d/camera_2d.cpp scene/3d/camera.cpp scene/3d/interpolated_camera.cpp #: scene/animation/animation_player.cpp scene/animation/animation_tree.cpp #: scene/animation/animation_tree_player.cpp scene/main/timer.cpp #, fuzzy @@ -21944,6 +21979,11 @@ msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp #, fuzzy +msgid "Pathfinding" +msgstr "Binding" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy msgid "Path Desired Distance" msgstr "Selecteerafstand:" @@ -21952,6 +21992,21 @@ msgid "Target Desired Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Path Max Distance" +msgstr "Selecteerafstand:" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Avoidance" +msgstr "Geavanceerd" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Avoidance Enabled" +msgstr "Inschakelen" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp msgid "Neighbor Dist" msgstr "" @@ -21969,16 +22024,6 @@ msgstr "Horizontaal omdraaien" msgid "Max Speed" msgstr "Snelheid:" -#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -#, fuzzy -msgid "Path Max Distance" -msgstr "Selecteerafstand:" - -#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -#, fuzzy -msgid "Avoidance Enabled" -msgstr "Inschakelen" - #: scene/2d/navigation_agent_2d.cpp #, fuzzy msgid "" @@ -25395,6 +25440,11 @@ msgstr "Map:" #: scene/gui/text_edit.cpp #, fuzzy +msgid "Drag And Drop Selection Enabled" +msgstr "Alleen selectie" + +#: scene/gui/text_edit.cpp +#, fuzzy msgid "Hiding Enabled" msgstr "Inschakelen" @@ -25801,18 +25851,6 @@ msgid "Viewport Path" msgstr "Export Pad" #: scene/main/viewport.cpp -msgid "" -"This viewport is not set as render target. If you intend for it to display " -"its contents directly to the screen, make it a child of a Control so it can " -"obtain a size. Otherwise, make it a RenderTarget and assign its internal " -"texture to some node for display." -msgstr "" -"Dit beeldvenster is niet ingesteld als renderdoelwit. Als de inhoud op het " -"scherm getoond moet worden, moet je het een kind van een Control knoop " -"maken, zodat het een grootte kan ontvangen. Anders, maak er een RenderTarget " -"van en wijs zijn interne textuur toe aan een knoop om te tonen." - -#: scene/main/viewport.cpp #, fuzzy msgid "" "The Viewport size must be greater than or equal to 2 pixels on both " @@ -25821,6 +25859,15 @@ msgstr "" "De grootte van een Viewport moet groter zijn dan 0 om iets weer te geven." #: scene/main/viewport.cpp +msgid "" +"This Viewport has HDR enabled, but its Usage is set to 2D or 2D No-" +"Sampling.\n" +"HDR is only supported in Viewports that have their Usage set to 3D or 3D No-" +"Effects.\n" +"HDR will be disabled for this Viewport." +msgstr "" + +#: scene/main/viewport.cpp msgid "ARVR" msgstr "" diff --git a/editor/translations/pl.po b/editor/translations/pl.po index e174b8a673..9fdaafae3e 100644 --- a/editor/translations/pl.po +++ b/editor/translations/pl.po @@ -61,13 +61,14 @@ # Konrad <kobe-interactive@protonmail.com>, 2022. # Pixel Zone - Godot Engine Tutorials <karoltomaszewskimusic@gmail.com>, 2022. # DK0492 <doriankaczmarek28@gmail.com>, 2022. +# Dawid Skubij <davidsd@tlen.pl>, 2022. msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "Report-Msgid-Bugs-To: https://github.com/godotengine/godot\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2022-05-30 16:17+0000\n" -"Last-Translator: DK0492 <doriankaczmarek28@gmail.com>\n" +"PO-Revision-Date: 2022-07-05 23:51+0000\n" +"Last-Translator: Dawid Skubij <davidsd@tlen.pl>\n" "Language-Team: Polish <https://hosted.weblate.org/projects/godot-engine/" "godot/pl/>\n" "Language: pl\n" @@ -76,7 +77,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 " "|| n%100>=20) ? 1 : 2;\n" -"X-Generator: Weblate 4.13-dev\n" +"X-Generator: Weblate 4.13.1-dev\n" #: core/bind/core_bind.cpp main/main.cpp msgid "Tablet Driver" @@ -448,6 +449,11 @@ msgstr "Meta" msgid "Command" msgstr "Command" +#: core/os/input_event.cpp +#, fuzzy +msgid "Physical" +msgstr " (fizyczny)" + #: core/os/input_event.cpp scene/2d/touch_screen_button.cpp #: scene/gui/base_button.cpp scene/gui/texture_button.cpp #: scene/resources/default_theme/default_theme.cpp @@ -714,9 +720,8 @@ msgstr "Kontrola wersji" #: core/project_settings.cpp scene/2d/collision_object_2d.cpp #: scene/3d/collision_object.cpp scene/gui/control.cpp -#, fuzzy msgid "Input" -msgstr "Input" +msgstr "Wejście" #: core/project_settings.cpp msgid "UI Accept" @@ -5616,6 +5621,11 @@ msgid "Mouse Extra Buttons Navigate History" msgstr "" #: editor/editor_settings.cpp +#, fuzzy +msgid "Drag And Drop Selection" +msgstr "Wybór GridMap" + +#: editor/editor_settings.cpp msgid "Appearance" msgstr "Wygląd" @@ -18857,6 +18867,11 @@ msgstr "Paczka musi mieć co najmniej jedną kropkę jako separator." #: platform/android/export/export_plugin.cpp #, fuzzy +msgid "Custom Build" +msgstr "Użyj niestandardowego katalogu użytkownika" + +#: platform/android/export/export_plugin.cpp +#, fuzzy msgid "Use Custom Build" msgstr "Użyj niestandardowego katalogu użytkownika" @@ -18865,6 +18880,16 @@ msgstr "Użyj niestandardowego katalogu użytkownika" msgid "Export Format" msgstr "Ścieżka eksportu" +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Min SDK" +msgstr "Rozmiar zarysu:" + +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Target SDK" +msgstr "Docelowa liczba klatek na sekundę (FPS)" + #: platform/android/export/export_plugin.cpp platform/iphone/export/export.cpp #, fuzzy msgid "Architectures" @@ -18908,16 +18933,6 @@ msgstr "Sprawdź poprzednią instancję" msgid "Code" msgstr "" -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Min SDK" -msgstr "Rozmiar zarysu:" - -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Target SDK" -msgstr "Docelowa liczba klatek na sekundę (FPS)" - #: platform/android/export/export_plugin.cpp platform/uwp/export/export.cpp #, fuzzy msgid "Package" @@ -19166,15 +19181,17 @@ msgid "\"Use Custom Build\" must be enabled to use the plugins." msgstr "\"Use Custom Build\" musi być włączone, by używać wtyczek." #: platform/android/export/export_plugin.cpp +#, fuzzy msgid "" -"\"Hand Tracking\" is only valid when \"Xr Mode\" is \"Oculus Mobile VrApi\" " +"\"Hand Tracking\" is only valid when \"XR Mode\" is \"Oculus Mobile VrApi\" " "or \"OpenXR\"." msgstr "" "\"Hand Tracking\" jest poprawne tylko, gdy \"Xr Mode\" jest \"Oculus Mobile " "VrApi\" lub \"OpenXR\"." #: platform/android/export/export_plugin.cpp -msgid "\"Passthrough\" is only valid when \"Xr Mode\" is \"OpenXR\"." +#, fuzzy +msgid "\"Passthrough\" is only valid when \"XR Mode\" is \"OpenXR\"." msgstr "\"Passthrough\" jest poprawne tylko, gdy \"Xr Mode\" jest \"OpenXR\"." #: platform/android/export/export_plugin.cpp @@ -19183,22 +19200,45 @@ msgstr "" "\"Eksportuj AAB\" jest ważne tylko gdy \"Use Custom Build\" jest włączone." #: platform/android/export/export_plugin.cpp +#, fuzzy msgid "" -"Changing the \"Min Sdk\" is only valid when \"Use Custom Build\" is enabled." +"\"Min SDK\" can only be overridden when \"Use Custom Build\" is enabled." msgstr "" "Zmiana \"Min Sdk\" jest poprawna tylko, gdy \"Use Custom Build\" jest " "włączone." #: platform/android/export/export_plugin.cpp +msgid "\"Min SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Min SDK\" cannot be lower than %d, which is the version needed by the " +"Godot library." +msgstr "" + +#: platform/android/export/export_plugin.cpp +#, fuzzy msgid "" -"Changing the \"Target Sdk\" is only valid when \"Use Custom Build\" is " -"enabled." +"\"Target SDK\" can only be overridden when \"Use Custom Build\" is enabled." msgstr "" "Zmiana \"Target Sdk\" jest poprawna tylko, gdy \"Use Custom Build\" jest " "włączone." #: platform/android/export/export_plugin.cpp -msgid "\"Target Sdk\" version must be greater or equal to \"Min Sdk\" version." +msgid "" +"\"Target SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Target SDK\" %d is higher than the default version %d. This may work, but " +"wasn't tested and may be unstable." +msgstr "" + +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "\"Target SDK\" version must be greater or equal to \"Min SDK\" version." msgstr "Wersja \"Target Sdk\" musi być większa lub równa wersji \"Min Sdk\"." #: platform/android/export/export_plugin.cpp platform/osx/export/export.cpp @@ -20938,7 +20978,7 @@ msgstr "Przybliż" msgid "Custom Viewport" msgstr "1 widok" -#: scene/2d/camera_2d.cpp scene/3d/camera.cpp +#: scene/2d/camera_2d.cpp scene/3d/camera.cpp scene/3d/interpolated_camera.cpp #: scene/animation/animation_player.cpp scene/animation/animation_tree.cpp #: scene/animation/animation_tree_player.cpp scene/main/timer.cpp #, fuzzy @@ -21717,6 +21757,11 @@ msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp #, fuzzy +msgid "Pathfinding" +msgstr "Wiązanie" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy msgid "Path Desired Distance" msgstr "Wybierz odległość:" @@ -21725,6 +21770,21 @@ msgid "Target Desired Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Path Max Distance" +msgstr "Wybierz odległość:" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Avoidance" +msgstr "Zaawansowane" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Avoidance Enabled" +msgstr "Włącz" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp msgid "Neighbor Dist" msgstr "" @@ -21742,16 +21802,6 @@ msgstr "Odbij poziomo" msgid "Max Speed" msgstr "Szybkość:" -#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -#, fuzzy -msgid "Path Max Distance" -msgstr "Wybierz odległość:" - -#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -#, fuzzy -msgid "Avoidance Enabled" -msgstr "Włącz" - #: scene/2d/navigation_agent_2d.cpp #, fuzzy msgid "" @@ -23582,9 +23632,8 @@ msgid "A RoomGroup should not be a child or grandchild of a Portal." msgstr "RoomGroup nie powinien być potomkiem Portalu." #: scene/3d/portal.cpp -#, fuzzy msgid "Portal Active" -msgstr " [portale aktywne]" +msgstr "Portal Aktywny" #: scene/3d/portal.cpp scene/resources/occluder_shape_polygon.cpp msgid "Two Way" @@ -25209,6 +25258,11 @@ msgstr "Folder:" #: scene/gui/text_edit.cpp #, fuzzy +msgid "Drag And Drop Selection Enabled" +msgstr "Tylko zaznaczenie" + +#: scene/gui/text_edit.cpp +#, fuzzy msgid "Hiding Enabled" msgstr "Włącz" @@ -25545,9 +25599,8 @@ msgid "Draw 2D Outlines" msgstr "Utwórz obrys" #: scene/main/scene_tree.cpp servers/visual_server.cpp -#, fuzzy msgid "Reflections" -msgstr "Kierunki" +msgstr "Odbicia" #: scene/main/scene_tree.cpp #, fuzzy @@ -25620,18 +25673,6 @@ msgstr "Ścieżka eksportu" #: scene/main/viewport.cpp msgid "" -"This viewport is not set as render target. If you intend for it to display " -"its contents directly to the screen, make it a child of a Control so it can " -"obtain a size. Otherwise, make it a RenderTarget and assign its internal " -"texture to some node for display." -msgstr "" -"Ten Viewport nie jest ustawiony jako Render Target. Jeśli chcesz wyświetlić " -"jego zawartość na ekranie dodaj go jako dziecko węzła typu Control, aby " -"otrzymał jakiś rozmiar. W przeciwnym wypadku ustawi opcję RenderTarget i " -"przyporządkuj jego teksturę dla któregoś węzła." - -#: scene/main/viewport.cpp -msgid "" "The Viewport size must be greater than or equal to 2 pixels on both " "dimensions to render anything." msgstr "" @@ -25639,6 +25680,15 @@ msgstr "" "cokolwiek renderować." #: scene/main/viewport.cpp +msgid "" +"This Viewport has HDR enabled, but its Usage is set to 2D or 2D No-" +"Sampling.\n" +"HDR is only supported in Viewports that have their Usage set to 3D or 3D No-" +"Effects.\n" +"HDR will be disabled for this Viewport." +msgstr "" + +#: scene/main/viewport.cpp msgid "ARVR" msgstr "" @@ -26730,7 +26780,7 @@ msgstr "Warunek" #: scene/resources/environment.cpp msgid "Fog" -msgstr "" +msgstr "Mgła" #: scene/resources/environment.cpp #, fuzzy @@ -26912,9 +26962,8 @@ msgstr "" #: scene/resources/environment.cpp #: servers/audio/effects/audio_effect_chorus.cpp -#, fuzzy msgid "2" -msgstr "2D" +msgstr "2" #: scene/resources/environment.cpp #: servers/audio/effects/audio_effect_chorus.cpp diff --git a/editor/translations/pr.po b/editor/translations/pr.po index f60daf2f7b..d0e041aba9 100644 --- a/editor/translations/pr.po +++ b/editor/translations/pr.po @@ -413,6 +413,11 @@ msgstr "" msgid "Command" msgstr "" +#: core/os/input_event.cpp +#, fuzzy +msgid "Physical" +msgstr "Paste yer Node" + #: core/os/input_event.cpp scene/2d/touch_screen_button.cpp #: scene/gui/base_button.cpp scene/gui/texture_button.cpp #: scene/resources/default_theme/default_theme.cpp @@ -5460,6 +5465,11 @@ msgid "Mouse Extra Buttons Navigate History" msgstr "" #: editor/editor_settings.cpp +#, fuzzy +msgid "Drag And Drop Selection" +msgstr "Yar, Blow th' Selected Down!" + +#: editor/editor_settings.cpp msgid "Appearance" msgstr "" @@ -18559,6 +18569,11 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Custom Build" +msgstr "Slit th' Node" + +#: platform/android/export/export_plugin.cpp msgid "Use Custom Build" msgstr "" @@ -18567,6 +18582,16 @@ msgstr "" msgid "Export Format" msgstr "Change yer Anim Transform" +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Min SDK" +msgstr "Edit" + +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Target SDK" +msgstr "Slit th' Node" + #: platform/android/export/export_plugin.cpp platform/iphone/export/export.cpp msgid "Architectures" msgstr "" @@ -18606,16 +18631,6 @@ msgstr "" msgid "Code" msgstr "" -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Min SDK" -msgstr "Edit" - -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Target SDK" -msgstr "Slit th' Node" - #: platform/android/export/export_plugin.cpp platform/uwp/export/export.cpp #, fuzzy msgid "Package" @@ -18849,12 +18864,12 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"\"Hand Tracking\" is only valid when \"Xr Mode\" is \"Oculus Mobile VrApi\" " +"\"Hand Tracking\" is only valid when \"XR Mode\" is \"Oculus Mobile VrApi\" " "or \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Passthrough\" is only valid when \"Xr Mode\" is \"OpenXR\"." +msgid "\"Passthrough\" is only valid when \"XR Mode\" is \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp @@ -18863,17 +18878,37 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Min Sdk\" is only valid when \"Use Custom Build\" is enabled." +"\"Min SDK\" can only be overridden when \"Use Custom Build\" is enabled." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Min SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Min SDK\" cannot be lower than %d, which is the version needed by the " +"Godot library." msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Target Sdk\" is only valid when \"Use Custom Build\" is " -"enabled." +"\"Target SDK\" can only be overridden when \"Use Custom Build\" is enabled." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Target Sdk\" version must be greater or equal to \"Min Sdk\" version." +msgid "" +"\"Target SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Target SDK\" %d is higher than the default version %d. This may work, but " +"wasn't tested and may be unstable." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Target SDK\" version must be greater or equal to \"Min SDK\" version." msgstr "" #: platform/android/export/export_plugin.cpp platform/osx/export/export.cpp @@ -20478,7 +20513,7 @@ msgstr "" msgid "Custom Viewport" msgstr "" -#: scene/2d/camera_2d.cpp scene/3d/camera.cpp +#: scene/2d/camera_2d.cpp scene/3d/camera.cpp scene/3d/interpolated_camera.cpp #: scene/animation/animation_player.cpp scene/animation/animation_tree.cpp #: scene/animation/animation_tree_player.cpp scene/main/timer.cpp #, fuzzy @@ -21184,6 +21219,11 @@ msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp #, fuzzy +msgid "Pathfinding" +msgstr "Slit th' Node" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy msgid "Path Desired Distance" msgstr "Edit" @@ -21192,29 +21232,34 @@ msgid "Target Desired Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Neighbor Dist" +msgid "Path Max Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Max Neighbors" -msgstr "" +#, fuzzy +msgid "Avoidance" +msgstr "Paste yer Node" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Time Horizon" +#, fuzzy +msgid "Avoidance Enabled" +msgstr "Paste yer Node" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +msgid "Neighbor Dist" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Max Speed" +msgid "Max Neighbors" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Path Max Distance" +msgid "Time Horizon" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -#, fuzzy -msgid "Avoidance Enabled" -msgstr "Paste yer Node" +msgid "Max Speed" +msgstr "" #: scene/2d/navigation_agent_2d.cpp msgid "" @@ -24349,6 +24394,11 @@ msgstr "" #: scene/gui/text_edit.cpp #, fuzzy +msgid "Drag And Drop Selection Enabled" +msgstr "Slit th' Node" + +#: scene/gui/text_edit.cpp +#, fuzzy msgid "Hiding Enabled" msgstr "Paste yer Node" @@ -24731,16 +24781,17 @@ msgstr "" #: scene/main/viewport.cpp msgid "" -"This viewport is not set as render target. If you intend for it to display " -"its contents directly to the screen, make it a child of a Control so it can " -"obtain a size. Otherwise, make it a RenderTarget and assign its internal " -"texture to some node for display." +"The Viewport size must be greater than or equal to 2 pixels on both " +"dimensions to render anything." msgstr "" #: scene/main/viewport.cpp msgid "" -"The Viewport size must be greater than or equal to 2 pixels on both " -"dimensions to render anything." +"This Viewport has HDR enabled, but its Usage is set to 2D or 2D No-" +"Sampling.\n" +"HDR is only supported in Viewports that have their Usage set to 3D or 3D No-" +"Effects.\n" +"HDR will be disabled for this Viewport." msgstr "" #: scene/main/viewport.cpp diff --git a/editor/translations/pt.po b/editor/translations/pt.po index 7db8765ae3..edbc6971fb 100644 --- a/editor/translations/pt.po +++ b/editor/translations/pt.po @@ -407,6 +407,11 @@ msgstr "Meta" msgid "Command" msgstr "Comando" +#: core/os/input_event.cpp +#, fuzzy +msgid "Physical" +msgstr " (Físico)" + #: core/os/input_event.cpp scene/2d/touch_screen_button.cpp #: scene/gui/base_button.cpp scene/gui/texture_button.cpp #: scene/resources/default_theme/default_theme.cpp @@ -5528,6 +5533,11 @@ msgid "Mouse Extra Buttons Navigate History" msgstr "Botões extra do Mouse para Navegar no Histórico" #: editor/editor_settings.cpp +#, fuzzy +msgid "Drag And Drop Selection" +msgstr "Seleção de GridMap" + +#: editor/editor_settings.cpp msgid "Appearance" msgstr "Aparência" @@ -18620,6 +18630,11 @@ msgid "The package must have at least one '.' separator." msgstr "O pacote deve ter pelo menos um separador '.'." #: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Custom Build" +msgstr "Usar Compilação Personalizada" + +#: platform/android/export/export_plugin.cpp msgid "Use Custom Build" msgstr "Usar Compilação Personalizada" @@ -18628,6 +18643,16 @@ msgstr "Usar Compilação Personalizada" msgid "Export Format" msgstr "Exportar Caminho" +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Min SDK" +msgstr "Tamanho do contorno:" + +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Target SDK" +msgstr "Alvo" + #: platform/android/export/export_plugin.cpp platform/iphone/export/export.cpp #, fuzzy msgid "Architectures" @@ -18671,16 +18696,6 @@ msgstr "Inspecionar instância anterior" msgid "Code" msgstr "Código" -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Min SDK" -msgstr "Tamanho do contorno:" - -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Target SDK" -msgstr "Alvo" - #: platform/android/export/export_plugin.cpp platform/uwp/export/export.cpp #, fuzzy msgid "Package" @@ -18936,15 +18951,17 @@ msgid "\"Use Custom Build\" must be enabled to use the plugins." msgstr "\"Use Custom Build\" têm de estar ativa para usar os plugins." #: platform/android/export/export_plugin.cpp +#, fuzzy msgid "" -"\"Hand Tracking\" is only valid when \"Xr Mode\" is \"Oculus Mobile VrApi\" " +"\"Hand Tracking\" is only valid when \"XR Mode\" is \"Oculus Mobile VrApi\" " "or \"OpenXR\"." msgstr "" "\"Rastreamento de Mão\" só é válido quando \"Modo Xr\" é \"Oculus Mobile " "VrApi\" ou \"OpenXR\"." #: platform/android/export/export_plugin.cpp -msgid "\"Passthrough\" is only valid when \"Xr Mode\" is \"OpenXR\"." +#, fuzzy +msgid "\"Passthrough\" is only valid when \"XR Mode\" is \"OpenXR\"." msgstr "\"Passthrough\" só é válido quando \"Modo Xr\" é \"OpenXR\"." #: platform/android/export/export_plugin.cpp @@ -18952,20 +18969,43 @@ msgid "\"Export AAB\" is only valid when \"Use Custom Build\" is enabled." msgstr "\"Exportar AAB\" só é válido quando \"Use Custom Build\" está ativa." #: platform/android/export/export_plugin.cpp +#, fuzzy msgid "" -"Changing the \"Min Sdk\" is only valid when \"Use Custom Build\" is enabled." +"\"Min SDK\" can only be overridden when \"Use Custom Build\" is enabled." msgstr "" "Mudança de \"Min Sdk\" só é válida quando \"Use Custom Build\" está ativa." #: platform/android/export/export_plugin.cpp +msgid "\"Min SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Target Sdk\" is only valid when \"Use Custom Build\" is " -"enabled." +"\"Min SDK\" cannot be lower than %d, which is the version needed by the " +"Godot library." +msgstr "" + +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "" +"\"Target SDK\" can only be overridden when \"Use Custom Build\" is enabled." msgstr "" "Mudança de \"Target Sdk\" só é válida quando \"Use Custom Build\" está ativa." #: platform/android/export/export_plugin.cpp -msgid "\"Target Sdk\" version must be greater or equal to \"Min Sdk\" version." +msgid "" +"\"Target SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Target SDK\" %d is higher than the default version %d. This may work, but " +"wasn't tested and may be unstable." +msgstr "" + +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "\"Target SDK\" version must be greater or equal to \"Min SDK\" version." msgstr "" "Versão de \"Target Sdk\" tem de ser maior ou igual à versão de \"Min Sdk\"." @@ -20640,7 +20680,7 @@ msgstr "Aumentar Zoom" msgid "Custom Viewport" msgstr "1 Viewport" -#: scene/2d/camera_2d.cpp scene/3d/camera.cpp +#: scene/2d/camera_2d.cpp scene/3d/camera.cpp scene/3d/interpolated_camera.cpp #: scene/animation/animation_player.cpp scene/animation/animation_tree.cpp #: scene/animation/animation_tree_player.cpp scene/main/timer.cpp #, fuzzy @@ -21412,6 +21452,11 @@ msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp #, fuzzy +msgid "Pathfinding" +msgstr "Ligação" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy msgid "Path Desired Distance" msgstr "Distância de escolha:" @@ -21420,6 +21465,21 @@ msgid "Target Desired Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Path Max Distance" +msgstr "Distância de escolha:" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Avoidance" +msgstr "Avançado" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Avoidance Enabled" +msgstr "Ativar" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp msgid "Neighbor Dist" msgstr "" @@ -21437,16 +21497,6 @@ msgstr "Inverter na Horizontal" msgid "Max Speed" msgstr "Velocidade:" -#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -#, fuzzy -msgid "Path Max Distance" -msgstr "Distância de escolha:" - -#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -#, fuzzy -msgid "Avoidance Enabled" -msgstr "Ativar" - #: scene/2d/navigation_agent_2d.cpp #, fuzzy msgid "" @@ -24886,6 +24936,11 @@ msgstr "Pasta:" #: scene/gui/text_edit.cpp #, fuzzy +msgid "Drag And Drop Selection Enabled" +msgstr "Apenas seleção" + +#: scene/gui/text_edit.cpp +#, fuzzy msgid "Hiding Enabled" msgstr "Ativar" @@ -25298,18 +25353,6 @@ msgstr "Exportar Caminho" #: scene/main/viewport.cpp msgid "" -"This viewport is not set as render target. If you intend for it to display " -"its contents directly to the screen, make it a child of a Control so it can " -"obtain a size. Otherwise, make it a RenderTarget and assign its internal " -"texture to some node for display." -msgstr "" -"Este viewport não está definida como alvo de Renderização. Se pretende " -"apresentar o seu conteúdo diretamente no ecrã, torne-a um filho de um " -"Control de modo a que obtenha um tamanho. Caso contrário, torne-a um " -"RenderTarget e atribua a sua textura interna a outro nó para visualizar." - -#: scene/main/viewport.cpp -msgid "" "The Viewport size must be greater than or equal to 2 pixels on both " "dimensions to render anything." msgstr "" @@ -25317,6 +25360,15 @@ msgstr "" "dimensões para renderizar." #: scene/main/viewport.cpp +msgid "" +"This Viewport has HDR enabled, but its Usage is set to 2D or 2D No-" +"Sampling.\n" +"HDR is only supported in Viewports that have their Usage set to 3D or 3D No-" +"Effects.\n" +"HDR will be disabled for this Viewport." +msgstr "" + +#: scene/main/viewport.cpp msgid "ARVR" msgstr "" diff --git a/editor/translations/pt_BR.po b/editor/translations/pt_BR.po index 230c927086..41301db983 100644 --- a/editor/translations/pt_BR.po +++ b/editor/translations/pt_BR.po @@ -523,6 +523,11 @@ msgstr "Meta" msgid "Command" msgstr "Comando" +#: core/os/input_event.cpp +#, fuzzy +msgid "Physical" +msgstr " (Físico)" + #: core/os/input_event.cpp scene/2d/touch_screen_button.cpp #: scene/gui/base_button.cpp scene/gui/texture_button.cpp #: scene/resources/default_theme/default_theme.cpp @@ -5654,6 +5659,11 @@ msgid "Mouse Extra Buttons Navigate History" msgstr "" #: editor/editor_settings.cpp +#, fuzzy +msgid "Drag And Drop Selection" +msgstr "Seleção Do GridMap" + +#: editor/editor_settings.cpp msgid "Appearance" msgstr "" @@ -18844,6 +18854,11 @@ msgstr "O pacote deve ter pelo menos um separador '.'." #: platform/android/export/export_plugin.cpp #, fuzzy +msgid "Custom Build" +msgstr "Usar Diretório de Usuário Personalizado" + +#: platform/android/export/export_plugin.cpp +#, fuzzy msgid "Use Custom Build" msgstr "Usar Diretório de Usuário Personalizado" @@ -18852,6 +18867,15 @@ msgstr "Usar Diretório de Usuário Personalizado" msgid "Export Format" msgstr "Caminho de Exportação" +#: platform/android/export/export_plugin.cpp +msgid "Min SDK" +msgstr "SDK Mínimo" + +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Target SDK" +msgstr "FPS alvo" + #: platform/android/export/export_plugin.cpp platform/iphone/export/export.cpp #, fuzzy msgid "Architectures" @@ -18895,15 +18919,6 @@ msgstr "Inspecionar a Instância Anterior" msgid "Code" msgstr "" -#: platform/android/export/export_plugin.cpp -msgid "Min SDK" -msgstr "SDK Mínimo" - -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Target SDK" -msgstr "FPS alvo" - #: platform/android/export/export_plugin.cpp platform/uwp/export/export.cpp #, fuzzy msgid "Package" @@ -19155,14 +19170,16 @@ msgstr "" "utilizar plugins." #: platform/android/export/export_plugin.cpp +#, fuzzy msgid "" -"\"Hand Tracking\" is only valid when \"Xr Mode\" is \"Oculus Mobile VrApi\" " +"\"Hand Tracking\" is only valid when \"XR Mode\" is \"Oculus Mobile VrApi\" " "or \"OpenXR\"." msgstr "" "\"Hand Tracking\" só é válido quando o \"Xr Mode\" é \"Oculus Mobile VR\"." #: platform/android/export/export_plugin.cpp -msgid "\"Passthrough\" is only valid when \"Xr Mode\" is \"OpenXR\"." +#, fuzzy +msgid "\"Passthrough\" is only valid when \"XR Mode\" is \"OpenXR\"." msgstr "" "\"Passthrough\" só é válido quando o \"Xr Mode\" é \"Oculus Mobile VR\"." @@ -19173,22 +19190,45 @@ msgstr "" "habilitado." #: platform/android/export/export_plugin.cpp +#, fuzzy msgid "" -"Changing the \"Min Sdk\" is only valid when \"Use Custom Build\" is enabled." +"\"Min SDK\" can only be overridden when \"Use Custom Build\" is enabled." msgstr "" "\"Exportar AAB\" só é válido quando \"Usar Compilação Customizada\" está " "habilitado." #: platform/android/export/export_plugin.cpp +msgid "\"Min SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Target Sdk\" is only valid when \"Use Custom Build\" is " -"enabled." +"\"Min SDK\" cannot be lower than %d, which is the version needed by the " +"Godot library." +msgstr "" + +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "" +"\"Target SDK\" can only be overridden when \"Use Custom Build\" is enabled." msgstr "" "\"Exportar AAB\" só é válido quando \"Usar Compilação Customizada\" está " "habilitado." #: platform/android/export/export_plugin.cpp -msgid "\"Target Sdk\" version must be greater or equal to \"Min Sdk\" version." +msgid "" +"\"Target SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Target SDK\" %d is higher than the default version %d. This may work, but " +"wasn't tested and may be unstable." +msgstr "" + +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "\"Target SDK\" version must be greater or equal to \"Min SDK\" version." msgstr "" "Versão do \"Target Sdk\" precisa ser igual ou maior que a versão do \"Min " "Sdk\"." @@ -20848,7 +20888,7 @@ msgstr "Ampliar" msgid "Custom Viewport" msgstr "1 Viewport" -#: scene/2d/camera_2d.cpp scene/3d/camera.cpp +#: scene/2d/camera_2d.cpp scene/3d/camera.cpp scene/3d/interpolated_camera.cpp #: scene/animation/animation_player.cpp scene/animation/animation_tree.cpp #: scene/animation/animation_tree_player.cpp scene/main/timer.cpp #, fuzzy @@ -21605,6 +21645,11 @@ msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp #, fuzzy +msgid "Pathfinding" +msgstr "VInculamento" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy msgid "Path Desired Distance" msgstr "Distância do Caminho U" @@ -21613,6 +21658,20 @@ msgid "Target Desired Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +msgid "Path Max Distance" +msgstr "Distância Máxima do Caminho" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Avoidance" +msgstr "Avançado" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Avoidance Enabled" +msgstr "Habilitar" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp msgid "Neighbor Dist" msgstr "" @@ -21629,15 +21688,6 @@ msgstr "Inverter Horizontalmente" msgid "Max Speed" msgstr "Velocidade Máxima" -#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Path Max Distance" -msgstr "Distância Máxima do Caminho" - -#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -#, fuzzy -msgid "Avoidance Enabled" -msgstr "Habilitar" - #: scene/2d/navigation_agent_2d.cpp msgid "" "The NavigationAgent2D can be used only under a Node2D inheriting parent node." @@ -25011,6 +25061,11 @@ msgstr "Pasta:" #: scene/gui/text_edit.cpp #, fuzzy +msgid "Drag And Drop Selection Enabled" +msgstr "Selecionar Apenas" + +#: scene/gui/text_edit.cpp +#, fuzzy msgid "Hiding Enabled" msgstr "Habilitar" @@ -25420,19 +25475,6 @@ msgstr "Caminho de Exportação" #: scene/main/viewport.cpp msgid "" -"This viewport is not set as render target. If you intend for it to display " -"its contents directly to the screen, make it a child of a Control so it can " -"obtain a size. Otherwise, make it a RenderTarget and assign its internal " -"texture to some node for display." -msgstr "" -"Este viewport não está definido como destino de renderização. Se você " -"pretende que ele mostre seu conteúdo diretamente na tela, faça-o filho de um " -"nó de Controle para que ele possa ter um tamanho. Caso contrário, defina-o " -"como destino de renderização e atribua sua textura interna a algum nó para " -"exibir." - -#: scene/main/viewport.cpp -msgid "" "The Viewport size must be greater than or equal to 2 pixels on both " "dimensions to render anything." msgstr "" @@ -25440,6 +25482,15 @@ msgstr "" "dimensões para renderizar algo." #: scene/main/viewport.cpp +msgid "" +"This Viewport has HDR enabled, but its Usage is set to 2D or 2D No-" +"Sampling.\n" +"HDR is only supported in Viewports that have their Usage set to 3D or 3D No-" +"Effects.\n" +"HDR will be disabled for this Viewport." +msgstr "" + +#: scene/main/viewport.cpp msgid "ARVR" msgstr "" diff --git a/editor/translations/ro.po b/editor/translations/ro.po index ddc340697c..cdd11f3980 100644 --- a/editor/translations/ro.po +++ b/editor/translations/ro.po @@ -418,6 +418,11 @@ msgstr "" msgid "Command" msgstr "Comunitate" +#: core/os/input_event.cpp +#, fuzzy +msgid "Physical" +msgstr "Cadru Fizic %" + #: core/os/input_event.cpp scene/2d/touch_screen_button.cpp #: scene/gui/base_button.cpp scene/gui/texture_button.cpp #: scene/resources/default_theme/default_theme.cpp @@ -5619,6 +5624,11 @@ msgid "Mouse Extra Buttons Navigate History" msgstr "" #: editor/editor_settings.cpp +#, fuzzy +msgid "Drag And Drop Selection" +msgstr "Toată selecția" + +#: editor/editor_settings.cpp msgid "Appearance" msgstr "" @@ -18991,6 +19001,11 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Custom Build" +msgstr "Creează Nod" + +#: platform/android/export/export_plugin.cpp msgid "Use Custom Build" msgstr "" @@ -18999,6 +19014,16 @@ msgstr "" msgid "Export Format" msgstr "Exportă Proiectul" +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Min SDK" +msgstr "Dimensiunea Conturului:" + +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Target SDK" +msgstr "Suprafață Țintă:" + #: platform/android/export/export_plugin.cpp platform/iphone/export/export.cpp msgid "Architectures" msgstr "" @@ -19037,16 +19062,6 @@ msgstr "Fila anterioară" msgid "Code" msgstr "" -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Min SDK" -msgstr "Dimensiunea Conturului:" - -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Target SDK" -msgstr "Suprafață Țintă:" - #: platform/android/export/export_plugin.cpp platform/uwp/export/export.cpp #, fuzzy msgid "Package" @@ -19292,12 +19307,12 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"\"Hand Tracking\" is only valid when \"Xr Mode\" is \"Oculus Mobile VrApi\" " +"\"Hand Tracking\" is only valid when \"XR Mode\" is \"Oculus Mobile VrApi\" " "or \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Passthrough\" is only valid when \"Xr Mode\" is \"OpenXR\"." +msgid "\"Passthrough\" is only valid when \"XR Mode\" is \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp @@ -19306,17 +19321,37 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Min Sdk\" is only valid when \"Use Custom Build\" is enabled." +"\"Min SDK\" can only be overridden when \"Use Custom Build\" is enabled." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Min SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Min SDK\" cannot be lower than %d, which is the version needed by the " +"Godot library." msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Target Sdk\" is only valid when \"Use Custom Build\" is " -"enabled." +"\"Target SDK\" can only be overridden when \"Use Custom Build\" is enabled." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Target Sdk\" version must be greater or equal to \"Min Sdk\" version." +msgid "" +"\"Target SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Target SDK\" %d is higher than the default version %d. This may work, but " +"wasn't tested and may be unstable." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Target SDK\" version must be greater or equal to \"Min SDK\" version." msgstr "" #: platform/android/export/export_plugin.cpp platform/osx/export/export.cpp @@ -20968,7 +21003,7 @@ msgstr "Apropiere" msgid "Custom Viewport" msgstr "Arată Fereastra de Lucru" -#: scene/2d/camera_2d.cpp scene/3d/camera.cpp +#: scene/2d/camera_2d.cpp scene/3d/camera.cpp scene/3d/interpolated_camera.cpp #: scene/animation/animation_player.cpp scene/animation/animation_tree.cpp #: scene/animation/animation_tree_player.cpp scene/main/timer.cpp #, fuzzy @@ -21697,6 +21732,11 @@ msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp #, fuzzy +msgid "Pathfinding" +msgstr "Rotație aleatorie:" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy msgid "Path Desired Distance" msgstr "Alege o Scenă Principală" @@ -21705,29 +21745,34 @@ msgid "Target Desired Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Neighbor Dist" +msgid "Path Max Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Max Neighbors" -msgstr "" +#, fuzzy +msgid "Avoidance" +msgstr "Avansate" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Time Horizon" +#, fuzzy +msgid "Avoidance Enabled" +msgstr "Activați" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +msgid "Neighbor Dist" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Max Speed" +msgid "Max Neighbors" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Path Max Distance" +msgid "Time Horizon" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -#, fuzzy -msgid "Avoidance Enabled" -msgstr "Activați" +msgid "Max Speed" +msgstr "" #: scene/2d/navigation_agent_2d.cpp msgid "" @@ -25004,6 +25049,11 @@ msgstr "Folderul:" #: scene/gui/text_edit.cpp #, fuzzy +msgid "Drag And Drop Selection Enabled" +msgstr "Numai Selecția" + +#: scene/gui/text_edit.cpp +#, fuzzy msgid "Hiding Enabled" msgstr "Activați" @@ -25406,16 +25456,17 @@ msgstr "Exportă Proiectul" #: scene/main/viewport.cpp msgid "" -"This viewport is not set as render target. If you intend for it to display " -"its contents directly to the screen, make it a child of a Control so it can " -"obtain a size. Otherwise, make it a RenderTarget and assign its internal " -"texture to some node for display." +"The Viewport size must be greater than or equal to 2 pixels on both " +"dimensions to render anything." msgstr "" #: scene/main/viewport.cpp msgid "" -"The Viewport size must be greater than or equal to 2 pixels on both " -"dimensions to render anything." +"This Viewport has HDR enabled, but its Usage is set to 2D or 2D No-" +"Sampling.\n" +"HDR is only supported in Viewports that have their Usage set to 3D or 3D No-" +"Effects.\n" +"HDR will be disabled for this Viewport." msgstr "" #: scene/main/viewport.cpp diff --git a/editor/translations/ru.po b/editor/translations/ru.po index 755683fdf0..84762459c8 100644 --- a/editor/translations/ru.po +++ b/editor/translations/ru.po @@ -115,13 +115,15 @@ # Deleted User <noreply+44465@weblate.org>, 2022. # Bozhko Artyom Dmitrievich <jek_sun@mail.ru>, 2022. # FuzzMix <fmwolfiechad@gmail.com>, 2022. +# Jasuse <jasusemaele@gmail.com>, 2022. +# Vadim Mitroshkin <Vadim7540@yandex.ru>, 2022. msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "Report-Msgid-Bugs-To: https://github.com/godotengine/godot\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2022-06-12 13:19+0000\n" -"Last-Translator: FuzzMix <fmwolfiechad@gmail.com>\n" +"PO-Revision-Date: 2022-07-03 00:44+0000\n" +"Last-Translator: Vadim Mitroshkin <Vadim7540@yandex.ru>\n" "Language-Team: Russian <https://hosted.weblate.org/projects/godot-engine/" "godot/ru/>\n" "Language: ru\n" @@ -130,7 +132,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && " "n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" -"X-Generator: Weblate 4.13-dev\n" +"X-Generator: Weblate 4.13.1-dev\n" #: core/bind/core_bind.cpp main/main.cpp msgid "Tablet Driver" @@ -469,14 +471,12 @@ msgid "Max Size (KB)" msgstr "Максимальный размер (КБ)" #: core/os/input.cpp -#, fuzzy msgid "Mouse Mode" -msgstr "Режим перемещения" +msgstr "Режим мыши" #: core/os/input.cpp -#, fuzzy msgid "Use Accumulated Input" -msgstr "Удалить вход" +msgstr "Использовать накопленный ввод" #: core/os/input_event.cpp editor/project_settings_editor.cpp #: servers/audio_server.cpp @@ -503,6 +503,11 @@ msgstr "Meta" msgid "Command" msgstr "Command" +#: core/os/input_event.cpp +#, fuzzy +msgid "Physical" +msgstr " (Физическая)" + #: core/os/input_event.cpp scene/2d/touch_screen_button.cpp #: scene/gui/base_button.cpp scene/gui/texture_button.cpp #: scene/resources/default_theme/default_theme.cpp @@ -2332,8 +2337,9 @@ msgid "Fix Dependencies" msgstr "Исправить зависимости" #: editor/dependency_editor.cpp +#, fuzzy msgid "Errors loading!" -msgstr "Ошибки загрузки!" +msgstr "Ошибки загружаются!" #: editor/dependency_editor.cpp msgid "Permanently delete %d item(s)? (No undo!)" @@ -5588,6 +5594,11 @@ msgid "Mouse Extra Buttons Navigate History" msgstr "Навигация по истории дополнительными кнопками мыши" #: editor/editor_settings.cpp +#, fuzzy +msgid "Drag And Drop Selection" +msgstr "Выделение сетки" + +#: editor/editor_settings.cpp msgid "Appearance" msgstr "Внешний вид" @@ -9530,7 +9541,7 @@ msgstr "Иконка" #: editor/plugins/item_list_editor_plugin.cpp msgid "ID" -msgstr "" +msgstr "Идентификатор" #: editor/plugins/item_list_editor_plugin.cpp #: scene/resources/default_theme/default_theme.cpp @@ -17055,7 +17066,7 @@ msgstr "Скин Godot" #: modules/gltf/gltf_spec_gloss.cpp msgid "Diffuse Img" -msgstr "" +msgstr "Рассеянное изображение" #: modules/gltf/gltf_spec_gloss.cpp msgid "Diffuse Factor" @@ -18486,6 +18497,11 @@ msgstr "Пакет должен иметь хотя бы один раздели #: platform/android/export/export_plugin.cpp #, fuzzy +msgid "Custom Build" +msgstr "Использовать собственную директорию данных пользователя" + +#: platform/android/export/export_plugin.cpp +#, fuzzy msgid "Use Custom Build" msgstr "Использовать собственную директорию данных пользователя" @@ -18494,6 +18510,16 @@ msgstr "Использовать собственную директорию д msgid "Export Format" msgstr "Путь экспорта" +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Min SDK" +msgstr "Минимальный размер" + +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Target SDK" +msgstr "Целевой FPS" + #: platform/android/export/export_plugin.cpp platform/iphone/export/export.cpp #, fuzzy msgid "Architectures" @@ -18537,16 +18563,6 @@ msgstr "Осмотреть предыдущий экземпляр" msgid "Code" msgstr "Код" -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Min SDK" -msgstr "Минимальный размер" - -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Target SDK" -msgstr "Целевой FPS" - #: platform/android/export/export_plugin.cpp platform/uwp/export/export.cpp #, fuzzy msgid "Package" @@ -18800,15 +18816,17 @@ msgid "\"Use Custom Build\" must be enabled to use the plugins." msgstr "«Use Custom Build» должен быть включен для использования плагинов." #: platform/android/export/export_plugin.cpp +#, fuzzy msgid "" -"\"Hand Tracking\" is only valid when \"Xr Mode\" is \"Oculus Mobile VrApi\" " +"\"Hand Tracking\" is only valid when \"XR Mode\" is \"Oculus Mobile VrApi\" " "or \"OpenXR\"." msgstr "" "«Hand Tracking» действителен только тогда, когда «Xr Mode» установлен в " "«Oculus Mobile VrApi» или «OpenXR»." #: platform/android/export/export_plugin.cpp -msgid "\"Passthrough\" is only valid when \"Xr Mode\" is \"OpenXR\"." +#, fuzzy +msgid "\"Passthrough\" is only valid when \"XR Mode\" is \"OpenXR\"." msgstr "" "«Passthrough» действителен только тогда, когда «Xr Mode» установлен в " "«OpenXR»." @@ -18820,22 +18838,45 @@ msgstr "" "пользовательскую сборку»." #: platform/android/export/export_plugin.cpp +#, fuzzy msgid "" -"Changing the \"Min Sdk\" is only valid when \"Use Custom Build\" is enabled." +"\"Min SDK\" can only be overridden when \"Use Custom Build\" is enabled." msgstr "" "Изменение «Min Sdk» действительно только если включён параметр «Использовать " "пользовательскую сборку»." #: platform/android/export/export_plugin.cpp +msgid "\"Min SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Target Sdk\" is only valid when \"Use Custom Build\" is " -"enabled." +"\"Min SDK\" cannot be lower than %d, which is the version needed by the " +"Godot library." +msgstr "" + +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "" +"\"Target SDK\" can only be overridden when \"Use Custom Build\" is enabled." msgstr "" "Изменение «Target Sdk» действительно только если включён параметр " "«Использовать пользовательскую сборку»." #: platform/android/export/export_plugin.cpp -msgid "\"Target Sdk\" version must be greater or equal to \"Min Sdk\" version." +msgid "" +"\"Target SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Target SDK\" %d is higher than the default version %d. This may work, but " +"wasn't tested and may be unstable." +msgstr "" + +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "\"Target SDK\" version must be greater or equal to \"Min SDK\" version." msgstr "Версия «Target Sdk» должна быть больше или равна версии «Min Sdk»." #: platform/android/export/export_plugin.cpp platform/osx/export/export.cpp @@ -20543,7 +20584,7 @@ msgstr "Приблизить" msgid "Custom Viewport" msgstr "1 Окно" -#: scene/2d/camera_2d.cpp scene/3d/camera.cpp +#: scene/2d/camera_2d.cpp scene/3d/camera.cpp scene/3d/interpolated_camera.cpp #: scene/animation/animation_player.cpp scene/animation/animation_tree.cpp #: scene/animation/animation_tree_player.cpp scene/main/timer.cpp #, fuzzy @@ -21293,6 +21334,11 @@ msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp #, fuzzy +msgid "Pathfinding" +msgstr "Привязка" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy msgid "Path Desired Distance" msgstr "Расстояние пути U" @@ -21301,6 +21347,21 @@ msgid "Target Desired Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Path Max Distance" +msgstr "Максимальное расстояние пути" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Avoidance" +msgstr "Дополнительно" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Avoidance Enabled" +msgstr "Включить" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp msgid "Neighbor Dist" msgstr "" @@ -21317,16 +21378,6 @@ msgstr "Перевернуть по горизонтали" msgid "Max Speed" msgstr "Макс скорость" -#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -#, fuzzy -msgid "Path Max Distance" -msgstr "Максимальное расстояние пути" - -#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -#, fuzzy -msgid "Avoidance Enabled" -msgstr "Включить" - #: scene/2d/navigation_agent_2d.cpp #, fuzzy msgid "" @@ -24704,6 +24755,11 @@ msgstr "Полоса сворачивания" #: scene/gui/text_edit.cpp #, fuzzy +msgid "Drag And Drop Selection Enabled" +msgstr "Только выделенное" + +#: scene/gui/text_edit.cpp +#, fuzzy msgid "Hiding Enabled" msgstr "Включить" @@ -25105,19 +25161,6 @@ msgstr "Путь экспорта" #: scene/main/viewport.cpp msgid "" -"This viewport is not set as render target. If you intend for it to display " -"its contents directly to the screen, make it a child of a Control so it can " -"obtain a size. Otherwise, make it a RenderTarget and assign its internal " -"texture to some node for display." -msgstr "" -"Этот viewport не установлен в качестве цели рендеринга. Если вы собираетесь " -"использовать его для отображения содержимого прямо на экран, то сделайте её " -"потомком Control'а, чтобы он мог получить размер. В противном случае, " -"сделайте его целью рендеринга и назначьте его внутреннюю текстуру какому-" -"либо узлу для отображения." - -#: scene/main/viewport.cpp -msgid "" "The Viewport size must be greater than or equal to 2 pixels on both " "dimensions to render anything." msgstr "" @@ -25125,6 +25168,15 @@ msgstr "" "измерениях, чтобы отобразить что-либо." #: scene/main/viewport.cpp +msgid "" +"This Viewport has HDR enabled, but its Usage is set to 2D or 2D No-" +"Sampling.\n" +"HDR is only supported in Viewports that have their Usage set to 3D or 3D No-" +"Effects.\n" +"HDR will be disabled for this Viewport." +msgstr "" + +#: scene/main/viewport.cpp msgid "ARVR" msgstr "" @@ -26894,7 +26946,7 @@ msgstr "Передвинуть точки" #: scene/resources/packed_scene.cpp msgid "Bundled" -msgstr "" +msgstr "Вложенный" #: scene/resources/particles_material.cpp msgid "Trail" @@ -27947,12 +27999,12 @@ msgstr "Совместимость" #: servers/visual_server.cpp msgid "Disable Half Float" -msgstr "" +msgstr "Выключить вещественные числа половинной точности" #: servers/visual_server.cpp #, fuzzy msgid "Enable High Float" -msgstr "Включить приоритет" +msgstr "Включить вещественные числа повышенной точности" #: servers/visual_server.cpp msgid "Precision" @@ -27967,13 +28019,12 @@ msgid "UV Contract Amount" msgstr "" #: servers/visual_server.cpp -#, fuzzy msgid "Use Simple PVS" -msgstr "Использовать привязку масштабирования" +msgstr "Использовать простой PVS" #: servers/visual_server.cpp msgid "PVS Logging" -msgstr "" +msgstr "Вести запись PVS" #: servers/visual_server.cpp msgid "Use Signals" @@ -28003,17 +28054,17 @@ msgid "Max Active Polygons" msgstr "Максимальное количество активных полигонов" #: servers/visual_server.cpp -#, fuzzy msgid "Shader Compilation Mode" -msgstr "Режим интерполяции" +msgstr "Режим компиляции шейдеров" #: servers/visual_server.cpp msgid "Max Simultaneous Compiles" -msgstr "" +msgstr "Максимальное количество одновременных компиляций" #: servers/visual_server.cpp +#, fuzzy msgid "Log Active Async Compiles Count" -msgstr "" +msgstr "Регистрировать количество активных асинхронных компиляций" #: servers/visual_server.cpp msgid "Shader Cache Size (MB)" diff --git a/editor/translations/si.po b/editor/translations/si.po index 2e5042392f..ae1abeaa5a 100644 --- a/editor/translations/si.po +++ b/editor/translations/si.po @@ -398,6 +398,10 @@ msgstr "" msgid "Command" msgstr "" +#: core/os/input_event.cpp +msgid "Physical" +msgstr "" + #: core/os/input_event.cpp scene/2d/touch_screen_button.cpp #: scene/gui/base_button.cpp scene/gui/texture_button.cpp #: scene/resources/default_theme/default_theme.cpp @@ -5333,6 +5337,10 @@ msgid "Mouse Extra Buttons Navigate History" msgstr "" #: editor/editor_settings.cpp +msgid "Drag And Drop Selection" +msgstr "" + +#: editor/editor_settings.cpp msgid "Appearance" msgstr "" @@ -17988,6 +17996,11 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Custom Build" +msgstr "යතුරු පිටපත් කරන්න" + +#: platform/android/export/export_plugin.cpp msgid "Use Custom Build" msgstr "" @@ -17996,6 +18009,15 @@ msgstr "" msgid "Export Format" msgstr "Anim පරිවර්තනය වෙනස් කරන්න" +#: platform/android/export/export_plugin.cpp +msgid "Min SDK" +msgstr "" + +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Target SDK" +msgstr "යතුරු මකා දමන්න" + #: platform/android/export/export_plugin.cpp platform/iphone/export/export.cpp msgid "Architectures" msgstr "" @@ -18032,15 +18054,6 @@ msgstr "" msgid "Code" msgstr "" -#: platform/android/export/export_plugin.cpp -msgid "Min SDK" -msgstr "" - -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Target SDK" -msgstr "යතුරු මකා දමන්න" - #: platform/android/export/export_plugin.cpp platform/uwp/export/export.cpp msgid "Package" msgstr "" @@ -18266,12 +18279,12 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"\"Hand Tracking\" is only valid when \"Xr Mode\" is \"Oculus Mobile VrApi\" " +"\"Hand Tracking\" is only valid when \"XR Mode\" is \"Oculus Mobile VrApi\" " "or \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Passthrough\" is only valid when \"Xr Mode\" is \"OpenXR\"." +msgid "\"Passthrough\" is only valid when \"XR Mode\" is \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp @@ -18280,17 +18293,37 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Min Sdk\" is only valid when \"Use Custom Build\" is enabled." +"\"Min SDK\" can only be overridden when \"Use Custom Build\" is enabled." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Min SDK\" should be a valid integer, but got \"%s\" which is invalid." msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Target Sdk\" is only valid when \"Use Custom Build\" is " -"enabled." +"\"Min SDK\" cannot be lower than %d, which is the version needed by the " +"Godot library." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Target Sdk\" version must be greater or equal to \"Min Sdk\" version." +msgid "" +"\"Target SDK\" can only be overridden when \"Use Custom Build\" is enabled." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Target SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Target SDK\" %d is higher than the default version %d. This may work, but " +"wasn't tested and may be unstable." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Target SDK\" version must be greater or equal to \"Min SDK\" version." msgstr "" #: platform/android/export/export_plugin.cpp platform/osx/export/export.cpp @@ -19828,7 +19861,7 @@ msgstr "" msgid "Custom Viewport" msgstr "" -#: scene/2d/camera_2d.cpp scene/3d/camera.cpp +#: scene/2d/camera_2d.cpp scene/3d/camera.cpp scene/3d/interpolated_camera.cpp #: scene/animation/animation_player.cpp scene/animation/animation_tree.cpp #: scene/animation/animation_tree_player.cpp scene/main/timer.cpp msgid "Process Mode" @@ -20515,6 +20548,10 @@ msgid "" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +msgid "Pathfinding" +msgstr "" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp msgid "Path Desired Distance" msgstr "" @@ -20523,29 +20560,34 @@ msgid "Target Desired Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Neighbor Dist" +msgid "Path Max Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Max Neighbors" -msgstr "" +#, fuzzy +msgid "Avoidance" +msgstr "සමතුලිතයි" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Time Horizon" +#, fuzzy +msgid "Avoidance Enabled" +msgstr "මෙම ලුහුබදින්නා ඉවත් කරන්න." + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +msgid "Neighbor Dist" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Max Speed" +msgid "Max Neighbors" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Path Max Distance" +msgid "Time Horizon" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -#, fuzzy -msgid "Avoidance Enabled" -msgstr "මෙම ලුහුබදින්නා ඉවත් කරන්න." +msgid "Max Speed" +msgstr "" #: scene/2d/navigation_agent_2d.cpp msgid "" @@ -23611,6 +23653,10 @@ msgid "Fold Gutter" msgstr "" #: scene/gui/text_edit.cpp +msgid "Drag And Drop Selection Enabled" +msgstr "" + +#: scene/gui/text_edit.cpp msgid "Hiding Enabled" msgstr "" @@ -23981,16 +24027,17 @@ msgstr "" #: scene/main/viewport.cpp msgid "" -"This viewport is not set as render target. If you intend for it to display " -"its contents directly to the screen, make it a child of a Control so it can " -"obtain a size. Otherwise, make it a RenderTarget and assign its internal " -"texture to some node for display." +"The Viewport size must be greater than or equal to 2 pixels on both " +"dimensions to render anything." msgstr "" #: scene/main/viewport.cpp msgid "" -"The Viewport size must be greater than or equal to 2 pixels on both " -"dimensions to render anything." +"This Viewport has HDR enabled, but its Usage is set to 2D or 2D No-" +"Sampling.\n" +"HDR is only supported in Viewports that have their Usage set to 3D or 3D No-" +"Effects.\n" +"HDR will be disabled for this Viewport." msgstr "" #: scene/main/viewport.cpp diff --git a/editor/translations/sk.po b/editor/translations/sk.po index 9e18f67b73..6e20ee48da 100644 --- a/editor/translations/sk.po +++ b/editor/translations/sk.po @@ -431,6 +431,11 @@ msgstr "" msgid "Command" msgstr "Komunita" +#: core/os/input_event.cpp +#, fuzzy +msgid "Physical" +msgstr "Fyzická Snímka %" + #: core/os/input_event.cpp scene/2d/touch_screen_button.cpp #: scene/gui/base_button.cpp scene/gui/texture_button.cpp #: scene/resources/default_theme/default_theme.cpp @@ -5644,6 +5649,11 @@ msgid "Mouse Extra Buttons Navigate History" msgstr "" #: editor/editor_settings.cpp +#, fuzzy +msgid "Drag And Drop Selection" +msgstr "Všetky vybrané" + +#: editor/editor_settings.cpp msgid "Appearance" msgstr "" @@ -18915,6 +18925,11 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Custom Build" +msgstr "Vložiť" + +#: platform/android/export/export_plugin.cpp msgid "Use Custom Build" msgstr "" @@ -18923,6 +18938,16 @@ msgstr "" msgid "Export Format" msgstr "Konštanty:" +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Min SDK" +msgstr "Veľkosť: " + +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Target SDK" +msgstr "Vytvoriť Node" + #: platform/android/export/export_plugin.cpp platform/iphone/export/export.cpp msgid "Architectures" msgstr "" @@ -18961,16 +18986,6 @@ msgstr "Minulá karta" msgid "Code" msgstr "" -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Min SDK" -msgstr "Veľkosť: " - -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Target SDK" -msgstr "Vytvoriť Node" - #: platform/android/export/export_plugin.cpp platform/uwp/export/export.cpp #, fuzzy msgid "Package" @@ -19216,12 +19231,12 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"\"Hand Tracking\" is only valid when \"Xr Mode\" is \"Oculus Mobile VrApi\" " +"\"Hand Tracking\" is only valid when \"XR Mode\" is \"Oculus Mobile VrApi\" " "or \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Passthrough\" is only valid when \"Xr Mode\" is \"OpenXR\"." +msgid "\"Passthrough\" is only valid when \"XR Mode\" is \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp @@ -19230,17 +19245,37 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Min Sdk\" is only valid when \"Use Custom Build\" is enabled." +"\"Min SDK\" can only be overridden when \"Use Custom Build\" is enabled." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Min SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Min SDK\" cannot be lower than %d, which is the version needed by the " +"Godot library." msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Target Sdk\" is only valid when \"Use Custom Build\" is " -"enabled." +"\"Target SDK\" can only be overridden when \"Use Custom Build\" is enabled." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Target Sdk\" version must be greater or equal to \"Min Sdk\" version." +msgid "" +"\"Target SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Target SDK\" %d is higher than the default version %d. This may work, but " +"wasn't tested and may be unstable." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Target SDK\" version must be greater or equal to \"Min SDK\" version." msgstr "" #: platform/android/export/export_plugin.cpp platform/osx/export/export.cpp @@ -20891,7 +20926,7 @@ msgstr "Priblížiť" msgid "Custom Viewport" msgstr "Zobraziť Výrez" -#: scene/2d/camera_2d.cpp scene/3d/camera.cpp +#: scene/2d/camera_2d.cpp scene/3d/camera.cpp scene/3d/interpolated_camera.cpp #: scene/animation/animation_player.cpp scene/animation/animation_tree.cpp #: scene/animation/animation_tree_player.cpp scene/main/timer.cpp #, fuzzy @@ -21627,6 +21662,11 @@ msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp #, fuzzy +msgid "Pathfinding" +msgstr "Prilepiť Animáciu" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy msgid "Path Desired Distance" msgstr "Vyberte hlavnú scénu" @@ -21635,29 +21675,34 @@ msgid "Target Desired Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Neighbor Dist" +msgid "Path Max Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Max Neighbors" -msgstr "" +#, fuzzy +msgid "Avoidance" +msgstr "Pokročilé" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Time Horizon" +#, fuzzy +msgid "Avoidance Enabled" +msgstr "Povoliť" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +msgid "Neighbor Dist" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Max Speed" +msgid "Max Neighbors" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Path Max Distance" +msgid "Time Horizon" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -#, fuzzy -msgid "Avoidance Enabled" -msgstr "Povoliť" +msgid "Max Speed" +msgstr "" #: scene/2d/navigation_agent_2d.cpp msgid "" @@ -24931,6 +24976,11 @@ msgstr "Priečinok:" #: scene/gui/text_edit.cpp #, fuzzy +msgid "Drag And Drop Selection Enabled" +msgstr "Iba Výber" + +#: scene/gui/text_edit.cpp +#, fuzzy msgid "Hiding Enabled" msgstr "Povoliť" @@ -25331,16 +25381,17 @@ msgstr "Zamerať Cestu" #: scene/main/viewport.cpp msgid "" -"This viewport is not set as render target. If you intend for it to display " -"its contents directly to the screen, make it a child of a Control so it can " -"obtain a size. Otherwise, make it a RenderTarget and assign its internal " -"texture to some node for display." +"The Viewport size must be greater than or equal to 2 pixels on both " +"dimensions to render anything." msgstr "" #: scene/main/viewport.cpp msgid "" -"The Viewport size must be greater than or equal to 2 pixels on both " -"dimensions to render anything." +"This Viewport has HDR enabled, but its Usage is set to 2D or 2D No-" +"Sampling.\n" +"HDR is only supported in Viewports that have their Usage set to 3D or 3D No-" +"Effects.\n" +"HDR will be disabled for this Viewport." msgstr "" #: scene/main/viewport.cpp diff --git a/editor/translations/sl.po b/editor/translations/sl.po index b796c872f7..43eb784a39 100644 --- a/editor/translations/sl.po +++ b/editor/translations/sl.po @@ -404,6 +404,11 @@ msgstr "" msgid "Command" msgstr "Skupnost" +#: core/os/input_event.cpp +#, fuzzy +msgid "Physical" +msgstr "Fizikalni Okvir %" + #: core/os/input_event.cpp scene/2d/touch_screen_button.cpp #: scene/gui/base_button.cpp scene/gui/texture_button.cpp #: scene/resources/default_theme/default_theme.cpp @@ -5715,6 +5720,11 @@ msgid "Mouse Extra Buttons Navigate History" msgstr "" #: editor/editor_settings.cpp +#, fuzzy +msgid "Drag And Drop Selection" +msgstr "GridMap Izbriši Izbor" + +#: editor/editor_settings.cpp msgid "Appearance" msgstr "" @@ -19206,6 +19216,11 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Custom Build" +msgstr "Gradnik Prehod" + +#: platform/android/export/export_plugin.cpp msgid "Use Custom Build" msgstr "" @@ -19214,6 +19229,16 @@ msgstr "" msgid "Export Format" msgstr "Izvozi Projekt" +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Min SDK" +msgstr "Zaženi Skripto" + +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Target SDK" +msgstr "Gradnik ČasovnoMerilo" + #: platform/android/export/export_plugin.cpp platform/iphone/export/export.cpp msgid "Architectures" msgstr "" @@ -19253,16 +19278,6 @@ msgstr "Prejšnji zavihek" msgid "Code" msgstr "" -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Min SDK" -msgstr "Zaženi Skripto" - -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Target SDK" -msgstr "Gradnik ČasovnoMerilo" - #: platform/android/export/export_plugin.cpp platform/uwp/export/export.cpp #, fuzzy msgid "Package" @@ -19509,12 +19524,12 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"\"Hand Tracking\" is only valid when \"Xr Mode\" is \"Oculus Mobile VrApi\" " +"\"Hand Tracking\" is only valid when \"XR Mode\" is \"Oculus Mobile VrApi\" " "or \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Passthrough\" is only valid when \"Xr Mode\" is \"OpenXR\"." +msgid "\"Passthrough\" is only valid when \"XR Mode\" is \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp @@ -19523,17 +19538,37 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Min Sdk\" is only valid when \"Use Custom Build\" is enabled." +"\"Min SDK\" can only be overridden when \"Use Custom Build\" is enabled." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Min SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Min SDK\" cannot be lower than %d, which is the version needed by the " +"Godot library." msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Target Sdk\" is only valid when \"Use Custom Build\" is " -"enabled." +"\"Target SDK\" can only be overridden when \"Use Custom Build\" is enabled." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Target Sdk\" version must be greater or equal to \"Min Sdk\" version." +msgid "" +"\"Target SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Target SDK\" %d is higher than the default version %d. This may work, but " +"wasn't tested and may be unstable." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Target SDK\" version must be greater or equal to \"Min SDK\" version." msgstr "" #: platform/android/export/export_plugin.cpp platform/osx/export/export.cpp @@ -21190,7 +21225,7 @@ msgstr "Približaj" msgid "Custom Viewport" msgstr "" -#: scene/2d/camera_2d.cpp scene/3d/camera.cpp +#: scene/2d/camera_2d.cpp scene/3d/camera.cpp scene/3d/interpolated_camera.cpp #: scene/animation/animation_player.cpp scene/animation/animation_tree.cpp #: scene/animation/animation_tree_player.cpp scene/main/timer.cpp #, fuzzy @@ -21922,6 +21957,11 @@ msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp #, fuzzy +msgid "Pathfinding" +msgstr "Prilepi animacijo" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy msgid "Path Desired Distance" msgstr "Izberi Glavno Sceno" @@ -21930,29 +21970,34 @@ msgid "Target Desired Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Neighbor Dist" +msgid "Path Max Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Max Neighbors" -msgstr "" +#, fuzzy +msgid "Avoidance" +msgstr "Možnosti pripenjanja" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Time Horizon" +#, fuzzy +msgid "Avoidance Enabled" +msgstr "Omogoči" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +msgid "Neighbor Dist" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Max Speed" +msgid "Max Neighbors" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Path Max Distance" +msgid "Time Horizon" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -#, fuzzy -msgid "Avoidance Enabled" -msgstr "Omogoči" +msgid "Max Speed" +msgstr "" #: scene/2d/navigation_agent_2d.cpp msgid "" @@ -25228,6 +25273,11 @@ msgstr "Ustvarite Mapo" #: scene/gui/text_edit.cpp #, fuzzy +msgid "Drag And Drop Selection Enabled" +msgstr "Samo Izbira" + +#: scene/gui/text_edit.cpp +#, fuzzy msgid "Hiding Enabled" msgstr "Omogoči" @@ -25624,16 +25674,17 @@ msgstr "Izvozi Projekt" #: scene/main/viewport.cpp msgid "" -"This viewport is not set as render target. If you intend for it to display " -"its contents directly to the screen, make it a child of a Control so it can " -"obtain a size. Otherwise, make it a RenderTarget and assign its internal " -"texture to some node for display." +"The Viewport size must be greater than or equal to 2 pixels on both " +"dimensions to render anything." msgstr "" #: scene/main/viewport.cpp msgid "" -"The Viewport size must be greater than or equal to 2 pixels on both " -"dimensions to render anything." +"This Viewport has HDR enabled, but its Usage is set to 2D or 2D No-" +"Sampling.\n" +"HDR is only supported in Viewports that have their Usage set to 3D or 3D No-" +"Effects.\n" +"HDR will be disabled for this Viewport." msgstr "" #: scene/main/viewport.cpp diff --git a/editor/translations/sq.po b/editor/translations/sq.po index ae64fa2e6f..b11dc2f46f 100644 --- a/editor/translations/sq.po +++ b/editor/translations/sq.po @@ -415,6 +415,11 @@ msgstr "" msgid "Command" msgstr "Komuniteti" +#: core/os/input_event.cpp +#, fuzzy +msgid "Physical" +msgstr "Hapi i Fizikës %" + #: core/os/input_event.cpp scene/2d/touch_screen_button.cpp #: scene/gui/base_button.cpp scene/gui/texture_button.cpp #: scene/resources/default_theme/default_theme.cpp @@ -5651,6 +5656,11 @@ msgid "Mouse Extra Buttons Navigate History" msgstr "" #: editor/editor_settings.cpp +#, fuzzy +msgid "Drag And Drop Selection" +msgstr "Fshi të Selektuarat" + +#: editor/editor_settings.cpp msgid "Appearance" msgstr "" @@ -18698,6 +18708,11 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Custom Build" +msgstr "Dyfisho Nyjet" + +#: platform/android/export/export_plugin.cpp msgid "Use Custom Build" msgstr "" @@ -18706,6 +18721,16 @@ msgstr "" msgid "Export Format" msgstr "Konstantet" +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Min SDK" +msgstr "Madhësia: " + +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Target SDK" +msgstr "Fshi Nyjen" + #: platform/android/export/export_plugin.cpp platform/iphone/export/export.cpp msgid "Architectures" msgstr "" @@ -18744,16 +18769,6 @@ msgstr "Tabi i mëparshëm" msgid "Code" msgstr "" -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Min SDK" -msgstr "Madhësia: " - -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Target SDK" -msgstr "Fshi Nyjen" - #: platform/android/export/export_plugin.cpp platform/uwp/export/export.cpp #, fuzzy msgid "Package" @@ -18998,12 +19013,12 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"\"Hand Tracking\" is only valid when \"Xr Mode\" is \"Oculus Mobile VrApi\" " +"\"Hand Tracking\" is only valid when \"XR Mode\" is \"Oculus Mobile VrApi\" " "or \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Passthrough\" is only valid when \"Xr Mode\" is \"OpenXR\"." +msgid "\"Passthrough\" is only valid when \"XR Mode\" is \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp @@ -19012,17 +19027,37 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Min Sdk\" is only valid when \"Use Custom Build\" is enabled." +"\"Min SDK\" can only be overridden when \"Use Custom Build\" is enabled." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Min SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Min SDK\" cannot be lower than %d, which is the version needed by the " +"Godot library." msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Target Sdk\" is only valid when \"Use Custom Build\" is " -"enabled." +"\"Target SDK\" can only be overridden when \"Use Custom Build\" is enabled." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Target Sdk\" version must be greater or equal to \"Min Sdk\" version." +msgid "" +"\"Target SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Target SDK\" %d is higher than the default version %d. This may work, but " +"wasn't tested and may be unstable." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Target SDK\" version must be greater or equal to \"Min SDK\" version." msgstr "" #: platform/android/export/export_plugin.cpp platform/osx/export/export.cpp @@ -20654,7 +20689,7 @@ msgstr "" msgid "Custom Viewport" msgstr "Zgjidh një 'Viewport'" -#: scene/2d/camera_2d.cpp scene/3d/camera.cpp +#: scene/2d/camera_2d.cpp scene/3d/camera.cpp scene/3d/interpolated_camera.cpp #: scene/animation/animation_player.cpp scene/animation/animation_tree.cpp #: scene/animation/animation_tree_player.cpp scene/main/timer.cpp #, fuzzy @@ -21359,6 +21394,11 @@ msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp #, fuzzy +msgid "Pathfinding" +msgstr "Konstantet" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy msgid "Path Desired Distance" msgstr "Zgjidh një Skenë Kryesore" @@ -21367,29 +21407,34 @@ msgid "Target Desired Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Neighbor Dist" +msgid "Path Max Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Max Neighbors" -msgstr "" +#, fuzzy +msgid "Avoidance" +msgstr "I Balancuar" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Time Horizon" +#, fuzzy +msgid "Avoidance Enabled" +msgstr "Lejo" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +msgid "Neighbor Dist" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Max Speed" +msgid "Max Neighbors" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Path Max Distance" +msgid "Time Horizon" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -#, fuzzy -msgid "Avoidance Enabled" -msgstr "Lejo" +msgid "Max Speed" +msgstr "" #: scene/2d/navigation_agent_2d.cpp msgid "" @@ -24550,6 +24595,11 @@ msgstr "Folderi:" #: scene/gui/text_edit.cpp #, fuzzy +msgid "Drag And Drop Selection Enabled" +msgstr "Zgjidh Këtë Folder" + +#: scene/gui/text_edit.cpp +#, fuzzy msgid "Hiding Enabled" msgstr "Lejo" @@ -24941,16 +24991,17 @@ msgstr "Fokuso Rrugën" #: scene/main/viewport.cpp msgid "" -"This viewport is not set as render target. If you intend for it to display " -"its contents directly to the screen, make it a child of a Control so it can " -"obtain a size. Otherwise, make it a RenderTarget and assign its internal " -"texture to some node for display." +"The Viewport size must be greater than or equal to 2 pixels on both " +"dimensions to render anything." msgstr "" #: scene/main/viewport.cpp msgid "" -"The Viewport size must be greater than or equal to 2 pixels on both " -"dimensions to render anything." +"This Viewport has HDR enabled, but its Usage is set to 2D or 2D No-" +"Sampling.\n" +"HDR is only supported in Viewports that have their Usage set to 3D or 3D No-" +"Effects.\n" +"HDR will be disabled for this Viewport." msgstr "" #: scene/main/viewport.cpp diff --git a/editor/translations/sr_Cyrl.po b/editor/translations/sr_Cyrl.po index 89a0067fe9..e4a0475e3f 100644 --- a/editor/translations/sr_Cyrl.po +++ b/editor/translations/sr_Cyrl.po @@ -431,6 +431,11 @@ msgstr "" msgid "Command" msgstr "Заједница" +#: core/os/input_event.cpp +#, fuzzy +msgid "Physical" +msgstr "Слика физике %" + #: core/os/input_event.cpp scene/2d/touch_screen_button.cpp #: scene/gui/base_button.cpp scene/gui/texture_button.cpp #: scene/resources/default_theme/default_theme.cpp @@ -5964,6 +5969,11 @@ msgid "Mouse Extra Buttons Navigate History" msgstr "" #: editor/editor_settings.cpp +#, fuzzy +msgid "Drag And Drop Selection" +msgstr "МапаМреже Испуни Одабрано" + +#: editor/editor_settings.cpp msgid "Appearance" msgstr "" @@ -20554,6 +20564,11 @@ msgid "The package must have at least one '.' separator." msgstr "Паковање мора имати бар један '.' раздвојник." #: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Custom Build" +msgstr "Направи чвор" + +#: platform/android/export/export_plugin.cpp msgid "Use Custom Build" msgstr "" @@ -20562,6 +20577,16 @@ msgstr "" msgid "Export Format" msgstr "Извези пројекат" +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Min SDK" +msgstr "Величина ивице:" + +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Target SDK" +msgstr "Мета" + #: platform/android/export/export_plugin.cpp platform/iphone/export/export.cpp #, fuzzy msgid "Architectures" @@ -20604,16 +20629,6 @@ msgstr "Истражи Претходну Инстанцу" msgid "Code" msgstr "" -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Min SDK" -msgstr "Величина ивице:" - -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Target SDK" -msgstr "Мета" - #: platform/android/export/export_plugin.cpp platform/uwp/export/export.cpp #, fuzzy msgid "Package" @@ -20876,12 +20891,12 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"\"Hand Tracking\" is only valid when \"Xr Mode\" is \"Oculus Mobile VrApi\" " +"\"Hand Tracking\" is only valid when \"XR Mode\" is \"Oculus Mobile VrApi\" " "or \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Passthrough\" is only valid when \"Xr Mode\" is \"OpenXR\"." +msgid "\"Passthrough\" is only valid when \"XR Mode\" is \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp @@ -20890,17 +20905,37 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Min Sdk\" is only valid when \"Use Custom Build\" is enabled." +"\"Min SDK\" can only be overridden when \"Use Custom Build\" is enabled." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Min SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Min SDK\" cannot be lower than %d, which is the version needed by the " +"Godot library." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Target SDK\" can only be overridden when \"Use Custom Build\" is enabled." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Target SDK\" should be a valid integer, but got \"%s\" which is invalid." msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Target Sdk\" is only valid when \"Use Custom Build\" is " -"enabled." +"\"Target SDK\" %d is higher than the default version %d. This may work, but " +"wasn't tested and may be unstable." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Target Sdk\" version must be greater or equal to \"Min Sdk\" version." +msgid "\"Target SDK\" version must be greater or equal to \"Min SDK\" version." msgstr "" #: platform/android/export/export_plugin.cpp platform/osx/export/export.cpp @@ -22599,7 +22634,7 @@ msgstr "Увеличај" msgid "Custom Viewport" msgstr "1 прозор" -#: scene/2d/camera_2d.cpp scene/3d/camera.cpp +#: scene/2d/camera_2d.cpp scene/3d/camera.cpp scene/3d/interpolated_camera.cpp #: scene/animation/animation_player.cpp scene/animation/animation_tree.cpp #: scene/animation/animation_tree_player.cpp scene/main/timer.cpp #, fuzzy @@ -23374,6 +23409,11 @@ msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp #, fuzzy +msgid "Pathfinding" +msgstr "Спојеви" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy msgid "Path Desired Distance" msgstr "Одабери Одстојање:" @@ -23382,6 +23422,21 @@ msgid "Target Desired Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Path Max Distance" +msgstr "Одабери Одстојање:" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Avoidance" +msgstr "Поставке залепљавања" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Avoidance Enabled" +msgstr "Укључи" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp msgid "Neighbor Dist" msgstr "" @@ -23399,16 +23454,6 @@ msgstr "Обрни Хоризонтално" msgid "Max Speed" msgstr "Брзина (FPS):" -#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -#, fuzzy -msgid "Path Max Distance" -msgstr "Одабери Одстојање:" - -#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -#, fuzzy -msgid "Avoidance Enabled" -msgstr "Укључи" - #: scene/2d/navigation_agent_2d.cpp msgid "" "The NavigationAgent2D can be used only under a Node2D inheriting parent node." @@ -26884,6 +26929,11 @@ msgstr "Пресавији линију" #: scene/gui/text_edit.cpp #, fuzzy +msgid "Drag And Drop Selection Enabled" +msgstr "Само одабрано" + +#: scene/gui/text_edit.cpp +#, fuzzy msgid "Hiding Enabled" msgstr "Укључи" @@ -27294,24 +27344,20 @@ msgstr "Извези пројекат" #: scene/main/viewport.cpp #, fuzzy msgid "" -"This viewport is not set as render target. If you intend for it to display " -"its contents directly to the screen, make it a child of a Control so it can " -"obtain a size. Otherwise, make it a RenderTarget and assign its internal " -"texture to some node for display." -msgstr "" -"Овај viewport није постављен као мета за исцртавање. Ако намераваш да " -"прикаже садржај директно на екран, учини га дететом Контроле да може да " -"добави величину. У супротном, учини га МетомИсцртавања и додели његову " -"унутрашњу текстуру неком чвору за приказ." - -#: scene/main/viewport.cpp -#, fuzzy -msgid "" "The Viewport size must be greater than or equal to 2 pixels on both " "dimensions to render anything." msgstr "Величина Viewport-а мора бити већа од 0 да би се нешто исцртало." #: scene/main/viewport.cpp +msgid "" +"This Viewport has HDR enabled, but its Usage is set to 2D or 2D No-" +"Sampling.\n" +"HDR is only supported in Viewports that have their Usage set to 3D or 3D No-" +"Effects.\n" +"HDR will be disabled for this Viewport." +msgstr "" + +#: scene/main/viewport.cpp msgid "ARVR" msgstr "" diff --git a/editor/translations/sr_Latn.po b/editor/translations/sr_Latn.po index 844e918f2d..9bbc31e19a 100644 --- a/editor/translations/sr_Latn.po +++ b/editor/translations/sr_Latn.po @@ -406,6 +406,11 @@ msgstr "" msgid "Command" msgstr "Zajednica" +#: core/os/input_event.cpp +#, fuzzy +msgid "Physical" +msgstr "Filtriraj signale" + #: core/os/input_event.cpp scene/2d/touch_screen_button.cpp #: scene/gui/base_button.cpp scene/gui/texture_button.cpp #: scene/resources/default_theme/default_theme.cpp @@ -5350,6 +5355,11 @@ msgid "Mouse Extra Buttons Navigate History" msgstr "" #: editor/editor_settings.cpp +#, fuzzy +msgid "Drag And Drop Selection" +msgstr "Sve sekcije" + +#: editor/editor_settings.cpp msgid "Appearance" msgstr "" @@ -18053,6 +18063,11 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Custom Build" +msgstr "Animacija Uduplaj Ključeve" + +#: platform/android/export/export_plugin.cpp msgid "Use Custom Build" msgstr "" @@ -18061,6 +18076,15 @@ msgstr "" msgid "Export Format" msgstr "Homogenost Boje." +#: platform/android/export/export_plugin.cpp +msgid "Min SDK" +msgstr "" + +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Target SDK" +msgstr "Ukloni Čvor" + #: platform/android/export/export_plugin.cpp platform/iphone/export/export.cpp msgid "Architectures" msgstr "" @@ -18097,15 +18121,6 @@ msgstr "" msgid "Code" msgstr "" -#: platform/android/export/export_plugin.cpp -msgid "Min SDK" -msgstr "" - -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Target SDK" -msgstr "Ukloni Čvor" - #: platform/android/export/export_plugin.cpp platform/uwp/export/export.cpp msgid "Package" msgstr "" @@ -18336,12 +18351,12 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"\"Hand Tracking\" is only valid when \"Xr Mode\" is \"Oculus Mobile VrApi\" " +"\"Hand Tracking\" is only valid when \"XR Mode\" is \"Oculus Mobile VrApi\" " "or \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Passthrough\" is only valid when \"Xr Mode\" is \"OpenXR\"." +msgid "\"Passthrough\" is only valid when \"XR Mode\" is \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp @@ -18350,17 +18365,37 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Min Sdk\" is only valid when \"Use Custom Build\" is enabled." +"\"Min SDK\" can only be overridden when \"Use Custom Build\" is enabled." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Min SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Min SDK\" cannot be lower than %d, which is the version needed by the " +"Godot library." msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Target Sdk\" is only valid when \"Use Custom Build\" is " -"enabled." +"\"Target SDK\" can only be overridden when \"Use Custom Build\" is enabled." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Target Sdk\" version must be greater or equal to \"Min Sdk\" version." +msgid "" +"\"Target SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Target SDK\" %d is higher than the default version %d. This may work, but " +"wasn't tested and may be unstable." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Target SDK\" version must be greater or equal to \"Min SDK\" version." msgstr "" #: platform/android/export/export_plugin.cpp platform/osx/export/export.cpp @@ -19919,7 +19954,7 @@ msgstr "Uveličaj" msgid "Custom Viewport" msgstr "" -#: scene/2d/camera_2d.cpp scene/3d/camera.cpp +#: scene/2d/camera_2d.cpp scene/3d/camera.cpp scene/3d/interpolated_camera.cpp #: scene/animation/animation_player.cpp scene/animation/animation_tree.cpp #: scene/animation/animation_tree_player.cpp scene/main/timer.cpp msgid "Process Mode" @@ -20619,6 +20654,11 @@ msgid "" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Pathfinding" +msgstr "Kontanta" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp msgid "Path Desired Distance" msgstr "" @@ -20627,29 +20667,34 @@ msgid "Target Desired Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Neighbor Dist" +msgid "Path Max Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Max Neighbors" -msgstr "" +#, fuzzy +msgid "Avoidance" +msgstr "Napredno" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Time Horizon" +#, fuzzy +msgid "Avoidance Enabled" +msgstr "Filtriraj signale" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +msgid "Neighbor Dist" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Max Speed" +msgid "Max Neighbors" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Path Max Distance" +msgid "Time Horizon" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -#, fuzzy -msgid "Avoidance Enabled" -msgstr "Filtriraj signale" +msgid "Max Speed" +msgstr "" #: scene/2d/navigation_agent_2d.cpp msgid "" @@ -23771,6 +23816,11 @@ msgstr "" #: scene/gui/text_edit.cpp #, fuzzy +msgid "Drag And Drop Selection Enabled" +msgstr "Samo Obeleženo" + +#: scene/gui/text_edit.cpp +#, fuzzy msgid "Hiding Enabled" msgstr "Filtriraj signale" @@ -24147,16 +24197,17 @@ msgstr "Putanja" #: scene/main/viewport.cpp msgid "" -"This viewport is not set as render target. If you intend for it to display " -"its contents directly to the screen, make it a child of a Control so it can " -"obtain a size. Otherwise, make it a RenderTarget and assign its internal " -"texture to some node for display." +"The Viewport size must be greater than or equal to 2 pixels on both " +"dimensions to render anything." msgstr "" #: scene/main/viewport.cpp msgid "" -"The Viewport size must be greater than or equal to 2 pixels on both " -"dimensions to render anything." +"This Viewport has HDR enabled, but its Usage is set to 2D or 2D No-" +"Sampling.\n" +"HDR is only supported in Viewports that have their Usage set to 3D or 3D No-" +"Effects.\n" +"HDR will be disabled for this Viewport." msgstr "" #: scene/main/viewport.cpp diff --git a/editor/translations/sv.po b/editor/translations/sv.po index 61e607d63d..010299e2cf 100644 --- a/editor/translations/sv.po +++ b/editor/translations/sv.po @@ -442,6 +442,11 @@ msgstr "" msgid "Command" msgstr "Gemenskap" +#: core/os/input_event.cpp +#, fuzzy +msgid "Physical" +msgstr "Fysik Bildruta %" + #: core/os/input_event.cpp scene/2d/touch_screen_button.cpp #: scene/gui/base_button.cpp scene/gui/texture_button.cpp #: scene/resources/default_theme/default_theme.cpp @@ -5660,6 +5665,11 @@ msgid "Mouse Extra Buttons Navigate History" msgstr "" #: editor/editor_settings.cpp +#, fuzzy +msgid "Drag And Drop Selection" +msgstr "Alla urval" + +#: editor/editor_settings.cpp msgid "Appearance" msgstr "" @@ -18984,6 +18994,11 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Custom Build" +msgstr "Klipp ut Noder" + +#: platform/android/export/export_plugin.cpp msgid "Use Custom Build" msgstr "" @@ -18992,6 +19007,16 @@ msgstr "" msgid "Export Format" msgstr "Exportera Projekt" +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Min SDK" +msgstr "Storlek:" + +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Target SDK" +msgstr "Byt Förälder-Node" + #: platform/android/export/export_plugin.cpp platform/iphone/export/export.cpp msgid "Architectures" msgstr "" @@ -19030,16 +19055,6 @@ msgstr "Föregående flik" msgid "Code" msgstr "" -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Min SDK" -msgstr "Storlek:" - -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Target SDK" -msgstr "Byt Förälder-Node" - #: platform/android/export/export_plugin.cpp platform/uwp/export/export.cpp #, fuzzy msgid "Package" @@ -19284,12 +19299,12 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"\"Hand Tracking\" is only valid when \"Xr Mode\" is \"Oculus Mobile VrApi\" " +"\"Hand Tracking\" is only valid when \"XR Mode\" is \"Oculus Mobile VrApi\" " "or \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Passthrough\" is only valid when \"Xr Mode\" is \"OpenXR\"." +msgid "\"Passthrough\" is only valid when \"XR Mode\" is \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp @@ -19298,17 +19313,37 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Min Sdk\" is only valid when \"Use Custom Build\" is enabled." +"\"Min SDK\" can only be overridden when \"Use Custom Build\" is enabled." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Min SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Min SDK\" cannot be lower than %d, which is the version needed by the " +"Godot library." msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Target Sdk\" is only valid when \"Use Custom Build\" is " -"enabled." +"\"Target SDK\" can only be overridden when \"Use Custom Build\" is enabled." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Target Sdk\" version must be greater or equal to \"Min Sdk\" version." +msgid "" +"\"Target SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Target SDK\" %d is higher than the default version %d. This may work, but " +"wasn't tested and may be unstable." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Target SDK\" version must be greater or equal to \"Min SDK\" version." msgstr "" #: platform/android/export/export_plugin.cpp platform/osx/export/export.cpp @@ -20964,7 +20999,7 @@ msgstr "Zooma In" msgid "Custom Viewport" msgstr "Vy underifrån" -#: scene/2d/camera_2d.cpp scene/3d/camera.cpp +#: scene/2d/camera_2d.cpp scene/3d/camera.cpp scene/3d/interpolated_camera.cpp #: scene/animation/animation_player.cpp scene/animation/animation_tree.cpp #: scene/animation/animation_tree_player.cpp scene/main/timer.cpp #, fuzzy @@ -21696,6 +21731,11 @@ msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp #, fuzzy +msgid "Pathfinding" +msgstr "Slumpmässig Rotation:" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy msgid "Path Desired Distance" msgstr "Välj en Huvudscen" @@ -21704,29 +21744,34 @@ msgid "Target Desired Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Neighbor Dist" +msgid "Path Max Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Max Neighbors" -msgstr "" +#, fuzzy +msgid "Avoidance" +msgstr "Avancerad" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Time Horizon" +#, fuzzy +msgid "Avoidance Enabled" +msgstr "Aktivera" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +msgid "Neighbor Dist" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Max Speed" +msgid "Max Neighbors" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Path Max Distance" +msgid "Time Horizon" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -#, fuzzy -msgid "Avoidance Enabled" -msgstr "Aktivera" +msgid "Max Speed" +msgstr "" #: scene/2d/navigation_agent_2d.cpp msgid "" @@ -25008,6 +25053,11 @@ msgstr "Mapp:" #: scene/gui/text_edit.cpp #, fuzzy +msgid "Drag And Drop Selection Enabled" +msgstr "Endast Urval" + +#: scene/gui/text_edit.cpp +#, fuzzy msgid "Hiding Enabled" msgstr "Aktivera" @@ -25405,16 +25455,17 @@ msgstr "Exportera Projekt" #: scene/main/viewport.cpp msgid "" -"This viewport is not set as render target. If you intend for it to display " -"its contents directly to the screen, make it a child of a Control so it can " -"obtain a size. Otherwise, make it a RenderTarget and assign its internal " -"texture to some node for display." +"The Viewport size must be greater than or equal to 2 pixels on both " +"dimensions to render anything." msgstr "" #: scene/main/viewport.cpp msgid "" -"The Viewport size must be greater than or equal to 2 pixels on both " -"dimensions to render anything." +"This Viewport has HDR enabled, but its Usage is set to 2D or 2D No-" +"Sampling.\n" +"HDR is only supported in Viewports that have their Usage set to 3D or 3D No-" +"Effects.\n" +"HDR will be disabled for this Viewport." msgstr "" #: scene/main/viewport.cpp diff --git a/editor/translations/te.po b/editor/translations/te.po index 431febd63c..9e49f9dcc5 100644 --- a/editor/translations/te.po +++ b/editor/translations/te.po @@ -388,6 +388,10 @@ msgstr "" msgid "Command" msgstr "సంఘం" +#: core/os/input_event.cpp +msgid "Physical" +msgstr "" + #: core/os/input_event.cpp scene/2d/touch_screen_button.cpp #: scene/gui/base_button.cpp scene/gui/texture_button.cpp #: scene/resources/default_theme/default_theme.cpp @@ -5259,6 +5263,10 @@ msgid "Mouse Extra Buttons Navigate History" msgstr "" #: editor/editor_settings.cpp +msgid "Drag And Drop Selection" +msgstr "" + +#: editor/editor_settings.cpp msgid "Appearance" msgstr "" @@ -17717,6 +17725,10 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export_plugin.cpp +msgid "Custom Build" +msgstr "" + +#: platform/android/export/export_plugin.cpp msgid "Use Custom Build" msgstr "" @@ -17724,6 +17736,15 @@ msgstr "" msgid "Export Format" msgstr "" +#: platform/android/export/export_plugin.cpp +msgid "Min SDK" +msgstr "" + +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Target SDK" +msgstr "నోడ్" + #: platform/android/export/export_plugin.cpp platform/iphone/export/export.cpp msgid "Architectures" msgstr "" @@ -17760,15 +17781,6 @@ msgstr "" msgid "Code" msgstr "" -#: platform/android/export/export_plugin.cpp -msgid "Min SDK" -msgstr "" - -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Target SDK" -msgstr "నోడ్" - #: platform/android/export/export_plugin.cpp platform/uwp/export/export.cpp msgid "Package" msgstr "" @@ -17988,12 +18000,12 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"\"Hand Tracking\" is only valid when \"Xr Mode\" is \"Oculus Mobile VrApi\" " +"\"Hand Tracking\" is only valid when \"XR Mode\" is \"Oculus Mobile VrApi\" " "or \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Passthrough\" is only valid when \"Xr Mode\" is \"OpenXR\"." +msgid "\"Passthrough\" is only valid when \"XR Mode\" is \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp @@ -18002,17 +18014,37 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Min Sdk\" is only valid when \"Use Custom Build\" is enabled." +"\"Min SDK\" can only be overridden when \"Use Custom Build\" is enabled." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Min SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Min SDK\" cannot be lower than %d, which is the version needed by the " +"Godot library." msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Target Sdk\" is only valid when \"Use Custom Build\" is " -"enabled." +"\"Target SDK\" can only be overridden when \"Use Custom Build\" is enabled." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Target Sdk\" version must be greater or equal to \"Min Sdk\" version." +msgid "" +"\"Target SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Target SDK\" %d is higher than the default version %d. This may work, but " +"wasn't tested and may be unstable." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Target SDK\" version must be greater or equal to \"Min SDK\" version." msgstr "" #: platform/android/export/export_plugin.cpp platform/osx/export/export.cpp @@ -19527,7 +19559,7 @@ msgstr "" msgid "Custom Viewport" msgstr "" -#: scene/2d/camera_2d.cpp scene/3d/camera.cpp +#: scene/2d/camera_2d.cpp scene/3d/camera.cpp scene/3d/interpolated_camera.cpp #: scene/animation/animation_player.cpp scene/animation/animation_tree.cpp #: scene/animation/animation_tree_player.cpp scene/main/timer.cpp msgid "Process Mode" @@ -20196,6 +20228,11 @@ msgid "" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Pathfinding" +msgstr "స్థిరాంకాలు" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp msgid "Path Desired Distance" msgstr "" @@ -20204,27 +20241,31 @@ msgid "Target Desired Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Neighbor Dist" +msgid "Path Max Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Max Neighbors" +msgid "Avoidance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Time Horizon" +msgid "Avoidance Enabled" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Max Speed" +msgid "Neighbor Dist" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Path Max Distance" +msgid "Max Neighbors" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Avoidance Enabled" +msgid "Time Horizon" +msgstr "" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +msgid "Max Speed" msgstr "" #: scene/2d/navigation_agent_2d.cpp @@ -23184,6 +23225,10 @@ msgid "Fold Gutter" msgstr "" #: scene/gui/text_edit.cpp +msgid "Drag And Drop Selection Enabled" +msgstr "" + +#: scene/gui/text_edit.cpp msgid "Hiding Enabled" msgstr "" @@ -23540,16 +23585,17 @@ msgstr "" #: scene/main/viewport.cpp msgid "" -"This viewport is not set as render target. If you intend for it to display " -"its contents directly to the screen, make it a child of a Control so it can " -"obtain a size. Otherwise, make it a RenderTarget and assign its internal " -"texture to some node for display." +"The Viewport size must be greater than or equal to 2 pixels on both " +"dimensions to render anything." msgstr "" #: scene/main/viewport.cpp msgid "" -"The Viewport size must be greater than or equal to 2 pixels on both " -"dimensions to render anything." +"This Viewport has HDR enabled, but its Usage is set to 2D or 2D No-" +"Sampling.\n" +"HDR is only supported in Viewports that have their Usage set to 3D or 3D No-" +"Effects.\n" +"HDR will be disabled for this Viewport." msgstr "" #: scene/main/viewport.cpp diff --git a/editor/translations/th.po b/editor/translations/th.po index df7f3a8c04..1a6a4b71be 100644 --- a/editor/translations/th.po +++ b/editor/translations/th.po @@ -438,6 +438,11 @@ msgstr "" msgid "Command" msgstr "ชุมชน" +#: core/os/input_event.cpp +#, fuzzy +msgid "Physical" +msgstr "% ของเฟรมฟิสิกส์" + #: core/os/input_event.cpp scene/2d/touch_screen_button.cpp #: scene/gui/base_button.cpp scene/gui/texture_button.cpp #: scene/resources/default_theme/default_theme.cpp @@ -5639,6 +5644,11 @@ msgid "Mouse Extra Buttons Navigate History" msgstr "" #: editor/editor_settings.cpp +#, fuzzy +msgid "Drag And Drop Selection" +msgstr "เติมที่เลือกใน GridMap" + +#: editor/editor_settings.cpp msgid "Appearance" msgstr "" @@ -18936,6 +18946,11 @@ msgid "The package must have at least one '.' separator." msgstr "แพ็คเกจจำเป็นต้องมี '.' อย่างน้อยหนึ่งตัว" #: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Custom Build" +msgstr "ตัดโหนด" + +#: platform/android/export/export_plugin.cpp msgid "Use Custom Build" msgstr "" @@ -18944,6 +18959,16 @@ msgstr "" msgid "Export Format" msgstr "ไดเรกทอรีส่งออก" +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Min SDK" +msgstr "ขนาดเส้นรอบรูป:" + +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Target SDK" +msgstr "เป้าหมาย" + #: platform/android/export/export_plugin.cpp platform/iphone/export/export.cpp #, fuzzy msgid "Architectures" @@ -18986,16 +19011,6 @@ msgstr "ตรวจสอบอินสแตนซ์ก่อนหน้า msgid "Code" msgstr "" -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Min SDK" -msgstr "ขนาดเส้นรอบรูป:" - -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Target SDK" -msgstr "เป้าหมาย" - #: platform/android/export/export_plugin.cpp platform/uwp/export/export.cpp #, fuzzy msgid "Package" @@ -19242,13 +19257,13 @@ msgstr "\"Use Custom Build\" จำเป็นต้องเปิดการ #: platform/android/export/export_plugin.cpp #, fuzzy msgid "" -"\"Hand Tracking\" is only valid when \"Xr Mode\" is \"Oculus Mobile VrApi\" " +"\"Hand Tracking\" is only valid when \"XR Mode\" is \"Oculus Mobile VrApi\" " "or \"OpenXR\"." msgstr "\"Hand Tracking\" จะสามารถใช้ได้เมื่อ \"Xr Mode\" เป็น \"Oculus Mobile VR\"" #: platform/android/export/export_plugin.cpp #, fuzzy -msgid "\"Passthrough\" is only valid when \"Xr Mode\" is \"OpenXR\"." +msgid "\"Passthrough\" is only valid when \"XR Mode\" is \"OpenXR\"." msgstr "\"Hand Tracking\" จะสามารถใช้ได้เมื่อ \"Xr Mode\" เป็น \"Oculus Mobile VR\"" #: platform/android/export/export_plugin.cpp @@ -19258,18 +19273,38 @@ msgstr "\"Export AAB\" จะใช้ได้เฉพาะเมื่อเ #: platform/android/export/export_plugin.cpp #, fuzzy msgid "" -"Changing the \"Min Sdk\" is only valid when \"Use Custom Build\" is enabled." +"\"Min SDK\" can only be overridden when \"Use Custom Build\" is enabled." msgstr "\"Export AAB\" จะใช้ได้เฉพาะเมื่อเปิดใช้งาน \"Use Custom Build\"" #: platform/android/export/export_plugin.cpp +msgid "\"Min SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Min SDK\" cannot be lower than %d, which is the version needed by the " +"Godot library." +msgstr "" + +#: platform/android/export/export_plugin.cpp #, fuzzy msgid "" -"Changing the \"Target Sdk\" is only valid when \"Use Custom Build\" is " -"enabled." +"\"Target SDK\" can only be overridden when \"Use Custom Build\" is enabled." msgstr "\"Export AAB\" จะใช้ได้เฉพาะเมื่อเปิดใช้งาน \"Use Custom Build\"" #: platform/android/export/export_plugin.cpp -msgid "\"Target Sdk\" version must be greater or equal to \"Min Sdk\" version." +msgid "" +"\"Target SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Target SDK\" %d is higher than the default version %d. This may work, but " +"wasn't tested and may be unstable." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Target SDK\" version must be greater or equal to \"Min SDK\" version." msgstr "" #: platform/android/export/export_plugin.cpp platform/osx/export/export.cpp @@ -20946,7 +20981,7 @@ msgstr "ขยาย" msgid "Custom Viewport" msgstr "1 วิวพอร์ต" -#: scene/2d/camera_2d.cpp scene/3d/camera.cpp +#: scene/2d/camera_2d.cpp scene/3d/camera.cpp scene/3d/interpolated_camera.cpp #: scene/animation/animation_player.cpp scene/animation/animation_tree.cpp #: scene/animation/animation_tree_player.cpp scene/main/timer.cpp #, fuzzy @@ -21707,6 +21742,11 @@ msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp #, fuzzy +msgid "Pathfinding" +msgstr "ปุ่มลัด" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy msgid "Path Desired Distance" msgstr "ระยะการเลือก:" @@ -21715,6 +21755,21 @@ msgid "Target Desired Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Path Max Distance" +msgstr "ระยะการเลือก:" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Avoidance" +msgstr "ขั้นสูง" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Avoidance Enabled" +msgstr "เปิด" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp msgid "Neighbor Dist" msgstr "" @@ -21732,16 +21787,6 @@ msgstr "พลิกแนวนอน" msgid "Max Speed" msgstr "ความเร็ว:" -#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -#, fuzzy -msgid "Path Max Distance" -msgstr "ระยะการเลือก:" - -#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -#, fuzzy -msgid "Avoidance Enabled" -msgstr "เปิด" - #: scene/2d/navigation_agent_2d.cpp msgid "" "The NavigationAgent2D can be used only under a Node2D inheriting parent node." @@ -25117,6 +25162,11 @@ msgstr "โฟลเดอร์:" #: scene/gui/text_edit.cpp #, fuzzy +msgid "Drag And Drop Selection Enabled" +msgstr "เฉพาะที่กำลังเลือก" + +#: scene/gui/text_edit.cpp +#, fuzzy msgid "Hiding Enabled" msgstr "เปิด" @@ -25523,17 +25573,6 @@ msgid "Viewport Path" msgstr "ไดเรกทอรีส่งออก" #: scene/main/viewport.cpp -msgid "" -"This viewport is not set as render target. If you intend for it to display " -"its contents directly to the screen, make it a child of a Control so it can " -"obtain a size. Otherwise, make it a RenderTarget and assign its internal " -"texture to some node for display." -msgstr "" -"Viewport นี้ไม่ได้เป็น render target ถ้าท่านต้องการแสดงผลบนหน้าจอโดยตรง " -"ให้แก้ไขโหนดนี้ให้เป็นโหนดลูกของ Control แต่ถ้าไม่ ให้ปรับเป็น render target และนำไปใช้เป็น " -"texture ของโหนดอื่น" - -#: scene/main/viewport.cpp #, fuzzy msgid "" "The Viewport size must be greater than or equal to 2 pixels on both " @@ -25541,6 +25580,15 @@ msgid "" msgstr "ขนาดวิวพอร์ตจะต้องมากกว่า 0 เพื่อที่จะเรนเดอร์ได้" #: scene/main/viewport.cpp +msgid "" +"This Viewport has HDR enabled, but its Usage is set to 2D or 2D No-" +"Sampling.\n" +"HDR is only supported in Viewports that have their Usage set to 3D or 3D No-" +"Effects.\n" +"HDR will be disabled for this Viewport." +msgstr "" + +#: scene/main/viewport.cpp msgid "ARVR" msgstr "" diff --git a/editor/translations/tl.po b/editor/translations/tl.po index f67f19ad11..d5a5d52332 100644 --- a/editor/translations/tl.po +++ b/editor/translations/tl.po @@ -415,6 +415,11 @@ msgstr "" msgid "Command" msgstr "Pamayanan" +#: core/os/input_event.cpp +#, fuzzy +msgid "Physical" +msgstr "Paganahin" + #: core/os/input_event.cpp scene/2d/touch_screen_button.cpp #: scene/gui/base_button.cpp scene/gui/texture_button.cpp #: scene/resources/default_theme/default_theme.cpp @@ -5453,6 +5458,11 @@ msgid "Mouse Extra Buttons Navigate History" msgstr "" #: editor/editor_settings.cpp +#, fuzzy +msgid "Drag And Drop Selection" +msgstr "Kopyahin Ang Pinagpipilian" + +#: editor/editor_settings.cpp msgid "Appearance" msgstr "" @@ -18258,6 +18268,11 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Custom Build" +msgstr "Kopyahin ang mga Node" + +#: platform/android/export/export_plugin.cpp msgid "Use Custom Build" msgstr "" @@ -18266,6 +18281,16 @@ msgstr "" msgid "Export Format" msgstr "Iluwas ang Library" +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Min SDK" +msgstr "Pangunahing Skrip:" + +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Target SDK" +msgstr "Pinagtututukan" + #: platform/android/export/export_plugin.cpp platform/iphone/export/export.cpp msgid "Architectures" msgstr "" @@ -18304,16 +18329,6 @@ msgstr "Nakaraang tab" msgid "Code" msgstr "" -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Min SDK" -msgstr "Pangunahing Skrip:" - -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Target SDK" -msgstr "Pinagtututukan" - #: platform/android/export/export_plugin.cpp platform/uwp/export/export.cpp #, fuzzy msgid "Package" @@ -18552,12 +18567,12 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"\"Hand Tracking\" is only valid when \"Xr Mode\" is \"Oculus Mobile VrApi\" " +"\"Hand Tracking\" is only valid when \"XR Mode\" is \"Oculus Mobile VrApi\" " "or \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Passthrough\" is only valid when \"Xr Mode\" is \"OpenXR\"." +msgid "\"Passthrough\" is only valid when \"XR Mode\" is \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp @@ -18566,17 +18581,37 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Min Sdk\" is only valid when \"Use Custom Build\" is enabled." +"\"Min SDK\" can only be overridden when \"Use Custom Build\" is enabled." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Min SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Min SDK\" cannot be lower than %d, which is the version needed by the " +"Godot library." msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Target Sdk\" is only valid when \"Use Custom Build\" is " -"enabled." +"\"Target SDK\" can only be overridden when \"Use Custom Build\" is enabled." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Target Sdk\" version must be greater or equal to \"Min Sdk\" version." +msgid "" +"\"Target SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Target SDK\" %d is higher than the default version %d. This may work, but " +"wasn't tested and may be unstable." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Target SDK\" version must be greater or equal to \"Min SDK\" version." msgstr "" #: platform/android/export/export_plugin.cpp platform/osx/export/export.cpp @@ -20201,7 +20236,7 @@ msgstr "Palakihin Ang Tanaw" msgid "Custom Viewport" msgstr "1 Tinginan" -#: scene/2d/camera_2d.cpp scene/3d/camera.cpp +#: scene/2d/camera_2d.cpp scene/3d/camera.cpp scene/3d/interpolated_camera.cpp #: scene/animation/animation_player.cpp scene/animation/animation_tree.cpp #: scene/animation/animation_tree_player.cpp scene/main/timer.cpp #, fuzzy @@ -20918,6 +20953,11 @@ msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp #, fuzzy +msgid "Pathfinding" +msgstr "Constant" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy msgid "Path Desired Distance" msgstr "Pumili ng Pangunahing Eksena" @@ -20926,6 +20966,20 @@ msgid "Target Desired Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +msgid "Path Max Distance" +msgstr "" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Avoidance" +msgstr "Paganahin" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Avoidance Enabled" +msgstr "Paganahin" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp msgid "Neighbor Dist" msgstr "" @@ -20942,15 +20996,6 @@ msgstr "" msgid "Max Speed" msgstr "Bilis:" -#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Path Max Distance" -msgstr "" - -#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -#, fuzzy -msgid "Avoidance Enabled" -msgstr "Paganahin" - #: scene/2d/navigation_agent_2d.cpp msgid "" "The NavigationAgent2D can be used only under a Node2D inheriting parent node." @@ -24179,6 +24224,11 @@ msgstr "Folder:" #: scene/gui/text_edit.cpp #, fuzzy +msgid "Drag And Drop Selection Enabled" +msgstr "Napili lang" + +#: scene/gui/text_edit.cpp +#, fuzzy msgid "Hiding Enabled" msgstr "Paganahin" @@ -24570,14 +24620,6 @@ msgstr "1 Tinginan" #: scene/main/viewport.cpp msgid "" -"This viewport is not set as render target. If you intend for it to display " -"its contents directly to the screen, make it a child of a Control so it can " -"obtain a size. Otherwise, make it a RenderTarget and assign its internal " -"texture to some node for display." -msgstr "" - -#: scene/main/viewport.cpp -msgid "" "The Viewport size must be greater than or equal to 2 pixels on both " "dimensions to render anything." msgstr "" @@ -24585,6 +24627,15 @@ msgstr "" "alinman." #: scene/main/viewport.cpp +msgid "" +"This Viewport has HDR enabled, but its Usage is set to 2D or 2D No-" +"Sampling.\n" +"HDR is only supported in Viewports that have their Usage set to 3D or 3D No-" +"Effects.\n" +"HDR will be disabled for this Viewport." +msgstr "" + +#: scene/main/viewport.cpp msgid "ARVR" msgstr "" diff --git a/editor/translations/tr.po b/editor/translations/tr.po index 89854afb02..1e4ab521bf 100644 --- a/editor/translations/tr.po +++ b/editor/translations/tr.po @@ -73,13 +73,14 @@ # inci <incialien@gmail.com>, 2022. # Ramazan Aslan <legendraslan@gmail.com>, 2022. # paledega <paledega@yandex.ru>, 2022. +# Yekez <yasintonge@gmail.com>, 2022. msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "Report-Msgid-Bugs-To: https://github.com/godotengine/godot\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2022-06-26 16:16+0000\n" -"Last-Translator: paledega <paledega@yandex.ru>\n" +"PO-Revision-Date: 2022-07-03 00:44+0000\n" +"Last-Translator: Yekez <yasintonge@gmail.com>\n" "Language-Team: Turkish <https://hosted.weblate.org/projects/godot-engine/" "godot/tr/>\n" "Language: tr\n" @@ -91,7 +92,7 @@ msgstr "" #: core/bind/core_bind.cpp main/main.cpp msgid "Tablet Driver" -msgstr "Tablet Sürücüsü" +msgstr "Tablet Sürücü" #: core/bind/core_bind.cpp msgid "Clipboard" @@ -99,7 +100,7 @@ msgstr "Pano" #: core/bind/core_bind.cpp msgid "Current Screen" -msgstr "Şu anki ekran" +msgstr "Şu anki Ekran" #: core/bind/core_bind.cpp msgid "Exit Code" @@ -107,7 +108,7 @@ msgstr "Çıkış Kodu" #: core/bind/core_bind.cpp msgid "V-Sync Enabled" -msgstr "V-Sync Etkinleştirildi" +msgstr "V-Sync Etkin" #: core/bind/core_bind.cpp main/main.cpp msgid "V-Sync Via Compositor" @@ -461,6 +462,11 @@ msgstr "Meta" msgid "Command" msgstr "Komut" +#: core/os/input_event.cpp +#, fuzzy +msgid "Physical" +msgstr " (Fiziksel)" + #: core/os/input_event.cpp scene/2d/touch_screen_button.cpp #: scene/gui/base_button.cpp scene/gui/texture_button.cpp #: scene/resources/default_theme/default_theme.cpp @@ -5643,6 +5649,11 @@ msgid "Mouse Extra Buttons Navigate History" msgstr "" #: editor/editor_settings.cpp +#, fuzzy +msgid "Drag And Drop Selection" +msgstr "GridMap Seçimi" + +#: editor/editor_settings.cpp msgid "Appearance" msgstr "" @@ -18860,6 +18871,11 @@ msgid "The package must have at least one '.' separator." msgstr "Paket en azından bir tane '.' ayıracına sahip olmalıdır." #: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Custom Build" +msgstr "ÖzelSınıf" + +#: platform/android/export/export_plugin.cpp msgid "Use Custom Build" msgstr "" @@ -18868,6 +18884,16 @@ msgstr "" msgid "Export Format" msgstr "Dışa aktarım Yolu" +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Min SDK" +msgstr "Kontur Boyutu:" + +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Target SDK" +msgstr "Hedef" + #: platform/android/export/export_plugin.cpp platform/iphone/export/export.cpp #, fuzzy msgid "Architectures" @@ -18911,16 +18937,6 @@ msgstr "Önceki Örneği İncele" msgid "Code" msgstr "" -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Min SDK" -msgstr "Kontur Boyutu:" - -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Target SDK" -msgstr "Hedef" - #: platform/android/export/export_plugin.cpp platform/uwp/export/export.cpp #, fuzzy msgid "Package" @@ -19170,15 +19186,17 @@ msgstr "" "Eklentileri kullanabilmek için \"Özel Derleme Kullan\" seçeneği aktif olmalı." #: platform/android/export/export_plugin.cpp +#, fuzzy msgid "" -"\"Hand Tracking\" is only valid when \"Xr Mode\" is \"Oculus Mobile VrApi\" " +"\"Hand Tracking\" is only valid when \"XR Mode\" is \"Oculus Mobile VrApi\" " "or \"OpenXR\"." msgstr "" "\"El Takibi (Hand Tracking)\" sadece \"Xr Modu\" \"Oculus Mobile VR\" ya da " "\"OpenXR\" olduğunda geçerlidir." #: platform/android/export/export_plugin.cpp -msgid "\"Passthrough\" is only valid when \"Xr Mode\" is \"OpenXR\"." +#, fuzzy +msgid "\"Passthrough\" is only valid when \"XR Mode\" is \"OpenXR\"." msgstr "\"İçinden Geçme\" sadece \"Xr Mod\" \"OpenXR\" ise geçerlidir." #: platform/android/export/export_plugin.cpp @@ -19188,22 +19206,45 @@ msgstr "" "geçerlidir." #: platform/android/export/export_plugin.cpp +#, fuzzy msgid "" -"Changing the \"Min Sdk\" is only valid when \"Use Custom Build\" is enabled." +"\"Min SDK\" can only be overridden when \"Use Custom Build\" is enabled." msgstr "" "\"Min Sdk\" değiştirilmesi sadece \"Özel Yapı\" etkinleştirildiğinde " "geçerlidir." #: platform/android/export/export_plugin.cpp +msgid "\"Min SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Target Sdk\" is only valid when \"Use Custom Build\" is " -"enabled." +"\"Min SDK\" cannot be lower than %d, which is the version needed by the " +"Godot library." +msgstr "" + +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "" +"\"Target SDK\" can only be overridden when \"Use Custom Build\" is enabled." msgstr "" "\"Target Sdk\" değiştirilmesi sadece \"Özel Yapı\" etkinleştirildiğinde " "geçerlidir." #: platform/android/export/export_plugin.cpp -msgid "\"Target Sdk\" version must be greater or equal to \"Min Sdk\" version." +msgid "" +"\"Target SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Target SDK\" %d is higher than the default version %d. This may work, but " +"wasn't tested and may be unstable." +msgstr "" + +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "\"Target SDK\" version must be greater or equal to \"Min SDK\" version." msgstr "" "\"Target Sdk\" sürümü \"Min Sdk\" sürümünden daha büyük veya eşit olmalıdır." @@ -20894,7 +20935,7 @@ msgstr "Yaklaştır" msgid "Custom Viewport" msgstr "1 Görüntü Kapısı" -#: scene/2d/camera_2d.cpp scene/3d/camera.cpp +#: scene/2d/camera_2d.cpp scene/3d/camera.cpp scene/3d/interpolated_camera.cpp #: scene/animation/animation_player.cpp scene/animation/animation_tree.cpp #: scene/animation/animation_tree_player.cpp scene/main/timer.cpp #, fuzzy @@ -21667,6 +21708,11 @@ msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp #, fuzzy +msgid "Pathfinding" +msgstr "Bağlayıcı" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy msgid "Path Desired Distance" msgstr "Uzaklık Seç:" @@ -21675,6 +21721,21 @@ msgid "Target Desired Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Path Max Distance" +msgstr "Uzaklık Seç:" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Avoidance" +msgstr "Gelişmiş" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Avoidance Enabled" +msgstr "Etkin" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp msgid "Neighbor Dist" msgstr "" @@ -21692,16 +21753,6 @@ msgstr "Yatay Yansıt" msgid "Max Speed" msgstr "Hız:" -#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -#, fuzzy -msgid "Path Max Distance" -msgstr "Uzaklık Seç:" - -#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -#, fuzzy -msgid "Avoidance Enabled" -msgstr "Etkin" - #: scene/2d/navigation_agent_2d.cpp #, fuzzy msgid "" @@ -25148,6 +25199,11 @@ msgstr "Dosya:" #: scene/gui/text_edit.cpp #, fuzzy +msgid "Drag And Drop Selection Enabled" +msgstr "Yalnızca Seçim" + +#: scene/gui/text_edit.cpp +#, fuzzy msgid "Hiding Enabled" msgstr "Etkin" @@ -25559,18 +25615,6 @@ msgstr "Dışa aktarım Yolu" #: scene/main/viewport.cpp msgid "" -"This viewport is not set as render target. If you intend for it to display " -"its contents directly to the screen, make it a child of a Control so it can " -"obtain a size. Otherwise, make it a RenderTarget and assign its internal " -"texture to some node for display." -msgstr "" -"Bu görüntükapısı bir işleyici hedefi olarak ayarlanmamış. Eğer bunu doğrudan " -"ekran içeriğini görüntülemek için düşünüyorsanız, bir Control'ün çocuğu " -"yapın böylece bir boyut elde edebilir. Aksi takdirde, Görüntüleme için bunu " -"bir RenderTarget yap ve dahili dokusunu herhangi bir düğüme ata." - -#: scene/main/viewport.cpp -msgid "" "The Viewport size must be greater than or equal to 2 pixels on both " "dimensions to render anything." msgstr "" @@ -25578,6 +25622,15 @@ msgstr "" "pikselden büyük ya da buna eşit olmalıdır." #: scene/main/viewport.cpp +msgid "" +"This Viewport has HDR enabled, but its Usage is set to 2D or 2D No-" +"Sampling.\n" +"HDR is only supported in Viewports that have their Usage set to 3D or 3D No-" +"Effects.\n" +"HDR will be disabled for this Viewport." +msgstr "" + +#: scene/main/viewport.cpp msgid "ARVR" msgstr "" diff --git a/editor/translations/uk.po b/editor/translations/uk.po index 719dc29d7a..4d22a47dea 100644 --- a/editor/translations/uk.po +++ b/editor/translations/uk.po @@ -23,13 +23,14 @@ # Wald Sin <naaveranos@gmail.com>, 2022. # Гліб Соколов <ramithes@i.ua>, 2022. # Max Donchenko <maxx.donchenko@gmail.com>, 2022. +# Artem <artem@molotov.work>, 2022. msgid "" msgstr "" "Project-Id-Version: Ukrainian (Godot Engine)\n" "Report-Msgid-Bugs-To: https://github.com/godotengine/godot\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2022-06-12 13:19+0000\n" -"Last-Translator: Yuri Chornoivan <yurchor@ukr.net>\n" +"PO-Revision-Date: 2022-07-03 00:44+0000\n" +"Last-Translator: Artem <artem@molotov.work>\n" "Language-Team: Ukrainian <https://hosted.weblate.org/projects/godot-engine/" "godot/uk/>\n" "Language: uk\n" @@ -38,7 +39,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && " "n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" -"X-Generator: Weblate 4.13-dev\n" +"X-Generator: Weblate 4.13.1-dev\n" #: core/bind/core_bind.cpp main/main.cpp msgid "Tablet Driver" @@ -378,14 +379,12 @@ msgid "Max Size (KB)" msgstr "Макс. розмір (кБ)" #: core/os/input.cpp -#, fuzzy msgid "Mouse Mode" -msgstr "Режим переміщення" +msgstr "Режим миші" #: core/os/input.cpp -#, fuzzy msgid "Use Accumulated Input" -msgstr "Видалити введення" +msgstr "Використати накопичувальне введення" #: core/os/input_event.cpp editor/project_settings_editor.cpp #: servers/audio_server.cpp @@ -412,6 +411,11 @@ msgstr "Meta" msgid "Command" msgstr "Команда" +#: core/os/input_event.cpp +#, fuzzy +msgid "Physical" +msgstr " (фізичний)" + #: core/os/input_event.cpp scene/2d/touch_screen_button.cpp #: scene/gui/base_button.cpp scene/gui/texture_button.cpp #: scene/resources/default_theme/default_theme.cpp @@ -662,14 +666,12 @@ msgid "Script Templates Search Path" msgstr "Шлях пошуку для шаблонів скриптів" #: core/project_settings.cpp -#, fuzzy msgid "Version Control Autoload On Startup" -msgstr "Автоматично завантажувати під час запуску" +msgstr "Автоматичне завантаження керування версіями під час запуску" #: core/project_settings.cpp -#, fuzzy msgid "Version Control Plugin Name" -msgstr "Керування версіями" +msgstr "Назва додатка керування версіями" #: core/project_settings.cpp scene/2d/collision_object_2d.cpp #: scene/3d/collision_object.cpp scene/gui/control.cpp @@ -2186,7 +2188,7 @@ msgstr "Відкрити" #: editor/dependency_editor.cpp msgid "Owners of: %s (Total: %d)" -msgstr "" +msgstr "Власник: %s (Загалом: %d)" #: editor/dependency_editor.cpp msgid "" @@ -2746,22 +2748,19 @@ msgstr "Оберіть" #: editor/editor_export.cpp msgid "Project export for platform:" -msgstr "" +msgstr "Експортування проєкту для платформи:" #: editor/editor_export.cpp -#, fuzzy msgid "Completed with errors." -msgstr "Повні шляхи до файлів" +msgstr "Завершено з помилками." #: editor/editor_export.cpp -#, fuzzy msgid "Completed successfully." -msgstr "Пакунок успішно встановлено!" +msgstr "Завершено успішно." #: editor/editor_export.cpp -#, fuzzy msgid "Failed." -msgstr "Не вдалося:" +msgstr "Помилка." #: editor/editor_export.cpp msgid "Storing File:" @@ -2776,29 +2775,24 @@ msgid "Packing" msgstr "Пакування" #: editor/editor_export.cpp -#, fuzzy msgid "Save PCK" -msgstr "Зберегти як" +msgstr "Зберегти PCK" #: editor/editor_export.cpp -#, fuzzy msgid "Cannot create file \"%s\"." -msgstr "Неможливо створити теку." +msgstr "Не вдалося створити файл «%s»." #: editor/editor_export.cpp -#, fuzzy msgid "Failed to export project files." -msgstr "Не вдалося експортувати файли проєкту" +msgstr "Не вдалося експортувати файли проєкту." #: editor/editor_export.cpp -#, fuzzy msgid "Can't open file to read from path \"%s\"." -msgstr "Неможливо відкрити файл для запису:" +msgstr "Не вдалося відкрити файл для читання зі шляху «%s»." #: editor/editor_export.cpp -#, fuzzy msgid "Save ZIP" -msgstr "Зберегти як" +msgstr "Зберегти ZIP" #: editor/editor_export.cpp msgid "" @@ -2918,30 +2912,25 @@ msgid "Custom release template not found." msgstr "Нетипового шаблону випуску не знайдено." #: editor/editor_export.cpp -#, fuzzy msgid "Prepare Template" -msgstr "Керування шаблонами" +msgstr "Приготувати шаблон" #: editor/editor_export.cpp platform/osx/export/export.cpp -#, fuzzy msgid "The given export path doesn't exist." -msgstr "Вказаного шляху для експортування не існує:" +msgstr "Вказаного шляху для експортування не існує." #: editor/editor_export.cpp platform/javascript/export/export.cpp -#, fuzzy msgid "Template file not found: \"%s\"." -msgstr "Файл шаблону не знайдено:" +msgstr "Не знайдено файла шаблона: «%s»." #: editor/editor_export.cpp -#, fuzzy msgid "Failed to copy export template." -msgstr "Неправильний шаблон експорту:" +msgstr "Не вдалося скопіювати шаблон експортування." #: editor/editor_export.cpp platform/windows/export/export.cpp #: platform/x11/export/export.cpp -#, fuzzy msgid "PCK Embedding" -msgstr "Фаска" +msgstr "Вбудовування PCK" #: editor/editor_export.cpp msgid "On 32-bit exports the embedded PCK cannot be bigger than 4 GiB." @@ -5216,9 +5205,8 @@ msgstr "" "меню «Експорт» або визначне наявний набір як придатний до використання." #: editor/editor_run_native.cpp -#, fuzzy msgid "Project Run" -msgstr "Проєкт" +msgstr "Запуск проєкту" #: editor/editor_run_script.cpp msgid "Write your logic in the _run() method." @@ -5502,6 +5490,11 @@ msgid "Mouse Extra Buttons Navigate History" msgstr "Додаткові кнопки миші для навігації журналом" #: editor/editor_settings.cpp +#, fuzzy +msgid "Drag And Drop Selection" +msgstr "Вибір GridMap" + +#: editor/editor_settings.cpp msgid "Appearance" msgstr "Вигляд" @@ -7156,12 +7149,18 @@ msgid "" "%s: Texture detected as used as a normal map in 3D. Enabling red-green " "texture compression to reduce memory usage (blue channel is discarded)." msgstr "" +"%s: виявлено текстуру, як використано як нормальну карту у просторовій " +"формі. Вмикаємо стискання червоно-зеленої текстури для зменшення споживання " +"пам'яті (канал синього відкинуто)." #: editor/import/resource_importer_texture.cpp msgid "" "%s: Texture detected as used in 3D. Enabling filter, repeat, mipmap " "generation and VRAM texture compression." msgstr "" +"%s: виявлено, що текстуру використано у просторовій формі. Вмикаємо " +"фільтрування, повторення, створення множинного відтворення та стискання " +"текстур у відеопам'яті." #: editor/import/resource_importer_texture.cpp msgid "2D, Detect 3D" @@ -11504,9 +11503,8 @@ msgid "Invalid geometry, can't replace by mesh." msgstr "Некоректна геометрія, неможливо замінити сіткою." #: editor/plugins/sprite_editor_plugin.cpp -#, fuzzy msgid "Convert to MeshInstance2D" -msgstr "Перетворити на Mesh2D" +msgstr "Перетворити на MeshInstance2D" #: editor/plugins/sprite_editor_plugin.cpp msgid "Invalid geometry, can't create polygon." @@ -12875,14 +12873,12 @@ msgid "Selected Collision" msgstr "Позначене зіткнення" #: editor/plugins/tile_set_editor_plugin.cpp -#, fuzzy msgid "Selected Collision One Way" -msgstr "Тільки виділити" +msgstr "Позначене односпрямоване зіткнення" #: editor/plugins/tile_set_editor_plugin.cpp -#, fuzzy msgid "Selected Collision One Way Margin" -msgstr "Поле зіткнення BVH" +msgstr "Поле позначеного односпрямованого зіткнення" #: editor/plugins/tile_set_editor_plugin.cpp msgid "Selected Navigation" @@ -14142,9 +14138,8 @@ msgid "Export templates for this platform are missing:" msgstr "Немає шаблонів експортування для цієї платформи:" #: editor/project_export.cpp -#, fuzzy msgid "Project Export" -msgstr "Засновники проєкту" +msgstr "Експортування проєкту" #: editor/project_export.cpp msgid "Manage Export Templates" @@ -16705,7 +16700,7 @@ msgstr "Копіювати вузол шляху" #: modules/gdscript/gdscript.cpp modules/visual_script/visual_script.cpp msgid "Max Call Stack" -msgstr "" +msgstr "Максимум стеку викликів" #: modules/gdscript/gdscript.cpp msgid "Treat Warnings As Errors" @@ -16815,11 +16810,11 @@ msgstr "Кількість розсіювання" #: modules/gltf/gltf_accessor.cpp msgid "Sparse Indices Buffer View" -msgstr "" +msgstr "Перегляд буфера розріджених індексів" #: modules/gltf/gltf_accessor.cpp msgid "Sparse Indices Byte Offset" -msgstr "" +msgstr "Байтовий зсув розріджених індексів" #: modules/gltf/gltf_accessor.cpp msgid "Sparse Indices Component Type" @@ -18362,6 +18357,11 @@ msgid "The package must have at least one '.' separator." msgstr "У назві пакунка має бути принаймні один роздільник «.»." #: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Custom Build" +msgstr "Нетипова збірка" + +#: platform/android/export/export_plugin.cpp msgid "Use Custom Build" msgstr "Нетипова збірка" @@ -18369,6 +18369,14 @@ msgstr "Нетипова збірка" msgid "Export Format" msgstr "Формат експортування" +#: platform/android/export/export_plugin.cpp +msgid "Min SDK" +msgstr "Мін. SDK" + +#: platform/android/export/export_plugin.cpp +msgid "Target SDK" +msgstr "SDK призначення" + #: platform/android/export/export_plugin.cpp platform/iphone/export/export.cpp #, fuzzy msgid "Architectures" @@ -18406,14 +18414,6 @@ msgstr "Вилучити попередньо встановлене" msgid "Code" msgstr "Код" -#: platform/android/export/export_plugin.cpp -msgid "Min SDK" -msgstr "Мін. SDK" - -#: platform/android/export/export_plugin.cpp -msgid "Target SDK" -msgstr "SDK призначення" - #: platform/android/export/export_plugin.cpp platform/uwp/export/export.cpp msgid "Package" msgstr "Пакунок" @@ -18651,15 +18651,17 @@ msgstr "" "«Використовувати нетипову збірку»." #: platform/android/export/export_plugin.cpp +#, fuzzy msgid "" -"\"Hand Tracking\" is only valid when \"Xr Mode\" is \"Oculus Mobile VrApi\" " +"\"Hand Tracking\" is only valid when \"XR Mode\" is \"Oculus Mobile VrApi\" " "or \"OpenXR\"." msgstr "" "«Стеженням за руками» можна скористатися, лише якщо «Режим Xr» дорівнює " "«Oculus Mobile VR» або «OpenXR»." #: platform/android/export/export_plugin.cpp -msgid "\"Passthrough\" is only valid when \"Xr Mode\" is \"OpenXR\"." +#, fuzzy +msgid "\"Passthrough\" is only valid when \"XR Mode\" is \"OpenXR\"." msgstr "" "«Стеженням за руками» можна скористатися, лише якщо «Режим Xr» дорівнює " "«OpenXR»." @@ -18671,22 +18673,45 @@ msgstr "" "нетипове збирання»." #: platform/android/export/export_plugin.cpp +#, fuzzy msgid "" -"Changing the \"Min Sdk\" is only valid when \"Use Custom Build\" is enabled." +"\"Min SDK\" can only be overridden when \"Use Custom Build\" is enabled." msgstr "" "Пункт «Мін. SDK» є чинним, лише якщо увімкнено «Використовувати нетипове " "збирання»." #: platform/android/export/export_plugin.cpp +msgid "\"Min SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Target Sdk\" is only valid when \"Use Custom Build\" is " -"enabled." +"\"Min SDK\" cannot be lower than %d, which is the version needed by the " +"Godot library." +msgstr "" + +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "" +"\"Target SDK\" can only be overridden when \"Use Custom Build\" is enabled." msgstr "" "Пункт «SDK цілі» є чинним, лише якщо увімкнено «Використовувати нетипове " "збирання»." #: platform/android/export/export_plugin.cpp -msgid "\"Target Sdk\" version must be greater or equal to \"Min Sdk\" version." +msgid "" +"\"Target SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Target SDK\" %d is higher than the default version %d. This may work, but " +"wasn't tested and may be unstable." +msgstr "" + +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "\"Target SDK\" version must be greater or equal to \"Min SDK\" version." msgstr "Версія «SDK цілі» має бути більшою або рівною за версію «Мін. SDK»." #: platform/android/export/export_plugin.cpp platform/osx/export/export.cpp @@ -19029,7 +19054,7 @@ msgstr "Опис використання мікрофона" #: platform/iphone/export/export.cpp msgid "Photolibrary Usage Description" -msgstr "Опис використання бібліотеки фотографій" +msgstr "Опис використання бібліотеки світлин" #: platform/iphone/export/export.cpp msgid "iPhone 120 X 120" @@ -19349,7 +19374,7 @@ msgstr "Опис використання календаря" #: platform/osx/export/export.cpp msgid "Photos Library Usage Description" -msgstr "Опис використання бібліотеки фотографій" +msgstr "Опис використання бібліотеки світлин" #: platform/osx/export/export.cpp msgid "Desktop Folder Usage Description" @@ -19430,7 +19455,7 @@ msgstr "Календарі" #: platform/osx/export/export.cpp msgid "Photos Library" -msgstr "Бібліотека фотографій" +msgstr "Бібліотека світлин" #: platform/osx/export/export.cpp msgid "Apple Events" @@ -19815,7 +19840,7 @@ msgid "" "Privacy: Photo library access is enabled, but usage description is not " "specified." msgstr "" -"Конфіденційність: увімкнено доступ до бібліотеки фотографій, але опис " +"Конфіденційність: увімкнено доступ до бібліотеки світлин, але опис " "використання не вказано." #: platform/osx/export/export.cpp @@ -20348,7 +20373,7 @@ msgstr "Масштаб" msgid "Custom Viewport" msgstr "1 панель перегляду" -#: scene/2d/camera_2d.cpp scene/3d/camera.cpp +#: scene/2d/camera_2d.cpp scene/3d/camera.cpp scene/3d/interpolated_camera.cpp #: scene/animation/animation_player.cpp scene/animation/animation_tree.cpp #: scene/animation/animation_tree_player.cpp scene/main/timer.cpp msgid "Process Mode" @@ -21036,6 +21061,11 @@ msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp #, fuzzy +msgid "Pathfinding" +msgstr "Палітурка" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy msgid "Path Desired Distance" msgstr "U-відстань контуру" @@ -21044,6 +21074,20 @@ msgid "Target Desired Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +msgid "Path Max Distance" +msgstr "Макс. відстань контуру" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Avoidance" +msgstr "Додатково" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Avoidance Enabled" +msgstr "Приховування увімкнено" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp msgid "Neighbor Dist" msgstr "" @@ -21059,15 +21103,6 @@ msgstr "Віддзеркалити горизонтально" msgid "Max Speed" msgstr "Макс. швидкість" -#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Path Max Distance" -msgstr "Макс. відстань контуру" - -#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -#, fuzzy -msgid "Avoidance Enabled" -msgstr "Приховування увімкнено" - #: scene/2d/navigation_agent_2d.cpp #, fuzzy msgid "" @@ -24180,6 +24215,11 @@ msgid "Fold Gutter" msgstr "Міжстовпцевий проміжок згортання" #: scene/gui/text_edit.cpp +#, fuzzy +msgid "Drag And Drop Selection Enabled" +msgstr "Увімкнено позначення" + +#: scene/gui/text_edit.cpp msgid "Hiding Enabled" msgstr "Приховування увімкнено" @@ -24538,18 +24578,6 @@ msgstr "Шлях до панелі перегляду" #: scene/main/viewport.cpp msgid "" -"This viewport is not set as render target. If you intend for it to display " -"its contents directly to the screen, make it a child of a Control so it can " -"obtain a size. Otherwise, make it a RenderTarget and assign its internal " -"texture to some node for display." -msgstr "" -"Ця панель показу не є ціллю обробки зображення. Якщо ви хочете, щоб її вміст " -"було безпосередньо показано на екрані, зробіть її дочірньою для вузла " -"Control, щоб у неї був розмір. Крім того, можна зробити її RenderTarget і " -"пов'язати її внутрішню текстуру з одним із вузлів для показу." - -#: scene/main/viewport.cpp -msgid "" "The Viewport size must be greater than or equal to 2 pixels on both " "dimensions to render anything." msgstr "" @@ -24557,6 +24585,15 @@ msgstr "" "або рівним 2 пікселям в обох вимірах." #: scene/main/viewport.cpp +msgid "" +"This Viewport has HDR enabled, but its Usage is set to 2D or 2D No-" +"Sampling.\n" +"HDR is only supported in Viewports that have their Usage set to 3D or 3D No-" +"Effects.\n" +"HDR will be disabled for this Viewport." +msgstr "" + +#: scene/main/viewport.cpp msgid "ARVR" msgstr "ARVR" diff --git a/editor/translations/ur_PK.po b/editor/translations/ur_PK.po index 76cd6b6495..e1bae41d6b 100644 --- a/editor/translations/ur_PK.po +++ b/editor/translations/ur_PK.po @@ -408,6 +408,11 @@ msgstr "" msgid "Command" msgstr "کمیونٹی" +#: core/os/input_event.cpp +#, fuzzy +msgid "Physical" +msgstr "سب سکریپشن بنائیں" + #: core/os/input_event.cpp scene/2d/touch_screen_button.cpp #: scene/gui/base_button.cpp scene/gui/texture_button.cpp #: scene/resources/default_theme/default_theme.cpp @@ -5407,6 +5412,11 @@ msgid "Mouse Extra Buttons Navigate History" msgstr "" #: editor/editor_settings.cpp +#, fuzzy +msgid "Drag And Drop Selection" +msgstr ".تمام کا انتخاب" + +#: editor/editor_settings.cpp msgid "Appearance" msgstr "" @@ -18373,6 +18383,11 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Custom Build" +msgstr "ایکشن منتقل کریں" + +#: platform/android/export/export_plugin.cpp msgid "Use Custom Build" msgstr "" @@ -18381,6 +18396,16 @@ msgstr "" msgid "Export Format" msgstr "سب سکریپشن بنائیں" +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Min SDK" +msgstr "سب سکریپشن بنائیں" + +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Target SDK" +msgstr ".اینیمیشن کی کیز کو ڈیلیٹ کرو" + #: platform/android/export/export_plugin.cpp platform/iphone/export/export.cpp msgid "Architectures" msgstr "" @@ -18417,16 +18442,6 @@ msgstr "" msgid "Code" msgstr "" -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Min SDK" -msgstr "سب سکریپشن بنائیں" - -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Target SDK" -msgstr ".اینیمیشن کی کیز کو ڈیلیٹ کرو" - #: platform/android/export/export_plugin.cpp platform/uwp/export/export.cpp #, fuzzy msgid "Package" @@ -18663,12 +18678,12 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"\"Hand Tracking\" is only valid when \"Xr Mode\" is \"Oculus Mobile VrApi\" " +"\"Hand Tracking\" is only valid when \"XR Mode\" is \"Oculus Mobile VrApi\" " "or \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Passthrough\" is only valid when \"Xr Mode\" is \"OpenXR\"." +msgid "\"Passthrough\" is only valid when \"XR Mode\" is \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp @@ -18677,17 +18692,37 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Min Sdk\" is only valid when \"Use Custom Build\" is enabled." +"\"Min SDK\" can only be overridden when \"Use Custom Build\" is enabled." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Min SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Min SDK\" cannot be lower than %d, which is the version needed by the " +"Godot library." msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Target Sdk\" is only valid when \"Use Custom Build\" is " -"enabled." +"\"Target SDK\" can only be overridden when \"Use Custom Build\" is enabled." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Target Sdk\" version must be greater or equal to \"Min Sdk\" version." +msgid "" +"\"Target SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Target SDK\" %d is higher than the default version %d. This may work, but " +"wasn't tested and may be unstable." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Target SDK\" version must be greater or equal to \"Min SDK\" version." msgstr "" #: platform/android/export/export_plugin.cpp platform/osx/export/export.cpp @@ -20272,7 +20307,7 @@ msgstr "" msgid "Custom Viewport" msgstr "" -#: scene/2d/camera_2d.cpp scene/3d/camera.cpp +#: scene/2d/camera_2d.cpp scene/3d/camera.cpp scene/3d/interpolated_camera.cpp #: scene/animation/animation_player.cpp scene/animation/animation_tree.cpp #: scene/animation/animation_tree_player.cpp scene/main/timer.cpp #, fuzzy @@ -20972,6 +21007,11 @@ msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp #, fuzzy +msgid "Pathfinding" +msgstr "مستقل" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy msgid "Path Desired Distance" msgstr "ایک مینو منظر چنیں" @@ -20980,29 +21020,34 @@ msgid "Target Desired Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Neighbor Dist" +msgid "Path Max Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Max Neighbors" -msgstr "" +#, fuzzy +msgid "Avoidance" +msgstr "سب سکریپشن بنائیں" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Time Horizon" +#, fuzzy +msgid "Avoidance Enabled" +msgstr "سب سکریپشن بنائیں" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +msgid "Neighbor Dist" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Max Speed" +msgid "Max Neighbors" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Path Max Distance" +msgid "Time Horizon" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -#, fuzzy -msgid "Avoidance Enabled" -msgstr "سب سکریپشن بنائیں" +msgid "Max Speed" +msgstr "" #: scene/2d/navigation_agent_2d.cpp msgid "" @@ -24102,6 +24147,11 @@ msgstr "" #: scene/gui/text_edit.cpp #, fuzzy +msgid "Drag And Drop Selection Enabled" +msgstr ".تمام کا انتخاب" + +#: scene/gui/text_edit.cpp +#, fuzzy msgid "Hiding Enabled" msgstr "سب سکریپشن بنائیں" @@ -24481,16 +24531,17 @@ msgstr "" #: scene/main/viewport.cpp msgid "" -"This viewport is not set as render target. If you intend for it to display " -"its contents directly to the screen, make it a child of a Control so it can " -"obtain a size. Otherwise, make it a RenderTarget and assign its internal " -"texture to some node for display." +"The Viewport size must be greater than or equal to 2 pixels on both " +"dimensions to render anything." msgstr "" #: scene/main/viewport.cpp msgid "" -"The Viewport size must be greater than or equal to 2 pixels on both " -"dimensions to render anything." +"This Viewport has HDR enabled, but its Usage is set to 2D or 2D No-" +"Sampling.\n" +"HDR is only supported in Viewports that have their Usage set to 3D or 3D No-" +"Effects.\n" +"HDR will be disabled for this Viewport." msgstr "" #: scene/main/viewport.cpp diff --git a/editor/translations/vi.po b/editor/translations/vi.po index 2b4093cc17..c8eae36ad6 100644 --- a/editor/translations/vi.po +++ b/editor/translations/vi.po @@ -412,6 +412,11 @@ msgstr "Meta" msgid "Command" msgstr "Command" +#: core/os/input_event.cpp +#, fuzzy +msgid "Physical" +msgstr "Vật lí" + #: core/os/input_event.cpp scene/2d/touch_screen_button.cpp #: scene/gui/base_button.cpp scene/gui/texture_button.cpp #: scene/resources/default_theme/default_theme.cpp @@ -5492,6 +5497,11 @@ msgid "Mouse Extra Buttons Navigate History" msgstr "" #: editor/editor_settings.cpp +#, fuzzy +msgid "Drag And Drop Selection" +msgstr "Chọn tất cả" + +#: editor/editor_settings.cpp msgid "Appearance" msgstr "Ngoại hình" @@ -18786,6 +18796,11 @@ msgid "The package must have at least one '.' separator." msgstr "Kí tự phân cách '.' phải xuất hiện ít nhất một lần trong tên gói." #: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Custom Build" +msgstr "Cắt các nút" + +#: platform/android/export/export_plugin.cpp msgid "Use Custom Build" msgstr "" @@ -18794,6 +18809,16 @@ msgstr "" msgid "Export Format" msgstr "Đường dẫn xuất" +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Min SDK" +msgstr "Kích cỡ viền:" + +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Target SDK" +msgstr "Bề mặt mục tiêu:" + #: platform/android/export/export_plugin.cpp platform/iphone/export/export.cpp #, fuzzy msgid "Architectures" @@ -18836,16 +18861,6 @@ msgstr "Cửa sổ trước" msgid "Code" msgstr "" -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Min SDK" -msgstr "Kích cỡ viền:" - -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Target SDK" -msgstr "Bề mặt mục tiêu:" - #: platform/android/export/export_plugin.cpp platform/uwp/export/export.cpp #, fuzzy msgid "Package" @@ -19092,7 +19107,7 @@ msgstr "\"Sử dụng Bản dựng tùy chỉnh\" phải được bật để s #: platform/android/export/export_plugin.cpp #, fuzzy msgid "" -"\"Hand Tracking\" is only valid when \"Xr Mode\" is \"Oculus Mobile VrApi\" " +"\"Hand Tracking\" is only valid when \"XR Mode\" is \"Oculus Mobile VrApi\" " "or \"OpenXR\"." msgstr "" "\"Theo dõi chuyển động tay\" chỉ dùng được khi \"Xr Mode\" là \"Oculus " @@ -19100,7 +19115,7 @@ msgstr "" #: platform/android/export/export_plugin.cpp #, fuzzy -msgid "\"Passthrough\" is only valid when \"Xr Mode\" is \"OpenXR\"." +msgid "\"Passthrough\" is only valid when \"XR Mode\" is \"OpenXR\"." msgstr "" "\"Theo dõi chuyển động tay\" chỉ dùng được khi \"Xr Mode\" là \"Oculus " "Mobile VR\"." @@ -19113,20 +19128,40 @@ msgstr "" #: platform/android/export/export_plugin.cpp #, fuzzy msgid "" -"Changing the \"Min Sdk\" is only valid when \"Use Custom Build\" is enabled." +"\"Min SDK\" can only be overridden when \"Use Custom Build\" is enabled." msgstr "" "\"Xuất AAB\" chỉ dùng được khi \"Sử dụng Bản dựng tùy chỉnh\" được bật." #: platform/android/export/export_plugin.cpp +msgid "\"Min SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Min SDK\" cannot be lower than %d, which is the version needed by the " +"Godot library." +msgstr "" + +#: platform/android/export/export_plugin.cpp #, fuzzy msgid "" -"Changing the \"Target Sdk\" is only valid when \"Use Custom Build\" is " -"enabled." +"\"Target SDK\" can only be overridden when \"Use Custom Build\" is enabled." msgstr "" "\"Xuất AAB\" chỉ dùng được khi \"Sử dụng Bản dựng tùy chỉnh\" được bật." #: platform/android/export/export_plugin.cpp -msgid "\"Target Sdk\" version must be greater or equal to \"Min Sdk\" version." +msgid "" +"\"Target SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Target SDK\" %d is higher than the default version %d. This may work, but " +"wasn't tested and may be unstable." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Target SDK\" version must be greater or equal to \"Min SDK\" version." msgstr "" #: platform/android/export/export_plugin.cpp platform/osx/export/export.cpp @@ -20810,7 +20845,7 @@ msgstr "Phóng to" msgid "Custom Viewport" msgstr "1 Cổng xem" -#: scene/2d/camera_2d.cpp scene/3d/camera.cpp +#: scene/2d/camera_2d.cpp scene/3d/camera.cpp scene/3d/interpolated_camera.cpp #: scene/animation/animation_player.cpp scene/animation/animation_tree.cpp #: scene/animation/animation_tree_player.cpp scene/main/timer.cpp #, fuzzy @@ -21568,6 +21603,11 @@ msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp #, fuzzy +msgid "Pathfinding" +msgstr "Đệm" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy msgid "Path Desired Distance" msgstr "Chọn ô" @@ -21576,6 +21616,20 @@ msgid "Target Desired Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +msgid "Path Max Distance" +msgstr "" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Avoidance" +msgstr "Nâng cao" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Avoidance Enabled" +msgstr "Mở" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp msgid "Neighbor Dist" msgstr "" @@ -21593,15 +21647,6 @@ msgstr "Lật Ngang" msgid "Max Speed" msgstr "Tốc độ:" -#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Path Max Distance" -msgstr "" - -#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -#, fuzzy -msgid "Avoidance Enabled" -msgstr "Mở" - #: scene/2d/navigation_agent_2d.cpp msgid "" "The NavigationAgent2D can be used only under a Node2D inheriting parent node." @@ -24954,6 +24999,11 @@ msgstr "Thư mục:" #: scene/gui/text_edit.cpp #, fuzzy +msgid "Drag And Drop Selection Enabled" +msgstr "Chỉ chọn" + +#: scene/gui/text_edit.cpp +#, fuzzy msgid "Hiding Enabled" msgstr "Mở" @@ -25358,16 +25408,17 @@ msgstr "Đường dẫn xuất" #: scene/main/viewport.cpp msgid "" -"This viewport is not set as render target. If you intend for it to display " -"its contents directly to the screen, make it a child of a Control so it can " -"obtain a size. Otherwise, make it a RenderTarget and assign its internal " -"texture to some node for display." +"The Viewport size must be greater than or equal to 2 pixels on both " +"dimensions to render anything." msgstr "" #: scene/main/viewport.cpp msgid "" -"The Viewport size must be greater than or equal to 2 pixels on both " -"dimensions to render anything." +"This Viewport has HDR enabled, but its Usage is set to 2D or 2D No-" +"Sampling.\n" +"HDR is only supported in Viewports that have their Usage set to 3D or 3D No-" +"Effects.\n" +"HDR will be disabled for this Viewport." msgstr "" #: scene/main/viewport.cpp diff --git a/editor/translations/zh_CN.po b/editor/translations/zh_CN.po index 4a15f6acf3..976fe38138 100644 --- a/editor/translations/zh_CN.po +++ b/editor/translations/zh_CN.po @@ -89,7 +89,7 @@ msgstr "" "Project-Id-Version: Chinese (Simplified) (Godot Engine)\n" "Report-Msgid-Bugs-To: https://github.com/godotengine/godot\n" "POT-Creation-Date: 2018-01-20 12:15+0200\n" -"PO-Revision-Date: 2022-06-20 06:44+0000\n" +"PO-Revision-Date: 2022-06-30 16:42+0000\n" "Last-Translator: Haoyu Qiu <timothyqiu32@gmail.com>\n" "Language-Team: Chinese (Simplified) <https://hosted.weblate.org/projects/" "godot-engine/godot/zh_Hans/>\n" @@ -466,6 +466,11 @@ msgstr "Meta" msgid "Command" msgstr "Command" +#: core/os/input_event.cpp +#, fuzzy +msgid "Physical" +msgstr " (物理)" + #: core/os/input_event.cpp scene/2d/touch_screen_button.cpp #: scene/gui/base_button.cpp scene/gui/texture_button.cpp #: scene/resources/default_theme/default_theme.cpp @@ -5431,6 +5436,11 @@ msgid "Mouse Extra Buttons Navigate History" msgstr "使用专门鼠标按键查看历史" #: editor/editor_settings.cpp +#, fuzzy +msgid "Drag And Drop Selection" +msgstr "GridMap 选择" + +#: editor/editor_settings.cpp msgid "Appearance" msgstr "外观" @@ -18065,6 +18075,11 @@ msgid "The package must have at least one '.' separator." msgstr "包必须至少有一个 “.” 分隔符。" #: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Custom Build" +msgstr "使用自定义构建" + +#: platform/android/export/export_plugin.cpp msgid "Use Custom Build" msgstr "使用自定义构建" @@ -18072,6 +18087,14 @@ msgstr "使用自定义构建" msgid "Export Format" msgstr "导出格式" +#: platform/android/export/export_plugin.cpp +msgid "Min SDK" +msgstr "最小 SDK" + +#: platform/android/export/export_plugin.cpp +msgid "Target SDK" +msgstr "目标 SDK" + #: platform/android/export/export_plugin.cpp platform/iphone/export/export.cpp msgid "Architectures" msgstr "架构" @@ -18108,14 +18131,6 @@ msgstr "清除上次安装" msgid "Code" msgstr "代码" -#: platform/android/export/export_plugin.cpp -msgid "Min SDK" -msgstr "最小 SDK" - -#: platform/android/export/export_plugin.cpp -msgid "Target SDK" -msgstr "目标 SDK" - #: platform/android/export/export_plugin.cpp platform/uwp/export/export.cpp msgid "Package" msgstr "包" @@ -18337,14 +18352,14 @@ msgstr "必须启用 “使用自定义构建” 才能使用插件。" #: platform/android/export/export_plugin.cpp msgid "" -"\"Hand Tracking\" is only valid when \"Xr Mode\" is \"Oculus Mobile VrApi\" " +"\"Hand Tracking\" is only valid when \"XR Mode\" is \"Oculus Mobile VrApi\" " "or \"OpenXR\"." msgstr "" -"“Hand Tracking”只有在当“Xr Mode”是“Oculus Mobile VrApi”或“OpenXR”时才有效。" +"“Hand Tracking”只有在当“XR Mode”是“Oculus Mobile VrApi”或“OpenXR”时才有效。" #: platform/android/export/export_plugin.cpp -msgid "\"Passthrough\" is only valid when \"Xr Mode\" is \"OpenXR\"." -msgstr "“Passthrough”只有在当“Xr Mode”是“OpenXR”时才有效。" +msgid "\"Passthrough\" is only valid when \"XR Mode\" is \"OpenXR\"." +msgstr "“Passthrough”只有在当“XR Mode”是“OpenXR”时才有效。" #: platform/android/export/export_plugin.cpp msgid "\"Export AAB\" is only valid when \"Use Custom Build\" is enabled." @@ -18352,18 +18367,38 @@ msgstr "“Export AAB”只有在当启用“Use Custom Build”时才有效。" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Min Sdk\" is only valid when \"Use Custom Build\" is enabled." -msgstr "修改“Min Sdk”只有在当启用“Use Custom Build”时才有效。" +"\"Min SDK\" can only be overridden when \"Use Custom Build\" is enabled." +msgstr "修改“Min SDK”只有在当启用“Use Custom Build”时才有效。" + +#: platform/android/export/export_plugin.cpp +msgid "\"Min SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Target Sdk\" is only valid when \"Use Custom Build\" is " -"enabled." -msgstr "修改“Target Sdk”只有在当启用“Use Custom Build”时才有效。" +"\"Min SDK\" cannot be lower than %d, which is the version needed by the " +"Godot library." +msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Target Sdk\" version must be greater or equal to \"Min Sdk\" version." -msgstr "“Target Sdk”版本必须大于等于“Min Sdk”版本。" +msgid "" +"\"Target SDK\" can only be overridden when \"Use Custom Build\" is enabled." +msgstr "修改“Target SDK”只有在当启用“Use Custom Build”时才有效。" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Target SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Target SDK\" %d is higher than the default version %d. This may work, but " +"wasn't tested and may be unstable." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Target SDK\" version must be greater or equal to \"Min SDK\" version." +msgstr "“Target SDK”版本必须大于等于“Min SDK”版本。" #: platform/android/export/export_plugin.cpp platform/osx/export/export.cpp #: platform/windows/export/export.cpp @@ -19894,7 +19929,7 @@ msgstr "缩放" msgid "Custom Viewport" msgstr "自定义视区" -#: scene/2d/camera_2d.cpp scene/3d/camera.cpp +#: scene/2d/camera_2d.cpp scene/3d/camera.cpp scene/3d/interpolated_camera.cpp #: scene/animation/animation_player.cpp scene/animation/animation_tree.cpp #: scene/animation/animation_tree_player.cpp scene/main/timer.cpp msgid "Process Mode" @@ -20567,17 +20602,36 @@ msgid "" "will be removed in a future version. Use 'Navigation2DServer.map_get_path()' " "instead." msgstr "" +"“Navigation2D”节点和“Navigation2D.get_simple_path()”已废弃,会在将来的版本中" +"移除。请用“Navigation2DServer.map_get_path()”替代。" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp #, fuzzy +msgid "Pathfinding" +msgstr "绑定" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp msgid "Path Desired Distance" -msgstr "目标期望距离" +msgstr "路径期望距离" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp msgid "Target Desired Distance" msgstr "目标期望距离" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +msgid "Path Max Distance" +msgstr "路径最大距离" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Avoidance" +msgstr "高级" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +msgid "Avoidance Enabled" +msgstr "启用避障" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp msgid "Neighbor Dist" msgstr "邻接距离" @@ -20593,14 +20647,6 @@ msgstr "时间下限" msgid "Max Speed" msgstr "最大速度" -#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Path Max Distance" -msgstr "路径最大距离" - -#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Avoidance Enabled" -msgstr "启用避障" - #: scene/2d/navigation_agent_2d.cpp msgid "" "The NavigationAgent2D can be used only under a Node2D inheriting parent node." @@ -21699,6 +21745,8 @@ msgid "" "be removed in a future version. Use 'NavigationServer.map_get_path()' " "instead." msgstr "" +"“Navigation”节点和“Navigation.get_simple_path()”已废弃,会在将来的版本中移" +"除。请用“NavigationServer.map_get_path()”替代。" #: scene/3d/navigation.cpp scene/resources/curve.cpp msgid "Up Vector" @@ -23603,6 +23651,11 @@ msgid "Fold Gutter" msgstr "折叠栏" #: scene/gui/text_edit.cpp +#, fuzzy +msgid "Drag And Drop Selection Enabled" +msgstr "启用选择" + +#: scene/gui/text_edit.cpp msgid "Hiding Enabled" msgstr "启用隐藏" @@ -23959,22 +24012,20 @@ msgstr "Viewport 路径" #: scene/main/viewport.cpp msgid "" -"This viewport is not set as render target. If you intend for it to display " -"its contents directly to the screen, make it a child of a Control so it can " -"obtain a size. Otherwise, make it a RenderTarget and assign its internal " -"texture to some node for display." -msgstr "" -"这个视窗未被设置为渲染目标。如果你想让其直接在屏幕上显示内容,请使其成为 " -"Control 的子节点,这样一来该 Viewport 才会有大小。否则请为其设置 " -"RenderTarget 并分配其内部纹理来显示。" - -#: scene/main/viewport.cpp -msgid "" "The Viewport size must be greater than or equal to 2 pixels on both " "dimensions to render anything." msgstr "Viewport 的宽高都大于等于 2 像素时才能进行渲染。" #: scene/main/viewport.cpp +msgid "" +"This Viewport has HDR enabled, but its Usage is set to 2D or 2D No-" +"Sampling.\n" +"HDR is only supported in Viewports that have their Usage set to 3D or 3D No-" +"Effects.\n" +"HDR will be disabled for this Viewport." +msgstr "" + +#: scene/main/viewport.cpp msgid "ARVR" msgstr "ARVR" @@ -25482,14 +25533,12 @@ msgid "Walkable Low Height Spans" msgstr "可行走低高度范围" #: scene/resources/navigation_mesh.cpp -#, fuzzy msgid "Baking AABB" -msgstr "正在生成 AABB" +msgstr "烘焙 AABB" #: scene/resources/navigation_mesh.cpp -#, fuzzy msgid "Baking AABB Offset" -msgstr "基础偏移" +msgstr "烘焙 AABB 偏移" #: scene/resources/occluder_shape.cpp msgid "Spheres" diff --git a/editor/translations/zh_HK.po b/editor/translations/zh_HK.po index 114f6b0a45..201811d543 100644 --- a/editor/translations/zh_HK.po +++ b/editor/translations/zh_HK.po @@ -417,6 +417,11 @@ msgstr "" msgid "Command" msgstr "社群" +#: core/os/input_event.cpp +#, fuzzy +msgid "Physical" +msgstr "物理幀 %" + #: core/os/input_event.cpp scene/2d/touch_screen_button.cpp #: scene/gui/base_button.cpp scene/gui/texture_button.cpp #: scene/resources/default_theme/default_theme.cpp @@ -5663,6 +5668,11 @@ msgid "Mouse Extra Buttons Navigate History" msgstr "" #: editor/editor_settings.cpp +#, fuzzy +msgid "Drag And Drop Selection" +msgstr "刪除選中檔案" + +#: editor/editor_settings.cpp msgid "Appearance" msgstr "" @@ -19119,6 +19129,11 @@ msgid "The package must have at least one '.' separator." msgstr "" #: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Custom Build" +msgstr "貼上" + +#: platform/android/export/export_plugin.cpp msgid "Use Custom Build" msgstr "" @@ -19127,6 +19142,16 @@ msgstr "" msgid "Export Format" msgstr "匯出" +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Min SDK" +msgstr "下一個腳本" + +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Target SDK" +msgstr "目標" + #: platform/android/export/export_plugin.cpp platform/iphone/export/export.cpp msgid "Architectures" msgstr "" @@ -19165,16 +19190,6 @@ msgstr "上一個tab" msgid "Code" msgstr "" -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Min SDK" -msgstr "下一個腳本" - -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Target SDK" -msgstr "目標" - #: platform/android/export/export_plugin.cpp platform/uwp/export/export.cpp #, fuzzy msgid "Package" @@ -19419,12 +19434,12 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"\"Hand Tracking\" is only valid when \"Xr Mode\" is \"Oculus Mobile VrApi\" " +"\"Hand Tracking\" is only valid when \"XR Mode\" is \"Oculus Mobile VrApi\" " "or \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Passthrough\" is only valid when \"Xr Mode\" is \"OpenXR\"." +msgid "\"Passthrough\" is only valid when \"XR Mode\" is \"OpenXR\"." msgstr "" #: platform/android/export/export_plugin.cpp @@ -19433,17 +19448,37 @@ msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Min Sdk\" is only valid when \"Use Custom Build\" is enabled." +"\"Min SDK\" can only be overridden when \"Use Custom Build\" is enabled." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Min SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Min SDK\" cannot be lower than %d, which is the version needed by the " +"Godot library." msgstr "" #: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Target Sdk\" is only valid when \"Use Custom Build\" is " -"enabled." +"\"Target SDK\" can only be overridden when \"Use Custom Build\" is enabled." msgstr "" #: platform/android/export/export_plugin.cpp -msgid "\"Target Sdk\" version must be greater or equal to \"Min Sdk\" version." +msgid "" +"\"Target SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Target SDK\" %d is higher than the default version %d. This may work, but " +"wasn't tested and may be unstable." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "\"Target SDK\" version must be greater or equal to \"Min SDK\" version." msgstr "" #: platform/android/export/export_plugin.cpp platform/osx/export/export.cpp @@ -21095,7 +21130,7 @@ msgstr "放大" msgid "Custom Viewport" msgstr "" -#: scene/2d/camera_2d.cpp scene/3d/camera.cpp +#: scene/2d/camera_2d.cpp scene/3d/camera.cpp scene/3d/interpolated_camera.cpp #: scene/animation/animation_player.cpp scene/animation/animation_tree.cpp #: scene/animation/animation_tree_player.cpp scene/main/timer.cpp #, fuzzy @@ -21810,6 +21845,11 @@ msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp #, fuzzy +msgid "Pathfinding" +msgstr "貼上動畫" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy msgid "Path Desired Distance" msgstr "選擇主場景" @@ -21818,29 +21858,34 @@ msgid "Target Desired Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Neighbor Dist" +msgid "Path Max Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Max Neighbors" -msgstr "" +#, fuzzy +msgid "Avoidance" +msgstr "進階" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Time Horizon" +#, fuzzy +msgid "Avoidance Enabled" +msgstr "啟用" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +msgid "Neighbor Dist" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Max Speed" +msgid "Max Neighbors" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -msgid "Path Max Distance" +msgid "Time Horizon" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -#, fuzzy -msgid "Avoidance Enabled" -msgstr "啟用" +msgid "Max Speed" +msgstr "" #: scene/2d/navigation_agent_2d.cpp msgid "" @@ -25061,6 +25106,11 @@ msgstr "資料夾:" #: scene/gui/text_edit.cpp #, fuzzy +msgid "Drag And Drop Selection Enabled" +msgstr "只限選中" + +#: scene/gui/text_edit.cpp +#, fuzzy msgid "Hiding Enabled" msgstr "啟用" @@ -25454,14 +25504,6 @@ msgid "Viewport Path" msgstr "匯出" #: scene/main/viewport.cpp -msgid "" -"This viewport is not set as render target. If you intend for it to display " -"its contents directly to the screen, make it a child of a Control so it can " -"obtain a size. Otherwise, make it a RenderTarget and assign its internal " -"texture to some node for display." -msgstr "" - -#: scene/main/viewport.cpp #, fuzzy msgid "" "The Viewport size must be greater than or equal to 2 pixels on both " @@ -25469,6 +25511,15 @@ msgid "" msgstr "viewport大小必須大於0以渲染任何東西。" #: scene/main/viewport.cpp +msgid "" +"This Viewport has HDR enabled, but its Usage is set to 2D or 2D No-" +"Sampling.\n" +"HDR is only supported in Viewports that have their Usage set to 3D or 3D No-" +"Effects.\n" +"HDR will be disabled for this Viewport." +msgstr "" + +#: scene/main/viewport.cpp msgid "ARVR" msgstr "" diff --git a/editor/translations/zh_TW.po b/editor/translations/zh_TW.po index bcf6650997..9021c16fc8 100644 --- a/editor/translations/zh_TW.po +++ b/editor/translations/zh_TW.po @@ -434,6 +434,11 @@ msgstr "Meta" msgid "Command" msgstr "Command" +#: core/os/input_event.cpp +#, fuzzy +msgid "Physical" +msgstr " (物理)" + #: core/os/input_event.cpp scene/2d/touch_screen_button.cpp #: scene/gui/base_button.cpp scene/gui/texture_button.cpp #: scene/resources/default_theme/default_theme.cpp @@ -5585,6 +5590,11 @@ msgid "Mouse Extra Buttons Navigate History" msgstr "滑鼠額外按鍵操作歷史紀錄" #: editor/editor_settings.cpp +#, fuzzy +msgid "Drag And Drop Selection" +msgstr "選擇網格地圖" + +#: editor/editor_settings.cpp msgid "Appearance" msgstr "外觀" @@ -18704,6 +18714,11 @@ msgid "The package must have at least one '.' separator." msgstr "套件必須至少有一個「.」分隔字元。" #: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Custom Build" +msgstr "剪下節點" + +#: platform/android/export/export_plugin.cpp msgid "Use Custom Build" msgstr "" @@ -18712,6 +18727,16 @@ msgstr "" msgid "Export Format" msgstr "匯出路徑" +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Min SDK" +msgstr "輪廓尺寸:" + +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "Target SDK" +msgstr "目標" + #: platform/android/export/export_plugin.cpp platform/iphone/export/export.cpp #, fuzzy msgid "Architectures" @@ -18754,16 +18779,6 @@ msgstr "偵查前一個實體" msgid "Code" msgstr "" -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Min SDK" -msgstr "輪廓尺寸:" - -#: platform/android/export/export_plugin.cpp -#, fuzzy -msgid "Target SDK" -msgstr "目標" - #: platform/android/export/export_plugin.cpp platform/uwp/export/export.cpp #, fuzzy msgid "Package" @@ -19003,15 +19018,17 @@ msgid "\"Use Custom Build\" must be enabled to use the plugins." msgstr "「使用自定建置」必須啟用以使用本外掛。" #: platform/android/export/export_plugin.cpp +#, fuzzy msgid "" -"\"Hand Tracking\" is only valid when \"Xr Mode\" is \"Oculus Mobile VrApi\" " +"\"Hand Tracking\" is only valid when \"XR Mode\" is \"Oculus Mobile VrApi\" " "or \"OpenXR\"." msgstr "" "「Hand Tracking」(手部追蹤)僅可在「Xr Mode」(XR 模式)設為「Oculus Mobile " "VR」或「OpenXR」時可用。" #: platform/android/export/export_plugin.cpp -msgid "\"Passthrough\" is only valid when \"Xr Mode\" is \"OpenXR\"." +#, fuzzy +msgid "\"Passthrough\" is only valid when \"XR Mode\" is \"OpenXR\"." msgstr "「Passthrough」僅可在「Xr Mode」(XR 模式)設為「OpenXR」時可用。" #: platform/android/export/export_plugin.cpp @@ -19019,18 +19036,41 @@ msgid "\"Export AAB\" is only valid when \"Use Custom Build\" is enabled." msgstr "「Export AAB」僅於「Use Custom Build」啟用時可用。" #: platform/android/export/export_plugin.cpp +#, fuzzy msgid "" -"Changing the \"Min Sdk\" is only valid when \"Use Custom Build\" is enabled." +"\"Min SDK\" can only be overridden when \"Use Custom Build\" is enabled." msgstr "對「Min Sdk」的修改僅在「Use Custom Build」啟用時有效。" #: platform/android/export/export_plugin.cpp +msgid "\"Min SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp msgid "" -"Changing the \"Target Sdk\" is only valid when \"Use Custom Build\" is " -"enabled." +"\"Min SDK\" cannot be lower than %d, which is the version needed by the " +"Godot library." +msgstr "" + +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "" +"\"Target SDK\" can only be overridden when \"Use Custom Build\" is enabled." msgstr "對「Target Sdk」的修改僅於「Use Custom Build」啟用時有效。" #: platform/android/export/export_plugin.cpp -msgid "\"Target Sdk\" version must be greater or equal to \"Min Sdk\" version." +msgid "" +"\"Target SDK\" should be a valid integer, but got \"%s\" which is invalid." +msgstr "" + +#: platform/android/export/export_plugin.cpp +msgid "" +"\"Target SDK\" %d is higher than the default version %d. This may work, but " +"wasn't tested and may be unstable." +msgstr "" + +#: platform/android/export/export_plugin.cpp +#, fuzzy +msgid "\"Target SDK\" version must be greater or equal to \"Min SDK\" version." msgstr "「Target Sdk」版本必須高於或于「Min Sdk」版本一致。" #: platform/android/export/export_plugin.cpp platform/osx/export/export.cpp @@ -20711,7 +20751,7 @@ msgstr "放大" msgid "Custom Viewport" msgstr "1 個檢視區" -#: scene/2d/camera_2d.cpp scene/3d/camera.cpp +#: scene/2d/camera_2d.cpp scene/3d/camera.cpp scene/3d/interpolated_camera.cpp #: scene/animation/animation_player.cpp scene/animation/animation_tree.cpp #: scene/animation/animation_tree_player.cpp scene/main/timer.cpp #, fuzzy @@ -21472,6 +21512,11 @@ msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp #, fuzzy +msgid "Pathfinding" +msgstr "綁定" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy msgid "Path Desired Distance" msgstr "選擇距離:" @@ -21480,6 +21525,21 @@ msgid "Target Desired Distance" msgstr "" #: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Path Max Distance" +msgstr "選擇距離:" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Avoidance" +msgstr "進階" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp +#, fuzzy +msgid "Avoidance Enabled" +msgstr "啟用" + +#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp msgid "Neighbor Dist" msgstr "" @@ -21497,16 +21557,6 @@ msgstr "水平翻轉" msgid "Max Speed" msgstr "速度:" -#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -#, fuzzy -msgid "Path Max Distance" -msgstr "選擇距離:" - -#: scene/2d/navigation_agent_2d.cpp scene/3d/navigation_agent.cpp -#, fuzzy -msgid "Avoidance Enabled" -msgstr "啟用" - #: scene/2d/navigation_agent_2d.cpp msgid "" "The NavigationAgent2D can be used only under a Node2D inheriting parent node." @@ -24903,6 +24953,11 @@ msgstr "資料夾:" #: scene/gui/text_edit.cpp #, fuzzy +msgid "Drag And Drop Selection Enabled" +msgstr "僅搜尋所選區域" + +#: scene/gui/text_edit.cpp +#, fuzzy msgid "Hiding Enabled" msgstr "啟用" @@ -25313,22 +25368,20 @@ msgstr "匯出路徑" #: scene/main/viewport.cpp msgid "" -"This viewport is not set as render target. If you intend for it to display " -"its contents directly to the screen, make it a child of a Control so it can " -"obtain a size. Otherwise, make it a RenderTarget and assign its internal " -"texture to some node for display." -msgstr "" -"該 Viewport 尚未被設定為算繪目標。若你想直接將其內容顯示於畫面上,請將其設為 " -"Control 的子節點以讓其取得大小。否則請將其設為 RenderTarget 並指派其內部紋理" -"為其他節點以顯示。" - -#: scene/main/viewport.cpp -msgid "" "The Viewport size must be greater than or equal to 2 pixels on both " "dimensions to render anything." msgstr "Viewport長與寬必須皆大於或等於2像素才可進行算繪。" #: scene/main/viewport.cpp +msgid "" +"This Viewport has HDR enabled, but its Usage is set to 2D or 2D No-" +"Sampling.\n" +"HDR is only supported in Viewports that have their Usage set to 3D or 3D No-" +"Effects.\n" +"HDR will be disabled for this Viewport." +msgstr "" + +#: scene/main/viewport.cpp msgid "ARVR" msgstr "" diff --git a/main/main.cpp b/main/main.cpp index f7c192001b..eb401cd9ef 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -621,11 +621,18 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph /* argument parsing and main creation */ List<String> args; List<String> main_args; + List<String> platform_args = OS::get_singleton()->get_cmdline_platform_args(); + // Add command line arguments. for (int i = 0; i < argc; i++) { args.push_back(String::utf8(argv[i])); } + // Add arguments received from macOS LaunchService (URL schemas, file associations). + for (const String &arg : platform_args) { + args.push_back(arg); + } + List<String>::Element *I = args.front(); while (I) { diff --git a/modules/gdscript/doc_classes/@GDScript.xml b/modules/gdscript/doc_classes/@GDScript.xml index 70151c4d21..049be47ca8 100644 --- a/modules/gdscript/doc_classes/@GDScript.xml +++ b/modules/gdscript/doc_classes/@GDScript.xml @@ -257,4 +257,165 @@ [b]Note:[/b] "Not a Number" is only a concept with floating-point numbers, and has no equivalent for integers. Dividing an integer [code]0[/code] by [code]0[/code] will not result in [constant NAN] and will result in a run-time error instead. </constant> </constants> + <annotations> + <annotation name="@export"> + <return type="void" /> + <description> + </description> + </annotation> + <annotation name="@export_category"> + <return type="void" /> + <argument index="0" name="name" type="String" /> + <description> + </description> + </annotation> + <annotation name="@export_color_no_alpha"> + <return type="void" /> + <description> + </description> + </annotation> + <annotation name="@export_dir"> + <return type="void" /> + <description> + </description> + </annotation> + <annotation name="@export_enum" qualifiers="vararg"> + <return type="void" /> + <argument index="0" name="names" type="String" /> + <description> + </description> + </annotation> + <annotation name="@export_exp_easing"> + <return type="void" /> + <argument index="0" name="hint1" type="String" default="null" /> + <argument index="1" name="hint2" type="String" default="null" /> + <description> + </description> + </annotation> + <annotation name="@export_file" qualifiers="vararg"> + <return type="void" /> + <argument index="0" name="filter" type="String" default="null" /> + <description> + </description> + </annotation> + <annotation name="@export_flags" qualifiers="vararg"> + <return type="void" /> + <argument index="0" name="names" type="String" /> + <description> + </description> + </annotation> + <annotation name="@export_flags_2d_navigation"> + <return type="void" /> + <description> + </description> + </annotation> + <annotation name="@export_flags_2d_physics"> + <return type="void" /> + <description> + </description> + </annotation> + <annotation name="@export_flags_2d_render"> + <return type="void" /> + <description> + </description> + </annotation> + <annotation name="@export_flags_3d_navigation"> + <return type="void" /> + <description> + </description> + </annotation> + <annotation name="@export_flags_3d_physics"> + <return type="void" /> + <description> + </description> + </annotation> + <annotation name="@export_flags_3d_render"> + <return type="void" /> + <description> + </description> + </annotation> + <annotation name="@export_global_dir"> + <return type="void" /> + <description> + </description> + </annotation> + <annotation name="@export_global_file" qualifiers="vararg"> + <return type="void" /> + <argument index="0" name="filter" type="String" default="null" /> + <description> + </description> + </annotation> + <annotation name="@export_group"> + <return type="void" /> + <argument index="0" name="name" type="String" /> + <argument index="1" name="prefix" type="String" default="null" /> + <description> + </description> + </annotation> + <annotation name="@export_multiline"> + <return type="void" /> + <description> + </description> + </annotation> + <annotation name="@export_node_path" qualifiers="vararg"> + <return type="void" /> + <argument index="0" name="type" type="String" default="null" /> + <description> + </description> + </annotation> + <annotation name="@export_placeholder"> + <return type="void" /> + <description> + </description> + </annotation> + <annotation name="@export_range"> + <return type="void" /> + <argument index="0" name="min" type="float" /> + <argument index="1" name="max" type="float" /> + <argument index="2" name="step" type="float" default="null" /> + <argument index="3" name="slider1" type="String" default="null" /> + <argument index="4" name="slider2" type="String" default="null" /> + <argument index="5" name="slider3" type="String" default="null" /> + <description> + </description> + </annotation> + <annotation name="@export_subgroup"> + <return type="void" /> + <argument index="0" name="name" type="String" /> + <argument index="1" name="prefix" type="String" default="null" /> + <description> + </description> + </annotation> + <annotation name="@icon"> + <return type="void" /> + <argument index="0" name="icon_path" type="String" /> + <description> + </description> + </annotation> + <annotation name="@onready"> + <return type="void" /> + <description> + </description> + </annotation> + <annotation name="@rpc" qualifiers="vararg"> + <return type="void" /> + <argument index="0" name="mode" type="String" default="null" /> + <argument index="1" name="sync" type="String" default="null" /> + <argument index="2" name="transfer_mode" type="String" default="null" /> + <argument index="3" name="transfer_channel" type="int" default="null" /> + <description> + </description> + </annotation> + <annotation name="@tool"> + <return type="void" /> + <description> + </description> + </annotation> + <annotation name="@warning_ignore" qualifiers="vararg"> + <return type="void" /> + <argument index="0" name="warning" type="String" /> + <description> + </description> + </annotation> + </annotations> </class> diff --git a/modules/gdscript/gdscript.cpp b/modules/gdscript/gdscript.cpp index e6aeef2fd1..bf83353ead 100644 --- a/modules/gdscript/gdscript.cpp +++ b/modules/gdscript/gdscript.cpp @@ -1050,7 +1050,7 @@ Error GDScript::load_source_code(const String &p_path) { w[len] = 0; String s; - if (s.parse_utf8((const char *)w)) { + if (s.parse_utf8((const char *)w) != OK) { ERR_FAIL_V_MSG(ERR_INVALID_DATA, "Script '" + p_path + "' contains invalid unicode (UTF-8), so it was not loaded. Please ensure that scripts are saved in valid UTF-8 unicode."); } diff --git a/modules/gdscript/gdscript.h b/modules/gdscript/gdscript.h index feb0a237df..e9a206f48b 100644 --- a/modules/gdscript/gdscript.h +++ b/modules/gdscript/gdscript.h @@ -489,6 +489,7 @@ public: virtual void get_public_functions(List<MethodInfo> *p_functions) const override; virtual void get_public_constants(List<Pair<String, Variant>> *p_constants) const override; + virtual void get_public_annotations(List<MethodInfo> *p_annotations) const override; virtual void profiling_start() override; virtual void profiling_stop() override; diff --git a/modules/gdscript/gdscript_analyzer.cpp b/modules/gdscript/gdscript_analyzer.cpp index ea994654bf..8b4c245bf6 100644 --- a/modules/gdscript/gdscript_analyzer.cpp +++ b/modules/gdscript/gdscript_analyzer.cpp @@ -655,43 +655,43 @@ void GDScriptAnalyzer::resolve_class_interface(GDScriptParser::ClassNode *p_clas } else { ERR_PRINT("Parser bug (please report): tried to assign unset node without an identifier."); } - } else { - if (member.variable->datatype_specifier != nullptr) { - datatype = specified_type; + } - if (member.variable->initializer != nullptr) { - if (!is_type_compatible(datatype, member.variable->initializer->get_datatype(), true, member.variable->initializer)) { - // Try reverse test since it can be a masked subtype. - if (!is_type_compatible(member.variable->initializer->get_datatype(), datatype, true, member.variable->initializer)) { - push_error(vformat(R"(Value of type "%s" cannot be assigned to a variable of type "%s".)", member.variable->initializer->get_datatype().to_string(), datatype.to_string()), member.variable->initializer); - } else { - // TODO: Add warning. - mark_node_unsafe(member.variable->initializer); - member.variable->use_conversion_assign = true; - } - } else if (datatype.builtin_type == Variant::INT && member.variable->initializer->get_datatype().builtin_type == Variant::FLOAT) { -#ifdef DEBUG_ENABLED - parser->push_warning(member.variable->initializer, GDScriptWarning::NARROWING_CONVERSION); -#endif - } - if (member.variable->initializer->get_datatype().is_variant()) { - // TODO: Warn unsafe assign. + if (member.variable->datatype_specifier != nullptr) { + datatype = specified_type; + + if (member.variable->initializer != nullptr) { + if (!is_type_compatible(datatype, member.variable->initializer->get_datatype(), true, member.variable->initializer)) { + // Try reverse test since it can be a masked subtype. + if (!is_type_compatible(member.variable->initializer->get_datatype(), datatype, true, member.variable->initializer)) { + push_error(vformat(R"(Value of type "%s" cannot be assigned to a variable of type "%s".)", member.variable->initializer->get_datatype().to_string(), datatype.to_string()), member.variable->initializer); + } else { + // TODO: Add warning. mark_node_unsafe(member.variable->initializer); member.variable->use_conversion_assign = true; } + } else if (datatype.builtin_type == Variant::INT && member.variable->initializer->get_datatype().builtin_type == Variant::FLOAT) { +#ifdef DEBUG_ENABLED + parser->push_warning(member.variable->initializer, GDScriptWarning::NARROWING_CONVERSION); +#endif } - } else if (member.variable->infer_datatype) { - if (member.variable->initializer == nullptr) { - push_error(vformat(R"(Cannot infer the type of "%s" variable because there's no default value.)", member.variable->identifier->name), member.variable->identifier); - } else if (!datatype.is_set() || datatype.has_no_type()) { - push_error(vformat(R"(Cannot infer the type of "%s" variable because the initial value doesn't have a set type.)", member.variable->identifier->name), member.variable->initializer); - } else if (datatype.is_variant()) { - push_error(vformat(R"(Cannot infer the type of "%s" variable because the initial value is Variant. Use explicit "Variant" type if this is intended.)", member.variable->identifier->name), member.variable->initializer); - } else if (datatype.builtin_type == Variant::NIL) { - push_error(vformat(R"(Cannot infer the type of "%s" variable because the initial value is "null".)", member.variable->identifier->name), member.variable->initializer); + if (member.variable->initializer->get_datatype().is_variant()) { + // TODO: Warn unsafe assign. + mark_node_unsafe(member.variable->initializer); + member.variable->use_conversion_assign = true; } - datatype.type_source = GDScriptParser::DataType::ANNOTATED_INFERRED; } + } else if (member.variable->infer_datatype) { + if (member.variable->initializer == nullptr) { + push_error(vformat(R"(Cannot infer the type of "%s" variable because there's no default value.)", member.variable->identifier->name), member.variable->identifier); + } else if (!datatype.is_set() || datatype.has_no_type()) { + push_error(vformat(R"(Cannot infer the type of "%s" variable because the initial value doesn't have a set type.)", member.variable->identifier->name), member.variable->initializer); + } else if (datatype.is_variant()) { + push_error(vformat(R"(Cannot infer the type of "%s" variable because the initial value is Variant. Use explicit "Variant" type if this is intended.)", member.variable->identifier->name), member.variable->initializer); + } else if (datatype.builtin_type == Variant::NIL) { + push_error(vformat(R"(Cannot infer the type of "%s" variable because the initial value is "null".)", member.variable->identifier->name), member.variable->initializer); + } + datatype.type_source = GDScriptParser::DataType::ANNOTATED_INFERRED; } datatype.is_constant = false; @@ -860,6 +860,9 @@ void GDScriptAnalyzer::resolve_class_interface(GDScriptParser::ClassNode *p_clas case GDScriptParser::ClassNode::Member::CLASS: check_class_member_name_conflict(p_class, member.m_class->identifier->name, member.m_class); break; + case GDScriptParser::ClassNode::Member::GROUP: + // No-op, but needed to silence warnings. + break; case GDScriptParser::ClassNode::Member::UNDEFINED: ERR_PRINT("Trying to resolve undefined member."); break; diff --git a/modules/gdscript/gdscript_cache.cpp b/modules/gdscript/gdscript_cache.cpp index 4c15fca91e..48d5fbc569 100644 --- a/modules/gdscript/gdscript_cache.cpp +++ b/modules/gdscript/gdscript_cache.cpp @@ -157,7 +157,7 @@ String GDScriptCache::get_source_code(const String &p_path) { source_file.write[len] = 0; String source; - if (source.parse_utf8((const char *)source_file.ptr())) { + if (source.parse_utf8((const char *)source_file.ptr()) != OK) { ERR_FAIL_V_MSG("", "Script '" + p_path + "' contains invalid unicode (UTF-8), so it was not loaded. Please ensure that scripts are saved in valid UTF-8 unicode."); } return source; diff --git a/modules/gdscript/gdscript_compiler.cpp b/modules/gdscript/gdscript_compiler.cpp index 6055d3df33..af8e4b3746 100644 --- a/modules/gdscript/gdscript_compiler.cpp +++ b/modules/gdscript/gdscript_compiler.cpp @@ -2452,6 +2452,25 @@ Error GDScriptCompiler::_parse_class_level(GDScript *p_script, const GDScriptPar } #endif } break; + + case GDScriptParser::ClassNode::Member::GROUP: { + const GDScriptParser::AnnotationNode *annotation = member.annotation; + StringName name = annotation->export_info.name; + + // This is not a normal member, but we need this to keep indices in order. + GDScript::MemberInfo minfo; + minfo.index = p_script->member_indices.size(); + + PropertyInfo prop_info; + prop_info.name = name; + prop_info.usage = annotation->export_info.usage; + prop_info.hint_string = annotation->export_info.hint_string; + + p_script->member_info[name] = prop_info; + p_script->member_indices[name] = minfo; + p_script->members.insert(name); + } break; + default: break; // Nothing to do here. } diff --git a/modules/gdscript/gdscript_editor.cpp b/modules/gdscript/gdscript_editor.cpp index 474c8094f2..0a1e1a22fb 100644 --- a/modules/gdscript/gdscript_editor.cpp +++ b/modules/gdscript/gdscript_editor.cpp @@ -445,6 +445,16 @@ void GDScriptLanguage::get_public_constants(List<Pair<String, Variant>> *p_const p_constants->push_back(nan); } +void GDScriptLanguage::get_public_annotations(List<MethodInfo> *p_annotations) const { + GDScriptParser parser; + List<MethodInfo> annotations; + parser.get_annotation_list(&annotations); + + for (const MethodInfo &E : annotations) { + p_annotations->push_back(E); + } +} + String GDScriptLanguage::make_function(const String &p_class, const String &p_name, const PackedStringArray &p_args) const { #ifdef TOOLS_ENABLED bool th = EditorSettings::get_singleton()->get_setting("text_editor/completion/add_type_hints"); @@ -569,7 +579,7 @@ static int _get_enum_constant_location(StringName p_class, StringName p_enum_con // END LOCATION METHODS static String _get_visual_datatype(const PropertyInfo &p_info, bool p_is_arg = true) { - if (p_info.usage & PROPERTY_USAGE_CLASS_IS_ENUM) { + if (p_info.usage & (PROPERTY_USAGE_CLASS_IS_ENUM | PROPERTY_USAGE_CLASS_IS_BITFIELD)) { String enum_name = p_info.class_name; if (!enum_name.contains(".")) { return enum_name; @@ -950,6 +960,8 @@ static void _find_identifiers_in_class(const GDScriptParser::ClassNode *p_class, } option = ScriptLanguage::CodeCompletionOption(member.signal->identifier->name, ScriptLanguage::CODE_COMPLETION_KIND_SIGNAL, location); break; + case GDScriptParser::ClassNode::Member::GROUP: + break; // No-op, but silences warnings. case GDScriptParser::ClassNode::Member::UNDEFINED: break; } @@ -1292,7 +1304,7 @@ static GDScriptCompletionIdentifier _type_from_property(const PropertyInfo &p_pr return ci; } - if (p_property.usage & PROPERTY_USAGE_CLASS_IS_ENUM) { + if (p_property.usage & (PROPERTY_USAGE_CLASS_IS_ENUM | PROPERTY_USAGE_CLASS_IS_BITFIELD)) { ci.enumeration = p_property.class_name; } @@ -1843,7 +1855,7 @@ static bool _guess_identifier_type(GDScriptParser::CompletionContext &p_context, while (suite) { for (int i = 0; i < suite->statements.size(); i++) { - if (suite->statements[i]->start_line > p_context.current_line) { + if (suite->statements[i]->end_line >= p_context.current_line) { break; } @@ -1891,7 +1903,7 @@ static bool _guess_identifier_type(GDScriptParser::CompletionContext &p_context, suite = suite->parent_block; } - if (last_assigned_expression && last_assign_line != p_context.current_line) { + if (last_assigned_expression && last_assign_line < p_context.current_line) { GDScriptParser::CompletionContext c = p_context; c.current_line = last_assign_line; r_type.assigned_expression = last_assigned_expression; @@ -2028,7 +2040,10 @@ static bool _guess_identifier_type_from_base(GDScriptParser::CompletionContext & return true; case GDScriptParser::ClassNode::Member::VARIABLE: if (!is_static) { - if (member.variable->initializer) { + if (member.variable->get_datatype().is_set() && !member.variable->get_datatype().is_variant()) { + r_type.type = member.variable->get_datatype(); + return true; + } else if (member.variable->initializer) { const GDScriptParser::ExpressionNode *init = member.variable->initializer; if (init->is_constant) { r_type.value = init->reduced_value; @@ -2050,9 +2065,6 @@ static bool _guess_identifier_type_from_base(GDScriptParser::CompletionContext & r_type.type = init->get_datatype(); return true; } - } else if (member.variable->get_datatype().is_set() && !member.variable->get_datatype().is_variant()) { - r_type.type = member.variable->get_datatype(); - return true; } } // TODO: Check assignments in constructor. @@ -2082,6 +2094,8 @@ static bool _guess_identifier_type_from_base(GDScriptParser::CompletionContext & r_type.type.kind = GDScriptParser::DataType::CLASS; r_type.type.class_type = member.m_class; return true; + case GDScriptParser::ClassNode::Member::GROUP: + return false; // No-op, but silences warnings. case GDScriptParser::ClassNode::Member::UNDEFINED: return false; // Unreachable. } @@ -2407,7 +2421,7 @@ static void _find_call_arguments(GDScriptParser::CompletionContext &p_context, c if (p_argidx < method_args) { PropertyInfo arg_info = info.arguments[p_argidx]; - if (arg_info.usage & PROPERTY_USAGE_CLASS_IS_ENUM) { + if (arg_info.usage & (PROPERTY_USAGE_CLASS_IS_ENUM | PROPERTY_USAGE_CLASS_IS_BITFIELD)) { _find_enumeration_candidates(p_context, arg_info.class_name, r_result); } } @@ -3376,6 +3390,15 @@ static Error _lookup_symbol_from_base(const GDScriptParser::DataType &p_base, co return OK; } } break; + case GDScriptParser::COMPLETION_ANNOTATION: { + const String annotation_symbol = "@" + p_symbol; + if (parser.annotation_exists(annotation_symbol)) { + r_result.type = ScriptLanguage::LOOKUP_RESULT_CLASS_ANNOTATION; + r_result.class_name = "@GDScript"; + r_result.class_member = annotation_symbol; + return OK; + } + } break; default: { } } diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp index ca430b0f72..233da87aee 100644 --- a/modules/gdscript/gdscript_parser.cpp +++ b/modules/gdscript/gdscript_parser.cpp @@ -105,6 +105,10 @@ void GDScriptParser::get_annotation_list(List<MethodInfo> *r_annotations) const } } +bool GDScriptParser::annotation_exists(const String &p_annotation_name) const { + return valid_annotations.has(p_annotation_name); +} + GDScriptParser::GDScriptParser() { // Register valid annotations. // TODO: Should this be static? @@ -131,6 +135,11 @@ GDScriptParser::GDScriptParser() { register_annotation(MethodInfo("@export_flags_3d_render"), AnnotationInfo::VARIABLE, &GDScriptParser::export_annotations<PROPERTY_HINT_LAYERS_3D_RENDER, Variant::INT>); register_annotation(MethodInfo("@export_flags_3d_physics"), AnnotationInfo::VARIABLE, &GDScriptParser::export_annotations<PROPERTY_HINT_LAYERS_3D_PHYSICS, Variant::INT>); register_annotation(MethodInfo("@export_flags_3d_navigation"), AnnotationInfo::VARIABLE, &GDScriptParser::export_annotations<PROPERTY_HINT_LAYERS_3D_NAVIGATION, Variant::INT>); + // Export grouping annotations. + register_annotation(MethodInfo("@export_category", PropertyInfo(Variant::STRING, "name")), AnnotationInfo::STANDALONE, &GDScriptParser::export_group_annotations<PROPERTY_USAGE_CATEGORY>); + register_annotation(MethodInfo("@export_group", PropertyInfo(Variant::STRING, "name"), PropertyInfo(Variant::STRING, "prefix")), AnnotationInfo::STANDALONE, &GDScriptParser::export_group_annotations<PROPERTY_USAGE_GROUP>, 1); + register_annotation(MethodInfo("@export_subgroup", PropertyInfo(Variant::STRING, "name"), PropertyInfo(Variant::STRING, "prefix")), AnnotationInfo::STANDALONE, &GDScriptParser::export_group_annotations<PROPERTY_USAGE_SUBGROUP>, 1); + // Warning annotations. register_annotation(MethodInfo("@warning_ignore", PropertyInfo(Variant::STRING, "warning")), AnnotationInfo::CLASS | AnnotationInfo::VARIABLE | AnnotationInfo::SIGNAL | AnnotationInfo::CONSTANT | AnnotationInfo::FUNCTION | AnnotationInfo::STATEMENT, &GDScriptParser::warning_annotations, 0, true); // Networking. register_annotation(MethodInfo("@rpc", PropertyInfo(Variant::STRING, "mode"), PropertyInfo(Variant::STRING, "sync"), PropertyInfo(Variant::STRING, "transfer_mode"), PropertyInfo(Variant::INT, "transfer_channel")), AnnotationInfo::FUNCTION, &GDScriptParser::network_annotations<Multiplayer::RPC_MODE_AUTHORITY>, 4, true); @@ -519,9 +528,13 @@ void GDScriptParser::parse_program() { head = alloc_node<ClassNode>(); current_class = head; + // If we happen to parse an annotation before extends or class_name keywords, track it. + // @tool is allowed, but others should fail. + AnnotationNode *premature_annotation = nullptr; + if (match(GDScriptTokenizer::Token::ANNOTATION)) { - // Check for @tool annotation. - AnnotationNode *annotation = parse_annotation(AnnotationInfo::SCRIPT | AnnotationInfo::CLASS_LEVEL); + // Check for @tool, script-level, or standalone annotation. + AnnotationNode *annotation = parse_annotation(AnnotationInfo::SCRIPT | AnnotationInfo::STANDALONE | AnnotationInfo::CLASS_LEVEL); if (annotation != nullptr) { if (annotation->name == SNAME("@tool")) { // TODO: don't allow @tool anywhere else. (Should all script annotations be the first thing?). @@ -531,7 +544,14 @@ void GDScriptParser::parse_program() { } // @tool annotation has no specific target. annotation->apply(this, nullptr); + } else if (annotation->applies_to(AnnotationInfo::SCRIPT | AnnotationInfo::STANDALONE)) { + premature_annotation = annotation; + if (previous.type != GDScriptTokenizer::Token::NEWLINE) { + push_error(R"(Expected newline after a standalone annotation.)"); + } + annotation->apply(this, head); } else { + premature_annotation = annotation; annotation_stack.push_back(annotation); } } @@ -541,8 +561,8 @@ void GDScriptParser::parse_program() { // Order here doesn't matter, but there should be only one of each at most. switch (current.type) { case GDScriptTokenizer::Token::CLASS_NAME: - if (!annotation_stack.is_empty()) { - push_error(R"("class_name" should be used before annotations.)"); + if (premature_annotation != nullptr) { + push_error(R"("class_name" should be used before annotations (except @tool).)"); } advance(); if (head->identifier != nullptr) { @@ -552,8 +572,8 @@ void GDScriptParser::parse_program() { } break; case GDScriptTokenizer::Token::EXTENDS: - if (!annotation_stack.is_empty()) { - push_error(R"("extends" should be used before annotations.)"); + if (premature_annotation != nullptr) { + push_error(R"("extends" should be used before annotations (except @tool).)"); } advance(); if (head->extends_used) { @@ -574,12 +594,12 @@ void GDScriptParser::parse_program() { } if (match(GDScriptTokenizer::Token::ANNOTATION)) { - // Check for @icon annotation. - AnnotationNode *annotation = parse_annotation(AnnotationInfo::SCRIPT | AnnotationInfo::CLASS_LEVEL); + // Check for a script-level, or standalone annotation. + AnnotationNode *annotation = parse_annotation(AnnotationInfo::SCRIPT | AnnotationInfo::STANDALONE | AnnotationInfo::CLASS_LEVEL); if (annotation != nullptr) { - if (annotation->name == SNAME("@icon")) { + if (annotation->applies_to(AnnotationInfo::SCRIPT | AnnotationInfo::STANDALONE)) { if (previous.type != GDScriptTokenizer::Token::NEWLINE) { - push_error(R"(Expected newline after "@icon" annotation.)"); + push_error(R"(Expected newline after a standalone annotation.)"); } annotation->apply(this, head); } else { @@ -807,9 +827,18 @@ void GDScriptParser::parse_class_body(bool p_is_multiline) { break; case GDScriptTokenizer::Token::ANNOTATION: { advance(); - AnnotationNode *annotation = parse_annotation(AnnotationInfo::CLASS_LEVEL); + + // Check for class-level annotations. + AnnotationNode *annotation = parse_annotation(AnnotationInfo::STANDALONE | AnnotationInfo::CLASS_LEVEL); if (annotation != nullptr) { - annotation_stack.push_back(annotation); + if (annotation->applies_to(AnnotationInfo::STANDALONE)) { + if (previous.type != GDScriptTokenizer::Token::NEWLINE) { + push_error(R"(Expected newline after a standalone annotation.)"); + } + annotation->apply(this, head); + } else { + annotation_stack.push_back(annotation); + } } break; } @@ -1748,6 +1777,10 @@ GDScriptParser::ForNode *GDScriptParser::parse_for() { SuiteNode *suite = alloc_node<SuiteNode>(); if (n_for->variable) { + const SuiteNode::Local &local = current_suite->get_local(n_for->variable->name); + if (local.type != SuiteNode::Local::UNDEFINED) { + push_error(vformat(R"(There is already a %s named "%s" declared in this scope.)", local.get_name(), n_for->variable->name), n_for->variable); + } suite->add_local(SuiteNode::Local(n_for->variable, current_function)); } suite->parent_for = n_for; @@ -3662,6 +3695,36 @@ bool GDScriptParser::export_annotations(const AnnotationNode *p_annotation, Node return true; } +template <PropertyUsageFlags t_usage> +bool GDScriptParser::export_group_annotations(const AnnotationNode *p_annotation, Node *p_node) { + AnnotationNode *annotation = const_cast<AnnotationNode *>(p_annotation); + + annotation->export_info.name = annotation->resolved_arguments[0]; + + switch (t_usage) { + case PROPERTY_USAGE_CATEGORY: { + annotation->export_info.usage = t_usage; + } break; + + case PROPERTY_USAGE_GROUP: { + annotation->export_info.usage = t_usage; + if (annotation->resolved_arguments.size() == 2) { + annotation->export_info.hint_string = annotation->resolved_arguments[1]; + } + } break; + + case PROPERTY_USAGE_SUBGROUP: { + annotation->export_info.usage = t_usage; + if (annotation->resolved_arguments.size() == 2) { + annotation->export_info.hint_string = annotation->resolved_arguments[1]; + } + } break; + } + + current_class->add_member_group(annotation); + return true; +} + bool GDScriptParser::warning_annotations(const AnnotationNode *p_annotation, Node *p_node) { #ifdef DEBUG_ENABLED bool has_error = false; @@ -4145,6 +4208,8 @@ void GDScriptParser::TreePrinter::print_class(ClassNode *p_class) { break; case ClassNode::Member::ENUM_VALUE: break; // Nothing. Will be printed by enum. + case ClassNode::Member::GROUP: + break; // Nothing. Groups are only used by inspector. case ClassNode::Member::UNDEFINED: push_line("<unknown member>"); break; diff --git a/modules/gdscript/gdscript_parser.h b/modules/gdscript/gdscript_parser.h index e3f8d4b8ba..8d3295f25b 100644 --- a/modules/gdscript/gdscript_parser.h +++ b/modules/gdscript/gdscript_parser.h @@ -325,6 +325,7 @@ public: Vector<Variant> resolved_arguments; AnnotationInfo *info = nullptr; + PropertyInfo export_info; bool apply(GDScriptParser *p_this, Node *p_target) const; bool applies_to(uint32_t p_target_kinds) const; @@ -500,6 +501,7 @@ public: VARIABLE, ENUM, ENUM_VALUE, // For unnamed enums. + GROUP, // For member grouping. }; Type type = UNDEFINED; @@ -511,6 +513,7 @@ public: SignalNode *signal; VariableNode *variable; EnumNode *m_enum; + AnnotationNode *annotation; }; EnumNode::Value enum_value; @@ -532,6 +535,8 @@ public: return "enum"; case ENUM_VALUE: return "enum value"; + case GROUP: + return "group"; } return ""; } @@ -552,6 +557,8 @@ public: return m_enum->start_line; case SIGNAL: return signal->start_line; + case GROUP: + return annotation->start_line; case UNDEFINED: ERR_FAIL_V_MSG(-1, "Reaching undefined member type."); } @@ -586,6 +593,9 @@ public: // TODO: Add parameter info. return type; } + case GROUP: { + return DataType(); + } case UNDEFINED: return DataType(); } @@ -622,6 +632,10 @@ public: type = ENUM_VALUE; enum_value = p_enum_value; } + Member(AnnotationNode *p_annotation) { + type = GROUP; + annotation = p_annotation; + } }; IdentifierNode *identifier = nullptr; @@ -668,6 +682,10 @@ public: members_indices[p_enum_value.identifier->name] = members.size(); members.push_back(Member(p_enum_value)); } + void add_member_group(AnnotationNode *p_annotation_node) { + members_indices[p_annotation_node->export_info.name] = members.size(); + members.push_back(Member(p_annotation_node)); + } ClassNode() { type = CLASS; @@ -1238,6 +1256,7 @@ private: SIGNAL = 1 << 4, FUNCTION = 1 << 5, STATEMENT = 1 << 6, + STANDALONE = 1 << 7, CLASS_LEVEL = CLASS | VARIABLE | FUNCTION, }; uint32_t target_kind = 0; // Flags. @@ -1348,6 +1367,8 @@ private: bool onready_annotation(const AnnotationNode *p_annotation, Node *p_target); template <PropertyHint t_hint, Variant::Type t_type> bool export_annotations(const AnnotationNode *p_annotation, Node *p_target); + template <PropertyUsageFlags t_usage> + bool export_group_annotations(const AnnotationNode *p_annotation, Node *p_target); bool warning_annotations(const AnnotationNode *p_annotation, Node *p_target); template <Multiplayer::RPCMode t_mode> bool network_annotations(const AnnotationNode *p_annotation, Node *p_target); @@ -1413,6 +1434,7 @@ public: CompletionContext get_completion_context() const { return completion_context; } CompletionCall get_completion_call() const { return completion_call; } void get_annotation_list(List<MethodInfo> *r_annotations) const; + bool annotation_exists(const String &p_annotation_name) const; const List<ParserError> &get_errors() const { return errors; } const List<String> get_dependencies() const { diff --git a/modules/gdscript/language_server/gdscript_extend_parser.cpp b/modules/gdscript/language_server/gdscript_extend_parser.cpp index d3c5fed95a..03e93821c7 100644 --- a/modules/gdscript/language_server/gdscript_extend_parser.cpp +++ b/modules/gdscript/language_server/gdscript_extend_parser.cpp @@ -307,6 +307,8 @@ void ExtendGDScriptParser::parse_class_symbol(const GDScriptParser::ClassNode *p parse_class_symbol(m.m_class, symbol); r_symbol.children.push_back(symbol); } break; + case ClassNode::Member::GROUP: + break; // No-op, but silences warnings. case ClassNode::Member::UNDEFINED: break; // Unreachable. } @@ -815,6 +817,8 @@ Dictionary ExtendGDScriptParser::dump_class_api(const GDScriptParser::ClassNode methods.append(dump_function_api(m.function)); } } break; + case ClassNode::Member::GROUP: + break; // No-op, but silences warnings. case ClassNode::Member::UNDEFINED: break; // Unreachable. } diff --git a/modules/gdscript/tests/scripts/parser/errors/class_name_after_annotation.gd b/modules/gdscript/tests/scripts/parser/errors/class_name_after_annotation.gd index d13d713454..ada6030132 100644 --- a/modules/gdscript/tests/scripts/parser/errors/class_name_after_annotation.gd +++ b/modules/gdscript/tests/scripts/parser/errors/class_name_after_annotation.gd @@ -1,6 +1,6 @@ -# Error here. `class_name` should be used *before* annotations, not after. +# Error here. `class_name` should be used *before* annotations, not after (except @tool). @icon("res://path/to/optional/icon.svg") class_name HelloWorld func test(): - pass + pass diff --git a/modules/gdscript/tests/scripts/parser/errors/class_name_after_annotation.out b/modules/gdscript/tests/scripts/parser/errors/class_name_after_annotation.out index 0bcc8acc55..02b33c8692 100644 --- a/modules/gdscript/tests/scripts/parser/errors/class_name_after_annotation.out +++ b/modules/gdscript/tests/scripts/parser/errors/class_name_after_annotation.out @@ -1,2 +1,2 @@ GDTEST_PARSER_ERROR -"class_name" should be used before annotations. +"class_name" should be used before annotations (except @tool). diff --git a/modules/gdscript/tests/scripts/parser/errors/variable_conflicts_for_variable.gd b/modules/gdscript/tests/scripts/parser/errors/variable_conflicts_for_variable.gd new file mode 100644 index 0000000000..409da11051 --- /dev/null +++ b/modules/gdscript/tests/scripts/parser/errors/variable_conflicts_for_variable.gd @@ -0,0 +1,4 @@ +func test(): + var TEST = 1 + for TEST in 2: + pass diff --git a/modules/gdscript/tests/scripts/parser/errors/variable_conflicts_for_variable.out b/modules/gdscript/tests/scripts/parser/errors/variable_conflicts_for_variable.out new file mode 100644 index 0000000000..407f094ca0 --- /dev/null +++ b/modules/gdscript/tests/scripts/parser/errors/variable_conflicts_for_variable.out @@ -0,0 +1,2 @@ +GDTEST_PARSER_ERROR +There is already a variable named "TEST" declared in this scope. diff --git a/modules/gdscript/tests/scripts/parser/errors/variable_conflicts_variable.gd b/modules/gdscript/tests/scripts/parser/errors/variable_conflicts_variable.gd new file mode 100644 index 0000000000..b353fd1288 --- /dev/null +++ b/modules/gdscript/tests/scripts/parser/errors/variable_conflicts_variable.gd @@ -0,0 +1,3 @@ +func test(): + var TEST = 1 + var TEST = 2 diff --git a/modules/gdscript/tests/scripts/parser/errors/variable_conflicts_variable.out b/modules/gdscript/tests/scripts/parser/errors/variable_conflicts_variable.out new file mode 100644 index 0000000000..407f094ca0 --- /dev/null +++ b/modules/gdscript/tests/scripts/parser/errors/variable_conflicts_variable.out @@ -0,0 +1,2 @@ +GDTEST_PARSER_ERROR +There is already a variable named "TEST" declared in this scope. diff --git a/modules/gltf/gltf_document.cpp b/modules/gltf/gltf_document.cpp index 36d985eff3..e8036098cb 100644 --- a/modules/gltf/gltf_document.cpp +++ b/modules/gltf/gltf_document.cpp @@ -5176,19 +5176,16 @@ Node3D *GLTFDocument::_generate_light(Ref<GLTFState> state, const GLTFNodeIndex } const float range = CLAMP(l->range, 0, 4096); - // Doubling the range will double the effective brightness, so we need double attenuation (half brightness). - // We want to have double intensity give double brightness, so we need half the attenuation. - const float attenuation = range / (intensity * 2048); if (l->light_type == "point") { OmniLight3D *light = memnew(OmniLight3D); - light->set_param(OmniLight3D::PARAM_ATTENUATION, attenuation); + light->set_param(OmniLight3D::PARAM_ENERGY, intensity); light->set_param(OmniLight3D::PARAM_RANGE, range); light->set_color(l->color); return light; } if (l->light_type == "spot") { SpotLight3D *light = memnew(SpotLight3D); - light->set_param(SpotLight3D::PARAM_ATTENUATION, attenuation); + light->set_param(SpotLight3D::PARAM_ENERGY, intensity); light->set_param(SpotLight3D::PARAM_RANGE, range); light->set_param(SpotLight3D::PARAM_SPOT_ANGLE, Math::rad2deg(l->outer_cone_angle)); light->set_color(l->color); @@ -5253,14 +5250,12 @@ GLTFLightIndex GLTFDocument::_convert_light(Ref<GLTFState> state, Light3D *p_lig l->light_type = "point"; OmniLight3D *light = cast_to<OmniLight3D>(p_light); l->range = light->get_param(OmniLight3D::PARAM_RANGE); - float attenuation = p_light->get_param(OmniLight3D::PARAM_ATTENUATION); - l->intensity = l->range / (attenuation * 2048); + l->intensity = light->get_param(OmniLight3D::PARAM_ENERGY); } else if (cast_to<SpotLight3D>(p_light)) { l->light_type = "spot"; SpotLight3D *light = cast_to<SpotLight3D>(p_light); l->range = light->get_param(SpotLight3D::PARAM_RANGE); - float attenuation = light->get_param(SpotLight3D::PARAM_ATTENUATION); - l->intensity = l->range / (attenuation * 2048); + l->intensity = light->get_param(SpotLight3D::PARAM_ENERGY); l->outer_cone_angle = Math::deg2rad(light->get_param(SpotLight3D::PARAM_SPOT_ANGLE)); // This equation is the inverse of the import equation (which has a desmos link). diff --git a/modules/mono/build_scripts/make_android_mono_config.py b/modules/mono/build_scripts/make_android_mono_config.py index 1920ef1c1a..3459244bc2 100644 --- a/modules/mono/build_scripts/make_android_mono_config.py +++ b/modules/mono/build_scripts/make_android_mono_config.py @@ -43,7 +43,7 @@ String get_godot_android_mono_config() { Compression::decompress(w, config_uncompressed_size, config_compressed_data, config_compressed_size, Compression::MODE_DEFLATE); String s; - if (s.parse_utf8((const char *)w, data.size())) { + if (s.parse_utf8((const char *)w, data.size()) != OK) { ERR_FAIL_V(String()); } return s; diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp index 622838b308..3dc26cfbe4 100644 --- a/modules/mono/csharp_script.cpp +++ b/modules/mono/csharp_script.cpp @@ -2866,6 +2866,12 @@ int CSharpScript::_try_get_member_export_hint(IMonoClassMember *p_member, Manage r_hint = PROPERTY_HINT_RESOURCE_TYPE; r_hint_string = String(NATIVE_GDMONOCLASS_NAME(field_native_class)); + } else if (p_variant_type == Variant::OBJECT && CACHED_CLASS(Node)->is_assignable_from(p_type.type_class)) { + GDMonoClass *field_native_class = GDMonoUtils::get_class_native_base(p_type.type_class); + CRASH_COND(field_native_class == nullptr); + + r_hint = PROPERTY_HINT_NODE_TYPE; + r_hint_string = String(NATIVE_GDMONOCLASS_NAME(field_native_class)); } else if (p_allow_generics && p_variant_type == Variant::ARRAY) { // Nested arrays are not supported in the inspector @@ -3063,16 +3069,11 @@ void CSharpScript::update_script_class_info(Ref<CSharpScript> p_script) { Vector<GDMonoMethod *> methods = top->get_all_methods(); for (int i = 0; i < methods.size(); i++) { if (!methods[i]->is_static()) { - Multiplayer::RPCMode mode = p_script->_member_get_rpc_mode(methods[i]); - if (Multiplayer::RPC_MODE_DISABLED != mode) { - Multiplayer::RPCConfig nd; - nd.name = methods[i]->get_name(); - nd.rpc_mode = mode; - // TODO Transfer mode, channel - nd.transfer_mode = Multiplayer::TRANSFER_MODE_RELIABLE; - nd.channel = 0; - if (-1 == p_script->rpc_functions.find(nd)) { - p_script->rpc_functions.push_back(nd); + Multiplayer::RPCConfig rpc_config = p_script->_member_get_rpc_config(methods[i]); + if (rpc_config.rpc_mode != Multiplayer::RPC_MODE_DISABLED) { + // RPC annotations can only be used once per method + if (p_script->rpc_functions.find(rpc_config) == -1) { + p_script->rpc_functions.push_back(rpc_config); } } } @@ -3507,15 +3508,19 @@ int CSharpScript::get_member_line(const StringName &p_member) const { return -1; } -Multiplayer::RPCMode CSharpScript::_member_get_rpc_mode(IMonoClassMember *p_member) const { - if (p_member->has_attribute(CACHED_CLASS(AnyPeerAttribute))) { - return Multiplayer::RPC_MODE_ANY_PEER; - } - if (p_member->has_attribute(CACHED_CLASS(AuthorityAttribute))) { - return Multiplayer::RPC_MODE_AUTHORITY; +Multiplayer::RPCConfig CSharpScript::_member_get_rpc_config(IMonoClassMember *p_member) const { + Multiplayer::RPCConfig rpc_config; + + MonoObject *rpc_attribute = p_member->get_attribute(CACHED_CLASS(RPCAttribute)); + if (rpc_attribute != nullptr) { + rpc_config.name = p_member->get_name(); + rpc_config.rpc_mode = (Multiplayer::RPCMode)CACHED_PROPERTY(RPCAttribute, Mode)->get_int_value(rpc_attribute); + rpc_config.call_local = CACHED_PROPERTY(RPCAttribute, CallLocal)->get_bool_value(rpc_attribute); + rpc_config.transfer_mode = (Multiplayer::TransferMode)CACHED_PROPERTY(RPCAttribute, TransferMode)->get_int_value(rpc_attribute); + rpc_config.channel = CACHED_PROPERTY(RPCAttribute, TransferChannel)->get_int_value(rpc_attribute); } - return Multiplayer::RPC_MODE_DISABLED; + return rpc_config; } const Vector<Multiplayer::RPCConfig> CSharpScript::get_rpc_methods() const { diff --git a/modules/mono/csharp_script.h b/modules/mono/csharp_script.h index 69bd8703aa..b17473470f 100644 --- a/modules/mono/csharp_script.h +++ b/modules/mono/csharp_script.h @@ -179,7 +179,7 @@ private: static void update_script_class_info(Ref<CSharpScript> p_script); static void initialize_for_managed_type(Ref<CSharpScript> p_script, GDMonoClass *p_class, GDMonoClass *p_native); - Multiplayer::RPCMode _member_get_rpc_mode(IMonoClassMember *p_member) const; + Multiplayer::RPCConfig _member_get_rpc_config(IMonoClassMember *p_member) const; protected: static void _bind_methods(); @@ -502,6 +502,7 @@ public: /* TODO? */ void get_public_functions(List<MethodInfo> *p_functions) const override {} /* TODO? */ void get_public_constants(List<Pair<String, Variant>> *p_constants) const override {} + /* TODO? */ void get_public_annotations(List<MethodInfo> *p_annotations) const override {} void reload_all_scripts() override; void reload_tool_script(const Ref<Script> &p_script, bool p_soft_reload) override; diff --git a/modules/mono/editor/GodotTools/GodotTools/Build/NuGetUtils.cs b/modules/mono/editor/GodotTools/GodotTools/Build/NuGetUtils.cs index 16dd1c8c6b..63b97e981e 100644 --- a/modules/mono/editor/GodotTools/GodotTools/Build/NuGetUtils.cs +++ b/modules/mono/editor/GodotTools/GodotTools/Build/NuGetUtils.cs @@ -99,7 +99,7 @@ namespace GodotTools.Build if (Utils.OS.IsWindows) { // %APPDATA% for both - return new[] {Path.Combine(applicationData, "NuGet", "NuGet.Config")}; + return new[] { Path.Combine(applicationData, "NuGet", "NuGet.Config") }; } var paths = new string[2]; @@ -156,6 +156,7 @@ namespace GodotTools.Build </packageSources> </configuration> "; + System.IO.Directory.CreateDirectory(Path.GetDirectoryName(nuGetConfigPath)); System.IO.File.WriteAllText(nuGetConfigPath, defaultConfig, Encoding.UTF8); // UTF-8 with BOM } diff --git a/modules/mono/editor/bindings_generator.cpp b/modules/mono/editor/bindings_generator.cpp index 9d3d481068..7cc195201b 100644 --- a/modules/mono/editor/bindings_generator.cpp +++ b/modules/mono/editor/bindings_generator.cpp @@ -990,6 +990,10 @@ void BindingsGenerator::_generate_global_constants(StringBuilder &p_output) { p_output.append("\n" INDENT1 OPEN_BLOCK); } + if (ienum.is_flags) { + p_output.append("\n" INDENT1 "[System.Flags]"); + } + p_output.append("\n" INDENT1 "public enum "); p_output.append(enum_proxy_name); p_output.append(" : long"); @@ -1434,6 +1438,10 @@ Error BindingsGenerator::_generate_cs_type(const TypeInterface &itype, const Str for (const EnumInterface &ienum : itype.enums) { ERR_FAIL_COND_V(ienum.constants.is_empty(), ERR_BUG); + if (ienum.is_flags) { + output.append(MEMBER_BEGIN "[System.Flags]"); + } + output.append(MEMBER_BEGIN "public enum "); output.append(ienum.cname.operator String()); output.append(" : long"); @@ -2865,7 +2873,7 @@ bool BindingsGenerator::_populate_object_type_interfaces() { " We only expected Object.free, but found '" + itype.name + "." + imethod.name + "'."); } - } else if (return_info.type == Variant::INT && return_info.usage & PROPERTY_USAGE_CLASS_IS_ENUM) { + } else if (return_info.type == Variant::INT && return_info.usage & (PROPERTY_USAGE_CLASS_IS_ENUM | PROPERTY_USAGE_CLASS_IS_BITFIELD)) { imethod.return_type.cname = return_info.class_name; imethod.return_type.is_enum = true; } else if (return_info.class_name != StringName()) { @@ -2903,7 +2911,7 @@ bool BindingsGenerator::_populate_object_type_interfaces() { ArgumentInterface iarg; iarg.name = orig_arg_name; - if (arginfo.type == Variant::INT && arginfo.usage & PROPERTY_USAGE_CLASS_IS_ENUM) { + if (arginfo.type == Variant::INT && arginfo.usage & (PROPERTY_USAGE_CLASS_IS_ENUM | PROPERTY_USAGE_CLASS_IS_BITFIELD)) { iarg.type.cname = arginfo.class_name; iarg.type.is_enum = true; } else if (arginfo.class_name != StringName()) { @@ -3011,7 +3019,7 @@ bool BindingsGenerator::_populate_object_type_interfaces() { ArgumentInterface iarg; iarg.name = orig_arg_name; - if (arginfo.type == Variant::INT && arginfo.usage & PROPERTY_USAGE_CLASS_IS_ENUM) { + if (arginfo.type == Variant::INT && arginfo.usage & (PROPERTY_USAGE_CLASS_IS_ENUM | PROPERTY_USAGE_CLASS_IS_BITFIELD)) { iarg.type.cname = arginfo.class_name; iarg.type.is_enum = true; } else if (arginfo.class_name != StringName()) { @@ -3075,9 +3083,9 @@ bool BindingsGenerator::_populate_object_type_interfaces() { List<String> constants; ClassDB::get_integer_constant_list(type_cname, &constants, true); - const HashMap<StringName, List<StringName>> &enum_map = class_info->enum_map; + const HashMap<StringName, ClassDB::ClassInfo::EnumInfo> &enum_map = class_info->enum_map; - for (const KeyValue<StringName, List<StringName>> &E : enum_map) { + for (const KeyValue<StringName, ClassDB::ClassInfo::EnumInfo> &E : enum_map) { StringName enum_proxy_cname = E.key; String enum_proxy_name = enum_proxy_cname.operator String(); if (itype.find_property_by_proxy_name(enum_proxy_cname)) { @@ -3087,7 +3095,8 @@ bool BindingsGenerator::_populate_object_type_interfaces() { enum_proxy_cname = StringName(enum_proxy_name); } EnumInterface ienum(enum_proxy_cname); - const List<StringName> &enum_constants = E.value; + ienum.is_flags = E.value.is_bitfield; + const List<StringName> &enum_constants = E.value.constants; for (const StringName &constant_cname : enum_constants) { String constant_name = constant_cname.operator String(); int64_t *value = class_info->constant_map.getptr(constant_cname); @@ -3676,6 +3685,7 @@ void BindingsGenerator::_populate_global_constants() { if (enum_name != StringName()) { EnumInterface ienum(enum_name); + // TODO: ienum.is_flags is always false for core constants since they don't seem to support bitfield enums List<EnumInterface>::Element *enum_match = global_enums.find(ienum); if (enum_match) { enum_match->get().constants.push_back(iconstant); diff --git a/modules/mono/editor/bindings_generator.h b/modules/mono/editor/bindings_generator.h index 70c4f12146..1547d0ed2f 100644 --- a/modules/mono/editor/bindings_generator.h +++ b/modules/mono/editor/bindings_generator.h @@ -60,6 +60,7 @@ class BindingsGenerator { struct EnumInterface { StringName cname; List<ConstantInterface> constants; + bool is_flags = false; _FORCE_INLINE_ bool operator==(const EnumInterface &p_ienum) const { return p_ienum.cname == cname; diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Attributes/RPCAttribute.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Attributes/RPCAttribute.cs new file mode 100644 index 0000000000..0a1c8322d7 --- /dev/null +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Attributes/RPCAttribute.cs @@ -0,0 +1,43 @@ +using System; + +namespace Godot +{ + /// <summary> + /// Attribute that changes the RPC mode for the annotated <c>method</c> to the given <see cref="Mode"/>, + /// optionally specifying the <see cref="TransferMode"/> and <see cref="TransferChannel"/> (on supported peers). + /// See <see cref="RPCMode"/> and <see cref="TransferMode"/>. By default, methods are not exposed to networking + /// (and RPCs). + /// </summary> + [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)] + public class RPCAttribute : Attribute + { + /// <summary> + /// RPC mode for the annotated method. + /// </summary> + public RPCMode Mode { get; } = RPCMode.Disabled; + + /// <summary> + /// If the method will also be called locally; otherwise, it is only called remotely. + /// </summary> + public bool CallLocal { get; set; } = false; + + /// <summary> + /// Transfer mode for the annotated method. + /// </summary> + public TransferMode TransferMode { get; set; } = TransferMode.Reliable; + + /// <summary> + /// Transfer channel for the annotated mode. + /// </summary> + public int TransferChannel { get; set; } = 0; + + /// <summary> + /// Constructs a <see cref="RPCAttribute"/> instance. + /// </summary> + /// <param name="mode">The RPC mode to use.</param> + public RPCAttribute(RPCMode mode = RPCMode.Authority) + { + Mode = mode; + } + } +} diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Attributes/RPCAttributes.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Attributes/RPCAttributes.cs deleted file mode 100644 index f0d37c344d..0000000000 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Attributes/RPCAttributes.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; - -namespace Godot -{ - /// <summary> - /// Constructs a new AnyPeerAttribute instance. Members with the AnyPeerAttribute are given authority over their own player. - /// </summary> - [AttributeUsage(AttributeTargets.Method)] - public class AnyPeerAttribute : Attribute { } - - /// <summary> - /// Constructs a new AuthorityAttribute instance. Members with the AuthorityAttribute are given authority over the game. - /// </summary> - [AttributeUsage(AttributeTargets.Method)] - public class AuthorityAttribute : Attribute { } -} diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Mathf.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Mathf.cs index 2b820070d6..36b7d0f80f 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Mathf.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Mathf.cs @@ -198,6 +198,28 @@ namespace Godot } /// <summary> + /// Returns the point at the given <paramref name="t"/> on a one-dimensional Bezier curve defined by + /// the given <paramref name="control1"/>, <paramref name="control2"/> and <paramref name="end"/> points. + /// </summary> + /// <param name="start">The start value for the interpolation.</param> + /// <param name="control1">Control point that defines the bezier curve.</param> + /// <param name="control2">Control point that defines the bezier curve.</param> + /// <param name="end">The destination value for the interpolation.</param> + /// <param name="t">A value on the range of 0.0 to 1.0, representing the amount of interpolation.</param> + /// <returns>The resulting value of the interpolation.</returns> + public static real_t BezierInterpolate(real_t start, real_t control1, real_t control2, real_t end, real_t t) + { + // Formula from Wikipedia article on Bezier curves + real_t omt = 1 - t; + real_t omt2 = omt * omt; + real_t omt3 = omt2 * omt; + real_t t2 = t * t; + real_t t3 = t2 * t; + + return start * omt3 + control1 * omt2 * t * 3 + control2 * omt * t2 * 3 + end * t3; + } + + /// <summary> /// Converts an angle expressed in degrees to radians. /// </summary> /// <param name="deg">An angle expressed in degrees.</param> diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector2.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector2.cs index 9e990ce83e..7bdbe1c28b 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector2.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector2.cs @@ -221,6 +221,27 @@ namespace Godot } /// <summary> + /// Returns the point at the given <paramref name="t"/> on a one-dimensional Bezier curve defined by this vector + /// and the given <paramref name="control1"/>, <paramref name="control2"/> and <paramref name="end"/> points. + /// </summary> + /// <param name="control1">Control point that defines the bezier curve.</param> + /// <param name="control2">Control point that defines the bezier curve.</param> + /// <param name="end">The destination vector.</param> + /// <param name="t">A value on the range of 0.0 to 1.0, representing the amount of interpolation.</param> + /// <returns>The interpolated vector.</returns> + public Vector2 BezierInterpolate(Vector2 control1, Vector2 control2, Vector2 end, real_t t) + { + // Formula from Wikipedia article on Bezier curves + real_t omt = 1 - t; + real_t omt2 = omt * omt; + real_t omt3 = omt2 * omt; + real_t t2 = t * t; + real_t t3 = t2 * t; + + return this * omt3 + control1 * omt2 * t * 3 + control2 * omt * t2 * 3 + end * t3; + } + + /// <summary> /// Returns the normalized vector pointing from this vector to <paramref name="to"/>. /// </summary> /// <param name="to">The other vector to point towards.</param> @@ -522,9 +543,10 @@ namespace Godot { real_t startLengthSquared = LengthSquared(); real_t endLengthSquared = to.LengthSquared(); - if (startLengthSquared == 0.0 || endLengthSquared == 0.0) { - // Zero length vectors have no angle, so the best we can do is either lerp or throw an error. - return Lerp(to, weight); + if (startLengthSquared == 0.0 || endLengthSquared == 0.0) + { + // Zero length vectors have no angle, so the best we can do is either lerp or throw an error. + return Lerp(to, weight); } real_t startLength = Mathf.Sqrt(startLengthSquared); real_t resultLength = Mathf.Lerp(startLength, Mathf.Sqrt(endLengthSquared), weight); diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector3.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector3.cs index 56859da7f2..480165d44a 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector3.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector3.cs @@ -214,6 +214,27 @@ namespace Godot } /// <summary> + /// Returns the point at the given <paramref name="t"/> on a one-dimensional Bezier curve defined by this vector + /// and the given <paramref name="control1"/>, <paramref name="control2"/> and <paramref name="end"/> points. + /// </summary> + /// <param name="control1">Control point that defines the bezier curve.</param> + /// <param name="control2">Control point that defines the bezier curve.</param> + /// <param name="end">The destination vector.</param> + /// <param name="t">A value on the range of 0.0 to 1.0, representing the amount of interpolation.</param> + /// <returns>The interpolated vector.</returns> + public Vector3 BezierInterpolate(Vector3 control1, Vector3 control2, Vector3 end, real_t t) + { + // Formula from Wikipedia article on Bezier curves + real_t omt = 1 - t; + real_t omt2 = omt * omt; + real_t omt3 = omt2 * omt; + real_t t2 = t * t; + real_t t3 = t2 * t; + + return this * omt3 + control1 * omt2 * t * 3 + control2 * omt * t2 * 3 + end * t3; + } + + /// <summary> /// Returns the normalized vector pointing from this vector to <paramref name="to"/>. /// </summary> /// <param name="to">The other vector to point towards.</param> @@ -562,9 +583,10 @@ namespace Godot { real_t startLengthSquared = LengthSquared(); real_t endLengthSquared = to.LengthSquared(); - if (startLengthSquared == 0.0 || endLengthSquared == 0.0) { - // Zero length vectors have no angle, so the best we can do is either lerp or throw an error. - return Lerp(to, weight); + if (startLengthSquared == 0.0 || endLengthSquared == 0.0) + { + // Zero length vectors have no angle, so the best we can do is either lerp or throw an error. + return Lerp(to, weight); } real_t startLength = Mathf.Sqrt(startLengthSquared); real_t resultLength = Mathf.Lerp(startLength, Mathf.Sqrt(endLengthSquared), weight); diff --git a/modules/mono/glue/GodotSharp/GodotSharp/GodotSharp.csproj b/modules/mono/glue/GodotSharp/GodotSharp/GodotSharp.csproj index 1fcfe74c86..e59f45bbf6 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/GodotSharp.csproj +++ b/modules/mono/glue/GodotSharp/GodotSharp/GodotSharp.csproj @@ -18,7 +18,7 @@ <Compile Include="Core\Attributes\DisableGodotGeneratorsAttribute.cs" /> <Compile Include="Core\Attributes\ExportAttribute.cs" /> <Compile Include="Core\Attributes\GodotMethodAttribute.cs" /> - <Compile Include="Core\Attributes\RPCAttributes.cs" /> + <Compile Include="Core\Attributes\RPCAttribute.cs" /> <Compile Include="Core\Attributes\ScriptPathAttribute.cs" /> <Compile Include="Core\Attributes\SignalAttribute.cs" /> <Compile Include="Core\Attributes\ToolAttribute.cs" /> diff --git a/modules/mono/mono_gd/gd_mono_cache.cpp b/modules/mono/mono_gd/gd_mono_cache.cpp index 44a8e26b8f..fd78fae4ad 100644 --- a/modules/mono/mono_gd/gd_mono_cache.cpp +++ b/modules/mono/mono_gd/gd_mono_cache.cpp @@ -140,8 +140,11 @@ void CachedData::clear_godot_api_cache() { field_ExportAttribute_hintString = nullptr; class_SignalAttribute = nullptr; class_ToolAttribute = nullptr; - class_AnyPeerAttribute = nullptr; - class_AuthorityAttribute = nullptr; + class_RPCAttribute = nullptr; + property_RPCAttribute_Mode = nullptr; + property_RPCAttribute_CallLocal = nullptr; + property_RPCAttribute_TransferMode = nullptr; + property_RPCAttribute_TransferChannel = nullptr; class_GodotMethodAttribute = nullptr; field_GodotMethodAttribute_methodName = nullptr; class_ScriptPathAttribute = nullptr; @@ -268,8 +271,11 @@ void update_godot_api_cache() { CACHE_FIELD_AND_CHECK(ExportAttribute, hintString, CACHED_CLASS(ExportAttribute)->get_field("hintString")); CACHE_CLASS_AND_CHECK(SignalAttribute, GODOT_API_CLASS(SignalAttribute)); CACHE_CLASS_AND_CHECK(ToolAttribute, GODOT_API_CLASS(ToolAttribute)); - CACHE_CLASS_AND_CHECK(AnyPeerAttribute, GODOT_API_CLASS(AnyPeerAttribute)); - CACHE_CLASS_AND_CHECK(AuthorityAttribute, GODOT_API_CLASS(AuthorityAttribute)); + CACHE_CLASS_AND_CHECK(RPCAttribute, GODOT_API_CLASS(RPCAttribute)); + CACHE_PROPERTY_AND_CHECK(RPCAttribute, Mode, CACHED_CLASS(RPCAttribute)->get_property("Mode")); + CACHE_PROPERTY_AND_CHECK(RPCAttribute, CallLocal, CACHED_CLASS(RPCAttribute)->get_property("CallLocal")); + CACHE_PROPERTY_AND_CHECK(RPCAttribute, TransferMode, CACHED_CLASS(RPCAttribute)->get_property("TransferMode")); + CACHE_PROPERTY_AND_CHECK(RPCAttribute, TransferChannel, CACHED_CLASS(RPCAttribute)->get_property("TransferChannel")); CACHE_CLASS_AND_CHECK(GodotMethodAttribute, GODOT_API_CLASS(GodotMethodAttribute)); CACHE_FIELD_AND_CHECK(GodotMethodAttribute, methodName, CACHED_CLASS(GodotMethodAttribute)->get_field("methodName")); CACHE_CLASS_AND_CHECK(ScriptPathAttribute, GODOT_API_CLASS(ScriptPathAttribute)); diff --git a/modules/mono/mono_gd/gd_mono_cache.h b/modules/mono/mono_gd/gd_mono_cache.h index 92136e1f41..b3b0865608 100644 --- a/modules/mono/mono_gd/gd_mono_cache.h +++ b/modules/mono/mono_gd/gd_mono_cache.h @@ -111,8 +111,11 @@ struct CachedData { GDMonoField *field_ExportAttribute_hintString = nullptr; GDMonoClass *class_SignalAttribute = nullptr; GDMonoClass *class_ToolAttribute = nullptr; - GDMonoClass *class_AnyPeerAttribute = nullptr; - GDMonoClass *class_AuthorityAttribute = nullptr; + GDMonoClass *class_RPCAttribute = nullptr; + GDMonoProperty *property_RPCAttribute_Mode = nullptr; + GDMonoProperty *property_RPCAttribute_CallLocal = nullptr; + GDMonoProperty *property_RPCAttribute_TransferMode = nullptr; + GDMonoProperty *property_RPCAttribute_TransferChannel = nullptr; GDMonoClass *class_GodotMethodAttribute = nullptr; GDMonoField *field_GodotMethodAttribute_methodName = nullptr; GDMonoClass *class_ScriptPathAttribute = nullptr; diff --git a/modules/mono/utils/path_utils.cpp b/modules/mono/utils/path_utils.cpp index 15a0b28181..a1905dfcfe 100644 --- a/modules/mono/utils/path_utils.cpp +++ b/modules/mono/utils/path_utils.cpp @@ -62,7 +62,8 @@ String cwd() { } String result; - if (result.parse_utf16(buffer.ptr())) { + result.parse_utf16(buffer.ptr()); + if (result.is_empty()) { return "."; } return result.simplify_path(); @@ -73,7 +74,7 @@ String cwd() { } String result; - if (result.parse_utf8(buffer)) { + if (result.parse_utf8(buffer) != OK) { return "."; } @@ -114,7 +115,8 @@ String realpath(const String &p_path) { ::CloseHandle(hFile); String result; - if (result.parse_utf16(buffer.ptr())) { + result.parse_utf16(buffer.ptr()); + if (result.is_empty()) { return p_path; } @@ -127,10 +129,10 @@ String realpath(const String &p_path) { } String result; - bool parse_ok = result.parse_utf8(resolved_path); + Error parse_ok = result.parse_utf8(resolved_path); ::free(resolved_path); - if (parse_ok) { + if (parse_ok != OK) { return p_path; } diff --git a/modules/mono/utils/string_utils.cpp b/modules/mono/utils/string_utils.cpp index 64b68b70af..975f2d8332 100644 --- a/modules/mono/utils/string_utils.cpp +++ b/modules/mono/utils/string_utils.cpp @@ -178,7 +178,7 @@ Error read_all_file_utf8(const String &p_path, String &r_content) { w[len] = 0; String source; - if (source.parse_utf8((const char *)w)) { + if (source.parse_utf8((const char *)w) != OK) { ERR_FAIL_V(ERR_INVALID_DATA); } diff --git a/modules/openxr/extensions/openxr_vulkan_extension.cpp b/modules/openxr/extensions/openxr_vulkan_extension.cpp index 2ddf3b8a7d..3d3d4de5b6 100644 --- a/modules/openxr/extensions/openxr_vulkan_extension.cpp +++ b/modules/openxr/extensions/openxr_vulkan_extension.cpp @@ -34,7 +34,6 @@ #include "../openxr_api.h" #include "../openxr_util.h" #include "servers/rendering/renderer_rd/effects/copy_effects.h" -#include "servers/rendering/renderer_rd/renderer_storage_rd.h" #include "servers/rendering/renderer_rd/storage_rd/texture_storage.h" #include "servers/rendering/rendering_server_globals.h" #include "servers/rendering_server.h" @@ -439,7 +438,6 @@ bool OpenXRVulkanExtension::copy_render_target_to_image(RID p_from_render_target SwapchainGraphicsData *data = (SwapchainGraphicsData *)p_swapchain_graphics_data; ERR_FAIL_NULL_V(data, false); ERR_FAIL_COND_V(p_from_render_target.is_null(), false); - ERR_FAIL_NULL_V(RendererStorageRD::base_singleton, false); RID source_image = RendererRD::TextureStorage::get_singleton()->render_target_get_rd_texture(p_from_render_target); ERR_FAIL_COND_V(source_image.is_null(), false); diff --git a/modules/text_server_adv/text_server_adv.cpp b/modules/text_server_adv/text_server_adv.cpp index c4269a53f4..fd7636566a 100644 --- a/modules/text_server_adv/text_server_adv.cpp +++ b/modules/text_server_adv/text_server_adv.cpp @@ -75,7 +75,7 @@ using namespace core_bind; hb_font_funcs_t *TextServerAdvanced::funcs = nullptr; -TextServerAdvanced::bmp_font_t *TextServerAdvanced::_bmp_font_create(TextServerAdvanced::FontDataForSizeAdvanced *p_face, bool p_unref) { +TextServerAdvanced::bmp_font_t *TextServerAdvanced::_bmp_font_create(TextServerAdvanced::FontForSizeAdvanced *p_face, bool p_unref) { bmp_font_t *bm_font = memnew(bmp_font_t); if (!bm_font) { @@ -228,11 +228,11 @@ void TextServerAdvanced::_bmp_free_font_funcs() { } } -void TextServerAdvanced::_bmp_font_set_funcs(hb_font_t *p_font, TextServerAdvanced::FontDataForSizeAdvanced *p_face, bool p_unref) { +void TextServerAdvanced::_bmp_font_set_funcs(hb_font_t *p_font, TextServerAdvanced::FontForSizeAdvanced *p_face, bool p_unref) { hb_font_set_funcs(p_font, funcs, _bmp_font_create(p_face, p_unref), _bmp_font_destroy); } -hb_font_t *TextServerAdvanced::_bmp_font_create(TextServerAdvanced::FontDataForSizeAdvanced *p_face, hb_destroy_func_t p_destroy) { +hb_font_t *TextServerAdvanced::_bmp_font_create(TextServerAdvanced::FontForSizeAdvanced *p_face, hb_destroy_func_t p_destroy) { hb_font_t *font; hb_face_t *face = hb_face_create(nullptr, 0); @@ -375,7 +375,7 @@ int64_t TextServerAdvanced::get_features() const { void TextServerAdvanced::free_rid(const RID &p_rid) { _THREAD_SAFE_METHOD_ if (font_owner.owns(p_rid)) { - FontDataAdvanced *fd = font_owner.get_or_null(p_rid); + FontAdvanced *fd = font_owner.get_or_null(p_rid); font_owner.free(p_rid); memdelete(fd); } else if (shaped_owner.owns(p_rid)) { @@ -476,259 +476,267 @@ bool TextServerAdvanced::is_locale_right_to_left(const String &p_locale) const { } } -_FORCE_INLINE_ void TextServerAdvanced::_insert_feature(const StringName &p_name, int32_t p_tag) { +_FORCE_INLINE_ void TextServerAdvanced::_insert_feature(const StringName &p_name, int32_t p_tag, Variant::Type p_vtype, bool p_hidden) { + FeatureInfo fi; + fi.name = p_name; + fi.vtype = p_vtype; + fi.hidden = p_hidden; + feature_sets.insert(p_name, p_tag); - feature_sets_inv.insert(p_tag, p_name); + feature_sets_inv.insert(p_tag, fi); } void TextServerAdvanced::_insert_feature_sets() { // Registered OpenType feature tags. - _insert_feature("access_all_alternates", HB_TAG('a', 'a', 'l', 't')); - _insert_feature("above_base_forms", HB_TAG('a', 'b', 'v', 'f')); - _insert_feature("above_base_mark_positioning", HB_TAG('a', 'b', 'v', 'm')); - _insert_feature("above_base_substitutions", HB_TAG('a', 'b', 'v', 's')); - _insert_feature("alternative_fractions", HB_TAG('a', 'f', 'r', 'c')); - _insert_feature("akhands", HB_TAG('a', 'k', 'h', 'n')); - _insert_feature("below_base_forms", HB_TAG('b', 'l', 'w', 'f')); - _insert_feature("below_base_mark_positioning", HB_TAG('b', 'l', 'w', 'm')); - _insert_feature("below_base_substitutions", HB_TAG('b', 'l', 'w', 's')); - _insert_feature("contextual_alternates", HB_TAG('c', 'a', 'l', 't')); - _insert_feature("case_sensitive_forms", HB_TAG('c', 'a', 's', 'e')); - _insert_feature("glyph_composition", HB_TAG('c', 'c', 'm', 'p')); - _insert_feature("conjunct_form_after_ro", HB_TAG('c', 'f', 'a', 'r')); - _insert_feature("conjunct_forms", HB_TAG('c', 'j', 'c', 't')); - _insert_feature("contextual_ligatures", HB_TAG('c', 'l', 'i', 'g')); - _insert_feature("centered_cjk_punctuation", HB_TAG('c', 'p', 'c', 't')); - _insert_feature("capital_spacing", HB_TAG('c', 'p', 's', 'p')); - _insert_feature("contextual_swash", HB_TAG('c', 's', 'w', 'h')); - _insert_feature("cursive_positioning", HB_TAG('c', 'u', 'r', 's')); - _insert_feature("character_variant_01", HB_TAG('c', 'v', '0', '1')); - _insert_feature("character_variant_02", HB_TAG('c', 'v', '0', '2')); - _insert_feature("character_variant_03", HB_TAG('c', 'v', '0', '3')); - _insert_feature("character_variant_04", HB_TAG('c', 'v', '0', '4')); - _insert_feature("character_variant_05", HB_TAG('c', 'v', '0', '5')); - _insert_feature("character_variant_06", HB_TAG('c', 'v', '0', '6')); - _insert_feature("character_variant_07", HB_TAG('c', 'v', '0', '7')); - _insert_feature("character_variant_08", HB_TAG('c', 'v', '0', '8')); - _insert_feature("character_variant_09", HB_TAG('c', 'v', '0', '9')); - _insert_feature("character_variant_10", HB_TAG('c', 'v', '1', '0')); - _insert_feature("character_variant_11", HB_TAG('c', 'v', '1', '1')); - _insert_feature("character_variant_12", HB_TAG('c', 'v', '1', '2')); - _insert_feature("character_variant_13", HB_TAG('c', 'v', '1', '3')); - _insert_feature("character_variant_14", HB_TAG('c', 'v', '1', '4')); - _insert_feature("character_variant_15", HB_TAG('c', 'v', '1', '5')); - _insert_feature("character_variant_16", HB_TAG('c', 'v', '1', '6')); - _insert_feature("character_variant_17", HB_TAG('c', 'v', '1', '7')); - _insert_feature("character_variant_18", HB_TAG('c', 'v', '1', '8')); - _insert_feature("character_variant_19", HB_TAG('c', 'v', '1', '9')); - _insert_feature("character_variant_20", HB_TAG('c', 'v', '2', '0')); - _insert_feature("character_variant_21", HB_TAG('c', 'v', '2', '1')); - _insert_feature("character_variant_22", HB_TAG('c', 'v', '2', '2')); - _insert_feature("character_variant_23", HB_TAG('c', 'v', '2', '3')); - _insert_feature("character_variant_24", HB_TAG('c', 'v', '2', '4')); - _insert_feature("character_variant_25", HB_TAG('c', 'v', '2', '5')); - _insert_feature("character_variant_26", HB_TAG('c', 'v', '2', '6')); - _insert_feature("character_variant_27", HB_TAG('c', 'v', '2', '7')); - _insert_feature("character_variant_28", HB_TAG('c', 'v', '2', '8')); - _insert_feature("character_variant_29", HB_TAG('c', 'v', '2', '9')); - _insert_feature("character_variant_30", HB_TAG('c', 'v', '3', '0')); - _insert_feature("character_variant_31", HB_TAG('c', 'v', '3', '1')); - _insert_feature("character_variant_32", HB_TAG('c', 'v', '3', '2')); - _insert_feature("character_variant_33", HB_TAG('c', 'v', '3', '3')); - _insert_feature("character_variant_34", HB_TAG('c', 'v', '3', '4')); - _insert_feature("character_variant_35", HB_TAG('c', 'v', '3', '5')); - _insert_feature("character_variant_36", HB_TAG('c', 'v', '3', '6')); - _insert_feature("character_variant_37", HB_TAG('c', 'v', '3', '7')); - _insert_feature("character_variant_38", HB_TAG('c', 'v', '3', '8')); - _insert_feature("character_variant_39", HB_TAG('c', 'v', '3', '9')); - _insert_feature("character_variant_40", HB_TAG('c', 'v', '4', '0')); - _insert_feature("character_variant_41", HB_TAG('c', 'v', '4', '1')); - _insert_feature("character_variant_42", HB_TAG('c', 'v', '4', '2')); - _insert_feature("character_variant_43", HB_TAG('c', 'v', '4', '3')); - _insert_feature("character_variant_44", HB_TAG('c', 'v', '4', '4')); - _insert_feature("character_variant_45", HB_TAG('c', 'v', '4', '5')); - _insert_feature("character_variant_46", HB_TAG('c', 'v', '4', '6')); - _insert_feature("character_variant_47", HB_TAG('c', 'v', '4', '7')); - _insert_feature("character_variant_48", HB_TAG('c', 'v', '4', '8')); - _insert_feature("character_variant_49", HB_TAG('c', 'v', '4', '9')); - _insert_feature("character_variant_50", HB_TAG('c', 'v', '5', '0')); - _insert_feature("character_variant_51", HB_TAG('c', 'v', '5', '1')); - _insert_feature("character_variant_52", HB_TAG('c', 'v', '5', '2')); - _insert_feature("character_variant_53", HB_TAG('c', 'v', '5', '3')); - _insert_feature("character_variant_54", HB_TAG('c', 'v', '5', '4')); - _insert_feature("character_variant_55", HB_TAG('c', 'v', '5', '5')); - _insert_feature("character_variant_56", HB_TAG('c', 'v', '5', '6')); - _insert_feature("character_variant_57", HB_TAG('c', 'v', '5', '7')); - _insert_feature("character_variant_58", HB_TAG('c', 'v', '5', '8')); - _insert_feature("character_variant_59", HB_TAG('c', 'v', '5', '9')); - _insert_feature("character_variant_60", HB_TAG('c', 'v', '6', '0')); - _insert_feature("character_variant_61", HB_TAG('c', 'v', '6', '1')); - _insert_feature("character_variant_62", HB_TAG('c', 'v', '6', '2')); - _insert_feature("character_variant_63", HB_TAG('c', 'v', '6', '3')); - _insert_feature("character_variant_64", HB_TAG('c', 'v', '6', '4')); - _insert_feature("character_variant_65", HB_TAG('c', 'v', '6', '5')); - _insert_feature("character_variant_66", HB_TAG('c', 'v', '6', '6')); - _insert_feature("character_variant_67", HB_TAG('c', 'v', '6', '7')); - _insert_feature("character_variant_68", HB_TAG('c', 'v', '6', '8')); - _insert_feature("character_variant_69", HB_TAG('c', 'v', '6', '9')); - _insert_feature("character_variant_70", HB_TAG('c', 'v', '7', '0')); - _insert_feature("character_variant_71", HB_TAG('c', 'v', '7', '1')); - _insert_feature("character_variant_72", HB_TAG('c', 'v', '7', '2')); - _insert_feature("character_variant_73", HB_TAG('c', 'v', '7', '3')); - _insert_feature("character_variant_74", HB_TAG('c', 'v', '7', '4')); - _insert_feature("character_variant_75", HB_TAG('c', 'v', '7', '5')); - _insert_feature("character_variant_76", HB_TAG('c', 'v', '7', '6')); - _insert_feature("character_variant_77", HB_TAG('c', 'v', '7', '7')); - _insert_feature("character_variant_78", HB_TAG('c', 'v', '7', '8')); - _insert_feature("character_variant_79", HB_TAG('c', 'v', '7', '9')); - _insert_feature("character_variant_80", HB_TAG('c', 'v', '8', '0')); - _insert_feature("character_variant_81", HB_TAG('c', 'v', '8', '1')); - _insert_feature("character_variant_82", HB_TAG('c', 'v', '8', '2')); - _insert_feature("character_variant_83", HB_TAG('c', 'v', '8', '3')); - _insert_feature("character_variant_84", HB_TAG('c', 'v', '8', '4')); - _insert_feature("character_variant_85", HB_TAG('c', 'v', '8', '5')); - _insert_feature("character_variant_86", HB_TAG('c', 'v', '8', '6')); - _insert_feature("character_variant_87", HB_TAG('c', 'v', '8', '7')); - _insert_feature("character_variant_88", HB_TAG('c', 'v', '8', '8')); - _insert_feature("character_variant_89", HB_TAG('c', 'v', '8', '9')); - _insert_feature("character_variant_90", HB_TAG('c', 'v', '9', '0')); - _insert_feature("character_variant_91", HB_TAG('c', 'v', '9', '1')); - _insert_feature("character_variant_92", HB_TAG('c', 'v', '9', '2')); - _insert_feature("character_variant_93", HB_TAG('c', 'v', '9', '3')); - _insert_feature("character_variant_94", HB_TAG('c', 'v', '9', '4')); - _insert_feature("character_variant_95", HB_TAG('c', 'v', '9', '5')); - _insert_feature("character_variant_96", HB_TAG('c', 'v', '9', '6')); - _insert_feature("character_variant_97", HB_TAG('c', 'v', '9', '7')); - _insert_feature("character_variant_98", HB_TAG('c', 'v', '9', '8')); - _insert_feature("character_variant_99", HB_TAG('c', 'v', '9', '9')); - _insert_feature("petite_capitals_from_capitals", HB_TAG('c', '2', 'p', 'c')); - _insert_feature("small_capitals_from_capitals", HB_TAG('c', '2', 's', 'c')); - _insert_feature("distances", HB_TAG('d', 'i', 's', 't')); - _insert_feature("discretionary_ligatures", HB_TAG('d', 'l', 'i', 'g')); - _insert_feature("denominators", HB_TAG('d', 'n', 'o', 'm')); - _insert_feature("dotless_forms", HB_TAG('d', 't', 'l', 's')); - _insert_feature("expert_forms", HB_TAG('e', 'x', 'p', 't')); - _insert_feature("final_glyph_on_line_alternates", HB_TAG('f', 'a', 'l', 't')); - _insert_feature("terminal_forms_2", HB_TAG('f', 'i', 'n', '2')); - _insert_feature("terminal_forms_3", HB_TAG('f', 'i', 'n', '3')); - _insert_feature("terminal_forms", HB_TAG('f', 'i', 'n', 'a')); - _insert_feature("flattened_accent_forms", HB_TAG('f', 'l', 'a', 'c')); - _insert_feature("fractions", HB_TAG('f', 'r', 'a', 'c')); - _insert_feature("full_widths", HB_TAG('f', 'w', 'i', 'd')); - _insert_feature("half_forms", HB_TAG('h', 'a', 'l', 'f')); - _insert_feature("halant_forms", HB_TAG('h', 'a', 'l', 'n')); - _insert_feature("alternate_half_widths", HB_TAG('h', 'a', 'l', 't')); - _insert_feature("historical_forms", HB_TAG('h', 'i', 's', 't')); - _insert_feature("horizontal_kana_alternates", HB_TAG('h', 'k', 'n', 'a')); - _insert_feature("historical_ligatures", HB_TAG('h', 'l', 'i', 'g')); - _insert_feature("hangul", HB_TAG('h', 'n', 'g', 'l')); - _insert_feature("hojo_kanji_forms", HB_TAG('h', 'o', 'j', 'o')); - _insert_feature("half_widths", HB_TAG('h', 'w', 'i', 'd')); - _insert_feature("initial_forms", HB_TAG('i', 'n', 'i', 't')); - _insert_feature("isolated_forms", HB_TAG('i', 's', 'o', 'l')); - _insert_feature("italics", HB_TAG('i', 't', 'a', 'l')); - _insert_feature("justification_alternates", HB_TAG('j', 'a', 'l', 't')); - _insert_feature("jis78_forms", HB_TAG('j', 'p', '7', '8')); - _insert_feature("jis83_forms", HB_TAG('j', 'p', '8', '3')); - _insert_feature("jis90_forms", HB_TAG('j', 'p', '9', '0')); - _insert_feature("jis2004_forms", HB_TAG('j', 'p', '0', '4')); - _insert_feature("kerning", HB_TAG('k', 'e', 'r', 'n')); - _insert_feature("left_bounds", HB_TAG('l', 'f', 'b', 'd')); - _insert_feature("standard_ligatures", HB_TAG('l', 'i', 'g', 'a')); - _insert_feature("leading_jamo_forms", HB_TAG('l', 'j', 'm', 'o')); - _insert_feature("lining_figures", HB_TAG('l', 'n', 'u', 'm')); - _insert_feature("localized_forms", HB_TAG('l', 'o', 'c', 'l')); - _insert_feature("left_to_right_alternates", HB_TAG('l', 't', 'r', 'a')); - _insert_feature("left_to_right_mirrored_forms", HB_TAG('l', 't', 'r', 'm')); - _insert_feature("mark_positioning", HB_TAG('m', 'a', 'r', 'k')); - _insert_feature("medial_forms_2", HB_TAG('m', 'e', 'd', '2')); - _insert_feature("medial_forms", HB_TAG('m', 'e', 'd', 'i')); - _insert_feature("mathematical_greek", HB_TAG('m', 'g', 'r', 'k')); - _insert_feature("mark_to_mark_positioning", HB_TAG('m', 'k', 'm', 'k')); - _insert_feature("mark_positioning_via_substitution", HB_TAG('m', 's', 'e', 't')); - _insert_feature("alternate_annotation_forms", HB_TAG('n', 'a', 'l', 't')); - _insert_feature("nlc_kanji_forms", HB_TAG('n', 'l', 'c', 'k')); - _insert_feature("nukta_forms", HB_TAG('n', 'u', 'k', 't')); - _insert_feature("numerators", HB_TAG('n', 'u', 'm', 'r')); - _insert_feature("oldstyle_figures", HB_TAG('o', 'n', 'u', 'm')); - _insert_feature("optical_bounds", HB_TAG('o', 'p', 'b', 'd')); - _insert_feature("ordinals", HB_TAG('o', 'r', 'd', 'n')); - _insert_feature("ornaments", HB_TAG('o', 'r', 'n', 'm')); - _insert_feature("proportional_alternate_widths", HB_TAG('p', 'a', 'l', 't')); - _insert_feature("petite_capitals", HB_TAG('p', 'c', 'a', 'p')); - _insert_feature("proportional_kana", HB_TAG('p', 'k', 'n', 'a')); - _insert_feature("proportional_figures", HB_TAG('p', 'n', 'u', 'm')); - _insert_feature("pre_base_forms", HB_TAG('p', 'r', 'e', 'f')); - _insert_feature("pre_base_substitutions", HB_TAG('p', 'r', 'e', 's')); - _insert_feature("post_base_forms", HB_TAG('p', 's', 't', 'f')); - _insert_feature("post_base_substitutions", HB_TAG('p', 's', 't', 's')); - _insert_feature("proportional_widths", HB_TAG('p', 'w', 'i', 'd')); - _insert_feature("quarter_widths", HB_TAG('q', 'w', 'i', 'd')); - _insert_feature("randomize", HB_TAG('r', 'a', 'n', 'd')); - _insert_feature("required_contextual_alternates", HB_TAG('r', 'c', 'l', 't')); - _insert_feature("rakar_forms", HB_TAG('r', 'k', 'r', 'f')); - _insert_feature("required_ligatures", HB_TAG('r', 'l', 'i', 'g')); - _insert_feature("reph_forms", HB_TAG('r', 'p', 'h', 'f')); - _insert_feature("right_bounds", HB_TAG('r', 't', 'b', 'd')); - _insert_feature("right_to_left_alternates", HB_TAG('r', 't', 'l', 'a')); - _insert_feature("right_to_left_mirrored_forms", HB_TAG('r', 't', 'l', 'm')); - _insert_feature("ruby_notation_forms", HB_TAG('r', 'u', 'b', 'y')); - _insert_feature("required_variation_alternates", HB_TAG('r', 'v', 'r', 'n')); - _insert_feature("stylistic_alternates", HB_TAG('s', 'a', 'l', 't')); - _insert_feature("scientific_inferiors", HB_TAG('s', 'i', 'n', 'f')); - _insert_feature("optical_size", HB_TAG('s', 'i', 'z', 'e')); - _insert_feature("small_capitals", HB_TAG('s', 'm', 'c', 'p')); - _insert_feature("simplified_forms", HB_TAG('s', 'm', 'p', 'l')); - _insert_feature("stylistic_set_01", HB_TAG('s', 's', '0', '1')); - _insert_feature("stylistic_set_02", HB_TAG('s', 's', '0', '2')); - _insert_feature("stylistic_set_03", HB_TAG('s', 's', '0', '3')); - _insert_feature("stylistic_set_04", HB_TAG('s', 's', '0', '4')); - _insert_feature("stylistic_set_05", HB_TAG('s', 's', '0', '5')); - _insert_feature("stylistic_set_06", HB_TAG('s', 's', '0', '6')); - _insert_feature("stylistic_set_07", HB_TAG('s', 's', '0', '7')); - _insert_feature("stylistic_set_08", HB_TAG('s', 's', '0', '8')); - _insert_feature("stylistic_set_09", HB_TAG('s', 's', '0', '9')); - _insert_feature("stylistic_set_10", HB_TAG('s', 's', '1', '0')); - _insert_feature("stylistic_set_11", HB_TAG('s', 's', '1', '1')); - _insert_feature("stylistic_set_12", HB_TAG('s', 's', '1', '2')); - _insert_feature("stylistic_set_13", HB_TAG('s', 's', '1', '3')); - _insert_feature("stylistic_set_14", HB_TAG('s', 's', '1', '4')); - _insert_feature("stylistic_set_15", HB_TAG('s', 's', '1', '5')); - _insert_feature("stylistic_set_16", HB_TAG('s', 's', '1', '6')); - _insert_feature("stylistic_set_17", HB_TAG('s', 's', '1', '7')); - _insert_feature("stylistic_set_18", HB_TAG('s', 's', '1', '8')); - _insert_feature("stylistic_set_19", HB_TAG('s', 's', '1', '9')); - _insert_feature("stylistic_set_20", HB_TAG('s', 's', '2', '0')); - _insert_feature("math_script_style_alternates", HB_TAG('s', 's', 't', 'y')); - _insert_feature("stretching_glyph_decomposition", HB_TAG('s', 't', 'c', 'h')); - _insert_feature("subscript", HB_TAG('s', 'u', 'b', 's')); - _insert_feature("superscript", HB_TAG('s', 'u', 'p', 's')); - _insert_feature("swash", HB_TAG('s', 'w', 's', 'h')); - _insert_feature("titling", HB_TAG('t', 'i', 't', 'l')); - _insert_feature("trailing_jamo_forms", HB_TAG('t', 'j', 'm', 'o')); - _insert_feature("traditional_name_forms", HB_TAG('t', 'n', 'a', 'm')); - _insert_feature("tabular_figures", HB_TAG('t', 'n', 'u', 'm')); - _insert_feature("traditional_forms", HB_TAG('t', 'r', 'a', 'd')); - _insert_feature("third_widths", HB_TAG('t', 'w', 'i', 'd')); - _insert_feature("unicase", HB_TAG('u', 'n', 'i', 'c')); - _insert_feature("alternate_vertical_metrics", HB_TAG('v', 'a', 'l', 't')); - _insert_feature("vattu_variants", HB_TAG('v', 'a', 't', 'u')); - _insert_feature("vertical_writing", HB_TAG('v', 'e', 'r', 't')); - _insert_feature("alternate_vertical_half_metrics", HB_TAG('v', 'h', 'a', 'l')); - _insert_feature("vowel_jamo_forms", HB_TAG('v', 'j', 'm', 'o')); - _insert_feature("vertical_kana_alternates", HB_TAG('v', 'k', 'n', 'a')); - _insert_feature("vertical_kerning", HB_TAG('v', 'k', 'r', 'n')); - _insert_feature("proportional_alternate_vertical_metrics", HB_TAG('v', 'p', 'a', 'l')); - _insert_feature("vertical_alternates_and_rotation", HB_TAG('v', 'r', 't', '2')); - _insert_feature("vertical_alternates_for_rotation", HB_TAG('v', 'r', 't', 'r')); - _insert_feature("slashed_zero", HB_TAG('z', 'e', 'r', 'o')); + // Name, Tag, Data Type, Hidden + _insert_feature("access_all_alternates", HB_TAG('a', 'a', 'l', 't'), Variant::Type::INT, false); + _insert_feature("above_base_forms", HB_TAG('a', 'b', 'v', 'f'), Variant::Type::INT, true); + _insert_feature("above_base_mark_positioning", HB_TAG('a', 'b', 'v', 'm'), Variant::Type::INT, true); + _insert_feature("above_base_substitutions", HB_TAG('a', 'b', 'v', 's'), Variant::Type::INT, true); + _insert_feature("alternative_fractions", HB_TAG('a', 'f', 'r', 'c'), Variant::Type::INT, false); + _insert_feature("akhands", HB_TAG('a', 'k', 'h', 'n'), Variant::Type::INT, true); + _insert_feature("below_base_forms", HB_TAG('b', 'l', 'w', 'f'), Variant::Type::INT, true); + _insert_feature("below_base_mark_positioning", HB_TAG('b', 'l', 'w', 'm'), Variant::Type::INT, true); + _insert_feature("below_base_substitutions", HB_TAG('b', 'l', 'w', 's'), Variant::Type::INT, true); + _insert_feature("contextual_alternates", HB_TAG('c', 'a', 'l', 't'), Variant::Type::BOOL, false); + _insert_feature("case_sensitive_forms", HB_TAG('c', 'a', 's', 'e'), Variant::Type::BOOL, false); + _insert_feature("glyph_composition", HB_TAG('c', 'c', 'm', 'p'), Variant::Type::INT, true); + _insert_feature("conjunct_form_after_ro", HB_TAG('c', 'f', 'a', 'r'), Variant::Type::INT, true); + _insert_feature("contextual_half_width_spacing", HB_TAG('c', 'h', 'w', 's'), Variant::Type::INT, true); + _insert_feature("conjunct_forms", HB_TAG('c', 'j', 'c', 't'), Variant::Type::INT, true); + _insert_feature("contextual_ligatures", HB_TAG('c', 'l', 'i', 'g'), Variant::Type::BOOL, false); + _insert_feature("centered_cjk_punctuation", HB_TAG('c', 'p', 'c', 't'), Variant::Type::BOOL, false); + _insert_feature("capital_spacing", HB_TAG('c', 'p', 's', 'p'), Variant::Type::BOOL, false); + _insert_feature("contextual_swash", HB_TAG('c', 's', 'w', 'h'), Variant::Type::INT, false); + _insert_feature("cursive_positioning", HB_TAG('c', 'u', 'r', 's'), Variant::Type::INT, true); + _insert_feature("character_variant_01", HB_TAG('c', 'v', '0', '1'), Variant::Type::BOOL, false); + _insert_feature("character_variant_02", HB_TAG('c', 'v', '0', '2'), Variant::Type::BOOL, false); + _insert_feature("character_variant_03", HB_TAG('c', 'v', '0', '3'), Variant::Type::BOOL, false); + _insert_feature("character_variant_04", HB_TAG('c', 'v', '0', '4'), Variant::Type::BOOL, false); + _insert_feature("character_variant_05", HB_TAG('c', 'v', '0', '5'), Variant::Type::BOOL, false); + _insert_feature("character_variant_06", HB_TAG('c', 'v', '0', '6'), Variant::Type::BOOL, false); + _insert_feature("character_variant_07", HB_TAG('c', 'v', '0', '7'), Variant::Type::BOOL, false); + _insert_feature("character_variant_08", HB_TAG('c', 'v', '0', '8'), Variant::Type::BOOL, false); + _insert_feature("character_variant_09", HB_TAG('c', 'v', '0', '9'), Variant::Type::BOOL, false); + _insert_feature("character_variant_10", HB_TAG('c', 'v', '1', '0'), Variant::Type::BOOL, false); + _insert_feature("character_variant_11", HB_TAG('c', 'v', '1', '1'), Variant::Type::BOOL, false); + _insert_feature("character_variant_12", HB_TAG('c', 'v', '1', '2'), Variant::Type::BOOL, false); + _insert_feature("character_variant_13", HB_TAG('c', 'v', '1', '3'), Variant::Type::BOOL, false); + _insert_feature("character_variant_14", HB_TAG('c', 'v', '1', '4'), Variant::Type::BOOL, false); + _insert_feature("character_variant_15", HB_TAG('c', 'v', '1', '5'), Variant::Type::BOOL, false); + _insert_feature("character_variant_16", HB_TAG('c', 'v', '1', '6'), Variant::Type::BOOL, false); + _insert_feature("character_variant_17", HB_TAG('c', 'v', '1', '7'), Variant::Type::BOOL, false); + _insert_feature("character_variant_18", HB_TAG('c', 'v', '1', '8'), Variant::Type::BOOL, false); + _insert_feature("character_variant_19", HB_TAG('c', 'v', '1', '9'), Variant::Type::BOOL, false); + _insert_feature("character_variant_20", HB_TAG('c', 'v', '2', '0'), Variant::Type::BOOL, false); + _insert_feature("character_variant_21", HB_TAG('c', 'v', '2', '1'), Variant::Type::BOOL, false); + _insert_feature("character_variant_22", HB_TAG('c', 'v', '2', '2'), Variant::Type::BOOL, false); + _insert_feature("character_variant_23", HB_TAG('c', 'v', '2', '3'), Variant::Type::BOOL, false); + _insert_feature("character_variant_24", HB_TAG('c', 'v', '2', '4'), Variant::Type::BOOL, false); + _insert_feature("character_variant_25", HB_TAG('c', 'v', '2', '5'), Variant::Type::BOOL, false); + _insert_feature("character_variant_26", HB_TAG('c', 'v', '2', '6'), Variant::Type::BOOL, false); + _insert_feature("character_variant_27", HB_TAG('c', 'v', '2', '7'), Variant::Type::BOOL, false); + _insert_feature("character_variant_28", HB_TAG('c', 'v', '2', '8'), Variant::Type::BOOL, false); + _insert_feature("character_variant_29", HB_TAG('c', 'v', '2', '9'), Variant::Type::BOOL, false); + _insert_feature("character_variant_30", HB_TAG('c', 'v', '3', '0'), Variant::Type::BOOL, false); + _insert_feature("character_variant_31", HB_TAG('c', 'v', '3', '1'), Variant::Type::BOOL, false); + _insert_feature("character_variant_32", HB_TAG('c', 'v', '3', '2'), Variant::Type::BOOL, false); + _insert_feature("character_variant_33", HB_TAG('c', 'v', '3', '3'), Variant::Type::BOOL, false); + _insert_feature("character_variant_34", HB_TAG('c', 'v', '3', '4'), Variant::Type::BOOL, false); + _insert_feature("character_variant_35", HB_TAG('c', 'v', '3', '5'), Variant::Type::BOOL, false); + _insert_feature("character_variant_36", HB_TAG('c', 'v', '3', '6'), Variant::Type::BOOL, false); + _insert_feature("character_variant_37", HB_TAG('c', 'v', '3', '7'), Variant::Type::BOOL, false); + _insert_feature("character_variant_38", HB_TAG('c', 'v', '3', '8'), Variant::Type::BOOL, false); + _insert_feature("character_variant_39", HB_TAG('c', 'v', '3', '9'), Variant::Type::BOOL, false); + _insert_feature("character_variant_40", HB_TAG('c', 'v', '4', '0'), Variant::Type::BOOL, false); + _insert_feature("character_variant_41", HB_TAG('c', 'v', '4', '1'), Variant::Type::BOOL, false); + _insert_feature("character_variant_42", HB_TAG('c', 'v', '4', '2'), Variant::Type::BOOL, false); + _insert_feature("character_variant_43", HB_TAG('c', 'v', '4', '3'), Variant::Type::BOOL, false); + _insert_feature("character_variant_44", HB_TAG('c', 'v', '4', '4'), Variant::Type::BOOL, false); + _insert_feature("character_variant_45", HB_TAG('c', 'v', '4', '5'), Variant::Type::BOOL, false); + _insert_feature("character_variant_46", HB_TAG('c', 'v', '4', '6'), Variant::Type::BOOL, false); + _insert_feature("character_variant_47", HB_TAG('c', 'v', '4', '7'), Variant::Type::BOOL, false); + _insert_feature("character_variant_48", HB_TAG('c', 'v', '4', '8'), Variant::Type::BOOL, false); + _insert_feature("character_variant_49", HB_TAG('c', 'v', '4', '9'), Variant::Type::BOOL, false); + _insert_feature("character_variant_50", HB_TAG('c', 'v', '5', '0'), Variant::Type::BOOL, false); + _insert_feature("character_variant_51", HB_TAG('c', 'v', '5', '1'), Variant::Type::BOOL, false); + _insert_feature("character_variant_52", HB_TAG('c', 'v', '5', '2'), Variant::Type::BOOL, false); + _insert_feature("character_variant_53", HB_TAG('c', 'v', '5', '3'), Variant::Type::BOOL, false); + _insert_feature("character_variant_54", HB_TAG('c', 'v', '5', '4'), Variant::Type::BOOL, false); + _insert_feature("character_variant_55", HB_TAG('c', 'v', '5', '5'), Variant::Type::BOOL, false); + _insert_feature("character_variant_56", HB_TAG('c', 'v', '5', '6'), Variant::Type::BOOL, false); + _insert_feature("character_variant_57", HB_TAG('c', 'v', '5', '7'), Variant::Type::BOOL, false); + _insert_feature("character_variant_58", HB_TAG('c', 'v', '5', '8'), Variant::Type::BOOL, false); + _insert_feature("character_variant_59", HB_TAG('c', 'v', '5', '9'), Variant::Type::BOOL, false); + _insert_feature("character_variant_60", HB_TAG('c', 'v', '6', '0'), Variant::Type::BOOL, false); + _insert_feature("character_variant_61", HB_TAG('c', 'v', '6', '1'), Variant::Type::BOOL, false); + _insert_feature("character_variant_62", HB_TAG('c', 'v', '6', '2'), Variant::Type::BOOL, false); + _insert_feature("character_variant_63", HB_TAG('c', 'v', '6', '3'), Variant::Type::BOOL, false); + _insert_feature("character_variant_64", HB_TAG('c', 'v', '6', '4'), Variant::Type::BOOL, false); + _insert_feature("character_variant_65", HB_TAG('c', 'v', '6', '5'), Variant::Type::BOOL, false); + _insert_feature("character_variant_66", HB_TAG('c', 'v', '6', '6'), Variant::Type::BOOL, false); + _insert_feature("character_variant_67", HB_TAG('c', 'v', '6', '7'), Variant::Type::BOOL, false); + _insert_feature("character_variant_68", HB_TAG('c', 'v', '6', '8'), Variant::Type::BOOL, false); + _insert_feature("character_variant_69", HB_TAG('c', 'v', '6', '9'), Variant::Type::BOOL, false); + _insert_feature("character_variant_70", HB_TAG('c', 'v', '7', '0'), Variant::Type::BOOL, false); + _insert_feature("character_variant_71", HB_TAG('c', 'v', '7', '1'), Variant::Type::BOOL, false); + _insert_feature("character_variant_72", HB_TAG('c', 'v', '7', '2'), Variant::Type::BOOL, false); + _insert_feature("character_variant_73", HB_TAG('c', 'v', '7', '3'), Variant::Type::BOOL, false); + _insert_feature("character_variant_74", HB_TAG('c', 'v', '7', '4'), Variant::Type::BOOL, false); + _insert_feature("character_variant_75", HB_TAG('c', 'v', '7', '5'), Variant::Type::BOOL, false); + _insert_feature("character_variant_76", HB_TAG('c', 'v', '7', '6'), Variant::Type::BOOL, false); + _insert_feature("character_variant_77", HB_TAG('c', 'v', '7', '7'), Variant::Type::BOOL, false); + _insert_feature("character_variant_78", HB_TAG('c', 'v', '7', '8'), Variant::Type::BOOL, false); + _insert_feature("character_variant_79", HB_TAG('c', 'v', '7', '9'), Variant::Type::BOOL, false); + _insert_feature("character_variant_80", HB_TAG('c', 'v', '8', '0'), Variant::Type::BOOL, false); + _insert_feature("character_variant_81", HB_TAG('c', 'v', '8', '1'), Variant::Type::BOOL, false); + _insert_feature("character_variant_82", HB_TAG('c', 'v', '8', '2'), Variant::Type::BOOL, false); + _insert_feature("character_variant_83", HB_TAG('c', 'v', '8', '3'), Variant::Type::BOOL, false); + _insert_feature("character_variant_84", HB_TAG('c', 'v', '8', '4'), Variant::Type::BOOL, false); + _insert_feature("character_variant_85", HB_TAG('c', 'v', '8', '5'), Variant::Type::BOOL, false); + _insert_feature("character_variant_86", HB_TAG('c', 'v', '8', '6'), Variant::Type::BOOL, false); + _insert_feature("character_variant_87", HB_TAG('c', 'v', '8', '7'), Variant::Type::BOOL, false); + _insert_feature("character_variant_88", HB_TAG('c', 'v', '8', '8'), Variant::Type::BOOL, false); + _insert_feature("character_variant_89", HB_TAG('c', 'v', '8', '9'), Variant::Type::BOOL, false); + _insert_feature("character_variant_90", HB_TAG('c', 'v', '9', '0'), Variant::Type::BOOL, false); + _insert_feature("character_variant_91", HB_TAG('c', 'v', '9', '1'), Variant::Type::BOOL, false); + _insert_feature("character_variant_92", HB_TAG('c', 'v', '9', '2'), Variant::Type::BOOL, false); + _insert_feature("character_variant_93", HB_TAG('c', 'v', '9', '3'), Variant::Type::BOOL, false); + _insert_feature("character_variant_94", HB_TAG('c', 'v', '9', '4'), Variant::Type::BOOL, false); + _insert_feature("character_variant_95", HB_TAG('c', 'v', '9', '5'), Variant::Type::BOOL, false); + _insert_feature("character_variant_96", HB_TAG('c', 'v', '9', '6'), Variant::Type::BOOL, false); + _insert_feature("character_variant_97", HB_TAG('c', 'v', '9', '7'), Variant::Type::BOOL, false); + _insert_feature("character_variant_98", HB_TAG('c', 'v', '9', '8'), Variant::Type::BOOL, false); + _insert_feature("character_variant_99", HB_TAG('c', 'v', '9', '9'), Variant::Type::BOOL, false); + _insert_feature("petite_capitals_from_capitals", HB_TAG('c', '2', 'p', 'c'), Variant::Type::BOOL, false); + _insert_feature("small_capitals_from_capitals", HB_TAG('c', '2', 's', 'c'), Variant::Type::BOOL, false); + _insert_feature("distances", HB_TAG('d', 'i', 's', 't'), Variant::Type::INT, true); + _insert_feature("discretionary_ligatures", HB_TAG('d', 'l', 'i', 'g'), Variant::Type::BOOL, false); + _insert_feature("denominators", HB_TAG('d', 'n', 'o', 'm'), Variant::Type::BOOL, false); + _insert_feature("dotless_forms", HB_TAG('d', 't', 'l', 's'), Variant::Type::INT, true); + _insert_feature("expert_forms", HB_TAG('e', 'x', 'p', 't'), Variant::Type::BOOL, true); + _insert_feature("final_glyph_on_line_alternates", HB_TAG('f', 'a', 'l', 't'), Variant::Type::INT, false); + _insert_feature("terminal_forms_2", HB_TAG('f', 'i', 'n', '2'), Variant::Type::INT, true); + _insert_feature("terminal_forms_3", HB_TAG('f', 'i', 'n', '3'), Variant::Type::INT, true); + _insert_feature("terminal_forms", HB_TAG('f', 'i', 'n', 'a'), Variant::Type::INT, true); + _insert_feature("flattened_accent_forms", HB_TAG('f', 'l', 'a', 'c'), Variant::Type::INT, true); + _insert_feature("fractions", HB_TAG('f', 'r', 'a', 'c'), Variant::Type::BOOL, false); + _insert_feature("full_widths", HB_TAG('f', 'w', 'i', 'd'), Variant::Type::BOOL, false); + _insert_feature("half_forms", HB_TAG('h', 'a', 'l', 'f'), Variant::Type::INT, true); + _insert_feature("halant_forms", HB_TAG('h', 'a', 'l', 'n'), Variant::Type::INT, true); + _insert_feature("alternate_half_widths", HB_TAG('h', 'a', 'l', 't'), Variant::Type::BOOL, false); + _insert_feature("historical_forms", HB_TAG('h', 'i', 's', 't'), Variant::Type::INT, false); + _insert_feature("horizontal_kana_alternates", HB_TAG('h', 'k', 'n', 'a'), Variant::Type::BOOL, false); + _insert_feature("historical_ligatures", HB_TAG('h', 'l', 'i', 'g'), Variant::Type::BOOL, false); + _insert_feature("hangul", HB_TAG('h', 'n', 'g', 'l'), Variant::Type::INT, false); + _insert_feature("hojo_kanji_forms", HB_TAG('h', 'o', 'j', 'o'), Variant::Type::INT, false); + _insert_feature("half_widths", HB_TAG('h', 'w', 'i', 'd'), Variant::Type::BOOL, false); + _insert_feature("initial_forms", HB_TAG('i', 'n', 'i', 't'), Variant::Type::INT, true); + _insert_feature("isolated_forms", HB_TAG('i', 's', 'o', 'l'), Variant::Type::INT, true); + _insert_feature("italics", HB_TAG('i', 't', 'a', 'l'), Variant::Type::INT, false); + _insert_feature("justification_alternates", HB_TAG('j', 'a', 'l', 't'), Variant::Type::INT, false); + _insert_feature("jis78_forms", HB_TAG('j', 'p', '7', '8'), Variant::Type::INT, false); + _insert_feature("jis83_forms", HB_TAG('j', 'p', '8', '3'), Variant::Type::INT, false); + _insert_feature("jis90_forms", HB_TAG('j', 'p', '9', '0'), Variant::Type::INT, false); + _insert_feature("jis2004_forms", HB_TAG('j', 'p', '0', '4'), Variant::Type::INT, false); + _insert_feature("kerning", HB_TAG('k', 'e', 'r', 'n'), Variant::Type::BOOL, false); + _insert_feature("left_bounds", HB_TAG('l', 'f', 'b', 'd'), Variant::Type::INT, false); + _insert_feature("standard_ligatures", HB_TAG('l', 'i', 'g', 'a'), Variant::Type::BOOL, false); + _insert_feature("leading_jamo_forms", HB_TAG('l', 'j', 'm', 'o'), Variant::Type::INT, true); + _insert_feature("lining_figures", HB_TAG('l', 'n', 'u', 'm'), Variant::Type::INT, false); + _insert_feature("localized_forms", HB_TAG('l', 'o', 'c', 'l'), Variant::Type::INT, true); + _insert_feature("left_to_right_alternates", HB_TAG('l', 't', 'r', 'a'), Variant::Type::INT, true); + _insert_feature("left_to_right_mirrored_forms", HB_TAG('l', 't', 'r', 'm'), Variant::Type::INT, true); + _insert_feature("mark_positioning", HB_TAG('m', 'a', 'r', 'k'), Variant::Type::INT, true); + _insert_feature("medial_forms_2", HB_TAG('m', 'e', 'd', '2'), Variant::Type::INT, true); + _insert_feature("medial_forms", HB_TAG('m', 'e', 'd', 'i'), Variant::Type::INT, true); + _insert_feature("mathematical_greek", HB_TAG('m', 'g', 'r', 'k'), Variant::Type::BOOL, false); + _insert_feature("mark_to_mark_positioning", HB_TAG('m', 'k', 'm', 'k'), Variant::Type::INT, true); + _insert_feature("mark_positioning_via_substitution", HB_TAG('m', 's', 'e', 't'), Variant::Type::INT, true); + _insert_feature("alternate_annotation_forms", HB_TAG('n', 'a', 'l', 't'), Variant::Type::INT, false); + _insert_feature("nlc_kanji_forms", HB_TAG('n', 'l', 'c', 'k'), Variant::Type::INT, false); + _insert_feature("nukta_forms", HB_TAG('n', 'u', 'k', 't'), Variant::Type::INT, true); + _insert_feature("numerators", HB_TAG('n', 'u', 'm', 'r'), Variant::Type::BOOL, false); + _insert_feature("oldstyle_figures", HB_TAG('o', 'n', 'u', 'm'), Variant::Type::INT, false); + _insert_feature("optical_bounds", HB_TAG('o', 'p', 'b', 'd'), Variant::Type::INT, true); + _insert_feature("ordinals", HB_TAG('o', 'r', 'd', 'n'), Variant::Type::BOOL, false); + _insert_feature("ornaments", HB_TAG('o', 'r', 'n', 'm'), Variant::Type::INT, false); + _insert_feature("proportional_alternate_widths", HB_TAG('p', 'a', 'l', 't'), Variant::Type::BOOL, false); + _insert_feature("petite_capitals", HB_TAG('p', 'c', 'a', 'p'), Variant::Type::BOOL, false); + _insert_feature("proportional_kana", HB_TAG('p', 'k', 'n', 'a'), Variant::Type::BOOL, false); + _insert_feature("proportional_figures", HB_TAG('p', 'n', 'u', 'm'), Variant::Type::BOOL, false); + _insert_feature("pre_base_forms", HB_TAG('p', 'r', 'e', 'f'), Variant::Type::INT, true); + _insert_feature("pre_base_substitutions", HB_TAG('p', 'r', 'e', 's'), Variant::Type::INT, true); + _insert_feature("post_base_forms", HB_TAG('p', 's', 't', 'f'), Variant::Type::INT, true); + _insert_feature("post_base_substitutions", HB_TAG('p', 's', 't', 's'), Variant::Type::INT, true); + _insert_feature("proportional_widths", HB_TAG('p', 'w', 'i', 'd'), Variant::Type::BOOL, false); + _insert_feature("quarter_widths", HB_TAG('q', 'w', 'i', 'd'), Variant::Type::BOOL, false); + _insert_feature("randomize", HB_TAG('r', 'a', 'n', 'd'), Variant::Type::INT, false); + _insert_feature("required_contextual_alternates", HB_TAG('r', 'c', 'l', 't'), Variant::Type::BOOL, true); + _insert_feature("rakar_forms", HB_TAG('r', 'k', 'r', 'f'), Variant::Type::INT, true); + _insert_feature("required_ligatures", HB_TAG('r', 'l', 'i', 'g'), Variant::Type::BOOL, true); + _insert_feature("reph_forms", HB_TAG('r', 'p', 'h', 'f'), Variant::Type::INT, true); + _insert_feature("right_bounds", HB_TAG('r', 't', 'b', 'd'), Variant::Type::INT, false); + _insert_feature("right_to_left_alternates", HB_TAG('r', 't', 'l', 'a'), Variant::Type::INT, true); + _insert_feature("right_to_left_mirrored_forms", HB_TAG('r', 't', 'l', 'm'), Variant::Type::INT, true); + _insert_feature("ruby_notation_forms", HB_TAG('r', 'u', 'b', 'y'), Variant::Type::INT, false); + _insert_feature("required_variation_alternates", HB_TAG('r', 'v', 'r', 'n'), Variant::Type::INT, true); + _insert_feature("stylistic_alternates", HB_TAG('s', 'a', 'l', 't'), Variant::Type::INT, false); + _insert_feature("scientific_inferiors", HB_TAG('s', 'i', 'n', 'f'), Variant::Type::BOOL, false); + _insert_feature("optical_size", HB_TAG('s', 'i', 'z', 'e'), Variant::Type::INT, false); + _insert_feature("small_capitals", HB_TAG('s', 'm', 'c', 'p'), Variant::Type::BOOL, false); + _insert_feature("simplified_forms", HB_TAG('s', 'm', 'p', 'l'), Variant::Type::INT, false); + _insert_feature("stylistic_set_01", HB_TAG('s', 's', '0', '1'), Variant::Type::BOOL, false); + _insert_feature("stylistic_set_02", HB_TAG('s', 's', '0', '2'), Variant::Type::BOOL, false); + _insert_feature("stylistic_set_03", HB_TAG('s', 's', '0', '3'), Variant::Type::BOOL, false); + _insert_feature("stylistic_set_04", HB_TAG('s', 's', '0', '4'), Variant::Type::BOOL, false); + _insert_feature("stylistic_set_05", HB_TAG('s', 's', '0', '5'), Variant::Type::BOOL, false); + _insert_feature("stylistic_set_06", HB_TAG('s', 's', '0', '6'), Variant::Type::BOOL, false); + _insert_feature("stylistic_set_07", HB_TAG('s', 's', '0', '7'), Variant::Type::BOOL, false); + _insert_feature("stylistic_set_08", HB_TAG('s', 's', '0', '8'), Variant::Type::BOOL, false); + _insert_feature("stylistic_set_09", HB_TAG('s', 's', '0', '9'), Variant::Type::BOOL, false); + _insert_feature("stylistic_set_10", HB_TAG('s', 's', '1', '0'), Variant::Type::BOOL, false); + _insert_feature("stylistic_set_11", HB_TAG('s', 's', '1', '1'), Variant::Type::BOOL, false); + _insert_feature("stylistic_set_12", HB_TAG('s', 's', '1', '2'), Variant::Type::BOOL, false); + _insert_feature("stylistic_set_13", HB_TAG('s', 's', '1', '3'), Variant::Type::BOOL, false); + _insert_feature("stylistic_set_14", HB_TAG('s', 's', '1', '4'), Variant::Type::BOOL, false); + _insert_feature("stylistic_set_15", HB_TAG('s', 's', '1', '5'), Variant::Type::BOOL, false); + _insert_feature("stylistic_set_16", HB_TAG('s', 's', '1', '6'), Variant::Type::BOOL, false); + _insert_feature("stylistic_set_17", HB_TAG('s', 's', '1', '7'), Variant::Type::BOOL, false); + _insert_feature("stylistic_set_18", HB_TAG('s', 's', '1', '8'), Variant::Type::BOOL, false); + _insert_feature("stylistic_set_19", HB_TAG('s', 's', '1', '9'), Variant::Type::BOOL, false); + _insert_feature("stylistic_set_20", HB_TAG('s', 's', '2', '0'), Variant::Type::BOOL, false); + _insert_feature("math_script_style_alternates", HB_TAG('s', 's', 't', 'y'), Variant::Type::INT, true); + _insert_feature("stretching_glyph_decomposition", HB_TAG('s', 't', 'c', 'h'), Variant::Type::INT, true); + _insert_feature("subscript", HB_TAG('s', 'u', 'b', 's'), Variant::Type::BOOL, false); + _insert_feature("superscript", HB_TAG('s', 'u', 'p', 's'), Variant::Type::BOOL, false); + _insert_feature("swash", HB_TAG('s', 'w', 's', 'h'), Variant::Type::INT, false); + _insert_feature("titling", HB_TAG('t', 'i', 't', 'l'), Variant::Type::BOOL, false); + _insert_feature("trailing_jamo_forms", HB_TAG('t', 'j', 'm', 'o'), Variant::Type::INT, true); + _insert_feature("traditional_name_forms", HB_TAG('t', 'n', 'a', 'm'), Variant::Type::INT, false); + _insert_feature("tabular_figures", HB_TAG('t', 'n', 'u', 'm'), Variant::Type::BOOL, false); + _insert_feature("traditional_forms", HB_TAG('t', 'r', 'a', 'd'), Variant::Type::INT, false); + _insert_feature("third_widths", HB_TAG('t', 'w', 'i', 'd'), Variant::Type::BOOL, false); + _insert_feature("unicase", HB_TAG('u', 'n', 'i', 'c'), Variant::Type::BOOL, false); + _insert_feature("alternate_vertical_metrics", HB_TAG('v', 'a', 'l', 't'), Variant::Type::INT, false); + _insert_feature("vattu_variants", HB_TAG('v', 'a', 't', 'u'), Variant::Type::INT, true); + _insert_feature("vertical_contextual_half_width_spacing", HB_TAG('v', 'c', 'h', 'w'), Variant::Type::BOOL, false); + _insert_feature("vertical_alternates", HB_TAG('v', 'e', 'r', 't'), Variant::Type::INT, false); + _insert_feature("alternate_vertical_half_metrics", HB_TAG('v', 'h', 'a', 'l'), Variant::Type::BOOL, false); + _insert_feature("vowel_jamo_forms", HB_TAG('v', 'j', 'm', 'o'), Variant::Type::INT, true); + _insert_feature("vertical_kana_alternates", HB_TAG('v', 'k', 'n', 'a'), Variant::Type::INT, false); + _insert_feature("vertical_kerning", HB_TAG('v', 'k', 'r', 'n'), Variant::Type::BOOL, false); + _insert_feature("proportional_alternate_vertical_metrics", HB_TAG('v', 'p', 'a', 'l'), Variant::Type::BOOL, false); + _insert_feature("vertical_alternates_and_rotation", HB_TAG('v', 'r', 't', '2'), Variant::Type::INT, false); + _insert_feature("vertical_alternates_for_rotation", HB_TAG('v', 'r', 't', 'r'), Variant::Type::INT, false); + _insert_feature("slashed_zero", HB_TAG('z', 'e', 'r', 'o'), Variant::Type::BOOL, false); // Registered OpenType variation tag. - _insert_feature("italic", HB_TAG('i', 't', 'a', 'l')); - _insert_feature("optical_size", HB_TAG('o', 'p', 's', 'z')); - _insert_feature("slant", HB_TAG('s', 'l', 'n', 't')); - _insert_feature("width", HB_TAG('w', 'd', 't', 'h')); - _insert_feature("weight", HB_TAG('w', 'g', 'h', 't')); + _insert_feature("italic", HB_TAG('i', 't', 'a', 'l'), Variant::Type::INT, false); + _insert_feature("optical_size", HB_TAG('o', 'p', 's', 'z'), Variant::Type::INT, false); + _insert_feature("slant", HB_TAG('s', 'l', 'n', 't'), Variant::Type::INT, false); + _insert_feature("width", HB_TAG('w', 'd', 't', 'h'), Variant::Type::INT, false); + _insert_feature("weight", HB_TAG('w', 'g', 'h', 't'), Variant::Type::INT, false); } int64_t TextServerAdvanced::name_to_tag(const String &p_name) const { @@ -740,9 +748,23 @@ int64_t TextServerAdvanced::name_to_tag(const String &p_name) const { return hb_tag_from_string(p_name.replace("custom_", "").ascii().get_data(), -1); } +Variant::Type TextServerAdvanced::_get_tag_type(int64_t p_tag) const { + if (feature_sets_inv.has(p_tag)) { + return feature_sets_inv[p_tag].vtype; + } + return Variant::Type::INT; +} + +bool TextServerAdvanced::_get_tag_hidden(int64_t p_tag) const { + if (feature_sets_inv.has(p_tag)) { + return feature_sets_inv[p_tag].hidden; + } + return false; +} + String TextServerAdvanced::tag_to_name(int64_t p_tag) const { if (feature_sets_inv.has(p_tag)) { - return feature_sets_inv[p_tag]; + return feature_sets_inv[p_tag].name; } // No readable name, use tag string. @@ -756,7 +778,7 @@ String TextServerAdvanced::tag_to_name(int64_t p_tag) const { /* Font Glyph Rendering */ /*************************************************************************/ -_FORCE_INLINE_ TextServerAdvanced::FontTexturePosition TextServerAdvanced::find_texture_pos_for_glyph(FontDataForSizeAdvanced *p_data, int p_color_size, Image::Format p_image_format, int p_width, int p_height, bool p_msdf) const { +_FORCE_INLINE_ TextServerAdvanced::FontTexturePosition TextServerAdvanced::find_texture_pos_for_glyph(FontForSizeAdvanced *p_data, int p_color_size, Image::Format p_image_format, int p_width, int p_height, bool p_msdf) const { FontTexturePosition ret; ret.index = -1; @@ -953,7 +975,7 @@ void TextServerAdvanced::_generateMTSDF_threaded(uint32_t y, void *p_td) const { } } -_FORCE_INLINE_ TextServerAdvanced::FontGlyph TextServerAdvanced::rasterize_msdf(FontDataAdvanced *p_font_data, FontDataForSizeAdvanced *p_data, int p_pixel_range, int p_rect_margin, FT_Outline *outline, const Vector2 &advance) const { +_FORCE_INLINE_ TextServerAdvanced::FontGlyph TextServerAdvanced::rasterize_msdf(FontAdvanced *p_font_data, FontForSizeAdvanced *p_data, int p_pixel_range, int p_rect_margin, FT_Outline *outline, const Vector2 &advance) const { msdfgen::Shape shape; shape.contours.clear(); @@ -1059,7 +1081,7 @@ _FORCE_INLINE_ TextServerAdvanced::FontGlyph TextServerAdvanced::rasterize_msdf( #endif #ifdef MODULE_FREETYPE_ENABLED -_FORCE_INLINE_ TextServerAdvanced::FontGlyph TextServerAdvanced::rasterize_bitmap(FontDataForSizeAdvanced *p_data, int p_rect_margin, FT_Bitmap bitmap, int yofs, int xofs, const Vector2 &advance) const { +_FORCE_INLINE_ TextServerAdvanced::FontGlyph TextServerAdvanced::rasterize_bitmap(FontForSizeAdvanced *p_data, int p_rect_margin, FT_Bitmap bitmap, int yofs, int xofs, const Vector2 &advance) const { int w = bitmap.width; int h = bitmap.rows; @@ -1136,12 +1158,12 @@ _FORCE_INLINE_ TextServerAdvanced::FontGlyph TextServerAdvanced::rasterize_bitma /* Font Cache */ /*************************************************************************/ -_FORCE_INLINE_ bool TextServerAdvanced::_ensure_glyph(FontDataAdvanced *p_font_data, const Vector2i &p_size, int32_t p_glyph) const { +_FORCE_INLINE_ bool TextServerAdvanced::_ensure_glyph(FontAdvanced *p_font_data, const Vector2i &p_size, int32_t p_glyph) const { ERR_FAIL_COND_V(!_ensure_cache_for_size(p_font_data, p_size), false); int32_t glyph_index = p_glyph & 0xffffff; // Remove subpixel shifts. - FontDataForSizeAdvanced *fd = p_font_data->cache[p_size]; + FontForSizeAdvanced *fd = p_font_data->cache[p_size]; if (fd->glyph_map.has(p_glyph)) { return fd->glyph_map[p_glyph].found; } @@ -1260,13 +1282,13 @@ _FORCE_INLINE_ bool TextServerAdvanced::_ensure_glyph(FontDataAdvanced *p_font_d return false; } -_FORCE_INLINE_ bool TextServerAdvanced::_ensure_cache_for_size(FontDataAdvanced *p_font_data, const Vector2i &p_size) const { +_FORCE_INLINE_ bool TextServerAdvanced::_ensure_cache_for_size(FontAdvanced *p_font_data, const Vector2i &p_size) const { ERR_FAIL_COND_V(p_size.x <= 0, false); if (p_font_data->cache.has(p_size)) { return true; } - FontDataForSizeAdvanced *fd = memnew(FontDataForSizeAdvanced); + FontForSizeAdvanced *fd = memnew(FontForSizeAdvanced); fd->size = p_size; if (p_font_data->data_ptr && (p_font_data->data_size > 0)) { // Init dynamic font. @@ -1358,21 +1380,23 @@ _FORCE_INLINE_ bool TextServerAdvanced::_ensure_cache_for_size(FontDataAdvanced if (fd->face->face_flags & FT_FACE_FLAG_FIXED_WIDTH) { p_font_data->style_flags |= FONT_FIXED_WIDTH; } + + hb_face_t *hb_face = hb_font_get_face(fd->hb_handle); // Get supported scripts from OpenType font data. p_font_data->supported_scripts.clear(); - unsigned int count = hb_ot_layout_table_get_script_tags(hb_font_get_face(fd->hb_handle), HB_OT_TAG_GSUB, 0, nullptr, nullptr); + unsigned int count = hb_ot_layout_table_get_script_tags(hb_face, HB_OT_TAG_GSUB, 0, nullptr, nullptr); if (count != 0) { hb_tag_t *script_tags = (hb_tag_t *)memalloc(count * sizeof(hb_tag_t)); - hb_ot_layout_table_get_script_tags(hb_font_get_face(fd->hb_handle), HB_OT_TAG_GSUB, 0, &count, script_tags); + hb_ot_layout_table_get_script_tags(hb_face, HB_OT_TAG_GSUB, 0, &count, script_tags); for (unsigned int i = 0; i < count; i++) { p_font_data->supported_scripts.insert(script_tags[i]); } memfree(script_tags); } - count = hb_ot_layout_table_get_script_tags(hb_font_get_face(fd->hb_handle), HB_OT_TAG_GPOS, 0, nullptr, nullptr); + count = hb_ot_layout_table_get_script_tags(hb_face, HB_OT_TAG_GPOS, 0, nullptr, nullptr); if (count != 0) { hb_tag_t *script_tags = (hb_tag_t *)memalloc(count * sizeof(hb_tag_t)); - hb_ot_layout_table_get_script_tags(hb_font_get_face(fd->hb_handle), HB_OT_TAG_GPOS, 0, &count, script_tags); + hb_ot_layout_table_get_script_tags(hb_face, HB_OT_TAG_GPOS, 0, &count, script_tags); for (unsigned int i = 0; i < count; i++) { p_font_data->supported_scripts.insert(script_tags[i]); } @@ -1596,21 +1620,47 @@ _FORCE_INLINE_ bool TextServerAdvanced::_ensure_cache_for_size(FontDataAdvanced // Read OpenType feature tags. p_font_data->supported_features.clear(); - count = hb_ot_layout_table_get_feature_tags(hb_font_get_face(fd->hb_handle), HB_OT_TAG_GSUB, 0, nullptr, nullptr); + count = hb_ot_layout_table_get_feature_tags(hb_face, HB_OT_TAG_GSUB, 0, nullptr, nullptr); if (count != 0) { hb_tag_t *feature_tags = (hb_tag_t *)memalloc(count * sizeof(hb_tag_t)); - hb_ot_layout_table_get_feature_tags(hb_font_get_face(fd->hb_handle), HB_OT_TAG_GSUB, 0, &count, feature_tags); + hb_ot_layout_table_get_feature_tags(hb_face, HB_OT_TAG_GSUB, 0, &count, feature_tags); for (unsigned int i = 0; i < count; i++) { - p_font_data->supported_features[feature_tags[i]] = 1; + Dictionary ftr; + + hb_ot_name_id_t lbl_id; + if (hb_ot_layout_feature_get_name_ids(hb_face, HB_OT_TAG_GSUB, i, &lbl_id, nullptr, nullptr, nullptr, nullptr)) { + String lbl; + unsigned int text_size = hb_ot_name_get_utf32(hb_face, lbl_id, hb_language_from_string(TranslationServer::get_singleton()->get_tool_locale().ascii().get_data(), -1), nullptr, nullptr) + 1; + lbl.resize(text_size); + hb_ot_name_get_utf32(hb_face, lbl_id, hb_language_from_string(TranslationServer::get_singleton()->get_tool_locale().ascii().get_data(), -1), &text_size, (uint32_t *)lbl.ptrw()); + ftr["label"] = lbl; + } + ftr["type"] = _get_tag_type(feature_tags[i]); + ftr["hidden"] = _get_tag_hidden(feature_tags[i]); + + p_font_data->supported_features[feature_tags[i]] = ftr; } memfree(feature_tags); } - count = hb_ot_layout_table_get_feature_tags(hb_font_get_face(fd->hb_handle), HB_OT_TAG_GPOS, 0, nullptr, nullptr); + count = hb_ot_layout_table_get_feature_tags(hb_face, HB_OT_TAG_GPOS, 0, nullptr, nullptr); if (count != 0) { hb_tag_t *feature_tags = (hb_tag_t *)memalloc(count * sizeof(hb_tag_t)); - hb_ot_layout_table_get_feature_tags(hb_font_get_face(fd->hb_handle), HB_OT_TAG_GPOS, 0, &count, feature_tags); + hb_ot_layout_table_get_feature_tags(hb_face, HB_OT_TAG_GPOS, 0, &count, feature_tags); for (unsigned int i = 0; i < count; i++) { - p_font_data->supported_features[feature_tags[i]] = 1; + Dictionary ftr; + + hb_ot_name_id_t lbl_id; + if (hb_ot_layout_feature_get_name_ids(hb_face, HB_OT_TAG_GPOS, i, &lbl_id, nullptr, nullptr, nullptr, nullptr)) { + String lbl; + unsigned int text_size = hb_ot_name_get_utf32(hb_face, lbl_id, hb_language_from_string(TranslationServer::get_singleton()->get_tool_locale().ascii().get_data(), -1), nullptr, nullptr) + 1; + lbl.resize(text_size); + hb_ot_name_get_utf32(hb_face, lbl_id, hb_language_from_string(TranslationServer::get_singleton()->get_tool_locale().ascii().get_data(), -1), &text_size, (uint32_t *)lbl.ptrw()); + ftr["label"] = lbl; + } + ftr["type"] = _get_tag_type(feature_tags[i]); + ftr["hidden"] = _get_tag_hidden(feature_tags[i]); + + p_font_data->supported_features[feature_tags[i]] = ftr; } memfree(feature_tags); } @@ -1676,8 +1726,8 @@ _FORCE_INLINE_ bool TextServerAdvanced::_ensure_cache_for_size(FontDataAdvanced return true; } -_FORCE_INLINE_ void TextServerAdvanced::_font_clear_cache(FontDataAdvanced *p_font_data) { - for (const KeyValue<Vector2i, FontDataForSizeAdvanced *> &E : p_font_data->cache) { +_FORCE_INLINE_ void TextServerAdvanced::_font_clear_cache(FontAdvanced *p_font_data) { + for (const KeyValue<Vector2i, FontForSizeAdvanced *> &E : p_font_data->cache) { memdelete(E.value); } p_font_data->cache.clear(); @@ -1688,7 +1738,7 @@ _FORCE_INLINE_ void TextServerAdvanced::_font_clear_cache(FontDataAdvanced *p_fo } hb_font_t *TextServerAdvanced::_font_get_hb_handle(const RID &p_font_rid, int64_t p_size) const { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, nullptr); MutexLock lock(fd->mutex); @@ -1702,13 +1752,13 @@ hb_font_t *TextServerAdvanced::_font_get_hb_handle(const RID &p_font_rid, int64_ RID TextServerAdvanced::create_font() { _THREAD_SAFE_METHOD_ - FontDataAdvanced *fd = memnew(FontDataAdvanced); + FontAdvanced *fd = memnew(FontAdvanced); return font_owner.make_rid(fd); } void TextServerAdvanced::font_set_data(const RID &p_font_rid, const PackedByteArray &p_data) { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1719,7 +1769,7 @@ void TextServerAdvanced::font_set_data(const RID &p_font_rid, const PackedByteAr } void TextServerAdvanced::font_set_data_ptr(const RID &p_font_rid, const uint8_t *p_data_ptr, int64_t p_data_size) { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1733,7 +1783,7 @@ void TextServerAdvanced::font_set_face_index(const RID &p_font_rid, int64_t p_fa ERR_FAIL_COND(p_face_index < 0); ERR_FAIL_COND(p_face_index >= 0x7FFF); - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1744,7 +1794,7 @@ void TextServerAdvanced::font_set_face_index(const RID &p_font_rid, int64_t p_fa } int64_t TextServerAdvanced::font_get_face_index(const RID &p_font_rid) const { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, 0); MutexLock lock(fd->mutex); @@ -1752,7 +1802,7 @@ int64_t TextServerAdvanced::font_get_face_index(const RID &p_font_rid) const { } int64_t TextServerAdvanced::font_get_face_count(const RID &p_font_rid) const { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, 0); MutexLock lock(fd->mutex); @@ -1793,7 +1843,7 @@ int64_t TextServerAdvanced::font_get_face_count(const RID &p_font_rid) const { } void TextServerAdvanced::font_set_style(const RID &p_font_rid, int64_t /*FontStyle*/ p_style) { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1803,7 +1853,7 @@ void TextServerAdvanced::font_set_style(const RID &p_font_rid, int64_t /*FontSty } int64_t /*FontStyle*/ TextServerAdvanced::font_get_style(const RID &p_font_rid) const { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, 0); MutexLock lock(fd->mutex); @@ -1813,7 +1863,7 @@ int64_t /*FontStyle*/ TextServerAdvanced::font_get_style(const RID &p_font_rid) } void TextServerAdvanced::font_set_style_name(const RID &p_font_rid, const String &p_name) { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1823,7 +1873,7 @@ void TextServerAdvanced::font_set_style_name(const RID &p_font_rid, const String } String TextServerAdvanced::font_get_style_name(const RID &p_font_rid) const { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, String()); MutexLock lock(fd->mutex); @@ -1833,7 +1883,7 @@ String TextServerAdvanced::font_get_style_name(const RID &p_font_rid) const { } void TextServerAdvanced::font_set_name(const RID &p_font_rid, const String &p_name) { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1843,7 +1893,7 @@ void TextServerAdvanced::font_set_name(const RID &p_font_rid, const String &p_na } String TextServerAdvanced::font_get_name(const RID &p_font_rid) const { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, String()); MutexLock lock(fd->mutex); @@ -1853,7 +1903,7 @@ String TextServerAdvanced::font_get_name(const RID &p_font_rid) const { } void TextServerAdvanced::font_set_antialiased(const RID &p_font_rid, bool p_antialiased) { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1864,7 +1914,7 @@ void TextServerAdvanced::font_set_antialiased(const RID &p_font_rid, bool p_anti } bool TextServerAdvanced::font_is_antialiased(const RID &p_font_rid) const { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, false); MutexLock lock(fd->mutex); @@ -1872,12 +1922,12 @@ bool TextServerAdvanced::font_is_antialiased(const RID &p_font_rid) const { } void TextServerAdvanced::font_set_generate_mipmaps(const RID &p_font_rid, bool p_generate_mipmaps) { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); if (fd->mipmaps != p_generate_mipmaps) { - for (KeyValue<Vector2i, FontDataForSizeAdvanced *> &E : fd->cache) { + for (KeyValue<Vector2i, FontForSizeAdvanced *> &E : fd->cache) { for (int i = 0; i < E.value->textures.size(); i++) { E.value->textures.write[i].dirty = true; } @@ -1887,7 +1937,7 @@ void TextServerAdvanced::font_set_generate_mipmaps(const RID &p_font_rid, bool p } bool TextServerAdvanced::font_get_generate_mipmaps(const RID &p_font_rid) const { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, false); MutexLock lock(fd->mutex); @@ -1895,7 +1945,7 @@ bool TextServerAdvanced::font_get_generate_mipmaps(const RID &p_font_rid) const } void TextServerAdvanced::font_set_multichannel_signed_distance_field(const RID &p_font_rid, bool p_msdf) { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1906,7 +1956,7 @@ void TextServerAdvanced::font_set_multichannel_signed_distance_field(const RID & } bool TextServerAdvanced::font_is_multichannel_signed_distance_field(const RID &p_font_rid) const { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, false); MutexLock lock(fd->mutex); @@ -1914,7 +1964,7 @@ bool TextServerAdvanced::font_is_multichannel_signed_distance_field(const RID &p } void TextServerAdvanced::font_set_msdf_pixel_range(const RID &p_font_rid, int64_t p_msdf_pixel_range) { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1925,7 +1975,7 @@ void TextServerAdvanced::font_set_msdf_pixel_range(const RID &p_font_rid, int64_ } int64_t TextServerAdvanced::font_get_msdf_pixel_range(const RID &p_font_rid) const { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, false); MutexLock lock(fd->mutex); @@ -1933,7 +1983,7 @@ int64_t TextServerAdvanced::font_get_msdf_pixel_range(const RID &p_font_rid) con } void TextServerAdvanced::font_set_msdf_size(const RID &p_font_rid, int64_t p_msdf_size) { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1944,7 +1994,7 @@ void TextServerAdvanced::font_set_msdf_size(const RID &p_font_rid, int64_t p_msd } int64_t TextServerAdvanced::font_get_msdf_size(const RID &p_font_rid) const { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, false); MutexLock lock(fd->mutex); @@ -1952,7 +2002,7 @@ int64_t TextServerAdvanced::font_get_msdf_size(const RID &p_font_rid) const { } void TextServerAdvanced::font_set_fixed_size(const RID &p_font_rid, int64_t p_fixed_size) { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1960,7 +2010,7 @@ void TextServerAdvanced::font_set_fixed_size(const RID &p_font_rid, int64_t p_fi } int64_t TextServerAdvanced::font_get_fixed_size(const RID &p_font_rid) const { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, false); MutexLock lock(fd->mutex); @@ -1968,7 +2018,7 @@ int64_t TextServerAdvanced::font_get_fixed_size(const RID &p_font_rid) const { } void TextServerAdvanced::font_set_force_autohinter(const RID &p_font_rid, bool p_force_autohinter) { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1979,7 +2029,7 @@ void TextServerAdvanced::font_set_force_autohinter(const RID &p_font_rid, bool p } bool TextServerAdvanced::font_is_force_autohinter(const RID &p_font_rid) const { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, false); MutexLock lock(fd->mutex); @@ -1987,7 +2037,7 @@ bool TextServerAdvanced::font_is_force_autohinter(const RID &p_font_rid) const { } void TextServerAdvanced::font_set_hinting(const RID &p_font_rid, TextServer::Hinting p_hinting) { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1998,7 +2048,7 @@ void TextServerAdvanced::font_set_hinting(const RID &p_font_rid, TextServer::Hin } TextServer::Hinting TextServerAdvanced::font_get_hinting(const RID &p_font_rid) const { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, HINTING_NONE); MutexLock lock(fd->mutex); @@ -2006,7 +2056,7 @@ TextServer::Hinting TextServerAdvanced::font_get_hinting(const RID &p_font_rid) } void TextServerAdvanced::font_set_subpixel_positioning(const RID &p_font_rid, TextServer::SubpixelPositioning p_subpixel) { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -2014,7 +2064,7 @@ void TextServerAdvanced::font_set_subpixel_positioning(const RID &p_font_rid, Te } TextServer::SubpixelPositioning TextServerAdvanced::font_get_subpixel_positioning(const RID &p_font_rid) const { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, SUBPIXEL_POSITIONING_DISABLED); MutexLock lock(fd->mutex); @@ -2022,7 +2072,7 @@ TextServer::SubpixelPositioning TextServerAdvanced::font_get_subpixel_positionin } void TextServerAdvanced::font_set_embolden(const RID &p_font_rid, double p_strength) { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -2033,7 +2083,7 @@ void TextServerAdvanced::font_set_embolden(const RID &p_font_rid, double p_stren } double TextServerAdvanced::font_get_embolden(const RID &p_font_rid) const { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, 0.0); MutexLock lock(fd->mutex); @@ -2041,7 +2091,7 @@ double TextServerAdvanced::font_get_embolden(const RID &p_font_rid) const { } void TextServerAdvanced::font_set_transform(const RID &p_font_rid, const Transform2D &p_transform) { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -2052,7 +2102,7 @@ void TextServerAdvanced::font_set_transform(const RID &p_font_rid, const Transfo } Transform2D TextServerAdvanced::font_get_transform(const RID &p_font_rid) const { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Transform2D()); MutexLock lock(fd->mutex); @@ -2060,7 +2110,7 @@ Transform2D TextServerAdvanced::font_get_transform(const RID &p_font_rid) const } void TextServerAdvanced::font_set_variation_coordinates(const RID &p_font_rid, const Dictionary &p_variation_coordinates) { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -2071,7 +2121,7 @@ void TextServerAdvanced::font_set_variation_coordinates(const RID &p_font_rid, c } Dictionary TextServerAdvanced::font_get_variation_coordinates(const RID &p_font_rid) const { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Dictionary()); MutexLock lock(fd->mutex); @@ -2079,7 +2129,7 @@ Dictionary TextServerAdvanced::font_get_variation_coordinates(const RID &p_font_ } void TextServerAdvanced::font_set_oversampling(const RID &p_font_rid, double p_oversampling) { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -2090,7 +2140,7 @@ void TextServerAdvanced::font_set_oversampling(const RID &p_font_rid, double p_o } double TextServerAdvanced::font_get_oversampling(const RID &p_font_rid) const { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, 0.0); MutexLock lock(fd->mutex); @@ -2098,30 +2148,30 @@ double TextServerAdvanced::font_get_oversampling(const RID &p_font_rid) const { } Array TextServerAdvanced::font_get_size_cache_list(const RID &p_font_rid) const { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Array()); MutexLock lock(fd->mutex); Array ret; - for (const KeyValue<Vector2i, FontDataForSizeAdvanced *> &E : fd->cache) { + for (const KeyValue<Vector2i, FontForSizeAdvanced *> &E : fd->cache) { ret.push_back(E.key); } return ret; } void TextServerAdvanced::font_clear_size_cache(const RID &p_font_rid) { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); - for (const KeyValue<Vector2i, FontDataForSizeAdvanced *> &E : fd->cache) { + for (const KeyValue<Vector2i, FontForSizeAdvanced *> &E : fd->cache) { memdelete(E.value); } fd->cache.clear(); } void TextServerAdvanced::font_remove_size_cache(const RID &p_font_rid, const Vector2i &p_size) { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -2132,7 +2182,7 @@ void TextServerAdvanced::font_remove_size_cache(const RID &p_font_rid, const Vec } void TextServerAdvanced::font_set_ascent(const RID &p_font_rid, int64_t p_size, double p_ascent) { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -2143,7 +2193,7 @@ void TextServerAdvanced::font_set_ascent(const RID &p_font_rid, int64_t p_size, } double TextServerAdvanced::font_get_ascent(const RID &p_font_rid, int64_t p_size) const { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, 0.0); MutexLock lock(fd->mutex); @@ -2159,7 +2209,7 @@ double TextServerAdvanced::font_get_ascent(const RID &p_font_rid, int64_t p_size } void TextServerAdvanced::font_set_descent(const RID &p_font_rid, int64_t p_size, double p_descent) { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); Vector2i size = _get_size(fd, p_size); @@ -2169,7 +2219,7 @@ void TextServerAdvanced::font_set_descent(const RID &p_font_rid, int64_t p_size, } double TextServerAdvanced::font_get_descent(const RID &p_font_rid, int64_t p_size) const { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, 0.0); MutexLock lock(fd->mutex); @@ -2185,7 +2235,7 @@ double TextServerAdvanced::font_get_descent(const RID &p_font_rid, int64_t p_siz } void TextServerAdvanced::font_set_underline_position(const RID &p_font_rid, int64_t p_size, double p_underline_position) { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -2196,7 +2246,7 @@ void TextServerAdvanced::font_set_underline_position(const RID &p_font_rid, int6 } double TextServerAdvanced::font_get_underline_position(const RID &p_font_rid, int64_t p_size) const { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, 0.0); MutexLock lock(fd->mutex); @@ -2212,7 +2262,7 @@ double TextServerAdvanced::font_get_underline_position(const RID &p_font_rid, in } void TextServerAdvanced::font_set_underline_thickness(const RID &p_font_rid, int64_t p_size, double p_underline_thickness) { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -2223,7 +2273,7 @@ void TextServerAdvanced::font_set_underline_thickness(const RID &p_font_rid, int } double TextServerAdvanced::font_get_underline_thickness(const RID &p_font_rid, int64_t p_size) const { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, 0.0); MutexLock lock(fd->mutex); @@ -2239,7 +2289,7 @@ double TextServerAdvanced::font_get_underline_thickness(const RID &p_font_rid, i } void TextServerAdvanced::font_set_scale(const RID &p_font_rid, int64_t p_size, double p_scale) { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -2255,7 +2305,7 @@ void TextServerAdvanced::font_set_scale(const RID &p_font_rid, int64_t p_size, d } double TextServerAdvanced::font_get_scale(const RID &p_font_rid, int64_t p_size) const { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, 0.0); MutexLock lock(fd->mutex); @@ -2270,60 +2320,8 @@ double TextServerAdvanced::font_get_scale(const RID &p_font_rid, int64_t p_size) } } -void TextServerAdvanced::font_set_spacing(const RID &p_font_rid, int64_t p_size, TextServer::SpacingType p_spacing, int64_t p_value) { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); - ERR_FAIL_COND(!fd); - - MutexLock lock(fd->mutex); - Vector2i size = _get_size(fd, p_size); - - ERR_FAIL_COND(!_ensure_cache_for_size(fd, size)); - switch (p_spacing) { - case TextServer::SPACING_GLYPH: { - fd->cache[size]->spacing_glyph = p_value; - } break; - case TextServer::SPACING_SPACE: { - fd->cache[size]->spacing_space = p_value; - } break; - default: { - ERR_FAIL_MSG("Invalid spacing type: " + String::num_int64(p_spacing)); - } break; - } -} - -int64_t TextServerAdvanced::font_get_spacing(const RID &p_font_rid, int64_t p_size, TextServer::SpacingType p_spacing) const { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); - ERR_FAIL_COND_V(!fd, 0); - - MutexLock lock(fd->mutex); - Vector2i size = _get_size(fd, p_size); - - ERR_FAIL_COND_V(!_ensure_cache_for_size(fd, size), 0); - - switch (p_spacing) { - case TextServer::SPACING_GLYPH: { - if (fd->msdf) { - return fd->cache[size]->spacing_glyph * (double)p_size / (double)fd->msdf_source_size; - } else { - return fd->cache[size]->spacing_glyph; - } - } break; - case TextServer::SPACING_SPACE: { - if (fd->msdf) { - return fd->cache[size]->spacing_space * (double)p_size / (double)fd->msdf_source_size; - } else { - return fd->cache[size]->spacing_space; - } - } break; - default: { - ERR_FAIL_V_MSG(0, "Invalid spacing type: " + String::num_int64(p_spacing)); - } break; - } - return 0; -} - int64_t TextServerAdvanced::font_get_texture_count(const RID &p_font_rid, const Vector2i &p_size) const { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, 0); MutexLock lock(fd->mutex); @@ -2335,7 +2333,7 @@ int64_t TextServerAdvanced::font_get_texture_count(const RID &p_font_rid, const } void TextServerAdvanced::font_clear_textures(const RID &p_font_rid, const Vector2i &p_size) { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); Vector2i size = _get_size_outline(fd, p_size); @@ -2345,7 +2343,7 @@ void TextServerAdvanced::font_clear_textures(const RID &p_font_rid, const Vector } void TextServerAdvanced::font_remove_texture(const RID &p_font_rid, const Vector2i &p_size, int64_t p_texture_index) { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -2357,7 +2355,7 @@ void TextServerAdvanced::font_remove_texture(const RID &p_font_rid, const Vector } void TextServerAdvanced::font_set_texture_image(const RID &p_font_rid, const Vector2i &p_size, int64_t p_texture_index, const Ref<Image> &p_image) { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); ERR_FAIL_COND(p_image.is_null()); @@ -2390,7 +2388,7 @@ void TextServerAdvanced::font_set_texture_image(const RID &p_font_rid, const Vec } Ref<Image> TextServerAdvanced::font_get_texture_image(const RID &p_font_rid, const Vector2i &p_size, int64_t p_texture_index) const { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Ref<Image>()); MutexLock lock(fd->mutex); @@ -2407,7 +2405,7 @@ Ref<Image> TextServerAdvanced::font_get_texture_image(const RID &p_font_rid, con } void TextServerAdvanced::font_set_texture_offsets(const RID &p_font_rid, const Vector2i &p_size, int64_t p_texture_index, const PackedInt32Array &p_offset) { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -2423,7 +2421,7 @@ void TextServerAdvanced::font_set_texture_offsets(const RID &p_font_rid, const V } PackedInt32Array TextServerAdvanced::font_get_texture_offsets(const RID &p_font_rid, const Vector2i &p_size, int64_t p_texture_index) const { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, PackedInt32Array()); MutexLock lock(fd->mutex); @@ -2436,7 +2434,7 @@ PackedInt32Array TextServerAdvanced::font_get_texture_offsets(const RID &p_font_ } Array TextServerAdvanced::font_get_glyph_list(const RID &p_font_rid, const Vector2i &p_size) const { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Array()); MutexLock lock(fd->mutex); @@ -2452,7 +2450,7 @@ Array TextServerAdvanced::font_get_glyph_list(const RID &p_font_rid, const Vecto } void TextServerAdvanced::font_clear_glyphs(const RID &p_font_rid, const Vector2i &p_size) { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -2463,7 +2461,7 @@ void TextServerAdvanced::font_clear_glyphs(const RID &p_font_rid, const Vector2i } void TextServerAdvanced::font_remove_glyph(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -2474,7 +2472,7 @@ void TextServerAdvanced::font_remove_glyph(const RID &p_font_rid, const Vector2i } double TextServerAdvanced::_get_extra_advance(RID p_font_rid, int p_font_size) const { - const FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + const FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, 0.0); MutexLock lock(fd->mutex); @@ -2488,7 +2486,7 @@ double TextServerAdvanced::_get_extra_advance(RID p_font_rid, int p_font_size) c } Vector2 TextServerAdvanced::font_get_glyph_advance(const RID &p_font_rid, int64_t p_size, int64_t p_glyph) const { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Vector2()); MutexLock lock(fd->mutex); @@ -2516,7 +2514,7 @@ Vector2 TextServerAdvanced::font_get_glyph_advance(const RID &p_font_rid, int64_ } void TextServerAdvanced::font_set_glyph_advance(const RID &p_font_rid, int64_t p_size, int64_t p_glyph, const Vector2 &p_advance) { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -2531,7 +2529,7 @@ void TextServerAdvanced::font_set_glyph_advance(const RID &p_font_rid, int64_t p } Vector2 TextServerAdvanced::font_get_glyph_offset(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Vector2()); MutexLock lock(fd->mutex); @@ -2552,7 +2550,7 @@ Vector2 TextServerAdvanced::font_get_glyph_offset(const RID &p_font_rid, const V } void TextServerAdvanced::font_set_glyph_offset(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph, const Vector2 &p_offset) { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -2567,7 +2565,7 @@ void TextServerAdvanced::font_set_glyph_offset(const RID &p_font_rid, const Vect } Vector2 TextServerAdvanced::font_get_glyph_size(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Vector2()); MutexLock lock(fd->mutex); @@ -2588,7 +2586,7 @@ Vector2 TextServerAdvanced::font_get_glyph_size(const RID &p_font_rid, const Vec } void TextServerAdvanced::font_set_glyph_size(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph, const Vector2 &p_gl_size) { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -2603,7 +2601,7 @@ void TextServerAdvanced::font_set_glyph_size(const RID &p_font_rid, const Vector } Rect2 TextServerAdvanced::font_get_glyph_uv_rect(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Rect2()); MutexLock lock(fd->mutex); @@ -2619,7 +2617,7 @@ Rect2 TextServerAdvanced::font_get_glyph_uv_rect(const RID &p_font_rid, const Ve } void TextServerAdvanced::font_set_glyph_uv_rect(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph, const Rect2 &p_uv_rect) { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -2634,7 +2632,7 @@ void TextServerAdvanced::font_set_glyph_uv_rect(const RID &p_font_rid, const Vec } int64_t TextServerAdvanced::font_get_glyph_texture_idx(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, -1); MutexLock lock(fd->mutex); @@ -2650,7 +2648,7 @@ int64_t TextServerAdvanced::font_get_glyph_texture_idx(const RID &p_font_rid, co } void TextServerAdvanced::font_set_glyph_texture_idx(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph, int64_t p_texture_idx) { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -2665,7 +2663,7 @@ void TextServerAdvanced::font_set_glyph_texture_idx(const RID &p_font_rid, const } RID TextServerAdvanced::font_get_glyph_texture_rid(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, RID()); MutexLock lock(fd->mutex); @@ -2705,7 +2703,7 @@ RID TextServerAdvanced::font_get_glyph_texture_rid(const RID &p_font_rid, const } Size2 TextServerAdvanced::font_get_glyph_texture_size(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Size2()); MutexLock lock(fd->mutex); @@ -2745,7 +2743,7 @@ Size2 TextServerAdvanced::font_get_glyph_texture_size(const RID &p_font_rid, con } Dictionary TextServerAdvanced::font_get_glyph_contours(const RID &p_font_rid, int64_t p_size, int64_t p_index) const { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Dictionary()); MutexLock lock(fd->mutex); @@ -2795,7 +2793,7 @@ Dictionary TextServerAdvanced::font_get_glyph_contours(const RID &p_font_rid, in } Array TextServerAdvanced::font_get_kerning_list(const RID &p_font_rid, int64_t p_size) const { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Array()); MutexLock lock(fd->mutex); @@ -2804,14 +2802,14 @@ Array TextServerAdvanced::font_get_kerning_list(const RID &p_font_rid, int64_t p ERR_FAIL_COND_V(!_ensure_cache_for_size(fd, size), Array()); Array ret; - for (const KeyValue<Vector2i, FontDataForSizeAdvanced *> &E : fd->cache) { + for (const KeyValue<Vector2i, FontForSizeAdvanced *> &E : fd->cache) { ret.push_back(E.key); } return ret; } void TextServerAdvanced::font_clear_kerning_map(const RID &p_font_rid, int64_t p_size) { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -2822,7 +2820,7 @@ void TextServerAdvanced::font_clear_kerning_map(const RID &p_font_rid, int64_t p } void TextServerAdvanced::font_remove_kerning(const RID &p_font_rid, int64_t p_size, const Vector2i &p_glyph_pair) { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -2833,7 +2831,7 @@ void TextServerAdvanced::font_remove_kerning(const RID &p_font_rid, int64_t p_si } void TextServerAdvanced::font_set_kerning(const RID &p_font_rid, int64_t p_size, const Vector2i &p_glyph_pair, const Vector2 &p_kerning) { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -2844,7 +2842,7 @@ void TextServerAdvanced::font_set_kerning(const RID &p_font_rid, int64_t p_size, } Vector2 TextServerAdvanced::font_get_kerning(const RID &p_font_rid, int64_t p_size, const Vector2i &p_glyph_pair) const { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Vector2()); MutexLock lock(fd->mutex); @@ -2877,7 +2875,7 @@ Vector2 TextServerAdvanced::font_get_kerning(const RID &p_font_rid, int64_t p_si } int64_t TextServerAdvanced::font_get_glyph_index(const RID &p_font_rid, int64_t p_size, int64_t p_char, int64_t p_variation_selector) const { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, 0); ERR_FAIL_COND_V_MSG((p_char >= 0xd800 && p_char <= 0xdfff) || (p_char > 0x10ffff), 0, "Unicode parsing error: Invalid unicode codepoint " + String::num_int64(p_char, 16) + "."); ERR_FAIL_COND_V_MSG((p_variation_selector >= 0xd800 && p_variation_selector <= 0xdfff) || (p_variation_selector > 0x10ffff), 0, "Unicode parsing error: Invalid unicode codepoint " + String::num_int64(p_variation_selector, 16) + "."); @@ -2902,7 +2900,7 @@ int64_t TextServerAdvanced::font_get_glyph_index(const RID &p_font_rid, int64_t } bool TextServerAdvanced::font_has_char(const RID &p_font_rid, int64_t p_char) const { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, false); ERR_FAIL_COND_V_MSG((p_char >= 0xd800 && p_char <= 0xdfff) || (p_char > 0x10ffff), false, "Unicode parsing error: Invalid unicode codepoint " + String::num_int64(p_char, 16) + "."); @@ -2910,7 +2908,7 @@ bool TextServerAdvanced::font_has_char(const RID &p_font_rid, int64_t p_char) co if (fd->cache.is_empty()) { ERR_FAIL_COND_V(!_ensure_cache_for_size(fd, fd->msdf ? Vector2i(fd->msdf_source_size, 0) : Vector2i(16, 0)), false); } - FontDataForSizeAdvanced *at_size = fd->cache.begin()->value; + FontForSizeAdvanced *at_size = fd->cache.begin()->value; #ifdef MODULE_FREETYPE_ENABLED if (at_size && at_size->face) { @@ -2921,14 +2919,14 @@ bool TextServerAdvanced::font_has_char(const RID &p_font_rid, int64_t p_char) co } String TextServerAdvanced::font_get_supported_chars(const RID &p_font_rid) const { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, String()); MutexLock lock(fd->mutex); if (fd->cache.is_empty()) { ERR_FAIL_COND_V(!_ensure_cache_for_size(fd, fd->msdf ? Vector2i(fd->msdf_source_size, 0) : Vector2i(16, 0)), String()); } - FontDataForSizeAdvanced *at_size = fd->cache.begin()->value; + FontForSizeAdvanced *at_size = fd->cache.begin()->value; String chars; #ifdef MODULE_FREETYPE_ENABLED @@ -2954,7 +2952,7 @@ String TextServerAdvanced::font_get_supported_chars(const RID &p_font_rid) const } void TextServerAdvanced::font_render_range(const RID &p_font_rid, const Vector2i &p_size, int64_t p_start, int64_t p_end) { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); ERR_FAIL_COND_MSG((p_start >= 0xd800 && p_start <= 0xdfff) || (p_start > 0x10ffff), "Unicode parsing error: Invalid unicode codepoint " + String::num_int64(p_start, 16) + "."); ERR_FAIL_COND_MSG((p_end >= 0xd800 && p_end <= 0xdfff) || (p_end > 0x10ffff), "Unicode parsing error: Invalid unicode codepoint " + String::num_int64(p_end, 16) + "."); @@ -2987,7 +2985,7 @@ void TextServerAdvanced::font_render_range(const RID &p_font_rid, const Vector2i } void TextServerAdvanced::font_render_glyph(const RID &p_font_rid, const Vector2i &p_size, int64_t p_index) { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -3016,7 +3014,7 @@ void TextServerAdvanced::font_render_glyph(const RID &p_font_rid, const Vector2i } void TextServerAdvanced::font_draw_glyph(const RID &p_font_rid, const RID &p_canvas, int64_t p_size, const Vector2 &p_pos, int64_t p_index, const Color &p_color) const { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -3095,7 +3093,7 @@ void TextServerAdvanced::font_draw_glyph(const RID &p_font_rid, const RID &p_can } void TextServerAdvanced::font_draw_glyph_outline(const RID &p_font_rid, const RID &p_canvas, int64_t p_size, int64_t p_outline_size, const Vector2 &p_pos, int64_t p_index, const Color &p_color) const { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -3174,7 +3172,7 @@ void TextServerAdvanced::font_draw_glyph_outline(const RID &p_font_rid, const RI } bool TextServerAdvanced::font_is_language_supported(const RID &p_font_rid, const String &p_language) const { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, false); MutexLock lock(fd->mutex); @@ -3186,7 +3184,7 @@ bool TextServerAdvanced::font_is_language_supported(const RID &p_font_rid, const } void TextServerAdvanced::font_set_language_support_override(const RID &p_font_rid, const String &p_language, bool p_supported) { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -3194,7 +3192,7 @@ void TextServerAdvanced::font_set_language_support_override(const RID &p_font_ri } bool TextServerAdvanced::font_get_language_support_override(const RID &p_font_rid, const String &p_language) { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, false); MutexLock lock(fd->mutex); @@ -3202,7 +3200,7 @@ bool TextServerAdvanced::font_get_language_support_override(const RID &p_font_ri } void TextServerAdvanced::font_remove_language_support_override(const RID &p_font_rid, const String &p_language) { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -3210,7 +3208,7 @@ void TextServerAdvanced::font_remove_language_support_override(const RID &p_font } PackedStringArray TextServerAdvanced::font_get_language_support_overrides(const RID &p_font_rid) { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, PackedStringArray()); MutexLock lock(fd->mutex); @@ -3222,7 +3220,7 @@ PackedStringArray TextServerAdvanced::font_get_language_support_overrides(const } bool TextServerAdvanced::font_is_script_supported(const RID &p_font_rid, const String &p_script) const { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, false); MutexLock lock(fd->mutex); @@ -3236,7 +3234,7 @@ bool TextServerAdvanced::font_is_script_supported(const RID &p_font_rid, const S } void TextServerAdvanced::font_set_script_support_override(const RID &p_font_rid, const String &p_script, bool p_supported) { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -3244,7 +3242,7 @@ void TextServerAdvanced::font_set_script_support_override(const RID &p_font_rid, } bool TextServerAdvanced::font_get_script_support_override(const RID &p_font_rid, const String &p_script) { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, false); MutexLock lock(fd->mutex); @@ -3252,7 +3250,7 @@ bool TextServerAdvanced::font_get_script_support_override(const RID &p_font_rid, } void TextServerAdvanced::font_remove_script_support_override(const RID &p_font_rid, const String &p_script) { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -3260,7 +3258,7 @@ void TextServerAdvanced::font_remove_script_support_override(const RID &p_font_r } PackedStringArray TextServerAdvanced::font_get_script_support_overrides(const RID &p_font_rid) { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, PackedStringArray()); MutexLock lock(fd->mutex); @@ -3272,7 +3270,7 @@ PackedStringArray TextServerAdvanced::font_get_script_support_overrides(const RI } void TextServerAdvanced::font_set_opentype_feature_overrides(const RID &p_font_rid, const Dictionary &p_overrides) { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -3282,7 +3280,7 @@ void TextServerAdvanced::font_set_opentype_feature_overrides(const RID &p_font_r } Dictionary TextServerAdvanced::font_get_opentype_feature_overrides(const RID &p_font_rid) const { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Dictionary()); MutexLock lock(fd->mutex); @@ -3290,7 +3288,7 @@ Dictionary TextServerAdvanced::font_get_opentype_feature_overrides(const RID &p_ } Dictionary TextServerAdvanced::font_supported_feature_list(const RID &p_font_rid) const { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Dictionary()); MutexLock lock(fd->mutex); @@ -3300,7 +3298,7 @@ Dictionary TextServerAdvanced::font_supported_feature_list(const RID &p_font_rid } Dictionary TextServerAdvanced::font_supported_variation_list(const RID &p_font_rid) const { - FontDataAdvanced *fd = font_owner.get_or_null(p_font_rid); + FontAdvanced *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Dictionary()); MutexLock lock(fd->mutex); @@ -3580,6 +3578,31 @@ bool TextServerAdvanced::shaped_text_get_preserve_control(const RID &p_shaped) c return sd->preserve_control; } +void TextServerAdvanced::shaped_text_set_spacing(const RID &p_shaped, SpacingType p_spacing, int64_t p_value) { + ERR_FAIL_INDEX((int)p_spacing, 4); + ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); + ERR_FAIL_COND(!sd); + + MutexLock lock(sd->mutex); + if (sd->extra_spacing[p_spacing] != p_value) { + if (sd->parent != RID()) { + full_copy(sd); + } + sd->extra_spacing[p_spacing] = p_value; + invalidate(sd, false); + } +} + +int64_t TextServerAdvanced::shaped_text_get_spacing(const RID &p_shaped, SpacingType p_spacing) const { + ERR_FAIL_INDEX_V((int)p_spacing, 4, 0); + + const ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); + ERR_FAIL_COND_V(!sd, 0); + + MutexLock lock(sd->mutex); + return sd->extra_spacing[p_spacing]; +} + TextServer::Orientation TextServerAdvanced::shaped_text_get_orientation(const RID &p_shaped) const { const ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, TextServer::ORIENTATION_HORIZONTAL); @@ -3847,6 +3870,9 @@ RID TextServerAdvanced::shaped_text_substr(const RID &p_shaped, int64_t p_start, new_sd->direction = sd->direction; new_sd->custom_punct = sd->custom_punct; new_sd->para_direction = sd->para_direction; + for (int i = 0; i < TextServer::SPACING_MAX; i++) { + new_sd->extra_spacing[i] = sd->extra_spacing[i]; + } if (!_shape_substr(new_sd, sd, p_start, p_length)) { memdelete(new_sd); @@ -4257,7 +4283,7 @@ void TextServerAdvanced::shaped_text_overrun_trim_to_width(const RID &p_shaped_l int ellipsis_width = 0; if (add_ellipsis && whitespace_gl_font_rid.is_valid()) { - ellipsis_width = 3 * dot_adv.x + font_get_spacing(whitespace_gl_font_rid, last_gl_font_size, SPACING_GLYPH) + (cut_per_word ? whitespace_adv.x : 0); + ellipsis_width = 3 * dot_adv.x + sd->extra_spacing[SPACING_GLYPH] + (cut_per_word ? whitespace_adv.x : 0); } int ell_min_characters = 6; @@ -4405,7 +4431,7 @@ bool TextServerAdvanced::shaped_text_update_breaks(const RID &p_shaped) { i++; } int r_end = sd->spans[i].end; - UBreakIterator *bi = ubrk_open(UBRK_LINE, language.ascii().get_data(), data + _convert_pos_inv(sd, r_start), _convert_pos_inv(sd, r_end - r_start), &err); + UBreakIterator *bi = ubrk_open(UBRK_LINE, (language.is_empty()) ? TranslationServer::get_singleton()->get_tool_locale().ascii().get_data() : language.ascii().get_data(), data + _convert_pos_inv(sd, r_start), _convert_pos_inv(sd, r_end - r_start), &err); if (U_FAILURE(err)) { // No data loaded - use fallback. for (int j = r_start; j < r_end; j++) { @@ -4851,15 +4877,16 @@ void TextServerAdvanced::_shape_run(ShapedTextDataAdvanced *p_sd, int64_t p_star } RID f = p_fonts[p_fb_index]; - FontDataAdvanced *fd = font_owner.get_or_null(f); + FontAdvanced *fd = font_owner.get_or_null(f); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); Vector2i fss = _get_size(fd, fs); hb_font_t *hb_font = _font_get_hb_handle(f, fs); double scale = font_get_scale(f, fs); - double sp_sp = font_get_spacing(f, fs, SPACING_SPACE); - double sp_gl = font_get_spacing(f, fs, SPACING_GLYPH); + double sp_sp = p_sd->extra_spacing[SPACING_SPACE]; + double sp_gl = p_sd->extra_spacing[SPACING_GLYPH]; + bool last_run = (p_sd->end == p_end); double ea = _get_extra_advance(f, fs); bool subpos = (font_get_subpixel_positioning(f) == SUBPIXEL_POSITIONING_ONE_HALF) || (font_get_subpixel_positioning(f) == SUBPIXEL_POSITIONING_ONE_QUARTER) || (font_get_subpixel_positioning(f) == SUBPIXEL_POSITIONING_AUTO && fs <= SUBPIXEL_POSITIONING_ONE_HALF_MAX_SIZE); ERR_FAIL_COND(hb_font == nullptr); @@ -4873,7 +4900,10 @@ void TextServerAdvanced::_shape_run(ShapedTextDataAdvanced *p_sd, int64_t p_star } hb_buffer_set_script(p_sd->hb_buffer, p_script); - if (!p_sd->spans[p_span].language.is_empty()) { + if (p_sd->spans[p_span].language.is_empty()) { + hb_language_t lang = hb_language_from_string(TranslationServer::get_singleton()->get_tool_locale().ascii().get_data(), -1); + hb_buffer_set_language(p_sd->hb_buffer, lang); + } else { hb_language_t lang = hb_language_from_string(p_sd->spans[p_span].language.ascii().get_data(), -1); hb_buffer_set_language(p_sd->hb_buffer, lang); } @@ -4954,10 +4984,13 @@ void TextServerAdvanced::_shape_run(ShapedTextDataAdvanced *p_sd, int64_t p_star } gl.y_off = -Math::round(glyph_pos[i].y_offset / (64.0 / scale)); } - if (sp_sp && is_whitespace(p_sd->text[glyph_info[i].cluster])) { - gl.advance += sp_sp; - } else { - gl.advance += sp_gl; + if (!last_run || i < glyph_count - 1) { + // Do not add extra spacing to the last glyph of the string. + if (sp_sp && is_whitespace(p_sd->text[glyph_info[i].cluster])) { + gl.advance += sp_sp; + } else { + gl.advance += sp_gl; + } } if (p_sd->preserve_control) { @@ -5288,9 +5321,9 @@ Size2 TextServerAdvanced::shaped_text_get_size(const RID &p_shaped) const { const_cast<TextServerAdvanced *>(this)->shaped_text_shape(p_shaped); } if (sd->orientation == TextServer::ORIENTATION_HORIZONTAL) { - return Size2((sd->text_trimmed ? sd->width_trimmed : sd->width), sd->ascent + sd->descent).ceil(); + return Size2((sd->text_trimmed ? sd->width_trimmed : sd->width), sd->ascent + sd->descent + sd->extra_spacing[SPACING_TOP] + sd->extra_spacing[SPACING_BOTTOM]).ceil(); } else { - return Size2(sd->ascent + sd->descent, (sd->text_trimmed ? sd->width_trimmed : sd->width)).ceil(); + return Size2(sd->ascent + sd->descent + sd->extra_spacing[SPACING_TOP] + sd->extra_spacing[SPACING_BOTTOM], (sd->text_trimmed ? sd->width_trimmed : sd->width)).ceil(); } } @@ -5302,7 +5335,7 @@ double TextServerAdvanced::shaped_text_get_ascent(const RID &p_shaped) const { if (!sd->valid) { const_cast<TextServerAdvanced *>(this)->shaped_text_shape(p_shaped); } - return sd->ascent; + return sd->ascent + sd->extra_spacing[SPACING_TOP]; } double TextServerAdvanced::shaped_text_get_descent(const RID &p_shaped) const { @@ -5313,7 +5346,7 @@ double TextServerAdvanced::shaped_text_get_descent(const RID &p_shaped) const { if (!sd->valid) { const_cast<TextServerAdvanced *>(this)->shaped_text_shape(p_shaped); } - return sd->descent; + return sd->descent + sd->extra_spacing[SPACING_BOTTOM]; } double TextServerAdvanced::shaped_text_get_width(const RID &p_shaped) const { @@ -5627,16 +5660,18 @@ String TextServerAdvanced::strip_diacritics(const String &p_string) const { } String TextServerAdvanced::string_to_upper(const String &p_string, const String &p_language) const { + const String lang = (p_language.is_empty()) ? TranslationServer::get_singleton()->get_tool_locale() : p_language; + // Convert to UTF-16. Char16String utf16 = p_string.utf16(); Vector<char16_t> upper; UErrorCode err = U_ZERO_ERROR; - int32_t len = u_strToUpper(nullptr, 0, utf16.get_data(), -1, p_language.ascii().get_data(), &err); + int32_t len = u_strToUpper(nullptr, 0, utf16.get_data(), -1, lang.ascii().get_data(), &err); ERR_FAIL_COND_V_MSG(err != U_BUFFER_OVERFLOW_ERROR, p_string, u_errorName(err)); upper.resize(len); err = U_ZERO_ERROR; - u_strToUpper(upper.ptrw(), len, utf16.get_data(), -1, p_language.ascii().get_data(), &err); + u_strToUpper(upper.ptrw(), len, utf16.get_data(), -1, lang.ascii().get_data(), &err); ERR_FAIL_COND_V_MSG(U_FAILURE(err), p_string, u_errorName(err)); // Convert back to UTF-32. @@ -5644,16 +5679,17 @@ String TextServerAdvanced::string_to_upper(const String &p_string, const String } String TextServerAdvanced::string_to_lower(const String &p_string, const String &p_language) const { + const String lang = (p_language.is_empty()) ? TranslationServer::get_singleton()->get_tool_locale() : p_language; // Convert to UTF-16. Char16String utf16 = p_string.utf16(); Vector<char16_t> lower; UErrorCode err = U_ZERO_ERROR; - int32_t len = u_strToLower(nullptr, 0, utf16.get_data(), -1, p_language.ascii().get_data(), &err); + int32_t len = u_strToLower(nullptr, 0, utf16.get_data(), -1, lang.ascii().get_data(), &err); ERR_FAIL_COND_V_MSG(err != U_BUFFER_OVERFLOW_ERROR, p_string, u_errorName(err)); lower.resize(len); err = U_ZERO_ERROR; - u_strToLower(lower.ptrw(), len, utf16.get_data(), -1, p_language.ascii().get_data(), &err); + u_strToLower(lower.ptrw(), len, utf16.get_data(), -1, lang.ascii().get_data(), &err); ERR_FAIL_COND_V_MSG(U_FAILURE(err), p_string, u_errorName(err)); // Convert back to UTF-32. @@ -5661,12 +5697,13 @@ String TextServerAdvanced::string_to_lower(const String &p_string, const String } PackedInt32Array TextServerAdvanced::string_get_word_breaks(const String &p_string, const String &p_language) const { + const String lang = (p_language.is_empty()) ? TranslationServer::get_singleton()->get_tool_locale() : p_language; // Convert to UTF-16. Char16String utf16 = p_string.utf16(); HashSet<int> breaks; UErrorCode err = U_ZERO_ERROR; - UBreakIterator *bi = ubrk_open(UBRK_LINE, p_language.ascii().get_data(), (const UChar *)utf16.get_data(), utf16.length(), &err); + UBreakIterator *bi = ubrk_open(UBRK_LINE, lang.ascii().get_data(), (const UChar *)utf16.get_data(), utf16.length(), &err); if (U_FAILURE(err)) { // No data loaded - use fallback. for (int i = 0; i < p_string.length(); i++) { diff --git a/modules/text_server_adv/text_server_adv.h b/modules/text_server_adv/text_server_adv.h index e7690cb70d..87582e8bac 100644 --- a/modules/text_server_adv/text_server_adv.h +++ b/modules/text_server_adv/text_server_adv.h @@ -133,12 +133,19 @@ class TextServerAdvanced : public TextServerExtension { }; Vector<NumSystemData> num_systems; + + struct FeatureInfo { + StringName name; + Variant::Type vtype = Variant::INT; + bool hidden = false; + }; + HashMap<StringName, int32_t> feature_sets; - HashMap<int32_t, StringName> feature_sets_inv; + HashMap<int32_t, FeatureInfo> feature_sets_inv; void _insert_num_systems_lang(); void _insert_feature_sets(); - _FORCE_INLINE_ void _insert_feature(const StringName &p_name, int32_t p_tag); + _FORCE_INLINE_ void _insert_feature(const StringName &p_name, int32_t p_tag, Variant::Type p_vtype = Variant::INT, bool p_hidden = false); // ICU support data. @@ -176,7 +183,7 @@ class TextServerAdvanced : public TextServerExtension { Vector2 advance; }; - struct FontDataForSizeAdvanced { + struct FontForSizeAdvanced { double ascent = 0.0; double descent = 0.0; double underline_position = 0.0; @@ -184,9 +191,6 @@ class TextServerAdvanced : public TextServerExtension { double scale = 1.0; double oversampling = 1.0; - int spacing_glyph = 0; - int spacing_space = 0; - Vector2i size; Vector<FontTexture> textures; @@ -199,7 +203,7 @@ class TextServerAdvanced : public TextServerExtension { FT_StreamRec stream; #endif - ~FontDataForSizeAdvanced() { + ~FontForSizeAdvanced() { if (hb_handle != nullptr) { hb_font_destroy(hb_handle); } @@ -211,7 +215,7 @@ class TextServerAdvanced : public TextServerExtension { } }; - struct FontDataAdvanced { + struct FontAdvanced { Mutex mutex; bool antialiased = true; @@ -232,7 +236,7 @@ class TextServerAdvanced : public TextServerExtension { String font_name; String style_name; - HashMap<Vector2i, FontDataForSizeAdvanced *, VariantHasher, VariantComparator> cache; + HashMap<Vector2i, FontForSizeAdvanced *, VariantHasher, VariantComparator> cache; bool face_init = false; HashSet<uint32_t> supported_scripts; @@ -250,28 +254,28 @@ class TextServerAdvanced : public TextServerExtension { int face_index = 0; mutable ThreadWorkPool work_pool; - ~FontDataAdvanced() { + ~FontAdvanced() { work_pool.finish(); - for (const KeyValue<Vector2i, FontDataForSizeAdvanced *> &E : cache) { + for (const KeyValue<Vector2i, FontForSizeAdvanced *> &E : cache) { memdelete(E.value); } cache.clear(); } }; - _FORCE_INLINE_ FontTexturePosition find_texture_pos_for_glyph(FontDataForSizeAdvanced *p_data, int p_color_size, Image::Format p_image_format, int p_width, int p_height, bool p_msdf) const; + _FORCE_INLINE_ FontTexturePosition find_texture_pos_for_glyph(FontForSizeAdvanced *p_data, int p_color_size, Image::Format p_image_format, int p_width, int p_height, bool p_msdf) const; #ifdef MODULE_MSDFGEN_ENABLED - _FORCE_INLINE_ FontGlyph rasterize_msdf(FontDataAdvanced *p_font_data, FontDataForSizeAdvanced *p_data, int p_pixel_range, int p_rect_margin, FT_Outline *outline, const Vector2 &advance) const; + _FORCE_INLINE_ FontGlyph rasterize_msdf(FontAdvanced *p_font_data, FontForSizeAdvanced *p_data, int p_pixel_range, int p_rect_margin, FT_Outline *outline, const Vector2 &advance) const; #endif #ifdef MODULE_FREETYPE_ENABLED - _FORCE_INLINE_ FontGlyph rasterize_bitmap(FontDataForSizeAdvanced *p_data, int p_rect_margin, FT_Bitmap bitmap, int yofs, int xofs, const Vector2 &advance) const; + _FORCE_INLINE_ FontGlyph rasterize_bitmap(FontForSizeAdvanced *p_data, int p_rect_margin, FT_Bitmap bitmap, int yofs, int xofs, const Vector2 &advance) const; #endif - _FORCE_INLINE_ bool _ensure_glyph(FontDataAdvanced *p_font_data, const Vector2i &p_size, int32_t p_glyph) const; - _FORCE_INLINE_ bool _ensure_cache_for_size(FontDataAdvanced *p_font_data, const Vector2i &p_size) const; - _FORCE_INLINE_ void _font_clear_cache(FontDataAdvanced *p_font_data); + _FORCE_INLINE_ bool _ensure_glyph(FontAdvanced *p_font_data, const Vector2i &p_size, int32_t p_glyph) const; + _FORCE_INLINE_ bool _ensure_cache_for_size(FontAdvanced *p_font_data, const Vector2i &p_size) const; + _FORCE_INLINE_ void _font_clear_cache(FontAdvanced *p_font_data); void _generateMTSDF_threaded(uint32_t y, void *p_td) const; - _FORCE_INLINE_ Vector2i _get_size(const FontDataAdvanced *p_font_data, int p_size) const { + _FORCE_INLINE_ Vector2i _get_size(const FontAdvanced *p_font_data, int p_size) const { if (p_font_data->msdf) { return Vector2i(p_font_data->msdf_source_size, 0); } else if (p_font_data->fixed_size > 0) { @@ -281,7 +285,7 @@ class TextServerAdvanced : public TextServerExtension { } } - _FORCE_INLINE_ Vector2i _get_size_outline(const FontDataAdvanced *p_font_data, const Vector2i &p_size) const { + _FORCE_INLINE_ Vector2i _get_size_outline(const FontAdvanced *p_font_data, const Vector2i &p_size) const { if (p_font_data->msdf) { return Vector2i(p_font_data->msdf_source_size, 0); } else if (p_font_data->fixed_size > 0) { @@ -292,6 +296,8 @@ class TextServerAdvanced : public TextServerExtension { } _FORCE_INLINE_ double _get_extra_advance(RID p_font_rid, int p_font_size) const; + _FORCE_INLINE_ Variant::Type _get_tag_type(int64_t p_tag) const; + _FORCE_INLINE_ bool _get_tag_hidden(int64_t p_tag) const; // Shaped text cache data. struct TrimData { @@ -351,6 +357,7 @@ class TextServerAdvanced : public TextServerExtension { double descent = 0.0; // Descent for horizontal layout, 1/2 of width for vertical. double width = 0.0; // Width for horizontal layout, height for vertical. double width_trimmed = 0.0; + int extra_spacing[4] = { 0, 0, 0, 0 }; double upos = 0.0; double uthk = 0.0; @@ -389,7 +396,7 @@ class TextServerAdvanced : public TextServerExtension { // Common data. double oversampling = 1.0; - mutable RID_PtrOwner<FontDataAdvanced> font_owner; + mutable RID_PtrOwner<FontAdvanced> font_owner; mutable RID_PtrOwner<ShapedTextDataAdvanced> shaped_owner; void _realign(ShapedTextDataAdvanced *p_sd) const; @@ -407,11 +414,11 @@ class TextServerAdvanced : public TextServerExtension { static hb_font_funcs_t *funcs; struct bmp_font_t { - TextServerAdvanced::FontDataForSizeAdvanced *face = nullptr; + TextServerAdvanced::FontForSizeAdvanced *face = nullptr; bool unref = false; /* Whether to destroy bm_face when done. */ }; - static bmp_font_t *_bmp_font_create(TextServerAdvanced::FontDataForSizeAdvanced *p_face, bool p_unref); + static bmp_font_t *_bmp_font_create(TextServerAdvanced::FontForSizeAdvanced *p_face, bool p_unref); static void _bmp_font_destroy(void *p_data); static hb_bool_t _bmp_get_nominal_glyph(hb_font_t *p_font, void *p_font_data, hb_codepoint_t p_unicode, hb_codepoint_t *r_glyph, void *p_user_data); static hb_position_t _bmp_get_glyph_h_advance(hb_font_t *p_font, void *p_font_data, hb_codepoint_t p_glyph, void *p_user_data); @@ -422,8 +429,8 @@ class TextServerAdvanced : public TextServerExtension { static hb_bool_t _bmp_get_font_h_extents(hb_font_t *p_font, void *p_font_data, hb_font_extents_t *r_metrics, void *p_user_data); static void _bmp_create_font_funcs(); static void _bmp_free_font_funcs(); - static void _bmp_font_set_funcs(hb_font_t *p_font, TextServerAdvanced::FontDataForSizeAdvanced *p_face, bool p_unref); - static hb_font_t *_bmp_font_create(TextServerAdvanced::FontDataForSizeAdvanced *p_face, hb_destroy_func_t p_destroy); + static void _bmp_font_set_funcs(hb_font_t *p_font, TextServerAdvanced::FontForSizeAdvanced *p_face, bool p_unref); + static hb_font_t *_bmp_font_create(TextServerAdvanced::FontForSizeAdvanced *p_face, hb_destroy_func_t p_destroy); hb_font_t *_font_get_hb_handle(const RID &p_font, int64_t p_font_size) const; @@ -546,9 +553,6 @@ public: virtual void font_set_scale(const RID &p_font_rid, int64_t p_size, double p_scale) override; virtual double font_get_scale(const RID &p_font_rid, int64_t p_size) const override; - virtual void font_set_spacing(const RID &p_font_rid, int64_t p_size, SpacingType p_spacing, int64_t p_value) override; - virtual int64_t font_get_spacing(const RID &p_font_rid, int64_t p_size, SpacingType p_spacing) const override; - virtual int64_t font_get_texture_count(const RID &p_font_rid, const Vector2i &p_size) const override; virtual void font_clear_textures(const RID &p_font_rid, const Vector2i &p_size) override; virtual void font_remove_texture(const RID &p_font_rid, const Vector2i &p_size, int64_t p_texture_index) override; @@ -646,6 +650,9 @@ public: virtual void shaped_text_set_preserve_control(const RID &p_shaped, bool p_enabled) override; virtual bool shaped_text_get_preserve_control(const RID &p_shaped) const override; + virtual void shaped_text_set_spacing(const RID &p_shaped, SpacingType p_spacing, int64_t p_value) override; + virtual int64_t shaped_text_get_spacing(const RID &p_shaped, SpacingType p_spacing) const override; + virtual bool shaped_text_add_string(const RID &p_shaped, const String &p_text, const Array &p_fonts, int64_t p_size, const Dictionary &p_opentype_features = Dictionary(), const String &p_language = "", const Variant &p_meta = Variant()) override; virtual bool shaped_text_add_object(const RID &p_shaped, const Variant &p_key, const Size2 &p_size, InlineAlignment p_inline_align = INLINE_ALIGNMENT_CENTER, int64_t p_length = 1) override; virtual bool shaped_text_resize_object(const RID &p_shaped, const Variant &p_key, const Size2 &p_size, InlineAlignment p_inline_align = INLINE_ALIGNMENT_CENTER) override; diff --git a/modules/text_server_fb/text_server_fb.cpp b/modules/text_server_fb/text_server_fb.cpp index f93c5909c9..8f57aa339c 100644 --- a/modules/text_server_fb/text_server_fb.cpp +++ b/modules/text_server_fb/text_server_fb.cpp @@ -104,7 +104,7 @@ int64_t TextServerFallback::get_features() const { void TextServerFallback::free_rid(const RID &p_rid) { _THREAD_SAFE_METHOD_ if (font_owner.owns(p_rid)) { - FontDataFallback *fd = font_owner.get_or_null(p_rid); + FontFallback *fd = font_owner.get_or_null(p_rid); font_owner.free(p_rid); memdelete(fd); } else if (shaped_owner.owns(p_rid)) { @@ -199,7 +199,7 @@ String TextServerFallback::tag_to_name(int64_t p_tag) const { /* Font Glyph Rendering */ /*************************************************************************/ -_FORCE_INLINE_ TextServerFallback::FontTexturePosition TextServerFallback::find_texture_pos_for_glyph(FontDataForSizeFallback *p_data, int p_color_size, Image::Format p_image_format, int p_width, int p_height, bool p_msdf) const { +_FORCE_INLINE_ TextServerFallback::FontTexturePosition TextServerFallback::find_texture_pos_for_glyph(FontForSizeFallback *p_data, int p_color_size, Image::Format p_image_format, int p_width, int p_height, bool p_msdf) const { FontTexturePosition ret; ret.index = -1; @@ -397,7 +397,7 @@ void TextServerFallback::_generateMTSDF_threaded(uint32_t y, void *p_td) const { } } -_FORCE_INLINE_ TextServerFallback::FontGlyph TextServerFallback::rasterize_msdf(FontDataFallback *p_font_data, FontDataForSizeFallback *p_data, int p_pixel_range, int p_rect_margin, FT_Outline *outline, const Vector2 &advance) const { +_FORCE_INLINE_ TextServerFallback::FontGlyph TextServerFallback::rasterize_msdf(FontFallback *p_font_data, FontForSizeFallback *p_data, int p_pixel_range, int p_rect_margin, FT_Outline *outline, const Vector2 &advance) const { msdfgen::Shape shape; shape.contours.clear(); @@ -502,7 +502,7 @@ _FORCE_INLINE_ TextServerFallback::FontGlyph TextServerFallback::rasterize_msdf( #endif #ifdef MODULE_FREETYPE_ENABLED -_FORCE_INLINE_ TextServerFallback::FontGlyph TextServerFallback::rasterize_bitmap(FontDataForSizeFallback *p_data, int p_rect_margin, FT_Bitmap bitmap, int yofs, int xofs, const Vector2 &advance) const { +_FORCE_INLINE_ TextServerFallback::FontGlyph TextServerFallback::rasterize_bitmap(FontForSizeFallback *p_data, int p_rect_margin, FT_Bitmap bitmap, int yofs, int xofs, const Vector2 &advance) const { int w = bitmap.width; int h = bitmap.rows; @@ -579,12 +579,12 @@ _FORCE_INLINE_ TextServerFallback::FontGlyph TextServerFallback::rasterize_bitma /* Font Cache */ /*************************************************************************/ -_FORCE_INLINE_ bool TextServerFallback::_ensure_glyph(FontDataFallback *p_font_data, const Vector2i &p_size, int32_t p_glyph) const { +_FORCE_INLINE_ bool TextServerFallback::_ensure_glyph(FontFallback *p_font_data, const Vector2i &p_size, int32_t p_glyph) const { ERR_FAIL_COND_V(!_ensure_cache_for_size(p_font_data, p_size), false); int32_t glyph_index = p_glyph & 0xffffff; // Remove subpixel shifts. - FontDataForSizeFallback *fd = p_font_data->cache[p_size]; + FontForSizeFallback *fd = p_font_data->cache[p_size]; if (fd->glyph_map.has(p_glyph)) { return fd->glyph_map[p_glyph].found; } @@ -705,13 +705,13 @@ _FORCE_INLINE_ bool TextServerFallback::_ensure_glyph(FontDataFallback *p_font_d return false; } -_FORCE_INLINE_ bool TextServerFallback::_ensure_cache_for_size(FontDataFallback *p_font_data, const Vector2i &p_size) const { +_FORCE_INLINE_ bool TextServerFallback::_ensure_cache_for_size(FontFallback *p_font_data, const Vector2i &p_size) const { ERR_FAIL_COND_V(p_size.x <= 0, false); if (p_font_data->cache.has(p_size)) { return true; } - FontDataForSizeFallback *fd = memnew(FontDataForSizeFallback); + FontForSizeFallback *fd = memnew(FontForSizeFallback); fd->size = p_size; if (p_font_data->data_ptr && (p_font_data->data_size > 0)) { // Init dynamic font. @@ -851,8 +851,8 @@ _FORCE_INLINE_ bool TextServerFallback::_ensure_cache_for_size(FontDataFallback return true; } -_FORCE_INLINE_ void TextServerFallback::_font_clear_cache(FontDataFallback *p_font_data) { - for (const KeyValue<Vector2i, FontDataForSizeFallback *> &E : p_font_data->cache) { +_FORCE_INLINE_ void TextServerFallback::_font_clear_cache(FontFallback *p_font_data) { + for (const KeyValue<Vector2i, FontForSizeFallback *> &E : p_font_data->cache) { memdelete(E.value); } @@ -864,13 +864,13 @@ _FORCE_INLINE_ void TextServerFallback::_font_clear_cache(FontDataFallback *p_fo RID TextServerFallback::create_font() { _THREAD_SAFE_METHOD_ - FontDataFallback *fd = memnew(FontDataFallback); + FontFallback *fd = memnew(FontFallback); return font_owner.make_rid(fd); } void TextServerFallback::font_set_data(const RID &p_font_rid, const PackedByteArray &p_data) { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -881,7 +881,7 @@ void TextServerFallback::font_set_data(const RID &p_font_rid, const PackedByteAr } void TextServerFallback::font_set_data_ptr(const RID &p_font_rid, const uint8_t *p_data_ptr, int64_t p_data_size) { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -892,7 +892,7 @@ void TextServerFallback::font_set_data_ptr(const RID &p_font_rid, const uint8_t } void TextServerFallback::font_set_style(const RID &p_font_rid, int64_t /*FontStyle*/ p_style) { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -905,7 +905,7 @@ void TextServerFallback::font_set_face_index(const RID &p_font_rid, int64_t p_fa ERR_FAIL_COND(p_face_index < 0); ERR_FAIL_COND(p_face_index >= 0x7FFF); - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -916,7 +916,7 @@ void TextServerFallback::font_set_face_index(const RID &p_font_rid, int64_t p_fa } int64_t TextServerFallback::font_get_face_index(const RID &p_font_rid) const { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, 0); MutexLock lock(fd->mutex); @@ -924,7 +924,7 @@ int64_t TextServerFallback::font_get_face_index(const RID &p_font_rid) const { } int64_t TextServerFallback::font_get_face_count(const RID &p_font_rid) const { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, 0); MutexLock lock(fd->mutex); @@ -965,7 +965,7 @@ int64_t TextServerFallback::font_get_face_count(const RID &p_font_rid) const { } int64_t /*FontStyle*/ TextServerFallback::font_get_style(const RID &p_font_rid) const { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, 0); MutexLock lock(fd->mutex); @@ -975,7 +975,7 @@ int64_t /*FontStyle*/ TextServerFallback::font_get_style(const RID &p_font_rid) } void TextServerFallback::font_set_style_name(const RID &p_font_rid, const String &p_name) { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -985,7 +985,7 @@ void TextServerFallback::font_set_style_name(const RID &p_font_rid, const String } String TextServerFallback::font_get_style_name(const RID &p_font_rid) const { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, String()); MutexLock lock(fd->mutex); @@ -995,7 +995,7 @@ String TextServerFallback::font_get_style_name(const RID &p_font_rid) const { } void TextServerFallback::font_set_name(const RID &p_font_rid, const String &p_name) { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1005,7 +1005,7 @@ void TextServerFallback::font_set_name(const RID &p_font_rid, const String &p_na } String TextServerFallback::font_get_name(const RID &p_font_rid) const { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, String()); MutexLock lock(fd->mutex); @@ -1015,7 +1015,7 @@ String TextServerFallback::font_get_name(const RID &p_font_rid) const { } void TextServerFallback::font_set_antialiased(const RID &p_font_rid, bool p_antialiased) { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1026,7 +1026,7 @@ void TextServerFallback::font_set_antialiased(const RID &p_font_rid, bool p_anti } bool TextServerFallback::font_is_antialiased(const RID &p_font_rid) const { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, false); MutexLock lock(fd->mutex); @@ -1034,12 +1034,12 @@ bool TextServerFallback::font_is_antialiased(const RID &p_font_rid) const { } void TextServerFallback::font_set_generate_mipmaps(const RID &p_font_rid, bool p_generate_mipmaps) { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); if (fd->mipmaps != p_generate_mipmaps) { - for (KeyValue<Vector2i, FontDataForSizeFallback *> &E : fd->cache) { + for (KeyValue<Vector2i, FontForSizeFallback *> &E : fd->cache) { for (int i = 0; i < E.value->textures.size(); i++) { E.value->textures.write[i].dirty = true; } @@ -1049,7 +1049,7 @@ void TextServerFallback::font_set_generate_mipmaps(const RID &p_font_rid, bool p } bool TextServerFallback::font_get_generate_mipmaps(const RID &p_font_rid) const { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, false); MutexLock lock(fd->mutex); @@ -1057,7 +1057,7 @@ bool TextServerFallback::font_get_generate_mipmaps(const RID &p_font_rid) const } void TextServerFallback::font_set_multichannel_signed_distance_field(const RID &p_font_rid, bool p_msdf) { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1068,7 +1068,7 @@ void TextServerFallback::font_set_multichannel_signed_distance_field(const RID & } bool TextServerFallback::font_is_multichannel_signed_distance_field(const RID &p_font_rid) const { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, false); MutexLock lock(fd->mutex); @@ -1076,7 +1076,7 @@ bool TextServerFallback::font_is_multichannel_signed_distance_field(const RID &p } void TextServerFallback::font_set_msdf_pixel_range(const RID &p_font_rid, int64_t p_msdf_pixel_range) { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1087,7 +1087,7 @@ void TextServerFallback::font_set_msdf_pixel_range(const RID &p_font_rid, int64_ } int64_t TextServerFallback::font_get_msdf_pixel_range(const RID &p_font_rid) const { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, false); MutexLock lock(fd->mutex); @@ -1095,7 +1095,7 @@ int64_t TextServerFallback::font_get_msdf_pixel_range(const RID &p_font_rid) con } void TextServerFallback::font_set_msdf_size(const RID &p_font_rid, int64_t p_msdf_size) { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1106,7 +1106,7 @@ void TextServerFallback::font_set_msdf_size(const RID &p_font_rid, int64_t p_msd } int64_t TextServerFallback::font_get_msdf_size(const RID &p_font_rid) const { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, false); MutexLock lock(fd->mutex); @@ -1114,7 +1114,7 @@ int64_t TextServerFallback::font_get_msdf_size(const RID &p_font_rid) const { } void TextServerFallback::font_set_fixed_size(const RID &p_font_rid, int64_t p_fixed_size) { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1122,7 +1122,7 @@ void TextServerFallback::font_set_fixed_size(const RID &p_font_rid, int64_t p_fi } int64_t TextServerFallback::font_get_fixed_size(const RID &p_font_rid) const { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, false); MutexLock lock(fd->mutex); @@ -1130,7 +1130,7 @@ int64_t TextServerFallback::font_get_fixed_size(const RID &p_font_rid) const { } void TextServerFallback::font_set_force_autohinter(const RID &p_font_rid, bool p_force_autohinter) { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1141,7 +1141,7 @@ void TextServerFallback::font_set_force_autohinter(const RID &p_font_rid, bool p } bool TextServerFallback::font_is_force_autohinter(const RID &p_font_rid) const { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, false); MutexLock lock(fd->mutex); @@ -1149,7 +1149,7 @@ bool TextServerFallback::font_is_force_autohinter(const RID &p_font_rid) const { } void TextServerFallback::font_set_hinting(const RID &p_font_rid, TextServer::Hinting p_hinting) { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1160,7 +1160,7 @@ void TextServerFallback::font_set_hinting(const RID &p_font_rid, TextServer::Hin } TextServer::Hinting TextServerFallback::font_get_hinting(const RID &p_font_rid) const { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, HINTING_NONE); MutexLock lock(fd->mutex); @@ -1168,7 +1168,7 @@ TextServer::Hinting TextServerFallback::font_get_hinting(const RID &p_font_rid) } void TextServerFallback::font_set_subpixel_positioning(const RID &p_font_rid, TextServer::SubpixelPositioning p_subpixel) { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1176,7 +1176,7 @@ void TextServerFallback::font_set_subpixel_positioning(const RID &p_font_rid, Te } TextServer::SubpixelPositioning TextServerFallback::font_get_subpixel_positioning(const RID &p_font_rid) const { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, SUBPIXEL_POSITIONING_DISABLED); MutexLock lock(fd->mutex); @@ -1184,7 +1184,7 @@ TextServer::SubpixelPositioning TextServerFallback::font_get_subpixel_positionin } void TextServerFallback::font_set_embolden(const RID &p_font_rid, double p_strength) { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1195,7 +1195,7 @@ void TextServerFallback::font_set_embolden(const RID &p_font_rid, double p_stren } double TextServerFallback::font_get_embolden(const RID &p_font_rid) const { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, 0.0); MutexLock lock(fd->mutex); @@ -1203,7 +1203,7 @@ double TextServerFallback::font_get_embolden(const RID &p_font_rid) const { } void TextServerFallback::font_set_transform(const RID &p_font_rid, const Transform2D &p_transform) { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1214,7 +1214,7 @@ void TextServerFallback::font_set_transform(const RID &p_font_rid, const Transfo } Transform2D TextServerFallback::font_get_transform(const RID &p_font_rid) const { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Transform2D()); MutexLock lock(fd->mutex); @@ -1222,7 +1222,7 @@ Transform2D TextServerFallback::font_get_transform(const RID &p_font_rid) const } void TextServerFallback::font_set_variation_coordinates(const RID &p_font_rid, const Dictionary &p_variation_coordinates) { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1233,7 +1233,7 @@ void TextServerFallback::font_set_variation_coordinates(const RID &p_font_rid, c } Dictionary TextServerFallback::font_get_variation_coordinates(const RID &p_font_rid) const { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Dictionary()); MutexLock lock(fd->mutex); @@ -1241,7 +1241,7 @@ Dictionary TextServerFallback::font_get_variation_coordinates(const RID &p_font_ } void TextServerFallback::font_set_oversampling(const RID &p_font_rid, double p_oversampling) { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1252,7 +1252,7 @@ void TextServerFallback::font_set_oversampling(const RID &p_font_rid, double p_o } double TextServerFallback::font_get_oversampling(const RID &p_font_rid) const { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, 0.0); MutexLock lock(fd->mutex); @@ -1260,30 +1260,30 @@ double TextServerFallback::font_get_oversampling(const RID &p_font_rid) const { } Array TextServerFallback::font_get_size_cache_list(const RID &p_font_rid) const { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Array()); MutexLock lock(fd->mutex); Array ret; - for (const KeyValue<Vector2i, FontDataForSizeFallback *> &E : fd->cache) { + for (const KeyValue<Vector2i, FontForSizeFallback *> &E : fd->cache) { ret.push_back(E.key); } return ret; } void TextServerFallback::font_clear_size_cache(const RID &p_font_rid) { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); - for (const KeyValue<Vector2i, FontDataForSizeFallback *> &E : fd->cache) { + for (const KeyValue<Vector2i, FontForSizeFallback *> &E : fd->cache) { memdelete(E.value); } fd->cache.clear(); } void TextServerFallback::font_remove_size_cache(const RID &p_font_rid, const Vector2i &p_size) { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1294,7 +1294,7 @@ void TextServerFallback::font_remove_size_cache(const RID &p_font_rid, const Vec } void TextServerFallback::font_set_ascent(const RID &p_font_rid, int64_t p_size, double p_ascent) { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1305,7 +1305,7 @@ void TextServerFallback::font_set_ascent(const RID &p_font_rid, int64_t p_size, } double TextServerFallback::font_get_ascent(const RID &p_font_rid, int64_t p_size) const { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, 0.0); MutexLock lock(fd->mutex); @@ -1321,7 +1321,7 @@ double TextServerFallback::font_get_ascent(const RID &p_font_rid, int64_t p_size } void TextServerFallback::font_set_descent(const RID &p_font_rid, int64_t p_size, double p_descent) { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); Vector2i size = _get_size(fd, p_size); @@ -1331,7 +1331,7 @@ void TextServerFallback::font_set_descent(const RID &p_font_rid, int64_t p_size, } double TextServerFallback::font_get_descent(const RID &p_font_rid, int64_t p_size) const { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, 0.0); MutexLock lock(fd->mutex); @@ -1347,7 +1347,7 @@ double TextServerFallback::font_get_descent(const RID &p_font_rid, int64_t p_siz } void TextServerFallback::font_set_underline_position(const RID &p_font_rid, int64_t p_size, double p_underline_position) { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1358,7 +1358,7 @@ void TextServerFallback::font_set_underline_position(const RID &p_font_rid, int6 } double TextServerFallback::font_get_underline_position(const RID &p_font_rid, int64_t p_size) const { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, 0.0); MutexLock lock(fd->mutex); @@ -1374,7 +1374,7 @@ double TextServerFallback::font_get_underline_position(const RID &p_font_rid, in } void TextServerFallback::font_set_underline_thickness(const RID &p_font_rid, int64_t p_size, double p_underline_thickness) { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1385,7 +1385,7 @@ void TextServerFallback::font_set_underline_thickness(const RID &p_font_rid, int } double TextServerFallback::font_get_underline_thickness(const RID &p_font_rid, int64_t p_size) const { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, 0.0); MutexLock lock(fd->mutex); @@ -1401,7 +1401,7 @@ double TextServerFallback::font_get_underline_thickness(const RID &p_font_rid, i } void TextServerFallback::font_set_scale(const RID &p_font_rid, int64_t p_size, double p_scale) { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1417,7 +1417,7 @@ void TextServerFallback::font_set_scale(const RID &p_font_rid, int64_t p_size, d } double TextServerFallback::font_get_scale(const RID &p_font_rid, int64_t p_size) const { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, 0.0); MutexLock lock(fd->mutex); @@ -1432,60 +1432,8 @@ double TextServerFallback::font_get_scale(const RID &p_font_rid, int64_t p_size) } } -void TextServerFallback::font_set_spacing(const RID &p_font_rid, int64_t p_size, TextServer::SpacingType p_spacing, int64_t p_value) { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); - ERR_FAIL_COND(!fd); - - MutexLock lock(fd->mutex); - Vector2i size = _get_size(fd, p_size); - - ERR_FAIL_COND(!_ensure_cache_for_size(fd, size)); - switch (p_spacing) { - case TextServer::SPACING_GLYPH: { - fd->cache[size]->spacing_glyph = p_value; - } break; - case TextServer::SPACING_SPACE: { - fd->cache[size]->spacing_space = p_value; - } break; - default: { - ERR_FAIL_MSG("Invalid spacing type: " + String::num_int64(p_spacing)); - } break; - } -} - -int64_t TextServerFallback::font_get_spacing(const RID &p_font_rid, int64_t p_size, TextServer::SpacingType p_spacing) const { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); - ERR_FAIL_COND_V(!fd, 0); - - MutexLock lock(fd->mutex); - Vector2i size = _get_size(fd, p_size); - - ERR_FAIL_COND_V(!_ensure_cache_for_size(fd, size), 0); - - switch (p_spacing) { - case TextServer::SPACING_GLYPH: { - if (fd->msdf) { - return fd->cache[size]->spacing_glyph * (double)p_size / (double)fd->msdf_source_size; - } else { - return fd->cache[size]->spacing_glyph; - } - } break; - case TextServer::SPACING_SPACE: { - if (fd->msdf) { - return fd->cache[size]->spacing_space * (double)p_size / (double)fd->msdf_source_size; - } else { - return fd->cache[size]->spacing_space; - } - } break; - default: { - ERR_FAIL_V_MSG(0, "Invalid spacing type: " + String::num_int64(p_spacing)); - } break; - } - return 0; -} - int64_t TextServerFallback::font_get_texture_count(const RID &p_font_rid, const Vector2i &p_size) const { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, 0); MutexLock lock(fd->mutex); @@ -1497,7 +1445,7 @@ int64_t TextServerFallback::font_get_texture_count(const RID &p_font_rid, const } void TextServerFallback::font_clear_textures(const RID &p_font_rid, const Vector2i &p_size) { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); Vector2i size = _get_size_outline(fd, p_size); @@ -1507,7 +1455,7 @@ void TextServerFallback::font_clear_textures(const RID &p_font_rid, const Vector } void TextServerFallback::font_remove_texture(const RID &p_font_rid, const Vector2i &p_size, int64_t p_texture_index) { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1519,7 +1467,7 @@ void TextServerFallback::font_remove_texture(const RID &p_font_rid, const Vector } void TextServerFallback::font_set_texture_image(const RID &p_font_rid, const Vector2i &p_size, int64_t p_texture_index, const Ref<Image> &p_image) { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); ERR_FAIL_COND(p_image.is_null()); @@ -1552,7 +1500,7 @@ void TextServerFallback::font_set_texture_image(const RID &p_font_rid, const Vec } Ref<Image> TextServerFallback::font_get_texture_image(const RID &p_font_rid, const Vector2i &p_size, int64_t p_texture_index) const { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Ref<Image>()); MutexLock lock(fd->mutex); @@ -1569,7 +1517,7 @@ Ref<Image> TextServerFallback::font_get_texture_image(const RID &p_font_rid, con } void TextServerFallback::font_set_texture_offsets(const RID &p_font_rid, const Vector2i &p_size, int64_t p_texture_index, const PackedInt32Array &p_offset) { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1585,7 +1533,7 @@ void TextServerFallback::font_set_texture_offsets(const RID &p_font_rid, const V } PackedInt32Array TextServerFallback::font_get_texture_offsets(const RID &p_font_rid, const Vector2i &p_size, int64_t p_texture_index) const { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, PackedInt32Array()); MutexLock lock(fd->mutex); @@ -1598,7 +1546,7 @@ PackedInt32Array TextServerFallback::font_get_texture_offsets(const RID &p_font_ } Array TextServerFallback::font_get_glyph_list(const RID &p_font_rid, const Vector2i &p_size) const { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Array()); MutexLock lock(fd->mutex); @@ -1614,7 +1562,7 @@ Array TextServerFallback::font_get_glyph_list(const RID &p_font_rid, const Vecto } void TextServerFallback::font_clear_glyphs(const RID &p_font_rid, const Vector2i &p_size) { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1625,7 +1573,7 @@ void TextServerFallback::font_clear_glyphs(const RID &p_font_rid, const Vector2i } void TextServerFallback::font_remove_glyph(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1636,7 +1584,7 @@ void TextServerFallback::font_remove_glyph(const RID &p_font_rid, const Vector2i } Vector2 TextServerFallback::font_get_glyph_advance(const RID &p_font_rid, int64_t p_size, int64_t p_glyph) const { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Vector2()); MutexLock lock(fd->mutex); @@ -1664,7 +1612,7 @@ Vector2 TextServerFallback::font_get_glyph_advance(const RID &p_font_rid, int64_ } void TextServerFallback::font_set_glyph_advance(const RID &p_font_rid, int64_t p_size, int64_t p_glyph, const Vector2 &p_advance) { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1679,7 +1627,7 @@ void TextServerFallback::font_set_glyph_advance(const RID &p_font_rid, int64_t p } Vector2 TextServerFallback::font_get_glyph_offset(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Vector2()); MutexLock lock(fd->mutex); @@ -1700,7 +1648,7 @@ Vector2 TextServerFallback::font_get_glyph_offset(const RID &p_font_rid, const V } void TextServerFallback::font_set_glyph_offset(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph, const Vector2 &p_offset) { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1715,7 +1663,7 @@ void TextServerFallback::font_set_glyph_offset(const RID &p_font_rid, const Vect } Vector2 TextServerFallback::font_get_glyph_size(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Vector2()); MutexLock lock(fd->mutex); @@ -1736,7 +1684,7 @@ Vector2 TextServerFallback::font_get_glyph_size(const RID &p_font_rid, const Vec } void TextServerFallback::font_set_glyph_size(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph, const Vector2 &p_gl_size) { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1751,7 +1699,7 @@ void TextServerFallback::font_set_glyph_size(const RID &p_font_rid, const Vector } Rect2 TextServerFallback::font_get_glyph_uv_rect(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Rect2()); MutexLock lock(fd->mutex); @@ -1767,7 +1715,7 @@ Rect2 TextServerFallback::font_get_glyph_uv_rect(const RID &p_font_rid, const Ve } void TextServerFallback::font_set_glyph_uv_rect(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph, const Rect2 &p_uv_rect) { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1782,7 +1730,7 @@ void TextServerFallback::font_set_glyph_uv_rect(const RID &p_font_rid, const Vec } int64_t TextServerFallback::font_get_glyph_texture_idx(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, -1); MutexLock lock(fd->mutex); @@ -1798,7 +1746,7 @@ int64_t TextServerFallback::font_get_glyph_texture_idx(const RID &p_font_rid, co } void TextServerFallback::font_set_glyph_texture_idx(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph, int64_t p_texture_idx) { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1813,7 +1761,7 @@ void TextServerFallback::font_set_glyph_texture_idx(const RID &p_font_rid, const } RID TextServerFallback::font_get_glyph_texture_rid(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, RID()); MutexLock lock(fd->mutex); @@ -1853,7 +1801,7 @@ RID TextServerFallback::font_get_glyph_texture_rid(const RID &p_font_rid, const } Size2 TextServerFallback::font_get_glyph_texture_size(const RID &p_font_rid, const Vector2i &p_size, int64_t p_glyph) const { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Size2()); MutexLock lock(fd->mutex); @@ -1893,7 +1841,7 @@ Size2 TextServerFallback::font_get_glyph_texture_size(const RID &p_font_rid, con } Dictionary TextServerFallback::font_get_glyph_contours(const RID &p_font_rid, int64_t p_size, int64_t p_index) const { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Dictionary()); MutexLock lock(fd->mutex); @@ -1943,7 +1891,7 @@ Dictionary TextServerFallback::font_get_glyph_contours(const RID &p_font_rid, in } Array TextServerFallback::font_get_kerning_list(const RID &p_font_rid, int64_t p_size) const { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Array()); MutexLock lock(fd->mutex); @@ -1959,7 +1907,7 @@ Array TextServerFallback::font_get_kerning_list(const RID &p_font_rid, int64_t p } void TextServerFallback::font_clear_kerning_map(const RID &p_font_rid, int64_t p_size) { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1970,7 +1918,7 @@ void TextServerFallback::font_clear_kerning_map(const RID &p_font_rid, int64_t p } void TextServerFallback::font_remove_kerning(const RID &p_font_rid, int64_t p_size, const Vector2i &p_glyph_pair) { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1981,7 +1929,7 @@ void TextServerFallback::font_remove_kerning(const RID &p_font_rid, int64_t p_si } void TextServerFallback::font_set_kerning(const RID &p_font_rid, int64_t p_size, const Vector2i &p_glyph_pair, const Vector2 &p_kerning) { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -1992,7 +1940,7 @@ void TextServerFallback::font_set_kerning(const RID &p_font_rid, int64_t p_size, } Vector2 TextServerFallback::font_get_kerning(const RID &p_font_rid, int64_t p_size, const Vector2i &p_glyph_pair) const { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Vector2()); MutexLock lock(fd->mutex); @@ -2032,7 +1980,7 @@ int64_t TextServerFallback::font_get_glyph_index(const RID &p_font_rid, int64_t } bool TextServerFallback::font_has_char(const RID &p_font_rid, int64_t p_char) const { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, false); ERR_FAIL_COND_V_MSG((p_char >= 0xd800 && p_char <= 0xdfff) || (p_char > 0x10ffff), false, "Unicode parsing error: Invalid unicode codepoint " + String::num_int64(p_char, 16) + "."); @@ -2040,7 +1988,7 @@ bool TextServerFallback::font_has_char(const RID &p_font_rid, int64_t p_char) co if (fd->cache.is_empty()) { ERR_FAIL_COND_V(!_ensure_cache_for_size(fd, fd->msdf ? Vector2i(fd->msdf_source_size, 0) : Vector2i(16, 0)), false); } - FontDataForSizeFallback *at_size = fd->cache.begin()->value; + FontForSizeFallback *at_size = fd->cache.begin()->value; #ifdef MODULE_FREETYPE_ENABLED if (at_size && at_size->face) { @@ -2051,14 +1999,14 @@ bool TextServerFallback::font_has_char(const RID &p_font_rid, int64_t p_char) co } String TextServerFallback::font_get_supported_chars(const RID &p_font_rid) const { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, String()); MutexLock lock(fd->mutex); if (fd->cache.is_empty()) { ERR_FAIL_COND_V(!_ensure_cache_for_size(fd, fd->msdf ? Vector2i(fd->msdf_source_size, 0) : Vector2i(16, 0)), String()); } - FontDataForSizeFallback *at_size = fd->cache.begin()->value; + FontForSizeFallback *at_size = fd->cache.begin()->value; String chars; #ifdef MODULE_FREETYPE_ENABLED @@ -2084,7 +2032,7 @@ String TextServerFallback::font_get_supported_chars(const RID &p_font_rid) const } void TextServerFallback::font_render_range(const RID &p_font_rid, const Vector2i &p_size, int64_t p_start, int64_t p_end) { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); ERR_FAIL_COND_MSG((p_start >= 0xd800 && p_start <= 0xdfff) || (p_start > 0x10ffff), "Unicode parsing error: Invalid unicode codepoint " + String::num_int64(p_start, 16) + "."); ERR_FAIL_COND_MSG((p_end >= 0xd800 && p_end <= 0xdfff) || (p_end > 0x10ffff), "Unicode parsing error: Invalid unicode codepoint " + String::num_int64(p_end, 16) + "."); @@ -2117,7 +2065,7 @@ void TextServerFallback::font_render_range(const RID &p_font_rid, const Vector2i } void TextServerFallback::font_render_glyph(const RID &p_font_rid, const Vector2i &p_size, int64_t p_index) { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -2146,7 +2094,7 @@ void TextServerFallback::font_render_glyph(const RID &p_font_rid, const Vector2i } void TextServerFallback::font_draw_glyph(const RID &p_font_rid, const RID &p_canvas, int64_t p_size, const Vector2 &p_pos, int64_t p_index, const Color &p_color) const { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -2225,7 +2173,7 @@ void TextServerFallback::font_draw_glyph(const RID &p_font_rid, const RID &p_can } void TextServerFallback::font_draw_glyph_outline(const RID &p_font_rid, const RID &p_canvas, int64_t p_size, int64_t p_outline_size, const Vector2 &p_pos, int64_t p_index, const Color &p_color) const { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -2304,7 +2252,7 @@ void TextServerFallback::font_draw_glyph_outline(const RID &p_font_rid, const RI } bool TextServerFallback::font_is_language_supported(const RID &p_font_rid, const String &p_language) const { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, false); MutexLock lock(fd->mutex); @@ -2316,7 +2264,7 @@ bool TextServerFallback::font_is_language_supported(const RID &p_font_rid, const } void TextServerFallback::font_set_language_support_override(const RID &p_font_rid, const String &p_language, bool p_supported) { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -2324,7 +2272,7 @@ void TextServerFallback::font_set_language_support_override(const RID &p_font_ri } bool TextServerFallback::font_get_language_support_override(const RID &p_font_rid, const String &p_language) { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, false); MutexLock lock(fd->mutex); @@ -2332,7 +2280,7 @@ bool TextServerFallback::font_get_language_support_override(const RID &p_font_ri } void TextServerFallback::font_remove_language_support_override(const RID &p_font_rid, const String &p_language) { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -2340,7 +2288,7 @@ void TextServerFallback::font_remove_language_support_override(const RID &p_font } PackedStringArray TextServerFallback::font_get_language_support_overrides(const RID &p_font_rid) { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, PackedStringArray()); MutexLock lock(fd->mutex); @@ -2352,7 +2300,7 @@ PackedStringArray TextServerFallback::font_get_language_support_overrides(const } bool TextServerFallback::font_is_script_supported(const RID &p_font_rid, const String &p_script) const { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, false); MutexLock lock(fd->mutex); @@ -2364,7 +2312,7 @@ bool TextServerFallback::font_is_script_supported(const RID &p_font_rid, const S } void TextServerFallback::font_set_script_support_override(const RID &p_font_rid, const String &p_script, bool p_supported) { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -2372,7 +2320,7 @@ void TextServerFallback::font_set_script_support_override(const RID &p_font_rid, } bool TextServerFallback::font_get_script_support_override(const RID &p_font_rid, const String &p_script) { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, false); MutexLock lock(fd->mutex); @@ -2380,7 +2328,7 @@ bool TextServerFallback::font_get_script_support_override(const RID &p_font_rid, } void TextServerFallback::font_remove_script_support_override(const RID &p_font_rid, const String &p_script) { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -2390,7 +2338,7 @@ void TextServerFallback::font_remove_script_support_override(const RID &p_font_r } PackedStringArray TextServerFallback::font_get_script_support_overrides(const RID &p_font_rid) { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, PackedStringArray()); MutexLock lock(fd->mutex); @@ -2402,7 +2350,7 @@ PackedStringArray TextServerFallback::font_get_script_support_overrides(const RI } void TextServerFallback::font_set_opentype_feature_overrides(const RID &p_font_rid, const Dictionary &p_overrides) { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND(!fd); MutexLock lock(fd->mutex); @@ -2412,7 +2360,7 @@ void TextServerFallback::font_set_opentype_feature_overrides(const RID &p_font_r } Dictionary TextServerFallback::font_get_opentype_feature_overrides(const RID &p_font_rid) const { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Dictionary()); MutexLock lock(fd->mutex); @@ -2424,7 +2372,7 @@ Dictionary TextServerFallback::font_supported_feature_list(const RID &p_font_rid } Dictionary TextServerFallback::font_supported_variation_list(const RID &p_font_rid) const { - FontDataFallback *fd = font_owner.get_or_null(p_font_rid); + FontFallback *fd = font_owner.get_or_null(p_font_rid); ERR_FAIL_COND_V(!fd, Dictionary()); MutexLock lock(fd->mutex); @@ -2630,6 +2578,31 @@ bool TextServerFallback::shaped_text_get_preserve_control(const RID &p_shaped) c return sd->preserve_control; } +void TextServerFallback::shaped_text_set_spacing(const RID &p_shaped, SpacingType p_spacing, int64_t p_value) { + ERR_FAIL_INDEX((int)p_spacing, 4); + ShapedTextDataFallback *sd = shaped_owner.get_or_null(p_shaped); + ERR_FAIL_COND(!sd); + + MutexLock lock(sd->mutex); + if (sd->extra_spacing[p_spacing] != p_value) { + if (sd->parent != RID()) { + full_copy(sd); + } + sd->extra_spacing[p_spacing] = p_value; + invalidate(sd); + } +} + +int64_t TextServerFallback::shaped_text_get_spacing(const RID &p_shaped, SpacingType p_spacing) const { + ERR_FAIL_INDEX_V((int)p_spacing, 4, 0); + + const ShapedTextDataFallback *sd = shaped_owner.get_or_null(p_shaped); + ERR_FAIL_COND_V(!sd, 0); + + MutexLock lock(sd->mutex); + return sd->extra_spacing[p_spacing]; +} + int64_t TextServerFallback::shaped_get_span_count(const RID &p_shaped) const { ShapedTextDataFallback *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_COND_V(!sd, 0); @@ -2912,6 +2885,9 @@ RID TextServerFallback::shaped_text_substr(const RID &p_shaped, int64_t p_start, new_sd->sort_valid = false; new_sd->upos = sd->upos; new_sd->uthk = sd->uthk; + for (int i = 0; i < TextServer::SPACING_MAX; i++) { + new_sd->extra_spacing[i] = sd->extra_spacing[i]; + } if (p_length > 0) { new_sd->text = sd->text.substr(p_start - sd->start, p_length); @@ -3289,7 +3265,7 @@ void TextServerFallback::shaped_text_overrun_trim_to_width(const RID &p_shaped_l int ellipsis_width = 0; if (add_ellipsis && whitespace_gl_font_rid.is_valid()) { - ellipsis_width = 3 * dot_adv.x + font_get_spacing(whitespace_gl_font_rid, last_gl_font_size, SPACING_GLYPH) + (cut_per_word ? whitespace_adv.x : 0); + ellipsis_width = 3 * dot_adv.x + sd->extra_spacing[SPACING_GLYPH] + (cut_per_word ? whitespace_adv.x : 0); } int ell_min_characters = 6; @@ -3491,10 +3467,13 @@ bool TextServerFallback::shaped_text_shape(const RID &p_shaped) { sd->descent = MAX(sd->descent, Math::round(font_get_glyph_advance(gl.font_rid, gl.font_size, gl.index).x * 0.5)); } } - if (font_get_spacing(gl.font_rid, gl.font_size, TextServer::SPACING_SPACE) && is_whitespace(sd->text[j - sd->start])) { - gl.advance += font_get_spacing(gl.font_rid, gl.font_size, TextServer::SPACING_SPACE); - } else { - gl.advance += font_get_spacing(gl.font_rid, gl.font_size, TextServer::SPACING_GLYPH); + if (j < sd->end - 1) { + // Do not add extra spacing to the last glyph of the string. + if (is_whitespace(sd->text[j - sd->start])) { + gl.advance += sd->extra_spacing[SPACING_SPACE]; + } else { + gl.advance += sd->extra_spacing[SPACING_GLYPH]; + } } sd->upos = MAX(sd->upos, font_get_underline_position(gl.font_rid, gl.font_size)); sd->uthk = MAX(sd->uthk, font_get_underline_thickness(gl.font_rid, gl.font_size)); @@ -3621,9 +3600,9 @@ Size2 TextServerFallback::shaped_text_get_size(const RID &p_shaped) const { const_cast<TextServerFallback *>(this)->shaped_text_shape(p_shaped); } if (sd->orientation == TextServer::ORIENTATION_HORIZONTAL) { - return Size2(sd->width, sd->ascent + sd->descent).ceil(); + return Size2(sd->width, sd->ascent + sd->descent + sd->extra_spacing[SPACING_TOP] + sd->extra_spacing[SPACING_BOTTOM]).ceil(); } else { - return Size2(sd->ascent + sd->descent, sd->width).ceil(); + return Size2(sd->ascent + sd->descent + sd->extra_spacing[SPACING_TOP] + sd->extra_spacing[SPACING_BOTTOM], sd->width).ceil(); } } @@ -3635,7 +3614,7 @@ double TextServerFallback::shaped_text_get_ascent(const RID &p_shaped) const { if (!sd->valid) { const_cast<TextServerFallback *>(this)->shaped_text_shape(p_shaped); } - return sd->ascent; + return sd->ascent + sd->extra_spacing[SPACING_TOP]; } double TextServerFallback::shaped_text_get_descent(const RID &p_shaped) const { @@ -3646,7 +3625,7 @@ double TextServerFallback::shaped_text_get_descent(const RID &p_shaped) const { if (!sd->valid) { const_cast<TextServerFallback *>(this)->shaped_text_shape(p_shaped); } - return sd->descent; + return sd->descent + sd->extra_spacing[SPACING_BOTTOM]; } double TextServerFallback::shaped_text_get_width(const RID &p_shaped) const { diff --git a/modules/text_server_fb/text_server_fb.h b/modules/text_server_fb/text_server_fb.h index e4c81aed5b..8b10c9e99e 100644 --- a/modules/text_server_fb/text_server_fb.h +++ b/modules/text_server_fb/text_server_fb.h @@ -144,7 +144,7 @@ class TextServerFallback : public TextServerExtension { Vector2 advance; }; - struct FontDataForSizeFallback { + struct FontForSizeFallback { double ascent = 0.0; double descent = 0.0; double underline_position = 0.0; @@ -152,9 +152,6 @@ class TextServerFallback : public TextServerExtension { double scale = 1.0; double oversampling = 1.0; - int spacing_glyph = 0; - int spacing_space = 0; - Vector2i size; Vector<FontTexture> textures; @@ -166,7 +163,7 @@ class TextServerFallback : public TextServerExtension { FT_StreamRec stream; #endif - ~FontDataForSizeFallback() { + ~FontForSizeFallback() { #ifdef MODULE_FREETYPE_ENABLED if (face != nullptr) { FT_Done_Face(face); @@ -175,7 +172,7 @@ class TextServerFallback : public TextServerExtension { } }; - struct FontDataFallback { + struct FontFallback { Mutex mutex; bool antialiased = true; @@ -196,7 +193,7 @@ class TextServerFallback : public TextServerExtension { String font_name; String style_name; - HashMap<Vector2i, FontDataForSizeFallback *, VariantHasher, VariantComparator> cache; + HashMap<Vector2i, FontForSizeFallback *, VariantHasher, VariantComparator> cache; bool face_init = false; Dictionary supported_varaitions; @@ -213,28 +210,28 @@ class TextServerFallback : public TextServerExtension { mutable ThreadWorkPool work_pool; - ~FontDataFallback() { + ~FontFallback() { work_pool.finish(); - for (const KeyValue<Vector2i, FontDataForSizeFallback *> &E : cache) { + for (const KeyValue<Vector2i, FontForSizeFallback *> &E : cache) { memdelete(E.value); } cache.clear(); } }; - _FORCE_INLINE_ FontTexturePosition find_texture_pos_for_glyph(FontDataForSizeFallback *p_data, int p_color_size, Image::Format p_image_format, int p_width, int p_height, bool p_msdf) const; + _FORCE_INLINE_ FontTexturePosition find_texture_pos_for_glyph(FontForSizeFallback *p_data, int p_color_size, Image::Format p_image_format, int p_width, int p_height, bool p_msdf) const; #ifdef MODULE_MSDFGEN_ENABLED - _FORCE_INLINE_ FontGlyph rasterize_msdf(FontDataFallback *p_font_data, FontDataForSizeFallback *p_data, int p_pixel_range, int p_rect_margin, FT_Outline *outline, const Vector2 &advance) const; + _FORCE_INLINE_ FontGlyph rasterize_msdf(FontFallback *p_font_data, FontForSizeFallback *p_data, int p_pixel_range, int p_rect_margin, FT_Outline *outline, const Vector2 &advance) const; #endif #ifdef MODULE_FREETYPE_ENABLED - _FORCE_INLINE_ FontGlyph rasterize_bitmap(FontDataForSizeFallback *p_data, int p_rect_margin, FT_Bitmap bitmap, int yofs, int xofs, const Vector2 &advance) const; + _FORCE_INLINE_ FontGlyph rasterize_bitmap(FontForSizeFallback *p_data, int p_rect_margin, FT_Bitmap bitmap, int yofs, int xofs, const Vector2 &advance) const; #endif - _FORCE_INLINE_ bool _ensure_glyph(FontDataFallback *p_font_data, const Vector2i &p_size, int32_t p_glyph) const; - _FORCE_INLINE_ bool _ensure_cache_for_size(FontDataFallback *p_font_data, const Vector2i &p_size) const; - _FORCE_INLINE_ void _font_clear_cache(FontDataFallback *p_font_data); + _FORCE_INLINE_ bool _ensure_glyph(FontFallback *p_font_data, const Vector2i &p_size, int32_t p_glyph) const; + _FORCE_INLINE_ bool _ensure_cache_for_size(FontFallback *p_font_data, const Vector2i &p_size) const; + _FORCE_INLINE_ void _font_clear_cache(FontFallback *p_font_data); void _generateMTSDF_threaded(uint32_t y, void *p_td) const; - _FORCE_INLINE_ Vector2i _get_size(const FontDataFallback *p_font_data, int p_size) const { + _FORCE_INLINE_ Vector2i _get_size(const FontFallback *p_font_data, int p_size) const { if (p_font_data->msdf) { return Vector2i(p_font_data->msdf_source_size, 0); } else if (p_font_data->fixed_size > 0) { @@ -244,7 +241,7 @@ class TextServerFallback : public TextServerExtension { } } - _FORCE_INLINE_ Vector2i _get_size_outline(const FontDataFallback *p_font_data, const Vector2i &p_size) const { + _FORCE_INLINE_ Vector2i _get_size_outline(const FontFallback *p_font_data, const Vector2i &p_size) const { if (p_font_data->msdf) { return Vector2i(p_font_data->msdf_source_size, 0); } else if (p_font_data->fixed_size > 0) { @@ -312,6 +309,7 @@ class TextServerFallback : public TextServerExtension { double descent = 0.0; // Descent for horizontal layout, 1/2 of width for vertical. double width = 0.0; // Width for horizontal layout, height for vertical. double width_trimmed = 0.0; + int extra_spacing[4] = { 0, 0, 0, 0 }; double upos = 0.0; double uthk = 0.0; @@ -326,7 +324,7 @@ class TextServerFallback : public TextServerExtension { // Common data. double oversampling = 1.0; - mutable RID_PtrOwner<FontDataFallback> font_owner; + mutable RID_PtrOwner<FontFallback> font_owner; mutable RID_PtrOwner<ShapedTextDataFallback> shaped_owner; void _realign(ShapedTextDataFallback *p_sd) const; @@ -437,9 +435,6 @@ public: virtual void font_set_scale(const RID &p_font_rid, int64_t p_size, double p_scale) override; virtual double font_get_scale(const RID &p_font_rid, int64_t p_size) const override; - virtual void font_set_spacing(const RID &p_font_rid, int64_t p_size, SpacingType p_spacing, int64_t p_value) override; - virtual int64_t font_get_spacing(const RID &p_font_rid, int64_t p_size, SpacingType p_spacing) const override; - virtual int64_t font_get_texture_count(const RID &p_font_rid, const Vector2i &p_size) const override; virtual void font_clear_textures(const RID &p_font_rid, const Vector2i &p_size) override; virtual void font_remove_texture(const RID &p_font_rid, const Vector2i &p_size, int64_t p_texture_index) override; @@ -536,6 +531,9 @@ public: virtual void shaped_text_set_preserve_control(const RID &p_shaped, bool p_enabled) override; virtual bool shaped_text_get_preserve_control(const RID &p_shaped) const override; + virtual void shaped_text_set_spacing(const RID &p_shaped, SpacingType p_spacing, int64_t p_value) override; + virtual int64_t shaped_text_get_spacing(const RID &p_shaped, SpacingType p_spacing) const override; + virtual bool shaped_text_add_string(const RID &p_shaped, const String &p_text, const Array &p_fonts, int64_t p_size, const Dictionary &p_opentype_features = Dictionary(), const String &p_language = "", const Variant &p_meta = Variant()) override; virtual bool shaped_text_add_object(const RID &p_shaped, const Variant &p_key, const Size2 &p_size, InlineAlignment p_inline_align = INLINE_ALIGNMENT_CENTER, int64_t p_length = 1) override; virtual bool shaped_text_resize_object(const RID &p_shaped, const Variant &p_key, const Size2 &p_size, InlineAlignment p_inline_align = INLINE_ALIGNMENT_CENTER) override; diff --git a/modules/visual_script/visual_script.cpp b/modules/visual_script/visual_script.cpp index c5bcf23c8e..742fa75bb7 100644 --- a/modules/visual_script/visual_script.cpp +++ b/modules/visual_script/visual_script.cpp @@ -2435,6 +2435,9 @@ void VisualScriptLanguage::get_public_functions(List<MethodInfo> *p_functions) c void VisualScriptLanguage::get_public_constants(List<Pair<String, Variant>> *p_constants) const { } +void VisualScriptLanguage::get_public_annotations(List<MethodInfo> *p_annotations) const { +} + void VisualScriptLanguage::profiling_start() { } diff --git a/modules/visual_script/visual_script.h b/modules/visual_script/visual_script.h index c2e4d0e597..716310f59b 100644 --- a/modules/visual_script/visual_script.h +++ b/modules/visual_script/visual_script.h @@ -599,6 +599,7 @@ public: virtual void get_recognized_extensions(List<String> *p_extensions) const override; virtual void get_public_functions(List<MethodInfo> *p_functions) const override; virtual void get_public_constants(List<Pair<String, Variant>> *p_constants) const override; + virtual void get_public_annotations(List<MethodInfo> *p_annotations) const override; virtual void profiling_start() override; virtual void profiling_stop() override; diff --git a/platform/android/detect.py b/platform/android/detect.py index 47cfade765..2ff5bf59ea 100644 --- a/platform/android/detect.py +++ b/platform/android/detect.py @@ -96,22 +96,19 @@ def configure(env): if env["android_arch"] == "armv7": target_triple = "armv7a-linux-androideabi" - bin_utils = "arm-linux-androideabi" env.extra_suffix = ".armv7" + env.extra_suffix elif env["android_arch"] == "arm64v8": target_triple = "aarch64-linux-android" - bin_utils = target_triple env.extra_suffix = ".armv8" + env.extra_suffix elif env["android_arch"] == "x86": target_triple = "i686-linux-android" - bin_utils = target_triple env.extra_suffix = ".x86" + env.extra_suffix elif env["android_arch"] == "x86_64": target_triple = "x86_64-linux-android" - bin_utils = target_triple env.extra_suffix = ".x86_64" + env.extra_suffix target_option = ["-target", target_triple + str(get_min_sdk_version(env["ndk_platform"]))] + env.Append(ASFLAGS=[target_option, "-c"]) env.Append(CCFLAGS=target_option) env.Append(LINKFLAGS=target_option) @@ -152,13 +149,12 @@ def configure(env): toolchain_path = ndk_root + "/toolchains/llvm/prebuilt/" + host_subpath compiler_path = toolchain_path + "/bin" - bin_utils_path = toolchain_path + "/" + bin_utils + "/bin" env["CC"] = compiler_path + "/clang" env["CXX"] = compiler_path + "/clang++" env["AR"] = compiler_path + "/llvm-ar" env["RANLIB"] = compiler_path + "/llvm-ranlib" - env["AS"] = bin_utils_path + "/as" + env["AS"] = compiler_path + "/clang" # Disable exceptions and rtti on non-tools (template) builds if env["tools"]: diff --git a/platform/linuxbsd/display_server_x11.cpp b/platform/linuxbsd/display_server_x11.cpp index ee26abab86..b0f87484b9 100644 --- a/platform/linuxbsd/display_server_x11.cpp +++ b/platform/linuxbsd/display_server_x11.cpp @@ -4175,13 +4175,17 @@ void DisplayServerX11::process_events() { void DisplayServerX11::release_rendering_thread() { #if defined(GLES3_ENABLED) - gl_manager->release_current(); + if (gl_manager) { + gl_manager->release_current(); + } #endif } void DisplayServerX11::make_rendering_thread() { #if defined(GLES3_ENABLED) - gl_manager->make_current(); + if (gl_manager) { + gl_manager->make_current(); + } #endif } diff --git a/platform/osx/display_server_osx.mm b/platform/osx/display_server_osx.mm index b6a5813bd0..4307685422 100644 --- a/platform/osx/display_server_osx.mm +++ b/platform/osx/display_server_osx.mm @@ -2920,7 +2920,9 @@ void DisplayServerOSX::make_rendering_thread() { void DisplayServerOSX::swap_buffers() { #if defined(GLES3_ENABLED) - gl_manager->swap_buffers(); + if (gl_manager) { + gl_manager->swap_buffers(); + } #endif } diff --git a/platform/osx/godot_application_delegate.h b/platform/osx/godot_application_delegate.h index 8eec762d8f..f5b67b580f 100644 --- a/platform/osx/godot_application_delegate.h +++ b/platform/osx/godot_application_delegate.h @@ -40,6 +40,7 @@ - (void)forceUnbundledWindowActivationHackStep1; - (void)forceUnbundledWindowActivationHackStep2; - (void)forceUnbundledWindowActivationHackStep3; +- (void)handleAppleEvent:(NSAppleEventDescriptor *)event withReplyEvent:(NSAppleEventDescriptor *)replyEvent; @end #endif // GODOT_APPLICATION_DELEGATE_H diff --git a/platform/osx/godot_application_delegate.mm b/platform/osx/godot_application_delegate.mm index dc82075c44..4d3558b273 100644 --- a/platform/osx/godot_application_delegate.mm +++ b/platform/osx/godot_application_delegate.mm @@ -67,6 +67,52 @@ } } +- (id)init { + self = [super init]; + + NSAppleEventManager *aem = [NSAppleEventManager sharedAppleEventManager]; + [aem setEventHandler:self andSelector:@selector(handleAppleEvent:withReplyEvent:) forEventClass:kInternetEventClass andEventID:kAEGetURL]; + [aem setEventHandler:self andSelector:@selector(handleAppleEvent:withReplyEvent:) forEventClass:kCoreEventClass andEventID:kAEOpenDocuments]; + + return self; +} + +- (void)handleAppleEvent:(NSAppleEventDescriptor *)event withReplyEvent:(NSAppleEventDescriptor *)replyEvent { + OS_OSX *os = (OS_OSX *)OS::get_singleton(); + if (!event || !os) { + return; + } + + List<String> args; + if (([event eventClass] == kInternetEventClass) && ([event eventID] == kAEGetURL)) { + // Opening URL scheme. + NSString *url = [[event paramDescriptorForKeyword:keyDirectObject] stringValue]; + args.push_back(vformat("--uri=\"%s\"", String::utf8([url UTF8String]))); + } + + if (([event eventClass] == kCoreEventClass) && ([event eventID] == kAEOpenDocuments)) { + // Opening file association. + NSAppleEventDescriptor *files = [event paramDescriptorForKeyword:keyDirectObject]; + if (files) { + NSInteger count = [files numberOfItems]; + for (NSInteger i = 1; i <= count; i++) { + NSURL *url = [NSURL URLWithString:[[files descriptorAtIndex:i] stringValue]]; + args.push_back(String::utf8([url.path UTF8String])); + } + } + } + + if (!args.is_empty()) { + if (os->get_main_loop()) { + // Application is already running, open a new instance with the URL/files as command line arguments. + os->create_instance(args); + } else { + // Application is just started, add to the list of command line arguments and continue. + os->set_cmdline_platform_args(args); + } + } +} + - (void)applicationDidResignActive:(NSNotification *)notification { DisplayServerOSX *ds = (DisplayServerOSX *)DisplayServer::get_singleton(); if (ds) { @@ -99,25 +145,6 @@ } } -- (BOOL)application:(NSApplication *)sender openFile:(NSString *)filename { - // Note: may be called called before main loop init! - OS_OSX *os = (OS_OSX *)OS::get_singleton(); - if (os) { - os->set_open_with_filename(String::utf8([filename UTF8String])); - } - -#ifdef TOOLS_ENABLED - // Open new instance. - if (os && os->get_main_loop()) { - List<String> args; - args.push_back(os->get_open_with_filename()); - String exec = os->get_executable_path(); - os->create_process(exec, args); - } -#endif - return YES; -} - - (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender { DisplayServerOSX *ds = (DisplayServerOSX *)DisplayServer::get_singleton(); if (ds) { diff --git a/platform/osx/godot_main_osx.mm b/platform/osx/godot_main_osx.mm index 354edca096..722928ad60 100644 --- a/platform/osx/godot_main_osx.mm +++ b/platform/osx/godot_main_osx.mm @@ -74,14 +74,7 @@ int main(int argc, char **argv) { // We must override main when testing is enabled. TEST_MAIN_OVERRIDE - if (os.get_open_with_filename() != "") { - char *argv_c = (char *)malloc(os.get_open_with_filename().utf8().size()); - memcpy(argv_c, os.get_open_with_filename().utf8().get_data(), os.get_open_with_filename().utf8().size()); - err = Main::setup(argv[0], 1, &argv_c); - free(argv_c); - } else { - err = Main::setup(argv[0], argc - first_arg, &argv[first_arg]); - } + err = Main::setup(argv[0], argc - first_arg, &argv[first_arg]); if (err == ERR_HELP) { // Returned by --help and --version, so success. return 0; diff --git a/platform/osx/os_osx.h b/platform/osx/os_osx.h index e4ec411c96..b105be4a06 100644 --- a/platform/osx/os_osx.h +++ b/platform/osx/os_osx.h @@ -57,7 +57,7 @@ class OS_OSX : public OS_Unix { MainLoop *main_loop = nullptr; - String open_with_filename; + List<String> launch_service_args; static _FORCE_INLINE_ String get_framework_executable(const String &p_path); static void pre_wait_observer_cb(CFRunLoopObserverRef p_observer, CFRunLoopActivity p_activiy, void *p_context); @@ -73,8 +73,8 @@ protected: virtual void delete_main_loop() override; public: - String get_open_with_filename() const; - void set_open_with_filename(const String &p_path); + virtual void set_cmdline_platform_args(const List<String> &p_args); + virtual List<String> get_cmdline_platform_args() const override; virtual String get_name() const override; diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm index a8fa56e34b..5230ed4155 100644 --- a/platform/osx/os_osx.mm +++ b/platform/osx/os_osx.mm @@ -121,12 +121,12 @@ void OS_OSX::delete_main_loop() { main_loop = nullptr; } -String OS_OSX::get_open_with_filename() const { - return open_with_filename; +void OS_OSX::set_cmdline_platform_args(const List<String> &p_args) { + launch_service_args = p_args; } -void OS_OSX::set_open_with_filename(const String &p_path) { - open_with_filename = p_path; +List<String> OS_OSX::get_cmdline_platform_args() const { + return launch_service_args; } String OS_OSX::get_name() const { diff --git a/platform/windows/display_server_windows.cpp b/platform/windows/display_server_windows.cpp index 03d0d0e0bd..e66fa142a7 100644 --- a/platform/windows/display_server_windows.cpp +++ b/platform/windows/display_server_windows.cpp @@ -656,7 +656,9 @@ void DisplayServerWindows::delete_sub_window(WindowID p_window) { void DisplayServerWindows::gl_window_make_current(DisplayServer::WindowID p_window_id) { #if defined(GLES3_ENABLED) - gl_manager->window_make_current(p_window_id); + if (gl_manager) { + gl_manager->window_make_current(p_window_id); + } #endif } diff --git a/scene/3d/label_3d.cpp b/scene/3d/label_3d.cpp index 1ae59451a1..0e5771bdb1 100644 --- a/scene/3d/label_3d.cpp +++ b/scene/3d/label_3d.cpp @@ -53,10 +53,6 @@ void Label3D::_bind_methods() { ClassDB::bind_method(D_METHOD("set_text_direction", "direction"), &Label3D::set_text_direction); ClassDB::bind_method(D_METHOD("get_text_direction"), &Label3D::get_text_direction); - ClassDB::bind_method(D_METHOD("set_opentype_feature", "tag", "value"), &Label3D::set_opentype_feature); - ClassDB::bind_method(D_METHOD("get_opentype_feature", "tag"), &Label3D::get_opentype_feature); - ClassDB::bind_method(D_METHOD("clear_opentype_features"), &Label3D::clear_opentype_features); - ClassDB::bind_method(D_METHOD("set_language", "language"), &Label3D::set_language); ClassDB::bind_method(D_METHOD("get_language"), &Label3D::get_language); @@ -140,7 +136,7 @@ void Label3D::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::COLOR, "outline_modulate"), "set_outline_modulate", "get_outline_modulate"); ADD_PROPERTY(PropertyInfo(Variant::STRING, "text", PROPERTY_HINT_MULTILINE_TEXT, ""), "set_text", "get_text"); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "font", PROPERTY_HINT_RESOURCE_TYPE, "Font"), "set_font", "get_font"); - ADD_PROPERTY(PropertyInfo(Variant::INT, "font_size", PROPERTY_HINT_RANGE, "1,127,1,suffix:px"), "set_font_size", "get_font_size"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "font_size", PROPERTY_HINT_RANGE, "1,256,1,or_greater,suffix:px"), "set_font_size", "get_font_size"); ADD_PROPERTY(PropertyInfo(Variant::INT, "outline_size", PROPERTY_HINT_RANGE, "0,127,1,suffix:px"), "set_outline_size", "get_outline_size"); ADD_PROPERTY(PropertyInfo(Variant::INT, "horizontal_alignment", PROPERTY_HINT_ENUM, "Left,Center,Right,Fill"), "set_horizontal_alignment", "get_horizontal_alignment"); ADD_PROPERTY(PropertyInfo(Variant::INT, "vertical_alignment", PROPERTY_HINT_ENUM, "Top,Center,Bottom"), "set_vertical_alignment", "get_vertical_alignment"); @@ -148,12 +144,12 @@ void Label3D::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "line_spacing", PROPERTY_HINT_NONE, "suffix:px"), "set_line_spacing", "get_line_spacing"); ADD_PROPERTY(PropertyInfo(Variant::INT, "autowrap_mode", PROPERTY_HINT_ENUM, "Off,Arbitrary,Word,Word (Smart)"), "set_autowrap_mode", "get_autowrap_mode"); ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "width", PROPERTY_HINT_NONE, "suffix:px"), "set_width", "get_width"); - ADD_PROPERTY(PropertyInfo(Variant::INT, "structured_text_bidi_override", PROPERTY_HINT_ENUM, "Default,URI,File,Email,List,None,Custom"), "set_structured_text_bidi_override", "get_structured_text_bidi_override"); - ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "structured_text_bidi_override_options"), "set_structured_text_bidi_override_options", "get_structured_text_bidi_override_options"); - ADD_GROUP("Locale", ""); + ADD_GROUP("BiDi", ""); ADD_PROPERTY(PropertyInfo(Variant::INT, "text_direction", PROPERTY_HINT_ENUM, "Auto,Left-to-Right,Right-to-Left"), "set_text_direction", "get_text_direction"); ADD_PROPERTY(PropertyInfo(Variant::STRING, "language", PROPERTY_HINT_LOCALE_ID, ""), "set_language", "get_language"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "structured_text_bidi_override", PROPERTY_HINT_ENUM, "Default,URI,File,Email,List,None,Custom"), "set_structured_text_bidi_override", "get_structured_text_bidi_override"); + ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "structured_text_bidi_override_options"), "set_structured_text_bidi_override_options", "get_structured_text_bidi_override_options"); BIND_ENUM_CONSTANT(FLAG_SHADED); BIND_ENUM_CONSTANT(FLAG_DOUBLE_SIDED); @@ -166,56 +162,6 @@ void Label3D::_bind_methods() { BIND_ENUM_CONSTANT(ALPHA_CUT_OPAQUE_PREPASS); } -bool Label3D::_set(const StringName &p_name, const Variant &p_value) { - String str = p_name; - if (str.begins_with("opentype_features/")) { - String name = str.get_slicec('/', 1); - int32_t tag = TS->name_to_tag(name); - int value = p_value; - if (value == -1) { - if (opentype_features.has(tag)) { - opentype_features.erase(tag); - dirty_font = true; - _queue_update(); - } - } else { - if (!opentype_features.has(tag) || (int)opentype_features[tag] != value) { - opentype_features[tag] = value; - dirty_font = true; - _queue_update(); - } - } - notify_property_list_changed(); - return true; - } - - return false; -} - -bool Label3D::_get(const StringName &p_name, Variant &r_ret) const { - String str = p_name; - if (str.begins_with("opentype_features/")) { - String name = str.get_slicec('/', 1); - int32_t tag = TS->name_to_tag(name); - if (opentype_features.has(tag)) { - r_ret = opentype_features[tag]; - return true; - } else { - r_ret = -1; - return true; - } - } - return false; -} - -void Label3D::_get_property_list(List<PropertyInfo> *p_list) const { - for (const Variant *ftr = opentype_features.next(nullptr); ftr != nullptr; ftr = opentype_features.next(ftr)) { - String name = TS->tag_to_name(*ftr); - p_list->push_back(PropertyInfo(Variant::INT, "opentype_features/" + name)); - } - p_list->push_back(PropertyInfo(Variant::NIL, "opentype_features/_new", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR)); -} - void Label3D::_validate_property(PropertyInfo &property) const { if (property.name == "material_override" || property.name == "material_overlay") { property.usage = PROPERTY_USAGE_NO_EDITOR; @@ -280,7 +226,7 @@ Ref<TriangleMesh> Label3D::generate_triangle_mesh() const { float total_h = 0.0; float max_line_w = 0.0; for (int i = 0; i < lines_rid.size(); i++) { - total_h += TS->shaped_text_get_size(lines_rid[i]).y + font->get_spacing(TextServer::SPACING_TOP) + font->get_spacing(TextServer::SPACING_BOTTOM) + line_spacing; + total_h += TS->shaped_text_get_size(lines_rid[i]).y + line_spacing; max_line_w = MAX(max_line_w, TS->shaped_text_get_width(lines_rid[i])); } @@ -471,7 +417,10 @@ void Label3D::_shape() { TS->shaped_text_set_direction(text_rid, text_direction); String text = (uppercase) ? TS->string_to_upper(xl_text, language) : xl_text; - TS->shaped_text_add_string(text_rid, text, font->get_rids(), font_size, opentype_features, language); + TS->shaped_text_add_string(text_rid, text, font->get_rids(), font_size, font->get_opentype_features(), language); + for (int i = 0; i < TextServer::SPACING_MAX; i++) { + TS->shaped_text_set_spacing(text_rid, TextServer::SpacingType(i), font->get_spacing(TextServer::SpacingType(i))); + } Array stt; if (st_parser == TextServer::STRUCTURED_TEXT_CUSTOM) { @@ -487,7 +436,10 @@ void Label3D::_shape() { } else if (dirty_font) { int spans = TS->shaped_get_span_count(text_rid); for (int i = 0; i < spans; i++) { - TS->shaped_set_span_update_font(text_rid, i, font->get_rids(), font_size, opentype_features); + TS->shaped_set_span_update_font(text_rid, i, font->get_rids(), font_size, font->get_opentype_features()); + } + for (int i = 0; i < TextServer::SPACING_MAX; i++) { + TS->shaped_text_set_spacing(text_rid, TextServer::SpacingType(i), font->get_spacing(TextServer::SpacingType(i))); } dirty_font = false; @@ -534,7 +486,7 @@ void Label3D::_shape() { // Generate surfaces and materials. float total_h = 0.0; for (int i = 0; i < lines_rid.size(); i++) { - total_h += (TS->shaped_text_get_size(lines_rid[i]).y + font->get_spacing(TextServer::SPACING_TOP) + font->get_spacing(TextServer::SPACING_BOTTOM) + line_spacing) * pixel_size; + total_h += (TS->shaped_text_get_size(lines_rid[i]).y + line_spacing) * pixel_size; } float vbegin = 0.0; @@ -570,7 +522,7 @@ void Label3D::_shape() { } break; } offset.x += lbl_offset.x * pixel_size; - offset.y -= (TS->shaped_text_get_ascent(lines_rid[i]) + font->get_spacing(TextServer::SPACING_TOP)) * pixel_size; + offset.y -= TS->shaped_text_get_ascent(lines_rid[i]) * pixel_size; if (outline_modulate.a != 0.0 && outline_size > 0) { // Outline surfaces. @@ -584,7 +536,7 @@ void Label3D::_shape() { for (int j = 0; j < gl_size; j++) { _generate_glyph_surfaces(glyphs[j], offset, modulate, render_priority); } - offset.y -= (TS->shaped_text_get_descent(lines_rid[i]) + line_spacing + font->get_spacing(TextServer::SPACING_BOTTOM)) * pixel_size; + offset.y -= (TS->shaped_text_get_descent(lines_rid[i]) + line_spacing) * pixel_size; } for (const KeyValue<SurfaceKey, SurfaceData> &E : surfaces) { @@ -657,29 +609,6 @@ TextServer::Direction Label3D::get_text_direction() const { return text_direction; } -void Label3D::clear_opentype_features() { - opentype_features.clear(); - dirty_font = true; - _queue_update(); -} - -void Label3D::set_opentype_feature(const String &p_name, int p_value) { - int32_t tag = TS->name_to_tag(p_name); - if (!opentype_features.has(tag) || (int)opentype_features[tag] != p_value) { - opentype_features[tag] = p_value; - dirty_font = true; - _queue_update(); - } -} - -int Label3D::get_opentype_feature(const String &p_name) const { - int32_t tag = TS->name_to_tag(p_name); - if (!opentype_features.has(tag)) { - return -1; - } - return opentype_features[tag]; -} - void Label3D::set_language(const String &p_language) { if (language != p_language) { language = p_language; @@ -781,7 +710,7 @@ Ref<Font> Label3D::_get_font_or_default() const { theme_font.unref(); } - if (font_override.is_valid() && font_override->get_data_count() > 0) { + if (font_override.is_valid()) { return font_override; } diff --git a/scene/3d/label_3d.h b/scene/3d/label_3d.h index 7ac38a9f3c..4498e89517 100644 --- a/scene/3d/label_3d.h +++ b/scene/3d/label_3d.h @@ -122,7 +122,6 @@ private: float line_spacing = 0.f; - Dictionary opentype_features; String language; TextServer::Direction text_direction = TextServer::DIRECTION_AUTO; TextServer::StructuredTextParser st_parser = TextServer::STRUCTURED_TEXT_DEFAULT; @@ -150,9 +149,6 @@ protected: static void _bind_methods(); - 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; void _validate_property(PropertyInfo &property) const override; void _im_update(); @@ -180,10 +176,6 @@ public: void set_text_direction(TextServer::Direction p_text_direction); TextServer::Direction get_text_direction() const; - void set_opentype_feature(const String &p_name, int p_value); - int get_opentype_feature(const String &p_name) const; - void clear_opentype_features(); - void set_language(const String &p_language); String get_language() const; diff --git a/scene/gui/button.cpp b/scene/gui/button.cpp index 1371c9cd57..d23a4fff43 100644 --- a/scene/gui/button.cpp +++ b/scene/gui/button.cpp @@ -342,12 +342,7 @@ void Button::_notification(int p_what) { } break; } - Color font_outline_color = get_theme_color(SNAME("font_outline_color")); - int outline_size = get_theme_constant(SNAME("outline_size")); - if (outline_size > 0 && font_outline_color.a > 0) { - text_buf->draw_outline(ci, text_ofs, outline_size, font_outline_color); - } - + text_buf->draw_outline(ci, text_ofs, get_theme_constant(SNAME("outline_size")), get_theme_color(SNAME("font_outline_color"))); text_buf->draw(ci, text_ofs, color); } break; } @@ -363,7 +358,7 @@ void Button::_shape() { } else { text_buf->set_direction((TextServer::Direction)text_direction); } - text_buf->add_string(xl_text, font, font_size, opentype_features, (!language.is_empty()) ? language : TranslationServer::get_singleton()->get_tool_locale()); + text_buf->add_string(xl_text, font, font_size, language); text_buf->set_text_overrun_behavior(overrun_behavior); } @@ -409,29 +404,6 @@ Control::TextDirection Button::get_text_direction() const { return text_direction; } -void Button::clear_opentype_features() { - opentype_features.clear(); - _shape(); - update(); -} - -void Button::set_opentype_feature(const String &p_name, int p_value) { - int32_t tag = TS->name_to_tag(p_name); - if (!opentype_features.has(tag) || (int)opentype_features[tag] != p_value) { - opentype_features[tag] = p_value; - _shape(); - update(); - } -} - -int Button::get_opentype_feature(const String &p_name) const { - int32_t tag = TS->name_to_tag(p_name); - if (!opentype_features.has(tag)) { - return -1; - } - return opentype_features[tag]; -} - void Button::set_language(const String &p_language) { if (language != p_language) { language = p_language; @@ -512,56 +484,6 @@ HorizontalAlignment Button::get_icon_alignment() const { return icon_alignment; } -bool Button::_set(const StringName &p_name, const Variant &p_value) { - String str = p_name; - if (str.begins_with("opentype_features/")) { - String name = str.get_slicec('/', 1); - int32_t tag = TS->name_to_tag(name); - int value = p_value; - if (value == -1) { - if (opentype_features.has(tag)) { - opentype_features.erase(tag); - _shape(); - update(); - } - } else { - if (!opentype_features.has(tag) || (int)opentype_features[tag] != value) { - opentype_features[tag] = value; - _shape(); - update(); - } - } - notify_property_list_changed(); - return true; - } - - return false; -} - -bool Button::_get(const StringName &p_name, Variant &r_ret) const { - String str = p_name; - if (str.begins_with("opentype_features/")) { - String name = str.get_slicec('/', 1); - int32_t tag = TS->name_to_tag(name); - if (opentype_features.has(tag)) { - r_ret = opentype_features[tag]; - return true; - } else { - r_ret = -1; - return true; - } - } - return false; -} - -void Button::_get_property_list(List<PropertyInfo> *p_list) const { - for (const Variant *ftr = opentype_features.next(nullptr); ftr != nullptr; ftr = opentype_features.next(ftr)) { - String name = TS->tag_to_name(*ftr); - p_list->push_back(PropertyInfo(Variant::INT, "opentype_features/" + name)); - } - p_list->push_back(PropertyInfo(Variant::NIL, "opentype_features/_new", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR)); -} - void Button::_bind_methods() { ClassDB::bind_method(D_METHOD("set_text", "text"), &Button::set_text); ClassDB::bind_method(D_METHOD("get_text"), &Button::get_text); @@ -569,9 +491,6 @@ void Button::_bind_methods() { ClassDB::bind_method(D_METHOD("get_text_overrun_behavior"), &Button::get_text_overrun_behavior); ClassDB::bind_method(D_METHOD("set_text_direction", "direction"), &Button::set_text_direction); ClassDB::bind_method(D_METHOD("get_text_direction"), &Button::get_text_direction); - ClassDB::bind_method(D_METHOD("set_opentype_feature", "tag", "value"), &Button::set_opentype_feature); - ClassDB::bind_method(D_METHOD("get_opentype_feature", "tag"), &Button::get_opentype_feature); - ClassDB::bind_method(D_METHOD("clear_opentype_features"), &Button::clear_opentype_features); ClassDB::bind_method(D_METHOD("set_language", "language"), &Button::set_language); ClassDB::bind_method(D_METHOD("get_language"), &Button::get_language); ClassDB::bind_method(D_METHOD("set_button_icon", "texture"), &Button::set_icon); @@ -588,8 +507,6 @@ void Button::_bind_methods() { ClassDB::bind_method(D_METHOD("is_expand_icon"), &Button::is_expand_icon); ADD_PROPERTY(PropertyInfo(Variant::STRING, "text", PROPERTY_HINT_MULTILINE_TEXT, "", PROPERTY_USAGE_DEFAULT_INTL), "set_text", "get_text"); - ADD_PROPERTY(PropertyInfo(Variant::INT, "text_direction", PROPERTY_HINT_ENUM, "Auto,Left-to-Right,Right-to-Left,Inherited"), "set_text_direction", "get_text_direction"); - ADD_PROPERTY(PropertyInfo(Variant::STRING, "language", PROPERTY_HINT_LOCALE_ID, ""), "set_language", "get_language"); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "icon", PROPERTY_HINT_RESOURCE_TYPE, "Texture2D"), "set_button_icon", "get_button_icon"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "flat"), "set_flat", "is_flat"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "clip_text"), "set_clip_text", "get_clip_text"); @@ -597,6 +514,10 @@ void Button::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::INT, "text_overrun_behavior", PROPERTY_HINT_ENUM, "Trim Nothing,Trim Characters,Trim Words,Ellipsis,Word Ellipsis"), "set_text_overrun_behavior", "get_text_overrun_behavior"); ADD_PROPERTY(PropertyInfo(Variant::INT, "icon_alignment", PROPERTY_HINT_ENUM, "Left,Center,Right"), "set_icon_alignment", "get_icon_alignment"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "expand_icon"), "set_expand_icon", "is_expand_icon"); + + ADD_GROUP("BiDi", ""); + ADD_PROPERTY(PropertyInfo(Variant::INT, "text_direction", PROPERTY_HINT_ENUM, "Auto,Left-to-Right,Right-to-Left,Inherited"), "set_text_direction", "get_text_direction"); + ADD_PROPERTY(PropertyInfo(Variant::STRING, "language", PROPERTY_HINT_LOCALE_ID, ""), "set_language", "get_language"); } Button::Button(const String &p_text) { diff --git a/scene/gui/button.h b/scene/gui/button.h index a1d71195cb..7a29cba677 100644 --- a/scene/gui/button.h +++ b/scene/gui/button.h @@ -43,7 +43,6 @@ private: String xl_text; Ref<TextParagraph> text_buf; - Dictionary opentype_features; String language; TextDirection text_direction = TEXT_DIRECTION_AUTO; TextServer::OverrunBehavior overrun_behavior = TextServer::OVERRUN_NO_TRIMMING; @@ -62,10 +61,6 @@ protected: void _notification(int p_what); static void _bind_methods(); - 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 Size2 get_minimum_size() const override; @@ -78,10 +73,6 @@ public: void set_text_direction(TextDirection p_text_direction); TextDirection get_text_direction() const; - void set_opentype_feature(const String &p_name, int p_value); - int get_opentype_feature(const String &p_name) const; - void clear_opentype_features(); - void set_language(const String &p_language); String get_language() const; diff --git a/scene/gui/code_edit.cpp b/scene/gui/code_edit.cpp index a710e924f2..22f968eac7 100644 --- a/scene/gui/code_edit.cpp +++ b/scene/gui/code_edit.cpp @@ -46,7 +46,7 @@ void CodeEdit::_notification(int p_what) { line_spacing = get_theme_constant(SNAME("line_spacing")); set_gutter_width(main_gutter, get_line_height()); - set_gutter_width(line_number_gutter, (line_number_digits + 1) * font->get_char_size('0', 0, font_size).width); + set_gutter_width(line_number_gutter, (line_number_digits + 1) * font->get_char_size('0', font_size).width); set_gutter_width(fold_gutter, get_line_height() / 1.2); breakpoint_color = get_theme_color(SNAME("breakpoint_color")); @@ -86,7 +86,7 @@ void CodeEdit::_notification(int p_what) { if (line_length_guideline_columns.size() > 0) { const int xmargin_beg = style_normal->get_margin(SIDE_LEFT) + get_total_gutter_width(); const int xmargin_end = size.width - style_normal->get_margin(SIDE_RIGHT) - (is_drawing_minimap() ? get_minimap_width() : 0); - const float char_size = font->get_char_size('0', 0, font_size).width; + const float char_size = font->get_char_size('0', font_size).width; for (int i = 0; i < line_length_guideline_columns.size(); i++) { const int xoffset = xmargin_beg + char_size * (int)line_length_guideline_columns[i] - get_h_scroll(); @@ -123,7 +123,7 @@ void CodeEdit::_notification(int p_what) { } const int scroll_width = code_completion_options_count > code_completion_max_lines ? code_completion_scroll_width : 0; - const int code_completion_base_width = font->get_string_size(code_completion_base, font_size).width; + const int code_completion_base_width = font->get_string_size(code_completion_base, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size).width; if (caret_pos.x - code_completion_base_width + code_completion_rect.size.width + scroll_width > get_size().width) { code_completion_rect.position.x = get_size().width - code_completion_rect.size.width - scroll_width; } else { @@ -178,8 +178,8 @@ void CodeEdit::_notification(int p_what) { for (int j = 0; j < code_completion_options[l].matches.size(); j++) { Pair<int, int> match = code_completion_options[l].matches[j]; - int match_offset = font->get_string_size(code_completion_options[l].display.substr(0, match.first), font_size).width; - int match_len = font->get_string_size(code_completion_options[l].display.substr(match.first, match.second), font_size).width; + int match_offset = font->get_string_size(code_completion_options[l].display.substr(0, match.first), HORIZONTAL_ALIGNMENT_LEFT, -1, font_size).width; + int match_len = font->get_string_size(code_completion_options[l].display.substr(match.first, match.second), HORIZONTAL_ALIGNMENT_LEFT, -1, font_size).width; draw_rect(Rect2(match_pos + Point2(match_offset, 0), Size2(match_len, row_height)), code_completion_existing_color); } @@ -208,11 +208,11 @@ void CodeEdit::_notification(int p_what) { int max_width = 0; for (int i = 0; i < line_count; i++) { - max_width = MAX(max_width, font->get_string_size(code_hint_lines[i], font_size).x); + max_width = MAX(max_width, font->get_string_size(code_hint_lines[i], HORIZONTAL_ALIGNMENT_LEFT, -1, font_size).x); } Size2 minsize = sb->get_minimum_size() + Size2(max_width, line_count * font_height + (line_spacing * line_count - 1)); - int offset = font->get_string_size(code_hint_lines[0].substr(0, code_hint_lines[0].find(String::chr(0xFFFF))), font_size).x; + int offset = font->get_string_size(code_hint_lines[0].substr(0, code_hint_lines[0].find(String::chr(0xFFFF))), HORIZONTAL_ALIGNMENT_LEFT, -1, font_size).x; if (code_hint_xpos == -0xFFFF) { code_hint_xpos = get_caret_draw_pos().x - offset; } @@ -232,8 +232,8 @@ void CodeEdit::_notification(int p_what) { int begin = 0; int end = 0; if (line.contains(String::chr(0xFFFF))) { - begin = font->get_string_size(line.substr(0, line.find(String::chr(0xFFFF))), font_size).x; - end = font->get_string_size(line.substr(0, line.rfind(String::chr(0xFFFF))), font_size).x; + begin = font->get_string_size(line.substr(0, line.find(String::chr(0xFFFF))), HORIZONTAL_ALIGNMENT_LEFT, -1, font_size).x; + end = font->get_string_size(line.substr(0, line.rfind(String::chr(0xFFFF))), HORIZONTAL_ALIGNMENT_LEFT, -1, font_size).x; } Point2 round_ofs = hint_ofs + sb->get_offset() + Vector2(0, font->get_ascent(font_size) + font_height * i + yofs); @@ -2795,7 +2795,7 @@ void CodeEdit::_filter_code_completion_candidates_impl() { offset = line_height; } - max_width = MAX(max_width, font->get_string_size(option.display, font_size).width + offset); + max_width = MAX(max_width, font->get_string_size(option.display, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size).width + offset); code_completion_options.push_back(option); } @@ -2906,7 +2906,7 @@ void CodeEdit::_filter_code_completion_candidates_impl() { if (string_to_complete.length() == 0) { code_completion_options.push_back(option); - max_width = MAX(max_width, font->get_string_size(option.display, font_size).width + offset); + max_width = MAX(max_width, font->get_string_size(option.display, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size).width + offset); continue; } @@ -3012,7 +3012,7 @@ void CodeEdit::_filter_code_completion_candidates_impl() { option.matches.append_array(ssq_matches); completion_options_subseq.push_back(option); } - max_width = MAX(max_width, font->get_string_size(option.display, font_size).width + offset); + max_width = MAX(max_width, font->get_string_size(option.display, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size).width + offset); } else if (!*ssq_lower) { // Matched the whole subsequence in s_lower. option.matches.clear(); @@ -3029,7 +3029,7 @@ void CodeEdit::_filter_code_completion_candidates_impl() { option.matches.append_array(ssq_lower_matches); completion_options_subseq_casei.push_back(option); } - max_width = MAX(max_width, font->get_string_size(option.display, font_size).width + offset); + max_width = MAX(max_width, font->get_string_size(option.display, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size).width + offset); } } @@ -3085,7 +3085,7 @@ void CodeEdit::_text_changed() { } if (font.is_valid()) { - set_gutter_width(line_number_gutter, (line_number_digits + 1) * font->get_char_size('0', 0, font_size).width); + set_gutter_width(line_number_gutter, (line_number_digits + 1) * font->get_char_size('0', font_size).width); } lc = get_line_count(); diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index 6e2db68db0..15ff1d3ed6 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -1115,7 +1115,7 @@ Ref<StyleBox> Control::get_theme_stylebox(const StringName &p_name, const String Ref<Font> Control::get_theme_font(const StringName &p_name, const StringName &p_theme_type) const { if (p_theme_type == StringName() || p_theme_type == get_class_name() || p_theme_type == data.theme_type_variation) { const Ref<Font> *font = data.font_override.getptr(p_name); - if (font && (*font)->get_data_count() > 0) { + if (font) { return *font; } } diff --git a/scene/gui/graph_node.cpp b/scene/gui/graph_node.cpp index 87706cd0d7..92016ca42e 100644 --- a/scene/gui/graph_node.cpp +++ b/scene/gui/graph_node.cpp @@ -44,26 +44,6 @@ struct _MinSizeCache { bool GraphNode::_set(const StringName &p_name, const Variant &p_value) { String str = p_name; - if (str.begins_with("opentype_features/")) { - String name = str.get_slicec('/', 1); - int32_t tag = TS->name_to_tag(name); - int value = p_value; - if (value == -1) { - if (opentype_features.has(tag)) { - opentype_features.erase(tag); - _shape(); - update(); - } - } else { - if (!opentype_features.has(tag) || (int)opentype_features[tag] != value) { - opentype_features[tag] = value; - _shape(); - update(); - } - } - notify_property_list_changed(); - return true; - } if (!str.begins_with("slot/")) { return false; @@ -106,18 +86,6 @@ bool GraphNode::_set(const StringName &p_name, const Variant &p_value) { bool GraphNode::_get(const StringName &p_name, Variant &r_ret) const { String str = p_name; - if (str.begins_with("opentype_features/")) { - String name = str.get_slicec('/', 1); - int32_t tag = TS->name_to_tag(name); - if (opentype_features.has(tag)) { - r_ret = opentype_features[tag]; - return true; - } else { - r_ret = -1; - return true; - } - } - if (!str.begins_with("slot/")) { return false; } @@ -156,12 +124,6 @@ bool GraphNode::_get(const StringName &p_name, Variant &r_ret) const { } void GraphNode::_get_property_list(List<PropertyInfo> *p_list) const { - for (const Variant *ftr = opentype_features.next(nullptr); ftr != nullptr; ftr = opentype_features.next(ftr)) { - String name = TS->tag_to_name(*ftr); - p_list->push_back(PropertyInfo(Variant::INT, "opentype_features/" + name)); - } - p_list->push_back(PropertyInfo(Variant::NIL, "opentype_features/_new", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR)); - int idx = 0; for (int i = 0; i < get_child_count(); i++) { Control *c = Object::cast_to<Control>(get_child(i)); @@ -471,7 +433,7 @@ void GraphNode::_shape() { } else { title_buf->set_direction((TextServer::Direction)text_direction); } - title_buf->add_string(title, font, font_size, opentype_features, (!language.is_empty()) ? language : TranslationServer::get_singleton()->get_tool_locale()); + title_buf->add_string(title, font, font_size, language); } #ifdef TOOLS_ENABLED @@ -726,29 +688,6 @@ Control::TextDirection GraphNode::get_text_direction() const { return text_direction; } -void GraphNode::clear_opentype_features() { - opentype_features.clear(); - _shape(); - update(); -} - -void GraphNode::set_opentype_feature(const String &p_name, int p_value) { - int32_t tag = TS->name_to_tag(p_name); - if (!opentype_features.has(tag) || (int)opentype_features[tag] != p_value) { - opentype_features[tag] = p_value; - _shape(); - update(); - } -} - -int GraphNode::get_opentype_feature(const String &p_name) const { - int32_t tag = TS->name_to_tag(p_name); - if (!opentype_features.has(tag)) { - return -1; - } - return opentype_features[tag]; -} - void GraphNode::set_language(const String &p_language) { if (language != p_language) { language = p_language; @@ -1043,9 +982,6 @@ void GraphNode::_bind_methods() { ClassDB::bind_method(D_METHOD("get_title"), &GraphNode::get_title); ClassDB::bind_method(D_METHOD("set_text_direction", "direction"), &GraphNode::set_text_direction); ClassDB::bind_method(D_METHOD("get_text_direction"), &GraphNode::get_text_direction); - ClassDB::bind_method(D_METHOD("set_opentype_feature", "tag", "value"), &GraphNode::set_opentype_feature); - ClassDB::bind_method(D_METHOD("get_opentype_feature", "tag"), &GraphNode::get_opentype_feature); - ClassDB::bind_method(D_METHOD("clear_opentype_features"), &GraphNode::clear_opentype_features); ClassDB::bind_method(D_METHOD("set_language", "language"), &GraphNode::set_language); ClassDB::bind_method(D_METHOD("get_language"), &GraphNode::get_language); @@ -1105,8 +1041,6 @@ void GraphNode::_bind_methods() { ClassDB::bind_method(D_METHOD("get_overlay"), &GraphNode::get_overlay); ADD_PROPERTY(PropertyInfo(Variant::STRING, "title"), "set_title", "get_title"); - ADD_PROPERTY(PropertyInfo(Variant::INT, "text_direction", PROPERTY_HINT_ENUM, "Auto,Left-to-Right,Right-to-Left,Inherited"), "set_text_direction", "get_text_direction"); - ADD_PROPERTY(PropertyInfo(Variant::STRING, "language", PROPERTY_HINT_LOCALE_ID, ""), "set_language", "get_language"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "position_offset", PROPERTY_HINT_NONE, "suffix:px"), "set_position_offset", "get_position_offset"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "show_close"), "set_show_close_button", "is_close_button_visible"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "resizable"), "set_resizable", "is_resizable"); @@ -1114,6 +1048,10 @@ void GraphNode::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::BOOL, "comment"), "set_comment", "is_comment"); ADD_PROPERTY(PropertyInfo(Variant::INT, "overlay", PROPERTY_HINT_ENUM, "Disabled,Breakpoint,Position"), "set_overlay", "get_overlay"); + ADD_GROUP("BiDi", ""); + ADD_PROPERTY(PropertyInfo(Variant::INT, "text_direction", PROPERTY_HINT_ENUM, "Auto,Left-to-Right,Right-to-Left,Inherited"), "set_text_direction", "get_text_direction"); + ADD_PROPERTY(PropertyInfo(Variant::STRING, "language", PROPERTY_HINT_LOCALE_ID, ""), "set_language", "get_language"); + ADD_SIGNAL(MethodInfo("position_offset_changed")); ADD_SIGNAL(MethodInfo("slot_updated", PropertyInfo(Variant::INT, "idx"))); ADD_SIGNAL(MethodInfo("dragged", PropertyInfo(Variant::VECTOR2, "from"), PropertyInfo(Variant::VECTOR2, "to"))); diff --git a/scene/gui/graph_node.h b/scene/gui/graph_node.h index f6c943dc89..0651eb5cc9 100644 --- a/scene/gui/graph_node.h +++ b/scene/gui/graph_node.h @@ -60,7 +60,6 @@ private: String title; Ref<TextLine> title_buf; - Dictionary opentype_features; String language; TextDirection text_direction = TEXT_DIRECTION_AUTO; @@ -148,10 +147,6 @@ public: void set_text_direction(TextDirection p_text_direction); TextDirection get_text_direction() const; - void set_opentype_feature(const String &p_name, int p_value); - int get_opentype_feature(const String &p_name) const; - void clear_opentype_features(); - void set_language(const String &p_language); String get_language() const; diff --git a/scene/gui/item_list.cpp b/scene/gui/item_list.cpp index aeb5338022..1d4ca4d196 100644 --- a/scene/gui/item_list.cpp +++ b/scene/gui/item_list.cpp @@ -43,7 +43,7 @@ void ItemList::_shape(int p_idx) { } else { item.text_buf->set_direction((TextServer::Direction)item.text_direction); } - item.text_buf->add_string(item.text, get_theme_font(SNAME("font")), get_theme_font_size(SNAME("font_size")), item.opentype_features, (!item.language.is_empty()) ? item.language : TranslationServer::get_singleton()->get_tool_locale()); + item.text_buf->add_string(item.text, get_theme_font(SNAME("font")), get_theme_font_size(SNAME("font_size")), item.language); if (icon_mode == ICON_MODE_TOP && max_text_lines > 0) { item.text_buf->set_flags(TextServer::BREAK_MANDATORY | TextServer::BREAK_WORD_BOUND | TextServer::BREAK_GRAPHEME_BOUND); } else { @@ -117,35 +117,6 @@ Control::TextDirection ItemList::get_item_text_direction(int p_idx) const { return items[p_idx].text_direction; } -void ItemList::clear_item_opentype_features(int p_idx) { - ERR_FAIL_INDEX(p_idx, items.size()); - items.write[p_idx].opentype_features.clear(); - _shape(p_idx); - update(); -} - -void ItemList::set_item_opentype_feature(int p_idx, const String &p_name, int p_value) { - if (p_idx < 0) { - p_idx += get_item_count(); - } - ERR_FAIL_INDEX(p_idx, items.size()); - int32_t tag = TS->name_to_tag(p_name); - if (!items[p_idx].opentype_features.has(tag) || (int)items[p_idx].opentype_features[tag] != p_value) { - items.write[p_idx].opentype_features[tag] = p_value; - _shape(p_idx); - update(); - } -} - -int ItemList::get_item_opentype_feature(int p_idx, const String &p_name) const { - ERR_FAIL_INDEX_V(p_idx, items.size(), -1); - int32_t tag = TS->name_to_tag(p_name); - if (!items[p_idx].opentype_features.has(tag)) { - return -1; - } - return items[p_idx].opentype_features[tag]; -} - void ItemList::set_item_language(int p_idx, const String &p_language) { if (p_idx < 0) { p_idx += get_item_count(); @@ -1656,10 +1627,6 @@ void ItemList::_bind_methods() { ClassDB::bind_method(D_METHOD("set_item_text_direction", "idx", "direction"), &ItemList::set_item_text_direction); ClassDB::bind_method(D_METHOD("get_item_text_direction", "idx"), &ItemList::get_item_text_direction); - ClassDB::bind_method(D_METHOD("set_item_opentype_feature", "idx", "tag", "value"), &ItemList::set_item_opentype_feature); - ClassDB::bind_method(D_METHOD("get_item_opentype_feature", "idx", "tag"), &ItemList::get_item_opentype_feature); - ClassDB::bind_method(D_METHOD("clear_item_opentype_features", "idx"), &ItemList::clear_item_opentype_features); - ClassDB::bind_method(D_METHOD("set_item_language", "idx", "language"), &ItemList::set_item_language); ClassDB::bind_method(D_METHOD("get_item_language", "idx"), &ItemList::get_item_language); diff --git a/scene/gui/item_list.h b/scene/gui/item_list.h index a15b090149..c7d87da0b5 100644 --- a/scene/gui/item_list.h +++ b/scene/gui/item_list.h @@ -58,7 +58,6 @@ private: Ref<Texture2D> tag_icon; String text; Ref<TextParagraph> text_buf; - Dictionary opentype_features; String language; TextDirection text_direction = TEXT_DIRECTION_AUTO; @@ -145,10 +144,6 @@ public: void set_item_text_direction(int p_idx, TextDirection p_text_direction); TextDirection get_item_text_direction(int p_idx) const; - void set_item_opentype_feature(int p_idx, const String &p_name, int p_value); - int get_item_opentype_feature(int p_idx, const String &p_name) const; - void clear_item_opentype_features(int p_idx); - void set_item_language(int p_idx, const String &p_language); String get_item_language(int p_idx) const; diff --git a/scene/gui/label.cpp b/scene/gui/label.cpp index 82ab7c2e18..5dec1df4a5 100644 --- a/scene/gui/label.cpp +++ b/scene/gui/label.cpp @@ -66,11 +66,11 @@ bool Label::is_uppercase() const { int Label::get_line_height(int p_line) const { Ref<Font> font = get_theme_font(SNAME("font")); if (p_line >= 0 && p_line < lines_rid.size()) { - return TS->shaped_text_get_size(lines_rid[p_line]).y + font->get_spacing(TextServer::SPACING_TOP) + font->get_spacing(TextServer::SPACING_BOTTOM); + return TS->shaped_text_get_size(lines_rid[p_line]).y; } else if (lines_rid.size() > 0) { int h = 0; for (int i = 0; i < lines_rid.size(); i++) { - h = MAX(h, TS->shaped_text_get_size(lines_rid[i]).y) + font->get_spacing(TextServer::SPACING_TOP) + font->get_spacing(TextServer::SPACING_BOTTOM); + h = MAX(h, TS->shaped_text_get_size(lines_rid[i]).y); } return h; } else { @@ -83,7 +83,6 @@ void Label::_shape() { int width = (get_size().width - style->get_minimum_size().width); if (dirty || font_dirty) { - String lang = (!language.is_empty()) ? language : TranslationServer::get_singleton()->get_tool_locale(); if (dirty) { TS->shaped_text_clear(text_rid); } @@ -95,18 +94,21 @@ void Label::_shape() { const Ref<Font> &font = get_theme_font(SNAME("font")); int font_size = get_theme_font_size(SNAME("font_size")); ERR_FAIL_COND(font.is_null()); - String text = (uppercase) ? TS->string_to_upper(xl_text, lang) : xl_text; + String text = (uppercase) ? TS->string_to_upper(xl_text, language) : xl_text; if (visible_chars >= 0 && visible_chars_behavior == TextServer::VC_CHARS_BEFORE_SHAPING) { text = text.substr(0, visible_chars); } if (dirty) { - TS->shaped_text_add_string(text_rid, text, font->get_rids(), font_size, opentype_features, lang); + TS->shaped_text_add_string(text_rid, text, font->get_rids(), font_size, font->get_opentype_features(), language); } else { int spans = TS->shaped_get_span_count(text_rid); for (int i = 0; i < spans; i++) { - TS->shaped_set_span_update_font(text_rid, i, font->get_rids(), font_size, opentype_features); + TS->shaped_set_span_update_font(text_rid, i, font->get_rids(), font_size, font->get_opentype_features()); } } + for (int i = 0; i < TextServer::SPACING_MAX; i++) { + TS->shaped_text_set_spacing(text_rid, TextServer::SpacingType(i), font->get_spacing(TextServer::SpacingType(i))); + } TS->shaped_text_set_bidi_override(text_rid, structured_text_parser(st_parser, st_args, text)); dirty = false; font_dirty = false; @@ -233,7 +235,7 @@ void Label::_update_visible() { minsize.height = 0; int last_line = MIN(lines_rid.size(), lines_visible + lines_skipped); for (int64_t i = lines_skipped; i < last_line; i++) { - minsize.height += TS->shaped_text_get_size(lines_rid[i]).y + font->get_spacing(TextServer::SPACING_TOP) + font->get_spacing(TextServer::SPACING_BOTTOM) + line_spacing; + minsize.height += TS->shaped_text_get_size(lines_rid[i]).y + line_spacing; if (minsize.height > (get_size().height - style->get_minimum_size().height + line_spacing)) { break; } @@ -314,7 +316,7 @@ void Label::_notification(int p_what) { // Get number of lines to fit to the height. for (int64_t i = lines_skipped; i < lines_rid.size(); i++) { - total_h += TS->shaped_text_get_size(lines_rid[i]).y + font->get_spacing(TextServer::SPACING_TOP) + font->get_spacing(TextServer::SPACING_BOTTOM) + line_spacing; + total_h += TS->shaped_text_get_size(lines_rid[i]).y + line_spacing; if (total_h > (get_size().height - style->get_minimum_size().height + line_spacing)) { break; } @@ -334,7 +336,7 @@ void Label::_notification(int p_what) { int total_glyphs = 0; total_h = 0; for (int64_t i = lines_skipped; i < last_line; i++) { - total_h += TS->shaped_text_get_size(lines_rid[i]).y + font->get_spacing(TextServer::SPACING_TOP) + font->get_spacing(TextServer::SPACING_BOTTOM) + line_spacing; + total_h += TS->shaped_text_get_size(lines_rid[i]).y + line_spacing; total_glyphs += TS->shaped_text_get_glyph_count(lines_rid[i]) + TS->shaped_text_get_ellipsis_glyph_count(lines_rid[i]); } int visible_glyphs = total_glyphs * percent_visible; @@ -374,7 +376,7 @@ void Label::_notification(int p_what) { for (int i = lines_skipped; i < last_line; i++) { Size2 line_size = TS->shaped_text_get_size(lines_rid[i]); ofs.x = 0; - ofs.y += TS->shaped_text_get_ascent(lines_rid[i]) + font->get_spacing(TextServer::SPACING_TOP); + ofs.y += TS->shaped_text_get_ascent(lines_rid[i]); switch (horizontal_alignment) { case HORIZONTAL_ALIGNMENT_FILL: if (rtl && autowrap_mode != TextServer::AUTOWRAP_OFF) { @@ -527,7 +529,7 @@ void Label::_notification(int p_what) { } } } - ofs.y += TS->shaped_text_get_descent(lines_rid[i]) + vsep + line_spacing + font->get_spacing(TextServer::SPACING_BOTTOM); + ofs.y += TS->shaped_text_get_descent(lines_rid[i]) + vsep + line_spacing; } } break; @@ -551,7 +553,7 @@ Size2 Label::get_minimum_size() const { Size2 min_size = minsize; Ref<Font> font = get_theme_font(SNAME("font")); - min_size.height = MAX(min_size.height, font->get_height(get_theme_font_size(SNAME("font_size"))) + font->get_spacing(TextServer::SPACING_TOP) + font->get_spacing(TextServer::SPACING_BOTTOM)); + min_size.height = MAX(min_size.height, font->get_height(get_theme_font_size(SNAME("font_size")))); Size2 min_style = get_theme_stylebox(SNAME("normal"))->get_minimum_size(); if (autowrap_mode != TextServer::AUTOWRAP_OFF) { @@ -582,7 +584,7 @@ int Label::get_visible_line_count() const { int lines_visible = 0; float total_h = 0.0; for (int64_t i = lines_skipped; i < lines_rid.size(); i++) { - total_h += TS->shaped_text_get_size(lines_rid[i]).y + font->get_spacing(TextServer::SPACING_TOP) + font->get_spacing(TextServer::SPACING_BOTTOM) + line_spacing; + total_h += TS->shaped_text_get_size(lines_rid[i]).y + line_spacing; if (total_h > (get_size().height - style->get_minimum_size().height + line_spacing)) { break; } @@ -674,29 +676,6 @@ Control::TextDirection Label::get_text_direction() const { return text_direction; } -void Label::clear_opentype_features() { - opentype_features.clear(); - font_dirty = true; - update(); -} - -void Label::set_opentype_feature(const String &p_name, int p_value) { - int32_t tag = TS->name_to_tag(p_name); - if (!opentype_features.has(tag) || (int)opentype_features[tag] != p_value) { - opentype_features[tag] = p_value; - font_dirty = true; - update(); - } -} - -int Label::get_opentype_feature(const String &p_name) const { - int32_t tag = TS->name_to_tag(p_name); - if (!opentype_features.has(tag)) { - return -1; - } - return opentype_features[tag]; -} - void Label::set_language(const String &p_language) { if (language != p_language) { language = p_language; @@ -818,56 +797,6 @@ int Label::get_total_character_count() const { return xl_text.length(); } -bool Label::_set(const StringName &p_name, const Variant &p_value) { - String str = p_name; - if (str.begins_with("opentype_features/")) { - String name = str.get_slicec('/', 1); - int32_t tag = TS->name_to_tag(name); - int value = p_value; - if (value == -1) { - if (opentype_features.has(tag)) { - opentype_features.erase(tag); - font_dirty = true; - update(); - } - } else { - if (!opentype_features.has(tag) || (int)opentype_features[tag] != value) { - opentype_features[tag] = value; - font_dirty = true; - update(); - } - } - notify_property_list_changed(); - return true; - } - - return false; -} - -bool Label::_get(const StringName &p_name, Variant &r_ret) const { - String str = p_name; - if (str.begins_with("opentype_features/")) { - String name = str.get_slicec('/', 1); - int32_t tag = TS->name_to_tag(name); - if (opentype_features.has(tag)) { - r_ret = opentype_features[tag]; - return true; - } else { - r_ret = -1; - return true; - } - } - return false; -} - -void Label::_get_property_list(List<PropertyInfo> *p_list) const { - for (const Variant *ftr = opentype_features.next(nullptr); ftr != nullptr; ftr = opentype_features.next(ftr)) { - String name = TS->tag_to_name(*ftr); - p_list->push_back(PropertyInfo(Variant::INT, "opentype_features/" + name)); - } - p_list->push_back(PropertyInfo(Variant::NIL, "opentype_features/_new", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR)); -} - void Label::_bind_methods() { ClassDB::bind_method(D_METHOD("set_horizontal_alignment", "alignment"), &Label::set_horizontal_alignment); ClassDB::bind_method(D_METHOD("get_horizontal_alignment"), &Label::get_horizontal_alignment); @@ -877,9 +806,6 @@ void Label::_bind_methods() { ClassDB::bind_method(D_METHOD("get_text"), &Label::get_text); ClassDB::bind_method(D_METHOD("set_text_direction", "direction"), &Label::set_text_direction); ClassDB::bind_method(D_METHOD("get_text_direction"), &Label::get_text_direction); - ClassDB::bind_method(D_METHOD("set_opentype_feature", "tag", "value"), &Label::set_opentype_feature); - ClassDB::bind_method(D_METHOD("get_opentype_feature", "tag"), &Label::get_opentype_feature); - ClassDB::bind_method(D_METHOD("clear_opentype_features"), &Label::clear_opentype_features); ClassDB::bind_method(D_METHOD("set_language", "language"), &Label::set_language); ClassDB::bind_method(D_METHOD("get_language"), &Label::get_language); ClassDB::bind_method(D_METHOD("set_autowrap_mode", "autowrap_mode"), &Label::set_autowrap_mode); @@ -924,11 +850,9 @@ void Label::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::INT, "visible_characters_behavior", PROPERTY_HINT_ENUM, "Characters Before Shaping,Characters After Shaping,Glyphs (Layout Direction),Glyphs (Left-to-Right),Glyphs (Right-to-Left)"), "set_visible_characters_behavior", "get_visible_characters_behavior"); ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "percent_visible", PROPERTY_HINT_RANGE, "0,1,0.001"), "set_percent_visible", "get_percent_visible"); - ADD_GROUP("Locale", ""); + ADD_GROUP("BiDi", ""); ADD_PROPERTY(PropertyInfo(Variant::INT, "text_direction", PROPERTY_HINT_ENUM, "Auto,Left-to-Right,Right-to-Left,Inherited"), "set_text_direction", "get_text_direction"); ADD_PROPERTY(PropertyInfo(Variant::STRING, "language", PROPERTY_HINT_LOCALE_ID, ""), "set_language", "get_language"); - - ADD_GROUP("Structured Text", "structured_text_"); ADD_PROPERTY(PropertyInfo(Variant::INT, "structured_text_bidi_override", PROPERTY_HINT_ENUM, "Default,URI,File,Email,List,None,Custom"), "set_structured_text_bidi_override", "get_structured_text_bidi_override"); ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "structured_text_bidi_override_options"), "set_structured_text_bidi_override_options", "get_structured_text_bidi_override_options"); } diff --git a/scene/gui/label.h b/scene/gui/label.h index fac3d75a1b..a59d35950d 100644 --- a/scene/gui/label.h +++ b/scene/gui/label.h @@ -53,7 +53,6 @@ private: RID text_rid; Vector<RID> lines_rid; - Dictionary opentype_features; String language; TextDirection text_direction = TEXT_DIRECTION_AUTO; TextServer::StructuredTextParser st_parser = TextServer::STRUCTURED_TEXT_DEFAULT; @@ -74,10 +73,6 @@ protected: static void _bind_methods(); - 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 Size2 get_minimum_size() const override; @@ -93,10 +88,6 @@ public: void set_text_direction(TextDirection p_text_direction); TextDirection get_text_direction() const; - void set_opentype_feature(const String &p_name, int p_value); - int get_opentype_feature(const String &p_name) const; - void clear_opentype_features(); - void set_language(const String &p_language); String get_language() const; diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp index 377a9c45c5..39f8f23cd8 100644 --- a/scene/gui/line_edit.cpp +++ b/scene/gui/line_edit.cpp @@ -787,7 +787,7 @@ void LineEdit::_notification(int p_what) { int x_ofs = 0; bool using_placeholder = text.is_empty() && ime_text.is_empty(); float text_width = TS->shaped_text_get_size(text_rid).x; - float text_height = TS->shaped_text_get_size(text_rid).y + font->get_spacing(TextServer::SPACING_TOP) + font->get_spacing(TextServer::SPACING_BOTTOM); + float text_height = TS->shaped_text_get_size(text_rid).y; switch (alignment) { case HORIZONTAL_ALIGNMENT_FILL: @@ -1451,29 +1451,6 @@ Control::TextDirection LineEdit::get_text_direction() const { return text_direction; } -void LineEdit::clear_opentype_features() { - opentype_features.clear(); - _shape(); - update(); -} - -void LineEdit::set_opentype_feature(const String &p_name, int p_value) { - int32_t tag = TS->name_to_tag(p_name); - if (!opentype_features.has(tag) || (int)opentype_features[tag] != p_value) { - opentype_features[tag] = p_value; - _shape(); - update(); - } -} - -int LineEdit::get_opentype_feature(const String &p_name) const { - int32_t tag = TS->name_to_tag(p_name); - if (!opentype_features.has(tag)) { - return -1; - } - return opentype_features[tag]; -} - void LineEdit::set_language(const String &p_language) { if (language != p_language) { language = p_language; @@ -1688,7 +1665,7 @@ Size2 LineEdit::get_minimum_size() const { Size2 min_size; // Minimum size of text. - float em_space_size = font->get_char_size('M', 0, font_size).x; + float em_space_size = font->get_char_size('M', font_size).x; min_size.width = get_theme_constant(SNAME("minimum_character_width")) * em_space_size; if (expand_to_text_length) { @@ -1696,7 +1673,7 @@ Size2 LineEdit::get_minimum_size() const { min_size.width = MAX(min_size.width, full_width + em_space_size); } - min_size.height = MAX(TS->shaped_text_get_size(text_rid).y + font->get_spacing(TextServer::SPACING_TOP) + font->get_spacing(TextServer::SPACING_BOTTOM), font->get_height(font_size)); + min_size.height = MAX(TS->shaped_text_get_size(text_rid).y, font->get_height(font_size)); // Take icons into account. int icon_max_width = 0; @@ -2155,7 +2132,10 @@ void LineEdit::_shape() { const Ref<Font> &font = get_theme_font(SNAME("font")); int font_size = get_theme_font_size(SNAME("font_size")); ERR_FAIL_COND(font.is_null()); - TS->shaped_text_add_string(text_rid, t, font->get_rids(), font_size, opentype_features, (!language.is_empty()) ? language : TranslationServer::get_singleton()->get_tool_locale()); + TS->shaped_text_add_string(text_rid, t, font->get_rids(), font_size, font->get_opentype_features(), language); + for (int i = 0; i < TextServer::SPACING_MAX; i++) { + TS->shaped_text_set_spacing(text_rid, TextServer::SpacingType(i), font->get_spacing(TextServer::SpacingType(i))); + } TS->shaped_text_set_bidi_override(text_rid, structured_text_parser(st_parser, st_args, t)); full_width = TS->shaped_text_get_size(text_rid).x; @@ -2236,56 +2216,6 @@ Key LineEdit::_get_menu_action_accelerator(const String &p_action) { } } -bool LineEdit::_set(const StringName &p_name, const Variant &p_value) { - String str = p_name; - if (str.begins_with("opentype_features/")) { - String name = str.get_slicec('/', 1); - int32_t tag = TS->name_to_tag(name); - int value = p_value; - if (value == -1) { - if (opentype_features.has(tag)) { - opentype_features.erase(tag); - _shape(); - update(); - } - } else { - if (!opentype_features.has(tag) || (int)opentype_features[tag] != value) { - opentype_features[tag] = value; - _shape(); - update(); - } - } - notify_property_list_changed(); - return true; - } - - return false; -} - -bool LineEdit::_get(const StringName &p_name, Variant &r_ret) const { - String str = p_name; - if (str.begins_with("opentype_features/")) { - String name = str.get_slicec('/', 1); - int32_t tag = TS->name_to_tag(name); - if (opentype_features.has(tag)) { - r_ret = opentype_features[tag]; - return true; - } else { - r_ret = -1; - return true; - } - } - return false; -} - -void LineEdit::_get_property_list(List<PropertyInfo> *p_list) const { - for (const Variant *ftr = opentype_features.next(nullptr); ftr != nullptr; ftr = opentype_features.next(ftr)) { - String name = TS->tag_to_name(*ftr); - p_list->push_back(PropertyInfo(Variant::INT, "opentype_features/" + name)); - } - p_list->push_back(PropertyInfo(Variant::NIL, "opentype_features/_new", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR)); -} - void LineEdit::_validate_property(PropertyInfo &property) const { if (!caret_blink_enabled && property.name == "caret_blink_speed") { property.usage = PROPERTY_USAGE_NO_EDITOR; @@ -2311,9 +2241,6 @@ void LineEdit::_bind_methods() { ClassDB::bind_method(D_METHOD("set_draw_control_chars", "enable"), &LineEdit::set_draw_control_chars); ClassDB::bind_method(D_METHOD("set_text_direction", "direction"), &LineEdit::set_text_direction); ClassDB::bind_method(D_METHOD("get_text_direction"), &LineEdit::get_text_direction); - ClassDB::bind_method(D_METHOD("set_opentype_feature", "tag", "value"), &LineEdit::set_opentype_feature); - ClassDB::bind_method(D_METHOD("get_opentype_feature", "tag"), &LineEdit::get_opentype_feature); - ClassDB::bind_method(D_METHOD("clear_opentype_features"), &LineEdit::clear_opentype_features); ClassDB::bind_method(D_METHOD("set_language", "language"), &LineEdit::set_language); ClassDB::bind_method(D_METHOD("get_language"), &LineEdit::get_language); ClassDB::bind_method(D_METHOD("set_structured_text_bidi_override", "parser"), &LineEdit::set_structured_text_bidi_override); @@ -2419,18 +2346,20 @@ void LineEdit::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::BOOL, "deselect_on_focus_loss_enabled"), "set_deselect_on_focus_loss_enabled", "is_deselect_on_focus_loss_enabled"); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "right_icon", PROPERTY_HINT_RESOURCE_TYPE, "Texture"), "set_right_icon", "get_right_icon"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "flat"), "set_flat", "is_flat"); - ADD_PROPERTY(PropertyInfo(Variant::INT, "text_direction", PROPERTY_HINT_ENUM, "Auto,Left-to-Right,Right-to-Left,Inherited"), "set_text_direction", "get_text_direction"); - ADD_PROPERTY(PropertyInfo(Variant::STRING, "language", PROPERTY_HINT_LOCALE_ID, ""), "set_language", "get_language"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "draw_control_chars"), "set_draw_control_chars", "get_draw_control_chars"); - ADD_GROUP("Structured Text", "structured_text_"); - ADD_PROPERTY(PropertyInfo(Variant::INT, "structured_text_bidi_override", PROPERTY_HINT_ENUM, "Default,URI,File,Email,List,None,Custom"), "set_structured_text_bidi_override", "get_structured_text_bidi_override"); - ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "structured_text_bidi_override_options"), "set_structured_text_bidi_override_options", "get_structured_text_bidi_override_options"); + ADD_GROUP("Caret", "caret_"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "caret_blink"), "set_caret_blink_enabled", "is_caret_blink_enabled"); ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "caret_blink_speed", PROPERTY_HINT_RANGE, "0.1,10,0.01"), "set_caret_blink_speed", "get_caret_blink_speed"); ADD_PROPERTY(PropertyInfo(Variant::INT, "caret_column", PROPERTY_HINT_RANGE, "0,1000,1,or_greater"), "set_caret_column", "get_caret_column"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "caret_force_displayed"), "set_caret_force_displayed", "is_caret_force_displayed"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "caret_mid_grapheme"), "set_caret_mid_grapheme_enabled", "is_caret_mid_grapheme_enabled"); + + ADD_GROUP("BiDi", ""); + ADD_PROPERTY(PropertyInfo(Variant::INT, "text_direction", PROPERTY_HINT_ENUM, "Auto,Left-to-Right,Right-to-Left,Inherited"), "set_text_direction", "get_text_direction"); + ADD_PROPERTY(PropertyInfo(Variant::STRING, "language", PROPERTY_HINT_LOCALE_ID, ""), "set_language", "get_language"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "structured_text_bidi_override", PROPERTY_HINT_ENUM, "Default,URI,File,Email,List,None,Custom"), "set_structured_text_bidi_override", "get_structured_text_bidi_override"); + ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "structured_text_bidi_override_options"), "set_structured_text_bidi_override_options", "get_structured_text_bidi_override_options"); } void LineEdit::_ensure_menu() { diff --git a/scene/gui/line_edit.h b/scene/gui/line_edit.h index 63c57640dc..557da35bfd 100644 --- a/scene/gui/line_edit.h +++ b/scene/gui/line_edit.h @@ -105,7 +105,6 @@ private: int scroll_offset = 0; int max_length = 0; // 0 for no maximum. - Dictionary opentype_features; String language; TextDirection text_direction = TEXT_DIRECTION_AUTO; TextDirection input_direction = TEXT_DIRECTION_LTR; @@ -210,9 +209,6 @@ protected: virtual void unhandled_key_input(const Ref<InputEvent> &p_event) override; virtual void gui_input(const Ref<InputEvent> &p_event) override; - 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; void _validate_property(PropertyInfo &property) const override; public: @@ -248,10 +244,6 @@ public: void set_text_direction(TextDirection p_text_direction); TextDirection get_text_direction() const; - void set_opentype_feature(const String &p_name, int p_value); - int get_opentype_feature(const String &p_name) const; - void clear_opentype_features(); - void set_language(const String &p_language); String get_language() const; diff --git a/scene/gui/link_button.cpp b/scene/gui/link_button.cpp index dca6437519..30c0bb3321 100644 --- a/scene/gui/link_button.cpp +++ b/scene/gui/link_button.cpp @@ -43,7 +43,7 @@ void LinkButton::_shape() { text_buf->set_direction((TextServer::Direction)text_direction); } TS->shaped_text_set_bidi_override(text_buf->get_rid(), structured_text_parser(st_parser, st_args, xl_text)); - text_buf->add_string(xl_text, font, font_size, opentype_features, (!language.is_empty()) ? language : TranslationServer::get_singleton()->get_tool_locale()); + text_buf->add_string(xl_text, font, font_size, language); } void LinkButton::set_text(const String &p_text) { @@ -96,29 +96,6 @@ Control::TextDirection LinkButton::get_text_direction() const { return text_direction; } -void LinkButton::clear_opentype_features() { - opentype_features.clear(); - _shape(); - update(); -} - -void LinkButton::set_opentype_feature(const String &p_name, int p_value) { - int32_t tag = TS->name_to_tag(p_name); - if (!opentype_features.has(tag) || (int)opentype_features[tag] != p_value) { - opentype_features[tag] = p_value; - _shape(); - update(); - } -} - -int LinkButton::get_opentype_feature(const String &p_name) const { - int32_t tag = TS->name_to_tag(p_name); - if (!opentype_features.has(tag)) { - return -1; - } - return opentype_features[tag]; -} - void LinkButton::set_language(const String &p_language) { if (language != p_language) { language = p_language; @@ -237,64 +214,11 @@ void LinkButton::_notification(int p_what) { } } -bool LinkButton::_set(const StringName &p_name, const Variant &p_value) { - String str = p_name; - if (str.begins_with("opentype_features/")) { - String name = str.get_slicec('/', 1); - int32_t tag = TS->name_to_tag(name); - int value = p_value; - if (value == -1) { - if (opentype_features.has(tag)) { - opentype_features.erase(tag); - _shape(); - update(); - } - } else { - if (!opentype_features.has(tag) || (int)opentype_features[tag] != value) { - opentype_features[tag] = value; - _shape(); - update(); - } - } - notify_property_list_changed(); - return true; - } - - return false; -} - -bool LinkButton::_get(const StringName &p_name, Variant &r_ret) const { - String str = p_name; - if (str.begins_with("opentype_features/")) { - String name = str.get_slicec('/', 1); - int32_t tag = TS->name_to_tag(name); - if (opentype_features.has(tag)) { - r_ret = opentype_features[tag]; - return true; - } else { - r_ret = -1; - return true; - } - } - return false; -} - -void LinkButton::_get_property_list(List<PropertyInfo> *p_list) const { - for (const Variant *ftr = opentype_features.next(nullptr); ftr != nullptr; ftr = opentype_features.next(ftr)) { - String name = TS->tag_to_name(*ftr); - p_list->push_back(PropertyInfo(Variant::INT, "opentype_features/" + name)); - } - p_list->push_back(PropertyInfo(Variant::NIL, "opentype_features/_new", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR)); -} - void LinkButton::_bind_methods() { ClassDB::bind_method(D_METHOD("set_text", "text"), &LinkButton::set_text); ClassDB::bind_method(D_METHOD("get_text"), &LinkButton::get_text); ClassDB::bind_method(D_METHOD("set_text_direction", "direction"), &LinkButton::set_text_direction); ClassDB::bind_method(D_METHOD("get_text_direction"), &LinkButton::get_text_direction); - ClassDB::bind_method(D_METHOD("set_opentype_feature", "tag", "value"), &LinkButton::set_opentype_feature); - ClassDB::bind_method(D_METHOD("get_opentype_feature", "tag"), &LinkButton::get_opentype_feature); - ClassDB::bind_method(D_METHOD("clear_opentype_features"), &LinkButton::clear_opentype_features); ClassDB::bind_method(D_METHOD("set_language", "language"), &LinkButton::set_language); ClassDB::bind_method(D_METHOD("get_language"), &LinkButton::get_language); ClassDB::bind_method(D_METHOD("set_underline_mode", "underline_mode"), &LinkButton::set_underline_mode); @@ -309,10 +233,11 @@ void LinkButton::_bind_methods() { BIND_ENUM_CONSTANT(UNDERLINE_MODE_NEVER); ADD_PROPERTY(PropertyInfo(Variant::STRING, "text"), "set_text", "get_text"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "underline", PROPERTY_HINT_ENUM, "Always,On Hover,Never"), "set_underline_mode", "get_underline_mode"); + + ADD_GROUP("BiDi", ""); ADD_PROPERTY(PropertyInfo(Variant::INT, "text_direction", PROPERTY_HINT_ENUM, "Auto,Left-to-Right,Right-to-Left,Inherited"), "set_text_direction", "get_text_direction"); ADD_PROPERTY(PropertyInfo(Variant::STRING, "language", PROPERTY_HINT_LOCALE_ID, ""), "set_language", "get_language"); - ADD_PROPERTY(PropertyInfo(Variant::INT, "underline", PROPERTY_HINT_ENUM, "Always,On Hover,Never"), "set_underline_mode", "get_underline_mode"); - ADD_GROUP("Structured Text", "structured_text_"); ADD_PROPERTY(PropertyInfo(Variant::INT, "structured_text_bidi_override", PROPERTY_HINT_ENUM, "Default,URI,File,Email,List,None,Custom"), "set_structured_text_bidi_override", "get_structured_text_bidi_override"); ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "structured_text_bidi_override_options"), "set_structured_text_bidi_override_options", "get_structured_text_bidi_override_options"); } diff --git a/scene/gui/link_button.h b/scene/gui/link_button.h index 6d2dcbde84..54a31f06ce 100644 --- a/scene/gui/link_button.h +++ b/scene/gui/link_button.h @@ -50,7 +50,6 @@ private: Ref<TextLine> text_buf; UnderlineMode underline_mode = UNDERLINE_MODE_ALWAYS; - Dictionary opentype_features; String language; TextDirection text_direction = TEXT_DIRECTION_AUTO; TextServer::StructuredTextParser st_parser = TextServer::STRUCTURED_TEXT_DEFAULT; @@ -63,10 +62,6 @@ protected: void _notification(int p_what); static void _bind_methods(); - 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: void set_text(const String &p_text); String get_text() const; @@ -80,10 +75,6 @@ public: void set_text_direction(TextDirection p_text_direction); TextDirection get_text_direction() const; - void set_opentype_feature(const String &p_name, int p_value); - int get_opentype_feature(const String &p_name) const; - void clear_opentype_features(); - void set_language(const String &p_language); String get_language() const; diff --git a/scene/gui/popup_menu.cpp b/scene/gui/popup_menu.cpp index 5931c112eb..3a31246b17 100644 --- a/scene/gui/popup_menu.cpp +++ b/scene/gui/popup_menu.cpp @@ -760,11 +760,11 @@ void PopupMenu::_shape_item(int p_item) { } else { items.write[p_item].text_buf->set_direction((TextServer::Direction)items[p_item].text_direction); } - items.write[p_item].text_buf->add_string(items.write[p_item].xl_text, font, font_size, items[p_item].opentype_features, !items[p_item].language.is_empty() ? items[p_item].language : TranslationServer::get_singleton()->get_tool_locale()); + items.write[p_item].text_buf->add_string(items.write[p_item].xl_text, font, font_size, items[p_item].language); items.write[p_item].accel_text_buf->clear(); items.write[p_item].accel_text_buf->set_direction(is_layout_rtl() ? TextServer::DIRECTION_RTL : TextServer::DIRECTION_LTR); - items.write[p_item].accel_text_buf->add_string(_get_accel_text(items.write[p_item]), font, font_size, Dictionary(), TranslationServer::get_singleton()->get_tool_locale()); + items.write[p_item].accel_text_buf->add_string(_get_accel_text(items.write[p_item]), font, font_size); items.write[p_item].dirty = false; } } @@ -1067,29 +1067,6 @@ void PopupMenu::set_item_text_direction(int p_item, Control::TextDirection p_tex } } -void PopupMenu::clear_item_opentype_features(int p_item) { - if (p_item < 0) { - p_item += get_item_count(); - } - ERR_FAIL_INDEX(p_item, items.size()); - items.write[p_item].opentype_features.clear(); - items.write[p_item].dirty = true; - control->update(); -} - -void PopupMenu::set_item_opentype_feature(int p_item, const String &p_name, int p_value) { - if (p_item < 0) { - p_item += get_item_count(); - } - ERR_FAIL_INDEX(p_item, items.size()); - int32_t tag = TS->name_to_tag(p_name); - if (!items[p_item].opentype_features.has(tag) || (int)items[p_item].opentype_features[tag] != p_value) { - items.write[p_item].opentype_features[tag] = p_value; - items.write[p_item].dirty = true; - control->update(); - } -} - void PopupMenu::set_item_language(int p_item, const String &p_language) { if (p_item < 0) { p_item += get_item_count(); @@ -1195,15 +1172,6 @@ Control::TextDirection PopupMenu::get_item_text_direction(int p_item) const { return items[p_item].text_direction; } -int PopupMenu::get_item_opentype_feature(int p_item, const String &p_name) const { - ERR_FAIL_INDEX_V(p_item, items.size(), -1); - int32_t tag = TS->name_to_tag(p_name); - if (!items[p_item].opentype_features.has(tag)) { - return -1; - } - return items[p_item].opentype_features[tag]; -} - String PopupMenu::get_item_language(int p_item) const { ERR_FAIL_INDEX_V(p_item, items.size(), ""); return items[p_item].language; @@ -1853,7 +1821,6 @@ void PopupMenu::_bind_methods() { ClassDB::bind_method(D_METHOD("set_item_text", "index", "text"), &PopupMenu::set_item_text); ClassDB::bind_method(D_METHOD("set_item_text_direction", "index", "direction"), &PopupMenu::set_item_text_direction); - ClassDB::bind_method(D_METHOD("set_item_opentype_feature", "index", "tag", "value"), &PopupMenu::set_item_opentype_feature); ClassDB::bind_method(D_METHOD("set_item_language", "index", "language"), &PopupMenu::set_item_language); ClassDB::bind_method(D_METHOD("set_item_icon", "index", "icon"), &PopupMenu::set_item_icon); ClassDB::bind_method(D_METHOD("set_item_checked", "index", "checked"), &PopupMenu::set_item_checked); @@ -1876,8 +1843,6 @@ void PopupMenu::_bind_methods() { ClassDB::bind_method(D_METHOD("get_item_text", "index"), &PopupMenu::get_item_text); ClassDB::bind_method(D_METHOD("get_item_text_direction", "index"), &PopupMenu::get_item_text_direction); - ClassDB::bind_method(D_METHOD("get_item_opentype_feature", "index", "tag"), &PopupMenu::get_item_opentype_feature); - ClassDB::bind_method(D_METHOD("clear_item_opentype_features", "index"), &PopupMenu::clear_item_opentype_features); ClassDB::bind_method(D_METHOD("get_item_language", "index"), &PopupMenu::get_item_language); ClassDB::bind_method(D_METHOD("get_item_icon", "index"), &PopupMenu::get_item_icon); ClassDB::bind_method(D_METHOD("is_item_checked", "index"), &PopupMenu::is_item_checked); diff --git a/scene/gui/popup_menu.h b/scene/gui/popup_menu.h index 8218c6122e..daa38b0e6d 100644 --- a/scene/gui/popup_menu.h +++ b/scene/gui/popup_menu.h @@ -47,7 +47,6 @@ class PopupMenu : public Popup { Ref<TextLine> text_buf; Ref<TextLine> accel_text_buf; - Dictionary opentype_features; String language; Control::TextDirection text_direction = Control::TEXT_DIRECTION_AUTO; @@ -171,8 +170,6 @@ public: void set_item_text(int p_idx, const String &p_text); void set_item_text_direction(int p_idx, Control::TextDirection p_text_direction); - void set_item_opentype_feature(int p_idx, const String &p_name, int p_value); - void clear_item_opentype_features(int p_idx); void set_item_language(int p_idx, const String &p_language); void set_item_icon(int p_idx, const Ref<Texture2D> &p_icon); void set_item_checked(int p_idx, bool p_checked); @@ -195,7 +192,6 @@ public: String get_item_text(int p_idx) const; Control::TextDirection get_item_text_direction(int p_idx) const; - int get_item_opentype_feature(int p_idx, const String &p_name) const; String get_item_language(int p_idx) const; int get_item_idx_from_text(const String &text) const; Ref<Texture2D> get_item_icon(int p_idx) const; diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp index 0516c8e722..05824d54f1 100644 --- a/scene/gui/rich_text_label.cpp +++ b/scene/gui/rich_text_label.cpp @@ -227,8 +227,10 @@ void RichTextLabel::_update_line_font(ItemFrame *p_frame, int p_line, const Ref< if (font_size == -1) { font_size = p_base_font_size; } - Dictionary font_ftr = _find_font_features(it); - TS->shaped_set_span_update_font(t, i, font->get_rids(), font_size, font_ftr); + TS->shaped_set_span_update_font(t, i, font->get_rids(), font_size, font->get_opentype_features()); + for (int j = 0; j < TextServer::SPACING_MAX; j++) { + TS->shaped_text_set_spacing(t, TextServer::SpacingType(j), font->get_spacing(TextServer::SpacingType(j))); + } } } @@ -263,7 +265,7 @@ float RichTextLabel::_resize_line(ItemFrame *p_frame, int p_line, const Ref<Font if (tab_size > 0) { // Align inline tabs. Vector<float> tabs; - tabs.push_back(tab_size * p_base_font->get_char_size(' ', 0, p_base_font_size).width); + tabs.push_back(tab_size * p_base_font->get_char_size(' ', p_base_font_size).width); l.text_buf->tab_align(tabs); } @@ -453,7 +455,7 @@ float RichTextLabel::_shape_line(ItemFrame *p_frame, int p_line, const Ref<Font> if (tab_size > 0) { // Align inline tabs. Vector<float> tabs; - tabs.push_back(tab_size * p_base_font->get_char_size(' ', 0, p_base_font_size).width); + tabs.push_back(tab_size * p_base_font->get_char_size(' ', p_base_font_size).width); l.text_buf->tab_align(tabs); } @@ -483,7 +485,7 @@ float RichTextLabel::_shape_line(ItemFrame *p_frame, int p_line, const Ref<Font> if (font_size == -1) { font_size = p_base_font_size; } - l.text_buf->add_string("\n", font, font_size, Dictionary(), ""); + l.text_buf->add_string("\n", font, font_size); text += "\n"; l.char_count++; remaining_characters--; @@ -498,7 +500,6 @@ float RichTextLabel::_shape_line(ItemFrame *p_frame, int p_line, const Ref<Font> if (font_size == -1) { font_size = p_base_font_size; } - Dictionary font_ftr = _find_font_features(it); String lang = _find_language(it); String tx = t->text; if (visible_chars_behavior == TextServer::VC_CHARS_BEFORE_SHAPING && visible_characters >= 0 && remaining_characters >= 0) { @@ -506,7 +507,7 @@ float RichTextLabel::_shape_line(ItemFrame *p_frame, int p_line, const Ref<Font> } remaining_characters -= tx.length(); - l.text_buf->add_string(tx, font, font_size, font_ftr, lang, (uint64_t)it); + l.text_buf->add_string(tx, font, font_size, lang, (uint64_t)it); text += tx; l.char_count += tx.length(); } break; @@ -837,7 +838,7 @@ int RichTextLabel::_draw_line(ItemFrame *p_frame, int p_line, const Vector2 &p_o //draw_rect(Rect2(p_ofs + off, TS->shaped_text_get_size(rid)), Color(1,0,0), false, 2); //DEBUG_RECTS - off.y += TS->shaped_text_get_ascent(rid) + l.text_buf->get_spacing_top(); + off.y += TS->shaped_text_get_ascent(rid); // Draw inlined objects. Array objects = TS->shaped_text_get_objects(rid); for (int i = 0; i < objects.size(); i++) { @@ -1299,7 +1300,7 @@ int RichTextLabel::_draw_line(ItemFrame *p_frame, int p_line, const Vector2 &p_o // Draw foreground color box _draw_fbg_boxes(ci, rid, fbg_line_off, it_from, it_to, chr_range.x, chr_range.y, 1); - off.y += TS->shaped_text_get_descent(rid) + l.text_buf->get_spacing_bottom(); + off.y += TS->shaped_text_get_descent(rid); } return line_count; @@ -1394,7 +1395,7 @@ float RichTextLabel::_find_click_in_line(ItemFrame *p_frame, int p_line, const V } break; } - off.y += TS->shaped_text_get_ascent(rid) + l.text_buf->get_spacing_top(); + off.y += TS->shaped_text_get_ascent(rid); Array objects = TS->shaped_text_get_objects(rid); for (int i = 0; i < objects.size(); i++) { @@ -1491,7 +1492,7 @@ float RichTextLabel::_find_click_in_line(ItemFrame *p_frame, int p_line, const V return table_offy; } - off.y += TS->shaped_text_get_descent(rid) + l.text_buf->get_spacing_bottom() + get_theme_constant(SNAME("line_separation")); + off.y += TS->shaped_text_get_descent(rid) + get_theme_constant(SNAME("line_separation")); } // Text line hit. @@ -2113,21 +2114,6 @@ int RichTextLabel::_find_outline_size(Item *p_item, int p_default) { return p_default; } -Dictionary RichTextLabel::_find_font_features(Item *p_item) { - Item *ffitem = p_item; - - while (ffitem) { - if (ffitem->type == ITEM_FONT_FEATURES) { - ItemFontFeatures *fi = static_cast<ItemFontFeatures *>(ffitem); - return fi->opentype_features; - } - - ffitem = ffitem->parent; - } - - return Dictionary(); -} - RichTextLabel::ItemDropcap *RichTextLabel::_find_dc_item(Item *p_item) { Item *item = p_item; @@ -2204,7 +2190,7 @@ int RichTextLabel::_find_margin(Item *p_item, const Ref<Font> &p_base_font, int if (font_size == -1) { font_size = p_base_font_size; } - margin += tab_size * font->get_char_size(' ', 0, font_size).width; + margin += tab_size * font->get_char_size(' ', font_size).width; } else if (item->type == ITEM_LIST) { Ref<Font> font = _find_font(item); @@ -2215,7 +2201,7 @@ int RichTextLabel::_find_margin(Item *p_item, const Ref<Font> &p_base_font, int if (font_size == -1) { font_size = p_base_font_size; } - margin += tab_size * font->get_char_size(' ', 0, font_size).width; + margin += tab_size * font->get_char_size(' ', font_size).width; } item = item->parent; @@ -2584,8 +2570,8 @@ void RichTextLabel::_process_line_caches() { MutexLock data_lock(data_mutex); Rect2 text_rect = _get_text_rect(); - Ref<Font> base_font = get_theme_font(SNAME("normal_font")); int base_font_size = get_theme_font_size(SNAME("normal_font_size")); + Ref<Font> base_font = get_theme_font(SNAME("normal_font")); int ctrl_height = get_size().height; int fi = main->first_invalid_line.load(); int total_chars = (fi == 0) ? 0 : (main->lines[fi].char_offset + main->lines[fi].char_count); @@ -2950,25 +2936,14 @@ void RichTextLabel::push_font_size(int p_font_size) { _add_item(item, true); } -void RichTextLabel::push_font_features(const Dictionary &p_features) { - _stop_thread(); - MutexLock data_lock(data_mutex); - - ERR_FAIL_COND(current->type == ITEM_TABLE); - ItemFontFeatures *item = memnew(ItemFontFeatures); - - item->opentype_features = p_features; - _add_item(item, true); -} - -void RichTextLabel::push_outline_size(int p_font_size) { +void RichTextLabel::push_outline_size(int p_ol_size) { _stop_thread(); MutexLock data_lock(data_mutex); ERR_FAIL_COND(current->type == ITEM_TABLE); ItemOutlineSize *item = memnew(ItemOutlineSize); - item->outline_size = p_font_size; + item->outline_size = p_ol_size; _add_item(item, true); } @@ -3840,8 +3815,8 @@ void RichTextLabel::append_text(const String &p_bbcode) { tag_stack.push_front("hint"); } else if (tag.begins_with("dropcap")) { Vector<String> subtag = tag.substr(5, tag.length()).split(" "); - Ref<Font> f = get_theme_font(SNAME("normal_font")); int fs = get_theme_font_size(SNAME("normal_font_size")) * 3; + Ref<Font> f = get_theme_font(SNAME("normal_font")); Color color = get_theme_color(SNAME("default_color")); Color outline_color = get_theme_color(SNAME("outline_color")); int outline_size = get_theme_constant(SNAME("outline_size")); @@ -3974,64 +3949,127 @@ void RichTextLabel::append_text(const String &p_bbcode) { pos = brk_end + 1; tag_stack.push_front("outline_color"); - } else if (tag.begins_with("font=")) { - String fnt = tag.substr(5, tag.length()); - - Ref<Font> font = ResourceLoader::load(fnt, "Font"); - if (font.is_valid()) { - push_font(font); - } else { - push_font(normal_font); - } - - pos = brk_end + 1; - tag_stack.push_front("font"); } else if (tag.begins_with("font_size=")) { int fnt_size = tag.substr(10, tag.length()).to_int(); push_font_size(fnt_size); pos = brk_end + 1; tag_stack.push_front("font_size"); + } else if (tag.begins_with("opentype_features=")) { String fnt_ftr = tag.substr(18, tag.length()); Vector<String> subtag = fnt_ftr.split(","); - Dictionary ftrs; - for (int i = 0; i < subtag.size(); i++) { - Vector<String> subtag_a = subtag[i].split("="); - if (subtag_a.size() == 2) { - ftrs[TS->name_to_tag(subtag_a[0])] = subtag_a[1].to_int(); - } else if (subtag_a.size() == 1) { - ftrs[TS->name_to_tag(subtag_a[0])] = 1; + if (subtag.size() > 0) { + Ref<Font> font = _find_font(current); + if (font.is_null()) { + font = normal_font; } + Ref<FontVariation> fc; + fc.instantiate(); + fc->set_base_font(font); + Dictionary features; + for (int i = 0; i < subtag.size(); i++) { + Vector<String> subtag_a = subtag[i].split("="); + if (subtag_a.size() == 2) { + features[TS->name_to_tag(subtag_a[0])] = subtag_a[1].to_int(); + } else if (subtag_a.size() == 1) { + features[TS->name_to_tag(subtag_a[0])] = 1; + } + } + fc->set_opentype_features(features); + push_font(fc); } - push_font_features(ftrs); pos = brk_end + 1; tag_stack.push_front("opentype_features"); + + } else if (tag.begins_with("font=")) { + String fnt = tag.substr(5, tag.length()); + + Ref<Font> fc = ResourceLoader::load(fnt, "Font"); + if (fc.is_valid()) { + push_font(fc); + } + + pos = brk_end + 1; + tag_stack.push_front("font"); + } else if (tag.begins_with("font ")) { Vector<String> subtag = tag.substr(2, tag.length()).split(" "); + Ref<FontVariation> fc; + fc.instantiate(); for (int i = 1; i < subtag.size(); i++) { Vector<String> subtag_a = subtag[i].split("=", true, 2); if (subtag_a.size() == 2) { if (subtag_a[0] == "name" || subtag_a[0] == "n") { String fnt = subtag_a[1]; - Ref<Font> font = ResourceLoader::load(fnt, "Font"); - if (font.is_valid()) { - push_font(font); - } else { - push_font(normal_font); + Ref<Font> font_data = ResourceLoader::load(fnt, "Font"); + if (font_data.is_valid()) { + fc->set_base_font(font_data); } } else if (subtag_a[0] == "size" || subtag_a[0] == "s") { int fnt_size = subtag_a[1].to_int(); - push_font_size(fnt_size); + if (fnt_size > 0) { + push_font_size(fnt_size); + } + } else if (subtag_a[0] == "glyph_spacing" || subtag_a[0] == "gl") { + int spacing = subtag_a[1].to_int(); + fc->set_spacing(TextServer::SPACING_GLYPH, spacing); + } else if (subtag_a[0] == "space_spacing" || subtag_a[0] == "sp") { + int spacing = subtag_a[1].to_int(); + fc->set_spacing(TextServer::SPACING_SPACE, spacing); + } else if (subtag_a[0] == "top_spacing" || subtag_a[0] == "top") { + int spacing = subtag_a[1].to_int(); + fc->set_spacing(TextServer::SPACING_TOP, spacing); + } else if (subtag_a[0] == "bottom_spacing" || subtag_a[0] == "bt") { + int spacing = subtag_a[1].to_int(); + fc->set_spacing(TextServer::SPACING_BOTTOM, spacing); + } else if (subtag_a[0] == "embolden" || subtag_a[0] == "emb") { + float emb = subtag_a[1].to_float(); + fc->set_variation_embolden(emb); + } else if (subtag_a[0] == "face_index" || subtag_a[0] == "fi") { + int fi = subtag_a[1].to_int(); + fc->set_variation_face_index(fi); + } else if (subtag_a[0] == "slant" || subtag_a[0] == "sln") { + float slant = subtag_a[1].to_float(); + fc->set_variation_transform(Transform2D(1.0, slant, 0.0, 1.0, 0.0, 0.0)); + } else if (subtag_a[0] == "opentype_variation" || subtag_a[0] == "otv") { + Dictionary variations; + if (!subtag_a[1].is_empty()) { + Vector<String> variation_tags = subtag_a[1].split(","); + for (int j = 0; j < variation_tags.size(); j++) { + Vector<String> subtag_b = variation_tags[j].split("="); + if (subtag_b.size() == 2) { + variations[TS->name_to_tag(subtag_b[0])] = subtag_b[1].to_float(); + } + } + fc->set_variation_opentype(variations); + } + } else if (subtag_a[0] == "opentype_features" || subtag_a[0] == "otf") { + Dictionary features; + if (!subtag_a[1].is_empty()) { + Vector<String> feature_tags = subtag_a[1].split(","); + for (int j = 0; j < feature_tags.size(); j++) { + Vector<String> subtag_b = feature_tags[j].split("="); + if (subtag_b.size() == 2) { + features[TS->name_to_tag(subtag_b[0])] = subtag_b[1].to_float(); + } else if (subtag_b.size() == 1) { + features[TS->name_to_tag(subtag_b[0])] = 1; + } + } + fc->set_opentype_features(features); + } } } } - + push_font(fc); pos = brk_end + 1; tag_stack.push_front("font"); + } else if (tag.begins_with("outline_size=")) { int fnt_size = tag.substr(13, tag.length()).to_int(); - push_outline_size(fnt_size); + if (fnt_size > 0) { + push_outline_size(fnt_size); + } pos = brk_end + 1; tag_stack.push_front("outline_size"); @@ -4854,7 +4892,6 @@ void RichTextLabel::_bind_methods() { ClassDB::bind_method(D_METHOD("remove_line", "line"), &RichTextLabel::remove_line); ClassDB::bind_method(D_METHOD("push_font", "font"), &RichTextLabel::push_font); ClassDB::bind_method(D_METHOD("push_font_size", "font_size"), &RichTextLabel::push_font_size); - ClassDB::bind_method(D_METHOD("push_font_features", "opentype_features"), &RichTextLabel::push_font_features); ClassDB::bind_method(D_METHOD("push_normal"), &RichTextLabel::push_normal); ClassDB::bind_method(D_METHOD("push_bold"), &RichTextLabel::push_bold); ClassDB::bind_method(D_METHOD("push_bold_italics"), &RichTextLabel::push_bold_italics); @@ -5018,11 +5055,9 @@ void RichTextLabel::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::BOOL, "context_menu_enabled"), "set_context_menu_enabled", "is_context_menu_enabled"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "shortcut_keys_enabled"), "set_shortcut_keys_enabled", "is_shortcut_keys_enabled"); - ADD_GROUP("Locale", ""); + ADD_GROUP("BiDi", ""); ADD_PROPERTY(PropertyInfo(Variant::INT, "text_direction", PROPERTY_HINT_ENUM, "Auto,Left-to-Right,Right-to-Left,Inherited"), "set_text_direction", "get_text_direction"); ADD_PROPERTY(PropertyInfo(Variant::STRING, "language", PROPERTY_HINT_LOCALE_ID, ""), "set_language", "get_language"); - - ADD_GROUP("Structured Text", "structured_text_"); ADD_PROPERTY(PropertyInfo(Variant::INT, "structured_text_bidi_override", PROPERTY_HINT_ENUM, "Default,URI,File,Email,List,None,Custom"), "set_structured_text_bidi_override", "get_structured_text_bidi_override"); ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "structured_text_bidi_override_options"), "set_structured_text_bidi_override_options", "get_structured_text_bidi_override_options"); diff --git a/scene/gui/rich_text_label.h b/scene/gui/rich_text_label.h index c697320976..3b6175e9cf 100644 --- a/scene/gui/rich_text_label.h +++ b/scene/gui/rich_text_label.h @@ -186,11 +186,6 @@ private: ItemFontSize() { type = ITEM_FONT_SIZE; } }; - struct ItemFontFeatures : public Item { - Dictionary opentype_features; - ItemFontFeatures() { type = ITEM_FONT_FEATURES; } - }; - struct ItemColor : public Item { Color color; ItemColor() { type = ITEM_COLOR; } @@ -466,9 +461,8 @@ private: Item *_get_item_at_pos(Item *p_item_from, Item *p_item_to, int p_position); void _find_frame(Item *p_item, ItemFrame **r_frame, int *r_line); - Ref<Font> _find_font(Item *p_item); int _find_font_size(Item *p_item); - Dictionary _find_font_features(Item *p_item); + Ref<Font> _find_font(Item *p_item); int _find_outline_size(Item *p_item, int p_default); ItemList *_find_list_item(Item *p_item); ItemDropcap *_find_dc_item(Item *p_item); @@ -525,7 +519,6 @@ public: void push_dropcap(const String &p_string, const Ref<Font> &p_font, int p_size, const Rect2 &p_dropcap_margins = Rect2(), const Color &p_color = Color(1, 1, 1), int p_ol_size = 0, const Color &p_ol_color = Color(0, 0, 0, 0)); void push_font(const Ref<Font> &p_font); void push_font_size(int p_font_size); - void push_font_features(const Dictionary &p_features); void push_outline_size(int p_font_size); void push_normal(); void push_bold(); diff --git a/scene/gui/tab_bar.cpp b/scene/gui/tab_bar.cpp index b4c90596f9..d36a364677 100644 --- a/scene/gui/tab_bar.cpp +++ b/scene/gui/tab_bar.cpp @@ -311,7 +311,7 @@ void TabBar::_shape(int p_tab) { tabs.write[p_tab].text_buf->set_direction((TextServer::Direction)tabs[p_tab].text_direction); } - tabs.write[p_tab].text_buf->add_string(tabs[p_tab].xl_text, font, font_size, tabs[p_tab].opentype_features, !tabs[p_tab].language.is_empty() ? tabs[p_tab].language : TranslationServer::get_singleton()->get_tool_locale()); + tabs.write[p_tab].text_buf->add_string(tabs[p_tab].xl_text, font, font_size, tabs[p_tab].language); } void TabBar::_notification(int p_what) { @@ -667,48 +667,6 @@ Control::TextDirection TabBar::get_tab_text_direction(int p_tab) const { return tabs[p_tab].text_direction; } -void TabBar::clear_tab_opentype_features(int p_tab) { - ERR_FAIL_INDEX(p_tab, tabs.size()); - tabs.write[p_tab].opentype_features.clear(); - - _shape(p_tab); - _update_cache(); - _ensure_no_over_offset(); - if (scroll_to_selected) { - ensure_tab_visible(current); - } - update(); - update_minimum_size(); -} - -void TabBar::set_tab_opentype_feature(int p_tab, const String &p_name, int p_value) { - ERR_FAIL_INDEX(p_tab, tabs.size()); - - int32_t tag = TS->name_to_tag(p_name); - if (!tabs[p_tab].opentype_features.has(tag) || (int)tabs[p_tab].opentype_features[tag] != p_value) { - tabs.write[p_tab].opentype_features[tag] = p_value; - - _shape(p_tab); - _update_cache(); - _ensure_no_over_offset(); - if (scroll_to_selected) { - ensure_tab_visible(current); - } - update(); - update_minimum_size(); - } -} - -int TabBar::get_tab_opentype_feature(int p_tab, const String &p_name) const { - ERR_FAIL_INDEX_V(p_tab, tabs.size(), -1); - - int32_t tag = TS->name_to_tag(p_name); - if (!tabs[p_tab].opentype_features.has(tag)) { - return -1; - } - return tabs[p_tab].opentype_features[tag]; -} - void TabBar::set_tab_language(int p_tab, const String &p_language) { ERR_FAIL_INDEX(p_tab, tabs.size()); @@ -1553,9 +1511,6 @@ void TabBar::_bind_methods() { ClassDB::bind_method(D_METHOD("get_tab_title", "tab_idx"), &TabBar::get_tab_title); ClassDB::bind_method(D_METHOD("set_tab_text_direction", "tab_idx", "direction"), &TabBar::set_tab_text_direction); ClassDB::bind_method(D_METHOD("get_tab_text_direction", "tab_idx"), &TabBar::get_tab_text_direction); - ClassDB::bind_method(D_METHOD("set_tab_opentype_feature", "tab_idx", "tag", "values"), &TabBar::set_tab_opentype_feature); - ClassDB::bind_method(D_METHOD("get_tab_opentype_feature", "tab_idx", "tag"), &TabBar::get_tab_opentype_feature); - ClassDB::bind_method(D_METHOD("clear_tab_opentype_features", "tab_idx"), &TabBar::clear_tab_opentype_features); ClassDB::bind_method(D_METHOD("set_tab_language", "tab_idx", "language"), &TabBar::set_tab_language); ClassDB::bind_method(D_METHOD("get_tab_language", "tab_idx"), &TabBar::get_tab_language); ClassDB::bind_method(D_METHOD("set_tab_icon", "tab_idx", "icon"), &TabBar::set_tab_icon); diff --git a/scene/gui/tab_bar.h b/scene/gui/tab_bar.h index 548a2e62af..d123385e47 100644 --- a/scene/gui/tab_bar.h +++ b/scene/gui/tab_bar.h @@ -57,7 +57,6 @@ private: String text; String xl_text; - Dictionary opentype_features; String language; Control::TextDirection text_direction = Control::TEXT_DIRECTION_INHERITED; @@ -137,10 +136,6 @@ public: void set_tab_text_direction(int p_tab, TextDirection p_text_direction); TextDirection get_tab_text_direction(int p_tab) const; - void set_tab_opentype_feature(int p_tab, const String &p_name, int p_value); - int get_tab_opentype_feature(int p_tab, const String &p_name) const; - void clear_tab_opentype_features(int p_tab); - void set_tab_language(int p_tab, const String &p_language); String get_tab_language(int p_tab) const; diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index a8542c4346..9c6cd6bdb2 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -75,14 +75,6 @@ int TextEdit::Text::get_tab_size() const { return tab_size; } -void TextEdit::Text::set_font_features(const Dictionary &p_features) { - if (opentype_features.hash() == p_features.hash()) { - return; - } - opentype_features = p_features; - is_dirty = true; -} - void TextEdit::Text::set_direction_and_language(TextServer::Direction p_direction, const String &p_language) { if (direction == p_direction && language == p_language) { return; @@ -178,7 +170,7 @@ void TextEdit::Text::_calculate_max_line_width() { void TextEdit::Text::invalidate_cache(int p_line, int p_column, bool p_text_changed, const String &p_ime_text, const Array &p_bidi_override) { ERR_FAIL_INDEX(p_line, text.size()); - if (font.is_null() || font_size <= 0) { + if (font.is_null()) { return; // Not in tree? } @@ -191,14 +183,14 @@ void TextEdit::Text::invalidate_cache(int p_line, int p_column, bool p_text_chan text.write[p_line].data_buf->set_preserve_control(draw_control_chars); if (p_ime_text.length() > 0) { if (p_text_changed) { - text.write[p_line].data_buf->add_string(p_ime_text, font, font_size, opentype_features, language); + text.write[p_line].data_buf->add_string(p_ime_text, font, font_size, language); } if (!p_bidi_override.is_empty()) { TS->shaped_text_set_bidi_override(text.write[p_line].data_buf->get_rid(), p_bidi_override); } } else { if (p_text_changed) { - text.write[p_line].data_buf->add_string(text[p_line].data, font, font_size, opentype_features, language); + text.write[p_line].data_buf->add_string(text[p_line].data, font, font_size, language); } if (!text[p_line].bidi_override.is_empty()) { TS->shaped_text_set_bidi_override(text.write[p_line].data_buf->get_rid(), text[p_line].bidi_override); @@ -209,14 +201,17 @@ void TextEdit::Text::invalidate_cache(int p_line, int p_column, bool p_text_chan RID r = text.write[p_line].data_buf->get_rid(); int spans = TS->shaped_get_span_count(r); for (int i = 0; i < spans; i++) { - TS->shaped_set_span_update_font(r, i, font->get_rids(), font_size, opentype_features); + TS->shaped_set_span_update_font(r, i, font->get_rids(), font_size, font->get_opentype_features()); + } + for (int i = 0; i < TextServer::SPACING_MAX; i++) { + TS->shaped_text_set_spacing(r, TextServer::SpacingType(i), font->get_spacing(TextServer::SpacingType(i))); } } // Apply tab align. if (tab_size > 0) { Vector<float> tabs; - tabs.push_back(font->get_char_size(' ', 0, font_size).width * tab_size); + tabs.push_back(font->get_char_size(' ', font_size).width * tab_size); text.write[p_line].data_buf->tab_align(tabs); } @@ -255,7 +250,7 @@ void TextEdit::Text::invalidate_all_lines() { if (tab_size_dirty) { if (tab_size > 0) { Vector<float> tabs; - tabs.push_back(font->get_char_size(' ', 0, font_size).width * tab_size); + tabs.push_back(font->get_char_size(' ', font_size).width * tab_size); text.write[i].data_buf->tab_align(tabs); } // Tabs have changes, force width update. @@ -277,7 +272,7 @@ void TextEdit::Text::invalidate_font() { max_width = -1; line_height = -1; - if (!font.is_null() && font_size > 0) { + if (font.is_valid() && font_size > 0) { font_height = font->get_height(font_size); } @@ -295,7 +290,7 @@ void TextEdit::Text::invalidate_all() { max_width = -1; line_height = -1; - if (!font.is_null() && font_size > 0) { + if (font.is_valid() && font_size > 0) { font_height = font->get_height(font_size); } @@ -973,7 +968,7 @@ void TextEdit::_notification(int p_what) { // Give visual indication of empty selected line. if (selection.active && line >= selection.from_line && line <= selection.to_line && char_margin >= xmargin_beg) { - float char_w = font->get_char_size(' ', 0, font_size).width; + float char_w = font->get_char_size(' ', font_size).width; if (rtl) { RenderingServer::get_singleton()->canvas_item_add_rect(ci, Rect2(size.width - xmargin_beg - ofs_x - char_w, ofs_y, char_w, row_height), selection_color); } else { @@ -1071,7 +1066,7 @@ void TextEdit::_notification(int p_what) { // Draw line. RID rid = ldata->get_line_rid(line_wrap_index); - float text_height = TS->shaped_text_get_size(rid).y + font->get_spacing(TextServer::SPACING_TOP) + font->get_spacing(TextServer::SPACING_BOTTOM); + float text_height = TS->shaped_text_get_size(rid).y; if (rtl) { char_margin = size.width - char_margin - TS->shaped_text_get_size(rid).x; @@ -1355,7 +1350,7 @@ void TextEdit::_notification(int p_what) { ts_caret.l_caret.size.y = caret_width; } if (ts_caret.l_caret.position.x >= TS->shaped_text_get_size(rid).x) { - ts_caret.l_caret.size.x = font->get_char_size('m', 0, font_size).x; + ts_caret.l_caret.size.x = font->get_char_size('m', font_size).x; } else { ts_caret.l_caret.size.x = 3 * caret_width; } @@ -2573,7 +2568,7 @@ void TextEdit::_update_placeholder() { placeholder_data_buf->set_width(text.get_width()); placeholder_data_buf->set_direction((TextServer::Direction)text_direction); placeholder_data_buf->set_preserve_control(draw_control_chars); - placeholder_data_buf->add_string(placeholder_text, font, font_size, opentype_features, language); + placeholder_data_buf->add_string(placeholder_text, font, font_size, language); placeholder_bidi_override = structured_text_parser(st_parser, st_args, placeholder_text); if (placeholder_bidi_override.is_empty()) { @@ -2582,7 +2577,7 @@ void TextEdit::_update_placeholder() { if (get_tab_size() > 0) { Vector<float> tabs; - tabs.push_back(font->get_char_size(' ', 0, font_size).width * get_tab_size()); + tabs.push_back(font->get_char_size(' ', font_size).width * get_tab_size()); placeholder_data_buf->tab_align(tabs); } @@ -2653,7 +2648,6 @@ void TextEdit::_update_caches() { dir = (TextServer::Direction)text_direction; } text.set_direction_and_language(dir, (!language.is_empty()) ? language : TranslationServer::get_singleton()->get_tool_locale()); - text.set_font_features(opentype_features); text.set_draw_control_chars(draw_control_chars); text.set_font(font); text.set_font_size(font_size); @@ -2858,33 +2852,6 @@ Control::TextDirection TextEdit::get_text_direction() const { return text_direction; } -void TextEdit::set_opentype_feature(const String &p_name, int p_value) { - int32_t tag = TS->name_to_tag(p_name); - if (!opentype_features.has(tag) || (int)opentype_features[tag] != p_value) { - opentype_features[tag] = p_value; - text.set_font_features(opentype_features); - text.invalidate_font(); - _update_placeholder(); - update(); - } -} - -int TextEdit::get_opentype_feature(const String &p_name) const { - int32_t tag = TS->name_to_tag(p_name); - if (!opentype_features.has(tag)) { - return -1; - } - return opentype_features[tag]; -} - -void TextEdit::clear_opentype_features() { - opentype_features.clear(); - text.set_font_features(opentype_features); - text.invalidate_font(); - _update_placeholder(); - update(); -} - void TextEdit::set_language(const String &p_language) { if (language != p_language) { language = p_language; @@ -5071,10 +5038,6 @@ void TextEdit::_bind_methods() { ClassDB::bind_method(D_METHOD("set_text_direction", "direction"), &TextEdit::set_text_direction); ClassDB::bind_method(D_METHOD("get_text_direction"), &TextEdit::get_text_direction); - ClassDB::bind_method(D_METHOD("set_opentype_feature", "tag", "value"), &TextEdit::set_opentype_feature); - ClassDB::bind_method(D_METHOD("get_opentype_feature", "tag"), &TextEdit::get_opentype_feature); - ClassDB::bind_method(D_METHOD("clear_opentype_features"), &TextEdit::clear_opentype_features); - ClassDB::bind_method(D_METHOD("set_language", "language"), &TextEdit::set_language); ClassDB::bind_method(D_METHOD("get_language"), &TextEdit::get_language); @@ -5107,6 +5070,7 @@ void TextEdit::_bind_methods() { ClassDB::bind_method(D_METHOD("set_text", "text"), &TextEdit::set_text); ClassDB::bind_method(D_METHOD("get_text"), &TextEdit::get_text); + ClassDB::bind_method(D_METHOD("get_line_count"), &TextEdit::get_line_count); ClassDB::bind_method(D_METHOD("set_placeholder", "text"), &TextEdit::set_placeholder); @@ -5427,8 +5391,6 @@ void TextEdit::_bind_methods() { /* Inspector */ ADD_PROPERTY(PropertyInfo(Variant::STRING, "text", PROPERTY_HINT_MULTILINE_TEXT), "set_text", "get_text"); ADD_PROPERTY(PropertyInfo(Variant::STRING, "placeholder_text", PROPERTY_HINT_MULTILINE_TEXT), "set_placeholder", "get_placeholder"); - ADD_PROPERTY(PropertyInfo(Variant::INT, "text_direction", PROPERTY_HINT_ENUM, "Auto,Left-to-Right,Right-to-Left,Inherited"), "set_text_direction", "get_text_direction"); - ADD_PROPERTY(PropertyInfo(Variant::STRING, "language", PROPERTY_HINT_LOCALE_ID, ""), "set_language", "get_language"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "editable"), "set_editable", "is_editable"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "context_menu_enabled"), "set_context_menu_enabled", "is_context_menu_enabled"); @@ -5468,7 +5430,9 @@ void TextEdit::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::BOOL, "caret_move_on_right_click"), "set_move_caret_on_right_click_enabled", "is_move_caret_on_right_click_enabled"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "caret_mid_grapheme"), "set_caret_mid_grapheme_enabled", "is_caret_mid_grapheme_enabled"); - ADD_GROUP("Structured Text", "structured_text_"); + ADD_GROUP("BiDi", ""); + ADD_PROPERTY(PropertyInfo(Variant::INT, "text_direction", PROPERTY_HINT_ENUM, "Auto,Left-to-Right,Right-to-Left,Inherited"), "set_text_direction", "get_text_direction"); + ADD_PROPERTY(PropertyInfo(Variant::STRING, "language", PROPERTY_HINT_LOCALE_ID, ""), "set_language", "get_language"); ADD_PROPERTY(PropertyInfo(Variant::INT, "structured_text_bidi_override", PROPERTY_HINT_ENUM, "Default,URI,File,Email,List,None,Custom"), "set_structured_text_bidi_override", "get_structured_text_bidi_override"); ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "structured_text_bidi_override_options"), "set_structured_text_bidi_override_options", "get_structured_text_bidi_override_options"); @@ -5493,60 +5457,6 @@ void TextEdit::_bind_methods() { ProjectSettings::get_singleton()->set_custom_property_info("gui/common/text_edit_undo_stack_max_size", PropertyInfo(Variant::INT, "gui/common/text_edit_undo_stack_max_size", PROPERTY_HINT_RANGE, "0,10000,1,or_greater")); // No negative numbers. } -bool TextEdit::_set(const StringName &p_name, const Variant &p_value) { - String str = p_name; - if (str.begins_with("opentype_features/")) { - String name = str.get_slicec('/', 1); - int32_t tag = TS->name_to_tag(name); - int value = p_value; - if (value == -1) { - if (opentype_features.has(tag)) { - opentype_features.erase(tag); - text.set_font_features(opentype_features); - text.invalidate_font(); - _update_placeholder(); - update(); - } - } else { - if (!opentype_features.has(tag) || (int)opentype_features[tag] != value) { - opentype_features[tag] = value; - text.set_font_features(opentype_features); - text.invalidate_font(); - _update_placeholder(); - update(); - } - } - notify_property_list_changed(); - return true; - } - - return false; -} - -bool TextEdit::_get(const StringName &p_name, Variant &r_ret) const { - String str = p_name; - if (str.begins_with("opentype_features/")) { - String name = str.get_slicec('/', 1); - int32_t tag = TS->name_to_tag(name); - if (opentype_features.has(tag)) { - r_ret = opentype_features[tag]; - return true; - } else { - r_ret = -1; - return true; - } - } - return false; -} - -void TextEdit::_get_property_list(List<PropertyInfo> *p_list) const { - for (const Variant *ftr = opentype_features.next(nullptr); ftr != nullptr; ftr = opentype_features.next(ftr)) { - String name = TS->tag_to_name(*ftr); - p_list->push_back(PropertyInfo(Variant::INT, "opentype_features/" + name)); - } - p_list->push_back(PropertyInfo(Variant::NIL, "opentype_features/_new", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR)); -} - /* Internal API for CodeEdit. */ // Line hiding. void TextEdit::_set_hiding_enabled(bool p_enabled) { diff --git a/scene/gui/text_edit.h b/scene/gui/text_edit.h index 6ba6e9cf20..6711cf8c7f 100644 --- a/scene/gui/text_edit.h +++ b/scene/gui/text_edit.h @@ -160,7 +160,6 @@ private: int font_size = -1; int font_height = 0; - Dictionary opentype_features; String language; TextServer::Direction direction = TextServer::DIRECTION_AUTO; bool draw_control_chars = false; @@ -180,7 +179,6 @@ private: int get_tab_size() const; void set_font(const Ref<Font> &p_font); void set_font_size(int p_font_size); - void set_font_features(const Dictionary &p_features); void set_direction_and_language(TextServer::Direction p_direction, const String &p_language); void set_draw_control_chars(bool p_enabled); @@ -271,7 +269,6 @@ private: TextDirection text_direction = TEXT_DIRECTION_AUTO; TextDirection input_direction = TEXT_DIRECTION_LTR; - Dictionary opentype_features; String language = ""; TextServer::StructuredTextParser st_parser = TextServer::STRUCTURED_TEXT_DEFAULT; @@ -581,10 +578,6 @@ protected: static void _bind_methods(); - 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; - /* Internal API for CodeEdit, pending public API. */ // brace matching bool highlight_matching_braces_enabled = false; @@ -650,10 +643,6 @@ public: void set_text_direction(TextDirection p_text_direction); TextDirection get_text_direction() const; - void set_opentype_feature(const String &p_name, int p_value); - int get_opentype_feature(const String &p_name) const; - void clear_opentype_features(); - void set_language(const String &p_language); String get_language() const; @@ -686,6 +675,7 @@ public: void set_text(const String &p_text); String get_text() const; + int get_line_count() const; void set_placeholder(const String &p_text); diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index d3e7540790..32d348c121 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -303,37 +303,6 @@ Control::TextDirection TreeItem::get_text_direction(int p_column) const { return cells[p_column].text_direction; } -void TreeItem::clear_opentype_features(int p_column) { - ERR_FAIL_INDEX(p_column, cells.size()); - - cells.write[p_column].opentype_features.clear(); - cells.write[p_column].dirty = true; - cells.write[p_column].cached_minimum_size_dirty = true; - - _changed_notify(p_column); -} - -void TreeItem::set_opentype_feature(int p_column, const String &p_name, int p_value) { - ERR_FAIL_INDEX(p_column, cells.size()); - int32_t tag = TS->name_to_tag(p_name); - if (!cells[p_column].opentype_features.has(tag) || (int)cells[p_column].opentype_features[tag] != p_value) { - cells.write[p_column].opentype_features[tag] = p_value; - cells.write[p_column].dirty = true; - cells.write[p_column].cached_minimum_size_dirty = true; - - _changed_notify(p_column); - } -} - -int TreeItem::get_opentype_feature(int p_column, const String &p_name) const { - ERR_FAIL_INDEX_V(p_column, cells.size(), -1); - int32_t tag = TS->name_to_tag(p_name); - if (!cells[p_column].opentype_features.has(tag)) { - return -1; - } - return cells[p_column].opentype_features[tag]; -} - void TreeItem::set_structured_text_bidi_override(int p_column, TextServer::StructuredTextParser p_parser) { ERR_FAIL_INDEX(p_column, cells.size()); @@ -1269,10 +1238,6 @@ void TreeItem::_bind_methods() { ClassDB::bind_method(D_METHOD("set_text_direction", "column", "direction"), &TreeItem::set_text_direction); ClassDB::bind_method(D_METHOD("get_text_direction", "column"), &TreeItem::get_text_direction); - ClassDB::bind_method(D_METHOD("set_opentype_feature", "column", "tag", "value"), &TreeItem::set_opentype_feature); - ClassDB::bind_method(D_METHOD("get_opentype_feature", "column", "tag"), &TreeItem::get_opentype_feature); - ClassDB::bind_method(D_METHOD("clear_opentype_features", "column"), &TreeItem::clear_opentype_features); - ClassDB::bind_method(D_METHOD("set_structured_text_bidi_override", "column", "parser"), &TreeItem::set_structured_text_bidi_override); ClassDB::bind_method(D_METHOD("get_structured_text_bidi_override", "column"), &TreeItem::get_structured_text_bidi_override); @@ -1667,7 +1632,7 @@ void Tree::update_column(int p_col) { columns.write[p_col].text_buf->set_direction((TextServer::Direction)columns[p_col].text_direction); } - columns.write[p_col].text_buf->add_string(columns[p_col].title, cache.font, cache.font_size, columns[p_col].opentype_features, !columns[p_col].language.is_empty() ? columns[p_col].language : TranslationServer::get_singleton()->get_tool_locale()); + columns.write[p_col].text_buf->add_string(columns[p_col].title, cache.font, cache.font_size, columns[p_col].language); } void Tree::update_item_cell(TreeItem *p_item, int p_col) { @@ -1725,7 +1690,7 @@ void Tree::update_item_cell(TreeItem *p_item, int p_col) { } else { font_size = cache.font_size; } - p_item->cells.write[p_col].text_buf->add_string(valtext, font, font_size, p_item->cells[p_col].opentype_features, !p_item->cells[p_col].language.is_empty() ? p_item->cells[p_col].language : TranslationServer::get_singleton()->get_tool_locale()); + p_item->cells.write[p_col].text_buf->add_string(valtext, font, font_size, p_item->cells[p_col].language); TS->shaped_text_set_bidi_override(p_item->cells[p_col].text_buf->get_rid(), structured_text_parser(p_item->cells[p_col].st_parser, p_item->cells[p_col].st_args, valtext)); p_item->cells.write[p_col].dirty = false; } @@ -4192,7 +4157,7 @@ int Tree::get_column_minimum_width(int p_column) const { // Check if the visible title of the column is wider. if (show_column_titles) { - min_width = MAX(cache.font->get_string_size(columns[p_column].title, cache.font_size).width + cache.bg->get_margin(SIDE_LEFT) + cache.bg->get_margin(SIDE_RIGHT), min_width); + min_width = MAX(cache.font->get_string_size(columns[p_column].title, HORIZONTAL_ALIGNMENT_LEFT, -1, cache.font_size).width + cache.bg->get_margin(SIDE_LEFT) + cache.bg->get_margin(SIDE_RIGHT), min_width); } if (!columns[p_column].clip_content) { @@ -4471,32 +4436,6 @@ Control::TextDirection Tree::get_column_title_direction(int p_column) const { return columns[p_column].text_direction; } -void Tree::clear_column_title_opentype_features(int p_column) { - ERR_FAIL_INDEX(p_column, columns.size()); - columns.write[p_column].opentype_features.clear(); - update_column(p_column); - update(); -} - -void Tree::set_column_title_opentype_feature(int p_column, const String &p_name, int p_value) { - ERR_FAIL_INDEX(p_column, columns.size()); - int32_t tag = TS->name_to_tag(p_name); - if (!columns[p_column].opentype_features.has(tag) || (int)columns[p_column].opentype_features[tag] != p_value) { - columns.write[p_column].opentype_features[tag] = p_value; - update_column(p_column); - update(); - } -} - -int Tree::get_column_title_opentype_feature(int p_column, const String &p_name) const { - ERR_FAIL_INDEX_V(p_column, columns.size(), -1); - int32_t tag = TS->name_to_tag(p_name); - if (!columns[p_column].opentype_features.has(tag)) { - return -1; - } - return columns[p_column].opentype_features[tag]; -} - void Tree::set_column_title_language(int p_column, const String &p_language) { ERR_FAIL_INDEX(p_column, columns.size()); if (columns[p_column].language != p_language) { @@ -4983,10 +4922,6 @@ void Tree::_bind_methods() { ClassDB::bind_method(D_METHOD("set_column_title_direction", "column", "direction"), &Tree::set_column_title_direction); ClassDB::bind_method(D_METHOD("get_column_title_direction", "column"), &Tree::get_column_title_direction); - ClassDB::bind_method(D_METHOD("set_column_title_opentype_feature", "column", "tag", "value"), &Tree::set_column_title_opentype_feature); - ClassDB::bind_method(D_METHOD("get_column_title_opentype_feature", "column", "tag"), &Tree::get_column_title_opentype_feature); - ClassDB::bind_method(D_METHOD("clear_column_title_opentype_features", "column"), &Tree::clear_column_title_opentype_features); - ClassDB::bind_method(D_METHOD("set_column_title_language", "column", "language"), &Tree::set_column_title_language); ClassDB::bind_method(D_METHOD("get_column_title_language", "column"), &Tree::get_column_title_language); diff --git a/scene/gui/tree.h b/scene/gui/tree.h index 0a8dd3204a..65f7ab185c 100644 --- a/scene/gui/tree.h +++ b/scene/gui/tree.h @@ -63,7 +63,6 @@ private: String text; String suffix; Ref<TextLine> text_buf; - Dictionary opentype_features; String language; TextServer::StructuredTextParser st_parser = TextServer::STRUCTURED_TEXT_DEFAULT; Array st_args; @@ -220,10 +219,6 @@ public: void set_text_direction(int p_column, Control::TextDirection p_text_direction); Control::TextDirection get_text_direction(int p_column) const; - void set_opentype_feature(int p_column, const String &p_name, int p_value); - int get_opentype_feature(int p_column, const String &p_name) const; - void clear_opentype_features(int p_column); - void set_structured_text_bidi_override(int p_column, TextServer::StructuredTextParser p_parser); TextServer::StructuredTextParser get_structured_text_bidi_override(int p_column) const; @@ -429,7 +424,6 @@ private: bool clip_content = false; String title; Ref<TextLine> text_buf; - Dictionary opentype_features; String language; Control::TextDirection text_direction = Control::TEXT_DIRECTION_INHERITED; ColumnInfo() { @@ -666,10 +660,6 @@ public: void set_column_title_direction(int p_column, Control::TextDirection p_text_direction); Control::TextDirection get_column_title_direction(int p_column) const; - void set_column_title_opentype_feature(int p_column, const String &p_name, int p_value); - int get_column_title_opentype_feature(int p_column, const String &p_name) const; - void clear_column_title_opentype_features(int p_column); - void set_column_title_language(int p_column, const String &p_language); String get_column_title_language(int p_column) const; diff --git a/scene/gui/video_stream_player.h b/scene/gui/video_stream_player.h index d2822a989b..913e7905b6 100644 --- a/scene/gui/video_stream_player.h +++ b/scene/gui/video_stream_player.h @@ -64,7 +64,7 @@ class VideoStreamPlayer : public Control { bool autoplay = false; float volume = 1.0; double last_audio_time = 0.0; - bool expand = true; + bool expand = false; bool loops = false; int buffering_ms = 500; int audio_track = 0; diff --git a/scene/main/canvas_item.cpp b/scene/main/canvas_item.cpp index 3dc358a6c2..5e90615ac1 100644 --- a/scene/main/canvas_item.cpp +++ b/scene/main/canvas_item.cpp @@ -658,24 +658,48 @@ void CanvasItem::draw_multimesh(const Ref<MultiMesh> &p_multimesh, const Ref<Tex RenderingServer::get_singleton()->canvas_item_add_multimesh(canvas_item, p_multimesh->get_rid(), texture_rid); } -void CanvasItem::draw_string(const Ref<Font> &p_font, const Point2 &p_pos, const String &p_text, HorizontalAlignment p_alignment, real_t p_width, int p_size, const Color &p_modulate, int p_outline_size, const Color &p_outline_modulate, uint16_t p_flags) const { +void CanvasItem::draw_string(const Ref<Font> &p_font, const Point2 &p_pos, const String &p_text, HorizontalAlignment p_alignment, float p_width, int p_font_size, const Color &p_modulate, uint16_t p_flags, TextServer::Direction p_direction, TextServer::Orientation p_orientation) const { ERR_FAIL_COND_MSG(!drawing, "Drawing is only allowed inside NOTIFICATION_DRAW, _draw() function or 'draw' signal."); ERR_FAIL_COND(p_font.is_null()); - p_font->draw_string(canvas_item, p_pos, p_text, p_alignment, p_width, p_size, p_modulate, p_outline_size, p_outline_modulate, p_flags); + + p_font->draw_string(canvas_item, p_pos, p_text, p_alignment, p_width, p_font_size, p_modulate, p_flags, p_direction, p_orientation); +} + +void CanvasItem::draw_multiline_string(const Ref<Font> &p_font, const Point2 &p_pos, const String &p_text, HorizontalAlignment p_alignment, float p_width, int p_font_size, int p_max_lines, const Color &p_modulate, uint16_t p_flags, TextServer::Direction p_direction, TextServer::Orientation p_orientation) const { + ERR_FAIL_COND_MSG(!drawing, "Drawing is only allowed inside NOTIFICATION_DRAW, _draw() function or 'draw' signal."); + ERR_FAIL_COND(p_font.is_null()); + + p_font->draw_multiline_string(canvas_item, p_pos, p_text, p_alignment, p_width, p_font_size, p_max_lines, p_modulate, p_flags, p_direction, p_orientation); } -void CanvasItem::draw_multiline_string(const Ref<Font> &p_font, const Point2 &p_pos, const String &p_text, HorizontalAlignment p_alignment, real_t p_width, int p_max_lines, int p_size, const Color &p_modulate, int p_outline_size, const Color &p_outline_modulate, uint16_t p_flags) const { +void CanvasItem::draw_string_outline(const Ref<Font> &p_font, const Point2 &p_pos, const String &p_text, HorizontalAlignment p_alignment, float p_width, int p_font_size, int p_size, const Color &p_modulate, uint16_t p_flags, TextServer::Direction p_direction, TextServer::Orientation p_orientation) const { ERR_FAIL_COND_MSG(!drawing, "Drawing is only allowed inside NOTIFICATION_DRAW, _draw() function or 'draw' signal."); ERR_FAIL_COND(p_font.is_null()); - p_font->draw_multiline_string(canvas_item, p_pos, p_text, p_alignment, p_width, p_max_lines, p_size, p_modulate, p_outline_size, p_outline_modulate, p_flags); + + p_font->draw_string_outline(canvas_item, p_pos, p_text, p_alignment, p_width, p_font_size, p_size, p_modulate, p_flags, p_direction, p_orientation); } -real_t CanvasItem::draw_char(const Ref<Font> &p_font, const Point2 &p_pos, const String &p_char, const String &p_next, int p_size, const Color &p_modulate, int p_outline_size, const Color &p_outline_modulate) const { - ERR_FAIL_COND_V_MSG(!drawing, 0.f, "Drawing is only allowed inside NOTIFICATION_DRAW, _draw() function or 'draw' signal."); - ERR_FAIL_COND_V(p_font.is_null(), 0.f); - ERR_FAIL_COND_V(p_char.length() != 1, 0.f); +void CanvasItem::draw_multiline_string_outline(const Ref<Font> &p_font, const Point2 &p_pos, const String &p_text, HorizontalAlignment p_alignment, float p_width, int p_font_size, int p_max_lines, int p_size, const Color &p_modulate, uint16_t p_flags, TextServer::Direction p_direction, TextServer::Orientation p_orientation) const { + ERR_FAIL_COND_MSG(!drawing, "Drawing is only allowed inside NOTIFICATION_DRAW, _draw() function or 'draw' signal."); + ERR_FAIL_COND(p_font.is_null()); + + p_font->draw_multiline_string_outline(canvas_item, p_pos, p_text, p_alignment, p_width, p_font_size, p_max_lines, p_size, p_modulate, p_flags, p_direction, p_orientation); +} + +void CanvasItem::draw_char(const Ref<Font> &p_font, const Point2 &p_pos, const String &p_char, int p_font_size, const Color &p_modulate) const { + ERR_FAIL_COND_MSG(!drawing, "Drawing is only allowed inside NOTIFICATION_DRAW, _draw() function or 'draw' signal."); + ERR_FAIL_COND(p_char.length() != 1); + ERR_FAIL_COND(p_font.is_null()); + + p_font->draw_char(canvas_item, p_pos, p_char[0], p_font_size, p_modulate); +} + +void CanvasItem::draw_char_outline(const Ref<Font> &p_font, const Point2 &p_pos, const String &p_char, int p_font_size, int p_size, const Color &p_modulate) const { + ERR_FAIL_COND_MSG(!drawing, "Drawing is only allowed inside NOTIFICATION_DRAW, _draw() function or 'draw' signal."); + ERR_FAIL_COND(p_char.length() != 1); + ERR_FAIL_COND(p_font.is_null()); - return p_font->draw_char(canvas_item, p_pos, p_char[0], p_next.get_data()[0], p_size, p_modulate, p_outline_size, p_outline_modulate); + p_font->draw_char_outline(canvas_item, p_pos, p_char[0], p_font_size, p_size, p_modulate); } void CanvasItem::_notify_transform(CanvasItem *p_node) { @@ -900,9 +924,12 @@ void CanvasItem::_bind_methods() { ClassDB::bind_method(D_METHOD("draw_primitive", "points", "colors", "uvs", "texture", "width"), &CanvasItem::draw_primitive, DEFVAL(Ref<Texture2D>()), DEFVAL(1.0)); ClassDB::bind_method(D_METHOD("draw_polygon", "points", "colors", "uvs", "texture"), &CanvasItem::draw_polygon, DEFVAL(PackedVector2Array()), DEFVAL(Ref<Texture2D>())); ClassDB::bind_method(D_METHOD("draw_colored_polygon", "points", "color", "uvs", "texture"), &CanvasItem::draw_colored_polygon, DEFVAL(PackedVector2Array()), DEFVAL(Ref<Texture2D>())); - ClassDB::bind_method(D_METHOD("draw_string", "font", "pos", "text", "alignment", "width", "size", "modulate", "outline_size", "outline_modulate", "flags"), &CanvasItem::draw_string, DEFVAL(HORIZONTAL_ALIGNMENT_LEFT), DEFVAL(-1), DEFVAL(Font::DEFAULT_FONT_SIZE), DEFVAL(Color(1, 1, 1)), DEFVAL(0), DEFVAL(Color(1, 1, 1, 0)), DEFVAL(TextServer::JUSTIFICATION_KASHIDA | TextServer::JUSTIFICATION_WORD_BOUND)); - ClassDB::bind_method(D_METHOD("draw_multiline_string", "font", "pos", "text", "alignment", "width", "max_lines", "size", "modulate", "outline_size", "outline_modulate", "flags"), &CanvasItem::draw_multiline_string, DEFVAL(HORIZONTAL_ALIGNMENT_LEFT), DEFVAL(-1), DEFVAL(-1), DEFVAL(Font::DEFAULT_FONT_SIZE), DEFVAL(Color(1, 1, 1)), DEFVAL(0), DEFVAL(Color(1, 1, 1, 0)), DEFVAL(TextServer::BREAK_MANDATORY | TextServer::BREAK_WORD_BOUND | TextServer::JUSTIFICATION_KASHIDA | TextServer::JUSTIFICATION_WORD_BOUND)); - ClassDB::bind_method(D_METHOD("draw_char", "font", "pos", "char", "next", "size", "modulate", "outline_size", "outline_modulate"), &CanvasItem::draw_char, DEFVAL(""), DEFVAL(Font::DEFAULT_FONT_SIZE), DEFVAL(Color(1, 1, 1)), DEFVAL(0), DEFVAL(Color(1, 1, 1, 0))); + ClassDB::bind_method(D_METHOD("draw_string", "font", "pos", "text", "alignment", "width", "font_size", "modulate", "flags", "direction", "orientation"), &CanvasItem::draw_string, DEFVAL(HORIZONTAL_ALIGNMENT_LEFT), DEFVAL(-1), DEFVAL(Font::DEFAULT_FONT_SIZE), DEFVAL(Color(1.0, 1.0, 1.0)), DEFVAL(TextServer::JUSTIFICATION_KASHIDA | TextServer::JUSTIFICATION_WORD_BOUND), DEFVAL(TextServer::DIRECTION_AUTO), DEFVAL(TextServer::ORIENTATION_HORIZONTAL)); + ClassDB::bind_method(D_METHOD("draw_multiline_string", "font", "pos", "text", "alignment", "width", "font_size", "max_lines", "modulate", "flags", "direction", "orientation"), &CanvasItem::draw_multiline_string, DEFVAL(HORIZONTAL_ALIGNMENT_LEFT), DEFVAL(-1), DEFVAL(Font::DEFAULT_FONT_SIZE), DEFVAL(-1), DEFVAL(Color(1.0, 1.0, 1.0)), DEFVAL(TextServer::BREAK_MANDATORY | TextServer::BREAK_WORD_BOUND | TextServer::JUSTIFICATION_KASHIDA | TextServer::JUSTIFICATION_WORD_BOUND), DEFVAL(TextServer::DIRECTION_AUTO), DEFVAL(TextServer::ORIENTATION_HORIZONTAL)); + ClassDB::bind_method(D_METHOD("draw_string_outline", "font", "pos", "text", "alignment", "width", "font_size", "size", "modulate", "flags", "direction", "orientation"), &CanvasItem::draw_string_outline, DEFVAL(HORIZONTAL_ALIGNMENT_LEFT), DEFVAL(-1), DEFVAL(Font::DEFAULT_FONT_SIZE), DEFVAL(1), DEFVAL(Color(1.0, 1.0, 1.0)), DEFVAL(TextServer::JUSTIFICATION_KASHIDA | TextServer::JUSTIFICATION_WORD_BOUND), DEFVAL(TextServer::DIRECTION_AUTO), DEFVAL(TextServer::ORIENTATION_HORIZONTAL)); + ClassDB::bind_method(D_METHOD("draw_multiline_string_outline", "font", "pos", "text", "alignment", "width", "font_size", "max_lines", "size", "modulate", "flags", "direction", "orientation"), &CanvasItem::draw_multiline_string_outline, DEFVAL(HORIZONTAL_ALIGNMENT_LEFT), DEFVAL(-1), DEFVAL(Font::DEFAULT_FONT_SIZE), DEFVAL(-1), DEFVAL(1), DEFVAL(Color(1.0, 1.0, 1.0)), DEFVAL(TextServer::BREAK_MANDATORY | TextServer::BREAK_WORD_BOUND | TextServer::JUSTIFICATION_KASHIDA | TextServer::JUSTIFICATION_WORD_BOUND), DEFVAL(TextServer::DIRECTION_AUTO), DEFVAL(TextServer::ORIENTATION_HORIZONTAL)); + ClassDB::bind_method(D_METHOD("draw_char", "font", "pos", "char", "font_size", "modulate"), &CanvasItem::draw_char, DEFVAL(Font::DEFAULT_FONT_SIZE), DEFVAL(Color(1.0, 1.0, 1.0))); + ClassDB::bind_method(D_METHOD("draw_char_outline", "font", "pos", "char", "font_size", "size", "modulate"), &CanvasItem::draw_char_outline, DEFVAL(Font::DEFAULT_FONT_SIZE), DEFVAL(-1), DEFVAL(Color(1.0, 1.0, 1.0))); ClassDB::bind_method(D_METHOD("draw_mesh", "mesh", "texture", "transform", "modulate"), &CanvasItem::draw_mesh, DEFVAL(Transform2D()), DEFVAL(Color(1, 1, 1, 1))); ClassDB::bind_method(D_METHOD("draw_multimesh", "multimesh", "texture"), &CanvasItem::draw_multimesh); ClassDB::bind_method(D_METHOD("draw_set_transform", "position", "rotation", "scale"), &CanvasItem::draw_set_transform, DEFVAL(0.0), DEFVAL(Size2(1.0, 1.0))); diff --git a/scene/main/canvas_item.h b/scene/main/canvas_item.h index ad64f1ab5e..c88878725f 100644 --- a/scene/main/canvas_item.h +++ b/scene/main/canvas_item.h @@ -235,9 +235,14 @@ public: void draw_mesh(const Ref<Mesh> &p_mesh, const Ref<Texture2D> &p_texture, const Transform2D &p_transform = Transform2D(), const Color &p_modulate = Color(1, 1, 1)); void draw_multimesh(const Ref<MultiMesh> &p_multimesh, const Ref<Texture2D> &p_texture); - void draw_string(const Ref<Font> &p_font, const Point2 &p_pos, const String &p_text, HorizontalAlignment p_alignment = HORIZONTAL_ALIGNMENT_LEFT, real_t p_width = -1, int p_size = Font::DEFAULT_FONT_SIZE, const Color &p_modulate = Color(1, 1, 1), int p_outline_size = 0, const Color &p_outline_modulate = Color(1, 1, 1, 0), uint16_t p_flags = TextServer::JUSTIFICATION_KASHIDA | TextServer::JUSTIFICATION_WORD_BOUND) const; - void draw_multiline_string(const Ref<Font> &p_font, const Point2 &p_pos, const String &p_text, HorizontalAlignment p_alignment = HORIZONTAL_ALIGNMENT_LEFT, real_t p_width = -1, int p_max_lines = -1, int p_size = Font::DEFAULT_FONT_SIZE, const Color &p_modulate = Color(1, 1, 1), int p_outline_size = 0, const Color &p_outline_modulate = Color(1, 1, 1, 0), uint16_t p_flags = TextServer::BREAK_MANDATORY | TextServer::BREAK_WORD_BOUND | TextServer::JUSTIFICATION_KASHIDA | TextServer::JUSTIFICATION_WORD_BOUND) const; - real_t draw_char(const Ref<Font> &p_font, const Point2 &p_pos, const String &p_char, const String &p_next = "", int p_size = Font::DEFAULT_FONT_SIZE, const Color &p_modulate = Color(1, 1, 1), int p_outline_size = 0, const Color &p_outline_modulate = Color(1, 1, 1, 0)) const; + void draw_string(const Ref<Font> &p_font, const Point2 &p_pos, const String &p_text, HorizontalAlignment p_alignment = HORIZONTAL_ALIGNMENT_LEFT, float p_width = -1, int p_font_size = Font::DEFAULT_FONT_SIZE, const Color &p_modulate = Color(1.0, 1.0, 1.0), uint16_t p_flags = TextServer::JUSTIFICATION_KASHIDA | TextServer::JUSTIFICATION_WORD_BOUND, TextServer::Direction p_direction = TextServer::DIRECTION_AUTO, TextServer::Orientation p_orientation = TextServer::ORIENTATION_HORIZONTAL) const; + void draw_multiline_string(const Ref<Font> &p_font, const Point2 &p_pos, const String &p_text, HorizontalAlignment p_alignment = HORIZONTAL_ALIGNMENT_LEFT, float p_width = -1, int p_font_size = Font::DEFAULT_FONT_SIZE, int p_max_lines = -1, const Color &p_modulate = Color(1.0, 1.0, 1.0), uint16_t p_flags = TextServer::BREAK_MANDATORY | TextServer::BREAK_WORD_BOUND | TextServer::JUSTIFICATION_KASHIDA | TextServer::JUSTIFICATION_WORD_BOUND, TextServer::Direction p_direction = TextServer::DIRECTION_AUTO, TextServer::Orientation p_orientation = TextServer::ORIENTATION_HORIZONTAL) const; + + void draw_string_outline(const Ref<Font> &p_font, const Point2 &p_pos, const String &p_text, HorizontalAlignment p_alignment = HORIZONTAL_ALIGNMENT_LEFT, float p_width = -1, int p_size = 1, int p_font_size = Font::DEFAULT_FONT_SIZE, const Color &p_modulate = Color(1.0, 1.0, 1.0), uint16_t p_flags = TextServer::JUSTIFICATION_KASHIDA | TextServer::JUSTIFICATION_WORD_BOUND, TextServer::Direction p_direction = TextServer::DIRECTION_AUTO, TextServer::Orientation p_orientation = TextServer::ORIENTATION_HORIZONTAL) const; + void draw_multiline_string_outline(const Ref<Font> &p_font, const Point2 &p_pos, const String &p_text, HorizontalAlignment p_alignment = HORIZONTAL_ALIGNMENT_LEFT, float p_width = -1, int p_font_size = Font::DEFAULT_FONT_SIZE, int p_max_lines = -1, int p_size = 1, const Color &p_modulate = Color(1.0, 1.0, 1.0), uint16_t p_flags = TextServer::BREAK_MANDATORY | TextServer::BREAK_WORD_BOUND | TextServer::JUSTIFICATION_KASHIDA | TextServer::JUSTIFICATION_WORD_BOUND, TextServer::Direction p_direction = TextServer::DIRECTION_AUTO, TextServer::Orientation p_orientation = TextServer::ORIENTATION_HORIZONTAL) const; + + void draw_char(const Ref<Font> &p_font, const Point2 &p_pos, const String &p_char, int p_font_size = Font::DEFAULT_FONT_SIZE, const Color &p_modulate = Color(1.0, 1.0, 1.0)) const; + void draw_char_outline(const Ref<Font> &p_font, const Point2 &p_pos, const String &p_char, int p_font_size = Font::DEFAULT_FONT_SIZE, int p_size = 1, const Color &p_modulate = Color(1.0, 1.0, 1.0)) const; void draw_set_transform(const Point2 &p_offset, real_t p_rot = 0.0, const Size2 &p_scale = Size2(1.0, 1.0)); void draw_set_transform_matrix(const Transform2D &p_matrix); diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index 1ad011f867..0080e899c3 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -219,7 +219,7 @@ void Viewport::_sub_window_update(Window *p_window) { int close_h_ofs = p_window->get_theme_constant(SNAME("close_h_offset")); int close_v_ofs = p_window->get_theme_constant(SNAME("close_v_offset")); - TextLine title_text = TextLine(p_window->atr(p_window->get_title()), title_font, font_size, Dictionary(), TranslationServer::get_singleton()->get_tool_locale()); + TextLine title_text = TextLine(p_window->atr(p_window->get_title()), title_font, font_size); title_text.set_width(r.size.width - panel->get_minimum_size().x - close_h_ofs); title_text.set_direction(p_window->is_layout_rtl() ? TextServer::DIRECTION_RTL : TextServer::DIRECTION_LTR); int x = (r.size.width - title_text.get_size().x) / 2; diff --git a/scene/register_scene_types.cpp b/scene/register_scene_types.cpp index 4d0d6111ec..5c5b60df63 100644 --- a/scene/register_scene_types.cpp +++ b/scene/register_scene_types.cpp @@ -853,8 +853,11 @@ void register_scene_types() { GDREGISTER_CLASS(Animation); GDREGISTER_CLASS(AnimationLibrary); - GDREGISTER_CLASS(FontData); - GDREGISTER_CLASS(Font); + + GDREGISTER_ABSTRACT_CLASS(Font); + GDREGISTER_CLASS(FontFile); + GDREGISTER_CLASS(FontVariation); + GDREGISTER_CLASS(Curve); GDREGISTER_CLASS(SceneReplicationConfig); @@ -921,9 +924,9 @@ void register_scene_types() { ClassDB::add_compatibility_class("AnimationTreePlayer", "AnimationTree"); ClassDB::add_compatibility_class("BakedLightmap", "LightmapGI"); ClassDB::add_compatibility_class("BakedLightmapData", "LightmapGIData"); - ClassDB::add_compatibility_class("BitmapFont", "Font"); - ClassDB::add_compatibility_class("DynamicFont", "Font"); - ClassDB::add_compatibility_class("DynamicFontData", "FontData"); + ClassDB::add_compatibility_class("BitmapFont", "FontFile"); + ClassDB::add_compatibility_class("DynamicFont", "FontFile"); + ClassDB::add_compatibility_class("DynamicFontData", "FontFile"); ClassDB::add_compatibility_class("Navigation3D", "Node3D"); ClassDB::add_compatibility_class("Navigation2D", "Node2D"); ClassDB::add_compatibility_class("OpenSimplexNoise", "FastNoiseLite"); @@ -1113,7 +1116,7 @@ void initialize_theme() { ProjectSettings::get_singleton()->set_custom_property_info("gui/theme/custom", PropertyInfo(Variant::STRING, "gui/theme/custom", PROPERTY_HINT_FILE, "*.tres,*.res,*.theme", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED)); String font_path = GLOBAL_DEF_RST("gui/theme/custom_font", ""); - ProjectSettings::get_singleton()->set_custom_property_info("gui/theme/custom_font", PropertyInfo(Variant::STRING, "gui/theme/custom_font", PROPERTY_HINT_FILE, "*.tres,*.res,*.font", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED)); + ProjectSettings::get_singleton()->set_custom_property_info("gui/theme/custom_font", PropertyInfo(Variant::STRING, "gui/theme/custom_font", PROPERTY_HINT_FILE, "*.tres,*.res", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED)); bool font_antialiased = (bool)GLOBAL_DEF_RST("gui/theme/default_font_antialiased", true); ProjectSettings::get_singleton()->set_custom_property_info("gui/theme/default_font_antialiased", PropertyInfo(Variant::BOOL, "gui/theme/default_font_antialiased", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED)); diff --git a/scene/resources/default_theme/default_theme.cpp b/scene/resources/default_theme/default_theme.cpp index e0e2641f16..9d13ac3a38 100644 --- a/scene/resources/default_theme/default_theme.cpp +++ b/scene/resources/default_theme/default_theme.cpp @@ -918,8 +918,8 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const theme->set_stylebox("panel", "TooltipPanel", make_flat_stylebox(Color(0, 0, 0, 0.5), 2 * default_margin, 0.5 * default_margin, 2 * default_margin, 0.5 * default_margin)); - theme->set_font("font", "TooltipLabel", Ref<Font>()); theme->set_font_size("font_size", "TooltipLabel", -1); + theme->set_font("font", "TooltipLabel", Ref<Font>()); theme->set_color("font_color", "TooltipLabel", control_font_color); theme->set_color("font_shadow_color", "TooltipLabel", Color(0, 0, 0, 0)); @@ -939,7 +939,6 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const theme->set_font("italics_font", "RichTextLabel", italics_font); theme->set_font("bold_italics_font", "RichTextLabel", bold_italics_font); theme->set_font("mono_font", "RichTextLabel", Ref<Font>()); - theme->set_font_size("normal_font_size", "RichTextLabel", -1); theme->set_font_size("bold_font_size", "RichTextLabel", -1); theme->set_font_size("italics_font_size", "RichTextLabel", -1); @@ -1034,9 +1033,9 @@ void make_default_theme(float p_scale, Ref<Font> p_font, TextServer::SubpixelPos Ref<StyleBox> default_style; Ref<Texture2D> default_icon; Ref<Font> default_font; - Ref<Font> bold_font; - Ref<Font> bold_italics_font; - Ref<Font> italics_font; + Ref<FontVariation> bold_font; + Ref<FontVariation> bold_italics_font; + Ref<FontVariation> italics_font; float default_scale = CLAMP(p_scale, 0.5, 8.0); if (p_font.is_valid()) { @@ -1046,48 +1045,31 @@ void make_default_theme(float p_scale, Ref<Font> p_font, TextServer::SubpixelPos // Use the default DynamicFont (separate from the editor font). // The default DynamicFont is chosen to have a small file size since it's // embedded in both editor and export template binaries. - Ref<Font> dynamic_font; + Ref<FontFile> dynamic_font; dynamic_font.instantiate(); - - Ref<FontData> dynamic_font_data; - dynamic_font_data.instantiate(); - dynamic_font_data->set_data_ptr(_font_OpenSans_SemiBold, _font_OpenSans_SemiBold_size); - dynamic_font_data->set_subpixel_positioning(p_font_subpixel); - dynamic_font_data->set_hinting(p_font_hinting); - dynamic_font_data->set_antialiased(p_font_antialiased); - dynamic_font_data->set_multichannel_signed_distance_field(p_font_msdf); - dynamic_font_data->set_generate_mipmaps(p_font_generate_mipmaps); - - dynamic_font->add_data(dynamic_font_data); + dynamic_font->set_data_ptr(_font_OpenSans_SemiBold, _font_OpenSans_SemiBold_size); + dynamic_font->set_subpixel_positioning(p_font_subpixel); + dynamic_font->set_hinting(p_font_hinting); + dynamic_font->set_antialiased(p_font_antialiased); + dynamic_font->set_multichannel_signed_distance_field(p_font_msdf); + dynamic_font->set_generate_mipmaps(p_font_generate_mipmaps); default_font = dynamic_font; } if (default_font.is_valid()) { bold_font.instantiate(); - for (int i = 0; i < default_font->get_data_count(); i++) { - Ref<FontData> data = default_font->get_data(i)->duplicate(); - // Try to match OpenSans ExtraBold. - data->set_embolden(1.2); - bold_font->add_data(data); - } + bold_font->set_base_font(default_font); + bold_font->set_variation_embolden(1.2); bold_italics_font.instantiate(); - for (int i = 0; i < default_font->get_data_count(); i++) { - Ref<FontData> data = default_font->get_data(i)->duplicate(); - // Try to match OpenSans ExtraBold Italic. - data->set_embolden(1.2); - data->set_transform(Transform2D(1.0, 0.2, 0.0, 1.0, 0.0, 0.0)); - bold_italics_font->add_data(data); - } + bold_italics_font->set_base_font(default_font); + bold_italics_font->set_variation_embolden(1.2); + bold_italics_font->set_variation_transform(Transform2D(1.0, 0.2, 0.0, 1.0, 0.0, 0.0)); italics_font.instantiate(); - for (int i = 0; i < default_font->get_data_count(); i++) { - Ref<FontData> data = default_font->get_data(i)->duplicate(); - // Try to match OpenSans Italic. - data->set_transform(Transform2D(1.0, 0.2, 0.0, 1.0, 0.0, 0.0)); - italics_font->add_data(data); - } + italics_font->set_base_font(default_font); + italics_font->set_variation_transform(Transform2D(1.0, 0.2, 0.0, 1.0, 0.0, 0.0)); } fill_default_theme(t, default_font, bold_font, bold_italics_font, italics_font, default_icon, default_style, default_scale); diff --git a/scene/resources/font.cpp b/scene/resources/font.cpp index 46f23424dd..6053d27ef7 100644 --- a/scene/resources/font.cpp +++ b/scene/resources/font.cpp @@ -30,6 +30,7 @@ #include "font.h" +#include "core/core_string_names.h" #include "core/io/image_loader.h" #include "core/io/resource_loader.h" #include "core/string/translation.h" @@ -37,439 +38,539 @@ #include "core/templates/hashfuncs.h" #include "scene/resources/text_line.h" #include "scene/resources/text_paragraph.h" +#include "scene/resources/theme.h" -_FORCE_INLINE_ void FontData::_clear_cache() { - for (int i = 0; i < cache.size(); i++) { - if (cache[i].is_valid()) { - TS->free_rid(cache[i]); - cache.write[i] = RID(); - } - } -} +/*************************************************************************/ +/* Font */ +/*************************************************************************/ -_FORCE_INLINE_ void FontData::_ensure_rid(int p_cache_index) const { - if (unlikely(p_cache_index >= cache.size())) { - cache.resize(p_cache_index + 1); - } - if (unlikely(!cache[p_cache_index].is_valid())) { - cache.write[p_cache_index] = TS->create_font(); - TS->font_set_data_ptr(cache[p_cache_index], data_ptr, data_size); - TS->font_set_face_index(cache[p_cache_index], face_index); - TS->font_set_antialiased(cache[p_cache_index], antialiased); - TS->font_set_generate_mipmaps(cache[p_cache_index], mipmaps); - TS->font_set_multichannel_signed_distance_field(cache[p_cache_index], msdf); - TS->font_set_msdf_pixel_range(cache[p_cache_index], msdf_pixel_range); - TS->font_set_msdf_size(cache[p_cache_index], msdf_size); - TS->font_set_fixed_size(cache[p_cache_index], fixed_size); - TS->font_set_force_autohinter(cache[p_cache_index], force_autohinter); - TS->font_set_hinting(cache[p_cache_index], hinting); - TS->font_set_subpixel_positioning(cache[p_cache_index], subpixel_positioning); - TS->font_set_embolden(cache[p_cache_index], embolden); - TS->font_set_transform(cache[p_cache_index], transform); - TS->font_set_oversampling(cache[p_cache_index], oversampling); - } -} +void Font::_bind_methods() { + ClassDB::bind_method(D_METHOD("set_fallbacks", "fallbacks"), &Font::set_fallbacks); + ClassDB::bind_method(D_METHOD("get_fallbacks"), &Font::get_fallbacks); -void FontData::_bind_methods() { - ClassDB::bind_method(D_METHOD("load_bitmap_font", "path"), &FontData::load_bitmap_font); - ClassDB::bind_method(D_METHOD("load_dynamic_font", "path"), &FontData::load_dynamic_font); + // Output. + ClassDB::bind_method(D_METHOD("find_variation", "variation_coordinates", "face_index", "strength", "transform"), &Font::find_variation, DEFVAL(0), DEFVAL(0.0), DEFVAL(Transform2D())); + ClassDB::bind_method(D_METHOD("get_rids"), &Font::get_rids); - ClassDB::bind_method(D_METHOD("set_data", "data"), &FontData::set_data); - ClassDB::bind_method(D_METHOD("get_data"), &FontData::get_data); + // Font metrics. + ClassDB::bind_method(D_METHOD("get_height", "font_size"), &Font::get_height, DEFVAL(DEFAULT_FONT_SIZE)); + ClassDB::bind_method(D_METHOD("get_ascent", "font_size"), &Font::get_ascent, DEFVAL(DEFAULT_FONT_SIZE)); + ClassDB::bind_method(D_METHOD("get_descent", "font_size"), &Font::get_descent, DEFVAL(DEFAULT_FONT_SIZE)); + ClassDB::bind_method(D_METHOD("get_underline_position", "font_size"), &Font::get_underline_position, DEFVAL(DEFAULT_FONT_SIZE)); + ClassDB::bind_method(D_METHOD("get_underline_thickness", "font_size"), &Font::get_underline_thickness, DEFVAL(DEFAULT_FONT_SIZE)); - ClassDB::bind_method(D_METHOD("set_face_index", "face_index"), &FontData::set_face_index); - ClassDB::bind_method(D_METHOD("get_face_index"), &FontData::get_face_index); + ClassDB::bind_method(D_METHOD("get_font_name"), &Font::get_font_name); + ClassDB::bind_method(D_METHOD("get_font_style_name"), &Font::get_font_style_name); + ClassDB::bind_method(D_METHOD("get_font_style"), &Font::get_font_style); - ClassDB::bind_method(D_METHOD("get_face_count"), &FontData::get_face_count); + ClassDB::bind_method(D_METHOD("get_spacing", "spacing"), &Font::get_spacing); + ClassDB::bind_method(D_METHOD("get_opentype_features"), &Font::get_opentype_features); - ClassDB::bind_method(D_METHOD("set_antialiased", "antialiased"), &FontData::set_antialiased); - ClassDB::bind_method(D_METHOD("is_antialiased"), &FontData::is_antialiased); + // Drawing string. + ClassDB::bind_method(D_METHOD("set_cache_capacity", "single_line", "multi_line"), &Font::set_cache_capacity); - ClassDB::bind_method(D_METHOD("set_generate_mipmaps", "generate_mipmaps"), &FontData::set_generate_mipmaps); - ClassDB::bind_method(D_METHOD("get_generate_mipmaps"), &FontData::get_generate_mipmaps); + ClassDB::bind_method(D_METHOD("get_string_size", "text", "alignment", "width", "font_size", "flags", "direction", "orientation"), &Font::get_string_size, DEFVAL(HORIZONTAL_ALIGNMENT_LEFT), DEFVAL(-1), DEFVAL(DEFAULT_FONT_SIZE), DEFVAL(TextServer::JUSTIFICATION_KASHIDA | TextServer::JUSTIFICATION_WORD_BOUND), DEFVAL(TextServer::DIRECTION_AUTO), DEFVAL(TextServer::ORIENTATION_HORIZONTAL)); + ClassDB::bind_method(D_METHOD("get_multiline_string_size", "text", "alignment", "width", "font_size", "max_lines", "flags", "direction", "orientation"), &Font::get_multiline_string_size, DEFVAL(HORIZONTAL_ALIGNMENT_LEFT), DEFVAL(-1), DEFVAL(DEFAULT_FONT_SIZE), DEFVAL(-1), DEFVAL(TextServer::BREAK_MANDATORY | TextServer::BREAK_WORD_BOUND), DEFVAL(TextServer::DIRECTION_AUTO), DEFVAL(TextServer::ORIENTATION_HORIZONTAL)); - ClassDB::bind_method(D_METHOD("set_font_name", "name"), &FontData::set_font_name); - ClassDB::bind_method(D_METHOD("get_font_name"), &FontData::get_font_name); + ClassDB::bind_method(D_METHOD("draw_string", "canvas_item", "pos", "text", "alignment", "width", "font_size", "modulate", "flags", "direction", "orientation"), &Font::draw_string, DEFVAL(HORIZONTAL_ALIGNMENT_LEFT), DEFVAL(-1), DEFVAL(DEFAULT_FONT_SIZE), DEFVAL(Color(1.0, 1.0, 1.0)), DEFVAL(TextServer::JUSTIFICATION_KASHIDA | TextServer::JUSTIFICATION_WORD_BOUND), DEFVAL(TextServer::DIRECTION_AUTO), DEFVAL(TextServer::ORIENTATION_HORIZONTAL)); + ClassDB::bind_method(D_METHOD("draw_multiline_string", "canvas_item", "pos", "text", "alignment", "width", "font_size", "max_lines", "modulate", "flags", "direction", "orientation"), &Font::draw_multiline_string, DEFVAL(HORIZONTAL_ALIGNMENT_LEFT), DEFVAL(-1), DEFVAL(DEFAULT_FONT_SIZE), DEFVAL(-1), DEFVAL(Color(1.0, 1.0, 1.0)), DEFVAL(TextServer::BREAK_MANDATORY | TextServer::BREAK_WORD_BOUND | TextServer::JUSTIFICATION_KASHIDA | TextServer::JUSTIFICATION_WORD_BOUND), DEFVAL(TextServer::DIRECTION_AUTO), DEFVAL(TextServer::ORIENTATION_HORIZONTAL)); - ClassDB::bind_method(D_METHOD("set_font_style_name", "name"), &FontData::set_font_style_name); - ClassDB::bind_method(D_METHOD("get_font_style_name"), &FontData::get_font_style_name); + ClassDB::bind_method(D_METHOD("draw_string_outline", "canvas_item", "pos", "text", "alignment", "width", "font_size", "size", "modulate", "flags", "direction", "orientation"), &Font::draw_string_outline, DEFVAL(HORIZONTAL_ALIGNMENT_LEFT), DEFVAL(-1), DEFVAL(DEFAULT_FONT_SIZE), DEFVAL(1), DEFVAL(Color(1.0, 1.0, 1.0)), DEFVAL(TextServer::JUSTIFICATION_KASHIDA | TextServer::JUSTIFICATION_WORD_BOUND), DEFVAL(TextServer::DIRECTION_AUTO), DEFVAL(TextServer::ORIENTATION_HORIZONTAL)); + ClassDB::bind_method(D_METHOD("draw_multiline_string_outline", "canvas_item", "pos", "text", "alignment", "width", "font_size", "max_lines", "size", "modulate", "flags", "direction", "orientation"), &Font::draw_multiline_string_outline, DEFVAL(HORIZONTAL_ALIGNMENT_LEFT), DEFVAL(-1), DEFVAL(DEFAULT_FONT_SIZE), DEFVAL(-1), DEFVAL(1), DEFVAL(Color(1.0, 1.0, 1.0)), DEFVAL(TextServer::BREAK_MANDATORY | TextServer::BREAK_WORD_BOUND | TextServer::JUSTIFICATION_KASHIDA | TextServer::JUSTIFICATION_WORD_BOUND), DEFVAL(TextServer::DIRECTION_AUTO), DEFVAL(TextServer::ORIENTATION_HORIZONTAL)); - ClassDB::bind_method(D_METHOD("set_font_style", "style"), &FontData::set_font_style); - ClassDB::bind_method(D_METHOD("get_font_style"), &FontData::get_font_style); + // Drawing char. + ClassDB::bind_method(D_METHOD("get_char_size", "char"), &Font::get_char_size); + ClassDB::bind_method(D_METHOD("draw_char", "canvas_item", "pos", "char", "modulate"), &Font::draw_char, DEFVAL(Color(1.0, 1.0, 1.0))); + ClassDB::bind_method(D_METHOD("draw_char_outline", "canvas_item", "pos", "char", "size", "modulate"), &Font::draw_char_outline, DEFVAL(-1), DEFVAL(Color(1.0, 1.0, 1.0))); - ClassDB::bind_method(D_METHOD("set_multichannel_signed_distance_field", "msdf"), &FontData::set_multichannel_signed_distance_field); - ClassDB::bind_method(D_METHOD("is_multichannel_signed_distance_field"), &FontData::is_multichannel_signed_distance_field); + // Helper functions. + ClassDB::bind_method(D_METHOD("has_char", "char"), &Font::has_char); + ClassDB::bind_method(D_METHOD("get_supported_chars"), &Font::get_supported_chars); - ClassDB::bind_method(D_METHOD("set_msdf_pixel_range", "msdf_pixel_range"), &FontData::set_msdf_pixel_range); - ClassDB::bind_method(D_METHOD("get_msdf_pixel_range"), &FontData::get_msdf_pixel_range); + ClassDB::bind_method(D_METHOD("is_language_supported", "language"), &Font::is_language_supported); + ClassDB::bind_method(D_METHOD("is_script_supported", "script"), &Font::is_script_supported); - ClassDB::bind_method(D_METHOD("set_msdf_size", "msdf_size"), &FontData::set_msdf_size); - ClassDB::bind_method(D_METHOD("get_msdf_size"), &FontData::get_msdf_size); + ClassDB::bind_method(D_METHOD("get_supported_feature_list"), &Font::get_supported_feature_list); + ClassDB::bind_method(D_METHOD("get_supported_variation_list"), &Font::get_supported_variation_list); + ClassDB::bind_method(D_METHOD("get_face_count"), &Font::get_face_count); +} - ClassDB::bind_method(D_METHOD("set_fixed_size", "fixed_size"), &FontData::set_fixed_size); - ClassDB::bind_method(D_METHOD("get_fixed_size"), &FontData::get_fixed_size); +void Font::_update_rids_fb(const Ref<Font> &p_f, int p_depth) const { + ERR_FAIL_COND(p_depth > MAX_FALLBACK_DEPTH); + if (p_f.is_valid()) { + RID rid = p_f->_get_rid(); + if (rid.is_valid()) { + rids.push_back(rid); + } + const TypedArray<Font> &_fallbacks = p_f->get_fallbacks(); + for (int i = 0; i < _fallbacks.size(); i++) { + _update_rids_fb(_fallbacks[i], p_depth + 1); + } + } +} - ClassDB::bind_method(D_METHOD("set_force_autohinter", "force_autohinter"), &FontData::set_force_autohinter); - ClassDB::bind_method(D_METHOD("is_force_autohinter"), &FontData::is_force_autohinter); +void Font::_update_rids() const { + rids.clear(); + _update_rids_fb(const_cast<Font *>(this), 0); + dirty_rids = false; +} - ClassDB::bind_method(D_METHOD("set_hinting", "hinting"), &FontData::set_hinting); - ClassDB::bind_method(D_METHOD("get_hinting"), &FontData::get_hinting); +void Font::_invalidate_rids() { + rids.clear(); + dirty_rids = true; - ClassDB::bind_method(D_METHOD("set_subpixel_positioning", "subpixel_positioning"), &FontData::set_subpixel_positioning); - ClassDB::bind_method(D_METHOD("get_subpixel_positioning"), &FontData::get_subpixel_positioning); + cache.clear(); + cache_wrap.clear(); - ClassDB::bind_method(D_METHOD("set_embolden", "strength"), &FontData::set_embolden); - ClassDB::bind_method(D_METHOD("get_embolden"), &FontData::get_embolden); + emit_changed(); +} - ClassDB::bind_method(D_METHOD("set_transform", "transform"), &FontData::set_transform); - ClassDB::bind_method(D_METHOD("get_transform"), &FontData::get_transform); +bool Font::_is_cyclic(const Ref<Font> &p_f, int p_depth) const { + ERR_FAIL_COND_V(p_depth > MAX_FALLBACK_DEPTH, false); + if (p_f.is_null()) { + return false; + } + for (int i = 0; i < p_f->fallbacks.size(); i++) { + const Ref<Font> &f = p_f->fallbacks[i]; + if (f == this) { + return true; + } + return _is_cyclic(f, p_depth + 1); + } + return false; +} - ClassDB::bind_method(D_METHOD("set_oversampling", "oversampling"), &FontData::set_oversampling); - ClassDB::bind_method(D_METHOD("get_oversampling"), &FontData::get_oversampling); +void Font::reset_state() { + _invalidate_rids(); +} - ClassDB::bind_method(D_METHOD("find_cache", "variation_coordinates"), &FontData::find_cache); +// Fallbacks. +void Font::set_fallbacks(const TypedArray<Font> &p_fallbacks) { + ERR_FAIL_COND(_is_cyclic(this, 0)); + for (int i = 0; i < fallbacks.size(); i++) { + Ref<Font> f = fallbacks[i]; + if (f.is_valid()) { + f->disconnect(CoreStringNames::get_singleton()->changed, callable_mp(this, &Font::_invalidate_rids)); + } + } + fallbacks = p_fallbacks; + for (int i = 0; i < fallbacks.size(); i++) { + Ref<Font> f = fallbacks[i]; + if (f.is_valid()) { + f->connect(CoreStringNames::get_singleton()->changed, callable_mp(this, &Font::_invalidate_rids), varray(), CONNECT_REFERENCE_COUNTED); + } + } + _invalidate_rids(); +} - ClassDB::bind_method(D_METHOD("get_cache_count"), &FontData::get_cache_count); - ClassDB::bind_method(D_METHOD("clear_cache"), &FontData::clear_cache); - ClassDB::bind_method(D_METHOD("remove_cache", "cache_index"), &FontData::remove_cache); +TypedArray<Font> Font::get_fallbacks() const { + return fallbacks; +} - ClassDB::bind_method(D_METHOD("get_size_cache_list", "cache_index"), &FontData::get_size_cache_list); - ClassDB::bind_method(D_METHOD("clear_size_cache", "cache_index"), &FontData::clear_size_cache); - ClassDB::bind_method(D_METHOD("remove_size_cache", "cache_index", "size"), &FontData::remove_size_cache); +// Output. +TypedArray<RID> Font::get_rids() const { + if (dirty_rids) { + _update_rids(); + } + return rids; +} - ClassDB::bind_method(D_METHOD("set_variation_coordinates", "cache_index", "variation_coordinates"), &FontData::set_variation_coordinates); - ClassDB::bind_method(D_METHOD("get_variation_coordinates", "cache_index"), &FontData::get_variation_coordinates); +// Drawing string. +real_t Font::get_height(int p_font_size) const { + if (dirty_rids) { + _update_rids(); + } + real_t ret = 0.f; + for (int i = 0; i < rids.size(); i++) { + ret = MAX(ret, TS->font_get_ascent(rids[i], p_font_size) + TS->font_get_descent(rids[i], p_font_size)); + } + return ret + get_spacing(TextServer::SPACING_BOTTOM) + get_spacing(TextServer::SPACING_TOP); +} - ClassDB::bind_method(D_METHOD("set_ascent", "cache_index", "size", "ascent"), &FontData::set_ascent); - ClassDB::bind_method(D_METHOD("get_ascent", "cache_index", "size"), &FontData::get_ascent); +real_t Font::get_ascent(int p_font_size) const { + if (dirty_rids) { + _update_rids(); + } + real_t ret = 0.f; + for (int i = 0; i < rids.size(); i++) { + ret = MAX(ret, TS->font_get_ascent(rids[i], p_font_size)); + } + return ret + get_spacing(TextServer::SPACING_TOP); +} + +real_t Font::get_descent(int p_font_size) const { + if (dirty_rids) { + _update_rids(); + } + real_t ret = 0.f; + for (int i = 0; i < rids.size(); i++) { + ret = MAX(ret, TS->font_get_descent(rids[i], p_font_size)); + } + return ret + get_spacing(TextServer::SPACING_BOTTOM); +} + +real_t Font::get_underline_position(int p_font_size) const { + if (dirty_rids) { + _update_rids(); + } + real_t ret = 0.f; + for (int i = 0; i < rids.size(); i++) { + ret = MAX(ret, TS->font_get_underline_position(rids[i], p_font_size)); + } + return ret + get_spacing(TextServer::SPACING_TOP); +} - ClassDB::bind_method(D_METHOD("set_descent", "cache_index", "size", "descent"), &FontData::set_descent); - ClassDB::bind_method(D_METHOD("get_descent", "cache_index", "size"), &FontData::get_descent); +real_t Font::get_underline_thickness(int p_font_size) const { + if (dirty_rids) { + _update_rids(); + } + real_t ret = 0.f; + for (int i = 0; i < rids.size(); i++) { + ret = MAX(ret, TS->font_get_underline_thickness(rids[i], p_font_size)); + } + return ret; +} - ClassDB::bind_method(D_METHOD("set_underline_position", "cache_index", "size", "underline_position"), &FontData::set_underline_position); - ClassDB::bind_method(D_METHOD("get_underline_position", "cache_index", "size"), &FontData::get_underline_position); +String Font::get_font_name() const { + return TS->font_get_name(_get_rid()); +} - ClassDB::bind_method(D_METHOD("set_underline_thickness", "cache_index", "size", "underline_thickness"), &FontData::set_underline_thickness); - ClassDB::bind_method(D_METHOD("get_underline_thickness", "cache_index", "size"), &FontData::get_underline_thickness); +String Font::get_font_style_name() const { + return TS->font_get_style_name(_get_rid()); +} - ClassDB::bind_method(D_METHOD("set_scale", "cache_index", "size", "scale"), &FontData::set_scale); - ClassDB::bind_method(D_METHOD("get_scale", "cache_index", "size"), &FontData::get_scale); +uint32_t Font::get_font_style() const { + return TS->font_get_style(_get_rid()); +} - ClassDB::bind_method(D_METHOD("set_spacing", "cache_index", "size", "spacing_type", "value"), &FontData::set_spacing); - ClassDB::bind_method(D_METHOD("get_spacing", "cache_index", "size", "spacing_type"), &FontData::get_spacing); +Dictionary Font::get_opentype_features() const { + return Dictionary(); +} + +// Drawing string. +void Font::set_cache_capacity(int p_single_line, int p_multi_line) { + cache.set_capacity(p_single_line); + cache_wrap.set_capacity(p_multi_line); +} - ClassDB::bind_method(D_METHOD("get_texture_count", "cache_index", "size"), &FontData::get_texture_count); - ClassDB::bind_method(D_METHOD("clear_textures", "cache_index", "size"), &FontData::clear_textures); - ClassDB::bind_method(D_METHOD("remove_texture", "cache_index", "size", "texture_index"), &FontData::remove_texture); +Size2 Font::get_string_size(const String &p_text, HorizontalAlignment p_alignment, float p_width, int p_font_size, uint16_t p_flags, TextServer::Direction p_direction, TextServer::Orientation p_orientation) const { + uint64_t hash = p_text.hash64(); + hash = hash_djb2_one_64(p_font_size, hash); + if (p_alignment == HORIZONTAL_ALIGNMENT_FILL) { + hash = hash_djb2_one_64(hash_murmur3_one_float(p_width), hash); + hash = hash_djb2_one_64(p_flags, hash); + hash = hash_djb2_one_64(p_direction, hash); + hash = hash_djb2_one_64(p_orientation, hash); + } - ClassDB::bind_method(D_METHOD("set_texture_image", "cache_index", "size", "texture_index", "image"), &FontData::set_texture_image); - ClassDB::bind_method(D_METHOD("get_texture_image", "cache_index", "size", "texture_index"), &FontData::get_texture_image); + Ref<TextLine> buffer; + if (cache.has(hash)) { + buffer = cache.get(hash); + } else { + buffer.instantiate(); + buffer->set_direction(p_direction); + buffer->set_orientation(p_orientation); + buffer->add_string(p_text, Ref<Font>(this), p_font_size); + cache.insert(hash, buffer); + } + return buffer->get_size(); +} + +Size2 Font::get_multiline_string_size(const String &p_text, HorizontalAlignment p_alignment, float p_width, int p_font_size, int p_max_lines, uint16_t p_flags, TextServer::Direction p_direction, TextServer::Orientation p_orientation) const { + uint64_t hash = p_text.hash64(); + hash = hash_djb2_one_64(p_font_size, hash); + hash = hash_djb2_one_64(hash_murmur3_one_float(p_width), hash); + hash = hash_djb2_one_64(p_flags, hash); + hash = hash_djb2_one_64(p_direction, hash); + hash = hash_djb2_one_64(p_orientation, hash); + + Ref<TextParagraph> lines_buffer; + if (cache_wrap.has(hash)) { + lines_buffer = cache_wrap.get(hash); + } else { + lines_buffer.instantiate(); + lines_buffer->set_direction(p_direction); + lines_buffer->set_orientation(p_orientation); + lines_buffer->add_string(p_text, Ref<Font>(this), p_font_size); + lines_buffer->set_width(p_width); + lines_buffer->set_flags(p_flags); + cache_wrap.insert(hash, lines_buffer); + } + + lines_buffer->set_alignment(p_alignment); + lines_buffer->set_max_lines_visible(p_max_lines); + + return lines_buffer->get_size(); +} + +void Font::draw_string(RID p_canvas_item, const Point2 &p_pos, const String &p_text, HorizontalAlignment p_alignment, float p_width, int p_font_size, const Color &p_modulate, uint16_t p_flags, TextServer::Direction p_direction, TextServer::Orientation p_orientation) const { + uint64_t hash = p_text.hash64(); + hash = hash_djb2_one_64(p_font_size, hash); + if (p_alignment == HORIZONTAL_ALIGNMENT_FILL) { + hash = hash_djb2_one_64(hash_murmur3_one_float(p_width), hash); + hash = hash_djb2_one_64(p_flags, hash); + } + + Ref<TextLine> buffer; + if (cache.has(hash)) { + buffer = cache.get(hash); + } else { + buffer.instantiate(); + buffer->set_direction(p_direction); + buffer->set_orientation(p_orientation); + buffer->add_string(p_text, Ref<Font>(this), p_font_size); + cache.insert(hash, buffer); + } - ClassDB::bind_method(D_METHOD("set_texture_offsets", "cache_index", "size", "texture_index", "offset"), &FontData::set_texture_offsets); - ClassDB::bind_method(D_METHOD("get_texture_offsets", "cache_index", "size", "texture_index"), &FontData::get_texture_offsets); + Vector2 ofs = p_pos; + if (p_orientation == TextServer::ORIENTATION_HORIZONTAL) { + ofs.y -= buffer->get_line_ascent(); + } else { + ofs.x -= buffer->get_line_ascent(); + } - ClassDB::bind_method(D_METHOD("get_glyph_list", "cache_index", "size"), &FontData::get_glyph_list); - ClassDB::bind_method(D_METHOD("clear_glyphs", "cache_index", "size"), &FontData::clear_glyphs); - ClassDB::bind_method(D_METHOD("remove_glyph", "cache_index", "size", "glyph"), &FontData::remove_glyph); + buffer->set_width(p_width); + buffer->set_horizontal_alignment(p_alignment); + buffer->set_flags(p_flags); - ClassDB::bind_method(D_METHOD("set_glyph_advance", "cache_index", "size", "glyph", "advance"), &FontData::set_glyph_advance); - ClassDB::bind_method(D_METHOD("get_glyph_advance", "cache_index", "size", "glyph"), &FontData::get_glyph_advance); + buffer->draw(p_canvas_item, ofs, p_modulate); +} - ClassDB::bind_method(D_METHOD("set_glyph_offset", "cache_index", "size", "glyph", "offset"), &FontData::set_glyph_offset); - ClassDB::bind_method(D_METHOD("get_glyph_offset", "cache_index", "size", "glyph"), &FontData::get_glyph_offset); +void Font::draw_multiline_string(RID p_canvas_item, const Point2 &p_pos, const String &p_text, HorizontalAlignment p_alignment, float p_width, int p_font_size, int p_max_lines, const Color &p_modulate, uint16_t p_flags, TextServer::Direction p_direction, TextServer::Orientation p_orientation) const { + uint64_t hash = p_text.hash64(); + hash = hash_djb2_one_64(p_font_size, hash); + hash = hash_djb2_one_64(hash_murmur3_one_float(p_width), hash); + hash = hash_djb2_one_64(p_flags, hash); + hash = hash_djb2_one_64(p_direction, hash); + hash = hash_djb2_one_64(p_orientation, hash); - ClassDB::bind_method(D_METHOD("set_glyph_size", "cache_index", "size", "glyph", "gl_size"), &FontData::set_glyph_size); - ClassDB::bind_method(D_METHOD("get_glyph_size", "cache_index", "size", "glyph"), &FontData::get_glyph_size); + Ref<TextParagraph> lines_buffer; + if (cache_wrap.has(hash)) { + lines_buffer = cache_wrap.get(hash); + } else { + lines_buffer.instantiate(); + lines_buffer->set_direction(p_direction); + lines_buffer->set_orientation(p_orientation); + lines_buffer->add_string(p_text, Ref<Font>(this), p_font_size); + lines_buffer->set_width(p_width); + lines_buffer->set_flags(p_flags); + cache_wrap.insert(hash, lines_buffer); + } - ClassDB::bind_method(D_METHOD("set_glyph_uv_rect", "cache_index", "size", "glyph", "uv_rect"), &FontData::set_glyph_uv_rect); - ClassDB::bind_method(D_METHOD("get_glyph_uv_rect", "cache_index", "size", "glyph"), &FontData::get_glyph_uv_rect); + Vector2 ofs = p_pos; + if (p_orientation == TextServer::ORIENTATION_HORIZONTAL) { + ofs.y -= lines_buffer->get_line_ascent(0); + } else { + ofs.x -= lines_buffer->get_line_ascent(0); + } - ClassDB::bind_method(D_METHOD("set_glyph_texture_idx", "cache_index", "size", "glyph", "texture_idx"), &FontData::set_glyph_texture_idx); - ClassDB::bind_method(D_METHOD("get_glyph_texture_idx", "cache_index", "size", "glyph"), &FontData::get_glyph_texture_idx); + lines_buffer->set_alignment(p_alignment); + lines_buffer->set_max_lines_visible(p_max_lines); - ClassDB::bind_method(D_METHOD("get_kerning_list", "cache_index", "size"), &FontData::get_kerning_list); - ClassDB::bind_method(D_METHOD("clear_kerning_map", "cache_index", "size"), &FontData::clear_kerning_map); - ClassDB::bind_method(D_METHOD("remove_kerning", "cache_index", "size", "glyph_pair"), &FontData::remove_kerning); + lines_buffer->draw(p_canvas_item, ofs, p_modulate); +} - ClassDB::bind_method(D_METHOD("set_kerning", "cache_index", "size", "glyph_pair", "kerning"), &FontData::set_kerning); - ClassDB::bind_method(D_METHOD("get_kerning", "cache_index", "size", "glyph_pair"), &FontData::get_kerning); +void Font::draw_string_outline(RID p_canvas_item, const Point2 &p_pos, const String &p_text, HorizontalAlignment p_alignment, float p_width, int p_font_size, int p_size, const Color &p_modulate, uint16_t p_flags, TextServer::Direction p_direction, TextServer::Orientation p_orientation) const { + uint64_t hash = p_text.hash64(); + hash = hash_djb2_one_64(p_font_size, hash); + if (p_alignment == HORIZONTAL_ALIGNMENT_FILL) { + hash = hash_djb2_one_64(hash_murmur3_one_float(p_width), hash); + hash = hash_djb2_one_64(p_flags, hash); + } - ClassDB::bind_method(D_METHOD("render_range", "cache_index", "size", "start", "end"), &FontData::render_range); - ClassDB::bind_method(D_METHOD("render_glyph", "cache_index", "size", "index"), &FontData::render_glyph); + Ref<TextLine> buffer; + if (cache.has(hash)) { + buffer = cache.get(hash); + } else { + buffer.instantiate(); + buffer->set_direction(p_direction); + buffer->set_orientation(p_orientation); + buffer->add_string(p_text, Ref<Font>(this), p_font_size); + cache.insert(hash, buffer); + } - ClassDB::bind_method(D_METHOD("get_cache_rid", "cache_index"), &FontData::get_cache_rid); + Vector2 ofs = p_pos; + if (p_orientation == TextServer::ORIENTATION_HORIZONTAL) { + ofs.y -= buffer->get_line_ascent(); + } else { + ofs.x -= buffer->get_line_ascent(); + } - ClassDB::bind_method(D_METHOD("is_language_supported", "language"), &FontData::is_language_supported); - ClassDB::bind_method(D_METHOD("set_language_support_override", "language", "supported"), &FontData::set_language_support_override); - ClassDB::bind_method(D_METHOD("get_language_support_override", "language"), &FontData::get_language_support_override); - ClassDB::bind_method(D_METHOD("remove_language_support_override", "language"), &FontData::remove_language_support_override); - ClassDB::bind_method(D_METHOD("get_language_support_overrides"), &FontData::get_language_support_overrides); + buffer->set_width(p_width); + buffer->set_horizontal_alignment(p_alignment); + buffer->set_flags(p_flags); - ClassDB::bind_method(D_METHOD("is_script_supported", "script"), &FontData::is_script_supported); - ClassDB::bind_method(D_METHOD("set_script_support_override", "script", "supported"), &FontData::set_script_support_override); - ClassDB::bind_method(D_METHOD("get_script_support_override", "script"), &FontData::get_script_support_override); - ClassDB::bind_method(D_METHOD("remove_script_support_override", "script"), &FontData::remove_script_support_override); - ClassDB::bind_method(D_METHOD("get_script_support_overrides"), &FontData::get_script_support_overrides); + buffer->draw_outline(p_canvas_item, ofs, p_size, p_modulate); +} - ClassDB::bind_method(D_METHOD("set_opentype_feature_overrides", "overrides"), &FontData::set_opentype_feature_overrides); - ClassDB::bind_method(D_METHOD("get_opentype_feature_overrides"), &FontData::get_opentype_feature_overrides); +void Font::draw_multiline_string_outline(RID p_canvas_item, const Point2 &p_pos, const String &p_text, HorizontalAlignment p_alignment, float p_width, int p_font_size, int p_max_lines, int p_size, const Color &p_modulate, uint16_t p_flags, TextServer::Direction p_direction, TextServer::Orientation p_orientation) const { + uint64_t hash = p_text.hash64(); + hash = hash_djb2_one_64(p_font_size, hash); + hash = hash_djb2_one_64(hash_murmur3_one_float(p_width), hash); + hash = hash_djb2_one_64(p_flags, hash); + hash = hash_djb2_one_64(p_direction, hash); + hash = hash_djb2_one_64(p_orientation, hash); - ClassDB::bind_method(D_METHOD("has_char", "char"), &FontData::has_char); - ClassDB::bind_method(D_METHOD("get_supported_chars"), &FontData::get_supported_chars); + Ref<TextParagraph> lines_buffer; + if (cache_wrap.has(hash)) { + lines_buffer = cache_wrap.get(hash); + } else { + lines_buffer.instantiate(); + lines_buffer->set_direction(p_direction); + lines_buffer->set_orientation(p_orientation); + lines_buffer->add_string(p_text, Ref<Font>(this), p_font_size); + lines_buffer->set_width(p_width); + lines_buffer->set_flags(p_flags); + cache_wrap.insert(hash, lines_buffer); + } - ClassDB::bind_method(D_METHOD("get_glyph_index", "size", "char", "variation_selector"), &FontData::get_glyph_index); + Vector2 ofs = p_pos; + if (p_orientation == TextServer::ORIENTATION_HORIZONTAL) { + ofs.y -= lines_buffer->get_line_ascent(0); + } else { + ofs.x -= lines_buffer->get_line_ascent(0); + } - ClassDB::bind_method(D_METHOD("get_supported_feature_list"), &FontData::get_supported_feature_list); - ClassDB::bind_method(D_METHOD("get_supported_variation_list"), &FontData::get_supported_variation_list); + lines_buffer->set_alignment(p_alignment); + lines_buffer->set_max_lines_visible(p_max_lines); - ADD_PROPERTY(PropertyInfo(Variant::PACKED_BYTE_ARRAY, "data", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE), "set_data", "get_data"); - ADD_PROPERTY(PropertyInfo(Variant::INT, "face_index", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE), "set_face_index", "get_face_index"); - ADD_PROPERTY(PropertyInfo(Variant::BOOL, "generate_mipmaps", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE), "set_generate_mipmaps", "get_generate_mipmaps"); - ADD_PROPERTY(PropertyInfo(Variant::BOOL, "antialiased", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE), "set_antialiased", "is_antialiased"); - ADD_PROPERTY(PropertyInfo(Variant::STRING, "font_name", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE), "set_font_name", "get_font_name"); - ADD_PROPERTY(PropertyInfo(Variant::STRING, "style_name", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE), "set_font_style_name", "get_font_style_name"); - ADD_PROPERTY(PropertyInfo(Variant::INT, "font_style", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE), "set_font_style", "get_font_style"); - ADD_PROPERTY(PropertyInfo(Variant::INT, "subpixel_positioning", PROPERTY_HINT_ENUM, "Disabled,Auto,One half of a pixel,One quarter of a pixel", PROPERTY_USAGE_STORAGE), "set_subpixel_positioning", "get_subpixel_positioning"); - ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "embolden", PROPERTY_HINT_RANGE, "-2,2,0.01", PROPERTY_USAGE_STORAGE), "set_embolden", "get_embolden"); - ADD_PROPERTY(PropertyInfo(Variant::TRANSFORM2D, "transform", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE), "set_transform", "get_transform"); - ADD_PROPERTY(PropertyInfo(Variant::BOOL, "multichannel_signed_distance_field", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE), "set_multichannel_signed_distance_field", "is_multichannel_signed_distance_field"); - ADD_PROPERTY(PropertyInfo(Variant::INT, "msdf_pixel_range", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE), "set_msdf_pixel_range", "get_msdf_pixel_range"); - ADD_PROPERTY(PropertyInfo(Variant::INT, "msdf_size", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE), "set_msdf_size", "get_msdf_size"); - ADD_PROPERTY(PropertyInfo(Variant::BOOL, "force_autohinter", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE), "set_force_autohinter", "is_force_autohinter"); - ADD_PROPERTY(PropertyInfo(Variant::INT, "hinting", PROPERTY_HINT_ENUM, "None,Light,Normal", PROPERTY_USAGE_STORAGE), "set_hinting", "get_hinting"); - ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "oversampling", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE), "set_oversampling", "get_oversampling"); - ADD_PROPERTY(PropertyInfo(Variant::INT, "fixed_size", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE), "set_fixed_size", "get_fixed_size"); - ADD_PROPERTY(PropertyInfo(Variant::DICTIONARY, "opentype_feature_overrides", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE), "set_opentype_feature_overrides", "get_opentype_feature_overrides"); + lines_buffer->draw_outline(p_canvas_item, ofs, p_size, p_modulate); } -bool FontData::_set(const StringName &p_name, const Variant &p_value) { - Vector<String> tokens = p_name.operator String().split("/"); - if (tokens.size() == 2 && tokens[0] == "language_support_override") { - String lang = tokens[1]; - set_language_support_override(lang, p_value); - return true; - } else if (tokens.size() == 2 && tokens[0] == "script_support_override") { - String script = tokens[1]; - set_script_support_override(script, p_value); - return true; - } else if (tokens.size() >= 3 && tokens[0] == "cache") { - int cache_index = tokens[1].to_int(); - if (tokens.size() == 3 && tokens[2] == "variation_coordinates") { - set_variation_coordinates(cache_index, p_value); - return true; - } - if (tokens.size() >= 5) { - Vector2i sz = Vector2i(tokens[2].to_int(), tokens[3].to_int()); - if (tokens[4] == "ascent") { - set_ascent(cache_index, sz.x, p_value); - return true; - } else if (tokens[4] == "descent") { - set_descent(cache_index, sz.x, p_value); - return true; - } else if (tokens[4] == "underline_position") { - set_underline_position(cache_index, sz.x, p_value); - return true; - } else if (tokens[4] == "underline_thickness") { - set_underline_thickness(cache_index, sz.x, p_value); - return true; - } else if (tokens[4] == "scale") { - set_scale(cache_index, sz.x, p_value); - return true; - } else if (tokens[4] == "spacing_glyph") { - set_spacing(cache_index, sz.x, TextServer::SPACING_GLYPH, p_value); - return true; - } else if (tokens[4] == "spacing_space") { - set_spacing(cache_index, sz.x, TextServer::SPACING_SPACE, p_value); - return true; - } else if (tokens.size() == 7 && tokens[4] == "textures") { - int texture_index = tokens[5].to_int(); - if (tokens[6] == "image") { - set_texture_image(cache_index, sz, texture_index, p_value); - return true; - } else if (tokens[6] == "offsets") { - set_texture_offsets(cache_index, sz, texture_index, p_value); - return true; - } - } else if (tokens.size() == 7 && tokens[4] == "glyphs") { - int32_t glyph_index = tokens[5].to_int(); - if (tokens[6] == "advance") { - set_glyph_advance(cache_index, sz.x, glyph_index, p_value); - return true; - } else if (tokens[6] == "offset") { - set_glyph_offset(cache_index, sz, glyph_index, p_value); - return true; - } else if (tokens[6] == "size") { - set_glyph_size(cache_index, sz, glyph_index, p_value); - return true; - } else if (tokens[6] == "uv_rect") { - set_glyph_uv_rect(cache_index, sz, glyph_index, p_value); - return true; - } else if (tokens[6] == "texture_idx") { - set_glyph_texture_idx(cache_index, sz, glyph_index, p_value); - return true; - } - } else if (tokens.size() == 7 && tokens[4] == "kerning_overrides") { - Vector2i gp = Vector2i(tokens[5].to_int(), tokens[6].to_int()); - set_kerning(cache_index, sz.x, gp, p_value); - return true; - } +// Drawing char. +Size2 Font::get_char_size(char32_t p_char, int p_font_size) const { + if (dirty_rids) { + _update_rids(); + } + for (int i = 0; i < rids.size(); i++) { + if (TS->font_has_char(rids[i], p_char)) { + int32_t glyph = TS->font_get_glyph_index(rids[i], p_font_size, p_char, 0); + return Size2(TS->font_get_glyph_advance(rids[i], p_font_size, glyph).x, get_height(p_font_size)); } } - return false; + return Size2(); } -bool FontData::_get(const StringName &p_name, Variant &r_ret) const { - Vector<String> tokens = p_name.operator String().split("/"); - if (tokens.size() == 2 && tokens[0] == "language_support_override") { - String lang = tokens[1]; - r_ret = get_language_support_override(lang); - return true; - } else if (tokens.size() == 2 && tokens[0] == "script_support_override") { - String script = tokens[1]; - r_ret = get_script_support_override(script); - return true; - } else if (tokens.size() >= 3 && tokens[0] == "cache") { - int cache_index = tokens[1].to_int(); - if (tokens.size() == 3 && tokens[2] == "variation_coordinates") { - r_ret = get_variation_coordinates(cache_index); - return true; +real_t Font::draw_char(RID p_canvas_item, const Point2 &p_pos, char32_t p_char, int p_font_size, const Color &p_modulate) const { + if (dirty_rids) { + _update_rids(); + } + for (int i = 0; i < rids.size(); i++) { + if (TS->font_has_char(rids[i], p_char)) { + int32_t glyph = TS->font_get_glyph_index(rids[i], p_font_size, p_char, 0); + TS->font_draw_glyph(rids[i], p_canvas_item, p_font_size, p_pos, glyph, p_modulate); + return TS->font_get_glyph_advance(rids[i], p_font_size, glyph).x; } - if (tokens.size() >= 5) { - Vector2i sz = Vector2i(tokens[2].to_int(), tokens[3].to_int()); - if (tokens[4] == "ascent") { - r_ret = get_ascent(cache_index, sz.x); - return true; - } else if (tokens[4] == "descent") { - r_ret = get_descent(cache_index, sz.x); - return true; - } else if (tokens[4] == "underline_position") { - r_ret = get_underline_position(cache_index, sz.x); - return true; - } else if (tokens[4] == "underline_thickness") { - r_ret = get_underline_thickness(cache_index, sz.x); - return true; - } else if (tokens[4] == "scale") { - r_ret = get_scale(cache_index, sz.x); - return true; - } else if (tokens[4] == "spacing_glyph") { - r_ret = get_spacing(cache_index, sz.x, TextServer::SPACING_GLYPH); - return true; - } else if (tokens[4] == "spacing_space") { - r_ret = get_spacing(cache_index, sz.x, TextServer::SPACING_SPACE); - return true; - } else if (tokens.size() == 7 && tokens[4] == "textures") { - int texture_index = tokens[5].to_int(); - if (tokens[6] == "image") { - r_ret = get_texture_image(cache_index, sz, texture_index); - return true; - } else if (tokens[6] == "offsets") { - r_ret = get_texture_offsets(cache_index, sz, texture_index); - return true; - } - } else if (tokens.size() == 7 && tokens[4] == "glyphs") { - int32_t glyph_index = tokens[5].to_int(); - if (tokens[6] == "advance") { - r_ret = get_glyph_advance(cache_index, sz.x, glyph_index); - return true; - } else if (tokens[6] == "offset") { - r_ret = get_glyph_offset(cache_index, sz, glyph_index); - return true; - } else if (tokens[6] == "size") { - r_ret = get_glyph_size(cache_index, sz, glyph_index); - return true; - } else if (tokens[6] == "uv_rect") { - r_ret = get_glyph_uv_rect(cache_index, sz, glyph_index); - return true; - } else if (tokens[6] == "texture_idx") { - r_ret = get_glyph_texture_idx(cache_index, sz, glyph_index); - return true; - } - } else if (tokens.size() == 7 && tokens[4] == "kerning_overrides") { - Vector2i gp = Vector2i(tokens[5].to_int(), tokens[6].to_int()); - r_ret = get_kerning(cache_index, sz.x, gp); - return true; - } + } + return 0.f; +} + +real_t Font::draw_char_outline(RID p_canvas_item, const Point2 &p_pos, char32_t p_char, int p_font_size, int p_size, const Color &p_modulate) const { + if (dirty_rids) { + _update_rids(); + } + for (int i = 0; i < rids.size(); i++) { + if (TS->font_has_char(rids[i], p_char)) { + int32_t glyph = TS->font_get_glyph_index(rids[i], p_font_size, p_char, 0); + TS->font_draw_glyph_outline(rids[i], p_canvas_item, p_font_size, p_size, p_pos, glyph, p_modulate); + return TS->font_get_glyph_advance(rids[i], p_font_size, glyph).x; } } - return false; + return 0.f; } -void FontData::_get_property_list(List<PropertyInfo> *p_list) const { - Vector<String> lang_over = get_language_support_overrides(); - for (int i = 0; i < lang_over.size(); i++) { - p_list->push_back(PropertyInfo(Variant::BOOL, "language_support_override/" + lang_over[i], PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE)); +// Helper functions. +bool Font::has_char(char32_t p_char) const { + if (dirty_rids) { + _update_rids(); } - Vector<String> scr_over = get_script_support_overrides(); - for (int i = 0; i < scr_over.size(); i++) { - p_list->push_back(PropertyInfo(Variant::BOOL, "script_support_override/" + scr_over[i], PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE)); + for (int i = 0; i < rids.size(); i++) { + if (TS->font_has_char(rids[i], p_char)) { + return true; + } } - for (int i = 0; i < cache.size(); i++) { - String prefix = "cache/" + itos(i) + "/"; - Array sizes = get_size_cache_list(i); - p_list->push_back(PropertyInfo(Variant::DICTIONARY, prefix + "variation_coordinates", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE)); - for (int j = 0; j < sizes.size(); j++) { - Vector2i sz = sizes[j]; - String prefix_sz = prefix + itos(sz.x) + "/" + itos(sz.y) + "/"; - if (sz.y == 0) { - p_list->push_back(PropertyInfo(Variant::FLOAT, prefix_sz + "ascent", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE)); - p_list->push_back(PropertyInfo(Variant::FLOAT, prefix_sz + "descent", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE)); - p_list->push_back(PropertyInfo(Variant::FLOAT, prefix_sz + "underline_position", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE)); - p_list->push_back(PropertyInfo(Variant::FLOAT, prefix_sz + "underline_thickness", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE)); - p_list->push_back(PropertyInfo(Variant::FLOAT, prefix_sz + "scale", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE)); - p_list->push_back(PropertyInfo(Variant::BOOL, prefix_sz + "spacing_glyph", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE)); - p_list->push_back(PropertyInfo(Variant::BOOL, prefix_sz + "spacing_space", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE)); - } + return false; +} - int tx_cnt = get_texture_count(i, sz); - for (int k = 0; k < tx_cnt; k++) { - p_list->push_back(PropertyInfo(Variant::PACKED_INT32_ARRAY, prefix_sz + "textures/" + itos(k) + "/offsets", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE)); - p_list->push_back(PropertyInfo(Variant::OBJECT, prefix_sz + "textures/" + itos(k) + "/image", PROPERTY_HINT_RESOURCE_TYPE, "Image", PROPERTY_USAGE_STORAGE | PROPERTY_USAGE_RESOURCE_NOT_PERSISTENT)); - } - Array glyphs = get_glyph_list(i, sz); - for (int k = 0; k < glyphs.size(); k++) { - const int32_t &gl = glyphs[k]; - if (sz.y == 0) { - p_list->push_back(PropertyInfo(Variant::VECTOR2, prefix_sz + "glyphs/" + itos(gl) + "/advance", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE)); - } - p_list->push_back(PropertyInfo(Variant::VECTOR2, prefix_sz + "glyphs/" + itos(gl) + "/offset", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE)); - p_list->push_back(PropertyInfo(Variant::VECTOR2, prefix_sz + "glyphs/" + itos(gl) + "/size", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE)); - p_list->push_back(PropertyInfo(Variant::RECT2, prefix_sz + "glyphs/" + itos(gl) + "/uv_rect", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE)); - p_list->push_back(PropertyInfo(Variant::INT, prefix_sz + "glyphs/" + itos(gl) + "/texture_idx", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE)); - } - if (sz.y == 0) { - Array kerning_map = get_kerning_list(i, sz.x); - for (int k = 0; k < kerning_map.size(); k++) { - const Vector2i &gl_pair = kerning_map[k]; - p_list->push_back(PropertyInfo(Variant::VECTOR2, prefix_sz + "kerning_overrides/" + itos(gl_pair.x) + "/" + itos(gl_pair.y), PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE)); - } +String Font::get_supported_chars() const { + if (dirty_rids) { + _update_rids(); + } + String chars; + for (int i = 0; i < rids.size(); i++) { + String data_chars = TS->font_get_supported_chars(rids[i]); + for (int j = 0; j < data_chars.length(); j++) { + if (chars.find_char(data_chars[j]) == -1) { + chars += data_chars[j]; } } } + return chars; } -void FontData::reset_state() { - _clear_cache(); - data.clear(); - data_ptr = nullptr; - data_size = 0; - face_index = 0; - cache.clear(); +bool Font::is_language_supported(const String &p_language) const { + return TS->font_is_language_supported(_get_rid(), p_language); +} - antialiased = true; - mipmaps = false; - msdf = false; - force_autohinter = false; - hinting = TextServer::HINTING_LIGHT; - subpixel_positioning = TextServer::SUBPIXEL_POSITIONING_DISABLED; - msdf_pixel_range = 14; - msdf_size = 128; - fixed_size = 0; - embolden = 0.f; - transform = Transform2D(); - oversampling = 0.f; +bool Font::is_script_supported(const String &p_script) const { + return TS->font_is_script_supported(_get_rid(), p_script); +} + +Dictionary Font::get_supported_feature_list() const { + return TS->font_supported_feature_list(_get_rid()); +} + +Dictionary Font::get_supported_variation_list() const { + return TS->font_supported_variation_list(_get_rid()); +} + +int64_t Font::get_face_count() const { + return TS->font_get_face_count(_get_rid()); +} + +Font::Font() { + cache.set_capacity(64); + cache_wrap.set_capacity(16); +} + +Font::~Font() { + reset_state(); } -void FontData::_convert_packed_8bit(Ref<Image> &p_source, int p_page, int p_sz) { +/*************************************************************************/ +/* FontFile */ +/*************************************************************************/ + +_FORCE_INLINE_ void FontFile::_clear_cache() { + for (int i = 0; i < cache.size(); i++) { + if (cache[i].is_valid()) { + TS->free_rid(cache[i]); + cache.write[i] = RID(); + } + } +} + +_FORCE_INLINE_ void FontFile::_ensure_rid(int p_cache_index) const { + if (unlikely(p_cache_index >= cache.size())) { + cache.resize(p_cache_index + 1); + } + if (unlikely(!cache[p_cache_index].is_valid())) { + cache.write[p_cache_index] = TS->create_font(); + TS->font_set_data_ptr(cache[p_cache_index], data_ptr, data_size); + TS->font_set_antialiased(cache[p_cache_index], antialiased); + TS->font_set_generate_mipmaps(cache[p_cache_index], mipmaps); + TS->font_set_multichannel_signed_distance_field(cache[p_cache_index], msdf); + TS->font_set_msdf_pixel_range(cache[p_cache_index], msdf_pixel_range); + TS->font_set_msdf_size(cache[p_cache_index], msdf_size); + TS->font_set_fixed_size(cache[p_cache_index], fixed_size); + TS->font_set_force_autohinter(cache[p_cache_index], force_autohinter); + TS->font_set_hinting(cache[p_cache_index], hinting); + TS->font_set_subpixel_positioning(cache[p_cache_index], subpixel_positioning); + TS->font_set_oversampling(cache[p_cache_index], oversampling); + } +} + +void FontFile::_convert_packed_8bit(Ref<Image> &p_source, int p_page, int p_sz) { int w = p_source->get_width(); int h = p_source->get_height(); @@ -516,7 +617,7 @@ void FontData::_convert_packed_8bit(Ref<Image> &p_source, int p_page, int p_sz) set_texture_image(0, Vector2i(p_sz, 0), p_page * 4 + 3, img_a); } -void FontData::_convert_packed_4bit(Ref<Image> &p_source, int p_page, int p_sz) { +void FontFile::_convert_packed_4bit(Ref<Image> &p_source, int p_page, int p_sz) { int w = p_source->get_width(); int h = p_source->get_height(); @@ -616,7 +717,7 @@ void FontData::_convert_packed_4bit(Ref<Image> &p_source, int p_page, int p_sz) set_texture_image(0, Vector2i(p_sz, 1), p_page * 4 + 3, img_ao); } -void FontData::_convert_rgba_4bit(Ref<Image> &p_source, int p_page, int p_sz) { +void FontFile::_convert_rgba_4bit(Ref<Image> &p_source, int p_page, int p_sz) { int w = p_source->get_width(); int h = p_source->get_height(); @@ -672,7 +773,7 @@ void FontData::_convert_rgba_4bit(Ref<Image> &p_source, int p_page, int p_sz) { set_texture_image(0, Vector2i(p_sz, 1), p_page, img_o); } -void FontData::_convert_mono_8bit(Ref<Image> &p_source, int p_page, int p_ch, int p_sz, int p_ol) { +void FontFile::_convert_mono_8bit(Ref<Image> &p_source, int p_page, int p_ch, int p_sz, int p_ol) { int w = p_source->get_width(); int h = p_source->get_height(); @@ -701,7 +802,7 @@ void FontData::_convert_mono_8bit(Ref<Image> &p_source, int p_page, int p_ch, in set_texture_image(0, Vector2i(p_sz, p_ol), p_page, img_g); } -void FontData::_convert_mono_4bit(Ref<Image> &p_source, int p_page, int p_ch, int p_sz, int p_ol) { +void FontFile::_convert_mono_4bit(Ref<Image> &p_source, int p_page, int p_ch, int p_sz, int p_ol) { int w = p_source->get_width(); int h = p_source->get_height(); @@ -744,9 +845,477 @@ void FontData::_convert_mono_4bit(Ref<Image> &p_source, int p_page, int p_ch, in set_texture_image(0, Vector2i(p_sz, p_ol), p_page, img_o); } +void FontFile::_bind_methods() { + ClassDB::bind_method(D_METHOD("load_bitmap_font", "path"), &FontFile::load_bitmap_font); + ClassDB::bind_method(D_METHOD("load_dynamic_font", "path"), &FontFile::load_dynamic_font); + + ClassDB::bind_method(D_METHOD("set_data", "data"), &FontFile::set_data); + ClassDB::bind_method(D_METHOD("get_data"), &FontFile::get_data); + + ClassDB::bind_method(D_METHOD("set_font_name", "name"), &FontFile::set_font_name); + ClassDB::bind_method(D_METHOD("set_font_style_name", "name"), &FontFile::set_font_style_name); + ClassDB::bind_method(D_METHOD("set_font_style", "style"), &FontFile::set_font_style); + + ClassDB::bind_method(D_METHOD("set_antialiased", "antialiased"), &FontFile::set_antialiased); + ClassDB::bind_method(D_METHOD("is_antialiased"), &FontFile::is_antialiased); + + ClassDB::bind_method(D_METHOD("set_generate_mipmaps", "generate_mipmaps"), &FontFile::set_generate_mipmaps); + ClassDB::bind_method(D_METHOD("get_generate_mipmaps"), &FontFile::get_generate_mipmaps); + + ClassDB::bind_method(D_METHOD("set_multichannel_signed_distance_field", "msdf"), &FontFile::set_multichannel_signed_distance_field); + ClassDB::bind_method(D_METHOD("is_multichannel_signed_distance_field"), &FontFile::is_multichannel_signed_distance_field); + + ClassDB::bind_method(D_METHOD("set_msdf_pixel_range", "msdf_pixel_range"), &FontFile::set_msdf_pixel_range); + ClassDB::bind_method(D_METHOD("get_msdf_pixel_range"), &FontFile::get_msdf_pixel_range); + + ClassDB::bind_method(D_METHOD("set_msdf_size", "msdf_size"), &FontFile::set_msdf_size); + ClassDB::bind_method(D_METHOD("get_msdf_size"), &FontFile::get_msdf_size); + + ClassDB::bind_method(D_METHOD("set_fixed_size", "fixed_size"), &FontFile::set_fixed_size); + ClassDB::bind_method(D_METHOD("get_fixed_size"), &FontFile::get_fixed_size); + + ClassDB::bind_method(D_METHOD("set_force_autohinter", "force_autohinter"), &FontFile::set_force_autohinter); + ClassDB::bind_method(D_METHOD("is_force_autohinter"), &FontFile::is_force_autohinter); + + ClassDB::bind_method(D_METHOD("set_hinting", "hinting"), &FontFile::set_hinting); + ClassDB::bind_method(D_METHOD("get_hinting"), &FontFile::get_hinting); + + ClassDB::bind_method(D_METHOD("set_subpixel_positioning", "subpixel_positioning"), &FontFile::set_subpixel_positioning); + ClassDB::bind_method(D_METHOD("get_subpixel_positioning"), &FontFile::get_subpixel_positioning); + + ClassDB::bind_method(D_METHOD("set_oversampling", "oversampling"), &FontFile::set_oversampling); + ClassDB::bind_method(D_METHOD("get_oversampling"), &FontFile::get_oversampling); + + ClassDB::bind_method(D_METHOD("get_cache_count"), &FontFile::get_cache_count); + ClassDB::bind_method(D_METHOD("clear_cache"), &FontFile::clear_cache); + ClassDB::bind_method(D_METHOD("remove_cache", "cache_index"), &FontFile::remove_cache); + + ClassDB::bind_method(D_METHOD("get_size_cache_list", "cache_index"), &FontFile::get_size_cache_list); + ClassDB::bind_method(D_METHOD("clear_size_cache", "cache_index"), &FontFile::clear_size_cache); + ClassDB::bind_method(D_METHOD("remove_size_cache", "cache_index", "size"), &FontFile::remove_size_cache); + + ClassDB::bind_method(D_METHOD("set_variation_coordinates", "cache_index", "variation_coordinates"), &FontFile::set_variation_coordinates); + ClassDB::bind_method(D_METHOD("get_variation_coordinates", "cache_index"), &FontFile::get_variation_coordinates); + + ClassDB::bind_method(D_METHOD("set_embolden", "cache_index", "strength"), &FontFile::set_embolden); + ClassDB::bind_method(D_METHOD("get_embolden", "cache_index"), &FontFile::get_embolden); + + ClassDB::bind_method(D_METHOD("set_transform", "cache_index", "transform"), &FontFile::set_transform); + ClassDB::bind_method(D_METHOD("get_transform", "cache_index"), &FontFile::get_transform); + + ClassDB::bind_method(D_METHOD("set_face_index", "cache_index", "face_index"), &FontFile::set_face_index); + ClassDB::bind_method(D_METHOD("get_face_index", "cache_index"), &FontFile::get_face_index); + + ClassDB::bind_method(D_METHOD("set_cache_ascent", "cache_index", "size", "ascent"), &FontFile::set_cache_ascent); + ClassDB::bind_method(D_METHOD("get_cache_ascent", "cache_index", "size"), &FontFile::get_cache_ascent); + + ClassDB::bind_method(D_METHOD("set_cache_descent", "cache_index", "size", "descent"), &FontFile::set_cache_descent); + ClassDB::bind_method(D_METHOD("get_cache_descent", "cache_index", "size"), &FontFile::get_cache_descent); + + ClassDB::bind_method(D_METHOD("set_cache_underline_position", "cache_index", "size", "underline_position"), &FontFile::set_cache_underline_position); + ClassDB::bind_method(D_METHOD("get_cache_underline_position", "cache_index", "size"), &FontFile::get_cache_underline_position); + + ClassDB::bind_method(D_METHOD("set_cache_underline_thickness", "cache_index", "size", "underline_thickness"), &FontFile::set_cache_underline_thickness); + ClassDB::bind_method(D_METHOD("get_cache_underline_thickness", "cache_index", "size"), &FontFile::get_cache_underline_thickness); + + ClassDB::bind_method(D_METHOD("set_cache_scale", "cache_index", "size", "scale"), &FontFile::set_cache_scale); + ClassDB::bind_method(D_METHOD("get_cache_scale", "cache_index", "size"), &FontFile::get_cache_scale); + + ClassDB::bind_method(D_METHOD("get_texture_count", "cache_index", "size"), &FontFile::get_texture_count); + ClassDB::bind_method(D_METHOD("clear_textures", "cache_index", "size"), &FontFile::clear_textures); + ClassDB::bind_method(D_METHOD("remove_texture", "cache_index", "size", "texture_index"), &FontFile::remove_texture); + + ClassDB::bind_method(D_METHOD("set_texture_image", "cache_index", "size", "texture_index", "image"), &FontFile::set_texture_image); + ClassDB::bind_method(D_METHOD("get_texture_image", "cache_index", "size", "texture_index"), &FontFile::get_texture_image); + + ClassDB::bind_method(D_METHOD("set_texture_offsets", "cache_index", "size", "texture_index", "offset"), &FontFile::set_texture_offsets); + ClassDB::bind_method(D_METHOD("get_texture_offsets", "cache_index", "size", "texture_index"), &FontFile::get_texture_offsets); + + ClassDB::bind_method(D_METHOD("get_glyph_list", "cache_index", "size"), &FontFile::get_glyph_list); + ClassDB::bind_method(D_METHOD("clear_glyphs", "cache_index", "size"), &FontFile::clear_glyphs); + ClassDB::bind_method(D_METHOD("remove_glyph", "cache_index", "size", "glyph"), &FontFile::remove_glyph); + + ClassDB::bind_method(D_METHOD("set_glyph_advance", "cache_index", "size", "glyph", "advance"), &FontFile::set_glyph_advance); + ClassDB::bind_method(D_METHOD("get_glyph_advance", "cache_index", "size", "glyph"), &FontFile::get_glyph_advance); + + ClassDB::bind_method(D_METHOD("set_glyph_offset", "cache_index", "size", "glyph", "offset"), &FontFile::set_glyph_offset); + ClassDB::bind_method(D_METHOD("get_glyph_offset", "cache_index", "size", "glyph"), &FontFile::get_glyph_offset); + + ClassDB::bind_method(D_METHOD("set_glyph_size", "cache_index", "size", "glyph", "gl_size"), &FontFile::set_glyph_size); + ClassDB::bind_method(D_METHOD("get_glyph_size", "cache_index", "size", "glyph"), &FontFile::get_glyph_size); + + ClassDB::bind_method(D_METHOD("set_glyph_uv_rect", "cache_index", "size", "glyph", "uv_rect"), &FontFile::set_glyph_uv_rect); + ClassDB::bind_method(D_METHOD("get_glyph_uv_rect", "cache_index", "size", "glyph"), &FontFile::get_glyph_uv_rect); + + ClassDB::bind_method(D_METHOD("set_glyph_texture_idx", "cache_index", "size", "glyph", "texture_idx"), &FontFile::set_glyph_texture_idx); + ClassDB::bind_method(D_METHOD("get_glyph_texture_idx", "cache_index", "size", "glyph"), &FontFile::get_glyph_texture_idx); + + ClassDB::bind_method(D_METHOD("get_kerning_list", "cache_index", "size"), &FontFile::get_kerning_list); + ClassDB::bind_method(D_METHOD("clear_kerning_map", "cache_index", "size"), &FontFile::clear_kerning_map); + ClassDB::bind_method(D_METHOD("remove_kerning", "cache_index", "size", "glyph_pair"), &FontFile::remove_kerning); + + ClassDB::bind_method(D_METHOD("set_kerning", "cache_index", "size", "glyph_pair", "kerning"), &FontFile::set_kerning); + ClassDB::bind_method(D_METHOD("get_kerning", "cache_index", "size", "glyph_pair"), &FontFile::get_kerning); + + ClassDB::bind_method(D_METHOD("render_range", "cache_index", "size", "start", "end"), &FontFile::render_range); + ClassDB::bind_method(D_METHOD("render_glyph", "cache_index", "size", "index"), &FontFile::render_glyph); + + ClassDB::bind_method(D_METHOD("set_language_support_override", "language", "supported"), &FontFile::set_language_support_override); + ClassDB::bind_method(D_METHOD("get_language_support_override", "language"), &FontFile::get_language_support_override); + ClassDB::bind_method(D_METHOD("remove_language_support_override", "language"), &FontFile::remove_language_support_override); + ClassDB::bind_method(D_METHOD("get_language_support_overrides"), &FontFile::get_language_support_overrides); + + ClassDB::bind_method(D_METHOD("set_script_support_override", "script", "supported"), &FontFile::set_script_support_override); + ClassDB::bind_method(D_METHOD("get_script_support_override", "script"), &FontFile::get_script_support_override); + ClassDB::bind_method(D_METHOD("remove_script_support_override", "script"), &FontFile::remove_script_support_override); + ClassDB::bind_method(D_METHOD("get_script_support_overrides"), &FontFile::get_script_support_overrides); + + ClassDB::bind_method(D_METHOD("set_opentype_feature_overrides", "overrides"), &FontFile::set_opentype_feature_overrides); + ClassDB::bind_method(D_METHOD("get_opentype_feature_overrides"), &FontFile::get_opentype_feature_overrides); + + ClassDB::bind_method(D_METHOD("get_glyph_index", "size", "char", "variation_selector"), &FontFile::get_glyph_index); + + ADD_PROPERTY(PropertyInfo(Variant::PACKED_BYTE_ARRAY, "data", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE), "set_data", "get_data"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "generate_mipmaps", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE), "set_generate_mipmaps", "get_generate_mipmaps"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "antialiased", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE), "set_antialiased", "is_antialiased"); + ADD_PROPERTY(PropertyInfo(Variant::STRING, "font_name", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE), "set_font_name", "get_font_name"); + ADD_PROPERTY(PropertyInfo(Variant::STRING, "style_name", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE), "set_font_style_name", "get_font_style_name"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "font_style", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE), "set_font_style", "get_font_style"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "subpixel_positioning", PROPERTY_HINT_ENUM, "Disabled,Auto,One half of a pixel,One quarter of a pixel", PROPERTY_USAGE_STORAGE), "set_subpixel_positioning", "get_subpixel_positioning"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "multichannel_signed_distance_field", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE), "set_multichannel_signed_distance_field", "is_multichannel_signed_distance_field"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "msdf_pixel_range", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE), "set_msdf_pixel_range", "get_msdf_pixel_range"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "msdf_size", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE), "set_msdf_size", "get_msdf_size"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "force_autohinter", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE), "set_force_autohinter", "is_force_autohinter"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "hinting", PROPERTY_HINT_ENUM, "None,Light,Normal", PROPERTY_USAGE_STORAGE), "set_hinting", "get_hinting"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "oversampling", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE), "set_oversampling", "get_oversampling"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "fixed_size", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE), "set_fixed_size", "get_fixed_size"); + ADD_PROPERTY(PropertyInfo(Variant::DICTIONARY, "opentype_feature_overrides", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE), "set_opentype_feature_overrides", "get_opentype_feature_overrides"); + ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "fallbacks", PROPERTY_HINT_ARRAY_TYPE, vformat("%s/%s:%s", Variant::OBJECT, PROPERTY_HINT_RESOURCE_TYPE, "Font"), PROPERTY_USAGE_STORAGE), "set_fallbacks", "get_fallbacks"); +} + +bool FontFile::_set(const StringName &p_name, const Variant &p_value) { + Vector<String> tokens = p_name.operator String().split("/"); + +#ifndef DISABLE_DEPRECATED + if (tokens.size() == 1 && tokens[0] == "font_path") { + // Compatibility, DynamicFontData. + load_dynamic_font(p_value); + } else if (tokens.size() == 1 && tokens[0] == "override_oversampling") { + set_oversampling(p_value); + } + if (tokens.size() == 1 && tokens[0] == "font_data") { + // Compatibility, DynamicFont. + Ref<Font> f = p_value; + if (f.is_valid()) { + fallbacks.push_back(f); + return true; + } + return false; + } else if (tokens.size() == 2 && tokens[0] == "fallback") { + // Compatibility, DynamicFont. + Ref<FontFile> f = p_value; + if (f.is_valid()) { + fallbacks.push_back(f); + return true; + } + return false; + } else if (tokens.size() == 1 && tokens[0] == "textures") { + // Compatibility, BitmapFont. + set_fixed_size(16); + Array textures = p_value; + for (int i = 0; i < textures.size(); i++) { + Ref<ImageTexture> tex = textures[i]; + ERR_CONTINUE(!tex.is_valid()); + set_texture_image(0, Vector2i(16, 0), i, tex->get_image()); + } + } else if (tokens.size() == 1 && tokens[0] == "chars") { + // Compatibility, BitmapFont. + set_fixed_size(16); + PackedInt32Array arr = p_value; + int len = arr.size(); + ERR_FAIL_COND_V(len % 9, false); + if (!len) { + return false; + } + int chars = len / 9; + for (int i = 0; i < chars; i++) { + const int32_t *data = &arr[i * 9]; + char32_t c = data[0]; + set_glyph_texture_idx(0, Vector2i(16, 0), c, data[1]); + set_glyph_uv_rect(0, Vector2i(16, 0), c, Rect2(data[2], data[3], data[4], data[5])); + set_glyph_offset(0, Vector2i(16, 0), c, Size2(data[6], data[7])); + set_glyph_advance(0, 16, c, Vector2(data[8], 0)); + } + } else if (tokens.size() == 1 && tokens[0] == "kernings") { + // Compatibility, BitmapFont. + set_fixed_size(16); + PackedInt32Array arr = p_value; + int len = arr.size(); + ERR_FAIL_COND_V(len % 3, false); + if (!len) { + return false; + } + for (int i = 0; i < len / 3; i++) { + const int32_t *data = &arr[i * 3]; + set_kerning(0, 16, Vector2i(data[0], data[1]), Vector2(data[2], 0)); + } + } else if (tokens.size() == 1 && tokens[0] == "height") { + // Compatibility, BitmapFont. + bmp_height = p_value; + set_fixed_size(16); + set_cache_descent(0, 16, bmp_height - bmp_ascent); + } else if (tokens.size() == 1 && tokens[0] == "ascent") { + // Compatibility, BitmapFont. + bmp_ascent = p_value; + set_fixed_size(16); + set_cache_ascent(0, 16, bmp_ascent); + set_cache_descent(0, 16, bmp_height - bmp_ascent); + } else if (tokens.size() == 1 && tokens[0] == "fallback") { + // Compatibility, BitmapFont. + Ref<Font> f = p_value; + if (f.is_valid()) { + fallbacks.push_back(f); + return true; + } + return false; + } +#endif // DISABLE_DEPRECATED + + if (tokens.size() == 2 && tokens[0] == "language_support_override") { + String lang = tokens[1]; + set_language_support_override(lang, p_value); + return true; + } else if (tokens.size() == 2 && tokens[0] == "script_support_override") { + String script = tokens[1]; + set_script_support_override(script, p_value); + return true; + } else if (tokens.size() >= 3 && tokens[0] == "cache") { + int cache_index = tokens[1].to_int(); + if (tokens.size() == 3 && tokens[2] == "variation_coordinates") { + set_variation_coordinates(cache_index, p_value); + return true; + } else if (tokens.size() == 3 && tokens[2] == "embolden") { + set_embolden(cache_index, p_value); + return true; + } else if (tokens.size() == 3 && tokens[2] == "face_index") { + set_face_index(cache_index, p_value); + return true; + } else if (tokens.size() == 3 && tokens[2] == "transform") { + set_transform(cache_index, p_value); + return true; + } + if (tokens.size() >= 5) { + Vector2i sz = Vector2i(tokens[2].to_int(), tokens[3].to_int()); + if (tokens[4] == "ascent") { + set_cache_ascent(cache_index, sz.x, p_value); + return true; + } else if (tokens[4] == "descent") { + set_cache_descent(cache_index, sz.x, p_value); + return true; + } else if (tokens[4] == "underline_position") { + set_cache_underline_position(cache_index, sz.x, p_value); + return true; + } else if (tokens[4] == "underline_thickness") { + set_cache_underline_thickness(cache_index, sz.x, p_value); + return true; + } else if (tokens[4] == "scale") { + set_cache_scale(cache_index, sz.x, p_value); + return true; + } else if (tokens.size() == 7 && tokens[4] == "textures") { + int texture_index = tokens[5].to_int(); + if (tokens[6] == "image") { + set_texture_image(cache_index, sz, texture_index, p_value); + return true; + } else if (tokens[6] == "offsets") { + set_texture_offsets(cache_index, sz, texture_index, p_value); + return true; + } + } else if (tokens.size() == 7 && tokens[4] == "glyphs") { + int32_t glyph_index = tokens[5].to_int(); + if (tokens[6] == "advance") { + set_glyph_advance(cache_index, sz.x, glyph_index, p_value); + return true; + } else if (tokens[6] == "offset") { + set_glyph_offset(cache_index, sz, glyph_index, p_value); + return true; + } else if (tokens[6] == "size") { + set_glyph_size(cache_index, sz, glyph_index, p_value); + return true; + } else if (tokens[6] == "uv_rect") { + set_glyph_uv_rect(cache_index, sz, glyph_index, p_value); + return true; + } else if (tokens[6] == "texture_idx") { + set_glyph_texture_idx(cache_index, sz, glyph_index, p_value); + return true; + } + } else if (tokens.size() == 7 && tokens[4] == "kerning_overrides") { + Vector2i gp = Vector2i(tokens[5].to_int(), tokens[6].to_int()); + set_kerning(cache_index, sz.x, gp, p_value); + return true; + } + } + } + return false; +} + +bool FontFile::_get(const StringName &p_name, Variant &r_ret) const { + Vector<String> tokens = p_name.operator String().split("/"); + if (tokens.size() == 2 && tokens[0] == "language_support_override") { + String lang = tokens[1]; + r_ret = get_language_support_override(lang); + return true; + } else if (tokens.size() == 2 && tokens[0] == "script_support_override") { + String script = tokens[1]; + r_ret = get_script_support_override(script); + return true; + } else if (tokens.size() >= 3 && tokens[0] == "cache") { + int cache_index = tokens[1].to_int(); + if (tokens.size() == 3 && tokens[2] == "variation_coordinates") { + r_ret = get_variation_coordinates(cache_index); + return true; + } else if (tokens.size() == 3 && tokens[2] == "embolden") { + r_ret = get_embolden(cache_index); + return true; + } else if (tokens.size() == 3 && tokens[2] == "face_index") { + r_ret = get_face_index(cache_index); + return true; + } else if (tokens.size() == 3 && tokens[2] == "transform") { + r_ret = get_transform(cache_index); + return true; + } + if (tokens.size() >= 5) { + Vector2i sz = Vector2i(tokens[2].to_int(), tokens[3].to_int()); + if (tokens[4] == "ascent") { + r_ret = get_cache_ascent(cache_index, sz.x); + return true; + } else if (tokens[4] == "descent") { + r_ret = get_cache_descent(cache_index, sz.x); + return true; + } else if (tokens[4] == "underline_position") { + r_ret = get_cache_underline_position(cache_index, sz.x); + return true; + } else if (tokens[4] == "underline_thickness") { + r_ret = get_cache_underline_thickness(cache_index, sz.x); + return true; + } else if (tokens[4] == "scale") { + r_ret = get_cache_scale(cache_index, sz.x); + return true; + } else if (tokens.size() == 7 && tokens[4] == "textures") { + int texture_index = tokens[5].to_int(); + if (tokens[6] == "image") { + r_ret = get_texture_image(cache_index, sz, texture_index); + return true; + } else if (tokens[6] == "offsets") { + r_ret = get_texture_offsets(cache_index, sz, texture_index); + return true; + } + } else if (tokens.size() == 7 && tokens[4] == "glyphs") { + int32_t glyph_index = tokens[5].to_int(); + if (tokens[6] == "advance") { + r_ret = get_glyph_advance(cache_index, sz.x, glyph_index); + return true; + } else if (tokens[6] == "offset") { + r_ret = get_glyph_offset(cache_index, sz, glyph_index); + return true; + } else if (tokens[6] == "size") { + r_ret = get_glyph_size(cache_index, sz, glyph_index); + return true; + } else if (tokens[6] == "uv_rect") { + r_ret = get_glyph_uv_rect(cache_index, sz, glyph_index); + return true; + } else if (tokens[6] == "texture_idx") { + r_ret = get_glyph_texture_idx(cache_index, sz, glyph_index); + return true; + } + } else if (tokens.size() == 7 && tokens[4] == "kerning_overrides") { + Vector2i gp = Vector2i(tokens[5].to_int(), tokens[6].to_int()); + r_ret = get_kerning(cache_index, sz.x, gp); + return true; + } + } + } + return false; +} + +void FontFile::_get_property_list(List<PropertyInfo> *p_list) const { + Vector<String> lang_over = get_language_support_overrides(); + for (int i = 0; i < lang_over.size(); i++) { + p_list->push_back(PropertyInfo(Variant::BOOL, "language_support_override/" + lang_over[i], PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE)); + } + Vector<String> scr_over = get_script_support_overrides(); + for (int i = 0; i < scr_over.size(); i++) { + p_list->push_back(PropertyInfo(Variant::BOOL, "script_support_override/" + scr_over[i], PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE)); + } + for (int i = 0; i < cache.size(); i++) { + String prefix = "cache/" + itos(i) + "/"; + Array sizes = get_size_cache_list(i); + p_list->push_back(PropertyInfo(Variant::DICTIONARY, prefix + "variation_coordinates", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE)); + p_list->push_back(PropertyInfo(Variant::INT, "face_index", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE)); + p_list->push_back(PropertyInfo(Variant::FLOAT, "embolden", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE)); + p_list->push_back(PropertyInfo(Variant::TRANSFORM2D, "transform", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE)); + + for (int j = 0; j < sizes.size(); j++) { + Vector2i sz = sizes[j]; + String prefix_sz = prefix + itos(sz.x) + "/" + itos(sz.y) + "/"; + if (sz.y == 0) { + p_list->push_back(PropertyInfo(Variant::FLOAT, prefix_sz + "ascent", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE)); + p_list->push_back(PropertyInfo(Variant::FLOAT, prefix_sz + "descent", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE)); + p_list->push_back(PropertyInfo(Variant::FLOAT, prefix_sz + "underline_position", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE)); + p_list->push_back(PropertyInfo(Variant::FLOAT, prefix_sz + "underline_thickness", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE)); + p_list->push_back(PropertyInfo(Variant::FLOAT, prefix_sz + "scale", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE)); + } + + int tx_cnt = get_texture_count(i, sz); + for (int k = 0; k < tx_cnt; k++) { + p_list->push_back(PropertyInfo(Variant::PACKED_INT32_ARRAY, prefix_sz + "textures/" + itos(k) + "/offsets", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE)); + p_list->push_back(PropertyInfo(Variant::OBJECT, prefix_sz + "textures/" + itos(k) + "/image", PROPERTY_HINT_RESOURCE_TYPE, "Image", PROPERTY_USAGE_STORAGE | PROPERTY_USAGE_RESOURCE_NOT_PERSISTENT)); + } + Array glyphs = get_glyph_list(i, sz); + for (int k = 0; k < glyphs.size(); k++) { + const int32_t &gl = glyphs[k]; + if (sz.y == 0) { + p_list->push_back(PropertyInfo(Variant::VECTOR2, prefix_sz + "glyphs/" + itos(gl) + "/advance", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE)); + } + p_list->push_back(PropertyInfo(Variant::VECTOR2, prefix_sz + "glyphs/" + itos(gl) + "/offset", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE)); + p_list->push_back(PropertyInfo(Variant::VECTOR2, prefix_sz + "glyphs/" + itos(gl) + "/size", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE)); + p_list->push_back(PropertyInfo(Variant::RECT2, prefix_sz + "glyphs/" + itos(gl) + "/uv_rect", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE)); + p_list->push_back(PropertyInfo(Variant::INT, prefix_sz + "glyphs/" + itos(gl) + "/texture_idx", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE)); + } + if (sz.y == 0) { + Array kerning_map = get_kerning_list(i, sz.x); + for (int k = 0; k < kerning_map.size(); k++) { + const Vector2i &gl_pair = kerning_map[k]; + p_list->push_back(PropertyInfo(Variant::VECTOR2, prefix_sz + "kerning_overrides/" + itos(gl_pair.x) + "/" + itos(gl_pair.y), PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE)); + } + } + } + } +} + +void FontFile::reset_state() { + _clear_cache(); + data.clear(); + data_ptr = nullptr; + data_size = 0; + cache.clear(); + + antialiased = true; + mipmaps = false; + msdf = false; + force_autohinter = false; + hinting = TextServer::HINTING_LIGHT; + subpixel_positioning = TextServer::SUBPIXEL_POSITIONING_DISABLED; + msdf_pixel_range = 14; + msdf_size = 128; + fixed_size = 0; + oversampling = 0.f; + + Font::reset_state(); +} + /*************************************************************************/ -Error FontData::load_bitmap_font(const String &p_path) { +Error FontFile::load_bitmap_font(const String &p_path) { reset_state(); antialiased = false; @@ -1209,13 +1778,13 @@ Error FontData::load_bitmap_font(const String &p_path) { set_font_name(font_name); set_font_style(st_flags); - set_ascent(0, base_size, ascent); - set_descent(0, base_size, height - ascent); + set_cache_ascent(0, base_size, ascent); + set_cache_descent(0, base_size, height - ascent); return OK; } -Error FontData::load_dynamic_font(const String &p_path) { +Error FontFile::load_dynamic_font(const String &p_path) { reset_state(); Vector<uint8_t> data = FileAccess::get_file_as_array(p_path); @@ -1224,7 +1793,7 @@ Error FontData::load_dynamic_font(const String &p_path) { return OK; } -void FontData::set_data_ptr(const uint8_t *p_data, size_t p_size) { +void FontFile::set_data_ptr(const uint8_t *p_data, size_t p_size) { data.clear(); data_ptr = p_data; data_size = p_size; @@ -1238,7 +1807,7 @@ void FontData::set_data_ptr(const uint8_t *p_data, size_t p_size) { } } -void FontData::set_data(const PackedByteArray &p_data) { +void FontFile::set_data(const PackedByteArray &p_data) { data = p_data; data_ptr = data.ptr(); data_size = data.size(); @@ -1252,32 +1821,7 @@ void FontData::set_data(const PackedByteArray &p_data) { } } -void FontData::set_face_index(int64_t p_index) { - ERR_FAIL_COND(p_index < 0); - ERR_FAIL_COND(p_index >= 0x7FFF); - - if (face_index != p_index) { - face_index = p_index; - if (data_ptr != nullptr) { - for (int i = 0; i < cache.size(); i++) { - if (cache[i].is_valid()) { - TS->font_set_face_index(cache[i], face_index); - } - } - } - } -} - -int64_t FontData::get_face_index() const { - return face_index; -} - -int64_t FontData::get_face_count() const { - _ensure_rid(0); - return TS->font_get_face_count(cache[0]); -} - -PackedByteArray FontData::get_data() const { +PackedByteArray FontFile::get_data() const { if (unlikely((size_t)data.size() != data_size)) { PackedByteArray *data_w = const_cast<PackedByteArray *>(&data); data_w->resize(data_size); @@ -1286,37 +1830,22 @@ PackedByteArray FontData::get_data() const { return data; } -void FontData::set_font_name(const String &p_name) { +void FontFile::set_font_name(const String &p_name) { _ensure_rid(0); TS->font_set_name(cache[0], p_name); } -String FontData::get_font_name() const { - _ensure_rid(0); - return TS->font_get_name(cache[0]); -} - -void FontData::set_font_style_name(const String &p_name) { +void FontFile::set_font_style_name(const String &p_name) { _ensure_rid(0); TS->font_set_style_name(cache[0], p_name); } -String FontData::get_font_style_name() const { - _ensure_rid(0); - return TS->font_get_style_name(cache[0]); -} - -void FontData::set_font_style(uint32_t p_style) { +void FontFile::set_font_style(uint32_t p_style) { _ensure_rid(0); TS->font_set_style(cache[0], p_style); } -uint32_t FontData::get_font_style() const { - _ensure_rid(0); - return TS->font_get_style(cache[0]); -} - -void FontData::set_antialiased(bool p_antialiased) { +void FontFile::set_antialiased(bool p_antialiased) { if (antialiased != p_antialiased) { antialiased = p_antialiased; for (int i = 0; i < cache.size(); i++) { @@ -1327,11 +1856,11 @@ void FontData::set_antialiased(bool p_antialiased) { } } -bool FontData::is_antialiased() const { +bool FontFile::is_antialiased() const { return antialiased; } -void FontData::set_generate_mipmaps(bool p_generate_mipmaps) { +void FontFile::set_generate_mipmaps(bool p_generate_mipmaps) { if (mipmaps != p_generate_mipmaps) { mipmaps = p_generate_mipmaps; for (int i = 0; i < cache.size(); i++) { @@ -1342,11 +1871,11 @@ void FontData::set_generate_mipmaps(bool p_generate_mipmaps) { } } -bool FontData::get_generate_mipmaps() const { +bool FontFile::get_generate_mipmaps() const { return mipmaps; } -void FontData::set_multichannel_signed_distance_field(bool p_msdf) { +void FontFile::set_multichannel_signed_distance_field(bool p_msdf) { if (msdf != p_msdf) { msdf = p_msdf; for (int i = 0; i < cache.size(); i++) { @@ -1357,11 +1886,11 @@ void FontData::set_multichannel_signed_distance_field(bool p_msdf) { } } -bool FontData::is_multichannel_signed_distance_field() const { +bool FontFile::is_multichannel_signed_distance_field() const { return msdf; } -void FontData::set_msdf_pixel_range(int p_msdf_pixel_range) { +void FontFile::set_msdf_pixel_range(int p_msdf_pixel_range) { if (msdf_pixel_range != p_msdf_pixel_range) { msdf_pixel_range = p_msdf_pixel_range; for (int i = 0; i < cache.size(); i++) { @@ -1372,11 +1901,11 @@ void FontData::set_msdf_pixel_range(int p_msdf_pixel_range) { } } -int FontData::get_msdf_pixel_range() const { +int FontFile::get_msdf_pixel_range() const { return msdf_pixel_range; } -void FontData::set_msdf_size(int p_msdf_size) { +void FontFile::set_msdf_size(int p_msdf_size) { if (msdf_size != p_msdf_size) { msdf_size = p_msdf_size; for (int i = 0; i < cache.size(); i++) { @@ -1387,11 +1916,11 @@ void FontData::set_msdf_size(int p_msdf_size) { } } -int FontData::get_msdf_size() const { +int FontFile::get_msdf_size() const { return msdf_size; } -void FontData::set_fixed_size(int p_fixed_size) { +void FontFile::set_fixed_size(int p_fixed_size) { if (fixed_size != p_fixed_size) { fixed_size = p_fixed_size; for (int i = 0; i < cache.size(); i++) { @@ -1402,11 +1931,11 @@ void FontData::set_fixed_size(int p_fixed_size) { } } -int FontData::get_fixed_size() const { +int FontFile::get_fixed_size() const { return fixed_size; } -void FontData::set_force_autohinter(bool p_force_autohinter) { +void FontFile::set_force_autohinter(bool p_force_autohinter) { if (force_autohinter != p_force_autohinter) { force_autohinter = p_force_autohinter; for (int i = 0; i < cache.size(); i++) { @@ -1417,11 +1946,11 @@ void FontData::set_force_autohinter(bool p_force_autohinter) { } } -bool FontData::is_force_autohinter() const { +bool FontFile::is_force_autohinter() const { return force_autohinter; } -void FontData::set_hinting(TextServer::Hinting p_hinting) { +void FontFile::set_hinting(TextServer::Hinting p_hinting) { if (hinting != p_hinting) { hinting = p_hinting; for (int i = 0; i < cache.size(); i++) { @@ -1432,11 +1961,11 @@ void FontData::set_hinting(TextServer::Hinting p_hinting) { } } -TextServer::Hinting FontData::get_hinting() const { +TextServer::Hinting FontFile::get_hinting() const { return hinting; } -void FontData::set_subpixel_positioning(TextServer::SubpixelPositioning p_subpixel) { +void FontFile::set_subpixel_positioning(TextServer::SubpixelPositioning p_subpixel) { if (subpixel_positioning != p_subpixel) { subpixel_positioning = p_subpixel; for (int i = 0; i < cache.size(); i++) { @@ -1447,41 +1976,11 @@ void FontData::set_subpixel_positioning(TextServer::SubpixelPositioning p_subpix } } -TextServer::SubpixelPositioning FontData::get_subpixel_positioning() const { +TextServer::SubpixelPositioning FontFile::get_subpixel_positioning() const { return subpixel_positioning; } -void FontData::set_embolden(float p_strength) { - if (embolden != p_strength) { - embolden = p_strength; - for (int i = 0; i < cache.size(); i++) { - _ensure_rid(i); - TS->font_set_embolden(cache[i], embolden); - } - emit_changed(); - } -} - -float FontData::get_embolden() const { - return embolden; -} - -void FontData::set_transform(Transform2D p_transform) { - if (transform != p_transform) { - transform = p_transform; - for (int i = 0; i < cache.size(); i++) { - _ensure_rid(i); - TS->font_set_transform(cache[i], transform); - } - emit_changed(); - } -} - -Transform2D FontData::get_transform() const { - return transform; -} - -void FontData::set_oversampling(real_t p_oversampling) { +void FontFile::set_oversampling(real_t p_oversampling) { if (oversampling != p_oversampling) { oversampling = p_oversampling; for (int i = 0; i < cache.size(); i++) { @@ -1492,17 +1991,20 @@ void FontData::set_oversampling(real_t p_oversampling) { } } -real_t FontData::get_oversampling() const { +real_t FontFile::get_oversampling() const { return oversampling; } -RID FontData::find_cache(const Dictionary &p_variation_coordinates) const { +RID FontFile::find_variation(const Dictionary &p_variation_coordinates, int p_face_index, float p_strength, Transform2D p_transform) const { // Find existing variation cache. const Dictionary &supported_coords = get_supported_variation_list(); for (int i = 0; i < cache.size(); i++) { if (cache[i].is_valid()) { const Dictionary &cache_var = TS->font_get_variation_coordinates(cache[i]); bool match = true; + match = match && (TS->font_get_face_index(cache[i]) == p_face_index); + match = match && (TS->font_get_embolden(cache[i]) == p_strength); + match = match && (TS->font_get_transform(cache[i]) == p_transform); for (const Variant *V = supported_coords.next(nullptr); V && match; V = supported_coords.next(V)) { const Vector3 &def = supported_coords[*V]; @@ -1538,19 +2040,28 @@ RID FontData::find_cache(const Dictionary &p_variation_coordinates) const { int idx = cache.size(); _ensure_rid(idx); TS->font_set_variation_coordinates(cache[idx], p_variation_coordinates); + TS->font_set_face_index(cache[idx], p_face_index); + TS->font_set_embolden(cache[idx], p_strength); + TS->font_set_transform(cache[idx], p_transform); return cache[idx]; } -int FontData::get_cache_count() const { +RID FontFile::_get_rid() const { + _ensure_rid(0); + return cache[0]; +} + +int FontFile::get_cache_count() const { return cache.size(); } -void FontData::clear_cache() { +void FontFile::clear_cache() { _clear_cache(); cache.clear(); + emit_changed(); } -void FontData::remove_cache(int p_cache_index) { +void FontFile::remove_cache(int p_cache_index) { ERR_FAIL_INDEX(p_cache_index, cache.size()); if (cache[p_cache_index].is_valid()) { TS->free_rid(cache.write[p_cache_index]); @@ -1559,952 +2070,607 @@ void FontData::remove_cache(int p_cache_index) { emit_changed(); } -Array FontData::get_size_cache_list(int p_cache_index) const { +Array FontFile::get_size_cache_list(int p_cache_index) const { ERR_FAIL_COND_V(p_cache_index < 0, Array()); _ensure_rid(p_cache_index); return TS->font_get_size_cache_list(cache[p_cache_index]); } -void FontData::clear_size_cache(int p_cache_index) { +void FontFile::clear_size_cache(int p_cache_index) { ERR_FAIL_COND(p_cache_index < 0); _ensure_rid(p_cache_index); TS->font_clear_size_cache(cache[p_cache_index]); } -void FontData::remove_size_cache(int p_cache_index, const Vector2i &p_size) { +void FontFile::remove_size_cache(int p_cache_index, const Vector2i &p_size) { ERR_FAIL_COND(p_cache_index < 0); _ensure_rid(p_cache_index); TS->font_remove_size_cache(cache[p_cache_index], p_size); } -void FontData::set_variation_coordinates(int p_cache_index, const Dictionary &p_variation_coordinates) { +void FontFile::set_variation_coordinates(int p_cache_index, const Dictionary &p_variation_coordinates) { ERR_FAIL_COND(p_cache_index < 0); _ensure_rid(p_cache_index); TS->font_set_variation_coordinates(cache[p_cache_index], p_variation_coordinates); - emit_changed(); } -Dictionary FontData::get_variation_coordinates(int p_cache_index) const { +Dictionary FontFile::get_variation_coordinates(int p_cache_index) const { ERR_FAIL_COND_V(p_cache_index < 0, Dictionary()); _ensure_rid(p_cache_index); return TS->font_get_variation_coordinates(cache[p_cache_index]); } -void FontData::set_ascent(int p_cache_index, int p_size, real_t p_ascent) { +void FontFile::set_embolden(int p_cache_index, float p_strength) { + ERR_FAIL_COND(p_cache_index < 0); + _ensure_rid(p_cache_index); + TS->font_set_embolden(cache[p_cache_index], p_strength); +} + +float FontFile::get_embolden(int p_cache_index) const { + ERR_FAIL_COND_V(p_cache_index < 0, 0.f); + _ensure_rid(p_cache_index); + return TS->font_get_embolden(cache[p_cache_index]); +} + +void FontFile::set_transform(int p_cache_index, Transform2D p_transform) { + ERR_FAIL_COND(p_cache_index < 0); + _ensure_rid(p_cache_index); + TS->font_set_transform(cache[p_cache_index], p_transform); +} + +Transform2D FontFile::get_transform(int p_cache_index) const { + ERR_FAIL_COND_V(p_cache_index < 0, Transform2D()); + _ensure_rid(p_cache_index); + return TS->font_get_transform(cache[p_cache_index]); +} + +void FontFile::set_face_index(int p_cache_index, int64_t p_index) { + ERR_FAIL_COND(p_cache_index < 0); + ERR_FAIL_COND(p_index < 0); + ERR_FAIL_COND(p_index >= 0x7FFF); + + _ensure_rid(p_cache_index); + TS->font_set_face_index(cache[p_cache_index], p_index); +} + +int64_t FontFile::get_face_index(int p_cache_index) const { + ERR_FAIL_COND_V(p_cache_index < 0, 0); + _ensure_rid(p_cache_index); + return TS->font_get_face_index(cache[p_cache_index]); +} + +void FontFile::set_cache_ascent(int p_cache_index, int p_size, real_t p_ascent) { ERR_FAIL_COND(p_cache_index < 0); _ensure_rid(p_cache_index); TS->font_set_ascent(cache[p_cache_index], p_size, p_ascent); } -real_t FontData::get_ascent(int p_cache_index, int p_size) const { +real_t FontFile::get_cache_ascent(int p_cache_index, int p_size) const { ERR_FAIL_COND_V(p_cache_index < 0, 0.f); _ensure_rid(p_cache_index); return TS->font_get_ascent(cache[p_cache_index], p_size); } -void FontData::set_descent(int p_cache_index, int p_size, real_t p_descent) { +void FontFile::set_cache_descent(int p_cache_index, int p_size, real_t p_descent) { ERR_FAIL_COND(p_cache_index < 0); _ensure_rid(p_cache_index); TS->font_set_descent(cache[p_cache_index], p_size, p_descent); } -real_t FontData::get_descent(int p_cache_index, int p_size) const { +real_t FontFile::get_cache_descent(int p_cache_index, int p_size) const { ERR_FAIL_COND_V(p_cache_index < 0, 0.f); _ensure_rid(p_cache_index); return TS->font_get_descent(cache[p_cache_index], p_size); } -void FontData::set_underline_position(int p_cache_index, int p_size, real_t p_underline_position) { +void FontFile::set_cache_underline_position(int p_cache_index, int p_size, real_t p_underline_position) { ERR_FAIL_COND(p_cache_index < 0); _ensure_rid(p_cache_index); TS->font_set_underline_position(cache[p_cache_index], p_size, p_underline_position); } -real_t FontData::get_underline_position(int p_cache_index, int p_size) const { +real_t FontFile::get_cache_underline_position(int p_cache_index, int p_size) const { ERR_FAIL_COND_V(p_cache_index < 0, 0.f); _ensure_rid(p_cache_index); return TS->font_get_underline_position(cache[p_cache_index], p_size); } -void FontData::set_underline_thickness(int p_cache_index, int p_size, real_t p_underline_thickness) { +void FontFile::set_cache_underline_thickness(int p_cache_index, int p_size, real_t p_underline_thickness) { ERR_FAIL_COND(p_cache_index < 0); _ensure_rid(p_cache_index); TS->font_set_underline_thickness(cache[p_cache_index], p_size, p_underline_thickness); } -real_t FontData::get_underline_thickness(int p_cache_index, int p_size) const { +real_t FontFile::get_cache_underline_thickness(int p_cache_index, int p_size) const { ERR_FAIL_COND_V(p_cache_index < 0, 0.f); _ensure_rid(p_cache_index); return TS->font_get_underline_thickness(cache[p_cache_index], p_size); } -void FontData::set_scale(int p_cache_index, int p_size, real_t p_scale) { +void FontFile::set_cache_scale(int p_cache_index, int p_size, real_t p_scale) { ERR_FAIL_COND(p_cache_index < 0); _ensure_rid(p_cache_index); TS->font_set_scale(cache[p_cache_index], p_size, p_scale); } -real_t FontData::get_scale(int p_cache_index, int p_size) const { +real_t FontFile::get_cache_scale(int p_cache_index, int p_size) const { ERR_FAIL_COND_V(p_cache_index < 0, 0.f); _ensure_rid(p_cache_index); return TS->font_get_scale(cache[p_cache_index], p_size); } -void FontData::set_spacing(int p_cache_index, int p_size, TextServer::SpacingType p_spacing, int p_value) { - ERR_FAIL_COND(p_cache_index < 0); - _ensure_rid(p_cache_index); - TS->font_set_spacing(cache[p_cache_index], p_size, p_spacing, p_value); -} - -int FontData::get_spacing(int p_cache_index, int p_size, TextServer::SpacingType p_spacing) const { - ERR_FAIL_COND_V(p_cache_index < 0, 0); - _ensure_rid(p_cache_index); - return TS->font_get_spacing(cache[p_cache_index], p_size, p_spacing); -} - -int FontData::get_texture_count(int p_cache_index, const Vector2i &p_size) const { +int FontFile::get_texture_count(int p_cache_index, const Vector2i &p_size) const { ERR_FAIL_COND_V(p_cache_index < 0, 0); _ensure_rid(p_cache_index); return TS->font_get_texture_count(cache[p_cache_index], p_size); } -void FontData::clear_textures(int p_cache_index, const Vector2i &p_size) { +void FontFile::clear_textures(int p_cache_index, const Vector2i &p_size) { ERR_FAIL_COND(p_cache_index < 0); _ensure_rid(p_cache_index); TS->font_clear_textures(cache[p_cache_index], p_size); } -void FontData::remove_texture(int p_cache_index, const Vector2i &p_size, int p_texture_index) { +void FontFile::remove_texture(int p_cache_index, const Vector2i &p_size, int p_texture_index) { ERR_FAIL_COND(p_cache_index < 0); _ensure_rid(p_cache_index); TS->font_remove_texture(cache[p_cache_index], p_size, p_texture_index); } -void FontData::set_texture_image(int p_cache_index, const Vector2i &p_size, int p_texture_index, const Ref<Image> &p_image) { +void FontFile::set_texture_image(int p_cache_index, const Vector2i &p_size, int p_texture_index, const Ref<Image> &p_image) { ERR_FAIL_COND(p_cache_index < 0); _ensure_rid(p_cache_index); TS->font_set_texture_image(cache[p_cache_index], p_size, p_texture_index, p_image); } -Ref<Image> FontData::get_texture_image(int p_cache_index, const Vector2i &p_size, int p_texture_index) const { +Ref<Image> FontFile::get_texture_image(int p_cache_index, const Vector2i &p_size, int p_texture_index) const { ERR_FAIL_COND_V(p_cache_index < 0, Ref<Image>()); _ensure_rid(p_cache_index); return TS->font_get_texture_image(cache[p_cache_index], p_size, p_texture_index); } -void FontData::set_texture_offsets(int p_cache_index, const Vector2i &p_size, int p_texture_index, const PackedInt32Array &p_offset) { +void FontFile::set_texture_offsets(int p_cache_index, const Vector2i &p_size, int p_texture_index, const PackedInt32Array &p_offset) { ERR_FAIL_COND(p_cache_index < 0); _ensure_rid(p_cache_index); TS->font_set_texture_offsets(cache[p_cache_index], p_size, p_texture_index, p_offset); } -PackedInt32Array FontData::get_texture_offsets(int p_cache_index, const Vector2i &p_size, int p_texture_index) const { +PackedInt32Array FontFile::get_texture_offsets(int p_cache_index, const Vector2i &p_size, int p_texture_index) const { ERR_FAIL_COND_V(p_cache_index < 0, PackedInt32Array()); _ensure_rid(p_cache_index); return TS->font_get_texture_offsets(cache[p_cache_index], p_size, p_texture_index); } -Array FontData::get_glyph_list(int p_cache_index, const Vector2i &p_size) const { +Array FontFile::get_glyph_list(int p_cache_index, const Vector2i &p_size) const { ERR_FAIL_COND_V(p_cache_index < 0, Array()); _ensure_rid(p_cache_index); return TS->font_get_glyph_list(cache[p_cache_index], p_size); } -void FontData::clear_glyphs(int p_cache_index, const Vector2i &p_size) { +void FontFile::clear_glyphs(int p_cache_index, const Vector2i &p_size) { ERR_FAIL_COND(p_cache_index < 0); _ensure_rid(p_cache_index); TS->font_clear_glyphs(cache[p_cache_index], p_size); } -void FontData::remove_glyph(int p_cache_index, const Vector2i &p_size, int32_t p_glyph) { +void FontFile::remove_glyph(int p_cache_index, const Vector2i &p_size, int32_t p_glyph) { ERR_FAIL_COND(p_cache_index < 0); _ensure_rid(p_cache_index); TS->font_remove_glyph(cache[p_cache_index], p_size, p_glyph); } -void FontData::set_glyph_advance(int p_cache_index, int p_size, int32_t p_glyph, const Vector2 &p_advance) { +void FontFile::set_glyph_advance(int p_cache_index, int p_size, int32_t p_glyph, const Vector2 &p_advance) { ERR_FAIL_COND(p_cache_index < 0); _ensure_rid(p_cache_index); TS->font_set_glyph_advance(cache[p_cache_index], p_size, p_glyph, p_advance); } -Vector2 FontData::get_glyph_advance(int p_cache_index, int p_size, int32_t p_glyph) const { +Vector2 FontFile::get_glyph_advance(int p_cache_index, int p_size, int32_t p_glyph) const { ERR_FAIL_COND_V(p_cache_index < 0, Vector2()); _ensure_rid(p_cache_index); return TS->font_get_glyph_advance(cache[p_cache_index], p_size, p_glyph); } -void FontData::set_glyph_offset(int p_cache_index, const Vector2i &p_size, int32_t p_glyph, const Vector2 &p_offset) { +void FontFile::set_glyph_offset(int p_cache_index, const Vector2i &p_size, int32_t p_glyph, const Vector2 &p_offset) { ERR_FAIL_COND(p_cache_index < 0); _ensure_rid(p_cache_index); TS->font_set_glyph_offset(cache[p_cache_index], p_size, p_glyph, p_offset); } -Vector2 FontData::get_glyph_offset(int p_cache_index, const Vector2i &p_size, int32_t p_glyph) const { +Vector2 FontFile::get_glyph_offset(int p_cache_index, const Vector2i &p_size, int32_t p_glyph) const { ERR_FAIL_COND_V(p_cache_index < 0, Vector2()); _ensure_rid(p_cache_index); return TS->font_get_glyph_offset(cache[p_cache_index], p_size, p_glyph); } -void FontData::set_glyph_size(int p_cache_index, const Vector2i &p_size, int32_t p_glyph, const Vector2 &p_gl_size) { +void FontFile::set_glyph_size(int p_cache_index, const Vector2i &p_size, int32_t p_glyph, const Vector2 &p_gl_size) { ERR_FAIL_COND(p_cache_index < 0); _ensure_rid(p_cache_index); TS->font_set_glyph_size(cache[p_cache_index], p_size, p_glyph, p_gl_size); } -Vector2 FontData::get_glyph_size(int p_cache_index, const Vector2i &p_size, int32_t p_glyph) const { +Vector2 FontFile::get_glyph_size(int p_cache_index, const Vector2i &p_size, int32_t p_glyph) const { ERR_FAIL_COND_V(p_cache_index < 0, Vector2()); _ensure_rid(p_cache_index); return TS->font_get_glyph_size(cache[p_cache_index], p_size, p_glyph); } -void FontData::set_glyph_uv_rect(int p_cache_index, const Vector2i &p_size, int32_t p_glyph, const Rect2 &p_uv_rect) { +void FontFile::set_glyph_uv_rect(int p_cache_index, const Vector2i &p_size, int32_t p_glyph, const Rect2 &p_uv_rect) { ERR_FAIL_COND(p_cache_index < 0); _ensure_rid(p_cache_index); TS->font_set_glyph_uv_rect(cache[p_cache_index], p_size, p_glyph, p_uv_rect); } -Rect2 FontData::get_glyph_uv_rect(int p_cache_index, const Vector2i &p_size, int32_t p_glyph) const { +Rect2 FontFile::get_glyph_uv_rect(int p_cache_index, const Vector2i &p_size, int32_t p_glyph) const { ERR_FAIL_COND_V(p_cache_index < 0, Rect2()); _ensure_rid(p_cache_index); return TS->font_get_glyph_uv_rect(cache[p_cache_index], p_size, p_glyph); } -void FontData::set_glyph_texture_idx(int p_cache_index, const Vector2i &p_size, int32_t p_glyph, int p_texture_idx) { +void FontFile::set_glyph_texture_idx(int p_cache_index, const Vector2i &p_size, int32_t p_glyph, int p_texture_idx) { ERR_FAIL_COND(p_cache_index < 0); _ensure_rid(p_cache_index); TS->font_set_glyph_texture_idx(cache[p_cache_index], p_size, p_glyph, p_texture_idx); } -int FontData::get_glyph_texture_idx(int p_cache_index, const Vector2i &p_size, int32_t p_glyph) const { +int FontFile::get_glyph_texture_idx(int p_cache_index, const Vector2i &p_size, int32_t p_glyph) const { ERR_FAIL_COND_V(p_cache_index < 0, 0); _ensure_rid(p_cache_index); return TS->font_get_glyph_texture_idx(cache[p_cache_index], p_size, p_glyph); } -Array FontData::get_kerning_list(int p_cache_index, int p_size) const { +Array FontFile::get_kerning_list(int p_cache_index, int p_size) const { ERR_FAIL_COND_V(p_cache_index < 0, Array()); _ensure_rid(p_cache_index); return TS->font_get_kerning_list(cache[p_cache_index], p_size); } -void FontData::clear_kerning_map(int p_cache_index, int p_size) { +void FontFile::clear_kerning_map(int p_cache_index, int p_size) { ERR_FAIL_COND(p_cache_index < 0); _ensure_rid(p_cache_index); TS->font_clear_kerning_map(cache[p_cache_index], p_size); } -void FontData::remove_kerning(int p_cache_index, int p_size, const Vector2i &p_glyph_pair) { +void FontFile::remove_kerning(int p_cache_index, int p_size, const Vector2i &p_glyph_pair) { ERR_FAIL_COND(p_cache_index < 0); _ensure_rid(p_cache_index); TS->font_remove_kerning(cache[p_cache_index], p_size, p_glyph_pair); } -void FontData::set_kerning(int p_cache_index, int p_size, const Vector2i &p_glyph_pair, const Vector2 &p_kerning) { +void FontFile::set_kerning(int p_cache_index, int p_size, const Vector2i &p_glyph_pair, const Vector2 &p_kerning) { ERR_FAIL_COND(p_cache_index < 0); _ensure_rid(p_cache_index); TS->font_set_kerning(cache[p_cache_index], p_size, p_glyph_pair, p_kerning); } -Vector2 FontData::get_kerning(int p_cache_index, int p_size, const Vector2i &p_glyph_pair) const { +Vector2 FontFile::get_kerning(int p_cache_index, int p_size, const Vector2i &p_glyph_pair) const { ERR_FAIL_COND_V(p_cache_index < 0, Vector2()); _ensure_rid(p_cache_index); return TS->font_get_kerning(cache[p_cache_index], p_size, p_glyph_pair); } -void FontData::render_range(int p_cache_index, const Vector2i &p_size, char32_t p_start, char32_t p_end) { +void FontFile::render_range(int p_cache_index, const Vector2i &p_size, char32_t p_start, char32_t p_end) { ERR_FAIL_COND(p_cache_index < 0); _ensure_rid(p_cache_index); TS->font_render_range(cache[p_cache_index], p_size, p_start, p_end); } -void FontData::render_glyph(int p_cache_index, const Vector2i &p_size, int32_t p_index) { +void FontFile::render_glyph(int p_cache_index, const Vector2i &p_size, int32_t p_index) { ERR_FAIL_COND(p_cache_index < 0); _ensure_rid(p_cache_index); TS->font_render_glyph(cache[p_cache_index], p_size, p_index); } -RID FontData::get_cache_rid(int p_cache_index) const { - ERR_FAIL_COND_V(p_cache_index < 0, RID()); - _ensure_rid(p_cache_index); - return cache[p_cache_index]; -} - -bool FontData::is_language_supported(const String &p_language) const { - _ensure_rid(0); - return TS->font_is_language_supported(cache[0], p_language); -} - -void FontData::set_language_support_override(const String &p_language, bool p_supported) { +void FontFile::set_language_support_override(const String &p_language, bool p_supported) { _ensure_rid(0); TS->font_set_language_support_override(cache[0], p_language, p_supported); } -bool FontData::get_language_support_override(const String &p_language) const { +bool FontFile::get_language_support_override(const String &p_language) const { _ensure_rid(0); return TS->font_get_language_support_override(cache[0], p_language); } -void FontData::remove_language_support_override(const String &p_language) { +void FontFile::remove_language_support_override(const String &p_language) { _ensure_rid(0); TS->font_remove_language_support_override(cache[0], p_language); } -Vector<String> FontData::get_language_support_overrides() const { +Vector<String> FontFile::get_language_support_overrides() const { _ensure_rid(0); return TS->font_get_language_support_overrides(cache[0]); } -bool FontData::is_script_supported(const String &p_script) const { - _ensure_rid(0); - return TS->font_is_script_supported(cache[0], p_script); -} - -void FontData::set_script_support_override(const String &p_script, bool p_supported) { +void FontFile::set_script_support_override(const String &p_script, bool p_supported) { _ensure_rid(0); TS->font_set_script_support_override(cache[0], p_script, p_supported); } -bool FontData::get_script_support_override(const String &p_script) const { +bool FontFile::get_script_support_override(const String &p_script) const { _ensure_rid(0); return TS->font_get_script_support_override(cache[0], p_script); } -void FontData::remove_script_support_override(const String &p_script) { +void FontFile::remove_script_support_override(const String &p_script) { _ensure_rid(0); TS->font_remove_script_support_override(cache[0], p_script); } -Vector<String> FontData::get_script_support_overrides() const { +Vector<String> FontFile::get_script_support_overrides() const { _ensure_rid(0); return TS->font_get_script_support_overrides(cache[0]); } -void FontData::set_opentype_feature_overrides(const Dictionary &p_overrides) { +void FontFile::set_opentype_feature_overrides(const Dictionary &p_overrides) { _ensure_rid(0); TS->font_set_opentype_feature_overrides(cache[0], p_overrides); } -Dictionary FontData::get_opentype_feature_overrides() const { +Dictionary FontFile::get_opentype_feature_overrides() const { _ensure_rid(0); return TS->font_get_opentype_feature_overrides(cache[0]); } -bool FontData::has_char(char32_t p_char) const { - _ensure_rid(0); - return TS->font_has_char(cache[0], p_char); -} - -String FontData::get_supported_chars() const { - _ensure_rid(0); - return TS->font_get_supported_chars(cache[0]); -} - -int32_t FontData::get_glyph_index(int p_size, char32_t p_char, char32_t p_variation_selector) const { +int32_t FontFile::get_glyph_index(int p_size, char32_t p_char, char32_t p_variation_selector) const { _ensure_rid(0); return TS->font_get_glyph_index(cache[0], p_size, p_char, p_variation_selector); } -Dictionary FontData::get_supported_feature_list() const { - _ensure_rid(0); - return TS->font_supported_feature_list(cache[0]); -} - -Dictionary FontData::get_supported_variation_list() const { - _ensure_rid(0); - return TS->font_supported_variation_list(cache[0]); -} - -FontData::FontData() { +FontFile::FontFile() { /* NOP */ } -FontData::~FontData() { - _clear_cache(); +FontFile::~FontFile() { + reset_state(); } /*************************************************************************/ +/* FontVariation */ +/*************************************************************************/ -void Font::_data_changed() { - for (int i = 0; i < rids.size(); i++) { - rids.write[i] = RID(); - } - emit_changed(); -} - -void Font::_ensure_rid(int p_index) const { - // Find or create cache record. - if (!rids[p_index].is_valid() && data[p_index].is_valid()) { - rids.write[p_index] = data[p_index]->find_cache(variation_coordinates); - } -} +void FontVariation::_bind_methods() { + ClassDB::bind_method(D_METHOD("set_base_font", "font"), &FontVariation::set_base_font); + ClassDB::bind_method(D_METHOD("get_base_font"), &FontVariation::get_base_font); -void Font::_bind_methods() { - ClassDB::bind_method(D_METHOD("add_data", "data"), &Font::add_data); - ClassDB::bind_method(D_METHOD("set_data", "idx", "data"), &Font::set_data); - ClassDB::bind_method(D_METHOD("get_data_count"), &Font::get_data_count); - ClassDB::bind_method(D_METHOD("get_data", "idx"), &Font::get_data); - ClassDB::bind_method(D_METHOD("get_data_rid", "idx"), &Font::get_data_rid); - ClassDB::bind_method(D_METHOD("clear_data"), &Font::clear_data); - ClassDB::bind_method(D_METHOD("remove_data", "idx"), &Font::remove_data); - - ClassDB::bind_method(D_METHOD("set_variation_coordinates", "variation_coordinates"), &Font::set_variation_coordinates); - ClassDB::bind_method(D_METHOD("get_variation_coordinates"), &Font::get_variation_coordinates); - ADD_PROPERTY(PropertyInfo(Variant::DICTIONARY, "variation_coordinates"), "set_variation_coordinates", "get_variation_coordinates"); - - ClassDB::bind_method(D_METHOD("set_spacing", "spacing", "value"), &Font::set_spacing); - ClassDB::bind_method(D_METHOD("get_spacing", "spacing"), &Font::get_spacing); + ClassDB::bind_method(D_METHOD("set_variation_opentype", "coords"), &FontVariation::set_variation_opentype); + ClassDB::bind_method(D_METHOD("get_variation_opentype"), &FontVariation::get_variation_opentype); - ADD_GROUP("Extra Spacing", "spacing"); - ADD_PROPERTYI(PropertyInfo(Variant::INT, "spacing_top", PROPERTY_HINT_NONE, "suffix:px"), "set_spacing", "get_spacing", TextServer::SPACING_TOP); - ADD_PROPERTYI(PropertyInfo(Variant::INT, "spacing_bottom", PROPERTY_HINT_NONE, "suffix:px"), "set_spacing", "get_spacing", TextServer::SPACING_BOTTOM); + ClassDB::bind_method(D_METHOD("set_variation_embolden", "strength"), &FontVariation::set_variation_embolden); + ClassDB::bind_method(D_METHOD("get_variation_embolden"), &FontVariation::get_variation_embolden); - ClassDB::bind_method(D_METHOD("get_height", "size"), &Font::get_height, DEFVAL(DEFAULT_FONT_SIZE)); - ClassDB::bind_method(D_METHOD("get_ascent", "size"), &Font::get_ascent, DEFVAL(DEFAULT_FONT_SIZE)); - ClassDB::bind_method(D_METHOD("get_descent", "size"), &Font::get_descent, DEFVAL(DEFAULT_FONT_SIZE)); - ClassDB::bind_method(D_METHOD("get_underline_position", "size"), &Font::get_underline_position, DEFVAL(DEFAULT_FONT_SIZE)); - ClassDB::bind_method(D_METHOD("get_underline_thickness", "size"), &Font::get_underline_thickness, DEFVAL(DEFAULT_FONT_SIZE)); + ClassDB::bind_method(D_METHOD("set_variation_face_index", "face_index"), &FontVariation::set_variation_face_index); + ClassDB::bind_method(D_METHOD("get_variation_face_index"), &FontVariation::get_variation_face_index); - ClassDB::bind_method(D_METHOD("get_string_size", "text", "size", "alignment", "width", "flags"), &Font::get_string_size, DEFVAL(DEFAULT_FONT_SIZE), DEFVAL(HORIZONTAL_ALIGNMENT_LEFT), DEFVAL(-1), DEFVAL(TextServer::JUSTIFICATION_KASHIDA | TextServer::JUSTIFICATION_WORD_BOUND)); - ClassDB::bind_method(D_METHOD("get_multiline_string_size", "text", "width", "size", "flags"), &Font::get_multiline_string_size, DEFVAL(-1), DEFVAL(DEFAULT_FONT_SIZE), DEFVAL(TextServer::BREAK_MANDATORY | TextServer::BREAK_WORD_BOUND)); + ClassDB::bind_method(D_METHOD("set_variation_transform", "transform"), &FontVariation::set_variation_transform); + ClassDB::bind_method(D_METHOD("get_variation_transform"), &FontVariation::get_variation_transform); - ClassDB::bind_method(D_METHOD("draw_string", "canvas_item", "pos", "text", "alignment", "width", "size", "modulate", "outline_size", "outline_modulate", "flags"), &Font::draw_string, DEFVAL(HORIZONTAL_ALIGNMENT_LEFT), DEFVAL(-1), DEFVAL(DEFAULT_FONT_SIZE), DEFVAL(Color(1, 1, 1)), DEFVAL(0), DEFVAL(Color(1, 1, 1, 0)), DEFVAL(TextServer::JUSTIFICATION_KASHIDA | TextServer::JUSTIFICATION_WORD_BOUND)); - ClassDB::bind_method(D_METHOD("draw_multiline_string", "canvas_item", "pos", "text", "alignment", "width", "max_lines", "size", "modulate", "outline_size", "outline_modulate", "flags"), &Font::draw_multiline_string, DEFVAL(HORIZONTAL_ALIGNMENT_LEFT), DEFVAL(-1), DEFVAL(-1), DEFVAL(DEFAULT_FONT_SIZE), DEFVAL(Color(1, 1, 1)), DEFVAL(0), DEFVAL(Color(1, 1, 1, 0)), DEFVAL(TextServer::BREAK_MANDATORY | TextServer::BREAK_WORD_BOUND | TextServer::JUSTIFICATION_KASHIDA | TextServer::JUSTIFICATION_WORD_BOUND)); + ClassDB::bind_method(D_METHOD("set_opentype_features", "features"), &FontVariation::set_opentype_features); - ClassDB::bind_method(D_METHOD("get_char_size", "char", "next", "size"), &Font::get_char_size, DEFVAL(0), DEFVAL(DEFAULT_FONT_SIZE)); - ClassDB::bind_method(D_METHOD("draw_char", "canvas_item", "pos", "char", "next", "size", "modulate", "outline_size", "outline_modulate"), &Font::draw_char, DEFVAL(0), DEFVAL(DEFAULT_FONT_SIZE), DEFVAL(Color(1, 1, 1)), DEFVAL(0), DEFVAL(Color(1, 1, 1, 0))); + ClassDB::bind_method(D_METHOD("set_spacing", "spacing", "value"), &FontVariation::set_spacing); - ClassDB::bind_method(D_METHOD("has_char", "char"), &Font::has_char); - ClassDB::bind_method(D_METHOD("get_supported_chars"), &Font::get_supported_chars); + ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "base_font", PROPERTY_HINT_RESOURCE_TYPE, "Font"), "set_base_font", "get_base_font"); + ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "fallbacks", PROPERTY_HINT_ARRAY_TYPE, vformat("%s/%s:%s", Variant::OBJECT, PROPERTY_HINT_RESOURCE_TYPE, "Font")), "set_fallbacks", "get_fallbacks"); - ClassDB::bind_method(D_METHOD("update_changes"), &Font::update_changes); + ADD_GROUP("Variation", "variation"); + ADD_PROPERTY(PropertyInfo(Variant::DICTIONARY, "variation_opentype"), "set_variation_opentype", "get_variation_opentype"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "variation_face_index"), "set_variation_face_index", "get_variation_face_index"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "variation_embolden", PROPERTY_HINT_RANGE, "-2,2,0.01"), "set_variation_embolden", "get_variation_embolden"); + ADD_PROPERTY(PropertyInfo(Variant::TRANSFORM2D, "variation_transform", PROPERTY_HINT_NONE, "suffix:px"), "set_variation_transform", "get_variation_transform"); - ClassDB::bind_method(D_METHOD("get_rids"), &Font::get_rids); -} + ADD_GROUP("OpenType Features", "opentype"); + ADD_PROPERTY(PropertyInfo(Variant::DICTIONARY, "opentype_features"), "set_opentype_features", "get_opentype_features"); -bool Font::_set(const StringName &p_name, const Variant &p_value) { - Vector<String> tokens = p_name.operator String().split("/"); -#ifndef DISABLE_DEPRECATED - if (tokens.size() == 1 && tokens[0] == "font_data") { - // Compatibility, DynamicFont main data. - Ref<FontData> fd = p_value; - if (fd.is_valid()) { - add_data(fd); - return true; - } - return false; - } else if (tokens.size() == 2 && tokens[0] == "fallback") { - // Compatibility, DynamicFont fallback data. - Ref<FontData> fd = p_value; - if (fd.is_valid()) { - add_data(fd); - return true; - } - return false; - } else if (tokens.size() == 1 && tokens[0] == "fallback") { - // Compatibility, BitmapFont fallback data. - Ref<Font> f = p_value; - if (f.is_valid()) { - for (int i = 0; i < f->get_data_count(); i++) { - add_data(f->get_data(i)); - } - return true; - } - return false; - } -#endif /* DISABLE_DEPRECATED */ - if (tokens.size() == 2 && tokens[0] == "data") { - int idx = tokens[1].to_int(); - Ref<FontData> fd = p_value; - if (fd.is_valid()) { - if (idx == data.size()) { - add_data(fd); - return true; - } else if (idx >= 0 && idx < data.size()) { - set_data(idx, fd); - return true; - } else { - return false; - } - } else if (idx >= 0 && idx < data.size()) { - remove_data(idx); - return true; - } - } - return false; + ADD_GROUP("Extra Spacing", "spacing"); + ADD_PROPERTYI(PropertyInfo(Variant::INT, "spacing_glyph", PROPERTY_HINT_NONE, "suffix:px"), "set_spacing", "get_spacing", TextServer::SPACING_GLYPH); + ADD_PROPERTYI(PropertyInfo(Variant::INT, "spacing_space", PROPERTY_HINT_NONE, "suffix:px"), "set_spacing", "get_spacing", TextServer::SPACING_SPACE); + ADD_PROPERTYI(PropertyInfo(Variant::INT, "spacing_top", PROPERTY_HINT_NONE, "suffix:px"), "set_spacing", "get_spacing", TextServer::SPACING_TOP); + ADD_PROPERTYI(PropertyInfo(Variant::INT, "spacing_bottom", PROPERTY_HINT_NONE, "suffix:px"), "set_spacing", "get_spacing", TextServer::SPACING_BOTTOM); } -bool Font::_get(const StringName &p_name, Variant &r_ret) const { - Vector<String> tokens = p_name.operator String().split("/"); - if (tokens.size() == 2 && tokens[0] == "data") { - int idx = tokens[1].to_int(); +void FontVariation::_update_rids() const { + Ref<Font> f = _get_base_font_or_default(); - if (idx == data.size()) { - r_ret = Ref<FontData>(); - return true; - } else if (idx >= 0 && idx < data.size()) { - r_ret = get_data(idx); - return true; + rids.clear(); + if (fallbacks.is_empty() && f.is_valid()) { + RID rid = _get_rid(); + if (rid.is_valid()) { + rids.push_back(rid); } - } - return false; -} - -void Font::_get_property_list(List<PropertyInfo> *p_list) const { - for (int i = 0; i < data.size(); i++) { - p_list->push_back(PropertyInfo(Variant::OBJECT, "data/" + itos(i), PROPERTY_HINT_RESOURCE_TYPE, "FontData")); + const TypedArray<Font> &base_fallbacks = f->get_fallbacks(); + for (int i = 0; i < base_fallbacks.size(); i++) { + _update_rids_fb(base_fallbacks[i], 0); + } + } else { + _update_rids_fb(const_cast<FontVariation *>(this), 0); } - p_list->push_back(PropertyInfo(Variant::OBJECT, "data/" + itos(data.size()), PROPERTY_HINT_RESOURCE_TYPE, "FontData")); + dirty_rids = false; } -void Font::reset_state() { - for (int i = 0; i < data.size(); i++) { - if (data[i].is_valid()) { - data.write[i]->connect(SNAME("changed"), callable_mp(this, &Font::_data_changed), varray(), CONNECT_REFERENCE_COUNTED); - } +void FontVariation::reset_state() { + if (base_font.is_valid()) { + base_font->disconnect(CoreStringNames::get_singleton()->changed, callable_mp(reinterpret_cast<Font *>(this), &Font::_invalidate_rids)); + base_font.unref(); } - cache.clear(); - cache_wrap.clear(); - data.clear(); - rids.clear(); - - variation_coordinates.clear(); - spacing_bottom = 0; - spacing_top = 0; -} -Dictionary Font::get_feature_list() const { - Dictionary out; - for (int i = 0; i < data.size(); i++) { - Dictionary data_ftrs = data[i]->get_supported_feature_list(); - for (const Variant *ftr = data_ftrs.next(nullptr); ftr != nullptr; ftr = data_ftrs.next(ftr)) { - out[*ftr] = data_ftrs[*ftr]; - } + if (theme_font.is_valid()) { + theme_font->disconnect(CoreStringNames::get_singleton()->changed, callable_mp(reinterpret_cast<Font *>(this), &Font::_invalidate_rids)); + theme_font.unref(); } - return out; -} -void Font::add_data(const Ref<FontData> &p_data) { - ERR_FAIL_COND(p_data.is_null()); - data.push_back(p_data); - rids.push_back(RID()); + variation = Variation(); + opentype_features = Dictionary(); - if (data[data.size() - 1].is_valid()) { - data.write[data.size() - 1]->connect(SNAME("changed"), callable_mp(this, &Font::_data_changed), varray(), CONNECT_REFERENCE_COUNTED); - Dictionary data_var_list = p_data->get_supported_variation_list(); - for (int j = 0; j < data_var_list.size(); j++) { - int32_t tag = data_var_list.get_key_at_index(j); - Vector3i value = data_var_list.get_value_at_index(j); - if (!variation_coordinates.has(tag) && !variation_coordinates.has(TS->tag_to_name(tag))) { - variation_coordinates[TS->tag_to_name(tag)] = value.z; - } - } + for (int i = 0; i < TextServer::SPACING_MAX; i++) { + extra_spacing[i] = 0; } - cache.clear(); - cache_wrap.clear(); - - emit_changed(); - notify_property_list_changed(); + Font::reset_state(); } -void Font::set_data(int p_idx, const Ref<FontData> &p_data) { - ERR_FAIL_COND(p_data.is_null()); - ERR_FAIL_INDEX(p_idx, data.size()); - - if (data[p_idx].is_valid()) { - data.write[p_idx]->disconnect(SNAME("changed"), callable_mp(this, &Font::_data_changed)); - } - - data.write[p_idx] = p_data; - rids.write[p_idx] = RID(); - Dictionary data_var_list = p_data->get_supported_variation_list(); - for (int j = 0; j < data_var_list.size(); j++) { - int32_t tag = data_var_list.get_key_at_index(j); - Vector3i value = data_var_list.get_value_at_index(j); - if (!variation_coordinates.has(tag) && !variation_coordinates.has(TS->tag_to_name(tag))) { - variation_coordinates[TS->tag_to_name(tag)] = value.z; +void FontVariation::set_base_font(const Ref<Font> &p_font) { + if (base_font != p_font) { + if (base_font.is_valid()) { + base_font->disconnect(CoreStringNames::get_singleton()->changed, callable_mp(reinterpret_cast<Font *>(this), &Font::_invalidate_rids)); } + base_font = p_font; + if (base_font.is_valid()) { + base_font->connect(CoreStringNames::get_singleton()->changed, callable_mp(reinterpret_cast<Font *>(this), &Font::_invalidate_rids), varray(), CONNECT_REFERENCE_COUNTED); + } + _invalidate_rids(); + notify_property_list_changed(); } - - if (data[p_idx].is_valid()) { - data.write[p_idx]->connect(SNAME("changed"), callable_mp(this, &Font::_data_changed), varray(), CONNECT_REFERENCE_COUNTED); - } - - cache.clear(); - cache_wrap.clear(); - - emit_changed(); - notify_property_list_changed(); -} - -int Font::get_data_count() const { - return data.size(); } -Ref<FontData> Font::get_data(int p_idx) const { - ERR_FAIL_INDEX_V(p_idx, data.size(), Ref<FontData>()); - return data[p_idx]; +Ref<Font> FontVariation::get_base_font() const { + return base_font; } -RID Font::get_data_rid(int p_idx) const { - ERR_FAIL_INDEX_V(p_idx, data.size(), RID()); - _ensure_rid(p_idx); - return rids[p_idx]; -} - -void Font::clear_data() { - for (int i = 0; i < data.size(); i++) { - if (data[i].is_valid()) { - data.write[i]->connect(SNAME("changed"), callable_mp(this, &Font::_data_changed), varray(), CONNECT_REFERENCE_COUNTED); - } +Ref<Font> FontVariation::_get_base_font_or_default() const { + if (theme_font.is_valid()) { + theme_font->disconnect(CoreStringNames::get_singleton()->changed, callable_mp(reinterpret_cast<Font *>(const_cast<FontVariation *>(this)), &Font::_invalidate_rids)); + theme_font.unref(); } - data.clear(); - rids.clear(); -} -void Font::remove_data(int p_idx) { - ERR_FAIL_INDEX(p_idx, data.size()); - - if (data[p_idx].is_valid()) { - data.write[p_idx]->disconnect(SNAME("changed"), callable_mp(this, &Font::_data_changed)); + if (base_font.is_valid()) { + return base_font; } - data.remove_at(p_idx); - rids.remove_at(p_idx); - - cache.clear(); - cache_wrap.clear(); + // Check the project-defined Theme resource. + if (Theme::get_project_default().is_valid()) { + List<StringName> theme_types; + Theme::get_project_default()->get_type_dependencies(get_class_name(), StringName(), &theme_types); - emit_changed(); - notify_property_list_changed(); -} + for (const StringName &E : theme_types) { + if (Theme::get_project_default()->has_theme_item(Theme::DATA_TYPE_FONT, "font", E)) { + Ref<Font> f = Theme::get_project_default()->get_theme_item(Theme::DATA_TYPE_FONT, "font", E); + if (f.is_valid()) { + theme_font = f; + theme_font->connect(CoreStringNames::get_singleton()->changed, callable_mp(reinterpret_cast<Font *>(const_cast<FontVariation *>(this)), &Font::_invalidate_rids), varray(), CONNECT_REFERENCE_COUNTED); + } + return f; + } + } + } -void Font::set_variation_coordinates(const Dictionary &p_variation_coordinates) { - _data_changed(); - variation_coordinates = p_variation_coordinates; -} + // Lastly, fall back on the items defined in the default Theme, if they exist. + if (Theme::get_default().is_valid()) { + List<StringName> theme_types; + Theme::get_default()->get_type_dependencies(get_class_name(), StringName(), &theme_types); -Dictionary Font::get_variation_coordinates() const { - return variation_coordinates; -} + for (const StringName &E : theme_types) { + if (Theme::get_default()->has_theme_item(Theme::DATA_TYPE_FONT, "font", E)) { + Ref<Font> f = Theme::get_default()->get_theme_item(Theme::DATA_TYPE_FONT, "font", E); + if (f.is_valid()) { + theme_font = f; + theme_font->connect(CoreStringNames::get_singleton()->changed, callable_mp(reinterpret_cast<Font *>(const_cast<FontVariation *>(this)), &Font::_invalidate_rids), varray(), CONNECT_REFERENCE_COUNTED); + } + return f; + } + } -void Font::set_spacing(TextServer::SpacingType p_spacing, int p_value) { - _data_changed(); - switch (p_spacing) { - case TextServer::SPACING_TOP: { - spacing_top = p_value; - } break; - case TextServer::SPACING_BOTTOM: { - spacing_bottom = p_value; - } break; - default: { - ERR_FAIL_MSG("Invalid spacing type: " + itos(p_spacing)); - } break; + // If they don't exist, use any type to return the default/empty value. + Ref<Font> f = Theme::get_default()->get_theme_item(Theme::DATA_TYPE_FONT, "font", StringName()); + if (f.is_valid()) { + theme_font = f; + theme_font->connect(CoreStringNames::get_singleton()->changed, callable_mp(reinterpret_cast<Font *>(const_cast<FontVariation *>(this)), &Font::_invalidate_rids), varray(), CONNECT_REFERENCE_COUNTED); + } + return f; } -} -int Font::get_spacing(TextServer::SpacingType p_spacing) const { - switch (p_spacing) { - case TextServer::SPACING_TOP: { - return spacing_top; - } break; - case TextServer::SPACING_BOTTOM: { - return spacing_bottom; - } break; - default: { - ERR_FAIL_V_MSG(0, "Invalid spacing type: " + itos(p_spacing)); - } break; - } + return Ref<Font>(); } -real_t Font::get_height(int p_size) const { - real_t ret = 0.f; - for (int i = 0; i < data.size(); i++) { - _ensure_rid(i); - ret = MAX(ret, TS->font_get_ascent(rids[i], p_size) + TS->font_get_descent(rids[i], p_size)); +void FontVariation::set_variation_opentype(const Dictionary &p_coords) { + if (variation.opentype != p_coords) { + variation.opentype = p_coords; + _invalidate_rids(); } - return ret + spacing_bottom + spacing_top; } -real_t Font::get_ascent(int p_size) const { - real_t ret = 0.f; - for (int i = 0; i < data.size(); i++) { - _ensure_rid(i); - ret = MAX(ret, TS->font_get_ascent(rids[i], p_size)); - } - return ret + spacing_top; +Dictionary FontVariation::get_variation_opentype() const { + return variation.opentype; } -real_t Font::get_descent(int p_size) const { - real_t ret = 0.f; - for (int i = 0; i < data.size(); i++) { - _ensure_rid(i); - ret = MAX(ret, TS->font_get_descent(rids[i], p_size)); +void FontVariation::set_variation_embolden(float p_strength) { + if (variation.embolden != p_strength) { + variation.embolden = p_strength; + _invalidate_rids(); } - return ret + spacing_bottom; } -real_t Font::get_underline_position(int p_size) const { - real_t ret = 0.f; - for (int i = 0; i < data.size(); i++) { - _ensure_rid(i); - ret = MAX(ret, TS->font_get_underline_position(rids[i], p_size)); - } - return ret + spacing_top; +float FontVariation::get_variation_embolden() const { + return variation.embolden; } -real_t Font::get_underline_thickness(int p_size) const { - real_t ret = 0.f; - for (int i = 0; i < data.size(); i++) { - _ensure_rid(i); - ret = MAX(ret, TS->font_get_underline_thickness(rids[i], p_size)); +void FontVariation::set_variation_transform(Transform2D p_transform) { + if (variation.transform != p_transform) { + variation.transform = p_transform; + _invalidate_rids(); } - return ret; } -Size2 Font::get_string_size(const String &p_text, int p_size, HorizontalAlignment p_alignment, float p_width, uint16_t p_flags) const { - ERR_FAIL_COND_V(data.is_empty(), Size2()); - - for (int i = 0; i < data.size(); i++) { - _ensure_rid(i); - } - - uint64_t hash = p_text.hash64(); - if (p_alignment == HORIZONTAL_ALIGNMENT_FILL) { - hash = hash_djb2_one_64(hash_murmur3_one_float(p_width), hash); - hash = hash_djb2_one_64(p_flags, hash); - } - hash = hash_djb2_one_64(p_size, hash); - - Ref<TextLine> buffer; - if (cache.has(hash)) { - buffer = cache.get(hash); - } else { - buffer.instantiate(); - buffer->add_string(p_text, Ref<Font>(this), p_size, Dictionary(), TranslationServer::get_singleton()->get_tool_locale()); - cache.insert(hash, buffer); - } - return buffer->get_size(); +Transform2D FontVariation::get_variation_transform() const { + return variation.transform; } -Size2 Font::get_multiline_string_size(const String &p_text, float p_width, int p_size, uint16_t p_flags) const { - ERR_FAIL_COND_V(data.is_empty(), Size2()); - - for (int i = 0; i < data.size(); i++) { - _ensure_rid(i); +void FontVariation::set_variation_face_index(int p_face_index) { + if (variation.face_index != p_face_index) { + variation.face_index = p_face_index; + _invalidate_rids(); } - - uint64_t hash = p_text.hash64(); - uint64_t wrp_hash = hash_djb2_one_64(hash_murmur3_one_float(p_width), hash); - wrp_hash = hash_djb2_one_64(p_flags, wrp_hash); - wrp_hash = hash_djb2_one_64(p_size, wrp_hash); - - Ref<TextParagraph> lines_buffer; - if (cache_wrap.has(wrp_hash)) { - lines_buffer = cache_wrap.get(wrp_hash); - } else { - lines_buffer.instantiate(); - lines_buffer->add_string(p_text, Ref<Font>(this), p_size, Dictionary(), TranslationServer::get_singleton()->get_tool_locale()); - lines_buffer->set_width(p_width); - lines_buffer->set_flags(p_flags); - cache_wrap.insert(wrp_hash, lines_buffer); - } - - Size2 ret; - for (int i = 0; i < lines_buffer->get_line_count(); i++) { - Size2 line_size = lines_buffer->get_line_size(i); - if (lines_buffer->get_orientation() == TextServer::ORIENTATION_HORIZONTAL) { - ret.x = MAX(ret.x, line_size.x); - ret.y += line_size.y; - } else { - ret.y = MAX(ret.y, line_size.y); - ret.x += line_size.x; - } - } - return ret; } -void Font::draw_string(RID p_canvas_item, const Point2 &p_pos, const String &p_text, HorizontalAlignment p_alignment, float p_width, int p_size, const Color &p_modulate, int p_outline_size, const Color &p_outline_modulate, uint16_t p_flags) const { - ERR_FAIL_COND(data.is_empty()); - - for (int i = 0; i < data.size(); i++) { - _ensure_rid(i); - } - - uint64_t hash = p_text.hash64(); - if (p_alignment == HORIZONTAL_ALIGNMENT_FILL) { - hash = hash_djb2_one_64(hash_murmur3_one_float(p_width), hash); - hash = hash_djb2_one_64(p_flags, hash); - } - hash = hash_djb2_one_64(p_size, hash); - - Ref<TextLine> buffer; - if (cache.has(hash)) { - buffer = cache.get(hash); - } else { - buffer.instantiate(); - buffer->add_string(p_text, Ref<Font>(this), p_size, Dictionary(), TranslationServer::get_singleton()->get_tool_locale()); - cache.insert(hash, buffer); - } - - Vector2 ofs = p_pos; - if (buffer->get_orientation() == TextServer::ORIENTATION_HORIZONTAL) { - ofs.y -= buffer->get_line_ascent(); - } else { - ofs.x -= buffer->get_line_ascent(); - } - - buffer->set_width(p_width); - buffer->set_horizontal_alignment(p_alignment); - buffer->set_flags(p_flags); - - if (p_outline_size > 0 && p_outline_modulate.a != 0.0f) { - buffer->draw_outline(p_canvas_item, ofs, p_outline_size, p_outline_modulate); - } - buffer->draw(p_canvas_item, ofs, p_modulate); +int FontVariation::get_variation_face_index() const { + return variation.face_index; } -void Font::draw_multiline_string(RID p_canvas_item, const Point2 &p_pos, const String &p_text, HorizontalAlignment p_alignment, float p_width, int p_max_lines, int p_size, const Color &p_modulate, int p_outline_size, const Color &p_outline_modulate, uint16_t p_flags) const { - ERR_FAIL_COND(data.is_empty()); - - for (int i = 0; i < data.size(); i++) { - _ensure_rid(i); - } - - uint64_t hash = p_text.hash64(); - uint64_t wrp_hash = hash_djb2_one_64(hash_murmur3_one_float(p_width), hash); - wrp_hash = hash_djb2_one_64(p_flags, wrp_hash); - wrp_hash = hash_djb2_one_64(p_size, wrp_hash); - - Ref<TextParagraph> lines_buffer; - if (cache_wrap.has(wrp_hash)) { - lines_buffer = cache_wrap.get(wrp_hash); - } else { - lines_buffer.instantiate(); - lines_buffer->add_string(p_text, Ref<Font>(this), p_size, Dictionary(), TranslationServer::get_singleton()->get_tool_locale()); - lines_buffer->set_width(p_width); - lines_buffer->set_flags(p_flags); - cache_wrap.insert(wrp_hash, lines_buffer); - } - - lines_buffer->set_alignment(p_alignment); - - Vector2 lofs = p_pos; - for (int i = 0; i < lines_buffer->get_line_count(); i++) { - if (lines_buffer->get_orientation() == TextServer::ORIENTATION_HORIZONTAL) { - if (i == 0) { - lofs.y -= lines_buffer->get_line_ascent(0); - } - } else { - if (i == 0) { - lofs.x -= lines_buffer->get_line_ascent(0); - } - } - if (p_width > 0) { - lines_buffer->set_alignment(p_alignment); - } - - if (p_outline_size > 0 && p_outline_modulate.a != 0.0f) { - lines_buffer->draw_line_outline(p_canvas_item, lofs, i, p_outline_size, p_outline_modulate); - } - lines_buffer->draw_line(p_canvas_item, lofs, i, p_modulate); - - Size2 line_size = lines_buffer->get_line_size(i); - if (lines_buffer->get_orientation() == TextServer::ORIENTATION_HORIZONTAL) { - lofs.y += line_size.y; - } else { - lofs.x += line_size.x; - } - - if ((p_max_lines > 0) && (i >= p_max_lines)) { - return; - } +void FontVariation::set_opentype_features(const Dictionary &p_features) { + if (opentype_features != p_features) { + opentype_features = p_features; + _invalidate_rids(); } } -Size2 Font::get_char_size(char32_t p_char, char32_t p_next, int p_size) const { - for (int i = 0; i < data.size(); i++) { - _ensure_rid(i); - if (data[i]->has_char(p_char)) { - int32_t glyph_a = TS->font_get_glyph_index(rids[i], p_size, p_char, 0); - Size2 ret = Size2(TS->font_get_glyph_advance(rids[i], p_size, glyph_a).x, TS->font_get_ascent(rids[i], p_size) + TS->font_get_descent(rids[i], p_size)); - if ((p_next != 0) && data[i]->has_char(p_next)) { - int32_t glyph_b = TS->font_get_glyph_index(rids[i], p_size, p_next, 0); - ret.x -= TS->font_get_kerning(rids[i], p_size, Vector2i(glyph_a, glyph_b)).x; - } - return ret; - } - } - return Size2(); +Dictionary FontVariation::get_opentype_features() const { + return opentype_features; } -real_t Font::draw_char(RID p_canvas_item, const Point2 &p_pos, char32_t p_char, char32_t p_next, int p_size, const Color &p_modulate, int p_outline_size, const Color &p_outline_modulate) const { - for (int i = 0; i < data.size(); i++) { - _ensure_rid(i); - if (data[i]->has_char(p_char)) { - int32_t glyph_a = TS->font_get_glyph_index(rids[i], p_size, p_char, 0); - real_t ret = TS->font_get_glyph_advance(rids[i], p_size, glyph_a).x; - if ((p_next != 0) && data[i]->has_char(p_next)) { - int32_t glyph_b = TS->font_get_glyph_index(rids[i], p_size, p_next, 0); - ret -= TS->font_get_kerning(rids[i], p_size, Vector2i(glyph_a, glyph_b)).x; - } - - if (p_outline_size > 0 && p_outline_modulate.a != 0.0f) { - TS->font_draw_glyph_outline(rids[i], p_canvas_item, p_size, p_outline_size, p_pos, glyph_a, p_outline_modulate); - } - TS->font_draw_glyph(rids[i], p_canvas_item, p_size, p_pos, glyph_a, p_modulate); - return ret; - } +void FontVariation::set_spacing(TextServer::SpacingType p_spacing, int p_value) { + ERR_FAIL_INDEX((int)p_spacing, TextServer::SPACING_MAX); + if (extra_spacing[p_spacing] != p_value) { + extra_spacing[p_spacing] = p_value; + _invalidate_rids(); } - return 0; } -bool Font::has_char(char32_t p_char) const { - for (int i = 0; i < data.size(); i++) { - if (data[i]->has_char(p_char)) { - return true; - } - } - return false; +int FontVariation::get_spacing(TextServer::SpacingType p_spacing) const { + ERR_FAIL_INDEX_V((int)p_spacing, TextServer::SPACING_MAX, 0); + return extra_spacing[p_spacing]; } -String Font::get_supported_chars() const { - String chars; - for (int i = 0; i < data.size(); i++) { - String data_chars = data[i]->get_supported_chars(); - for (int j = 0; j < data_chars.length(); j++) { - if (chars.find_char(data_chars[j]) == -1) { - chars += data_chars[j]; - } - } +RID FontVariation::find_variation(const Dictionary &p_variation_coordinates, int p_face_index, float p_strength, Transform2D p_transform) const { + Ref<Font> f = _get_base_font_or_default(); + if (f.is_valid()) { + return f->find_variation(p_variation_coordinates, p_face_index, p_strength, p_transform); } - return chars; + return RID(); } -Array Font::get_rids() const { - Array _rids; - for (int i = 0; i < data.size(); i++) { - _ensure_rid(i); - if (rids[i].is_valid()) { - _rids.push_back(rids[i]); - } +RID FontVariation::_get_rid() const { + Ref<Font> f = _get_base_font_or_default(); + if (f.is_valid()) { + return f->find_variation(variation.opentype, variation.face_index, variation.embolden, variation.transform); } - return _rids; -} - -void Font::update_changes() { - emit_changed(); + return RID(); } -Font::Font() { - cache.set_capacity(128); - cache_wrap.set_capacity(32); +FontVariation::FontVariation() { + for (int i = 0; i < TextServer::SPACING_MAX; i++) { + extra_spacing[i] = 0; + } } -Font::~Font() { - clear_data(); - cache.clear(); - cache_wrap.clear(); +FontVariation::~FontVariation() { + reset_state(); } diff --git a/scene/resources/font.h b/scene/resources/font.h index 950959e054..40b223b0f5 100644 --- a/scene/resources/font.h +++ b/scene/resources/font.h @@ -37,16 +37,108 @@ #include "scene/resources/texture.h" #include "servers/text_server.h" +class TextLine; +class TextParagraph; + +/*************************************************************************/ +/* Font */ +/*************************************************************************/ + +class Font : public Resource { + GDCLASS(Font, Resource); + + // Shaped string cache. + mutable LRUCache<uint64_t, Ref<TextLine>> cache; + mutable LRUCache<uint64_t, Ref<TextParagraph>> cache_wrap; + +protected: + // Output. + mutable TypedArray<RID> rids; + mutable bool dirty_rids = true; + + // Fallbacks. + static constexpr int MAX_FALLBACK_DEPTH = 64; + TypedArray<Font> fallbacks; + + static void _bind_methods(); + + virtual void _update_rids_fb(const Ref<Font> &p_f, int p_depth) const; + virtual void _update_rids() const; + virtual bool _is_cyclic(const Ref<Font> &p_f, int p_depth) const; + + virtual void reset_state() override; + +public: + virtual void _invalidate_rids(); + + static constexpr int DEFAULT_FONT_SIZE = 16; + + // Fallbacks. + virtual void set_fallbacks(const TypedArray<Font> &p_fallbacks); + virtual TypedArray<Font> get_fallbacks() const; + + // Output. + virtual RID find_variation(const Dictionary &p_variation_coordinates, int p_face_index = 0, float p_strength = 0.0, Transform2D p_transform = Transform2D()) const { return RID(); }; + virtual RID _get_rid() const { return RID(); }; + virtual TypedArray<RID> get_rids() const; + + // Font metrics. + virtual real_t get_height(int p_font_size) const; + virtual real_t get_ascent(int p_font_size) const; + virtual real_t get_descent(int p_font_size) const; + virtual real_t get_underline_position(int p_font_size) const; + virtual real_t get_underline_thickness(int p_font_size) const; + + virtual String get_font_name() const; + virtual String get_font_style_name() const; + virtual uint32_t get_font_style() const; + + virtual int get_spacing(TextServer::SpacingType p_spacing) const { return 0; }; + virtual Dictionary get_opentype_features() const; + + // Drawing string. + virtual void set_cache_capacity(int p_single_line, int p_multi_line); + + virtual Size2 get_string_size(const String &p_text, HorizontalAlignment p_alignment = HORIZONTAL_ALIGNMENT_LEFT, float p_width = -1, int p_font_size = DEFAULT_FONT_SIZE, uint16_t p_flags = TextServer::JUSTIFICATION_KASHIDA | TextServer::JUSTIFICATION_WORD_BOUND, TextServer::Direction p_direction = TextServer::DIRECTION_AUTO, TextServer::Orientation p_orientation = TextServer::ORIENTATION_HORIZONTAL) const; + virtual Size2 get_multiline_string_size(const String &p_text, HorizontalAlignment p_alignment = HORIZONTAL_ALIGNMENT_LEFT, float p_width = -1, int p_font_size = DEFAULT_FONT_SIZE, int p_max_lines = -1, uint16_t p_flags = TextServer::BREAK_MANDATORY | TextServer::BREAK_WORD_BOUND, TextServer::Direction p_direction = TextServer::DIRECTION_AUTO, TextServer::Orientation p_orientation = TextServer::ORIENTATION_HORIZONTAL) const; + + virtual void draw_string(RID p_canvas_item, const Point2 &p_pos, const String &p_text, HorizontalAlignment p_alignment = HORIZONTAL_ALIGNMENT_LEFT, float p_width = -1, int p_font_size = DEFAULT_FONT_SIZE, const Color &p_modulate = Color(1.0, 1.0, 1.0), uint16_t p_flags = TextServer::JUSTIFICATION_KASHIDA | TextServer::JUSTIFICATION_WORD_BOUND, TextServer::Direction p_direction = TextServer::DIRECTION_AUTO, TextServer::Orientation p_orientation = TextServer::ORIENTATION_HORIZONTAL) const; + virtual void draw_multiline_string(RID p_canvas_item, const Point2 &p_pos, const String &p_text, HorizontalAlignment p_alignment = HORIZONTAL_ALIGNMENT_LEFT, float p_width = -1, int p_font_size = DEFAULT_FONT_SIZE, int p_max_lines = -1, const Color &p_modulate = Color(1.0, 1.0, 1.0), uint16_t p_flags = TextServer::BREAK_MANDATORY | TextServer::BREAK_WORD_BOUND | TextServer::JUSTIFICATION_KASHIDA | TextServer::JUSTIFICATION_WORD_BOUND, TextServer::Direction p_direction = TextServer::DIRECTION_AUTO, TextServer::Orientation p_orientation = TextServer::ORIENTATION_HORIZONTAL) const; + + virtual void draw_string_outline(RID p_canvas_item, const Point2 &p_pos, const String &p_text, HorizontalAlignment p_alignment = HORIZONTAL_ALIGNMENT_LEFT, float p_width = -1, int p_font_size = DEFAULT_FONT_SIZE, int p_size = 1, const Color &p_modulate = Color(1.0, 1.0, 1.0), uint16_t p_flags = TextServer::JUSTIFICATION_KASHIDA | TextServer::JUSTIFICATION_WORD_BOUND, TextServer::Direction p_direction = TextServer::DIRECTION_AUTO, TextServer::Orientation p_orientation = TextServer::ORIENTATION_HORIZONTAL) const; + virtual void draw_multiline_string_outline(RID p_canvas_item, const Point2 &p_pos, const String &p_text, HorizontalAlignment p_alignment = HORIZONTAL_ALIGNMENT_LEFT, float p_width = -1, int p_font_size = DEFAULT_FONT_SIZE, int p_max_lines = -1, int p_size = 1, const Color &p_modulate = Color(1.0, 1.0, 1.0), uint16_t p_flags = TextServer::BREAK_MANDATORY | TextServer::BREAK_WORD_BOUND | TextServer::JUSTIFICATION_KASHIDA | TextServer::JUSTIFICATION_WORD_BOUND, TextServer::Direction p_direction = TextServer::DIRECTION_AUTO, TextServer::Orientation p_orientation = TextServer::ORIENTATION_HORIZONTAL) const; + + // Drawing char. + virtual Size2 get_char_size(char32_t p_char, int p_font_size = DEFAULT_FONT_SIZE) const; + virtual real_t draw_char(RID p_canvas_item, const Point2 &p_pos, char32_t p_char, int p_font_size = DEFAULT_FONT_SIZE, const Color &p_modulate = Color(1.0, 1.0, 1.0)) const; + virtual real_t draw_char_outline(RID p_canvas_item, const Point2 &p_pos, char32_t p_char, int p_font_size = DEFAULT_FONT_SIZE, int p_size = 1, const Color &p_modulate = Color(1.0, 1.0, 1.0)) const; + + // Helper functions. + virtual bool has_char(char32_t p_char) const; + virtual String get_supported_chars() const; + + virtual bool is_language_supported(const String &p_language) const; + virtual bool is_script_supported(const String &p_script) const; + + virtual Dictionary get_supported_feature_list() const; + virtual Dictionary get_supported_variation_list() const; + virtual int64_t get_face_count() const; + + Font(); + ~Font(); +}; + +/*************************************************************************/ +/* FontFile */ /*************************************************************************/ -class FontData : public Resource { - GDCLASS(FontData, Resource); +class FontFile : public Font { + GDCLASS(FontFile, Font); RES_BASE_EXTENSION("fontdata"); // Font source data. const uint8_t *data_ptr = nullptr; size_t data_size = 0; - int face_index = 0; PackedByteArray data; bool antialiased = true; @@ -59,8 +151,11 @@ class FontData : public Resource { TextServer::Hinting hinting = TextServer::HINTING_LIGHT; TextServer::SubpixelPositioning subpixel_positioning = TextServer::SUBPIXEL_POSITIONING_AUTO; real_t oversampling = 0.f; - real_t embolden = 0.f; - Transform2D transform; + +#ifndef DISABLE_DEPRECATED + real_t bmp_height = 0.0; + real_t bmp_ascent = 0.0; +#endif // Cache. mutable Vector<RID> cache; @@ -92,20 +187,10 @@ public: virtual void set_data(const PackedByteArray &p_data); virtual PackedByteArray get_data() const; - virtual void set_face_index(int64_t p_index); - virtual int64_t get_face_index() const; - - virtual int64_t get_face_count() const; - // Common properties. virtual void set_font_name(const String &p_name); - virtual String get_font_name() const; - virtual void set_font_style_name(const String &p_name); - virtual String get_font_style_name() const; - virtual void set_font_style(uint32_t p_style); - virtual uint32_t get_font_style() const; virtual void set_antialiased(bool p_antialiased); virtual bool is_antialiased() const; @@ -134,17 +219,12 @@ public: virtual void set_subpixel_positioning(TextServer::SubpixelPositioning p_subpixel); virtual TextServer::SubpixelPositioning get_subpixel_positioning() const; - virtual void set_embolden(float p_strength); - virtual float get_embolden() const; - - virtual void set_transform(Transform2D p_transform); - virtual Transform2D get_transform() const; - virtual void set_oversampling(real_t p_oversampling); virtual real_t get_oversampling() const; // Cache. - virtual RID find_cache(const Dictionary &p_variation_coordinates) const; + virtual RID find_variation(const Dictionary &p_variation_coordinates, int p_face_index = 0, float p_strength = 0.0, Transform2D p_transform = Transform2D()) const override; + virtual RID _get_rid() const override; virtual int get_cache_count() const; virtual void clear_cache(); @@ -157,23 +237,29 @@ public: virtual void set_variation_coordinates(int p_cache_index, const Dictionary &p_variation_coordinates); virtual Dictionary get_variation_coordinates(int p_cache_index) const; - virtual void set_ascent(int p_cache_index, int p_size, real_t p_ascent); - virtual real_t get_ascent(int p_cache_index, int p_size) const; + virtual void set_embolden(int p_cache_index, float p_strength); + virtual float get_embolden(int p_cache_index) const; + + virtual void set_transform(int p_cache_index, Transform2D p_transform); + virtual Transform2D get_transform(int p_cache_index) const; + + virtual void set_face_index(int p_cache_index, int64_t p_index); + virtual int64_t get_face_index(int p_cache_index) const; - virtual void set_descent(int p_cache_index, int p_size, real_t p_descent); - virtual real_t get_descent(int p_cache_index, int p_size) const; + virtual void set_cache_ascent(int p_cache_index, int p_size, real_t p_ascent); + virtual real_t get_cache_ascent(int p_cache_index, int p_size) const; - virtual void set_underline_position(int p_cache_index, int p_size, real_t p_underline_position); - virtual real_t get_underline_position(int p_cache_index, int p_size) const; + virtual void set_cache_descent(int p_cache_index, int p_size, real_t p_descent); + virtual real_t get_cache_descent(int p_cache_index, int p_size) const; - virtual void set_underline_thickness(int p_cache_index, int p_size, real_t p_underline_thickness); - virtual real_t get_underline_thickness(int p_cache_index, int p_size) const; + virtual void set_cache_underline_position(int p_cache_index, int p_size, real_t p_underline_position); + virtual real_t get_cache_underline_position(int p_cache_index, int p_size) const; - virtual void set_scale(int p_cache_index, int p_size, real_t p_scale); // Rendering scale for bitmap fonts (e.g. emoji fonts). - virtual real_t get_scale(int p_cache_index, int p_size) const; + virtual void set_cache_underline_thickness(int p_cache_index, int p_size, real_t p_underline_thickness); + virtual real_t get_cache_underline_thickness(int p_cache_index, int p_size) const; - virtual void set_spacing(int p_cache_index, int p_size, TextServer::SpacingType p_spacing, int p_value); - virtual int get_spacing(int p_cache_index, int p_size, TextServer::SpacingType p_spacing) const; + virtual void set_cache_scale(int p_cache_index, int p_size, real_t p_scale); // Rendering scale for bitmap fonts (e.g. emoji fonts). + virtual real_t get_cache_scale(int p_cache_index, int p_size) const; virtual int get_texture_count(int p_cache_index, const Vector2i &p_size) const; virtual void clear_textures(int p_cache_index, const Vector2i &p_size); @@ -214,16 +300,12 @@ public: virtual void render_range(int p_cache_index, const Vector2i &p_size, char32_t p_start, char32_t p_end); virtual void render_glyph(int p_cache_index, const Vector2i &p_size, int32_t p_index); - virtual RID get_cache_rid(int p_cache_index) const; - // Language/script support override. - virtual bool is_language_supported(const String &p_language) const; virtual void set_language_support_override(const String &p_language, bool p_supported); virtual bool get_language_support_override(const String &p_language) const; virtual void remove_language_support_override(const String &p_language); virtual Vector<String> get_language_support_overrides() const; - virtual bool is_script_supported(const String &p_script) const; virtual void set_script_support_override(const String &p_script, bool p_supported); virtual bool get_script_support_override(const String &p_script) const; virtual void remove_script_support_override(const String &p_script); @@ -233,100 +315,70 @@ public: virtual Dictionary get_opentype_feature_overrides() const; // Base font properties. - virtual bool has_char(char32_t p_char) const; - virtual String get_supported_chars() const; - virtual int32_t get_glyph_index(int p_size, char32_t p_char, char32_t p_variation_selector = 0x0000) const; - virtual Dictionary get_supported_feature_list() const; - virtual Dictionary get_supported_variation_list() const; - - FontData(); - ~FontData(); + FontFile(); + ~FontFile(); }; /*************************************************************************/ +/* FontVariation */ +/*************************************************************************/ -class TextLine; -class TextParagraph; +class FontVariation : public Font { + GDCLASS(FontVariation, Font); -class Font : public Resource { - GDCLASS(Font, Resource); + struct Variation { + Dictionary opentype; + real_t embolden = 0.f; + int face_index = 0; + Transform2D transform; + }; - // Shaped string cache. - mutable LRUCache<uint64_t, Ref<TextLine>> cache; - mutable LRUCache<uint64_t, Ref<TextParagraph>> cache_wrap; - - // Font data cache. - Vector<Ref<FontData>> data; - mutable Vector<RID> rids; + mutable Ref<Font> theme_font; - // Font config. - Dictionary variation_coordinates; - int spacing_bottom = 0; - int spacing_top = 0; + Ref<Font> base_font; - _FORCE_INLINE_ void _data_changed(); - _FORCE_INLINE_ void _ensure_rid(int p_index) const; // Find or create cache record. + Variation variation; + Dictionary opentype_features; + int extra_spacing[TextServer::SPACING_MAX]; protected: static void _bind_methods(); - 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; + virtual void _update_rids() const override; virtual void reset_state() override; public: - static const int DEFAULT_FONT_SIZE = 16; - - Dictionary get_feature_list() const; + virtual void set_base_font(const Ref<Font> &p_font); + virtual Ref<Font> get_base_font() const; + virtual Ref<Font> _get_base_font_or_default() const; - // Font data. - virtual void add_data(const Ref<FontData> &p_data); - virtual void set_data(int p_idx, const Ref<FontData> &p_data); - virtual int get_data_count() const; - virtual Ref<FontData> get_data(int p_idx) const; - virtual RID get_data_rid(int p_idx) const; - virtual void clear_data(); - virtual void remove_data(int p_idx); + virtual void set_variation_opentype(const Dictionary &p_coords); + virtual Dictionary get_variation_opentype() const; - // Font configuration. - virtual void set_variation_coordinates(const Dictionary &p_variation_coordinates); - virtual Dictionary get_variation_coordinates() const; + virtual void set_variation_embolden(float p_strength); + virtual float get_variation_embolden() const; - virtual void set_spacing(TextServer::SpacingType p_spacing, int p_value); - virtual int get_spacing(TextServer::SpacingType p_spacing) const; - - // Font metrics. - virtual real_t get_height(int p_size = DEFAULT_FONT_SIZE) const; - virtual real_t get_ascent(int p_size = DEFAULT_FONT_SIZE) const; - virtual real_t get_descent(int p_size = DEFAULT_FONT_SIZE) const; - virtual real_t get_underline_position(int p_size = DEFAULT_FONT_SIZE) const; - virtual real_t get_underline_thickness(int p_size = DEFAULT_FONT_SIZE) const; + virtual void set_variation_transform(Transform2D p_transform); + virtual Transform2D get_variation_transform() const; - // Drawing string. - virtual Size2 get_string_size(const String &p_text, int p_size = DEFAULT_FONT_SIZE, HorizontalAlignment p_alignment = HORIZONTAL_ALIGNMENT_LEFT, float p_width = -1, uint16_t p_flags = TextServer::JUSTIFICATION_KASHIDA | TextServer::JUSTIFICATION_WORD_BOUND) const; - virtual Size2 get_multiline_string_size(const String &p_text, float p_width = -1, int p_size = DEFAULT_FONT_SIZE, uint16_t p_flags = TextServer::BREAK_MANDATORY | TextServer::BREAK_WORD_BOUND) const; + virtual void set_variation_face_index(int p_face_index); + virtual int get_variation_face_index() const; - virtual void draw_string(RID p_canvas_item, const Point2 &p_pos, const String &p_text, HorizontalAlignment p_alignment = HORIZONTAL_ALIGNMENT_LEFT, float p_width = -1, int p_size = DEFAULT_FONT_SIZE, const Color &p_modulate = Color(1, 1, 1), int p_outline_size = 0, const Color &p_outline_modulate = Color(1, 1, 1, 0), uint16_t p_flags = TextServer::JUSTIFICATION_KASHIDA | TextServer::JUSTIFICATION_WORD_BOUND) const; - virtual void draw_multiline_string(RID p_canvas_item, const Point2 &p_pos, const String &p_text, HorizontalAlignment p_alignment = HORIZONTAL_ALIGNMENT_LEFT, float p_width = -1, int p_max_lines = -1, int p_size = DEFAULT_FONT_SIZE, const Color &p_modulate = Color(1, 1, 1), int p_outline_size = 0, const Color &p_outline_modulate = Color(1, 1, 1, 0), uint16_t p_flags = TextServer::BREAK_MANDATORY | TextServer::BREAK_WORD_BOUND | TextServer::JUSTIFICATION_KASHIDA | TextServer::JUSTIFICATION_WORD_BOUND) const; + virtual void set_opentype_features(const Dictionary &p_features); + virtual Dictionary get_opentype_features() const override; - // Helper functions. - virtual bool has_char(char32_t p_char) const; - virtual String get_supported_chars() const; - - // Drawing char. - virtual Size2 get_char_size(char32_t p_char, char32_t p_next = 0, int p_size = DEFAULT_FONT_SIZE) const; - virtual real_t draw_char(RID p_canvas_item, const Point2 &p_pos, char32_t p_char, char32_t p_next = 0, int p_size = DEFAULT_FONT_SIZE, const Color &p_modulate = Color(1, 1, 1), int p_outline_size = 0, const Color &p_outline_modulate = Color(1, 1, 1, 0)) const; - - Array get_rids() const; + virtual void set_spacing(TextServer::SpacingType p_spacing, int p_value); + virtual int get_spacing(TextServer::SpacingType p_spacing) const override; - void update_changes(); + // Output. + virtual RID find_variation(const Dictionary &p_variation_coordinates, int p_face_index = 0, float p_strength = 0.0, Transform2D p_transform = Transform2D()) const override; + virtual RID _get_rid() const override; - Font(); - ~Font(); + FontVariation(); + ~FontVariation(); }; #endif /* FONT_H */ diff --git a/scene/resources/primitive_meshes.cpp b/scene/resources/primitive_meshes.cpp index 9fa483bf36..68441afb1c 100644 --- a/scene/resources/primitive_meshes.cpp +++ b/scene/resources/primitive_meshes.cpp @@ -2376,7 +2376,10 @@ void TextMesh::_create_mesh_array(Array &p_arr) const { TS->shaped_text_set_direction(text_rid, text_direction); String text = (uppercase) ? TS->string_to_upper(xl_text, language) : xl_text; - TS->shaped_text_add_string(text_rid, text, font->get_rids(), font_size, opentype_features, language); + TS->shaped_text_add_string(text_rid, text, font->get_rids(), font_size, font->get_opentype_features(), language); + for (int i = 0; i < TextServer::SPACING_MAX; i++) { + TS->shaped_text_set_spacing(text_rid, TextServer::SpacingType(i), font->get_spacing(TextServer::SpacingType(i))); + } Array stt; if (st_parser == TextServer::STRUCTURED_TEXT_CUSTOM) { @@ -2394,7 +2397,10 @@ void TextMesh::_create_mesh_array(Array &p_arr) const { } else if (dirty_font) { int spans = TS->shaped_get_span_count(text_rid); for (int i = 0; i < spans; i++) { - TS->shaped_set_span_update_font(text_rid, i, font->get_rids(), font_size, opentype_features); + TS->shaped_set_span_update_font(text_rid, i, font->get_rids(), font_size, font->get_opentype_features()); + } + for (int i = 0; i < TextServer::SPACING_MAX; i++) { + TS->shaped_text_set_spacing(text_rid, TextServer::SpacingType(i), font->get_spacing(TextServer::SpacingType(i))); } dirty_font = false; @@ -2679,10 +2685,6 @@ void TextMesh::_bind_methods() { ClassDB::bind_method(D_METHOD("set_text_direction", "direction"), &TextMesh::set_text_direction); ClassDB::bind_method(D_METHOD("get_text_direction"), &TextMesh::get_text_direction); - ClassDB::bind_method(D_METHOD("set_opentype_feature", "tag", "value"), &TextMesh::set_opentype_feature); - ClassDB::bind_method(D_METHOD("get_opentype_feature", "tag"), &TextMesh::get_opentype_feature); - ClassDB::bind_method(D_METHOD("clear_opentype_features"), &TextMesh::clear_opentype_features); - ClassDB::bind_method(D_METHOD("set_language", "language"), &TextMesh::set_language); ClassDB::bind_method(D_METHOD("get_language"), &TextMesh::get_language); @@ -2701,11 +2703,9 @@ void TextMesh::_bind_methods() { ADD_GROUP("Text", ""); ADD_PROPERTY(PropertyInfo(Variant::STRING, "text"), "set_text", "get_text"); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "font", PROPERTY_HINT_RESOURCE_TYPE, "Font"), "set_font", "get_font"); - ADD_PROPERTY(PropertyInfo(Variant::INT, "font_size", PROPERTY_HINT_RANGE, "1,127,1,suffix:px"), "set_font_size", "get_font_size"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "font_size", PROPERTY_HINT_RANGE, "1,256,1,or_greater,suffix:px"), "set_font_size", "get_font_size"); ADD_PROPERTY(PropertyInfo(Variant::INT, "horizontal_alignment", PROPERTY_HINT_ENUM, "Left,Center,Right,Fill"), "set_horizontal_alignment", "get_horizontal_alignment"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "uppercase"), "set_uppercase", "is_uppercase"); - ADD_PROPERTY(PropertyInfo(Variant::INT, "structured_text_bidi_override", PROPERTY_HINT_ENUM, "Default,URI,File,Email,List,None,Custom"), "set_structured_text_bidi_override", "get_structured_text_bidi_override"); - ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "structured_text_bidi_override_options"), "set_structured_text_bidi_override_options", "get_structured_text_bidi_override_options"); ADD_GROUP("Mesh", ""); ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "pixel_size", PROPERTY_HINT_RANGE, "0.0001,128,0.0001,suffix:m"), "set_pixel_size", "get_pixel_size"); @@ -2713,9 +2713,11 @@ void TextMesh::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "depth", PROPERTY_HINT_RANGE, "0.0,100.0,0.001,or_greater,suffix:m"), "set_depth", "get_depth"); ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "width", PROPERTY_HINT_NONE, "suffix:m"), "set_width", "get_width"); - ADD_GROUP("Locale", ""); + ADD_GROUP("BiDi", ""); ADD_PROPERTY(PropertyInfo(Variant::INT, "text_direction", PROPERTY_HINT_ENUM, "Auto,Left-to-Right,Right-to-Left"), "set_text_direction", "get_text_direction"); ADD_PROPERTY(PropertyInfo(Variant::STRING, "language", PROPERTY_HINT_LOCALE_ID, ""), "set_language", "get_language"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "structured_text_bidi_override", PROPERTY_HINT_ENUM, "Default,URI,File,Email,List,None,Custom"), "set_structured_text_bidi_override", "get_structured_text_bidi_override"); + ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "structured_text_bidi_override_options"), "set_structured_text_bidi_override_options", "get_structured_text_bidi_override_options"); } void TextMesh::_notification(int p_what) { @@ -2732,56 +2734,6 @@ void TextMesh::_notification(int p_what) { } } -bool TextMesh::_set(const StringName &p_name, const Variant &p_value) { - String str = p_name; - if (str.begins_with("opentype_features/")) { - String name = str.get_slicec('/', 1); - int32_t tag = TS->name_to_tag(name); - int value = p_value; - if (value == -1) { - if (opentype_features.has(tag)) { - opentype_features.erase(tag); - dirty_font = true; - _request_update(); - } - } else { - if (!opentype_features.has(tag) || (int)opentype_features[tag] != value) { - opentype_features[tag] = value; - dirty_font = true; - _request_update(); - } - } - notify_property_list_changed(); - return true; - } - - return false; -} - -bool TextMesh::_get(const StringName &p_name, Variant &r_ret) const { - String str = p_name; - if (str.begins_with("opentype_features/")) { - String name = str.get_slicec('/', 1); - int32_t tag = TS->name_to_tag(name); - if (opentype_features.has(tag)) { - r_ret = opentype_features[tag]; - return true; - } else { - r_ret = -1; - return true; - } - } - return false; -} - -void TextMesh::_get_property_list(List<PropertyInfo> *p_list) const { - for (const Variant *ftr = opentype_features.next(nullptr); ftr != nullptr; ftr = opentype_features.next(ftr)) { - String name = TS->tag_to_name(*ftr); - p_list->push_back(PropertyInfo(Variant::INT, "opentype_features/" + name)); - } - p_list->push_back(PropertyInfo(Variant::NIL, "opentype_features/_new", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR)); -} - TextMesh::TextMesh() { primitive_type = PRIMITIVE_TRIANGLES; text_rid = TS->create_shaped_text(); @@ -2845,7 +2797,7 @@ Ref<Font> TextMesh::get_font() const { } Ref<Font> TextMesh::_get_font_or_default() const { - if (font_override.is_valid() && font_override->get_data_count() > 0) { + if (font_override.is_valid()) { return font_override; } @@ -2952,29 +2904,6 @@ TextServer::Direction TextMesh::get_text_direction() const { return text_direction; } -void TextMesh::clear_opentype_features() { - opentype_features.clear(); - dirty_font = true; - _request_update(); -} - -void TextMesh::set_opentype_feature(const String &p_name, int p_value) { - int32_t tag = TS->name_to_tag(p_name); - if (!opentype_features.has(tag) || (int)opentype_features[tag] != p_value) { - opentype_features[tag] = p_value; - dirty_font = true; - _request_update(); - } -} - -int TextMesh::get_opentype_feature(const String &p_name) const { - int32_t tag = TS->name_to_tag(p_name); - if (!opentype_features.has(tag)) { - return -1; - } - return opentype_features[tag]; -} - void TextMesh::set_language(const String &p_language) { if (language != p_language) { language = p_language; diff --git a/scene/resources/primitive_meshes.h b/scene/resources/primitive_meshes.h index a6d8978c2d..cb93211756 100644 --- a/scene/resources/primitive_meshes.h +++ b/scene/resources/primitive_meshes.h @@ -525,7 +525,6 @@ private: HorizontalAlignment horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER; bool uppercase = false; - Dictionary opentype_features; String language; TextServer::Direction text_direction = TextServer::DIRECTION_AUTO; TextServer::StructuredTextParser st_parser = TextServer::STRUCTURED_TEXT_DEFAULT; @@ -548,10 +547,6 @@ protected: virtual void _create_mesh_array(Array &p_arr) const override; - 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: GDVIRTUAL2RC(Array, _structured_text_parser, Array, String) @@ -574,10 +569,6 @@ public: void set_text_direction(TextServer::Direction p_text_direction); TextServer::Direction get_text_direction() const; - void set_opentype_feature(const String &p_name, int p_value); - int get_opentype_feature(const String &p_name) const; - void clear_opentype_features(); - void set_language(const String &p_language); String get_language() const; diff --git a/scene/resources/text_file.cpp b/scene/resources/text_file.cpp index 96a47c37c4..0404e1f79b 100644 --- a/scene/resources/text_file.cpp +++ b/scene/resources/text_file.cpp @@ -64,7 +64,7 @@ Error TextFile::load_text(const String &p_path) { w[len] = 0; String s; - ERR_FAIL_COND_V_MSG(s.parse_utf8((const char *)w), ERR_INVALID_DATA, "Script '" + p_path + "' contains invalid unicode (UTF-8), so it was not loaded. Please ensure that scripts are saved in valid UTF-8 unicode."); + ERR_FAIL_COND_V_MSG(s.parse_utf8((const char *)w) != OK, ERR_INVALID_DATA, "Script '" + p_path + "' contains invalid unicode (UTF-8), so it was not loaded. Please ensure that scripts are saved in valid UTF-8 unicode."); text = s; path = p_path; return OK; diff --git a/scene/resources/text_line.cpp b/scene/resources/text_line.cpp index d6e7ca3478..f32b7feb4b 100644 --- a/scene/resources/text_line.cpp +++ b/scene/resources/text_line.cpp @@ -55,7 +55,7 @@ void TextLine::_bind_methods() { ClassDB::bind_method(D_METHOD("set_bidi_override", "override"), &TextLine::set_bidi_override); - ClassDB::bind_method(D_METHOD("add_string", "text", "fonts", "size", "opentype_features", "language", "meta"), &TextLine::add_string, DEFVAL(Dictionary()), DEFVAL(""), DEFVAL(Variant())); + ClassDB::bind_method(D_METHOD("add_string", "text", "font", "font_size", "language", "meta"), &TextLine::add_string, DEFVAL(""), DEFVAL(Variant())); ClassDB::bind_method(D_METHOD("add_object", "key", "size", "inline_align", "length"), &TextLine::add_object, DEFVAL(INLINE_ALIGNMENT_CENTER), DEFVAL(1)); ClassDB::bind_method(D_METHOD("resize_object", "key", "size", "inline_align"), &TextLine::resize_object, DEFVAL(INLINE_ALIGNMENT_CENTER)); @@ -149,8 +149,6 @@ RID TextLine::get_rid() const { void TextLine::clear() { TS->shaped_text_clear(rid); - spacing_top = 0; - spacing_bottom = 0; } void TextLine::set_preserve_invalid(bool p_enabled) { @@ -194,11 +192,12 @@ void TextLine::set_bidi_override(const Array &p_override) { dirty = true; } -bool TextLine::add_string(const String &p_text, const Ref<Font> &p_fonts, int p_size, const Dictionary &p_opentype_features, const String &p_language, const Variant &p_meta) { - ERR_FAIL_COND_V(p_fonts.is_null(), false); - bool res = TS->shaped_text_add_string(rid, p_text, p_fonts->get_rids(), p_size, p_opentype_features, p_language, p_meta); - spacing_top = p_fonts->get_spacing(TextServer::SPACING_TOP); - spacing_bottom = p_fonts->get_spacing(TextServer::SPACING_BOTTOM); +bool TextLine::add_string(const String &p_text, const Ref<Font> &p_font, int p_font_size, const String &p_language, const Variant &p_meta) { + ERR_FAIL_COND_V(p_font.is_null(), false); + bool res = TS->shaped_text_add_string(rid, p_text, p_font->get_rids(), p_font_size, p_font->get_opentype_features(), p_language, p_meta); + for (int i = 0; i < TextServer::SPACING_MAX; i++) { + TS->shaped_text_set_spacing(rid, TextServer::SpacingType(i), p_font->get_spacing(TextServer::SpacingType(i))); + } dirty = true; return res; } @@ -278,20 +277,20 @@ float TextLine::get_width() const { Size2 TextLine::get_size() const { const_cast<TextLine *>(this)->_shape(); if (TS->shaped_text_get_orientation(rid) == TextServer::ORIENTATION_HORIZONTAL) { - return Size2(TS->shaped_text_get_size(rid).x, TS->shaped_text_get_size(rid).y + spacing_top + spacing_bottom); + return Size2(TS->shaped_text_get_size(rid).x, TS->shaped_text_get_size(rid).y); } else { - return Size2(TS->shaped_text_get_size(rid).x + spacing_top + spacing_bottom, TS->shaped_text_get_size(rid).y); + return Size2(TS->shaped_text_get_size(rid).x, TS->shaped_text_get_size(rid).y); } } float TextLine::get_line_ascent() const { const_cast<TextLine *>(this)->_shape(); - return TS->shaped_text_get_ascent(rid) + spacing_top; + return TS->shaped_text_get_ascent(rid); } float TextLine::get_line_descent() const { const_cast<TextLine *>(this)->_shape(); - return TS->shaped_text_get_descent(rid) + spacing_bottom; + return TS->shaped_text_get_descent(rid); } float TextLine::get_line_width() const { @@ -347,10 +346,10 @@ void TextLine::draw(RID p_canvas, const Vector2 &p_pos, const Color &p_color) co float clip_l; if (TS->shaped_text_get_orientation(rid) == TextServer::ORIENTATION_HORIZONTAL) { - ofs.y += TS->shaped_text_get_ascent(rid) + spacing_top; + ofs.y += TS->shaped_text_get_ascent(rid); clip_l = MAX(0, p_pos.x - ofs.x); } else { - ofs.x += TS->shaped_text_get_ascent(rid) + spacing_top; + ofs.x += TS->shaped_text_get_ascent(rid); clip_l = MAX(0, p_pos.y - ofs.y); } return TS->shaped_text_draw(rid, p_canvas, ofs, clip_l, clip_l + width, p_color); @@ -394,10 +393,10 @@ void TextLine::draw_outline(RID p_canvas, const Vector2 &p_pos, int p_outline_si float clip_l; if (TS->shaped_text_get_orientation(rid) == TextServer::ORIENTATION_HORIZONTAL) { - ofs.y += TS->shaped_text_get_ascent(rid) + spacing_top; + ofs.y += TS->shaped_text_get_ascent(rid); clip_l = MAX(0, p_pos.x - ofs.x); } else { - ofs.x += TS->shaped_text_get_ascent(rid) + spacing_top; + ofs.x += TS->shaped_text_get_ascent(rid); clip_l = MAX(0, p_pos.y - ofs.y); } return TS->shaped_text_draw_outline(rid, p_canvas, ofs, clip_l, clip_l + width, p_outline_size, p_color); @@ -409,11 +408,14 @@ int TextLine::hit_test(float p_coords) const { return TS->shaped_text_hit_test_position(rid, p_coords); } -TextLine::TextLine(const String &p_text, const Ref<Font> &p_fonts, int p_size, const Dictionary &p_opentype_features, const String &p_language, TextServer::Direction p_direction, TextServer::Orientation p_orientation) { +TextLine::TextLine(const String &p_text, const Ref<Font> &p_font, int p_font_size, const String &p_language, TextServer::Direction p_direction, TextServer::Orientation p_orientation) { rid = TS->create_shaped_text(p_direction, p_orientation); - spacing_top = p_fonts->get_spacing(TextServer::SPACING_TOP); - spacing_bottom = p_fonts->get_spacing(TextServer::SPACING_BOTTOM); - TS->shaped_text_add_string(rid, p_text, p_fonts->get_rids(), p_size, p_opentype_features, p_language); + if (p_font.is_valid()) { + TS->shaped_text_add_string(rid, p_text, p_font->get_rids(), p_font_size, p_font->get_opentype_features(), p_language); + for (int i = 0; i < TextServer::SPACING_MAX; i++) { + TS->shaped_text_set_spacing(rid, TextServer::SpacingType(i), p_font->get_spacing(TextServer::SpacingType(i))); + } + } } TextLine::TextLine() { diff --git a/scene/resources/text_line.h b/scene/resources/text_line.h index 784ee8ef26..2d1548d079 100644 --- a/scene/resources/text_line.h +++ b/scene/resources/text_line.h @@ -41,8 +41,6 @@ class TextLine : public RefCounted { private: RID rid; - int spacing_top = 0; - int spacing_bottom = 0; bool dirty = true; @@ -77,7 +75,7 @@ public: void set_preserve_control(bool p_enabled); bool get_preserve_control() const; - bool add_string(const String &p_text, const Ref<Font> &p_fonts, int p_size, const Dictionary &p_opentype_features = Dictionary(), const String &p_language = "", const Variant &p_meta = Variant()); + bool add_string(const String &p_text, const Ref<Font> &p_font, int p_font_size, const String &p_language = "", const Variant &p_meta = Variant()); bool add_object(Variant p_key, const Size2 &p_size, InlineAlignment p_inline_align = INLINE_ALIGNMENT_CENTER, int p_length = 1); bool resize_object(Variant p_key, const Size2 &p_size, InlineAlignment p_inline_align = INLINE_ALIGNMENT_CENTER); @@ -111,7 +109,7 @@ public: int hit_test(float p_coords) const; - TextLine(const String &p_text, const Ref<Font> &p_fonts, int p_size, const Dictionary &p_opentype_features = Dictionary(), const String &p_language = "", TextServer::Direction p_direction = TextServer::DIRECTION_AUTO, TextServer::Orientation p_orientation = TextServer::ORIENTATION_HORIZONTAL); + TextLine(const String &p_text, const Ref<Font> &p_font, int p_font_size, const String &p_language = "", TextServer::Direction p_direction = TextServer::DIRECTION_AUTO, TextServer::Orientation p_orientation = TextServer::ORIENTATION_HORIZONTAL); TextLine(); ~TextLine(); }; diff --git a/scene/resources/text_paragraph.cpp b/scene/resources/text_paragraph.cpp index 874992ea3d..c8b9e895fc 100644 --- a/scene/resources/text_paragraph.cpp +++ b/scene/resources/text_paragraph.cpp @@ -60,10 +60,10 @@ void TextParagraph::_bind_methods() { ClassDB::bind_method(D_METHOD("set_bidi_override", "override"), &TextParagraph::set_bidi_override); - ClassDB::bind_method(D_METHOD("set_dropcap", "text", "fonts", "size", "dropcap_margins", "opentype_features", "language"), &TextParagraph::set_dropcap, DEFVAL(Rect2()), DEFVAL(Dictionary()), DEFVAL("")); + ClassDB::bind_method(D_METHOD("set_dropcap", "text", "font", "font_size", "dropcap_margins", "language"), &TextParagraph::set_dropcap, DEFVAL(Rect2()), DEFVAL("")); ClassDB::bind_method(D_METHOD("clear_dropcap"), &TextParagraph::clear_dropcap); - ClassDB::bind_method(D_METHOD("add_string", "text", "fonts", "size", "opentype_features", "language", "meta"), &TextParagraph::add_string, DEFVAL(Dictionary()), DEFVAL(""), DEFVAL(Variant())); + ClassDB::bind_method(D_METHOD("add_string", "text", "font", "font_size", "language", "meta"), &TextParagraph::add_string, DEFVAL(""), DEFVAL(Variant())); ClassDB::bind_method(D_METHOD("add_object", "key", "size", "inline_align", "length"), &TextParagraph::add_object, DEFVAL(INLINE_ALIGNMENT_CENTER), DEFVAL(1)); ClassDB::bind_method(D_METHOD("resize_object", "key", "size", "inline_align"), &TextParagraph::resize_object, DEFVAL(INLINE_ALIGNMENT_CENTER)); @@ -113,9 +113,6 @@ void TextParagraph::_bind_methods() { ClassDB::bind_method(D_METHOD("get_line_underline_position", "line"), &TextParagraph::get_line_underline_position); ClassDB::bind_method(D_METHOD("get_line_underline_thickness", "line"), &TextParagraph::get_line_underline_thickness); - ClassDB::bind_method(D_METHOD("get_spacing_top"), &TextParagraph::get_spacing_top); - ClassDB::bind_method(D_METHOD("get_spacing_bottom"), &TextParagraph::get_spacing_bottom); - ClassDB::bind_method(D_METHOD("get_dropcap_size"), &TextParagraph::get_dropcap_size); ClassDB::bind_method(D_METHOD("get_dropcap_lines"), &TextParagraph::get_dropcap_lines); @@ -266,8 +263,6 @@ RID TextParagraph::get_dropcap_rid() const { void TextParagraph::clear() { _THREAD_SAFE_METHOD_ - spacing_top = 0; - spacing_bottom = 0; for (int i = 0; i < (int)lines_rid.size(); i++) { TS->free_rid(lines_rid[i]); } @@ -347,44 +342,37 @@ TextServer::Orientation TextParagraph::get_orientation() const { return TS->shaped_text_get_orientation(rid); } -bool TextParagraph::set_dropcap(const String &p_text, const Ref<Font> &p_fonts, int p_size, const Rect2 &p_dropcap_margins, const Dictionary &p_opentype_features, const String &p_language) { +bool TextParagraph::set_dropcap(const String &p_text, const Ref<Font> &p_font, int p_font_size, const Rect2 &p_dropcap_margins, const String &p_language) { _THREAD_SAFE_METHOD_ - - ERR_FAIL_COND_V(p_fonts.is_null(), false); + ERR_FAIL_COND_V(p_font.is_null(), false); TS->shaped_text_clear(dropcap_rid); dropcap_margins = p_dropcap_margins; - bool res = TS->shaped_text_add_string(dropcap_rid, p_text, p_fonts->get_rids(), p_size, p_opentype_features, p_language); + bool res = TS->shaped_text_add_string(dropcap_rid, p_text, p_font->get_rids(), p_font_size, p_font->get_opentype_features(), p_language); + for (int i = 0; i < TextServer::SPACING_MAX; i++) { + TS->shaped_text_set_spacing(dropcap_rid, TextServer::SpacingType(i), p_font->get_spacing(TextServer::SpacingType(i))); + } lines_dirty = true; return res; } void TextParagraph::clear_dropcap() { _THREAD_SAFE_METHOD_ - dropcap_margins = Rect2(); TS->shaped_text_clear(dropcap_rid); lines_dirty = true; } -bool TextParagraph::add_string(const String &p_text, const Ref<Font> &p_fonts, int p_size, const Dictionary &p_opentype_features, const String &p_language, const Variant &p_meta) { +bool TextParagraph::add_string(const String &p_text, const Ref<Font> &p_font, int p_font_size, const String &p_language, const Variant &p_meta) { _THREAD_SAFE_METHOD_ - - ERR_FAIL_COND_V(p_fonts.is_null(), false); - bool res = TS->shaped_text_add_string(rid, p_text, p_fonts->get_rids(), p_size, p_opentype_features, p_language, p_meta); - spacing_top = p_fonts->get_spacing(TextServer::SPACING_TOP); - spacing_bottom = p_fonts->get_spacing(TextServer::SPACING_BOTTOM); + ERR_FAIL_COND_V(p_font.is_null(), false); + bool res = TS->shaped_text_add_string(rid, p_text, p_font->get_rids(), p_font_size, p_font->get_opentype_features(), p_language, p_meta); + for (int i = 0; i < TextServer::SPACING_MAX; i++) { + TS->shaped_text_set_spacing(rid, TextServer::SpacingType(i), p_font->get_spacing(TextServer::SpacingType(i))); + } lines_dirty = true; return res; } -int TextParagraph::get_spacing_top() const { - return spacing_top; -} - -int TextParagraph::get_spacing_bottom() const { - return spacing_bottom; -} - void TextParagraph::set_bidi_override(const Array &p_override) { _THREAD_SAFE_METHOD_ @@ -476,9 +464,9 @@ Size2 TextParagraph::get_non_wrapped_size() const { const_cast<TextParagraph *>(this)->_shape_lines(); if (TS->shaped_text_get_orientation(rid) == TextServer::ORIENTATION_HORIZONTAL) { - return Size2(TS->shaped_text_get_size(rid).x, TS->shaped_text_get_size(rid).y + spacing_top + spacing_bottom); + return Size2(TS->shaped_text_get_size(rid).x, TS->shaped_text_get_size(rid).y); } else { - return Size2(TS->shaped_text_get_size(rid).x + spacing_top + spacing_bottom, TS->shaped_text_get_size(rid).y); + return Size2(TS->shaped_text_get_size(rid).x, TS->shaped_text_get_size(rid).y); } } @@ -492,9 +480,9 @@ Size2 TextParagraph::get_size() const { Size2 lsize = TS->shaped_text_get_size(lines_rid[i]); if (TS->shaped_text_get_orientation(lines_rid[i]) == TextServer::ORIENTATION_HORIZONTAL) { size.x = MAX(size.x, lsize.x); - size.y += lsize.y + spacing_top + spacing_bottom; + size.y += lsize.y; } else { - size.x += lsize.x + spacing_top + spacing_bottom; + size.x += lsize.x; size.y = MAX(size.y, lsize.y); } } @@ -538,9 +526,9 @@ Rect2 TextParagraph::get_line_object_rect(int p_line, Variant p_key) const { for (int i = 0; i < p_line; i++) { Size2 lsize = TS->shaped_text_get_size(lines_rid[i]); if (TS->shaped_text_get_orientation(lines_rid[i]) == TextServer::ORIENTATION_HORIZONTAL) { - xrect.position.y += lsize.y + spacing_top + spacing_bottom; + xrect.position.y += lsize.y; } else { - xrect.position.x += lsize.x + spacing_top + spacing_bottom; + xrect.position.x += lsize.x; } } return xrect; @@ -552,9 +540,9 @@ Size2 TextParagraph::get_line_size(int p_line) const { const_cast<TextParagraph *>(this)->_shape_lines(); ERR_FAIL_COND_V(p_line < 0 || p_line >= (int)lines_rid.size(), Size2()); if (TS->shaped_text_get_orientation(lines_rid[p_line]) == TextServer::ORIENTATION_HORIZONTAL) { - return Size2(TS->shaped_text_get_size(lines_rid[p_line]).x, TS->shaped_text_get_size(lines_rid[p_line]).y + spacing_top + spacing_bottom); + return Size2(TS->shaped_text_get_size(lines_rid[p_line]).x, TS->shaped_text_get_size(lines_rid[p_line]).y); } else { - return Size2(TS->shaped_text_get_size(lines_rid[p_line]).x + spacing_top + spacing_bottom, TS->shaped_text_get_size(lines_rid[p_line]).y); + return Size2(TS->shaped_text_get_size(lines_rid[p_line]).x, TS->shaped_text_get_size(lines_rid[p_line]).y); } } @@ -571,7 +559,7 @@ float TextParagraph::get_line_ascent(int p_line) const { const_cast<TextParagraph *>(this)->_shape_lines(); ERR_FAIL_COND_V(p_line < 0 || p_line >= (int)lines_rid.size(), 0.f); - return TS->shaped_text_get_ascent(lines_rid[p_line]) + spacing_top; + return TS->shaped_text_get_ascent(lines_rid[p_line]); } float TextParagraph::get_line_descent(int p_line) const { @@ -579,7 +567,7 @@ float TextParagraph::get_line_descent(int p_line) const { const_cast<TextParagraph *>(this)->_shape_lines(); ERR_FAIL_COND_V(p_line < 0 || p_line >= (int)lines_rid.size(), 0.f); - return TS->shaped_text_get_descent(lines_rid[p_line]) + spacing_bottom; + return TS->shaped_text_get_descent(lines_rid[p_line]); } float TextParagraph::get_line_width(int p_line) const { @@ -647,7 +635,7 @@ void TextParagraph::draw(RID p_canvas, const Vector2 &p_pos, const Color &p_colo float l_width = width; if (TS->shaped_text_get_orientation(lines_rid[i]) == TextServer::ORIENTATION_HORIZONTAL) { ofs.x = p_pos.x; - ofs.y += TS->shaped_text_get_ascent(lines_rid[i]) + spacing_top; + ofs.y += TS->shaped_text_get_ascent(lines_rid[i]); if (i <= dropcap_lines) { if (TS->shaped_text_get_inferred_direction(dropcap_rid) == TextServer::DIRECTION_LTR) { ofs.x -= h_offset; @@ -656,7 +644,7 @@ void TextParagraph::draw(RID p_canvas, const Vector2 &p_pos, const Color &p_colo } } else { ofs.y = p_pos.y; - ofs.x += TS->shaped_text_get_ascent(lines_rid[i]) + spacing_top; + ofs.x += TS->shaped_text_get_ascent(lines_rid[i]); if (i <= dropcap_lines) { if (TS->shaped_text_get_inferred_direction(dropcap_rid) == TextServer::DIRECTION_LTR) { ofs.x -= h_offset; @@ -711,10 +699,10 @@ void TextParagraph::draw(RID p_canvas, const Vector2 &p_pos, const Color &p_colo TS->shaped_text_draw(lines_rid[i], p_canvas, ofs, clip_l, clip_l + l_width, p_color); if (TS->shaped_text_get_orientation(lines_rid[i]) == TextServer::ORIENTATION_HORIZONTAL) { ofs.x = p_pos.x; - ofs.y += TS->shaped_text_get_descent(lines_rid[i]) + spacing_bottom; + ofs.y += TS->shaped_text_get_descent(lines_rid[i]); } else { ofs.y = p_pos.y; - ofs.x += TS->shaped_text_get_descent(lines_rid[i]) + spacing_bottom; + ofs.x += TS->shaped_text_get_descent(lines_rid[i]); } } } @@ -749,7 +737,7 @@ void TextParagraph::draw_outline(RID p_canvas, const Vector2 &p_pos, int p_outli float l_width = width; if (TS->shaped_text_get_orientation(lines_rid[i]) == TextServer::ORIENTATION_HORIZONTAL) { ofs.x = p_pos.x; - ofs.y += TS->shaped_text_get_ascent(lines_rid[i]) + spacing_top; + ofs.y += TS->shaped_text_get_ascent(lines_rid[i]); if (i <= dropcap_lines) { if (TS->shaped_text_get_inferred_direction(dropcap_rid) == TextServer::DIRECTION_LTR) { ofs.x -= h_offset; @@ -758,7 +746,7 @@ void TextParagraph::draw_outline(RID p_canvas, const Vector2 &p_pos, int p_outli } } else { ofs.y = p_pos.y; - ofs.x += TS->shaped_text_get_ascent(lines_rid[i]) + spacing_top; + ofs.x += TS->shaped_text_get_ascent(lines_rid[i]); if (i <= dropcap_lines) { if (TS->shaped_text_get_inferred_direction(dropcap_rid) == TextServer::DIRECTION_LTR) { ofs.x -= h_offset; @@ -813,10 +801,10 @@ void TextParagraph::draw_outline(RID p_canvas, const Vector2 &p_pos, int p_outli TS->shaped_text_draw_outline(lines_rid[i], p_canvas, ofs, clip_l, clip_l + l_width, p_outline_size, p_color); if (TS->shaped_text_get_orientation(lines_rid[i]) == TextServer::ORIENTATION_HORIZONTAL) { ofs.x = p_pos.x; - ofs.y += TS->shaped_text_get_descent(lines_rid[i]) + spacing_bottom; + ofs.y += TS->shaped_text_get_descent(lines_rid[i]); } else { ofs.y = p_pos.y; - ofs.x += TS->shaped_text_get_descent(lines_rid[i]) + spacing_bottom; + ofs.x += TS->shaped_text_get_descent(lines_rid[i]); } } } @@ -840,12 +828,12 @@ int TextParagraph::hit_test(const Point2 &p_coords) const { if ((p_coords.y >= ofs.y) && (p_coords.y <= ofs.y + TS->shaped_text_get_size(lines_rid[i]).y)) { return TS->shaped_text_hit_test_position(lines_rid[i], p_coords.x); } - ofs.y += TS->shaped_text_get_size(lines_rid[i]).y + spacing_bottom + spacing_top; + ofs.y += TS->shaped_text_get_size(lines_rid[i]).y; } else { if ((p_coords.x >= ofs.x) && (p_coords.x <= ofs.x + TS->shaped_text_get_size(lines_rid[i]).x)) { return TS->shaped_text_hit_test_position(lines_rid[i], p_coords.y); } - ofs.y += TS->shaped_text_get_size(lines_rid[i]).x + spacing_bottom + spacing_top; + ofs.y += TS->shaped_text_get_size(lines_rid[i]).x; } } return TS->shaped_text_get_range(rid).y; @@ -908,9 +896,9 @@ void TextParagraph::draw_line(RID p_canvas, const Vector2 &p_pos, int p_line, co Vector2 ofs = p_pos; if (TS->shaped_text_get_orientation(lines_rid[p_line]) == TextServer::ORIENTATION_HORIZONTAL) { - ofs.y += TS->shaped_text_get_ascent(lines_rid[p_line]) + spacing_top; + ofs.y += TS->shaped_text_get_ascent(lines_rid[p_line]); } else { - ofs.x += TS->shaped_text_get_ascent(lines_rid[p_line]) + spacing_top; + ofs.x += TS->shaped_text_get_ascent(lines_rid[p_line]); } return TS->shaped_text_draw(lines_rid[p_line], p_canvas, ofs, -1, -1, p_color); } @@ -923,18 +911,21 @@ void TextParagraph::draw_line_outline(RID p_canvas, const Vector2 &p_pos, int p_ Vector2 ofs = p_pos; if (TS->shaped_text_get_orientation(lines_rid[p_line]) == TextServer::ORIENTATION_HORIZONTAL) { - ofs.y += TS->shaped_text_get_ascent(lines_rid[p_line]) + spacing_top; + ofs.y += TS->shaped_text_get_ascent(lines_rid[p_line]); } else { - ofs.x += TS->shaped_text_get_ascent(lines_rid[p_line]) + spacing_top; + ofs.x += TS->shaped_text_get_ascent(lines_rid[p_line]); } return TS->shaped_text_draw_outline(lines_rid[p_line], p_canvas, ofs, -1, -1, p_outline_size, p_color); } -TextParagraph::TextParagraph(const String &p_text, const Ref<Font> &p_fonts, int p_size, const Dictionary &p_opentype_features, const String &p_language, float p_width, TextServer::Direction p_direction, TextServer::Orientation p_orientation) { +TextParagraph::TextParagraph(const String &p_text, const Ref<Font> &p_font, int p_font_size, const String &p_language, float p_width, TextServer::Direction p_direction, TextServer::Orientation p_orientation) { rid = TS->create_shaped_text(p_direction, p_orientation); - TS->shaped_text_add_string(rid, p_text, p_fonts->get_rids(), p_size, p_opentype_features, p_language); - spacing_top = p_fonts->get_spacing(TextServer::SPACING_TOP); - spacing_bottom = p_fonts->get_spacing(TextServer::SPACING_BOTTOM); + if (p_font.is_valid()) { + TS->shaped_text_add_string(rid, p_text, p_font->get_rids(), p_font_size, p_font->get_opentype_features(), p_language); + for (int i = 0; i < TextServer::SPACING_MAX; i++) { + TS->shaped_text_set_spacing(rid, TextServer::SpacingType(i), p_font->get_spacing(TextServer::SpacingType(i))); + } + } width = p_width; } diff --git a/scene/resources/text_paragraph.h b/scene/resources/text_paragraph.h index bdcc2b5701..f161cb5b8c 100644 --- a/scene/resources/text_paragraph.h +++ b/scene/resources/text_paragraph.h @@ -48,8 +48,6 @@ private: RID rid; LocalVector<RID> lines_rid; - int spacing_top = 0; - int spacing_bottom = 0; bool lines_dirty = true; @@ -92,10 +90,10 @@ public: void set_custom_punctuation(const String &p_punct); String get_custom_punctuation() const; - bool set_dropcap(const String &p_text, const Ref<Font> &p_fonts, int p_size, const Rect2 &p_dropcap_margins = Rect2(), const Dictionary &p_opentype_features = Dictionary(), const String &p_language = ""); + bool set_dropcap(const String &p_text, const Ref<Font> &p_font, int p_font_size, const Rect2 &p_dropcap_margins = Rect2(), const String &p_language = ""); void clear_dropcap(); - bool add_string(const String &p_text, const Ref<Font> &p_fonts, int p_size, const Dictionary &p_opentype_features = Dictionary(), const String &p_language = "", const Variant &p_meta = Variant()); + bool add_string(const String &p_text, const Ref<Font> &p_font, int p_font_size, const String &p_language = "", const Variant &p_meta = Variant()); bool add_object(Variant p_key, const Size2 &p_size, InlineAlignment p_inline_align = INLINE_ALIGNMENT_CENTER, int p_length = 1); bool resize_object(Variant p_key, const Size2 &p_size, InlineAlignment p_inline_align = INLINE_ALIGNMENT_CENTER); @@ -151,7 +149,7 @@ public: Mutex &get_mutex() const { return _thread_safe_; }; - TextParagraph(const String &p_text, const Ref<Font> &p_fonts, int p_size, const Dictionary &p_opentype_features = Dictionary(), const String &p_language = "", float p_width = -1.f, TextServer::Direction p_direction = TextServer::DIRECTION_AUTO, TextServer::Orientation p_orientation = TextServer::ORIENTATION_HORIZONTAL); + TextParagraph(const String &p_text, const Ref<Font> &p_font, int p_font_size, const String &p_language = "", float p_width = -1.f, TextServer::Direction p_direction = TextServer::DIRECTION_AUTO, TextServer::Orientation p_orientation = TextServer::ORIENTATION_HORIZONTAL); TextParagraph(); ~TextParagraph(); }; diff --git a/scene/resources/texture.cpp b/scene/resources/texture.cpp index f31a71eada..e58ef68388 100644 --- a/scene/resources/texture.cpp +++ b/scene/resources/texture.cpp @@ -3016,12 +3016,12 @@ Error ImageTextureLayered::create_from_images(Vector<Ref<Image>> p_images) { } void ImageTextureLayered::update_layer(const Ref<Image> &p_image, int p_layer) { - ERR_FAIL_COND(texture.is_valid()); - ERR_FAIL_COND(p_image.is_null()); - ERR_FAIL_COND(p_image->get_format() != format); - ERR_FAIL_COND(p_image->get_width() != width || p_image->get_height() != height); - ERR_FAIL_INDEX(p_layer, layers); - ERR_FAIL_COND(p_image->has_mipmaps() != mipmaps); + ERR_FAIL_COND_MSG(texture.is_null(), "Texture is not initialized."); + ERR_FAIL_COND_MSG(p_image.is_null(), "Invalid image."); + ERR_FAIL_COND_MSG(p_image->get_format() != format, "Image format must match texture's image format."); + ERR_FAIL_COND_MSG(p_image->get_width() != width || p_image->get_height() != height, "Image size must match texture's image size."); + ERR_FAIL_COND_MSG(p_image->has_mipmaps() != mipmaps, "Image mipmap configuration must match texture's image mipmap configuration."); + ERR_FAIL_INDEX_MSG(p_layer, layers, "Layer index is out of bounds."); RS::get_singleton()->texture_2d_update(texture, p_image, p_layer); } diff --git a/scene/resources/world_3d.cpp b/scene/resources/world_3d.cpp index a84ee773b4..fb6dcd3d57 100644 --- a/scene/resources/world_3d.cpp +++ b/scene/resources/world_3d.cpp @@ -31,7 +31,6 @@ #include "world_3d.h" #include "core/config/project_settings.h" -#include "core/math/octree.h" #include "scene/3d/camera_3d.h" #include "scene/3d/visible_on_screen_notifier_3d.h" #include "scene/scene_string_names.h" diff --git a/servers/rendering/SCsub b/servers/rendering/SCsub index 06d1d28b08..cf26ca029d 100644 --- a/servers/rendering/SCsub +++ b/servers/rendering/SCsub @@ -4,5 +4,6 @@ Import("env") env.add_source_files(env.servers_sources, "*.cpp") +SConscript("dummy/SCsub") SConscript("renderer_rd/SCsub") SConscript("storage/SCsub") diff --git a/servers/rendering/dummy/SCsub b/servers/rendering/dummy/SCsub new file mode 100644 index 0000000000..aa688af6cd --- /dev/null +++ b/servers/rendering/dummy/SCsub @@ -0,0 +1,7 @@ +#!/usr/bin/env python + +Import("env") + +env.add_source_files(env.servers_sources, "*.cpp") + +SConscript("storage/SCsub") diff --git a/servers/rendering/dummy/environment/fog.h b/servers/rendering/dummy/environment/fog.h new file mode 100644 index 0000000000..8a2be90507 --- /dev/null +++ b/servers/rendering/dummy/environment/fog.h @@ -0,0 +1,55 @@ +/*************************************************************************/ +/* fog.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2022 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. */ +/*************************************************************************/ + +#ifndef FOG_DUMMY_H +#define FOG_DUMMY_H + +#include "servers/rendering/environment/renderer_fog.h" + +namespace RendererDummy { + +class Fog : public RendererFog { +public: + /* FOG VOLUMES */ + + virtual RID fog_volume_allocate() override { return RID(); } + virtual void fog_volume_initialize(RID p_rid) override {} + virtual void fog_free(RID p_rid) override {} + + virtual void fog_volume_set_shape(RID p_fog_volume, RS::FogVolumeShape p_shape) override {} + virtual void fog_volume_set_extents(RID p_fog_volume, const Vector3 &p_extents) override {} + virtual void fog_volume_set_material(RID p_fog_volume, RID p_material) override {} + virtual AABB fog_volume_get_aabb(RID p_fog_volume) const override { return AABB(); } + virtual RS::FogVolumeShape fog_volume_get_shape(RID p_fog_volume) const override { return RS::FOG_VOLUME_SHAPE_BOX; } +}; + +} // namespace RendererDummy + +#endif // !FOG_DUMMY_H diff --git a/servers/rendering/dummy/environment/gi.h b/servers/rendering/dummy/environment/gi.h index 374f0c8923..9c7647c2de 100644 --- a/servers/rendering/dummy/environment/gi.h +++ b/servers/rendering/dummy/environment/gi.h @@ -74,9 +74,6 @@ public: virtual void voxel_gi_set_use_two_bounces(RID p_voxel_gi, bool p_enable) override {} virtual bool voxel_gi_is_using_two_bounces(RID p_voxel_gi) const override { return false; } - virtual void voxel_gi_set_anisotropy_strength(RID p_voxel_gi, float p_strength) override {} - virtual float voxel_gi_get_anisotropy_strength(RID p_voxel_gi) const override { return 0; } - virtual uint32_t voxel_gi_get_version(RID p_voxel_gi) const override { return 0; } }; diff --git a/servers/rendering/dummy/rasterizer_dummy.h b/servers/rendering/dummy/rasterizer_dummy.h index 9c2bd45cce..d867114384 100644 --- a/servers/rendering/dummy/rasterizer_dummy.h +++ b/servers/rendering/dummy/rasterizer_dummy.h @@ -34,15 +34,16 @@ #include "core/templates/rid_owner.h" #include "core/templates/self_list.h" #include "scene/resources/mesh.h" +#include "servers/rendering/dummy/environment/fog.h" #include "servers/rendering/dummy/environment/gi.h" #include "servers/rendering/dummy/rasterizer_canvas_dummy.h" #include "servers/rendering/dummy/rasterizer_scene_dummy.h" -#include "servers/rendering/dummy/rasterizer_storage_dummy.h" #include "servers/rendering/dummy/storage/light_storage.h" #include "servers/rendering/dummy/storage/material_storage.h" #include "servers/rendering/dummy/storage/mesh_storage.h" #include "servers/rendering/dummy/storage/particles_storage.h" #include "servers/rendering/dummy/storage/texture_storage.h" +#include "servers/rendering/dummy/storage/utilities.h" #include "servers/rendering/renderer_compositor.h" #include "servers/rendering_server.h" @@ -53,23 +54,25 @@ private: protected: RasterizerCanvasDummy canvas; + RendererDummy::Utilities utilities; RendererDummy::LightStorage light_storage; RendererDummy::MaterialStorage material_storage; RendererDummy::MeshStorage mesh_storage; RendererDummy::ParticlesStorage particles_storage; RendererDummy::TextureStorage texture_storage; RendererDummy::GI gi; - RasterizerStorageDummy storage; + RendererDummy::Fog fog; RasterizerSceneDummy scene; public: + RendererUtilities *get_utilities() override { return &utilities; }; RendererLightStorage *get_light_storage() override { return &light_storage; }; RendererMaterialStorage *get_material_storage() override { return &material_storage; }; RendererMeshStorage *get_mesh_storage() override { return &mesh_storage; }; RendererParticlesStorage *get_particles_storage() override { return &particles_storage; }; RendererTextureStorage *get_texture_storage() override { return &texture_storage; }; RendererGI *get_gi() override { return &gi; }; - RendererStorage *get_storage() override { return &storage; } + RendererFog *get_fog() override { return &fog; }; RendererCanvasRender *get_canvas() override { return &canvas; } RendererSceneRender *get_scene() override { return &scene; } diff --git a/servers/rendering/dummy/storage/SCsub b/servers/rendering/dummy/storage/SCsub new file mode 100644 index 0000000000..86681f9c74 --- /dev/null +++ b/servers/rendering/dummy/storage/SCsub @@ -0,0 +1,5 @@ +#!/usr/bin/env python + +Import("env") + +env.add_source_files(env.servers_sources, "*.cpp") diff --git a/servers/rendering/dummy/storage/material_storage.h b/servers/rendering/dummy/storage/material_storage.h index 8890be8ea9..d4809f81e3 100644 --- a/servers/rendering/dummy/storage/material_storage.h +++ b/servers/rendering/dummy/storage/material_storage.h @@ -32,6 +32,7 @@ #define MATERIAL_STORAGE_DUMMY_H #include "servers/rendering/storage/material_storage.h" +#include "servers/rendering/storage/utilities.h" namespace RendererDummy { @@ -87,7 +88,7 @@ public: virtual bool material_is_animated(RID p_material) override { return false; } virtual bool material_casts_shadows(RID p_material) override { return false; } virtual void material_get_instance_shader_parameters(RID p_material, List<InstanceShaderParam> *r_parameters) override {} - virtual void material_update_dependency(RID p_material, RendererStorage::DependencyTracker *p_instance) override {} + virtual void material_update_dependency(RID p_material, DependencyTracker *p_instance) override {} }; } // namespace RendererDummy diff --git a/servers/rendering/dummy/storage/mesh_storage.h b/servers/rendering/dummy/storage/mesh_storage.h index dfbd265bba..78b19d721d 100644 --- a/servers/rendering/dummy/storage/mesh_storage.h +++ b/servers/rendering/dummy/storage/mesh_storage.h @@ -32,6 +32,7 @@ #define MESH_STORAGE_DUMMY_H #include "servers/rendering/storage/mesh_storage.h" +#include "servers/rendering/storage/utilities.h" namespace RendererDummy { @@ -121,7 +122,11 @@ public: virtual void skeleton_bone_set_transform_2d(RID p_skeleton, int p_bone, const Transform2D &p_transform) override {} virtual Transform2D skeleton_bone_get_transform_2d(RID p_skeleton, int p_bone) const override { return Transform2D(); } - virtual void skeleton_update_dependency(RID p_base, RendererStorage::DependencyTracker *p_instance) override {} + virtual void skeleton_update_dependency(RID p_base, DependencyTracker *p_instance) override {} + + /* OCCLUDER */ + + void occluder_set_mesh(RID p_occluder, const PackedVector3Array &p_vertices, const PackedInt32Array &p_indices) {} }; } // namespace RendererDummy diff --git a/servers/rendering/dummy/storage/texture_storage.cpp b/servers/rendering/dummy/storage/texture_storage.cpp new file mode 100644 index 0000000000..62e2a306a2 --- /dev/null +++ b/servers/rendering/dummy/storage/texture_storage.cpp @@ -0,0 +1,43 @@ +/*************************************************************************/ +/* texture_storage.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2022 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 "texture_storage.h" + +using namespace RendererDummy; + +TextureStorage *TextureStorage::singleton = nullptr; + +TextureStorage::TextureStorage() { + singleton = this; +} + +TextureStorage::~TextureStorage() { + singleton = nullptr; +} diff --git a/servers/rendering/dummy/storage/texture_storage.h b/servers/rendering/dummy/storage/texture_storage.h index 11d827a6e3..fe10f6489c 100644 --- a/servers/rendering/dummy/storage/texture_storage.h +++ b/servers/rendering/dummy/storage/texture_storage.h @@ -38,6 +38,8 @@ namespace RendererDummy { class TextureStorage : public RendererTextureStorage { private: + static TextureStorage *singleton; + struct DummyTexture { Ref<Image> image; }; @@ -45,11 +47,12 @@ private: public: static TextureStorage *get_singleton() { - // Here we cheat until we can retire RasterizerStorageDummy::free() - - return (TextureStorage *)RSG::texture_storage; + return singleton; }; + TextureStorage(); + ~TextureStorage(); + virtual bool can_create_resources_async() const override { return false; } /* Canvas Texture API */ diff --git a/servers/rendering/dummy/rasterizer_storage_dummy.h b/servers/rendering/dummy/storage/utilities.h index 7f637d2c42..f090309e88 100644 --- a/servers/rendering/dummy/rasterizer_storage_dummy.h +++ b/servers/rendering/dummy/storage/utilities.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* rasterizer_storage_dummy.h */ +/* utilities.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -28,79 +28,71 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#ifndef RASTERIZER_STORAGE_DUMMY_H -#define RASTERIZER_STORAGE_DUMMY_H +#ifndef UTILITIES_DUMMY_H +#define UTILITIES_DUMMY_H -#include "servers/rendering/renderer_storage.h" -#include "storage/texture_storage.h" +#include "servers/rendering/storage/utilities.h" +#include "texture_storage.h" -class RasterizerStorageDummy : public RendererStorage { -public: - void base_update_dependency(RID p_base, DependencyTracker *p_instance) override {} - - /* OCCLUDER */ +namespace RendererDummy { - void occluder_set_mesh(RID p_occluder, const PackedVector3Array &p_vertices, const PackedInt32Array &p_indices) {} +class Utilities : public RendererUtilities { +public: + /* INSTANCES */ - /* FOG VOLUMES */ + virtual RS::InstanceType get_base_type(RID p_rid) const override { return RS::INSTANCE_NONE; } + virtual bool free(RID p_rid) override { + if (RendererDummy::TextureStorage::get_singleton()->owns_texture(p_rid)) { + RendererDummy::TextureStorage::get_singleton()->texture_free(p_rid); + return true; + } + return false; + } - RID fog_volume_allocate() override { return RID(); } - void fog_volume_initialize(RID p_rid) override {} + /* DEPENDENCIES */ - void fog_volume_set_shape(RID p_fog_volume, RS::FogVolumeShape p_shape) override {} - void fog_volume_set_extents(RID p_fog_volume, const Vector3 &p_extents) override {} - void fog_volume_set_material(RID p_fog_volume, RID p_material) override {} - AABB fog_volume_get_aabb(RID p_fog_volume) const override { return AABB(); } - RS::FogVolumeShape fog_volume_get_shape(RID p_fog_volume) const override { return RS::FOG_VOLUME_SHAPE_BOX; } + virtual void base_update_dependency(RID p_base, DependencyTracker *p_instance) override {} /* VISIBILITY NOTIFIER */ + virtual RID visibility_notifier_allocate() override { return RID(); } virtual void visibility_notifier_initialize(RID p_notifier) override {} + virtual void visibility_notifier_free(RID p_notifier) override {} + virtual void visibility_notifier_set_aabb(RID p_notifier, const AABB &p_aabb) override {} virtual void visibility_notifier_set_callbacks(RID p_notifier, const Callable &p_enter_callbable, const Callable &p_exit_callable) override {} virtual AABB visibility_notifier_get_aabb(RID p_notifier) const override { return AABB(); } virtual void visibility_notifier_call(RID p_notifier, bool p_enter, bool p_deferred) override {} - /* STORAGE */ + /* TIMING */ - RS::InstanceType get_base_type(RID p_rid) const override { return RS::INSTANCE_NONE; } - bool free(RID p_rid) override { - if (RendererDummy::TextureStorage::get_singleton()->owns_texture(p_rid)) { - RendererDummy::TextureStorage::get_singleton()->texture_free(p_rid); - return true; - } - return false; - } + virtual void capture_timestamps_begin() override {} + virtual void capture_timestamp(const String &p_name) override {} + virtual uint32_t get_captured_timestamps_count() const override { return 0; } + virtual uint64_t get_captured_timestamps_frame() const override { return 0; } + virtual uint64_t get_captured_timestamp_gpu_time(uint32_t p_index) const override { return 0; } + virtual uint64_t get_captured_timestamp_cpu_time(uint32_t p_index) const override { return 0; } + virtual String get_captured_timestamp_name(uint32_t p_index) const override { return String(); } - virtual void update_memory_info() override {} - virtual uint64_t get_rendering_info(RS::RenderingInfo p_info) override { return 0; } + /* MISC */ + + virtual void update_dirty_resources() override {} + virtual void set_debug_generate_wireframes(bool p_generate) override {} - bool has_os_feature(const String &p_feature) const override { + virtual bool has_os_feature(const String &p_feature) const override { return p_feature == "rgtc" || p_feature == "bptc" || p_feature == "s3tc" || p_feature == "etc" || p_feature == "etc2"; } - void update_dirty_resources() override {} - - void set_debug_generate_wireframes(bool p_generate) override {} - - String get_video_adapter_name() const override { return String(); } - String get_video_adapter_vendor() const override { return String(); } - RenderingDevice::DeviceType get_video_adapter_type() const override { return RenderingDevice::DeviceType::DEVICE_TYPE_OTHER; } - String get_video_adapter_api_version() const override { return String(); } - - static RendererStorage *base_singleton; - - void capture_timestamps_begin() override {} - void capture_timestamp(const String &p_name) override {} - uint32_t get_captured_timestamps_count() const override { return 0; } - uint64_t get_captured_timestamps_frame() const override { return 0; } - uint64_t get_captured_timestamp_gpu_time(uint32_t p_index) const override { return 0; } - uint64_t get_captured_timestamp_cpu_time(uint32_t p_index) const override { return 0; } - String get_captured_timestamp_name(uint32_t p_index) const override { return String(); } + virtual void update_memory_info() override {} - RasterizerStorageDummy() {} - ~RasterizerStorageDummy() {} + virtual uint64_t get_rendering_info(RS::RenderingInfo p_info) override { return 0; } + virtual String get_video_adapter_name() const override { return String(); } + virtual String get_video_adapter_vendor() const override { return String(); } + virtual RenderingDevice::DeviceType get_video_adapter_type() const override { return RenderingDevice::DeviceType::DEVICE_TYPE_OTHER; } + virtual String get_video_adapter_api_version() const override { return String(); } }; -#endif // !RASTERIZER_STORAGE_DUMMY_H +} // namespace RendererDummy + +#endif // !UTILITIES_DUMMY_H diff --git a/servers/rendering/environment/renderer_fog.h b/servers/rendering/environment/renderer_fog.h new file mode 100644 index 0000000000..ac50da0fc0 --- /dev/null +++ b/servers/rendering/environment/renderer_fog.h @@ -0,0 +1,53 @@ +/*************************************************************************/ +/* renderer_fog.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2022 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. */ +/*************************************************************************/ + +#ifndef RENDERER_FOG_H +#define RENDERER_FOG_H + +#include "servers/rendering_server.h" + +class RendererFog { +public: + virtual ~RendererFog() {} + + /* FOG VOLUMES */ + + virtual RID fog_volume_allocate() = 0; + virtual void fog_volume_initialize(RID p_rid) = 0; + virtual void fog_free(RID p_rid) = 0; + + virtual void fog_volume_set_shape(RID p_fog_volume, RS::FogVolumeShape p_shape) = 0; + virtual void fog_volume_set_extents(RID p_fog_volume, const Vector3 &p_extents) = 0; + virtual void fog_volume_set_material(RID p_fog_volume, RID p_material) = 0; + virtual AABB fog_volume_get_aabb(RID p_fog_volume) const = 0; + virtual RS::FogVolumeShape fog_volume_get_shape(RID p_fog_volume) const = 0; +}; + +#endif // !RENDERER_FOG_H diff --git a/servers/rendering/environment/renderer_gi.h b/servers/rendering/environment/renderer_gi.h index c4f63b7b6b..4f93bb8675 100644 --- a/servers/rendering/environment/renderer_gi.h +++ b/servers/rendering/environment/renderer_gi.h @@ -31,7 +31,6 @@ #ifndef RENDERER_GI_H #define RENDERER_GI_H -#include "servers/rendering/renderer_storage.h" #include "servers/rendering_server.h" class RendererGI { @@ -76,9 +75,6 @@ public: virtual void voxel_gi_set_use_two_bounces(RID p_voxel_gi, bool p_enable) = 0; virtual bool voxel_gi_is_using_two_bounces(RID p_voxel_gi) const = 0; - virtual void voxel_gi_set_anisotropy_strength(RID p_voxel_gi, float p_strength) = 0; - virtual float voxel_gi_get_anisotropy_strength(RID p_voxel_gi) const = 0; - virtual uint32_t voxel_gi_get_version(RID p_probe) const = 0; }; diff --git a/servers/rendering/renderer_canvas_render.cpp b/servers/rendering/renderer_canvas_render.cpp index 163a24247e..f93fdd500a 100644 --- a/servers/rendering/renderer_canvas_render.cpp +++ b/servers/rendering/renderer_canvas_render.cpp @@ -128,3 +128,9 @@ const Rect2 &RendererCanvasRender::Item::get_rect() const { rect_dirty = false; return rect; } + +RendererCanvasRender::Item::CommandMesh::~CommandMesh() { + if (mesh_instance.is_valid()) { + RSG::mesh_storage->mesh_free(mesh_instance); + } +} diff --git a/servers/rendering/renderer_canvas_render.h b/servers/rendering/renderer_canvas_render.h index 1724a99b20..52b2f82089 100644 --- a/servers/rendering/renderer_canvas_render.h +++ b/servers/rendering/renderer_canvas_render.h @@ -31,7 +31,7 @@ #ifndef RENDERINGSERVERCANVASRENDER_H #define RENDERINGSERVERCANVASRENDER_H -#include "servers/rendering/renderer_storage.h" +#include "servers/rendering_server.h" class RendererCanvasRender { public: @@ -257,11 +257,7 @@ public: RID texture; CommandMesh() { type = TYPE_MESH; } - ~CommandMesh() { - if (mesh_instance.is_valid()) { - RendererStorage::base_singleton->free(mesh_instance); - } - } + ~CommandMesh(); }; struct CommandMultiMesh : public Command { diff --git a/servers/rendering/renderer_compositor.h b/servers/rendering/renderer_compositor.h index f58bc851ef..a67eb25736 100644 --- a/servers/rendering/renderer_compositor.h +++ b/servers/rendering/renderer_compositor.h @@ -31,15 +31,16 @@ #ifndef RENDERING_SERVER_COMPOSITOR_H #define RENDERING_SERVER_COMPOSITOR_H +#include "servers/rendering/environment/renderer_fog.h" #include "servers/rendering/environment/renderer_gi.h" #include "servers/rendering/renderer_canvas_render.h" #include "servers/rendering/renderer_scene.h" -#include "servers/rendering/renderer_storage.h" #include "servers/rendering/storage/light_storage.h" #include "servers/rendering/storage/material_storage.h" #include "servers/rendering/storage/mesh_storage.h" #include "servers/rendering/storage/particles_storage.h" #include "servers/rendering/storage/texture_storage.h" +#include "servers/rendering/storage/utilities.h" #include "servers/rendering_server.h" class RendererSceneRender; @@ -77,13 +78,14 @@ protected: public: static RendererCompositor *create(); + virtual RendererUtilities *get_utilities() = 0; virtual RendererLightStorage *get_light_storage() = 0; virtual RendererMaterialStorage *get_material_storage() = 0; virtual RendererMeshStorage *get_mesh_storage() = 0; virtual RendererParticlesStorage *get_particles_storage() = 0; virtual RendererTextureStorage *get_texture_storage() = 0; virtual RendererGI *get_gi() = 0; - virtual RendererStorage *get_storage() = 0; + virtual RendererFog *get_fog() = 0; virtual RendererCanvasRender *get_canvas() = 0; virtual RendererSceneRender *get_scene() = 0; diff --git a/servers/rendering/renderer_rd/cluster_builder_rd.cpp b/servers/rendering/renderer_rd/cluster_builder_rd.cpp index 0b36fe3964..228933d618 100644 --- a/servers/rendering/renderer_rd/cluster_builder_rd.cpp +++ b/servers/rendering/renderer_rd/cluster_builder_rd.cpp @@ -413,7 +413,7 @@ void ClusterBuilderRD::bake_cluster() { StateUniform state; - RendererStorageRD::store_camera(adjusted_projection, state.projection); + RendererRD::MaterialStorage::store_camera(adjusted_projection, state.projection); state.inv_z_far = 1.0 / z_far; state.screen_to_clusters_shift = get_shift_from_power_of_2(cluster_size); state.screen_to_clusters_shift -= divisor; //screen is smaller, shift one less diff --git a/servers/rendering/renderer_rd/cluster_builder_rd.h b/servers/rendering/renderer_rd/cluster_builder_rd.h index e82193ea6a..74ca530ff6 100644 --- a/servers/rendering/renderer_rd/cluster_builder_rd.h +++ b/servers/rendering/renderer_rd/cluster_builder_rd.h @@ -31,10 +31,10 @@ #ifndef CLUSTER_BUILDER_RD_H #define CLUSTER_BUILDER_RD_H -#include "servers/rendering/renderer_rd/renderer_storage_rd.h" #include "servers/rendering/renderer_rd/shaders/cluster_debug.glsl.gen.h" #include "servers/rendering/renderer_rd/shaders/cluster_render.glsl.gen.h" #include "servers/rendering/renderer_rd/shaders/cluster_store.glsl.gen.h" +#include "servers/rendering/renderer_rd/storage_rd/material_storage.h" class ClusterBuilderSharedDataRD { friend class ClusterBuilderRD; @@ -261,7 +261,7 @@ public: e.type = ELEMENT_TYPE_OMNI_LIGHT; e.original_index = cluster_count_by_type[ELEMENT_TYPE_OMNI_LIGHT]; - RendererStorageRD::store_transform_transposed_3x4(xform, e.transform_inv); + RendererRD::MaterialStorage::store_transform_transposed_3x4(xform, e.transform_inv); cluster_count_by_type[ELEMENT_TYPE_OMNI_LIGHT]++; @@ -309,7 +309,7 @@ public: e.type = ELEMENT_TYPE_SPOT_LIGHT; e.original_index = cluster_count_by_type[ELEMENT_TYPE_SPOT_LIGHT]; //use omni since they share index - RendererStorageRD::store_transform_transposed_3x4(xform, e.transform_inv); + RendererRD::MaterialStorage::store_transform_transposed_3x4(xform, e.transform_inv); cluster_count_by_type[ELEMENT_TYPE_SPOT_LIGHT]++; } @@ -356,7 +356,7 @@ public: e.type = (p_box_type == BOX_TYPE_DECAL) ? ELEMENT_TYPE_DECAL : ELEMENT_TYPE_REFLECTION_PROBE; e.original_index = cluster_count_by_type[e.type]; - RendererStorageRD::store_transform_transposed_3x4(xform, e.transform_inv); + RendererRD::MaterialStorage::store_transform_transposed_3x4(xform, e.transform_inv); cluster_count_by_type[e.type]++; render_element_count++; diff --git a/servers/rendering/renderer_rd/environment/fog.cpp b/servers/rendering/renderer_rd/environment/fog.cpp new file mode 100644 index 0000000000..2a6c96480e --- /dev/null +++ b/servers/rendering/renderer_rd/environment/fog.cpp @@ -0,0 +1,128 @@ +/*************************************************************************/ +/* fog.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2022 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 "fog.h" + +using namespace RendererRD; + +Fog *Fog::singleton = nullptr; + +Fog::Fog() { + singleton = this; +} + +Fog::~Fog() { + singleton = nullptr; +} + +/* FOG VOLUMES */ + +RID Fog::fog_volume_allocate() { + return fog_volume_owner.allocate_rid(); +} + +void Fog::fog_volume_initialize(RID p_rid) { + fog_volume_owner.initialize_rid(p_rid, FogVolume()); +} + +void Fog::fog_free(RID p_rid) { + FogVolume *fog_volume = fog_volume_owner.get_or_null(p_rid); + fog_volume->dependency.deleted_notify(p_rid); + fog_volume_owner.free(p_rid); +} + +void Fog::fog_volume_set_shape(RID p_fog_volume, RS::FogVolumeShape p_shape) { + FogVolume *fog_volume = fog_volume_owner.get_or_null(p_fog_volume); + ERR_FAIL_COND(!fog_volume); + + if (p_shape == fog_volume->shape) { + return; + } + + fog_volume->shape = p_shape; + fog_volume->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_AABB); +} + +void Fog::fog_volume_set_extents(RID p_fog_volume, const Vector3 &p_extents) { + FogVolume *fog_volume = fog_volume_owner.get_or_null(p_fog_volume); + ERR_FAIL_COND(!fog_volume); + + fog_volume->extents = p_extents; + fog_volume->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_AABB); +} + +void Fog::fog_volume_set_material(RID p_fog_volume, RID p_material) { + FogVolume *fog_volume = fog_volume_owner.get_or_null(p_fog_volume); + ERR_FAIL_COND(!fog_volume); + fog_volume->material = p_material; +} + +RID Fog::fog_volume_get_material(RID p_fog_volume) const { + FogVolume *fog_volume = fog_volume_owner.get_or_null(p_fog_volume); + ERR_FAIL_COND_V(!fog_volume, RID()); + + return fog_volume->material; +} + +RS::FogVolumeShape Fog::fog_volume_get_shape(RID p_fog_volume) const { + FogVolume *fog_volume = fog_volume_owner.get_or_null(p_fog_volume); + ERR_FAIL_COND_V(!fog_volume, RS::FOG_VOLUME_SHAPE_BOX); + + return fog_volume->shape; +} + +AABB Fog::fog_volume_get_aabb(RID p_fog_volume) const { + FogVolume *fog_volume = fog_volume_owner.get_or_null(p_fog_volume); + ERR_FAIL_COND_V(!fog_volume, AABB()); + + switch (fog_volume->shape) { + case RS::FOG_VOLUME_SHAPE_ELLIPSOID: + case RS::FOG_VOLUME_SHAPE_CONE: + case RS::FOG_VOLUME_SHAPE_CYLINDER: + case RS::FOG_VOLUME_SHAPE_BOX: { + AABB aabb; + aabb.position = -fog_volume->extents; + aabb.size = fog_volume->extents * 2; + return aabb; + } + default: { + // Need some size otherwise will get culled + return AABB(Vector3(-1, -1, -1), Vector3(2, 2, 2)); + } + } + + return AABB(); +} + +Vector3 Fog::fog_volume_get_extents(RID p_fog_volume) const { + const FogVolume *fog_volume = fog_volume_owner.get_or_null(p_fog_volume); + ERR_FAIL_COND_V(!fog_volume, Vector3()); + return fog_volume->extents; +} diff --git a/editor/plugins/ot_features_plugin.h b/servers/rendering/renderer_rd/environment/fog.h index 6639148080..55a01c3616 100644 --- a/editor/plugins/ot_features_plugin.h +++ b/servers/rendering/renderer_rd/environment/fog.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* ot_features_plugin.h */ +/* fog.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -28,75 +28,56 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#ifndef OT_FEATURES_PLUGIN_H -#define OT_FEATURES_PLUGIN_H +#ifndef FOG_RD_H +#define FOG_RD_H -#include "editor/editor_plugin.h" -#include "editor/editor_properties.h" +#include "core/templates/local_vector.h" +#include "core/templates/rid_owner.h" +#include "servers/rendering/environment/renderer_fog.h" +#include "servers/rendering/storage/utilities.h" -/*************************************************************************/ - -class OpenTypeFeaturesEditor : public EditorProperty { - GDCLASS(OpenTypeFeaturesEditor, EditorProperty); - EditorSpinSlider *spin = nullptr; - bool setting = true; - void _value_changed(double p_val); - Button *button = nullptr; - - void _remove_feature(); - -protected: - void _notification(int p_what); - static void _bind_methods(); +namespace RendererRD { +class Fog : public RendererFog { public: - virtual void update_property() override; - OpenTypeFeaturesEditor(); -}; + struct FogVolume { + RID material; + Vector3 extents = Vector3(1, 1, 1); -/*************************************************************************/ - -class OpenTypeFeaturesAdd : public Button { - GDCLASS(OpenTypeFeaturesAdd, Button); + RS::FogVolumeShape shape = RS::FOG_VOLUME_SHAPE_BOX; - Object *edited_object = nullptr; - PopupMenu *menu = nullptr; - PopupMenu *menu_ss = nullptr; - PopupMenu *menu_cv = nullptr; - PopupMenu *menu_cu = nullptr; + Dependency dependency; + }; - void _add_feature(int p_option); - void _features_menu(); +private: + static Fog *singleton; -protected: - void _notification(int p_what); - static void _bind_methods(); + mutable RID_Owner<FogVolume, true> fog_volume_owner; public: - void setup(Object *p_object); + static Fog *get_singleton() { return singleton; } - OpenTypeFeaturesAdd(); -}; + Fog(); + ~Fog(); -/*************************************************************************/ + /* FOG VOLUMES */ -class EditorInspectorPluginOpenTypeFeatures : public EditorInspectorPlugin { - GDCLASS(EditorInspectorPluginOpenTypeFeatures, EditorInspectorPlugin); + FogVolume *get_fog_volume(RID p_rid) { return fog_volume_owner.get_or_null(p_rid); }; + bool owns_fog_volume(RID p_rid) { return fog_volume_owner.owns(p_rid); }; -public: - virtual bool can_handle(Object *p_object) override; - virtual bool parse_property(Object *p_object, const Variant::Type p_type, const String &p_path, const PropertyHint p_hint, const String &p_hint_text, const uint32_t p_usage, const bool p_wide = false) override; -}; - -/*************************************************************************/ + virtual RID fog_volume_allocate() override; + virtual void fog_volume_initialize(RID p_rid) override; + virtual void fog_free(RID p_rid) override; -class OpenTypeFeaturesEditorPlugin : public EditorPlugin { - GDCLASS(OpenTypeFeaturesEditorPlugin, EditorPlugin); - -public: - OpenTypeFeaturesEditorPlugin(); - - virtual String get_name() const override { return "OpenTypeFeatures"; } + virtual void fog_volume_set_shape(RID p_fog_volume, RS::FogVolumeShape p_shape) override; + virtual void fog_volume_set_extents(RID p_fog_volume, const Vector3 &p_extents) override; + virtual void fog_volume_set_material(RID p_fog_volume, RID p_material) override; + virtual RS::FogVolumeShape fog_volume_get_shape(RID p_fog_volume) const override; + RID fog_volume_get_material(RID p_fog_volume) const; + virtual AABB fog_volume_get_aabb(RID p_fog_volume) const override; + Vector3 fog_volume_get_extents(RID p_fog_volume) const; }; -#endif // OT_FEATURES_PLUGIN_H +} // namespace RendererRD + +#endif // !FOG_RD_H diff --git a/servers/rendering/renderer_rd/environment/gi.cpp b/servers/rendering/renderer_rd/environment/gi.cpp index 19c97eaeeb..a749e7d5bc 100644 --- a/servers/rendering/renderer_rd/environment/gi.cpp +++ b/servers/rendering/renderer_rd/environment/gi.cpp @@ -33,7 +33,6 @@ #include "core/config/project_settings.h" #include "servers/rendering/renderer_rd/renderer_compositor_rd.h" #include "servers/rendering/renderer_rd/renderer_scene_render_rd.h" -#include "servers/rendering/renderer_rd/renderer_storage_rd.h" #include "servers/rendering/renderer_rd/storage_rd/material_storage.h" #include "servers/rendering/renderer_rd/storage_rd/texture_storage.h" #include "servers/rendering/rendering_server_default.h" @@ -184,7 +183,7 @@ void GI::voxel_gi_allocate_data(RID p_voxel_gi, const Transform3D &p_to_cell_xfo voxel_gi->version++; voxel_gi->data_version++; - voxel_gi->dependency.changed_notify(RendererStorage::DEPENDENCY_CHANGED_AABB); + voxel_gi->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_AABB); } AABB GI::voxel_gi_get_bounds(RID p_voxel_gi) const { @@ -312,19 +311,6 @@ float GI::voxel_gi_get_normal_bias(RID p_voxel_gi) const { return voxel_gi->normal_bias; } -void GI::voxel_gi_set_anisotropy_strength(RID p_voxel_gi, float p_strength) { - VoxelGI *voxel_gi = voxel_gi_owner.get_or_null(p_voxel_gi); - ERR_FAIL_COND(!voxel_gi); - - voxel_gi->anisotropy_strength = p_strength; -} - -float GI::voxel_gi_get_anisotropy_strength(RID p_voxel_gi) const { - VoxelGI *voxel_gi = voxel_gi_owner.get_or_null(p_voxel_gi); - ERR_FAIL_COND_V(!voxel_gi, 0); - return voxel_gi->anisotropy_strength; -} - void GI::voxel_gi_set_interior(RID p_voxel_gi, bool p_enable) { VoxelGI *voxel_gi = voxel_gi_owner.get_or_null(p_voxel_gi); ERR_FAIL_COND(!voxel_gi); @@ -390,7 +376,6 @@ void GI::SDFGI::create(RendererSceneEnvironmentRD *p_env, const Vector3 &p_world RendererRD::TextureStorage *texture_storage = RendererRD::TextureStorage::get_singleton(); RendererRD::MaterialStorage *material_storage = RendererRD::MaterialStorage::get_singleton(); - storage = p_gi->storage; gi = p_gi; num_cascades = p_env->sdfgi_cascades; min_cell_size = p_env->sdfgi_min_cell_size; @@ -1287,7 +1272,7 @@ void GI::SDFGI::update_probes(RendererSceneEnvironmentRD *p_env, RendererSceneSk if (p_env->background == RS::ENV_BG_CLEAR_COLOR) { push_constant.sky_mode = SDFGIShader::IntegratePushConstant::SKY_MODE_COLOR; - Color c = storage->get_default_clear_color().srgb_to_linear(); + Color c = RSG::texture_storage->get_default_clear_color().srgb_to_linear(); push_constant.sky_color[0] = c.r; push_constant.sky_color[1] = c.g; push_constant.sky_color[2] = c.b; @@ -1636,7 +1621,7 @@ void GI::SDFGI::debug_probes(RID p_framebuffer, const uint32_t p_view_count, con } for (uint32_t v = 0; v < p_view_count; v++) { - RendererStorageRD::store_camera(p_camera_with_transforms[v], scene_data.projection[v]); + RendererRD::MaterialStorage::store_camera(p_camera_with_transforms[v], scene_data.projection[v]); } RD::get_singleton()->buffer_update(debug_probes_scene_data_ubo, 0, sizeof(SDFGIShader::DebugProbesSceneData), &scene_data, RD::BARRIER_MASK_RASTER); @@ -3218,12 +3203,10 @@ GI::~GI() { singleton = nullptr; } -void GI::init(RendererStorageRD *p_storage, RendererSceneSkyRD *p_sky) { +void GI::init(RendererSceneSkyRD *p_sky) { RendererRD::TextureStorage *texture_storage = RendererRD::TextureStorage::get_singleton(); RendererRD::MaterialStorage *material_storage = RendererRD::MaterialStorage::get_singleton(); - storage = p_storage; - /* GI */ { @@ -3679,7 +3662,7 @@ void GI::process_gi(RID p_render_buffers, RID *p_normal_roughness_views, RID p_v } for (uint32_t v = 0; v < p_view_count; v++) { - RendererStorageRD::store_camera(p_projections[v].inverse(), scene_data.inv_projection[v]); + RendererRD::MaterialStorage::store_camera(p_projections[v].inverse(), scene_data.inv_projection[v]); scene_data.eye_offset[v][0] = p_eye_offsets[v].x; scene_data.eye_offset[v][1] = p_eye_offsets[v].y; scene_data.eye_offset[v][2] = p_eye_offsets[v].z; @@ -3687,7 +3670,7 @@ void GI::process_gi(RID p_render_buffers, RID *p_normal_roughness_views, RID p_v } // Note that we will be ignoring the origin of this transform. - RendererStorageRD::store_transform(p_cam_transform, scene_data.cam_transform); + RendererRD::MaterialStorage::store_transform(p_cam_transform, scene_data.cam_transform); scene_data.screen_size[0] = rb->internal_width; scene_data.screen_size[1] = rb->internal_height; @@ -3921,7 +3904,6 @@ void GI::process_gi(RID p_render_buffers, RID *p_normal_roughness_views, RID p_v RID GI::voxel_gi_instance_create(RID p_base) { VoxelGIInstance voxel_gi; voxel_gi.gi = this; - voxel_gi.storage = storage; voxel_gi.probe = p_base; RID rid = voxel_gi_instance_owner.make_rid(voxel_gi); return rid; diff --git a/servers/rendering/renderer_rd/environment/gi.h b/servers/rendering/renderer_rd/environment/gi.h index b6ecfe42ea..294b8d3cfd 100644 --- a/servers/rendering/renderer_rd/environment/gi.h +++ b/servers/rendering/renderer_rd/environment/gi.h @@ -37,7 +37,6 @@ #include "servers/rendering/renderer_compositor.h" #include "servers/rendering/renderer_rd/renderer_scene_environment_rd.h" #include "servers/rendering/renderer_rd/renderer_scene_sky_rd.h" -#include "servers/rendering/renderer_rd/renderer_storage_rd.h" #include "servers/rendering/renderer_rd/shaders/environment/gi.glsl.gen.h" #include "servers/rendering/renderer_rd/shaders/environment/sdfgi_debug.glsl.gen.h" #include "servers/rendering/renderer_rd/shaders/environment/sdfgi_debug_probes.glsl.gen.h" @@ -47,8 +46,8 @@ #include "servers/rendering/renderer_rd/shaders/environment/voxel_gi.glsl.gen.h" #include "servers/rendering/renderer_rd/shaders/environment/voxel_gi_debug.glsl.gen.h" #include "servers/rendering/renderer_scene_render.h" -#include "servers/rendering/renderer_storage.h" #include "servers/rendering/rendering_device.h" +#include "servers/rendering/storage/utilities.h" // Forward declare RenderDataRD and RendererSceneRenderRD so we can pass it into some of our methods, these classes are pretty tightly bound struct RenderDataRD; @@ -84,16 +83,13 @@ public: bool interior = false; bool use_two_bounces = false; - float anisotropy_strength = 0.5; - uint32_t version = 1; uint32_t data_version = 1; - RendererStorage::Dependency dependency; + Dependency dependency; }; private: - RendererStorageRD *storage = nullptr; static GI *singleton; /* VOXEL GI STORAGE */ @@ -418,9 +414,6 @@ public: virtual void voxel_gi_set_use_two_bounces(RID p_voxel_gi, bool p_enable) override; virtual bool voxel_gi_is_using_two_bounces(RID p_voxel_gi) const override; - virtual void voxel_gi_set_anisotropy_strength(RID p_voxel_gi, float p_strength) override; - virtual float voxel_gi_get_anisotropy_strength(RID p_voxel_gi) const override; - virtual uint32_t voxel_gi_get_version(RID p_probe) const override; uint32_t voxel_gi_get_data_version(RID p_probe); @@ -435,7 +428,6 @@ public: struct VoxelGIInstance { // access to our containers - RendererStorageRD *storage = nullptr; GI *gi = nullptr; RID probe; @@ -559,7 +551,6 @@ public: }; // access to our containers - RendererStorageRD *storage = nullptr; GI *gi = nullptr; // used for rendering (voxelization) @@ -780,7 +771,7 @@ public: GI(); ~GI(); - void init(RendererStorageRD *p_storage, RendererSceneSkyRD *p_sky); + void init(RendererSceneSkyRD *p_sky); void free(); SDFGI *create_sdfgi(RendererSceneEnvironmentRD *p_env, const Vector3 &p_world_position, uint32_t p_requested_history_size); diff --git a/servers/rendering/renderer_rd/forward_clustered/render_forward_clustered.cpp b/servers/rendering/renderer_rd/forward_clustered/render_forward_clustered.cpp index c7048289c8..b1e0017e5b 100644 --- a/servers/rendering/renderer_rd/forward_clustered/render_forward_clustered.cpp +++ b/servers/rendering/renderer_rd/forward_clustered/render_forward_clustered.cpp @@ -30,6 +30,7 @@ #include "render_forward_clustered.h" #include "core/config/project_settings.h" +#include "servers/rendering/renderer_rd/renderer_compositor_rd.h" #include "servers/rendering/renderer_rd/storage_rd/light_storage.h" #include "servers/rendering/renderer_rd/storage_rd/mesh_storage.h" #include "servers/rendering/renderer_rd/storage_rd/particles_storage.h" @@ -812,15 +813,15 @@ void RenderForwardClustered::_setup_environment(const RenderDataRD *p_render_dat CameraMatrix projection = correction * p_render_data->cam_projection; //store camera into ubo - RendererStorageRD::store_camera(projection, scene_state.ubo.projection_matrix); - RendererStorageRD::store_camera(projection.inverse(), scene_state.ubo.inv_projection_matrix); - RendererStorageRD::store_transform(p_render_data->cam_transform, scene_state.ubo.inv_view_matrix); - RendererStorageRD::store_transform(p_render_data->cam_transform.affine_inverse(), scene_state.ubo.view_matrix); + RendererRD::MaterialStorage::store_camera(projection, scene_state.ubo.projection_matrix); + RendererRD::MaterialStorage::store_camera(projection.inverse(), scene_state.ubo.inv_projection_matrix); + RendererRD::MaterialStorage::store_transform(p_render_data->cam_transform, scene_state.ubo.inv_view_matrix); + RendererRD::MaterialStorage::store_transform(p_render_data->cam_transform.affine_inverse(), scene_state.ubo.view_matrix); for (uint32_t v = 0; v < p_render_data->view_count; v++) { projection = correction * p_render_data->view_projection[v]; - RendererStorageRD::store_camera(projection, scene_state.ubo.projection_matrix_view[v]); - RendererStorageRD::store_camera(projection.inverse(), scene_state.ubo.inv_projection_matrix_view[v]); + RendererRD::MaterialStorage::store_camera(projection, scene_state.ubo.projection_matrix_view[v]); + RendererRD::MaterialStorage::store_camera(projection.inverse(), scene_state.ubo.inv_projection_matrix_view[v]); scene_state.ubo.eye_offset[v][0] = p_render_data->view_eye_offset[v].x; scene_state.ubo.eye_offset[v][1] = p_render_data->view_eye_offset[v].y; @@ -836,10 +837,10 @@ void RenderForwardClustered::_setup_environment(const RenderDataRD *p_render_dat scene_state.ubo.pancake_shadows = p_pancake_shadows; - RendererStorageRD::store_soft_shadow_kernel(directional_penumbra_shadow_kernel_get(), scene_state.ubo.directional_penumbra_shadow_kernel); - RendererStorageRD::store_soft_shadow_kernel(directional_soft_shadow_kernel_get(), scene_state.ubo.directional_soft_shadow_kernel); - RendererStorageRD::store_soft_shadow_kernel(penumbra_shadow_kernel_get(), scene_state.ubo.penumbra_shadow_kernel); - RendererStorageRD::store_soft_shadow_kernel(soft_shadow_kernel_get(), scene_state.ubo.soft_shadow_kernel); + RendererRD::MaterialStorage::store_soft_shadow_kernel(directional_penumbra_shadow_kernel_get(), scene_state.ubo.directional_penumbra_shadow_kernel); + RendererRD::MaterialStorage::store_soft_shadow_kernel(directional_soft_shadow_kernel_get(), scene_state.ubo.directional_soft_shadow_kernel); + RendererRD::MaterialStorage::store_soft_shadow_kernel(penumbra_shadow_kernel_get(), scene_state.ubo.penumbra_shadow_kernel); + RendererRD::MaterialStorage::store_soft_shadow_kernel(soft_shadow_kernel_get(), scene_state.ubo.soft_shadow_kernel); Size2 screen_pixel_size = Vector2(1.0, 1.0) / Size2(p_screen_size); scene_state.ubo.screen_pixel_size[0] = screen_pixel_size.x; @@ -934,7 +935,7 @@ void RenderForwardClustered::_setup_environment(const RenderDataRD *p_render_dat Basis sky_transform = environment_get_sky_orientation(p_render_data->environment); sky_transform = sky_transform.inverse() * p_render_data->cam_transform.basis; - RendererStorageRD::store_transform_3x3(sky_transform, scene_state.ubo.radiance_inverse_xform); + RendererRD::MaterialStorage::store_transform_3x3(sky_transform, scene_state.ubo.radiance_inverse_xform); scene_state.ubo.use_ambient_cubemap = (ambient_src == RS::ENV_AMBIENT_SOURCE_BG && env_bg == RS::ENV_BG_SKY) || ambient_src == RS::ENV_AMBIENT_SOURCE_SKY; scene_state.ubo.use_ambient_light = scene_state.ubo.use_ambient_cubemap || ambient_src == RS::ENV_AMBIENT_SOURCE_COLOR; @@ -1005,15 +1006,15 @@ void RenderForwardClustered::_setup_environment(const RenderDataRD *p_render_dat CameraMatrix prev_projection = prev_correction * p_render_data->prev_cam_projection; //store camera into ubo - RendererStorageRD::store_camera(prev_projection, scene_state.prev_ubo.projection_matrix); - RendererStorageRD::store_camera(prev_projection.inverse(), scene_state.prev_ubo.inv_projection_matrix); - RendererStorageRD::store_transform(p_render_data->prev_cam_transform, scene_state.prev_ubo.inv_view_matrix); - RendererStorageRD::store_transform(p_render_data->prev_cam_transform.affine_inverse(), scene_state.prev_ubo.view_matrix); + RendererRD::MaterialStorage::store_camera(prev_projection, scene_state.prev_ubo.projection_matrix); + RendererRD::MaterialStorage::store_camera(prev_projection.inverse(), scene_state.prev_ubo.inv_projection_matrix); + RendererRD::MaterialStorage::store_transform(p_render_data->prev_cam_transform, scene_state.prev_ubo.inv_view_matrix); + RendererRD::MaterialStorage::store_transform(p_render_data->prev_cam_transform.affine_inverse(), scene_state.prev_ubo.view_matrix); for (uint32_t v = 0; v < p_render_data->view_count; v++) { prev_projection = prev_correction * p_render_data->view_projection[v]; - RendererStorageRD::store_camera(prev_projection, scene_state.prev_ubo.projection_matrix_view[v]); - RendererStorageRD::store_camera(prev_projection.inverse(), scene_state.prev_ubo.inv_projection_matrix_view[v]); + RendererRD::MaterialStorage::store_camera(prev_projection, scene_state.prev_ubo.projection_matrix_view[v]); + RendererRD::MaterialStorage::store_camera(prev_projection.inverse(), scene_state.prev_ubo.inv_projection_matrix_view[v]); } scene_state.prev_ubo.taa_jitter[0] = p_render_data->prev_taa_jitter.x; scene_state.prev_ubo.taa_jitter[1] = p_render_data->prev_taa_jitter.y; @@ -1069,11 +1070,11 @@ void RenderForwardClustered::_fill_instance_data(RenderListType p_render_list, i } if (inst->store_transform_cache) { - RendererStorageRD::store_transform(inst->transform, instance_data.transform); - RendererStorageRD::store_transform(inst->prev_transform, instance_data.prev_transform); + RendererRD::MaterialStorage::store_transform(inst->transform, instance_data.transform); + RendererRD::MaterialStorage::store_transform(inst->prev_transform, instance_data.prev_transform); } else { - RendererStorageRD::store_transform(Transform3D(), instance_data.transform); - RendererStorageRD::store_transform(Transform3D(), instance_data.prev_transform); + RendererRD::MaterialStorage::store_transform(Transform3D(), instance_data.transform); + RendererRD::MaterialStorage::store_transform(Transform3D(), instance_data.prev_transform); } instance_data.flags = inst->flags_cache; @@ -1397,7 +1398,7 @@ void RenderForwardClustered::_setup_lightmaps(const PagedArray<RID> &p_lightmaps Basis to_lm = lightmap_instance_get_transform(p_lightmaps[i]).basis.inverse() * p_cam_transform.basis; to_lm = to_lm.inverse().transposed(); //will transform normals - RendererStorageRD::store_transform_3x3(to_lm, scene_state.lightmaps[i].normal_xform); + RendererRD::MaterialStorage::store_transform_3x3(to_lm, scene_state.lightmaps[i].normal_xform); scene_state.lightmap_ids[i] = p_lightmaps[i]; scene_state.lightmap_has_sh[i] = RendererRD::LightStorage::get_singleton()->lightmap_uses_spherical_harmonics(lightmap); @@ -1798,7 +1799,7 @@ void RenderForwardClustered::_render_scene(RenderDataRD *p_render_data, const Co } else { //just mix specular back RENDER_TIMESTAMP("Merge Specular"); - storage->get_effects()->merge_specular(color_only_framebuffer, render_buffer->specular, render_buffer->msaa == RS::VIEWPORT_MSAA_DISABLED ? RID() : render_buffer->color, RID()); + RendererCompositorRD::singleton->get_effects()->merge_specular(color_only_framebuffer, render_buffer->specular, render_buffer->msaa == RS::VIEWPORT_MSAA_DISABLED ? RID() : render_buffer->color, RID()); } } @@ -2189,7 +2190,7 @@ void RenderForwardClustered::_render_sdfgi(RID p_render_buffers, const Vector3i to_bounds.origin = p_bounds.position; to_bounds.basis.scale(p_bounds.size); - RendererStorageRD::store_transform(to_bounds.affine_inverse() * render_data.cam_transform, scene_state.ubo.sdf_to_bounds); + RendererRD::MaterialStorage::store_transform(to_bounds.affine_inverse() * render_data.cam_transform, scene_state.ubo.sdf_to_bounds); _setup_environment(&render_data, true, Vector2(1, 1), false, Color()); @@ -2888,7 +2889,7 @@ void RenderForwardClustered::_geometry_instance_add_surface_with_material(Geomet sdcache->surface_index = p_surface; if (ginstance->data->dirty_dependencies) { - storage->base_update_dependency(p_mesh, &ginstance->data->dependency_tracker); + RSG::utilities->base_update_dependency(p_mesh, &ginstance->data->dependency_tracker); } //shadow @@ -3131,16 +3132,16 @@ void RenderForwardClustered::_update_dirty_geometry_instances() { } } -void RenderForwardClustered::_geometry_instance_dependency_changed(RendererStorage::DependencyChangedNotification p_notification, RendererStorage::DependencyTracker *p_tracker) { +void RenderForwardClustered::_geometry_instance_dependency_changed(Dependency::DependencyChangedNotification p_notification, DependencyTracker *p_tracker) { switch (p_notification) { - case RendererStorage::DEPENDENCY_CHANGED_MATERIAL: - case RendererStorage::DEPENDENCY_CHANGED_MESH: - case RendererStorage::DEPENDENCY_CHANGED_PARTICLES: - case RendererStorage::DEPENDENCY_CHANGED_MULTIMESH: - case RendererStorage::DEPENDENCY_CHANGED_SKELETON_DATA: { + case Dependency::DEPENDENCY_CHANGED_MATERIAL: + case Dependency::DEPENDENCY_CHANGED_MESH: + case Dependency::DEPENDENCY_CHANGED_PARTICLES: + case Dependency::DEPENDENCY_CHANGED_MULTIMESH: + case Dependency::DEPENDENCY_CHANGED_SKELETON_DATA: { static_cast<RenderForwardClustered *>(singleton)->_geometry_instance_mark_dirty(static_cast<GeometryInstance *>(p_tracker->userdata)); } break; - case RendererStorage::DEPENDENCY_CHANGED_MULTIMESH_VISIBLE_INSTANCES: { + case Dependency::DEPENDENCY_CHANGED_MULTIMESH_VISIBLE_INSTANCES: { GeometryInstanceForwardClustered *ginstance = static_cast<GeometryInstanceForwardClustered *>(p_tracker->userdata); if (ginstance->data->base_type == RS::INSTANCE_MULTIMESH) { ginstance->instance_count = RendererRD::MeshStorage::get_singleton()->multimesh_get_instances_to_draw(ginstance->data->base); @@ -3151,12 +3152,12 @@ void RenderForwardClustered::_geometry_instance_dependency_changed(RendererStora } break; } } -void RenderForwardClustered::_geometry_instance_dependency_deleted(const RID &p_dependency, RendererStorage::DependencyTracker *p_tracker) { +void RenderForwardClustered::_geometry_instance_dependency_deleted(const RID &p_dependency, DependencyTracker *p_tracker) { static_cast<RenderForwardClustered *>(singleton)->_geometry_instance_mark_dirty(static_cast<GeometryInstance *>(p_tracker->userdata)); } RendererSceneRender::GeometryInstance *RenderForwardClustered::geometry_instance_create(RID p_base) { - RS::InstanceType type = storage->get_base_type(p_base); + RS::InstanceType type = RSG::utilities->get_base_type(p_base); ERR_FAIL_COND_V(!((1 << type) & RS::INSTANCE_GEOMETRY_MASK), nullptr); GeometryInstanceForwardClustered *ginstance = geometry_instance_alloc.alloc(); @@ -3420,8 +3421,7 @@ void RenderForwardClustered::_update_shader_quality_settings() { _base_uniforms_changed(); //also need this } -RenderForwardClustered::RenderForwardClustered(RendererStorageRD *p_storage) : - RendererSceneRenderRD(p_storage) { +RenderForwardClustered::RenderForwardClustered() { singleton = this; /* SCENE SHADER */ @@ -3453,7 +3453,7 @@ RenderForwardClustered::RenderForwardClustered(RendererStorageRD *p_storage) : defines += "\n#define MATERIAL_UNIFORM_SET " + itos(MATERIAL_UNIFORM_SET) + "\n"; } - scene_shader.init(p_storage, defines); + scene_shader.init(defines); } render_list_thread_threshold = GLOBAL_GET("rendering/limits/forward_renderer/threaded_render_minimum_instances"); diff --git a/servers/rendering/renderer_rd/forward_clustered/render_forward_clustered.h b/servers/rendering/renderer_rd/forward_clustered/render_forward_clustered.h index 83f69e0674..9e1f1b9954 100644 --- a/servers/rendering/renderer_rd/forward_clustered/render_forward_clustered.h +++ b/servers/rendering/renderer_rd/forward_clustered/render_forward_clustered.h @@ -36,8 +36,8 @@ #include "servers/rendering/renderer_rd/forward_clustered/scene_shader_forward_clustered.h" #include "servers/rendering/renderer_rd/pipeline_cache_rd.h" #include "servers/rendering/renderer_rd/renderer_scene_render_rd.h" -#include "servers/rendering/renderer_rd/renderer_storage_rd.h" #include "servers/rendering/renderer_rd/shaders/scene_forward_clustered.glsl.gen.h" +#include "servers/rendering/renderer_rd/storage_rd/utilities.h" namespace RendererSceneRenderImplementation { @@ -541,7 +541,7 @@ class RenderForwardClustered : public RendererSceneRenderRD { bool mirror = false; bool dirty_dependencies = false; - RendererStorage::DependencyTracker dependency_tracker; + DependencyTracker dependency_tracker; }; Data *data = nullptr; @@ -550,8 +550,8 @@ class RenderForwardClustered : public RendererSceneRenderRD { dirty_list_element(this) {} }; - static void _geometry_instance_dependency_changed(RendererStorage::DependencyChangedNotification p_notification, RendererStorage::DependencyTracker *p_tracker); - static void _geometry_instance_dependency_deleted(const RID &p_dependency, RendererStorage::DependencyTracker *p_tracker); + static void _geometry_instance_dependency_changed(Dependency::DependencyChangedNotification p_notification, DependencyTracker *p_tracker); + static void _geometry_instance_dependency_deleted(const RID &p_dependency, DependencyTracker *p_tracker); SelfList<GeometryInstanceForwardClustered>::List geometry_instance_dirty_list; @@ -683,7 +683,7 @@ public: virtual bool free(RID p_rid) override; - RenderForwardClustered(RendererStorageRD *p_storage); + RenderForwardClustered(); ~RenderForwardClustered(); }; } // namespace RendererSceneRenderImplementation diff --git a/servers/rendering/renderer_rd/forward_clustered/scene_shader_forward_clustered.cpp b/servers/rendering/renderer_rd/forward_clustered/scene_shader_forward_clustered.cpp index aada989bcb..1951bfe915 100644 --- a/servers/rendering/renderer_rd/forward_clustered/scene_shader_forward_clustered.cpp +++ b/servers/rendering/renderer_rd/forward_clustered/scene_shader_forward_clustered.cpp @@ -520,9 +520,8 @@ SceneShaderForwardClustered::~SceneShaderForwardClustered() { material_storage->material_free(default_material); } -void SceneShaderForwardClustered::init(RendererStorageRD *p_storage, const String p_defines) { +void SceneShaderForwardClustered::init(const String p_defines) { RendererRD::MaterialStorage *material_storage = RendererRD::MaterialStorage::get_singleton(); - storage = p_storage; { Vector<String> shader_versions; diff --git a/servers/rendering/renderer_rd/forward_clustered/scene_shader_forward_clustered.h b/servers/rendering/renderer_rd/forward_clustered/scene_shader_forward_clustered.h index ffa3893b6a..1cfe723174 100644 --- a/servers/rendering/renderer_rd/forward_clustered/scene_shader_forward_clustered.h +++ b/servers/rendering/renderer_rd/forward_clustered/scene_shader_forward_clustered.h @@ -32,7 +32,6 @@ #define RSSR_SCENE_SHADER_FC_H #include "servers/rendering/renderer_rd/renderer_scene_render_rd.h" -#include "servers/rendering/renderer_rd/renderer_storage_rd.h" #include "servers/rendering/renderer_rd/shaders/scene_forward_clustered.glsl.gen.h" namespace RendererSceneRenderImplementation { @@ -42,8 +41,6 @@ private: static SceneShaderForwardClustered *singleton; public: - RendererStorageRD *storage = nullptr; - enum ShaderVersion { SHADER_VERSION_DEPTH_PASS, SHADER_VERSION_DEPTH_PASS_DP, @@ -249,7 +246,7 @@ public: SceneShaderForwardClustered(); ~SceneShaderForwardClustered(); - void init(RendererStorageRD *p_storage, const String p_defines); + void init(const String p_defines); void set_default_specialization_constants(const Vector<RD::PipelineSpecializationConstant> &p_constants); }; diff --git a/servers/rendering/renderer_rd/forward_mobile/render_forward_mobile.cpp b/servers/rendering/renderer_rd/forward_mobile/render_forward_mobile.cpp index 25acd2e25f..e1855ddb36 100644 --- a/servers/rendering/renderer_rd/forward_mobile/render_forward_mobile.cpp +++ b/servers/rendering/renderer_rd/forward_mobile/render_forward_mobile.cpp @@ -465,7 +465,7 @@ void RenderForwardMobile::_setup_lightmaps(const PagedArray<RID> &p_lightmaps, c Basis to_lm = lightmap_instance_get_transform(p_lightmaps[i]).basis.inverse() * p_cam_transform.basis; to_lm = to_lm.inverse().transposed(); //will transform normals - RendererStorageRD::store_transform_3x3(to_lm, scene_state.lightmaps[i].normal_xform); + RendererRD::MaterialStorage::store_transform_3x3(to_lm, scene_state.lightmaps[i].normal_xform); scene_state.lightmap_ids[i] = p_lightmaps[i]; scene_state.lightmap_has_sh[i] = RendererRD::LightStorage::get_singleton()->lightmap_uses_spherical_harmonics(lightmap); @@ -1534,15 +1534,15 @@ void RenderForwardMobile::_setup_environment(const RenderDataRD *p_render_data, CameraMatrix projection = correction * p_render_data->cam_projection; //store camera into ubo - RendererStorageRD::store_camera(projection, scene_state.ubo.projection_matrix); - RendererStorageRD::store_camera(projection.inverse(), scene_state.ubo.inv_projection_matrix); - RendererStorageRD::store_transform(p_render_data->cam_transform, scene_state.ubo.inv_view_matrix); - RendererStorageRD::store_transform(p_render_data->cam_transform.affine_inverse(), scene_state.ubo.view_matrix); + RendererRD::MaterialStorage::store_camera(projection, scene_state.ubo.projection_matrix); + RendererRD::MaterialStorage::store_camera(projection.inverse(), scene_state.ubo.inv_projection_matrix); + RendererRD::MaterialStorage::store_transform(p_render_data->cam_transform, scene_state.ubo.inv_view_matrix); + RendererRD::MaterialStorage::store_transform(p_render_data->cam_transform.affine_inverse(), scene_state.ubo.view_matrix); for (uint32_t v = 0; v < p_render_data->view_count; v++) { projection = correction * p_render_data->view_projection[v]; - RendererStorageRD::store_camera(projection, scene_state.ubo.projection_matrix_view[v]); - RendererStorageRD::store_camera(projection.inverse(), scene_state.ubo.inv_projection_matrix_view[v]); + RendererRD::MaterialStorage::store_camera(projection, scene_state.ubo.projection_matrix_view[v]); + RendererRD::MaterialStorage::store_camera(projection.inverse(), scene_state.ubo.inv_projection_matrix_view[v]); scene_state.ubo.eye_offset[v][0] = p_render_data->view_eye_offset[v].x; scene_state.ubo.eye_offset[v][1] = p_render_data->view_eye_offset[v].y; @@ -1555,10 +1555,10 @@ void RenderForwardMobile::_setup_environment(const RenderDataRD *p_render_data, scene_state.ubo.pancake_shadows = p_pancake_shadows; - RendererStorageRD::store_soft_shadow_kernel(directional_penumbra_shadow_kernel_get(), scene_state.ubo.directional_penumbra_shadow_kernel); - RendererStorageRD::store_soft_shadow_kernel(directional_soft_shadow_kernel_get(), scene_state.ubo.directional_soft_shadow_kernel); - RendererStorageRD::store_soft_shadow_kernel(penumbra_shadow_kernel_get(), scene_state.ubo.penumbra_shadow_kernel); - RendererStorageRD::store_soft_shadow_kernel(soft_shadow_kernel_get(), scene_state.ubo.soft_shadow_kernel); + RendererRD::MaterialStorage::store_soft_shadow_kernel(directional_penumbra_shadow_kernel_get(), scene_state.ubo.directional_penumbra_shadow_kernel); + RendererRD::MaterialStorage::store_soft_shadow_kernel(directional_soft_shadow_kernel_get(), scene_state.ubo.directional_soft_shadow_kernel); + RendererRD::MaterialStorage::store_soft_shadow_kernel(penumbra_shadow_kernel_get(), scene_state.ubo.penumbra_shadow_kernel); + RendererRD::MaterialStorage::store_soft_shadow_kernel(soft_shadow_kernel_get(), scene_state.ubo.soft_shadow_kernel); Size2 screen_pixel_size = Vector2(1.0, 1.0) / Size2(p_screen_size); scene_state.ubo.screen_pixel_size[0] = screen_pixel_size.x; @@ -1648,7 +1648,7 @@ void RenderForwardMobile::_setup_environment(const RenderDataRD *p_render_data, Basis sky_transform = environment_get_sky_orientation(p_render_data->environment); sky_transform = sky_transform.inverse() * p_render_data->cam_transform.basis; - RendererStorageRD::store_transform_3x3(sky_transform, scene_state.ubo.radiance_inverse_xform); + RendererRD::MaterialStorage::store_transform_3x3(sky_transform, scene_state.ubo.radiance_inverse_xform); scene_state.ubo.use_ambient_cubemap = (ambient_src == RS::ENV_AMBIENT_SOURCE_BG && env_bg == RS::ENV_BG_SKY) || ambient_src == RS::ENV_AMBIENT_SOURCE_SKY; scene_state.ubo.use_ambient_light = scene_state.ubo.use_ambient_cubemap || ambient_src == RS::ENV_AMBIENT_SOURCE_COLOR; @@ -1866,9 +1866,9 @@ void RenderForwardMobile::_render_list_template(RenderingDevice::DrawListID p_dr GeometryInstanceForwardMobile::PushConstant push_constant; if (inst->store_transform_cache) { - RendererStorageRD::store_transform(inst->transform, push_constant.transform); + RendererRD::MaterialStorage::store_transform(inst->transform, push_constant.transform); } else { - RendererStorageRD::store_transform(Transform3D(), push_constant.transform); + RendererRD::MaterialStorage::store_transform(Transform3D(), push_constant.transform); } push_constant.flags = inst->flags_cache; @@ -2032,7 +2032,7 @@ void RenderForwardMobile::_render_list_template(RenderingDevice::DrawListID p_dr /* Geometry instance */ RendererSceneRender::GeometryInstance *RenderForwardMobile::geometry_instance_create(RID p_base) { - RS::InstanceType type = storage->get_base_type(p_base); + RS::InstanceType type = RSG::utilities->get_base_type(p_base); ERR_FAIL_COND_V(!((1 << type) & RS::INSTANCE_GEOMETRY_MASK), nullptr); GeometryInstanceForwardMobile *ginstance = geometry_instance_alloc.alloc(); @@ -2373,7 +2373,7 @@ void RenderForwardMobile::_geometry_instance_add_surface_with_material(GeometryI sdcache->surface_index = p_surface; if (ginstance->data->dirty_dependencies) { - storage->base_update_dependency(p_mesh, &ginstance->data->dependency_tracker); + RSG::utilities->base_update_dependency(p_mesh, &ginstance->data->dependency_tracker); } //shadow @@ -2609,16 +2609,16 @@ void RenderForwardMobile::_update_dirty_geometry_instances() { } } -void RenderForwardMobile::_geometry_instance_dependency_changed(RendererStorage::DependencyChangedNotification p_notification, RendererStorage::DependencyTracker *p_tracker) { +void RenderForwardMobile::_geometry_instance_dependency_changed(Dependency::DependencyChangedNotification p_notification, DependencyTracker *p_tracker) { switch (p_notification) { - case RendererStorage::DEPENDENCY_CHANGED_MATERIAL: - case RendererStorage::DEPENDENCY_CHANGED_MESH: - case RendererStorage::DEPENDENCY_CHANGED_PARTICLES: - case RendererStorage::DEPENDENCY_CHANGED_MULTIMESH: - case RendererStorage::DEPENDENCY_CHANGED_SKELETON_DATA: { + case Dependency::DEPENDENCY_CHANGED_MATERIAL: + case Dependency::DEPENDENCY_CHANGED_MESH: + case Dependency::DEPENDENCY_CHANGED_PARTICLES: + case Dependency::DEPENDENCY_CHANGED_MULTIMESH: + case Dependency::DEPENDENCY_CHANGED_SKELETON_DATA: { static_cast<RenderForwardMobile *>(singleton)->_geometry_instance_mark_dirty(static_cast<GeometryInstance *>(p_tracker->userdata)); } break; - case RendererStorage::DEPENDENCY_CHANGED_MULTIMESH_VISIBLE_INSTANCES: { + case Dependency::DEPENDENCY_CHANGED_MULTIMESH_VISIBLE_INSTANCES: { GeometryInstanceForwardMobile *ginstance = static_cast<GeometryInstanceForwardMobile *>(p_tracker->userdata); if (ginstance->data->base_type == RS::INSTANCE_MULTIMESH) { ginstance->instance_count = RendererRD::MeshStorage::get_singleton()->multimesh_get_instances_to_draw(ginstance->data->base); @@ -2629,7 +2629,7 @@ void RenderForwardMobile::_geometry_instance_dependency_changed(RendererStorage: } break; } } -void RenderForwardMobile::_geometry_instance_dependency_deleted(const RID &p_dependency, RendererStorage::DependencyTracker *p_tracker) { +void RenderForwardMobile::_geometry_instance_dependency_deleted(const RID &p_dependency, DependencyTracker *p_tracker) { static_cast<RenderForwardMobile *>(singleton)->_geometry_instance_mark_dirty(static_cast<GeometryInstance *>(p_tracker->userdata)); } @@ -2695,8 +2695,7 @@ void RenderForwardMobile::_update_shader_quality_settings() { _base_uniforms_changed(); //also need this } -RenderForwardMobile::RenderForwardMobile(RendererStorageRD *p_storage) : - RendererSceneRenderRD(p_storage) { +RenderForwardMobile::RenderForwardMobile() { singleton = this; sky.set_texture_format(_render_buffers_get_color_format()); @@ -2728,7 +2727,7 @@ RenderForwardMobile::RenderForwardMobile(RendererStorageRD *p_storage) : defines += "\n#define MATERIAL_UNIFORM_SET " + itos(MATERIAL_UNIFORM_SET) + "\n"; } - scene_shader.init(p_storage, defines); + scene_shader.init(defines); // !BAS! maybe we need a mobile version of this setting? render_list_thread_threshold = GLOBAL_GET("rendering/limits/forward_renderer/threaded_render_minimum_instances"); diff --git a/servers/rendering/renderer_rd/forward_mobile/render_forward_mobile.h b/servers/rendering/renderer_rd/forward_mobile/render_forward_mobile.h index 82e6c52c43..473a58045c 100644 --- a/servers/rendering/renderer_rd/forward_mobile/render_forward_mobile.h +++ b/servers/rendering/renderer_rd/forward_mobile/render_forward_mobile.h @@ -35,7 +35,7 @@ #include "servers/rendering/renderer_rd/forward_mobile/scene_shader_forward_mobile.h" #include "servers/rendering/renderer_rd/pipeline_cache_rd.h" #include "servers/rendering/renderer_rd/renderer_scene_render_rd.h" -#include "servers/rendering/renderer_rd/renderer_storage_rd.h" +#include "servers/rendering/renderer_rd/storage_rd/utilities.h" namespace RendererSceneRenderImplementation { @@ -597,7 +597,7 @@ protected: bool dirty_dependencies = false; - RendererStorage::DependencyTracker dependency_tracker; + DependencyTracker dependency_tracker; }; Data *data = nullptr; @@ -613,8 +613,8 @@ protected: public: virtual RID reflection_probe_create_framebuffer(RID p_color, RID p_depth) override; - static void _geometry_instance_dependency_changed(RendererStorage::DependencyChangedNotification p_notification, RendererStorage::DependencyTracker *p_tracker); - static void _geometry_instance_dependency_deleted(const RID &p_dependency, RendererStorage::DependencyTracker *p_tracker); + static void _geometry_instance_dependency_changed(Dependency::DependencyChangedNotification p_notification, DependencyTracker *p_tracker); + static void _geometry_instance_dependency_deleted(const RID &p_dependency, DependencyTracker *p_tracker); SelfList<GeometryInstanceForwardMobile>::List geometry_instance_dirty_list; @@ -668,7 +668,7 @@ public: virtual bool is_volumetric_supported() const override; virtual uint32_t get_max_elements() const override; - RenderForwardMobile(RendererStorageRD *p_storage); + RenderForwardMobile(); ~RenderForwardMobile(); }; } // namespace RendererSceneRenderImplementation diff --git a/servers/rendering/renderer_rd/forward_mobile/scene_shader_forward_mobile.cpp b/servers/rendering/renderer_rd/forward_mobile/scene_shader_forward_mobile.cpp index f66ad529de..dd00dc2bf9 100644 --- a/servers/rendering/renderer_rd/forward_mobile/scene_shader_forward_mobile.cpp +++ b/servers/rendering/renderer_rd/forward_mobile/scene_shader_forward_mobile.cpp @@ -466,8 +466,7 @@ SceneShaderForwardMobile::SceneShaderForwardMobile() { singleton = this; } -void SceneShaderForwardMobile::init(RendererStorageRD *p_storage, const String p_defines) { - storage = p_storage; +void SceneShaderForwardMobile::init(const String p_defines) { RendererRD::MaterialStorage *material_storage = RendererRD::MaterialStorage::get_singleton(); /* SCENE SHADER */ diff --git a/servers/rendering/renderer_rd/forward_mobile/scene_shader_forward_mobile.h b/servers/rendering/renderer_rd/forward_mobile/scene_shader_forward_mobile.h index f325d5c0a5..88c2143b09 100644 --- a/servers/rendering/renderer_rd/forward_mobile/scene_shader_forward_mobile.h +++ b/servers/rendering/renderer_rd/forward_mobile/scene_shader_forward_mobile.h @@ -32,7 +32,6 @@ #define RSSR_SCENE_SHADER_FM_H #include "servers/rendering/renderer_rd/renderer_scene_render_rd.h" -#include "servers/rendering/renderer_rd/renderer_storage_rd.h" #include "servers/rendering/renderer_rd/shaders/scene_forward_mobile.glsl.gen.h" namespace RendererSceneRenderImplementation { @@ -40,7 +39,6 @@ namespace RendererSceneRenderImplementation { class SceneShaderForwardMobile { private: static SceneShaderForwardMobile *singleton; - RendererStorageRD *storage = nullptr; public: enum ShaderVersion { @@ -207,7 +205,7 @@ public: Vector<RD::PipelineSpecializationConstant> default_specialization_constants; - void init(RendererStorageRD *p_storage, const String p_defines); + void init(const String p_defines); void set_default_specialization_constants(const Vector<RD::PipelineSpecializationConstant> &p_constants); }; diff --git a/servers/rendering/renderer_rd/renderer_canvas_render_rd.cpp b/servers/rendering/renderer_rd/renderer_canvas_render_rd.cpp index 3c2f3f8a42..b87b189d53 100644 --- a/servers/rendering/renderer_rd/renderer_canvas_render_rd.cpp +++ b/servers/rendering/renderer_rd/renderer_canvas_render_rd.cpp @@ -2270,10 +2270,9 @@ void RendererCanvasRenderRD::set_time(double p_time) { void RendererCanvasRenderRD::update() { } -RendererCanvasRenderRD::RendererCanvasRenderRD(RendererStorageRD *p_storage) { +RendererCanvasRenderRD::RendererCanvasRenderRD() { RendererRD::TextureStorage *texture_storage = RendererRD::TextureStorage::get_singleton(); RendererRD::MaterialStorage *material_storage = RendererRD::MaterialStorage::get_singleton(); - storage = p_storage; { //create default samplers diff --git a/servers/rendering/renderer_rd/renderer_canvas_render_rd.h b/servers/rendering/renderer_rd/renderer_canvas_render_rd.h index 04881ce7e6..2ab5a7c831 100644 --- a/servers/rendering/renderer_rd/renderer_canvas_render_rd.h +++ b/servers/rendering/renderer_rd/renderer_canvas_render_rd.h @@ -34,15 +34,13 @@ #include "servers/rendering/renderer_canvas_render.h" #include "servers/rendering/renderer_compositor.h" #include "servers/rendering/renderer_rd/pipeline_cache_rd.h" -#include "servers/rendering/renderer_rd/renderer_storage_rd.h" #include "servers/rendering/renderer_rd/shaders/canvas.glsl.gen.h" #include "servers/rendering/renderer_rd/shaders/canvas_occlusion.glsl.gen.h" +#include "servers/rendering/renderer_rd/storage_rd/material_storage.h" #include "servers/rendering/rendering_device.h" #include "servers/rendering/shader_compiler.h" class RendererCanvasRenderRD : public RendererCanvasRender { - RendererStorageRD *storage = nullptr; - enum { BASE_UNIFORM_SET = 0, MATERIAL_UNIFORM_SET = 1, @@ -462,7 +460,7 @@ public: void set_time(double p_time); void update(); bool free(RID p_rid); - RendererCanvasRenderRD(RendererStorageRD *p_storage); + RendererCanvasRenderRD(); ~RendererCanvasRenderRD(); }; diff --git a/servers/rendering/renderer_rd/renderer_compositor_rd.cpp b/servers/rendering/renderer_rd/renderer_compositor_rd.cpp index 759b8690eb..a61172c8f5 100644 --- a/servers/rendering/renderer_rd/renderer_compositor_rd.cpp +++ b/servers/rendering/renderer_rd/renderer_compositor_rd.cpp @@ -154,12 +154,14 @@ uint64_t RendererCompositorRD::frame = 1; void RendererCompositorRD::finalize() { memdelete(scene); memdelete(canvas); - memdelete(storage); + memdelete(effects); + memdelete(fog); memdelete(particles_storage); memdelete(light_storage); memdelete(mesh_storage); memdelete(material_storage); memdelete(texture_storage); + memdelete(utilities); //only need to erase these, the rest are erased by cascade blit.shader.version_free(blit.shader_version); @@ -287,28 +289,29 @@ RendererCompositorRD::RendererCompositorRD() { singleton = this; + utilities = memnew(RendererRD::Utilities); texture_storage = memnew(RendererRD::TextureStorage); material_storage = memnew(RendererRD::MaterialStorage); mesh_storage = memnew(RendererRD::MeshStorage); light_storage = memnew(RendererRD::LightStorage); particles_storage = memnew(RendererRD::ParticlesStorage); - storage = memnew(RendererStorageRD); - canvas = memnew(RendererCanvasRenderRD(storage)); + fog = memnew(RendererRD::Fog); + canvas = memnew(RendererCanvasRenderRD()); back_end = (bool)(int)GLOBAL_GET("rendering/vulkan/rendering/back_end"); uint64_t textures_per_stage = RD::get_singleton()->limit_get(RD::LIMIT_MAX_TEXTURES_PER_SHADER_STAGE); if (back_end || textures_per_stage < 48) { - scene = memnew(RendererSceneRenderImplementation::RenderForwardMobile(storage)); + scene = memnew(RendererSceneRenderImplementation::RenderForwardMobile()); } else { // back_end == false // default to our high end renderer - scene = memnew(RendererSceneRenderImplementation::RenderForwardClustered(storage)); + scene = memnew(RendererSceneRenderImplementation::RenderForwardClustered()); } scene->init(); // now we're ready to create our effects, - storage->init_effects(!scene->_render_buffers_can_be_storage()); + effects = memnew(EffectsRD(!scene->_render_buffers_can_be_storage())); } RendererCompositorRD::~RendererCompositorRD() { diff --git a/servers/rendering/renderer_rd/renderer_compositor_rd.h b/servers/rendering/renderer_rd/renderer_compositor_rd.h index 12bcfc4684..2be55743fb 100644 --- a/servers/rendering/renderer_rd/renderer_compositor_rd.h +++ b/servers/rendering/renderer_rd/renderer_compositor_rd.h @@ -34,28 +34,32 @@ #include "core/os/os.h" #include "core/templates/thread_work_pool.h" #include "servers/rendering/renderer_compositor.h" +#include "servers/rendering/renderer_rd/effects_rd.h" +#include "servers/rendering/renderer_rd/environment/fog.h" #include "servers/rendering/renderer_rd/forward_clustered/render_forward_clustered.h" #include "servers/rendering/renderer_rd/forward_mobile/render_forward_mobile.h" #include "servers/rendering/renderer_rd/renderer_canvas_render_rd.h" -#include "servers/rendering/renderer_rd/renderer_storage_rd.h" #include "servers/rendering/renderer_rd/shaders/blit.glsl.gen.h" #include "servers/rendering/renderer_rd/storage_rd/light_storage.h" #include "servers/rendering/renderer_rd/storage_rd/material_storage.h" #include "servers/rendering/renderer_rd/storage_rd/mesh_storage.h" #include "servers/rendering/renderer_rd/storage_rd/particles_storage.h" #include "servers/rendering/renderer_rd/storage_rd/texture_storage.h" +#include "servers/rendering/renderer_rd/storage_rd/utilities.h" #include "servers/rendering/renderer_rd/uniform_set_cache_rd.h" class RendererCompositorRD : public RendererCompositor { protected: UniformSetCacheRD *uniform_set_cache = nullptr; RendererCanvasRenderRD *canvas = nullptr; + RendererRD::Utilities *utilities = nullptr; RendererRD::LightStorage *light_storage = nullptr; RendererRD::MaterialStorage *material_storage = nullptr; RendererRD::MeshStorage *mesh_storage = nullptr; RendererRD::ParticlesStorage *particles_storage = nullptr; RendererRD::TextureStorage *texture_storage = nullptr; - RendererStorageRD *storage = nullptr; + RendererRD::Fog *fog = nullptr; + EffectsRD *effects = nullptr; RendererSceneRenderRD *scene = nullptr; enum BlitMode { @@ -98,6 +102,7 @@ protected: static uint64_t frame; public: + RendererUtilities *get_utilities() { return utilities; }; RendererLightStorage *get_light_storage() { return light_storage; } RendererMaterialStorage *get_material_storage() { return material_storage; } RendererMeshStorage *get_mesh_storage() { return mesh_storage; } @@ -107,7 +112,8 @@ public: ERR_FAIL_NULL_V(scene, nullptr); return scene->get_gi(); } - RendererStorage *get_storage() { return storage; } + RendererFog *get_fog() { return fog; } + EffectsRD *get_effects() { return effects; } RendererCanvasRender *get_canvas() { return canvas; } RendererSceneRender *get_scene() { return scene; } diff --git a/servers/rendering/renderer_rd/renderer_scene_render_rd.cpp b/servers/rendering/renderer_rd/renderer_scene_render_rd.cpp index eb4bc3d535..bf4f3546c1 100644 --- a/servers/rendering/renderer_rd/renderer_scene_render_rd.cpp +++ b/servers/rendering/renderer_rd/renderer_scene_render_rd.cpp @@ -33,6 +33,7 @@ #include "core/config/project_settings.h" #include "core/os/os.h" #include "renderer_compositor_rd.h" +#include "servers/rendering/renderer_rd/environment/fog.h" #include "servers/rendering/renderer_rd/storage_rd/material_storage.h" #include "servers/rendering/renderer_rd/storage_rd/texture_storage.h" #include "servers/rendering/rendering_server_default.h" @@ -534,7 +535,7 @@ Ref<Image> RendererSceneRenderRD::environment_bake_panorama(RID p_env, bool p_ba return panorama; } else { const float bg_energy = env->bg_energy; - Color panorama_color = ((environment_background == RS::ENV_BG_CLEAR_COLOR) ? storage->get_default_clear_color() : env->bg_color); + Color panorama_color = ((environment_background == RS::ENV_BG_CLEAR_COLOR) ? RSG::texture_storage->get_default_clear_color() : env->bg_color); panorama_color = panorama_color.srgb_to_linear(); panorama_color.r *= bg_energy; panorama_color.g *= bg_energy; @@ -759,7 +760,7 @@ bool RendererSceneRenderRD::reflection_probe_instance_begin_render(RID p_instanc } atlas->reflections.resize(atlas->count); for (int i = 0; i < atlas->count; i++) { - atlas->reflections.write[i].data.update_reflection_data(storage, atlas->size, mipmaps, false, atlas->reflection, i * 6, RSG::light_storage->reflection_probe_get_update_mode(rpi->probe) == RS::REFLECTION_PROBE_UPDATE_ALWAYS, sky.roughness_layers, _render_buffers_get_color_format()); + atlas->reflections.write[i].data.update_reflection_data(atlas->size, mipmaps, false, atlas->reflection, i * 6, RSG::light_storage->reflection_probe_get_update_mode(rpi->probe) == RS::REFLECTION_PROBE_UPDATE_ALWAYS, sky.roughness_layers, _render_buffers_get_color_format()); for (int j = 0; j < 6; j++) { atlas->reflections.write[i].fbs[j] = reflection_probe_create_framebuffer(atlas->reflections.write[i].data.layers[0].mipmaps[0].views[j], atlas->depth_buffer); } @@ -829,7 +830,7 @@ bool RendererSceneRenderRD::reflection_probe_instance_postprocess_step(RID p_ins if (RSG::light_storage->reflection_probe_get_update_mode(rpi->probe) == RS::REFLECTION_PROBE_UPDATE_ALWAYS) { // Using real time reflections, all roughness is done in one step - atlas->reflections.write[rpi->atlas_index].data.create_reflection_fast_filter(storage, false); + atlas->reflections.write[rpi->atlas_index].data.create_reflection_fast_filter(false); rpi->rendering = false; rpi->processing_side = 0; rpi->processing_layer = 1; @@ -837,7 +838,7 @@ bool RendererSceneRenderRD::reflection_probe_instance_postprocess_step(RID p_ins } if (rpi->processing_layer > 1) { - atlas->reflections.write[rpi->atlas_index].data.create_reflection_importance_sample(storage, false, 10, rpi->processing_layer, sky.sky_ggx_samples_quality); + atlas->reflections.write[rpi->atlas_index].data.create_reflection_importance_sample(false, 10, rpi->processing_layer, sky.sky_ggx_samples_quality); rpi->processing_layer++; if (rpi->processing_layer == atlas->reflections[rpi->atlas_index].data.layers[0].mipmaps.size()) { rpi->rendering = false; @@ -848,7 +849,7 @@ bool RendererSceneRenderRD::reflection_probe_instance_postprocess_step(RID p_ins return false; } else { - atlas->reflections.write[rpi->atlas_index].data.create_reflection_importance_sample(storage, false, rpi->processing_side, rpi->processing_layer, sky.sky_ggx_samples_quality); + atlas->reflections.write[rpi->atlas_index].data.create_reflection_importance_sample(false, rpi->processing_side, rpi->processing_layer, sky.sky_ggx_samples_quality); } rpi->processing_side++; @@ -1968,7 +1969,7 @@ void RendererSceneRenderRD::_process_sss(RID p_render_buffers, const CameraMatri _allocate_blur_textures(rb); } - storage->get_effects()->sub_surface_scattering(rb->internal_texture, rb->sss_texture, rb->depth_texture, p_camera, Size2i(rb->internal_width, rb->internal_height), sss_scale, sss_depth_scale, sss_quality); + RendererCompositorRD::singleton->get_effects()->sub_surface_scattering(rb->internal_texture, rb->sss_texture, rb->depth_texture, p_camera, Size2i(rb->internal_width, rb->internal_height), sss_scale, sss_depth_scale, sss_quality); } void RendererSceneRenderRD::_process_ssr(RID p_render_buffers, RID p_dest_framebuffer, RID p_normal_buffer, RID p_specular_buffer, RID p_metallic, const Color &p_metallic_mask, RID p_environment, const CameraMatrix &p_projection, bool p_use_additive) { @@ -1979,7 +1980,7 @@ void RendererSceneRenderRD::_process_ssr(RID p_render_buffers, RID p_dest_frameb if (!can_use_effects) { //just copy - storage->get_effects()->merge_specular(p_dest_framebuffer, p_specular_buffer, p_use_additive ? RID() : rb->internal_texture, RID()); + RendererCompositorRD::singleton->get_effects()->merge_specular(p_dest_framebuffer, p_specular_buffer, p_use_additive ? RID() : rb->internal_texture, RID()); return; } @@ -2019,8 +2020,8 @@ void RendererSceneRenderRD::_process_ssr(RID p_render_buffers, RID p_dest_frameb _allocate_blur_textures(rb); } - storage->get_effects()->screen_space_reflection(rb->internal_texture, p_normal_buffer, ssr_roughness_quality, rb->ssr.blur_radius[0], rb->ssr.blur_radius[1], p_metallic, p_metallic_mask, rb->depth_texture, rb->ssr.depth_scaled, rb->ssr.normal_scaled, rb->blur[0].layers[0].mipmaps[1].texture, rb->blur[1].layers[0].mipmaps[0].texture, Size2i(rb->internal_width / 2, rb->internal_height / 2), env->ssr_max_steps, env->ssr_fade_in, env->ssr_fade_out, env->ssr_depth_tolerance, p_projection); - storage->get_effects()->merge_specular(p_dest_framebuffer, p_specular_buffer, p_use_additive ? RID() : rb->internal_texture, rb->blur[0].layers[0].mipmaps[1].texture); + RendererCompositorRD::singleton->get_effects()->screen_space_reflection(rb->internal_texture, p_normal_buffer, ssr_roughness_quality, rb->ssr.blur_radius[0], rb->ssr.blur_radius[1], p_metallic, p_metallic_mask, rb->depth_texture, rb->ssr.depth_scaled, rb->ssr.normal_scaled, rb->blur[0].layers[0].mipmaps[1].texture, rb->blur[1].layers[0].mipmaps[0].texture, Size2i(rb->internal_width / 2, rb->internal_height / 2), env->ssr_max_steps, env->ssr_fade_in, env->ssr_fade_out, env->ssr_depth_tolerance, p_projection); + RendererCompositorRD::singleton->get_effects()->merge_specular(p_dest_framebuffer, p_specular_buffer, p_use_additive ? RID() : rb->internal_texture, rb->blur[0].layers[0].mipmaps[1].texture); } void RendererSceneRenderRD::_process_ssao(RID p_render_buffers, RID p_environment, RID p_normal_buffer, const CameraMatrix &p_projection) { @@ -2145,7 +2146,7 @@ void RendererSceneRenderRD::_process_ssao(RID p_render_buffers, RID p_environmen settings.half_screen_size = Size2i(buffer_width, buffer_height); settings.quarter_screen_size = Size2i(half_width, half_height); - storage->get_effects()->generate_ssao(p_normal_buffer, rb->ss_effects.ssao.depth_texture_view, rb->ss_effects.ssao.ao_deinterleaved, rb->ss_effects.ssao.ao_deinterleaved_slices, rb->ss_effects.ssao.ao_pong, rb->ss_effects.ssao.ao_pong_slices, rb->ss_effects.ssao.ao_final, rb->ss_effects.ssao.importance_map[0], rb->ss_effects.ssao.importance_map[1], p_projection, settings, uniform_sets_are_invalid, rb->ss_effects.ssao.gather_uniform_set, rb->ss_effects.ssao.importance_map_uniform_set); + RendererCompositorRD::singleton->get_effects()->generate_ssao(p_normal_buffer, rb->ss_effects.ssao.depth_texture_view, rb->ss_effects.ssao.ao_deinterleaved, rb->ss_effects.ssao.ao_deinterleaved_slices, rb->ss_effects.ssao.ao_pong, rb->ss_effects.ssao.ao_pong_slices, rb->ss_effects.ssao.ao_final, rb->ss_effects.ssao.importance_map[0], rb->ss_effects.ssao.importance_map[1], p_projection, settings, uniform_sets_are_invalid, rb->ss_effects.ssao.gather_uniform_set, rb->ss_effects.ssao.importance_map_uniform_set); } void RendererSceneRenderRD::_process_ssil(RID p_render_buffers, RID p_environment, RID p_normal_buffer, const CameraMatrix &p_projection, const Transform3D &p_transform) { @@ -2306,7 +2307,7 @@ void RendererSceneRenderRD::_process_ssil(RID p_render_buffers, RID p_environmen transform.set_origin(Vector3(0.0, 0.0, 0.0)); CameraMatrix last_frame_projection = rb->ss_effects.last_frame_projection * CameraMatrix(rb->ss_effects.last_frame_transform.affine_inverse()) * CameraMatrix(transform) * projection.inverse(); - storage->get_effects()->screen_space_indirect_lighting(rb->ss_effects.last_frame, rb->ss_effects.ssil.ssil_final, p_normal_buffer, rb->ss_effects.ssil.depth_texture_view, rb->ss_effects.ssil.deinterleaved, rb->ss_effects.ssil.deinterleaved_slices, rb->ss_effects.ssil.pong, rb->ss_effects.ssil.pong_slices, rb->ss_effects.ssil.importance_map[0], rb->ss_effects.ssil.importance_map[1], rb->ss_effects.ssil.edges, rb->ss_effects.ssil.edges_slices, p_projection, last_frame_projection, settings, uniform_sets_are_invalid, rb->ss_effects.ssil.gather_uniform_set, rb->ss_effects.ssil.importance_map_uniform_set, rb->ss_effects.ssil.projection_uniform_set); + RendererCompositorRD::singleton->get_effects()->screen_space_indirect_lighting(rb->ss_effects.last_frame, rb->ss_effects.ssil.ssil_final, p_normal_buffer, rb->ss_effects.ssil.depth_texture_view, rb->ss_effects.ssil.deinterleaved, rb->ss_effects.ssil.deinterleaved_slices, rb->ss_effects.ssil.pong, rb->ss_effects.ssil.pong_slices, rb->ss_effects.ssil.importance_map[0], rb->ss_effects.ssil.importance_map[1], rb->ss_effects.ssil.edges, rb->ss_effects.ssil.edges_slices, p_projection, last_frame_projection, settings, uniform_sets_are_invalid, rb->ss_effects.ssil.gather_uniform_set, rb->ss_effects.ssil.importance_map_uniform_set, rb->ss_effects.ssil.projection_uniform_set); rb->ss_effects.last_frame_projection = projection; rb->ss_effects.last_frame_transform = transform; } @@ -2354,7 +2355,7 @@ void RendererSceneRenderRD::_process_taa(RID p_render_buffers, RID p_velocity_bu RD::get_singleton()->draw_command_begin_label("TAA"); if (!just_allocated) { - storage->get_effects()->taa_resolve(rb->internal_texture, rb->taa.temp, rb->depth_texture, p_velocity_buffer, rb->taa.prev_velocity, rb->taa.history, Size2(rb->internal_width, rb->internal_height), p_z_near, p_z_far); + RendererCompositorRD::singleton->get_effects()->taa_resolve(rb->internal_texture, rb->taa.temp, rb->depth_texture, p_velocity_buffer, rb->taa.prev_velocity, rb->taa.history, Size2(rb->internal_width, rb->internal_height), p_z_near, p_z_far); copy_effects->copy_to_rect(rb->taa.temp, rb->internal_texture, Rect2(0, 0, rb->internal_width, rb->internal_height)); } @@ -2492,9 +2493,9 @@ void RendererSceneRenderRD::_render_buffers_post_process_and_tonemap(const Rende double step = env->auto_exp_speed * time_step; if (can_use_storage) { - storage->get_effects()->luminance_reduction(rb->internal_texture, Size2i(rb->internal_width, rb->internal_height), rb->luminance.reduce, rb->luminance.current, env->min_luminance, env->max_luminance, step, set_immediate); + RendererCompositorRD::singleton->get_effects()->luminance_reduction(rb->internal_texture, Size2i(rb->internal_width, rb->internal_height), rb->luminance.reduce, rb->luminance.current, env->min_luminance, env->max_luminance, step, set_immediate); } else { - storage->get_effects()->luminance_reduction_raster(rb->internal_texture, Size2i(rb->internal_width, rb->internal_height), rb->luminance.reduce, rb->luminance.fb, rb->luminance.current, env->min_luminance, env->max_luminance, step, set_immediate); + RendererCompositorRD::singleton->get_effects()->luminance_reduction_raster(rb->internal_texture, Size2i(rb->internal_width, rb->internal_height), rb->luminance.reduce, rb->luminance.fb, rb->luminance.current, env->min_luminance, env->max_luminance, step, set_immediate); } // Swap final reduce with prev luminance. SWAP(rb->luminance.current, rb->luminance.reduce.write[rb->luminance.reduce.size() - 1]); @@ -2639,7 +2640,7 @@ void RendererSceneRenderRD::_render_buffers_post_process_and_tonemap(const Rende if (can_use_effects && can_use_storage && (rb->internal_width != rb->width || rb->internal_height != rb->height)) { RD::get_singleton()->draw_command_begin_label("FSR 1.0 Upscale"); - storage->get_effects()->fsr_upscale(rb->internal_texture, rb->upscale_texture, rb->texture, Size2i(rb->internal_width, rb->internal_height), Size2i(rb->width, rb->height), rb->fsr_sharpness); + RendererCompositorRD::singleton->get_effects()->fsr_upscale(rb->internal_texture, rb->upscale_texture, rb->texture, Size2i(rb->internal_width, rb->internal_height), Size2i(rb->width, rb->height), rb->fsr_sharpness); RD::get_singleton()->draw_command_end_label(); } @@ -3364,7 +3365,7 @@ void RendererSceneRenderRD::_setup_reflections(const PagedArray<RID> &p_reflecti Transform3D transform = rpi->transform; Transform3D proj = (p_camera_inverse_transform * transform).inverse(); - RendererStorageRD::store_transform(proj, reflection_ubo.local_matrix); + RendererRD::MaterialStorage::store_transform(proj, reflection_ubo.local_matrix); if (current_cluster_builder != nullptr) { current_cluster_builder->add_box(ClusterBuilderRD::BOX_TYPE_REFLECTION_PROBE, transform, extents); @@ -3482,7 +3483,7 @@ void RendererSceneRenderRD::_setup_lights(const PagedArray<RID> &p_lights, const light_data.shadow_transmittance_bias[j] = light_storage->light_get_transmittance_bias(base) * bias_scale; light_data.shadow_z_range[j] = li->shadow_transform[j].farplane; light_data.shadow_range_begin[j] = li->shadow_transform[j].range_begin; - RendererStorageRD::store_camera(shadow_mtx, light_data.shadow_matrices[j]); + RendererRD::MaterialStorage::store_camera(shadow_mtx, light_data.shadow_matrices[j]); Vector2 uv_scale = li->shadow_transform[j].uv_scale; uv_scale *= atlas_rect.size; //adapt to atlas size @@ -3727,7 +3728,7 @@ void RendererSceneRenderRD::_setup_lights(const PagedArray<RID> &p_lights, const if (type == RS::LIGHT_OMNI) { Transform3D proj = (inverse_transform * light_transform).inverse(); - RendererStorageRD::store_transform(proj, light_data.shadow_matrix); + RendererRD::MaterialStorage::store_transform(proj, light_data.shadow_matrix); if (size > 0.0 && light_data.soft_shadow_scale > 0.0) { // Only enable PCSS-like soft shadows if blurring is enabled. @@ -3746,7 +3747,7 @@ void RendererSceneRenderRD::_setup_lights(const PagedArray<RID> &p_lights, const bias.set_light_bias(); CameraMatrix shadow_mtx = bias * li->shadow_transform[0].camera * modelview; - RendererStorageRD::store_camera(shadow_mtx, light_data.shadow_matrix); + RendererRD::MaterialStorage::store_camera(shadow_mtx, light_data.shadow_matrix); if (size > 0.0 && light_data.soft_shadow_scale > 0.0) { // Only enable PCSS-like soft shadows if blurring is enabled. @@ -3865,7 +3866,7 @@ void RendererSceneRenderRD::_setup_decals(const PagedArray<RID> &p_decals, const Transform3D scale_xform; scale_xform.basis.scale(decal_extents); Transform3D to_decal_xform = (p_camera_inverse_xform * di->transform * scale_xform * uv_xform).affine_inverse(); - RendererStorageRD::store_transform(to_decal_xform, dd.xform); + RendererRD::MaterialStorage::store_transform(to_decal_xform, dd.xform); Vector3 normal = xform.basis.get_column(Vector3::AXIS_Y).normalized(); normal = p_camera_inverse_xform.basis.xform(normal); //camera is normalized, so fine @@ -3903,7 +3904,7 @@ void RendererSceneRenderRD::_setup_decals(const PagedArray<RID> &p_decals, const dd.normal_rect[3] = rect.size.y; Basis normal_xform = p_camera_inverse_xform.basis * xform.basis.orthonormalized(); - RendererStorageRD::store_basis_3x4(normal_xform, dd.normal_xform); + RendererRD::MaterialStorage::store_basis_3x4(normal_xform, dd.normal_xform); } else { dd.normal_rect[0] = 0; dd.normal_rect[1] = 0; @@ -4326,8 +4327,8 @@ void RendererSceneRenderRD::_update_volumetric_fog(RID p_render_buffers, RID p_e params.temporal_blend = env->volumetric_fog_temporal_reprojection_amount; Transform3D to_prev_cam_view = p_prev_cam_inv_transform * p_cam_transform; - storage->store_transform(to_prev_cam_view, params.to_prev_view); - storage->store_transform(p_cam_transform, params.transform); + RendererRD::MaterialStorage::store_transform(to_prev_cam_view, params.to_prev_view); + RendererRD::MaterialStorage::store_transform(p_cam_transform, params.transform); RD::get_singleton()->buffer_update(volumetric_fog.volume_ubo, 0, sizeof(VolumetricFogShader::VolumeUBO), ¶ms, RD::BARRIER_MASK_COMPUTE); @@ -4389,7 +4390,7 @@ void RendererSceneRenderRD::_update_volumetric_fog(RID p_render_buffers, RID p_e ERR_FAIL_COND(!fog_volume_instance); RID fog_volume = fog_volume_instance->volume; - RID fog_material = storage->fog_volume_get_material(fog_volume); + RID fog_material = RendererRD::Fog::get_singleton()->fog_volume_get_material(fog_volume); FogMaterialData *material = nullptr; @@ -4418,8 +4419,8 @@ void RendererSceneRenderRD::_update_volumetric_fog(RID p_render_buffers, RID p_e Vector3i kernel_size = Vector3i(); Vector3 position = fog_volume_instance->transform.get_origin(); - RS::FogVolumeShape volume_type = storage->fog_volume_get_shape(fog_volume); - Vector3 extents = storage->fog_volume_get_extents(fog_volume); + RS::FogVolumeShape volume_type = RendererRD::Fog::get_singleton()->fog_volume_get_shape(fog_volume); + Vector3 extents = RendererRD::Fog::get_singleton()->fog_volume_get_extents(fog_volume); if (volume_type != RS::FOG_VOLUME_SHAPE_WORLD) { // Local fog volume. @@ -4462,8 +4463,8 @@ void RendererSceneRenderRD::_update_volumetric_fog(RID p_render_buffers, RID p_e volumetric_fog.push_constant.corner[0] = min.x; volumetric_fog.push_constant.corner[1] = min.y; volumetric_fog.push_constant.corner[2] = min.z; - volumetric_fog.push_constant.shape = uint32_t(storage->fog_volume_get_shape(fog_volume)); - storage->store_transform(fog_volume_instance->transform.affine_inverse(), volumetric_fog.push_constant.transform); + volumetric_fog.push_constant.shape = uint32_t(RendererRD::Fog::get_singleton()->fog_volume_get_shape(fog_volume)); + RendererRD::MaterialStorage::store_transform(fog_volume_instance->transform.affine_inverse(), volumetric_fog.push_constant.transform); RD::get_singleton()->compute_list_bind_compute_pipeline(compute_list, shader_data->pipeline); @@ -4808,7 +4809,7 @@ void RendererSceneRenderRD::_update_volumetric_fog(RID p_render_buffers, RID p_e params.temporal_frame = RSG::rasterizer->get_frame_number() % VolumetricFog::MAX_TEMPORAL_FRAMES; Transform3D to_prev_cam_view = p_prev_cam_inv_transform * p_cam_transform; - storage->store_transform(to_prev_cam_view, params.to_prev_view); + RendererRD::MaterialStorage::store_transform(to_prev_cam_view, params.to_prev_view); params.use_temporal_reprojection = env->volumetric_fog_temporal_reprojection; params.temporal_blend = env->volumetric_fog_temporal_reprojection_amount; @@ -4829,7 +4830,7 @@ void RendererSceneRenderRD::_update_volumetric_fog(RID p_render_buffers, RID p_e Basis sky_transform = env->sky_orientation; sky_transform = sky_transform.inverse() * p_cam_transform.basis; - RendererStorageRD::store_transform_3x3(sky_transform, params.radiance_inverse_xform); + RendererRD::MaterialStorage::store_transform_3x3(sky_transform, params.radiance_inverse_xform); RD::get_singleton()->draw_command_begin_label("Render Volumetric Fog"); @@ -5040,7 +5041,7 @@ void RendererSceneRenderRD::_pre_opaque_render(RenderDataRD *p_render_data, bool invalidate_uniform_set = true; } - storage->get_effects()->downsample_depth(rb->depth_texture, rb->ss_effects.linear_depth_slices, ssao_quality, ssil_quality, invalidate_uniform_set, ssao_half_size, ssil_half_size, Size2i(rb->width, rb->height), p_render_data->cam_projection); + RendererCompositorRD::singleton->get_effects()->downsample_depth(rb->depth_texture, rb->ss_effects.linear_depth_slices, ssao_quality, ssil_quality, invalidate_uniform_set, ssao_half_size, ssil_half_size, Size2i(rb->width, rb->height), p_render_data->cam_projection); } if (p_use_ssao) { @@ -5189,7 +5190,7 @@ void RendererSceneRenderRD::render_scene(RID p_render_buffers, const CameraData if (p_render_buffers.is_valid()) { clear_color = texture_storage->render_target_get_clear_request_color(rb->render_target); } else { - clear_color = storage->get_default_clear_color(); + clear_color = RSG::texture_storage->get_default_clear_color(); } //assign render indices to voxel_gi_instances @@ -5754,8 +5755,7 @@ uint32_t RendererSceneRenderRD::get_max_elements() const { return GLOBAL_GET("rendering/limits/cluster_builder/max_clustered_elements"); } -RendererSceneRenderRD::RendererSceneRenderRD(RendererStorageRD *p_storage) { - storage = p_storage; +RendererSceneRenderRD::RendererSceneRenderRD() { singleton = this; } @@ -5769,12 +5769,12 @@ void RendererSceneRenderRD::init() { /* SKY SHADER */ - sky.init(storage); + sky.init(); /* GI */ if (is_dynamic_gi_supported()) { - gi.init(storage, &sky); + gi.init(&sky); } { //decals diff --git a/servers/rendering/renderer_rd/renderer_scene_render_rd.h b/servers/rendering/renderer_rd/renderer_scene_render_rd.h index 3f03f857f7..e8296882c9 100644 --- a/servers/rendering/renderer_rd/renderer_scene_render_rd.h +++ b/servers/rendering/renderer_rd/renderer_scene_render_rd.h @@ -41,7 +41,6 @@ #include "servers/rendering/renderer_rd/environment/gi.h" #include "servers/rendering/renderer_rd/renderer_scene_environment_rd.h" #include "servers/rendering/renderer_rd/renderer_scene_sky_rd.h" -#include "servers/rendering/renderer_rd/renderer_storage_rd.h" #include "servers/rendering/renderer_rd/shaders/volumetric_fog.glsl.gen.h" #include "servers/rendering/renderer_rd/shaders/volumetric_fog_process.glsl.gen.h" #include "servers/rendering/renderer_scene.h" @@ -102,7 +101,6 @@ class RendererSceneRenderRD : public RendererSceneRender { friend RendererRD::GI; protected: - RendererStorageRD *storage = nullptr; RendererRD::BokehDOF *bokeh_dof = nullptr; RendererRD::CopyEffects *copy_effects = nullptr; RendererRD::ToneMapper *tone_mapper = nullptr; @@ -1512,7 +1510,7 @@ public: void init(); - RendererSceneRenderRD(RendererStorageRD *p_storage); + RendererSceneRenderRD(); ~RendererSceneRenderRD(); }; diff --git a/servers/rendering/renderer_rd/renderer_scene_sky_rd.cpp b/servers/rendering/renderer_rd/renderer_scene_sky_rd.cpp index b3b9b86aa8..73175d3cf3 100644 --- a/servers/rendering/renderer_rd/renderer_scene_sky_rd.cpp +++ b/servers/rendering/renderer_rd/renderer_scene_sky_rd.cpp @@ -37,6 +37,7 @@ #include "servers/rendering/renderer_rd/storage_rd/material_storage.h" #include "servers/rendering/renderer_rd/storage_rd/texture_storage.h" #include "servers/rendering/rendering_server_default.h" +#include "servers/rendering/rendering_server_globals.h" //////////////////////////////////////////////////////////////////////////////// // SKY SHADER @@ -329,13 +330,13 @@ void RendererSceneSkyRD::ReflectionData::clear_reflection_data() { coefficient_buffer = RID(); } -void RendererSceneSkyRD::ReflectionData::update_reflection_data(RendererStorageRD *p_storage, int p_size, int p_mipmaps, bool p_use_array, RID p_base_cube, int p_base_layer, bool p_low_quality, int p_roughness_layers, RD::DataFormat p_texture_format) { +void RendererSceneSkyRD::ReflectionData::update_reflection_data(int p_size, int p_mipmaps, bool p_use_array, RID p_base_cube, int p_base_layer, bool p_low_quality, int p_roughness_layers, RD::DataFormat p_texture_format) { //recreate radiance and all data int mipmaps = p_mipmaps; uint32_t w = p_size, h = p_size; - EffectsRD *effects = p_storage->get_effects(); + EffectsRD *effects = RendererCompositorRD::singleton->get_effects(); ERR_FAIL_NULL_MSG(effects, "Effects haven't been initialised"); bool prefer_raster_effects = effects->get_prefer_raster_effects(); @@ -437,7 +438,7 @@ void RendererSceneSkyRD::ReflectionData::update_reflection_data(RendererStorageR } } -void RendererSceneSkyRD::ReflectionData::create_reflection_fast_filter(RendererStorageRD *p_storage, bool p_use_arrays) { +void RendererSceneSkyRD::ReflectionData::create_reflection_fast_filter(bool p_use_arrays) { RendererRD::CopyEffects *copy_effects = RendererRD::CopyEffects::get_singleton(); ERR_FAIL_NULL_MSG(copy_effects, "Effects haven't been initialised"); bool prefer_raster_effects = copy_effects->get_prefer_raster_effects(); @@ -495,7 +496,7 @@ void RendererSceneSkyRD::ReflectionData::create_reflection_fast_filter(RendererS } } -void RendererSceneSkyRD::ReflectionData::create_reflection_importance_sample(RendererStorageRD *p_storage, bool p_use_arrays, int p_cube_side, int p_base_layer, uint32_t p_sky_ggx_samples_quality) { +void RendererSceneSkyRD::ReflectionData::create_reflection_importance_sample(bool p_use_arrays, int p_cube_side, int p_base_layer, uint32_t p_sky_ggx_samples_quality) { RendererRD::CopyEffects *copy_effects = RendererRD::CopyEffects::get_singleton(); ERR_FAIL_NULL_MSG(copy_effects, "Effects haven't been initialised"); bool prefer_raster_effects = copy_effects->get_prefer_raster_effects(); @@ -564,7 +565,7 @@ void RendererSceneSkyRD::ReflectionData::create_reflection_importance_sample(Ren RD::get_singleton()->draw_command_end_label(); // Filter radiance } -void RendererSceneSkyRD::ReflectionData::update_reflection_mipmaps(RendererStorageRD *p_storage, int p_start, int p_end) { +void RendererSceneSkyRD::ReflectionData::update_reflection_mipmaps(int p_start, int p_end) { RendererRD::CopyEffects *copy_effects = RendererRD::CopyEffects::get_singleton(); ERR_FAIL_NULL_MSG(copy_effects, "Effects haven't been initialised"); bool prefer_raster_effects = copy_effects->get_prefer_raster_effects(); @@ -591,7 +592,7 @@ void RendererSceneSkyRD::ReflectionData::update_reflection_mipmaps(RendererStora //////////////////////////////////////////////////////////////////////////////// // RendererSceneSkyRD::Sky -void RendererSceneSkyRD::Sky::free(RendererStorageRD *p_storage) { +void RendererSceneSkyRD::Sky::free() { if (radiance.is_valid()) { RD::get_singleton()->free(radiance); radiance = RID(); @@ -614,12 +615,12 @@ void RendererSceneSkyRD::Sky::free(RendererStorageRD *p_storage) { } if (material.is_valid()) { - p_storage->free(material); + RSG::material_storage->material_free(material); material = RID(); } } -RID RendererSceneSkyRD::Sky::get_textures(RendererStorageRD *p_storage, SkyTextureSetVersion p_version, RID p_default_shader_rd) { +RID RendererSceneSkyRD::Sky::get_textures(SkyTextureSetVersion p_version, RID p_default_shader_rd) { RendererRD::TextureStorage *texture_storage = RendererRD::TextureStorage::get_singleton(); if (texture_uniform_sets[p_version].is_valid() && RD::get_singleton()->uniform_set_is_valid(texture_uniform_sets[p_version])) { @@ -795,10 +796,9 @@ RendererSceneSkyRD::RendererSceneSkyRD() { sky_use_cubemap_array = GLOBAL_GET("rendering/reflections/sky_reflections/texture_array_reflections"); } -void RendererSceneSkyRD::init(RendererStorageRD *p_storage) { +void RendererSceneSkyRD::init() { RendererRD::TextureStorage *texture_storage = RendererRD::TextureStorage::get_singleton(); RendererRD::MaterialStorage *material_storage = RendererRD::MaterialStorage::get_singleton(); - storage = p_storage; { // Start with the directional lights for the sky @@ -1387,7 +1387,7 @@ void RendererSceneSkyRD::update(RendererSceneEnvironmentRD *p_env, const CameraM for (int i = 0; i < 6; i++) { Basis local_view = Basis::looking_at(view_normals[i], view_up[i]); - RID texture_uniform_set = sky->get_textures(storage, SKY_TEXTURE_SET_CUBEMAP_QUARTER_RES, sky_shader.default_shader_rd); + RID texture_uniform_set = sky->get_textures(SKY_TEXTURE_SET_CUBEMAP_QUARTER_RES, sky_shader.default_shader_rd); cubemap_draw_list = RD::get_singleton()->draw_list_begin(sky->reflection.layers[0].mipmaps[2].framebuffers[i], RD::INITIAL_ACTION_KEEP, RD::FINAL_ACTION_READ, RD::INITIAL_ACTION_KEEP, RD::FINAL_ACTION_DISCARD); _render_sky(cubemap_draw_list, p_time, sky->reflection.layers[0].mipmaps[2].framebuffers[i], pipeline, material->uniform_set, texture_uniform_set, 1, &cm, local_view, multiplier, p_transform.origin, p_luminance_multiplier); @@ -1406,7 +1406,7 @@ void RendererSceneSkyRD::update(RendererSceneEnvironmentRD *p_env, const CameraM for (int i = 0; i < 6; i++) { Basis local_view = Basis::looking_at(view_normals[i], view_up[i]); - RID texture_uniform_set = sky->get_textures(storage, SKY_TEXTURE_SET_CUBEMAP_HALF_RES, sky_shader.default_shader_rd); + RID texture_uniform_set = sky->get_textures(SKY_TEXTURE_SET_CUBEMAP_HALF_RES, sky_shader.default_shader_rd); cubemap_draw_list = RD::get_singleton()->draw_list_begin(sky->reflection.layers[0].mipmaps[1].framebuffers[i], RD::INITIAL_ACTION_KEEP, RD::FINAL_ACTION_READ, RD::INITIAL_ACTION_KEEP, RD::FINAL_ACTION_DISCARD); _render_sky(cubemap_draw_list, p_time, sky->reflection.layers[0].mipmaps[1].framebuffers[i], pipeline, material->uniform_set, texture_uniform_set, 1, &cm, local_view, multiplier, p_transform.origin, p_luminance_multiplier); @@ -1421,7 +1421,7 @@ void RendererSceneSkyRD::update(RendererSceneEnvironmentRD *p_env, const CameraM RD::get_singleton()->draw_command_begin_label("Render Sky Cubemap"); for (int i = 0; i < 6; i++) { Basis local_view = Basis::looking_at(view_normals[i], view_up[i]); - RID texture_uniform_set = sky->get_textures(storage, SKY_TEXTURE_SET_CUBEMAP, sky_shader.default_shader_rd); + RID texture_uniform_set = sky->get_textures(SKY_TEXTURE_SET_CUBEMAP, sky_shader.default_shader_rd); cubemap_draw_list = RD::get_singleton()->draw_list_begin(sky->reflection.layers[0].mipmaps[0].framebuffers[i], RD::INITIAL_ACTION_KEEP, RD::FINAL_ACTION_READ, RD::INITIAL_ACTION_KEEP, RD::FINAL_ACTION_DISCARD); _render_sky(cubemap_draw_list, p_time, sky->reflection.layers[0].mipmaps[0].framebuffers[i], pipeline, material->uniform_set, texture_uniform_set, 1, &cm, local_view, multiplier, p_transform.origin, p_luminance_multiplier); @@ -1430,22 +1430,22 @@ void RendererSceneSkyRD::update(RendererSceneEnvironmentRD *p_env, const CameraM RD::get_singleton()->draw_command_end_label(); if (sky_mode == RS::SKY_MODE_REALTIME) { - sky->reflection.create_reflection_fast_filter(storage, sky_use_cubemap_array); + sky->reflection.create_reflection_fast_filter(sky_use_cubemap_array); if (sky_use_cubemap_array) { - sky->reflection.update_reflection_mipmaps(storage, 0, sky->reflection.layers.size()); + sky->reflection.update_reflection_mipmaps(0, sky->reflection.layers.size()); } } else { if (update_single_frame) { for (int i = 1; i < max_processing_layer; i++) { - sky->reflection.create_reflection_importance_sample(storage, sky_use_cubemap_array, 10, i, sky_ggx_samples_quality); + sky->reflection.create_reflection_importance_sample(sky_use_cubemap_array, 10, i, sky_ggx_samples_quality); } if (sky_use_cubemap_array) { - sky->reflection.update_reflection_mipmaps(storage, 0, sky->reflection.layers.size()); + sky->reflection.update_reflection_mipmaps(0, sky->reflection.layers.size()); } } else { if (sky_use_cubemap_array) { // Multi-Frame so just update the first array level - sky->reflection.update_reflection_mipmaps(storage, 0, 1); + sky->reflection.update_reflection_mipmaps(0, 1); } } sky->processing_layer = 1; @@ -1455,10 +1455,10 @@ void RendererSceneSkyRD::update(RendererSceneEnvironmentRD *p_env, const CameraM } else { if (sky_mode == RS::SKY_MODE_INCREMENTAL && sky->processing_layer < max_processing_layer) { - sky->reflection.create_reflection_importance_sample(storage, sky_use_cubemap_array, 10, sky->processing_layer, sky_ggx_samples_quality); + sky->reflection.create_reflection_importance_sample(sky_use_cubemap_array, 10, sky->processing_layer, sky_ggx_samples_quality); if (sky_use_cubemap_array) { - sky->reflection.update_reflection_mipmaps(storage, sky->processing_layer, sky->processing_layer + 1); + sky->reflection.update_reflection_mipmaps(sky->processing_layer, sky->processing_layer + 1); } sky->processing_layer++; @@ -1536,7 +1536,7 @@ void RendererSceneSkyRD::draw(RendererSceneEnvironmentRD *p_env, bool p_can_cont if (shader_data->uses_quarter_res) { PipelineCacheRD *pipeline = &shader_data->pipelines[view_count > 1 ? SKY_VERSION_QUARTER_RES_MULTIVIEW : SKY_VERSION_QUARTER_RES]; - RID texture_uniform_set = sky->get_textures(storage, SKY_TEXTURE_SET_QUARTER_RES, sky_shader.default_shader_rd); + RID texture_uniform_set = sky->get_textures(SKY_TEXTURE_SET_QUARTER_RES, sky_shader.default_shader_rd); Vector<Color> clear_colors; clear_colors.push_back(Color(0.0, 0.0, 0.0)); @@ -1549,7 +1549,7 @@ void RendererSceneSkyRD::draw(RendererSceneEnvironmentRD *p_env, bool p_can_cont if (shader_data->uses_half_res) { PipelineCacheRD *pipeline = &shader_data->pipelines[view_count > 1 ? SKY_VERSION_HALF_RES_MULTIVIEW : SKY_VERSION_HALF_RES]; - RID texture_uniform_set = sky->get_textures(storage, SKY_TEXTURE_SET_HALF_RES, sky_shader.default_shader_rd); + RID texture_uniform_set = sky->get_textures(SKY_TEXTURE_SET_HALF_RES, sky_shader.default_shader_rd); Vector<Color> clear_colors; clear_colors.push_back(Color(0.0, 0.0, 0.0)); @@ -1563,7 +1563,7 @@ void RendererSceneSkyRD::draw(RendererSceneEnvironmentRD *p_env, bool p_can_cont RID texture_uniform_set; if (sky) { - texture_uniform_set = sky->get_textures(storage, SKY_TEXTURE_SET_BACKGROUND, sky_shader.default_shader_rd); + texture_uniform_set = sky->get_textures(SKY_TEXTURE_SET_BACKGROUND, sky_shader.default_shader_rd); } else { texture_uniform_set = sky_scene_state.fog_only_texture_uniform_set; } @@ -1634,7 +1634,7 @@ void RendererSceneSkyRD::update_res_buffers(RendererSceneEnvironmentRD *p_env, u if (shader_data->uses_quarter_res) { PipelineCacheRD *pipeline = &shader_data->pipelines[view_count > 1 ? SKY_VERSION_QUARTER_RES_MULTIVIEW : SKY_VERSION_QUARTER_RES]; - RID texture_uniform_set = sky->get_textures(storage, SKY_TEXTURE_SET_QUARTER_RES, sky_shader.default_shader_rd); + RID texture_uniform_set = sky->get_textures(SKY_TEXTURE_SET_QUARTER_RES, sky_shader.default_shader_rd); Vector<Color> clear_colors; clear_colors.push_back(Color(0.0, 0.0, 0.0)); @@ -1647,7 +1647,7 @@ void RendererSceneSkyRD::update_res_buffers(RendererSceneEnvironmentRD *p_env, u if (shader_data->uses_half_res) { PipelineCacheRD *pipeline = &shader_data->pipelines[view_count > 1 ? SKY_VERSION_HALF_RES_MULTIVIEW : SKY_VERSION_HALF_RES]; - RID texture_uniform_set = sky->get_textures(storage, SKY_TEXTURE_SET_HALF_RES, sky_shader.default_shader_rd); + RID texture_uniform_set = sky->get_textures(SKY_TEXTURE_SET_HALF_RES, sky_shader.default_shader_rd); Vector<Color> clear_colors; clear_colors.push_back(Color(0.0, 0.0, 0.0)); @@ -1729,7 +1729,7 @@ void RendererSceneSkyRD::draw(RD::DrawListID p_draw_list, RendererSceneEnvironme RID texture_uniform_set; if (sky) { - texture_uniform_set = sky->get_textures(storage, SKY_TEXTURE_SET_BACKGROUND, sky_shader.default_shader_rd); + texture_uniform_set = sky->get_textures(SKY_TEXTURE_SET_BACKGROUND, sky_shader.default_shader_rd); } else { texture_uniform_set = sky_scene_state.fog_only_texture_uniform_set; } @@ -1777,7 +1777,7 @@ void RendererSceneSkyRD::update_dirty_skys() { sky->radiance = RD::get_singleton()->texture_create(tf, RD::TextureView()); - sky->reflection.update_reflection_data(storage, sky->radiance_size, mipmaps, true, sky->radiance, 0, sky->mode == RS::SKY_MODE_REALTIME, roughness_layers, texture_format); + sky->reflection.update_reflection_data(sky->radiance_size, mipmaps, true, sky->radiance, 0, sky->mode == RS::SKY_MODE_REALTIME, roughness_layers, texture_format); } else { //regular cubemap, lower quality (aliasing, less memory) @@ -1792,7 +1792,7 @@ void RendererSceneSkyRD::update_dirty_skys() { sky->radiance = RD::get_singleton()->texture_create(tf, RD::TextureView()); - sky->reflection.update_reflection_data(storage, sky->radiance_size, MIN(mipmaps, layers), false, sky->radiance, 0, sky->mode == RS::SKY_MODE_REALTIME, roughness_layers, texture_format); + sky->reflection.update_reflection_data(sky->radiance_size, MIN(mipmaps, layers), false, sky->radiance, 0, sky->mode == RS::SKY_MODE_REALTIME, roughness_layers, texture_format); } texture_set_dirty = true; } @@ -1872,7 +1872,7 @@ void RendererSceneSkyRD::free_sky(RID p_sky) { Sky *sky = get_sky(p_sky); ERR_FAIL_COND(!sky); - sky->free(storage); + sky->free(); sky_owner.free(p_sky); } diff --git a/servers/rendering/renderer_rd/renderer_scene_sky_rd.h b/servers/rendering/renderer_rd/renderer_scene_sky_rd.h index 83a8fe6e77..a8ee406abc 100644 --- a/servers/rendering/renderer_rd/renderer_scene_sky_rd.h +++ b/servers/rendering/renderer_rd/renderer_scene_sky_rd.h @@ -33,11 +33,13 @@ #include "core/templates/rid_owner.h" #include "servers/rendering/renderer_compositor.h" +#include "servers/rendering/renderer_rd/pipeline_cache_rd.h" #include "servers/rendering/renderer_rd/renderer_scene_environment_rd.h" -#include "servers/rendering/renderer_rd/renderer_storage_rd.h" #include "servers/rendering/renderer_rd/shaders/sky.glsl.gen.h" +#include "servers/rendering/renderer_rd/storage_rd/material_storage.h" #include "servers/rendering/renderer_scene_render.h" #include "servers/rendering/rendering_device.h" +#include "servers/rendering/shader_compiler.h" // Forward declare RendererSceneRenderRD so we can pass it into some of our methods, these classes are pretty tightly bound class RendererSceneRenderRD; @@ -63,7 +65,6 @@ public: }; private: - RendererStorageRD *storage = nullptr; RD::DataFormat texture_format = RD::DATA_FORMAT_R16G16B16A16_SFLOAT; RID index_buffer; @@ -211,10 +212,10 @@ public: Vector<Layer> layers; void clear_reflection_data(); - void update_reflection_data(RendererStorageRD *p_storage, int p_size, int p_mipmaps, bool p_use_array, RID p_base_cube, int p_base_layer, bool p_low_quality, int p_roughness_layers, RD::DataFormat p_texture_format); - void create_reflection_fast_filter(RendererStorageRD *p_storage, bool p_use_arrays); - void create_reflection_importance_sample(RendererStorageRD *p_storage, bool p_use_arrays, int p_cube_side, int p_base_layer, uint32_t p_sky_ggx_samples_quality); - void update_reflection_mipmaps(RendererStorageRD *p_storage, int p_start, int p_end); + void update_reflection_data(int p_size, int p_mipmaps, bool p_use_array, RID p_base_cube, int p_base_layer, bool p_low_quality, int p_roughness_layers, RD::DataFormat p_texture_format); + void create_reflection_fast_filter(bool p_use_arrays); + void create_reflection_importance_sample(bool p_use_arrays, int p_cube_side, int p_base_layer, uint32_t p_sky_ggx_samples_quality); + void update_reflection_mipmaps(int p_start, int p_end); }; /* Sky shader */ @@ -267,9 +268,9 @@ public: Vector3 prev_position; float prev_time; - void free(RendererStorageRD *p_storage); + void free(); - RID get_textures(RendererStorageRD *p_storage, SkyTextureSetVersion p_version, RID p_default_shader_rd); + RID get_textures(SkyTextureSetVersion p_version, RID p_default_shader_rd); bool set_radiance_size(int p_radiance_size); bool set_mode(RS::SkyMode p_mode); bool set_material(RID p_material); @@ -289,7 +290,7 @@ public: static RendererRD::MaterialData *_create_sky_material_funcs(RendererRD::ShaderData *p_shader); RendererSceneSkyRD(); - void init(RendererStorageRD *p_storage); + void init(); void set_texture_format(RD::DataFormat p_texture_format); ~RendererSceneSkyRD(); diff --git a/servers/rendering/renderer_rd/renderer_storage_rd.h b/servers/rendering/renderer_rd/renderer_storage_rd.h deleted file mode 100644 index d41129d678..0000000000 --- a/servers/rendering/renderer_rd/renderer_storage_rd.h +++ /dev/null @@ -1,222 +0,0 @@ -/*************************************************************************/ -/* renderer_storage_rd.h */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* https://godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur. */ -/* Copyright (c) 2014-2022 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. */ -/*************************************************************************/ - -#ifndef RENDERING_SERVER_STORAGE_RD_H -#define RENDERING_SERVER_STORAGE_RD_H - -#include "core/templates/list.h" -#include "core/templates/local_vector.h" -#include "core/templates/rid_owner.h" -#include "servers/rendering/renderer_compositor.h" -#include "servers/rendering/renderer_rd/effects_rd.h" -#include "servers/rendering/renderer_rd/shaders/environment/voxel_gi_sdf.glsl.gen.h" -#include "servers/rendering/renderer_rd/storage_rd/material_storage.h" -#include "servers/rendering/renderer_scene_render.h" -#include "servers/rendering/rendering_device.h" -#include "servers/rendering/shader_compiler.h" - -class RendererStorageRD : public RendererStorage { -public: - static _FORCE_INLINE_ void store_transform(const Transform3D &p_mtx, float *p_array) { - p_array[0] = p_mtx.basis.rows[0][0]; - p_array[1] = p_mtx.basis.rows[1][0]; - p_array[2] = p_mtx.basis.rows[2][0]; - p_array[3] = 0; - p_array[4] = p_mtx.basis.rows[0][1]; - p_array[5] = p_mtx.basis.rows[1][1]; - p_array[6] = p_mtx.basis.rows[2][1]; - p_array[7] = 0; - p_array[8] = p_mtx.basis.rows[0][2]; - p_array[9] = p_mtx.basis.rows[1][2]; - p_array[10] = p_mtx.basis.rows[2][2]; - p_array[11] = 0; - p_array[12] = p_mtx.origin.x; - p_array[13] = p_mtx.origin.y; - p_array[14] = p_mtx.origin.z; - p_array[15] = 1; - } - - static _FORCE_INLINE_ void store_basis_3x4(const Basis &p_mtx, float *p_array) { - p_array[0] = p_mtx.rows[0][0]; - p_array[1] = p_mtx.rows[1][0]; - p_array[2] = p_mtx.rows[2][0]; - p_array[3] = 0; - p_array[4] = p_mtx.rows[0][1]; - p_array[5] = p_mtx.rows[1][1]; - p_array[6] = p_mtx.rows[2][1]; - p_array[7] = 0; - p_array[8] = p_mtx.rows[0][2]; - p_array[9] = p_mtx.rows[1][2]; - p_array[10] = p_mtx.rows[2][2]; - p_array[11] = 0; - } - - static _FORCE_INLINE_ void store_transform_3x3(const Basis &p_mtx, float *p_array) { - p_array[0] = p_mtx.rows[0][0]; - p_array[1] = p_mtx.rows[1][0]; - p_array[2] = p_mtx.rows[2][0]; - p_array[3] = 0; - p_array[4] = p_mtx.rows[0][1]; - p_array[5] = p_mtx.rows[1][1]; - p_array[6] = p_mtx.rows[2][1]; - p_array[7] = 0; - p_array[8] = p_mtx.rows[0][2]; - p_array[9] = p_mtx.rows[1][2]; - p_array[10] = p_mtx.rows[2][2]; - p_array[11] = 0; - } - - static _FORCE_INLINE_ void store_transform_transposed_3x4(const Transform3D &p_mtx, float *p_array) { - p_array[0] = p_mtx.basis.rows[0][0]; - p_array[1] = p_mtx.basis.rows[0][1]; - p_array[2] = p_mtx.basis.rows[0][2]; - p_array[3] = p_mtx.origin.x; - p_array[4] = p_mtx.basis.rows[1][0]; - p_array[5] = p_mtx.basis.rows[1][1]; - p_array[6] = p_mtx.basis.rows[1][2]; - p_array[7] = p_mtx.origin.y; - p_array[8] = p_mtx.basis.rows[2][0]; - p_array[9] = p_mtx.basis.rows[2][1]; - p_array[10] = p_mtx.basis.rows[2][2]; - p_array[11] = p_mtx.origin.z; - } - - static _FORCE_INLINE_ void store_camera(const CameraMatrix &p_mtx, float *p_array) { - for (int i = 0; i < 4; i++) { - for (int j = 0; j < 4; j++) { - p_array[i * 4 + j] = p_mtx.matrix[i][j]; - } - } - } - - static _FORCE_INLINE_ void store_soft_shadow_kernel(const float *p_kernel, float *p_array) { - for (int i = 0; i < 128; i++) { - p_array[i] = p_kernel[i]; - } - } - -private: - /* FOG VOLUMES */ - - struct FogVolume { - RID material; - Vector3 extents = Vector3(1, 1, 1); - - RS::FogVolumeShape shape = RS::FOG_VOLUME_SHAPE_BOX; - - Dependency dependency; - }; - - mutable RID_Owner<FogVolume, true> fog_volume_owner; - - /* visibility_notifier */ - - struct VisibilityNotifier { - AABB aabb; - Callable enter_callback; - Callable exit_callback; - Dependency dependency; - }; - - mutable RID_Owner<VisibilityNotifier> visibility_notifier_owner; - - /* EFFECTS */ - - EffectsRD *effects = nullptr; - -public: - //internal usage - - void base_update_dependency(RID p_base, DependencyTracker *p_instance); - - /* FOG VOLUMES */ - - virtual RID fog_volume_allocate(); - virtual void fog_volume_initialize(RID p_rid); - - virtual void fog_volume_set_shape(RID p_fog_volume, RS::FogVolumeShape p_shape); - virtual void fog_volume_set_extents(RID p_fog_volume, const Vector3 &p_extents); - virtual void fog_volume_set_material(RID p_fog_volume, RID p_material); - virtual RS::FogVolumeShape fog_volume_get_shape(RID p_fog_volume) const; - virtual RID fog_volume_get_material(RID p_fog_volume) const; - virtual AABB fog_volume_get_aabb(RID p_fog_volume) const; - virtual Vector3 fog_volume_get_extents(RID p_fog_volume) const; - - /* VISIBILITY NOTIFIER */ - - virtual RID visibility_notifier_allocate(); - virtual void visibility_notifier_initialize(RID p_notifier); - virtual void visibility_notifier_set_aabb(RID p_notifier, const AABB &p_aabb); - virtual void visibility_notifier_set_callbacks(RID p_notifier, const Callable &p_enter_callbable, const Callable &p_exit_callable); - - virtual AABB visibility_notifier_get_aabb(RID p_notifier) const; - virtual void visibility_notifier_call(RID p_notifier, bool p_enter, bool p_deferred); - - RS::InstanceType get_base_type(RID p_rid) const; - - bool free(RID p_rid); - - bool has_os_feature(const String &p_feature) const; - - void update_dirty_resources(); - - void set_debug_generate_wireframes(bool p_generate) {} - - //keep cached since it can be called form any thread - uint64_t texture_mem_cache = 0; - uint64_t buffer_mem_cache = 0; - uint64_t total_mem_cache = 0; - - virtual void update_memory_info(); - virtual uint64_t get_rendering_info(RS::RenderingInfo p_info); - - String get_video_adapter_name() const; - String get_video_adapter_vendor() const; - RenderingDevice::DeviceType get_video_adapter_type() const; - String get_video_adapter_api_version() const; - - virtual void capture_timestamps_begin(); - virtual void capture_timestamp(const String &p_name); - virtual uint32_t get_captured_timestamps_count() const; - virtual uint64_t get_captured_timestamps_frame() const; - virtual uint64_t get_captured_timestamp_gpu_time(uint32_t p_index) const; - virtual uint64_t get_captured_timestamp_cpu_time(uint32_t p_index) const; - virtual String get_captured_timestamp_name(uint32_t p_index) const; - - static RendererStorageRD *base_singleton; - - void init_effects(bool p_prefer_raster_effects); - EffectsRD *get_effects(); - - RendererStorageRD(); - ~RendererStorageRD(); -}; - -#endif // RASTERIZER_STORAGE_RD_H diff --git a/servers/rendering/renderer_rd/storage_rd/light_storage.cpp b/servers/rendering/renderer_rd/storage_rd/light_storage.cpp index 56a4525b8e..e65f676785 100644 --- a/servers/rendering/renderer_rd/storage_rd/light_storage.cpp +++ b/servers/rendering/renderer_rd/storage_rd/light_storage.cpp @@ -156,12 +156,12 @@ void LightStorage::light_set_param(RID p_light, RS::LightParam p_param, float p_ case RS::LIGHT_PARAM_SHADOW_PANCAKE_SIZE: case RS::LIGHT_PARAM_SHADOW_BIAS: { light->version++; - light->dependency.changed_notify(RendererStorage::DEPENDENCY_CHANGED_LIGHT); + light->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_LIGHT); } break; case RS::LIGHT_PARAM_SIZE: { if ((light->param[p_param] > CMP_EPSILON) != (p_value > CMP_EPSILON)) { //changing from no size to size and the opposite - light->dependency.changed_notify(RendererStorage::DEPENDENCY_CHANGED_LIGHT_SOFT_SHADOW_AND_PROJECTOR); + light->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_LIGHT_SOFT_SHADOW_AND_PROJECTOR); } } break; default: { @@ -177,7 +177,7 @@ void LightStorage::light_set_shadow(RID p_light, bool p_enabled) { light->shadow = p_enabled; light->version++; - light->dependency.changed_notify(RendererStorage::DEPENDENCY_CHANGED_LIGHT); + light->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_LIGHT); } void LightStorage::light_set_projector(RID p_light, RID p_texture) { @@ -199,7 +199,7 @@ void LightStorage::light_set_projector(RID p_light, RID p_texture) { if (light->projector.is_valid()) { texture_storage->texture_add_to_decal_atlas(light->projector, light->type == RS::LIGHT_OMNI); } - light->dependency.changed_notify(RendererStorage::DEPENDENCY_CHANGED_LIGHT_SOFT_SHADOW_AND_PROJECTOR); + light->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_LIGHT_SOFT_SHADOW_AND_PROJECTOR); } } @@ -217,7 +217,7 @@ void LightStorage::light_set_cull_mask(RID p_light, uint32_t p_mask) { light->cull_mask = p_mask; light->version++; - light->dependency.changed_notify(RendererStorage::DEPENDENCY_CHANGED_LIGHT); + light->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_LIGHT); } void LightStorage::light_set_distance_fade(RID p_light, bool p_enabled, float p_begin, float p_shadow, float p_length) { @@ -237,7 +237,7 @@ void LightStorage::light_set_reverse_cull_face_mode(RID p_light, bool p_enabled) light->reverse_cull = p_enabled; light->version++; - light->dependency.changed_notify(RendererStorage::DEPENDENCY_CHANGED_LIGHT); + light->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_LIGHT); } void LightStorage::light_set_bake_mode(RID p_light, RS::LightBakeMode p_bake_mode) { @@ -247,7 +247,7 @@ void LightStorage::light_set_bake_mode(RID p_light, RS::LightBakeMode p_bake_mod light->bake_mode = p_bake_mode; light->version++; - light->dependency.changed_notify(RendererStorage::DEPENDENCY_CHANGED_LIGHT); + light->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_LIGHT); } void LightStorage::light_set_max_sdfgi_cascade(RID p_light, uint32_t p_cascade) { @@ -257,7 +257,7 @@ void LightStorage::light_set_max_sdfgi_cascade(RID p_light, uint32_t p_cascade) light->max_sdfgi_cascade = p_cascade; light->version++; - light->dependency.changed_notify(RendererStorage::DEPENDENCY_CHANGED_LIGHT); + light->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_LIGHT); } void LightStorage::light_omni_set_shadow_mode(RID p_light, RS::LightOmniShadowMode p_mode) { @@ -267,7 +267,7 @@ void LightStorage::light_omni_set_shadow_mode(RID p_light, RS::LightOmniShadowMo light->omni_shadow_mode = p_mode; light->version++; - light->dependency.changed_notify(RendererStorage::DEPENDENCY_CHANGED_LIGHT); + light->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_LIGHT); } RS::LightOmniShadowMode LightStorage::light_omni_get_shadow_mode(RID p_light) { @@ -283,7 +283,7 @@ void LightStorage::light_directional_set_shadow_mode(RID p_light, RS::LightDirec light->directional_shadow_mode = p_mode; light->version++; - light->dependency.changed_notify(RendererStorage::DEPENDENCY_CHANGED_LIGHT); + light->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_LIGHT); } void LightStorage::light_directional_set_blend_splits(RID p_light, bool p_enable) { @@ -292,7 +292,7 @@ void LightStorage::light_directional_set_blend_splits(RID p_light, bool p_enable light->directional_blend_splits = p_enable; light->version++; - light->dependency.changed_notify(RendererStorage::DEPENDENCY_CHANGED_LIGHT); + light->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_LIGHT); } bool LightStorage::light_directional_get_blend_splits(RID p_light) const { @@ -387,7 +387,7 @@ void LightStorage::reflection_probe_set_update_mode(RID p_probe, RS::ReflectionP ERR_FAIL_COND(!reflection_probe); reflection_probe->update_mode = p_mode; - reflection_probe->dependency.changed_notify(RendererStorage::DEPENDENCY_CHANGED_REFLECTION_PROBE); + reflection_probe->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_REFLECTION_PROBE); } void LightStorage::reflection_probe_set_intensity(RID p_probe, float p_intensity) { @@ -424,7 +424,7 @@ void LightStorage::reflection_probe_set_max_distance(RID p_probe, float p_distan reflection_probe->max_distance = p_distance; - reflection_probe->dependency.changed_notify(RendererStorage::DEPENDENCY_CHANGED_REFLECTION_PROBE); + reflection_probe->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_REFLECTION_PROBE); } void LightStorage::reflection_probe_set_extents(RID p_probe, const Vector3 &p_extents) { @@ -435,7 +435,7 @@ void LightStorage::reflection_probe_set_extents(RID p_probe, const Vector3 &p_ex return; } reflection_probe->extents = p_extents; - reflection_probe->dependency.changed_notify(RendererStorage::DEPENDENCY_CHANGED_REFLECTION_PROBE); + reflection_probe->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_REFLECTION_PROBE); } void LightStorage::reflection_probe_set_origin_offset(RID p_probe, const Vector3 &p_offset) { @@ -443,7 +443,7 @@ void LightStorage::reflection_probe_set_origin_offset(RID p_probe, const Vector3 ERR_FAIL_COND(!reflection_probe); reflection_probe->origin_offset = p_offset; - reflection_probe->dependency.changed_notify(RendererStorage::DEPENDENCY_CHANGED_REFLECTION_PROBE); + reflection_probe->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_REFLECTION_PROBE); } void LightStorage::reflection_probe_set_as_interior(RID p_probe, bool p_enable) { @@ -451,7 +451,7 @@ void LightStorage::reflection_probe_set_as_interior(RID p_probe, bool p_enable) ERR_FAIL_COND(!reflection_probe); reflection_probe->interior = p_enable; - reflection_probe->dependency.changed_notify(RendererStorage::DEPENDENCY_CHANGED_REFLECTION_PROBE); + reflection_probe->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_REFLECTION_PROBE); } void LightStorage::reflection_probe_set_enable_box_projection(RID p_probe, bool p_enable) { @@ -466,7 +466,7 @@ void LightStorage::reflection_probe_set_enable_shadows(RID p_probe, bool p_enabl ERR_FAIL_COND(!reflection_probe); reflection_probe->enable_shadows = p_enable; - reflection_probe->dependency.changed_notify(RendererStorage::DEPENDENCY_CHANGED_REFLECTION_PROBE); + reflection_probe->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_REFLECTION_PROBE); } void LightStorage::reflection_probe_set_cull_mask(RID p_probe, uint32_t p_layers) { @@ -474,7 +474,7 @@ void LightStorage::reflection_probe_set_cull_mask(RID p_probe, uint32_t p_layers ERR_FAIL_COND(!reflection_probe); reflection_probe->cull_mask = p_layers; - reflection_probe->dependency.changed_notify(RendererStorage::DEPENDENCY_CHANGED_REFLECTION_PROBE); + reflection_probe->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_REFLECTION_PROBE); } void LightStorage::reflection_probe_set_resolution(RID p_probe, int p_resolution) { @@ -491,7 +491,7 @@ void LightStorage::reflection_probe_set_mesh_lod_threshold(RID p_probe, float p_ reflection_probe->mesh_lod_threshold = p_ratio; - reflection_probe->dependency.changed_notify(RendererStorage::DEPENDENCY_CHANGED_REFLECTION_PROBE); + reflection_probe->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_REFLECTION_PROBE); } AABB LightStorage::reflection_probe_get_aabb(RID p_probe) const { diff --git a/servers/rendering/renderer_rd/storage_rd/light_storage.h b/servers/rendering/renderer_rd/storage_rd/light_storage.h index 3cc455692d..fb25e4da7e 100644 --- a/servers/rendering/renderer_rd/storage_rd/light_storage.h +++ b/servers/rendering/renderer_rd/storage_rd/light_storage.h @@ -35,6 +35,7 @@ #include "core/templates/rid_owner.h" #include "core/templates/self_list.h" #include "servers/rendering/storage/light_storage.h" +#include "servers/rendering/storage/utilities.h" namespace RendererRD { @@ -61,7 +62,7 @@ struct Light { RS::LightDirectionalSkyMode directional_sky_mode = RS::LIGHT_DIRECTIONAL_SKY_MODE_LIGHT_AND_SKY; uint64_t version = 0; - RendererStorage::Dependency dependency; + Dependency dependency; }; /* REFLECTION PROBE */ @@ -82,7 +83,7 @@ struct ReflectionProbe { uint32_t cull_mask = (1 << 20) - 1; float mesh_lod_threshold = 0.01; - RendererStorage::Dependency dependency; + Dependency dependency; }; /* LIGHTMAP */ @@ -104,7 +105,7 @@ struct Lightmap { int32_t over = EMPTY_LEAF, under = EMPTY_LEAF; }; - RendererStorage::Dependency dependency; + Dependency dependency; }; class LightStorage : public RendererLightStorage { diff --git a/servers/rendering/renderer_rd/storage_rd/material_storage.cpp b/servers/rendering/renderer_rd/storage_rd/material_storage.cpp index 096d371b8d..fcd25852eb 100644 --- a/servers/rendering/renderer_rd/storage_rd/material_storage.cpp +++ b/servers/rendering/renderer_rd/storage_rd/material_storage.cpp @@ -2346,7 +2346,7 @@ void MaterialStorage::shader_set_code(RID p_shader, const String &p_code) { for (Material *E : shader->owners) { Material *material = E; - material->dependency.changed_notify(RendererStorage::DEPENDENCY_CHANGED_MATERIAL); + material->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_MATERIAL); _material_queue_update(material, true, true); } } @@ -2436,7 +2436,7 @@ void MaterialStorage::_material_uniform_set_erased(void *p_material) { // if a texture is deleted, so re-create it. MaterialStorage::get_singleton()->_material_queue_update(material, false, true); } - material->dependency.changed_notify(RendererStorage::DEPENDENCY_CHANGED_MATERIAL); + material->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_MATERIAL); } } @@ -2466,7 +2466,7 @@ void MaterialStorage::_update_queued_materials() { if (uniforms_changed) { //some implementations such as 3D renderer cache the matreial uniform set, so update is required - material->dependency.changed_notify(RendererStorage::DEPENDENCY_CHANGED_MATERIAL); + material->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_MATERIAL); } } } @@ -2507,7 +2507,7 @@ void MaterialStorage::material_set_shader(RID p_material, RID p_shader) { } if (p_shader.is_null()) { - material->dependency.changed_notify(RendererStorage::DEPENDENCY_CHANGED_MATERIAL); + material->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_MATERIAL); material->shader_id = 0; return; } @@ -2530,7 +2530,7 @@ void MaterialStorage::material_set_shader(RID p_material, RID p_shader) { material->data->set_next_pass(material->next_pass); material->data->set_render_priority(material->priority); //updating happens later - material->dependency.changed_notify(RendererStorage::DEPENDENCY_CHANGED_MATERIAL); + material->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_MATERIAL); _material_queue_update(material, true, true); } @@ -2576,7 +2576,7 @@ void MaterialStorage::material_set_next_pass(RID p_material, RID p_next_material material->data->set_next_pass(p_next_material); } - material->dependency.changed_notify(RendererStorage::DEPENDENCY_CHANGED_MATERIAL); + material->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_MATERIAL); } void MaterialStorage::material_set_render_priority(RID p_material, int priority) { @@ -2626,7 +2626,7 @@ void MaterialStorage::material_get_instance_shader_parameters(RID p_material, Li } } -void MaterialStorage::material_update_dependency(RID p_material, RendererStorage::DependencyTracker *p_instance) { +void MaterialStorage::material_update_dependency(RID p_material, DependencyTracker *p_instance) { Material *material = material_owner.get_or_null(p_material); ERR_FAIL_COND(!material); p_instance->update_dependency(&material->dependency); diff --git a/servers/rendering/renderer_rd/storage_rd/material_storage.h b/servers/rendering/renderer_rd/storage_rd/material_storage.h index f83df05355..e35d5e7669 100644 --- a/servers/rendering/renderer_rd/storage_rd/material_storage.h +++ b/servers/rendering/renderer_rd/storage_rd/material_storage.h @@ -31,12 +31,14 @@ #ifndef MATERIAL_STORAGE_RD_H #define MATERIAL_STORAGE_RD_H +#include "core/math/camera_matrix.h" #include "core/templates/local_vector.h" #include "core/templates/rid_owner.h" #include "core/templates/self_list.h" #include "servers/rendering/shader_compiler.h" #include "servers/rendering/shader_language.h" #include "servers/rendering/storage/material_storage.h" +#include "servers/rendering/storage/utilities.h" namespace RendererRD { @@ -125,7 +127,7 @@ struct Material { RID next_pass; SelfList<Material> update_element; - RendererStorage::Dependency dependency; + Dependency dependency; Material() : update_element(this) {} @@ -232,6 +234,86 @@ public: MaterialStorage(); virtual ~MaterialStorage(); + /* Helpers */ + + static _FORCE_INLINE_ void store_transform(const Transform3D &p_mtx, float *p_array) { + p_array[0] = p_mtx.basis.rows[0][0]; + p_array[1] = p_mtx.basis.rows[1][0]; + p_array[2] = p_mtx.basis.rows[2][0]; + p_array[3] = 0; + p_array[4] = p_mtx.basis.rows[0][1]; + p_array[5] = p_mtx.basis.rows[1][1]; + p_array[6] = p_mtx.basis.rows[2][1]; + p_array[7] = 0; + p_array[8] = p_mtx.basis.rows[0][2]; + p_array[9] = p_mtx.basis.rows[1][2]; + p_array[10] = p_mtx.basis.rows[2][2]; + p_array[11] = 0; + p_array[12] = p_mtx.origin.x; + p_array[13] = p_mtx.origin.y; + p_array[14] = p_mtx.origin.z; + p_array[15] = 1; + } + + static _FORCE_INLINE_ void store_basis_3x4(const Basis &p_mtx, float *p_array) { + p_array[0] = p_mtx.rows[0][0]; + p_array[1] = p_mtx.rows[1][0]; + p_array[2] = p_mtx.rows[2][0]; + p_array[3] = 0; + p_array[4] = p_mtx.rows[0][1]; + p_array[5] = p_mtx.rows[1][1]; + p_array[6] = p_mtx.rows[2][1]; + p_array[7] = 0; + p_array[8] = p_mtx.rows[0][2]; + p_array[9] = p_mtx.rows[1][2]; + p_array[10] = p_mtx.rows[2][2]; + p_array[11] = 0; + } + + static _FORCE_INLINE_ void store_transform_3x3(const Basis &p_mtx, float *p_array) { + p_array[0] = p_mtx.rows[0][0]; + p_array[1] = p_mtx.rows[1][0]; + p_array[2] = p_mtx.rows[2][0]; + p_array[3] = 0; + p_array[4] = p_mtx.rows[0][1]; + p_array[5] = p_mtx.rows[1][1]; + p_array[6] = p_mtx.rows[2][1]; + p_array[7] = 0; + p_array[8] = p_mtx.rows[0][2]; + p_array[9] = p_mtx.rows[1][2]; + p_array[10] = p_mtx.rows[2][2]; + p_array[11] = 0; + } + + static _FORCE_INLINE_ void store_transform_transposed_3x4(const Transform3D &p_mtx, float *p_array) { + p_array[0] = p_mtx.basis.rows[0][0]; + p_array[1] = p_mtx.basis.rows[0][1]; + p_array[2] = p_mtx.basis.rows[0][2]; + p_array[3] = p_mtx.origin.x; + p_array[4] = p_mtx.basis.rows[1][0]; + p_array[5] = p_mtx.basis.rows[1][1]; + p_array[6] = p_mtx.basis.rows[1][2]; + p_array[7] = p_mtx.origin.y; + p_array[8] = p_mtx.basis.rows[2][0]; + p_array[9] = p_mtx.basis.rows[2][1]; + p_array[10] = p_mtx.basis.rows[2][2]; + p_array[11] = p_mtx.origin.z; + } + + static _FORCE_INLINE_ void store_camera(const CameraMatrix &p_mtx, float *p_array) { + for (int i = 0; i < 4; i++) { + for (int j = 0; j < 4; j++) { + p_array[i * 4 + j] = p_mtx.matrix[i][j]; + } + } + } + + static _FORCE_INLINE_ void store_soft_shadow_kernel(const float *p_kernel, float *p_array) { + for (int i = 0; i < 128; i++) { + p_array[i] = p_kernel[i]; + } + } + /* Samplers */ _FORCE_INLINE_ RID sampler_rd_get_default(RS::CanvasItemTextureFilter p_filter, RS::CanvasItemTextureRepeat p_repeat) { @@ -317,7 +399,7 @@ public: virtual void material_get_instance_shader_parameters(RID p_material, List<InstanceShaderParam> *r_parameters) override; - virtual void material_update_dependency(RID p_material, RendererStorage::DependencyTracker *p_instance) override; + virtual void material_update_dependency(RID p_material, DependencyTracker *p_instance) override; void material_set_data_request_function(ShaderType p_shader_type, MaterialDataRequestFunction p_function); MaterialDataRequestFunction material_get_data_request_function(ShaderType p_shader_type); diff --git a/servers/rendering/renderer_rd/storage_rd/mesh_storage.cpp b/servers/rendering/renderer_rd/storage_rd/mesh_storage.cpp index 1e0d67f269..3875eb6615 100644 --- a/servers/rendering/renderer_rd/storage_rd/mesh_storage.cpp +++ b/servers/rendering/renderer_rd/storage_rd/mesh_storage.cpp @@ -210,6 +210,8 @@ void MeshStorage::mesh_free(RID p_rid) { mesh_clear(p_rid); mesh_set_shadow_mesh(p_rid, RID()); Mesh *mesh = mesh_owner.get_or_null(p_rid); + ERR_FAIL_COND(!mesh); + mesh->dependency.deleted_notify(p_rid); if (mesh->instances.size()) { ERR_PRINT("deleting mesh with active instances"); @@ -218,7 +220,7 @@ void MeshStorage::mesh_free(RID p_rid) { for (Mesh *E : mesh->shadow_owners) { Mesh *shadow_owner = E; shadow_owner->shadow_mesh = RID(); - shadow_owner->dependency.changed_notify(RendererStorage::DEPENDENCY_CHANGED_MESH); + shadow_owner->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_MESH); } } mesh_owner.free(p_rid); @@ -429,12 +431,12 @@ void MeshStorage::mesh_add_surface(RID p_mesh, const RS::SurfaceData &p_surface) _mesh_instance_add_surface(mi, mesh, mesh->surface_count - 1); } - mesh->dependency.changed_notify(RendererStorage::DEPENDENCY_CHANGED_MESH); + mesh->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_MESH); for (Mesh *E : mesh->shadow_owners) { Mesh *shadow_owner = E; shadow_owner->shadow_mesh = RID(); - shadow_owner->dependency.changed_notify(RendererStorage::DEPENDENCY_CHANGED_MESH); + shadow_owner->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_MESH); } mesh->material_cache.clear(); @@ -501,7 +503,7 @@ void MeshStorage::mesh_surface_set_material(RID p_mesh, int p_surface, RID p_mat ERR_FAIL_UNSIGNED_INDEX((uint32_t)p_surface, mesh->surface_count); mesh->surfaces[p_surface]->material = p_material; - mesh->dependency.changed_notify(RendererStorage::DEPENDENCY_CHANGED_MATERIAL); + mesh->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_MATERIAL); mesh->material_cache.clear(); } @@ -692,7 +694,7 @@ void MeshStorage::mesh_set_shadow_mesh(RID p_mesh, RID p_shadow_mesh) { shadow_mesh->shadow_owners.insert(mesh); } - mesh->dependency.changed_notify(RendererStorage::DEPENDENCY_CHANGED_MESH); + mesh->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_MESH); } void MeshStorage::mesh_clear(RID p_mesh) { @@ -740,12 +742,12 @@ void MeshStorage::mesh_clear(RID p_mesh) { _mesh_instance_clear(mi); } mesh->has_bone_weights = false; - mesh->dependency.changed_notify(RendererStorage::DEPENDENCY_CHANGED_MESH); + mesh->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_MESH); for (Mesh *E : mesh->shadow_owners) { Mesh *shadow_owner = E; shadow_owner->shadow_mesh = RID(); - shadow_owner->dependency.changed_notify(RendererStorage::DEPENDENCY_CHANGED_MESH); + shadow_owner->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_MESH); } } @@ -1209,7 +1211,7 @@ void MeshStorage::multimesh_allocate_data(RID p_multimesh, int p_instances, RS:: multimesh->buffer = RD::get_singleton()->storage_buffer_create(multimesh->instances * multimesh->stride_cache * 4); } - multimesh->dependency.changed_notify(RendererStorage::DEPENDENCY_CHANGED_MULTIMESH); + multimesh->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_MULTIMESH); } int MeshStorage::multimesh_get_instance_count(RID p_multimesh) const { @@ -1243,7 +1245,7 @@ void MeshStorage::multimesh_set_mesh(RID p_multimesh, RID p_mesh) { } } - multimesh->dependency.changed_notify(RendererStorage::DEPENDENCY_CHANGED_MESH); + multimesh->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_MESH); } #define MULTIMESH_DIRTY_REGION_SIZE 512 @@ -1602,7 +1604,7 @@ void MeshStorage::multimesh_set_buffer(RID p_multimesh, const Vector<float> &p_b const float *data = p_buffer.ptr(); _multimesh_re_create_aabb(multimesh, data, multimesh->instances); - multimesh->dependency.changed_notify(RendererStorage::DEPENDENCY_CHANGED_AABB); + multimesh->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_AABB); } } @@ -1644,7 +1646,7 @@ void MeshStorage::multimesh_set_visible_instances(RID p_multimesh, int p_visible multimesh->visible_instances = p_visible; - multimesh->dependency.changed_notify(RendererStorage::DEPENDENCY_CHANGED_MULTIMESH_VISIBLE_INSTANCES); + multimesh->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_MULTIMESH_VISIBLE_INSTANCES); } int MeshStorage::multimesh_get_visible_instances(RID p_multimesh) const { @@ -1703,7 +1705,7 @@ void MeshStorage::_update_dirty_multimeshes() { //aabb is dirty.. _multimesh_re_create_aabb(multimesh, data, visible_instances); multimesh->aabb_dirty = false; - multimesh->dependency.changed_notify(RendererStorage::DEPENDENCY_CHANGED_AABB); + multimesh->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_AABB); } } @@ -1781,7 +1783,7 @@ void MeshStorage::skeleton_allocate_data(RID p_skeleton, int p_bones, bool p_2d_ } } - skeleton->dependency.changed_notify(RendererStorage::DEPENDENCY_CHANGED_SKELETON_DATA); + skeleton->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_SKELETON_DATA); } int MeshStorage::skeleton_get_bone_count(RID p_skeleton) const { @@ -1902,7 +1904,7 @@ void MeshStorage::_update_dirty_skeletons() { skeleton_dirty_list = skeleton->dirty_list; - skeleton->dependency.changed_notify(RendererStorage::DEPENDENCY_CHANGED_SKELETON_BONES); + skeleton->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_SKELETON_BONES); skeleton->version++; @@ -1913,7 +1915,7 @@ void MeshStorage::_update_dirty_skeletons() { skeleton_dirty_list = nullptr; } -void MeshStorage::skeleton_update_dependency(RID p_skeleton, RendererStorage::DependencyTracker *p_instance) { +void MeshStorage::skeleton_update_dependency(RID p_skeleton, DependencyTracker *p_instance) { Skeleton *skeleton = skeleton_owner.get_or_null(p_skeleton); ERR_FAIL_COND(!skeleton); diff --git a/servers/rendering/renderer_rd/storage_rd/mesh_storage.h b/servers/rendering/renderer_rd/storage_rd/mesh_storage.h index 7ce019cf98..9cdda6bfca 100644 --- a/servers/rendering/renderer_rd/storage_rd/mesh_storage.h +++ b/servers/rendering/renderer_rd/storage_rd/mesh_storage.h @@ -35,8 +35,8 @@ #include "core/templates/rid_owner.h" #include "core/templates/self_list.h" #include "servers/rendering/renderer_rd/shaders/skeleton.glsl.gen.h" -#include "servers/rendering/renderer_storage.h" #include "servers/rendering/storage/mesh_storage.h" +#include "servers/rendering/storage/utilities.h" namespace RendererRD { @@ -143,7 +143,7 @@ struct Mesh { RID shadow_mesh; HashSet<Mesh *> shadow_owners; - RendererStorage::Dependency dependency; + Dependency dependency; }; /* Mesh Instance */ @@ -199,7 +199,7 @@ struct MultiMesh { bool dirty = false; MultiMesh *dirty_list = nullptr; - RendererStorage::Dependency dependency; + Dependency dependency; }; /* Skeleton */ @@ -256,7 +256,7 @@ struct Skeleton { uint64_t version = 1; - RendererStorage::Dependency dependency; + Dependency dependency; }; class MeshStorage : public RendererMeshStorage { @@ -672,7 +672,7 @@ public: virtual void skeleton_bone_set_transform_2d(RID p_skeleton, int p_bone, const Transform2D &p_transform) override; virtual Transform2D skeleton_bone_get_transform_2d(RID p_skeleton, int p_bone) const override; - virtual void skeleton_update_dependency(RID p_skeleton, RendererStorage::DependencyTracker *p_instance) override; + virtual void skeleton_update_dependency(RID p_skeleton, DependencyTracker *p_instance) override; void _update_dirty_skeletons(); diff --git a/servers/rendering/renderer_rd/storage_rd/particles_storage.cpp b/servers/rendering/renderer_rd/storage_rd/particles_storage.cpp index 58a96ed1f9..5200e0d318 100644 --- a/servers/rendering/renderer_rd/storage_rd/particles_storage.cpp +++ b/servers/rendering/renderer_rd/storage_rd/particles_storage.cpp @@ -30,7 +30,6 @@ #include "particles_storage.h" #include "servers/rendering/renderer_rd/renderer_compositor_rd.h" -#include "servers/rendering/renderer_rd/renderer_storage_rd.h" #include "servers/rendering/rendering_server_globals.h" #include "texture_storage.h" @@ -321,7 +320,7 @@ void ParticlesStorage::particles_set_amount(RID p_particles, int p_amount) { particles->prev_phase = 0; particles->clear = true; - particles->dependency.changed_notify(RendererStorage::DEPENDENCY_CHANGED_PARTICLES); + particles->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_PARTICLES); } void ParticlesStorage::particles_set_lifetime(RID p_particles, double p_lifetime) { @@ -356,7 +355,7 @@ void ParticlesStorage::particles_set_custom_aabb(RID p_particles, const AABB &p_ Particles *particles = particles_owner.get_or_null(p_particles); ERR_FAIL_COND(!particles); particles->custom_aabb = p_aabb; - particles->dependency.changed_notify(RendererStorage::DEPENDENCY_CHANGED_AABB); + particles->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_AABB); } void ParticlesStorage::particles_set_speed_scale(RID p_particles, double p_scale) { @@ -370,7 +369,7 @@ void ParticlesStorage::particles_set_use_local_coordinates(RID p_particles, bool ERR_FAIL_COND(!particles); particles->use_local_coords = p_enable; - particles->dependency.changed_notify(RendererStorage::DEPENDENCY_CHANGED_PARTICLES); + particles->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_PARTICLES); } void ParticlesStorage::particles_set_fixed_fps(RID p_particles, int p_fps) { @@ -386,7 +385,7 @@ void ParticlesStorage::particles_set_fixed_fps(RID p_particles, int p_fps) { particles->prev_phase = 0; particles->clear = true; - particles->dependency.changed_notify(RendererStorage::DEPENDENCY_CHANGED_PARTICLES); + particles->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_PARTICLES); } void ParticlesStorage::particles_set_interpolate(RID p_particles, bool p_enable) { @@ -419,7 +418,7 @@ void ParticlesStorage::particles_set_trails(RID p_particles, bool p_enable, doub particles->prev_phase = 0; particles->clear = true; - particles->dependency.changed_notify(RendererStorage::DEPENDENCY_CHANGED_PARTICLES); + particles->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_PARTICLES); } void ParticlesStorage::particles_set_trail_bind_poses(RID p_particles, const Vector<Transform3D> &p_bind_poses) { @@ -436,7 +435,7 @@ void ParticlesStorage::particles_set_trail_bind_poses(RID p_particles, const Vec particles->trail_bind_poses = p_bind_poses; particles->trail_bind_poses_dirty = true; - particles->dependency.changed_notify(RendererStorage::DEPENDENCY_CHANGED_PARTICLES); + particles->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_PARTICLES); } void ParticlesStorage::particles_set_collision_base_size(RID p_particles, real_t p_size) { @@ -458,7 +457,7 @@ void ParticlesStorage::particles_set_process_material(RID p_particles, RID p_mat ERR_FAIL_COND(!particles); particles->process_material = p_material; - particles->dependency.changed_notify(RendererStorage::DEPENDENCY_CHANGED_PARTICLES); //the instance buffer may have changed + particles->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_PARTICLES); //the instance buffer may have changed } RID ParticlesStorage::particles_get_process_material(RID p_particles) const { @@ -545,7 +544,7 @@ void ParticlesStorage::particles_emit(RID p_particles, const Transform3D &p_tran int32_t idx = particles->emission_buffer->particle_count; if (idx < particles->emission_buffer->particle_max) { - RendererStorageRD::store_transform(p_transform, particles->emission_buffer->data[idx].xform); + RendererRD::MaterialStorage::store_transform(p_transform, particles->emission_buffer->data[idx].xform); particles->emission_buffer->data[idx].velocity[0] = p_velocity.x; particles->emission_buffer->data[idx].velocity[1] = p_velocity.y; @@ -766,9 +765,9 @@ void ParticlesStorage::_particles_process(Particles *p_particles, double p_delta frame_params.randomness = p_particles->randomness; if (p_particles->use_local_coords) { - RendererStorageRD::store_transform(Transform3D(), frame_params.emission_transform); + RendererRD::MaterialStorage::store_transform(Transform3D(), frame_params.emission_transform); } else { - RendererStorageRD::store_transform(p_particles->emission_transform, frame_params.emission_transform); + RendererRD::MaterialStorage::store_transform(p_particles->emission_transform, frame_params.emission_transform); } frame_params.cycle = p_particles->cycle_number; @@ -858,7 +857,7 @@ void ParticlesStorage::_particles_process(Particles *p_particles, double p_delta ParticlesFrameParams::Attractor &attr = frame_params.attractors[frame_params.attractor_count]; - RendererStorageRD::store_transform(to_collider, attr.transform); + RendererRD::MaterialStorage::store_transform(to_collider, attr.transform); attr.strength = pc->attractor_strength; attr.attenuation = pc->attractor_attenuation; attr.directionality = pc->attractor_directionality; @@ -906,7 +905,7 @@ void ParticlesStorage::_particles_process(Particles *p_particles, double p_delta ParticlesFrameParams::Collider &col = frame_params.colliders[frame_params.collider_count]; - RendererStorageRD::store_transform(to_collider, col.transform); + RendererRD::MaterialStorage::store_transform(to_collider, col.transform); switch (pc->type) { case RS::PARTICLES_COLLISION_TYPE_SPHERE_COLLIDE: { col.type = ParticlesFrameParams::COLLISION_TYPE_SPHERE; @@ -1203,7 +1202,7 @@ void ParticlesStorage::particles_set_view_axis(RID p_particles, const Vector3 &p RD::get_singleton()->compute_list_dispatch_threads(compute_list, particles->amount, 1, 1); RD::get_singleton()->compute_list_end(); - RendererStorageRD::base_singleton->get_effects()->sort_buffer(particles->particles_sort_uniform_set, particles->amount); + RendererCompositorRD::singleton->get_effects()->sort_buffer(particles->particles_sort_uniform_set, particles->amount); } copy_push_constant.total_particles *= copy_push_constant.total_particles; @@ -1383,7 +1382,7 @@ void ParticlesStorage::update_particles() { } for (int i = 0; i < particles->trail_bind_poses.size(); i++) { - RendererStorageRD::store_transform(particles->trail_bind_poses[i], &particles_shader.pose_update_buffer[i * 16]); + RendererRD::MaterialStorage::store_transform(particles->trail_bind_poses[i], &particles_shader.pose_update_buffer[i * 16]); } RD::get_singleton()->buffer_update(particles->trail_bind_pose_buffer, 0, particles->trail_bind_poses.size() * 16 * sizeof(float), particles_shader.pose_update_buffer.ptr()); @@ -1457,14 +1456,14 @@ void ParticlesStorage::update_particles() { // In local mode, particle positions are calculated locally (relative to the node position) // and they're also drawn locally. // It works as expected, so we just pass an identity transform. - RendererStorageRD::store_transform(Transform3D(), copy_push_constant.inv_emission_transform); + RendererRD::MaterialStorage::store_transform(Transform3D(), copy_push_constant.inv_emission_transform); } else { // In global mode, particle positions are calculated globally (relative to the canvas origin) // but they're drawn locally. // So, we need to pass the inverse of the emission transform to bring the // particles to local coordinates before drawing. Transform3D inv = particles->emission_transform.affine_inverse(); - RendererStorageRD::store_transform(inv, copy_push_constant.inv_emission_transform); + RendererRD::MaterialStorage::store_transform(inv, copy_push_constant.inv_emission_transform); } copy_push_constant.total_particles = total_amount; @@ -1500,7 +1499,7 @@ void ParticlesStorage::update_particles() { RD::get_singleton()->compute_list_end(); } - particles->dependency.changed_notify(RendererStorage::DEPENDENCY_CHANGED_AABB); + particles->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_AABB); } } @@ -1756,7 +1755,7 @@ void ParticlesStorage::particles_collision_set_collision_type(RID p_particles_co particles_collision->heightfield_texture = RID(); } particles_collision->type = p_type; - particles_collision->dependency.changed_notify(RendererStorage::DEPENDENCY_CHANGED_AABB); + particles_collision->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_AABB); } void ParticlesStorage::particles_collision_set_cull_mask(RID p_particles_collision, uint32_t p_cull_mask) { @@ -1770,7 +1769,7 @@ void ParticlesStorage::particles_collision_set_sphere_radius(RID p_particles_col ERR_FAIL_COND(!particles_collision); particles_collision->radius = p_radius; - particles_collision->dependency.changed_notify(RendererStorage::DEPENDENCY_CHANGED_AABB); + particles_collision->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_AABB); } void ParticlesStorage::particles_collision_set_box_extents(RID p_particles_collision, const Vector3 &p_extents) { @@ -1778,7 +1777,7 @@ void ParticlesStorage::particles_collision_set_box_extents(RID p_particles_colli ERR_FAIL_COND(!particles_collision); particles_collision->extents = p_extents; - particles_collision->dependency.changed_notify(RendererStorage::DEPENDENCY_CHANGED_AABB); + particles_collision->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_AABB); } void ParticlesStorage::particles_collision_set_attractor_strength(RID p_particles_collision, real_t p_strength) { @@ -1812,7 +1811,7 @@ void ParticlesStorage::particles_collision_set_field_texture(RID p_particles_col void ParticlesStorage::particles_collision_height_field_update(RID p_particles_collision) { ParticlesCollision *particles_collision = particles_collision_owner.get_or_null(p_particles_collision); ERR_FAIL_COND(!particles_collision); - particles_collision->dependency.changed_notify(RendererStorage::DEPENDENCY_CHANGED_AABB); + particles_collision->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_AABB); } void ParticlesStorage::particles_collision_set_height_field_resolution(RID p_particles_collision, RS::ParticlesCollisionHeightfieldResolution p_resolution) { diff --git a/servers/rendering/renderer_rd/storage_rd/particles_storage.h b/servers/rendering/renderer_rd/storage_rd/particles_storage.h index 115633d17a..70ac6f0349 100644 --- a/servers/rendering/renderer_rd/storage_rd/particles_storage.h +++ b/servers/rendering/renderer_rd/storage_rd/particles_storage.h @@ -37,9 +37,9 @@ #include "servers/rendering/renderer_rd/shaders/particles.glsl.gen.h" #include "servers/rendering/renderer_rd/shaders/particles_copy.glsl.gen.h" #include "servers/rendering/renderer_rd/storage_rd/material_storage.h" -#include "servers/rendering/renderer_storage.h" #include "servers/rendering/shader_compiler.h" #include "servers/rendering/storage/particles_storage.h" +#include "servers/rendering/storage/utilities.h" namespace RendererRD { @@ -226,7 +226,7 @@ struct Particles { HashSet<RID> collisions; - RendererStorage::Dependency dependency; + Dependency dependency; double trail_length = 1.0; bool trails_enabled = false; @@ -254,7 +254,7 @@ struct ParticlesCollision { RS::ParticlesCollisionHeightfieldResolution heightfield_resolution = RS::PARTICLES_COLLISION_HEIGHTFIELD_RESOLUTION_1024; - RendererStorage::Dependency dependency; + Dependency dependency; }; struct ParticlesCollisionInstance { diff --git a/servers/rendering/renderer_rd/storage_rd/texture_storage.cpp b/servers/rendering/renderer_rd/storage_rd/texture_storage.cpp index 329c23bad0..1109357a74 100644 --- a/servers/rendering/renderer_rd/storage_rd/texture_storage.cpp +++ b/servers/rendering/renderer_rd/storage_rd/texture_storage.cpp @@ -1712,7 +1712,7 @@ void TextureStorage::decal_set_extents(RID p_decal, const Vector3 &p_extents) { Decal *decal = decal_owner.get_or_null(p_decal); ERR_FAIL_COND(!decal); decal->extents = p_extents; - decal->dependency.changed_notify(RendererStorage::DEPENDENCY_CHANGED_AABB); + decal->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_AABB); } void TextureStorage::decal_set_texture(RID p_decal, RS::DecalTexture p_type, RID p_texture) { @@ -1736,7 +1736,7 @@ void TextureStorage::decal_set_texture(RID p_decal, RS::DecalTexture p_type, RID texture_add_to_decal_atlas(decal->textures[p_type]); } - decal->dependency.changed_notify(RendererStorage::DEPENDENCY_CHANGED_DECAL); + decal->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_DECAL); } void TextureStorage::decal_set_emission_energy(RID p_decal, float p_energy) { @@ -1761,7 +1761,7 @@ void TextureStorage::decal_set_cull_mask(RID p_decal, uint32_t p_layers) { Decal *decal = decal_owner.get_or_null(p_decal); ERR_FAIL_COND(!decal); decal->cull_mask = p_layers; - decal->dependency.changed_notify(RendererStorage::DEPENDENCY_CHANGED_AABB); + decal->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_AABB); } void TextureStorage::decal_set_distance_fade(RID p_decal, bool p_enabled, float p_begin, float p_length) { diff --git a/servers/rendering/renderer_rd/storage_rd/texture_storage.h b/servers/rendering/renderer_rd/storage_rd/texture_storage.h index 901f764085..7a96e6c6ed 100644 --- a/servers/rendering/renderer_rd/storage_rd/texture_storage.h +++ b/servers/rendering/renderer_rd/storage_rd/texture_storage.h @@ -33,8 +33,8 @@ #include "core/templates/rid_owner.h" #include "servers/rendering/renderer_rd/shaders/canvas_sdf.glsl.gen.h" -#include "servers/rendering/renderer_storage.h" #include "servers/rendering/storage/texture_storage.h" +#include "servers/rendering/storage/utilities.h" namespace RendererRD { @@ -193,7 +193,7 @@ struct Decal { float distance_fade_length = 1; float normal_fade = 0.0; - RendererStorage::Dependency dependency; + Dependency dependency; }; struct RenderTarget { diff --git a/servers/rendering/renderer_rd/renderer_storage_rd.cpp b/servers/rendering/renderer_rd/storage_rd/utilities.cpp index 8c55ff1d0a..a1f62c16c7 100644 --- a/servers/rendering/renderer_rd/renderer_storage_rd.cpp +++ b/servers/rendering/renderer_rd/storage_rd/utilities.cpp @@ -1,5 +1,5 @@ /*************************************************************************/ -/* renderer_storage_rd.cpp */ +/* utilities.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -28,195 +28,29 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#include "renderer_storage_rd.h" - -#include "core/config/engine.h" -#include "core/config/project_settings.h" -#include "core/io/resource_loader.h" -#include "core/math/math_defs.h" -#include "renderer_compositor_rd.h" -#include "servers/rendering/renderer_rd/environment/gi.h" -#include "servers/rendering/renderer_rd/storage_rd/light_storage.h" -#include "servers/rendering/renderer_rd/storage_rd/mesh_storage.h" -#include "servers/rendering/renderer_rd/storage_rd/particles_storage.h" -#include "servers/rendering/renderer_rd/storage_rd/texture_storage.h" -#include "servers/rendering/rendering_server_globals.h" -#include "servers/rendering/shader_language.h" - -/* FOG VOLUMES */ - -RID RendererStorageRD::fog_volume_allocate() { - return fog_volume_owner.allocate_rid(); -} -void RendererStorageRD::fog_volume_initialize(RID p_rid) { - fog_volume_owner.initialize_rid(p_rid, FogVolume()); -} - -void RendererStorageRD::fog_volume_set_shape(RID p_fog_volume, RS::FogVolumeShape p_shape) { - FogVolume *fog_volume = fog_volume_owner.get_or_null(p_fog_volume); - ERR_FAIL_COND(!fog_volume); - - if (p_shape == fog_volume->shape) { - return; - } - - fog_volume->shape = p_shape; - fog_volume->dependency.changed_notify(DEPENDENCY_CHANGED_AABB); -} +#include "utilities.h" +#include "../environment/fog.h" +#include "../environment/gi.h" +#include "light_storage.h" +#include "mesh_storage.h" +#include "particles_storage.h" +#include "texture_storage.h" -void RendererStorageRD::fog_volume_set_extents(RID p_fog_volume, const Vector3 &p_extents) { - FogVolume *fog_volume = fog_volume_owner.get_or_null(p_fog_volume); - ERR_FAIL_COND(!fog_volume); +using namespace RendererRD; - fog_volume->extents = p_extents; - fog_volume->dependency.changed_notify(DEPENDENCY_CHANGED_AABB); -} +Utilities *Utilities::singleton = nullptr; -void RendererStorageRD::fog_volume_set_material(RID p_fog_volume, RID p_material) { - FogVolume *fog_volume = fog_volume_owner.get_or_null(p_fog_volume); - ERR_FAIL_COND(!fog_volume); - fog_volume->material = p_material; +Utilities::Utilities() { + singleton = this; } -RID RendererStorageRD::fog_volume_get_material(RID p_fog_volume) const { - FogVolume *fog_volume = fog_volume_owner.get_or_null(p_fog_volume); - ERR_FAIL_COND_V(!fog_volume, RID()); - - return fog_volume->material; +Utilities::~Utilities() { + singleton = nullptr; } -RS::FogVolumeShape RendererStorageRD::fog_volume_get_shape(RID p_fog_volume) const { - FogVolume *fog_volume = fog_volume_owner.get_or_null(p_fog_volume); - ERR_FAIL_COND_V(!fog_volume, RS::FOG_VOLUME_SHAPE_BOX); - - return fog_volume->shape; -} +/* INSTANCES */ -AABB RendererStorageRD::fog_volume_get_aabb(RID p_fog_volume) const { - FogVolume *fog_volume = fog_volume_owner.get_or_null(p_fog_volume); - ERR_FAIL_COND_V(!fog_volume, AABB()); - - switch (fog_volume->shape) { - case RS::FOG_VOLUME_SHAPE_ELLIPSOID: - case RS::FOG_VOLUME_SHAPE_CONE: - case RS::FOG_VOLUME_SHAPE_CYLINDER: - case RS::FOG_VOLUME_SHAPE_BOX: { - AABB aabb; - aabb.position = -fog_volume->extents; - aabb.size = fog_volume->extents * 2; - return aabb; - } - default: { - // Need some size otherwise will get culled - return AABB(Vector3(-1, -1, -1), Vector3(2, 2, 2)); - } - } - - return AABB(); -} - -Vector3 RendererStorageRD::fog_volume_get_extents(RID p_fog_volume) const { - const FogVolume *fog_volume = fog_volume_owner.get_or_null(p_fog_volume); - ERR_FAIL_COND_V(!fog_volume, Vector3()); - return fog_volume->extents; -} - -/* VISIBILITY NOTIFIER */ - -RID RendererStorageRD::visibility_notifier_allocate() { - return visibility_notifier_owner.allocate_rid(); -} -void RendererStorageRD::visibility_notifier_initialize(RID p_notifier) { - visibility_notifier_owner.initialize_rid(p_notifier, VisibilityNotifier()); -} -void RendererStorageRD::visibility_notifier_set_aabb(RID p_notifier, const AABB &p_aabb) { - VisibilityNotifier *vn = visibility_notifier_owner.get_or_null(p_notifier); - ERR_FAIL_COND(!vn); - vn->aabb = p_aabb; - vn->dependency.changed_notify(DEPENDENCY_CHANGED_AABB); -} -void RendererStorageRD::visibility_notifier_set_callbacks(RID p_notifier, const Callable &p_enter_callbable, const Callable &p_exit_callable) { - VisibilityNotifier *vn = visibility_notifier_owner.get_or_null(p_notifier); - ERR_FAIL_COND(!vn); - vn->enter_callback = p_enter_callbable; - vn->exit_callback = p_exit_callable; -} - -AABB RendererStorageRD::visibility_notifier_get_aabb(RID p_notifier) const { - const VisibilityNotifier *vn = visibility_notifier_owner.get_or_null(p_notifier); - ERR_FAIL_COND_V(!vn, AABB()); - return vn->aabb; -} -void RendererStorageRD::visibility_notifier_call(RID p_notifier, bool p_enter, bool p_deferred) { - VisibilityNotifier *vn = visibility_notifier_owner.get_or_null(p_notifier); - ERR_FAIL_COND(!vn); - - if (p_enter) { - if (!vn->enter_callback.is_null()) { - if (p_deferred) { - vn->enter_callback.call_deferred(nullptr, 0); - } else { - Variant r; - Callable::CallError ce; - vn->enter_callback.call(nullptr, 0, r, ce); - } - } - } else { - if (!vn->exit_callback.is_null()) { - if (p_deferred) { - vn->exit_callback.call_deferred(nullptr, 0); - } else { - Variant r; - Callable::CallError ce; - vn->exit_callback.call(nullptr, 0, r, ce); - } - } - } -} - -/* misc */ - -void RendererStorageRD::base_update_dependency(RID p_base, DependencyTracker *p_instance) { - if (RendererRD::MeshStorage::get_singleton()->owns_mesh(p_base)) { - RendererRD::Mesh *mesh = RendererRD::MeshStorage::get_singleton()->get_mesh(p_base); - p_instance->update_dependency(&mesh->dependency); - } else if (RendererRD::MeshStorage::get_singleton()->owns_multimesh(p_base)) { - RendererRD::MultiMesh *multimesh = RendererRD::MeshStorage::get_singleton()->get_multimesh(p_base); - p_instance->update_dependency(&multimesh->dependency); - if (multimesh->mesh.is_valid()) { - base_update_dependency(multimesh->mesh, p_instance); - } - } else if (RendererRD::LightStorage::get_singleton()->owns_reflection_probe(p_base)) { - RendererRD::ReflectionProbe *rp = RendererRD::LightStorage::get_singleton()->get_reflection_probe(p_base); - p_instance->update_dependency(&rp->dependency); - } else if (RendererRD::TextureStorage::get_singleton()->owns_decal(p_base)) { - RendererRD::Decal *decal = RendererRD::TextureStorage::get_singleton()->get_decal(p_base); - p_instance->update_dependency(&decal->dependency); - } else if (RendererRD::GI::get_singleton()->owns_voxel_gi(p_base)) { - RendererRD::GI::VoxelGI *gip = RendererRD::GI::get_singleton()->get_voxel_gi(p_base); - p_instance->update_dependency(&gip->dependency); - } else if (RendererRD::LightStorage::get_singleton()->owns_lightmap(p_base)) { - RendererRD::Lightmap *lm = RendererRD::LightStorage::get_singleton()->get_lightmap(p_base); - p_instance->update_dependency(&lm->dependency); - } else if (RendererRD::LightStorage::get_singleton()->owns_light(p_base)) { - RendererRD::Light *l = RendererRD::LightStorage::get_singleton()->get_light(p_base); - p_instance->update_dependency(&l->dependency); - } else if (RendererRD::ParticlesStorage::get_singleton()->owns_particles(p_base)) { - RendererRD::Particles *p = RendererRD::ParticlesStorage::get_singleton()->get_particles(p_base); - p_instance->update_dependency(&p->dependency); - } else if (RendererRD::ParticlesStorage::get_singleton()->owns_particles_collision(p_base)) { - RendererRD::ParticlesCollision *pc = RendererRD::ParticlesStorage::get_singleton()->get_particles_collision(p_base); - p_instance->update_dependency(&pc->dependency); - } else if (fog_volume_owner.owns(p_base)) { - FogVolume *fv = fog_volume_owner.get_or_null(p_base); - p_instance->update_dependency(&fv->dependency); - } else if (visibility_notifier_owner.owns(p_base)) { - VisibilityNotifier *vn = visibility_notifier_owner.get_or_null(p_base); - p_instance->update_dependency(&vn->dependency); - } -} - -RS::InstanceType RendererStorageRD::get_base_type(RID p_rid) const { +RS::InstanceType Utilities::get_base_type(RID p_rid) const { if (RendererRD::MeshStorage::get_singleton()->owns_mesh(p_rid)) { return RS::INSTANCE_MESH; } @@ -244,49 +78,17 @@ RS::InstanceType RendererStorageRD::get_base_type(RID p_rid) const { if (RendererRD::ParticlesStorage::get_singleton()->owns_particles_collision(p_rid)) { return RS::INSTANCE_PARTICLES_COLLISION; } - if (fog_volume_owner.owns(p_rid)) { + if (RendererRD::Fog::get_singleton()->owns_fog_volume(p_rid)) { return RS::INSTANCE_FOG_VOLUME; } - if (visibility_notifier_owner.owns(p_rid)) { + if (owns_visibility_notifier(p_rid)) { return RS::INSTANCE_VISIBLITY_NOTIFIER; } return RS::INSTANCE_NONE; } -void RendererStorageRD::update_dirty_resources() { - RendererRD::MaterialStorage::get_singleton()->_update_global_variables(); //must do before materials, so it can queue them for update - RendererRD::MaterialStorage::get_singleton()->_update_queued_materials(); - RendererRD::MeshStorage::get_singleton()->_update_dirty_multimeshes(); - RendererRD::MeshStorage::get_singleton()->_update_dirty_skeletons(); - RendererRD::TextureStorage::get_singleton()->update_decal_atlas(); -} - -bool RendererStorageRD::has_os_feature(const String &p_feature) const { - if (!RD::get_singleton()) { - return false; - } - - if (p_feature == "rgtc" && RD::get_singleton()->texture_is_format_supported_for_usage(RD::DATA_FORMAT_BC5_UNORM_BLOCK, RD::TEXTURE_USAGE_SAMPLING_BIT)) { - return true; - } - - if (p_feature == "s3tc" && RD::get_singleton()->texture_is_format_supported_for_usage(RD::DATA_FORMAT_BC1_RGB_UNORM_BLOCK, RD::TEXTURE_USAGE_SAMPLING_BIT)) { - return true; - } - - if (p_feature == "bptc" && RD::get_singleton()->texture_is_format_supported_for_usage(RD::DATA_FORMAT_BC7_UNORM_BLOCK, RD::TEXTURE_USAGE_SAMPLING_BIT)) { - return true; - } - - if ((p_feature == "etc" || p_feature == "etc2") && RD::get_singleton()->texture_is_format_supported_for_usage(RD::DATA_FORMAT_ETC2_R8G8B8_UNORM_BLOCK, RD::TEXTURE_USAGE_SAMPLING_BIT)) { - return true; - } - - return false; -} - -bool RendererStorageRD::free(RID p_rid) { +bool Utilities::free(RID p_rid) { if (RendererRD::TextureStorage::get_singleton()->owns_texture(p_rid)) { RendererRD::TextureStorage::get_singleton()->texture_free(p_rid); } else if (RendererRD::TextureStorage::get_singleton()->owns_canvas_texture(p_rid)) { @@ -317,16 +119,12 @@ bool RendererStorageRD::free(RID p_rid) { RendererRD::ParticlesStorage::get_singleton()->particles_free(p_rid); } else if (RendererRD::ParticlesStorage::get_singleton()->owns_particles_collision(p_rid)) { RendererRD::ParticlesStorage::get_singleton()->particles_collision_free(p_rid); - } else if (visibility_notifier_owner.owns(p_rid)) { - VisibilityNotifier *vn = visibility_notifier_owner.get_or_null(p_rid); - vn->dependency.deleted_notify(p_rid); - visibility_notifier_owner.free(p_rid); + } else if (owns_visibility_notifier(p_rid)) { + visibility_notifier_free(p_rid); } else if (RendererRD::ParticlesStorage::get_singleton()->owns_particles_collision_instance(p_rid)) { RendererRD::ParticlesStorage::get_singleton()->particles_collision_instance_free(p_rid); - } else if (fog_volume_owner.owns(p_rid)) { - FogVolume *fog_volume = fog_volume_owner.get_or_null(p_rid); - fog_volume->dependency.deleted_notify(p_rid); - fog_volume_owner.free(p_rid); + } else if (RendererRD::Fog::get_singleton()->owns_fog_volume(p_rid)) { + RendererRD::Fog::get_singleton()->fog_free(p_rid); } else if (RendererRD::TextureStorage::get_singleton()->owns_render_target(p_rid)) { RendererRD::TextureStorage::get_singleton()->render_target_free(p_rid); } else { @@ -336,49 +134,182 @@ bool RendererStorageRD::free(RID p_rid) { return true; } -void RendererStorageRD::init_effects(bool p_prefer_raster_effects) { - effects = memnew(EffectsRD(p_prefer_raster_effects)); +/* DEPENDENCIES */ + +void Utilities::base_update_dependency(RID p_base, DependencyTracker *p_instance) { + if (MeshStorage::get_singleton()->owns_mesh(p_base)) { + Mesh *mesh = MeshStorage::get_singleton()->get_mesh(p_base); + p_instance->update_dependency(&mesh->dependency); + } else if (MeshStorage::get_singleton()->owns_multimesh(p_base)) { + MultiMesh *multimesh = MeshStorage::get_singleton()->get_multimesh(p_base); + p_instance->update_dependency(&multimesh->dependency); + if (multimesh->mesh.is_valid()) { + base_update_dependency(multimesh->mesh, p_instance); + } + } else if (LightStorage::get_singleton()->owns_reflection_probe(p_base)) { + ReflectionProbe *rp = LightStorage::get_singleton()->get_reflection_probe(p_base); + p_instance->update_dependency(&rp->dependency); + } else if (TextureStorage::get_singleton()->owns_decal(p_base)) { + Decal *decal = TextureStorage::get_singleton()->get_decal(p_base); + p_instance->update_dependency(&decal->dependency); + } else if (GI::get_singleton()->owns_voxel_gi(p_base)) { + GI::VoxelGI *gip = GI::get_singleton()->get_voxel_gi(p_base); + p_instance->update_dependency(&gip->dependency); + } else if (LightStorage::get_singleton()->owns_lightmap(p_base)) { + Lightmap *lm = LightStorage::get_singleton()->get_lightmap(p_base); + p_instance->update_dependency(&lm->dependency); + } else if (LightStorage::get_singleton()->owns_light(p_base)) { + Light *l = LightStorage::get_singleton()->get_light(p_base); + p_instance->update_dependency(&l->dependency); + } else if (ParticlesStorage::get_singleton()->owns_particles(p_base)) { + Particles *p = ParticlesStorage::get_singleton()->get_particles(p_base); + p_instance->update_dependency(&p->dependency); + } else if (ParticlesStorage::get_singleton()->owns_particles_collision(p_base)) { + ParticlesCollision *pc = ParticlesStorage::get_singleton()->get_particles_collision(p_base); + p_instance->update_dependency(&pc->dependency); + } else if (Fog::get_singleton()->owns_fog_volume(p_base)) { + Fog::FogVolume *fv = Fog::get_singleton()->get_fog_volume(p_base); + p_instance->update_dependency(&fv->dependency); + } else if (owns_visibility_notifier(p_base)) { + VisibilityNotifier *vn = get_visibility_notifier(p_base); + p_instance->update_dependency(&vn->dependency); + } +} + +/* VISIBILITY NOTIFIER */ + +RID Utilities::visibility_notifier_allocate() { + return visibility_notifier_owner.allocate_rid(); +} + +void Utilities::visibility_notifier_initialize(RID p_notifier) { + visibility_notifier_owner.initialize_rid(p_notifier, VisibilityNotifier()); +} + +void Utilities::visibility_notifier_free(RID p_notifier) { + VisibilityNotifier *vn = visibility_notifier_owner.get_or_null(p_notifier); + vn->dependency.deleted_notify(p_notifier); + visibility_notifier_owner.free(p_notifier); +} + +void Utilities::visibility_notifier_set_aabb(RID p_notifier, const AABB &p_aabb) { + VisibilityNotifier *vn = visibility_notifier_owner.get_or_null(p_notifier); + ERR_FAIL_COND(!vn); + vn->aabb = p_aabb; + vn->dependency.changed_notify(Dependency::DEPENDENCY_CHANGED_AABB); +} + +void Utilities::visibility_notifier_set_callbacks(RID p_notifier, const Callable &p_enter_callbable, const Callable &p_exit_callable) { + VisibilityNotifier *vn = visibility_notifier_owner.get_or_null(p_notifier); + ERR_FAIL_COND(!vn); + vn->enter_callback = p_enter_callbable; + vn->exit_callback = p_exit_callable; +} + +AABB Utilities::visibility_notifier_get_aabb(RID p_notifier) const { + const VisibilityNotifier *vn = visibility_notifier_owner.get_or_null(p_notifier); + ERR_FAIL_COND_V(!vn, AABB()); + return vn->aabb; } -EffectsRD *RendererStorageRD::get_effects() { - ERR_FAIL_NULL_V_MSG(effects, nullptr, "Effects haven't been initialised yet."); - return effects; +void Utilities::visibility_notifier_call(RID p_notifier, bool p_enter, bool p_deferred) { + VisibilityNotifier *vn = visibility_notifier_owner.get_or_null(p_notifier); + ERR_FAIL_COND(!vn); + + if (p_enter) { + if (!vn->enter_callback.is_null()) { + if (p_deferred) { + vn->enter_callback.call_deferred(nullptr, 0); + } else { + Variant r; + Callable::CallError ce; + vn->enter_callback.call(nullptr, 0, r, ce); + } + } + } else { + if (!vn->exit_callback.is_null()) { + if (p_deferred) { + vn->exit_callback.call_deferred(nullptr, 0); + } else { + Variant r; + Callable::CallError ce; + vn->exit_callback.call(nullptr, 0, r, ce); + } + } + } } -void RendererStorageRD::capture_timestamps_begin() { +/* TIMING */ + +void Utilities::capture_timestamps_begin() { RD::get_singleton()->capture_timestamp("Frame Begin"); } -void RendererStorageRD::capture_timestamp(const String &p_name) { +void Utilities::capture_timestamp(const String &p_name) { RD::get_singleton()->capture_timestamp(p_name); } -uint32_t RendererStorageRD::get_captured_timestamps_count() const { +uint32_t Utilities::get_captured_timestamps_count() const { return RD::get_singleton()->get_captured_timestamps_count(); } -uint64_t RendererStorageRD::get_captured_timestamps_frame() const { +uint64_t Utilities::get_captured_timestamps_frame() const { return RD::get_singleton()->get_captured_timestamps_frame(); } -uint64_t RendererStorageRD::get_captured_timestamp_gpu_time(uint32_t p_index) const { +uint64_t Utilities::get_captured_timestamp_gpu_time(uint32_t p_index) const { return RD::get_singleton()->get_captured_timestamp_gpu_time(p_index); } -uint64_t RendererStorageRD::get_captured_timestamp_cpu_time(uint32_t p_index) const { +uint64_t Utilities::get_captured_timestamp_cpu_time(uint32_t p_index) const { return RD::get_singleton()->get_captured_timestamp_cpu_time(p_index); } -String RendererStorageRD::get_captured_timestamp_name(uint32_t p_index) const { +String Utilities::get_captured_timestamp_name(uint32_t p_index) const { return RD::get_singleton()->get_captured_timestamp_name(p_index); } -void RendererStorageRD::update_memory_info() { +/* MISC */ + +void Utilities::update_dirty_resources() { + MaterialStorage::get_singleton()->_update_global_variables(); //must do before materials, so it can queue them for update + MaterialStorage::get_singleton()->_update_queued_materials(); + MeshStorage::get_singleton()->_update_dirty_multimeshes(); + MeshStorage::get_singleton()->_update_dirty_skeletons(); + TextureStorage::get_singleton()->update_decal_atlas(); +} + +bool Utilities::has_os_feature(const String &p_feature) const { + if (!RD::get_singleton()) { + return false; + } + + if (p_feature == "rgtc" && RD::get_singleton()->texture_is_format_supported_for_usage(RD::DATA_FORMAT_BC5_UNORM_BLOCK, RD::TEXTURE_USAGE_SAMPLING_BIT)) { + return true; + } + + if (p_feature == "s3tc" && RD::get_singleton()->texture_is_format_supported_for_usage(RD::DATA_FORMAT_BC1_RGB_UNORM_BLOCK, RD::TEXTURE_USAGE_SAMPLING_BIT)) { + return true; + } + + if (p_feature == "bptc" && RD::get_singleton()->texture_is_format_supported_for_usage(RD::DATA_FORMAT_BC7_UNORM_BLOCK, RD::TEXTURE_USAGE_SAMPLING_BIT)) { + return true; + } + + if ((p_feature == "etc" || p_feature == "etc2") && RD::get_singleton()->texture_is_format_supported_for_usage(RD::DATA_FORMAT_ETC2_R8G8B8_UNORM_BLOCK, RD::TEXTURE_USAGE_SAMPLING_BIT)) { + return true; + } + + return false; +} + +void Utilities::update_memory_info() { texture_mem_cache = RenderingDevice::get_singleton()->get_memory_usage(RenderingDevice::MEMORY_TEXTURES); buffer_mem_cache = RenderingDevice::get_singleton()->get_memory_usage(RenderingDevice::MEMORY_BUFFERS); total_mem_cache = RenderingDevice::get_singleton()->get_memory_usage(RenderingDevice::MEMORY_TOTAL); } -uint64_t RendererStorageRD::get_rendering_info(RS::RenderingInfo p_info) { + +uint64_t Utilities::get_rendering_info(RS::RenderingInfo p_info) { if (p_info == RS::RENDERING_INFO_TEXTURE_MEM_USED) { return texture_mem_cache; } else if (p_info == RS::RENDERING_INFO_BUFFER_MEM_USED) { @@ -389,31 +320,18 @@ uint64_t RendererStorageRD::get_rendering_info(RS::RenderingInfo p_info) { return 0; } -String RendererStorageRD::get_video_adapter_name() const { +String Utilities::get_video_adapter_name() const { return RenderingDevice::get_singleton()->get_device_name(); } -String RendererStorageRD::get_video_adapter_vendor() const { +String Utilities::get_video_adapter_vendor() const { return RenderingDevice::get_singleton()->get_device_vendor_name(); } -RenderingDevice::DeviceType RendererStorageRD::get_video_adapter_type() const { +RenderingDevice::DeviceType Utilities::get_video_adapter_type() const { return RenderingDevice::get_singleton()->get_device_type(); } -String RendererStorageRD::get_video_adapter_api_version() const { +String Utilities::get_video_adapter_api_version() const { return RenderingDevice::get_singleton()->get_device_api_version(); } - -RendererStorageRD *RendererStorageRD::base_singleton = nullptr; - -RendererStorageRD::RendererStorageRD() { - base_singleton = this; -} - -RendererStorageRD::~RendererStorageRD() { - if (effects) { - memdelete(effects); - effects = nullptr; - } -} diff --git a/servers/rendering/renderer_rd/storage_rd/utilities.h b/servers/rendering/renderer_rd/storage_rd/utilities.h new file mode 100644 index 0000000000..979e984546 --- /dev/null +++ b/servers/rendering/renderer_rd/storage_rd/utilities.h @@ -0,0 +1,122 @@ +/*************************************************************************/ +/* utilities.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2022 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. */ +/*************************************************************************/ + +#ifndef UTILITIES_RD_H +#define UTILITIES_RD_H + +#include "core/templates/rid_owner.h" +#include "servers/rendering/storage/utilities.h" + +namespace RendererRD { + +/* VISIBILITY NOTIFIER */ + +struct VisibilityNotifier { + AABB aabb; + Callable enter_callback; + Callable exit_callback; + Dependency dependency; +}; + +class Utilities : public RendererUtilities { +private: + static Utilities *singleton; + + /* VISIBILITY NOTIFIER */ + + mutable RID_Owner<VisibilityNotifier> visibility_notifier_owner; + + /* MISC */ + + //keep cached since it can be called form any thread + uint64_t texture_mem_cache = 0; + uint64_t buffer_mem_cache = 0; + uint64_t total_mem_cache = 0; + +public: + static Utilities *get_singleton() { return singleton; } + + Utilities(); + virtual ~Utilities() override; + + /* INSTANCES */ + + virtual RS::InstanceType get_base_type(RID p_rid) const override; + virtual bool free(RID p_rid) override; + + /* DEPENDENCIES */ + + virtual void base_update_dependency(RID p_base, DependencyTracker *p_instance) override; + + /* VISIBILITY NOTIFIER */ + + VisibilityNotifier *get_visibility_notifier(RID p_rid) { return visibility_notifier_owner.get_or_null(p_rid); }; + bool owns_visibility_notifier(RID p_rid) const { return visibility_notifier_owner.owns(p_rid); }; + + virtual RID visibility_notifier_allocate() override; + virtual void visibility_notifier_initialize(RID p_notifier) override; + virtual void visibility_notifier_free(RID p_notifier) override; + + virtual void visibility_notifier_set_aabb(RID p_notifier, const AABB &p_aabb) override; + virtual void visibility_notifier_set_callbacks(RID p_notifier, const Callable &p_enter_callbable, const Callable &p_exit_callable) override; + + virtual AABB visibility_notifier_get_aabb(RID p_notifier) const override; + virtual void visibility_notifier_call(RID p_notifier, bool p_enter, bool p_deferred) override; + + /* TIMING */ + + virtual void capture_timestamps_begin() override; + virtual void capture_timestamp(const String &p_name) override; + virtual uint32_t get_captured_timestamps_count() const override; + virtual uint64_t get_captured_timestamps_frame() const override; + virtual uint64_t get_captured_timestamp_gpu_time(uint32_t p_index) const override; + virtual uint64_t get_captured_timestamp_cpu_time(uint32_t p_index) const override; + virtual String get_captured_timestamp_name(uint32_t p_index) const override; + + /* MISC */ + + virtual void update_dirty_resources() override; + virtual void set_debug_generate_wireframes(bool p_generate) override {} + + virtual bool has_os_feature(const String &p_feature) const override; + + virtual void update_memory_info() override; + + virtual uint64_t get_rendering_info(RS::RenderingInfo p_info) override; + + virtual String get_video_adapter_name() const override; + virtual String get_video_adapter_vendor() const override; + virtual RenderingDevice::DeviceType get_video_adapter_type() const override; + virtual String get_video_adapter_api_version() const override; +}; + +} // namespace RendererRD + +#endif // !UTILITIES_RD_H diff --git a/servers/rendering/renderer_scene_cull.cpp b/servers/rendering/renderer_scene_cull.cpp index 325907ee85..aaf7ab8efd 100644 --- a/servers/rendering/renderer_scene_cull.cpp +++ b/servers/rendering/renderer_scene_cull.cpp @@ -470,7 +470,7 @@ void RendererSceneCull::_instance_update_mesh_instance(Instance *p_instance) { p_instance->mesh_instance = RSG::mesh_storage->mesh_instance_create(p_instance->base); } else { - RSG::storage->free(p_instance->mesh_instance); + RSG::mesh_storage->mesh_free(p_instance->mesh_instance); p_instance->mesh_instance = RID(); } @@ -506,7 +506,7 @@ void RendererSceneCull::instance_set_base(RID p_instance, RID p_base) { } if (instance->mesh_instance.is_valid()) { - RSG::storage->free(instance->mesh_instance); + RSG::mesh_storage->mesh_free(instance->mesh_instance); instance->mesh_instance = RID(); // no need to set instance data flag here, as it was freed above } @@ -538,7 +538,7 @@ void RendererSceneCull::instance_set_base(RID p_instance, RID p_base) { } break; case RS::INSTANCE_PARTICLES_COLLISION: { InstanceParticlesCollisionData *collision = static_cast<InstanceParticlesCollisionData *>(instance->base_data); - RSG::storage->free(collision->instance); + RSG::utilities->free(collision->instance); } break; case RS::INSTANCE_FOG_VOLUME: { InstanceFogVolumeData *volume = static_cast<InstanceFogVolumeData *>(instance->base_data); @@ -607,7 +607,7 @@ void RendererSceneCull::instance_set_base(RID p_instance, RID p_base) { instance->base = RID(); if (p_base.is_valid()) { - instance->base_type = RSG::storage->get_base_type(p_base); + instance->base_type = RSG::utilities->get_base_type(p_base); // fix up a specific malfunctioning case before the switch, so it can be handled if (instance->base_type == RS::INSTANCE_NONE && RendererSceneOcclusionCull::get_singleton()->is_occluder(p_base)) { @@ -724,7 +724,7 @@ void RendererSceneCull::instance_set_base(RID p_instance, RID p_base) { } //forcefully update the dependency now, so if for some reason it gets removed, we can immediately clear it - RSG::storage->base_update_dependency(p_base, &instance->dependency_tracker); + RSG::utilities->base_update_dependency(p_base, &instance->dependency_tracker); } _instance_queue_update(instance, true, true); @@ -1876,10 +1876,10 @@ void RendererSceneCull::_update_instance_aabb(Instance *p_instance) { } break; case RenderingServer::INSTANCE_FOG_VOLUME: { - new_aabb = RSG::storage->fog_volume_get_aabb(p_instance->base); + new_aabb = RSG::fog->fog_volume_get_aabb(p_instance->base); } break; case RenderingServer::INSTANCE_VISIBLITY_NOTIFIER: { - new_aabb = RSG::storage->visibility_notifier_get_aabb(p_instance->base); + new_aabb = RSG::utilities->visibility_notifier_get_aabb(p_instance->base); } break; case RenderingServer::INSTANCE_LIGHT: { new_aabb = RSG::light_storage->light_get_aabb(p_instance->base); @@ -3677,7 +3677,7 @@ void RendererSceneCull::_update_dirty_instance(Instance *p_instance) { p_instance->dependency_tracker.update_begin(); if (p_instance->base.is_valid()) { - RSG::storage->base_update_dependency(p_instance->base, &p_instance->dependency_tracker); + RSG::utilities->base_update_dependency(p_instance->base, &p_instance->dependency_tracker); } if (p_instance->material_override.is_valid()) { @@ -3785,7 +3785,7 @@ void RendererSceneCull::_update_dirty_instance(Instance *p_instance) { can_cast_shadows = false; } - RSG::storage->base_update_dependency(mesh, &p_instance->dependency_tracker); + RSG::utilities->base_update_dependency(mesh, &p_instance->dependency_tracker); } } else if (p_instance->base_type == RS::INSTANCE_PARTICLES) { bool cast_shadows = false; @@ -3885,7 +3885,7 @@ void RendererSceneCull::_update_dirty_instance(Instance *p_instance) { } void RendererSceneCull::update_dirty_instances() { - RSG::storage->update_dirty_resources(); + RSG::utilities->update_dirty_resources(); while (_instance_update_list.first()) { _update_dirty_instance(_instance_update_list.first()->self()); @@ -3978,12 +3978,12 @@ void RendererSceneCull::update_visibility_notifiers() { if (visibility_notifier->just_visible) { visibility_notifier->just_visible = false; - RSG::storage->visibility_notifier_call(visibility_notifier->base, true, RSG::threaded); + RSG::utilities->visibility_notifier_call(visibility_notifier->base, true, RSG::threaded); } else { if (visibility_notifier->visible_in_frame != RSG::rasterizer->get_frame_number()) { visible_notifier_list.remove(E); - RSG::storage->visibility_notifier_call(visibility_notifier->base, false, RSG::threaded); + RSG::utilities->visibility_notifier_call(visibility_notifier->base, false, RSG::threaded); } } diff --git a/servers/rendering/renderer_scene_cull.h b/servers/rendering/renderer_scene_cull.h index 4880221586..198898141e 100644 --- a/servers/rendering/renderer_scene_cull.h +++ b/servers/rendering/renderer_scene_cull.h @@ -42,7 +42,7 @@ #include "servers/rendering/renderer_scene.h" #include "servers/rendering/renderer_scene_occlusion_cull.h" #include "servers/rendering/renderer_scene_render.h" -#include "servers/rendering/renderer_storage.h" +#include "servers/rendering/storage/utilities.h" #include "servers/xr/xr_interface.h" class RendererSceneCull : public RendererScene { @@ -470,32 +470,32 @@ public: SelfList<InstancePair>::List pairs; uint64_t pair_check; - RendererStorage::DependencyTracker dependency_tracker; + DependencyTracker dependency_tracker; - static void dependency_changed(RendererStorage::DependencyChangedNotification p_notification, RendererStorage::DependencyTracker *tracker) { + static void dependency_changed(Dependency::DependencyChangedNotification p_notification, DependencyTracker *tracker) { Instance *instance = (Instance *)tracker->userdata; switch (p_notification) { - case RendererStorage::DEPENDENCY_CHANGED_SKELETON_DATA: - case RendererStorage::DEPENDENCY_CHANGED_AABB: { + case Dependency::DEPENDENCY_CHANGED_SKELETON_DATA: + case Dependency::DEPENDENCY_CHANGED_AABB: { singleton->_instance_queue_update(instance, true, false); } break; - case RendererStorage::DEPENDENCY_CHANGED_MATERIAL: { + case Dependency::DEPENDENCY_CHANGED_MATERIAL: { singleton->_instance_queue_update(instance, false, true); } break; - case RendererStorage::DEPENDENCY_CHANGED_MESH: - case RendererStorage::DEPENDENCY_CHANGED_PARTICLES: - case RendererStorage::DEPENDENCY_CHANGED_MULTIMESH: - case RendererStorage::DEPENDENCY_CHANGED_DECAL: - case RendererStorage::DEPENDENCY_CHANGED_LIGHT: - case RendererStorage::DEPENDENCY_CHANGED_REFLECTION_PROBE: { + case Dependency::DEPENDENCY_CHANGED_MESH: + case Dependency::DEPENDENCY_CHANGED_PARTICLES: + case Dependency::DEPENDENCY_CHANGED_MULTIMESH: + case Dependency::DEPENDENCY_CHANGED_DECAL: + case Dependency::DEPENDENCY_CHANGED_LIGHT: + case Dependency::DEPENDENCY_CHANGED_REFLECTION_PROBE: { singleton->_instance_queue_update(instance, true, true); } break; - case RendererStorage::DEPENDENCY_CHANGED_MULTIMESH_VISIBLE_INSTANCES: - case RendererStorage::DEPENDENCY_CHANGED_SKELETON_BONES: { + case Dependency::DEPENDENCY_CHANGED_MULTIMESH_VISIBLE_INSTANCES: + case Dependency::DEPENDENCY_CHANGED_SKELETON_BONES: { //ignored } break; - case RendererStorage::DEPENDENCY_CHANGED_LIGHT_SOFT_SHADOW_AND_PROJECTOR: { + case Dependency::DEPENDENCY_CHANGED_LIGHT_SOFT_SHADOW_AND_PROJECTOR: { //requires repairing if (instance->indexer_id.is_valid()) { singleton->_unpair_instance(instance); @@ -506,7 +506,7 @@ public: } } - static void dependency_deleted(const RID &p_dependency, RendererStorage::DependencyTracker *tracker) { + static void dependency_deleted(const RID &p_dependency, DependencyTracker *tracker) { Instance *instance = (Instance *)tracker->userdata; if (p_dependency == instance->base) { diff --git a/servers/rendering/renderer_viewport.cpp b/servers/rendering/renderer_viewport.cpp index ab9ee2067f..2fccb1fd38 100644 --- a/servers/rendering/renderer_viewport.cpp +++ b/servers/rendering/renderer_viewport.cpp @@ -175,7 +175,7 @@ void RendererViewport::_draw_3d(Viewport *p_viewport) { void RendererViewport::_draw_viewport(Viewport *p_viewport) { if (p_viewport->measure_render_time) { String rt_id = "vp_begin_" + itos(p_viewport->self.get_id()); - RSG::storage->capture_timestamp(rt_id); + RSG::utilities->capture_timestamp(rt_id); timestamp_vp_map[rt_id] = p_viewport->self; } @@ -212,7 +212,7 @@ void RendererViewport::_draw_viewport(Viewport *p_viewport) { _configure_3d_render_buffers(p_viewport); } - Color bgcolor = p_viewport->transparent_bg ? Color(0, 0, 0, 0) : RSG::storage->get_default_clear_color(); + Color bgcolor = p_viewport->transparent_bg ? Color(0, 0, 0, 0) : RSG::texture_storage->get_default_clear_color(); if (p_viewport->clear_mode != RS::VIEWPORT_CLEAR_NEVER) { RSG::texture_storage->render_target_request_clear(p_viewport->render_target, bgcolor); @@ -521,7 +521,7 @@ void RendererViewport::_draw_viewport(Viewport *p_viewport) { if (p_viewport->measure_render_time) { String rt_id = "vp_end_" + itos(p_viewport->self.get_id()); - RSG::storage->capture_timestamp(rt_id); + RSG::utilities->capture_timestamp(rt_id); timestamp_vp_map[rt_id] = p_viewport->self; } } @@ -1259,7 +1259,7 @@ void RendererViewport::handle_timestamp(String p_timestamp, uint64_t p_cpu_time, } void RendererViewport::set_default_clear_color(const Color &p_color) { - RSG::storage->set_default_clear_color(p_color); + RSG::texture_storage->set_default_clear_color(p_color); } // Workaround for setting this on thread. diff --git a/servers/rendering/rendering_server_default.cpp b/servers/rendering/rendering_server_default.cpp index 7e035bae80..bcd7e6a1dd 100644 --- a/servers/rendering/rendering_server_default.cpp +++ b/servers/rendering/rendering_server_default.cpp @@ -48,7 +48,7 @@ void RenderingServerDefault::_free(RID p_rid) { if (unlikely(p_rid.is_null())) { return; } - if (RSG::storage->free(p_rid)) { + if (RSG::utilities->free(p_rid)) { return; } if (RSG::canvas->free(p_rid)) { @@ -116,35 +116,35 @@ void RenderingServerDefault::_draw(bool p_swap_buffers, double frame_step) { } RS::get_singleton()->emit_signal(SNAME("frame_post_draw")); - if (RSG::storage->get_captured_timestamps_count()) { + if (RSG::utilities->get_captured_timestamps_count()) { Vector<FrameProfileArea> new_profile; - if (RSG::storage->capturing_timestamps) { - new_profile.resize(RSG::storage->get_captured_timestamps_count()); + if (RSG::utilities->capturing_timestamps) { + new_profile.resize(RSG::utilities->get_captured_timestamps_count()); } - uint64_t base_cpu = RSG::storage->get_captured_timestamp_cpu_time(0); - uint64_t base_gpu = RSG::storage->get_captured_timestamp_gpu_time(0); - for (uint32_t i = 0; i < RSG::storage->get_captured_timestamps_count(); i++) { - uint64_t time_cpu = RSG::storage->get_captured_timestamp_cpu_time(i); - uint64_t time_gpu = RSG::storage->get_captured_timestamp_gpu_time(i); + uint64_t base_cpu = RSG::utilities->get_captured_timestamp_cpu_time(0); + uint64_t base_gpu = RSG::utilities->get_captured_timestamp_gpu_time(0); + for (uint32_t i = 0; i < RSG::utilities->get_captured_timestamps_count(); i++) { + uint64_t time_cpu = RSG::utilities->get_captured_timestamp_cpu_time(i); + uint64_t time_gpu = RSG::utilities->get_captured_timestamp_gpu_time(i); - String name = RSG::storage->get_captured_timestamp_name(i); + String name = RSG::utilities->get_captured_timestamp_name(i); if (name.begins_with("vp_")) { RSG::viewport->handle_timestamp(name, time_cpu, time_gpu); } - if (RSG::storage->capturing_timestamps) { + if (RSG::utilities->capturing_timestamps) { new_profile.write[i].gpu_msec = double((time_gpu - base_gpu) / 1000) / 1000.0; new_profile.write[i].cpu_msec = double(time_cpu - base_cpu) / 1000.0; - new_profile.write[i].name = RSG::storage->get_captured_timestamp_name(i); + new_profile.write[i].name = RSG::utilities->get_captured_timestamp_name(i); } } frame_profile = new_profile; } - frame_profile_frame = RSG::storage->get_captured_timestamps_frame(); + frame_profile_frame = RSG::utilities->get_captured_timestamps_frame(); if (print_gpu_profile) { if (print_frame_profile_ticks_from == 0) { @@ -191,7 +191,7 @@ void RenderingServerDefault::_draw(bool p_swap_buffers, double frame_step) { } } - RSG::storage->update_memory_info(); + RSG::utilities->update_memory_info(); } double RenderingServerDefault::get_frame_setup_time_cpu() const { @@ -250,27 +250,27 @@ uint64_t RenderingServerDefault::get_rendering_info(RenderingInfo p_info) { } else if (p_info == RENDERING_INFO_TOTAL_DRAW_CALLS_IN_FRAME) { return RSG::viewport->get_total_draw_calls_used(); } - return RSG::storage->get_rendering_info(p_info); + return RSG::utilities->get_rendering_info(p_info); } String RenderingServerDefault::get_video_adapter_name() const { - return RSG::storage->get_video_adapter_name(); + return RSG::utilities->get_video_adapter_name(); } String RenderingServerDefault::get_video_adapter_vendor() const { - return RSG::storage->get_video_adapter_vendor(); + return RSG::utilities->get_video_adapter_vendor(); } RenderingDevice::DeviceType RenderingServerDefault::get_video_adapter_type() const { - return RSG::storage->get_video_adapter_type(); + return RSG::utilities->get_video_adapter_type(); } String RenderingServerDefault::get_video_adapter_api_version() const { - return RSG::storage->get_video_adapter_api_version(); + return RSG::utilities->get_video_adapter_api_version(); } void RenderingServerDefault::set_frame_profiling_enabled(bool p_enable) { - RSG::storage->capturing_timestamps = p_enable; + RSG::utilities->capturing_timestamps = p_enable; } uint64_t RenderingServerDefault::get_frame_profile_frame() { @@ -301,7 +301,7 @@ void RenderingServerDefault::sdfgi_set_debug_probe_select(const Vector3 &p_posit } void RenderingServerDefault::set_print_gpu_profile(bool p_enable) { - RSG::storage->capturing_timestamps = p_enable; + RSG::utilities->capturing_timestamps = p_enable; print_gpu_profile = p_enable; } @@ -313,15 +313,15 @@ RID RenderingServerDefault::get_test_cube() { } bool RenderingServerDefault::has_os_feature(const String &p_feature) const { - if (RSG::storage) { - return RSG::storage->has_os_feature(p_feature); + if (RSG::utilities) { + return RSG::utilities->has_os_feature(p_feature); } else { return false; } } void RenderingServerDefault::set_debug_generate_wireframes(bool p_generate) { - RSG::storage->set_debug_generate_wireframes(p_generate); + RSG::utilities->set_debug_generate_wireframes(p_generate); } bool RenderingServerDefault::is_low_end() const { @@ -399,13 +399,14 @@ RenderingServerDefault::RenderingServerDefault(bool p_create_thread) : RendererSceneCull *sr = memnew(RendererSceneCull); RSG::scene = sr; RSG::rasterizer = RendererCompositor::create(); + RSG::utilities = RSG::rasterizer->get_utilities(); RSG::light_storage = RSG::rasterizer->get_light_storage(); RSG::material_storage = RSG::rasterizer->get_material_storage(); RSG::mesh_storage = RSG::rasterizer->get_mesh_storage(); RSG::particles_storage = RSG::rasterizer->get_particles_storage(); RSG::texture_storage = RSG::rasterizer->get_texture_storage(); RSG::gi = RSG::rasterizer->get_gi(); - RSG::storage = RSG::rasterizer->get_storage(); + RSG::fog = RSG::rasterizer->get_fog(); RSG::canvas_render = RSG::rasterizer->get_canvas(); sr->set_scene_render(RSG::rasterizer->get_scene()); diff --git a/servers/rendering/rendering_server_default.h b/servers/rendering/rendering_server_default.h index aef89619db..584d9a7a51 100644 --- a/servers/rendering/rendering_server_default.h +++ b/servers/rendering/rendering_server_default.h @@ -31,7 +31,6 @@ #ifndef RENDERING_SERVER_DEFAULT_H #define RENDERING_SERVER_DEFAULT_H -#include "core/math/octree.h" #include "core/templates/command_queue_mt.h" #include "core/templates/hash_map.h" #include "renderer_canvas_cull.h" @@ -524,8 +523,8 @@ public: #undef ServerName #undef server_name -#define ServerName RendererStorage -#define server_name RSG::storage +#define ServerName RendererFog +#define server_name RSG::fog FUNCRIDSPLIT(fog_volume) @@ -535,6 +534,12 @@ public: /* VISIBILITY_NOTIFIER */ +#undef ServerName +#undef server_name + +#define ServerName RendererUtilities +#define server_name RSG::utilities + FUNCRIDSPLIT(visibility_notifier) FUNC2(visibility_notifier_set_aabb, RID, const AABB &) FUNC3(visibility_notifier_set_callbacks, RID, const Callable &, const Callable &) diff --git a/servers/rendering/rendering_server_globals.cpp b/servers/rendering/rendering_server_globals.cpp index 1c2a275265..46fa49e683 100644 --- a/servers/rendering/rendering_server_globals.cpp +++ b/servers/rendering/rendering_server_globals.cpp @@ -32,13 +32,14 @@ bool RenderingServerGlobals::threaded = false; +RendererUtilities *RenderingServerGlobals::utilities = nullptr; RendererLightStorage *RenderingServerGlobals::light_storage = nullptr; RendererMaterialStorage *RenderingServerGlobals::material_storage = nullptr; RendererMeshStorage *RenderingServerGlobals::mesh_storage = nullptr; RendererParticlesStorage *RenderingServerGlobals::particles_storage = nullptr; RendererTextureStorage *RenderingServerGlobals::texture_storage = nullptr; RendererGI *RenderingServerGlobals::gi = nullptr; -RendererStorage *RenderingServerGlobals::storage = nullptr; +RendererFog *RenderingServerGlobals::fog = nullptr; RendererCanvasRender *RenderingServerGlobals::canvas_render = nullptr; RendererCompositor *RenderingServerGlobals::rasterizer = nullptr; diff --git a/servers/rendering/rendering_server_globals.h b/servers/rendering/rendering_server_globals.h index 91712f2a51..87d69984f8 100644 --- a/servers/rendering/rendering_server_globals.h +++ b/servers/rendering/rendering_server_globals.h @@ -31,6 +31,7 @@ #ifndef RENDERING_SERVER_GLOBALS_H #define RENDERING_SERVER_GLOBALS_H +#include "servers/rendering/environment/renderer_fog.h" #include "servers/rendering/environment/renderer_gi.h" #include "servers/rendering/renderer_canvas_cull.h" #include "servers/rendering/renderer_canvas_render.h" @@ -40,6 +41,7 @@ #include "servers/rendering/storage/mesh_storage.h" #include "servers/rendering/storage/particles_storage.h" #include "servers/rendering/storage/texture_storage.h" +#include "servers/rendering/storage/utilities.h" class RendererCanvasCull; class RendererViewport; @@ -49,13 +51,14 @@ class RenderingServerGlobals { public: static bool threaded; + static RendererUtilities *utilities; static RendererLightStorage *light_storage; static RendererMaterialStorage *material_storage; static RendererMeshStorage *mesh_storage; static RendererParticlesStorage *particles_storage; static RendererTextureStorage *texture_storage; static RendererGI *gi; - static RendererStorage *storage; + static RendererFog *fog; static RendererCanvasRender *canvas_render; static RendererCompositor *rasterizer; diff --git a/servers/rendering/storage/light_storage.h b/servers/rendering/storage/light_storage.h index 0cb0f35570..f627e46e52 100644 --- a/servers/rendering/storage/light_storage.h +++ b/servers/rendering/storage/light_storage.h @@ -31,7 +31,6 @@ #ifndef LIGHT_STORAGE_H #define LIGHT_STORAGE_H -#include "servers/rendering/renderer_storage.h" #include "servers/rendering_server.h" class RendererLightStorage { diff --git a/servers/rendering/storage/material_storage.h b/servers/rendering/storage/material_storage.h index f0363f129a..00790106af 100644 --- a/servers/rendering/storage/material_storage.h +++ b/servers/rendering/storage/material_storage.h @@ -31,8 +31,8 @@ #ifndef MATERIAL_STORAGE_H #define MATERIAL_STORAGE_H -#include "servers/rendering/renderer_storage.h" #include "servers/rendering_server.h" +#include "utilities.h" class RendererMaterialStorage { public: @@ -95,7 +95,7 @@ public: virtual void material_get_instance_shader_parameters(RID p_material, List<InstanceShaderParam> *r_parameters) = 0; - virtual void material_update_dependency(RID p_material, RendererStorage::DependencyTracker *p_instance) = 0; + virtual void material_update_dependency(RID p_material, DependencyTracker *p_instance) = 0; }; #endif // !MATERIAL_STORAGE_H diff --git a/servers/rendering/storage/mesh_storage.h b/servers/rendering/storage/mesh_storage.h index 1dac51319c..146f6fde40 100644 --- a/servers/rendering/storage/mesh_storage.h +++ b/servers/rendering/storage/mesh_storage.h @@ -31,8 +31,8 @@ #ifndef MESH_STORAGE_H #define MESH_STORAGE_H -#include "servers/rendering/renderer_storage.h" #include "servers/rendering_server.h" +#include "utilities.h" class RendererMeshStorage { public: @@ -130,7 +130,7 @@ public: virtual Transform2D skeleton_bone_get_transform_2d(RID p_skeleton, int p_bone) const = 0; virtual void skeleton_set_base_transform_2d(RID p_skeleton, const Transform2D &p_base_transform) = 0; - virtual void skeleton_update_dependency(RID p_base, RendererStorage::DependencyTracker *p_instance) = 0; + virtual void skeleton_update_dependency(RID p_base, DependencyTracker *p_instance) = 0; }; #endif // !MESH_STORAGE_H diff --git a/servers/rendering/storage/particles_storage.h b/servers/rendering/storage/particles_storage.h index 268b5473e2..eba68210a5 100644 --- a/servers/rendering/storage/particles_storage.h +++ b/servers/rendering/storage/particles_storage.h @@ -31,7 +31,6 @@ #ifndef PARTICLES_STORAGE_H #define PARTICLES_STORAGE_H -#include "servers/rendering/renderer_storage.h" #include "servers/rendering_server.h" class RendererParticlesStorage { diff --git a/servers/rendering/storage/texture_storage.h b/servers/rendering/storage/texture_storage.h index e3a969d032..e90a028713 100644 --- a/servers/rendering/storage/texture_storage.h +++ b/servers/rendering/storage/texture_storage.h @@ -34,7 +34,18 @@ #include "servers/rendering_server.h" class RendererTextureStorage { +private: + Color default_clear_color; + public: + void set_default_clear_color(const Color &p_color) { + default_clear_color = p_color; + } + + Color get_default_clear_color() const { + return default_clear_color; + } + /* Canvas Texture API */ virtual RID canvas_texture_allocate() = 0; diff --git a/servers/rendering/renderer_storage.cpp b/servers/rendering/storage/utilities.cpp index 56409ae187..7cc6417a25 100644 --- a/servers/rendering/renderer_storage.cpp +++ b/servers/rendering/storage/utilities.cpp @@ -1,5 +1,5 @@ /*************************************************************************/ -/* renderer_storage.cpp */ +/* utilities.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -28,11 +28,9 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#include "renderer_storage.h" +#include "utilities.h" -RendererStorage *RendererStorage::base_singleton = nullptr; - -void RendererStorage::Dependency::changed_notify(DependencyChangedNotification p_notification) { +void Dependency::changed_notify(DependencyChangedNotification p_notification) { for (const KeyValue<DependencyTracker *, uint32_t> &E : instances) { if (E.key->changed_callback) { E.key->changed_callback(p_notification, E.key); @@ -40,7 +38,7 @@ void RendererStorage::Dependency::changed_notify(DependencyChangedNotification p } } -void RendererStorage::Dependency::deleted_notify(const RID &p_rid) { +void Dependency::deleted_notify(const RID &p_rid) { for (const KeyValue<DependencyTracker *, uint32_t> &E : instances) { if (E.key->deleted_callback) { E.key->deleted_callback(p_rid, E.key); @@ -52,7 +50,7 @@ void RendererStorage::Dependency::deleted_notify(const RID &p_rid) { instances.clear(); } -RendererStorage::Dependency::~Dependency() { +Dependency::~Dependency() { #ifdef DEBUG_ENABLED if (instances.size()) { WARN_PRINT("Leaked instance dependency: Bug - did not call instance_notify_deleted when freeing."); @@ -62,7 +60,3 @@ RendererStorage::Dependency::~Dependency() { } #endif } - -RendererStorage::RendererStorage() { - base_singleton = this; -} diff --git a/servers/rendering/renderer_storage.h b/servers/rendering/storage/utilities.h index 859950673e..4d7c34383c 100644 --- a/servers/rendering/renderer_storage.h +++ b/servers/rendering/storage/utilities.h @@ -1,5 +1,5 @@ /*************************************************************************/ -/* renderer_storage.h */ +/* utilities.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ @@ -28,14 +28,14 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#ifndef RENDERINGSERVERSTORAGE_H -#define RENDERINGSERVERSTORAGE_H +#ifndef RENDERER_UTILITIES_H +#define RENDERER_UTILITIES_H #include "servers/rendering_server.h" -class RendererStorage { - Color default_clear_color; +class DependencyTracker; +class Dependency { public: enum DependencyChangedNotification { DEPENDENCY_CHANGED_AABB, @@ -52,137 +52,113 @@ public: DEPENDENCY_CHANGED_REFLECTION_PROBE, }; - struct DependencyTracker; + void changed_notify(DependencyChangedNotification p_notification); + void deleted_notify(const RID &p_rid); - struct Dependency { - void changed_notify(DependencyChangedNotification p_notification); - void deleted_notify(const RID &p_rid); + ~Dependency(); - ~Dependency(); - - private: - friend struct DependencyTracker; - HashMap<DependencyTracker *, uint32_t> instances; - }; +private: + friend class DependencyTracker; + HashMap<DependencyTracker *, uint32_t> instances; +}; - struct DependencyTracker { - void *userdata = nullptr; - typedef void (*ChangedCallback)(DependencyChangedNotification, DependencyTracker *); - typedef void (*DeletedCallback)(const RID &, DependencyTracker *); +class DependencyTracker { +public: + void *userdata = nullptr; + typedef void (*ChangedCallback)(Dependency::DependencyChangedNotification, DependencyTracker *); + typedef void (*DeletedCallback)(const RID &, DependencyTracker *); - ChangedCallback changed_callback = nullptr; - DeletedCallback deleted_callback = nullptr; + ChangedCallback changed_callback = nullptr; + DeletedCallback deleted_callback = nullptr; - void update_begin() { // call before updating dependencies - instance_version++; - } + void update_begin() { // call before updating dependencies + instance_version++; + } - void update_dependency(Dependency *p_dependency) { //called internally, can't be used directly, use update functions in Storage - dependencies.insert(p_dependency); - p_dependency->instances[this] = instance_version; - } + void update_dependency(Dependency *p_dependency) { //called internally, can't be used directly, use update functions in Storage + dependencies.insert(p_dependency); + p_dependency->instances[this] = instance_version; + } - void update_end() { //call after updating dependencies - List<Pair<Dependency *, DependencyTracker *>> to_clean_up; - - for (Dependency *E : dependencies) { - Dependency *dep = E; - HashMap<DependencyTracker *, uint32_t>::Iterator F = dep->instances.find(this); - ERR_CONTINUE(!F); - if (F->value != instance_version) { - Pair<Dependency *, DependencyTracker *> p; - p.first = dep; - p.second = F->key; - to_clean_up.push_back(p); - } + void update_end() { //call after updating dependencies + List<Pair<Dependency *, DependencyTracker *>> to_clean_up; + + for (Dependency *E : dependencies) { + Dependency *dep = E; + HashMap<DependencyTracker *, uint32_t>::Iterator F = dep->instances.find(this); + ERR_CONTINUE(!F); + if (F->value != instance_version) { + Pair<Dependency *, DependencyTracker *> p; + p.first = dep; + p.second = F->key; + to_clean_up.push_back(p); } + } - while (to_clean_up.size()) { - to_clean_up.front()->get().first->instances.erase(to_clean_up.front()->get().second); - dependencies.erase(to_clean_up.front()->get().first); - to_clean_up.pop_front(); - } + while (to_clean_up.size()) { + to_clean_up.front()->get().first->instances.erase(to_clean_up.front()->get().second); + dependencies.erase(to_clean_up.front()->get().first); + to_clean_up.pop_front(); } + } - void clear() { // clear all dependencies - for (Dependency *E : dependencies) { - Dependency *dep = E; - dep->instances.erase(this); - } - dependencies.clear(); + void clear() { // clear all dependencies + for (Dependency *E : dependencies) { + Dependency *dep = E; + dep->instances.erase(this); } + dependencies.clear(); + } - ~DependencyTracker() { clear(); } + ~DependencyTracker() { clear(); } - private: - friend struct Dependency; - uint32_t instance_version = 0; - HashSet<Dependency *> dependencies; - }; +private: + friend class Dependency; + uint32_t instance_version = 0; + HashSet<Dependency *> dependencies; +}; - virtual void base_update_dependency(RID p_base, DependencyTracker *p_instance) = 0; +class RendererUtilities { +public: + virtual ~RendererUtilities() {} - /* FOG VOLUMES */ + /* INSTANCES */ - virtual RID fog_volume_allocate() = 0; - virtual void fog_volume_initialize(RID p_rid) = 0; + virtual RS::InstanceType get_base_type(RID p_rid) const = 0; + virtual bool free(RID p_rid) = 0; - virtual void fog_volume_set_shape(RID p_fog_volume, RS::FogVolumeShape p_shape) = 0; - virtual void fog_volume_set_extents(RID p_fog_volume, const Vector3 &p_extents) = 0; - virtual void fog_volume_set_material(RID p_fog_volume, RID p_material) = 0; - virtual AABB fog_volume_get_aabb(RID p_fog_volume) const = 0; - virtual RS::FogVolumeShape fog_volume_get_shape(RID p_fog_volume) const = 0; + /* DEPENDENCIES */ + + virtual void base_update_dependency(RID p_base, DependencyTracker *p_instance) = 0; /* VISIBILITY NOTIFIER */ virtual RID visibility_notifier_allocate() = 0; virtual void visibility_notifier_initialize(RID p_notifier) = 0; + virtual void visibility_notifier_free(RID p_notifier) = 0; + virtual void visibility_notifier_set_aabb(RID p_notifier, const AABB &p_aabb) = 0; virtual void visibility_notifier_set_callbacks(RID p_notifier, const Callable &p_enter_callbable, const Callable &p_exit_callable) = 0; virtual AABB visibility_notifier_get_aabb(RID p_notifier) const = 0; virtual void visibility_notifier_call(RID p_notifier, bool p_enter, bool p_deferred) = 0; - virtual RS::InstanceType get_base_type(RID p_rid) const = 0; - virtual bool free(RID p_rid) = 0; - - virtual bool has_os_feature(const String &p_feature) const = 0; + /* TIMING */ - virtual void update_dirty_resources() = 0; - - virtual void set_debug_generate_wireframes(bool p_generate) = 0; - - virtual void update_memory_info() = 0; - - virtual uint64_t get_rendering_info(RS::RenderingInfo p_info) = 0; - virtual String get_video_adapter_name() const = 0; - virtual String get_video_adapter_vendor() const = 0; - virtual RenderingDevice::DeviceType get_video_adapter_type() const = 0; - virtual String get_video_adapter_api_version() const = 0; - - static RendererStorage *base_singleton; - - void set_default_clear_color(const Color &p_color) { - default_clear_color = p_color; - } + bool capturing_timestamps = false; - Color get_default_clear_color() const { - return default_clear_color; - } -#define TIMESTAMP_BEGIN() \ - { \ - if (RSG::storage->capturing_timestamps) \ - RSG::storage->capture_timestamps_begin(); \ +#define TIMESTAMP_BEGIN() \ + { \ + if (RSG::utilities->capturing_timestamps) \ + RSG::utilities->capture_timestamps_begin(); \ } -#define RENDER_TIMESTAMP(m_text) \ - { \ - if (RSG::storage->capturing_timestamps) \ - RSG::storage->capture_timestamp(m_text); \ +#define RENDER_TIMESTAMP(m_text) \ + { \ + if (RSG::utilities->capturing_timestamps) \ + RSG::utilities->capture_timestamp(m_text); \ } - bool capturing_timestamps = false; - virtual void capture_timestamps_begin() = 0; virtual void capture_timestamp(const String &p_name) = 0; virtual uint32_t get_captured_timestamps_count() const = 0; @@ -191,8 +167,20 @@ public: virtual uint64_t get_captured_timestamp_cpu_time(uint32_t p_index) const = 0; virtual String get_captured_timestamp_name(uint32_t p_index) const = 0; - RendererStorage(); - virtual ~RendererStorage() {} + /* MISC */ + + virtual void update_dirty_resources() = 0; + virtual void set_debug_generate_wireframes(bool p_generate) = 0; + + virtual bool has_os_feature(const String &p_feature) const = 0; + + virtual void update_memory_info() = 0; + + virtual uint64_t get_rendering_info(RS::RenderingInfo p_info) = 0; + virtual String get_video_adapter_name() const = 0; + virtual String get_video_adapter_vendor() const = 0; + virtual RenderingDevice::DeviceType get_video_adapter_type() const = 0; + virtual String get_video_adapter_api_version() const = 0; }; -#endif // RENDERINGSERVERSTORAGE_H +#endif // !RENDERER_UTILITIES_H diff --git a/servers/text/text_server_extension.cpp b/servers/text/text_server_extension.cpp index e9a558ac5f..68959819c9 100644 --- a/servers/text/text_server_extension.cpp +++ b/servers/text/text_server_extension.cpp @@ -127,9 +127,6 @@ void TextServerExtension::_bind_methods() { GDVIRTUAL_BIND(font_set_scale, "font_rid", "size", "scale"); GDVIRTUAL_BIND(font_get_scale, "font_rid", "size"); - GDVIRTUAL_BIND(font_set_spacing, "font_rid", "size", "spacing", "value"); - GDVIRTUAL_BIND(font_get_spacing, "font_rid", "size", "spacing"); - GDVIRTUAL_BIND(font_get_texture_count, "font_rid", "size"); GDVIRTUAL_BIND(font_clear_textures, "font_rid", "size"); GDVIRTUAL_BIND(font_remove_texture, "font_rid", "size", "texture_index"); @@ -230,6 +227,9 @@ void TextServerExtension::_bind_methods() { GDVIRTUAL_BIND(shaped_text_set_preserve_control, "shaped", "enabled"); GDVIRTUAL_BIND(shaped_text_get_preserve_control, "shaped"); + GDVIRTUAL_BIND(shaped_text_set_spacing, "shaped", "spacing", "value"); + GDVIRTUAL_BIND(shaped_text_get_spacing, "shaped", "spacing"); + GDVIRTUAL_BIND(shaped_text_add_string, "shaped", "text", "fonts", "size", "opentype_features", "language", "meta"); GDVIRTUAL_BIND(shaped_text_add_object, "shaped", "key", "size", "inline_align", "length"); GDVIRTUAL_BIND(shaped_text_resize_object, "shaped", "key", "size", "inline_align"); @@ -706,18 +706,6 @@ double TextServerExtension::font_get_scale(const RID &p_font_rid, int64_t p_size return 0.0; } -void TextServerExtension::font_set_spacing(const RID &p_font_rid, int64_t p_size, TextServer::SpacingType p_spacing, int64_t p_value) { - GDVIRTUAL_CALL(font_set_spacing, p_font_rid, p_size, p_spacing, p_value); -} - -int64_t TextServerExtension::font_get_spacing(const RID &p_font_rid, int64_t p_size, TextServer::SpacingType p_spacing) const { - int64_t ret; - if (GDVIRTUAL_CALL(font_get_spacing, p_font_rid, p_size, p_spacing, ret)) { - return ret; - } - return 0; -} - int64_t TextServerExtension::font_get_texture_count(const RID &p_font_rid, const Vector2i &p_size) const { int64_t ret; if (GDVIRTUAL_CALL(font_get_texture_count, p_font_rid, p_size, ret)) { @@ -1132,6 +1120,18 @@ bool TextServerExtension::shaped_text_get_preserve_control(const RID &p_shaped) return false; } +void TextServerExtension::shaped_text_set_spacing(const RID &p_shaped, TextServer::SpacingType p_spacing, int64_t p_value) { + GDVIRTUAL_CALL(shaped_text_set_spacing, p_shaped, p_spacing, p_value); +} + +int64_t TextServerExtension::shaped_text_get_spacing(const RID &p_shaped, TextServer::SpacingType p_spacing) const { + int64_t ret; + if (GDVIRTUAL_CALL(shaped_text_get_spacing, p_shaped, p_spacing, ret)) { + return ret; + } + return 0; +} + bool TextServerExtension::shaped_text_add_string(const RID &p_shaped, const String &p_text, const Array &p_fonts, int64_t p_size, const Dictionary &p_opentype_features, const String &p_language, const Variant &p_meta) { bool ret; if (GDVIRTUAL_CALL(shaped_text_add_string, p_shaped, p_text, p_fonts, p_size, p_opentype_features, p_language, p_meta, ret)) { diff --git a/servers/text/text_server_extension.h b/servers/text/text_server_extension.h index 9ca0939247..d948a97c66 100644 --- a/servers/text/text_server_extension.h +++ b/servers/text/text_server_extension.h @@ -204,11 +204,6 @@ public: GDVIRTUAL3(font_set_scale, RID, int64_t, double); GDVIRTUAL2RC(double, font_get_scale, RID, int64_t); - virtual void font_set_spacing(const RID &p_font_rid, int64_t p_size, SpacingType p_spacing, int64_t p_value) override; - virtual int64_t font_get_spacing(const RID &p_font_rid, int64_t p_size, SpacingType p_spacing) const override; - GDVIRTUAL4(font_set_spacing, RID, int64_t, SpacingType, int64_t); - GDVIRTUAL3RC(int64_t, font_get_spacing, RID, int64_t, SpacingType); - virtual int64_t font_get_texture_count(const RID &p_font_rid, const Vector2i &p_size) const override; virtual void font_clear_textures(const RID &p_font_rid, const Vector2i &p_size) override; virtual void font_remove_texture(const RID &p_font_rid, const Vector2i &p_size, int64_t p_texture_index) override; @@ -377,6 +372,11 @@ public: GDVIRTUAL2(shaped_text_set_preserve_control, RID, bool); GDVIRTUAL1RC(bool, shaped_text_get_preserve_control, RID); + virtual void shaped_text_set_spacing(const RID &p_shaped, SpacingType p_spacing, int64_t p_value) override; + virtual int64_t shaped_text_get_spacing(const RID &p_shaped, SpacingType p_spacing) const override; + GDVIRTUAL3(shaped_text_set_spacing, RID, SpacingType, int64_t); + GDVIRTUAL2RC(int64_t, shaped_text_get_spacing, RID, SpacingType); + virtual bool shaped_text_add_string(const RID &p_shaped, const String &p_text, const Array &p_fonts, int64_t p_size, const Dictionary &p_opentype_features = Dictionary(), const String &p_language = "", const Variant &p_meta = Variant()) override; virtual bool shaped_text_add_object(const RID &p_shaped, const Variant &p_key, const Size2 &p_size, InlineAlignment p_inline_align = INLINE_ALIGNMENT_CENTER, int64_t p_length = 1) override; virtual bool shaped_text_resize_object(const RID &p_shaped, const Variant &p_key, const Size2 &p_size, InlineAlignment p_inline_align = INLINE_ALIGNMENT_CENTER) override; diff --git a/servers/text_server.cpp b/servers/text_server.cpp index fe5ade88a1..c1293230d8 100644 --- a/servers/text_server.cpp +++ b/servers/text_server.cpp @@ -280,9 +280,6 @@ void TextServer::_bind_methods() { ClassDB::bind_method(D_METHOD("font_set_scale", "font_rid", "size", "scale"), &TextServer::font_set_scale); ClassDB::bind_method(D_METHOD("font_get_scale", "font_rid", "size"), &TextServer::font_get_scale); - ClassDB::bind_method(D_METHOD("font_set_spacing", "font_rid", "size", "spacing", "value"), &TextServer::font_set_spacing); - ClassDB::bind_method(D_METHOD("font_get_spacing", "font_rid", "size", "spacing"), &TextServer::font_get_spacing); - ClassDB::bind_method(D_METHOD("font_get_texture_count", "font_rid", "size"), &TextServer::font_get_texture_count); ClassDB::bind_method(D_METHOD("font_clear_textures", "font_rid", "size"), &TextServer::font_clear_textures); ClassDB::bind_method(D_METHOD("font_remove_texture", "font_rid", "size", "texture_index"), &TextServer::font_remove_texture); @@ -383,6 +380,9 @@ void TextServer::_bind_methods() { ClassDB::bind_method(D_METHOD("shaped_text_set_preserve_control", "shaped", "enabled"), &TextServer::shaped_text_set_preserve_control); ClassDB::bind_method(D_METHOD("shaped_text_get_preserve_control", "shaped"), &TextServer::shaped_text_get_preserve_control); + ClassDB::bind_method(D_METHOD("shaped_text_set_spacing", "shaped", "spacing", "value"), &TextServer::shaped_text_set_spacing); + ClassDB::bind_method(D_METHOD("shaped_text_get_spacing", "shaped", "spacing"), &TextServer::shaped_text_get_spacing); + ClassDB::bind_method(D_METHOD("shaped_text_add_string", "shaped", "text", "fonts", "size", "opentype_features", "language", "meta"), &TextServer::shaped_text_add_string, DEFVAL(Dictionary()), DEFVAL(""), DEFVAL(Variant())); ClassDB::bind_method(D_METHOD("shaped_text_add_object", "shaped", "key", "size", "inline_align", "length"), &TextServer::shaped_text_add_object, DEFVAL(INLINE_ALIGNMENT_CENTER), DEFVAL(1)); ClassDB::bind_method(D_METHOD("shaped_text_resize_object", "shaped", "key", "size", "inline_align"), &TextServer::shaped_text_resize_object, DEFVAL(INLINE_ALIGNMENT_CENTER)); diff --git a/servers/text_server.h b/servers/text_server.h index 6339dde0ea..0fd35f2ec0 100644 --- a/servers/text_server.h +++ b/servers/text_server.h @@ -161,6 +161,7 @@ public: SPACING_SPACE, SPACING_TOP, SPACING_BOTTOM, + SPACING_MAX, }; enum FontStyle { @@ -284,9 +285,6 @@ public: virtual void font_set_scale(const RID &p_font_rid, int64_t p_size, double p_scale) = 0; virtual double font_get_scale(const RID &p_font_rid, int64_t p_size) const = 0; - virtual void font_set_spacing(const RID &p_font_rid, int64_t p_size, SpacingType p_spacing, int64_t p_value) = 0; - virtual int64_t font_get_spacing(const RID &p_font_rid, int64_t p_size, SpacingType p_spacing) const = 0; - virtual int64_t font_get_texture_count(const RID &p_font_rid, const Vector2i &p_size) const = 0; virtual void font_clear_textures(const RID &p_font_rid, const Vector2i &p_size) = 0; virtual void font_remove_texture(const RID &p_font_rid, const Vector2i &p_size, int64_t p_texture_index) = 0; @@ -386,6 +384,9 @@ public: virtual void shaped_text_set_preserve_control(const RID &p_shaped, bool p_enabled) = 0; virtual bool shaped_text_get_preserve_control(const RID &p_shaped) const = 0; + virtual void shaped_text_set_spacing(const RID &p_shaped, SpacingType p_spacing, int64_t p_value) = 0; + virtual int64_t shaped_text_get_spacing(const RID &p_shaped, SpacingType p_spacing) const = 0; + virtual bool shaped_text_add_string(const RID &p_shaped, const String &p_text, const Array &p_fonts, int64_t p_size, const Dictionary &p_opentype_features = Dictionary(), const String &p_language = "", const Variant &p_meta = Variant()) = 0; virtual bool shaped_text_add_object(const RID &p_shaped, const Variant &p_key, const Size2 &p_size, InlineAlignment p_inline_align = INLINE_ALIGNMENT_CENTER, int64_t p_length = 1) = 0; virtual bool shaped_text_resize_object(const RID &p_shaped, const Variant &p_key, const Size2 &p_size, InlineAlignment p_inline_align = INLINE_ALIGNMENT_CENTER) = 0; diff --git a/servers/xr/xr_interface_extension.cpp b/servers/xr/xr_interface_extension.cpp index a0bec0f95b..1f3d07c357 100644 --- a/servers/xr/xr_interface_extension.cpp +++ b/servers/xr/xr_interface_extension.cpp @@ -29,9 +29,7 @@ /*************************************************************************/ #include "xr_interface_extension.h" -#include "servers/rendering/renderer_rd/renderer_storage_rd.h" #include "servers/rendering/renderer_rd/storage_rd/texture_storage.h" -#include "servers/rendering/renderer_storage.h" #include "servers/rendering/rendering_server_globals.h" void XRInterfaceExtension::_bind_methods() { diff --git a/tests/core/object/test_class_db.h b/tests/core/object/test_class_db.h index 7ea9e16ff1..c7535426df 100644 --- a/tests/core/object/test_class_db.h +++ b/tests/core/object/test_class_db.h @@ -597,7 +597,7 @@ void add_exposed_classes(Context &r_context) { (exposed_class.name != r_context.names_cache.object_class || String(method.name) != "free"), warn_msg.utf8().get_data()); - } else if (return_info.type == Variant::INT && return_info.usage & PROPERTY_USAGE_CLASS_IS_ENUM) { + } else if (return_info.type == Variant::INT && return_info.usage & (PROPERTY_USAGE_CLASS_IS_ENUM | PROPERTY_USAGE_CLASS_IS_BITFIELD)) { method.return_type.name = return_info.class_name; method.return_type.is_enum = true; } else if (return_info.class_name != StringName()) { @@ -626,7 +626,7 @@ void add_exposed_classes(Context &r_context) { ArgumentData arg; arg.name = orig_arg_name; - if (arg_info.type == Variant::INT && arg_info.usage & PROPERTY_USAGE_CLASS_IS_ENUM) { + if (arg_info.type == Variant::INT && arg_info.usage & (PROPERTY_USAGE_CLASS_IS_ENUM | PROPERTY_USAGE_CLASS_IS_BITFIELD)) { arg.type.name = arg_info.class_name; arg.type.is_enum = true; } else if (arg_info.class_name != StringName()) { @@ -694,7 +694,7 @@ void add_exposed_classes(Context &r_context) { ArgumentData arg; arg.name = orig_arg_name; - if (arg_info.type == Variant::INT && arg_info.usage & PROPERTY_USAGE_CLASS_IS_ENUM) { + if (arg_info.type == Variant::INT && arg_info.usage & (PROPERTY_USAGE_CLASS_IS_ENUM | PROPERTY_USAGE_CLASS_IS_BITFIELD)) { arg.type.name = arg_info.class_name; arg.type.is_enum = true; } else if (arg_info.class_name != StringName()) { @@ -732,13 +732,13 @@ void add_exposed_classes(Context &r_context) { List<String> constants; ClassDB::get_integer_constant_list(class_name, &constants, true); - const HashMap<StringName, List<StringName>> &enum_map = class_info->enum_map; + const HashMap<StringName, ClassDB::ClassInfo::EnumInfo> &enum_map = class_info->enum_map; - for (const KeyValue<StringName, List<StringName>> &K : enum_map) { + for (const KeyValue<StringName, ClassDB::ClassInfo::EnumInfo> &K : enum_map) { EnumData enum_; enum_.name = K.key; - for (const StringName &E : K.value) { + for (const StringName &E : K.value.constants) { const StringName &constant_name = E; TEST_FAIL_COND(String(constant_name).find("::") != -1, "Enum constant contains '::', check bindings to remove the scope: '", diff --git a/tests/core/string/test_string.h b/tests/core/string/test_string.h index 0b191d2d94..0c5704d6c9 100644 --- a/tests/core/string/test_string.h +++ b/tests/core/string/test_string.h @@ -89,12 +89,12 @@ TEST_CASE("[String] UTF8") { static const char32_t u32str[] = { 0x0045, 0x0020, 0x304A, 0x360F, 0x3088, 0x3046, 0x1F3A4, 0 }; static const uint8_t u8str[] = { 0x45, 0x20, 0xE3, 0x81, 0x8A, 0xE3, 0x98, 0x8F, 0xE3, 0x82, 0x88, 0xE3, 0x81, 0x86, 0xF0, 0x9F, 0x8E, 0xA4, 0 }; String s = u32str; - bool err = s.parse_utf8(s.utf8().get_data()); - CHECK(!err); + Error err = s.parse_utf8(s.utf8().get_data()); + CHECK(err == OK); CHECK(s == u32str); err = s.parse_utf8((const char *)u8str); - CHECK(!err); + CHECK(err == OK); CHECK(s == u32str); CharString cs = (const char *)u8str; @@ -106,12 +106,12 @@ TEST_CASE("[String] UTF16") { static const char32_t u32str[] = { 0x0045, 0x0020, 0x304A, 0x360F, 0x3088, 0x3046, 0x1F3A4, 0 }; static const char16_t u16str[] = { 0x0045, 0x0020, 0x304A, 0x360F, 0x3088, 0x3046, 0xD83C, 0xDFA4, 0 }; String s = u32str; - bool err = s.parse_utf16(s.utf16().get_data()); - CHECK(!err); + Error err = s.parse_utf16(s.utf16().get_data()); + CHECK(err == OK); CHECK(s == u32str); err = s.parse_utf16(u16str); - CHECK(!err); + CHECK(err == OK); CHECK(s == u32str); Char16String cs = u16str; @@ -123,8 +123,8 @@ TEST_CASE("[String] UTF8 with BOM") { static const char32_t u32str[] = { 0x0045, 0x0020, 0x304A, 0x360F, 0x3088, 0x3046, 0x1F3A4, 0 }; static const uint8_t u8str[] = { 0xEF, 0xBB, 0xBF, 0x45, 0x20, 0xE3, 0x81, 0x8A, 0xE3, 0x98, 0x8F, 0xE3, 0x82, 0x88, 0xE3, 0x81, 0x86, 0xF0, 0x9F, 0x8E, 0xA4, 0 }; String s; - bool err = s.parse_utf8((const char *)u8str); - CHECK(!err); + Error err = s.parse_utf8((const char *)u8str); + CHECK(err == OK); CHECK(s == u32str); CharString cs = (const char *)u8str; @@ -137,12 +137,12 @@ TEST_CASE("[String] UTF16 with BOM") { static const char16_t u16str[] = { 0xFEFF, 0x0020, 0x0045, 0x304A, 0x360F, 0x3088, 0x3046, 0xD83C, 0xDFA4, 0 }; static const char16_t u16str_swap[] = { 0xFFFE, 0x2000, 0x4500, 0x4A30, 0x0F36, 0x8830, 0x4630, 0x3CD8, 0xA4DF, 0 }; String s; - bool err = s.parse_utf16(u16str); - CHECK(!err); + Error err = s.parse_utf16(u16str); + CHECK(err == OK); CHECK(s == u32str); err = s.parse_utf16(u16str_swap); - CHECK(!err); + CHECK(err == OK); CHECK(s == u32str); Char16String cs = u16str; @@ -152,29 +152,48 @@ TEST_CASE("[String] UTF16 with BOM") { CHECK(String::utf16(cs) == s); } -TEST_CASE("[String] Invalid UTF8") { +TEST_CASE("[String] Invalid UTF8 (non-standard)") { ERR_PRINT_OFF - static const uint8_t u8str[] = { 0x45, 0xE3, 0x81, 0x8A, 0x8F, 0xE3, 0xE3, 0x98, 0x8F, 0xE3, 0x82, 0x88, 0xE3, 0x81, 0x86, 0xF0, 0x9F, 0x8E, 0xA4, 0 }; + static const uint8_t u8str[] = { 0x45, 0xE3, 0x81, 0x8A, 0xE3, 0x82, 0x88, 0xE3, 0x81, 0x86, 0xF0, 0x9F, 0x8E, 0xA4, 0xF0, 0x82, 0x82, 0xAC, 0xED, 0xA0, 0x81, 0 }; + // + +2 +2 +2 +3 overlong +3 unpaired +2 + static const char32_t u32str[] = { 0x45, 0x304A, 0x3088, 0x3046, 0x1F3A4, 0x20AC, 0xD801, 0 }; String s; - bool err = s.parse_utf8((const char *)u8str); - CHECK(err); - CHECK(s.is_empty()); + Error err = s.parse_utf8((const char *)u8str); + CHECK(err == ERR_PARSE_ERROR); + CHECK(s == u32str); CharString cs = (const char *)u8str; - CHECK(String::utf8(cs).is_empty()); + CHECK(String::utf8(cs) == s); ERR_PRINT_ON } -TEST_CASE("[String] Invalid UTF16") { +TEST_CASE("[String] Invalid UTF8 (unrecoverable)") { + ERR_PRINT_OFF + static const uint8_t u8str[] = { 0x45, 0xE3, 0x81, 0x8A, 0x8F, 0xE3, 0xE3, 0x98, 0x8F, 0xE3, 0x82, 0x88, 0xE3, 0x81, 0x86, 0xC0, 0x80, 0xF0, 0x9F, 0x8E, 0xA4, 0xF0, 0x82, 0x82, 0xAC, 0xED, 0xA0, 0x81, 0 }; + // + +2 inv +2 inv inv inv +2 +2 ovl NUL +1 +3 overlong +3 unpaired +2 + static const char32_t u32str[] = { 0x45, 0x304A, 0x20, 0x20, 0x20, 0x20, 0x3088, 0x3046, 0x20, 0x1F3A4, 0x20AC, 0xD801, 0 }; + String s; + Error err = s.parse_utf8((const char *)u8str); + CHECK(err == ERR_INVALID_DATA); + CHECK(s == u32str); + + CharString cs = (const char *)u8str; + CHECK(String::utf8(cs) == s); + ERR_PRINT_ON +} + +TEST_CASE("[String] Invalid UTF16 (non-standard)") { ERR_PRINT_OFF static const char16_t u16str[] = { 0x0045, 0x304A, 0x3088, 0x3046, 0xDFA4, 0 }; + // + + + + unpaired + static const char32_t u32str[] = { 0x0045, 0x304A, 0x3088, 0x3046, 0xDFA4, 0 }; String s; - bool err = s.parse_utf16(u16str); - CHECK(err); - CHECK(s.is_empty()); + Error err = s.parse_utf16(u16str); + CHECK(err == ERR_PARSE_ERROR); + CHECK(s == u32str); Char16String cs = u16str; - CHECK(String::utf16(cs).is_empty()); + CHECK(String::utf16(cs) == s); ERR_PRINT_ON } @@ -262,8 +281,8 @@ TEST_CASE("[String] Test chr") { CHECK(String::chr('H') == "H"); CHECK(String::chr(0x3012)[0] == 0x3012); ERR_PRINT_OFF - CHECK(String::chr(0xd812)[0] == 0xfffd); // Unpaired UTF-16 surrogate - CHECK(String::chr(0x20d812)[0] == 0xfffd); // Outside UTF-32 range + CHECK(String::chr(0xd812)[0] == 0xd812); // Unpaired UTF-16 surrogate + CHECK(String::chr(0x20d812)[0] == 0x20d812); // Outside UTF-32 range ERR_PRINT_ON } @@ -1125,9 +1144,9 @@ TEST_CASE("[String] lstrip and rstrip") { #undef STRIP_TEST } -TEST_CASE("[String] ensuring empty string into parse_utf8 passes empty string") { +TEST_CASE("[String] Ensuring empty string into parse_utf8 passes empty string") { String empty; - CHECK(empty.parse_utf8(nullptr, -1)); + CHECK(empty.parse_utf8(nullptr, -1) == ERR_INVALID_DATA); } TEST_CASE("[String] Cyrillic to_lower()") { @@ -1440,8 +1459,8 @@ TEST_CASE("[String] validate_node_name") { String name_with_spaces = "Name with spaces"; CHECK(name_with_spaces.validate_node_name() == "Name with spaces"); - String name_with_kana = "Name with kana ゴドツ"; - CHECK(name_with_kana.validate_node_name() == "Name with kana ゴドツ"); + String name_with_kana = U"Name with kana ゴドツ"; + CHECK(name_with_kana.validate_node_name() == U"Name with kana ゴドツ"); String name_with_invalid_chars = "Name with invalid characters :.@removed!"; CHECK(name_with_invalid_chars.validate_node_name() == "Name with invalid characters removed!"); diff --git a/tests/scene/test_theme.h b/tests/scene/test_theme.h index fedffc8449..f7cfa0fd5b 100644 --- a/tests/scene/test_theme.h +++ b/tests/scene/test_theme.h @@ -46,7 +46,7 @@ public: } const valid_data[Theme::DATA_TYPE_MAX] = { { Theme::DATA_TYPE_COLOR, Color() }, { Theme::DATA_TYPE_CONSTANT, 42 }, - { Theme::DATA_TYPE_FONT, Ref<Font>(memnew(Font)) }, + { Theme::DATA_TYPE_FONT, Ref<FontFile>(memnew(FontFile)) }, { Theme::DATA_TYPE_FONT_SIZE, 42 }, { Theme::DATA_TYPE_ICON, Ref<Texture>(memnew(ImageTexture)) }, { Theme::DATA_TYPE_STYLEBOX, Ref<StyleBox>(memnew(StyleBoxFlat)) }, |