diff options
482 files changed, 28531 insertions, 17758 deletions
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/input/input_event.cpp b/core/input/input_event.cpp index 32e025417e..3c104c2c86 100644 --- a/core/input/input_event.cpp +++ b/core/input/input_event.cpp @@ -741,6 +741,14 @@ float InputEventMouseMotion::get_pressure() const { return pressure; } +void InputEventMouseMotion::set_pen_inverted(bool p_inverted) { + pen_inverted = p_inverted; +} + +bool InputEventMouseMotion::get_pen_inverted() const { + return pen_inverted; +} + void InputEventMouseMotion::set_relative(const Vector2 &p_relative) { relative = p_relative; } @@ -768,6 +776,7 @@ Ref<InputEvent> InputEventMouseMotion::xformed_by(const Transform2D &p_xform, co mm->set_position(p_xform.xform(get_position() + p_local_ofs)); mm->set_pressure(get_pressure()); + mm->set_pen_inverted(get_pen_inverted()); mm->set_tilt(get_tilt()); mm->set_global_position(get_global_position()); @@ -805,9 +814,9 @@ String InputEventMouseMotion::to_string() { break; } - // Work around the fact vformat can only take 5 substitutions but 6 need to be passed. - String mask_and_position = vformat("button_mask=%s, position=(%s)", button_mask_string, String(get_position())); - return vformat("InputEventMouseMotion: %s, relative=(%s), velocity=(%s), pressure=%.2f, tilt=(%s)", mask_and_position, String(get_relative()), String(get_velocity()), get_pressure(), String(get_tilt())); + // Work around the fact vformat can only take 5 substitutions but 7 need to be passed. + String mask_and_position_and_relative = vformat("button_mask=%s, position=(%s), relative=(%s)", button_mask_string, String(get_position()), String(get_relative())); + return vformat("InputEventMouseMotion: %s, velocity=(%s), pressure=%.2f, tilt=(%s), pen_inverted=(%d)", mask_and_position_and_relative, String(get_velocity()), get_pressure(), String(get_tilt()), get_pen_inverted()); } bool InputEventMouseMotion::accumulate(const Ref<InputEvent> &p_event) { @@ -859,6 +868,9 @@ void InputEventMouseMotion::_bind_methods() { ClassDB::bind_method(D_METHOD("set_pressure", "pressure"), &InputEventMouseMotion::set_pressure); ClassDB::bind_method(D_METHOD("get_pressure"), &InputEventMouseMotion::get_pressure); + ClassDB::bind_method(D_METHOD("set_pen_inverted", "pen_inverted"), &InputEventMouseMotion::set_pen_inverted); + ClassDB::bind_method(D_METHOD("get_pen_inverted"), &InputEventMouseMotion::get_pen_inverted); + ClassDB::bind_method(D_METHOD("set_relative", "relative"), &InputEventMouseMotion::set_relative); ClassDB::bind_method(D_METHOD("get_relative"), &InputEventMouseMotion::get_relative); @@ -867,6 +879,7 @@ void InputEventMouseMotion::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "tilt"), "set_tilt", "get_tilt"); ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "pressure"), "set_pressure", "get_pressure"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "pen_inverted"), "set_pen_inverted", "get_pen_inverted"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "relative", PROPERTY_HINT_NONE, "suffix:px"), "set_relative", "get_relative"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "velocity", PROPERTY_HINT_NONE, "suffix:px/s"), "set_velocity", "get_velocity"); } diff --git a/core/input/input_event.h b/core/input/input_event.h index 114db46623..59a2df497c 100644 --- a/core/input/input_event.h +++ b/core/input/input_event.h @@ -272,6 +272,7 @@ class InputEventMouseMotion : public InputEventMouse { float pressure = 0; Vector2 relative; Vector2 velocity; + bool pen_inverted = false; protected: static void _bind_methods(); @@ -283,6 +284,9 @@ public: void set_pressure(float p_pressure); float get_pressure() const; + void set_pen_inverted(bool p_inverted); + bool get_pen_inverted() const; + void set_relative(const Vector2 &p_relative); Vector2 get_relative() const; diff --git a/core/io/dir_access.cpp b/core/io/dir_access.cpp index 433a7efb21..0a900078b7 100644 --- a/core/io/dir_access.cpp +++ b/core/io/dir_access.cpp @@ -181,6 +181,10 @@ Error DirAccess::make_dir_recursive(String p_dir) { return OK; } +DirAccess::AccessType DirAccess::get_access_type() const { + return _access_type; +} + String DirAccess::fix_path(String p_path) const { switch (_access_type) { case ACCESS_RESOURCES: { diff --git a/core/io/dir_access.h b/core/io/dir_access.h index 0125f011b5..22017efaa3 100644 --- a/core/io/dir_access.h +++ b/core/io/dir_access.h @@ -57,6 +57,7 @@ protected: String _get_root_path() const; String _get_root_string() const; + AccessType get_access_type() const; String fix_path(String p_path) const; template <class T> diff --git a/core/io/xml_parser.cpp b/core/io/xml_parser.cpp index 7b43193f47..154b55f5e7 100644 --- a/core/io/xml_parser.cpp +++ b/core/io/xml_parser.cpp @@ -72,11 +72,11 @@ void XMLParser::_parse_closing_xml_element() { node_empty = false; attributes.clear(); - ++P; + next_char(); const char *pBeginClose = P; while (*P && *P != '>') { - ++P; + next_char(); } node_name = String::utf8(pBeginClose, (int)(P - pBeginClose)); @@ -85,7 +85,7 @@ void XMLParser::_parse_closing_xml_element() { #endif if (*P) { - ++P; + next_char(); } } @@ -95,12 +95,12 @@ void XMLParser::_ignore_definition() { char *F = P; // move until end marked with '>' reached while (*P && *P != '>') { - ++P; + next_char(); } node_name.parse_utf8(F, P - F); if (*P) { - ++P; + next_char(); } } @@ -114,7 +114,7 @@ bool XMLParser::_parse_cdata() { // skip '<![CDATA[' int count = 0; while (*P && count < 8) { - ++P; + next_char(); ++count; } @@ -134,7 +134,7 @@ bool XMLParser::_parse_cdata() { cDataEnd = P - 2; } - ++P; + next_char(); } if (cDataEnd) { @@ -180,7 +180,7 @@ void XMLParser::_parse_comment() { } else if (*P == '<') { ++count; } - ++P; + next_char(); } if (count) { @@ -206,7 +206,7 @@ void XMLParser::_parse_opening_xml_element() { // find end of element while (*P && *P != '>' && !_is_white_space(*P)) { - ++P; + next_char(); } const char *endName = P; @@ -214,7 +214,7 @@ void XMLParser::_parse_opening_xml_element() { // find attributes while (*P && *P != '>') { if (_is_white_space(*P)) { - ++P; + next_char(); } else { if (*P != '/') { // we've got an attribute @@ -223,7 +223,7 @@ void XMLParser::_parse_opening_xml_element() { const char *attributeNameBegin = P; while (*P && !_is_white_space(*P) && *P != '=') { - ++P; + next_char(); } if (!*P) { @@ -231,12 +231,12 @@ void XMLParser::_parse_opening_xml_element() { } const char *attributeNameEnd = P; - ++P; + next_char(); // read the attribute value // check for quotes and single quotes, thx to murphy while ((*P != '\"') && (*P != '\'') && *P) { - ++P; + next_char(); } if (!*P) { // malformatted xml file @@ -245,16 +245,16 @@ void XMLParser::_parse_opening_xml_element() { const char attributeQuoteChar = *P; - ++P; + next_char(); const char *attributeValueBegin = P; while (*P != attributeQuoteChar && *P) { - ++P; + next_char(); } const char *attributeValueEnd = P; if (*P) { - ++P; + next_char(); } Attribute attr; @@ -268,7 +268,7 @@ void XMLParser::_parse_opening_xml_element() { attributes.push_back(attr); } else { // tag is closed directly - ++P; + next_char(); node_empty = true; break; } @@ -288,7 +288,7 @@ void XMLParser::_parse_opening_xml_element() { #endif if (*P) { - ++P; + next_char(); } } @@ -298,7 +298,7 @@ void XMLParser::_parse_current_node() { // more forward until '<' found while (*P != '<' && *P) { - ++P; + next_char(); } if (P - start > 0) { @@ -312,7 +312,7 @@ void XMLParser::_parse_current_node() { return; } - ++P; + next_char(); // based on current token, parse and report next element switch (*P) { @@ -487,6 +487,7 @@ Error XMLParser::open(const String &p_path) { file->get_buffer((uint8_t *)data, length); data[length] = 0; P = data; + current_line = 0; return OK; } @@ -523,10 +524,7 @@ void XMLParser::close() { } int XMLParser::get_current_line() const { - return 0; -} - -XMLParser::XMLParser() { + return current_line; } XMLParser::~XMLParser() { diff --git a/core/io/xml_parser.h b/core/io/xml_parser.h index da14ee8eae..aea252ddc7 100644 --- a/core/io/xml_parser.h +++ b/core/io/xml_parser.h @@ -68,6 +68,7 @@ private: char *data = nullptr; char *P = nullptr; uint64_t length = 0; + uint64_t current_line = 0; String node_name; bool node_empty = false; NodeType node_type = NODE_NONE; @@ -88,6 +89,13 @@ private: void _parse_opening_xml_element(); void _parse_current_node(); + _FORCE_INLINE_ void next_char() { + if (*P == '\n') { + current_line++; + } + P++; + } + static void _bind_methods(); public: @@ -113,7 +121,6 @@ public: void close(); - XMLParser(); ~XMLParser(); }; diff --git a/core/math/expression.cpp b/core/math/expression.cpp index 419056d7d6..e230b69dc9 100644 --- a/core/math/expression.cpp +++ b/core/math/expression.cpp @@ -891,7 +891,7 @@ Expression::ENode *Expression::_parse_expression() { case TK_PERIOD: { //named indexing or function call _get_token(tk); - if (tk.type != TK_IDENTIFIER) { + if (tk.type != TK_IDENTIFIER && tk.type != TK_BUILTIN_FUNC) { _set_error("Expected identifier after '.'"); return nullptr; } 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/templates/lru.h b/core/templates/lru.h index 48ba318b12..55130cbeb0 100644 --- a/core/templates/lru.h +++ b/core/templates/lru.h @@ -35,7 +35,7 @@ #include "hash_map.h" #include "list.h" -template <class TKey, class TData> +template <class TKey, class TData, class Hasher = HashMapHasherDefault, class Comparator = HashMapComparatorDefault<TKey>> class LRUCache { private: struct Pair { @@ -52,7 +52,7 @@ private: typedef typename List<Pair>::Element *Element; List<Pair> _list; - HashMap<TKey, Element> _map; + HashMap<TKey, Element, Hasher, Comparator> _map; size_t capacity; public: 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/CodeEdit.xml b/doc/classes/CodeEdit.xml index 7ca27a35fe..4994ef352e 100644 --- a/doc/classes/CodeEdit.xml +++ b/doc/classes/CodeEdit.xml @@ -592,6 +592,9 @@ <theme_item name="completion_scroll_color" data_type="color" type="Color" default="Color(1, 1, 1, 0.29)"> [Color] of the scrollbar in the code completion popup. </theme_item> + <theme_item name="completion_scroll_hovered_color" data_type="color" type="Color" default="Color(1, 1, 1, 0.4)"> + [Color] of the scrollbar in the code completion popup when hovered. + </theme_item> <theme_item name="completion_selected_color" data_type="color" type="Color" default="Color(0.26, 0.26, 0.27, 1)"> Background highlight [Color] for the current selected option item in the code completion popup. </theme_item> diff --git a/doc/classes/Decal.xml b/doc/classes/Decal.xml index c38e1d1499..861b4b480c 100644 --- a/doc/classes/Decal.xml +++ b/doc/classes/Decal.xml @@ -89,15 +89,19 @@ </member> <member name="texture_albedo" type="Texture2D" setter="set_texture" getter="get_texture"> [Texture2D] with the base [Color] of the Decal. Either this or the [member texture_emission] must be set for the Decal to be visible. Use the alpha channel like a mask to smoothly blend the edges of the decal with the underlying object. + [b]Note:[/b] Unlike [BaseMaterial3D] whose filter mode can be adjusted on a per-material basis, the filter mode for [Decal] textures is set globally with [member ProjectSettings.rendering/textures/decals/filter]. </member> <member name="texture_emission" type="Texture2D" setter="set_texture" getter="get_texture"> [Texture2D] with the emission [Color] of the Decal. Either this or the [member texture_emission] must be set for the Decal to be visible. Use the alpha channel like a mask to smoothly blend the edges of the decal with the underlying object. + [b]Note:[/b] Unlike [BaseMaterial3D] whose filter mode can be adjusted on a per-material basis, the filter mode for [Decal] textures is set globally with [member ProjectSettings.rendering/textures/decals/filter]. </member> <member name="texture_normal" type="Texture2D" setter="set_texture" getter="get_texture"> [Texture2D] with the per-pixel normal map for the decal. Use this to add extra detail to decals. + [b]Note:[/b] Unlike [BaseMaterial3D] whose filter mode can be adjusted on a per-material basis, the filter mode for [Decal] textures is set globally with [member ProjectSettings.rendering/textures/decals/filter]. </member> <member name="texture_orm" type="Texture2D" setter="set_texture" getter="get_texture"> [Texture2D] storing ambient occlusion, roughness, and metallic for the decal. Use this to add extra detail to decals. + [b]Note:[/b] Unlike [BaseMaterial3D] whose filter mode can be adjusted on a per-material basis, the filter mode for [Decal] textures is set globally with [member ProjectSettings.rendering/textures/decals/filter]. </member> <member name="upper_fade" type="float" setter="set_upper_fade" getter="get_upper_fade" default="0.3"> Sets the curve over which the decal will fade as the surface gets further from the center of the [AABB]. Only positive values are valid (negative values will be clamped to [code]0.0[/code]). diff --git a/doc/classes/InputEventMouseMotion.xml b/doc/classes/InputEventMouseMotion.xml index ad74204d82..83aad587a5 100644 --- a/doc/classes/InputEventMouseMotion.xml +++ b/doc/classes/InputEventMouseMotion.xml @@ -12,6 +12,10 @@ <link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/676</link> </tutorials> <members> + <member name="pen_inverted" type="bool" setter="set_pen_inverted" getter="get_pen_inverted" default="false"> + Returns [code]true[/code] when using the eraser end of a stylus pen. + [b]Note:[/b] This property is implemented on Linux, macOS and Windows. + </member> <member name="pressure" type="float" setter="set_pressure" getter="get_pressure" default="0.0"> Represents the pressure the user puts on the pen. Ranges from [code]0.0[/code] to [code]1.0[/code]. </member> diff --git a/doc/classes/Light3D.xml b/doc/classes/Light3D.xml index 4d8fd63257..0ebd83c882 100644 --- a/doc/classes/Light3D.xml +++ b/doc/classes/Light3D.xml @@ -73,6 +73,7 @@ </member> <member name="light_projector" type="Texture2D" setter="set_projector" getter="get_projector"> [Texture2D] projected by light. [member shadow_enabled] must be on for the projector to work. Light projectors make the light appear as if it is shining through a colored but transparent object, almost like light shining through stained-glass. + [b]Note:[/b] Unlike [BaseMaterial3D] whose filter mode can be adjusted on a per-material basis, the filter mode for light projector textures is set globally with [member ProjectSettings.rendering/textures/light_projectors/filter]. </member> <member name="light_size" type="float" setter="set_param" getter="get_param" default="0.0"> The size of the light in Godot units. Only available for [OmniLight3D]s and [SpotLight3D]s. Increasing this value will make the light fade out slower and shadows appear blurrier. This can be used to simulate area lights to an extent. 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/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/StyleBox.xml b/doc/classes/StyleBox.xml index 74d02a84fd..d863e3c652 100644 --- a/doc/classes/StyleBox.xml +++ b/doc/classes/StyleBox.xml @@ -46,8 +46,8 @@ <argument index="0" name="canvas_item" type="RID" /> <argument index="1" name="rect" type="Rect2" /> <description> - Draws this stylebox using a [CanvasItem] with given [RID]. - 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]. + 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 [RenderingServer] with [method RenderingServer.canvas_item_create]. </description> </method> <method name="get_center_size" qualifiers="const"> diff --git a/doc/classes/TextEdit.xml b/doc/classes/TextEdit.xml index 2de185903d..62a1be030d 100644 --- a/doc/classes/TextEdit.xml +++ b/doc/classes/TextEdit.xml @@ -998,13 +998,16 @@ <member name="placeholder_text" type="String" setter="set_placeholder" getter="get_placeholder" default=""""> Text shown when the [TextEdit] is empty. It is [b]not[/b] the [TextEdit]'s default value (see [member text]). </member> + <member name="scroll_fit_content_height" type="bool" setter="set_fit_content_height_enabled" getter="is_fit_content_height_enabled" default="false"> + If [code]true[/code], [TextEdit] will disable vertical scroll and fit minimum height to the number of visible lines. + </member> <member name="scroll_horizontal" type="int" setter="set_h_scroll" getter="get_h_scroll" default="0"> If there is a horizontal scrollbar, this determines the current horizontal scroll value in pixels. </member> <member name="scroll_past_end_of_file" type="bool" setter="set_scroll_past_end_of_file_enabled" getter="is_scroll_past_end_of_file_enabled" default="false"> Allow scrolling past the last line into "virtual" space. </member> - <member name="scroll_smooth" type="bool" setter="set_smooth_scroll_enable" getter="is_smooth_scroll_enabled" default="false"> + <member name="scroll_smooth" type="bool" setter="set_smooth_scroll_enabled" getter="is_smooth_scroll_enabled" default="false"> Scroll smoothly over the text rather then jumping to the next location. </member> <member name="scroll_v_scroll_speed" type="float" setter="set_v_scroll_speed" getter="get_v_scroll_speed" default="80.0"> 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/classes/VoxelGI.xml b/doc/classes/VoxelGI.xml index 55ba1c4934..d941185d33 100644 --- a/doc/classes/VoxelGI.xml +++ b/doc/classes/VoxelGI.xml @@ -37,6 +37,7 @@ </member> <member name="extents" type="Vector3" setter="set_extents" getter="get_extents" default="Vector3(10, 10, 10)"> The size of the area covered by the [VoxelGI]. If you make the extents larger without increasing the subdivisions with [member subdiv], the size of each cell will increase and result in lower detailed lighting. + [b]Note:[/b] Extents are clamped to 1.0 unit or more on each axis. </member> <member name="subdiv" type="int" setter="set_subdiv" getter="get_subdiv" enum="VoxelGI.Subdiv" default="1"> Number of times to subdivide the grid that the [VoxelGI] operates on. A higher number results in finer detail and thus higher visual quality, while lower numbers result in better performance. diff --git a/doc/classes/XMLParser.xml b/doc/classes/XMLParser.xml index c40a07c40a..79ab33045f 100644 --- a/doc/classes/XMLParser.xml +++ b/doc/classes/XMLParser.xml @@ -32,7 +32,7 @@ <method name="get_current_line" qualifiers="const"> <return type="int" /> <description> - Gets the current line in the parsed file (currently not implemented). + Gets the current line in the parsed file, counting from 0. </description> </method> <method name="get_named_attribute_value" qualifiers="const"> 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/drivers/gles3/environment/fog.h b/drivers/gles3/environment/fog.h new file mode 100644 index 0000000000..22bf3bb017 --- /dev/null +++ b/drivers/gles3/environment/fog.h @@ -0,0 +1,62 @@ +/*************************************************************************/ +/* 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_GLES3_H +#define FOG_GLES3_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/environment/renderer_fog.h" + +namespace GLES3 { + +class Fog : public RendererFog { +public: + /* FOG VOLUMES */ + + virtual RID fog_volume_allocate() override; + 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; + virtual RS::FogVolumeShape fog_volume_get_shape(RID p_fog_volume) const override; +}; + +} // namespace GLES3 + +#endif // GLES3_ENABLED + +#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..b042e53116 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; @@ -72,7 +72,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 +268,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 +314,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 +335,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 +346,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 +504,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 +553,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 +899,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 +926,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 +950,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 +1348,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 +1363,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 +1439,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 +1493,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 +1542,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 7e6105f033..c4b42806fd 100644 --- a/drivers/unix/dir_access_unix.cpp +++ b/drivers/unix/dir_access_unix.cpp @@ -33,6 +33,7 @@ #if defined(UNIX_ENABLED) || defined(LIBC_FILEIO_ENABLED) #include "core/os/memory.h" +#include "core/os/os.h" #include "core/string/print_string.h" #include "core/templates/list.h" @@ -49,10 +50,6 @@ #include <mntent.h> #endif -Ref<DirAccess> DirAccessUnix::create_fs() { - return memnew(DirAccessUnix); -} - Error DirAccessUnix::list_dir_begin() { list_dir_end(); //close any previous dir opening! @@ -216,10 +213,11 @@ static bool _filter_drive(struct mntent *mnt) { #endif static void _get_drives(List<String> *list) { + // Add root. list->push_back("/"); #if defined(HAVE_MNTENT) && defined(X11_ENABLED) - // Check /etc/mtab for the list of mounted partitions + // Check /etc/mtab for the list of mounted partitions. FILE *mtab = setmntent("/etc/mtab", "r"); if (mtab) { struct mntent mnt; @@ -239,7 +237,7 @@ static void _get_drives(List<String> *list) { } #endif - // Add $HOME + // Add $HOME. const char *home = getenv("HOME"); if (home) { // Only add if it's not a duplicate @@ -248,7 +246,8 @@ static void _get_drives(List<String> *list) { list->push_back(home_name); } - // Check $HOME/.config/gtk-3.0/bookmarks + // Check GTK+3 bookmarks for both XDG locations (Documents, Downloads, etc.) + // and potential user-defined bookmarks. char path[1024]; snprintf(path, 1024, "%s/.config/gtk-3.0/bookmarks", home); FILE *fd = fopen(path, "r"); @@ -257,7 +256,7 @@ static void _get_drives(List<String> *list) { while (fgets(string, 1024, fd)) { // Parse only file:// links if (strncmp(string, "file://", 7) == 0) { - // Strip any unwanted edges on the strings and push_back if it's not a duplicate + // Strip any unwanted edges on the strings and push_back if it's not a duplicate. String fpath = String::utf8(string + 7).strip_edges().split_spaces()[0].uri_decode(); if (!list->find(fpath)) { list->push_back(fpath); @@ -267,6 +266,12 @@ static void _get_drives(List<String> *list) { fclose(fd); } + + // Add Desktop dir. + String dpath = OS::get_singleton()->get_system_dir(OS::SystemDir::SYSTEM_DIR_DESKTOP); + if (dpath.length() > 0 && !list->find(dpath)) { + list->push_back(dpath); + } } list->sort(); diff --git a/drivers/unix/dir_access_unix.h b/drivers/unix/dir_access_unix.h index 69530de337..5e2129b74a 100644 --- a/drivers/unix/dir_access_unix.h +++ b/drivers/unix/dir_access_unix.h @@ -43,13 +43,11 @@ class DirAccessUnix : public DirAccess { DIR *dir_stream = nullptr; - static Ref<DirAccess> create_fs(); - - String current_dir; bool _cisdir = false; bool _cishidden = false; protected: + String current_dir; virtual String fix_unicode_name(const char *p_name) const { return String::utf8(p_name); } virtual bool is_hidden(const String &p_name); diff --git a/drivers/unix/file_access_unix.cpp b/drivers/unix/file_access_unix.cpp index e0b2994b63..99836b7bea 100644 --- a/drivers/unix/file_access_unix.cpp +++ b/drivers/unix/file_access_unix.cpp @@ -333,10 +333,6 @@ Error FileAccessUnix::_set_unix_permissions(const String &p_file, uint32_t p_per return FAILED; } -Ref<FileAccess> FileAccessUnix::create_libc() { - return memnew(FileAccessUnix); -} - CloseNotificationFunc FileAccessUnix::close_notification_func = nullptr; FileAccessUnix::~FileAccessUnix() { diff --git a/drivers/unix/file_access_unix.h b/drivers/unix/file_access_unix.h index 4340bbbc82..0261b8be53 100644 --- a/drivers/unix/file_access_unix.h +++ b/drivers/unix/file_access_unix.h @@ -49,7 +49,6 @@ class FileAccessUnix : public FileAccess { String path; String path_src; - static Ref<FileAccess> create_libc(); void _close(); public: 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_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_file_dialog.cpp b/editor/editor_file_dialog.cpp index 95f72476aa..af1345b205 100644 --- a/editor/editor_file_dialog.cpp +++ b/editor/editor_file_dialog.cpp @@ -731,9 +731,9 @@ void EditorFileDialog::update_file_name() { String base_name = file_str.get_basename(); Vector<String> filter_substr = filter_str.split(";"); if (filter_substr.size() >= 2) { - file_str = base_name + "." + filter_substr[0].strip_edges().lstrip("*.").to_lower(); + file_str = base_name + "." + filter_substr[0].strip_edges().get_extension().to_lower(); } else { - file_str = base_name + "." + filter_str.get_extension().strip_edges().to_lower(); + file_str = base_name + "." + filter_str.strip_edges().get_extension().to_lower(); } file->set_text(file_str); } diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp index 36360954d9..48d4b96a67 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; @@ -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_properties.cpp b/editor/editor_properties.cpp index 70622e85ff..6a035225e5 100644 --- a/editor/editor_properties.cpp +++ b/editor/editor_properties.cpp @@ -3175,7 +3175,20 @@ bool EditorPropertyNodePath::is_drop_valid(const Dictionary &p_drag_data) const return false; } Array nodes = p_drag_data["nodes"]; - return nodes.size() == 1; + if (nodes.size() != 1) { + return false; + } + + Node *dropped_node = get_tree()->get_edited_scene_root()->get_node(nodes[0]); + ERR_FAIL_NULL_V(dropped_node, false); + + for (const StringName &E : valid_types) { + if (dropped_node->is_class(E)) { + return true; + } + } + + return false; } void EditorPropertyNodePath::update_property() { diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp index ad9c547693..fbdc1c0a0c 100644 --- a/editor/editor_settings.cpp +++ b/editor/editor_settings.cpp @@ -763,6 +763,7 @@ void EditorSettings::_load_godot2_text_editor_theme() { _initial_set("text_editor/theme/highlighting/completion_selected_color", Color(0.26, 0.26, 0.27)); _initial_set("text_editor/theme/highlighting/completion_existing_color", Color(0.87, 0.87, 0.87, 0.13)); _initial_set("text_editor/theme/highlighting/completion_scroll_color", Color(1, 1, 1, 0.29)); + _initial_set("text_editor/theme/highlighting/completion_scroll_hovered_color", Color(1, 1, 1, 0.4)); _initial_set("text_editor/theme/highlighting/completion_font_color", Color(0.67, 0.67, 0.67)); _initial_set("text_editor/theme/highlighting/text_color", Color(0.67, 0.67, 0.67)); _initial_set("text_editor/theme/highlighting/line_number_color", Color(0.67, 0.67, 0.67, 0.4)); diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp index 10412eac41..82c1d278b7 100644 --- a/editor/editor_themes.cpp +++ b/editor/editor_themes.cpp @@ -1683,6 +1683,7 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { const Color completion_existing_color = alpha2; // Same opacity as the scroll grabber editor icon. const Color completion_scroll_color = Color(mono_value, mono_value, mono_value, 0.29); + const Color completion_scroll_hovered_color = Color(mono_value, mono_value, mono_value, 0.4); const Color completion_font_color = font_color; const Color text_color = font_color; const Color line_number_color = dim_color; @@ -1721,6 +1722,7 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { setting->set_initial_value("text_editor/theme/highlighting/completion_selected_color", completion_selected_color, true); setting->set_initial_value("text_editor/theme/highlighting/completion_existing_color", completion_existing_color, true); setting->set_initial_value("text_editor/theme/highlighting/completion_scroll_color", completion_scroll_color, true); + setting->set_initial_value("text_editor/theme/highlighting/completion_scroll_hovered_color", completion_scroll_hovered_color, true); setting->set_initial_value("text_editor/theme/highlighting/completion_font_color", completion_font_color, true); setting->set_initial_value("text_editor/theme/highlighting/text_color", text_color, true); setting->set_initial_value("text_editor/theme/highlighting/line_number_color", line_number_color, true); @@ -1766,6 +1768,7 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { theme->set_color("completion_selected_color", "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/completion_selected_color")); theme->set_color("completion_existing_color", "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/completion_existing_color")); theme->set_color("completion_scroll_color", "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/completion_scroll_color")); + theme->set_color("completion_scroll_hovered_color", "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/completion_scroll_hovered_color")); theme->set_color("completion_font_color", "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/completion_font_color")); theme->set_color("font_color", "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/text_color")); theme->set_color("line_number_color", "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/line_number_color")); diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index dea4aaded7..22788913d4 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -813,9 +813,17 @@ Vector2 CanvasItemEditor::_position_to_anchor(const Control *p_control, Vector2 } void CanvasItemEditor::_save_canvas_item_state(List<CanvasItem *> p_canvas_items, bool save_bones) { + original_transform = Transform2D(); + bool transform_stored = false; + for (CanvasItem *canvas_item : p_canvas_items) { CanvasItemEditorSelectedItem *se = editor_selection->get_node_editor_data<CanvasItemEditorSelectedItem>(canvas_item); if (se) { + if (!transform_stored) { + original_transform = canvas_item->get_global_transform(); + transform_stored = true; + } + se->undo_state = canvas_item->_edit_get_state(); se->pre_drag_xform = canvas_item->get_global_transform_with_canvas(); if (canvas_item->_edit_use_rect()) { @@ -3624,6 +3632,67 @@ void CanvasItemEditor::_draw_hover() { } } +void CanvasItemEditor::_draw_transform_message() { + if (drag_selection.is_empty() || !drag_selection.front()->get()) { + return; + } + String transform_message; + Transform2D current_transform = drag_selection.front()->get()->get_global_transform(); + + double snap = EDITOR_GET("interface/inspector/default_float_step"); + int snap_step_decimals = Math::range_step_decimals(snap); +#define FORMAT(value) (TS->format_number(String::num(value, snap_step_decimals))) + + switch (drag_type) { + case DRAG_MOVE: + case DRAG_MOVE_X: + case DRAG_MOVE_Y: { + Vector2 delta = current_transform.get_origin() - original_transform.get_origin(); + if (drag_type == DRAG_MOVE) { + transform_message = TTR("Moving:") + " (" + FORMAT(delta.x) + ", " + FORMAT(delta.y) + ") px"; + } else if (drag_type == DRAG_MOVE_X) { + transform_message = TTR("Moving:") + " " + FORMAT(delta.x) + " px"; + } else if (drag_type == DRAG_MOVE_Y) { + transform_message = TTR("Moving:") + " " + FORMAT(delta.y) + " px"; + } + } break; + + case DRAG_ROTATE: { + real_t delta = Math::rad2deg(current_transform.get_rotation() - original_transform.get_rotation()); + transform_message = TTR("Rotating:") + " " + FORMAT(delta) + String::utf8(" °"); + } break; + + case DRAG_SCALE_X: + case DRAG_SCALE_Y: + case DRAG_SCALE_BOTH: { + Vector2 original_scale = (Math::is_zero_approx(original_transform.get_scale().x) || Math::is_zero_approx(original_transform.get_scale().y)) ? Vector2(CMP_EPSILON, CMP_EPSILON) : original_transform.get_scale(); + Vector2 delta = current_transform.get_scale() / original_scale; + if (drag_type == DRAG_SCALE_BOTH) { + transform_message = TTR("Scaling:") + String::utf8(" ×(") + FORMAT(delta.x) + ", " + FORMAT(delta.y) + ")"; + } else if (drag_type == DRAG_SCALE_X) { + transform_message = TTR("Scaling:") + String::utf8(" ×") + FORMAT(delta.x); + } else if (drag_type == DRAG_SCALE_Y) { + transform_message = TTR("Scaling:") + String::utf8(" ×") + FORMAT(delta.y); + } + } break; + + default: + break; + } +#undef FORMAT + + if (transform_message.is_empty()) { + return; + } + + Ref<Font> font = get_theme_font(SNAME("font"), SNAME("Label")); + int font_size = get_theme_font_size(SNAME("font_size"), SNAME("Label")); + Point2 msgpos = Point2(RULER_WIDTH + 5 * EDSCALE, viewport->get_size().y - 20 * EDSCALE); + viewport->draw_string(font, msgpos + Point2(1, 1), transform_message, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, Color(0, 0, 0, 0.8)); + viewport->draw_string(font, msgpos + Point2(-1, -1), transform_message, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, Color(0, 0, 0, 0.8)); + viewport->draw_string(font, msgpos, transform_message, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, Color(1, 1, 1, 1)); +} + void CanvasItemEditor::_draw_locks_and_groups(Node *p_node, const Transform2D &p_parent_xform, const Transform2D &p_canvas_xform) { ERR_FAIL_COND(!p_node); @@ -3735,6 +3804,7 @@ void CanvasItemEditor::_draw_viewport() { _draw_smart_snapping(); _draw_focus(); _draw_hover(); + _draw_transform_message(); } void CanvasItemEditor::update_viewport() { diff --git a/editor/plugins/canvas_item_editor_plugin.h b/editor/plugins/canvas_item_editor_plugin.h index c20a054800..5f50882dba 100644 --- a/editor/plugins/canvas_item_editor_plugin.h +++ b/editor/plugins/canvas_item_editor_plugin.h @@ -347,6 +347,7 @@ private: bool is_hovering_v_guide = false; bool updating_value_dialog = false; + Transform2D original_transform; Point2 box_selecting_to; @@ -433,6 +434,7 @@ private: void _draw_invisible_nodes_positions(Node *p_node, const Transform2D &p_parent_xform = Transform2D(), const Transform2D &p_canvas_xform = Transform2D()); void _draw_locks_and_groups(Node *p_node, const Transform2D &p_parent_xform = Transform2D(), const Transform2D &p_canvas_xform = Transform2D()); void _draw_hover(); + void _draw_transform_message(); void _draw_viewport(); diff --git a/editor/plugins/curve_editor_plugin.cpp b/editor/plugins/curve_editor_plugin.cpp index 6d1a86765a..654c92c532 100644 --- a/editor/plugins/curve_editor_plugin.cpp +++ b/editor/plugins/curve_editor_plugin.cpp @@ -751,12 +751,13 @@ void CurveEditor::_draw() { // Help text + float width = view_size.x - 60 * EDSCALE; if (_selected_point > 0 && _selected_point + 1 < curve.get_point_count()) { text_color.a *= 0.4; - draw_string(font, Vector2(50 * EDSCALE, font_height), TTR("Hold Shift to edit tangents individually"), HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, text_color); + draw_multiline_string(font, Vector2(50 * EDSCALE, font_height), TTR("Hold Shift to edit tangents individually"), HORIZONTAL_ALIGNMENT_LEFT, width, -1, font_size, text_color); } else if (curve.get_point_count() == 0) { text_color.a *= 0.4; - draw_string(font, Vector2(50 * EDSCALE, font_height), TTR("Right click to add point"), HORIZONTAL_ALIGNMENT_LEFT, -1, font_size, text_color); + draw_multiline_string(font, Vector2(50 * EDSCALE, font_height), TTR("Right click to add point"), HORIZONTAL_ALIGNMENT_LEFT, width, -1, font_size, text_color); } } diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp index b6bec79375..7730f7f294 100644 --- a/editor/plugins/node_3d_editor_plugin.cpp +++ b/editor/plugins/node_3d_editor_plugin.cpp @@ -4522,6 +4522,7 @@ Node3DEditorViewport::Node3DEditorViewport(Node3DEditor *p_spatial_editor, int p vbox->add_child(view_menu); display_submenu = memnew(PopupMenu); + view_menu->get_popup()->set_hide_on_checkable_item_selection(false); view_menu->get_popup()->add_child(display_submenu); view_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("spatial_editor/top_view"), VIEW_TOP); @@ -4545,6 +4546,7 @@ Node3DEditorViewport::Node3DEditorViewport(Node3DEditor *p_spatial_editor, int p view_menu->get_popup()->add_radio_check_shortcut(ED_SHORTCUT("spatial_editor/view_display_lighting", TTR("Display Lighting")), VIEW_DISPLAY_LIGHTING); view_menu->get_popup()->add_radio_check_shortcut(ED_SHORTCUT("spatial_editor/view_display_unshaded", TTR("Display Unshaded")), VIEW_DISPLAY_SHADELESS); view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(VIEW_DISPLAY_NORMAL), true); + display_submenu->set_hide_on_checkable_item_selection(false); display_submenu->add_radio_check_item(TTR("Directional Shadow Splits"), VIEW_DISPLAY_DEBUG_PSSM_SPLITS); display_submenu->add_separator(); display_submenu->add_radio_check_item(TTR("Normal Buffer"), VIEW_DISPLAY_NORMAL_BUFFER); @@ -4700,7 +4702,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/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/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大å°å¿…é ˆå¤§æ–¼ï¼ä»¥æ¸²æŸ“任何æ±è¥¿ã€‚" #: 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/modules/gdscript/doc_classes/@GDScript.xml b/modules/gdscript/doc_classes/@GDScript.xml index 70151c4d21..e672ea6454 100644 --- a/modules/gdscript/doc_classes/@GDScript.xml +++ b/modules/gdscript/doc_classes/@GDScript.xml @@ -257,4 +257,145 @@ [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_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_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="@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.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_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 0dd990d135..8479884154 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; } @@ -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..11fa7575d8 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; } @@ -3662,6 +3691,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 +4204,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/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/csharp_script.h b/modules/mono/csharp_script.h index 69bd8703aa..91b14ba108 100644 --- a/modules/mono/csharp_script.h +++ b/modules/mono/csharp_script.h @@ -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/bindings_generator.cpp b/modules/mono/editor/bindings_generator.cpp index 9d3d481068..4ee774c3bd 100644 --- a/modules/mono/editor/bindings_generator.cpp +++ b/modules/mono/editor/bindings_generator.cpp @@ -2865,7 +2865,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 +2903,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 +3011,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 +3075,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 +3087,7 @@ 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; + 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); 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/SCsub b/modules/text_server_adv/SCsub index a46f17311a..2d764a4006 100644 --- a/modules/text_server_adv/SCsub +++ b/modules/text_server_adv/SCsub @@ -75,18 +75,18 @@ if env["builtin_harfbuzz"]: "src/hb-ot-meta.cc", "src/hb-ot-metrics.cc", "src/hb-ot-name.cc", - "src/hb-ot-shape-complex-arabic.cc", - "src/hb-ot-shape-complex-default.cc", - "src/hb-ot-shape-complex-hangul.cc", - "src/hb-ot-shape-complex-hebrew.cc", - "src/hb-ot-shape-complex-indic-table.cc", - "src/hb-ot-shape-complex-indic.cc", - "src/hb-ot-shape-complex-khmer.cc", - "src/hb-ot-shape-complex-myanmar.cc", - "src/hb-ot-shape-complex-syllabic.cc", - "src/hb-ot-shape-complex-thai.cc", - "src/hb-ot-shape-complex-use.cc", - "src/hb-ot-shape-complex-vowel-constraints.cc", + "src/hb-ot-shaper-arabic.cc", + "src/hb-ot-shaper-default.cc", + "src/hb-ot-shaper-hangul.cc", + "src/hb-ot-shaper-hebrew.cc", + "src/hb-ot-shaper-indic-table.cc", + "src/hb-ot-shaper-indic.cc", + "src/hb-ot-shaper-khmer.cc", + "src/hb-ot-shaper-myanmar.cc", + "src/hb-ot-shaper-syllabic.cc", + "src/hb-ot-shaper-thai.cc", + "src/hb-ot-shaper-use.cc", + "src/hb-ot-shaper-vowel-constraints.cc", "src/hb-ot-shape-fallback.cc", "src/hb-ot-shape-normalize.cc", "src/hb-ot-shape.cc", diff --git a/modules/text_server_adv/gdextension_build/SConstruct b/modules/text_server_adv/gdextension_build/SConstruct index 0e36ef6805..69848a9e52 100644 --- a/modules/text_server_adv/gdextension_build/SConstruct +++ b/modules/text_server_adv/gdextension_build/SConstruct @@ -220,18 +220,18 @@ thirdparty_harfbuzz_sources = [ "src/hb-ot-meta.cc", "src/hb-ot-metrics.cc", "src/hb-ot-name.cc", - "src/hb-ot-shape-complex-arabic.cc", - "src/hb-ot-shape-complex-default.cc", - "src/hb-ot-shape-complex-hangul.cc", - "src/hb-ot-shape-complex-hebrew.cc", - "src/hb-ot-shape-complex-indic-table.cc", - "src/hb-ot-shape-complex-indic.cc", - "src/hb-ot-shape-complex-khmer.cc", - "src/hb-ot-shape-complex-myanmar.cc", - "src/hb-ot-shape-complex-syllabic.cc", - "src/hb-ot-shape-complex-thai.cc", - "src/hb-ot-shape-complex-use.cc", - "src/hb-ot-shape-complex-vowel-constraints.cc", + "src/hb-ot-shaper-arabic.cc", + "src/hb-ot-shaper-default.cc", + "src/hb-ot-shaper-hangul.cc", + "src/hb-ot-shaper-hebrew.cc", + "src/hb-ot-shaper-indic-table.cc", + "src/hb-ot-shaper-indic.cc", + "src/hb-ot-shaper-khmer.cc", + "src/hb-ot-shaper-myanmar.cc", + "src/hb-ot-shaper-syllabic.cc", + "src/hb-ot-shaper-thai.cc", + "src/hb-ot-shaper-use.cc", + "src/hb-ot-shaper-vowel-constraints.cc", "src/hb-ot-shape-fallback.cc", "src/hb-ot-shape-normalize.cc", "src/hb-ot-shape.cc", 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/SCsub b/platform/android/SCsub index ad226255bc..d370a4d18d 100644 --- a/platform/android/SCsub +++ b/platform/android/SCsub @@ -6,6 +6,7 @@ android_files = [ "os_android.cpp", "android_input_handler.cpp", "file_access_android.cpp", + "file_access_filesystem_jandroid.cpp", "audio_driver_opensl.cpp", "dir_access_jandroid.cpp", "tts_android.cpp", diff --git a/platform/android/dir_access_jandroid.cpp b/platform/android/dir_access_jandroid.cpp index 5b9eee8117..eb344d3b43 100644 --- a/platform/android/dir_access_jandroid.cpp +++ b/platform/android/dir_access_jandroid.cpp @@ -31,30 +31,32 @@ #include "dir_access_jandroid.h" #include "core/string/print_string.h" -#include "file_access_android.h" #include "string_android.h" #include "thread_jandroid.h" -jobject DirAccessJAndroid::io = nullptr; +jobject DirAccessJAndroid::dir_access_handler = nullptr; jclass DirAccessJAndroid::cls = nullptr; jmethodID DirAccessJAndroid::_dir_open = nullptr; jmethodID DirAccessJAndroid::_dir_next = nullptr; jmethodID DirAccessJAndroid::_dir_close = nullptr; jmethodID DirAccessJAndroid::_dir_is_dir = nullptr; - -Ref<DirAccess> DirAccessJAndroid::create_fs() { - return memnew(DirAccessJAndroid); -} +jmethodID DirAccessJAndroid::_dir_exists = nullptr; +jmethodID DirAccessJAndroid::_file_exists = nullptr; +jmethodID DirAccessJAndroid::_get_drive_count = nullptr; +jmethodID DirAccessJAndroid::_get_drive = nullptr; +jmethodID DirAccessJAndroid::_make_dir = nullptr; +jmethodID DirAccessJAndroid::_get_space_left = nullptr; +jmethodID DirAccessJAndroid::_rename = nullptr; +jmethodID DirAccessJAndroid::_remove = nullptr; +jmethodID DirAccessJAndroid::_current_is_hidden = nullptr; Error DirAccessJAndroid::list_dir_begin() { list_dir_end(); - JNIEnv *env = get_jni_env(); - - jstring js = env->NewStringUTF(current_dir.utf8().get_data()); - int res = env->CallIntMethod(io, _dir_open, js); + int res = dir_open(current_dir); if (res <= 0) { return ERR_CANT_OPEN; } + id = res; return OK; @@ -62,169 +64,236 @@ Error DirAccessJAndroid::list_dir_begin() { String DirAccessJAndroid::get_next() { ERR_FAIL_COND_V(id == 0, ""); + if (_dir_next) { + JNIEnv *env = get_jni_env(); + ERR_FAIL_COND_V(env == nullptr, ""); + jstring str = (jstring)env->CallObjectMethod(dir_access_handler, _dir_next, get_access_type(), id); + if (!str) { + return ""; + } - JNIEnv *env = get_jni_env(); - jstring str = (jstring)env->CallObjectMethod(io, _dir_next, id); - if (!str) { + String ret = jstring_to_string((jstring)str, env); + env->DeleteLocalRef((jobject)str); + return ret; + } else { return ""; } - String ret = jstring_to_string((jstring)str, env); - env->DeleteLocalRef((jobject)str); - return ret; } bool DirAccessJAndroid::current_is_dir() const { - JNIEnv *env = get_jni_env(); - - return env->CallBooleanMethod(io, _dir_is_dir, id); + if (_dir_is_dir) { + JNIEnv *env = get_jni_env(); + ERR_FAIL_COND_V(env == nullptr, false); + return env->CallBooleanMethod(dir_access_handler, _dir_is_dir, get_access_type(), id); + } else { + return false; + } } bool DirAccessJAndroid::current_is_hidden() const { - return current != "." && current != ".." && current.begins_with("."); + if (_current_is_hidden) { + JNIEnv *env = get_jni_env(); + ERR_FAIL_COND_V(env == nullptr, false); + return env->CallBooleanMethod(dir_access_handler, _current_is_hidden, get_access_type(), id); + } + return false; } void DirAccessJAndroid::list_dir_end() { if (id == 0) { return; } - JNIEnv *env = get_jni_env(); - env->CallVoidMethod(io, _dir_close, id); + + dir_close(id); id = 0; } int DirAccessJAndroid::get_drive_count() { - return 0; + if (_get_drive_count) { + JNIEnv *env = get_jni_env(); + ERR_FAIL_COND_V(env == nullptr, 0); + return env->CallIntMethod(dir_access_handler, _get_drive_count, get_access_type()); + } else { + return 0; + } } String DirAccessJAndroid::get_drive(int p_drive) { - return ""; + if (_get_drive) { + JNIEnv *env = get_jni_env(); + ERR_FAIL_COND_V(env == nullptr, ""); + jstring j_drive = (jstring)env->CallObjectMethod(dir_access_handler, _get_drive, get_access_type(), p_drive); + if (!j_drive) { + return ""; + } + + String drive = jstring_to_string(j_drive, env); + env->DeleteLocalRef(j_drive); + return drive; + } else { + return ""; + } } Error DirAccessJAndroid::change_dir(String p_dir) { - JNIEnv *env = get_jni_env(); - - if (p_dir.is_empty() || p_dir == "." || (p_dir == ".." && current_dir.is_empty())) { + String new_dir = get_absolute_path(p_dir); + if (new_dir == current_dir) { return OK; } - String new_dir; - - if (p_dir != "res://" && p_dir.length() > 1 && p_dir.ends_with("/")) { - p_dir = p_dir.substr(0, p_dir.length() - 1); - } - - if (p_dir.begins_with("/")) { - new_dir = p_dir.substr(1, p_dir.length()); - } else if (p_dir.begins_with("res://")) { - new_dir = p_dir.substr(6, p_dir.length()); - } else if (current_dir.is_empty()) { - new_dir = p_dir; - } else { - new_dir = current_dir.plus_file(p_dir); - } - - //test if newdir exists - new_dir = new_dir.simplify_path(); - - jstring js = env->NewStringUTF(new_dir.utf8().get_data()); - int res = env->CallIntMethod(io, _dir_open, js); - env->DeleteLocalRef(js); - if (res <= 0) { + if (!dir_exists(new_dir)) { return ERR_INVALID_PARAMETER; } - env->CallVoidMethod(io, _dir_close, res); - current_dir = new_dir; - return OK; } -String DirAccessJAndroid::get_current_dir(bool p_include_drive) const { - return "res://" + current_dir; +String DirAccessJAndroid::get_absolute_path(String p_path) { + if (current_dir != "" && p_path == current_dir) { + return current_dir; + } + + if (p_path.is_relative_path()) { + p_path = get_current_dir().plus_file(p_path); + } + + p_path = fix_path(p_path); + p_path = p_path.simplify_path(); + return p_path; } bool DirAccessJAndroid::file_exists(String p_file) { - String sd; - if (current_dir.is_empty()) { - sd = p_file; + if (_file_exists) { + JNIEnv *env = get_jni_env(); + ERR_FAIL_COND_V(env == nullptr, false); + + String path = get_absolute_path(p_file); + jstring j_path = env->NewStringUTF(path.utf8().get_data()); + bool result = env->CallBooleanMethod(dir_access_handler, _file_exists, get_access_type(), j_path); + env->DeleteLocalRef(j_path); + return result; } else { - sd = current_dir.plus_file(p_file); + return false; } - - Ref<FileAccessAndroid> f; - f.instantiate(); - bool exists = f->file_exists(sd); - - return exists; } bool DirAccessJAndroid::dir_exists(String p_dir) { - JNIEnv *env = get_jni_env(); - - String sd; - - if (current_dir.is_empty()) { - sd = p_dir; + if (_dir_exists) { + JNIEnv *env = get_jni_env(); + ERR_FAIL_COND_V(env == nullptr, false); + + String path = get_absolute_path(p_dir); + jstring j_path = env->NewStringUTF(path.utf8().get_data()); + bool result = env->CallBooleanMethod(dir_access_handler, _dir_exists, get_access_type(), j_path); + env->DeleteLocalRef(j_path); + return result; } else { - if (p_dir.is_relative_path()) { - sd = current_dir.plus_file(p_dir); - } else { - sd = fix_path(p_dir); - } - } - - String path = sd.simplify_path(); - - if (path.begins_with("/")) { - path = path.substr(1, path.length()); - } else if (path.begins_with("res://")) { - path = path.substr(6, path.length()); + return false; } +} - jstring js = env->NewStringUTF(path.utf8().get_data()); - int res = env->CallIntMethod(io, _dir_open, js); - env->DeleteLocalRef(js); - if (res <= 0) { - return false; +Error DirAccessJAndroid::make_dir_recursive(String p_dir) { + // Check if the directory exists already + if (dir_exists(p_dir)) { + return ERR_ALREADY_EXISTS; } - env->CallVoidMethod(io, _dir_close, res); + if (_make_dir) { + JNIEnv *env = get_jni_env(); + ERR_FAIL_COND_V(env == nullptr, ERR_UNCONFIGURED); - return true; + String path = get_absolute_path(p_dir); + jstring j_dir = env->NewStringUTF(path.utf8().get_data()); + bool result = env->CallBooleanMethod(dir_access_handler, _make_dir, get_access_type(), j_dir); + env->DeleteLocalRef(j_dir); + if (result) { + return OK; + } else { + return FAILED; + } + } else { + return ERR_UNCONFIGURED; + } } Error DirAccessJAndroid::make_dir(String p_dir) { - ERR_FAIL_V(ERR_UNAVAILABLE); + return make_dir_recursive(p_dir); } Error DirAccessJAndroid::rename(String p_from, String p_to) { - ERR_FAIL_V(ERR_UNAVAILABLE); -} + if (_rename) { + JNIEnv *env = get_jni_env(); + ERR_FAIL_COND_V(env == nullptr, ERR_UNCONFIGURED); -Error DirAccessJAndroid::remove(String p_name) { - ERR_FAIL_V(ERR_UNAVAILABLE); + String from_path = get_absolute_path(p_from); + jstring j_from = env->NewStringUTF(from_path.utf8().get_data()); + + String to_path = get_absolute_path(p_to); + jstring j_to = env->NewStringUTF(to_path.utf8().get_data()); + + bool result = env->CallBooleanMethod(dir_access_handler, _rename, get_access_type(), j_from, j_to); + env->DeleteLocalRef(j_from); + env->DeleteLocalRef(j_to); + if (result) { + return OK; + } else { + return FAILED; + } + } else { + return ERR_UNCONFIGURED; + } } -String DirAccessJAndroid::get_filesystem_type() const { - return "APK"; +Error DirAccessJAndroid::remove(String p_name) { + if (_remove) { + JNIEnv *env = get_jni_env(); + ERR_FAIL_COND_V(env == nullptr, ERR_UNCONFIGURED); + + String path = get_absolute_path(p_name); + jstring j_name = env->NewStringUTF(path.utf8().get_data()); + bool result = env->CallBooleanMethod(dir_access_handler, _remove, get_access_type(), j_name); + env->DeleteLocalRef(j_name); + if (result) { + return OK; + } else { + return FAILED; + } + } else { + return ERR_UNCONFIGURED; + } } uint64_t DirAccessJAndroid::get_space_left() { - return 0; + if (_get_space_left) { + JNIEnv *env = get_jni_env(); + ERR_FAIL_COND_V(env == nullptr, 0); + return env->CallLongMethod(dir_access_handler, _get_space_left, get_access_type()); + } else { + return 0; + } } -void DirAccessJAndroid::setup(jobject p_io) { +void DirAccessJAndroid::setup(jobject p_dir_access_handler) { JNIEnv *env = get_jni_env(); - io = p_io; + dir_access_handler = env->NewGlobalRef(p_dir_access_handler); - jclass c = env->GetObjectClass(io); + jclass c = env->GetObjectClass(dir_access_handler); cls = (jclass)env->NewGlobalRef(c); - _dir_open = env->GetMethodID(cls, "dir_open", "(Ljava/lang/String;)I"); - _dir_next = env->GetMethodID(cls, "dir_next", "(I)Ljava/lang/String;"); - _dir_close = env->GetMethodID(cls, "dir_close", "(I)V"); - _dir_is_dir = env->GetMethodID(cls, "dir_is_dir", "(I)Z"); + _dir_open = env->GetMethodID(cls, "dirOpen", "(ILjava/lang/String;)I"); + _dir_next = env->GetMethodID(cls, "dirNext", "(II)Ljava/lang/String;"); + _dir_close = env->GetMethodID(cls, "dirClose", "(II)V"); + _dir_is_dir = env->GetMethodID(cls, "dirIsDir", "(II)Z"); + _dir_exists = env->GetMethodID(cls, "dirExists", "(ILjava/lang/String;)Z"); + _file_exists = env->GetMethodID(cls, "fileExists", "(ILjava/lang/String;)Z"); + _get_drive_count = env->GetMethodID(cls, "getDriveCount", "(I)I"); + _get_drive = env->GetMethodID(cls, "getDrive", "(II)Ljava/lang/String;"); + _make_dir = env->GetMethodID(cls, "makeDir", "(ILjava/lang/String;)Z"); + _get_space_left = env->GetMethodID(cls, "getSpaceLeft", "(I)J"); + _rename = env->GetMethodID(cls, "rename", "(ILjava/lang/String;Ljava/lang/String;)Z"); + _remove = env->GetMethodID(cls, "remove", "(ILjava/lang/String;)Z"); + _current_is_hidden = env->GetMethodID(cls, "isCurrentHidden", "(II)Z"); } DirAccessJAndroid::DirAccessJAndroid() { @@ -233,3 +302,26 @@ DirAccessJAndroid::DirAccessJAndroid() { DirAccessJAndroid::~DirAccessJAndroid() { list_dir_end(); } + +int DirAccessJAndroid::dir_open(String p_path) { + if (_dir_open) { + JNIEnv *env = get_jni_env(); + ERR_FAIL_COND_V(env == nullptr, 0); + + String path = get_absolute_path(p_path); + jstring js = env->NewStringUTF(path.utf8().get_data()); + int dirId = env->CallIntMethod(dir_access_handler, _dir_open, get_access_type(), js); + env->DeleteLocalRef(js); + return dirId; + } else { + return 0; + } +} + +void DirAccessJAndroid::dir_close(int p_id) { + if (_dir_close) { + JNIEnv *env = get_jni_env(); + ERR_FAIL_COND(env == nullptr); + env->CallVoidMethod(dir_access_handler, _dir_close, get_access_type(), p_id); + } +} diff --git a/platform/android/dir_access_jandroid.h b/platform/android/dir_access_jandroid.h index 0e1b12cb58..d469c9d317 100644 --- a/platform/android/dir_access_jandroid.h +++ b/platform/android/dir_access_jandroid.h @@ -32,58 +32,70 @@ #define DIR_ACCESS_JANDROID_H #include "core/io/dir_access.h" +#include "drivers/unix/dir_access_unix.h" #include "java_godot_lib_jni.h" #include <stdio.h> -class DirAccessJAndroid : public DirAccess { - static jobject io; +/// Android implementation of the DirAccess interface used to provide access to +/// ACCESS_FILESYSTEM and ACCESS_RESOURCES directory resources. +/// The implementation use jni in order to comply with Android filesystem +/// access restriction. +class DirAccessJAndroid : public DirAccessUnix { + static jobject dir_access_handler; static jclass cls; static jmethodID _dir_open; static jmethodID _dir_next; static jmethodID _dir_close; static jmethodID _dir_is_dir; - - int id = 0; - - String current_dir; - String current; - - static Ref<DirAccess> create_fs(); + static jmethodID _dir_exists; + static jmethodID _file_exists; + static jmethodID _get_drive_count; + static jmethodID _get_drive; + static jmethodID _make_dir; + static jmethodID _get_space_left; + static jmethodID _rename; + static jmethodID _remove; + static jmethodID _current_is_hidden; public: - virtual Error list_dir_begin(); ///< This starts dir listing - virtual String get_next(); - virtual bool current_is_dir() const; - virtual bool current_is_hidden() const; - virtual void list_dir_end(); ///< + virtual Error list_dir_begin() override; ///< This starts dir listing + virtual String get_next() override; + virtual bool current_is_dir() const override; + virtual bool current_is_hidden() const override; + virtual void list_dir_end() override; ///< - virtual int get_drive_count(); - virtual String get_drive(int p_drive); + virtual int get_drive_count() override; + virtual String get_drive(int p_drive) override; - virtual Error change_dir(String p_dir); ///< can be relative or absolute, return false on success - virtual String get_current_dir(bool p_include_drive = true) const; ///< return current dir location + virtual Error change_dir(String p_dir) override; ///< can be relative or absolute, return false on success - virtual bool file_exists(String p_file); - virtual bool dir_exists(String p_dir); + virtual bool file_exists(String p_file) override; + virtual bool dir_exists(String p_dir) override; - virtual Error make_dir(String p_dir); + virtual Error make_dir(String p_dir) override; + virtual Error make_dir_recursive(String p_dir) override; - virtual Error rename(String p_from, String p_to); - virtual Error remove(String p_name); + virtual Error rename(String p_from, String p_to) override; + virtual Error remove(String p_name) override; - virtual bool is_link(String p_file) { return false; } - virtual String read_link(String p_file) { return p_file; } - virtual Error create_link(String p_source, String p_target) { return FAILED; } + virtual bool is_link(String p_file) override { return false; } + virtual String read_link(String p_file) override { return p_file; } + virtual Error create_link(String p_source, String p_target) override { return FAILED; } - virtual String get_filesystem_type() const; + virtual uint64_t get_space_left() override; - uint64_t get_space_left(); - - static void setup(jobject p_io); + static void setup(jobject p_dir_access_handler); DirAccessJAndroid(); ~DirAccessJAndroid(); + +private: + int id = 0; + + int dir_open(String p_path); + void dir_close(int p_id); + String get_absolute_path(String p_path); }; #endif // DIR_ACCESS_JANDROID_H diff --git a/platform/android/export/export_plugin.cpp b/platform/android/export/export_plugin.cpp index e94ca87d81..d72137e523 100644 --- a/platform/android/export/export_plugin.cpp +++ b/platform/android/export/export_plugin.cpp @@ -123,6 +123,7 @@ static const char *android_perms[] = { "MANAGE_ACCOUNTS", "MANAGE_APP_TOKENS", "MANAGE_DOCUMENTS", + "MANAGE_EXTERNAL_STORAGE", "MASTER_CLEAR", "MEDIA_CONTENT_CONTROL", "MODIFY_AUDIO_SETTINGS", @@ -245,7 +246,7 @@ static const char *APK_ASSETS_DIRECTORY = "res://android/build/assets"; static const char *AAB_ASSETS_DIRECTORY = "res://android/build/assetPacks/installTime/src/main/assets"; static const int DEFAULT_MIN_SDK_VERSION = 19; // Should match the value in 'platform/android/java/app/config.gradle#minSdk' -static const int DEFAULT_TARGET_SDK_VERSION = 31; // Should match the value in 'platform/android/java/app/config.gradle#targetSdk' +static const int DEFAULT_TARGET_SDK_VERSION = 32; // Should match the value in 'platform/android/java/app/config.gradle#targetSdk' void EditorExportPlatformAndroid::_check_for_changes_poll_thread(void *ud) { EditorExportPlatformAndroid *ea = static_cast<EditorExportPlatformAndroid *>(ud); @@ -276,6 +277,7 @@ void EditorExportPlatformAndroid::_check_for_changes_poll_thread(void *ud) { } } +#ifndef ANDROID_ENABLED // Check for devices updates String adb = get_adb_path(); if (FileAccess::exists(adb)) { @@ -387,6 +389,7 @@ void EditorExportPlatformAndroid::_check_for_changes_poll_thread(void *ud) { ea->devices_changed.set(); } } +#endif uint64_t sleep = 200; uint64_t wait = 3000000; @@ -399,6 +402,7 @@ void EditorExportPlatformAndroid::_check_for_changes_poll_thread(void *ud) { } } +#ifndef ANDROID_ENABLED if (EditorSettings::get_singleton()->get("export/android/shutdown_adb_on_exit")) { String adb = get_adb_path(); if (!FileAccess::exists(adb)) { @@ -409,6 +413,7 @@ void EditorExportPlatformAndroid::_check_for_changes_poll_thread(void *ud) { args.push_back("kill-server"); OS::get_singleton()->execute(adb, args); } +#endif } String EditorExportPlatformAndroid::get_project_name(const String &p_name) const { @@ -747,10 +752,14 @@ Error EditorExportPlatformAndroid::copy_gradle_so(void *p_userdata, const Shared return OK; } -bool EditorExportPlatformAndroid::_has_storage_permission(const Vector<String> &p_permissions) { +bool EditorExportPlatformAndroid::_has_read_write_storage_permission(const Vector<String> &p_permissions) { return p_permissions.find("android.permission.READ_EXTERNAL_STORAGE") != -1 || p_permissions.find("android.permission.WRITE_EXTERNAL_STORAGE") != -1; } +bool EditorExportPlatformAndroid::_has_manage_external_storage_permission(const Vector<String> &p_permissions) { + return p_permissions.find("android.permission.MANAGE_EXTERNAL_STORAGE") != -1; +} + void EditorExportPlatformAndroid::_get_permissions(const Ref<EditorExportPreset> &p_preset, bool p_give_internet, Vector<String> &r_permissions) { const char **aperms = android_perms; while (*aperms) { @@ -798,7 +807,7 @@ void EditorExportPlatformAndroid::_write_tmp_manifest(const Ref<EditorExportPres _get_permissions(p_preset, p_give_internet, perms); for (int i = 0; i < perms.size(); i++) { String permission = perms.get(i); - if (permission == "android.permission.WRITE_EXTERNAL_STORAGE" || permission == "android.permission.READ_EXTERNAL_STORAGE") { + if (permission == "android.permission.WRITE_EXTERNAL_STORAGE" || (permission == "android.permission.READ_EXTERNAL_STORAGE" && _has_manage_external_storage_permission(perms))) { manifest_text += vformat(" <uses-permission android:name=\"%s\" android:maxSdkVersion=\"29\" />\n", permission); } else { manifest_text += vformat(" <uses-permission android:name=\"%s\" />\n", permission); @@ -806,7 +815,7 @@ void EditorExportPlatformAndroid::_write_tmp_manifest(const Ref<EditorExportPres } manifest_text += _get_xr_features_tag(p_preset); - manifest_text += _get_application_tag(p_preset, _has_storage_permission(perms)); + manifest_text += _get_application_tag(p_preset, _has_read_write_storage_permission(perms)); manifest_text += "</manifest>\n"; String manifest_path = vformat("res://android/build/src/%s/AndroidManifest.xml", (p_debug ? "debug" : "release")); @@ -864,7 +873,7 @@ void EditorExportPlatformAndroid::_fix_manifest(const Ref<EditorExportPreset> &p Vector<String> perms; // Write permissions into the perms variable. _get_permissions(p_preset, p_give_internet, perms); - bool has_storage_permission = _has_storage_permission(perms); + bool has_read_write_storage_permission = _has_read_write_storage_permission(perms); while (ofs < (uint32_t)p_manifest.size()) { uint32_t chunk = decode_uint32(&p_manifest[ofs]); @@ -948,7 +957,7 @@ void EditorExportPlatformAndroid::_fix_manifest(const Ref<EditorExportPreset> &p } if (tname == "application" && attrname == "requestLegacyExternalStorage") { - encode_uint32(has_storage_permission ? 0xFFFFFFFF : 0, &p_manifest.write[iofs + 16]); + encode_uint32(has_read_write_storage_permission ? 0xFFFFFFFF : 0, &p_manifest.write[iofs + 16]); } if (tname == "application" && attrname == "allowBackup") { diff --git a/platform/android/export/export_plugin.h b/platform/android/export/export_plugin.h index eeb5aae0f1..15ac8091be 100644 --- a/platform/android/export/export_plugin.h +++ b/platform/android/export/export_plugin.h @@ -116,7 +116,9 @@ class EditorExportPlatformAndroid : public EditorExportPlatform { static Error copy_gradle_so(void *p_userdata, const SharedObject &p_so); - bool _has_storage_permission(const Vector<String> &p_permissions); + bool _has_read_write_storage_permission(const Vector<String> &p_permissions); + + bool _has_manage_external_storage_permission(const Vector<String> &p_permissions); void _get_permissions(const Ref<EditorExportPreset> &p_preset, bool p_give_internet, Vector<String> &r_permissions); diff --git a/platform/android/export/gradle_export_util.cpp b/platform/android/export/gradle_export_util.cpp index 9a470edfdd..8d370a31a4 100644 --- a/platform/android/export/gradle_export_util.cpp +++ b/platform/android/export/gradle_export_util.cpp @@ -254,7 +254,7 @@ String _get_activity_tag(const Ref<EditorExportPreset> &p_preset) { return manifest_activity_text; } -String _get_application_tag(const Ref<EditorExportPreset> &p_preset, bool p_has_storage_permission) { +String _get_application_tag(const Ref<EditorExportPreset> &p_preset, bool p_has_read_write_storage_permission) { int xr_mode_index = (int)(p_preset->get("xr_features/xr_mode")); bool uses_xr = xr_mode_index == XR_MODE_OPENXR; String manifest_application_text = vformat( @@ -271,7 +271,7 @@ String _get_application_tag(const Ref<EditorExportPreset> &p_preset, bool p_has_ bool_to_string(p_preset->get("user_data_backup/allow")), bool_to_string(p_preset->get("package/classify_as_game")), bool_to_string(p_preset->get("package/retain_data_on_uninstall")), - bool_to_string(p_has_storage_permission)); + bool_to_string(p_has_read_write_storage_permission)); if (uses_xr) { bool hand_tracking_enabled = (int)(p_preset->get("xr_features/hand_tracking")) > XR_HAND_TRACKING_NONE; diff --git a/platform/android/export/gradle_export_util.h b/platform/android/export/gradle_export_util.h index 109852bdfc..7896392d16 100644 --- a/platform/android/export/gradle_export_util.h +++ b/platform/android/export/gradle_export_util.h @@ -104,6 +104,6 @@ String _get_xr_features_tag(const Ref<EditorExportPreset> &p_preset); String _get_activity_tag(const Ref<EditorExportPreset> &p_preset); -String _get_application_tag(const Ref<EditorExportPreset> &p_preset, bool p_has_storage_permission); +String _get_application_tag(const Ref<EditorExportPreset> &p_preset, bool p_has_read_write_storage_permission); #endif // GODOT_GRADLE_EXPORT_UTIL_H diff --git a/platform/android/file_access_android.cpp b/platform/android/file_access_android.cpp index 4bb8a13bb6..ace7636e6c 100644 --- a/platform/android/file_access_android.cpp +++ b/platform/android/file_access_android.cpp @@ -34,14 +34,20 @@ AAssetManager *FileAccessAndroid::asset_manager = nullptr; -Ref<FileAccess> FileAccessAndroid::create_android() { - return memnew(FileAccessAndroid); +String FileAccessAndroid::get_path() const { + return path_src; +} + +String FileAccessAndroid::get_path_absolute() const { + return absolute_path; } Error FileAccessAndroid::_open(const String &p_path, int p_mode_flags) { _close(); + path_src = p_path; String path = fix_path(p_path).simplify_path(); + absolute_path = path; if (path.begins_with("/")) { path = path.substr(1, path.length()); } else if (path.begins_with("res://")) { @@ -134,7 +140,7 @@ uint64_t FileAccessAndroid::get_buffer(uint8_t *p_dst, uint64_t p_length) const } Error FileAccessAndroid::get_error() const { - return eof ? ERR_FILE_EOF : OK; //not sure what else it may happen + return eof ? ERR_FILE_EOF : OK; // not sure what else it may happen } void FileAccessAndroid::flush() { diff --git a/platform/android/file_access_android.h b/platform/android/file_access_android.h index c16f74ac43..e6fd8c857b 100644 --- a/platform/android/file_access_android.h +++ b/platform/android/file_access_android.h @@ -37,11 +37,12 @@ #include <stdio.h> class FileAccessAndroid : public FileAccess { - static Ref<FileAccess> create_android(); mutable AAsset *asset = nullptr; mutable uint64_t len = 0; mutable uint64_t pos = 0; mutable bool eof = false; + String absolute_path; + String path_src; void _close(); @@ -51,6 +52,11 @@ public: virtual Error _open(const String &p_path, int p_mode_flags); // open a file virtual bool is_open() const; // true when file is open + /// returns the path for the current open file + virtual String get_path() const; + /// returns the absolute path for the current open file + virtual String get_path_absolute() const; + virtual void seek(uint64_t p_position); // seek to a given position virtual void seek_end(int64_t p_position = 0); // seek from the end of file virtual uint64_t get_position() const; // get position in the file diff --git a/platform/android/file_access_filesystem_jandroid.cpp b/platform/android/file_access_filesystem_jandroid.cpp new file mode 100644 index 0000000000..c1a48e025e --- /dev/null +++ b/platform/android/file_access_filesystem_jandroid.cpp @@ -0,0 +1,283 @@ +/*************************************************************************/ +/* file_access_filesystem_jandroid.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 "file_access_filesystem_jandroid.h" +#include "core/os/os.h" +#include "thread_jandroid.h" +#include <unistd.h> + +jobject FileAccessFilesystemJAndroid::file_access_handler = nullptr; +jclass FileAccessFilesystemJAndroid::cls; + +jmethodID FileAccessFilesystemJAndroid::_file_open = nullptr; +jmethodID FileAccessFilesystemJAndroid::_file_get_size = nullptr; +jmethodID FileAccessFilesystemJAndroid::_file_seek = nullptr; +jmethodID FileAccessFilesystemJAndroid::_file_seek_end = nullptr; +jmethodID FileAccessFilesystemJAndroid::_file_read = nullptr; +jmethodID FileAccessFilesystemJAndroid::_file_tell = nullptr; +jmethodID FileAccessFilesystemJAndroid::_file_eof = nullptr; +jmethodID FileAccessFilesystemJAndroid::_file_close = nullptr; +jmethodID FileAccessFilesystemJAndroid::_file_write = nullptr; +jmethodID FileAccessFilesystemJAndroid::_file_flush = nullptr; +jmethodID FileAccessFilesystemJAndroid::_file_exists = nullptr; +jmethodID FileAccessFilesystemJAndroid::_file_last_modified = nullptr; + +String FileAccessFilesystemJAndroid::get_path() const { + return path_src; +} + +String FileAccessFilesystemJAndroid::get_path_absolute() const { + return absolute_path; +} + +Error FileAccessFilesystemJAndroid::_open(const String &p_path, int p_mode_flags) { + if (is_open()) { + _close(); + } + + if (_file_open) { + JNIEnv *env = get_jni_env(); + ERR_FAIL_COND_V(env == nullptr, ERR_UNCONFIGURED); + + String path = fix_path(p_path).simplify_path(); + jstring js = env->NewStringUTF(path.utf8().get_data()); + int res = env->CallIntMethod(file_access_handler, _file_open, js, p_mode_flags); + env->DeleteLocalRef(js); + + if (res <= 0) { + switch (res) { + case 0: + default: + return ERR_FILE_CANT_OPEN; + + case -1: + return ERR_FILE_NOT_FOUND; + } + } + + id = res; + path_src = p_path; + absolute_path = path; + return OK; + } else { + return ERR_UNCONFIGURED; + } +} + +void FileAccessFilesystemJAndroid::_close() { + if (!is_open()) { + return; + } + + if (_file_close) { + JNIEnv *env = get_jni_env(); + ERR_FAIL_COND(env == nullptr); + env->CallVoidMethod(file_access_handler, _file_close, id); + } + id = 0; +} + +bool FileAccessFilesystemJAndroid::is_open() const { + return id != 0; +} + +void FileAccessFilesystemJAndroid::seek(uint64_t p_position) { + if (_file_seek) { + JNIEnv *env = get_jni_env(); + ERR_FAIL_COND(env == nullptr); + ERR_FAIL_COND_MSG(!is_open(), "File must be opened before use."); + env->CallVoidMethod(file_access_handler, _file_seek, id, p_position); + } +} + +void FileAccessFilesystemJAndroid::seek_end(int64_t p_position) { + if (_file_seek_end) { + JNIEnv *env = get_jni_env(); + ERR_FAIL_COND(env == nullptr); + ERR_FAIL_COND_MSG(!is_open(), "File must be opened before use."); + env->CallVoidMethod(file_access_handler, _file_seek_end, id, p_position); + } +} + +uint64_t FileAccessFilesystemJAndroid::get_position() const { + if (_file_tell) { + JNIEnv *env = get_jni_env(); + ERR_FAIL_COND_V(env == nullptr, 0); + ERR_FAIL_COND_V_MSG(!is_open(), 0, "File must be opened before use."); + return env->CallLongMethod(file_access_handler, _file_tell, id); + } else { + return 0; + } +} + +uint64_t FileAccessFilesystemJAndroid::get_length() const { + if (_file_get_size) { + JNIEnv *env = get_jni_env(); + ERR_FAIL_COND_V(env == nullptr, 0); + ERR_FAIL_COND_V_MSG(!is_open(), 0, "File must be opened before use."); + return env->CallLongMethod(file_access_handler, _file_get_size, id); + } else { + return 0; + } +} + +bool FileAccessFilesystemJAndroid::eof_reached() const { + if (_file_eof) { + JNIEnv *env = get_jni_env(); + ERR_FAIL_COND_V(env == nullptr, false); + ERR_FAIL_COND_V_MSG(!is_open(), false, "File must be opened before use."); + return env->CallBooleanMethod(file_access_handler, _file_eof, id); + } else { + return false; + } +} + +uint8_t FileAccessFilesystemJAndroid::get_8() const { + ERR_FAIL_COND_V_MSG(!is_open(), 0, "File must be opened before use."); + uint8_t byte; + get_buffer(&byte, 1); + return byte; +} + +uint64_t FileAccessFilesystemJAndroid::get_buffer(uint8_t *p_dst, uint64_t p_length) const { + if (_file_read) { + ERR_FAIL_COND_V_MSG(!is_open(), 0, "File must be opened before use."); + if (p_length == 0) { + return 0; + } + + JNIEnv *env = get_jni_env(); + ERR_FAIL_COND_V(env == nullptr, 0); + + jobject j_buffer = env->NewDirectByteBuffer(p_dst, p_length); + int length = env->CallIntMethod(file_access_handler, _file_read, id, j_buffer); + env->DeleteLocalRef(j_buffer); + return length; + } else { + return 0; + } +} + +void FileAccessFilesystemJAndroid::store_8(uint8_t p_dest) { + store_buffer(&p_dest, 1); +} + +void FileAccessFilesystemJAndroid::store_buffer(const uint8_t *p_src, uint64_t p_length) { + if (_file_write) { + ERR_FAIL_COND_MSG(!is_open(), "File must be opened before use."); + if (p_length == 0) { + return; + } + + JNIEnv *env = get_jni_env(); + ERR_FAIL_COND(env == nullptr); + + jobject j_buffer = env->NewDirectByteBuffer((void *)p_src, p_length); + env->CallVoidMethod(file_access_handler, _file_write, id, j_buffer); + env->DeleteLocalRef(j_buffer); + } +} + +Error FileAccessFilesystemJAndroid::get_error() const { + if (eof_reached()) { + return ERR_FILE_EOF; + } + return OK; +} + +void FileAccessFilesystemJAndroid::flush() { + if (_file_flush) { + JNIEnv *env = get_jni_env(); + ERR_FAIL_COND(env == nullptr); + ERR_FAIL_COND_MSG(!is_open(), "File must be opened before use."); + env->CallVoidMethod(file_access_handler, _file_flush, id); + } +} + +bool FileAccessFilesystemJAndroid::file_exists(const String &p_path) { + if (_file_exists) { + JNIEnv *env = get_jni_env(); + ERR_FAIL_COND_V(env == nullptr, false); + + String path = fix_path(p_path).simplify_path(); + jstring js = env->NewStringUTF(path.utf8().get_data()); + bool result = env->CallBooleanMethod(file_access_handler, _file_exists, js); + env->DeleteLocalRef(js); + return result; + } else { + return false; + } +} + +uint64_t FileAccessFilesystemJAndroid::_get_modified_time(const String &p_file) { + if (_file_last_modified) { + JNIEnv *env = get_jni_env(); + ERR_FAIL_COND_V(env == nullptr, false); + + String path = fix_path(p_file).simplify_path(); + jstring js = env->NewStringUTF(path.utf8().get_data()); + uint64_t result = env->CallLongMethod(file_access_handler, _file_last_modified, js); + env->DeleteLocalRef(js); + return result; + } else { + return 0; + } +} + +void FileAccessFilesystemJAndroid::setup(jobject p_file_access_handler) { + JNIEnv *env = get_jni_env(); + file_access_handler = env->NewGlobalRef(p_file_access_handler); + + jclass c = env->GetObjectClass(file_access_handler); + cls = (jclass)env->NewGlobalRef(c); + + _file_open = env->GetMethodID(cls, "fileOpen", "(Ljava/lang/String;I)I"); + _file_get_size = env->GetMethodID(cls, "fileGetSize", "(I)J"); + _file_tell = env->GetMethodID(cls, "fileGetPosition", "(I)J"); + _file_eof = env->GetMethodID(cls, "isFileEof", "(I)Z"); + _file_seek = env->GetMethodID(cls, "fileSeek", "(IJ)V"); + _file_seek_end = env->GetMethodID(cls, "fileSeekFromEnd", "(IJ)V"); + _file_read = env->GetMethodID(cls, "fileRead", "(ILjava/nio/ByteBuffer;)I"); + _file_close = env->GetMethodID(cls, "fileClose", "(I)V"); + _file_write = env->GetMethodID(cls, "fileWrite", "(ILjava/nio/ByteBuffer;)V"); + _file_flush = env->GetMethodID(cls, "fileFlush", "(I)V"); + _file_exists = env->GetMethodID(cls, "fileExists", "(Ljava/lang/String;)Z"); + _file_last_modified = env->GetMethodID(cls, "fileLastModified", "(Ljava/lang/String;)J"); +} + +FileAccessFilesystemJAndroid::FileAccessFilesystemJAndroid() { + id = 0; +} + +FileAccessFilesystemJAndroid::~FileAccessFilesystemJAndroid() { + if (is_open()) { + _close(); + } +} diff --git a/platform/android/file_access_filesystem_jandroid.h b/platform/android/file_access_filesystem_jandroid.h new file mode 100644 index 0000000000..18d5df1628 --- /dev/null +++ b/platform/android/file_access_filesystem_jandroid.h @@ -0,0 +1,97 @@ +/*************************************************************************/ +/* file_access_filesystem_jandroid.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 FILE_ACCESS_FILESYSTEM_JANDROID_H +#define FILE_ACCESS_FILESYSTEM_JANDROID_H + +#include "core/io/file_access.h" +#include "java_godot_lib_jni.h" + +class FileAccessFilesystemJAndroid : public FileAccess { + static jobject file_access_handler; + static jclass cls; + + static jmethodID _file_open; + static jmethodID _file_get_size; + static jmethodID _file_seek; + static jmethodID _file_seek_end; + static jmethodID _file_tell; + static jmethodID _file_eof; + static jmethodID _file_read; + static jmethodID _file_write; + static jmethodID _file_flush; + static jmethodID _file_close; + static jmethodID _file_exists; + static jmethodID _file_last_modified; + + int id; + String absolute_path; + String path_src; + + void _close(); ///< close a file + +public: + virtual Error _open(const String &p_path, int p_mode_flags) override; ///< open a file + virtual bool is_open() const override; ///< true when file is open + + /// returns the path for the current open file + virtual String get_path() const override; + /// returns the absolute path for the current open file + virtual String get_path_absolute() const override; + + virtual void seek(uint64_t p_position) override; ///< seek to a given position + virtual void seek_end(int64_t p_position = 0) override; ///< seek from the end of file + virtual uint64_t get_position() const override; ///< get position in the file + virtual uint64_t get_length() const override; ///< get size of the file + + virtual bool eof_reached() const override; ///< reading passed EOF + + virtual uint8_t get_8() const override; ///< get a byte + virtual uint64_t get_buffer(uint8_t *p_dst, uint64_t p_length) const override; + + virtual Error get_error() const override; ///< get last error + + virtual void flush() override; + virtual void store_8(uint8_t p_dest) override; ///< store a byte + virtual void store_buffer(const uint8_t *p_src, uint64_t p_length) override; + + virtual bool file_exists(const String &p_path) override; ///< return true if a file exists + + static void setup(jobject p_file_access_handler); + + virtual uint64_t _get_modified_time(const String &p_file) override; + virtual uint32_t _get_unix_permissions(const String &p_file) override { return 0; } + virtual Error _set_unix_permissions(const String &p_file, uint32_t p_permissions) override { return FAILED; } + + FileAccessFilesystemJAndroid(); + ~FileAccessFilesystemJAndroid(); +}; + +#endif // FILE_ACCESS_FILESYSTEM_JANDROID_H diff --git a/platform/android/java/app/config.gradle b/platform/android/java/app/config.gradle index 3daf628e63..fbd97fae0b 100644 --- a/platform/android/java/app/config.gradle +++ b/platform/android/java/app/config.gradle @@ -1,9 +1,9 @@ ext.versions = [ androidGradlePlugin: '7.0.3', - compileSdk : 31, + compileSdk : 32, minSdk : 19, // Also update 'platform/android/java/lib/AndroidManifest.xml#minSdkVersion' & 'platform/android/export/export_plugin.cpp#DEFAULT_MIN_SDK_VERSION' - targetSdk : 31, // Also update 'platform/android/java/lib/AndroidManifest.xml#targetSdkVersion' & 'platform/android/export/export_plugin.cpp#DEFAULT_TARGET_SDK_VERSION' - buildTools : '30.0.3', + targetSdk : 32, // Also update 'platform/android/java/lib/AndroidManifest.xml#targetSdkVersion' & 'platform/android/export/export_plugin.cpp#DEFAULT_TARGET_SDK_VERSION' + buildTools : '32.0.0', kotlinVersion : '1.6.21', fragmentVersion : '1.3.6', nexusPublishVersion: '1.1.0', diff --git a/platform/android/java/editor/build.gradle b/platform/android/java/editor/build.gradle index dd167c3880..729966ee69 100644 --- a/platform/android/java/editor/build.gradle +++ b/platform/android/java/editor/build.gradle @@ -23,8 +23,7 @@ android { versionCode getGodotLibraryVersionCode() versionName getGodotLibraryVersionName() minSdkVersion versions.minSdk - //noinspection ExpiredTargetSdkVersion - Restrict to version 29 until https://github.com/godotengine/godot/pull/51815 is submitted - targetSdkVersion 29 // versions.targetSdk + targetSdkVersion versions.targetSdk missingDimensionStrategy 'products', 'editor' } diff --git a/platform/android/java/editor/src/main/AndroidManifest.xml b/platform/android/java/editor/src/main/AndroidManifest.xml index 93cbb47400..abf506a83c 100644 --- a/platform/android/java/editor/src/main/AndroidManifest.xml +++ b/platform/android/java/editor/src/main/AndroidManifest.xml @@ -14,8 +14,12 @@ android:glEsVersion="0x00020000" android:required="true" /> - <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> - <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> + <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" + tools:ignore="ScopedStorage" /> + <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" + android:maxSdkVersion="29"/> + <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" + android:maxSdkVersion="29"/> <uses-permission android:name="android.permission.INTERNET" /> <application diff --git a/platform/android/java/editor/src/main/java/org/godotengine/editor/GodotEditor.kt b/platform/android/java/editor/src/main/java/org/godotengine/editor/GodotEditor.kt index a1ade722e8..740f3f48d3 100644 --- a/platform/android/java/editor/src/main/java/org/godotengine/editor/GodotEditor.kt +++ b/platform/android/java/editor/src/main/java/org/godotengine/editor/GodotEditor.kt @@ -30,10 +30,14 @@ package org.godotengine.editor +import android.Manifest import android.content.Intent +import android.content.pm.PackageManager import android.os.Build import android.os.Bundle import android.os.Debug +import android.os.Environment +import android.widget.Toast import androidx.window.layout.WindowMetricsCalculator import org.godotengine.godot.FullScreenGodotApp import org.godotengine.godot.utils.PermissionsUtil @@ -68,7 +72,7 @@ open class GodotEditor : FullScreenGodotApp() { val params = intent.getStringArrayExtra(COMMAND_LINE_PARAMS) updateCommandLineParams(params) - if (BuildConfig.BUILD_TYPE == "debug" && WAIT_FOR_DEBUGGER) { + if (BuildConfig.BUILD_TYPE == "dev" && WAIT_FOR_DEBUGGER) { Debug.waitForDebugger() } @@ -143,4 +147,50 @@ open class GodotEditor : FullScreenGodotApp() { * The Godot Android Editor sets its own orientation via its AndroidManifest */ protected open fun overrideOrientationRequest() = true + + override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { + super.onActivityResult(requestCode, resultCode, data) + // Check if we got the MANAGE_EXTERNAL_STORAGE permission + if (requestCode == PermissionsUtil.REQUEST_MANAGE_EXTERNAL_STORAGE_REQ_CODE) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { + if (!Environment.isExternalStorageManager()) { + Toast.makeText( + this, + R.string.denied_storage_permission_error_msg, + Toast.LENGTH_LONG + ).show() + } + } + } + } + + override fun onRequestPermissionsResult( + requestCode: Int, + permissions: Array<String?>, + grantResults: IntArray + ) { + super.onRequestPermissionsResult(requestCode, permissions, grantResults) + // Check if we got access to the necessary storage permissions + if (requestCode == PermissionsUtil.REQUEST_ALL_PERMISSION_REQ_CODE) { + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R) { + var hasReadAccess = false + var hasWriteAccess = false + for (i in permissions.indices) { + if (Manifest.permission.READ_EXTERNAL_STORAGE == permissions[i] && grantResults[i] == PackageManager.PERMISSION_GRANTED) { + hasReadAccess = true + } + if (Manifest.permission.WRITE_EXTERNAL_STORAGE == permissions[i] && grantResults[i] == PackageManager.PERMISSION_GRANTED) { + hasWriteAccess = true + } + } + if (!hasReadAccess || !hasWriteAccess) { + Toast.makeText( + this, + R.string.denied_storage_permission_error_msg, + Toast.LENGTH_LONG + ).show() + } + } + } + } } diff --git a/platform/android/java/editor/src/main/res/values/strings.xml b/platform/android/java/editor/src/main/res/values/strings.xml index e8ce34f34d..837a5d62e1 100644 --- a/platform/android/java/editor/src/main/res/values/strings.xml +++ b/platform/android/java/editor/src/main/res/values/strings.xml @@ -1,4 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <resources> <string name="godot_editor_name_string">Godot Editor 4.x</string> + + <string name="denied_storage_permission_error_msg">Missing storage access permission!</string> </resources> diff --git a/platform/android/java/lib/AndroidManifest.xml b/platform/android/java/lib/AndroidManifest.xml index 228d8d45fa..79b5aadf2a 100644 --- a/platform/android/java/lib/AndroidManifest.xml +++ b/platform/android/java/lib/AndroidManifest.xml @@ -5,7 +5,7 @@ android:versionName="1.0"> <!-- Should match the mindSdk and targetSdk values in platform/android/java/app/config.gradle --> - <uses-sdk android:minSdkVersion="19" android:targetSdkVersion="31" /> + <uses-sdk android:minSdkVersion="19" android:targetSdkVersion="32" /> <application> diff --git a/platform/android/java/lib/src/org/godotengine/godot/Godot.java b/platform/android/java/lib/src/org/godotengine/godot/Godot.java index cafae94d62..28e689e63a 100644 --- a/platform/android/java/lib/src/org/godotengine/godot/Godot.java +++ b/platform/android/java/lib/src/org/godotengine/godot/Godot.java @@ -34,6 +34,8 @@ import static android.content.Context.MODE_PRIVATE; import static android.content.Context.WINDOW_SERVICE; import org.godotengine.godot.input.GodotEditText; +import org.godotengine.godot.io.directory.DirectoryAccessHandler; +import org.godotengine.godot.io.file.FileAccessHandler; import org.godotengine.godot.plugin.GodotPlugin; import org.godotengine.godot.plugin.GodotPluginRegistry; import org.godotengine.godot.tts.GodotTTS; @@ -164,9 +166,9 @@ public class Godot extends Fragment implements SensorEventListener, IDownloaderC private Sensor mMagnetometer; private Sensor mGyroscope; - public static GodotIO io; - public static GodotNetUtils netUtils; - public static GodotTTS tts; + public GodotIO io; + public GodotNetUtils netUtils; + public GodotTTS tts; public interface ResultCallback { void callback(int requestCode, int resultCode, Intent data); @@ -458,16 +460,26 @@ public class Godot extends Fragment implements SensorEventListener, IDownloaderC final Activity activity = getActivity(); io = new GodotIO(activity); - GodotLib.io = io; netUtils = new GodotNetUtils(activity); tts = new GodotTTS(activity); + Context context = getContext(); + DirectoryAccessHandler directoryAccessHandler = new DirectoryAccessHandler(context); + FileAccessHandler fileAccessHandler = new FileAccessHandler(context); mSensorManager = (SensorManager)activity.getSystemService(Context.SENSOR_SERVICE); mAccelerometer = mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER); mGravity = mSensorManager.getDefaultSensor(Sensor.TYPE_GRAVITY); mMagnetometer = mSensorManager.getDefaultSensor(Sensor.TYPE_MAGNETIC_FIELD); mGyroscope = mSensorManager.getDefaultSensor(Sensor.TYPE_GYROSCOPE); - GodotLib.initialize(activity, this, activity.getAssets(), use_apk_expansion); + GodotLib.initialize(activity, + this, + activity.getAssets(), + io, + netUtils, + directoryAccessHandler, + fileAccessHandler, + use_apk_expansion, + tts); result_callback = null; diff --git a/platform/android/java/lib/src/org/godotengine/godot/GodotIO.java b/platform/android/java/lib/src/org/godotengine/godot/GodotIO.java index a8e3669ac6..0434efdf4c 100644 --- a/platform/android/java/lib/src/org/godotengine/godot/GodotIO.java +++ b/platform/android/java/lib/src/org/godotengine/godot/GodotIO.java @@ -36,7 +36,6 @@ import android.app.Activity; import android.content.ActivityNotFoundException; import android.content.Intent; import android.content.pm.ActivityInfo; -import android.content.res.AssetManager; import android.graphics.Point; import android.graphics.Rect; import android.net.Uri; @@ -46,12 +45,10 @@ import android.provider.Settings; import android.text.TextUtils; import android.util.DisplayMetrics; import android.util.Log; -import android.util.SparseArray; import android.view.Display; import android.view.DisplayCutout; import android.view.WindowInsets; -import java.io.IOException; import java.util.List; import java.util.Locale; @@ -60,7 +57,6 @@ import java.util.Locale; public class GodotIO { private static final String TAG = GodotIO.class.getSimpleName(); - private final AssetManager am; private final Activity activity; private final String uniqueId; GodotEditText edit; @@ -73,100 +69,8 @@ public class GodotIO { final int SCREEN_SENSOR_PORTRAIT = 5; final int SCREEN_SENSOR = 6; - ///////////////////////// - /// DIRECTORIES - ///////////////////////// - - static class AssetDir { - public String[] files; - public int current; - public String path; - } - - private int last_dir_id = 1; - - private final SparseArray<AssetDir> dirs; - - public int dir_open(String path) { - AssetDir ad = new AssetDir(); - ad.current = 0; - ad.path = path; - - try { - ad.files = am.list(path); - // no way to find path is directory or file exactly. - // but if ad.files.length==0, then it's an empty directory or file. - if (ad.files.length == 0) { - return -1; - } - } catch (IOException e) { - System.out.printf("Exception on dir_open: %s\n", e); - return -1; - } - - ++last_dir_id; - dirs.put(last_dir_id, ad); - - return last_dir_id; - } - - public boolean dir_is_dir(int id) { - if (dirs.get(id) == null) { - System.out.printf("dir_next: invalid dir id: %d\n", id); - return false; - } - AssetDir ad = dirs.get(id); - //System.out.printf("go next: %d,%d\n",ad.current,ad.files.length); - int idx = ad.current; - if (idx > 0) - idx--; - - if (idx >= ad.files.length) - return false; - String fname = ad.files[idx]; - - try { - if (ad.path.equals("")) - am.open(fname); - else - am.open(ad.path + "/" + fname); - return false; - } catch (Exception e) { - return true; - } - } - - public String dir_next(int id) { - if (dirs.get(id) == null) { - System.out.printf("dir_next: invalid dir id: %d\n", id); - return ""; - } - - AssetDir ad = dirs.get(id); - //System.out.printf("go next: %d,%d\n",ad.current,ad.files.length); - - if (ad.current >= ad.files.length) { - ad.current++; - return ""; - } - String r = ad.files[ad.current]; - ad.current++; - return r; - } - - public void dir_close(int id) { - if (dirs.get(id) == null) { - System.out.printf("dir_close: invalid dir id: %d\n", id); - return; - } - - dirs.remove(id); - } - GodotIO(Activity p_activity) { - am = p_activity.getAssets(); activity = p_activity; - dirs = new SparseArray<>(); String androidId = Settings.Secure.getString(activity.getContentResolver(), Settings.Secure.ANDROID_ID); if (androidId == null) { diff --git a/platform/android/java/lib/src/org/godotengine/godot/GodotLib.java b/platform/android/java/lib/src/org/godotengine/godot/GodotLib.java index 3182ab0666..e2ae62d9cf 100644 --- a/platform/android/java/lib/src/org/godotengine/godot/GodotLib.java +++ b/platform/android/java/lib/src/org/godotengine/godot/GodotLib.java @@ -31,8 +31,13 @@ package org.godotengine.godot; import org.godotengine.godot.gl.GodotRenderer; +import org.godotengine.godot.io.directory.DirectoryAccessHandler; +import org.godotengine.godot.io.file.FileAccessHandler; +import org.godotengine.godot.tts.GodotTTS; +import org.godotengine.godot.utils.GodotNetUtils; import android.app.Activity; +import android.content.res.AssetManager; import android.hardware.SensorEvent; import android.view.Surface; @@ -42,8 +47,6 @@ import javax.microedition.khronos.opengles.GL10; * Wrapper for native library */ public class GodotLib { - public static GodotIO io; - static { System.loadLibrary("godot_android"); } @@ -51,7 +54,15 @@ public class GodotLib { /** * Invoked on the main thread to initialize Godot native layer. */ - public static native void initialize(Activity activity, Godot p_instance, Object p_asset_manager, boolean use_apk_expansion); + public static native void initialize(Activity activity, + Godot p_instance, + AssetManager p_asset_manager, + GodotIO godotIO, + GodotNetUtils netUtils, + DirectoryAccessHandler directoryAccessHandler, + FileAccessHandler fileAccessHandler, + boolean use_apk_expansion, + GodotTTS tts); /** * Invoked on the main thread to clean up Godot native layer. diff --git a/platform/android/java/lib/src/org/godotengine/godot/io/StorageScope.kt b/platform/android/java/lib/src/org/godotengine/godot/io/StorageScope.kt new file mode 100644 index 0000000000..c7bd55b620 --- /dev/null +++ b/platform/android/java/lib/src/org/godotengine/godot/io/StorageScope.kt @@ -0,0 +1,114 @@ +/*************************************************************************/ +/* StorageScope.kt */ +/*************************************************************************/ +/* 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. */ +/*************************************************************************/ + +package org.godotengine.godot.io + +import android.content.Context +import android.os.Build +import android.os.Environment +import java.io.File + +/** + * Represents the different storage scopes. + */ +internal enum class StorageScope { + /** + * Covers internal and external directories accessible to the app without restrictions. + */ + APP, + + /** + * Covers shared directories (from Android 10 and higher). + */ + SHARED, + + /** + * Everything else.. + */ + UNKNOWN; + + companion object { + /** + * Determines which [StorageScope] the given path falls under. + */ + fun getStorageScope(context: Context, path: String?): StorageScope { + if (path == null) { + return UNKNOWN + } + + val pathFile = File(path) + if (!pathFile.isAbsolute) { + return UNKNOWN + } + + val canonicalPathFile = pathFile.canonicalPath + + val internalAppDir = context.filesDir.canonicalPath ?: return UNKNOWN + if (canonicalPathFile.startsWith(internalAppDir)) { + return APP + } + + val internalCacheDir = context.cacheDir.canonicalPath ?: return UNKNOWN + if (canonicalPathFile.startsWith(internalCacheDir)) { + return APP + } + + val externalAppDir = context.getExternalFilesDir(null)?.canonicalPath ?: return UNKNOWN + if (canonicalPathFile.startsWith(externalAppDir)) { + return APP + } + + val sharedDir = Environment.getExternalStorageDirectory().canonicalPath ?: return UNKNOWN + if (canonicalPathFile.startsWith(sharedDir)) { + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R) { + // Before R, apps had access to shared storage so long as they have the right + // permissions (and flag on Q). + return APP + } + + // Post R, access is limited based on the target destination + // 'Downloads' and 'Documents' are still accessible + val downloadsSharedDir = + Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS).canonicalPath + ?: return SHARED + val documentsSharedDir = + Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOCUMENTS).canonicalPath + ?: return SHARED + if (canonicalPathFile.startsWith(downloadsSharedDir) || canonicalPathFile.startsWith(documentsSharedDir)) { + return APP + } + + return SHARED + } + + return UNKNOWN + } + } +} diff --git a/platform/android/java/lib/src/org/godotengine/godot/io/directory/AssetsDirectoryAccess.kt b/platform/android/java/lib/src/org/godotengine/godot/io/directory/AssetsDirectoryAccess.kt new file mode 100644 index 0000000000..098b10ae36 --- /dev/null +++ b/platform/android/java/lib/src/org/godotengine/godot/io/directory/AssetsDirectoryAccess.kt @@ -0,0 +1,177 @@ +/*************************************************************************/ +/* AssetsDirectoryAccess.kt */ +/*************************************************************************/ +/* 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. */ +/*************************************************************************/ + +package org.godotengine.godot.io.directory + +import android.content.Context +import android.util.Log +import android.util.SparseArray +import org.godotengine.godot.io.directory.DirectoryAccessHandler.Companion.INVALID_DIR_ID +import org.godotengine.godot.io.directory.DirectoryAccessHandler.Companion.STARTING_DIR_ID +import java.io.File +import java.io.IOException + +/** + * Handles directories access within the Android assets directory. + */ +internal class AssetsDirectoryAccess(context: Context) : DirectoryAccessHandler.DirectoryAccess { + + companion object { + private val TAG = AssetsDirectoryAccess::class.java.simpleName + } + + private data class AssetDir(val path: String, val files: Array<String>, var current: Int = 0) + + private val assetManager = context.assets + + private var lastDirId = STARTING_DIR_ID + private val dirs = SparseArray<AssetDir>() + + private fun getAssetsPath(originalPath: String): String { + if (originalPath.startsWith(File.separatorChar)) { + return originalPath.substring(1) + } + return originalPath + } + + override fun hasDirId(dirId: Int) = dirs.indexOfKey(dirId) >= 0 + + override fun dirOpen(path: String): Int { + val assetsPath = getAssetsPath(path) ?: return INVALID_DIR_ID + try { + val files = assetManager.list(assetsPath) ?: return INVALID_DIR_ID + // Empty directories don't get added to the 'assets' directory, so + // if ad.files.length > 0 ==> path is directory + // if ad.files.length == 0 ==> path is file + if (files.isEmpty()) { + return INVALID_DIR_ID + } + + val ad = AssetDir(assetsPath, files) + + dirs.put(++lastDirId, ad) + return lastDirId + } catch (e: IOException) { + Log.e(TAG, "Exception on dirOpen", e) + return INVALID_DIR_ID + } + } + + override fun dirExists(path: String): Boolean { + val assetsPath = getAssetsPath(path) + try { + val files = assetManager.list(assetsPath) ?: return false + // Empty directories don't get added to the 'assets' directory, so + // if ad.files.length > 0 ==> path is directory + // if ad.files.length == 0 ==> path is file + return files.isNotEmpty() + } catch (e: IOException) { + Log.e(TAG, "Exception on dirExists", e) + return false + } + } + + override fun fileExists(path: String): Boolean { + val assetsPath = getAssetsPath(path) ?: return false + try { + val files = assetManager.list(assetsPath) ?: return false + // Empty directories don't get added to the 'assets' directory, so + // if ad.files.length > 0 ==> path is directory + // if ad.files.length == 0 ==> path is file + return files.isEmpty() + } catch (e: IOException) { + Log.e(TAG, "Exception on fileExists", e) + return false + } + } + + override fun dirIsDir(dirId: Int): Boolean { + val ad: AssetDir = dirs[dirId] + + var idx = ad.current + if (idx > 0) { + idx-- + } + + if (idx >= ad.files.size) { + return false + } + + val fileName = ad.files[idx] + // List the contents of $fileName. If it's a file, it will be empty, otherwise it'll be a + // directory + val filePath = if (ad.path == "") fileName else "${ad.path}/${fileName}" + val fileContents = assetManager.list(filePath) + return (fileContents?.size?: 0) > 0 + } + + override fun isCurrentHidden(dirId: Int): Boolean { + val ad = dirs[dirId] + + var idx = ad.current + if (idx > 0) { + idx-- + } + + if (idx >= ad.files.size) { + return false + } + + val fileName = ad.files[idx] + return fileName.startsWith('.') + } + + override fun dirNext(dirId: Int): String { + val ad: AssetDir = dirs[dirId] + + if (ad.current >= ad.files.size) { + ad.current++ + return "" + } + + return ad.files[ad.current++] + } + + override fun dirClose(dirId: Int) { + dirs.remove(dirId) + } + + override fun getDriveCount() = 0 + + override fun getDrive(drive: Int) = "" + + override fun makeDir(dir: String) = false + + override fun getSpaceLeft() = 0L + + override fun rename(from: String, to: String) = false + + override fun remove(filename: String) = false +} diff --git a/platform/android/java/lib/src/org/godotengine/godot/io/directory/DirectoryAccessHandler.kt b/platform/android/java/lib/src/org/godotengine/godot/io/directory/DirectoryAccessHandler.kt new file mode 100644 index 0000000000..fedcf4843f --- /dev/null +++ b/platform/android/java/lib/src/org/godotengine/godot/io/directory/DirectoryAccessHandler.kt @@ -0,0 +1,224 @@ +/*************************************************************************/ +/* DirectoryAccessHandler.kt */ +/*************************************************************************/ +/* 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. */ +/*************************************************************************/ + +package org.godotengine.godot.io.directory + +import android.content.Context +import android.util.Log +import org.godotengine.godot.io.directory.DirectoryAccessHandler.AccessType.ACCESS_FILESYSTEM +import org.godotengine.godot.io.directory.DirectoryAccessHandler.AccessType.ACCESS_RESOURCES + +/** + * Handles files and directories access and manipulation for the Android platform + */ +class DirectoryAccessHandler(context: Context) { + + companion object { + private val TAG = DirectoryAccessHandler::class.java.simpleName + + internal const val INVALID_DIR_ID = -1 + internal const val STARTING_DIR_ID = 1 + + private fun getAccessTypeFromNative(accessType: Int): AccessType? { + return when (accessType) { + ACCESS_RESOURCES.nativeValue -> ACCESS_RESOURCES + ACCESS_FILESYSTEM.nativeValue -> ACCESS_FILESYSTEM + else -> null + } + } + } + + private enum class AccessType(val nativeValue: Int) { + ACCESS_RESOURCES(0), ACCESS_FILESYSTEM(2) + } + + internal interface DirectoryAccess { + fun dirOpen(path: String): Int + fun dirNext(dirId: Int): String + fun dirClose(dirId: Int) + fun dirIsDir(dirId: Int): Boolean + fun dirExists(path: String): Boolean + fun fileExists(path: String): Boolean + fun hasDirId(dirId: Int): Boolean + fun isCurrentHidden(dirId: Int): Boolean + fun getDriveCount() : Int + fun getDrive(drive: Int): String + fun makeDir(dir: String): Boolean + fun getSpaceLeft(): Long + fun rename(from: String, to: String): Boolean + fun remove(filename: String): Boolean + } + + private val assetsDirAccess = AssetsDirectoryAccess(context) + private val fileSystemDirAccess = FilesystemDirectoryAccess(context) + + private fun hasDirId(accessType: AccessType, dirId: Int): Boolean { + return when (accessType) { + ACCESS_RESOURCES -> assetsDirAccess.hasDirId(dirId) + ACCESS_FILESYSTEM -> fileSystemDirAccess.hasDirId(dirId) + } + } + + fun dirOpen(nativeAccessType: Int, path: String?): Int { + val accessType = getAccessTypeFromNative(nativeAccessType) + if (path == null || accessType == null) { + return INVALID_DIR_ID + } + + return when (accessType) { + ACCESS_RESOURCES -> assetsDirAccess.dirOpen(path) + ACCESS_FILESYSTEM -> fileSystemDirAccess.dirOpen(path) + } + } + + fun dirNext(nativeAccessType: Int, dirId: Int): String { + val accessType = getAccessTypeFromNative(nativeAccessType) + if (accessType == null || !hasDirId(accessType, dirId)) { + Log.w(TAG, "dirNext: Invalid dir id: $dirId") + return "" + } + + return when (accessType) { + ACCESS_RESOURCES -> assetsDirAccess.dirNext(dirId) + ACCESS_FILESYSTEM -> fileSystemDirAccess.dirNext(dirId) + } + } + + fun dirClose(nativeAccessType: Int, dirId: Int) { + val accessType = getAccessTypeFromNative(nativeAccessType) + if (accessType == null || !hasDirId(accessType, dirId)) { + Log.w(TAG, "dirClose: Invalid dir id: $dirId") + return + } + + when (accessType) { + ACCESS_RESOURCES -> assetsDirAccess.dirClose(dirId) + ACCESS_FILESYSTEM -> fileSystemDirAccess.dirClose(dirId) + } + } + + fun dirIsDir(nativeAccessType: Int, dirId: Int): Boolean { + val accessType = getAccessTypeFromNative(nativeAccessType) + if (accessType == null || !hasDirId(accessType, dirId)) { + Log.w(TAG, "dirIsDir: Invalid dir id: $dirId") + return false + } + + return when (accessType) { + ACCESS_RESOURCES -> assetsDirAccess.dirIsDir(dirId) + ACCESS_FILESYSTEM -> fileSystemDirAccess.dirIsDir(dirId) + } + } + + fun isCurrentHidden(nativeAccessType: Int, dirId: Int): Boolean { + val accessType = getAccessTypeFromNative(nativeAccessType) + if (accessType == null || !hasDirId(accessType, dirId)) { + return false + } + + return when (accessType) { + ACCESS_RESOURCES -> assetsDirAccess.isCurrentHidden(dirId) + ACCESS_FILESYSTEM -> fileSystemDirAccess.isCurrentHidden(dirId) + } + } + + fun dirExists(nativeAccessType: Int, path: String?): Boolean { + val accessType = getAccessTypeFromNative(nativeAccessType) + if (path == null || accessType == null) { + return false + } + + return when (accessType) { + ACCESS_RESOURCES -> assetsDirAccess.dirExists(path) + ACCESS_FILESYSTEM -> fileSystemDirAccess.dirExists(path) + } + } + + fun fileExists(nativeAccessType: Int, path: String?): Boolean { + val accessType = getAccessTypeFromNative(nativeAccessType) + if (path == null || accessType == null) { + return false + } + + return when (accessType) { + ACCESS_RESOURCES -> assetsDirAccess.fileExists(path) + ACCESS_FILESYSTEM -> fileSystemDirAccess.fileExists(path) + } + } + + fun getDriveCount(nativeAccessType: Int): Int { + val accessType = getAccessTypeFromNative(nativeAccessType) ?: return 0 + return when(accessType) { + ACCESS_RESOURCES -> assetsDirAccess.getDriveCount() + ACCESS_FILESYSTEM -> fileSystemDirAccess.getDriveCount() + } + } + + fun getDrive(nativeAccessType: Int, drive: Int): String { + val accessType = getAccessTypeFromNative(nativeAccessType) ?: return "" + return when (accessType) { + ACCESS_RESOURCES -> assetsDirAccess.getDrive(drive) + ACCESS_FILESYSTEM -> fileSystemDirAccess.getDrive(drive) + } + } + + fun makeDir(nativeAccessType: Int, dir: String): Boolean { + val accessType = getAccessTypeFromNative(nativeAccessType) ?: return false + return when (accessType) { + ACCESS_RESOURCES -> assetsDirAccess.makeDir(dir) + ACCESS_FILESYSTEM -> fileSystemDirAccess.makeDir(dir) + } + } + + fun getSpaceLeft(nativeAccessType: Int): Long { + val accessType = getAccessTypeFromNative(nativeAccessType) ?: return 0L + return when (accessType) { + ACCESS_RESOURCES -> assetsDirAccess.getSpaceLeft() + ACCESS_FILESYSTEM -> fileSystemDirAccess.getSpaceLeft() + } + } + + fun rename(nativeAccessType: Int, from: String, to: String): Boolean { + val accessType = getAccessTypeFromNative(nativeAccessType) ?: return false + return when (accessType) { + ACCESS_RESOURCES -> assetsDirAccess.rename(from, to) + ACCESS_FILESYSTEM -> fileSystemDirAccess.rename(from, to) + } + } + + fun remove(nativeAccessType: Int, filename: String): Boolean { + val accessType = getAccessTypeFromNative(nativeAccessType) ?: return false + return when (accessType) { + ACCESS_RESOURCES -> assetsDirAccess.remove(filename) + ACCESS_FILESYSTEM -> fileSystemDirAccess.remove(filename) + } + } + +} diff --git a/platform/android/java/lib/src/org/godotengine/godot/io/directory/FilesystemDirectoryAccess.kt b/platform/android/java/lib/src/org/godotengine/godot/io/directory/FilesystemDirectoryAccess.kt new file mode 100644 index 0000000000..c3acf42568 --- /dev/null +++ b/platform/android/java/lib/src/org/godotengine/godot/io/directory/FilesystemDirectoryAccess.kt @@ -0,0 +1,230 @@ +/*************************************************************************/ +/* FileSystemDirectoryAccess.kt */ +/*************************************************************************/ +/* 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. */ +/*************************************************************************/ + +package org.godotengine.godot.io.directory + +import android.annotation.SuppressLint +import android.content.Context +import android.os.Build +import android.os.storage.StorageManager +import android.util.Log +import android.util.SparseArray +import org.godotengine.godot.io.StorageScope +import org.godotengine.godot.io.directory.DirectoryAccessHandler.Companion.INVALID_DIR_ID +import org.godotengine.godot.io.directory.DirectoryAccessHandler.Companion.STARTING_DIR_ID +import org.godotengine.godot.io.file.FileAccessHandler +import java.io.File + +/** + * Handles directories access with the internal and external filesystem. + */ +internal class FilesystemDirectoryAccess(private val context: Context): + DirectoryAccessHandler.DirectoryAccess { + + companion object { + private val TAG = FilesystemDirectoryAccess::class.java.simpleName + } + + private data class DirData(val dirFile: File, val files: Array<File>, var current: Int = 0) + + private val storageManager = context.getSystemService(Context.STORAGE_SERVICE) as StorageManager + private var lastDirId = STARTING_DIR_ID + private val dirs = SparseArray<DirData>() + + private fun inScope(path: String): Boolean { + // Directory access is available for shared storage on Android 11+ + // On Android 10, access is also available as long as the `requestLegacyExternalStorage` + // tag is available. + return StorageScope.getStorageScope(context, path) != StorageScope.UNKNOWN + } + + override fun hasDirId(dirId: Int) = dirs.indexOfKey(dirId) >= 0 + + override fun dirOpen(path: String): Int { + if (!inScope(path)) { + Log.w(TAG, "Path $path is not accessible.") + return INVALID_DIR_ID + } + + // Check this is a directory. + val dirFile = File(path) + if (!dirFile.isDirectory) { + return INVALID_DIR_ID + } + + // Get the files in the directory + val files = dirFile.listFiles()?: return INVALID_DIR_ID + + // Create the data representing this directory + val dirData = DirData(dirFile, files) + + dirs.put(++lastDirId, dirData) + return lastDirId + } + + override fun dirExists(path: String): Boolean { + if (!inScope(path)) { + Log.w(TAG, "Path $path is not accessible.") + return false + } + + try { + return File(path).isDirectory + } catch (e: SecurityException) { + return false + } + } + + override fun fileExists(path: String) = FileAccessHandler.fileExists(context, path) + + override fun dirNext(dirId: Int): String { + val dirData = dirs[dirId] + if (dirData.current >= dirData.files.size) { + dirData.current++ + return "" + } + + return dirData.files[dirData.current++].name + } + + override fun dirClose(dirId: Int) { + dirs.remove(dirId) + } + + override fun dirIsDir(dirId: Int): Boolean { + val dirData = dirs[dirId] + + var index = dirData.current + if (index > 0) { + index-- + } + + if (index >= dirData.files.size) { + return false + } + + return dirData.files[index].isDirectory + } + + override fun isCurrentHidden(dirId: Int): Boolean { + val dirData = dirs[dirId] + + var index = dirData.current + if (index > 0) { + index-- + } + + if (index >= dirData.files.size) { + return false + } + + return dirData.files[index].isHidden + } + + override fun getDriveCount(): Int { + return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { + storageManager.storageVolumes.size + } else { + 0 + } + } + + override fun getDrive(drive: Int): String { + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N) { + return "" + } + + if (drive < 0 || drive >= storageManager.storageVolumes.size) { + return "" + } + + val storageVolume = storageManager.storageVolumes[drive] + return storageVolume.getDescription(context) + } + + override fun makeDir(dir: String): Boolean { + if (!inScope(dir)) { + Log.w(TAG, "Directory $dir is not accessible.") + return false + } + + try { + val dirFile = File(dir) + return dirFile.isDirectory || dirFile.mkdirs() + } catch (e: SecurityException) { + return false + } + } + + @SuppressLint("UsableSpace") + override fun getSpaceLeft() = context.getExternalFilesDir(null)?.usableSpace ?: 0L + + override fun rename(from: String, to: String): Boolean { + if (!inScope(from) || !inScope(to)) { + Log.w(TAG, "Argument filenames are not accessible:\n" + + "from: $from\n" + + "to: $to") + return false + } + + return try { + val fromFile = File(from) + if (fromFile.isDirectory) { + fromFile.renameTo(File(to)) + } else { + FileAccessHandler.renameFile(context, from, to) + } + } catch (e: SecurityException) { + false + } + } + + override fun remove(filename: String): Boolean { + if (!inScope(filename)) { + Log.w(TAG, "Filename $filename is not accessible.") + return false + } + + return try { + val deleteFile = File(filename) + if (deleteFile.exists()) { + if (deleteFile.isDirectory) { + deleteFile.delete() + } else { + FileAccessHandler.removeFile(context, filename) + } + } else { + true + } + } catch (e: SecurityException) { + false + } + } +} diff --git a/platform/android/java/lib/src/org/godotengine/godot/io/file/DataAccess.kt b/platform/android/java/lib/src/org/godotengine/godot/io/file/DataAccess.kt new file mode 100644 index 0000000000..aef1bed8ce --- /dev/null +++ b/platform/android/java/lib/src/org/godotengine/godot/io/file/DataAccess.kt @@ -0,0 +1,186 @@ +/*************************************************************************/ +/* DataAccess.kt */ +/*************************************************************************/ +/* 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. */ +/*************************************************************************/ + +package org.godotengine.godot.io.file + +import android.content.Context +import android.os.Build +import android.util.Log +import org.godotengine.godot.io.StorageScope +import java.io.IOException +import java.nio.ByteBuffer +import java.nio.channels.FileChannel +import kotlin.math.max + +/** + * Base class for file IO operations. + * + * Its derived instances provide concrete implementations to handle regular file access, as well + * as file access through the media store API on versions of Android were scoped storage is enabled. + */ +internal abstract class DataAccess(private val filePath: String) { + + companion object { + private val TAG = DataAccess::class.java.simpleName + + fun generateDataAccess( + storageScope: StorageScope, + context: Context, + filePath: String, + accessFlag: FileAccessFlags + ): DataAccess? { + return when (storageScope) { + StorageScope.APP -> FileData(filePath, accessFlag) + + StorageScope.SHARED -> if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { + MediaStoreData(context, filePath, accessFlag) + } else { + null + } + + StorageScope.UNKNOWN -> null + } + } + + fun fileExists(storageScope: StorageScope, context: Context, path: String): Boolean { + return when(storageScope) { + StorageScope.APP -> FileData.fileExists(path) + StorageScope.SHARED -> MediaStoreData.fileExists(context, path) + StorageScope.UNKNOWN -> false + } + } + + fun fileLastModified(storageScope: StorageScope, context: Context, path: String): Long { + return when(storageScope) { + StorageScope.APP -> FileData.fileLastModified(path) + StorageScope.SHARED -> MediaStoreData.fileLastModified(context, path) + StorageScope.UNKNOWN -> 0L + } + } + + fun removeFile(storageScope: StorageScope, context: Context, path: String): Boolean { + return when(storageScope) { + StorageScope.APP -> FileData.delete(path) + StorageScope.SHARED -> MediaStoreData.delete(context, path) + StorageScope.UNKNOWN -> false + } + } + + fun renameFile(storageScope: StorageScope, context: Context, from: String, to: String): Boolean { + return when(storageScope) { + StorageScope.APP -> FileData.rename(from, to) + StorageScope.SHARED -> MediaStoreData.rename(context, from, to) + StorageScope.UNKNOWN -> false + } + } + } + + protected abstract val fileChannel: FileChannel + internal var endOfFile = false + private set + + fun close() { + try { + fileChannel.close() + } catch (e: IOException) { + Log.w(TAG, "Exception when closing file $filePath.", e) + } + } + + fun flush() { + try { + fileChannel.force(false) + } catch (e: IOException) { + Log.w(TAG, "Exception when flushing file $filePath.", e) + } + } + + fun seek(position: Long) { + try { + fileChannel.position(position) + if (position <= size()) { + endOfFile = false + } + } catch (e: Exception) { + Log.w(TAG, "Exception when seeking file $filePath.", e) + } + } + + fun seekFromEnd(positionFromEnd: Long) { + val positionFromBeginning = max(0, size() - positionFromEnd) + seek(positionFromBeginning) + } + + fun position(): Long { + return try { + fileChannel.position() + } catch (e: IOException) { + Log.w( + TAG, + "Exception when retrieving position for file $filePath.", + e + ) + 0L + } + } + + fun size() = try { + fileChannel.size() + } catch (e: IOException) { + Log.w(TAG, "Exception when retrieving size for file $filePath.", e) + 0L + } + + fun read(buffer: ByteBuffer): Int { + return try { + val readBytes = fileChannel.read(buffer) + if (readBytes == -1) { + endOfFile = true + 0 + } else { + readBytes + } + } catch (e: IOException) { + Log.w(TAG, "Exception while reading from file $filePath.", e) + 0 + } + } + + fun write(buffer: ByteBuffer) { + try { + val writtenBytes = fileChannel.write(buffer) + if (writtenBytes > 0) { + endOfFile = false + } + } catch (e: IOException) { + Log.w(TAG, "Exception while writing to file $filePath.", e) + } + } +} diff --git a/platform/android/java/lib/src/org/godotengine/godot/io/file/FileAccessFlags.kt b/platform/android/java/lib/src/org/godotengine/godot/io/file/FileAccessFlags.kt new file mode 100644 index 0000000000..c6b242a4b6 --- /dev/null +++ b/platform/android/java/lib/src/org/godotengine/godot/io/file/FileAccessFlags.kt @@ -0,0 +1,87 @@ +/*************************************************************************/ +/* FileAccessFlags.kt */ +/*************************************************************************/ +/* 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. */ +/*************************************************************************/ + +package org.godotengine.godot.io.file + +/** + * Android representation of Godot native access flags. + */ +internal enum class FileAccessFlags(val nativeValue: Int) { + /** + * Opens the file for read operations. + * The cursor is positioned at the beginning of the file. + */ + READ(1), + + /** + * Opens the file for write operations. + * The file is created if it does not exist, and truncated if it does. + */ + WRITE(2), + + /** + * Opens the file for read and write operations. + * Does not truncate the file. The cursor is positioned at the beginning of the file. + */ + READ_WRITE(3), + + /** + * Opens the file for read and write operations. + * The file is created if it does not exist, and truncated if it does. + * The cursor is positioned at the beginning of the file. + */ + WRITE_READ(7); + + fun getMode(): String { + return when (this) { + READ -> "r" + WRITE -> "w" + READ_WRITE, WRITE_READ -> "rw" + } + } + + fun shouldTruncate(): Boolean { + return when (this) { + READ, READ_WRITE -> false + WRITE, WRITE_READ -> true + } + } + + companion object { + fun fromNativeModeFlags(modeFlag: Int): FileAccessFlags? { + for (flag in values()) { + if (flag.nativeValue == modeFlag) { + return flag + } + } + return null + } + } +} diff --git a/platform/android/java/lib/src/org/godotengine/godot/io/file/FileAccessHandler.kt b/platform/android/java/lib/src/org/godotengine/godot/io/file/FileAccessHandler.kt new file mode 100644 index 0000000000..a4e0a82d6e --- /dev/null +++ b/platform/android/java/lib/src/org/godotengine/godot/io/file/FileAccessHandler.kt @@ -0,0 +1,202 @@ +/*************************************************************************/ +/* FileAccessHandler.kt */ +/*************************************************************************/ +/* 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. */ +/*************************************************************************/ + +package org.godotengine.godot.io.file + +import android.content.Context +import android.util.Log +import android.util.SparseArray +import org.godotengine.godot.io.StorageScope +import java.io.FileNotFoundException +import java.nio.ByteBuffer + +/** + * Handles regular and media store file access and interactions. + */ +class FileAccessHandler(val context: Context) { + + companion object { + private val TAG = FileAccessHandler::class.java.simpleName + + private const val FILE_NOT_FOUND_ERROR_ID = -1 + private const val INVALID_FILE_ID = 0 + private const val STARTING_FILE_ID = 1 + + fun fileExists(context: Context, path: String?): Boolean { + val storageScope = StorageScope.getStorageScope(context, path) + if (storageScope == StorageScope.UNKNOWN) { + return false + } + + return try { + DataAccess.fileExists(storageScope, context, path!!) + } catch (e: SecurityException) { + false + } + } + + fun removeFile(context: Context, path: String?): Boolean { + val storageScope = StorageScope.getStorageScope(context, path) + if (storageScope == StorageScope.UNKNOWN) { + return false + } + + return try { + DataAccess.removeFile(storageScope, context, path!!) + } catch (e: Exception) { + false + } + } + + fun renameFile(context: Context, from: String?, to: String?): Boolean { + val storageScope = StorageScope.getStorageScope(context, from) + if (storageScope == StorageScope.UNKNOWN) { + return false + } + + return try { + DataAccess.renameFile(storageScope, context, from!!, to!!) + } catch (e: Exception) { + false + } + } + } + + private val files = SparseArray<DataAccess>() + private var lastFileId = STARTING_FILE_ID + + private fun hasFileId(fileId: Int) = files.indexOfKey(fileId) >= 0 + + fun fileOpen(path: String?, modeFlags: Int): Int { + val storageScope = StorageScope.getStorageScope(context, path) + if (storageScope == StorageScope.UNKNOWN) { + return INVALID_FILE_ID + } + + try { + val accessFlag = FileAccessFlags.fromNativeModeFlags(modeFlags) ?: return INVALID_FILE_ID + val dataAccess = DataAccess.generateDataAccess(storageScope, context, path!!, accessFlag) ?: return INVALID_FILE_ID + + files.put(++lastFileId, dataAccess) + return lastFileId + } catch (e: FileNotFoundException) { + return FILE_NOT_FOUND_ERROR_ID + } catch (e: Exception) { + Log.w(TAG, "Error while opening $path", e) + return INVALID_FILE_ID + } + } + + fun fileGetSize(fileId: Int): Long { + if (!hasFileId(fileId)) { + return 0L + } + + return files[fileId].size() + } + + fun fileSeek(fileId: Int, position: Long) { + if (!hasFileId(fileId)) { + return + } + + files[fileId].seek(position) + } + + fun fileSeekFromEnd(fileId: Int, position: Long) { + if (!hasFileId(fileId)) { + return + } + + files[fileId].seekFromEnd(position) + } + + fun fileRead(fileId: Int, byteBuffer: ByteBuffer?): Int { + if (!hasFileId(fileId) || byteBuffer == null) { + return 0 + } + + return files[fileId].read(byteBuffer) + } + + fun fileWrite(fileId: Int, byteBuffer: ByteBuffer?) { + if (!hasFileId(fileId) || byteBuffer == null) { + return + } + + files[fileId].write(byteBuffer) + } + + fun fileFlush(fileId: Int) { + if (!hasFileId(fileId)) { + return + } + + files[fileId].flush() + } + + fun fileExists(path: String?) = Companion.fileExists(context, path) + + fun fileLastModified(filepath: String?): Long { + val storageScope = StorageScope.getStorageScope(context, filepath) + if (storageScope == StorageScope.UNKNOWN) { + return 0L + } + + return try { + DataAccess.fileLastModified(storageScope, context, filepath!!) + } catch (e: SecurityException) { + 0L + } + } + + fun fileGetPosition(fileId: Int): Long { + if (!hasFileId(fileId)) { + return 0L + } + + return files[fileId].position() + } + + fun isFileEof(fileId: Int): Boolean { + if (!hasFileId(fileId)) { + return false + } + + return files[fileId].endOfFile + } + + fun fileClose(fileId: Int) { + if (hasFileId(fileId)) { + files[fileId].close() + files.remove(fileId) + } + } +} diff --git a/platform/android/java/lib/src/org/godotengine/godot/io/file/FileData.kt b/platform/android/java/lib/src/org/godotengine/godot/io/file/FileData.kt new file mode 100644 index 0000000000..5af694ad99 --- /dev/null +++ b/platform/android/java/lib/src/org/godotengine/godot/io/file/FileData.kt @@ -0,0 +1,93 @@ +/*************************************************************************/ +/* FileData.kt */ +/*************************************************************************/ +/* 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. */ +/*************************************************************************/ + +package org.godotengine.godot.io.file + +import java.io.File +import java.io.FileOutputStream +import java.io.RandomAccessFile +import java.nio.channels.FileChannel + +/** + * Implementation of [DataAccess] which handles regular (not scoped) file access and interactions. + */ +internal class FileData(filePath: String, accessFlag: FileAccessFlags) : DataAccess(filePath) { + + companion object { + private val TAG = FileData::class.java.simpleName + + fun fileExists(path: String): Boolean { + return try { + File(path).isFile + } catch (e: SecurityException) { + false + } + } + + fun fileLastModified(filepath: String): Long { + return try { + File(filepath).lastModified() + } catch (e: SecurityException) { + 0L + } + } + + fun delete(filepath: String): Boolean { + return try { + File(filepath).delete() + } catch (e: Exception) { + false + } + } + + fun rename(from: String, to: String): Boolean { + return try { + val fromFile = File(from) + fromFile.renameTo(File(to)) + } catch (e: Exception) { + false + } + } + } + + override val fileChannel: FileChannel + + init { + if (accessFlag == FileAccessFlags.WRITE) { + fileChannel = FileOutputStream(filePath, !accessFlag.shouldTruncate()).channel + } else { + fileChannel = RandomAccessFile(filePath, accessFlag.getMode()).channel + } + + if (accessFlag.shouldTruncate()) { + fileChannel.truncate(0) + } + } +} diff --git a/platform/android/java/lib/src/org/godotengine/godot/io/file/MediaStoreData.kt b/platform/android/java/lib/src/org/godotengine/godot/io/file/MediaStoreData.kt new file mode 100644 index 0000000000..81a7dd1705 --- /dev/null +++ b/platform/android/java/lib/src/org/godotengine/godot/io/file/MediaStoreData.kt @@ -0,0 +1,284 @@ +/*************************************************************************/ +/* MediaStoreData.kt */ +/*************************************************************************/ +/* 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. */ +/*************************************************************************/ + +package org.godotengine.godot.io.file + +import android.content.ContentUris +import android.content.ContentValues +import android.content.Context +import android.database.Cursor +import android.net.Uri +import android.os.Build +import android.os.Environment +import android.provider.MediaStore +import androidx.annotation.RequiresApi + +import java.io.File +import java.io.FileInputStream +import java.io.FileNotFoundException +import java.io.FileOutputStream +import java.nio.channels.FileChannel + +/** + * Implementation of [DataAccess] which handles access and interactions with file and data + * under scoped storage via the MediaStore API. + */ +@RequiresApi(Build.VERSION_CODES.Q) +internal class MediaStoreData(context: Context, filePath: String, accessFlag: FileAccessFlags) : + DataAccess(filePath) { + + private data class DataItem( + val id: Long, + val uri: Uri, + val displayName: String, + val relativePath: String, + val size: Int, + val dateModified: Int, + val mediaType: Int + ) + + companion object { + private val TAG = MediaStoreData::class.java.simpleName + + private val COLLECTION = MediaStore.Files.getContentUri(MediaStore.VOLUME_EXTERNAL_PRIMARY) + + private val PROJECTION = arrayOf( + MediaStore.Files.FileColumns._ID, + MediaStore.Files.FileColumns.DISPLAY_NAME, + MediaStore.Files.FileColumns.RELATIVE_PATH, + MediaStore.Files.FileColumns.SIZE, + MediaStore.Files.FileColumns.DATE_MODIFIED, + MediaStore.Files.FileColumns.MEDIA_TYPE, + ) + + private const val SELECTION_BY_PATH = "${MediaStore.Files.FileColumns.DISPLAY_NAME} = ? " + + " AND ${MediaStore.Files.FileColumns.RELATIVE_PATH} = ?" + + private fun getSelectionByPathArguments(path: String): Array<String> { + return arrayOf(getMediaStoreDisplayName(path), getMediaStoreRelativePath(path)) + } + + private const val SELECTION_BY_ID = "${MediaStore.Files.FileColumns._ID} = ? " + + private fun getSelectionByIdArgument(id: Long) = arrayOf(id.toString()) + + private fun getMediaStoreDisplayName(path: String) = File(path).name + + private fun getMediaStoreRelativePath(path: String): String { + val pathFile = File(path) + val environmentDir = Environment.getExternalStorageDirectory() + var relativePath = (pathFile.parent?.replace(environmentDir.absolutePath, "") ?: "").trim('/') + if (relativePath.isNotBlank()) { + relativePath += "/" + } + return relativePath + } + + private fun queryById(context: Context, id: Long): List<DataItem> { + val query = context.contentResolver.query( + COLLECTION, + PROJECTION, + SELECTION_BY_ID, + getSelectionByIdArgument(id), + null + ) + return dataItemFromCursor(query) + } + + private fun queryByPath(context: Context, path: String): List<DataItem> { + val query = context.contentResolver.query( + COLLECTION, + PROJECTION, + SELECTION_BY_PATH, + getSelectionByPathArguments(path), + null + ) + return dataItemFromCursor(query) + } + + private fun dataItemFromCursor(query: Cursor?): List<DataItem> { + query?.use { cursor -> + cursor.count + if (cursor.count == 0) { + return emptyList() + } + val idColumn = cursor.getColumnIndexOrThrow(MediaStore.Files.FileColumns._ID) + val displayNameColumn = + cursor.getColumnIndexOrThrow(MediaStore.Files.FileColumns.DISPLAY_NAME) + val relativePathColumn = + cursor.getColumnIndexOrThrow(MediaStore.Files.FileColumns.RELATIVE_PATH) + val sizeColumn = cursor.getColumnIndexOrThrow(MediaStore.Files.FileColumns.SIZE) + val dateModifiedColumn = + cursor.getColumnIndexOrThrow(MediaStore.Files.FileColumns.DATE_MODIFIED) + val mediaTypeColumn = cursor.getColumnIndexOrThrow(MediaStore.Files.FileColumns.MEDIA_TYPE) + + val result = ArrayList<DataItem>() + while (cursor.moveToNext()) { + val id = cursor.getLong(idColumn) + result.add( + DataItem( + id, + ContentUris.withAppendedId(COLLECTION, id), + cursor.getString(displayNameColumn), + cursor.getString(relativePathColumn), + cursor.getInt(sizeColumn), + cursor.getInt(dateModifiedColumn), + cursor.getInt(mediaTypeColumn) + ) + ) + } + return result + } + return emptyList() + } + + private fun addFile(context: Context, path: String): DataItem? { + val fileDetails = ContentValues().apply { + put(MediaStore.Files.FileColumns._ID, 0) + put(MediaStore.Files.FileColumns.DISPLAY_NAME, getMediaStoreDisplayName(path)) + put(MediaStore.Files.FileColumns.RELATIVE_PATH, getMediaStoreRelativePath(path)) + } + + context.contentResolver.insert(COLLECTION, fileDetails) ?: return null + + // File was successfully added, let's retrieve its info + val infos = queryByPath(context, path) + if (infos.isEmpty()) { + return null + } + + return infos[0] + } + + fun delete(context: Context, path: String): Boolean { + val itemsToDelete = queryByPath(context, path) + if (itemsToDelete.isEmpty()) { + return false + } + + val resolver = context.contentResolver + var itemsDeleted = 0 + for (item in itemsToDelete) { + itemsDeleted += resolver.delete(item.uri, null, null) + } + + return itemsDeleted > 0 + } + + fun fileExists(context: Context, path: String): Boolean { + return queryByPath(context, path).isNotEmpty() + } + + fun fileLastModified(context: Context, path: String): Long { + val result = queryByPath(context, path) + if (result.isEmpty()) { + return 0L + } + + val dataItem = result[0] + return dataItem.dateModified.toLong() + } + + fun rename(context: Context, from: String, to: String): Boolean { + // Ensure the source exists. + val sources = queryByPath(context, from) + if (sources.isEmpty()) { + return false + } + + // Take the first source + val source = sources[0] + + // Set up the updated values + val updatedDetails = ContentValues().apply { + put(MediaStore.Files.FileColumns.DISPLAY_NAME, getMediaStoreDisplayName(to)) + put(MediaStore.Files.FileColumns.RELATIVE_PATH, getMediaStoreRelativePath(to)) + } + + val updated = context.contentResolver.update( + source.uri, + updatedDetails, + SELECTION_BY_ID, + getSelectionByIdArgument(source.id) + ) + return updated > 0 + } + } + + private val id: Long + private val uri: Uri + override val fileChannel: FileChannel + + init { + val contentResolver = context.contentResolver + val dataItems = queryByPath(context, filePath) + + val dataItem = when (accessFlag) { + FileAccessFlags.READ -> { + // The file should already exist + if (dataItems.isEmpty()) { + throw FileNotFoundException("Unable to access file $filePath") + } + + val dataItem = dataItems[0] + dataItem + } + + FileAccessFlags.WRITE, FileAccessFlags.READ_WRITE, FileAccessFlags.WRITE_READ -> { + // Create the file if it doesn't exist + val dataItem = if (dataItems.isEmpty()) { + addFile(context, filePath) + } else { + dataItems[0] + } + + if (dataItem == null) { + throw FileNotFoundException("Unable to access file $filePath") + } + dataItem + } + } + + id = dataItem.id + uri = dataItem.uri + + val parcelFileDescriptor = contentResolver.openFileDescriptor(uri, accessFlag.getMode()) + ?: throw IllegalStateException("Unable to access file descriptor") + fileChannel = if (accessFlag == FileAccessFlags.READ) { + FileInputStream(parcelFileDescriptor.fileDescriptor).channel + } else { + FileOutputStream(parcelFileDescriptor.fileDescriptor).channel + } + + if (accessFlag.shouldTruncate()) { + fileChannel.truncate(0) + } + } +} diff --git a/platform/android/java/lib/src/org/godotengine/godot/utils/PermissionsUtil.java b/platform/android/java/lib/src/org/godotengine/godot/utils/PermissionsUtil.java index e5b4f41153..57db0709f0 100644 --- a/platform/android/java/lib/src/org/godotengine/godot/utils/PermissionsUtil.java +++ b/platform/android/java/lib/src/org/godotengine/godot/utils/PermissionsUtil.java @@ -32,10 +32,14 @@ package org.godotengine.godot.utils; import android.Manifest; import android.app.Activity; +import android.content.Intent; import android.content.pm.PackageInfo; import android.content.pm.PackageManager; import android.content.pm.PermissionInfo; +import android.net.Uri; import android.os.Build; +import android.os.Environment; +import android.provider.Settings; import android.util.Log; import androidx.core.content.ContextCompat; @@ -53,7 +57,8 @@ public final class PermissionsUtil { static final int REQUEST_RECORD_AUDIO_PERMISSION = 1; static final int REQUEST_CAMERA_PERMISSION = 2; static final int REQUEST_VIBRATE_PERMISSION = 3; - static final int REQUEST_ALL_PERMISSION_REQ_CODE = 1001; + public static final int REQUEST_ALL_PERMISSION_REQ_CODE = 1001; + public static final int REQUEST_MANAGE_EXTERNAL_STORAGE_REQ_CODE = 2002; private PermissionsUtil() { } @@ -108,13 +113,26 @@ public final class PermissionsUtil { if (manifestPermissions.length == 0) return true; - List<String> dangerousPermissions = new ArrayList<>(); + List<String> requestedPermissions = new ArrayList<>(); for (String manifestPermission : manifestPermissions) { try { - PermissionInfo permissionInfo = getPermissionInfo(activity, manifestPermission); - int protectionLevel = Build.VERSION.SDK_INT >= Build.VERSION_CODES.P ? permissionInfo.getProtection() : permissionInfo.protectionLevel; - if (protectionLevel == PermissionInfo.PROTECTION_DANGEROUS && ContextCompat.checkSelfPermission(activity, manifestPermission) != PackageManager.PERMISSION_GRANTED) { - dangerousPermissions.add(manifestPermission); + if (manifestPermission.equals(Manifest.permission.MANAGE_EXTERNAL_STORAGE)) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R && !Environment.isExternalStorageManager()) { + try { + Intent intent = new Intent(Settings.ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION); + intent.setData(Uri.parse(String.format("package:%s", activity.getPackageName()))); + activity.startActivityForResult(intent, REQUEST_MANAGE_EXTERNAL_STORAGE_REQ_CODE); + } catch (Exception ignored) { + Intent intent = new Intent(Settings.ACTION_MANAGE_ALL_FILES_ACCESS_PERMISSION); + activity.startActivityForResult(intent, REQUEST_MANAGE_EXTERNAL_STORAGE_REQ_CODE); + } + } + } else { + PermissionInfo permissionInfo = getPermissionInfo(activity, manifestPermission); + int protectionLevel = Build.VERSION.SDK_INT >= Build.VERSION_CODES.P ? permissionInfo.getProtection() : permissionInfo.protectionLevel; + if (protectionLevel == PermissionInfo.PROTECTION_DANGEROUS && ContextCompat.checkSelfPermission(activity, manifestPermission) != PackageManager.PERMISSION_GRANTED) { + requestedPermissions.add(manifestPermission); + } } } catch (PackageManager.NameNotFoundException e) { // Skip this permission and continue. @@ -122,13 +140,12 @@ public final class PermissionsUtil { } } - if (dangerousPermissions.isEmpty()) { + if (requestedPermissions.isEmpty()) { // If list is empty, all of dangerous permissions were granted. return true; } - String[] requestedPermissions = dangerousPermissions.toArray(new String[0]); - activity.requestPermissions(requestedPermissions, REQUEST_ALL_PERMISSION_REQ_CODE); + activity.requestPermissions(requestedPermissions.toArray(new String[0]), REQUEST_ALL_PERMISSION_REQ_CODE); return false; } @@ -148,13 +165,19 @@ public final class PermissionsUtil { if (manifestPermissions.length == 0) return manifestPermissions; - List<String> dangerousPermissions = new ArrayList<>(); + List<String> grantedPermissions = new ArrayList<>(); for (String manifestPermission : manifestPermissions) { try { - PermissionInfo permissionInfo = getPermissionInfo(activity, manifestPermission); - int protectionLevel = Build.VERSION.SDK_INT >= Build.VERSION_CODES.P ? permissionInfo.getProtection() : permissionInfo.protectionLevel; - if (protectionLevel == PermissionInfo.PROTECTION_DANGEROUS && ContextCompat.checkSelfPermission(activity, manifestPermission) == PackageManager.PERMISSION_GRANTED) { - dangerousPermissions.add(manifestPermission); + if (manifestPermission.equals(Manifest.permission.MANAGE_EXTERNAL_STORAGE)) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R && Environment.isExternalStorageManager()) { + grantedPermissions.add(manifestPermission); + } + } else { + PermissionInfo permissionInfo = getPermissionInfo(activity, manifestPermission); + int protectionLevel = Build.VERSION.SDK_INT >= Build.VERSION_CODES.P ? permissionInfo.getProtection() : permissionInfo.protectionLevel; + if (protectionLevel == PermissionInfo.PROTECTION_DANGEROUS && ContextCompat.checkSelfPermission(activity, manifestPermission) == PackageManager.PERMISSION_GRANTED) { + grantedPermissions.add(manifestPermission); + } } } catch (PackageManager.NameNotFoundException e) { // Skip this permission and continue. @@ -162,7 +185,7 @@ public final class PermissionsUtil { } } - return dangerousPermissions.toArray(new String[0]); + return grantedPermissions.toArray(new String[0]); } /** @@ -177,7 +200,7 @@ public final class PermissionsUtil { if (permission.equals(p)) return true; } - } catch (PackageManager.NameNotFoundException e) { + } catch (PackageManager.NameNotFoundException ignored) { } return false; diff --git a/platform/android/java_godot_lib_jni.cpp b/platform/android/java_godot_lib_jni.cpp index 6e716c34a6..f4de4acfad 100644 --- a/platform/android/java_godot_lib_jni.cpp +++ b/platform/android/java_godot_lib_jni.cpp @@ -43,6 +43,7 @@ #include "dir_access_jandroid.h" #include "display_server_android.h" #include "file_access_android.h" +#include "file_access_filesystem_jandroid.h" #include "jni_utils.h" #include "main/main.h" #include "net_socket_android.h" @@ -78,13 +79,13 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_setVirtualKeyboardHei } } -JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_initialize(JNIEnv *env, jclass clazz, jobject activity, jobject godot_instance, jobject p_asset_manager, jboolean p_use_apk_expansion) { +JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_initialize(JNIEnv *env, jclass clazz, jobject p_activity, jobject p_godot_instance, jobject p_asset_manager, jobject p_godot_io, jobject p_net_utils, jobject p_directory_access_handler, jobject p_file_access_handler, jboolean p_use_apk_expansion, jobject p_godot_tts) { JavaVM *jvm; env->GetJavaVM(&jvm); // create our wrapper classes - godot_java = new GodotJavaWrapper(env, activity, godot_instance); - godot_io_java = new GodotIOJavaWrapper(env, godot_java->get_member_object("io", "Lorg/godotengine/godot/GodotIO;", env)); + godot_java = new GodotJavaWrapper(env, p_activity, p_godot_instance); + godot_io_java = new GodotIOJavaWrapper(env, p_godot_io); init_thread_jandroid(jvm, env); @@ -92,9 +93,10 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_initialize(JNIEnv *en FileAccessAndroid::asset_manager = AAssetManager_fromJava(env, amgr); - DirAccessJAndroid::setup(godot_io_java->get_instance()); - NetSocketAndroid::setup(godot_java->get_member_object("netUtils", "Lorg/godotengine/godot/utils/GodotNetUtils;", env)); - TTS_Android::setup(godot_java->get_member_object("tts", "Lorg/godotengine/godot/tts/GodotTTS;", env)); + DirAccessJAndroid::setup(p_directory_access_handler); + FileAccessFilesystemJAndroid::setup(p_file_access_handler); + NetSocketAndroid::setup(p_net_utils); + TTS_Android::setup(p_godot_tts); os_android = new OS_Android(godot_java, godot_io_java, p_use_apk_expansion); diff --git a/platform/android/java_godot_lib_jni.h b/platform/android/java_godot_lib_jni.h index aa8d67cf46..de16f197b8 100644 --- a/platform/android/java_godot_lib_jni.h +++ b/platform/android/java_godot_lib_jni.h @@ -37,7 +37,7 @@ // These functions can be called from within JAVA and are the means by which our JAVA implementation calls back into our C++ code. // See java/src/org/godotengine/godot/GodotLib.java for the JAVA side of this (yes that's why we have the long names) extern "C" { -JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_initialize(JNIEnv *env, jclass clazz, jobject activity, jobject godot_instance, jobject p_asset_manager, jboolean p_use_apk_expansion); +JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_initialize(JNIEnv *env, jclass clazz, jobject p_activity, jobject p_godot_instance, jobject p_asset_manager, jobject p_godot_io, jobject p_net_utils, jobject p_directory_access_handler, jobject p_file_access_handler, jboolean p_use_apk_expansion, jobject p_godot_tts); JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_ondestroy(JNIEnv *env, jclass clazz); JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_setup(JNIEnv *env, jclass clazz, jobjectArray p_cmdline); JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_resize(JNIEnv *env, jclass clazz, jobject p_surface, jint p_width, jint p_height); diff --git a/platform/android/os_android.cpp b/platform/android/os_android.cpp index 6674428de8..0f551e7f4f 100644 --- a/platform/android/os_android.cpp +++ b/platform/android/os_android.cpp @@ -40,6 +40,7 @@ #include "dir_access_jandroid.h" #include "file_access_android.h" +#include "file_access_filesystem_jandroid.h" #include "net_socket_android.h" #include <dlfcn.h> @@ -93,7 +94,7 @@ void OS_Android::initialize_core() { } #endif FileAccess::make_default<FileAccessUnix>(FileAccess::ACCESS_USERDATA); - FileAccess::make_default<FileAccessUnix>(FileAccess::ACCESS_FILESYSTEM); + FileAccess::make_default<FileAccessFilesystemJAndroid>(FileAccess::ACCESS_FILESYSTEM); #ifdef TOOLS_ENABLED DirAccess::make_default<DirAccessUnix>(DirAccess::ACCESS_RESOURCES); @@ -105,7 +106,7 @@ void OS_Android::initialize_core() { } #endif DirAccess::make_default<DirAccessUnix>(DirAccess::ACCESS_USERDATA); - DirAccess::make_default<DirAccessUnix>(DirAccess::ACCESS_FILESYSTEM); + DirAccess::make_default<DirAccessJAndroid>(DirAccess::ACCESS_FILESYSTEM); NetSocketAndroid::make_default(); } @@ -300,6 +301,33 @@ String OS_Android::get_system_dir(SystemDir p_dir, bool p_shared_storage) const return godot_io_java->get_system_dir(p_dir, p_shared_storage); } +Error OS_Android::move_to_trash(const String &p_path) { + Ref<DirAccess> da_ref = DirAccess::create_for_path(p_path); + if (da_ref.is_null()) { + return FAILED; + } + + // Check if it's a directory + if (da_ref->dir_exists(p_path)) { + Error err = da_ref->change_dir(p_path); + if (err) { + return err; + } + // This is directory, let's erase its contents + err = da_ref->erase_contents_recursive(); + if (err) { + return err; + } + // Remove the top directory + return da_ref->remove(p_path); + } else if (da_ref->file_exists(p_path)) { + // This is a file, let's remove it. + return da_ref->remove(p_path); + } else { + return FAILED; + } +} + void OS_Android::set_display_size(const Size2i &p_size) { display_size = p_size; } diff --git a/platform/android/os_android.h b/platform/android/os_android.h index 3f607eac48..96c06d715c 100644 --- a/platform/android/os_android.h +++ b/platform/android/os_android.h @@ -122,6 +122,8 @@ public: virtual String get_system_dir(SystemDir p_dir, bool p_shared_storage = true) const override; + virtual Error move_to_trash(const String &p_path) override; + void vibrate_handheld(int p_duration_ms) override; virtual String get_config_path() const override; diff --git a/platform/linuxbsd/display_server_x11.cpp b/platform/linuxbsd/display_server_x11.cpp index ce32674c88..b0f87484b9 100644 --- a/platform/linuxbsd/display_server_x11.cpp +++ b/platform/linuxbsd/display_server_x11.cpp @@ -196,6 +196,7 @@ bool DisplayServerX11::_refresh_device_info() { xi.absolute_devices.clear(); xi.touch_devices.clear(); + xi.pen_inverted_devices.clear(); int dev_count; XIDeviceInfo *info = XIQueryDevice(x11_display, XIAllDevices, &dev_count); @@ -205,7 +206,7 @@ bool DisplayServerX11::_refresh_device_info() { if (!dev->enabled) { continue; } - if (!(dev->use == XIMasterPointer || dev->use == XIFloatingSlave)) { + if (!(dev->use == XISlavePointer || dev->use == XIFloatingSlave)) { continue; } @@ -274,6 +275,7 @@ bool DisplayServerX11::_refresh_device_info() { xi.pen_pressure_range[dev->deviceid] = Vector2(pressure_min, pressure_max); xi.pen_tilt_x_range[dev->deviceid] = Vector2(tilt_x_min, tilt_x_max); xi.pen_tilt_y_range[dev->deviceid] = Vector2(tilt_y_min, tilt_y_max); + xi.pen_inverted_devices[dev->deviceid] = (bool)strstr(dev->name, "eraser"); } XIFreeDeviceInfo(info); @@ -3484,7 +3486,7 @@ void DisplayServerX11::process_events() { } break; case XI_RawMotion: { XIRawEvent *raw_event = (XIRawEvent *)event_data; - int device_id = raw_event->deviceid; + int device_id = raw_event->sourceid; // Determine the axis used (called valuators in XInput for some forsaken reason) // Mask is a bitmask indicating which axes are involved. @@ -3550,6 +3552,11 @@ void DisplayServerX11::process_events() { values++; } + HashMap<int, bool>::Iterator pen_inverted = xi.pen_inverted_devices.find(device_id); + if (pen_inverted) { + xi.pen_inverted = pen_inverted->value; + } + // https://bugs.freedesktop.org/show_bug.cgi?id=71609 // http://lists.libsdl.org/pipermail/commits-libsdl.org/2015-June/000282.html if (raw_event->time == xi.last_relative_time && rel_x == xi.relative_motion.x && rel_y == xi.relative_motion.y) { @@ -3984,6 +3991,7 @@ void DisplayServerX11::process_events() { mm->set_pressure(bool(mouse_get_button_state() & MouseButton::MASK_LEFT) ? 1.0f : 0.0f); } mm->set_tilt(xi.tilt); + mm->set_pen_inverted(xi.pen_inverted); _get_key_modifier_state(event.xmotion.state, mm); mm->set_button_mask((MouseButton)mouse_get_button_state()); @@ -4167,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/linuxbsd/display_server_x11.h b/platform/linuxbsd/display_server_x11.h index a87f2bb6e1..9ce6a557db 100644 --- a/platform/linuxbsd/display_server_x11.h +++ b/platform/linuxbsd/display_server_x11.h @@ -201,10 +201,12 @@ class DisplayServerX11 : public DisplayServer { HashMap<int, Vector2> pen_pressure_range; HashMap<int, Vector2> pen_tilt_x_range; HashMap<int, Vector2> pen_tilt_y_range; + HashMap<int, bool> pen_inverted_devices; XIEventMask all_event_mask; HashMap<int, Vector2> state; double pressure; bool pressure_supported; + bool pen_inverted; Vector2 tilt; Vector2 mouse_pos_to_filter; Vector2 relative_motion; 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_content_view.h b/platform/osx/godot_content_view.h index 7942d716dc..353305aec1 100644 --- a/platform/osx/godot_content_view.h +++ b/platform/osx/godot_content_view.h @@ -52,6 +52,7 @@ bool ime_input_event_in_progress; bool mouse_down_control; bool ignore_momentum_scroll; + bool last_pen_inverted; } - (void)processScrollEvent:(NSEvent *)event button:(MouseButton)button factor:(double)factor; diff --git a/platform/osx/godot_content_view.mm b/platform/osx/godot_content_view.mm index e96f0a8098..018b90e629 100644 --- a/platform/osx/godot_content_view.mm +++ b/platform/osx/godot_content_view.mm @@ -42,6 +42,7 @@ ime_input_event_in_progress = false; mouse_down_control = false; ignore_momentum_scroll = false; + last_pen_inverted = false; [self updateTrackingAreas]; if (@available(macOS 10.13, *)) { @@ -377,9 +378,15 @@ ds->update_mouse_pos(wd, mpos); mm->set_position(wd.mouse_pos); mm->set_pressure([event pressure]); - if ([event subtype] == NSEventSubtypeTabletPoint) { + NSEventSubtype subtype = [event subtype]; + if (subtype == NSEventSubtypeTabletPoint) { const NSPoint p = [event tilt]; mm->set_tilt(Vector2(p.x, p.y)); + mm->set_pen_inverted(last_pen_inverted); + } else if (subtype == NSEventSubtypeTabletProximity) { + // Check if using the eraser end of pen only on proximity event. + last_pen_inverted = [event pointingDeviceType] == NSPointingDeviceTypeEraser; + mm->set_pen_inverted(last_pen_inverted); } mm->set_global_position(wd.mouse_pos); mm->set_velocity(Input::get_singleton()->get_last_mouse_velocity()); diff --git a/platform/windows/display_server_windows.cpp b/platform/windows/display_server_windows.cpp index 998b0882b3..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 } @@ -2490,6 +2492,8 @@ LRESULT DisplayServerWindows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARA windows[window_id].last_tilt = Vector2(); } + windows[window_id].last_pen_inverted = packet.pkStatus & TPS_INVERT; + POINT coords; GetCursorPos(&coords); ScreenToClient(windows[window_id].hWnd, &coords); @@ -2508,6 +2512,7 @@ LRESULT DisplayServerWindows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARA mm->set_pressure(windows[window_id].last_pressure); mm->set_tilt(windows[window_id].last_tilt); + mm->set_pen_inverted(windows[window_id].last_pen_inverted); mm->set_button_mask(last_button_state); @@ -2640,6 +2645,7 @@ LRESULT DisplayServerWindows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARA if ((pen_info.penMask & PEN_MASK_TILT_X) && (pen_info.penMask & PEN_MASK_TILT_Y)) { mm->set_tilt(Vector2((float)pen_info.tiltX / 90, (float)pen_info.tiltY / 90)); } + mm->set_pen_inverted(pen_info.penFlags & (PEN_FLAG_INVERTED | PEN_FLAG_ERASER)); mm->set_ctrl_pressed(GetKeyState(VK_CONTROL) < 0); mm->set_shift_pressed(GetKeyState(VK_SHIFT) < 0); @@ -2742,14 +2748,17 @@ LRESULT DisplayServerWindows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARA } else { windows[window_id].last_tilt = Vector2(); windows[window_id].last_pressure = (wParam & MK_LBUTTON) ? 1.0f : 0.0f; + windows[window_id].last_pen_inverted = false; } } else { windows[window_id].last_tilt = Vector2(); windows[window_id].last_pressure = (wParam & MK_LBUTTON) ? 1.0f : 0.0f; + windows[window_id].last_pen_inverted = false; } mm->set_pressure(windows[window_id].last_pressure); mm->set_tilt(windows[window_id].last_tilt); + mm->set_pen_inverted(windows[window_id].last_pen_inverted); mm->set_button_mask(last_button_state); @@ -3360,8 +3369,8 @@ void DisplayServerWindows::_update_tablet_ctx(const String &p_old_driver, const if ((p_new_driver == "wintab") && wintab_available) { wintab_WTInfo(WTI_DEFSYSCTX, 0, &wd.wtlc); wd.wtlc.lcOptions |= CXO_MESSAGES; - wd.wtlc.lcPktData = PK_NORMAL_PRESSURE | PK_TANGENT_PRESSURE | PK_ORIENTATION; - wd.wtlc.lcMoveMask = PK_NORMAL_PRESSURE | PK_TANGENT_PRESSURE; + wd.wtlc.lcPktData = PK_STATUS | PK_NORMAL_PRESSURE | PK_TANGENT_PRESSURE | PK_ORIENTATION; + wd.wtlc.lcMoveMask = PK_STATUS | PK_NORMAL_PRESSURE | PK_TANGENT_PRESSURE; wd.wtlc.lcPktMode = 0; wd.wtlc.lcOutOrgX = 0; wd.wtlc.lcOutExtX = wd.wtlc.lcInExtX; @@ -3484,8 +3493,8 @@ DisplayServer::WindowID DisplayServerWindows::_create_window(WindowMode p_mode, if ((tablet_get_current_driver() == "wintab") && wintab_available) { wintab_WTInfo(WTI_DEFSYSCTX, 0, &wd.wtlc); wd.wtlc.lcOptions |= CXO_MESSAGES; - wd.wtlc.lcPktData = PK_NORMAL_PRESSURE | PK_TANGENT_PRESSURE | PK_ORIENTATION; - wd.wtlc.lcMoveMask = PK_NORMAL_PRESSURE | PK_TANGENT_PRESSURE; + wd.wtlc.lcPktData = PK_STATUS | PK_NORMAL_PRESSURE | PK_TANGENT_PRESSURE | PK_ORIENTATION; + wd.wtlc.lcMoveMask = PK_STATUS | PK_NORMAL_PRESSURE | PK_TANGENT_PRESSURE; wd.wtlc.lcPktMode = 0; wd.wtlc.lcOutOrgX = 0; wd.wtlc.lcOutExtX = wd.wtlc.lcInExtX; diff --git a/platform/windows/display_server_windows.h b/platform/windows/display_server_windows.h index fc89517774..0429bed3a0 100644 --- a/platform/windows/display_server_windows.h +++ b/platform/windows/display_server_windows.h @@ -82,10 +82,13 @@ #define DVC_ROTATION 18 #define CXO_MESSAGES 0x0004 +#define PK_STATUS 0x0002 #define PK_NORMAL_PRESSURE 0x0400 #define PK_TANGENT_PRESSURE 0x0800 #define PK_ORIENTATION 0x1000 +#define TPS_INVERT 0x0010 /* 1.1 */ + typedef struct tagLOGCONTEXTW { WCHAR lcName[40]; UINT lcOptions; @@ -137,6 +140,7 @@ typedef struct tagORIENTATION { } ORIENTATION; typedef struct tagPACKET { + int pkStatus; int pkNormalPressure; int pkTangentPressure; ORIENTATION pkOrientation; @@ -158,6 +162,14 @@ typedef UINT32 POINTER_FLAGS; typedef UINT32 PEN_FLAGS; typedef UINT32 PEN_MASK; +#ifndef PEN_FLAG_INVERTED +#define PEN_FLAG_INVERTED 0x00000002 +#endif + +#ifndef PEN_FLAG_ERASER +#define PEN_FLAG_ERASER 0x00000004 +#endif + #ifndef PEN_MASK_PRESSURE #define PEN_MASK_PRESSURE 0x00000001 #endif @@ -357,11 +369,13 @@ class DisplayServerWindows : public DisplayServer { int min_pressure; int max_pressure; bool tilt_supported; + bool pen_inverted = false; bool block_mm = false; int last_pressure_update; float last_pressure; Vector2 last_tilt; + bool last_pen_inverted = false; HBITMAP hBitmap; //DIB section for layered window uint8_t *dib_data = nullptr; diff --git a/scene/3d/label_3d.cpp b/scene/3d/label_3d.cpp index 0849b2c631..1ae59451a1 100644 --- a/scene/3d/label_3d.cpp +++ b/scene/3d/label_3d.cpp @@ -370,15 +370,8 @@ void Label3D::_generate_glyph_surfaces(const Glyph &p_glyph, Vector2 &r_offset, bool msdf = TS->font_is_multichannel_signed_distance_field(p_glyph.font_rid); - uint64_t mat_hash; - if (tex != RID()) { - mat_hash = hash_one_uint64(tex.get_id()); - } else { - mat_hash = hash_one_uint64(0); - } - mat_hash = hash_fmix32(hash_murmur3_one_64(p_priority | (p_outline_size << 31), mat_hash)); - - if (!surfaces.has(mat_hash)) { + SurfaceKey key = SurfaceKey(tex.get_id(), p_priority, p_outline_size); + if (!surfaces.has(key)) { SurfaceData surf; surf.material = RenderingServer::get_singleton()->material_create(); // Set defaults for material, names need to match up those in StandardMaterial3D @@ -407,9 +400,9 @@ void Label3D::_generate_glyph_surfaces(const Glyph &p_glyph, Vector2 &r_offset, surf.z_shift = p_priority * pixel_size; } - surfaces[mat_hash] = surf; + surfaces[key] = surf; } - SurfaceData &s = surfaces[mat_hash]; + SurfaceData &s = surfaces[key]; s.mesh_vertices.resize((s.offset + 1) * 4); s.mesh_normals.resize((s.offset + 1) * 4); @@ -464,7 +457,7 @@ void Label3D::_shape() { aabb = AABB(); // Clear materials. - for (const KeyValue<uint64_t, SurfaceData> &E : surfaces) { + for (const KeyValue<SurfaceKey, SurfaceData> &E : surfaces) { RenderingServer::get_singleton()->free(E.value.material); } surfaces.clear(); @@ -594,7 +587,7 @@ void Label3D::_shape() { offset.y -= (TS->shaped_text_get_descent(lines_rid[i]) + line_spacing + font->get_spacing(TextServer::SPACING_BOTTOM)) * pixel_size; } - for (const KeyValue<uint64_t, SurfaceData> &E : surfaces) { + for (const KeyValue<SurfaceKey, SurfaceData> &E : surfaces) { Array mesh_array; mesh_array.resize(RS::ARRAY_MAX); mesh_array[RS::ARRAY_VERTEX] = E.value.mesh_vertices; @@ -1018,7 +1011,7 @@ Label3D::~Label3D() { TS->free_rid(text_rid); RenderingServer::get_singleton()->free(mesh); - for (KeyValue<uint64_t, SurfaceData> E : surfaces) { + for (KeyValue<SurfaceKey, SurfaceData> E : surfaces) { RenderingServer::get_singleton()->free(E.value.material); } surfaces.clear(); diff --git a/scene/3d/label_3d.h b/scene/3d/label_3d.h index 7766bca068..7ac38a9f3c 100644 --- a/scene/3d/label_3d.h +++ b/scene/3d/label_3d.h @@ -76,7 +76,29 @@ private: RID material; }; - HashMap<uint64_t, SurfaceData> surfaces; + struct SurfaceKey { + uint64_t texture_id; + int32_t priority; + int32_t outline_size; + + bool operator==(const SurfaceKey &p_b) const { + return (texture_id == p_b.texture_id) && (priority == p_b.priority) && (outline_size == p_b.outline_size); + } + + SurfaceKey(uint64_t p_texture_id, int p_priority, int p_outline_size) { + texture_id = p_texture_id; + priority = p_priority; + outline_size = p_outline_size; + } + }; + + struct SurfaceKeyHasher { + _FORCE_INLINE_ static uint32_t hash(const SurfaceKey &p_a) { + return hash_murmur3_buffer(&p_a, sizeof(SurfaceKey)); + } + }; + + HashMap<SurfaceKey, SurfaceData, SurfaceKeyHasher> surfaces; HorizontalAlignment horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER; VerticalAlignment vertical_alignment = VERTICAL_ALIGNMENT_CENTER; diff --git a/scene/3d/voxel_gi.cpp b/scene/3d/voxel_gi.cpp index d81b59b3fc..ae231026a7 100644 --- a/scene/3d/voxel_gi.cpp +++ b/scene/3d/voxel_gi.cpp @@ -272,7 +272,8 @@ VoxelGI::Subdiv VoxelGI::get_subdiv() const { } void VoxelGI::set_extents(const Vector3 &p_extents) { - extents = p_extents; + // Prevent very small extents as these break baking if other extents are set very high. + extents = Vector3(MAX(1.0, p_extents.x), MAX(1.0, p_extents.y), MAX(1.0, p_extents.z)); update_gizmos(); } diff --git a/scene/gui/code_edit.cpp b/scene/gui/code_edit.cpp index 22e9763929..a710e924f2 100644 --- a/scene/gui/code_edit.cpp +++ b/scene/gui/code_edit.cpp @@ -68,6 +68,7 @@ void CodeEdit::_notification(int p_what) { code_completion_max_lines = get_theme_constant(SNAME("completion_lines")); code_completion_scroll_width = get_theme_constant(SNAME("completion_scroll_width")); code_completion_scroll_color = get_theme_color(SNAME("completion_scroll_color")); + code_completion_scroll_hovered_color = get_theme_color(SNAME("completion_scroll_hovered_color")); code_completion_background_color = get_theme_color(SNAME("completion_background_color")); code_completion_selected_color = get_theme_color(SNAME("completion_selected_color")); code_completion_existing_color = get_theme_color(SNAME("completion_existing_color")); @@ -134,6 +135,9 @@ void CodeEdit::_notification(int p_what) { RenderingServer::get_singleton()->canvas_item_add_rect(ci, Rect2(code_completion_rect.position, code_completion_rect.size + Size2(scroll_width, 0)), code_completion_background_color); } + code_completion_scroll_rect.position = code_completion_rect.position + Vector2(code_completion_rect.size.width, 0); + code_completion_scroll_rect.size = Vector2(scroll_width, code_completion_rect.size.height); + code_completion_line_ofs = CLAMP(code_completion_current_selected - lines / 2, 0, code_completion_options_count - lines); RenderingServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2(code_completion_rect.position.x, code_completion_rect.position.y + (code_completion_current_selected - code_completion_line_ofs) * row_height), Size2(code_completion_rect.size.width, row_height)), code_completion_selected_color); @@ -185,9 +189,11 @@ void CodeEdit::_notification(int p_what) { /* Draw a small scroll rectangle to show a position in the options. */ if (scroll_width) { + Color scroll_color = is_code_completion_scroll_hovered || is_code_completion_scroll_pressed ? code_completion_scroll_hovered_color : code_completion_scroll_color; + float r = (float)code_completion_max_lines / code_completion_options_count; float o = (float)code_completion_line_ofs / code_completion_options_count; - draw_rect(Rect2(code_completion_rect.position.x + code_completion_rect.size.width, code_completion_rect.position.y + o * code_completion_rect.size.y, scroll_width, code_completion_rect.size.y * r), code_completion_scroll_color); + draw_rect(Rect2(code_completion_rect.position.x + code_completion_rect.size.width, code_completion_rect.position.y + o * code_completion_rect.size.y, scroll_width, code_completion_rect.size.y * r), scroll_color); } } @@ -260,6 +266,12 @@ void CodeEdit::gui_input(const Ref<InputEvent> &p_gui_input) { return; } + if (is_code_completion_scroll_pressed && mb->get_button_index() == MouseButton::LEFT) { + is_code_completion_scroll_pressed = false; + update(); + return; + } + if (code_completion_active && code_completion_rect.has_point(mb->get_position())) { if (!mb->is_pressed()) { return; @@ -289,7 +301,21 @@ void CodeEdit::gui_input(const Ref<InputEvent> &p_gui_input) { break; } return; + } else if (code_completion_active && code_completion_scroll_rect.has_point(mb->get_position())) { + if (mb->get_button_index() != MouseButton::LEFT) { + return; + } + + if (mb->is_pressed()) { + is_code_completion_scroll_pressed = true; + + _update_scroll_selected_line(mb->get_position().y); + update(); + } + + return; } + cancel_code_completion(); set_code_hint(""); @@ -354,6 +380,18 @@ void CodeEdit::gui_input(const Ref<InputEvent> &p_gui_input) { set_symbol_lookup_word_as_valid(false); } } + + bool scroll_hovered = code_completion_scroll_rect.has_point(mpos); + if (is_code_completion_scroll_hovered != scroll_hovered) { + is_code_completion_scroll_hovered = scroll_hovered; + update(); + } + + if (is_code_completion_scroll_pressed) { + _update_scroll_selected_line(mpos.y); + update(); + return; + } } Ref<InputEventKey> k = p_gui_input; @@ -546,6 +584,10 @@ Control::CursorShape CodeEdit::get_cursor_shape(const Point2 &p_pos) const { return CURSOR_ARROW; } + if (code_completion_active && code_completion_scroll_rect.has_point(p_pos)) { + return CURSOR_ARROW; + } + Point2i pos = get_line_column_at_pos(p_pos, false); int line = pos.y; int col = pos.x; @@ -2697,6 +2739,13 @@ TypedArray<String> CodeEdit::_get_delimiters(DelimiterType p_type) const { } /* Code Completion */ +void CodeEdit::_update_scroll_selected_line(float p_mouse_y) { + float percent = (float)(p_mouse_y - code_completion_scroll_rect.position.y) / code_completion_scroll_rect.size.height; + percent = CLAMP(percent, 0.0f, 1.0f); + + code_completion_current_selected = (int)(percent * (code_completion_options.size() - 1)); +} + void CodeEdit::_filter_code_completion_candidates_impl() { int line_height = get_line_height(); diff --git a/scene/gui/code_edit.h b/scene/gui/code_edit.h index ccf046c612..a431d8a5b2 100644 --- a/scene/gui/code_edit.h +++ b/scene/gui/code_edit.h @@ -203,22 +203,27 @@ private: int code_completion_max_lines = 7; int code_completion_scroll_width = 0; Color code_completion_scroll_color = Color(0, 0, 0, 0); + Color code_completion_scroll_hovered_color = Color(0, 0, 0, 0); Color code_completion_background_color = Color(0, 0, 0, 0); Color code_completion_selected_color = Color(0, 0, 0, 0); Color code_completion_existing_color = Color(0, 0, 0, 0); bool code_completion_active = false; + bool is_code_completion_scroll_hovered = false; + bool is_code_completion_scroll_pressed = false; Vector<ScriptLanguage::CodeCompletionOption> code_completion_options; int code_completion_line_ofs = 0; int code_completion_current_selected = 0; int code_completion_longest_line = 0; Rect2i code_completion_rect; + Rect2i code_completion_scroll_rect; HashSet<char32_t> code_completion_prefixes; List<ScriptLanguage::CodeCompletionOption> code_completion_option_submitted; List<ScriptLanguage::CodeCompletionOption> code_completion_option_sources; String code_completion_base; + void _update_scroll_selected_line(float p_mouse_y); void _filter_code_completion_candidates_impl(); /* Line length guidelines */ diff --git a/scene/gui/file_dialog.cpp b/scene/gui/file_dialog.cpp index 73effa6c4b..6bb4ac9c6f 100644 --- a/scene/gui/file_dialog.cpp +++ b/scene/gui/file_dialog.cpp @@ -480,7 +480,12 @@ void FileDialog::update_file_name() { String filter_str = filters[idx]; String file_str = file->get_text(); String base_name = file_str.get_basename(); - file_str = base_name + "." + filter_str.strip_edges().to_lower(); + Vector<String> filter_substr = filter_str.split(";"); + if (filter_substr.size() >= 2) { + file_str = base_name + "." + filter_substr[0].strip_edges().get_extension().to_lower(); + } else { + file_str = base_name + "." + filter_str.strip_edges().get_extension().to_lower(); + } file->set_text(file_str); } } diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp index 540250c8e9..377a9c45c5 100644 --- a/scene/gui/line_edit.cpp +++ b/scene/gui/line_edit.cpp @@ -744,6 +744,17 @@ void LineEdit::_notification(int p_what) { update(); } break; + case NOTIFICATION_INTERNAL_PROCESS: { + if (caret_blinking) { + caret_blink_timer += get_process_delta_time(); + + if (caret_blink_timer >= caret_blink_speed) { + caret_blink_timer = 0.0; + _toggle_draw_caret(); + } + } + } break; + case NOTIFICATION_DRAW: { if ((!has_focus() && !(menu && menu->has_focus()) && !caret_force_displayed) || !window_has_focus) { draw_caret = false; @@ -991,8 +1002,9 @@ void LineEdit::_notification(int p_what) { case NOTIFICATION_FOCUS_ENTER: { if (!caret_force_displayed) { if (caret_blink_enabled) { - if (caret_blink_timer->is_stopped()) { - caret_blink_timer->start(); + if (!caret_blinking) { + caret_blinking = true; + caret_blink_timer = 0.0; } } else { draw_caret = true; @@ -1010,7 +1022,7 @@ void LineEdit::_notification(int p_what) { case NOTIFICATION_FOCUS_EXIT: { if (caret_blink_enabled && !caret_force_displayed) { - caret_blink_timer->stop(); + caret_blinking = false; } if (get_viewport()->get_window_id() != DisplayServer::INVALID_WINDOW_ID && DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_IME)) { @@ -1318,14 +1330,16 @@ bool LineEdit::is_caret_blink_enabled() const { void LineEdit::set_caret_blink_enabled(const bool p_enabled) { caret_blink_enabled = p_enabled; + set_process_internal(p_enabled); if (has_focus() || caret_force_displayed) { if (p_enabled) { - if (caret_blink_timer->is_stopped()) { - caret_blink_timer->start(); + if (!caret_blinking) { + caret_blinking = true; + caret_blink_timer = 0.0; } } else { - caret_blink_timer->stop(); + caret_blinking = false; } } @@ -1345,20 +1359,19 @@ void LineEdit::set_caret_force_displayed(const bool p_enabled) { } float LineEdit::get_caret_blink_speed() const { - return caret_blink_timer->get_wait_time(); + return caret_blink_speed; } void LineEdit::set_caret_blink_speed(const float p_speed) { ERR_FAIL_COND(p_speed <= 0); - caret_blink_timer->set_wait_time(p_speed); + caret_blink_speed = p_speed; } void LineEdit::_reset_caret_blink_timer() { if (caret_blink_enabled) { draw_caret = true; if (has_focus()) { - caret_blink_timer->stop(); - caret_blink_timer->start(); + caret_blink_timer = 0.0; update(); } } @@ -2508,10 +2521,6 @@ LineEdit::LineEdit(const String &p_placeholder) { set_mouse_filter(MOUSE_FILTER_STOP); set_process_unhandled_key_input(true); - caret_blink_timer = memnew(Timer); - add_child(caret_blink_timer, false, INTERNAL_MODE_FRONT); - caret_blink_timer->set_wait_time(0.65); - caret_blink_timer->connect("timeout", callable_mp(this, &LineEdit::_toggle_draw_caret)); set_caret_blink_enabled(false); set_placeholder(p_placeholder); diff --git a/scene/gui/line_edit.h b/scene/gui/line_edit.h index 0fb178fca4..63c57640dc 100644 --- a/scene/gui/line_edit.h +++ b/scene/gui/line_edit.h @@ -160,7 +160,9 @@ private: bool caret_blink_enabled = false; bool caret_force_displayed = false; bool draw_caret = true; - Timer *caret_blink_timer = nullptr; + float caret_blink_speed = 0.65; + double caret_blink_timer = 0.0; + bool caret_blinking = false; bool _is_over_clear_button(const Point2 &p_pos) const; diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index 5506616b7a..a8542c4346 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -2668,7 +2668,11 @@ void TextEdit::_update_caches() { /* General overrides. */ Size2 TextEdit::get_minimum_size() const { - return style_normal->get_minimum_size(); + Size2 size = style_normal->get_minimum_size(); + if (fit_content_height) { + size.y += content_height_cache; + } + return size; } bool TextEdit::is_text_field() const { @@ -4499,6 +4503,18 @@ float TextEdit::get_v_scroll_speed() const { return v_scroll_speed; } +void TextEdit::set_fit_content_height_enabled(const bool p_enabled) { + if (fit_content_height == p_enabled) { + return; + } + fit_content_height = p_enabled; + update_minimum_size(); +} + +bool TextEdit::is_fit_content_height_enabled() const { + return fit_content_height; +} + double TextEdit::get_scroll_pos_for_line(int p_line, int p_wrap_index) const { ERR_FAIL_INDEX_V(p_line, text.size(), 0); ERR_FAIL_COND_V(p_wrap_index < 0, 0); @@ -5297,7 +5313,7 @@ void TextEdit::_bind_methods() { /* Viewport. */ // Scrolling. - ClassDB::bind_method(D_METHOD("set_smooth_scroll_enable", "enable"), &TextEdit::set_smooth_scroll_enabled); + ClassDB::bind_method(D_METHOD("set_smooth_scroll_enabled", "enable"), &TextEdit::set_smooth_scroll_enabled); ClassDB::bind_method(D_METHOD("is_smooth_scroll_enabled"), &TextEdit::is_smooth_scroll_enabled); ClassDB::bind_method(D_METHOD("set_v_scroll", "value"), &TextEdit::set_v_scroll); @@ -5312,6 +5328,9 @@ void TextEdit::_bind_methods() { ClassDB::bind_method(D_METHOD("set_v_scroll_speed", "speed"), &TextEdit::set_v_scroll_speed); ClassDB::bind_method(D_METHOD("get_v_scroll_speed"), &TextEdit::get_v_scroll_speed); + ClassDB::bind_method(D_METHOD("set_fit_content_height_enabled"), &TextEdit::set_fit_content_height_enabled); + ClassDB::bind_method(D_METHOD("is_fit_content_height_enabled"), &TextEdit::is_fit_content_height_enabled); + ClassDB::bind_method(D_METHOD("get_scroll_pos_for_line", "line", "wrap_index"), &TextEdit::get_scroll_pos_for_line, DEFVAL(0)); // Visible lines. @@ -5431,11 +5450,12 @@ void TextEdit::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "syntax_highlighter", PROPERTY_HINT_RESOURCE_TYPE, "SyntaxHighlighter", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_DO_NOT_SHARE_ON_DUPLICATE), "set_syntax_highlighter", "get_syntax_highlighter"); ADD_GROUP("Scroll", "scroll_"); - ADD_PROPERTY(PropertyInfo(Variant::BOOL, "scroll_smooth"), "set_smooth_scroll_enable", "is_smooth_scroll_enabled"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "scroll_smooth"), "set_smooth_scroll_enabled", "is_smooth_scroll_enabled"); ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "scroll_v_scroll_speed", PROPERTY_HINT_NONE, "suffix:px/s"), "set_v_scroll_speed", "get_v_scroll_speed"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "scroll_past_end_of_file"), "set_scroll_past_end_of_file_enabled", "is_scroll_past_end_of_file_enabled"); ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "scroll_vertical", PROPERTY_HINT_NONE, "suffix:px"), "set_v_scroll", "get_v_scroll"); ADD_PROPERTY(PropertyInfo(Variant::INT, "scroll_horizontal", PROPERTY_HINT_NONE, "suffix:px"), "set_h_scroll", "get_h_scroll"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "scroll_fit_content_height"), "set_fit_content_height_enabled", "is_fit_content_height_enabled"); ADD_GROUP("Minimap", "minimap_"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "minimap_draw"), "set_draw_minimap", "is_drawing_minimap"); @@ -6197,6 +6217,11 @@ void TextEdit::_update_scrollbars() { total_width += minimap_width; } + content_height_cache = MAX(total_rows, 1) * get_line_height(); + if (fit_content_height) { + update_minimum_size(); + } + updating_scrolls = true; if (total_rows > visible_rows) { diff --git a/scene/gui/text_edit.h b/scene/gui/text_edit.h index 9de2982d0a..6ba6e9cf20 100644 --- a/scene/gui/text_edit.h +++ b/scene/gui/text_edit.h @@ -456,6 +456,8 @@ private: HScrollBar *h_scroll = nullptr; VScrollBar *v_scroll = nullptr; + float content_height_cache = 0.0; + bool fit_content_height = false; bool scroll_past_end_of_file_enabled = false; // Smooth scrolling. @@ -851,6 +853,9 @@ public: void set_v_scroll_speed(float p_speed); float get_v_scroll_speed() const; + void set_fit_content_height_enabled(const bool p_enabled); + bool is_fit_content_height_enabled() const; + double get_scroll_pos_for_line(int p_line, int p_wrap_index = 0) const; // Visible lines. 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/resources/default_theme/default_theme.cpp b/scene/resources/default_theme/default_theme.cpp index 401aeb4889..e0e2641f16 100644 --- a/scene/resources/default_theme/default_theme.cpp +++ b/scene/resources/default_theme/default_theme.cpp @@ -467,6 +467,7 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const theme->set_color("completion_selected_color", "CodeEdit", Color(0.26, 0.26, 0.27)); theme->set_color("completion_existing_color", "CodeEdit", Color(0.87, 0.87, 0.87, 0.13)); theme->set_color("completion_scroll_color", "CodeEdit", control_font_pressed_color * Color(1, 1, 1, 0.29)); + theme->set_color("completion_scroll_hovered_color", "CodeEdit", control_font_pressed_color * Color(1, 1, 1, 0.4)); theme->set_color("completion_font_color", "CodeEdit", Color(0.67, 0.67, 0.67)); theme->set_color("font_color", "CodeEdit", control_font_color); theme->set_color("font_selected_color", "CodeEdit", Color(0, 0, 0)); diff --git a/scene/resources/primitive_meshes.cpp b/scene/resources/primitive_meshes.cpp index f4fd81b25f..9fa483bf36 100644 --- a/scene/resources/primitive_meshes.cpp +++ b/scene/resources/primitive_meshes.cpp @@ -2190,12 +2190,12 @@ RibbonTrailMesh::RibbonTrailMesh() { /* TextMesh */ /*************************************************************************/ -void TextMesh::_generate_glyph_mesh_data(uint32_t p_hash, const Glyph &p_gl) const { - if (cache.has(p_hash)) { +void TextMesh::_generate_glyph_mesh_data(const GlyphMeshKey &p_key, const Glyph &p_gl) const { + if (cache.has(p_key)) { return; } - GlyphMeshData &gl_data = cache[p_hash]; + GlyphMeshData &gl_data = cache[p_key]; Dictionary d = TS->font_get_glyph_contours(p_gl.font_rid, p_gl.font_size, p_gl.index); Vector2 origin = Vector2(p_gl.x_off, p_gl.y_off) * pixel_size; @@ -2437,11 +2437,9 @@ void TextMesh::_create_mesh_array(Array &p_arr) const { continue; } if (glyphs[i].font_rid != RID()) { - uint32_t hash = hash_one_uint64(glyphs[i].font_rid.get_id()); - hash = hash_murmur3_one_32(glyphs[i].index, hash); - - _generate_glyph_mesh_data(hash, glyphs[i]); - GlyphMeshData &gl_data = cache[hash]; + GlyphMeshKey key = GlyphMeshKey(glyphs[i].font_rid.get_id(), glyphs[i].index); + _generate_glyph_mesh_data(key, glyphs[i]); + GlyphMeshData &gl_data = cache[key]; p_size += glyphs[i].repeat * gl_data.triangles.size() * ((has_depth) ? 2 : 1); i_size += glyphs[i].repeat * gl_data.triangles.size() * ((has_depth) ? 2 : 1); @@ -2496,10 +2494,9 @@ void TextMesh::_create_mesh_array(Array &p_arr) const { continue; } if (glyphs[i].font_rid != RID()) { - uint32_t hash = hash_one_uint64(glyphs[i].font_rid.get_id()); - hash = hash_murmur3_one_32(glyphs[i].index, hash); - - const GlyphMeshData &gl_data = cache[hash]; + GlyphMeshKey key = GlyphMeshKey(glyphs[i].font_rid.get_id(), glyphs[i].index); + _generate_glyph_mesh_data(key, glyphs[i]); + const GlyphMeshData &gl_data = cache[key]; int64_t ts = gl_data.triangles.size(); const Vector2 *ts_ptr = gl_data.triangles.ptr(); diff --git a/scene/resources/primitive_meshes.h b/scene/resources/primitive_meshes.h index 38cc7db5fe..a6d8978c2d 100644 --- a/scene/resources/primitive_meshes.h +++ b/scene/resources/primitive_meshes.h @@ -475,6 +475,7 @@ private: sharp = p_sharp; }; }; + struct ContourInfo { real_t length = 0.0; bool ccw = true; @@ -484,6 +485,27 @@ private: ccw = p_ccw; } }; + + struct GlyphMeshKey { + uint64_t font_id; + uint32_t gl_id; + + bool operator==(const GlyphMeshKey &p_b) const { + return (font_id == p_b.font_id) && (gl_id == p_b.gl_id); + } + + GlyphMeshKey(uint64_t p_font_id, uint32_t p_gl_id) { + font_id = p_font_id; + gl_id = p_gl_id; + } + }; + + struct GlyphMeshKeyHasher { + _FORCE_INLINE_ static uint32_t hash(const GlyphMeshKey &p_a) { + return hash_murmur3_buffer(&p_a, sizeof(GlyphMeshKey)); + } + }; + struct GlyphMeshData { Vector<Vector2> triangles; Vector<Vector<ContourPoint>> contours; @@ -491,7 +513,7 @@ private: Vector2 min_p = Vector2(INFINITY, INFINITY); Vector2 max_p = Vector2(-INFINITY, -INFINITY); }; - mutable HashMap<uint32_t, GlyphMeshData> cache; + mutable HashMap<GlyphMeshKey, GlyphMeshData, GlyphMeshKeyHasher> cache; RID text_rid; String text; @@ -517,7 +539,7 @@ private: mutable bool dirty_font = true; mutable bool dirty_cache = true; - void _generate_glyph_mesh_data(uint32_t p_hash, const Glyph &p_glyph) const; + void _generate_glyph_mesh_data(const GlyphMeshKey &p_key, const Glyph &p_glyph) const; void _font_changed(); protected: 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/servers/rendering/renderer_rd/environment/fog.h b/servers/rendering/renderer_rd/environment/fog.h new file mode 100644 index 0000000000..55a01c3616 --- /dev/null +++ b/servers/rendering/renderer_rd/environment/fog.h @@ -0,0 +1,83 @@ +/*************************************************************************/ +/* 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_RD_H +#define FOG_RD_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" + +namespace RendererRD { + +class Fog : public RendererFog { +public: + struct FogVolume { + RID material; + Vector3 extents = Vector3(1, 1, 1); + + RS::FogVolumeShape shape = RS::FOG_VOLUME_SHAPE_BOX; + + Dependency dependency; + }; + +private: + static Fog *singleton; + + mutable RID_Owner<FogVolume, true> fog_volume_owner; + +public: + static Fog *get_singleton() { return singleton; } + + Fog(); + ~Fog(); + + /* FOG VOLUMES */ + + 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); }; + + virtual RID fog_volume_allocate() override; + 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 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; +}; + +} // 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..c97b75ba14 100644 --- a/servers/rendering/renderer_rd/storage_rd/mesh_storage.cpp +++ b/servers/rendering/renderer_rd/storage_rd/mesh_storage.cpp @@ -218,7 +218,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 +429,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 +501,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 +692,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 +740,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 +1209,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 +1243,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 +1602,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 +1644,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 +1703,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 +1781,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 +1902,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 +1913,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/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/math/test_plane.h b/tests/core/math/test_plane.h new file mode 100644 index 0000000000..d81a5af1ce --- /dev/null +++ b/tests/core/math/test_plane.h @@ -0,0 +1,172 @@ +/*************************************************************************/ +/* test_plane.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 TEST_PLANE_H +#define TEST_PLANE_H + +#include "core/math/plane.h" + +#include "thirdparty/doctest/doctest.h" + +namespace TestPlane { + +// Plane + +TEST_CASE("[Plane] Constructor methods") { + const Plane plane = Plane(32, 22, 16, 3); + const Plane plane_vector = Plane(Vector3(32, 22, 16), 3); + const Plane plane_copy_plane = Plane(plane); + + CHECK_MESSAGE( + plane == plane_vector, + "Planes created with same values but different methods should be equal."); + + CHECK_MESSAGE( + plane == plane_copy_plane, + "Planes created with same values but different methods should be equal."); +} + +TEST_CASE("[Plane] Basic getters") { + const Plane plane = Plane(32, 22, 16, 3); + const Plane plane_normalized = Plane(32.0 / 42, 22.0 / 42, 16.0 / 42, 3.0 / 42); + + CHECK_MESSAGE( + plane.get_normal().is_equal_approx(Vector3(32, 22, 16)), + "get_normal() should return the expected value."); + + CHECK_MESSAGE( + plane.normalized().is_equal_approx(plane_normalized), + "normalized() should return a copy of the normalized value."); +} + +TEST_CASE("[Plane] Basic setters") { + Plane plane = Plane(32, 22, 16, 3); + plane.set_normal(Vector3(4, 2, 3)); + + CHECK_MESSAGE( + plane.is_equal_approx(Plane(4, 2, 3, 3)), + "set_normal() should result in the expected plane."); + + plane = Plane(32, 22, 16, 3); + plane.normalize(); + + CHECK_MESSAGE( + plane.is_equal_approx(Plane(32.0 / 42, 22.0 / 42, 16.0 / 42, 3.0 / 42)), + "normalize() should result in the expected plane."); +} + +TEST_CASE("[Plane] Plane-point operations") { + const Plane plane = Plane(32, 22, 16, 3); + const Plane y_facing_plane = Plane(0, 1, 0, 4); + + CHECK_MESSAGE( + plane.center().is_equal_approx(Vector3(32 * 3, 22 * 3, 16 * 3)), + "center() should return a vector pointing to the center of the plane."); + + CHECK_MESSAGE( + y_facing_plane.is_point_over(Vector3(0, 5, 0)), + "is_point_over() should return the expected result."); + + CHECK_MESSAGE( + y_facing_plane.get_any_perpendicular_normal().is_equal_approx(Vector3(1, 0, 0)), + "get_any_perpindicular_normal() should return the expected result."); + + // TODO distance_to() +} + +TEST_CASE("[Plane] Has point") { + const Plane x_facing_plane = Plane(1, 0, 0, 0); + const Plane y_facing_plane = Plane(0, 1, 0, 0); + const Plane z_facing_plane = Plane(0, 0, 1, 0); + + const Vector3 x_axis_point = Vector3(10, 0, 0); + const Vector3 y_axis_point = Vector3(0, 10, 0); + const Vector3 z_axis_point = Vector3(0, 0, 10); + + const Plane x_facing_plane_with_d_offset = Plane(1, 0, 0, 1); + const Vector3 y_axis_point_with_d_offset = Vector3(1, 10, 0); + + CHECK_MESSAGE( + x_facing_plane.has_point(y_axis_point), + "has_point() with contained Vector3 should return the expected result."); + CHECK_MESSAGE( + x_facing_plane.has_point(z_axis_point), + "has_point() with contained Vector3 should return the expected result."); + + CHECK_MESSAGE( + y_facing_plane.has_point(x_axis_point), + "has_point() with contained Vector3 should return the expected result."); + CHECK_MESSAGE( + y_facing_plane.has_point(z_axis_point), + "has_point() with contained Vector3 should return the expected result."); + + CHECK_MESSAGE( + z_facing_plane.has_point(y_axis_point), + "has_point() with contained Vector3 should return the expected result."); + CHECK_MESSAGE( + z_facing_plane.has_point(x_axis_point), + "has_point() with contained Vector3 should return the expected result."); + + CHECK_MESSAGE( + x_facing_plane_with_d_offset.has_point(y_axis_point_with_d_offset), + "has_point() with passed Vector3 should return the expected result."); +} + +TEST_CASE("[Plane] Intersection") { + const Plane x_facing_plane = Plane(1, 0, 0, 1); + const Plane y_facing_plane = Plane(0, 1, 0, 2); + const Plane z_facing_plane = Plane(0, 0, 1, 3); + + Vector3 vec_out; + + CHECK_MESSAGE( + x_facing_plane.intersect_3(y_facing_plane, z_facing_plane, &vec_out), + "intersect_3() should return the expected result."); + CHECK_MESSAGE( + vec_out.is_equal_approx(Vector3(1, 2, 3)), + "intersect_3() should modify vec_out to the expected result."); + + CHECK_MESSAGE( + x_facing_plane.intersects_ray(Vector3(0, 1, 1), Vector3(2, 0, 0), &vec_out), + "intersects_ray() should return the expected result."); + CHECK_MESSAGE( + vec_out.is_equal_approx(Vector3(1, 1, 1)), + "intersects_ray() should modify vec_out to the expected result."); + + CHECK_MESSAGE( + x_facing_plane.intersects_segment(Vector3(0, 1, 1), Vector3(2, 1, 1), &vec_out), + "intersects_segment() should return the expected result."); + CHECK_MESSAGE( + vec_out.is_equal_approx(Vector3(1, 1, 1)), + "intersects_segment() should modify vec_out to the expected result."); +} +} // namespace TestPlane + +#endif // TEST_PLANE_H 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/test_main.cpp b/tests/test_main.cpp index ac0cdf0cc1..79cda7e512 100644 --- a/tests/test_main.cpp +++ b/tests/test_main.cpp @@ -45,6 +45,7 @@ #include "tests/core/math/test_expression.h" #include "tests/core/math/test_geometry_2d.h" #include "tests/core/math/test_geometry_3d.h" +#include "tests/core/math/test_plane.h" #include "tests/core/math/test_random_number_generator.h" #include "tests/core/math/test_rect2.h" #include "tests/core/math/test_rect2i.h" diff --git a/thirdparty/README.md b/thirdparty/README.md index ed8eb9f48f..94b071a2ea 100644 --- a/thirdparty/README.md +++ b/thirdparty/README.md @@ -213,7 +213,7 @@ Files extracted from upstream source: ## harfbuzz - Upstream: https://github.com/harfbuzz/harfbuzz -- Version: 4.3.0 (aee123fc83388b8f5acfb301d87bd92eccc5b843, 2022) +- Version: 4.4.1 (096aaa62a6e0d07c02a4894fc036efc927e5aaf9, 2022) - License: MIT Files extracted from upstream source: diff --git a/thirdparty/harfbuzz/src/OT/Layout/GPOS.hh b/thirdparty/harfbuzz/src/OT/Layout/GPOS.hh new file mode 100644 index 0000000000..224d6b746b --- /dev/null +++ b/thirdparty/harfbuzz/src/OT/Layout/GPOS.hh @@ -0,0 +1,165 @@ +#ifndef OT_LAYOUT_GPOS_HH +#define OT_LAYOUT_GPOS_HH + +#include "../../hb-ot-layout-common.hh" +#include "../../hb-ot-layout-gsubgpos.hh" +#include "GPOS/Common.hh" +#include "GPOS/PosLookup.hh" + +namespace OT { +namespace Layout { + +static void +propagate_attachment_offsets (hb_glyph_position_t *pos, + unsigned int len, + unsigned int i, + hb_direction_t direction, + unsigned nesting_level = HB_MAX_NESTING_LEVEL); + +/* + * GPOS -- Glyph Positioning + * https://docs.microsoft.com/en-us/typography/opentype/spec/gpos + */ + +struct GPOS : GSUBGPOS +{ + static constexpr hb_tag_t tableTag = HB_OT_TAG_GPOS; + + using Lookup = GPOS_impl::PosLookup; + + const GPOS_impl::PosLookup& get_lookup (unsigned int i) const + { return static_cast<const GPOS_impl::PosLookup &> (GSUBGPOS::get_lookup (i)); } + + static inline void position_start (hb_font_t *font, hb_buffer_t *buffer); + static inline void position_finish_advances (hb_font_t *font, hb_buffer_t *buffer); + static inline void position_finish_offsets (hb_font_t *font, hb_buffer_t *buffer); + + bool subset (hb_subset_context_t *c) const + { + hb_subset_layout_context_t l (c, tableTag, c->plan->gpos_lookups, c->plan->gpos_langsys, c->plan->gpos_features); + return GSUBGPOS::subset<GPOS_impl::PosLookup> (&l); + } + + bool sanitize (hb_sanitize_context_t *c) const + { return GSUBGPOS::sanitize<GPOS_impl::PosLookup> (c); } + + HB_INTERNAL bool is_blocklisted (hb_blob_t *blob, + hb_face_t *face) const; + + void collect_variation_indices (hb_collect_variation_indices_context_t *c) const + { + for (unsigned i = 0; i < GSUBGPOS::get_lookup_count (); i++) + { + if (!c->gpos_lookups->has (i)) continue; + const GPOS_impl::PosLookup &l = get_lookup (i); + l.dispatch (c); + } + } + + void closure_lookups (hb_face_t *face, + const hb_set_t *glyphs, + hb_set_t *lookup_indexes /* IN/OUT */) const + { GSUBGPOS::closure_lookups<GPOS_impl::PosLookup> (face, glyphs, lookup_indexes); } + + typedef GSUBGPOS::accelerator_t<GPOS> accelerator_t; +}; + + +static void +propagate_attachment_offsets (hb_glyph_position_t *pos, + unsigned int len, + unsigned int i, + hb_direction_t direction, + unsigned nesting_level) +{ + /* Adjusts offsets of attached glyphs (both cursive and mark) to accumulate + * offset of glyph they are attached to. */ + int chain = pos[i].attach_chain(), type = pos[i].attach_type(); + if (likely (!chain)) + return; + + pos[i].attach_chain() = 0; + + unsigned int j = (int) i + chain; + + if (unlikely (j >= len)) + return; + + if (unlikely (!nesting_level)) + return; + + propagate_attachment_offsets (pos, len, j, direction, nesting_level - 1); + + assert (!!(type & GPOS_impl::ATTACH_TYPE_MARK) ^ !!(type & GPOS_impl::ATTACH_TYPE_CURSIVE)); + + if (type & GPOS_impl::ATTACH_TYPE_CURSIVE) + { + if (HB_DIRECTION_IS_HORIZONTAL (direction)) + pos[i].y_offset += pos[j].y_offset; + else + pos[i].x_offset += pos[j].x_offset; + } + else /*if (type & GPOS_impl::ATTACH_TYPE_MARK)*/ + { + pos[i].x_offset += pos[j].x_offset; + pos[i].y_offset += pos[j].y_offset; + + assert (j < i); + if (HB_DIRECTION_IS_FORWARD (direction)) + for (unsigned int k = j; k < i; k++) { + pos[i].x_offset -= pos[k].x_advance; + pos[i].y_offset -= pos[k].y_advance; + } + else + for (unsigned int k = j + 1; k < i + 1; k++) { + pos[i].x_offset += pos[k].x_advance; + pos[i].y_offset += pos[k].y_advance; + } + } +} + +void +GPOS::position_start (hb_font_t *font HB_UNUSED, hb_buffer_t *buffer) +{ + unsigned int count = buffer->len; + for (unsigned int i = 0; i < count; i++) + buffer->pos[i].attach_chain() = buffer->pos[i].attach_type() = 0; +} + +void +GPOS::position_finish_advances (hb_font_t *font HB_UNUSED, hb_buffer_t *buffer HB_UNUSED) +{ + //_hb_buffer_assert_gsubgpos_vars (buffer); +} + +void +GPOS::position_finish_offsets (hb_font_t *font, hb_buffer_t *buffer) +{ + _hb_buffer_assert_gsubgpos_vars (buffer); + + unsigned int len; + hb_glyph_position_t *pos = hb_buffer_get_glyph_positions (buffer, &len); + hb_direction_t direction = buffer->props.direction; + + /* Handle attachments */ + if (buffer->scratch_flags & HB_BUFFER_SCRATCH_FLAG_HAS_GPOS_ATTACHMENT) + for (unsigned i = 0; i < len; i++) + propagate_attachment_offsets (pos, len, i, direction); + + if (unlikely (font->slant)) + { + for (unsigned i = 0; i < len; i++) + if (unlikely (pos[i].y_offset)) + pos[i].x_offset += _hb_roundf (font->slant_xy * pos[i].y_offset); + } +} + +} + +struct GPOS_accelerator_t : Layout::GPOS::accelerator_t { + GPOS_accelerator_t (hb_face_t *face) : Layout::GPOS::accelerator_t (face) {} +}; + +} + +#endif /* OT_LAYOUT_GPOS_HH */ diff --git a/thirdparty/harfbuzz/src/OT/Layout/GPOS/Anchor.hh b/thirdparty/harfbuzz/src/OT/Layout/GPOS/Anchor.hh new file mode 100644 index 0000000000..bfe6b36afd --- /dev/null +++ b/thirdparty/harfbuzz/src/OT/Layout/GPOS/Anchor.hh @@ -0,0 +1,84 @@ +#ifndef OT_LAYOUT_GPOS_ANCHOR_HH +#define OT_LAYOUT_GPOS_ANCHOR_HH + +#include "AnchorFormat1.hh" +#include "AnchorFormat2.hh" +#include "AnchorFormat3.hh" + +namespace OT { +namespace Layout { +namespace GPOS_impl { + +struct Anchor +{ + protected: + union { + HBUINT16 format; /* Format identifier */ + AnchorFormat1 format1; + AnchorFormat2 format2; + AnchorFormat3 format3; + } u; + public: + DEFINE_SIZE_UNION (2, format); + + bool sanitize (hb_sanitize_context_t *c) const + { + TRACE_SANITIZE (this); + if (!u.format.sanitize (c)) return_trace (false); + switch (u.format) { + case 1: return_trace (u.format1.sanitize (c)); + case 2: return_trace (u.format2.sanitize (c)); + case 3: return_trace (u.format3.sanitize (c)); + default:return_trace (true); + } + } + + void get_anchor (hb_ot_apply_context_t *c, hb_codepoint_t glyph_id, + float *x, float *y) const + { + *x = *y = 0; + switch (u.format) { + case 1: u.format1.get_anchor (c, glyph_id, x, y); return; + case 2: u.format2.get_anchor (c, glyph_id, x, y); return; + case 3: u.format3.get_anchor (c, glyph_id, x, y); return; + default: return; + } + } + + bool subset (hb_subset_context_t *c) const + { + TRACE_SUBSET (this); + switch (u.format) { + case 1: return_trace (bool (reinterpret_cast<Anchor *> (u.format1.copy (c->serializer)))); + case 2: + if (c->plan->flags & HB_SUBSET_FLAGS_NO_HINTING) + { + // AnchorFormat 2 just containins extra hinting information, so + // if hints are being dropped convert to format 1. + return_trace (bool (reinterpret_cast<Anchor *> (u.format1.copy (c->serializer)))); + } + return_trace (bool (reinterpret_cast<Anchor *> (u.format2.copy (c->serializer)))); + case 3: return_trace (bool (reinterpret_cast<Anchor *> (u.format3.copy (c->serializer, + c->plan->layout_variation_idx_map)))); + default:return_trace (false); + } + } + + void collect_variation_indices (hb_collect_variation_indices_context_t *c) const + { + switch (u.format) { + case 1: case 2: + return; + case 3: + u.format3.collect_variation_indices (c); + return; + default: return; + } + } +}; + +} +} +} + +#endif // OT_LAYOUT_GPOS_ANCHOR_HH diff --git a/thirdparty/harfbuzz/src/OT/Layout/GPOS/AnchorFormat1.hh b/thirdparty/harfbuzz/src/OT/Layout/GPOS/AnchorFormat1.hh new file mode 100644 index 0000000000..738cc31bbf --- /dev/null +++ b/thirdparty/harfbuzz/src/OT/Layout/GPOS/AnchorFormat1.hh @@ -0,0 +1,46 @@ +#ifndef OT_LAYOUT_GPOS_ANCHORFORMAT1_HH +#define OT_LAYOUT_GPOS_ANCHORFORMAT1_HH + +namespace OT { +namespace Layout { +namespace GPOS_impl { + +struct AnchorFormat1 +{ + protected: + HBUINT16 format; /* Format identifier--format = 1 */ + FWORD xCoordinate; /* Horizontal value--in design units */ + FWORD yCoordinate; /* Vertical value--in design units */ + public: + DEFINE_SIZE_STATIC (6); + + bool sanitize (hb_sanitize_context_t *c) const + { + TRACE_SANITIZE (this); + return_trace (c->check_struct (this)); + } + + void get_anchor (hb_ot_apply_context_t *c, hb_codepoint_t glyph_id HB_UNUSED, + float *x, float *y) const + { + hb_font_t *font = c->font; + *x = font->em_fscale_x (xCoordinate); + *y = font->em_fscale_y (yCoordinate); + } + + AnchorFormat1* copy (hb_serialize_context_t *c) const + { + TRACE_SERIALIZE (this); + AnchorFormat1* out = c->embed<AnchorFormat1> (this); + if (!out) return_trace (out); + out->format = 1; + return_trace (out); + } +}; + + +} +} +} + +#endif // OT_LAYOUT_GPOS_ANCHORFORMAT1_HH diff --git a/thirdparty/harfbuzz/src/OT/Layout/GPOS/AnchorFormat2.hh b/thirdparty/harfbuzz/src/OT/Layout/GPOS/AnchorFormat2.hh new file mode 100644 index 0000000000..70b4d19f53 --- /dev/null +++ b/thirdparty/harfbuzz/src/OT/Layout/GPOS/AnchorFormat2.hh @@ -0,0 +1,58 @@ +#ifndef OT_LAYOUT_GPOS_ANCHORFORMAT2_HH +#define OT_LAYOUT_GPOS_ANCHORFORMAT2_HH + +namespace OT { +namespace Layout { +namespace GPOS_impl { + +struct AnchorFormat2 +{ + + protected: + HBUINT16 format; /* Format identifier--format = 2 */ + FWORD xCoordinate; /* Horizontal value--in design units */ + FWORD yCoordinate; /* Vertical value--in design units */ + HBUINT16 anchorPoint; /* Index to glyph contour point */ + public: + DEFINE_SIZE_STATIC (8); + + bool sanitize (hb_sanitize_context_t *c) const + { + TRACE_SANITIZE (this); + return_trace (c->check_struct (this)); + } + + void get_anchor (hb_ot_apply_context_t *c, hb_codepoint_t glyph_id, + float *x, float *y) const + { + hb_font_t *font = c->font; + +#ifdef HB_NO_HINTING + *x = font->em_fscale_x (xCoordinate); + *y = font->em_fscale_y (yCoordinate); + return; +#endif + + unsigned int x_ppem = font->x_ppem; + unsigned int y_ppem = font->y_ppem; + hb_position_t cx = 0, cy = 0; + bool ret; + + ret = (x_ppem || y_ppem) && + font->get_glyph_contour_point_for_origin (glyph_id, anchorPoint, HB_DIRECTION_LTR, &cx, &cy); + *x = ret && x_ppem ? cx : font->em_fscale_x (xCoordinate); + *y = ret && y_ppem ? cy : font->em_fscale_y (yCoordinate); + } + + AnchorFormat2* copy (hb_serialize_context_t *c) const + { + TRACE_SERIALIZE (this); + return_trace (c->embed<AnchorFormat2> (this)); + } +}; + +} +} +} + +#endif // OT_LAYOUT_GPOS_ANCHORFORMAT2_HH diff --git a/thirdparty/harfbuzz/src/OT/Layout/GPOS/AnchorFormat3.hh b/thirdparty/harfbuzz/src/OT/Layout/GPOS/AnchorFormat3.hh new file mode 100644 index 0000000000..d77b4699be --- /dev/null +++ b/thirdparty/harfbuzz/src/OT/Layout/GPOS/AnchorFormat3.hh @@ -0,0 +1,70 @@ +#ifndef OT_LAYOUT_GPOS_ANCHORFORMAT3_HH +#define OT_LAYOUT_GPOS_ANCHORFORMAT3_HH + +namespace OT { +namespace Layout { +namespace GPOS_impl { + +struct AnchorFormat3 +{ + protected: + HBUINT16 format; /* Format identifier--format = 3 */ + FWORD xCoordinate; /* Horizontal value--in design units */ + FWORD yCoordinate; /* Vertical value--in design units */ + Offset16To<Device> + xDeviceTable; /* Offset to Device table for X + * coordinate-- from beginning of + * Anchor table (may be NULL) */ + Offset16To<Device> + yDeviceTable; /* Offset to Device table for Y + * coordinate-- from beginning of + * Anchor table (may be NULL) */ + public: + DEFINE_SIZE_STATIC (10); + + bool sanitize (hb_sanitize_context_t *c) const + { + TRACE_SANITIZE (this); + return_trace (c->check_struct (this) && xDeviceTable.sanitize (c, this) && yDeviceTable.sanitize (c, this)); + } + + void get_anchor (hb_ot_apply_context_t *c, hb_codepoint_t glyph_id HB_UNUSED, + float *x, float *y) const + { + hb_font_t *font = c->font; + *x = font->em_fscale_x (xCoordinate); + *y = font->em_fscale_y (yCoordinate); + + if (font->x_ppem || font->num_coords) + *x += (this+xDeviceTable).get_x_delta (font, c->var_store, c->var_store_cache); + if (font->y_ppem || font->num_coords) + *y += (this+yDeviceTable).get_y_delta (font, c->var_store, c->var_store_cache); + } + + AnchorFormat3* copy (hb_serialize_context_t *c, + const hb_map_t *layout_variation_idx_map) const + { + TRACE_SERIALIZE (this); + if (!layout_variation_idx_map) return_trace (nullptr); + + auto *out = c->embed<AnchorFormat3> (this); + if (unlikely (!out)) return_trace (nullptr); + + out->xDeviceTable.serialize_copy (c, xDeviceTable, this, 0, hb_serialize_context_t::Head, layout_variation_idx_map); + out->yDeviceTable.serialize_copy (c, yDeviceTable, this, 0, hb_serialize_context_t::Head, layout_variation_idx_map); + return_trace (out); + } + + void collect_variation_indices (hb_collect_variation_indices_context_t *c) const + { + (this+xDeviceTable).collect_variation_indices (c->layout_variation_indices); + (this+yDeviceTable).collect_variation_indices (c->layout_variation_indices); + } +}; + + +} +} +} + +#endif // OT_LAYOUT_GPOS_ANCHORFORMAT3_HH diff --git a/thirdparty/harfbuzz/src/OT/Layout/GPOS/AnchorMatrix.hh b/thirdparty/harfbuzz/src/OT/Layout/GPOS/AnchorMatrix.hh new file mode 100644 index 0000000000..c442efa1ea --- /dev/null +++ b/thirdparty/harfbuzz/src/OT/Layout/GPOS/AnchorMatrix.hh @@ -0,0 +1,77 @@ +#ifndef OT_LAYOUT_GPOS_ANCHORMATRIX_HH +#define OT_LAYOUT_GPOS_ANCHORMATRIX_HH + +namespace OT { +namespace Layout { +namespace GPOS_impl { + +struct AnchorMatrix +{ + HBUINT16 rows; /* Number of rows */ + UnsizedArrayOf<Offset16To<Anchor>> + matrixZ; /* Matrix of offsets to Anchor tables-- + * from beginning of AnchorMatrix table */ + public: + DEFINE_SIZE_ARRAY (2, matrixZ); + + bool sanitize (hb_sanitize_context_t *c, unsigned int cols) const + { + TRACE_SANITIZE (this); + if (!c->check_struct (this)) return_trace (false); + if (unlikely (hb_unsigned_mul_overflows (rows, cols))) return_trace (false); + unsigned int count = rows * cols; + if (!c->check_array (matrixZ.arrayZ, count)) return_trace (false); + for (unsigned int i = 0; i < count; i++) + if (!matrixZ[i].sanitize (c, this)) return_trace (false); + return_trace (true); + } + + const Anchor& get_anchor (unsigned int row, unsigned int col, + unsigned int cols, bool *found) const + { + *found = false; + if (unlikely (row >= rows || col >= cols)) return Null (Anchor); + *found = !matrixZ[row * cols + col].is_null (); + return this+matrixZ[row * cols + col]; + } + + template <typename Iterator, + hb_requires (hb_is_iterator (Iterator))> + void collect_variation_indices (hb_collect_variation_indices_context_t *c, + Iterator index_iter) const + { + for (unsigned i : index_iter) + (this+matrixZ[i]).collect_variation_indices (c); + } + + template <typename Iterator, + hb_requires (hb_is_iterator (Iterator))> + bool subset (hb_subset_context_t *c, + unsigned num_rows, + Iterator index_iter) const + { + TRACE_SUBSET (this); + + auto *out = c->serializer->start_embed (this); + + if (!index_iter) return_trace (false); + if (unlikely (!c->serializer->extend_min (out))) return_trace (false); + + out->rows = num_rows; + for (const unsigned i : index_iter) + { + auto *offset = c->serializer->embed (matrixZ[i]); + if (!offset) return_trace (false); + offset->serialize_subset (c, matrixZ[i], this); + } + + return_trace (true); + } +}; + + +} +} +} + +#endif /* OT_LAYOUT_GPOS_ANCHORMATRIX_HH */ diff --git a/thirdparty/harfbuzz/src/OT/Layout/GPOS/ChainContextPos.hh b/thirdparty/harfbuzz/src/OT/Layout/GPOS/ChainContextPos.hh new file mode 100644 index 0000000000..d551ac2a2b --- /dev/null +++ b/thirdparty/harfbuzz/src/OT/Layout/GPOS/ChainContextPos.hh @@ -0,0 +1,14 @@ +#ifndef OT_LAYOUT_GPOS_CHAINCONTEXTPOS_HH +#define OT_LAYOUT_GPOS_CHAINCONTEXTPOS_HH + +namespace OT { +namespace Layout { +namespace GPOS_impl { + +struct ChainContextPos : ChainContext {}; + +} +} +} + +#endif /* OT_LAYOUT_GPOS_CHAINCONTEXTPOS_HH */ diff --git a/thirdparty/harfbuzz/src/OT/Layout/GPOS/Common.hh b/thirdparty/harfbuzz/src/OT/Layout/GPOS/Common.hh new file mode 100644 index 0000000000..e16c06729d --- /dev/null +++ b/thirdparty/harfbuzz/src/OT/Layout/GPOS/Common.hh @@ -0,0 +1,32 @@ +#ifndef OT_LAYOUT_GPOS_COMMON_HH +#define OT_LAYOUT_GPOS_COMMON_HH + +namespace OT { +namespace Layout { +namespace GPOS_impl { + +enum attach_type_t { + ATTACH_TYPE_NONE = 0X00, + + /* Each attachment should be either a mark or a cursive; can't be both. */ + ATTACH_TYPE_MARK = 0X01, + ATTACH_TYPE_CURSIVE = 0X02, +}; + +/* buffer **position** var allocations */ +#define attach_chain() var.i16[0] /* glyph to which this attaches to, relative to current glyphs; negative for going back, positive for forward. */ +#define attach_type() var.u8[2] /* attachment type */ +/* Note! if attach_chain() is zero, the value of attach_type() is irrelevant. */ + +template<typename Iterator, typename SrcLookup> +static void SinglePos_serialize (hb_serialize_context_t *c, + const SrcLookup *src, + Iterator it, + const hb_map_t *layout_variation_idx_map); + + +} +} +} + +#endif // OT_LAYOUT_GPOS_COMMON_HH diff --git a/thirdparty/harfbuzz/src/OT/Layout/GPOS/ContextPos.hh b/thirdparty/harfbuzz/src/OT/Layout/GPOS/ContextPos.hh new file mode 100644 index 0000000000..2a01eaa3a6 --- /dev/null +++ b/thirdparty/harfbuzz/src/OT/Layout/GPOS/ContextPos.hh @@ -0,0 +1,14 @@ +#ifndef OT_LAYOUT_GPOS_CONTEXTPOS_HH +#define OT_LAYOUT_GPOS_CONTEXTPOS_HH + +namespace OT { +namespace Layout { +namespace GPOS_impl { + +struct ContextPos : Context {}; + +} +} +} + +#endif /* OT_LAYOUT_GPOS_CONTEXTPOS_HH */ diff --git a/thirdparty/harfbuzz/src/OT/Layout/GPOS/CursivePos.hh b/thirdparty/harfbuzz/src/OT/Layout/GPOS/CursivePos.hh new file mode 100644 index 0000000000..c105cfb091 --- /dev/null +++ b/thirdparty/harfbuzz/src/OT/Layout/GPOS/CursivePos.hh @@ -0,0 +1,35 @@ +#ifndef OT_LAYOUT_GPOS_CURSIVEPOS_HH +#define OT_LAYOUT_GPOS_CURSIVEPOS_HH + +#include "CursivePosFormat1.hh" + +namespace OT { +namespace Layout { +namespace GPOS_impl { + +struct CursivePos +{ + protected: + union { + HBUINT16 format; /* Format identifier */ + CursivePosFormat1 format1; + } u; + + public: + template <typename context_t, typename ...Ts> + typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const + { + TRACE_DISPATCH (this, u.format); + if (unlikely (!c->may_dispatch (this, &u.format))) return_trace (c->no_dispatch_return_value ()); + switch (u.format) { + case 1: return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...)); + default:return_trace (c->default_return_value ()); + } + } +}; + +} +} +} + +#endif /* OT_LAYOUT_GPOS_CURSIVEPOS_HH */ diff --git a/thirdparty/harfbuzz/src/OT/Layout/GPOS/CursivePosFormat1.hh b/thirdparty/harfbuzz/src/OT/Layout/GPOS/CursivePosFormat1.hh new file mode 100644 index 0000000000..e212fab976 --- /dev/null +++ b/thirdparty/harfbuzz/src/OT/Layout/GPOS/CursivePosFormat1.hh @@ -0,0 +1,281 @@ +#ifndef OT_LAYOUT_GPOS_CURSIVEPOSFORMAT1_HH +#define OT_LAYOUT_GPOS_CURSIVEPOSFORMAT1_HH + +#include "Anchor.hh" + +namespace OT { +namespace Layout { +namespace GPOS_impl { + +struct EntryExitRecord +{ + friend struct CursivePosFormat1; + + bool sanitize (hb_sanitize_context_t *c, const void *base) const + { + TRACE_SANITIZE (this); + return_trace (entryAnchor.sanitize (c, base) && exitAnchor.sanitize (c, base)); + } + + void collect_variation_indices (hb_collect_variation_indices_context_t *c, + const void *src_base) const + { + (src_base+entryAnchor).collect_variation_indices (c); + (src_base+exitAnchor).collect_variation_indices (c); + } + + EntryExitRecord* subset (hb_subset_context_t *c, + const void *src_base) const + { + TRACE_SERIALIZE (this); + auto *out = c->serializer->embed (this); + if (unlikely (!out)) return_trace (nullptr); + + out->entryAnchor.serialize_subset (c, entryAnchor, src_base); + out->exitAnchor.serialize_subset (c, exitAnchor, src_base); + return_trace (out); + } + + protected: + Offset16To<Anchor> + entryAnchor; /* Offset to EntryAnchor table--from + * beginning of CursivePos + * subtable--may be NULL */ + Offset16To<Anchor> + exitAnchor; /* Offset to ExitAnchor table--from + * beginning of CursivePos + * subtable--may be NULL */ + public: + DEFINE_SIZE_STATIC (4); +}; + +static void +reverse_cursive_minor_offset (hb_glyph_position_t *pos, unsigned int i, hb_direction_t direction, unsigned int new_parent) { + int chain = pos[i].attach_chain(), type = pos[i].attach_type(); + if (likely (!chain || 0 == (type & ATTACH_TYPE_CURSIVE))) + return; + + pos[i].attach_chain() = 0; + + unsigned int j = (int) i + chain; + + /* Stop if we see new parent in the chain. */ + if (j == new_parent) + return; + + reverse_cursive_minor_offset (pos, j, direction, new_parent); + + if (HB_DIRECTION_IS_HORIZONTAL (direction)) + pos[j].y_offset = -pos[i].y_offset; + else + pos[j].x_offset = -pos[i].x_offset; + + pos[j].attach_chain() = -chain; + pos[j].attach_type() = type; +} + + +struct CursivePosFormat1 +{ + protected: + HBUINT16 format; /* Format identifier--format = 1 */ + Offset16To<Coverage> + coverage; /* Offset to Coverage table--from + * beginning of subtable */ + Array16Of<EntryExitRecord> + entryExitRecord; /* Array of EntryExit records--in + * Coverage Index order */ + public: + DEFINE_SIZE_ARRAY (6, entryExitRecord); + + bool sanitize (hb_sanitize_context_t *c) const + { + TRACE_SANITIZE (this); + return_trace (coverage.sanitize (c, this) && entryExitRecord.sanitize (c, this)); + } + + bool intersects (const hb_set_t *glyphs) const + { return (this+coverage).intersects (glyphs); } + + void closure_lookups (hb_closure_lookups_context_t *c) const {} + + void collect_variation_indices (hb_collect_variation_indices_context_t *c) const + { + + hb_zip (this+coverage, entryExitRecord) + | hb_filter (c->glyph_set, hb_first) + | hb_map (hb_second) + | hb_apply ([&] (const EntryExitRecord& record) { record.collect_variation_indices (c, this); }) + ; + } + + void collect_glyphs (hb_collect_glyphs_context_t *c) const + { if (unlikely (!(this+coverage).collect_coverage (c->input))) return; } + + const Coverage &get_coverage () const { return this+coverage; } + + bool apply (hb_ot_apply_context_t *c) const + { + TRACE_APPLY (this); + hb_buffer_t *buffer = c->buffer; + + const EntryExitRecord &this_record = entryExitRecord[(this+coverage).get_coverage (buffer->cur().codepoint)]; + if (!this_record.entryAnchor) return_trace (false); + + hb_ot_apply_context_t::skipping_iterator_t &skippy_iter = c->iter_input; + skippy_iter.reset (buffer->idx, 1); + unsigned unsafe_from; + if (!skippy_iter.prev (&unsafe_from)) + { + buffer->unsafe_to_concat_from_outbuffer (unsafe_from, buffer->idx + 1); + return_trace (false); + } + + const EntryExitRecord &prev_record = entryExitRecord[(this+coverage).get_coverage (buffer->info[skippy_iter.idx].codepoint)]; + if (!prev_record.exitAnchor) + { + buffer->unsafe_to_concat_from_outbuffer (skippy_iter.idx, buffer->idx + 1); + return_trace (false); + } + + unsigned int i = skippy_iter.idx; + unsigned int j = buffer->idx; + + buffer->unsafe_to_break (i, j); + float entry_x, entry_y, exit_x, exit_y; + (this+prev_record.exitAnchor).get_anchor (c, buffer->info[i].codepoint, &exit_x, &exit_y); + (this+this_record.entryAnchor).get_anchor (c, buffer->info[j].codepoint, &entry_x, &entry_y); + + hb_glyph_position_t *pos = buffer->pos; + + hb_position_t d; + /* Main-direction adjustment */ + switch (c->direction) { + case HB_DIRECTION_LTR: + pos[i].x_advance = roundf (exit_x) + pos[i].x_offset; + + d = roundf (entry_x) + pos[j].x_offset; + pos[j].x_advance -= d; + pos[j].x_offset -= d; + break; + case HB_DIRECTION_RTL: + d = roundf (exit_x) + pos[i].x_offset; + pos[i].x_advance -= d; + pos[i].x_offset -= d; + + pos[j].x_advance = roundf (entry_x) + pos[j].x_offset; + break; + case HB_DIRECTION_TTB: + pos[i].y_advance = roundf (exit_y) + pos[i].y_offset; + + d = roundf (entry_y) + pos[j].y_offset; + pos[j].y_advance -= d; + pos[j].y_offset -= d; + break; + case HB_DIRECTION_BTT: + d = roundf (exit_y) + pos[i].y_offset; + pos[i].y_advance -= d; + pos[i].y_offset -= d; + + pos[j].y_advance = roundf (entry_y); + break; + case HB_DIRECTION_INVALID: + default: + break; + } + + /* Cross-direction adjustment */ + + /* We attach child to parent (think graph theory and rooted trees whereas + * the root stays on baseline and each node aligns itself against its + * parent. + * + * Optimize things for the case of RightToLeft, as that's most common in + * Arabic. */ + unsigned int child = i; + unsigned int parent = j; + hb_position_t x_offset = entry_x - exit_x; + hb_position_t y_offset = entry_y - exit_y; + if (!(c->lookup_props & LookupFlag::RightToLeft)) + { + unsigned int k = child; + child = parent; + parent = k; + x_offset = -x_offset; + y_offset = -y_offset; + } + + /* If child was already connected to someone else, walk through its old + * chain and reverse the link direction, such that the whole tree of its + * previous connection now attaches to new parent. Watch out for case + * where new parent is on the path from old chain... + */ + reverse_cursive_minor_offset (pos, child, c->direction, parent); + + pos[child].attach_type() = ATTACH_TYPE_CURSIVE; + pos[child].attach_chain() = (int) parent - (int) child; + buffer->scratch_flags |= HB_BUFFER_SCRATCH_FLAG_HAS_GPOS_ATTACHMENT; + if (likely (HB_DIRECTION_IS_HORIZONTAL (c->direction))) + pos[child].y_offset = y_offset; + else + pos[child].x_offset = x_offset; + + /* If parent was attached to child, separate them. + * https://github.com/harfbuzz/harfbuzz/issues/2469 + */ + if (unlikely (pos[parent].attach_chain() == -pos[child].attach_chain())) + pos[parent].attach_chain() = 0; + + buffer->idx++; + return_trace (true); + } + + template <typename Iterator, + hb_requires (hb_is_iterator (Iterator))> + void serialize (hb_subset_context_t *c, + Iterator it, + const void *src_base) + { + if (unlikely (!c->serializer->extend_min ((*this)))) return; + this->format = 1; + this->entryExitRecord.len = it.len (); + + for (const EntryExitRecord& entry_record : + it + | hb_map (hb_second)) + entry_record.subset (c, src_base); + + auto glyphs = + + it + | hb_map_retains_sorting (hb_first) + ; + + coverage.serialize_serialize (c->serializer, glyphs); + } + + bool subset (hb_subset_context_t *c) const + { + TRACE_SUBSET (this); + const hb_set_t &glyphset = *c->plan->glyphset_gsub (); + const hb_map_t &glyph_map = *c->plan->glyph_map; + + auto *out = c->serializer->start_embed (*this); + if (unlikely (!out)) return_trace (false); + + auto it = + + hb_zip (this+coverage, entryExitRecord) + | hb_filter (glyphset, hb_first) + | hb_map_retains_sorting ([&] (hb_pair_t<hb_codepoint_t, const EntryExitRecord&> p) -> hb_pair_t<hb_codepoint_t, const EntryExitRecord&> + { return hb_pair (glyph_map[p.first], p.second);}) + ; + + bool ret = bool (it); + out->serialize (c, it, this); + return_trace (ret); + } +}; + + +} +} +} + +#endif /* OT_LAYOUT_GPOS_CURSIVEPOSFORMAT1_HH */ diff --git a/thirdparty/harfbuzz/src/OT/Layout/GPOS/ExtensionPos.hh b/thirdparty/harfbuzz/src/OT/Layout/GPOS/ExtensionPos.hh new file mode 100644 index 0000000000..d1808adab4 --- /dev/null +++ b/thirdparty/harfbuzz/src/OT/Layout/GPOS/ExtensionPos.hh @@ -0,0 +1,17 @@ +#ifndef OT_LAYOUT_GPOS_EXTENSIONPOS_HH +#define OT_LAYOUT_GPOS_EXTENSIONPOS_HH + +namespace OT { +namespace Layout { +namespace GPOS_impl { + +struct ExtensionPos : Extension<ExtensionPos> +{ + typedef struct PosLookupSubTable SubTable; +}; + +} +} +} + +#endif /* OT_LAYOUT_GPOS_EXTENSIONPOS_HH */ diff --git a/thirdparty/harfbuzz/src/OT/Layout/GPOS/MarkArray.hh b/thirdparty/harfbuzz/src/OT/Layout/GPOS/MarkArray.hh new file mode 100644 index 0000000000..f8cddd1991 --- /dev/null +++ b/thirdparty/harfbuzz/src/OT/Layout/GPOS/MarkArray.hh @@ -0,0 +1,113 @@ +#ifndef OT_LAYOUT_GPOS_MARKARRAY_HH +#define OT_LAYOUT_GPOS_MARKARRAY_HH + +#include "AnchorMatrix.hh" +#include "MarkRecord.hh" + +namespace OT { +namespace Layout { +namespace GPOS_impl { + +struct MarkArray : Array16Of<MarkRecord> /* Array of MarkRecords--in Coverage order */ +{ + bool sanitize (hb_sanitize_context_t *c) const + { + TRACE_SANITIZE (this); + return_trace (Array16Of<MarkRecord>::sanitize (c, this)); + } + + bool apply (hb_ot_apply_context_t *c, + unsigned int mark_index, unsigned int glyph_index, + const AnchorMatrix &anchors, unsigned int class_count, + unsigned int glyph_pos) const + { + TRACE_APPLY (this); + hb_buffer_t *buffer = c->buffer; + const MarkRecord &record = Array16Of<MarkRecord>::operator[](mark_index); + unsigned int mark_class = record.klass; + + const Anchor& mark_anchor = this + record.markAnchor; + bool found; + const Anchor& glyph_anchor = anchors.get_anchor (glyph_index, mark_class, class_count, &found); + /* If this subtable doesn't have an anchor for this base and this class, + * return false such that the subsequent subtables have a chance at it. */ + if (unlikely (!found)) return_trace (false); + + float mark_x, mark_y, base_x, base_y; + + buffer->unsafe_to_break (glyph_pos, buffer->idx + 1); + mark_anchor.get_anchor (c, buffer->cur().codepoint, &mark_x, &mark_y); + glyph_anchor.get_anchor (c, buffer->info[glyph_pos].codepoint, &base_x, &base_y); + + hb_glyph_position_t &o = buffer->cur_pos(); + o.x_offset = roundf (base_x - mark_x); + o.y_offset = roundf (base_y - mark_y); + o.attach_type() = ATTACH_TYPE_MARK; + o.attach_chain() = (int) glyph_pos - (int) buffer->idx; + buffer->scratch_flags |= HB_BUFFER_SCRATCH_FLAG_HAS_GPOS_ATTACHMENT; + + buffer->idx++; + return_trace (true); + } + + template <typename Iterator, + hb_requires (hb_is_iterator (Iterator))> + bool subset (hb_subset_context_t *c, + Iterator coverage, + const hb_map_t *klass_mapping) const + { + TRACE_SUBSET (this); + const hb_set_t &glyphset = *c->plan->glyphset_gsub (); + + auto* out = c->serializer->start_embed (this); + if (unlikely (!c->serializer->extend_min (out))) return_trace (false); + + auto mark_iter = + + hb_zip (coverage, this->iter ()) + | hb_filter (glyphset, hb_first) + | hb_map (hb_second) + ; + + unsigned new_length = 0; + for (const auto& mark_record : mark_iter) { + if (unlikely (!mark_record.subset (c, this, klass_mapping))) + return_trace (false); + new_length++; + } + + if (unlikely (!c->serializer->check_assign (out->len, new_length, + HB_SERIALIZE_ERROR_ARRAY_OVERFLOW))) + return_trace (false); + + return_trace (true); + } +}; + +static void Markclass_closure_and_remap_indexes (const Coverage &mark_coverage, + const MarkArray &mark_array, + const hb_set_t &glyphset, + hb_map_t* klass_mapping /* INOUT */) +{ + hb_set_t orig_classes; + + + hb_zip (mark_coverage, mark_array) + | hb_filter (glyphset, hb_first) + | hb_map (hb_second) + | hb_map (&MarkRecord::get_class) + | hb_sink (orig_classes) + ; + + unsigned idx = 0; + for (auto klass : orig_classes.iter ()) + { + if (klass_mapping->has (klass)) continue; + klass_mapping->set (klass, idx); + idx++; + } +} + +} +} +} + +#endif /* OT_LAYOUT_GPOS_MARKARRAY_HH */ diff --git a/thirdparty/harfbuzz/src/OT/Layout/GPOS/MarkBasePos.hh b/thirdparty/harfbuzz/src/OT/Layout/GPOS/MarkBasePos.hh new file mode 100644 index 0000000000..e99e13ff84 --- /dev/null +++ b/thirdparty/harfbuzz/src/OT/Layout/GPOS/MarkBasePos.hh @@ -0,0 +1,35 @@ +#ifndef OT_LAYOUT_GPOS_MARKBASEPOS_HH +#define OT_LAYOUT_GPOS_MARKBASEPOS_HH + +#include "MarkBasePosFormat1.hh" + +namespace OT { +namespace Layout { +namespace GPOS_impl { + +struct MarkBasePos +{ + protected: + union { + HBUINT16 format; /* Format identifier */ + MarkBasePosFormat1 format1; + } u; + + public: + template <typename context_t, typename ...Ts> + typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const + { + TRACE_DISPATCH (this, u.format); + if (unlikely (!c->may_dispatch (this, &u.format))) return_trace (c->no_dispatch_return_value ()); + switch (u.format) { + case 1: return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...)); + default:return_trace (c->default_return_value ()); + } + } +}; + +} +} +} + +#endif /* OT_LAYOUT_GPOS_MARKBASEPOS_HH */ diff --git a/thirdparty/harfbuzz/src/OT/Layout/GPOS/MarkBasePosFormat1.hh b/thirdparty/harfbuzz/src/OT/Layout/GPOS/MarkBasePosFormat1.hh new file mode 100644 index 0000000000..a10b806fe5 --- /dev/null +++ b/thirdparty/harfbuzz/src/OT/Layout/GPOS/MarkBasePosFormat1.hh @@ -0,0 +1,217 @@ +#ifndef OT_LAYOUT_GPOS_MARKBASEPOSFORMAT1_HH +#define OT_LAYOUT_GPOS_MARKBASEPOSFORMAT1_HH + +#include "MarkArray.hh" + +namespace OT { +namespace Layout { +namespace GPOS_impl { + +typedef AnchorMatrix BaseArray; /* base-major-- + * in order of BaseCoverage Index--, + * mark-minor-- + * ordered by class--zero-based. */ + +struct MarkBasePosFormat1 +{ + protected: + HBUINT16 format; /* Format identifier--format = 1 */ + Offset16To<Coverage> + markCoverage; /* Offset to MarkCoverage table--from + * beginning of MarkBasePos subtable */ + Offset16To<Coverage> + baseCoverage; /* Offset to BaseCoverage table--from + * beginning of MarkBasePos subtable */ + HBUINT16 classCount; /* Number of classes defined for marks */ + Offset16To<MarkArray> + markArray; /* Offset to MarkArray table--from + * beginning of MarkBasePos subtable */ + Offset16To<BaseArray> + baseArray; /* Offset to BaseArray table--from + * beginning of MarkBasePos subtable */ + + public: + DEFINE_SIZE_STATIC (12); + + bool sanitize (hb_sanitize_context_t *c) const + { + TRACE_SANITIZE (this); + return_trace (c->check_struct (this) && + markCoverage.sanitize (c, this) && + baseCoverage.sanitize (c, this) && + markArray.sanitize (c, this) && + baseArray.sanitize (c, this, (unsigned int) classCount)); + } + + bool intersects (const hb_set_t *glyphs) const + { + return (this+markCoverage).intersects (glyphs) && + (this+baseCoverage).intersects (glyphs); + } + + void closure_lookups (hb_closure_lookups_context_t *c) const {} + + void collect_variation_indices (hb_collect_variation_indices_context_t *c) const + { + + hb_zip (this+markCoverage, this+markArray) + | hb_filter (c->glyph_set, hb_first) + | hb_map (hb_second) + | hb_apply ([&] (const MarkRecord& record) { record.collect_variation_indices (c, &(this+markArray)); }) + ; + + hb_map_t klass_mapping; + Markclass_closure_and_remap_indexes (this+markCoverage, this+markArray, *c->glyph_set, &klass_mapping); + + unsigned basecount = (this+baseArray).rows; + auto base_iter = + + hb_zip (this+baseCoverage, hb_range (basecount)) + | hb_filter (c->glyph_set, hb_first) + | hb_map (hb_second) + ; + + hb_sorted_vector_t<unsigned> base_indexes; + for (const unsigned row : base_iter) + { + + hb_range ((unsigned) classCount) + | hb_filter (klass_mapping) + | hb_map ([&] (const unsigned col) { return row * (unsigned) classCount + col; }) + | hb_sink (base_indexes) + ; + } + (this+baseArray).collect_variation_indices (c, base_indexes.iter ()); + } + + void collect_glyphs (hb_collect_glyphs_context_t *c) const + { + if (unlikely (!(this+markCoverage).collect_coverage (c->input))) return; + if (unlikely (!(this+baseCoverage).collect_coverage (c->input))) return; + } + + const Coverage &get_coverage () const { return this+markCoverage; } + + bool apply (hb_ot_apply_context_t *c) const + { + TRACE_APPLY (this); + hb_buffer_t *buffer = c->buffer; + unsigned int mark_index = (this+markCoverage).get_coverage (buffer->cur().codepoint); + if (likely (mark_index == NOT_COVERED)) return_trace (false); + + /* Now we search backwards for a non-mark glyph */ + hb_ot_apply_context_t::skipping_iterator_t &skippy_iter = c->iter_input; + skippy_iter.reset (buffer->idx, 1); + skippy_iter.set_lookup_props (LookupFlag::IgnoreMarks); + do { + unsigned unsafe_from; + if (!skippy_iter.prev (&unsafe_from)) + { + buffer->unsafe_to_concat_from_outbuffer (unsafe_from, buffer->idx + 1); + return_trace (false); + } + + /* We only want to attach to the first of a MultipleSubst sequence. + * https://github.com/harfbuzz/harfbuzz/issues/740 + * Reject others... + * ...but stop if we find a mark in the MultipleSubst sequence: + * https://github.com/harfbuzz/harfbuzz/issues/1020 */ + if (!_hb_glyph_info_multiplied (&buffer->info[skippy_iter.idx]) || + 0 == _hb_glyph_info_get_lig_comp (&buffer->info[skippy_iter.idx]) || + (skippy_iter.idx == 0 || + _hb_glyph_info_is_mark (&buffer->info[skippy_iter.idx - 1]) || + _hb_glyph_info_get_lig_id (&buffer->info[skippy_iter.idx]) != + _hb_glyph_info_get_lig_id (&buffer->info[skippy_iter.idx - 1]) || + _hb_glyph_info_get_lig_comp (&buffer->info[skippy_iter.idx]) != + _hb_glyph_info_get_lig_comp (&buffer->info[skippy_iter.idx - 1]) + 1 + )) + break; + skippy_iter.reject (); + } while (true); + + /* Checking that matched glyph is actually a base glyph by GDEF is too strong; disabled */ + //if (!_hb_glyph_info_is_base_glyph (&buffer->info[skippy_iter.idx])) { return_trace (false); } + + unsigned int base_index = (this+baseCoverage).get_coverage (buffer->info[skippy_iter.idx].codepoint); + if (base_index == NOT_COVERED) + { + buffer->unsafe_to_concat_from_outbuffer (skippy_iter.idx, buffer->idx + 1); + return_trace (false); + } + + return_trace ((this+markArray).apply (c, mark_index, base_index, this+baseArray, classCount, skippy_iter.idx)); + } + + bool subset (hb_subset_context_t *c) const + { + TRACE_SUBSET (this); + const hb_set_t &glyphset = *c->plan->glyphset_gsub (); + const hb_map_t &glyph_map = *c->plan->glyph_map; + + auto *out = c->serializer->start_embed (*this); + if (unlikely (!c->serializer->extend_min (out))) return_trace (false); + out->format = format; + + hb_map_t klass_mapping; + Markclass_closure_and_remap_indexes (this+markCoverage, this+markArray, glyphset, &klass_mapping); + + if (!klass_mapping.get_population ()) return_trace (false); + out->classCount = klass_mapping.get_population (); + + auto mark_iter = + + hb_zip (this+markCoverage, this+markArray) + | hb_filter (glyphset, hb_first) + ; + + hb_sorted_vector_t<hb_codepoint_t> new_coverage; + + mark_iter + | hb_map (hb_first) + | hb_map (glyph_map) + | hb_sink (new_coverage) + ; + + if (!out->markCoverage.serialize_serialize (c->serializer, new_coverage.iter ())) + return_trace (false); + + out->markArray.serialize_subset (c, markArray, this, + (this+markCoverage).iter (), + &klass_mapping); + + unsigned basecount = (this+baseArray).rows; + auto base_iter = + + hb_zip (this+baseCoverage, hb_range (basecount)) + | hb_filter (glyphset, hb_first) + ; + + new_coverage.reset (); + + base_iter + | hb_map (hb_first) + | hb_map (glyph_map) + | hb_sink (new_coverage) + ; + + if (!out->baseCoverage.serialize_serialize (c->serializer, new_coverage.iter ())) + return_trace (false); + + hb_sorted_vector_t<unsigned> base_indexes; + for (const unsigned row : + base_iter + | hb_map (hb_second)) + { + + hb_range ((unsigned) classCount) + | hb_filter (klass_mapping) + | hb_map ([&] (const unsigned col) { return row * (unsigned) classCount + col; }) + | hb_sink (base_indexes) + ; + } + + out->baseArray.serialize_subset (c, baseArray, this, + base_iter.len (), + base_indexes.iter ()); + + return_trace (true); + } +}; + + +} +} +} + +#endif /* OT_LAYOUT_GPOS_MARKBASEPOSFORMAT1_HH */ diff --git a/thirdparty/harfbuzz/src/OT/Layout/GPOS/MarkLigPos.hh b/thirdparty/harfbuzz/src/OT/Layout/GPOS/MarkLigPos.hh new file mode 100644 index 0000000000..7e74aa73e0 --- /dev/null +++ b/thirdparty/harfbuzz/src/OT/Layout/GPOS/MarkLigPos.hh @@ -0,0 +1,35 @@ +#ifndef OT_LAYOUT_GPOS_MARKLIGPOS_HH +#define OT_LAYOUT_GPOS_MARKLIGPOS_HH + +#include "MarkLigPosFormat1.hh" + +namespace OT { +namespace Layout { +namespace GPOS_impl { + +struct MarkLigPos +{ + protected: + union { + HBUINT16 format; /* Format identifier */ + MarkLigPosFormat1 format1; + } u; + + public: + template <typename context_t, typename ...Ts> + typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const + { + TRACE_DISPATCH (this, u.format); + if (unlikely (!c->may_dispatch (this, &u.format))) return_trace (c->no_dispatch_return_value ()); + switch (u.format) { + case 1: return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...)); + default:return_trace (c->default_return_value ()); + } + } +}; + +} +} +} + +#endif /* OT_LAYOUT_GPOS_MARKLIGPOS_HH */ diff --git a/thirdparty/harfbuzz/src/OT/Layout/GPOS/MarkLigPosFormat1.hh b/thirdparty/harfbuzz/src/OT/Layout/GPOS/MarkLigPosFormat1.hh new file mode 100644 index 0000000000..4382aa6c6c --- /dev/null +++ b/thirdparty/harfbuzz/src/OT/Layout/GPOS/MarkLigPosFormat1.hh @@ -0,0 +1,244 @@ +#ifndef OT_LAYOUT_GPOS_MARKLIGPOSFORMAT1_HH +#define OT_LAYOUT_GPOS_MARKLIGPOSFORMAT1_HH + +namespace OT { +namespace Layout { +namespace GPOS_impl { + +typedef AnchorMatrix LigatureAttach; /* component-major-- + * in order of writing direction--, + * mark-minor-- + * ordered by class--zero-based. */ + +/* Array of LigatureAttach tables ordered by LigatureCoverage Index */ +struct LigatureArray : List16OfOffset16To<LigatureAttach> +{ + template <typename Iterator, + hb_requires (hb_is_iterator (Iterator))> + bool subset (hb_subset_context_t *c, + Iterator coverage, + unsigned class_count, + const hb_map_t *klass_mapping) const + { + TRACE_SUBSET (this); + const hb_set_t &glyphset = *c->plan->glyphset_gsub (); + + auto *out = c->serializer->start_embed (this); + if (unlikely (!c->serializer->extend_min (out))) return_trace (false); + + for (const auto _ : + hb_zip (coverage, *this) + | hb_filter (glyphset, hb_first)) + { + auto *matrix = out->serialize_append (c->serializer); + if (unlikely (!matrix)) return_trace (false); + + const LigatureAttach& src = (this + _.second); + auto indexes = + + hb_range (src.rows * class_count) + | hb_filter ([=] (unsigned index) { return klass_mapping->has (index % class_count); }) + ; + matrix->serialize_subset (c, + _.second, + this, + src.rows, + indexes); + } + return_trace (this->len); + } +}; + +struct MarkLigPosFormat1 +{ + protected: + HBUINT16 format; /* Format identifier--format = 1 */ + Offset16To<Coverage> + markCoverage; /* Offset to Mark Coverage table--from + * beginning of MarkLigPos subtable */ + Offset16To<Coverage> + ligatureCoverage; /* Offset to Ligature Coverage + * table--from beginning of MarkLigPos + * subtable */ + HBUINT16 classCount; /* Number of defined mark classes */ + Offset16To<MarkArray> + markArray; /* Offset to MarkArray table--from + * beginning of MarkLigPos subtable */ + Offset16To<LigatureArray> + ligatureArray; /* Offset to LigatureArray table--from + * beginning of MarkLigPos subtable */ + public: + DEFINE_SIZE_STATIC (12); + + bool sanitize (hb_sanitize_context_t *c) const + { + TRACE_SANITIZE (this); + return_trace (c->check_struct (this) && + markCoverage.sanitize (c, this) && + ligatureCoverage.sanitize (c, this) && + markArray.sanitize (c, this) && + ligatureArray.sanitize (c, this, (unsigned int) classCount)); + } + + bool intersects (const hb_set_t *glyphs) const + { + return (this+markCoverage).intersects (glyphs) && + (this+ligatureCoverage).intersects (glyphs); + } + + void closure_lookups (hb_closure_lookups_context_t *c) const {} + + void collect_variation_indices (hb_collect_variation_indices_context_t *c) const + { + + hb_zip (this+markCoverage, this+markArray) + | hb_filter (c->glyph_set, hb_first) + | hb_map (hb_second) + | hb_apply ([&] (const MarkRecord& record) { record.collect_variation_indices (c, &(this+markArray)); }) + ; + + hb_map_t klass_mapping; + Markclass_closure_and_remap_indexes (this+markCoverage, this+markArray, *c->glyph_set, &klass_mapping); + + unsigned ligcount = (this+ligatureArray).len; + auto lig_iter = + + hb_zip (this+ligatureCoverage, hb_range (ligcount)) + | hb_filter (c->glyph_set, hb_first) + | hb_map (hb_second) + ; + + const LigatureArray& lig_array = this+ligatureArray; + for (const unsigned i : lig_iter) + { + hb_sorted_vector_t<unsigned> lig_indexes; + unsigned row_count = lig_array[i].rows; + for (unsigned row : + hb_range (row_count)) + { + + hb_range ((unsigned) classCount) + | hb_filter (klass_mapping) + | hb_map ([&] (const unsigned col) { return row * (unsigned) classCount + col; }) + | hb_sink (lig_indexes) + ; + } + + lig_array[i].collect_variation_indices (c, lig_indexes.iter ()); + } + } + + void collect_glyphs (hb_collect_glyphs_context_t *c) const + { + if (unlikely (!(this+markCoverage).collect_coverage (c->input))) return; + if (unlikely (!(this+ligatureCoverage).collect_coverage (c->input))) return; + } + + const Coverage &get_coverage () const { return this+markCoverage; } + + bool apply (hb_ot_apply_context_t *c) const + { + TRACE_APPLY (this); + hb_buffer_t *buffer = c->buffer; + unsigned int mark_index = (this+markCoverage).get_coverage (buffer->cur().codepoint); + if (likely (mark_index == NOT_COVERED)) return_trace (false); + + /* Now we search backwards for a non-mark glyph */ + hb_ot_apply_context_t::skipping_iterator_t &skippy_iter = c->iter_input; + skippy_iter.reset (buffer->idx, 1); + skippy_iter.set_lookup_props (LookupFlag::IgnoreMarks); + unsigned unsafe_from; + if (!skippy_iter.prev (&unsafe_from)) + { + buffer->unsafe_to_concat_from_outbuffer (unsafe_from, buffer->idx + 1); + return_trace (false); + } + + /* Checking that matched glyph is actually a ligature by GDEF is too strong; disabled */ + //if (!_hb_glyph_info_is_ligature (&buffer->info[skippy_iter.idx])) { return_trace (false); } + + unsigned int j = skippy_iter.idx; + unsigned int lig_index = (this+ligatureCoverage).get_coverage (buffer->info[j].codepoint); + if (lig_index == NOT_COVERED) + { + buffer->unsafe_to_concat_from_outbuffer (skippy_iter.idx, buffer->idx + 1); + return_trace (false); + } + + const LigatureArray& lig_array = this+ligatureArray; + const LigatureAttach& lig_attach = lig_array[lig_index]; + + /* Find component to attach to */ + unsigned int comp_count = lig_attach.rows; + if (unlikely (!comp_count)) + { + buffer->unsafe_to_concat_from_outbuffer (skippy_iter.idx, buffer->idx + 1); + return_trace (false); + } + + /* We must now check whether the ligature ID of the current mark glyph + * is identical to the ligature ID of the found ligature. If yes, we + * can directly use the component index. If not, we attach the mark + * glyph to the last component of the ligature. */ + unsigned int comp_index; + unsigned int lig_id = _hb_glyph_info_get_lig_id (&buffer->info[j]); + unsigned int mark_id = _hb_glyph_info_get_lig_id (&buffer->cur()); + unsigned int mark_comp = _hb_glyph_info_get_lig_comp (&buffer->cur()); + if (lig_id && lig_id == mark_id && mark_comp > 0) + comp_index = hb_min (comp_count, _hb_glyph_info_get_lig_comp (&buffer->cur())) - 1; + else + comp_index = comp_count - 1; + + return_trace ((this+markArray).apply (c, mark_index, comp_index, lig_attach, classCount, j)); + } + + bool subset (hb_subset_context_t *c) const + { + TRACE_SUBSET (this); + const hb_set_t &glyphset = *c->plan->glyphset_gsub (); + const hb_map_t &glyph_map = *c->plan->glyph_map; + + auto *out = c->serializer->start_embed (*this); + if (unlikely (!c->serializer->extend_min (out))) return_trace (false); + out->format = format; + + hb_map_t klass_mapping; + Markclass_closure_and_remap_indexes (this+markCoverage, this+markArray, glyphset, &klass_mapping); + + if (!klass_mapping.get_population ()) return_trace (false); + out->classCount = klass_mapping.get_population (); + + auto mark_iter = + + hb_zip (this+markCoverage, this+markArray) + | hb_filter (glyphset, hb_first) + ; + + auto new_mark_coverage = + + mark_iter + | hb_map_retains_sorting (hb_first) + | hb_map_retains_sorting (glyph_map) + ; + + if (!out->markCoverage.serialize_serialize (c->serializer, new_mark_coverage)) + return_trace (false); + + out->markArray.serialize_subset (c, markArray, this, + (this+markCoverage).iter (), + &klass_mapping); + + auto new_ligature_coverage = + + hb_iter (this + ligatureCoverage) + | hb_filter (glyphset) + | hb_map_retains_sorting (glyph_map) + ; + + if (!out->ligatureCoverage.serialize_serialize (c->serializer, new_ligature_coverage)) + return_trace (false); + + out->ligatureArray.serialize_subset (c, ligatureArray, this, + hb_iter (this+ligatureCoverage), classCount, &klass_mapping); + + return_trace (true); + } + +}; + +} +} +} + +#endif /* OT_LAYOUT_GPOS_MARKLIGPOSFORMAT1_HH */ diff --git a/thirdparty/harfbuzz/src/OT/Layout/GPOS/MarkMarkPos.hh b/thirdparty/harfbuzz/src/OT/Layout/GPOS/MarkMarkPos.hh new file mode 100644 index 0000000000..c0eee6d54c --- /dev/null +++ b/thirdparty/harfbuzz/src/OT/Layout/GPOS/MarkMarkPos.hh @@ -0,0 +1,36 @@ +#ifndef OT_LAYOUT_GPOS_MARKMARKPOS_HH +#define OT_LAYOUT_GPOS_MARKMARKPOS_HH + +#include "MarkMarkPosFormat1.hh" + +namespace OT { +namespace Layout { +namespace GPOS_impl { + +struct MarkMarkPos +{ + protected: + union { + HBUINT16 format; /* Format identifier */ + MarkMarkPosFormat1 format1; + } u; + + public: + template <typename context_t, typename ...Ts> + typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const + { + TRACE_DISPATCH (this, u.format); + if (unlikely (!c->may_dispatch (this, &u.format))) return_trace (c->no_dispatch_return_value ()); + switch (u.format) { + case 1: return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...)); + default:return_trace (c->default_return_value ()); + } + } +}; + + +} +} +} + +#endif /* OT_LAYOUT_GPOS_MARKMARKPOS_HH */ diff --git a/thirdparty/harfbuzz/src/OT/Layout/GPOS/MarkMarkPosFormat1.hh b/thirdparty/harfbuzz/src/OT/Layout/GPOS/MarkMarkPosFormat1.hh new file mode 100644 index 0000000000..c48a74f773 --- /dev/null +++ b/thirdparty/harfbuzz/src/OT/Layout/GPOS/MarkMarkPosFormat1.hh @@ -0,0 +1,227 @@ +#ifndef OT_LAYOUT_GPOS_MARKMARKPOSFORMAT1_HH +#define OT_LAYOUT_GPOS_MARKMARKPOSFORMAT1_HH + +#include "MarkMarkPosFormat1.hh" + +namespace OT { +namespace Layout { +namespace GPOS_impl { + +typedef AnchorMatrix Mark2Array; /* mark2-major-- + * in order of Mark2Coverage Index--, + * mark1-minor-- + * ordered by class--zero-based. */ + +struct MarkMarkPosFormat1 +{ + protected: + HBUINT16 format; /* Format identifier--format = 1 */ + Offset16To<Coverage> + mark1Coverage; /* Offset to Combining Mark1 Coverage + * table--from beginning of MarkMarkPos + * subtable */ + Offset16To<Coverage> + mark2Coverage; /* Offset to Combining Mark2 Coverage + * table--from beginning of MarkMarkPos + * subtable */ + HBUINT16 classCount; /* Number of defined mark classes */ + Offset16To<MarkArray> + mark1Array; /* Offset to Mark1Array table--from + * beginning of MarkMarkPos subtable */ + Offset16To<Mark2Array> + mark2Array; /* Offset to Mark2Array table--from + * beginning of MarkMarkPos subtable */ + public: + DEFINE_SIZE_STATIC (12); + + bool sanitize (hb_sanitize_context_t *c) const + { + TRACE_SANITIZE (this); + return_trace (c->check_struct (this) && + mark1Coverage.sanitize (c, this) && + mark2Coverage.sanitize (c, this) && + mark1Array.sanitize (c, this) && + mark2Array.sanitize (c, this, (unsigned int) classCount)); + } + + bool intersects (const hb_set_t *glyphs) const + { + return (this+mark1Coverage).intersects (glyphs) && + (this+mark2Coverage).intersects (glyphs); + } + + void closure_lookups (hb_closure_lookups_context_t *c) const {} + + void collect_variation_indices (hb_collect_variation_indices_context_t *c) const + { + + hb_zip (this+mark1Coverage, this+mark1Array) + | hb_filter (c->glyph_set, hb_first) + | hb_map (hb_second) + | hb_apply ([&] (const MarkRecord& record) { record.collect_variation_indices (c, &(this+mark1Array)); }) + ; + + hb_map_t klass_mapping; + Markclass_closure_and_remap_indexes (this+mark1Coverage, this+mark1Array, *c->glyph_set, &klass_mapping); + + unsigned mark2_count = (this+mark2Array).rows; + auto mark2_iter = + + hb_zip (this+mark2Coverage, hb_range (mark2_count)) + | hb_filter (c->glyph_set, hb_first) + | hb_map (hb_second) + ; + + hb_sorted_vector_t<unsigned> mark2_indexes; + for (const unsigned row : mark2_iter) + { + + hb_range ((unsigned) classCount) + | hb_filter (klass_mapping) + | hb_map ([&] (const unsigned col) { return row * (unsigned) classCount + col; }) + | hb_sink (mark2_indexes) + ; + } + (this+mark2Array).collect_variation_indices (c, mark2_indexes.iter ()); + } + + void collect_glyphs (hb_collect_glyphs_context_t *c) const + { + if (unlikely (!(this+mark1Coverage).collect_coverage (c->input))) return; + if (unlikely (!(this+mark2Coverage).collect_coverage (c->input))) return; + } + + const Coverage &get_coverage () const { return this+mark1Coverage; } + + bool apply (hb_ot_apply_context_t *c) const + { + TRACE_APPLY (this); + hb_buffer_t *buffer = c->buffer; + unsigned int mark1_index = (this+mark1Coverage).get_coverage (buffer->cur().codepoint); + if (likely (mark1_index == NOT_COVERED)) return_trace (false); + + /* now we search backwards for a suitable mark glyph until a non-mark glyph */ + hb_ot_apply_context_t::skipping_iterator_t &skippy_iter = c->iter_input; + skippy_iter.reset (buffer->idx, 1); + skippy_iter.set_lookup_props (c->lookup_props & ~LookupFlag::IgnoreFlags); + unsigned unsafe_from; + if (!skippy_iter.prev (&unsafe_from)) + { + buffer->unsafe_to_concat_from_outbuffer (unsafe_from, buffer->idx + 1); + return_trace (false); + } + + if (!_hb_glyph_info_is_mark (&buffer->info[skippy_iter.idx])) + { + buffer->unsafe_to_concat_from_outbuffer (skippy_iter.idx, buffer->idx + 1); + return_trace (false); + } + + unsigned int j = skippy_iter.idx; + + unsigned int id1 = _hb_glyph_info_get_lig_id (&buffer->cur()); + unsigned int id2 = _hb_glyph_info_get_lig_id (&buffer->info[j]); + unsigned int comp1 = _hb_glyph_info_get_lig_comp (&buffer->cur()); + unsigned int comp2 = _hb_glyph_info_get_lig_comp (&buffer->info[j]); + + if (likely (id1 == id2)) + { + if (id1 == 0) /* Marks belonging to the same base. */ + goto good; + else if (comp1 == comp2) /* Marks belonging to the same ligature component. */ + goto good; + } + else + { + /* If ligature ids don't match, it may be the case that one of the marks + * itself is a ligature. In which case match. */ + if ((id1 > 0 && !comp1) || (id2 > 0 && !comp2)) + goto good; + } + + /* Didn't match. */ + buffer->unsafe_to_concat_from_outbuffer (skippy_iter.idx, buffer->idx + 1); + return_trace (false); + + good: + unsigned int mark2_index = (this+mark2Coverage).get_coverage (buffer->info[j].codepoint); + if (mark2_index == NOT_COVERED) + { + buffer->unsafe_to_concat_from_outbuffer (skippy_iter.idx, buffer->idx + 1); + return_trace (false); + } + + return_trace ((this+mark1Array).apply (c, mark1_index, mark2_index, this+mark2Array, classCount, j)); + } + + bool subset (hb_subset_context_t *c) const + { + TRACE_SUBSET (this); + const hb_set_t &glyphset = *c->plan->glyphset_gsub (); + const hb_map_t &glyph_map = *c->plan->glyph_map; + + auto *out = c->serializer->start_embed (*this); + if (unlikely (!c->serializer->extend_min (out))) return_trace (false); + out->format = format; + + hb_map_t klass_mapping; + Markclass_closure_and_remap_indexes (this+mark1Coverage, this+mark1Array, glyphset, &klass_mapping); + + if (!klass_mapping.get_population ()) return_trace (false); + out->classCount = klass_mapping.get_population (); + + auto mark1_iter = + + hb_zip (this+mark1Coverage, this+mark1Array) + | hb_filter (glyphset, hb_first) + ; + + hb_sorted_vector_t<hb_codepoint_t> new_coverage; + + mark1_iter + | hb_map (hb_first) + | hb_map (glyph_map) + | hb_sink (new_coverage) + ; + + if (!out->mark1Coverage.serialize_serialize (c->serializer, new_coverage.iter ())) + return_trace (false); + + out->mark1Array.serialize_subset (c, mark1Array, this, + (this+mark1Coverage).iter (), + &klass_mapping); + + unsigned mark2count = (this+mark2Array).rows; + auto mark2_iter = + + hb_zip (this+mark2Coverage, hb_range (mark2count)) + | hb_filter (glyphset, hb_first) + ; + + new_coverage.reset (); + + mark2_iter + | hb_map (hb_first) + | hb_map (glyph_map) + | hb_sink (new_coverage) + ; + + if (!out->mark2Coverage.serialize_serialize (c->serializer, new_coverage.iter ())) + return_trace (false); + + hb_sorted_vector_t<unsigned> mark2_indexes; + for (const unsigned row : + mark2_iter + | hb_map (hb_second)) + { + + hb_range ((unsigned) classCount) + | hb_filter (klass_mapping) + | hb_map ([&] (const unsigned col) { return row * (unsigned) classCount + col; }) + | hb_sink (mark2_indexes) + ; + } + + out->mark2Array.serialize_subset (c, mark2Array, this, mark2_iter.len (), mark2_indexes.iter ()); + + return_trace (true); + } +}; + + +} +} +} + +#endif /* OT_LAYOUT_GPOS_MARKMARKPOSFORMAT1_HH */ diff --git a/thirdparty/harfbuzz/src/OT/Layout/GPOS/MarkRecord.hh b/thirdparty/harfbuzz/src/OT/Layout/GPOS/MarkRecord.hh new file mode 100644 index 0000000000..7a514453ae --- /dev/null +++ b/thirdparty/harfbuzz/src/OT/Layout/GPOS/MarkRecord.hh @@ -0,0 +1,52 @@ +#ifndef OT_LAYOUT_GPOS_MARKRECORD_HH +#define OT_LAYOUT_GPOS_MARKRECORD_HH + +namespace OT { +namespace Layout { +namespace GPOS_impl { + +struct MarkRecord +{ + friend struct MarkArray; + + protected: + HBUINT16 klass; /* Class defined for this mark */ + Offset16To<Anchor> + markAnchor; /* Offset to Anchor table--from + * beginning of MarkArray table */ + public: + DEFINE_SIZE_STATIC (4); + + unsigned get_class () const { return (unsigned) klass; } + bool sanitize (hb_sanitize_context_t *c, const void *base) const + { + TRACE_SANITIZE (this); + return_trace (c->check_struct (this) && markAnchor.sanitize (c, base)); + } + + MarkRecord *subset (hb_subset_context_t *c, + const void *src_base, + const hb_map_t *klass_mapping) const + { + TRACE_SUBSET (this); + auto *out = c->serializer->embed (this); + if (unlikely (!out)) return_trace (nullptr); + + out->klass = klass_mapping->get (klass); + out->markAnchor.serialize_subset (c, markAnchor, src_base); + return_trace (out); + } + + void collect_variation_indices (hb_collect_variation_indices_context_t *c, + const void *src_base) const + { + (src_base+markAnchor).collect_variation_indices (c); + } +}; + + +} +} +} + +#endif /* OT_LAYOUT_GPOS_MARKRECORD_HH */ diff --git a/thirdparty/harfbuzz/src/OT/Layout/GPOS/PairPos.hh b/thirdparty/harfbuzz/src/OT/Layout/GPOS/PairPos.hh new file mode 100644 index 0000000000..8479178d38 --- /dev/null +++ b/thirdparty/harfbuzz/src/OT/Layout/GPOS/PairPos.hh @@ -0,0 +1,38 @@ +#ifndef OT_LAYOUT_GPOS_PAIRPOS_HH +#define OT_LAYOUT_GPOS_PAIRPOS_HH + +#include "PairPosFormat1.hh" +#include "PairPosFormat2.hh" + +namespace OT { +namespace Layout { +namespace GPOS_impl { + +struct PairPos +{ + protected: + union { + HBUINT16 format; /* Format identifier */ + PairPosFormat1 format1; + PairPosFormat2 format2; + } u; + + public: + template <typename context_t, typename ...Ts> + typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const + { + TRACE_DISPATCH (this, u.format); + if (unlikely (!c->may_dispatch (this, &u.format))) return_trace (c->no_dispatch_return_value ()); + switch (u.format) { + case 1: return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...)); + case 2: return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...)); + default:return_trace (c->default_return_value ()); + } + } +}; + +} +} +} + +#endif // OT_LAYOUT_GPOS_PAIRPOS_HH diff --git a/thirdparty/harfbuzz/src/OT/Layout/GPOS/PairPosFormat1.hh b/thirdparty/harfbuzz/src/OT/Layout/GPOS/PairPosFormat1.hh new file mode 100644 index 0000000000..35a2db2d45 --- /dev/null +++ b/thirdparty/harfbuzz/src/OT/Layout/GPOS/PairPosFormat1.hh @@ -0,0 +1,420 @@ +#ifndef OT_LAYOUT_GPOS_PAIRPOSFORMAT1_HH +#define OT_LAYOUT_GPOS_PAIRPOSFORMAT1_HH + +namespace OT { +namespace Layout { +namespace GPOS_impl { + +struct PairValueRecord +{ + friend struct PairSet; + + int cmp (hb_codepoint_t k) const + { return secondGlyph.cmp (k); } + + struct context_t + { + const void *base; + const ValueFormat *valueFormats; + const ValueFormat *newFormats; + unsigned len1; /* valueFormats[0].get_len() */ + const hb_map_t *glyph_map; + const hb_map_t *layout_variation_idx_map; + }; + + bool subset (hb_subset_context_t *c, + context_t *closure) const + { + TRACE_SERIALIZE (this); + auto *s = c->serializer; + auto *out = s->start_embed (*this); + if (unlikely (!s->extend_min (out))) return_trace (false); + + out->secondGlyph = (*closure->glyph_map)[secondGlyph]; + + closure->valueFormats[0].copy_values (s, + closure->newFormats[0], + closure->base, &values[0], + closure->layout_variation_idx_map); + closure->valueFormats[1].copy_values (s, + closure->newFormats[1], + closure->base, + &values[closure->len1], + closure->layout_variation_idx_map); + + return_trace (true); + } + + void collect_variation_indices (hb_collect_variation_indices_context_t *c, + const ValueFormat *valueFormats, + const void *base) const + { + unsigned record1_len = valueFormats[0].get_len (); + unsigned record2_len = valueFormats[1].get_len (); + const hb_array_t<const Value> values_array = values.as_array (record1_len + record2_len); + + if (valueFormats[0].has_device ()) + valueFormats[0].collect_variation_indices (c, base, values_array.sub_array (0, record1_len)); + + if (valueFormats[1].has_device ()) + valueFormats[1].collect_variation_indices (c, base, values_array.sub_array (record1_len, record2_len)); + } + + bool intersects (const hb_set_t& glyphset) const + { + return glyphset.has(secondGlyph); + } + + const Value* get_values_1 () const + { + return &values[0]; + } + + const Value* get_values_2 (ValueFormat format1) const + { + return &values[format1.get_len ()]; + } + + protected: + HBGlyphID16 secondGlyph; /* GlyphID of second glyph in the + * pair--first glyph is listed in the + * Coverage table */ + ValueRecord values; /* Positioning data for the first glyph + * followed by for second glyph */ + public: + DEFINE_SIZE_ARRAY (2, values); +}; + +struct PairSet +{ + friend struct PairPosFormat1; + + bool intersects (const hb_set_t *glyphs, + const ValueFormat *valueFormats) const + { + unsigned int len1 = valueFormats[0].get_len (); + unsigned int len2 = valueFormats[1].get_len (); + unsigned int record_size = HBUINT16::static_size * (1 + len1 + len2); + + const PairValueRecord *record = &firstPairValueRecord; + unsigned int count = len; + for (unsigned int i = 0; i < count; i++) + { + if (glyphs->has (record->secondGlyph)) + return true; + record = &StructAtOffset<const PairValueRecord> (record, record_size); + } + return false; + } + + void collect_glyphs (hb_collect_glyphs_context_t *c, + const ValueFormat *valueFormats) const + { + unsigned int len1 = valueFormats[0].get_len (); + unsigned int len2 = valueFormats[1].get_len (); + unsigned int record_size = HBUINT16::static_size * (1 + len1 + len2); + + const PairValueRecord *record = &firstPairValueRecord; + c->input->add_array (&record->secondGlyph, len, record_size); + } + + void collect_variation_indices (hb_collect_variation_indices_context_t *c, + const ValueFormat *valueFormats) const + { + unsigned len1 = valueFormats[0].get_len (); + unsigned len2 = valueFormats[1].get_len (); + unsigned record_size = HBUINT16::static_size * (1 + len1 + len2); + + const PairValueRecord *record = &firstPairValueRecord; + unsigned count = len; + for (unsigned i = 0; i < count; i++) + { + if (c->glyph_set->has (record->secondGlyph)) + { record->collect_variation_indices (c, valueFormats, this); } + + record = &StructAtOffset<const PairValueRecord> (record, record_size); + } + } + + bool apply (hb_ot_apply_context_t *c, + const ValueFormat *valueFormats, + unsigned int pos) const + { + TRACE_APPLY (this); + hb_buffer_t *buffer = c->buffer; + unsigned int len1 = valueFormats[0].get_len (); + unsigned int len2 = valueFormats[1].get_len (); + unsigned int record_size = HBUINT16::static_size * (1 + len1 + len2); + + const PairValueRecord *record = hb_bsearch (buffer->info[pos].codepoint, + &firstPairValueRecord, + len, + record_size); + if (record) + { + bool applied_first = valueFormats[0].apply_value (c, this, &record->values[0], buffer->cur_pos()); + bool applied_second = valueFormats[1].apply_value (c, this, &record->values[len1], buffer->pos[pos]); + if (applied_first || applied_second) + buffer->unsafe_to_break (buffer->idx, pos + 1); + if (len2) + pos++; + buffer->idx = pos; + return_trace (true); + } + buffer->unsafe_to_concat (buffer->idx, pos + 1); + return_trace (false); + } + + bool subset (hb_subset_context_t *c, + const ValueFormat valueFormats[2], + const ValueFormat newFormats[2]) const + { + TRACE_SUBSET (this); + auto snap = c->serializer->snapshot (); + + auto *out = c->serializer->start_embed (*this); + if (unlikely (!c->serializer->extend_min (out))) return_trace (false); + out->len = 0; + + const hb_set_t &glyphset = *c->plan->glyphset_gsub (); + const hb_map_t &glyph_map = *c->plan->glyph_map; + + unsigned len1 = valueFormats[0].get_len (); + unsigned len2 = valueFormats[1].get_len (); + unsigned record_size = HBUINT16::static_size + Value::static_size * (len1 + len2); + + PairValueRecord::context_t context = + { + this, + valueFormats, + newFormats, + len1, + &glyph_map, + c->plan->layout_variation_idx_map + }; + + const PairValueRecord *record = &firstPairValueRecord; + unsigned count = len, num = 0; + for (unsigned i = 0; i < count; i++) + { + if (glyphset.has (record->secondGlyph) + && record->subset (c, &context)) num++; + record = &StructAtOffset<const PairValueRecord> (record, record_size); + } + + out->len = num; + if (!num) c->serializer->revert (snap); + return_trace (num); + } + + struct sanitize_closure_t + { + const ValueFormat *valueFormats; + unsigned int len1; /* valueFormats[0].get_len() */ + unsigned int stride; /* 1 + len1 + len2 */ + }; + + bool sanitize (hb_sanitize_context_t *c, const sanitize_closure_t *closure) const + { + TRACE_SANITIZE (this); + if (!(c->check_struct (this) + && c->check_range (&firstPairValueRecord, + len, + HBUINT16::static_size, + closure->stride))) return_trace (false); + + unsigned int count = len; + const PairValueRecord *record = &firstPairValueRecord; + return_trace (closure->valueFormats[0].sanitize_values_stride_unsafe (c, this, &record->values[0], count, closure->stride) && + closure->valueFormats[1].sanitize_values_stride_unsafe (c, this, &record->values[closure->len1], count, closure->stride)); + } + + protected: + HBUINT16 len; /* Number of PairValueRecords */ + PairValueRecord firstPairValueRecord; + /* Array of PairValueRecords--ordered + * by GlyphID of the second glyph */ + public: + DEFINE_SIZE_MIN (2); +}; + +struct PairPosFormat1 +{ + protected: + HBUINT16 format; /* Format identifier--format = 1 */ + Offset16To<Coverage> + coverage; /* Offset to Coverage table--from + * beginning of subtable */ + ValueFormat valueFormat[2]; /* [0] Defines the types of data in + * ValueRecord1--for the first glyph + * in the pair--may be zero (0) */ + /* [1] Defines the types of data in + * ValueRecord2--for the second glyph + * in the pair--may be zero (0) */ + Array16OfOffset16To<PairSet> + pairSet; /* Array of PairSet tables + * ordered by Coverage Index */ + public: + DEFINE_SIZE_ARRAY (10, pairSet); + + bool sanitize (hb_sanitize_context_t *c) const + { + TRACE_SANITIZE (this); + + if (!c->check_struct (this)) return_trace (false); + + unsigned int len1 = valueFormat[0].get_len (); + unsigned int len2 = valueFormat[1].get_len (); + PairSet::sanitize_closure_t closure = + { + valueFormat, + len1, + 1 + len1 + len2 + }; + + return_trace (coverage.sanitize (c, this) && pairSet.sanitize (c, this, &closure)); + } + + + bool intersects (const hb_set_t *glyphs) const + { + return + + hb_zip (this+coverage, pairSet) + | hb_filter (*glyphs, hb_first) + | hb_map (hb_second) + | hb_map ([glyphs, this] (const Offset16To<PairSet> &_) + { return (this+_).intersects (glyphs, valueFormat); }) + | hb_any + ; + } + + void closure_lookups (hb_closure_lookups_context_t *c) const {} + void collect_variation_indices (hb_collect_variation_indices_context_t *c) const + { + if ((!valueFormat[0].has_device ()) && (!valueFormat[1].has_device ())) return; + + auto it = + + hb_zip (this+coverage, pairSet) + | hb_filter (c->glyph_set, hb_first) + | hb_map (hb_second) + ; + + if (!it) return; + + it + | hb_map (hb_add (this)) + | hb_apply ([&] (const PairSet& _) { _.collect_variation_indices (c, valueFormat); }) + ; + } + + void collect_glyphs (hb_collect_glyphs_context_t *c) const + { + if (unlikely (!(this+coverage).collect_coverage (c->input))) return; + unsigned int count = pairSet.len; + for (unsigned int i = 0; i < count; i++) + (this+pairSet[i]).collect_glyphs (c, valueFormat); + } + + const Coverage &get_coverage () const { return this+coverage; } + + bool apply (hb_ot_apply_context_t *c) const + { + TRACE_APPLY (this); + hb_buffer_t *buffer = c->buffer; + unsigned int index = (this+coverage).get_coverage (buffer->cur().codepoint); + if (likely (index == NOT_COVERED)) return_trace (false); + + hb_ot_apply_context_t::skipping_iterator_t &skippy_iter = c->iter_input; + skippy_iter.reset (buffer->idx, 1); + unsigned unsafe_to; + if (!skippy_iter.next (&unsafe_to)) + { + buffer->unsafe_to_concat (buffer->idx, unsafe_to); + return_trace (false); + } + + return_trace ((this+pairSet[index]).apply (c, valueFormat, skippy_iter.idx)); + } + + bool subset (hb_subset_context_t *c) const + { + TRACE_SUBSET (this); + + const hb_set_t &glyphset = *c->plan->glyphset_gsub (); + const hb_map_t &glyph_map = *c->plan->glyph_map; + + auto *out = c->serializer->start_embed (*this); + if (unlikely (!c->serializer->extend_min (out))) return_trace (false); + out->format = format; + out->valueFormat[0] = valueFormat[0]; + out->valueFormat[1] = valueFormat[1]; + if (c->plan->flags & HB_SUBSET_FLAGS_NO_HINTING) + { + hb_pair_t<unsigned, unsigned> newFormats = compute_effective_value_formats (glyphset); + out->valueFormat[0] = newFormats.first; + out->valueFormat[1] = newFormats.second; + } + + hb_sorted_vector_t<hb_codepoint_t> new_coverage; + + + hb_zip (this+coverage, pairSet) + | hb_filter (glyphset, hb_first) + | hb_filter ([this, c, out] (const Offset16To<PairSet>& _) + { + auto snap = c->serializer->snapshot (); + auto *o = out->pairSet.serialize_append (c->serializer); + if (unlikely (!o)) return false; + bool ret = o->serialize_subset (c, _, this, valueFormat, out->valueFormat); + if (!ret) + { + out->pairSet.pop (); + c->serializer->revert (snap); + } + return ret; + }, + hb_second) + | hb_map (hb_first) + | hb_map (glyph_map) + | hb_sink (new_coverage) + ; + + out->coverage.serialize_serialize (c->serializer, new_coverage.iter ()); + + return_trace (bool (new_coverage)); + } + + + hb_pair_t<unsigned, unsigned> compute_effective_value_formats (const hb_set_t& glyphset) const + { + unsigned len1 = valueFormat[0].get_len (); + unsigned len2 = valueFormat[1].get_len (); + unsigned record_size = HBUINT16::static_size + Value::static_size * (len1 + len2); + + unsigned format1 = 0; + unsigned format2 = 0; + for (const Offset16To<PairSet>& _ : + + hb_zip (this+coverage, pairSet) | hb_filter (glyphset, hb_first) | hb_map (hb_second)) + { + const PairSet& set = (this + _); + const PairValueRecord *record = &set.firstPairValueRecord; + + for (unsigned i = 0; i < set.len; i++) + { + if (record->intersects (glyphset)) + { + format1 = format1 | valueFormat[0].get_effective_format (record->get_values_1 ()); + format2 = format2 | valueFormat[1].get_effective_format (record->get_values_2 (valueFormat[0])); + } + record = &StructAtOffset<const PairValueRecord> (record, record_size); + } + } + + return hb_pair (format1, format2); + } +}; + + +} +} +} + +#endif // OT_LAYOUT_GPOS_PAIRPOSFORMAT1_HH diff --git a/thirdparty/harfbuzz/src/OT/Layout/GPOS/PairPosFormat2.hh b/thirdparty/harfbuzz/src/OT/Layout/GPOS/PairPosFormat2.hh new file mode 100644 index 0000000000..3f5f9959c4 --- /dev/null +++ b/thirdparty/harfbuzz/src/OT/Layout/GPOS/PairPosFormat2.hh @@ -0,0 +1,314 @@ +#ifndef OT_LAYOUT_GPOS_PAIRPOSFORMAT2_HH +#define OT_LAYOUT_GPOS_PAIRPOSFORMAT2_HH + +#include "ValueFormat.hh" + +namespace OT { +namespace Layout { +namespace GPOS_impl { + +struct PairPosFormat2 +{ + protected: + HBUINT16 format; /* Format identifier--format = 2 */ + Offset16To<Coverage> + coverage; /* Offset to Coverage table--from + * beginning of subtable */ + ValueFormat valueFormat1; /* ValueRecord definition--for the + * first glyph of the pair--may be zero + * (0) */ + ValueFormat valueFormat2; /* ValueRecord definition--for the + * second glyph of the pair--may be + * zero (0) */ + Offset16To<ClassDef> + classDef1; /* Offset to ClassDef table--from + * beginning of PairPos subtable--for + * the first glyph of the pair */ + Offset16To<ClassDef> + classDef2; /* Offset to ClassDef table--from + * beginning of PairPos subtable--for + * the second glyph of the pair */ + HBUINT16 class1Count; /* Number of classes in ClassDef1 + * table--includes Class0 */ + HBUINT16 class2Count; /* Number of classes in ClassDef2 + * table--includes Class0 */ + ValueRecord values; /* Matrix of value pairs: + * class1-major, class2-minor, + * Each entry has value1 and value2 */ + public: + DEFINE_SIZE_ARRAY (16, values); + + bool sanitize (hb_sanitize_context_t *c) const + { + TRACE_SANITIZE (this); + if (!(c->check_struct (this) + && coverage.sanitize (c, this) + && classDef1.sanitize (c, this) + && classDef2.sanitize (c, this))) return_trace (false); + + unsigned int len1 = valueFormat1.get_len (); + unsigned int len2 = valueFormat2.get_len (); + unsigned int stride = len1 + len2; + unsigned int record_size = valueFormat1.get_size () + valueFormat2.get_size (); + unsigned int count = (unsigned int) class1Count * (unsigned int) class2Count; + return_trace (c->check_range ((const void *) values, + count, + record_size) && + valueFormat1.sanitize_values_stride_unsafe (c, this, &values[0], count, stride) && + valueFormat2.sanitize_values_stride_unsafe (c, this, &values[len1], count, stride)); + } + + bool intersects (const hb_set_t *glyphs) const + { + return (this+coverage).intersects (glyphs) && + (this+classDef2).intersects (glyphs); + } + + void closure_lookups (hb_closure_lookups_context_t *c) const {} + void collect_variation_indices (hb_collect_variation_indices_context_t *c) const + { + if (!intersects (c->glyph_set)) return; + if ((!valueFormat1.has_device ()) && (!valueFormat2.has_device ())) return; + + hb_set_t klass1_glyphs, klass2_glyphs; + if (!(this+classDef1).collect_coverage (&klass1_glyphs)) return; + if (!(this+classDef2).collect_coverage (&klass2_glyphs)) return; + + hb_set_t class1_set, class2_set; + for (const unsigned cp : + c->glyph_set->iter () | hb_filter (this + coverage)) + { + if (!klass1_glyphs.has (cp)) class1_set.add (0); + else + { + unsigned klass1 = (this+classDef1).get (cp); + class1_set.add (klass1); + } + } + + class2_set.add (0); + for (const unsigned cp : + c->glyph_set->iter () | hb_filter (klass2_glyphs)) + { + unsigned klass2 = (this+classDef2).get (cp); + class2_set.add (klass2); + } + + if (class1_set.is_empty () + || class2_set.is_empty () + || (class2_set.get_population() == 1 && class2_set.has(0))) + return; + + unsigned len1 = valueFormat1.get_len (); + unsigned len2 = valueFormat2.get_len (); + const hb_array_t<const Value> values_array = values.as_array ((unsigned)class1Count * (unsigned) class2Count * (len1 + len2)); + for (const unsigned class1_idx : class1_set.iter ()) + { + for (const unsigned class2_idx : class2_set.iter ()) + { + unsigned start_offset = (class1_idx * (unsigned) class2Count + class2_idx) * (len1 + len2); + if (valueFormat1.has_device ()) + valueFormat1.collect_variation_indices (c, this, values_array.sub_array (start_offset, len1)); + + if (valueFormat2.has_device ()) + valueFormat2.collect_variation_indices (c, this, values_array.sub_array (start_offset+len1, len2)); + } + } + } + + void collect_glyphs (hb_collect_glyphs_context_t *c) const + { + if (unlikely (!(this+coverage).collect_coverage (c->input))) return; + if (unlikely (!(this+classDef2).collect_coverage (c->input))) return; + } + + const Coverage &get_coverage () const { return this+coverage; } + + bool apply (hb_ot_apply_context_t *c) const + { + TRACE_APPLY (this); + hb_buffer_t *buffer = c->buffer; + unsigned int index = (this+coverage).get_coverage (buffer->cur().codepoint); + if (likely (index == NOT_COVERED)) return_trace (false); + + hb_ot_apply_context_t::skipping_iterator_t &skippy_iter = c->iter_input; + skippy_iter.reset (buffer->idx, 1); + unsigned unsafe_to; + if (!skippy_iter.next (&unsafe_to)) + { + buffer->unsafe_to_concat (buffer->idx, unsafe_to); + return_trace (false); + } + + unsigned int len1 = valueFormat1.get_len (); + unsigned int len2 = valueFormat2.get_len (); + unsigned int record_len = len1 + len2; + + unsigned int klass1 = (this+classDef1).get_class (buffer->cur().codepoint); + unsigned int klass2 = (this+classDef2).get_class (buffer->info[skippy_iter.idx].codepoint); + if (unlikely (klass1 >= class1Count || klass2 >= class2Count)) + { + buffer->unsafe_to_concat (buffer->idx, skippy_iter.idx + 1); + return_trace (false); + } + + const Value *v = &values[record_len * (klass1 * class2Count + klass2)]; + + bool applied_first = false, applied_second = false; + + + /* Isolate simple kerning and apply it half to each side. + * Results in better cursor positinoing / underline drawing. + * + * Disabled, because causes issues... :-( + * https://github.com/harfbuzz/harfbuzz/issues/3408 + * https://github.com/harfbuzz/harfbuzz/pull/3235#issuecomment-1029814978 + */ +#ifndef HB_SPLIT_KERN + if (0) +#endif + { + if (!len2) + { + const hb_direction_t dir = buffer->props.direction; + const bool horizontal = HB_DIRECTION_IS_HORIZONTAL (dir); + const bool backward = HB_DIRECTION_IS_BACKWARD (dir); + unsigned mask = horizontal ? ValueFormat::xAdvance : ValueFormat::yAdvance; + if (backward) + mask |= mask >> 2; /* Add eg. xPlacement in RTL. */ + /* Add Devices. */ + mask |= mask << 4; + + if (valueFormat1 & ~mask) + goto bail; + + /* Is simple kern. Apply value on an empty position slot, + * then split it between sides. */ + + hb_glyph_position_t pos{}; + if (valueFormat1.apply_value (c, this, v, pos)) + { + hb_position_t *src = &pos.x_advance; + hb_position_t *dst1 = &buffer->cur_pos().x_advance; + hb_position_t *dst2 = &buffer->pos[skippy_iter.idx].x_advance; + unsigned i = horizontal ? 0 : 1; + + hb_position_t kern = src[i]; + hb_position_t kern1 = kern >> 1; + hb_position_t kern2 = kern - kern1; + + if (!backward) + { + dst1[i] += kern1; + dst2[i] += kern2; + dst2[i + 2] += kern2; + } + else + { + dst1[i] += kern1; + dst1[i + 2] += src[i + 2] - kern2; + dst2[i] += kern2; + } + + applied_first = applied_second = kern != 0; + goto success; + } + goto boring; + } + } + bail: + + + applied_first = valueFormat1.apply_value (c, this, v, buffer->cur_pos()); + applied_second = valueFormat2.apply_value (c, this, v + len1, buffer->pos[skippy_iter.idx]); + + success: + if (applied_first || applied_second) + buffer->unsafe_to_break (buffer->idx, skippy_iter.idx + 1); + else + boring: + buffer->unsafe_to_concat (buffer->idx, skippy_iter.idx + 1); + + + buffer->idx = skippy_iter.idx; + if (len2) + buffer->idx++; + + return_trace (true); + } + + bool subset (hb_subset_context_t *c) const + { + TRACE_SUBSET (this); + auto *out = c->serializer->start_embed (*this); + if (unlikely (!c->serializer->extend_min (out))) return_trace (false); + out->format = format; + + hb_map_t klass1_map; + out->classDef1.serialize_subset (c, classDef1, this, &klass1_map, true, true, &(this + coverage)); + out->class1Count = klass1_map.get_population (); + + hb_map_t klass2_map; + out->classDef2.serialize_subset (c, classDef2, this, &klass2_map, true, false); + out->class2Count = klass2_map.get_population (); + + unsigned len1 = valueFormat1.get_len (); + unsigned len2 = valueFormat2.get_len (); + + hb_pair_t<unsigned, unsigned> newFormats = hb_pair (valueFormat1, valueFormat2); + if (c->plan->flags & HB_SUBSET_FLAGS_NO_HINTING) + newFormats = compute_effective_value_formats (klass1_map, klass2_map); + + out->valueFormat1 = newFormats.first; + out->valueFormat2 = newFormats.second; + + for (unsigned class1_idx : + hb_range ((unsigned) class1Count) | hb_filter (klass1_map)) + { + for (unsigned class2_idx : + hb_range ((unsigned) class2Count) | hb_filter (klass2_map)) + { + unsigned idx = (class1_idx * (unsigned) class2Count + class2_idx) * (len1 + len2); + valueFormat1.copy_values (c->serializer, newFormats.first, this, &values[idx], c->plan->layout_variation_idx_map); + valueFormat2.copy_values (c->serializer, newFormats.second, this, &values[idx + len1], c->plan->layout_variation_idx_map); + } + } + + const hb_set_t &glyphset = *c->plan->glyphset_gsub (); + const hb_map_t &glyph_map = *c->plan->glyph_map; + + auto it = + + hb_iter (this+coverage) + | hb_filter (glyphset) + | hb_map_retains_sorting (glyph_map) + ; + + out->coverage.serialize_serialize (c->serializer, it); + return_trace (out->class1Count && out->class2Count && bool (it)); + } + + + hb_pair_t<unsigned, unsigned> compute_effective_value_formats (const hb_map_t& klass1_map, + const hb_map_t& klass2_map) const + { + unsigned len1 = valueFormat1.get_len (); + unsigned len2 = valueFormat2.get_len (); + + unsigned format1 = 0; + unsigned format2 = 0; + + for (unsigned class1_idx : + hb_range ((unsigned) class1Count) | hb_filter (klass1_map)) + { + for (unsigned class2_idx : + hb_range ((unsigned) class2Count) | hb_filter (klass2_map)) + { + unsigned idx = (class1_idx * (unsigned) class2Count + class2_idx) * (len1 + len2); + format1 = format1 | valueFormat1.get_effective_format (&values[idx]); + format2 = format2 | valueFormat2.get_effective_format (&values[idx + len1]); + } + } + + return hb_pair (format1, format2); + } +}; + +} +} +} + +#endif // OT_LAYOUT_GPOS_PAIRPOSFORMAT2_HH diff --git a/thirdparty/harfbuzz/src/OT/Layout/GPOS/PosLookup.hh b/thirdparty/harfbuzz/src/OT/Layout/GPOS/PosLookup.hh new file mode 100644 index 0000000000..c4e57bb543 --- /dev/null +++ b/thirdparty/harfbuzz/src/OT/Layout/GPOS/PosLookup.hh @@ -0,0 +1,79 @@ +#ifndef OT_LAYOUT_GPOS_POSLOOKUP_HH +#define OT_LAYOUT_GPOS_POSLOOKUP_HH + +#include "PosLookupSubTable.hh" +#include "../../../hb-ot-layout-common.hh" + +namespace OT { +namespace Layout { +namespace GPOS_impl { + +struct PosLookup : Lookup +{ + using SubTable = PosLookupSubTable; + + const SubTable& get_subtable (unsigned int i) const + { return Lookup::get_subtable<SubTable> (i); } + + bool is_reverse () const + { + return false; + } + + bool apply (hb_ot_apply_context_t *c) const + { + TRACE_APPLY (this); + return_trace (dispatch (c)); + } + + bool intersects (const hb_set_t *glyphs) const + { + hb_intersects_context_t c (glyphs); + return dispatch (&c); + } + + hb_collect_glyphs_context_t::return_t collect_glyphs (hb_collect_glyphs_context_t *c) const + { return dispatch (c); } + + hb_closure_lookups_context_t::return_t closure_lookups (hb_closure_lookups_context_t *c, unsigned this_index) const + { + if (c->is_lookup_visited (this_index)) + return hb_closure_lookups_context_t::default_return_value (); + + c->set_lookup_visited (this_index); + if (!intersects (c->glyphs)) + { + c->set_lookup_inactive (this_index); + return hb_closure_lookups_context_t::default_return_value (); + } + + hb_closure_lookups_context_t::return_t ret = dispatch (c); + return ret; + } + + template <typename set_t> + void collect_coverage (set_t *glyphs) const + { + hb_collect_coverage_context_t<set_t> c (glyphs); + dispatch (&c); + } + + template <typename context_t> + static typename context_t::return_t dispatch_recurse_func (context_t *c, unsigned int lookup_index); + + template <typename context_t, typename ...Ts> + typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const + { return Lookup::dispatch<SubTable> (c, std::forward<Ts> (ds)...); } + + bool subset (hb_subset_context_t *c) const + { return Lookup::subset<SubTable> (c); } + + bool sanitize (hb_sanitize_context_t *c) const + { return Lookup::sanitize<SubTable> (c); } +}; + +} +} +} + +#endif /* OT_LAYOUT_GPOS_POSLOOKUP_HH */ diff --git a/thirdparty/harfbuzz/src/OT/Layout/GPOS/PosLookupSubTable.hh b/thirdparty/harfbuzz/src/OT/Layout/GPOS/PosLookupSubTable.hh new file mode 100644 index 0000000000..c19fbc323f --- /dev/null +++ b/thirdparty/harfbuzz/src/OT/Layout/GPOS/PosLookupSubTable.hh @@ -0,0 +1,79 @@ +#ifndef OT_LAYOUT_GPOS_POSLOOKUPSUBTABLE_HH +#define OT_LAYOUT_GPOS_POSLOOKUPSUBTABLE_HH + +#include "SinglePos.hh" +#include "PairPos.hh" +#include "CursivePos.hh" +#include "MarkBasePos.hh" +#include "MarkLigPos.hh" +#include "MarkMarkPos.hh" +#include "ContextPos.hh" +#include "ChainContextPos.hh" +#include "ExtensionPos.hh" + +namespace OT { +namespace Layout { +namespace GPOS_impl { + +struct PosLookupSubTable +{ + friend struct ::OT::Lookup; + friend struct PosLookup; + + enum Type { + Single = 1, + Pair = 2, + Cursive = 3, + MarkBase = 4, + MarkLig = 5, + MarkMark = 6, + Context = 7, + ChainContext = 8, + Extension = 9 + }; + + template <typename context_t, typename ...Ts> + typename context_t::return_t dispatch (context_t *c, unsigned int lookup_type, Ts&&... ds) const + { + TRACE_DISPATCH (this, lookup_type); + switch (lookup_type) { + case Single: return_trace (u.single.dispatch (c, std::forward<Ts> (ds)...)); + case Pair: return_trace (u.pair.dispatch (c, std::forward<Ts> (ds)...)); + case Cursive: return_trace (u.cursive.dispatch (c, std::forward<Ts> (ds)...)); + case MarkBase: return_trace (u.markBase.dispatch (c, std::forward<Ts> (ds)...)); + case MarkLig: return_trace (u.markLig.dispatch (c, std::forward<Ts> (ds)...)); + case MarkMark: return_trace (u.markMark.dispatch (c, std::forward<Ts> (ds)...)); + case Context: return_trace (u.context.dispatch (c, std::forward<Ts> (ds)...)); + case ChainContext: return_trace (u.chainContext.dispatch (c, std::forward<Ts> (ds)...)); + case Extension: return_trace (u.extension.dispatch (c, std::forward<Ts> (ds)...)); + default: return_trace (c->default_return_value ()); + } + } + + bool intersects (const hb_set_t *glyphs, unsigned int lookup_type) const + { + hb_intersects_context_t c (glyphs); + return dispatch (&c, lookup_type); + } + + protected: + union { + SinglePos single; + PairPos pair; + CursivePos cursive; + MarkBasePos markBase; + MarkLigPos markLig; + MarkMarkPos markMark; + ContextPos context; + ChainContextPos chainContext; + ExtensionPos extension; + } u; + public: + DEFINE_SIZE_MIN (0); +}; + +} +} +} + +#endif /* HB_OT_LAYOUT_GPOS_POSLOOKUPSUBTABLE_HH */ diff --git a/thirdparty/harfbuzz/src/OT/Layout/GPOS/SinglePos.hh b/thirdparty/harfbuzz/src/OT/Layout/GPOS/SinglePos.hh new file mode 100644 index 0000000000..57e146befd --- /dev/null +++ b/thirdparty/harfbuzz/src/OT/Layout/GPOS/SinglePos.hh @@ -0,0 +1,98 @@ +#ifndef OT_LAYOUT_GPOS_SINGLEPOS_HH +#define OT_LAYOUT_GPOS_SINGLEPOS_HH + +#include "SinglePosFormat1.hh" +#include "SinglePosFormat2.hh" + +namespace OT { +namespace Layout { +namespace GPOS_impl { + +struct SinglePos +{ + protected: + union { + HBUINT16 format; /* Format identifier */ + SinglePosFormat1 format1; + SinglePosFormat2 format2; + } u; + + public: + template<typename Iterator, + hb_requires (hb_is_iterator (Iterator))> + unsigned get_format (Iterator glyph_val_iter_pairs) + { + hb_array_t<const Value> first_val_iter = hb_second (*glyph_val_iter_pairs); + + for (const auto iter : glyph_val_iter_pairs) + for (const auto _ : hb_zip (iter.second, first_val_iter)) + if (_.first != _.second) + return 2; + + return 1; + } + + template<typename Iterator, + typename SrcLookup, + hb_requires (hb_is_iterator (Iterator))> + void serialize (hb_serialize_context_t *c, + const SrcLookup* src, + Iterator glyph_val_iter_pairs, + const hb_map_t *layout_variation_idx_map) + { + if (unlikely (!c->extend_min (u.format))) return; + unsigned format = 2; + ValueFormat new_format = src->get_value_format (); + + if (glyph_val_iter_pairs) + { + format = get_format (glyph_val_iter_pairs); + new_format = src->get_value_format ().get_effective_format (+ glyph_val_iter_pairs | hb_map (hb_second)); + } + + u.format = format; + switch (u.format) { + case 1: u.format1.serialize (c, + src, + glyph_val_iter_pairs, + new_format, + layout_variation_idx_map); + return; + case 2: u.format2.serialize (c, + src, + glyph_val_iter_pairs, + new_format, + layout_variation_idx_map); + return; + default:return; + } + } + + template <typename context_t, typename ...Ts> + typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const + { + TRACE_DISPATCH (this, u.format); + if (unlikely (!c->may_dispatch (this, &u.format))) return_trace (c->no_dispatch_return_value ()); + switch (u.format) { + case 1: return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...)); + case 2: return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...)); + default:return_trace (c->default_return_value ()); + } + } +}; + + +template<typename Iterator, typename SrcLookup> +static void +SinglePos_serialize (hb_serialize_context_t *c, + const SrcLookup *src, + Iterator it, + const hb_map_t *layout_variation_idx_map) +{ c->start_embed<SinglePos> ()->serialize (c, src, it, layout_variation_idx_map); } + + +} +} +} + +#endif /* OT_LAYOUT_GPOS_SINGLEPOS_HH */ diff --git a/thirdparty/harfbuzz/src/OT/Layout/GPOS/SinglePosFormat1.hh b/thirdparty/harfbuzz/src/OT/Layout/GPOS/SinglePosFormat1.hh new file mode 100644 index 0000000000..8b7840ed0e --- /dev/null +++ b/thirdparty/harfbuzz/src/OT/Layout/GPOS/SinglePosFormat1.hh @@ -0,0 +1,124 @@ +#ifndef OT_LAYOUT_GPOS_SINGLEPOSFORMAT1_HH +#define OT_LAYOUT_GPOS_SINGLEPOSFORMAT1_HH + +#include "Common.hh" +#include "ValueFormat.hh" + +namespace OT { +namespace Layout { +namespace GPOS_impl { + +struct SinglePosFormat1 +{ + protected: + HBUINT16 format; /* Format identifier--format = 1 */ + Offset16To<Coverage> + coverage; /* Offset to Coverage table--from + * beginning of subtable */ + ValueFormat valueFormat; /* Defines the types of data in the + * ValueRecord */ + ValueRecord values; /* Defines positioning + * value(s)--applied to all glyphs in + * the Coverage table */ + public: + DEFINE_SIZE_ARRAY (6, values); + + bool sanitize (hb_sanitize_context_t *c) const + { + TRACE_SANITIZE (this); + return_trace (c->check_struct (this) && + coverage.sanitize (c, this) && + valueFormat.sanitize_value (c, this, values)); + } + + bool intersects (const hb_set_t *glyphs) const + { return (this+coverage).intersects (glyphs); } + + void closure_lookups (hb_closure_lookups_context_t *c) const {} + void collect_variation_indices (hb_collect_variation_indices_context_t *c) const + { + if (!valueFormat.has_device ()) return; + + auto it = + + hb_iter (this+coverage) + | hb_filter (c->glyph_set) + ; + + if (!it) return; + valueFormat.collect_variation_indices (c, this, values.as_array (valueFormat.get_len ())); + } + + void collect_glyphs (hb_collect_glyphs_context_t *c) const + { if (unlikely (!(this+coverage).collect_coverage (c->input))) return; } + + const Coverage &get_coverage () const { return this+coverage; } + + ValueFormat get_value_format () const { return valueFormat; } + + bool apply (hb_ot_apply_context_t *c) const + { + TRACE_APPLY (this); + hb_buffer_t *buffer = c->buffer; + unsigned int index = (this+coverage).get_coverage (buffer->cur().codepoint); + if (likely (index == NOT_COVERED)) return_trace (false); + + valueFormat.apply_value (c, this, values, buffer->cur_pos()); + + buffer->idx++; + return_trace (true); + } + + template<typename Iterator, + typename SrcLookup, + hb_requires (hb_is_iterator (Iterator))> + void serialize (hb_serialize_context_t *c, + const SrcLookup *src, + Iterator it, + ValueFormat newFormat, + const hb_map_t *layout_variation_idx_map) + { + if (unlikely (!c->extend_min (this))) return; + if (unlikely (!c->check_assign (valueFormat, + newFormat, + HB_SERIALIZE_ERROR_INT_OVERFLOW))) return; + + for (const hb_array_t<const Value>& _ : + it | hb_map (hb_second)) + { + src->get_value_format ().copy_values (c, newFormat, src, &_, layout_variation_idx_map); + // Only serialize the first entry in the iterator, the rest are assumed to + // be the same. + break; + } + + auto glyphs = + + it + | hb_map_retains_sorting (hb_first) + ; + + coverage.serialize_serialize (c, glyphs); + } + + bool subset (hb_subset_context_t *c) const + { + TRACE_SUBSET (this); + const hb_set_t &glyphset = *c->plan->glyphset_gsub (); + const hb_map_t &glyph_map = *c->plan->glyph_map; + + auto it = + + hb_iter (this+coverage) + | hb_filter (glyphset) + | hb_map_retains_sorting (glyph_map) + | hb_zip (hb_repeat (values.as_array (valueFormat.get_len ()))) + ; + + bool ret = bool (it); + SinglePos_serialize (c->serializer, this, it, c->plan->layout_variation_idx_map); + return_trace (ret); + } +}; + +} +} +} + +#endif /* OT_LAYOUT_GPOS_SINGLEPOSFORMAT1_HH */ diff --git a/thirdparty/harfbuzz/src/OT/Layout/GPOS/SinglePosFormat2.hh b/thirdparty/harfbuzz/src/OT/Layout/GPOS/SinglePosFormat2.hh new file mode 100644 index 0000000000..0d038b4422 --- /dev/null +++ b/thirdparty/harfbuzz/src/OT/Layout/GPOS/SinglePosFormat2.hh @@ -0,0 +1,140 @@ +#ifndef OT_LAYOUT_GPOS_SINGLEPOSFORMAT2_HH +#define OT_LAYOUT_GPOS_SINGLEPOSFORMAT2_HH + +#include "Common.hh" + +namespace OT { +namespace Layout { +namespace GPOS_impl { + +struct SinglePosFormat2 +{ + protected: + HBUINT16 format; /* Format identifier--format = 2 */ + Offset16To<Coverage> + coverage; /* Offset to Coverage table--from + * beginning of subtable */ + ValueFormat valueFormat; /* Defines the types of data in the + * ValueRecord */ + HBUINT16 valueCount; /* Number of ValueRecords */ + ValueRecord values; /* Array of ValueRecords--positioning + * values applied to glyphs */ + public: + DEFINE_SIZE_ARRAY (8, values); + + bool sanitize (hb_sanitize_context_t *c) const + { + TRACE_SANITIZE (this); + return_trace (c->check_struct (this) && + coverage.sanitize (c, this) && + valueFormat.sanitize_values (c, this, values, valueCount)); + } + + bool intersects (const hb_set_t *glyphs) const + { return (this+coverage).intersects (glyphs); } + + void closure_lookups (hb_closure_lookups_context_t *c) const {} + void collect_variation_indices (hb_collect_variation_indices_context_t *c) const + { + if (!valueFormat.has_device ()) return; + + auto it = + + hb_zip (this+coverage, hb_range ((unsigned) valueCount)) + | hb_filter (c->glyph_set, hb_first) + ; + + if (!it) return; + + unsigned sub_length = valueFormat.get_len (); + const hb_array_t<const Value> values_array = values.as_array (valueCount * sub_length); + + for (unsigned i : + it + | hb_map (hb_second)) + valueFormat.collect_variation_indices (c, this, values_array.sub_array (i * sub_length, sub_length)); + + } + + void collect_glyphs (hb_collect_glyphs_context_t *c) const + { if (unlikely (!(this+coverage).collect_coverage (c->input))) return; } + + const Coverage &get_coverage () const { return this+coverage; } + + ValueFormat get_value_format () const { return valueFormat; } + + bool apply (hb_ot_apply_context_t *c) const + { + TRACE_APPLY (this); + hb_buffer_t *buffer = c->buffer; + unsigned int index = (this+coverage).get_coverage (buffer->cur().codepoint); + if (likely (index == NOT_COVERED)) return_trace (false); + + if (likely (index >= valueCount)) return_trace (false); + + valueFormat.apply_value (c, this, + &values[index * valueFormat.get_len ()], + buffer->cur_pos()); + + buffer->idx++; + return_trace (true); + } + + template<typename Iterator, + typename SrcLookup, + hb_requires (hb_is_iterator (Iterator))> + void serialize (hb_serialize_context_t *c, + const SrcLookup *src, + Iterator it, + ValueFormat newFormat, + const hb_map_t *layout_variation_idx_map) + { + auto out = c->extend_min (this); + if (unlikely (!out)) return; + if (unlikely (!c->check_assign (valueFormat, newFormat, HB_SERIALIZE_ERROR_INT_OVERFLOW))) return; + if (unlikely (!c->check_assign (valueCount, it.len (), HB_SERIALIZE_ERROR_ARRAY_OVERFLOW))) return; + + + it + | hb_map (hb_second) + | hb_apply ([&] (hb_array_t<const Value> _) + { src->get_value_format ().copy_values (c, newFormat, src, &_, layout_variation_idx_map); }) + ; + + auto glyphs = + + it + | hb_map_retains_sorting (hb_first) + ; + + coverage.serialize_serialize (c, glyphs); + } + + bool subset (hb_subset_context_t *c) const + { + TRACE_SUBSET (this); + const hb_set_t &glyphset = *c->plan->glyphset_gsub (); + const hb_map_t &glyph_map = *c->plan->glyph_map; + + unsigned sub_length = valueFormat.get_len (); + auto values_array = values.as_array (valueCount * sub_length); + + auto it = + + hb_zip (this+coverage, hb_range ((unsigned) valueCount)) + | hb_filter (glyphset, hb_first) + | hb_map_retains_sorting ([&] (const hb_pair_t<hb_codepoint_t, unsigned>& _) + { + return hb_pair (glyph_map[_.first], + values_array.sub_array (_.second * sub_length, + sub_length)); + }) + ; + + bool ret = bool (it); + SinglePos_serialize (c->serializer, this, it, c->plan->layout_variation_idx_map); + return_trace (ret); + } +}; + + +} +} +} + +#endif /* OT_LAYOUT_GPOS_SINGLEPOSFORMAT2_HH */ diff --git a/thirdparty/harfbuzz/src/OT/Layout/GPOS/ValueFormat.hh b/thirdparty/harfbuzz/src/OT/Layout/GPOS/ValueFormat.hh new file mode 100644 index 0000000000..b29f287bce --- /dev/null +++ b/thirdparty/harfbuzz/src/OT/Layout/GPOS/ValueFormat.hh @@ -0,0 +1,329 @@ +#ifndef OT_LAYOUT_GPOS_VALUEFORMAT_HH +#define OT_LAYOUT_GPOS_VALUEFORMAT_HH + +#include "../../../hb-ot-layout-gsubgpos.hh" + +namespace OT { +namespace Layout { +namespace GPOS_impl { + +typedef HBUINT16 Value; + +typedef UnsizedArrayOf<Value> ValueRecord; + +struct ValueFormat : HBUINT16 +{ + enum Flags { + xPlacement = 0x0001u, /* Includes horizontal adjustment for placement */ + yPlacement = 0x0002u, /* Includes vertical adjustment for placement */ + xAdvance = 0x0004u, /* Includes horizontal adjustment for advance */ + yAdvance = 0x0008u, /* Includes vertical adjustment for advance */ + xPlaDevice = 0x0010u, /* Includes horizontal Device table for placement */ + yPlaDevice = 0x0020u, /* Includes vertical Device table for placement */ + xAdvDevice = 0x0040u, /* Includes horizontal Device table for advance */ + yAdvDevice = 0x0080u, /* Includes vertical Device table for advance */ + ignored = 0x0F00u, /* Was used in TrueType Open for MM fonts */ + reserved = 0xF000u, /* For future use */ + + devices = 0x00F0u /* Mask for having any Device table */ + }; + +/* All fields are options. Only those available advance the value pointer. */ +#if 0 + HBINT16 xPlacement; /* Horizontal adjustment for + * placement--in design units */ + HBINT16 yPlacement; /* Vertical adjustment for + * placement--in design units */ + HBINT16 xAdvance; /* Horizontal adjustment for + * advance--in design units (only used + * for horizontal writing) */ + HBINT16 yAdvance; /* Vertical adjustment for advance--in + * design units (only used for vertical + * writing) */ + Offset16To<Device> xPlaDevice; /* Offset to Device table for + * horizontal placement--measured from + * beginning of PosTable (may be NULL) */ + Offset16To<Device> yPlaDevice; /* Offset to Device table for vertical + * placement--measured from beginning + * of PosTable (may be NULL) */ + Offset16To<Device> xAdvDevice; /* Offset to Device table for + * horizontal advance--measured from + * beginning of PosTable (may be NULL) */ + Offset16To<Device> yAdvDevice; /* Offset to Device table for vertical + * advance--measured from beginning of + * PosTable (may be NULL) */ +#endif + + IntType& operator = (uint16_t i) { v = i; return *this; } + + unsigned int get_len () const { return hb_popcount ((unsigned int) *this); } + unsigned int get_size () const { return get_len () * Value::static_size; } + + bool apply_value (hb_ot_apply_context_t *c, + const void *base, + const Value *values, + hb_glyph_position_t &glyph_pos) const + { + bool ret = false; + unsigned int format = *this; + if (!format) return ret; + + hb_font_t *font = c->font; + bool horizontal = +#ifndef HB_NO_VERTICAL + HB_DIRECTION_IS_HORIZONTAL (c->direction) +#else + true +#endif + ; + + if (format & xPlacement) glyph_pos.x_offset += font->em_scale_x (get_short (values++, &ret)); + if (format & yPlacement) glyph_pos.y_offset += font->em_scale_y (get_short (values++, &ret)); + if (format & xAdvance) { + if (likely (horizontal)) glyph_pos.x_advance += font->em_scale_x (get_short (values, &ret)); + values++; + } + /* y_advance values grow downward but font-space grows upward, hence negation */ + if (format & yAdvance) { + if (unlikely (!horizontal)) glyph_pos.y_advance -= font->em_scale_y (get_short (values, &ret)); + values++; + } + + if (!has_device ()) return ret; + + bool use_x_device = font->x_ppem || font->num_coords; + bool use_y_device = font->y_ppem || font->num_coords; + + if (!use_x_device && !use_y_device) return ret; + + const VariationStore &store = c->var_store; + auto *cache = c->var_store_cache; + + /* pixel -> fractional pixel */ + if (format & xPlaDevice) { + if (use_x_device) glyph_pos.x_offset += (base + get_device (values, &ret)).get_x_delta (font, store, cache); + values++; + } + if (format & yPlaDevice) { + if (use_y_device) glyph_pos.y_offset += (base + get_device (values, &ret)).get_y_delta (font, store, cache); + values++; + } + if (format & xAdvDevice) { + if (horizontal && use_x_device) glyph_pos.x_advance += (base + get_device (values, &ret)).get_x_delta (font, store, cache); + values++; + } + if (format & yAdvDevice) { + /* y_advance values grow downward but font-space grows upward, hence negation */ + if (!horizontal && use_y_device) glyph_pos.y_advance -= (base + get_device (values, &ret)).get_y_delta (font, store, cache); + values++; + } + return ret; + } + + unsigned int get_effective_format (const Value *values) const + { + unsigned int format = *this; + for (unsigned flag = xPlacement; flag <= yAdvDevice; flag = flag << 1) { + if (format & flag) should_drop (*values++, (Flags) flag, &format); + } + + return format; + } + + template<typename Iterator, + hb_requires (hb_is_iterator (Iterator))> + unsigned int get_effective_format (Iterator it) const { + unsigned int new_format = 0; + + for (const hb_array_t<const Value>& values : it) + new_format = new_format | get_effective_format (&values); + + return new_format; + } + + void copy_values (hb_serialize_context_t *c, + unsigned int new_format, + const void *base, + const Value *values, + const hb_map_t *layout_variation_idx_map) const + { + unsigned int format = *this; + if (!format) return; + + if (format & xPlacement) copy_value (c, new_format, xPlacement, *values++); + if (format & yPlacement) copy_value (c, new_format, yPlacement, *values++); + if (format & xAdvance) copy_value (c, new_format, xAdvance, *values++); + if (format & yAdvance) copy_value (c, new_format, yAdvance, *values++); + + if (format & xPlaDevice) copy_device (c, base, values++, layout_variation_idx_map); + if (format & yPlaDevice) copy_device (c, base, values++, layout_variation_idx_map); + if (format & xAdvDevice) copy_device (c, base, values++, layout_variation_idx_map); + if (format & yAdvDevice) copy_device (c, base, values++, layout_variation_idx_map); + } + + void copy_value (hb_serialize_context_t *c, + unsigned int new_format, + Flags flag, + Value value) const + { + // Filter by new format. + if (!(new_format & flag)) return; + c->copy (value); + } + + void collect_variation_indices (hb_collect_variation_indices_context_t *c, + const void *base, + const hb_array_t<const Value>& values) const + { + unsigned format = *this; + unsigned i = 0; + if (format & xPlacement) i++; + if (format & yPlacement) i++; + if (format & xAdvance) i++; + if (format & yAdvance) i++; + if (format & xPlaDevice) + { + (base + get_device (&(values[i]))).collect_variation_indices (c->layout_variation_indices); + i++; + } + + if (format & ValueFormat::yPlaDevice) + { + (base + get_device (&(values[i]))).collect_variation_indices (c->layout_variation_indices); + i++; + } + + if (format & ValueFormat::xAdvDevice) + { + + (base + get_device (&(values[i]))).collect_variation_indices (c->layout_variation_indices); + i++; + } + + if (format & ValueFormat::yAdvDevice) + { + + (base + get_device (&(values[i]))).collect_variation_indices (c->layout_variation_indices); + i++; + } + } + + private: + bool sanitize_value_devices (hb_sanitize_context_t *c, const void *base, const Value *values) const + { + unsigned int format = *this; + + if (format & xPlacement) values++; + if (format & yPlacement) values++; + if (format & xAdvance) values++; + if (format & yAdvance) values++; + + if ((format & xPlaDevice) && !get_device (values++).sanitize (c, base)) return false; + if ((format & yPlaDevice) && !get_device (values++).sanitize (c, base)) return false; + if ((format & xAdvDevice) && !get_device (values++).sanitize (c, base)) return false; + if ((format & yAdvDevice) && !get_device (values++).sanitize (c, base)) return false; + + return true; + } + + static inline Offset16To<Device>& get_device (Value* value) + { + return *static_cast<Offset16To<Device> *> (value); + } + static inline const Offset16To<Device>& get_device (const Value* value, bool *worked=nullptr) + { + if (worked) *worked |= bool (*value); + return *static_cast<const Offset16To<Device> *> (value); + } + + bool copy_device (hb_serialize_context_t *c, const void *base, + const Value *src_value, const hb_map_t *layout_variation_idx_map) const + { + Value *dst_value = c->copy (*src_value); + + if (!dst_value) return false; + if (*dst_value == 0) return true; + + *dst_value = 0; + c->push (); + if ((base + get_device (src_value)).copy (c, layout_variation_idx_map)) + { + c->add_link (*dst_value, c->pop_pack ()); + return true; + } + else + { + c->pop_discard (); + return false; + } + } + + static inline const HBINT16& get_short (const Value* value, bool *worked=nullptr) + { + if (worked) *worked |= bool (*value); + return *reinterpret_cast<const HBINT16 *> (value); + } + + public: + + bool has_device () const + { + unsigned int format = *this; + return (format & devices) != 0; + } + + bool sanitize_value (hb_sanitize_context_t *c, const void *base, const Value *values) const + { + TRACE_SANITIZE (this); + return_trace (c->check_range (values, get_size ()) && (!has_device () || sanitize_value_devices (c, base, values))); + } + + bool sanitize_values (hb_sanitize_context_t *c, const void *base, const Value *values, unsigned int count) const + { + TRACE_SANITIZE (this); + unsigned int len = get_len (); + + if (!c->check_range (values, count, get_size ())) return_trace (false); + + if (!has_device ()) return_trace (true); + + for (unsigned int i = 0; i < count; i++) { + if (!sanitize_value_devices (c, base, values)) + return_trace (false); + values += len; + } + + return_trace (true); + } + + /* Just sanitize referenced Device tables. Doesn't check the values themselves. */ + bool sanitize_values_stride_unsafe (hb_sanitize_context_t *c, const void *base, const Value *values, unsigned int count, unsigned int stride) const + { + TRACE_SANITIZE (this); + + if (!has_device ()) return_trace (true); + + for (unsigned int i = 0; i < count; i++) { + if (!sanitize_value_devices (c, base, values)) + return_trace (false); + values += stride; + } + + return_trace (true); + } + + private: + + void should_drop (Value value, Flags flag, unsigned int* format) const + { + if (value) return; + *format = *format & ~flag; + } + +}; + +} +} +} + +#endif // #ifndef OT_LAYOUT_GPOS_VALUEFORMAT_HH diff --git a/thirdparty/harfbuzz/src/OT/Layout/GSUB/GSUB.hh b/thirdparty/harfbuzz/src/OT/Layout/GSUB/GSUB.hh index ad153ce8d7..3f0c4b2ad9 100644 --- a/thirdparty/harfbuzz/src/OT/Layout/GSUB/GSUB.hh +++ b/thirdparty/harfbuzz/src/OT/Layout/GSUB/GSUB.hh @@ -19,6 +19,8 @@ namespace GSUB { struct GSUB : GSUBGPOS { + using Lookup = SubstLookup; + static constexpr hb_tag_t tableTag = HB_OT_TAG_GSUB; const SubstLookup& get_lookup (unsigned int i) const diff --git a/thirdparty/harfbuzz/src/OT/Layout/GSUB/SubstLookup.hh b/thirdparty/harfbuzz/src/OT/Layout/GSUB/SubstLookup.hh index 3419b5a734..8fb3b55097 100644 --- a/thirdparty/harfbuzz/src/OT/Layout/GSUB/SubstLookup.hh +++ b/thirdparty/harfbuzz/src/OT/Layout/GSUB/SubstLookup.hh @@ -10,7 +10,7 @@ namespace GSUB { struct SubstLookup : Lookup { - typedef SubstLookupSubTable SubTable; + using SubTable = SubstLookupSubTable; bool sanitize (hb_sanitize_context_t *c) const { return Lookup::sanitize<SubTable> (c); } @@ -73,8 +73,6 @@ struct SubstLookup : Lookup return hb_closure_lookups_context_t::default_return_value (); } - c->set_recurse_func (dispatch_closure_lookups_recurse_func); - hb_closure_lookups_context_t::return_t ret = dispatch (c); return ret; } @@ -100,8 +98,6 @@ struct SubstLookup : Lookup return dispatch (c); } - static inline bool apply_recurse_func (hb_ot_apply_context_t *c, unsigned int lookup_index); - bool serialize_single (hb_serialize_context_t *c, uint32_t lookup_props, hb_sorted_array_t<const HBGlyphID16> glyphs, @@ -206,8 +202,6 @@ struct SubstLookup : Lookup return ret; } - HB_INTERNAL static hb_closure_lookups_context_t::return_t dispatch_closure_lookups_recurse_func (hb_closure_lookups_context_t *c, unsigned lookup_index); - template <typename context_t, typename ...Ts> typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const { return Lookup::dispatch<SubTable> (c, std::forward<Ts> (ds)...); } diff --git a/thirdparty/harfbuzz/src/OT/glyf/CompositeGlyph.hh b/thirdparty/harfbuzz/src/OT/glyf/CompositeGlyph.hh new file mode 100644 index 0000000000..c145beaa49 --- /dev/null +++ b/thirdparty/harfbuzz/src/OT/glyf/CompositeGlyph.hh @@ -0,0 +1,258 @@ +#ifndef OT_GLYF_COMPOSITEGLYPH_HH +#define OT_GLYF_COMPOSITEGLYPH_HH + + +#include "../../hb-open-type.hh" + + +namespace OT { +namespace glyf_impl { + + +struct CompositeGlyphRecord +{ + protected: + enum composite_glyph_flag_t + { + ARG_1_AND_2_ARE_WORDS = 0x0001, + ARGS_ARE_XY_VALUES = 0x0002, + ROUND_XY_TO_GRID = 0x0004, + WE_HAVE_A_SCALE = 0x0008, + MORE_COMPONENTS = 0x0020, + WE_HAVE_AN_X_AND_Y_SCALE = 0x0040, + WE_HAVE_A_TWO_BY_TWO = 0x0080, + WE_HAVE_INSTRUCTIONS = 0x0100, + USE_MY_METRICS = 0x0200, + OVERLAP_COMPOUND = 0x0400, + SCALED_COMPONENT_OFFSET = 0x0800, + UNSCALED_COMPONENT_OFFSET = 0x1000 + }; + + public: + unsigned int get_size () const + { + unsigned int size = min_size; + /* arg1 and 2 are int16 */ + if (flags & ARG_1_AND_2_ARE_WORDS) size += 4; + /* arg1 and 2 are int8 */ + else size += 2; + + /* One x 16 bit (scale) */ + if (flags & WE_HAVE_A_SCALE) size += 2; + /* Two x 16 bit (xscale, yscale) */ + else if (flags & WE_HAVE_AN_X_AND_Y_SCALE) size += 4; + /* Four x 16 bit (xscale, scale01, scale10, yscale) */ + else if (flags & WE_HAVE_A_TWO_BY_TWO) size += 8; + + return size; + } + + void drop_instructions_flag () { flags = (uint16_t) flags & ~WE_HAVE_INSTRUCTIONS; } + void set_overlaps_flag () + { + flags = (uint16_t) flags | OVERLAP_COMPOUND; + } + + bool has_instructions () const { return flags & WE_HAVE_INSTRUCTIONS; } + + bool has_more () const { return flags & MORE_COMPONENTS; } + bool is_use_my_metrics () const { return flags & USE_MY_METRICS; } + bool is_anchored () const { return !(flags & ARGS_ARE_XY_VALUES); } + void get_anchor_points (unsigned int &point1, unsigned int &point2) const + { + const HBUINT8 *p = &StructAfter<const HBUINT8> (glyphIndex); + if (flags & ARG_1_AND_2_ARE_WORDS) + { + point1 = ((const HBUINT16 *) p)[0]; + point2 = ((const HBUINT16 *) p)[1]; + } + else + { + point1 = p[0]; + point2 = p[1]; + } + } + + void transform_points (contour_point_vector_t &points) const + { + float matrix[4]; + contour_point_t trans; + if (get_transformation (matrix, trans)) + { + if (scaled_offsets ()) + { + points.translate (trans); + points.transform (matrix); + } + else + { + points.transform (matrix); + points.translate (trans); + } + } + } + + protected: + bool scaled_offsets () const + { return (flags & (SCALED_COMPONENT_OFFSET | UNSCALED_COMPONENT_OFFSET)) == SCALED_COMPONENT_OFFSET; } + + bool get_transformation (float (&matrix)[4], contour_point_t &trans) const + { + matrix[0] = matrix[3] = 1.f; + matrix[1] = matrix[2] = 0.f; + + int tx, ty; + const HBINT8 *p = &StructAfter<const HBINT8> (glyphIndex); + if (flags & ARG_1_AND_2_ARE_WORDS) + { + tx = *(const HBINT16 *) p; + p += HBINT16::static_size; + ty = *(const HBINT16 *) p; + p += HBINT16::static_size; + } + else + { + tx = *p++; + ty = *p++; + } + if (is_anchored ()) tx = ty = 0; + + trans.init ((float) tx, (float) ty); + + { + const F2DOT14 *points = (const F2DOT14 *) p; + if (flags & WE_HAVE_A_SCALE) + { + matrix[0] = matrix[3] = points[0].to_float (); + return true; + } + else if (flags & WE_HAVE_AN_X_AND_Y_SCALE) + { + matrix[0] = points[0].to_float (); + matrix[3] = points[1].to_float (); + return true; + } + else if (flags & WE_HAVE_A_TWO_BY_TWO) + { + matrix[0] = points[0].to_float (); + matrix[1] = points[1].to_float (); + matrix[2] = points[2].to_float (); + matrix[3] = points[3].to_float (); + return true; + } + } + return tx || ty; + } + + public: + HBUINT16 flags; + HBGlyphID16 glyphIndex; + public: + DEFINE_SIZE_MIN (4); +}; + +struct composite_iter_t : hb_iter_with_fallback_t<composite_iter_t, const CompositeGlyphRecord &> +{ + typedef const CompositeGlyphRecord *__item_t__; + composite_iter_t (hb_bytes_t glyph_, __item_t__ current_) : + glyph (glyph_), current (nullptr), current_size (0) + { + set_current (current_); + } + + composite_iter_t () : glyph (hb_bytes_t ()), current (nullptr), current_size (0) {} + + item_t __item__ () const { return *current; } + bool __more__ () const { return current; } + void __next__ () + { + if (!current->has_more ()) { current = nullptr; return; } + + set_current (&StructAtOffset<CompositeGlyphRecord> (current, current_size)); + } + composite_iter_t __end__ () const { return composite_iter_t (); } + bool operator != (const composite_iter_t& o) const + { return current != o.current; } + + + void set_current (__item_t__ current_) + { + if (!glyph.check_range (current_, CompositeGlyphRecord::min_size)) + { + current = nullptr; + current_size = 0; + return; + } + unsigned size = current_->get_size (); + if (!glyph.check_range (current_, size)) + { + current = nullptr; + current_size = 0; + return; + } + + current = current_; + current_size = size; + } + + private: + hb_bytes_t glyph; + __item_t__ current; + unsigned current_size; +}; + +struct CompositeGlyph +{ + const GlyphHeader &header; + hb_bytes_t bytes; + CompositeGlyph (const GlyphHeader &header_, hb_bytes_t bytes_) : + header (header_), bytes (bytes_) {} + + composite_iter_t iter () const + { return composite_iter_t (bytes, &StructAfter<CompositeGlyphRecord, GlyphHeader> (header)); } + + unsigned int instructions_length (hb_bytes_t bytes) const + { + unsigned int start = bytes.length; + unsigned int end = bytes.length; + const CompositeGlyphRecord *last = nullptr; + for (auto &item : iter ()) + last = &item; + if (unlikely (!last)) return 0; + + if (last->has_instructions ()) + start = (char *) last - &bytes + last->get_size (); + if (unlikely (start > end)) return 0; + return end - start; + } + + /* Trimming for composites not implemented. + * If removing hints it falls out of that. */ + const hb_bytes_t trim_padding () const { return bytes; } + + void drop_hints () + { + for (const auto &_ : iter ()) + const_cast<CompositeGlyphRecord &> (_).drop_instructions_flag (); + } + + /* Chop instructions off the end */ + void drop_hints_bytes (hb_bytes_t &dest_start) const + { dest_start = bytes.sub_array (0, bytes.length - instructions_length (bytes)); } + + void set_overlaps_flag () + { + CompositeGlyphRecord& glyph_chain = const_cast<CompositeGlyphRecord &> ( + StructAfter<CompositeGlyphRecord, GlyphHeader> (header)); + if (!bytes.check_range(&glyph_chain, CompositeGlyphRecord::min_size)) + return; + glyph_chain.set_overlaps_flag (); + } +}; + + +} /* namespace glyf_impl */ +} /* namespace OT */ + + +#endif /* OT_GLYF_COMPOSITEGLYPH_HH */ diff --git a/thirdparty/harfbuzz/src/OT/glyf/Glyph.hh b/thirdparty/harfbuzz/src/OT/glyf/Glyph.hh new file mode 100644 index 0000000000..2199d2c48b --- /dev/null +++ b/thirdparty/harfbuzz/src/OT/glyf/Glyph.hh @@ -0,0 +1,233 @@ +#ifndef OT_GLYF_GLYPH_HH +#define OT_GLYF_GLYPH_HH + + +#include "../../hb-open-type.hh" + +#include "GlyphHeader.hh" +#include "SimpleGlyph.hh" +#include "CompositeGlyph.hh" + + +namespace OT { + +struct glyf_accelerator_t; + +namespace glyf_impl { + + +enum phantom_point_index_t +{ + PHANTOM_LEFT = 0, + PHANTOM_RIGHT = 1, + PHANTOM_TOP = 2, + PHANTOM_BOTTOM = 3, + PHANTOM_COUNT = 4 +}; + +struct Glyph +{ + enum glyph_type_t { EMPTY, SIMPLE, COMPOSITE }; + + public: + composite_iter_t get_composite_iterator () const + { + if (type != COMPOSITE) return composite_iter_t (); + return CompositeGlyph (*header, bytes).iter (); + } + + const hb_bytes_t trim_padding () const + { + switch (type) { + case COMPOSITE: return CompositeGlyph (*header, bytes).trim_padding (); + case SIMPLE: return SimpleGlyph (*header, bytes).trim_padding (); + default: return bytes; + } + } + + void drop_hints () + { + switch (type) { + case COMPOSITE: CompositeGlyph (*header, bytes).drop_hints (); return; + case SIMPLE: SimpleGlyph (*header, bytes).drop_hints (); return; + default: return; + } + } + + void set_overlaps_flag () + { + switch (type) { + case COMPOSITE: CompositeGlyph (*header, bytes).set_overlaps_flag (); return; + case SIMPLE: SimpleGlyph (*header, bytes).set_overlaps_flag (); return; + default: return; + } + } + + void drop_hints_bytes (hb_bytes_t &dest_start, hb_bytes_t &dest_end) const + { + switch (type) { + case COMPOSITE: CompositeGlyph (*header, bytes).drop_hints_bytes (dest_start); return; + case SIMPLE: SimpleGlyph (*header, bytes).drop_hints_bytes (dest_start, dest_end); return; + default: return; + } + } + + /* Note: Recursively calls itself. + * all_points includes phantom points + */ + template <typename accelerator_t> + bool get_points (hb_font_t *font, const accelerator_t &glyf_accelerator, + contour_point_vector_t &all_points /* OUT */, + bool phantom_only = false, + unsigned int depth = 0) const + { + if (unlikely (depth > HB_MAX_NESTING_LEVEL)) return false; + contour_point_vector_t stack_points; + bool inplace = type == SIMPLE && all_points.length == 0; + /* Load into all_points if it's empty, as an optimization. */ + contour_point_vector_t &points = inplace ? all_points : stack_points; + + switch (type) { + case COMPOSITE: + { + /* pseudo component points for each component in composite glyph */ + unsigned num_points = hb_len (CompositeGlyph (*header, bytes).iter ()); + if (unlikely (!points.resize (num_points))) return false; + break; + } + case SIMPLE: + if (unlikely (!SimpleGlyph (*header, bytes).get_contour_points (points, phantom_only))) + return false; + break; + } + + /* Init phantom points */ + if (unlikely (!points.resize (points.length + PHANTOM_COUNT))) return false; + hb_array_t<contour_point_t> phantoms = points.sub_array (points.length - PHANTOM_COUNT, PHANTOM_COUNT); + { + int h_delta = (int) header->xMin - + glyf_accelerator.hmtx->get_side_bearing (gid); + int v_orig = (int) header->yMax + +#ifndef HB_NO_VERTICAL + glyf_accelerator.vmtx->get_side_bearing (gid) +#else + 0 +#endif + ; + unsigned h_adv = glyf_accelerator.hmtx->get_advance (gid); + unsigned v_adv = +#ifndef HB_NO_VERTICAL + glyf_accelerator.vmtx->get_advance (gid) +#else + - font->face->get_upem () +#endif + ; + phantoms[PHANTOM_LEFT].x = h_delta; + phantoms[PHANTOM_RIGHT].x = h_adv + h_delta; + phantoms[PHANTOM_TOP].y = v_orig; + phantoms[PHANTOM_BOTTOM].y = v_orig - (int) v_adv; + } + +#ifndef HB_NO_VAR + glyf_accelerator.gvar->apply_deltas_to_points (gid, font, points.as_array ()); +#endif + + switch (type) { + case SIMPLE: + if (!inplace) + all_points.extend (points.as_array ()); + break; + case COMPOSITE: + { + contour_point_vector_t comp_points; + unsigned int comp_index = 0; + for (auto &item : get_composite_iterator ()) + { + comp_points.reset (); + if (unlikely (!glyf_accelerator.glyph_for_gid (item.glyphIndex) + .get_points (font, glyf_accelerator, comp_points, + phantom_only, depth + 1))) + return false; + + /* Copy phantom points from component if USE_MY_METRICS flag set */ + if (item.is_use_my_metrics ()) + for (unsigned int i = 0; i < PHANTOM_COUNT; i++) + phantoms[i] = comp_points[comp_points.length - PHANTOM_COUNT + i]; + + /* Apply component transformation & translation */ + item.transform_points (comp_points); + + /* Apply translation from gvar */ + comp_points.translate (points[comp_index]); + + if (item.is_anchored ()) + { + unsigned int p1, p2; + item.get_anchor_points (p1, p2); + if (likely (p1 < all_points.length && p2 < comp_points.length)) + { + contour_point_t delta; + delta.init (all_points[p1].x - comp_points[p2].x, + all_points[p1].y - comp_points[p2].y); + + comp_points.translate (delta); + } + } + + all_points.extend (comp_points.sub_array (0, comp_points.length - PHANTOM_COUNT)); + + comp_index++; + } + + all_points.extend (phantoms); + } break; + default: + all_points.extend (phantoms); + } + + if (depth == 0) /* Apply at top level */ + { + /* Undocumented rasterizer behavior: + * Shift points horizontally by the updated left side bearing + */ + contour_point_t delta; + delta.init (-phantoms[PHANTOM_LEFT].x, 0.f); + if (delta.x) all_points.translate (delta); + } + + return !all_points.in_error (); + } + + bool get_extents (hb_font_t *font, const glyf_accelerator_t &glyf_accelerator, + hb_glyph_extents_t *extents) const + { + if (type == EMPTY) return true; /* Empty glyph; zero extents. */ + return header->get_extents (font, glyf_accelerator, gid, extents); + } + + hb_bytes_t get_bytes () const { return bytes; } + + Glyph (hb_bytes_t bytes_ = hb_bytes_t (), + hb_codepoint_t gid_ = (hb_codepoint_t) -1) : bytes (bytes_), + header (bytes.as<GlyphHeader> ()), + gid (gid_) + { + int num_contours = header->numberOfContours; + if (unlikely (num_contours == 0)) type = EMPTY; + else if (num_contours > 0) type = SIMPLE; + else type = COMPOSITE; /* negative numbers */ + } + + protected: + hb_bytes_t bytes; + const GlyphHeader *header; + hb_codepoint_t gid; + unsigned type; +}; + + +} /* namespace glyf_impl */ +} /* namespace OT */ + + +#endif /* OT_GLYF_GLYPH_HH */ diff --git a/thirdparty/harfbuzz/src/OT/glyf/GlyphHeader.hh b/thirdparty/harfbuzz/src/OT/glyf/GlyphHeader.hh new file mode 100644 index 0000000000..792bd5478f --- /dev/null +++ b/thirdparty/harfbuzz/src/OT/glyf/GlyphHeader.hh @@ -0,0 +1,48 @@ +#ifndef OT_GLYF_GLYPHHEADER_HH +#define OT_GLYF_GLYPHHEADER_HH + + +#include "../../hb-open-type.hh" + + +namespace OT { +namespace glyf_impl { + + +struct GlyphHeader +{ + bool has_data () const { return numberOfContours; } + + template <typename accelerator_t> + bool get_extents (hb_font_t *font, const accelerator_t &glyf_accelerator, + hb_codepoint_t gid, hb_glyph_extents_t *extents) const + { + /* Undocumented rasterizer behavior: shift glyph to the left by (lsb - xMin), i.e., xMin = lsb */ + /* extents->x_bearing = hb_min (glyph_header.xMin, glyph_header.xMax); */ + extents->x_bearing = font->em_scale_x (glyf_accelerator.hmtx->get_side_bearing (gid)); + extents->y_bearing = font->em_scale_y (hb_max (yMin, yMax)); + extents->width = font->em_scale_x (hb_max (xMin, xMax) - hb_min (xMin, xMax)); + extents->height = font->em_scale_y (hb_min (yMin, yMax) - hb_max (yMin, yMax)); + + return true; + } + + HBINT16 numberOfContours; + /* If the number of contours is + * greater than or equal to zero, + * this is a simple glyph; if negative, + * this is a composite glyph. */ + FWORD xMin; /* Minimum x for coordinate data. */ + FWORD yMin; /* Minimum y for coordinate data. */ + FWORD xMax; /* Maximum x for coordinate data. */ + FWORD yMax; /* Maximum y for coordinate data. */ + public: + DEFINE_SIZE_STATIC (10); +}; + + +} /* namespace glyf_impl */ +} /* namespace OT */ + + +#endif /* OT_GLYF_GLYPHHEADER_HH */ diff --git a/thirdparty/harfbuzz/src/OT/glyf/SimpleGlyph.hh b/thirdparty/harfbuzz/src/OT/glyf/SimpleGlyph.hh new file mode 100644 index 0000000000..6df978cf13 --- /dev/null +++ b/thirdparty/harfbuzz/src/OT/glyf/SimpleGlyph.hh @@ -0,0 +1,216 @@ +#ifndef OT_GLYF_SIMPLEGLYPH_HH +#define OT_GLYF_SIMPLEGLYPH_HH + + +#include "../../hb-open-type.hh" + + +namespace OT { +namespace glyf_impl { + + +struct SimpleGlyph +{ + enum simple_glyph_flag_t + { + FLAG_ON_CURVE = 0x01, + FLAG_X_SHORT = 0x02, + FLAG_Y_SHORT = 0x04, + FLAG_REPEAT = 0x08, + FLAG_X_SAME = 0x10, + FLAG_Y_SAME = 0x20, + FLAG_OVERLAP_SIMPLE = 0x40, + FLAG_RESERVED2 = 0x80 + }; + + const GlyphHeader &header; + hb_bytes_t bytes; + SimpleGlyph (const GlyphHeader &header_, hb_bytes_t bytes_) : + header (header_), bytes (bytes_) {} + + unsigned int instruction_len_offset () const + { return GlyphHeader::static_size + 2 * header.numberOfContours; } + + unsigned int length (unsigned int instruction_len) const + { return instruction_len_offset () + 2 + instruction_len; } + + unsigned int instructions_length () const + { + unsigned int instruction_length_offset = instruction_len_offset (); + if (unlikely (instruction_length_offset + 2 > bytes.length)) return 0; + + const HBUINT16 &instructionLength = StructAtOffset<HBUINT16> (&bytes, instruction_length_offset); + /* Out of bounds of the current glyph */ + if (unlikely (length (instructionLength) > bytes.length)) return 0; + return instructionLength; + } + + const hb_bytes_t trim_padding () const + { + /* based on FontTools _g_l_y_f.py::trim */ + const uint8_t *glyph = (uint8_t*) bytes.arrayZ; + const uint8_t *glyph_end = glyph + bytes.length; + /* simple glyph w/contours, possibly trimmable */ + glyph += instruction_len_offset (); + + if (unlikely (glyph + 2 >= glyph_end)) return hb_bytes_t (); + unsigned int num_coordinates = StructAtOffset<HBUINT16> (glyph - 2, 0) + 1; + unsigned int num_instructions = StructAtOffset<HBUINT16> (glyph, 0); + + glyph += 2 + num_instructions; + + unsigned int coord_bytes = 0; + unsigned int coords_with_flags = 0; + while (glyph < glyph_end) + { + uint8_t flag = *glyph; + glyph++; + + unsigned int repeat = 1; + if (flag & FLAG_REPEAT) + { + if (unlikely (glyph >= glyph_end)) return hb_bytes_t (); + repeat = *glyph + 1; + glyph++; + } + + unsigned int xBytes, yBytes; + xBytes = yBytes = 0; + if (flag & FLAG_X_SHORT) xBytes = 1; + else if ((flag & FLAG_X_SAME) == 0) xBytes = 2; + + if (flag & FLAG_Y_SHORT) yBytes = 1; + else if ((flag & FLAG_Y_SAME) == 0) yBytes = 2; + + coord_bytes += (xBytes + yBytes) * repeat; + coords_with_flags += repeat; + if (coords_with_flags >= num_coordinates) break; + } + + if (unlikely (coords_with_flags != num_coordinates)) return hb_bytes_t (); + return bytes.sub_array (0, bytes.length + coord_bytes - (glyph_end - glyph)); + } + + /* zero instruction length */ + void drop_hints () + { + GlyphHeader &glyph_header = const_cast<GlyphHeader &> (header); + (HBUINT16 &) StructAtOffset<HBUINT16> (&glyph_header, instruction_len_offset ()) = 0; + } + + void drop_hints_bytes (hb_bytes_t &dest_start, hb_bytes_t &dest_end) const + { + unsigned int instructions_len = instructions_length (); + unsigned int glyph_length = length (instructions_len); + dest_start = bytes.sub_array (0, glyph_length - instructions_len); + dest_end = bytes.sub_array (glyph_length, bytes.length - glyph_length); + } + + void set_overlaps_flag () + { + if (unlikely (!header.numberOfContours)) return; + + unsigned flags_offset = length (instructions_length ()); + if (unlikely (flags_offset + 1 > bytes.length)) return; + + HBUINT8 &first_flag = (HBUINT8 &) StructAtOffset<HBUINT16> (&bytes, flags_offset); + first_flag = (uint8_t) first_flag | FLAG_OVERLAP_SIMPLE; + } + + static bool read_flags (const HBUINT8 *&p /* IN/OUT */, + contour_point_vector_t &points_ /* IN/OUT */, + const HBUINT8 *end) + { + unsigned count = points_.length; + for (unsigned int i = 0; i < count;) + { + if (unlikely (p + 1 > end)) return false; + uint8_t flag = *p++; + points_.arrayZ[i++].flag = flag; + if (flag & FLAG_REPEAT) + { + if (unlikely (p + 1 > end)) return false; + unsigned int repeat_count = *p++; + unsigned stop = hb_min (i + repeat_count, count); + for (; i < stop;) + points_.arrayZ[i++].flag = flag; + } + } + return true; + } + + static bool read_points (const HBUINT8 *&p /* IN/OUT */, + contour_point_vector_t &points_ /* IN/OUT */, + const HBUINT8 *end, + float contour_point_t::*m, + const simple_glyph_flag_t short_flag, + const simple_glyph_flag_t same_flag) + { + int v = 0; + + unsigned count = points_.length; + for (unsigned i = 0; i < count; i++) + { + unsigned flag = points_[i].flag; + if (flag & short_flag) + { + if (unlikely (p + 1 > end)) return false; + if (flag & same_flag) + v += *p++; + else + v -= *p++; + } + else + { + if (!(flag & same_flag)) + { + if (unlikely (p + HBINT16::static_size > end)) return false; + v += *(const HBINT16 *) p; + p += HBINT16::static_size; + } + } + points_.arrayZ[i].*m = v; + } + return true; + } + + bool get_contour_points (contour_point_vector_t &points_ /* OUT */, + bool phantom_only = false) const + { + const HBUINT16 *endPtsOfContours = &StructAfter<HBUINT16> (header); + int num_contours = header.numberOfContours; + assert (num_contours); + /* One extra item at the end, for the instruction-count below. */ + if (unlikely (!bytes.check_range (&endPtsOfContours[num_contours]))) return false; + unsigned int num_points = endPtsOfContours[num_contours - 1] + 1; + + points_.alloc (num_points + 4); // Allocate for phantom points, to avoid a possible copy + if (!points_.resize (num_points)) return false; + if (phantom_only) return true; + + for (int i = 0; i < num_contours; i++) + points_[endPtsOfContours[i]].is_end_point = true; + + /* Skip instructions */ + const HBUINT8 *p = &StructAtOffset<HBUINT8> (&endPtsOfContours[num_contours + 1], + endPtsOfContours[num_contours]); + + if (unlikely ((const char *) p < bytes.arrayZ)) return false; /* Unlikely overflow */ + const HBUINT8 *end = (const HBUINT8 *) (bytes.arrayZ + bytes.length); + if (unlikely (p >= end)) return false; + + /* Read x & y coordinates */ + return read_flags (p, points_, end) + && read_points (p, points_, end, &contour_point_t::x, + FLAG_X_SHORT, FLAG_X_SAME) + && read_points (p, points_, end, &contour_point_t::y, + FLAG_Y_SHORT, FLAG_Y_SAME); + } +}; + + +} /* namespace glyf_impl */ +} /* namespace OT */ + + +#endif /* OT_GLYF_SIMPLEGLYPH_HH */ diff --git a/thirdparty/harfbuzz/src/OT/glyf/SubsetGlyph.hh b/thirdparty/harfbuzz/src/OT/glyf/SubsetGlyph.hh new file mode 100644 index 0000000000..ebe4372047 --- /dev/null +++ b/thirdparty/harfbuzz/src/OT/glyf/SubsetGlyph.hh @@ -0,0 +1,72 @@ +#ifndef OT_GLYF_SUBSETGLYPH_HH +#define OT_GLYF_SUBSETGLYPH_HH + + +#include "../../hb-open-type.hh" + + +namespace OT { +namespace glyf_impl { + + +struct SubsetGlyph +{ + hb_codepoint_t new_gid; + hb_codepoint_t old_gid; + Glyph source_glyph; + hb_bytes_t dest_start; /* region of source_glyph to copy first */ + hb_bytes_t dest_end; /* region of source_glyph to copy second */ + + bool serialize (hb_serialize_context_t *c, + bool use_short_loca, + const hb_subset_plan_t *plan) const + { + TRACE_SERIALIZE (this); + + hb_bytes_t dest_glyph = dest_start.copy (c); + dest_glyph = hb_bytes_t (&dest_glyph, dest_glyph.length + dest_end.copy (c).length); + unsigned int pad_length = use_short_loca ? padding () : 0; + DEBUG_MSG (SUBSET, nullptr, "serialize %d byte glyph, width %d pad %d", dest_glyph.length, dest_glyph.length + pad_length, pad_length); + + HBUINT8 pad; + pad = 0; + while (pad_length > 0) + { + c->embed (pad); + pad_length--; + } + + if (unlikely (!dest_glyph.length)) return_trace (true); + + /* update components gids */ + for (auto &_ : Glyph (dest_glyph).get_composite_iterator ()) + { + hb_codepoint_t new_gid; + if (plan->new_gid_for_old_gid (_.glyphIndex, &new_gid)) + const_cast<CompositeGlyphRecord &> (_).glyphIndex = new_gid; + } + + if (plan->flags & HB_SUBSET_FLAGS_NO_HINTING) + Glyph (dest_glyph).drop_hints (); + + if (plan->flags & HB_SUBSET_FLAGS_SET_OVERLAPS_FLAG) + Glyph (dest_glyph).set_overlaps_flag (); + + return_trace (true); + } + + void drop_hints_bytes () + { source_glyph.drop_hints_bytes (dest_start, dest_end); } + + unsigned int length () const { return dest_start.length + dest_end.length; } + /* pad to 2 to ensure 2-byte loca will be ok */ + unsigned int padding () const { return length () % 2; } + unsigned int padded_size () const { return length () + padding (); } +}; + + +} /* namespace glyf_impl */ +} /* namespace OT */ + + +#endif /* OT_GLYF_SUBSETGLYPH_HH */ diff --git a/thirdparty/harfbuzz/src/OT/glyf/glyf-helpers.hh b/thirdparty/harfbuzz/src/OT/glyf/glyf-helpers.hh new file mode 100644 index 0000000000..f51f7a81fc --- /dev/null +++ b/thirdparty/harfbuzz/src/OT/glyf/glyf-helpers.hh @@ -0,0 +1,90 @@ +#ifndef OT_GLYF_GLYF_HELPERS_HH +#define OT_GLYF_GLYF_HELPERS_HH + + +#include "../../hb-open-type.hh" +#include "../../hb-subset-plan.hh" + +#include "loca.hh" + + +namespace OT { +namespace glyf_impl { + + +template<typename IteratorIn, typename IteratorOut, + hb_requires (hb_is_source_of (IteratorIn, unsigned int)), + hb_requires (hb_is_sink_of (IteratorOut, unsigned))> +static void +_write_loca (IteratorIn it, bool short_offsets, IteratorOut dest) +{ + unsigned right_shift = short_offsets ? 1 : 0; + unsigned int offset = 0; + dest << 0; + + it + | hb_map ([=, &offset] (unsigned int padded_size) + { + offset += padded_size; + DEBUG_MSG (SUBSET, nullptr, "loca entry offset %d", offset); + return offset >> right_shift; + }) + | hb_sink (dest) + ; +} + +static bool +_add_head_and_set_loca_version (hb_subset_plan_t *plan, bool use_short_loca) +{ + hb_blob_t *head_blob = hb_sanitize_context_t ().reference_table<head> (plan->source); + hb_blob_t *head_prime_blob = hb_blob_copy_writable_or_fail (head_blob); + hb_blob_destroy (head_blob); + + if (unlikely (!head_prime_blob)) + return false; + + head *head_prime = (head *) hb_blob_get_data_writable (head_prime_blob, nullptr); + head_prime->indexToLocFormat = use_short_loca ? 0 : 1; + bool success = plan->add_table (HB_OT_TAG_head, head_prime_blob); + + hb_blob_destroy (head_prime_blob); + return success; +} + +template<typename Iterator, + hb_requires (hb_is_source_of (Iterator, unsigned int))> +static bool +_add_loca_and_head (hb_subset_plan_t * plan, Iterator padded_offsets, bool use_short_loca) +{ + unsigned num_offsets = padded_offsets.len () + 1; + unsigned entry_size = use_short_loca ? 2 : 4; + char *loca_prime_data = (char *) hb_calloc (entry_size, num_offsets); + + if (unlikely (!loca_prime_data)) return false; + + DEBUG_MSG (SUBSET, nullptr, "loca entry_size %d num_offsets %d size %d", + entry_size, num_offsets, entry_size * num_offsets); + + if (use_short_loca) + _write_loca (padded_offsets, true, hb_array ((HBUINT16 *) loca_prime_data, num_offsets)); + else + _write_loca (padded_offsets, false, hb_array ((HBUINT32 *) loca_prime_data, num_offsets)); + + hb_blob_t *loca_blob = hb_blob_create (loca_prime_data, + entry_size * num_offsets, + HB_MEMORY_MODE_WRITABLE, + loca_prime_data, + hb_free); + + bool result = plan->add_table (HB_OT_TAG_loca, loca_blob) + && _add_head_and_set_loca_version (plan, use_short_loca); + + hb_blob_destroy (loca_blob); + return result; +} + + +} /* namespace glyf_impl */ +} /* namespace OT */ + + +#endif /* OT_GLYF_GLYF_HELPERS_HH */ diff --git a/thirdparty/harfbuzz/src/OT/glyf/glyf.hh b/thirdparty/harfbuzz/src/OT/glyf/glyf.hh new file mode 100644 index 0000000000..f74513cb96 --- /dev/null +++ b/thirdparty/harfbuzz/src/OT/glyf/glyf.hh @@ -0,0 +1,388 @@ +#ifndef OT_GLYF_GLYF_HH +#define OT_GLYF_GLYF_HH + + +#include "../../hb-open-type.hh" +#include "../../hb-ot-head-table.hh" +#include "../../hb-ot-hmtx-table.hh" +#include "../../hb-ot-var-gvar-table.hh" +#include "../../hb-draw.hh" + +#include "glyf-helpers.hh" +#include "Glyph.hh" +#include "SubsetGlyph.hh" +#include "loca.hh" +#include "path-builder.hh" + + +namespace OT { + + +/* + * glyf -- TrueType Glyph Data + * https://docs.microsoft.com/en-us/typography/opentype/spec/glyf + */ +#define HB_OT_TAG_glyf HB_TAG('g','l','y','f') + + +struct glyf +{ + friend struct glyf_accelerator_t; + + static constexpr hb_tag_t tableTag = HB_OT_TAG_glyf; + + bool sanitize (hb_sanitize_context_t *c HB_UNUSED) const + { + TRACE_SANITIZE (this); + /* Runtime checks as eager sanitizing each glyph is costy */ + return_trace (true); + } + + /* requires source of SubsetGlyph complains the identifier isn't declared */ + template <typename Iterator> + bool serialize (hb_serialize_context_t *c, + Iterator it, + bool use_short_loca, + const hb_subset_plan_t *plan) + { + TRACE_SERIALIZE (this); + unsigned init_len = c->length (); + for (const auto &_ : it) _.serialize (c, use_short_loca, plan); + + /* As a special case when all glyph in the font are empty, add a zero byte + * to the table, so that OTS doesn’t reject it, and to make the table work + * on Windows as well. + * See https://github.com/khaledhosny/ots/issues/52 */ + if (init_len == c->length ()) + { + HBUINT8 empty_byte; + empty_byte = 0; + c->copy (empty_byte); + } + return_trace (true); + } + + /* Byte region(s) per glyph to output + unpadded, hints removed if so requested + If we fail to process a glyph we produce an empty (0-length) glyph */ + bool subset (hb_subset_context_t *c) const + { + TRACE_SUBSET (this); + + glyf *glyf_prime = c->serializer->start_embed <glyf> (); + if (unlikely (!c->serializer->check_success (glyf_prime))) return_trace (false); + + hb_vector_t<glyf_impl::SubsetGlyph> glyphs; + _populate_subset_glyphs (c->plan, &glyphs); + + auto padded_offsets = + + hb_iter (glyphs) + | hb_map (&glyf_impl::SubsetGlyph::padded_size) + ; + + unsigned max_offset = + padded_offsets | hb_reduce (hb_add, 0); + bool use_short_loca = max_offset < 0x1FFFF; + + + glyf_prime->serialize (c->serializer, hb_iter (glyphs), use_short_loca, c->plan); + if (!use_short_loca) { + padded_offsets = + + hb_iter (glyphs) + | hb_map (&glyf_impl::SubsetGlyph::length) + ; + } + + + if (unlikely (c->serializer->in_error ())) return_trace (false); + return_trace (c->serializer->check_success (glyf_impl::_add_loca_and_head (c->plan, + padded_offsets, + use_short_loca))); + } + + void + _populate_subset_glyphs (const hb_subset_plan_t *plan, + hb_vector_t<glyf_impl::SubsetGlyph> *glyphs /* OUT */) const; + + protected: + UnsizedArrayOf<HBUINT8> + dataZ; /* Glyphs data. */ + public: + DEFINE_SIZE_MIN (0); /* In reality, this is UNBOUNDED() type; but since we always + * check the size externally, allow Null() object of it by + * defining it _MIN instead. */ +}; + +struct glyf_accelerator_t +{ + glyf_accelerator_t (hb_face_t *face) + { + short_offset = false; + num_glyphs = 0; + loca_table = nullptr; + glyf_table = nullptr; +#ifndef HB_NO_VAR + gvar = nullptr; +#endif + hmtx = nullptr; +#ifndef HB_NO_VERTICAL + vmtx = nullptr; +#endif + const OT::head &head = *face->table.head; + if (head.indexToLocFormat > 1 || head.glyphDataFormat > 0) + /* Unknown format. Leave num_glyphs=0, that takes care of disabling us. */ + return; + short_offset = 0 == head.indexToLocFormat; + + loca_table = face->table.loca.get_blob (); // Needs no destruct! + glyf_table = hb_sanitize_context_t ().reference_table<glyf> (face); +#ifndef HB_NO_VAR + gvar = face->table.gvar; +#endif + hmtx = face->table.hmtx; +#ifndef HB_NO_VERTICAL + vmtx = face->table.vmtx; +#endif + + num_glyphs = hb_max (1u, loca_table.get_length () / (short_offset ? 2 : 4)) - 1; + num_glyphs = hb_min (num_glyphs, face->get_num_glyphs ()); + } + ~glyf_accelerator_t () + { + glyf_table.destroy (); + } + + bool has_data () const { return num_glyphs; } + + protected: + template<typename T> + bool get_points (hb_font_t *font, hb_codepoint_t gid, T consumer) const + { + if (gid >= num_glyphs) return false; + + /* Making this allocfree is not that easy + https://github.com/harfbuzz/harfbuzz/issues/2095 + mostly because of gvar handling in VF fonts, + perhaps a separate path for non-VF fonts can be considered */ + contour_point_vector_t all_points; + + bool phantom_only = !consumer.is_consuming_contour_points (); + if (unlikely (!glyph_for_gid (gid).get_points (font, *this, all_points, phantom_only))) + return false; + + if (consumer.is_consuming_contour_points ()) + { + unsigned count = all_points.length; + assert (count >= glyf_impl::PHANTOM_COUNT); + count -= glyf_impl::PHANTOM_COUNT; + for (unsigned point_index = 0; point_index < count; point_index++) + consumer.consume_point (all_points[point_index]); + consumer.points_end (); + } + + /* Where to write phantoms, nullptr if not requested */ + contour_point_t *phantoms = consumer.get_phantoms_sink (); + if (phantoms) + for (unsigned i = 0; i < glyf_impl::PHANTOM_COUNT; ++i) + phantoms[i] = all_points[all_points.length - glyf_impl::PHANTOM_COUNT + i]; + + return true; + } + +#ifndef HB_NO_VAR + struct points_aggregator_t + { + hb_font_t *font; + hb_glyph_extents_t *extents; + contour_point_t *phantoms; + + struct contour_bounds_t + { + contour_bounds_t () { min_x = min_y = FLT_MAX; max_x = max_y = -FLT_MAX; } + + void add (const contour_point_t &p) + { + min_x = hb_min (min_x, p.x); + min_y = hb_min (min_y, p.y); + max_x = hb_max (max_x, p.x); + max_y = hb_max (max_y, p.y); + } + + bool empty () const { return (min_x >= max_x) || (min_y >= max_y); } + + void get_extents (hb_font_t *font, hb_glyph_extents_t *extents) + { + if (unlikely (empty ())) + { + extents->width = 0; + extents->x_bearing = 0; + extents->height = 0; + extents->y_bearing = 0; + return; + } + extents->x_bearing = font->em_scalef_x (min_x); + extents->width = font->em_scalef_x (max_x) - extents->x_bearing; + extents->y_bearing = font->em_scalef_y (max_y); + extents->height = font->em_scalef_y (min_y) - extents->y_bearing; + } + + protected: + float min_x, min_y, max_x, max_y; + } bounds; + + points_aggregator_t (hb_font_t *font_, hb_glyph_extents_t *extents_, contour_point_t *phantoms_) + { + font = font_; + extents = extents_; + phantoms = phantoms_; + if (extents) bounds = contour_bounds_t (); + } + + void consume_point (const contour_point_t &point) { bounds.add (point); } + void points_end () { bounds.get_extents (font, extents); } + + bool is_consuming_contour_points () { return extents; } + contour_point_t *get_phantoms_sink () { return phantoms; } + }; + + public: + unsigned + get_advance_var (hb_font_t *font, hb_codepoint_t gid, bool is_vertical) const + { + if (unlikely (gid >= num_glyphs)) return 0; + + bool success = false; + + contour_point_t phantoms[glyf_impl::PHANTOM_COUNT]; + if (likely (font->num_coords == gvar->get_axis_count ())) + success = get_points (font, gid, points_aggregator_t (font, nullptr, phantoms)); + + if (unlikely (!success)) + return +#ifndef HB_NO_VERTICAL + is_vertical ? vmtx->get_advance (gid) : +#endif + hmtx->get_advance (gid); + + float result = is_vertical + ? phantoms[glyf_impl::PHANTOM_TOP].y - phantoms[glyf_impl::PHANTOM_BOTTOM].y + : phantoms[glyf_impl::PHANTOM_RIGHT].x - phantoms[glyf_impl::PHANTOM_LEFT].x; + return hb_clamp (roundf (result), 0.f, (float) UINT_MAX / 2); + } + + int get_side_bearing_var (hb_font_t *font, hb_codepoint_t gid, bool is_vertical) const + { + if (unlikely (gid >= num_glyphs)) return 0; + + hb_glyph_extents_t extents; + + contour_point_t phantoms[glyf_impl::PHANTOM_COUNT]; + if (unlikely (!get_points (font, gid, points_aggregator_t (font, &extents, phantoms)))) + return +#ifndef HB_NO_VERTICAL + is_vertical ? vmtx->get_side_bearing (gid) : +#endif + hmtx->get_side_bearing (gid); + + return is_vertical + ? ceilf (phantoms[glyf_impl::PHANTOM_TOP].y) - extents.y_bearing + : floorf (phantoms[glyf_impl::PHANTOM_LEFT].x); + } +#endif + + public: + bool get_extents (hb_font_t *font, hb_codepoint_t gid, hb_glyph_extents_t *extents) const + { + if (unlikely (gid >= num_glyphs)) return false; + +#ifndef HB_NO_VAR + if (font->num_coords) + return get_points (font, gid, points_aggregator_t (font, extents, nullptr)); +#endif + return glyph_for_gid (gid).get_extents (font, *this, extents); + } + + const glyf_impl::Glyph + glyph_for_gid (hb_codepoint_t gid, bool needs_padding_removal = false) const + { + if (unlikely (gid >= num_glyphs)) return glyf_impl::Glyph (); + + unsigned int start_offset, end_offset; + + if (short_offset) + { + const HBUINT16 *offsets = (const HBUINT16 *) loca_table->dataZ.arrayZ; + start_offset = 2 * offsets[gid]; + end_offset = 2 * offsets[gid + 1]; + } + else + { + const HBUINT32 *offsets = (const HBUINT32 *) loca_table->dataZ.arrayZ; + start_offset = offsets[gid]; + end_offset = offsets[gid + 1]; + } + + if (unlikely (start_offset > end_offset || end_offset > glyf_table.get_length ())) + return glyf_impl::Glyph (); + + glyf_impl::Glyph glyph (hb_bytes_t ((const char *) this->glyf_table + start_offset, + end_offset - start_offset), gid); + return needs_padding_removal ? glyf_impl::Glyph (glyph.trim_padding (), gid) : glyph; + } + + bool + get_path (hb_font_t *font, hb_codepoint_t gid, hb_draw_session_t &draw_session) const + { return get_points (font, gid, glyf_impl::path_builder_t (font, draw_session)); } + +#ifndef HB_NO_VAR + const gvar_accelerator_t *gvar; +#endif + const hmtx_accelerator_t *hmtx; +#ifndef HB_NO_VERTICAL + const vmtx_accelerator_t *vmtx; +#endif + + private: + bool short_offset; + unsigned int num_glyphs; + hb_blob_ptr_t<loca> loca_table; + hb_blob_ptr_t<glyf> glyf_table; +}; + + +inline void +glyf::_populate_subset_glyphs (const hb_subset_plan_t *plan, + hb_vector_t<glyf_impl::SubsetGlyph> *glyphs /* OUT */) const +{ + OT::glyf_accelerator_t glyf (plan->source); + + + hb_range (plan->num_output_glyphs ()) + | hb_map ([&] (hb_codepoint_t new_gid) + { + glyf_impl::SubsetGlyph subset_glyph = {0}; + subset_glyph.new_gid = new_gid; + + /* should never fail: all old gids should be mapped */ + if (!plan->old_gid_for_new_gid (new_gid, &subset_glyph.old_gid)) + return subset_glyph; + + if (new_gid == 0 && + !(plan->flags & HB_SUBSET_FLAGS_NOTDEF_OUTLINE)) + subset_glyph.source_glyph = glyf_impl::Glyph (); + else + subset_glyph.source_glyph = glyf.glyph_for_gid (subset_glyph.old_gid, true); + if (plan->flags & HB_SUBSET_FLAGS_NO_HINTING) + subset_glyph.drop_hints_bytes (); + else + subset_glyph.dest_start = subset_glyph.source_glyph.get_bytes (); + return subset_glyph; + }) + | hb_sink (glyphs) + ; +} + + + +} /* namespace OT */ + + +#endif /* OT_GLYF_GLYF_HH */ diff --git a/thirdparty/harfbuzz/src/OT/glyf/loca.hh b/thirdparty/harfbuzz/src/OT/glyf/loca.hh new file mode 100644 index 0000000000..4481cba8ed --- /dev/null +++ b/thirdparty/harfbuzz/src/OT/glyf/loca.hh @@ -0,0 +1,43 @@ +#ifndef OT_GLYF_LOCA_HH +#define OT_GLYF_LOCA_HH + + +#include "../../hb-open-type.hh" + + +namespace OT { + + +/* + * loca -- Index to Location + * https://docs.microsoft.com/en-us/typography/opentype/spec/loca + */ +#define HB_OT_TAG_loca HB_TAG('l','o','c','a') + +struct loca +{ + friend struct glyf; + friend struct glyf_accelerator_t; + + static constexpr hb_tag_t tableTag = HB_OT_TAG_loca; + + bool sanitize (hb_sanitize_context_t *c HB_UNUSED) const + { + TRACE_SANITIZE (this); + return_trace (true); + } + + protected: + UnsizedArrayOf<HBUINT8> + dataZ; /* Location data. */ + public: + DEFINE_SIZE_MIN (0); /* In reality, this is UNBOUNDED() type; but since we always + * check the size externally, allow Null() object of it by + * defining it _MIN instead. */ +}; + + +} /* namespace OT */ + + +#endif /* OT_GLYF_LOCA_HH */ diff --git a/thirdparty/harfbuzz/src/OT/glyf/path-builder.hh b/thirdparty/harfbuzz/src/OT/glyf/path-builder.hh new file mode 100644 index 0000000000..9bfc45a1a6 --- /dev/null +++ b/thirdparty/harfbuzz/src/OT/glyf/path-builder.hh @@ -0,0 +1,135 @@ +#ifndef OT_GLYF_PATH_BUILDER_HH +#define OT_GLYF_PATH_BUILDER_HH + + +#include "../../hb.hh" + + +namespace OT { +namespace glyf_impl { + + +struct path_builder_t +{ + hb_font_t *font; + hb_draw_session_t *draw_session; + + struct optional_point_t + { + optional_point_t () {} + optional_point_t (float x_, float y_) : has_data (true), x (x_), y (y_) {} + operator bool () const { return has_data; } + + bool has_data = false; + float x = 0.; + float y = 0.; + + optional_point_t lerp (optional_point_t p, float t) + { return optional_point_t (x + t * (p.x - x), y + t * (p.y - y)); } + } first_oncurve, first_offcurve, last_offcurve; + + path_builder_t (hb_font_t *font_, hb_draw_session_t &draw_session_) + { + font = font_; + draw_session = &draw_session_; + first_oncurve = first_offcurve = last_offcurve = optional_point_t (); + } + + /* based on https://github.com/RazrFalcon/ttf-parser/blob/4f32821/src/glyf.rs#L287 + See also: + * https://developer.apple.com/fonts/TrueType-Reference-Manual/RM01/Chap1.html + * https://stackoverflow.com/a/20772557 */ + void consume_point (const contour_point_t &point) + { + bool is_on_curve = point.flag & glyf_impl::SimpleGlyph::FLAG_ON_CURVE; + optional_point_t p (font->em_fscalef_x (point.x), font->em_fscalef_y (point.y)); + if (!first_oncurve) + { + if (is_on_curve) + { + first_oncurve = p; + draw_session->move_to (p.x, p.y); + } + else + { + if (first_offcurve) + { + optional_point_t mid = first_offcurve.lerp (p, .5f); + first_oncurve = mid; + last_offcurve = p; + draw_session->move_to (mid.x, mid.y); + } + else + first_offcurve = p; + } + } + else + { + if (last_offcurve) + { + if (is_on_curve) + { + draw_session->quadratic_to (last_offcurve.x, last_offcurve.y, + p.x, p.y); + last_offcurve = optional_point_t (); + } + else + { + optional_point_t mid = last_offcurve.lerp (p, .5f); + draw_session->quadratic_to (last_offcurve.x, last_offcurve.y, + mid.x, mid.y); + last_offcurve = p; + } + } + else + { + if (is_on_curve) + draw_session->line_to (p.x, p.y); + else + last_offcurve = p; + } + } + + if (point.is_end_point) + { + if (first_offcurve && last_offcurve) + { + optional_point_t mid = last_offcurve.lerp (first_offcurve, .5f); + draw_session->quadratic_to (last_offcurve.x, last_offcurve.y, + mid.x, mid.y); + last_offcurve = optional_point_t (); + /* now check the rest */ + } + + if (first_offcurve && first_oncurve) + draw_session->quadratic_to (first_offcurve.x, first_offcurve.y, + first_oncurve.x, first_oncurve.y); + else if (last_offcurve && first_oncurve) + draw_session->quadratic_to (last_offcurve.x, last_offcurve.y, + first_oncurve.x, first_oncurve.y); + else if (first_oncurve) + draw_session->line_to (first_oncurve.x, first_oncurve.y); + else if (first_offcurve) + { + float x = first_offcurve.x, y = first_offcurve.y; + draw_session->move_to (x, y); + draw_session->quadratic_to (x, y, x, y); + } + + /* Getting ready for the next contour */ + first_oncurve = first_offcurve = last_offcurve = optional_point_t (); + draw_session->close_path (); + } + } + void points_end () {} + + bool is_consuming_contour_points () { return true; } + contour_point_t *get_phantoms_sink () { return nullptr; } +}; + + +} /* namespace glyf_impl */ +} /* namespace OT */ + + +#endif /* OT_GLYF_PATH_BUILDER_HH */ diff --git a/thirdparty/harfbuzz/src/graph/graph.hh b/thirdparty/harfbuzz/src/graph/graph.hh new file mode 100644 index 0000000000..52ca9dd142 --- /dev/null +++ b/thirdparty/harfbuzz/src/graph/graph.hh @@ -0,0 +1,860 @@ +/* + * Copyright © 2022 Google, Inc. + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Google Author(s): Garret Rieger + */ + +#ifndef GRAPH_GRAPH_HH +#define GRAPH_GRAPH_HH + +namespace graph { + +/** + * Represents a serialized table in the form of a graph. + * Provides methods for modifying and reordering the graph. + */ +struct graph_t +{ + struct vertex_t + { + hb_serialize_context_t::object_t obj; + int64_t distance = 0 ; + int64_t space = 0 ; + hb_vector_t<unsigned> parents; + unsigned start = 0; + unsigned end = 0; + unsigned priority = 0; + + friend void swap (vertex_t& a, vertex_t& b) + { + hb_swap (a.obj, b.obj); + hb_swap (a.distance, b.distance); + hb_swap (a.space, b.space); + hb_swap (a.parents, b.parents); + hb_swap (a.start, b.start); + hb_swap (a.end, b.end); + hb_swap (a.priority, b.priority); + } + + bool is_shared () const + { + return parents.length > 1; + } + + unsigned incoming_edges () const + { + return parents.length; + } + + void remove_parent (unsigned parent_index) + { + for (unsigned i = 0; i < parents.length; i++) + { + if (parents[i] != parent_index) continue; + parents.remove (i); + break; + } + } + + void remap_parents (const hb_vector_t<unsigned>& id_map) + { + for (unsigned i = 0; i < parents.length; i++) + parents[i] = id_map[parents[i]]; + } + + void remap_parent (unsigned old_index, unsigned new_index) + { + for (unsigned i = 0; i < parents.length; i++) + { + if (parents[i] == old_index) + parents[i] = new_index; + } + } + + bool is_leaf () const + { + return !obj.real_links.length && !obj.virtual_links.length; + } + + bool raise_priority () + { + if (has_max_priority ()) return false; + priority++; + return true; + } + + bool has_max_priority () const { + return priority >= 3; + } + + int64_t modified_distance (unsigned order) const + { + // TODO(garretrieger): once priority is high enough, should try + // setting distance = 0 which will force to sort immediately after + // it's parent where possible. + + int64_t modified_distance = + hb_min (hb_max(distance + distance_modifier (), 0), 0x7FFFFFFFFFF); + if (has_max_priority ()) { + modified_distance = 0; + } + return (modified_distance << 18) | (0x003FFFF & order); + } + + int64_t distance_modifier () const + { + if (!priority) return 0; + int64_t table_size = obj.tail - obj.head; + + if (priority == 1) + return -table_size / 2; + + return -table_size; + } + }; + + /* + * A topological sorting of an object graph. Ordered + * in reverse serialization order (first object in the + * serialization is at the end of the list). This matches + * the 'packed' object stack used internally in the + * serializer + */ + template<typename T> + graph_t (const T& objects) + : parents_invalid (true), + distance_invalid (true), + positions_invalid (true), + successful (true) + { + num_roots_for_space_.push (1); + bool removed_nil = false; + vertices_.alloc (objects.length); + vertices_scratch_.alloc (objects.length); + for (unsigned i = 0; i < objects.length; i++) + { + // TODO(grieger): check all links point to valid objects. + + // If this graph came from a serialization buffer object 0 is the + // nil object. We don't need it for our purposes here so drop it. + if (i == 0 && !objects[i]) + { + removed_nil = true; + continue; + } + + vertex_t* v = vertices_.push (); + if (check_success (!vertices_.in_error ())) + v->obj = *objects[i]; + if (!removed_nil) continue; + // Fix indices to account for removed nil object. + for (auto& l : v->obj.all_links_writer ()) { + l.objidx--; + } + } + } + + ~graph_t () + { + vertices_.fini (); + } + + bool in_error () const + { + return !successful || + vertices_.in_error () || + num_roots_for_space_.in_error (); + } + + const vertex_t& root () const + { + return vertices_[root_idx ()]; + } + + unsigned root_idx () const + { + // Object graphs are in reverse order, the first object is at the end + // of the vector. Since the graph is topologically sorted it's safe to + // assume the first object has no incoming edges. + return vertices_.length - 1; + } + + const hb_serialize_context_t::object_t& object(unsigned i) const + { + return vertices_[i].obj; + } + + /* + * Generates a new topological sorting of graph ordered by the shortest + * distance to each node. + */ + void sort_shortest_distance () + { + positions_invalid = true; + + if (vertices_.length <= 1) { + // Graph of 1 or less doesn't need sorting. + return; + } + + update_distances (); + + hb_priority_queue_t queue; + hb_vector_t<vertex_t> &sorted_graph = vertices_scratch_; + if (unlikely (!check_success (sorted_graph.resize (vertices_.length)))) return; + hb_vector_t<unsigned> id_map; + if (unlikely (!check_success (id_map.resize (vertices_.length)))) return; + + hb_vector_t<unsigned> removed_edges; + if (unlikely (!check_success (removed_edges.resize (vertices_.length)))) return; + update_parents (); + + queue.insert (root ().modified_distance (0), root_idx ()); + int new_id = root_idx (); + unsigned order = 1; + while (!queue.in_error () && !queue.is_empty ()) + { + unsigned next_id = queue.pop_minimum().second; + + hb_swap (sorted_graph[new_id], vertices_[next_id]); + const vertex_t& next = sorted_graph[new_id]; + + id_map[next_id] = new_id--; + + for (const auto& link : next.obj.all_links ()) { + removed_edges[link.objidx]++; + if (!(vertices_[link.objidx].incoming_edges () - removed_edges[link.objidx])) + // Add the order that the links were encountered to the priority. + // This ensures that ties between priorities objects are broken in a consistent + // way. More specifically this is set up so that if a set of objects have the same + // distance they'll be added to the topological order in the order that they are + // referenced from the parent object. + queue.insert (vertices_[link.objidx].modified_distance (order++), + link.objidx); + } + } + + check_success (!queue.in_error ()); + check_success (!sorted_graph.in_error ()); + if (!check_success (new_id == -1)) + print_orphaned_nodes (); + + remap_all_obj_indices (id_map, &sorted_graph); + + hb_swap (vertices_, sorted_graph); + } + + /* + * Assign unique space numbers to each connected subgraph of 32 bit offset(s). + */ + bool assign_32bit_spaces () + { + unsigned root_index = root_idx (); + hb_set_t visited; + hb_set_t roots; + for (unsigned i = 0; i <= root_index; i++) + { + // Only real links can form 32 bit spaces + for (auto& l : vertices_[i].obj.real_links) + { + if (l.width == 4 && !l.is_signed) + { + roots.add (l.objidx); + find_subgraph (l.objidx, visited); + } + } + } + + // Mark everything not in the subgraphs of 32 bit roots as visited. + // This prevents 32 bit subgraphs from being connected via nodes not in the 32 bit subgraphs. + visited.invert (); + + if (!roots) return false; + + while (roots) + { + unsigned next = HB_SET_VALUE_INVALID; + if (unlikely (!check_success (!roots.in_error ()))) break; + if (!roots.next (&next)) break; + + hb_set_t connected_roots; + find_connected_nodes (next, roots, visited, connected_roots); + if (unlikely (!check_success (!connected_roots.in_error ()))) break; + + isolate_subgraph (connected_roots); + if (unlikely (!check_success (!connected_roots.in_error ()))) break; + + unsigned next_space = this->next_space (); + num_roots_for_space_.push (0); + for (unsigned root : connected_roots) + { + DEBUG_MSG (SUBSET_REPACK, nullptr, "Subgraph %u gets space %u", root, next_space); + vertices_[root].space = next_space; + num_roots_for_space_[next_space] = num_roots_for_space_[next_space] + 1; + distance_invalid = true; + positions_invalid = true; + } + + // TODO(grieger): special case for GSUB/GPOS use extension promotions to move 16 bit space + // into the 32 bit space as needed, instead of using isolation. + } + + + + return true; + } + + /* + * Isolates the subgraph of nodes reachable from root. Any links to nodes in the subgraph + * that originate from outside of the subgraph will be removed by duplicating the linked to + * object. + * + * Indices stored in roots will be updated if any of the roots are duplicated to new indices. + */ + bool isolate_subgraph (hb_set_t& roots) + { + update_parents (); + hb_map_t subgraph; + + // incoming edges to root_idx should be all 32 bit in length so we don't need to de-dup these + // set the subgraph incoming edge count to match all of root_idx's incoming edges + hb_set_t parents; + for (unsigned root_idx : roots) + { + subgraph.set (root_idx, wide_parents (root_idx, parents)); + find_subgraph (root_idx, subgraph); + } + + unsigned original_root_idx = root_idx (); + hb_map_t index_map; + bool made_changes = false; + for (auto entry : subgraph.iter ()) + { + const auto& node = vertices_[entry.first]; + unsigned subgraph_incoming_edges = entry.second; + + if (subgraph_incoming_edges < node.incoming_edges ()) + { + // Only de-dup objects with incoming links from outside the subgraph. + made_changes = true; + duplicate_subgraph (entry.first, index_map); + } + } + + if (!made_changes) + return false; + + if (original_root_idx != root_idx () + && parents.has (original_root_idx)) + { + // If the root idx has changed since parents was determined, update root idx in parents + parents.add (root_idx ()); + parents.del (original_root_idx); + } + + auto new_subgraph = + + subgraph.keys () + | hb_map([&] (unsigned node_idx) { + const unsigned *v; + if (index_map.has (node_idx, &v)) return *v; + return node_idx; + }) + ; + + remap_obj_indices (index_map, new_subgraph); + remap_obj_indices (index_map, parents.iter (), true); + + // Update roots set with new indices as needed. + unsigned next = HB_SET_VALUE_INVALID; + while (roots.next (&next)) + { + const unsigned *v; + if (index_map.has (next, &v)) + { + roots.del (next); + roots.add (*v); + } + } + + return true; + } + + void find_subgraph (unsigned node_idx, hb_map_t& subgraph) + { + for (const auto& link : vertices_[node_idx].obj.all_links ()) + { + const unsigned *v; + if (subgraph.has (link.objidx, &v)) + { + subgraph.set (link.objidx, *v + 1); + continue; + } + subgraph.set (link.objidx, 1); + find_subgraph (link.objidx, subgraph); + } + } + + void find_subgraph (unsigned node_idx, hb_set_t& subgraph) + { + if (subgraph.has (node_idx)) return; + subgraph.add (node_idx); + for (const auto& link : vertices_[node_idx].obj.all_links ()) + find_subgraph (link.objidx, subgraph); + } + + /* + * duplicates all nodes in the subgraph reachable from node_idx. Does not re-assign + * links. index_map is updated with mappings from old id to new id. If a duplication has already + * been performed for a given index, then it will be skipped. + */ + void duplicate_subgraph (unsigned node_idx, hb_map_t& index_map) + { + if (index_map.has (node_idx)) + return; + + index_map.set (node_idx, duplicate (node_idx)); + for (const auto& l : object (node_idx).all_links ()) { + duplicate_subgraph (l.objidx, index_map); + } + } + + /* + * Creates a copy of node_idx and returns it's new index. + */ + unsigned duplicate (unsigned node_idx) + { + positions_invalid = true; + distance_invalid = true; + + auto* clone = vertices_.push (); + auto& child = vertices_[node_idx]; + if (vertices_.in_error ()) { + return -1; + } + + clone->obj.head = child.obj.head; + clone->obj.tail = child.obj.tail; + clone->distance = child.distance; + clone->space = child.space; + clone->parents.reset (); + + unsigned clone_idx = vertices_.length - 2; + for (const auto& l : child.obj.real_links) + { + clone->obj.real_links.push (l); + vertices_[l.objidx].parents.push (clone_idx); + } + for (const auto& l : child.obj.virtual_links) + { + clone->obj.virtual_links.push (l); + vertices_[l.objidx].parents.push (clone_idx); + } + + check_success (!clone->obj.real_links.in_error ()); + check_success (!clone->obj.virtual_links.in_error ()); + + // The last object is the root of the graph, so swap back the root to the end. + // The root's obj idx does change, however since it's root nothing else refers to it. + // all other obj idx's will be unaffected. + hb_swap (vertices_[vertices_.length - 2], *clone); + + // Since the root moved, update the parents arrays of all children on the root. + for (const auto& l : root ().obj.all_links ()) + vertices_[l.objidx].remap_parent (root_idx () - 1, root_idx ()); + + return clone_idx; + } + + /* + * Creates a copy of child and re-assigns the link from + * parent to the clone. The copy is a shallow copy, objects + * linked from child are not duplicated. + */ + bool duplicate (unsigned parent_idx, unsigned child_idx) + { + update_parents (); + + unsigned links_to_child = 0; + for (const auto& l : vertices_[parent_idx].obj.all_links ()) + { + if (l.objidx == child_idx) links_to_child++; + } + + if (vertices_[child_idx].incoming_edges () <= links_to_child) + { + // Can't duplicate this node, doing so would orphan the original one as all remaining links + // to child are from parent. + DEBUG_MSG (SUBSET_REPACK, nullptr, " Not duplicating %d => %d", + parent_idx, child_idx); + return false; + } + + DEBUG_MSG (SUBSET_REPACK, nullptr, " Duplicating %d => %d", + parent_idx, child_idx); + + unsigned clone_idx = duplicate (child_idx); + if (clone_idx == (unsigned) -1) return false; + // duplicate shifts the root node idx, so if parent_idx was root update it. + if (parent_idx == clone_idx) parent_idx++; + + auto& parent = vertices_[parent_idx]; + for (auto& l : parent.obj.all_links_writer ()) + { + if (l.objidx != child_idx) + continue; + + reassign_link (l, parent_idx, clone_idx); + } + + return true; + } + + /* + * Raises the sorting priority of all children. + */ + bool raise_childrens_priority (unsigned parent_idx) + { + DEBUG_MSG (SUBSET_REPACK, nullptr, " Raising priority of all children of %d", + parent_idx); + // This operation doesn't change ordering until a sort is run, so no need + // to invalidate positions. It does not change graph structure so no need + // to update distances or edge counts. + auto& parent = vertices_[parent_idx].obj; + bool made_change = false; + for (auto& l : parent.all_links_writer ()) + made_change |= vertices_[l.objidx].raise_priority (); + return made_change; + } + + void print_orphaned_nodes () + { + if (!DEBUG_ENABLED(SUBSET_REPACK)) return; + + DEBUG_MSG (SUBSET_REPACK, nullptr, "Graph is not fully connected."); + parents_invalid = true; + update_parents(); + + for (unsigned i = 0; i < root_idx (); i++) + { + const auto& v = vertices_[i]; + if (!v.parents) + DEBUG_MSG (SUBSET_REPACK, nullptr, "Node %u is orphaned.", i); + } + } + + unsigned num_roots_for_space (unsigned space) const + { + return num_roots_for_space_[space]; + } + + unsigned next_space () const + { + return num_roots_for_space_.length; + } + + void move_to_new_space (const hb_set_t& indices) + { + num_roots_for_space_.push (0); + unsigned new_space = num_roots_for_space_.length - 1; + + for (unsigned index : indices) { + auto& node = vertices_[index]; + num_roots_for_space_[node.space] = num_roots_for_space_[node.space] - 1; + num_roots_for_space_[new_space] = num_roots_for_space_[new_space] + 1; + node.space = new_space; + distance_invalid = true; + positions_invalid = true; + } + } + + unsigned space_for (unsigned index, unsigned* root = nullptr) const + { + const auto& node = vertices_[index]; + if (node.space) + { + if (root != nullptr) + *root = index; + return node.space; + } + + if (!node.parents) + { + if (root) + *root = index; + return 0; + } + + return space_for (node.parents[0], root); + } + + void err_other_error () { this->successful = false; } + + size_t total_size_in_bytes () const { + size_t total_size = 0; + for (unsigned i = 0; i < vertices_.length; i++) { + size_t size = vertices_[i].obj.tail - vertices_[i].obj.head; + total_size += size; + } + return total_size; + } + + + private: + + /* + * Returns the numbers of incoming edges that are 32bits wide. + */ + unsigned wide_parents (unsigned node_idx, hb_set_t& parents) const + { + unsigned count = 0; + hb_set_t visited; + for (unsigned p : vertices_[node_idx].parents) + { + if (visited.has (p)) continue; + visited.add (p); + + // Only real links can be wide + for (const auto& l : vertices_[p].obj.real_links) + { + if (l.objidx == node_idx && l.width == 4 && !l.is_signed) + { + count++; + parents.add (p); + } + } + } + return count; + } + + bool check_success (bool success) + { return this->successful && (success || ((void) err_other_error (), false)); } + + public: + /* + * Creates a map from objid to # of incoming edges. + */ + void update_parents () + { + if (!parents_invalid) return; + + for (unsigned i = 0; i < vertices_.length; i++) + vertices_[i].parents.reset (); + + for (unsigned p = 0; p < vertices_.length; p++) + { + for (auto& l : vertices_[p].obj.all_links ()) + { + vertices_[l.objidx].parents.push (p); + } + } + + parents_invalid = false; + } + + /* + * compute the serialized start and end positions for each vertex. + */ + void update_positions () + { + if (!positions_invalid) return; + + unsigned current_pos = 0; + for (int i = root_idx (); i >= 0; i--) + { + auto& v = vertices_[i]; + v.start = current_pos; + current_pos += v.obj.tail - v.obj.head; + v.end = current_pos; + } + + positions_invalid = false; + } + + /* + * Finds the distance to each object in the graph + * from the initial node. + */ + void update_distances () + { + if (!distance_invalid) return; + + // Uses Dijkstra's algorithm to find all of the shortest distances. + // https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm + // + // Implementation Note: + // Since our priority queue doesn't support fast priority decreases + // we instead just add new entries into the queue when a priority changes. + // Redundant ones are filtered out later on by the visited set. + // According to https://www3.cs.stonybrook.edu/~rezaul/papers/TR-07-54.pdf + // for practical performance this is faster then using a more advanced queue + // (such as a fibonacci queue) with a fast decrease priority. + for (unsigned i = 0; i < vertices_.length; i++) + { + if (i == vertices_.length - 1) + vertices_[i].distance = 0; + else + vertices_[i].distance = hb_int_max (int64_t); + } + + hb_priority_queue_t queue; + queue.insert (0, vertices_.length - 1); + + hb_vector_t<bool> visited; + visited.resize (vertices_.length); + + while (!queue.in_error () && !queue.is_empty ()) + { + unsigned next_idx = queue.pop_minimum ().second; + if (visited[next_idx]) continue; + const auto& next = vertices_[next_idx]; + int64_t next_distance = vertices_[next_idx].distance; + visited[next_idx] = true; + + for (const auto& link : next.obj.all_links ()) + { + if (visited[link.objidx]) continue; + + const auto& child = vertices_[link.objidx].obj; + unsigned link_width = link.width ? link.width : 4; // treat virtual offsets as 32 bits wide + int64_t child_weight = (child.tail - child.head) + + ((int64_t) 1 << (link_width * 8)) * (vertices_[link.objidx].space + 1); + int64_t child_distance = next_distance + child_weight; + + if (child_distance < vertices_[link.objidx].distance) + { + vertices_[link.objidx].distance = child_distance; + queue.insert (child_distance, link.objidx); + } + } + } + + check_success (!queue.in_error ()); + if (!check_success (queue.is_empty ())) + { + print_orphaned_nodes (); + return; + } + + distance_invalid = false; + } + + private: + /* + * Updates a link in the graph to point to a different object. Corrects the + * parents vector on the previous and new child nodes. + */ + void reassign_link (hb_serialize_context_t::object_t::link_t& link, + unsigned parent_idx, + unsigned new_idx) + { + unsigned old_idx = link.objidx; + link.objidx = new_idx; + vertices_[old_idx].remove_parent (parent_idx); + vertices_[new_idx].parents.push (parent_idx); + } + + /* + * Updates all objidx's in all links using the provided mapping. Corrects incoming edge counts. + */ + template<typename Iterator, hb_requires (hb_is_iterator (Iterator))> + void remap_obj_indices (const hb_map_t& id_map, + Iterator subgraph, + bool only_wide = false) + { + if (!id_map) return; + for (unsigned i : subgraph) + { + for (auto& link : vertices_[i].obj.all_links_writer ()) + { + const unsigned *v; + if (!id_map.has (link.objidx, &v)) continue; + if (only_wide && !(link.width == 4 && !link.is_signed)) continue; + + reassign_link (link, i, *v); + } + } + } + + /* + * Updates all objidx's in all links using the provided mapping. + */ + void remap_all_obj_indices (const hb_vector_t<unsigned>& id_map, + hb_vector_t<vertex_t>* sorted_graph) const + { + for (unsigned i = 0; i < sorted_graph->length; i++) + { + (*sorted_graph)[i].remap_parents (id_map); + for (auto& link : (*sorted_graph)[i].obj.all_links_writer ()) + { + link.objidx = id_map[link.objidx]; + } + } + } + + /* + * Finds all nodes in targets that are reachable from start_idx, nodes in visited will be skipped. + * For this search the graph is treated as being undirected. + * + * Connected targets will be added to connected and removed from targets. All visited nodes + * will be added to visited. + */ + void find_connected_nodes (unsigned start_idx, + hb_set_t& targets, + hb_set_t& visited, + hb_set_t& connected) + { + if (unlikely (!check_success (!visited.in_error ()))) return; + if (visited.has (start_idx)) return; + visited.add (start_idx); + + if (targets.has (start_idx)) + { + targets.del (start_idx); + connected.add (start_idx); + } + + const auto& v = vertices_[start_idx]; + + // Graph is treated as undirected so search children and parents of start_idx + for (const auto& l : v.obj.all_links ()) + find_connected_nodes (l.objidx, targets, visited, connected); + + for (unsigned p : v.parents) + find_connected_nodes (p, targets, visited, connected); + } + + public: + // TODO(garretrieger): make private, will need to move most of offset overflow code into graph. + hb_vector_t<vertex_t> vertices_; + hb_vector_t<vertex_t> vertices_scratch_; + private: + bool parents_invalid; + bool distance_invalid; + bool positions_invalid; + bool successful; + hb_vector_t<unsigned> num_roots_for_space_; +}; + +} + +#endif // GRAPH_GRAPH_HH diff --git a/thirdparty/harfbuzz/src/graph/serialize.hh b/thirdparty/harfbuzz/src/graph/serialize.hh new file mode 100644 index 0000000000..ecc6cc5aea --- /dev/null +++ b/thirdparty/harfbuzz/src/graph/serialize.hh @@ -0,0 +1,249 @@ +/* + * Copyright © 2022 Google, Inc. + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Google Author(s): Garret Rieger + */ + +#ifndef GRAPH_SERIALIZE_HH +#define GRAPH_SERIALIZE_HH + +namespace graph { + +struct overflow_record_t +{ + unsigned parent; + unsigned child; +}; + +inline +int64_t compute_offset ( + const graph_t& graph, + unsigned parent_idx, + const hb_serialize_context_t::object_t::link_t& link) +{ + const auto& parent = graph.vertices_[parent_idx]; + const auto& child = graph.vertices_[link.objidx]; + int64_t offset = 0; + switch ((hb_serialize_context_t::whence_t) link.whence) { + case hb_serialize_context_t::whence_t::Head: + offset = child.start - parent.start; break; + case hb_serialize_context_t::whence_t::Tail: + offset = child.start - parent.end; break; + case hb_serialize_context_t::whence_t::Absolute: + offset = child.start; break; + } + + assert (offset >= link.bias); + offset -= link.bias; + return offset; +} + +inline +bool is_valid_offset (int64_t offset, + const hb_serialize_context_t::object_t::link_t& link) +{ + if (unlikely (!link.width)) + // Virtual links can't overflow. + return link.is_signed || offset >= 0; + + if (link.is_signed) + { + if (link.width == 4) + return offset >= -((int64_t) 1 << 31) && offset < ((int64_t) 1 << 31); + else + return offset >= -(1 << 15) && offset < (1 << 15); + } + else + { + if (link.width == 4) + return offset >= 0 && offset < ((int64_t) 1 << 32); + else if (link.width == 3) + return offset >= 0 && offset < ((int32_t) 1 << 24); + else + return offset >= 0 && offset < (1 << 16); + } +} + +/* + * Will any offsets overflow on graph when it's serialized? + */ +inline bool +will_overflow (graph_t& graph, + hb_vector_t<overflow_record_t>* overflows = nullptr) +{ + if (overflows) overflows->resize (0); + graph.update_positions (); + + const auto& vertices = graph.vertices_; + for (int parent_idx = vertices.length - 1; parent_idx >= 0; parent_idx--) + { + // Don't need to check virtual links for overflow + for (const auto& link : vertices[parent_idx].obj.real_links) + { + int64_t offset = compute_offset (graph, parent_idx, link); + if (is_valid_offset (offset, link)) + continue; + + if (!overflows) return true; + + overflow_record_t r; + r.parent = parent_idx; + r.child = link.objidx; + overflows->push (r); + } + } + + if (!overflows) return false; + return overflows->length; +} + +inline +void print_overflows (graph_t& graph, + const hb_vector_t<overflow_record_t>& overflows) +{ + if (!DEBUG_ENABLED(SUBSET_REPACK)) return; + + graph.update_parents (); + int limit = 10; + for (const auto& o : overflows) + { + if (!limit--) break; + const auto& parent = graph.vertices_[o.parent]; + const auto& child = graph.vertices_[o.child]; + DEBUG_MSG (SUBSET_REPACK, nullptr, + " overflow from " + "%4d (%4d in, %4d out, space %2d) => " + "%4d (%4d in, %4d out, space %2d)", + o.parent, + parent.incoming_edges (), + parent.obj.real_links.length + parent.obj.virtual_links.length, + graph.space_for (o.parent), + o.child, + child.incoming_edges (), + child.obj.real_links.length + child.obj.virtual_links.length, + graph.space_for (o.child)); + } + if (overflows.length > 10) { + DEBUG_MSG (SUBSET_REPACK, nullptr, " ... plus %d more overflows.", overflows.length - 10); + } +} + +template <typename O> inline void +serialize_link_of_type (const hb_serialize_context_t::object_t::link_t& link, + char* head, + hb_serialize_context_t* c) +{ + OT::Offset<O>* offset = reinterpret_cast<OT::Offset<O>*> (head + link.position); + *offset = 0; + c->add_link (*offset, + // serializer has an extra nil object at the start of the + // object array. So all id's are +1 of what our id's are. + link.objidx + 1, + (hb_serialize_context_t::whence_t) link.whence, + link.bias); +} + +inline +void serialize_link (const hb_serialize_context_t::object_t::link_t& link, + char* head, + hb_serialize_context_t* c) +{ + switch (link.width) + { + case 0: + // Virtual links aren't serialized. + return; + case 4: + if (link.is_signed) + { + serialize_link_of_type<OT::HBINT32> (link, head, c); + } else { + serialize_link_of_type<OT::HBUINT32> (link, head, c); + } + return; + case 2: + if (link.is_signed) + { + serialize_link_of_type<OT::HBINT16> (link, head, c); + } else { + serialize_link_of_type<OT::HBUINT16> (link, head, c); + } + return; + case 3: + serialize_link_of_type<OT::HBUINT24> (link, head, c); + return; + default: + // Unexpected link width. + assert (0); + } +} + +/* + * serialize graph into the provided serialization buffer. + */ +inline hb_blob_t* serialize (const graph_t& graph) +{ + hb_vector_t<char> buffer; + size_t size = graph.total_size_in_bytes (); + if (!buffer.alloc (size)) { + DEBUG_MSG (SUBSET_REPACK, nullptr, "Unable to allocate output buffer."); + return nullptr; + } + hb_serialize_context_t c((void *) buffer, size); + + c.start_serialize<void> (); + const auto& vertices = graph.vertices_; + for (unsigned i = 0; i < vertices.length; i++) { + c.push (); + + size_t size = vertices[i].obj.tail - vertices[i].obj.head; + char* start = c.allocate_size <char> (size); + if (!start) { + DEBUG_MSG (SUBSET_REPACK, nullptr, "Buffer out of space."); + return nullptr; + } + + memcpy (start, vertices[i].obj.head, size); + + // Only real links needs to be serialized. + for (const auto& link : vertices[i].obj.real_links) + serialize_link (link, start, &c); + + // All duplications are already encoded in the graph, so don't + // enable sharing during packing. + c.pop_pack (false); + } + c.end_serialize (); + + if (c.in_error ()) { + DEBUG_MSG (SUBSET_REPACK, nullptr, "Error during serialization. Err flag: %d", + c.errors); + return nullptr; + } + + return c.copy_blob (); +} + +} // namespace graph + +#endif // GRAPH_SERIALIZE_HH diff --git a/thirdparty/harfbuzz/src/hb-aat-layout-kerx-table.hh b/thirdparty/harfbuzz/src/hb-aat-layout-kerx-table.hh index 0354b47d5a..6a24c90c31 100644 --- a/thirdparty/harfbuzz/src/hb-aat-layout-kerx-table.hh +++ b/thirdparty/harfbuzz/src/hb-aat-layout-kerx-table.hh @@ -287,7 +287,7 @@ struct KerxSubTableFormat1 * in the 'kern' table example. */ if (v == -0x8000) { - o.attach_type() = ATTACH_TYPE_NONE; + o.attach_type() = OT::Layout::GPOS_impl::ATTACH_TYPE_NONE; o.attach_chain() = 0; o.y_offset = 0; } @@ -310,7 +310,7 @@ struct KerxSubTableFormat1 /* CoreText doesn't do crossStream kerning in vertical. We do. */ if (v == -0x8000) { - o.attach_type() = ATTACH_TYPE_NONE; + o.attach_type() = OT::Layout::GPOS_impl::ATTACH_TYPE_NONE; o.attach_chain() = 0; o.x_offset = 0; } @@ -567,7 +567,7 @@ struct KerxSubTableFormat4 } break; } - o.attach_type() = ATTACH_TYPE_MARK; + o.attach_type() = OT::Layout::GPOS_impl::ATTACH_TYPE_MARK; o.attach_chain() = (int) mark - (int) buffer->idx; buffer->scratch_flags |= HB_BUFFER_SCRATCH_FLAG_HAS_GPOS_ATTACHMENT; } @@ -901,7 +901,7 @@ struct KerxTable unsigned int count = c->buffer->len; for (unsigned int i = 0; i < count; i++) { - pos[i].attach_type() = ATTACH_TYPE_CURSIVE; + pos[i].attach_type() = OT::Layout::GPOS_impl::ATTACH_TYPE_CURSIVE; pos[i].attach_chain() = HB_DIRECTION_IS_FORWARD (c->buffer->props.direction) ? -1 : +1; /* We intentionally don't set HB_BUFFER_SCRATCH_FLAG_HAS_GPOS_ATTACHMENT, * since there needs to be a non-zero attachment for post-positioning to diff --git a/thirdparty/harfbuzz/src/hb-aat-layout-morx-table.hh b/thirdparty/harfbuzz/src/hb-aat-layout-morx-table.hh index b77c1f4d44..3d053cb13e 100644 --- a/thirdparty/harfbuzz/src/hb-aat-layout-morx-table.hh +++ b/thirdparty/harfbuzz/src/hb-aat-layout-morx-table.hh @@ -123,7 +123,7 @@ struct RearrangementSubtable bool reverse_l = 3 == (m >> 4); bool reverse_r = 3 == (m & 0x0F); - if (end - start >= l + r) + if (end - start >= l + r && end-start <= HB_MAX_CONTEXT_LENGTH) { buffer->merge_clusters (start, hb_min (buffer->idx + 1, buffer->len)); buffer->merge_clusters (start, end); diff --git a/thirdparty/harfbuzz/src/hb-algs.hh b/thirdparty/harfbuzz/src/hb-algs.hh index 05b4df52f1..f1633d886a 100644 --- a/thirdparty/harfbuzz/src/hb-algs.hh +++ b/thirdparty/harfbuzz/src/hb-algs.hh @@ -59,7 +59,7 @@ static inline constexpr T operator | (T l, T r) { return T ((unsigned) l | (unsigned) r); } \ static inline constexpr T operator & (T l, T r) { return T ((unsigned) l & (unsigned) r); } \ static inline constexpr T operator ^ (T l, T r) { return T ((unsigned) l ^ (unsigned) r); } \ - static inline constexpr T operator ~ (T r) { return T (~(unsigned int) r); } \ + static inline constexpr unsigned operator ~ (T r) { return (~(unsigned) r); } \ static inline T& operator |= (T &l, T r) { l = l | r; return l; } \ static inline T& operator &= (T& l, T r) { l = l & r; return l; } \ static inline T& operator ^= (T& l, T r) { l = l ^ r; return l; } \ @@ -227,31 +227,26 @@ struct } HB_FUNCOBJ (hb_bool); -template <typename T> -static inline -constexpr T hb_coerce (const T v) { return v; } -template <typename T, typename V, - hb_enable_if (!hb_is_same (hb_decay<T>, hb_decay<V>) && std::is_pointer<V>::value)> -static inline -constexpr T hb_coerce (const V v) { return *v; } - struct { private: template <typename T> constexpr auto - impl (const T& v, hb_priority<2>) const HB_RETURN (uint32_t, hb_deref (v).hash ()) + impl (const T& v, hb_priority<1>) const HB_RETURN (uint32_t, hb_deref (v).hash ()) - template <typename T> constexpr auto - impl (const T& v, hb_priority<1>) const HB_RETURN (uint32_t, std::hash<hb_decay<decltype (hb_deref (v))>>{} (hb_deref (v))) + template <typename T> constexpr uint32_t + impl (const hb::shared_ptr<T>& v, hb_priority<1>) const + { + return v.get () ? v.get ()->hash () : 0; + } + template <typename T> constexpr uint32_t + impl (const hb::unique_ptr<T>& v, hb_priority<1>) const + { + return v.get () ? v.get ()->hash () : 0; + } - template <typename T, - hb_enable_if (std::is_integral<T>::value)> constexpr auto - impl (const T& v, hb_priority<0>) const HB_AUTO_RETURN - ( - /* Knuth's multiplicative method: */ - (uint32_t) v * 2654435761u - ) + template <typename T> constexpr auto + impl (const T& v, hb_priority<0>) const HB_RETURN (uint32_t, std::hash<hb_decay<decltype (hb_deref (v))>>{} (hb_deref (v))) public: @@ -862,6 +857,11 @@ hb_in_ranges (T u, T lo1, T hi1, T lo2, T hi2, T lo3, T hi3) { return hb_in_range (u, lo1, hi1) || hb_in_range (u, lo2, hi2) || hb_in_range (u, lo3, hi3); } +template <typename T> static inline bool +hb_in_ranges (T u, T lo1, T hi1, T lo2, T hi2, T lo3, T hi3, T lo4, T hi4) +{ + return hb_in_range (u, lo1, hi1) || hb_in_range (u, lo2, hi2) || hb_in_range (u, lo3, hi3) || hb_in_range (u, lo4, hi4); +} /* diff --git a/thirdparty/harfbuzz/src/hb-array.hh b/thirdparty/harfbuzz/src/hb-array.hh index 1963698cf7..5baeb6f7fe 100644 --- a/thirdparty/harfbuzz/src/hb-array.hh +++ b/thirdparty/harfbuzz/src/hb-array.hh @@ -56,7 +56,6 @@ struct hb_array_t : hb_iter_with_fallback_t<hb_array_t<Type>, Type&> hb_array_t& operator= (const hb_array_t&) = default; hb_array_t& operator= (hb_array_t&&) = default; - constexpr hb_array_t (std::nullptr_t) : hb_array_t () {} constexpr hb_array_t (Type *array_, unsigned int length_) : arrayZ (array_), length (length_) {} template <unsigned int length_> constexpr hb_array_t (Type (&array_)[length_]) : hb_array_t (array_, length_) {} @@ -314,7 +313,6 @@ struct hb_sorted_array_t : hb_sorted_array_t& operator= (const hb_sorted_array_t&) = default; hb_sorted_array_t& operator= (hb_sorted_array_t&&) = default; - constexpr hb_sorted_array_t (std::nullptr_t) : hb_sorted_array_t () {} constexpr hb_sorted_array_t (Type *array_, unsigned int length_) : hb_array_t<Type> (array_, length_) {} template <unsigned int length_> constexpr hb_sorted_array_t (Type (&array_)[length_]) : hb_array_t<Type> (array_) {} diff --git a/thirdparty/harfbuzz/src/hb-bimap.hh b/thirdparty/harfbuzz/src/hb-bimap.hh index 5b313bf59c..8e8c988716 100644 --- a/thirdparty/harfbuzz/src/hb-bimap.hh +++ b/thirdparty/harfbuzz/src/hb-bimap.hh @@ -54,17 +54,18 @@ struct hb_bimap_t if (unlikely (rhs == HB_MAP_VALUE_INVALID)) { del (lhs); return; } forw_map.set (lhs, rhs); - if (in_error ()) return; + if (unlikely (in_error ())) return; back_map.set (rhs, lhs); - if (in_error ()) forw_map.del (lhs); + if (unlikely (in_error ())) forw_map.del (lhs); } hb_codepoint_t get (hb_codepoint_t lhs) const { return forw_map.get (lhs); } hb_codepoint_t backward (hb_codepoint_t rhs) const { return back_map.get (rhs); } hb_codepoint_t operator [] (hb_codepoint_t lhs) const { return get (lhs); } - bool has (hb_codepoint_t lhs, hb_codepoint_t *vp = nullptr) const { return forw_map.has (lhs, vp); } + bool has (hb_codepoint_t lhs) const { return forw_map.has (lhs); } + void del (hb_codepoint_t lhs) { @@ -78,7 +79,7 @@ struct hb_bimap_t back_map.clear (); } - bool is_empty () const { return get_population () == 0; } + bool is_empty () const { return forw_map.is_empty (); } unsigned int get_population () const { return forw_map.get_population (); } diff --git a/thirdparty/harfbuzz/src/hb-bit-set-invertible.hh b/thirdparty/harfbuzz/src/hb-bit-set-invertible.hh index caea47d8d3..27fb0732ea 100644 --- a/thirdparty/harfbuzz/src/hb-bit-set-invertible.hh +++ b/thirdparty/harfbuzz/src/hb-bit-set-invertible.hh @@ -80,7 +80,7 @@ struct hb_bit_set_invertible_t next (&v); return v == INVALID; } - uint32_t hash () const { return s.hash () ^ inverted; } + uint32_t hash () const { return s.hash () ^ (uint32_t) inverted; } hb_codepoint_t get_min () const { @@ -100,7 +100,7 @@ struct hb_bit_set_invertible_t void add (hb_codepoint_t g) { unlikely (inverted) ? s.del (g) : s.add (g); } bool add_range (hb_codepoint_t a, hb_codepoint_t b) - { return unlikely (inverted) ? (s.del_range (a, b), true) : s.add_range (a, b); } + { return unlikely (inverted) ? ((void) s.del_range (a, b), true) : s.add_range (a, b); } template <typename T> void add_array (const T *array, unsigned int count, unsigned int stride=sizeof(T)) diff --git a/thirdparty/harfbuzz/src/hb-bit-set.hh b/thirdparty/harfbuzz/src/hb-bit-set.hh index 11a4359dc9..438fb66a2c 100644 --- a/thirdparty/harfbuzz/src/hb-bit-set.hh +++ b/thirdparty/harfbuzz/src/hb-bit-set.hh @@ -56,7 +56,7 @@ struct hb_bit_set_t { successful = true; population = 0; - last_page_lookup = 0; + last_page_lookup.set_relaxed (0); page_map.init (); pages.init (); } @@ -78,7 +78,7 @@ struct hb_bit_set_t bool successful = true; /* Allocations successful */ mutable unsigned int population = 0; - mutable unsigned int last_page_lookup = 0; + mutable hb_atomic_int_t last_page_lookup = 0; hb_sorted_vector_t<page_map_t> page_map; hb_vector_t<page_t> pages; @@ -607,7 +607,7 @@ struct hb_bit_set_t const auto* page_map_array = page_map.arrayZ; unsigned int major = get_major (*codepoint); - unsigned int i = last_page_lookup; + unsigned int i = last_page_lookup.get_relaxed (); if (unlikely (i >= page_map.length || page_map_array[i].major != major)) { @@ -625,7 +625,7 @@ struct hb_bit_set_t if (pages_array[current.index].next (codepoint)) { *codepoint += current.major * page_t::PAGE_BITS; - last_page_lookup = i; + last_page_lookup.set_relaxed (i); return true; } i++; @@ -638,11 +638,11 @@ struct hb_bit_set_t if (m != INVALID) { *codepoint = current.major * page_t::PAGE_BITS + m; - last_page_lookup = i; + last_page_lookup.set_relaxed (i); return true; } } - last_page_lookup = 0; + last_page_lookup.set_relaxed (0); *codepoint = INVALID; return false; } @@ -725,7 +725,7 @@ struct hb_bit_set_t { const auto* page_map_array = page_map.arrayZ; unsigned int major = get_major (codepoint); - unsigned int i = last_page_lookup; + unsigned int i = last_page_lookup.get_relaxed (); if (unlikely (i >= page_map.length || page_map_array[i].major != major)) { page_map.bfind (major, &i, HB_NOT_FOUND_STORE_CLOSEST); @@ -766,7 +766,7 @@ struct hb_bit_set_t { const auto* page_map_array = page_map.arrayZ; unsigned int major = get_major (codepoint); - unsigned int i = last_page_lookup; + unsigned int i = last_page_lookup.get_relaxed (); if (unlikely (i >= page_map.length || page_map_array[i].major != major)) { page_map.bfind(major, &i, HB_NOT_FOUND_STORE_CLOSEST); @@ -893,15 +893,15 @@ struct hb_bit_set_t /* The extra page_map length is necessary; can't just rely on vector here, * since the next check would be tricked because a null page also has * major==0, which we can't distinguish from an actualy major==0 page... */ - if (likely (last_page_lookup < page_map.length)) + unsigned i = last_page_lookup.get_relaxed (); + if (likely (i < page_map.length)) { - auto &cached_page = page_map.arrayZ[last_page_lookup]; + auto &cached_page = page_map.arrayZ[i]; if (cached_page.major == major) return &pages[cached_page.index]; } page_map_t map = {major, pages.length}; - unsigned int i; if (!page_map.bfind (map, &i, HB_NOT_FOUND_STORE_CLOSEST)) { if (!insert) @@ -917,7 +917,7 @@ struct hb_bit_set_t page_map[i] = map; } - last_page_lookup = i; + last_page_lookup.set_relaxed (i); return &pages[page_map[i].index]; } const page_t *page_for (hb_codepoint_t g) const @@ -927,19 +927,19 @@ struct hb_bit_set_t /* The extra page_map length is necessary; can't just rely on vector here, * since the next check would be tricked because a null page also has * major==0, which we can't distinguish from an actualy major==0 page... */ - if (likely (last_page_lookup < page_map.length)) + unsigned i = last_page_lookup.get_relaxed (); + if (likely (i < page_map.length)) { - auto &cached_page = page_map.arrayZ[last_page_lookup]; + auto &cached_page = page_map.arrayZ[i]; if (cached_page.major == major) return &pages[cached_page.index]; } page_map_t key = {major}; - unsigned int i; if (!page_map.bfind (key, &i)) return nullptr; - last_page_lookup = i; + last_page_lookup.set_relaxed (i); return &pages[page_map[i].index]; } page_t &page_at (unsigned int i) { return pages[page_map[i].index]; } diff --git a/thirdparty/harfbuzz/src/hb-blob.cc b/thirdparty/harfbuzz/src/hb-blob.cc index 65e44c7f6a..b561a9374e 100644 --- a/thirdparty/harfbuzz/src/hb-blob.cc +++ b/thirdparty/harfbuzz/src/hb-blob.cc @@ -369,7 +369,7 @@ hb_blob_get_length (hb_blob_t *blob) * * Fetches the data from a blob. * - * Returns: (transfer none) (array length=length): the byte data of @blob. + * Returns: (nullable) (transfer none) (array length=length): the byte data of @blob. * * Since: 0.9.2 **/ @@ -572,7 +572,7 @@ _open_resource_fork (const char *file_name, hb_mapped_file_t *file) strncpy (rsrc_name, file_name, name_len); strncpy (rsrc_name + name_len, _PATH_RSRCFORKSPEC, - sizeof (_PATH_RSRCFORKSPEC) - 1); + sizeof (_PATH_RSRCFORKSPEC)); int fd = open (rsrc_name, O_RDONLY | O_BINARY, 0); hb_free (rsrc_name); diff --git a/thirdparty/harfbuzz/src/hb-buffer-serialize.cc b/thirdparty/harfbuzz/src/hb-buffer-serialize.cc index 6539b89640..3f619a113e 100644 --- a/thirdparty/harfbuzz/src/hb-buffer-serialize.cc +++ b/thirdparty/harfbuzz/src/hb-buffer-serialize.cc @@ -31,7 +31,7 @@ #include "hb-buffer.hh" -static const char *serialize_formats[] = { +static const char *_hb_buffer_serialize_formats[] = { "text", "json", nullptr @@ -50,7 +50,7 @@ static const char *serialize_formats[] = { const char ** hb_buffer_serialize_list_formats () { - return serialize_formats; + return _hb_buffer_serialize_formats; } /** @@ -91,8 +91,8 @@ hb_buffer_serialize_format_to_string (hb_buffer_serialize_format_t format) { switch ((unsigned) format) { - case HB_BUFFER_SERIALIZE_FORMAT_TEXT: return serialize_formats[0]; - case HB_BUFFER_SERIALIZE_FORMAT_JSON: return serialize_formats[1]; + case HB_BUFFER_SERIALIZE_FORMAT_TEXT: return _hb_buffer_serialize_formats[0]; + case HB_BUFFER_SERIALIZE_FORMAT_JSON: return _hb_buffer_serialize_formats[1]; default: case HB_BUFFER_SERIALIZE_FORMAT_INVALID: return nullptr; } @@ -400,9 +400,9 @@ _hb_buffer_serialize_unicode_text (hb_buffer_t *buffer, * @buf: (out) (array length=buf_size) (element-type uint8_t): output string to * write serialized buffer into. * @buf_size: the size of @buf. - * @buf_consumed: (out) (optional): if not %NULL, will be set to the number of byes written into @buf. + * @buf_consumed: (out) (optional): if not %NULL, will be set to the number of bytes written into @buf. * @font: (nullable): the #hb_font_t used to shape this buffer, needed to - * read glyph names and extents. If %NULL, and empty font will be used. + * read glyph names and extents. If %NULL, an empty font will be used. * @format: the #hb_buffer_serialize_format_t to use for formatting the output. * @flags: the #hb_buffer_serialize_flags_t that control what glyph properties * to serialize. @@ -514,7 +514,7 @@ hb_buffer_serialize_glyphs (hb_buffer_t *buffer, * @buf: (out) (array length=buf_size) (element-type uint8_t): output string to * write serialized buffer into. * @buf_size: the size of @buf. - * @buf_consumed: (out) (optional): if not %NULL, will be set to the number of byes written into @buf. + * @buf_consumed: (out) (optional): if not %NULL, will be set to the number of bytes written into @buf. * @format: the #hb_buffer_serialize_format_t to use for formatting the output. * @flags: the #hb_buffer_serialize_flags_t that control what glyph properties * to serialize. @@ -637,9 +637,9 @@ _hb_buffer_serialize_invalid (hb_buffer_t *buffer, * @buf: (out) (array length=buf_size) (element-type uint8_t): output string to * write serialized buffer into. * @buf_size: the size of @buf. - * @buf_consumed: (out) (optional): if not %NULL, will be set to the number of byes written into @buf. + * @buf_consumed: (out) (optional): if not %NULL, will be set to the number of bytes written into @buf. * @font: (nullable): the #hb_font_t used to shape this buffer, needed to - * read glyph names and extents. If %NULL, and empty font will be used. + * read glyph names and extents. If %NULL, an empty font will be used. * @format: the #hb_buffer_serialize_format_t to use for formatting the output. * @flags: the #hb_buffer_serialize_flags_t that control what glyph properties * to serialize. diff --git a/thirdparty/harfbuzz/src/hb-buffer-verify.cc b/thirdparty/harfbuzz/src/hb-buffer-verify.cc index dea2c11c35..5453e1ca94 100644 --- a/thirdparty/harfbuzz/src/hb-buffer-verify.cc +++ b/thirdparty/harfbuzz/src/hb-buffer-verify.cc @@ -102,9 +102,9 @@ buffer_verify_unsafe_to_break (hb_buffer_t *buffer, /* Check that breaking up shaping at safe-to-break is indeed safe. */ hb_buffer_t *fragment = hb_buffer_create_similar (buffer); - hb_buffer_set_flags (fragment, hb_buffer_get_flags (fragment) & ~HB_BUFFER_FLAG_VERIFY); + hb_buffer_set_flags (fragment, (hb_buffer_flags_t (hb_buffer_get_flags (fragment) & ~HB_BUFFER_FLAG_VERIFY))); hb_buffer_t *reconstruction = hb_buffer_create_similar (buffer); - hb_buffer_set_flags (reconstruction, hb_buffer_get_flags (reconstruction) & ~HB_BUFFER_FLAG_VERIFY); + hb_buffer_set_flags (reconstruction, (hb_buffer_flags_t (hb_buffer_get_flags (reconstruction) & ~HB_BUFFER_FLAG_VERIFY))); unsigned int num_glyphs; hb_glyph_info_t *info = hb_buffer_get_glyph_infos (buffer, &num_glyphs); @@ -169,6 +169,12 @@ buffer_verify_unsafe_to_break (hb_buffer_t *buffer, hb_buffer_destroy (fragment); return false; } + else if (!fragment->successful || fragment->shaping_failed) + { + hb_buffer_destroy (reconstruction); + hb_buffer_destroy (fragment); + return true; + } hb_buffer_append (reconstruction, fragment, 0, -1); start = end; @@ -238,10 +244,10 @@ buffer_verify_unsafe_to_concat (hb_buffer_t *buffer, hb_buffer_t *fragments[2] {hb_buffer_create_similar (buffer), hb_buffer_create_similar (buffer)}; - hb_buffer_set_flags (fragments[0], hb_buffer_get_flags (fragments[0]) & ~HB_BUFFER_FLAG_VERIFY); - hb_buffer_set_flags (fragments[1], hb_buffer_get_flags (fragments[1]) & ~HB_BUFFER_FLAG_VERIFY); + hb_buffer_set_flags (fragments[0], (hb_buffer_flags_t (hb_buffer_get_flags (fragments[0]) & ~HB_BUFFER_FLAG_VERIFY))); + hb_buffer_set_flags (fragments[1], (hb_buffer_flags_t (hb_buffer_get_flags (fragments[1]) & ~HB_BUFFER_FLAG_VERIFY))); hb_buffer_t *reconstruction = hb_buffer_create_similar (buffer); - hb_buffer_set_flags (reconstruction, hb_buffer_get_flags (reconstruction) & ~HB_BUFFER_FLAG_VERIFY); + hb_buffer_set_flags (reconstruction, (hb_buffer_flags_t (hb_buffer_get_flags (reconstruction) & ~HB_BUFFER_FLAG_VERIFY))); hb_segment_properties_t props; hb_buffer_get_segment_properties (buffer, &props); hb_buffer_set_segment_properties (fragments[0], &props); @@ -317,12 +323,22 @@ buffer_verify_unsafe_to_concat (hb_buffer_t *buffer, ret = false; goto out; } + else if (!fragments[0]->successful || fragments[0]->shaping_failed) + { + ret = true; + goto out; + } if (!hb_shape_full (font, fragments[1], features, num_features, shapers)) { buffer_verify_error (buffer, font, BUFFER_VERIFY_ERROR "shaping failed while shaping fragment."); ret = false; goto out; } + else if (!fragments[1]->successful || fragments[1]->shaping_failed) + { + ret = true; + goto out; + } if (!forward) { @@ -402,6 +418,7 @@ hb_buffer_t::verify (hb_buffer_t *text_buffer, ret = false; if (!ret) { +#ifndef HB_NO_BUFFER_SERIALIZE unsigned len = text_buffer->len; hb_vector_t<char> bytes; if (likely (bytes.resize (len * 10 + 16))) @@ -414,6 +431,7 @@ hb_buffer_t::verify (hb_buffer_t *text_buffer, HB_BUFFER_SERIALIZE_FLAG_NO_CLUSTERS); buffer_verify_error (this, font, BUFFER_VERIFY_ERROR "text was: %s.", bytes.arrayZ); } +#endif } return ret; } diff --git a/thirdparty/harfbuzz/src/hb-buffer.cc b/thirdparty/harfbuzz/src/hb-buffer.cc index 6a9ee3ccc8..2272ecf09b 100644 --- a/thirdparty/harfbuzz/src/hb-buffer.cc +++ b/thirdparty/harfbuzz/src/hb-buffer.cc @@ -81,8 +81,8 @@ hb_segment_properties_equal (const hb_segment_properties_t *a, unsigned int hb_segment_properties_hash (const hb_segment_properties_t *p) { - return (unsigned int) p->direction ^ - (unsigned int) p->script ^ + return ((unsigned int) p->direction * 31 + + (unsigned int) p->script) * 31 + (intptr_t) (p->language); } @@ -289,6 +289,7 @@ hb_buffer_t::clear () props = default_props; successful = true; + shaping_failed = false; have_output = false; have_positions = false; @@ -310,6 +311,7 @@ hb_buffer_t::enter () { deallocate_var_all (); serial = 0; + shaping_failed = false; scratch_flags = HB_BUFFER_SCRATCH_FLAG_DEFAULT; if (likely (!hb_unsigned_mul_overflows (len, HB_BUFFER_MAX_LEN_FACTOR))) { @@ -329,6 +331,7 @@ hb_buffer_t::leave () max_ops = HB_BUFFER_MAX_OPS_DEFAULT; deallocate_var_all (); serial = 0; + // Intentionally not reseting shaping_failed, such that it can be inspected. } @@ -542,7 +545,8 @@ hb_buffer_t::delete_glyph () /* The logic here is duplicated in hb_ot_hide_default_ignorables(). */ unsigned int cluster = info[idx].cluster; - if (idx + 1 < len && cluster == info[idx + 1].cluster) + if ((idx + 1 < len && cluster == info[idx + 1].cluster) || + (out_len && cluster == out_info[out_len - 1].cluster)) { /* Cluster survives; do nothing. */ goto done; @@ -623,6 +627,7 @@ DEFINE_NULL_INSTANCE (hb_buffer_t) = HB_SEGMENT_PROPERTIES_DEFAULT, false, /* successful */ + true, /* shaping_failed */ false, /* have_output */ true /* have_positions */ @@ -631,7 +636,7 @@ DEFINE_NULL_INSTANCE (hb_buffer_t) = /** - * hb_buffer_create: (Xconstructor) + * hb_buffer_create: * * Creates a new #hb_buffer_t with all properties to defaults. * @@ -834,7 +839,7 @@ hb_buffer_set_content_type (hb_buffer_t *buffer, * Since: 0.9.5 **/ hb_buffer_content_type_t -hb_buffer_get_content_type (hb_buffer_t *buffer) +hb_buffer_get_content_type (const hb_buffer_t *buffer) { return buffer->content_type; } @@ -876,7 +881,7 @@ hb_buffer_set_unicode_funcs (hb_buffer_t *buffer, * Since: 0.9.2 **/ hb_unicode_funcs_t * -hb_buffer_get_unicode_funcs (hb_buffer_t *buffer) +hb_buffer_get_unicode_funcs (const hb_buffer_t *buffer) { return buffer->unicode; } @@ -919,7 +924,7 @@ hb_buffer_set_direction (hb_buffer_t *buffer, * Since: 0.9.2 **/ hb_direction_t -hb_buffer_get_direction (hb_buffer_t *buffer) +hb_buffer_get_direction (const hb_buffer_t *buffer) { return buffer->props.direction; } @@ -963,7 +968,7 @@ hb_buffer_set_script (hb_buffer_t *buffer, * Since: 0.9.2 **/ hb_script_t -hb_buffer_get_script (hb_buffer_t *buffer) +hb_buffer_get_script (const hb_buffer_t *buffer) { return buffer->props.script; } @@ -1007,7 +1012,7 @@ hb_buffer_set_language (hb_buffer_t *buffer, * Since: 0.9.2 **/ hb_language_t -hb_buffer_get_language (hb_buffer_t *buffer) +hb_buffer_get_language (const hb_buffer_t *buffer) { return buffer->props.language; } @@ -1043,7 +1048,7 @@ hb_buffer_set_segment_properties (hb_buffer_t *buffer, * Since: 0.9.7 **/ void -hb_buffer_get_segment_properties (hb_buffer_t *buffer, +hb_buffer_get_segment_properties (const hb_buffer_t *buffer, hb_segment_properties_t *props) { *props = buffer->props; @@ -1081,7 +1086,7 @@ hb_buffer_set_flags (hb_buffer_t *buffer, * Since: 0.9.7 **/ hb_buffer_flags_t -hb_buffer_get_flags (hb_buffer_t *buffer) +hb_buffer_get_flags (const hb_buffer_t *buffer) { return buffer->flags; } @@ -1120,7 +1125,7 @@ hb_buffer_set_cluster_level (hb_buffer_t *buffer, * Since: 0.9.42 **/ hb_buffer_cluster_level_t -hb_buffer_get_cluster_level (hb_buffer_t *buffer) +hb_buffer_get_cluster_level (const hb_buffer_t *buffer) { return buffer->cluster_level; } @@ -1161,7 +1166,7 @@ hb_buffer_set_replacement_codepoint (hb_buffer_t *buffer, * Since: 0.9.31 **/ hb_codepoint_t -hb_buffer_get_replacement_codepoint (hb_buffer_t *buffer) +hb_buffer_get_replacement_codepoint (const hb_buffer_t *buffer) { return buffer->replacement; } @@ -1201,7 +1206,7 @@ hb_buffer_set_invisible_glyph (hb_buffer_t *buffer, * Since: 2.0.0 **/ hb_codepoint_t -hb_buffer_get_invisible_glyph (hb_buffer_t *buffer) +hb_buffer_get_invisible_glyph (const hb_buffer_t *buffer) { return buffer->invisible; } @@ -1241,7 +1246,7 @@ hb_buffer_set_not_found_glyph (hb_buffer_t *buffer, * Since: 3.1.0 **/ hb_codepoint_t -hb_buffer_get_not_found_glyph (hb_buffer_t *buffer) +hb_buffer_get_not_found_glyph (const hb_buffer_t *buffer) { return buffer->not_found; } @@ -1381,7 +1386,7 @@ hb_buffer_set_length (hb_buffer_t *buffer, * Since: 0.9.2 **/ unsigned int -hb_buffer_get_length (hb_buffer_t *buffer) +hb_buffer_get_length (const hb_buffer_t *buffer) { return buffer->len; } diff --git a/thirdparty/harfbuzz/src/hb-buffer.h b/thirdparty/harfbuzz/src/hb-buffer.h index 14aaa5e1f5..22fb3496f2 100644 --- a/thirdparty/harfbuzz/src/hb-buffer.h +++ b/thirdparty/harfbuzz/src/hb-buffer.h @@ -289,7 +289,7 @@ hb_buffer_set_content_type (hb_buffer_t *buffer, hb_buffer_content_type_t content_type); HB_EXTERN hb_buffer_content_type_t -hb_buffer_get_content_type (hb_buffer_t *buffer); +hb_buffer_get_content_type (const hb_buffer_t *buffer); HB_EXTERN void @@ -297,21 +297,21 @@ hb_buffer_set_unicode_funcs (hb_buffer_t *buffer, hb_unicode_funcs_t *unicode_funcs); HB_EXTERN hb_unicode_funcs_t * -hb_buffer_get_unicode_funcs (hb_buffer_t *buffer); +hb_buffer_get_unicode_funcs (const hb_buffer_t *buffer); HB_EXTERN void hb_buffer_set_direction (hb_buffer_t *buffer, hb_direction_t direction); HB_EXTERN hb_direction_t -hb_buffer_get_direction (hb_buffer_t *buffer); +hb_buffer_get_direction (const hb_buffer_t *buffer); HB_EXTERN void hb_buffer_set_script (hb_buffer_t *buffer, hb_script_t script); HB_EXTERN hb_script_t -hb_buffer_get_script (hb_buffer_t *buffer); +hb_buffer_get_script (const hb_buffer_t *buffer); HB_EXTERN void hb_buffer_set_language (hb_buffer_t *buffer, @@ -319,14 +319,14 @@ hb_buffer_set_language (hb_buffer_t *buffer, HB_EXTERN hb_language_t -hb_buffer_get_language (hb_buffer_t *buffer); +hb_buffer_get_language (const hb_buffer_t *buffer); HB_EXTERN void hb_buffer_set_segment_properties (hb_buffer_t *buffer, const hb_segment_properties_t *props); HB_EXTERN void -hb_buffer_get_segment_properties (hb_buffer_t *buffer, +hb_buffer_get_segment_properties (const hb_buffer_t *buffer, hb_segment_properties_t *props); HB_EXTERN void @@ -373,6 +373,7 @@ hb_buffer_guess_segment_properties (hb_buffer_t *buffer); * flag indicating that the @HB_GLYPH_FLAG_UNSAFE_TO_CONCAT * glyph-flag should be produced by the shaper. By default * it will not be produced since it incurs a cost. Since: 4.0.0 + * @HB_BUFFER_FLAG_DEFINED: All currently defined flags: Since: 4.4.0 * * Flags for #hb_buffer_t. * @@ -386,7 +387,9 @@ typedef enum { /*< flags >*/ HB_BUFFER_FLAG_REMOVE_DEFAULT_IGNORABLES = 0x00000008u, HB_BUFFER_FLAG_DO_NOT_INSERT_DOTTED_CIRCLE = 0x00000010u, HB_BUFFER_FLAG_VERIFY = 0x00000020u, - HB_BUFFER_FLAG_PRODUCE_UNSAFE_TO_CONCAT = 0x00000040u + HB_BUFFER_FLAG_PRODUCE_UNSAFE_TO_CONCAT = 0x00000040u, + + HB_BUFFER_FLAG_DEFINED = 0x0000007Fu } hb_buffer_flags_t; HB_EXTERN void @@ -394,7 +397,7 @@ hb_buffer_set_flags (hb_buffer_t *buffer, hb_buffer_flags_t flags); HB_EXTERN hb_buffer_flags_t -hb_buffer_get_flags (hb_buffer_t *buffer); +hb_buffer_get_flags (const hb_buffer_t *buffer); /** * hb_buffer_cluster_level_t: @@ -436,7 +439,7 @@ hb_buffer_set_cluster_level (hb_buffer_t *buffer, hb_buffer_cluster_level_t cluster_level); HB_EXTERN hb_buffer_cluster_level_t -hb_buffer_get_cluster_level (hb_buffer_t *buffer); +hb_buffer_get_cluster_level (const hb_buffer_t *buffer); /** * HB_BUFFER_REPLACEMENT_CODEPOINT_DEFAULT: @@ -453,21 +456,21 @@ hb_buffer_set_replacement_codepoint (hb_buffer_t *buffer, hb_codepoint_t replacement); HB_EXTERN hb_codepoint_t -hb_buffer_get_replacement_codepoint (hb_buffer_t *buffer); +hb_buffer_get_replacement_codepoint (const hb_buffer_t *buffer); HB_EXTERN void hb_buffer_set_invisible_glyph (hb_buffer_t *buffer, hb_codepoint_t invisible); HB_EXTERN hb_codepoint_t -hb_buffer_get_invisible_glyph (hb_buffer_t *buffer); +hb_buffer_get_invisible_glyph (const hb_buffer_t *buffer); HB_EXTERN void hb_buffer_set_not_found_glyph (hb_buffer_t *buffer, hb_codepoint_t not_found); HB_EXTERN hb_codepoint_t -hb_buffer_get_not_found_glyph (hb_buffer_t *buffer); +hb_buffer_get_not_found_glyph (const hb_buffer_t *buffer); /* @@ -549,7 +552,7 @@ hb_buffer_set_length (hb_buffer_t *buffer, unsigned int length); HB_EXTERN unsigned int -hb_buffer_get_length (hb_buffer_t *buffer); +hb_buffer_get_length (const hb_buffer_t *buffer); /* Getting glyphs out of the buffer */ @@ -583,6 +586,7 @@ hb_buffer_normalize_glyphs (hb_buffer_t *buffer); * @HB_BUFFER_SERIALIZE_FLAG_GLYPH_FLAGS: serialize glyph flags. Since: 1.5.0 * @HB_BUFFER_SERIALIZE_FLAG_NO_ADVANCES: do not serialize glyph advances, * glyph offsets will reflect absolute glyph positions. Since: 1.8.0 + * @HB_BUFFER_SERIALIZE_FLAG_DEFINED: All currently defined flags. Since: 4.4.0 * * Flags that control what glyph information are serialized in hb_buffer_serialize_glyphs(). * @@ -595,7 +599,9 @@ typedef enum { /*< flags >*/ HB_BUFFER_SERIALIZE_FLAG_NO_GLYPH_NAMES = 0x00000004u, HB_BUFFER_SERIALIZE_FLAG_GLYPH_EXTENTS = 0x00000008u, HB_BUFFER_SERIALIZE_FLAG_GLYPH_FLAGS = 0x00000010u, - HB_BUFFER_SERIALIZE_FLAG_NO_ADVANCES = 0x00000020u + HB_BUFFER_SERIALIZE_FLAG_NO_ADVANCES = 0x00000020u, + + HB_BUFFER_SERIALIZE_FLAG_DEFINED = 0x0000003Fu } hb_buffer_serialize_flags_t; /** diff --git a/thirdparty/harfbuzz/src/hb-buffer.hh b/thirdparty/harfbuzz/src/hb-buffer.hh index bc6992905e..6ca78f28d4 100644 --- a/thirdparty/harfbuzz/src/hb-buffer.hh +++ b/thirdparty/harfbuzz/src/hb-buffer.hh @@ -57,6 +57,7 @@ static_assert ((sizeof (hb_glyph_info_t) == 20), ""); static_assert ((sizeof (hb_glyph_info_t) == sizeof (hb_glyph_position_t)), ""); +HB_MARK_AS_FLAG_T (hb_glyph_flags_t); HB_MARK_AS_FLAG_T (hb_buffer_flags_t); HB_MARK_AS_FLAG_T (hb_buffer_serialize_flags_t); HB_MARK_AS_FLAG_T (hb_buffer_diff_flags_t); @@ -69,12 +70,13 @@ enum hb_buffer_scratch_flags_t { HB_BUFFER_SCRATCH_FLAG_HAS_GPOS_ATTACHMENT = 0x00000008u, HB_BUFFER_SCRATCH_FLAG_HAS_CGJ = 0x00000010u, HB_BUFFER_SCRATCH_FLAG_HAS_GLYPH_FLAGS = 0x00000020u, + HB_BUFFER_SCRATCH_FLAG_HAS_BROKEN_SYLLABLE = 0x00000040u, - /* Reserved for complex shapers' internal use. */ - HB_BUFFER_SCRATCH_FLAG_COMPLEX0 = 0x01000000u, - HB_BUFFER_SCRATCH_FLAG_COMPLEX1 = 0x02000000u, - HB_BUFFER_SCRATCH_FLAG_COMPLEX2 = 0x04000000u, - HB_BUFFER_SCRATCH_FLAG_COMPLEX3 = 0x08000000u, + /* Reserved for shapers' internal use. */ + HB_BUFFER_SCRATCH_FLAG_SHAPER0 = 0x01000000u, + HB_BUFFER_SCRATCH_FLAG_SHAPER1 = 0x02000000u, + HB_BUFFER_SCRATCH_FLAG_SHAPER2 = 0x04000000u, + HB_BUFFER_SCRATCH_FLAG_SHAPER3 = 0x08000000u, }; HB_MARK_AS_FLAG_T (hb_buffer_scratch_flags_t); @@ -106,6 +108,7 @@ struct hb_buffer_t hb_segment_properties_t props; /* Script, language, direction */ bool successful; /* Allocations successful */ + bool shaping_failed; /* Shaping failure */ bool have_output; /* Whether we have an output buffer going on */ bool have_positions; /* Whether we have positions */ @@ -130,9 +133,7 @@ struct hb_buffer_t * Managed by enter / leave */ -#ifndef HB_NDEBUG uint8_t allocated_var_bits; -#endif uint8_t serial; hb_buffer_scratch_flags_t scratch_flags; /* Have space-fallback, etc. */ unsigned int max_len; /* Maximum allowed len. */ @@ -161,38 +162,40 @@ struct hb_buffer_t void allocate_var (unsigned int start, unsigned int count) { -#ifndef HB_NDEBUG unsigned int end = start + count; assert (end <= 8); unsigned int bits = (1u<<end) - (1u<<start); assert (0 == (allocated_var_bits & bits)); allocated_var_bits |= bits; -#endif + } + bool try_allocate_var (unsigned int start, unsigned int count) + { + unsigned int end = start + count; + assert (end <= 8); + unsigned int bits = (1u<<end) - (1u<<start); + if (allocated_var_bits & bits) + return false; + allocated_var_bits |= bits; + return true; } void deallocate_var (unsigned int start, unsigned int count) { -#ifndef HB_NDEBUG unsigned int end = start + count; assert (end <= 8); unsigned int bits = (1u<<end) - (1u<<start); assert (bits == (allocated_var_bits & bits)); allocated_var_bits &= ~bits; -#endif } void assert_var (unsigned int start, unsigned int count) { -#ifndef HB_NDEBUG unsigned int end = start + count; assert (end <= 8); - unsigned int bits = (1u<<end) - (1u<<start); + HB_UNUSED unsigned int bits = (1u<<end) - (1u<<start); assert (bits == (allocated_var_bits & bits)); -#endif } void deallocate_var_all () { -#ifndef HB_NDEBUG allocated_var_bits = 0; -#endif } hb_glyph_info_t &cur (unsigned int i = 0) { return info[idx + i]; } @@ -549,7 +552,7 @@ struct hb_buffer_t #ifdef HB_NO_BUFFER_MESSAGE return true; #else - if (!messaging ()) + if (likely (!messaging ())) return true; message_depth++; @@ -619,9 +622,10 @@ DECLARE_NULL_INSTANCE (hb_buffer_t); #define HB_BUFFER_XALLOCATE_VAR(b, func, var) \ b->func (offsetof (hb_glyph_info_t, var) - offsetof(hb_glyph_info_t, var1), \ sizeof (b->info[0].var)) -#define HB_BUFFER_ALLOCATE_VAR(b, var) HB_BUFFER_XALLOCATE_VAR (b, allocate_var, var ()) -#define HB_BUFFER_DEALLOCATE_VAR(b, var) HB_BUFFER_XALLOCATE_VAR (b, deallocate_var, var ()) -#define HB_BUFFER_ASSERT_VAR(b, var) HB_BUFFER_XALLOCATE_VAR (b, assert_var, var ()) +#define HB_BUFFER_ALLOCATE_VAR(b, var) HB_BUFFER_XALLOCATE_VAR (b, allocate_var, var ()) +#define HB_BUFFER_TRY_ALLOCATE_VAR(b, var) HB_BUFFER_XALLOCATE_VAR (b, try_allocate_var, var ()) +#define HB_BUFFER_DEALLOCATE_VAR(b, var) HB_BUFFER_XALLOCATE_VAR (b, deallocate_var, var ()) +#define HB_BUFFER_ASSERT_VAR(b, var) HB_BUFFER_XALLOCATE_VAR (b, assert_var, var ()) #endif /* HB_BUFFER_HH */ diff --git a/thirdparty/harfbuzz/src/hb-cache.hh b/thirdparty/harfbuzz/src/hb-cache.hh index e617b75de9..d6b229ed65 100644 --- a/thirdparty/harfbuzz/src/hb-cache.hh +++ b/thirdparty/harfbuzz/src/hb-cache.hh @@ -32,7 +32,7 @@ /* Implements a lockfree cache for int->int functions. */ -template <unsigned int key_bits, unsigned int value_bits, unsigned int cache_bits> +template <unsigned int key_bits=16, unsigned int value_bits=8 + 32 - key_bits, unsigned int cache_bits=8> struct hb_cache_t { static_assert ((key_bits >= cache_bits), ""); diff --git a/thirdparty/harfbuzz/src/hb-common.cc b/thirdparty/harfbuzz/src/hb-common.cc index 41229b9183..7266d9b01f 100644 --- a/thirdparty/harfbuzz/src/hb-common.cc +++ b/thirdparty/harfbuzz/src/hb-common.cc @@ -160,7 +160,7 @@ hb_tag_to_string (hb_tag_t tag, char *buf) /* hb_direction_t */ -const char direction_strings[][4] = { +static const char direction_strings[][4] = { "ltr", "rtl", "ttb", diff --git a/thirdparty/harfbuzz/src/hb-config.hh b/thirdparty/harfbuzz/src/hb-config.hh index 4b46dea938..2578231d23 100644 --- a/thirdparty/harfbuzz/src/hb-config.hh +++ b/thirdparty/harfbuzz/src/hb-config.hh @@ -64,6 +64,7 @@ #define HB_NO_FACE_COLLECT_UNICODES #define HB_NO_GETENV #define HB_NO_HINTING +#define HB_NO_LANGUAGE_LONG #define HB_NO_LANGUAGE_PRIVATE_SUBTAG #define HB_NO_LAYOUT_FEATURE_PARAMS #define HB_NO_LAYOUT_COLLECT_GLYPHS @@ -145,10 +146,10 @@ #endif #ifdef HB_NO_OT_SHAPE_FALLBACK -#define HB_NO_OT_SHAPE_COMPLEX_ARABIC_FALLBACK -#define HB_NO_OT_SHAPE_COMPLEX_HEBREW_FALLBACK -#define HB_NO_OT_SHAPE_COMPLEX_THAI_FALLBACK -#define HB_NO_OT_SHAPE_COMPLEX_VOWEL_CONSTRAINTS +#define HB_NO_OT_SHAPER_ARABIC_FALLBACK +#define HB_NO_OT_SHAPER_HEBREW_FALLBACK +#define HB_NO_OT_SHAPER_THAI_FALLBACK +#define HB_NO_OT_SHAPER_VOWEL_CONSTRAINTS #endif #ifdef NDEBUG @@ -163,5 +164,9 @@ #endif #endif +#ifdef HB_OPTIMIZE_SIZE +#define HB_NO_OT_LAYOUT_LOOKUP_CACHE +#endif + #endif /* HB_CONFIG_HH */ diff --git a/thirdparty/harfbuzz/src/hb-coretext.cc b/thirdparty/harfbuzz/src/hb-coretext.cc index 6ccc1b0a2b..99b33c001e 100644 --- a/thirdparty/harfbuzz/src/hb-coretext.cc +++ b/thirdparty/harfbuzz/src/hb-coretext.cc @@ -332,7 +332,7 @@ _hb_coretext_shaper_font_data_create (hb_font_t *font) return nullptr; } - if (font->coords) + if (font->num_coords) { CFMutableDictionaryRef variations = CFDictionaryCreateMutable (kCFAllocatorDefault, @@ -379,37 +379,6 @@ _hb_coretext_shaper_font_data_destroy (hb_coretext_font_data_t *data) CFRelease ((CTFontRef) data); } -static const hb_coretext_font_data_t * -hb_coretext_font_data_sync (hb_font_t *font) -{ -retry: - const hb_coretext_font_data_t *data = font->data.coretext; - if (unlikely (!data)) return nullptr; - - if (fabs (CTFontGetSize ((CTFontRef) data) - (CGFloat) font->ptem) > (CGFloat) .5) - { - /* XXX-MT-bug - * Note that evaluating condition above can be dangerous if another thread - * got here first and destructed data. That's, as always, bad use pattern. - * If you modify the font (change font size), other threads must not be - * using it at the same time. However, since this check is delayed to - * when one actually tries to shape something, this is a XXX race condition - * (and the only one we have that I know of) right now. Ie. you modify the - * font size in one thread, then (supposedly safely) try to use it from two - * or more threads and BOOM! I'm not sure how to fix this. We want RCU. - */ - - /* Drop and recreate. */ - /* If someone dropped it in the mean time, throw it away and don't touch it. - * Otherwise, destruct it. */ - if (likely (font->data.coretext.cmpexch (const_cast<hb_coretext_font_data_t *> (data), nullptr))) - _hb_coretext_shaper_font_data_destroy (const_cast<hb_coretext_font_data_t *> (data)); - else - goto retry; - } - return font->data.coretext; -} - /** * hb_coretext_font_create: * @ct_font: The CTFontRef to work upon @@ -455,8 +424,8 @@ hb_coretext_font_create (CTFontRef ct_font) CTFontRef hb_coretext_font_get_ct_font (hb_font_t *font) { - const hb_coretext_font_data_t *data = hb_coretext_font_data_sync (font); - return data ? (CTFontRef) data : nullptr; + CTFontRef ct_font = (CTFontRef) (const void *) font->data.coretext; + return ct_font ? (CTFontRef) ct_font : nullptr; } @@ -516,7 +485,7 @@ _hb_coretext_shape (hb_shape_plan_t *shape_plan, { hb_face_t *face = font->face; CGFontRef cg_font = (CGFontRef) (const void *) face->data.coretext; - CTFontRef ct_font = (CTFontRef) hb_coretext_font_data_sync (font); + CTFontRef ct_font = (CTFontRef) (const void *) font->data.coretext; CGFloat ct_font_size = CTFontGetSize (ct_font); CGFloat x_mult = (CGFloat) font->x_scale / ct_font_size; @@ -1106,7 +1075,8 @@ resize_and_retry: advance = positions[j + 1].x - positions[j].x; else /* last glyph */ advance = run_advance - (positions[j].x - positions[0].x); - info->mask = round (advance * x_mult); + /* int cast necessary to pass through negative values. */ + info->mask = (int) round (advance * x_mult); info->var1.i32 = x_offset; info->var2.i32 = round (positions[j].y * y_mult); info++; @@ -1122,7 +1092,8 @@ resize_and_retry: advance = positions[j + 1].y - positions[j].y; else /* last glyph */ advance = run_advance - (positions[j].y - positions[0].y); - info->mask = round (advance * y_mult); + /* int cast necessary to pass through negative values. */ + info->mask = (int) round (advance * y_mult); info->var1.i32 = round (positions[j].x * x_mult); info->var2.i32 = y_offset; info++; @@ -1151,7 +1122,7 @@ resize_and_retry: pos->x_offset = info->var1.i32; pos->y_offset = info->var2.i32; - info++, pos++; + info++; pos++; } else for (unsigned int i = 0; i < count; i++) @@ -1160,7 +1131,7 @@ resize_and_retry: pos->x_offset = info->var1.i32; pos->y_offset = info->var2.i32; - info++, pos++; + info++; pos++; } /* Fix up clusters so that we never return out-of-order indices; @@ -1173,7 +1144,8 @@ resize_and_retry: * This does *not* mean we'll form the same clusters as Uniscribe * or the native OT backend, only that the cluster indices will be * monotonic in the output buffer. */ - if (count > 1 && (status_or & kCTRunStatusNonMonotonic)) + if (count > 1 && (status_or & kCTRunStatusNonMonotonic) && + buffer->cluster_level != HB_BUFFER_CLUSTER_LEVEL_CHARACTERS) { hb_glyph_info_t *info = buffer->info; if (HB_DIRECTION_IS_FORWARD (buffer->props.direction)) @@ -1197,6 +1169,10 @@ resize_and_retry: } } + /* TODO: Sometimes the above positioning code generates negative + * advance values. Fix them up. Example, with NotoNastaliqUrdu + * font and sequence ابهد. */ + buffer->clear_glyph_flags (); buffer->unsafe_to_break (); diff --git a/thirdparty/harfbuzz/src/hb-cplusplus.hh b/thirdparty/harfbuzz/src/hb-cplusplus.hh new file mode 100644 index 0000000000..86d0452080 --- /dev/null +++ b/thirdparty/harfbuzz/src/hb-cplusplus.hh @@ -0,0 +1,192 @@ +/* + * Copyright © 2022 Behdad Esfahbod + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + */ + +#ifndef HB_CPLUSPLUS_HH +#define HB_CPLUSPLUS_HH + +#include "hb.h" + +HB_BEGIN_DECLS +HB_END_DECLS + +#ifdef __cplusplus + +#include <functional> +#include <utility> + +#if 0 +#if !(__cplusplus >= 201103L) +#error "HarfBuzz C++ helpers require C++11" +#endif +#endif + +namespace hb { + + +template <typename T> +struct vtable; + +template <typename T> +struct shared_ptr +{ + using element_type = T; + + using v = vtable<T>; + + explicit shared_ptr (T *p = nullptr) : p (p) {} + shared_ptr (const shared_ptr &o) : p (v::reference (o.p)) {} + shared_ptr (shared_ptr &&o) : p (o.p) { o.p = nullptr; } + shared_ptr& operator = (const shared_ptr &o) { if (p != o.p) { destroy (); p = o.p; reference (); } return *this; } + shared_ptr& operator = (shared_ptr &&o) { v::destroy (p); p = o.p; o.p = nullptr; return *this; } + ~shared_ptr () { v::destroy (p); p = nullptr; } + + T* get() const { return p; } + + void swap (shared_ptr &o) { std::swap (p, o.p); } + friend void swap (shared_ptr &a, shared_ptr &b) { std::swap (a.p, b.p); } + + operator T * () const { return p; } + T& operator * () const { return *get (); } + T* operator -> () const { return get (); } + operator bool () { return p; } + bool operator == (const shared_ptr &o) { return p == o.p; } + bool operator != (const shared_ptr &o) { return p != o.p; } + + static T* get_empty() { return v::get_empty (); } + T* reference() { return v::reference (p); } + void destroy() { v::destroy (p); } + void set_user_data (hb_user_data_key_t *key, + void *value, + hb_destroy_func_t destroy, + hb_bool_t replace) { v::set_user_data (p, key, value, destroy, replace); } + void * get_user_data (hb_user_data_key_t *key) { return v::get_user_data (p, key); } + + private: + T *p; +}; + +template<typename T> struct is_shared_ptr : std::false_type {}; +template<typename T> struct is_shared_ptr<shared_ptr<T>> : std::true_type {}; + +template <typename T> +struct unique_ptr +{ + using element_type = T; + + using v = vtable<T>; + + explicit unique_ptr (T *p = nullptr) : p (p) {} + unique_ptr (const unique_ptr &o) = delete; + unique_ptr (unique_ptr &&o) : p (o.p) { o.p = nullptr; } + unique_ptr& operator = (const unique_ptr &o) = delete; + unique_ptr& operator = (unique_ptr &&o) { v::destroy (p); p = o.p; o.p = nullptr; return *this; } + ~unique_ptr () { v::destroy (p); p = nullptr; } + + T* get() const { return p; } + T* release () { T* v = p; p = nullptr; return v; } + + void swap (unique_ptr &o) { std::swap (p, o.p); } + friend void swap (unique_ptr &a, unique_ptr &b) { std::swap (a.p, b.p); } + + operator T * () const { return p; } + T& operator * () const { return *get (); } + T* operator -> () const { return get (); } + operator bool () { return p; } + + private: + T *p; +}; + +template<typename T> struct is_unique_ptr : std::false_type {}; +template<typename T> struct is_unique_ptr<unique_ptr<T>> : std::true_type {}; + +template <typename T, + T * (*_get_empty) (void), + T * (*_reference) (T *), + void (*_destroy) (T *), + hb_bool_t (*_set_user_data) (T *, + hb_user_data_key_t *, + void *, + hb_destroy_func_t, + hb_bool_t), + void * (*_get_user_data) (T *, + hb_user_data_key_t *)> +struct vtable_t +{ + static constexpr auto get_empty = _get_empty; + static constexpr auto reference = _reference; + static constexpr auto destroy = _destroy; + static constexpr auto set_user_data = _set_user_data; + static constexpr auto get_user_data = _get_user_data; +}; + +#define HB_DEFINE_VTABLE(name) \ + template<> \ + struct vtable<hb_##name##_t> \ + : vtable_t<hb_##name##_t, \ + &hb_##name##_get_empty, \ + &hb_##name##_reference, \ + &hb_##name##_destroy, \ + &hb_##name##_set_user_data, \ + &hb_##name##_get_user_data> {} + +HB_DEFINE_VTABLE (buffer); +HB_DEFINE_VTABLE (blob); +HB_DEFINE_VTABLE (face); +HB_DEFINE_VTABLE (font); +HB_DEFINE_VTABLE (font_funcs); +HB_DEFINE_VTABLE (map); +HB_DEFINE_VTABLE (set); +HB_DEFINE_VTABLE (shape_plan); +HB_DEFINE_VTABLE (unicode_funcs); + +#undef HB_DEFINE_VTABLE + + +} // namespace hb + +template<typename T> +struct std::hash<hb::shared_ptr<T>> +{ + std::size_t operator()(const hb::shared_ptr<T>& v) const noexcept + { + std::size_t h = std::hash<decltype (v.get ())>{}(v.get ()); + return h; + } +}; + +template<typename T> +struct std::hash<hb::unique_ptr<T>> +{ + std::size_t operator()(const hb::unique_ptr<T>& v) const noexcept + { + std::size_t h = std::hash<decltype (v.get ())>{}(v.get ()); + return h; + } +}; + + +#endif /* __cplusplus */ + +#endif /* HB_CPLUSPLUS_HH */ diff --git a/thirdparty/harfbuzz/src/hb-directwrite.cc b/thirdparty/harfbuzz/src/hb-directwrite.cc index f177ff31c0..ce04f5bab1 100644 --- a/thirdparty/harfbuzz/src/hb-directwrite.cc +++ b/thirdparty/harfbuzz/src/hb-directwrite.cc @@ -241,17 +241,12 @@ struct hb_directwrite_font_data_t {}; hb_directwrite_font_data_t * _hb_directwrite_shaper_font_data_create (hb_font_t *font) { - hb_directwrite_font_data_t *data = new hb_directwrite_font_data_t; - if (unlikely (!data)) - return nullptr; - - return data; + return (hb_directwrite_font_data_t *) HB_SHAPER_DATA_SUCCEEDED; } void _hb_directwrite_shaper_font_data_destroy (hb_directwrite_font_data_t *data) { - delete data; } diff --git a/thirdparty/harfbuzz/src/hb-draw.cc b/thirdparty/harfbuzz/src/hb-draw.cc index b31019b07e..fdc71102d6 100644 --- a/thirdparty/harfbuzz/src/hb-draw.cc +++ b/thirdparty/harfbuzz/src/hb-draw.cc @@ -56,12 +56,14 @@ hb_draw_quadratic_to_nil (hb_draw_funcs_t *dfuncs, void *draw_data, float to_x, float to_y, void *user_data HB_UNUSED) { +#define HB_ONE_THIRD 0.33333333f dfuncs->emit_cubic_to (draw_data, *st, - (st->current_x + 2.f * control_x) / 3.f, - (st->current_y + 2.f * control_y) / 3.f, - (to_x + 2.f * control_x) / 3.f, - (to_y + 2.f * control_y) / 3.f, + (st->current_x + 2.f * control_x) * HB_ONE_THIRD, + (st->current_y + 2.f * control_y) * HB_ONE_THIRD, + (to_x + 2.f * control_x) * HB_ONE_THIRD, + (to_y + 2.f * control_y) * HB_ONE_THIRD, to_x, to_y); +#undef HB_ONE_THIRD } static void @@ -89,25 +91,46 @@ hb_draw_funcs_set_##name##_func (hb_draw_funcs_t *dfuncs, \ if (hb_object_is_immutable (dfuncs)) \ return; \ \ - if (dfuncs->destroy.name) \ - dfuncs->destroy.name (dfuncs->user_data.name); \ - \ - if (func) { \ - dfuncs->func.name = func; \ - dfuncs->user_data.name = user_data; \ - dfuncs->destroy.name = destroy; \ - } else { \ - dfuncs->func.name = hb_draw_##name##_nil; \ - dfuncs->user_data.name = nullptr; \ - dfuncs->destroy.name = nullptr; \ - } \ + if (dfuncs->destroy && dfuncs->destroy->name) \ + dfuncs->destroy->name (!dfuncs->user_data ? nullptr : dfuncs->user_data->name); \ + \ + if (user_data && !dfuncs->user_data) \ + { \ + dfuncs->user_data = (decltype (dfuncs->user_data)) hb_calloc (1, sizeof (*dfuncs->user_data)); \ + if (unlikely (!dfuncs->user_data)) \ + goto fail; \ + } \ + if (destroy && !dfuncs->destroy) \ + { \ + dfuncs->destroy = (decltype (dfuncs->destroy)) hb_calloc (1, sizeof (*dfuncs->destroy)); \ + if (unlikely (!dfuncs->destroy)) \ + goto fail; \ + } \ + \ + if (func) { \ + dfuncs->func.name = func; \ + if (dfuncs->user_data) \ + dfuncs->user_data->name = user_data; \ + if (dfuncs->destroy) \ + dfuncs->destroy->name = destroy; \ + } else { \ + dfuncs->func.name = hb_draw_##name##_nil; \ + if (dfuncs->user_data) \ + dfuncs->user_data->name = nullptr; \ + if (dfuncs->destroy) \ + dfuncs->destroy->name = nullptr; \ + } \ + \ +fail: \ + if (destroy) \ + destroy (user_data); \ } HB_DRAW_FUNCS_IMPLEMENT_CALLBACKS #undef HB_DRAW_FUNC_IMPLEMENT /** - * hb_draw_funcs_create: (Xconstructor) + * hb_draw_funcs_create: * * Creates a new draw callbacks object. * @@ -177,11 +200,13 @@ hb_draw_funcs_destroy (hb_draw_funcs_t *dfuncs) { if (!hb_object_destroy (dfuncs)) return; + if (dfuncs->destroy) + { #define HB_DRAW_FUNC_IMPLEMENT(name) \ - if (dfuncs->destroy.name) dfuncs->destroy.name (dfuncs->user_data.name); - HB_DRAW_FUNCS_IMPLEMENT_CALLBACKS + if (dfuncs->destroy->name) dfuncs->destroy->name (!dfuncs->user_data ? nullptr : dfuncs->user_data->name); + HB_DRAW_FUNCS_IMPLEMENT_CALLBACKS #undef HB_DRAW_FUNC_IMPLEMENT - + } hb_free (dfuncs); } diff --git a/thirdparty/harfbuzz/src/hb-draw.hh b/thirdparty/harfbuzz/src/hb-draw.hh index 28bc9218e1..768f51a875 100644 --- a/thirdparty/harfbuzz/src/hb-draw.hh +++ b/thirdparty/harfbuzz/src/hb-draw.hh @@ -54,31 +54,31 @@ struct hb_draw_funcs_t #define HB_DRAW_FUNC_IMPLEMENT(name) void *name; HB_DRAW_FUNCS_IMPLEMENT_CALLBACKS #undef HB_DRAW_FUNC_IMPLEMENT - } user_data; + } *user_data; struct { #define HB_DRAW_FUNC_IMPLEMENT(name) hb_destroy_func_t name; HB_DRAW_FUNCS_IMPLEMENT_CALLBACKS #undef HB_DRAW_FUNC_IMPLEMENT - } destroy; + } *destroy; void emit_move_to (void *draw_data, hb_draw_state_t &st, float to_x, float to_y) { func.move_to (this, draw_data, &st, to_x, to_y, - user_data.move_to); } + !user_data ? nullptr : user_data->move_to); } void emit_line_to (void *draw_data, hb_draw_state_t &st, float to_x, float to_y) { func.line_to (this, draw_data, &st, to_x, to_y, - user_data.line_to); } + !user_data ? nullptr : user_data->line_to); } void emit_quadratic_to (void *draw_data, hb_draw_state_t &st, float control_x, float control_y, float to_x, float to_y) { func.quadratic_to (this, draw_data, &st, control_x, control_y, to_x, to_y, - user_data.quadratic_to); } + !user_data ? nullptr : user_data->quadratic_to); } void emit_cubic_to (void *draw_data, hb_draw_state_t &st, float control1_x, float control1_y, float control2_x, float control2_y, @@ -87,10 +87,10 @@ struct hb_draw_funcs_t control1_x, control1_y, control2_x, control2_y, to_x, to_y, - user_data.cubic_to); } + !user_data ? nullptr : user_data->cubic_to); } void emit_close_path (void *draw_data, hb_draw_state_t &st) { func.close_path (this, draw_data, &st, - user_data.close_path); } + !user_data ? nullptr : user_data->close_path); } void move_to (void *draw_data, hb_draw_state_t &st, diff --git a/thirdparty/harfbuzz/src/hb-face.cc b/thirdparty/harfbuzz/src/hb-face.cc index 5365598636..7cdd6cb49f 100644 --- a/thirdparty/harfbuzz/src/hb-face.cc +++ b/thirdparty/harfbuzz/src/hb-face.cc @@ -190,7 +190,7 @@ _hb_face_for_data_reference_table (hb_face_t *face HB_UNUSED, hb_tag_t tag, void } /** - * hb_face_create: (Xconstructor) + * hb_face_create: * @blob: #hb_blob_t to work upon * @index: The index of the face within @blob * @@ -342,7 +342,7 @@ hb_face_set_user_data (hb_face_t *face, * Since: 0.9.2 **/ void * -hb_face_get_user_data (const hb_face_t *face, +hb_face_get_user_data (hb_face_t *face, hb_user_data_key_t *key) { return hb_object_get_user_data (face, key); diff --git a/thirdparty/harfbuzz/src/hb-face.h b/thirdparty/harfbuzz/src/hb-face.h index 6ef2f8b886..3b7477a76c 100644 --- a/thirdparty/harfbuzz/src/hb-face.h +++ b/thirdparty/harfbuzz/src/hb-face.h @@ -96,7 +96,7 @@ hb_face_set_user_data (hb_face_t *face, hb_bool_t replace); HB_EXTERN void * -hb_face_get_user_data (const hb_face_t *face, +hb_face_get_user_data (hb_face_t *face, hb_user_data_key_t *key); HB_EXTERN void diff --git a/thirdparty/harfbuzz/src/hb-font.cc b/thirdparty/harfbuzz/src/hb-font.cc index 5700e06271..8c4fe863b6 100644 --- a/thirdparty/harfbuzz/src/hb-font.cc +++ b/thirdparty/harfbuzz/src/hb-font.cc @@ -636,16 +636,8 @@ DEFINE_NULL_INSTANCE (hb_font_funcs_t) = { HB_OBJECT_HEADER_STATIC, - { -#define HB_FONT_FUNC_IMPLEMENT(name) nullptr, - HB_FONT_FUNCS_IMPLEMENT_CALLBACKS -#undef HB_FONT_FUNC_IMPLEMENT - }, - { -#define HB_FONT_FUNC_IMPLEMENT(name) nullptr, - HB_FONT_FUNCS_IMPLEMENT_CALLBACKS -#undef HB_FONT_FUNC_IMPLEMENT - }, + nullptr, + nullptr, { { #define HB_FONT_FUNC_IMPLEMENT(name) hb_font_get_##name##_nil, @@ -658,16 +650,8 @@ DEFINE_NULL_INSTANCE (hb_font_funcs_t) = static const hb_font_funcs_t _hb_font_funcs_default = { HB_OBJECT_HEADER_STATIC, - { -#define HB_FONT_FUNC_IMPLEMENT(name) nullptr, - HB_FONT_FUNCS_IMPLEMENT_CALLBACKS -#undef HB_FONT_FUNC_IMPLEMENT - }, - { -#define HB_FONT_FUNC_IMPLEMENT(name) nullptr, - HB_FONT_FUNCS_IMPLEMENT_CALLBACKS -#undef HB_FONT_FUNC_IMPLEMENT - }, + nullptr, + nullptr, { { #define HB_FONT_FUNC_IMPLEMENT(name) hb_font_get_##name##_default, @@ -679,7 +663,7 @@ static const hb_font_funcs_t _hb_font_funcs_default = { /** - * hb_font_funcs_create: (Xconstructor) + * hb_font_funcs_create: * * Creates a new #hb_font_funcs_t structure of font functions. * @@ -746,10 +730,16 @@ hb_font_funcs_destroy (hb_font_funcs_t *ffuncs) { if (!hb_object_destroy (ffuncs)) return; -#define HB_FONT_FUNC_IMPLEMENT(name) if (ffuncs->destroy.name) \ - ffuncs->destroy.name (ffuncs->user_data.name); - HB_FONT_FUNCS_IMPLEMENT_CALLBACKS + if (ffuncs->destroy) + { +#define HB_FONT_FUNC_IMPLEMENT(name) if (ffuncs->destroy->name) \ + ffuncs->destroy->name (!ffuncs->user_data ? nullptr : ffuncs->user_data->name); + HB_FONT_FUNCS_IMPLEMENT_CALLBACKS #undef HB_FONT_FUNC_IMPLEMENT + } + + hb_free (ffuncs->destroy); + hb_free (ffuncs->user_data); hb_free (ffuncs); } @@ -841,24 +831,50 @@ hb_font_funcs_set_##name##_func (hb_font_funcs_t *ffuncs, \ hb_destroy_func_t destroy) \ { \ if (hb_object_is_immutable (ffuncs)) \ + goto fail; \ + \ + if (!func) \ { \ if (destroy) \ destroy (user_data); \ - return; \ + destroy = nullptr; \ + user_data = nullptr; \ } \ \ - if (ffuncs->destroy.name) \ - ffuncs->destroy.name (ffuncs->user_data.name); \ + if (ffuncs->destroy && ffuncs->destroy->name) \ + ffuncs->destroy->name (!ffuncs->user_data ? nullptr : ffuncs->user_data->name); \ + \ + if (user_data && !ffuncs->user_data) \ + { \ + ffuncs->user_data = (decltype (ffuncs->user_data)) hb_calloc (1, sizeof (*ffuncs->user_data)); \ + if (unlikely (!ffuncs->user_data)) \ + goto fail; \ + } \ + if (destroy && !ffuncs->destroy) \ + { \ + ffuncs->destroy = (decltype (ffuncs->destroy)) hb_calloc (1, sizeof (*ffuncs->destroy)); \ + if (unlikely (!ffuncs->destroy)) \ + goto fail; \ + } \ \ if (func) { \ ffuncs->get.f.name = func; \ - ffuncs->user_data.name = user_data; \ - ffuncs->destroy.name = destroy; \ + if (ffuncs->user_data) \ + ffuncs->user_data->name = user_data; \ + if (ffuncs->destroy) \ + ffuncs->destroy->name = destroy; \ } else { \ ffuncs->get.f.name = hb_font_get_##name##_default; \ - ffuncs->user_data.name = nullptr; \ - ffuncs->destroy.name = nullptr; \ + if (ffuncs->user_data) \ + ffuncs->user_data->name = nullptr; \ + if (ffuncs->destroy) \ + ffuncs->destroy->name = nullptr; \ } \ + return; \ + \ +fail: \ + if (destroy) \ + destroy (user_data); \ } HB_FONT_FUNCS_IMPLEMENT_CALLBACKS @@ -1623,6 +1639,9 @@ DEFINE_NULL_INSTANCE (hb_font_t) = { HB_OBJECT_HEADER_STATIC, + 0, /* serial */ + 0, /* serial_coords */ + nullptr, /* parent */ const_cast<hb_face_t *> (&_hb_Null_hb_face_t), @@ -1630,6 +1649,8 @@ DEFINE_NULL_INSTANCE (hb_font_t) = 1000, /* y_scale */ 0., /* slant */ 0., /* slant_xy; */ + 1.f, /* x_multf */ + 1.f, /* y_multf */ 1<<16, /* x_mult */ 1<<16, /* y_mult */ @@ -1662,14 +1683,15 @@ _hb_font_create (hb_face_t *face) font->face = hb_face_reference (face); font->klass = hb_font_funcs_get_empty (); font->data.init0 (font); - font->x_scale = font->y_scale = hb_face_get_upem (face); + font->x_scale = font->y_scale = face->get_upem (); + font->x_multf = font->y_multf = 1.f; font->x_mult = font->y_mult = 1 << 16; return font; } /** - * hb_font_create: (Xconstructor) + * hb_font_create: * @face: a face. * * Constructs a new font object from the specified face. @@ -1715,6 +1737,8 @@ _hb_font_adopt_var_coords (hb_font_t *font, font->coords = coords; font->design_coords = design_coords; font->num_coords = coords_length; + + font->mults_changed (); // Easiest to call this to drop cached data } /** @@ -1744,7 +1768,6 @@ hb_font_create_sub_font (hb_font_t *parent) font->x_scale = parent->x_scale; font->y_scale = parent->y_scale; font->slant = parent->slant; - font->mults_changed (); font->x_ppem = parent->x_ppem; font->y_ppem = parent->y_ppem; font->ptem = parent->ptem; @@ -1767,6 +1790,8 @@ hb_font_create_sub_font (hb_font_t *parent) } } + font->mults_changed (); + return font; } @@ -1852,6 +1877,9 @@ hb_font_set_user_data (hb_font_t *font, hb_destroy_func_t destroy /* May be NULL. */, hb_bool_t replace) { + if (!hb_object_is_immutable (font)) + font->serial++; + return hb_object_set_user_data (font, key, data, destroy, replace); } @@ -1911,6 +1939,45 @@ hb_font_is_immutable (hb_font_t *font) } /** + * hb_font_get_serial: + * @font: #hb_font_t to work upon + * + * Returns the internal serial number of the font. The serial + * number is increased every time a setting on the font is + * changed, using a setter function. + * + * Return value: serial number + * + * Since: 4.4.0. + **/ +unsigned int +hb_font_get_serial (hb_font_t *font) +{ + return font->serial; +} + +/** + * hb_font_changed: + * @font: #hb_font_t to work upon + * + * Notifies the @font that underlying font data has changed. + * This has the effect of increasing the serial as returned + * by hb_font_get_serial(), which invalidates internal caches. + * + * Since: 4.4.0. + **/ +void +hb_font_changed (hb_font_t *font) +{ + if (hb_object_is_immutable (font)) + return; + + font->serial++; + + font->mults_changed (); +} + +/** * hb_font_set_parent: * @font: #hb_font_t to work upon * @parent: The parent font object to assign @@ -1926,6 +1993,11 @@ hb_font_set_parent (hb_font_t *font, if (hb_object_is_immutable (font)) return; + if (parent == font->parent) + return; + + font->serial++; + if (!parent) parent = hb_font_get_empty (); @@ -1968,6 +2040,11 @@ hb_font_set_face (hb_font_t *font, if (hb_object_is_immutable (font)) return; + if (face == font->face) + return; + + font->serial++; + if (unlikely (!face)) face = hb_face_get_empty (); @@ -2022,6 +2099,8 @@ hb_font_set_funcs (hb_font_t *font, return; } + font->serial++; + if (font->destroy) font->destroy (font->user_data); @@ -2059,6 +2138,8 @@ hb_font_set_funcs_data (hb_font_t *font, return; } + font->serial++; + if (font->destroy) font->destroy (font->user_data); @@ -2085,6 +2166,11 @@ hb_font_set_scale (hb_font_t *font, if (hb_object_is_immutable (font)) return; + if (font->x_scale == x_scale && font->y_scale == y_scale) + return; + + font->serial++; + font->x_scale = x_scale; font->y_scale = y_scale; font->mults_changed (); @@ -2127,6 +2213,11 @@ hb_font_set_ppem (hb_font_t *font, if (hb_object_is_immutable (font)) return; + if (font->x_ppem == x_ppem && font->y_ppem == y_ppem) + return; + + font->serial++; + font->x_ppem = x_ppem; font->y_ppem = y_ppem; } @@ -2169,6 +2260,11 @@ hb_font_set_ptem (hb_font_t *font, if (hb_object_is_immutable (font)) return; + if (font->ptem == ptem) + return; + + font->serial++; + font->ptem = ptem; } @@ -2216,6 +2312,11 @@ hb_font_set_synthetic_slant (hb_font_t *font, float slant) if (hb_object_is_immutable (font)) return; + if (font->slant == slant) + return; + + font->serial++; + font->slant = slant; font->mults_changed (); } @@ -2263,6 +2364,8 @@ hb_font_set_variations (hb_font_t *font, if (hb_object_is_immutable (font)) return; + font->serial_coords = ++font->serial; + if (!variations_length) { hb_font_set_var_coords_normalized (font, nullptr, 0); @@ -2322,6 +2425,8 @@ hb_font_set_var_coords_design (hb_font_t *font, if (hb_object_is_immutable (font)) return; + font->serial_coords = ++font->serial; + int *normalized = coords_length ? (int *) hb_calloc (coords_length, sizeof (int)) : nullptr; float *design_coords = coords_length ? (float *) hb_calloc (coords_length, sizeof (float)) : nullptr; @@ -2355,6 +2460,8 @@ hb_font_set_var_named_instance (hb_font_t *font, if (hb_object_is_immutable (font)) return; + font->serial_coords = ++font->serial; + unsigned int coords_length = hb_ot_var_named_instance_get_design_coords (font->face, instance_index, nullptr, nullptr); float *coords = coords_length ? (float *) hb_calloc (coords_length, sizeof (float)) : nullptr; @@ -2391,6 +2498,8 @@ hb_font_set_var_coords_normalized (hb_font_t *font, if (hb_object_is_immutable (font)) return; + font->serial_coords = ++font->serial; + int *copy = coords_length ? (int *) hb_calloc (coords_length, sizeof (coords[0])) : nullptr; int *unmapped = coords_length ? (int *) hb_calloc (coords_length, sizeof (coords[0])) : nullptr; float *design_coords = coords_length ? (float *) hb_calloc (coords_length, sizeof (design_coords[0])) : nullptr; diff --git a/thirdparty/harfbuzz/src/hb-font.h b/thirdparty/harfbuzz/src/hb-font.h index 9548857535..ca6ecf7963 100644 --- a/thirdparty/harfbuzz/src/hb-font.h +++ b/thirdparty/harfbuzz/src/hb-font.h @@ -1002,6 +1002,12 @@ hb_font_make_immutable (hb_font_t *font); HB_EXTERN hb_bool_t hb_font_is_immutable (hb_font_t *font); +HB_EXTERN unsigned int +hb_font_get_serial (hb_font_t *font); + +HB_EXTERN void +hb_font_changed (hb_font_t *font); + HB_EXTERN void hb_font_set_parent (hb_font_t *font, hb_font_t *parent); diff --git a/thirdparty/harfbuzz/src/hb-font.hh b/thirdparty/harfbuzz/src/hb-font.hh index 70311b4a85..bb402e23eb 100644 --- a/thirdparty/harfbuzz/src/hb-font.hh +++ b/thirdparty/harfbuzz/src/hb-font.hh @@ -68,13 +68,13 @@ struct hb_font_funcs_t #define HB_FONT_FUNC_IMPLEMENT(name) void *name; HB_FONT_FUNCS_IMPLEMENT_CALLBACKS #undef HB_FONT_FUNC_IMPLEMENT - } user_data; + } *user_data; struct { #define HB_FONT_FUNC_IMPLEMENT(name) hb_destroy_func_t name; HB_FONT_FUNCS_IMPLEMENT_CALLBACKS #undef HB_FONT_FUNC_IMPLEMENT - } destroy; + } *destroy; /* Don't access these directly. Call font->get_*() instead. */ union get_t { @@ -104,6 +104,8 @@ DECLARE_NULL_INSTANCE (hb_font_funcs_t); struct hb_font_t { hb_object_header_t header; + unsigned int serial; + unsigned int serial_coords; hb_font_t *parent; hb_face_t *face; @@ -112,6 +114,8 @@ struct hb_font_t int32_t y_scale; float slant; float slant_xy; + float x_multf; + float y_multf; int64_t x_mult; int64_t y_mult; @@ -137,12 +141,12 @@ struct hb_font_t { return HB_DIRECTION_IS_VERTICAL(direction) ? y_mult : x_mult; } hb_position_t em_scale_x (int16_t v) { return em_mult (v, x_mult); } hb_position_t em_scale_y (int16_t v) { return em_mult (v, y_mult); } - hb_position_t em_scalef_x (float v) { return em_scalef (v, x_scale); } - hb_position_t em_scalef_y (float v) { return em_scalef (v, y_scale); } - float em_fscale_x (int16_t v) { return em_fscale (v, x_scale); } - float em_fscale_y (int16_t v) { return em_fscale (v, y_scale); } - float em_fscalef_x (float v) { return em_fscalef (v, x_scale); } - float em_fscalef_y (float v) { return em_fscalef (v, y_scale); } + hb_position_t em_scalef_x (float v) { return em_multf (v, x_multf); } + hb_position_t em_scalef_y (float v) { return em_multf (v, y_multf); } + float em_fscale_x (int16_t v) { return em_fmult (v, x_multf); } + float em_fscale_y (int16_t v) { return em_fmult (v, y_multf); } + float em_fscalef_x (float v) { return em_fmultf (v, x_multf); } + float em_fscalef_y (float v) { return em_fmultf (v, y_multf); } hb_position_t em_scale_dir (int16_t v, hb_direction_t direction) { return em_mult (v, dir_mult (direction)); } @@ -205,14 +209,14 @@ struct hb_font_t memset (extents, 0, sizeof (*extents)); return klass->get.f.font_h_extents (this, user_data, extents, - klass->user_data.font_h_extents); + !klass->user_data ? nullptr : klass->user_data->font_h_extents); } hb_bool_t get_font_v_extents (hb_font_extents_t *extents) { memset (extents, 0, sizeof (*extents)); return klass->get.f.font_v_extents (this, user_data, extents, - klass->user_data.font_v_extents); + !klass->user_data ? nullptr : klass->user_data->font_v_extents); } bool has_glyph (hb_codepoint_t unicode) @@ -228,7 +232,7 @@ struct hb_font_t *glyph = not_found; return klass->get.f.nominal_glyph (this, user_data, unicode, glyph, - klass->user_data.nominal_glyph); + !klass->user_data ? nullptr : klass->user_data->nominal_glyph); } unsigned int get_nominal_glyphs (unsigned int count, const hb_codepoint_t *first_unicode, @@ -240,7 +244,7 @@ struct hb_font_t count, first_unicode, unicode_stride, first_glyph, glyph_stride, - klass->user_data.nominal_glyphs); + !klass->user_data ? nullptr : klass->user_data->nominal_glyphs); } hb_bool_t get_variation_glyph (hb_codepoint_t unicode, hb_codepoint_t variation_selector, @@ -250,21 +254,21 @@ struct hb_font_t *glyph = not_found; return klass->get.f.variation_glyph (this, user_data, unicode, variation_selector, glyph, - klass->user_data.variation_glyph); + !klass->user_data ? nullptr : klass->user_data->variation_glyph); } hb_position_t get_glyph_h_advance (hb_codepoint_t glyph) { return klass->get.f.glyph_h_advance (this, user_data, glyph, - klass->user_data.glyph_h_advance); + !klass->user_data ? nullptr : klass->user_data->glyph_h_advance); } hb_position_t get_glyph_v_advance (hb_codepoint_t glyph) { return klass->get.f.glyph_v_advance (this, user_data, glyph, - klass->user_data.glyph_v_advance); + !klass->user_data ? nullptr : klass->user_data->glyph_v_advance); } void get_glyph_h_advances (unsigned int count, @@ -277,7 +281,7 @@ struct hb_font_t count, first_glyph, glyph_stride, first_advance, advance_stride, - klass->user_data.glyph_h_advances); + !klass->user_data ? nullptr : klass->user_data->glyph_h_advances); } void get_glyph_v_advances (unsigned int count, @@ -290,7 +294,7 @@ struct hb_font_t count, first_glyph, glyph_stride, first_advance, advance_stride, - klass->user_data.glyph_v_advances); + !klass->user_data ? nullptr : klass->user_data->glyph_v_advances); } hb_bool_t get_glyph_h_origin (hb_codepoint_t glyph, @@ -299,7 +303,7 @@ struct hb_font_t *x = *y = 0; return klass->get.f.glyph_h_origin (this, user_data, glyph, x, y, - klass->user_data.glyph_h_origin); + !klass->user_data ? nullptr : klass->user_data->glyph_h_origin); } hb_bool_t get_glyph_v_origin (hb_codepoint_t glyph, @@ -308,7 +312,7 @@ struct hb_font_t *x = *y = 0; return klass->get.f.glyph_v_origin (this, user_data, glyph, x, y, - klass->user_data.glyph_v_origin); + !klass->user_data ? nullptr : klass->user_data->glyph_v_origin); } hb_position_t get_glyph_h_kerning (hb_codepoint_t left_glyph, @@ -319,7 +323,7 @@ struct hb_font_t #else return klass->get.f.glyph_h_kerning (this, user_data, left_glyph, right_glyph, - klass->user_data.glyph_h_kerning); + !klass->user_data ? nullptr : klass->user_data->glyph_h_kerning); #endif } @@ -331,7 +335,7 @@ struct hb_font_t #else return klass->get.f.glyph_v_kerning (this, user_data, top_glyph, bottom_glyph, - klass->user_data.glyph_v_kerning); + !klass->user_data ? nullptr : klass->user_data->glyph_v_kerning); #endif } @@ -342,7 +346,7 @@ struct hb_font_t return klass->get.f.glyph_extents (this, user_data, glyph, extents, - klass->user_data.glyph_extents); + !klass->user_data ? nullptr : klass->user_data->glyph_extents); } hb_bool_t get_glyph_contour_point (hb_codepoint_t glyph, unsigned int point_index, @@ -352,7 +356,7 @@ struct hb_font_t return klass->get.f.glyph_contour_point (this, user_data, glyph, point_index, x, y, - klass->user_data.glyph_contour_point); + !klass->user_data ? nullptr : klass->user_data->glyph_contour_point); } hb_bool_t get_glyph_name (hb_codepoint_t glyph, @@ -362,7 +366,7 @@ struct hb_font_t return klass->get.f.glyph_name (this, user_data, glyph, name, size, - klass->user_data.glyph_name); + !klass->user_data ? nullptr : klass->user_data->glyph_name); } hb_bool_t get_glyph_from_name (const char *name, int len, /* -1 means nul-terminated */ @@ -373,7 +377,7 @@ struct hb_font_t return klass->get.f.glyph_from_name (this, user_data, name, len, glyph, - klass->user_data.glyph_from_name); + !klass->user_data ? nullptr : klass->user_data->glyph_from_name); } void get_glyph_shape (hb_codepoint_t glyph, @@ -382,7 +386,7 @@ struct hb_font_t klass->get.f.glyph_shape (this, user_data, glyph, draw_funcs, draw_data, - klass->user_data.glyph_shape); + !klass->user_data ? nullptr : klass->user_data->glyph_shape); } @@ -444,7 +448,6 @@ struct hb_font_t { *x = get_glyph_h_advance (glyph) / 2; - /* TODO cache this somehow?! */ hb_font_extents_t extents; get_h_extents_with_fallback (&extents); *y = extents.ascender; @@ -628,20 +631,26 @@ struct hb_font_t void mults_changed () { - signed upem = face->get_upem (); - x_mult = ((int64_t) x_scale << 16) / upem; - y_mult = ((int64_t) y_scale << 16) / upem; + float upem = face->get_upem (); + x_multf = x_scale / upem; + y_multf = y_scale / upem; + bool x_neg = x_scale < 0; + x_mult = (x_neg ? -((int64_t) -x_scale << 16) : ((int64_t) x_scale << 16)) / upem; + bool y_neg = y_scale < 0; + y_mult = (y_neg ? -((int64_t) -y_scale << 16) : ((int64_t) y_scale << 16)) / upem; slant_xy = y_scale ? slant * x_scale / y_scale : 0.f; + + data.fini (); } hb_position_t em_mult (int16_t v, int64_t mult) { return (hb_position_t) ((v * mult + 32768) >> 16); } - hb_position_t em_scalef (float v, int scale) - { return (hb_position_t) roundf (em_fscalef (v, scale)); } - float em_fscalef (float v, int scale) - { return v * scale / face->get_upem (); } - float em_fscale (int16_t v, int scale) - { return (float) v * scale / face->get_upem (); } + hb_position_t em_multf (float v, float mult) + { return (hb_position_t) roundf (em_fmultf (v, mult)); } + float em_fmultf (float v, float mult) + { return v * mult; } + float em_fmult (int16_t v, float mult) + { return (float) v * mult; } }; DECLARE_NULL_INSTANCE (hb_font_t); diff --git a/thirdparty/harfbuzz/src/hb-ft.cc b/thirdparty/harfbuzz/src/hb-ft.cc index d3c5d3db93..b526a82865 100644 --- a/thirdparty/harfbuzz/src/hb-ft.cc +++ b/thirdparty/harfbuzz/src/hb-ft.cc @@ -37,6 +37,8 @@ #include "hb-font.hh" #include "hb-machinery.hh" #include "hb-cache.hh" +#include "hb-ot-os2-table.hh" +#include "hb-ot-shaper-arabic-pua.hh" #include FT_ADVANCES_H #include FT_MULTIPLE_MASTERS_H @@ -86,7 +88,7 @@ struct hb_ft_font_t mutable hb_mutex_t lock; FT_Face ft_face; - mutable int cached_x_scale; + mutable unsigned cached_serial; mutable hb_advance_cache_t advance_cache; }; @@ -103,7 +105,7 @@ _hb_ft_font_create (FT_Face ft_face, bool symbol, bool unref) ft_font->load_flags = FT_LOAD_DEFAULT | FT_LOAD_NO_HINTING; - ft_font->cached_x_scale = 0; + ft_font->cached_serial = (unsigned) -1; ft_font->advance_cache.init (); return ft_font; @@ -130,6 +132,58 @@ _hb_ft_font_destroy (void *data) hb_free (ft_font); } + +/* hb_font changed, update FT_Face. */ +static void _hb_ft_hb_font_changed (hb_font_t *font, FT_Face ft_face) +{ + + FT_Set_Char_Size (ft_face, + abs (font->x_scale), abs (font->y_scale), + 0, 0); +#if 0 + font->x_ppem * 72 * 64 / font->x_scale, + font->y_ppem * 72 * 64 / font->y_scale); +#endif + if (font->x_scale < 0 || font->y_scale < 0) + { + FT_Matrix matrix = { font->x_scale < 0 ? -1 : +1, 0, + 0, font->y_scale < 0 ? -1 : +1}; + FT_Set_Transform (ft_face, &matrix, nullptr); + } + +#if defined(HAVE_FT_GET_VAR_BLEND_COORDINATES) && !defined(HB_NO_VAR) + unsigned int num_coords; + const int *coords = hb_font_get_var_coords_normalized (font, &num_coords); + if (num_coords) + { + FT_Fixed *ft_coords = (FT_Fixed *) hb_calloc (num_coords, sizeof (FT_Fixed)); + if (ft_coords) + { + for (unsigned int i = 0; i < num_coords; i++) + ft_coords[i] = coords[i] * 4; + FT_Set_Var_Blend_Coordinates (ft_face, num_coords, ft_coords); + hb_free (ft_coords); + } + } +#endif +} + +/* Check if hb_font changed, update FT_Face. */ +static inline bool +_hb_ft_hb_font_check_changed (hb_font_t *font, + const hb_ft_font_t *ft_font) +{ + if (font->serial != ft_font->cached_serial) + { + _hb_ft_hb_font_changed (font, ft_font->ft_face); + ft_font->advance_cache.clear (); + ft_font->cached_serial = font->serial; + return true; + } + return false; +} + + /** * hb_ft_font_set_load_flags: * @font: #hb_font_t to work upon @@ -181,7 +235,7 @@ hb_ft_font_get_load_flags (hb_font_t *font) } /** - * hb_ft_font_get_face: + * hb_ft_font_get_face: (skip) * @font: #hb_font_t to work upon * * Fetches the FT_Face associated with the specified #hb_font_t @@ -203,7 +257,7 @@ hb_ft_font_get_face (hb_font_t *font) } /** - * hb_ft_font_lock_face: + * hb_ft_font_lock_face: (skip) * @font: #hb_font_t to work upon * * Gets the FT_Face associated with @font, This face will be kept around until @@ -246,7 +300,7 @@ hb_ft_font_unlock_face (hb_font_t *font) static hb_bool_t -hb_ft_get_nominal_glyph (hb_font_t *font HB_UNUSED, +hb_ft_get_nominal_glyph (hb_font_t *font, void *font_data, hb_codepoint_t unicode, hb_codepoint_t *glyph, @@ -258,14 +312,29 @@ hb_ft_get_nominal_glyph (hb_font_t *font HB_UNUSED, if (unlikely (!g)) { - if (unlikely (ft_font->symbol) && unicode <= 0x00FFu) + if (unlikely (ft_font->symbol)) { - /* For symbol-encoded OpenType fonts, we duplicate the - * U+F000..F0FF range at U+0000..U+00FF. That's what - * Windows seems to do, and that's hinted about at: - * https://docs.microsoft.com/en-us/typography/opentype/spec/recom - * under "Non-Standard (Symbol) Fonts". */ - g = FT_Get_Char_Index (ft_font->ft_face, 0xF000u + unicode); + switch ((unsigned) font->face->table.OS2->get_font_page ()) { + case OT::OS2::font_page_t::FONT_PAGE_NONE: + if (unicode <= 0x00FFu) + /* For symbol-encoded OpenType fonts, we duplicate the + * U+F000..F0FF range at U+0000..U+00FF. That's what + * Windows seems to do, and that's hinted about at: + * https://docs.microsoft.com/en-us/typography/opentype/spec/recom + * under "Non-Standard (Symbol) Fonts". */ + g = FT_Get_Char_Index (ft_font->ft_face, 0xF000u + unicode); + break; +#ifndef HB_NO_OT_SHAPER_ARABIC_FALLBACK + case OT::OS2::font_page_t::FONT_PAGE_SIMP_ARABIC: + g = FT_Get_Char_Index (ft_font->ft_face, _hb_arabic_pua_simp_map (unicode)); + break; + case OT::OS2::font_page_t::FONT_PAGE_TRAD_ARABIC: + g = FT_Get_Char_Index (ft_font->ft_face, _hb_arabic_pua_trad_map (unicode)); + break; +#endif + default: + break; + } if (!g) return false; } @@ -337,12 +406,6 @@ hb_ft_get_glyph_h_advances (hb_font_t* font, void* font_data, int load_flags = ft_font->load_flags; int mult = font->x_scale < 0 ? -1 : +1; - if (font->x_scale != ft_font->cached_x_scale) - { - ft_font->advance_cache.clear (); - ft_font->cached_x_scale = font->x_scale; - } - for (unsigned int i = 0; i < count; i++) { FT_Fixed v = 0; @@ -426,6 +489,7 @@ hb_ft_get_glyph_h_kerning (hb_font_t *font, void *user_data HB_UNUSED) { const hb_ft_font_t *ft_font = (const hb_ft_font_t *) font_data; + hb_lock_t lock (ft_font->lock); FT_Vector kerningv; FT_Kerning_Mode mode = font->x_ppem ? FT_KERNING_DEFAULT : FT_KERNING_UNFITTED; @@ -556,6 +620,7 @@ hb_ft_get_font_h_extents (hb_font_t *font HB_UNUSED, const hb_ft_font_t *ft_font = (const hb_ft_font_t *) font_data; hb_lock_t lock (ft_font->lock); FT_Face ft_face = ft_font->ft_face; + metrics->ascender = FT_MulFix(ft_face->ascender, ft_face->size->metrics.y_scale); metrics->descender = FT_MulFix(ft_face->descender, ft_face->size->metrics.y_scale); metrics->line_gap = FT_MulFix( ft_face->height, ft_face->size->metrics.y_scale ) - (metrics->ascender - metrics->descender); @@ -619,6 +684,8 @@ hb_ft_get_glyph_shape (hb_font_t *font HB_UNUSED, hb_lock_t lock (ft_font->lock); FT_Face ft_face = ft_font->ft_face; + _hb_ft_hb_font_check_changed (font, ft_font); + if (unlikely (FT_Load_Glyph (ft_face, glyph, FT_LOAD_NO_BITMAP | ft_font->load_flags))) return; @@ -964,6 +1031,31 @@ hb_ft_font_changed (hb_font_t *font) } /** + * hb_ft_hb_font_changed: + * @font: #hb_font_t to work upon + * + * Refreshes the state of the underlying FT_Face of @font when the hb_font_t + * @font has changed. + * This function should be called after changing the size or + * variation-axis settings on the @font. + * This call is fast if nothing has changed on @font. + * + * Return value: true if changed, false otherwise + * + * Since: 4.4.0 + **/ +hb_bool_t +hb_ft_hb_font_changed (hb_font_t *font) +{ + if (font->destroy != (hb_destroy_func_t) _hb_ft_font_destroy) + return false; + + hb_ft_font_t *ft_font = (hb_ft_font_t *) font->user_data; + + return _hb_ft_hb_font_check_changed (font, ft_font); +} + +/** * hb_ft_font_create_referenced: * @ft_face: FT_Face to work upon * @@ -1081,35 +1173,7 @@ hb_ft_font_set_funcs (hb_font_t *font) if (FT_Select_Charmap (ft_face, FT_ENCODING_MS_SYMBOL)) FT_Select_Charmap (ft_face, FT_ENCODING_UNICODE); - FT_Set_Char_Size (ft_face, - abs (font->x_scale), abs (font->y_scale), - 0, 0); -#if 0 - font->x_ppem * 72 * 64 / font->x_scale, - font->y_ppem * 72 * 64 / font->y_scale); -#endif - if (font->x_scale < 0 || font->y_scale < 0) - { - FT_Matrix matrix = { font->x_scale < 0 ? -1 : +1, 0, - 0, font->y_scale < 0 ? -1 : +1}; - FT_Set_Transform (ft_face, &matrix, nullptr); - } - -#if defined(HAVE_FT_GET_VAR_BLEND_COORDINATES) && !defined(HB_NO_VAR) - unsigned int num_coords; - const int *coords = hb_font_get_var_coords_normalized (font, &num_coords); - if (num_coords) - { - FT_Fixed *ft_coords = (FT_Fixed *) hb_calloc (num_coords, sizeof (FT_Fixed)); - if (ft_coords) - { - for (unsigned int i = 0; i < num_coords; i++) - ft_coords[i] = coords[i] * 4; - FT_Set_Var_Blend_Coordinates (ft_face, num_coords, ft_coords); - hb_free (ft_coords); - } - } -#endif + _hb_ft_hb_font_changed (font, ft_face); ft_face->generic.data = blob; ft_face->generic.finalizer = (FT_Generic_Finalizer) _release_blob; diff --git a/thirdparty/harfbuzz/src/hb-ft.h b/thirdparty/harfbuzz/src/hb-ft.h index bf07115ab9..6a8a7abe8c 100644 --- a/thirdparty/harfbuzz/src/hb-ft.h +++ b/thirdparty/harfbuzz/src/hb-ft.h @@ -122,10 +122,17 @@ hb_ft_font_set_load_flags (hb_font_t *font, int load_flags); HB_EXTERN int hb_ft_font_get_load_flags (hb_font_t *font); -/* Call when size or variations settings on underlying FT_Face change. */ +/* Call when size or variations settings on underlying FT_Face changed, + * and you want to update the hb_font_t from it. */ HB_EXTERN void hb_ft_font_changed (hb_font_t *font); +/* Call when size or variations settings on underlying hb_font_t may have + * changed, and you want to update the FT_Face from it. This call is fast + * if nothing changed on hb_font_t. Returns true if changed. */ +HB_EXTERN hb_bool_t +hb_ft_hb_font_changed (hb_font_t *font); + /* Makes an hb_font_t use FreeType internally to implement font functions. * Note: this internally creates an FT_Face. Use it when you create your * hb_face_t using hb_face_create(). */ diff --git a/thirdparty/harfbuzz/src/hb-iter.hh b/thirdparty/harfbuzz/src/hb-iter.hh index 43a3098f65..d4461f166c 100644 --- a/thirdparty/harfbuzz/src/hb-iter.hh +++ b/thirdparty/harfbuzz/src/hb-iter.hh @@ -43,17 +43,12 @@ * is writable, then the iterator returns lvalues, otherwise it * returns rvalues. * - * TODO Document more. - * - * If iterator implementation implements operator!=, then can be + * If iterator implementation implements operator!=, then it can be * used in range-based for loop. That already happens if the iterator * is random-access. Otherwise, the range-based for loop incurs * one traversal to find end(), which can be avoided if written * as a while-style for loop, or if iterator implements a faster - * __end__() method. - * TODO When opting in for C++17, address this by changing return - * type of .end()? - */ + * __end__() method. */ /* * Base classes for iterators. @@ -75,10 +70,6 @@ struct hb_iter_t iter_t* thiz () { return static_cast< iter_t *> (this); } public: - /* TODO: - * Port operators below to use hb_enable_if to sniff which method implements - * an operator and use it, and remove hb_iter_fallback_mixin_t completely. */ - /* Operators. */ iter_t iter () const { return *thiz(); } iter_t operator + () const { return *thiz(); } @@ -87,8 +78,7 @@ struct hb_iter_t explicit operator bool () const { return thiz()->__more__ (); } unsigned len () const { return thiz()->__len__ (); } /* The following can only be enabled if item_t is reference type. Otherwise - * it will be returning pointer to temporary rvalue. - * TODO Use a wrapper return type to fix for non-reference type. */ + * it will be returning pointer to temporary rvalue. */ template <typename T = item_t, hb_enable_if (std::is_reference<T>::value)> hb_remove_reference<item_t>* operator -> () const { return std::addressof (**thiz()); } diff --git a/thirdparty/harfbuzz/src/hb-machinery.hh b/thirdparty/harfbuzz/src/hb-machinery.hh index e52a6a4124..ff2a99f5ed 100644 --- a/thirdparty/harfbuzz/src/hb-machinery.hh +++ b/thirdparty/harfbuzz/src/hb-machinery.hh @@ -176,7 +176,7 @@ struct hb_lazy_loader_t : hb_data_wrapper_t<Data, WheresData> void init0 () {} /* Init, when memory is already set to 0. No-op for us. */ void init () { instance.set_relaxed (nullptr); } - void fini () { do_destroy (instance.get ()); } + void fini () { do_destroy (instance.get ()); init (); } void free_instance () { diff --git a/thirdparty/harfbuzz/src/hb-map.cc b/thirdparty/harfbuzz/src/hb-map.cc index 6c83c670c9..089615c72a 100644 --- a/thirdparty/harfbuzz/src/hb-map.cc +++ b/thirdparty/harfbuzz/src/hb-map.cc @@ -40,7 +40,7 @@ /** - * hb_map_create: (Xconstructor) + * hb_map_create: * * Creates a new, initially empty map. * @@ -172,6 +172,25 @@ hb_map_allocation_successful (const hb_map_t *map) return map->successful; } +/** + * hb_map_copy: + * @map: A map + * + * Allocate a copy of @map. + * + * Return value: Newly-allocated map. + * + * Since: 4.4.0 + **/ +hb_map_t * +hb_map_copy (const hb_map_t *map) +{ + hb_map_t *copy = hb_map_create (); + if (unlikely (!copy)) return nullptr; + copy->resize (map->population); + hb_copy (*map, *copy); + return copy; +} /** * hb_map_set: @@ -309,3 +328,20 @@ hb_map_is_equal (const hb_map_t *map, return map->is_equal (*other); } +/** + * hb_map_hash: + * @map: A map + * + * Creates a hash representing @map. + * + * Return value: + * A hash of @map. + * + * Since: 4.4.0 + **/ +HB_EXTERN unsigned int +hb_map_hash (const hb_map_t *map) +{ + return map->hash (); +} + diff --git a/thirdparty/harfbuzz/src/hb-map.h b/thirdparty/harfbuzz/src/hb-map.h index 3f67c50b92..41d877d6a1 100644 --- a/thirdparty/harfbuzz/src/hb-map.h +++ b/thirdparty/harfbuzz/src/hb-map.h @@ -82,6 +82,9 @@ hb_map_get_user_data (hb_map_t *map, HB_EXTERN hb_bool_t hb_map_allocation_successful (const hb_map_t *map); +HB_EXTERN hb_map_t * +hb_map_copy (const hb_map_t *map); + HB_EXTERN void hb_map_clear (hb_map_t *map); @@ -95,6 +98,9 @@ HB_EXTERN hb_bool_t hb_map_is_equal (const hb_map_t *map, const hb_map_t *other); +HB_EXTERN unsigned int +hb_map_hash (const hb_map_t *map); + HB_EXTERN void hb_map_set (hb_map_t *map, hb_codepoint_t key, diff --git a/thirdparty/harfbuzz/src/hb-map.hh b/thirdparty/harfbuzz/src/hb-map.hh index aec7d87f42..5efad8d20c 100644 --- a/thirdparty/harfbuzz/src/hb-map.hh +++ b/thirdparty/harfbuzz/src/hb-map.hh @@ -34,15 +34,13 @@ * hb_hashmap_t */ +extern HB_INTERNAL const hb_codepoint_t minus_1; + template <typename K, typename V, - typename k_invalid_t = K, - typename v_invalid_t = V, - k_invalid_t kINVALID = std::is_pointer<K>::value ? 0 : std::is_signed<K>::value ? hb_int_min (K) : (K) -1, - v_invalid_t vINVALID = std::is_pointer<V>::value ? 0 : std::is_signed<V>::value ? hb_int_min (V) : (V) -1> + bool minus_one = false> struct hb_hashmap_t { hb_hashmap_t () { init (); } - hb_hashmap_t (std::nullptr_t) : hb_hashmap_t () {} ~hb_hashmap_t () { fini (); } hb_hashmap_t (const hb_hashmap_t& o) : hb_hashmap_t () { resize (population); hb_copy (o, *this); } @@ -68,38 +66,44 @@ struct hb_hashmap_t struct item_t { K key; + uint32_t hash : 30; + uint32_t is_used_ : 1; + uint32_t is_tombstone_ : 1; V value; - uint32_t hash; + + bool is_used () const { return is_used_; } + void set_used (bool is_used) { is_used_ = is_used; } + bool is_tombstone () const { return is_tombstone_; } + void set_tombstone (bool is_tombstone) { is_tombstone_ = is_tombstone; } + bool is_real () const { return is_used_ && !is_tombstone_; } + + template <bool v = minus_one, + hb_enable_if (v == false)> + static inline const V& default_value () { return Null(V); }; + template <bool v = minus_one, + hb_enable_if (v == true)> + static inline const V& default_value () + { + static_assert (hb_is_same (V, hb_codepoint_t), ""); + return minus_1; + }; void clear () { new (std::addressof (key)) K (); - key = hb_coerce<K> (kINVALID); new (std::addressof (value)) V (); - value = hb_coerce<V> (vINVALID); hash = 0; + is_used_ = false; + is_tombstone_ = false; } bool operator == (const K &o) { return hb_deref (key) == hb_deref (o); } bool operator == (const item_t &o) { return *this == o.key; } - bool is_unused () const - { - const K inv = hb_coerce<K> (kINVALID); - return key == inv; - } - bool is_tombstone () const - { - const K kinv = hb_coerce<K> (kINVALID); - const V vinv = hb_coerce<V> (vINVALID); - return key != kinv && value == vinv; - } - bool is_real () const - { - const K kinv = hb_coerce<K> (kINVALID); - const V vinv = hb_coerce<V> (vINVALID); - return key != kinv && value != vinv; - } hb_pair_t<K, V> get_pair() const { return hb_pair_t<K, V> (key, value); } + hb_pair_t<const K &, const V &> get_pair_ref() const { return hb_pair_t<const K &, const V &> (key, value); } + + uint32_t total_hash () const + { return (hash * 31) + hb_hash (value); } }; hb_object_header_t header; @@ -200,27 +204,39 @@ struct hb_hashmap_t return true; } - bool set (K key, const V& value) { return set_with_hash (key, hb_hash (key), value); } - bool set (K key, V&& value) { return set_with_hash (key, hb_hash (key), std::move (value)); } + template <typename VV> + bool set (K key, VV&& value) { return set_with_hash (key, hb_hash (key), std::forward<VV> (value)); } - V get (K key) const + const V& get (K key) const { - if (unlikely (!items)) return hb_coerce<V> (vINVALID); + if (unlikely (!items)) return item_t::default_value (); unsigned int i = bucket_for (key); - return items[i].is_real () && items[i] == key ? items[i].value : hb_coerce<V> (vINVALID); + return items[i].is_real () && items[i] == key ? items[i].value : item_t::default_value (); } - void del (K key) { set (key, hb_coerce<V> (vINVALID)); } + void del (K key) { set_with_hash (key, hb_hash (key), item_t::default_value (), true); } /* Has interface. */ - typedef V value_t; + typedef const V& value_t; value_t operator [] (K k) const { return get (k); } - bool has (K k, V *vp = nullptr) const + bool has (K key, const V **vp = nullptr) const { - V v = (*this)[k]; - if (vp) *vp = v; - const V vinv = hb_coerce<V> (vINVALID); - return v != vinv; + if (unlikely (!items)) + { + if (vp) *vp = &item_t::default_value (); + return false; + } + unsigned int i = bucket_for (key); + if (items[i].is_real () && items[i] == key) + { + if (vp) *vp = &items[i].value; + return true; + } + else + { + if (vp) *vp = &item_t::default_value (); + return false; + } } /* Projection. */ V operator () (K k) const { return get (k); } @@ -242,8 +258,9 @@ struct hb_hashmap_t uint32_t hash () const { uint32_t h = 0; - for (auto pair : iter ()) - h ^= (hb_hash (pair.first) * 31) + hb_hash (pair.second); + for (const auto &item : + hb_array (items, mask ? mask + 1 : 0) + | hb_filter (&item_t::is_real)) + h ^= item.total_hash (); return h; } @@ -271,6 +288,12 @@ struct hb_hashmap_t | hb_filter (&item_t::is_real) | hb_map (&item_t::get_pair) ) + auto iter_ref () const HB_AUTO_RETURN + ( + + hb_array (items, mask ? mask + 1 : 0) + | hb_filter (&item_t::is_real) + | hb_map (&item_t::get_pair_ref) + ) auto keys () const HB_AUTO_RETURN ( + hb_array (items, mask ? mask + 1 : 0) @@ -293,19 +316,16 @@ struct hb_hashmap_t protected: template <typename VV> - bool set_with_hash (K key, uint32_t hash, VV&& value) + bool set_with_hash (K key, uint32_t hash, VV&& value, bool is_delete=false) { if (unlikely (!successful)) return false; - const K kinv = hb_coerce<K> (kINVALID); - if (unlikely (key == kinv)) return true; if (unlikely ((occupancy + occupancy / 2) >= mask && !resize ())) return false; unsigned int i = bucket_for_hash (key, hash); - const V vinv = hb_coerce<V> (vINVALID); - if (value == vinv && items[i].key != key) + if (is_delete && items[i].key != key) return true; /* Trying to delete non-existent key. */ - if (!items[i].is_unused ()) + if (items[i].is_used ()) { occupancy--; if (!items[i].is_tombstone ()) @@ -313,27 +333,30 @@ struct hb_hashmap_t } items[i].key = key; - items[i].value = value; + items[i].value = std::forward<VV> (value); items[i].hash = hash; + items[i].set_used (true); + items[i].set_tombstone (is_delete); occupancy++; - if (!items[i].is_tombstone ()) + if (!is_delete) population++; return true; } - unsigned int bucket_for (K key) const + unsigned int bucket_for (const K &key) const { return bucket_for_hash (key, hb_hash (key)); } - unsigned int bucket_for_hash (K key, uint32_t hash) const + unsigned int bucket_for_hash (const K &key, uint32_t hash) const { + hash &= 0x3FFFFFFF; // We only store lower 30bit of hash unsigned int i = hash % prime; unsigned int step = 0; unsigned int tombstone = (unsigned) -1; - while (!items[i].is_unused ()) + while (items[i].is_used ()) { if (items[i].hash == hash && items[i] == key) return i; @@ -402,21 +425,14 @@ struct hb_hashmap_t struct hb_map_t : hb_hashmap_t<hb_codepoint_t, hb_codepoint_t, - hb_codepoint_t, - hb_codepoint_t, - HB_MAP_VALUE_INVALID, - HB_MAP_VALUE_INVALID> + true> { using hashmap = hb_hashmap_t<hb_codepoint_t, hb_codepoint_t, - hb_codepoint_t, - hb_codepoint_t, - HB_MAP_VALUE_INVALID, - HB_MAP_VALUE_INVALID>; + true>; ~hb_map_t () = default; hb_map_t () : hashmap () {} - hb_map_t (std::nullptr_t) : hb_map_t () {} hb_map_t (const hb_map_t &o) : hashmap ((hashmap &) o) {} hb_map_t (hb_map_t &&o) : hashmap (std::move ((hashmap &) o)) {} hb_map_t& operator= (const hb_map_t&) = default; diff --git a/thirdparty/harfbuzz/src/hb-meta.hh b/thirdparty/harfbuzz/src/hb-meta.hh index 90757d38ac..e97d790fc3 100644 --- a/thirdparty/harfbuzz/src/hb-meta.hh +++ b/thirdparty/harfbuzz/src/hb-meta.hh @@ -188,7 +188,7 @@ template <> struct hb_int_max<signed long long> : hb_integral_constant<signed l template <> struct hb_int_max<unsigned long long> : hb_integral_constant<unsigned long long, ULLONG_MAX> {}; #define hb_int_max(T) hb_int_max<T>::value -#if __GNUG__ && __GNUC__ < 5 +#if defined(__GNUC__) && __GNUC__ < 5 #define hb_is_trivially_copyable(T) __has_trivial_copy(T) #define hb_is_trivially_copy_assignable(T) __has_trivial_assign(T) #define hb_is_trivially_constructible(T) __has_trivial_constructor(T) diff --git a/thirdparty/harfbuzz/src/hb-null.hh b/thirdparty/harfbuzz/src/hb-null.hh index db38a4dfd2..78eb6474d5 100644 --- a/thirdparty/harfbuzz/src/hb-null.hh +++ b/thirdparty/harfbuzz/src/hb-null.hh @@ -37,7 +37,7 @@ /* Global nul-content Null pool. Enlarge as necessary. */ -#define HB_NULL_POOL_SIZE 384 +#define HB_NULL_POOL_SIZE 448 /* Use SFINAE to sniff whether T has min_size; in which case return the larger * of sizeof(T) and T::null_size, otherwise return sizeof(T). @@ -108,7 +108,7 @@ struct NullHelper /* Specializations for arbitrary-content Null objects expressed in bytes. */ #define DECLARE_NULL_NAMESPACE_BYTES(Namespace, Type) \ } /* Close namespace. */ \ - extern HB_INTERNAL const unsigned char _hb_Null_##Namespace##_##Type[Namespace::Type::null_size]; \ + extern HB_INTERNAL const unsigned char _hb_Null_##Namespace##_##Type[hb_null_size (Namespace::Type)]; \ template <> \ struct Null<Namespace::Type> { \ static Namespace::Type const & get_null () { \ @@ -118,7 +118,7 @@ struct NullHelper namespace Namespace { \ static_assert (true, "") /* Require semicolon after. */ #define DEFINE_NULL_NAMESPACE_BYTES(Namespace, Type) \ - const unsigned char _hb_Null_##Namespace##_##Type[Namespace::Type::null_size] + const unsigned char _hb_Null_##Namespace##_##Type[hb_null_size (Namespace::Type)] /* Specializations for arbitrary-content Null objects expressed as struct initializer. */ #define DECLARE_NULL_INSTANCE(Type) \ diff --git a/thirdparty/harfbuzz/src/hb-ot-cff1-table.hh b/thirdparty/harfbuzz/src/hb-ot-cff1-table.hh index b5047002ac..4aa337f78b 100644 --- a/thirdparty/harfbuzz/src/hb-ot-cff1-table.hh +++ b/thirdparty/harfbuzz/src/hb-ot-cff1-table.hh @@ -406,6 +406,8 @@ struct Charset1_2 { void collect_glyph_to_sid_map (hb_map_t *mapping, unsigned int num_glyphs) const { hb_codepoint_t gid = 1; + if (gid >= num_glyphs) + return; for (unsigned i = 0;; i++) { hb_codepoint_t sid = ranges[i].first; @@ -1138,7 +1140,8 @@ struct cff1 cff1_top_dict_interp_env_t env (fontDictStr); cff1_font_dict_interpreter_t font_interp (env); font = fontDicts.push (); - if (unlikely (font == &Crap (cff1_font_dict_values_t))) { fini (); return; } + if (unlikely (fontDicts.in_error ())) { fini (); return; } + font->init (); if (unlikely (!font_interp.interpret (*font))) { fini (); return; } PRIVDICTVAL *priv = &privateDicts[i]; @@ -1333,7 +1336,7 @@ struct cff1 if (names) { names->fini (); - free (names); + hb_free (names); } SUPER::fini (); @@ -1379,7 +1382,7 @@ struct cff1 hb_sorted_vector_t<gname_t> *names = glyph_names.get (); if (unlikely (!names)) { - names = (hb_sorted_vector_t<gname_t> *) calloc (sizeof (hb_sorted_vector_t<gname_t>), 1); + names = (hb_sorted_vector_t<gname_t> *) hb_calloc (sizeof (hb_sorted_vector_t<gname_t>), 1); if (likely (names)) { names->init (); @@ -1409,14 +1412,14 @@ struct cff1 if (names) { names->fini (); - free (names); + hb_free (names); } goto retry; } - } + } gname_t key = { hb_bytes_t (name, len), 0 }; - const gname_t *gname = glyph_names->bsearch (key); + const gname_t *gname = names ? names->bsearch (key) : nullptr; if (!gname) return false; hb_codepoint_t gid = sid_to_glyph (gname->sid); if (!gid && gname->sid) return false; diff --git a/thirdparty/harfbuzz/src/hb-ot-cmap-table.hh b/thirdparty/harfbuzz/src/hb-ot-cmap-table.hh index 7e96d9c8b3..09c9fe93f3 100644 --- a/thirdparty/harfbuzz/src/hb-ot-cmap-table.hh +++ b/thirdparty/harfbuzz/src/hb-ot-cmap-table.hh @@ -27,6 +27,8 @@ #ifndef HB_OT_CMAP_TABLE_HH #define HB_OT_CMAP_TABLE_HH +#include "hb-ot-os2-table.hh" +#include "hb-ot-shaper-arabic-pua.hh" #include "hb-open-type.hh" #include "hb-set.hh" @@ -1476,33 +1478,47 @@ struct SubtableUnicodesCache { private: const void* base; - hb_hashmap_t<intptr_t, hb_set_t*> cached_unicodes; + hb_hashmap_t<intptr_t, hb::unique_ptr<hb_set_t>> cached_unicodes; public: SubtableUnicodesCache(const void* cmap_base) : base(cmap_base), cached_unicodes() {} - ~SubtableUnicodesCache() - { - for (hb_set_t* s : cached_unicodes.values()) { - hb_set_destroy (s); - } - } - hb_set_t* set_for(const EncodingRecord* record) + hb_set_t* set_for (const EncodingRecord* record) { - if (!cached_unicodes.has ((intptr_t) record)) { - hb_set_t* new_set = hb_set_create (); - if (!cached_unicodes.set ((intptr_t) record, new_set)) { - hb_set_destroy (new_set); + if (!cached_unicodes.has ((intptr_t) record)) + { + hb_set_t *s = hb_set_create (); + if (unlikely (s->in_error ())) + return hb_set_get_empty (); + + (base+record->subtable).collect_unicodes (s); + + if (unlikely (!cached_unicodes.set ((intptr_t) record, hb::unique_ptr<hb_set_t> {s}))) return hb_set_get_empty (); - } - (base+record->subtable).collect_unicodes (cached_unicodes.get ((intptr_t) record)); + + return s; } return cached_unicodes.get ((intptr_t) record); } }; +static inline uint_fast16_t +_hb_symbol_pua_map (unsigned codepoint) +{ + if (codepoint <= 0x00FFu) + { + /* For symbol-encoded OpenType fonts, we duplicate the + * U+F000..F0FF range at U+0000..U+00FF. That's what + * Windows seems to do, and that's hinted about at: + * https://docs.microsoft.com/en-us/typography/opentype/spec/recom + * under "Non-Standard (Symbol) Fonts". */ + return 0xF000u + codepoint; + } + return 0; +} + struct cmap { static constexpr hb_tag_t tableTag = HB_OT_TAG_cmap; @@ -1726,7 +1742,24 @@ struct cmap this->get_glyph_data = subtable; if (unlikely (symbol)) - this->get_glyph_funcZ = get_glyph_from_symbol<CmapSubtable>; + { + switch ((unsigned) face->table.OS2->get_font_page ()) { + case OS2::font_page_t::FONT_PAGE_NONE: + this->get_glyph_funcZ = get_glyph_from_symbol<CmapSubtable, _hb_symbol_pua_map>; + break; +#ifndef HB_NO_OT_SHAPER_ARABIC_FALLBACK + case OS2::font_page_t::FONT_PAGE_SIMP_ARABIC: + this->get_glyph_funcZ = get_glyph_from_symbol<CmapSubtable, _hb_arabic_pua_simp_map>; + break; + case OS2::font_page_t::FONT_PAGE_TRAD_ARABIC: + this->get_glyph_funcZ = get_glyph_from_symbol<CmapSubtable, _hb_arabic_pua_trad_map>; + break; +#endif + default: + this->get_glyph_funcZ = get_glyph_from<CmapSubtable>; + break; + } + } else { switch (subtable->u.format) { @@ -1808,6 +1841,7 @@ struct cmap typedef bool (*hb_cmap_get_glyph_func_t) (const void *obj, hb_codepoint_t codepoint, hb_codepoint_t *glyph); + typedef uint_fast16_t (*hb_pua_remap_func_t) (unsigned); template <typename Type> HB_INTERNAL static bool get_glyph_from (const void *obj, @@ -1818,7 +1852,7 @@ struct cmap return typed_obj->get_glyph (codepoint, glyph); } - template <typename Type> + template <typename Type, hb_pua_remap_func_t remap> HB_INTERNAL static bool get_glyph_from_symbol (const void *obj, hb_codepoint_t codepoint, hb_codepoint_t *glyph) @@ -1827,15 +1861,8 @@ struct cmap if (likely (typed_obj->get_glyph (codepoint, glyph))) return true; - if (codepoint <= 0x00FFu) - { - /* For symbol-encoded OpenType fonts, we duplicate the - * U+F000..F0FF range at U+0000..U+00FF. That's what - * Windows seems to do, and that's hinted about at: - * https://docs.microsoft.com/en-us/typography/opentype/spec/recom - * under "Non-Standard (Symbol) Fonts". */ - return typed_obj->get_glyph (0xF000u + codepoint, glyph); - } + if (hb_codepoint_t c = remap (codepoint)) + return typed_obj->get_glyph (c, glyph); return false; } diff --git a/thirdparty/harfbuzz/src/hb-ot-color-cpal-table.hh b/thirdparty/harfbuzz/src/hb-ot-color-cpal-table.hh index 24476eda17..bcab77f79d 100644 --- a/thirdparty/harfbuzz/src/hb-ot-color-cpal-table.hh +++ b/thirdparty/harfbuzz/src/hb-ot-color-cpal-table.hh @@ -97,9 +97,10 @@ struct CPALV1Tail c->push (); for (const auto _ : colorLabels) { - if (!color_index_map->has (_)) continue; + const hb_codepoint_t *v; + if (!color_index_map->has (_, &v)) continue; NameID new_color_idx; - new_color_idx = color_index_map->get (_); + new_color_idx = *v; if (!c->copy<NameID> (new_color_idx)) { c->pop_discard (); diff --git a/thirdparty/harfbuzz/src/hb-ot-color-sbix-table.hh b/thirdparty/harfbuzz/src/hb-ot-color-sbix-table.hh index 9741ebd450..d0e2235fb2 100644 --- a/thirdparty/harfbuzz/src/hb-ot-color-sbix-table.hh +++ b/thirdparty/harfbuzz/src/hb-ot-color-sbix-table.hh @@ -298,6 +298,12 @@ struct sbix const PNGHeader &png = *blob->as<PNGHeader>(); + if (png.IHDR.height >= 65536 || png.IHDR.width >= 65536) + { + hb_blob_destroy (blob); + return false; + } + extents->x_bearing = x_offset; extents->y_bearing = png.IHDR.height + y_offset; extents->width = png.IHDR.width; diff --git a/thirdparty/harfbuzz/src/hb-ot-font.cc b/thirdparty/harfbuzz/src/hb-ot-font.cc index 0f44ee4d5f..af1bc86d48 100644 --- a/thirdparty/harfbuzz/src/hb-ot-font.cc +++ b/thirdparty/harfbuzz/src/hb-ot-font.cc @@ -30,6 +30,7 @@ #include "hb-ot.h" +#include "hb-cache.hh" #include "hb-font.hh" #include "hb-machinery.hh" #include "hb-ot-face.hh" @@ -58,6 +59,41 @@ * never need to call these functions directly. **/ +struct hb_ot_font_t +{ + const hb_ot_face_t *ot_face; + + /* h_advance caching */ + mutable hb_atomic_int_t cached_coords_serial; + mutable hb_atomic_ptr_t<hb_advance_cache_t> advance_cache; +}; + +static hb_ot_font_t * +_hb_ot_font_create (hb_font_t *font) +{ + hb_ot_font_t *ot_font = (hb_ot_font_t *) hb_calloc (1, sizeof (hb_ot_font_t)); + if (unlikely (!ot_font)) + return nullptr; + + ot_font->ot_face = &font->face->table; + + return ot_font; +} + +static void +_hb_ot_font_destroy (void *font_data) +{ + hb_ot_font_t *ot_font = (hb_ot_font_t *) font_data; + + auto *cache = ot_font->advance_cache.get_relaxed (); + if (cache) + { + cache->fini (); + hb_free (cache); + } + + hb_free (ot_font); +} static hb_bool_t hb_ot_get_nominal_glyph (hb_font_t *font HB_UNUSED, @@ -66,7 +102,8 @@ hb_ot_get_nominal_glyph (hb_font_t *font HB_UNUSED, hb_codepoint_t *glyph, void *user_data HB_UNUSED) { - const hb_ot_face_t *ot_face = (const hb_ot_face_t *) font_data; + const hb_ot_font_t *ot_font = (const hb_ot_font_t *) font_data; + const hb_ot_face_t *ot_face = ot_font->ot_face; return ot_face->cmap->get_nominal_glyph (unicode, glyph); } @@ -80,7 +117,8 @@ hb_ot_get_nominal_glyphs (hb_font_t *font HB_UNUSED, unsigned int glyph_stride, void *user_data HB_UNUSED) { - const hb_ot_face_t *ot_face = (const hb_ot_face_t *) font_data; + const hb_ot_font_t *ot_font = (const hb_ot_font_t *) font_data; + const hb_ot_face_t *ot_face = ot_font->ot_face; return ot_face->cmap->get_nominal_glyphs (count, first_unicode, unicode_stride, first_glyph, glyph_stride); @@ -94,7 +132,8 @@ hb_ot_get_variation_glyph (hb_font_t *font HB_UNUSED, hb_codepoint_t *glyph, void *user_data HB_UNUSED) { - const hb_ot_face_t *ot_face = (const hb_ot_face_t *) font_data; + const hb_ot_font_t *ot_font = (const hb_ot_font_t *) font_data; + const hb_ot_face_t *ot_face = ot_font->ot_face; return ot_face->cmap->get_variation_glyph (unicode, variation_selector, glyph); } @@ -107,15 +146,83 @@ hb_ot_get_glyph_h_advances (hb_font_t* font, void* font_data, unsigned advance_stride, void *user_data HB_UNUSED) { - const hb_ot_face_t *ot_face = (const hb_ot_face_t *) font_data; + const hb_ot_font_t *ot_font = (const hb_ot_font_t *) font_data; + const hb_ot_face_t *ot_face = ot_font->ot_face; const OT::hmtx_accelerator_t &hmtx = *ot_face->hmtx; - for (unsigned int i = 0; i < count; i++) +#ifndef HB_NO_VAR + const OT::HVARVVAR &HVAR = *hmtx.var_table; + const OT::VariationStore &varStore = &HVAR + HVAR.varStore; + OT::VariationStore::cache_t *varStore_cache = font->num_coords * count >= 128 ? varStore.create_cache () : nullptr; + + bool use_cache = font->num_coords; +#else + OT::VariationStore::cache_t *varStore_cache = nullptr; + bool use_cache = false; +#endif + + hb_advance_cache_t *cache = nullptr; + if (use_cache) { - *first_advance = font->em_scale_x (hmtx.get_advance (*first_glyph, font)); - first_glyph = &StructAtOffsetUnaligned<hb_codepoint_t> (first_glyph, glyph_stride); - first_advance = &StructAtOffsetUnaligned<hb_position_t> (first_advance, advance_stride); + retry: + cache = ot_font->advance_cache.get (); + if (unlikely (!cache)) + { + cache = (hb_advance_cache_t *) hb_malloc (sizeof (hb_advance_cache_t)); + if (unlikely (!cache)) + { + use_cache = false; + goto out; + } + + cache->init (); + if (unlikely (!ot_font->advance_cache.cmpexch (nullptr, cache))) + { + hb_free (cache); + goto retry; + } + ot_font->cached_coords_serial.set (font->serial_coords); + } + } + out: + + if (!use_cache) + { + for (unsigned int i = 0; i < count; i++) + { + *first_advance = font->em_scale_x (hmtx.get_advance (*first_glyph, font, varStore_cache)); + first_glyph = &StructAtOffsetUnaligned<hb_codepoint_t> (first_glyph, glyph_stride); + first_advance = &StructAtOffsetUnaligned<hb_position_t> (first_advance, advance_stride); + } } + else + { /* Use cache. */ + if (ot_font->cached_coords_serial.get () != (int) font->serial_coords) + { + ot_font->advance_cache->init (); + ot_font->cached_coords_serial.set (font->serial_coords); + } + + for (unsigned int i = 0; i < count; i++) + { + hb_position_t v; + unsigned cv; + if (ot_font->advance_cache->get (*first_glyph, &cv)) + v = cv; + else + { + v = hmtx.get_advance (*first_glyph, font, varStore_cache); + ot_font->advance_cache->set (*first_glyph, v); + } + *first_advance = font->em_scale_x (v); + first_glyph = &StructAtOffsetUnaligned<hb_codepoint_t> (first_glyph, glyph_stride); + first_advance = &StructAtOffsetUnaligned<hb_position_t> (first_advance, advance_stride); + } + } + +#ifndef HB_NO_VAR + OT::VariationStore::destroy_cache (varStore_cache); +#endif } #ifndef HB_NO_VERTICAL @@ -128,16 +235,31 @@ hb_ot_get_glyph_v_advances (hb_font_t* font, void* font_data, unsigned advance_stride, void *user_data HB_UNUSED) { - const hb_ot_face_t *ot_face = (const hb_ot_face_t *) font_data; + const hb_ot_font_t *ot_font = (const hb_ot_font_t *) font_data; + const hb_ot_face_t *ot_face = ot_font->ot_face; const OT::vmtx_accelerator_t &vmtx = *ot_face->vmtx; if (vmtx.has_data ()) + { +#ifndef HB_NO_VAR + const OT::HVARVVAR &VVAR = *vmtx.var_table; + const OT::VariationStore &varStore = &VVAR + VVAR.varStore; + OT::VariationStore::cache_t *varStore_cache = font->num_coords ? varStore.create_cache () : nullptr; +#else + OT::VariationStore::cache_t *varStore_cache = nullptr; +#endif + for (unsigned int i = 0; i < count; i++) { - *first_advance = font->em_scale_y (-(int) vmtx.get_advance (*first_glyph, font)); + *first_advance = font->em_scale_y (-(int) vmtx.get_advance (*first_glyph, font, varStore_cache)); first_glyph = &StructAtOffsetUnaligned<hb_codepoint_t> (first_glyph, glyph_stride); first_advance = &StructAtOffsetUnaligned<hb_position_t> (first_advance, advance_stride); } + +#ifndef HB_NO_VAR + OT::VariationStore::destroy_cache (varStore_cache); +#endif + } else { hb_font_extents_t font_extents; @@ -163,7 +285,8 @@ hb_ot_get_glyph_v_origin (hb_font_t *font, hb_position_t *y, void *user_data HB_UNUSED) { - const hb_ot_face_t *ot_face = (const hb_ot_face_t *) font_data; + const hb_ot_font_t *ot_font = (const hb_ot_font_t *) font_data; + const hb_ot_face_t *ot_face = ot_font->ot_face; *x = font->get_glyph_h_advance (glyph) / 2; @@ -208,7 +331,8 @@ hb_ot_get_glyph_extents (hb_font_t *font, hb_glyph_extents_t *extents, void *user_data HB_UNUSED) { - const hb_ot_face_t *ot_face = (const hb_ot_face_t *) font_data; + const hb_ot_font_t *ot_font = (const hb_ot_font_t *) font_data; + const hb_ot_face_t *ot_face = ot_font->ot_face; #if !defined(HB_NO_OT_FONT_BITMAP) && !defined(HB_NO_COLOR) if (ot_face->sbix->get_extents (font, glyph, extents)) return true; @@ -234,7 +358,9 @@ hb_ot_get_glyph_name (hb_font_t *font HB_UNUSED, char *name, unsigned int size, void *user_data HB_UNUSED) { - const hb_ot_face_t *ot_face = (const hb_ot_face_t *) font_data; + const hb_ot_font_t *ot_font = (const hb_ot_font_t *) font_data; + const hb_ot_face_t *ot_face = ot_font->ot_face; + if (ot_face->post->get_glyph_name (glyph, name, size)) return true; #ifndef HB_NO_OT_FONT_CFF if (ot_face->cff1->get_glyph_name (glyph, name, size)) return true; @@ -248,7 +374,9 @@ hb_ot_get_glyph_from_name (hb_font_t *font HB_UNUSED, hb_codepoint_t *glyph, void *user_data HB_UNUSED) { - const hb_ot_face_t *ot_face = (const hb_ot_face_t *) font_data; + const hb_ot_font_t *ot_font = (const hb_ot_font_t *) font_data; + const hb_ot_face_t *ot_face = ot_font->ot_face; + if (ot_face->post->get_glyph_from_name (name, len, glyph)) return true; #ifndef HB_NO_OT_FONT_CFF if (ot_face->cff1->get_glyph_from_name (name, len, glyph)) return true; @@ -364,10 +492,14 @@ _hb_ot_get_font_funcs () void hb_ot_font_set_funcs (hb_font_t *font) { + hb_ot_font_t *ot_font = _hb_ot_font_create (font); + if (unlikely (!ot_font)) + return; + hb_font_set_funcs (font, _hb_ot_get_font_funcs (), - &font->face->table, - nullptr); + ot_font, + _hb_ot_font_destroy); } #ifndef HB_NO_VAR diff --git a/thirdparty/harfbuzz/src/hb-ot-glyf-table.hh b/thirdparty/harfbuzz/src/hb-ot-glyf-table.hh index 866bb7e04c..c32ff7636d 100644 --- a/thirdparty/harfbuzz/src/hb-ot-glyf-table.hh +++ b/thirdparty/harfbuzz/src/hb-ot-glyf-table.hh @@ -30,1334 +30,6 @@ #ifndef HB_OT_GLYF_TABLE_HH #define HB_OT_GLYF_TABLE_HH -#include "hb-open-type.hh" -#include "hb-ot-head-table.hh" -#include "hb-ot-hmtx-table.hh" -#include "hb-ot-var-gvar-table.hh" -#include "hb-draw.hh" - -namespace OT { - - -/* - * loca -- Index to Location - * https://docs.microsoft.com/en-us/typography/opentype/spec/loca - */ -#define HB_OT_TAG_loca HB_TAG('l','o','c','a') - -#ifndef HB_MAX_COMPOSITE_OPERATIONS -#define HB_MAX_COMPOSITE_OPERATIONS 100000 -#endif - - -struct loca -{ - friend struct glyf; - - static constexpr hb_tag_t tableTag = HB_OT_TAG_loca; - - bool sanitize (hb_sanitize_context_t *c HB_UNUSED) const - { - TRACE_SANITIZE (this); - return_trace (true); - } - - protected: - UnsizedArrayOf<HBUINT8> - dataZ; /* Location data. */ - public: - DEFINE_SIZE_MIN (0); /* In reality, this is UNBOUNDED() type; but since we always - * check the size externally, allow Null() object of it by - * defining it _MIN instead. */ -}; - - -/* - * glyf -- TrueType Glyph Data - * https://docs.microsoft.com/en-us/typography/opentype/spec/glyf - */ -#define HB_OT_TAG_glyf HB_TAG('g','l','y','f') - - -struct glyf -{ - static constexpr hb_tag_t tableTag = HB_OT_TAG_glyf; - - bool sanitize (hb_sanitize_context_t *c HB_UNUSED) const - { - TRACE_SANITIZE (this); - /* Runtime checks as eager sanitizing each glyph is costy */ - return_trace (true); - } - - template<typename Iterator, - hb_requires (hb_is_source_of (Iterator, unsigned int))> - static bool - _add_loca_and_head (hb_subset_plan_t * plan, Iterator padded_offsets, bool use_short_loca) - { - unsigned num_offsets = padded_offsets.len () + 1; - unsigned entry_size = use_short_loca ? 2 : 4; - char *loca_prime_data = (char *) hb_calloc (entry_size, num_offsets); - - if (unlikely (!loca_prime_data)) return false; - - DEBUG_MSG (SUBSET, nullptr, "loca entry_size %d num_offsets %d size %d", - entry_size, num_offsets, entry_size * num_offsets); - - if (use_short_loca) - _write_loca (padded_offsets, 1, hb_array ((HBUINT16 *) loca_prime_data, num_offsets)); - else - _write_loca (padded_offsets, 0, hb_array ((HBUINT32 *) loca_prime_data, num_offsets)); - - hb_blob_t *loca_blob = hb_blob_create (loca_prime_data, - entry_size * num_offsets, - HB_MEMORY_MODE_WRITABLE, - loca_prime_data, - hb_free); - - bool result = plan->add_table (HB_OT_TAG_loca, loca_blob) - && _add_head_and_set_loca_version (plan, use_short_loca); - - hb_blob_destroy (loca_blob); - return result; - } - - template<typename IteratorIn, typename IteratorOut, - hb_requires (hb_is_source_of (IteratorIn, unsigned int)), - hb_requires (hb_is_sink_of (IteratorOut, unsigned))> - static void - _write_loca (IteratorIn it, unsigned right_shift, IteratorOut dest) - { - unsigned int offset = 0; - dest << 0; - + it - | hb_map ([=, &offset] (unsigned int padded_size) - { - offset += padded_size; - DEBUG_MSG (SUBSET, nullptr, "loca entry offset %d", offset); - return offset >> right_shift; - }) - | hb_sink (dest) - ; - } - - /* requires source of SubsetGlyph complains the identifier isn't declared */ - template <typename Iterator> - bool serialize (hb_serialize_context_t *c, - Iterator it, - bool use_short_loca, - const hb_subset_plan_t *plan) - { - TRACE_SERIALIZE (this); - unsigned init_len = c->length (); - for (const auto &_ : it) _.serialize (c, use_short_loca, plan); - - /* As a special case when all glyph in the font are empty, add a zero byte - * to the table, so that OTS doesn’t reject it, and to make the table work - * on Windows as well. - * See https://github.com/khaledhosny/ots/issues/52 */ - if (init_len == c->length ()) - { - HBUINT8 empty_byte; - empty_byte = 0; - c->copy (empty_byte); - } - return_trace (true); - } - - /* Byte region(s) per glyph to output - unpadded, hints removed if so requested - If we fail to process a glyph we produce an empty (0-length) glyph */ - bool subset (hb_subset_context_t *c) const - { - TRACE_SUBSET (this); - - glyf *glyf_prime = c->serializer->start_embed <glyf> (); - if (unlikely (!c->serializer->check_success (glyf_prime))) return_trace (false); - - hb_vector_t<SubsetGlyph> glyphs; - _populate_subset_glyphs (c->plan, &glyphs); - - auto padded_offsets = - + hb_iter (glyphs) - | hb_map (&SubsetGlyph::padded_size) - ; - - unsigned max_offset = + padded_offsets | hb_reduce (hb_add, 0); - bool use_short_loca = max_offset < 0x1FFFF; - - - glyf_prime->serialize (c->serializer, hb_iter (glyphs), use_short_loca, c->plan); - if (!use_short_loca) { - padded_offsets = - + hb_iter (glyphs) - | hb_map (&SubsetGlyph::length) - ; - } - - - if (unlikely (c->serializer->in_error ())) return_trace (false); - return_trace (c->serializer->check_success (_add_loca_and_head (c->plan, - padded_offsets, - use_short_loca))); - } - - template <typename SubsetGlyph> - void - _populate_subset_glyphs (const hb_subset_plan_t *plan, - hb_vector_t<SubsetGlyph> *glyphs /* OUT */) const - { - OT::glyf::accelerator_t glyf (plan->source); - - + hb_range (plan->num_output_glyphs ()) - | hb_map ([&] (hb_codepoint_t new_gid) - { - SubsetGlyph subset_glyph = {0}; - subset_glyph.new_gid = new_gid; - - /* should never fail: all old gids should be mapped */ - if (!plan->old_gid_for_new_gid (new_gid, &subset_glyph.old_gid)) - return subset_glyph; - - if (new_gid == 0 && - !(plan->flags & HB_SUBSET_FLAGS_NOTDEF_OUTLINE)) - subset_glyph.source_glyph = Glyph (); - else - subset_glyph.source_glyph = glyf.glyph_for_gid (subset_glyph.old_gid, true); - if (plan->flags & HB_SUBSET_FLAGS_NO_HINTING) - subset_glyph.drop_hints_bytes (); - else - subset_glyph.dest_start = subset_glyph.source_glyph.get_bytes (); - return subset_glyph; - }) - | hb_sink (glyphs) - ; - } - - static bool - _add_head_and_set_loca_version (hb_subset_plan_t *plan, bool use_short_loca) - { - hb_blob_t *head_blob = hb_sanitize_context_t ().reference_table<head> (plan->source); - hb_blob_t *head_prime_blob = hb_blob_copy_writable_or_fail (head_blob); - hb_blob_destroy (head_blob); - - if (unlikely (!head_prime_blob)) - return false; - - head *head_prime = (head *) hb_blob_get_data_writable (head_prime_blob, nullptr); - head_prime->indexToLocFormat = use_short_loca ? 0 : 1; - bool success = plan->add_table (HB_OT_TAG_head, head_prime_blob); - - hb_blob_destroy (head_prime_blob); - return success; - } - - struct CompositeGlyphChain - { - protected: - enum composite_glyph_flag_t - { - ARG_1_AND_2_ARE_WORDS = 0x0001, - ARGS_ARE_XY_VALUES = 0x0002, - ROUND_XY_TO_GRID = 0x0004, - WE_HAVE_A_SCALE = 0x0008, - MORE_COMPONENTS = 0x0020, - WE_HAVE_AN_X_AND_Y_SCALE = 0x0040, - WE_HAVE_A_TWO_BY_TWO = 0x0080, - WE_HAVE_INSTRUCTIONS = 0x0100, - USE_MY_METRICS = 0x0200, - OVERLAP_COMPOUND = 0x0400, - SCALED_COMPONENT_OFFSET = 0x0800, - UNSCALED_COMPONENT_OFFSET = 0x1000 - }; - - public: - unsigned int get_size () const - { - unsigned int size = min_size; - /* arg1 and 2 are int16 */ - if (flags & ARG_1_AND_2_ARE_WORDS) size += 4; - /* arg1 and 2 are int8 */ - else size += 2; - - /* One x 16 bit (scale) */ - if (flags & WE_HAVE_A_SCALE) size += 2; - /* Two x 16 bit (xscale, yscale) */ - else if (flags & WE_HAVE_AN_X_AND_Y_SCALE) size += 4; - /* Four x 16 bit (xscale, scale01, scale10, yscale) */ - else if (flags & WE_HAVE_A_TWO_BY_TWO) size += 8; - - return size; - } - - void set_glyph_index (hb_codepoint_t new_gid) { glyphIndex = new_gid; } - hb_codepoint_t get_glyph_index () const { return glyphIndex; } - - void drop_instructions_flag () { flags = (uint16_t) flags & ~WE_HAVE_INSTRUCTIONS; } - void set_overlaps_flag () - { - flags = (uint16_t) flags | OVERLAP_COMPOUND; - } - - bool has_instructions () const { return flags & WE_HAVE_INSTRUCTIONS; } - - bool has_more () const { return flags & MORE_COMPONENTS; } - bool is_use_my_metrics () const { return flags & USE_MY_METRICS; } - bool is_anchored () const { return !(flags & ARGS_ARE_XY_VALUES); } - void get_anchor_points (unsigned int &point1, unsigned int &point2) const - { - const HBUINT8 *p = &StructAfter<const HBUINT8> (glyphIndex); - if (flags & ARG_1_AND_2_ARE_WORDS) - { - point1 = ((const HBUINT16 *) p)[0]; - point2 = ((const HBUINT16 *) p)[1]; - } - else - { - point1 = p[0]; - point2 = p[1]; - } - } - - void transform_points (contour_point_vector_t &points) const - { - float matrix[4]; - contour_point_t trans; - if (get_transformation (matrix, trans)) - { - if (scaled_offsets ()) - { - points.translate (trans); - points.transform (matrix); - } - else - { - points.transform (matrix); - points.translate (trans); - } - } - } - - protected: - bool scaled_offsets () const - { return (flags & (SCALED_COMPONENT_OFFSET | UNSCALED_COMPONENT_OFFSET)) == SCALED_COMPONENT_OFFSET; } - - bool get_transformation (float (&matrix)[4], contour_point_t &trans) const - { - matrix[0] = matrix[3] = 1.f; - matrix[1] = matrix[2] = 0.f; - - int tx, ty; - const HBINT8 *p = &StructAfter<const HBINT8> (glyphIndex); - if (flags & ARG_1_AND_2_ARE_WORDS) - { - tx = *(const HBINT16 *) p; - p += HBINT16::static_size; - ty = *(const HBINT16 *) p; - p += HBINT16::static_size; - } - else - { - tx = *p++; - ty = *p++; - } - if (is_anchored ()) tx = ty = 0; - - trans.init ((float) tx, (float) ty); - - { - const F2DOT14 *points = (const F2DOT14 *) p; - if (flags & WE_HAVE_A_SCALE) - { - matrix[0] = matrix[3] = points[0].to_float (); - return true; - } - else if (flags & WE_HAVE_AN_X_AND_Y_SCALE) - { - matrix[0] = points[0].to_float (); - matrix[3] = points[1].to_float (); - return true; - } - else if (flags & WE_HAVE_A_TWO_BY_TWO) - { - matrix[0] = points[0].to_float (); - matrix[1] = points[1].to_float (); - matrix[2] = points[2].to_float (); - matrix[3] = points[3].to_float (); - return true; - } - } - return tx || ty; - } - - protected: - HBUINT16 flags; - HBGlyphID16 glyphIndex; - public: - DEFINE_SIZE_MIN (4); - }; - - struct composite_iter_t : hb_iter_with_fallback_t<composite_iter_t, const CompositeGlyphChain &> - { - typedef const CompositeGlyphChain *__item_t__; - composite_iter_t (hb_bytes_t glyph_, __item_t__ current_) : - glyph (glyph_), current (nullptr), current_size (0) - { - set_next (current_); - } - - composite_iter_t () : glyph (hb_bytes_t ()), current (nullptr), current_size (0) {} - - const CompositeGlyphChain &__item__ () const { return *current; } - bool __more__ () const { return current; } - void __next__ () - { - if (!current->has_more ()) { current = nullptr; return; } - - set_next (&StructAtOffset<CompositeGlyphChain> (current, current_size)); - } - bool operator != (const composite_iter_t& o) const - { return glyph != o.glyph || current != o.current; } - - - void set_next (const CompositeGlyphChain *composite) - { - if (!glyph.check_range (composite, CompositeGlyphChain::min_size)) - { - current = nullptr; - current_size = 0; - return; - } - unsigned size = composite->get_size (); - if (!glyph.check_range (composite, size)) - { - current = nullptr; - current_size = 0; - return; - } - - current = composite; - current_size = size; - } - - private: - hb_bytes_t glyph; - __item_t__ current; - unsigned current_size; - }; - - enum phantom_point_index_t - { - PHANTOM_LEFT = 0, - PHANTOM_RIGHT = 1, - PHANTOM_TOP = 2, - PHANTOM_BOTTOM = 3, - PHANTOM_COUNT = 4 - }; - - struct accelerator_t; - - struct Glyph - { - enum simple_glyph_flag_t - { - FLAG_ON_CURVE = 0x01, - FLAG_X_SHORT = 0x02, - FLAG_Y_SHORT = 0x04, - FLAG_REPEAT = 0x08, - FLAG_X_SAME = 0x10, - FLAG_Y_SAME = 0x20, - FLAG_OVERLAP_SIMPLE = 0x40, - FLAG_RESERVED2 = 0x80 - }; - - private: - struct GlyphHeader - { - bool has_data () const { return numberOfContours; } - - bool get_extents (hb_font_t *font, const accelerator_t &glyf_accelerator, - hb_codepoint_t gid, hb_glyph_extents_t *extents) const - { - /* Undocumented rasterizer behavior: shift glyph to the left by (lsb - xMin), i.e., xMin = lsb */ - /* extents->x_bearing = hb_min (glyph_header.xMin, glyph_header.xMax); */ - extents->x_bearing = font->em_scale_x (glyf_accelerator.hmtx->get_side_bearing (gid)); - extents->y_bearing = font->em_scale_y (hb_max (yMin, yMax)); - extents->width = font->em_scale_x (hb_max (xMin, xMax) - hb_min (xMin, xMax)); - extents->height = font->em_scale_y (hb_min (yMin, yMax) - hb_max (yMin, yMax)); - - return true; - } - - HBINT16 numberOfContours; - /* If the number of contours is - * greater than or equal to zero, - * this is a simple glyph; if negative, - * this is a composite glyph. */ - FWORD xMin; /* Minimum x for coordinate data. */ - FWORD yMin; /* Minimum y for coordinate data. */ - FWORD xMax; /* Maximum x for coordinate data. */ - FWORD yMax; /* Maximum y for coordinate data. */ - public: - DEFINE_SIZE_STATIC (10); - }; - - struct SimpleGlyph - { - const GlyphHeader &header; - hb_bytes_t bytes; - SimpleGlyph (const GlyphHeader &header_, hb_bytes_t bytes_) : - header (header_), bytes (bytes_) {} - - unsigned int instruction_len_offset () const - { return GlyphHeader::static_size + 2 * header.numberOfContours; } - - unsigned int length (unsigned int instruction_len) const - { return instruction_len_offset () + 2 + instruction_len; } - - unsigned int instructions_length () const - { - unsigned int instruction_length_offset = instruction_len_offset (); - if (unlikely (instruction_length_offset + 2 > bytes.length)) return 0; - - const HBUINT16 &instructionLength = StructAtOffset<HBUINT16> (&bytes, instruction_length_offset); - /* Out of bounds of the current glyph */ - if (unlikely (length (instructionLength) > bytes.length)) return 0; - return instructionLength; - } - - const Glyph trim_padding () const - { - /* based on FontTools _g_l_y_f.py::trim */ - const uint8_t *glyph = (uint8_t*) bytes.arrayZ; - const uint8_t *glyph_end = glyph + bytes.length; - /* simple glyph w/contours, possibly trimmable */ - glyph += instruction_len_offset (); - - if (unlikely (glyph + 2 >= glyph_end)) return Glyph (); - unsigned int num_coordinates = StructAtOffset<HBUINT16> (glyph - 2, 0) + 1; - unsigned int num_instructions = StructAtOffset<HBUINT16> (glyph, 0); - - glyph += 2 + num_instructions; - - unsigned int coord_bytes = 0; - unsigned int coords_with_flags = 0; - while (glyph < glyph_end) - { - uint8_t flag = *glyph; - glyph++; - - unsigned int repeat = 1; - if (flag & FLAG_REPEAT) - { - if (unlikely (glyph >= glyph_end)) return Glyph (); - repeat = *glyph + 1; - glyph++; - } - - unsigned int xBytes, yBytes; - xBytes = yBytes = 0; - if (flag & FLAG_X_SHORT) xBytes = 1; - else if ((flag & FLAG_X_SAME) == 0) xBytes = 2; - - if (flag & FLAG_Y_SHORT) yBytes = 1; - else if ((flag & FLAG_Y_SAME) == 0) yBytes = 2; - - coord_bytes += (xBytes + yBytes) * repeat; - coords_with_flags += repeat; - if (coords_with_flags >= num_coordinates) break; - } - - if (unlikely (coords_with_flags != num_coordinates)) return Glyph (); - return Glyph (bytes.sub_array (0, bytes.length + coord_bytes - (glyph_end - glyph))); - } - - /* zero instruction length */ - void drop_hints () - { - GlyphHeader &glyph_header = const_cast<GlyphHeader &> (header); - (HBUINT16 &) StructAtOffset<HBUINT16> (&glyph_header, instruction_len_offset ()) = 0; - } - - void drop_hints_bytes (hb_bytes_t &dest_start, hb_bytes_t &dest_end) const - { - unsigned int instructions_len = instructions_length (); - unsigned int glyph_length = length (instructions_len); - dest_start = bytes.sub_array (0, glyph_length - instructions_len); - dest_end = bytes.sub_array (glyph_length, bytes.length - glyph_length); - } - - void set_overlaps_flag () - { - if (unlikely (!header.numberOfContours)) return; - - unsigned flags_offset = length (instructions_length ()); - if (unlikely (flags_offset + 1 > bytes.length)) return; - - HBUINT8 &first_flag = (HBUINT8 &) StructAtOffset<HBUINT16> (&bytes, flags_offset); - first_flag = (uint8_t) first_flag | FLAG_OVERLAP_SIMPLE; - } - - static bool read_points (const HBUINT8 *&p /* IN/OUT */, - contour_point_vector_t &points_ /* IN/OUT */, - const hb_bytes_t &bytes, - void (* setter) (contour_point_t &_, float v), - const simple_glyph_flag_t short_flag, - const simple_glyph_flag_t same_flag) - { - float v = 0; - for (unsigned i = 0; i < points_.length; i++) - { - uint8_t flag = points_[i].flag; - if (flag & short_flag) - { - if (unlikely (!bytes.check_range (p))) return false; - if (flag & same_flag) - v += *p++; - else - v -= *p++; - } - else - { - if (!(flag & same_flag)) - { - if (unlikely (!bytes.check_range ((const HBUINT16 *) p))) return false; - v += *(const HBINT16 *) p; - p += HBINT16::static_size; - } - } - setter (points_[i], v); - } - return true; - } - - bool get_contour_points (contour_point_vector_t &points_ /* OUT */, - bool phantom_only = false) const - { - const HBUINT16 *endPtsOfContours = &StructAfter<HBUINT16> (header); - int num_contours = header.numberOfContours; - if (unlikely (!bytes.check_range (&endPtsOfContours[num_contours + 1]))) return false; - unsigned int num_points = endPtsOfContours[num_contours - 1] + 1; - - points_.resize (num_points); - for (unsigned int i = 0; i < points_.length; i++) points_[i].init (); - if (phantom_only) return true; - - for (int i = 0; i < num_contours; i++) - points_[endPtsOfContours[i]].is_end_point = true; - - /* Skip instructions */ - const HBUINT8 *p = &StructAtOffset<HBUINT8> (&endPtsOfContours[num_contours + 1], - endPtsOfContours[num_contours]); - - /* Read flags */ - for (unsigned int i = 0; i < num_points; i++) - { - if (unlikely (!bytes.check_range (p))) return false; - uint8_t flag = *p++; - points_[i].flag = flag; - if (flag & FLAG_REPEAT) - { - if (unlikely (!bytes.check_range (p))) return false; - unsigned int repeat_count = *p++; - while ((repeat_count-- > 0) && (++i < num_points)) - points_[i].flag = flag; - } - } - - /* Read x & y coordinates */ - return read_points (p, points_, bytes, [] (contour_point_t &p, float v) { p.x = v; }, - FLAG_X_SHORT, FLAG_X_SAME) - && read_points (p, points_, bytes, [] (contour_point_t &p, float v) { p.y = v; }, - FLAG_Y_SHORT, FLAG_Y_SAME); - } - }; - - struct CompositeGlyph - { - const GlyphHeader &header; - hb_bytes_t bytes; - CompositeGlyph (const GlyphHeader &header_, hb_bytes_t bytes_) : - header (header_), bytes (bytes_) {} - - composite_iter_t get_iterator () const - { return composite_iter_t (bytes, &StructAfter<CompositeGlyphChain, GlyphHeader> (header)); } - - unsigned int instructions_length (hb_bytes_t bytes) const - { - unsigned int start = bytes.length; - unsigned int end = bytes.length; - const CompositeGlyphChain *last = nullptr; - for (auto &item : get_iterator ()) - last = &item; - if (unlikely (!last)) return 0; - - if (last->has_instructions ()) - start = (char *) last - &bytes + last->get_size (); - if (unlikely (start > end)) return 0; - return end - start; - } - - /* Trimming for composites not implemented. - * If removing hints it falls out of that. */ - const Glyph trim_padding () const { return Glyph (bytes); } - - void drop_hints () - { - for (const auto &_ : get_iterator ()) - const_cast<CompositeGlyphChain &> (_).drop_instructions_flag (); - } - - /* Chop instructions off the end */ - void drop_hints_bytes (hb_bytes_t &dest_start) const - { dest_start = bytes.sub_array (0, bytes.length - instructions_length (bytes)); } - - void set_overlaps_flag () - { - const_cast<CompositeGlyphChain &> (StructAfter<CompositeGlyphChain, GlyphHeader> (header)) - .set_overlaps_flag (); - } - }; - - enum glyph_type_t { EMPTY, SIMPLE, COMPOSITE }; - - public: - composite_iter_t get_composite_iterator () const - { - if (type != COMPOSITE) return composite_iter_t (); - return CompositeGlyph (*header, bytes).get_iterator (); - } - - const Glyph trim_padding () const - { - switch (type) { - case COMPOSITE: return CompositeGlyph (*header, bytes).trim_padding (); - case SIMPLE: return SimpleGlyph (*header, bytes).trim_padding (); - default: return bytes; - } - } - - void drop_hints () - { - switch (type) { - case COMPOSITE: CompositeGlyph (*header, bytes).drop_hints (); return; - case SIMPLE: SimpleGlyph (*header, bytes).drop_hints (); return; - default: return; - } - } - - void set_overlaps_flag () - { - switch (type) { - case COMPOSITE: CompositeGlyph (*header, bytes).set_overlaps_flag (); return; - case SIMPLE: SimpleGlyph (*header, bytes).set_overlaps_flag (); return; - default: return; - } - } - - void drop_hints_bytes (hb_bytes_t &dest_start, hb_bytes_t &dest_end) const - { - switch (type) { - case COMPOSITE: CompositeGlyph (*header, bytes).drop_hints_bytes (dest_start); return; - case SIMPLE: SimpleGlyph (*header, bytes).drop_hints_bytes (dest_start, dest_end); return; - default: return; - } - } - - /* Note: Recursively calls itself. - * all_points includes phantom points - */ - bool get_points (hb_font_t *font, const accelerator_t &glyf_accelerator, - contour_point_vector_t &all_points /* OUT */, - bool phantom_only = false, - unsigned int depth = 0) const - { - if (unlikely (depth > HB_MAX_NESTING_LEVEL)) return false; - contour_point_vector_t points; - - switch (type) { - case COMPOSITE: - { - /* pseudo component points for each component in composite glyph */ - unsigned num_points = hb_len (CompositeGlyph (*header, bytes).get_iterator ()); - if (unlikely (!points.resize (num_points))) return false; - for (unsigned i = 0; i < points.length; i++) - points[i].init (); - break; - } - case SIMPLE: - if (unlikely (!SimpleGlyph (*header, bytes).get_contour_points (points, phantom_only))) - return false; - break; - } - - /* Init phantom points */ - if (unlikely (!points.resize (points.length + PHANTOM_COUNT))) return false; - hb_array_t<contour_point_t> phantoms = points.sub_array (points.length - PHANTOM_COUNT, PHANTOM_COUNT); - { - for (unsigned i = 0; i < PHANTOM_COUNT; ++i) phantoms[i].init (); - int h_delta = (int) header->xMin - - glyf_accelerator.hmtx->get_side_bearing (gid); - int v_orig = (int) header->yMax + -#ifndef HB_NO_VERTICAL - glyf_accelerator.vmtx->get_side_bearing (gid) -#else - 0 -#endif - ; - unsigned h_adv = glyf_accelerator.hmtx->get_advance (gid); - unsigned v_adv = -#ifndef HB_NO_VERTICAL - glyf_accelerator.vmtx->get_advance (gid) -#else - - font->face->get_upem () -#endif - ; - phantoms[PHANTOM_LEFT].x = h_delta; - phantoms[PHANTOM_RIGHT].x = h_adv + h_delta; - phantoms[PHANTOM_TOP].y = v_orig; - phantoms[PHANTOM_BOTTOM].y = v_orig - (int) v_adv; - } - -#ifndef HB_NO_VAR - glyf_accelerator.gvar->apply_deltas_to_points (gid, font, points.as_array ()); -#endif - - switch (type) { - case SIMPLE: - all_points.extend (points.as_array ()); - break; - case COMPOSITE: - { - unsigned int comp_index = 0; - for (auto &item : get_composite_iterator ()) - { - contour_point_vector_t comp_points; - if (unlikely (!glyf_accelerator.glyph_for_gid (item.get_glyph_index ()) - .get_points (font, glyf_accelerator, comp_points, - phantom_only, depth + 1) - || comp_points.length < PHANTOM_COUNT)) - return false; - - /* Copy phantom points from component if USE_MY_METRICS flag set */ - if (item.is_use_my_metrics ()) - for (unsigned int i = 0; i < PHANTOM_COUNT; i++) - phantoms[i] = comp_points[comp_points.length - PHANTOM_COUNT + i]; - - /* Apply component transformation & translation */ - item.transform_points (comp_points); - - /* Apply translation from gvar */ - comp_points.translate (points[comp_index]); - - if (item.is_anchored ()) - { - unsigned int p1, p2; - item.get_anchor_points (p1, p2); - if (likely (p1 < all_points.length && p2 < comp_points.length)) - { - contour_point_t delta; - delta.init (all_points[p1].x - comp_points[p2].x, - all_points[p1].y - comp_points[p2].y); - - comp_points.translate (delta); - } - } - - all_points.extend (comp_points.sub_array (0, comp_points.length - PHANTOM_COUNT)); - - comp_index++; - } - - all_points.extend (phantoms); - } break; - default: - all_points.extend (phantoms); - } - - if (depth == 0) /* Apply at top level */ - { - /* Undocumented rasterizer behavior: - * Shift points horizontally by the updated left side bearing - */ - contour_point_t delta; - delta.init (-phantoms[PHANTOM_LEFT].x, 0.f); - if (delta.x) all_points.translate (delta); - } - - return true; - } - - bool get_extents (hb_font_t *font, const accelerator_t &glyf_accelerator, - hb_glyph_extents_t *extents) const - { - if (type == EMPTY) return true; /* Empty glyph; zero extents. */ - return header->get_extents (font, glyf_accelerator, gid, extents); - } - - hb_bytes_t get_bytes () const { return bytes; } - - Glyph (hb_bytes_t bytes_ = hb_bytes_t (), - hb_codepoint_t gid_ = (hb_codepoint_t) -1) : bytes (bytes_), gid (gid_), - header (bytes.as<GlyphHeader> ()) - { - int num_contours = header->numberOfContours; - if (unlikely (num_contours == 0)) type = EMPTY; - else if (num_contours > 0) type = SIMPLE; - else type = COMPOSITE; /* negative numbers */ - } - - protected: - hb_bytes_t bytes; - hb_codepoint_t gid; - const GlyphHeader *header; - unsigned type; - }; - - struct accelerator_t - { - accelerator_t (hb_face_t *face) - { - short_offset = false; - num_glyphs = 0; - loca_table = nullptr; - glyf_table = nullptr; -#ifndef HB_NO_VAR - gvar = nullptr; -#endif - hmtx = nullptr; -#ifndef HB_NO_VERTICAL - vmtx = nullptr; -#endif - const OT::head &head = *face->table.head; - if (head.indexToLocFormat > 1 || head.glyphDataFormat > 0) - /* Unknown format. Leave num_glyphs=0, that takes care of disabling us. */ - return; - short_offset = 0 == head.indexToLocFormat; - - loca_table = face->table.loca.get_blob (); // Needs no destruct! - glyf_table = hb_sanitize_context_t ().reference_table<glyf> (face); -#ifndef HB_NO_VAR - gvar = face->table.gvar; -#endif - hmtx = face->table.hmtx; -#ifndef HB_NO_VERTICAL - vmtx = face->table.vmtx; -#endif - - num_glyphs = hb_max (1u, loca_table.get_length () / (short_offset ? 2 : 4)) - 1; - num_glyphs = hb_min (num_glyphs, face->get_num_glyphs ()); - } - ~accelerator_t () - { - glyf_table.destroy (); - } - - bool has_data () const { return num_glyphs; } - - protected: - template<typename T> - bool get_points (hb_font_t *font, hb_codepoint_t gid, T consumer) const - { - if (gid >= num_glyphs) return false; - - /* Making this allocfree is not that easy - https://github.com/harfbuzz/harfbuzz/issues/2095 - mostly because of gvar handling in VF fonts, - perhaps a separate path for non-VF fonts can be considered */ - contour_point_vector_t all_points; - - bool phantom_only = !consumer.is_consuming_contour_points (); - if (unlikely (!glyph_for_gid (gid).get_points (font, *this, all_points, phantom_only))) - return false; - - if (consumer.is_consuming_contour_points ()) - { - for (unsigned point_index = 0; point_index + 4 < all_points.length; ++point_index) - consumer.consume_point (all_points[point_index]); - consumer.points_end (); - } - - /* Where to write phantoms, nullptr if not requested */ - contour_point_t *phantoms = consumer.get_phantoms_sink (); - if (phantoms) - for (unsigned i = 0; i < PHANTOM_COUNT; ++i) - phantoms[i] = all_points[all_points.length - PHANTOM_COUNT + i]; - - return true; - } - -#ifndef HB_NO_VAR - struct points_aggregator_t - { - hb_font_t *font; - hb_glyph_extents_t *extents; - contour_point_t *phantoms; - - struct contour_bounds_t - { - contour_bounds_t () { min_x = min_y = FLT_MAX; max_x = max_y = -FLT_MAX; } - - void add (const contour_point_t &p) - { - min_x = hb_min (min_x, p.x); - min_y = hb_min (min_y, p.y); - max_x = hb_max (max_x, p.x); - max_y = hb_max (max_y, p.y); - } - - bool empty () const { return (min_x >= max_x) || (min_y >= max_y); } - - void get_extents (hb_font_t *font, hb_glyph_extents_t *extents) - { - if (unlikely (empty ())) - { - extents->width = 0; - extents->x_bearing = 0; - extents->height = 0; - extents->y_bearing = 0; - return; - } - extents->x_bearing = font->em_scalef_x (min_x); - extents->width = font->em_scalef_x (max_x) - extents->x_bearing; - extents->y_bearing = font->em_scalef_y (max_y); - extents->height = font->em_scalef_y (min_y) - extents->y_bearing; - } - - protected: - float min_x, min_y, max_x, max_y; - } bounds; - - points_aggregator_t (hb_font_t *font_, hb_glyph_extents_t *extents_, contour_point_t *phantoms_) - { - font = font_; - extents = extents_; - phantoms = phantoms_; - if (extents) bounds = contour_bounds_t (); - } - - void consume_point (const contour_point_t &point) { bounds.add (point); } - void points_end () { bounds.get_extents (font, extents); } - - bool is_consuming_contour_points () { return extents; } - contour_point_t *get_phantoms_sink () { return phantoms; } - }; - - public: - unsigned - get_advance_var (hb_font_t *font, hb_codepoint_t gid, bool is_vertical) const - { - if (unlikely (gid >= num_glyphs)) return 0; - - bool success = false; - - contour_point_t phantoms[PHANTOM_COUNT]; - if (likely (font->num_coords == gvar->get_axis_count ())) - success = get_points (font, gid, points_aggregator_t (font, nullptr, phantoms)); - - if (unlikely (!success)) - return -#ifndef HB_NO_VERTICAL - is_vertical ? vmtx->get_advance (gid) : -#endif - hmtx->get_advance (gid); - - float result = is_vertical - ? phantoms[PHANTOM_TOP].y - phantoms[PHANTOM_BOTTOM].y - : phantoms[PHANTOM_RIGHT].x - phantoms[PHANTOM_LEFT].x; - return hb_clamp (roundf (result), 0.f, (float) UINT_MAX / 2); - } - - int get_side_bearing_var (hb_font_t *font, hb_codepoint_t gid, bool is_vertical) const - { - if (unlikely (gid >= num_glyphs)) return 0; - - hb_glyph_extents_t extents; - - contour_point_t phantoms[PHANTOM_COUNT]; - if (unlikely (!get_points (font, gid, points_aggregator_t (font, &extents, phantoms)))) - return -#ifndef HB_NO_VERTICAL - is_vertical ? vmtx->get_side_bearing (gid) : -#endif - hmtx->get_side_bearing (gid); - - return is_vertical - ? ceilf (phantoms[PHANTOM_TOP].y) - extents.y_bearing - : floorf (phantoms[PHANTOM_LEFT].x); - } -#endif - - public: - bool get_extents (hb_font_t *font, hb_codepoint_t gid, hb_glyph_extents_t *extents) const - { - if (unlikely (gid >= num_glyphs)) return false; - -#ifndef HB_NO_VAR - if (font->num_coords && font->num_coords == gvar->get_axis_count ()) - return get_points (font, gid, points_aggregator_t (font, extents, nullptr)); -#endif - return glyph_for_gid (gid).get_extents (font, *this, extents); - } - - const Glyph - glyph_for_gid (hb_codepoint_t gid, bool needs_padding_removal = false) const - { - if (unlikely (gid >= num_glyphs)) return Glyph (); - - unsigned int start_offset, end_offset; - - if (short_offset) - { - const HBUINT16 *offsets = (const HBUINT16 *) loca_table->dataZ.arrayZ; - start_offset = 2 * offsets[gid]; - end_offset = 2 * offsets[gid + 1]; - } - else - { - const HBUINT32 *offsets = (const HBUINT32 *) loca_table->dataZ.arrayZ; - start_offset = offsets[gid]; - end_offset = offsets[gid + 1]; - } - - if (unlikely (start_offset > end_offset || end_offset > glyf_table.get_length ())) - return Glyph (); - - Glyph glyph (hb_bytes_t ((const char *) this->glyf_table + start_offset, - end_offset - start_offset), gid); - return needs_padding_removal ? glyph.trim_padding () : glyph; - } - - unsigned - add_gid_and_children (hb_codepoint_t gid, - hb_set_t *gids_to_retain, - unsigned depth = 0, - unsigned operation_count = 0) const - { - if (unlikely (depth++ > HB_MAX_NESTING_LEVEL)) return operation_count; - if (unlikely (operation_count++ > HB_MAX_COMPOSITE_OPERATIONS)) return operation_count; - /* Check if is already visited */ - if (gids_to_retain->has (gid)) return operation_count; - - gids_to_retain->add (gid); - - auto it = glyph_for_gid (gid).get_composite_iterator (); - while (it) - { - auto item = *(it++); - operation_count = - add_gid_and_children (item.get_glyph_index (), gids_to_retain, depth, operation_count); - } - - return operation_count; - } - - struct path_builder_t - { - hb_font_t *font; - hb_draw_session_t *draw_session; - - struct optional_point_t - { - optional_point_t () { has_data = false; } - optional_point_t (float x_, float y_) { x = x_; y = y_; has_data = true; } - - bool has_data; - float x; - float y; - - optional_point_t lerp (optional_point_t p, float t) - { return optional_point_t (x + t * (p.x - x), y + t * (p.y - y)); } - } first_oncurve, first_offcurve, last_offcurve; - - path_builder_t (hb_font_t *font_, hb_draw_session_t &draw_session_) - { - font = font_; - draw_session = &draw_session_; - first_oncurve = first_offcurve = last_offcurve = optional_point_t (); - } - - /* based on https://github.com/RazrFalcon/ttf-parser/blob/4f32821/src/glyf.rs#L287 - See also: - * https://developer.apple.com/fonts/TrueType-Reference-Manual/RM01/Chap1.html - * https://stackoverflow.com/a/20772557 */ - void consume_point (const contour_point_t &point) - { - bool is_on_curve = point.flag & Glyph::FLAG_ON_CURVE; - optional_point_t p (point.x, point.y); - if (!first_oncurve.has_data) - { - if (is_on_curve) - { - first_oncurve = p; - draw_session->move_to (font->em_fscalef_x (p.x), font->em_fscalef_y (p.y)); - } - else - { - if (first_offcurve.has_data) - { - optional_point_t mid = first_offcurve.lerp (p, .5f); - first_oncurve = mid; - last_offcurve = p; - draw_session->move_to (font->em_fscalef_x (mid.x), font->em_fscalef_y (mid.y)); - } - else - first_offcurve = p; - } - } - else - { - if (last_offcurve.has_data) - { - if (is_on_curve) - { - draw_session->quadratic_to (font->em_fscalef_x (last_offcurve.x), font->em_fscalef_y (last_offcurve.y), - font->em_fscalef_x (p.x), font->em_fscalef_y (p.y)); - last_offcurve = optional_point_t (); - } - else - { - optional_point_t mid = last_offcurve.lerp (p, .5f); - draw_session->quadratic_to (font->em_fscalef_x (last_offcurve.x), font->em_fscalef_y (last_offcurve.y), - font->em_fscalef_x (mid.x), font->em_fscalef_y (mid.y)); - last_offcurve = p; - } - } - else - { - if (is_on_curve) - draw_session->line_to (font->em_fscalef_x (p.x), font->em_fscalef_y (p.y)); - else - last_offcurve = p; - } - } - - if (point.is_end_point) - { - if (first_offcurve.has_data && last_offcurve.has_data) - { - optional_point_t mid = last_offcurve.lerp (first_offcurve, .5f); - draw_session->quadratic_to (font->em_fscalef_x (last_offcurve.x), font->em_fscalef_y (last_offcurve.y), - font->em_fscalef_x (mid.x), font->em_fscalef_y (mid.y)); - last_offcurve = optional_point_t (); - /* now check the rest */ - } - - if (first_offcurve.has_data && first_oncurve.has_data) - draw_session->quadratic_to (font->em_fscalef_x (first_offcurve.x), font->em_fscalef_y (first_offcurve.y), - font->em_fscalef_x (first_oncurve.x), font->em_fscalef_y (first_oncurve.y)); - else if (last_offcurve.has_data && first_oncurve.has_data) - draw_session->quadratic_to (font->em_fscalef_x (last_offcurve.x), font->em_fscalef_y (last_offcurve.y), - font->em_fscalef_x (first_oncurve.x), font->em_fscalef_y (first_oncurve.y)); - else if (first_oncurve.has_data) - draw_session->line_to (font->em_fscalef_x (first_oncurve.x), font->em_fscalef_y (first_oncurve.y)); - else if (first_offcurve.has_data) - { - float x = font->em_fscalef_x (first_offcurve.x), y = font->em_fscalef_x (first_offcurve.y); - draw_session->move_to (x, y); - draw_session->quadratic_to (x, y, x, y); - } - - /* Getting ready for the next contour */ - first_oncurve = first_offcurve = last_offcurve = optional_point_t (); - draw_session->close_path (); - } - } - void points_end () {} - - bool is_consuming_contour_points () { return true; } - contour_point_t *get_phantoms_sink () { return nullptr; } - }; - - bool - get_path (hb_font_t *font, hb_codepoint_t gid, hb_draw_session_t &draw_session) const - { return get_points (font, gid, path_builder_t (font, draw_session)); } - -#ifndef HB_NO_VAR - const gvar_accelerator_t *gvar; -#endif - const hmtx_accelerator_t *hmtx; -#ifndef HB_NO_VERTICAL - const vmtx_accelerator_t *vmtx; -#endif - - private: - bool short_offset; - unsigned int num_glyphs; - hb_blob_ptr_t<loca> loca_table; - hb_blob_ptr_t<glyf> glyf_table; - }; - - struct SubsetGlyph - { - hb_codepoint_t new_gid; - hb_codepoint_t old_gid; - Glyph source_glyph; - hb_bytes_t dest_start; /* region of source_glyph to copy first */ - hb_bytes_t dest_end; /* region of source_glyph to copy second */ - - bool serialize (hb_serialize_context_t *c, - bool use_short_loca, - const hb_subset_plan_t *plan) const - { - TRACE_SERIALIZE (this); - - hb_bytes_t dest_glyph = dest_start.copy (c); - dest_glyph = hb_bytes_t (&dest_glyph, dest_glyph.length + dest_end.copy (c).length); - unsigned int pad_length = use_short_loca ? padding () : 0; - DEBUG_MSG (SUBSET, nullptr, "serialize %d byte glyph, width %d pad %d", dest_glyph.length, dest_glyph.length + pad_length, pad_length); - - HBUINT8 pad; - pad = 0; - while (pad_length > 0) - { - c->embed (pad); - pad_length--; - } - - if (unlikely (!dest_glyph.length)) return_trace (true); - - /* update components gids */ - for (auto &_ : Glyph (dest_glyph).get_composite_iterator ()) - { - hb_codepoint_t new_gid; - if (plan->new_gid_for_old_gid (_.get_glyph_index (), &new_gid)) - const_cast<CompositeGlyphChain &> (_).set_glyph_index (new_gid); - } - - if (plan->flags & HB_SUBSET_FLAGS_NO_HINTING) - Glyph (dest_glyph).drop_hints (); - - if (plan->flags & HB_SUBSET_FLAGS_SET_OVERLAPS_FLAG) - Glyph (dest_glyph).set_overlaps_flag (); - - return_trace (true); - } - - void drop_hints_bytes () - { source_glyph.drop_hints_bytes (dest_start, dest_end); } - - unsigned int length () const { return dest_start.length + dest_end.length; } - /* pad to 2 to ensure 2-byte loca will be ok */ - unsigned int padding () const { return length () % 2; } - unsigned int padded_size () const { return length () + padding (); } - }; - - protected: - UnsizedArrayOf<HBUINT8> - dataZ; /* Glyphs data. */ - public: - DEFINE_SIZE_MIN (0); /* In reality, this is UNBOUNDED() type; but since we always - * check the size externally, allow Null() object of it by - * defining it _MIN instead. */ -}; - -struct glyf_accelerator_t : glyf::accelerator_t { - glyf_accelerator_t (hb_face_t *face) : glyf::accelerator_t (face) {} -}; - - -} /* namespace OT */ - +#include "OT/glyf/glyf.hh" #endif /* HB_OT_GLYF_TABLE_HH */ diff --git a/thirdparty/harfbuzz/src/hb-ot-hmtx-table.hh b/thirdparty/harfbuzz/src/hb-ot-hmtx-table.hh index d5e1fc91d2..d0e46e0b0f 100644 --- a/thirdparty/harfbuzz/src/hb-ot-hmtx-table.hh +++ b/thirdparty/harfbuzz/src/hb-ot-hmtx-table.hh @@ -242,7 +242,7 @@ struct hmtxvmtx return side_bearing; if (var_table.get_length ()) - return side_bearing + var_table->get_side_bearing_var (glyph, font->coords, font->num_coords); // TODO Optimize?! + return side_bearing + var_table->get_side_bearing_var (glyph, font->coords, font->num_coords); return _glyf_get_side_bearing_var (font, glyph, T::tableTag == HB_OT_TAG_vmtx); #else @@ -284,7 +284,8 @@ struct hmtxvmtx } unsigned int get_advance (hb_codepoint_t glyph, - hb_font_t *font) const + hb_font_t *font, + VariationStore::cache_t *store_cache = nullptr) const { unsigned int advance = get_advance (glyph); @@ -293,7 +294,7 @@ struct hmtxvmtx return advance; if (var_table.get_length ()) - return advance + roundf (var_table->get_advance_var (glyph, font)); // TODO Optimize?! + return advance + roundf (var_table->get_advance_var (glyph, font, store_cache)); // TODO Optimize?! return _glyf_get_advance_var (font, glyph, T::tableTag == HB_OT_TAG_vmtx); #else @@ -310,7 +311,7 @@ struct hmtxvmtx unsigned int default_advance; - private: + public: hb_blob_ptr_t<hmtxvmtx> table; hb_blob_ptr_t<HVARVVAR> var_table; }; diff --git a/thirdparty/harfbuzz/src/hb-ot-layout-common.hh b/thirdparty/harfbuzz/src/hb-ot-layout-common.hh index b644df708d..d343805346 100644 --- a/thirdparty/harfbuzz/src/hb-ot-layout-common.hh +++ b/thirdparty/harfbuzz/src/hb-ot-layout-common.hh @@ -102,7 +102,7 @@ static void ClassDef_remap_and_serialize ( struct hb_prune_langsys_context_t { hb_prune_langsys_context_t (const void *table_, - hb_hashmap_t<unsigned, hb_set_t *> *script_langsys_map_, + hb_hashmap_t<unsigned, hb::unique_ptr<hb_set_t>> *script_langsys_map_, const hb_map_t *duplicate_feature_map_, hb_set_t *new_collected_feature_indexes_) :table (table_), @@ -122,7 +122,7 @@ struct hb_prune_langsys_context_t public: const void *table; - hb_hashmap_t<unsigned, hb_set_t *> *script_langsys_map; + hb_hashmap_t<unsigned, hb::unique_ptr<hb_set_t>> *script_langsys_map; const hb_map_t *duplicate_feature_map; hb_set_t *new_feature_indexes; @@ -162,14 +162,14 @@ struct hb_subset_layout_context_t : hb_subset_context_t *subset_context; const hb_tag_t table_tag; const hb_map_t *lookup_index_map; - const hb_hashmap_t<unsigned, hb_set_t *> *script_langsys_map; + const hb_hashmap_t<unsigned, hb::unique_ptr<hb_set_t>> *script_langsys_map; const hb_map_t *feature_index_map; unsigned cur_script_index; hb_subset_layout_context_t (hb_subset_context_t *c_, hb_tag_t tag_, hb_map_t *lookup_map_, - hb_hashmap_t<unsigned, hb_set_t *> *script_langsys_map_, + hb_hashmap_t<unsigned, hb::unique_ptr<hb_set_t>> *script_langsys_map_, hb_map_t *feature_index_map_) : subset_context (c_), table_tag (tag_), @@ -659,7 +659,8 @@ struct LangSys auto *out = c->serializer->start_embed (*this); if (unlikely (!out || !c->serializer->extend_min (out))) return_trace (false); - out->reqFeatureIndex = l->feature_index_map->has (reqFeatureIndex) ? l->feature_index_map->get (reqFeatureIndex) : 0xFFFFu; + const unsigned *v; + out->reqFeatureIndex = l->feature_index_map->has (reqFeatureIndex, &v) ? *v : 0xFFFFu; if (!l->visitFeatureIndex (featureIndex.len)) return_trace (false); @@ -722,12 +723,8 @@ struct Script if (!c->script_langsys_map->has (script_index)) { - hb_set_t* empty_set = hb_set_create (); - if (unlikely (!c->script_langsys_map->set (script_index, empty_set))) - { - hb_set_destroy (empty_set); + if (unlikely (!c->script_langsys_map->set (script_index, hb::unique_ptr<hb_set_t> {hb_set_create ()}))) return; - } } unsigned langsys_count = get_lang_sys_count (); @@ -2004,6 +2001,8 @@ struct ClassDefFormat1 return_trace (c->check_struct (this) && classValue.sanitize (c)); } + unsigned cost () const { return 1; } + template <typename set_t> bool collect_coverage (set_t *glyphs) const { @@ -2240,6 +2239,8 @@ struct ClassDefFormat2 return_trace (rangeRecord.sanitize (c)); } + unsigned cost () const { return hb_bit_storage ((unsigned) rangeRecord.len); /* bsearch cost */ } + template <typename set_t> bool collect_coverage (set_t *glyphs) const { @@ -2480,6 +2481,15 @@ struct ClassDef } } + unsigned cost () const + { + switch (u.format) { + case 1: return u.format1.cost (); + case 2: return u.format2.cost (); + default:return 0u; + } + } + /* Might return false if array looks unsorted. * Used for faster rejection of corrupt data. */ template <typename set_t> @@ -2601,14 +2611,27 @@ struct VarRegionAxis DEFINE_SIZE_STATIC (6); }; +#define REGION_CACHE_ITEM_CACHE_INVALID 2.f + struct VarRegionList { + using cache_t = float; + float evaluate (unsigned int region_index, - const int *coords, unsigned int coord_len) const + const int *coords, unsigned int coord_len, + cache_t *cache = nullptr) const { if (unlikely (region_index >= regionCount)) return 0.; + float *cached_value = nullptr; + if (cache) + { + cached_value = &(cache[region_index]); + if (likely (*cached_value != REGION_CACHE_ITEM_CACHE_INVALID)) + return *cached_value; + } + const VarRegionAxis *axes = axesZ.arrayZ + (region_index * axisCount); float v = 1.; @@ -2618,9 +2641,16 @@ struct VarRegionList int coord = i < coord_len ? coords[i] : 0; float factor = axes[i].evaluate (coord); if (factor == 0.f) + { + if (cache) + *cached_value = 0.; return 0.; + } v *= factor; } + + if (cache) + *cached_value = v; return v; } @@ -2668,7 +2698,7 @@ struct VarData { return regionIndices.len; } unsigned int get_row_size () const - { return shortCount + regionIndices.len; } + { return (wordCount () + regionIndices.len) * (longWords () ? 2 : 1); } unsigned int get_size () const { return min_size @@ -2678,13 +2708,17 @@ struct VarData float get_delta (unsigned int inner, const int *coords, unsigned int coord_count, - const VarRegionList ®ions) const + const VarRegionList ®ions, + VarRegionList::cache_t *cache = nullptr) const { if (unlikely (inner >= itemCount)) return 0.; unsigned int count = regionIndices.len; - unsigned int scount = shortCount; + bool is_long = longWords (); + unsigned word_count = wordCount (); + unsigned int scount = is_long ? count - word_count : word_count; + unsigned int lcount = is_long ? word_count : 0; const HBUINT8 *bytes = get_delta_bytes (); const HBUINT8 *row = bytes + inner * (scount + count); @@ -2692,16 +2726,22 @@ struct VarData float delta = 0.; unsigned int i = 0; - const HBINT16 *scursor = reinterpret_cast<const HBINT16 *> (row); + const HBINT16 *lcursor = reinterpret_cast<const HBINT16 *> (row); + for (; i < lcount; i++) + { + float scalar = regions.evaluate (regionIndices.arrayZ[i], coords, coord_count, cache); + delta += scalar * *lcursor++; + } + const HBINT16 *scursor = reinterpret_cast<const HBINT16 *> (lcursor); for (; i < scount; i++) { - float scalar = regions.evaluate (regionIndices.arrayZ[i], coords, coord_count); + float scalar = regions.evaluate (regionIndices.arrayZ[i], coords, coord_count, cache); delta += scalar * *scursor++; } const HBINT8 *bcursor = reinterpret_cast<const HBINT8 *> (scursor); for (; i < count; i++) { - float scalar = regions.evaluate (regionIndices.arrayZ[i], coords, coord_count); + float scalar = regions.evaluate (regionIndices.arrayZ[i], coords, coord_count, cache); delta += scalar * *bcursor++; } @@ -2725,7 +2765,7 @@ struct VarData TRACE_SANITIZE (this); return_trace (c->check_struct (this) && regionIndices.sanitize (c) && - shortCount <= regionIndices.len && + wordCount () <= regionIndices.len && c->check_range (get_delta_bytes (), itemCount, get_row_size ())); @@ -2740,43 +2780,66 @@ struct VarData if (unlikely (!c->extend_min (this))) return_trace (false); itemCount = inner_map.get_next_value (); - /* Optimize short count */ - unsigned short ri_count = src->regionIndices.len; - enum delta_size_t { kZero=0, kByte, kShort }; + /* Optimize word count */ + unsigned ri_count = src->regionIndices.len; + enum delta_size_t { kZero=0, kNonWord, kWord }; hb_vector_t<delta_size_t> delta_sz; hb_vector_t<unsigned int> ri_map; /* maps old index to new index */ delta_sz.resize (ri_count); ri_map.resize (ri_count); - unsigned int new_short_count = 0; + unsigned int new_word_count = 0; unsigned int r; + + bool has_long = false; + if (src->longWords ()) + { + for (r = 0; r < ri_count; r++) + { + for (unsigned int i = 0; i < inner_map.get_next_value (); i++) + { + unsigned int old = inner_map.backward (i); + int32_t delta = src->get_item_delta (old, r); + if (delta < -65536 || 65535 < delta) + { + has_long = true; + break; + } + } + } + } + + signed min_threshold = has_long ? -65536 : -128; + signed max_threshold = has_long ? +65535 : +127; for (r = 0; r < ri_count; r++) { delta_sz[r] = kZero; for (unsigned int i = 0; i < inner_map.get_next_value (); i++) { unsigned int old = inner_map.backward (i); - int16_t delta = src->get_item_delta (old, r); - if (delta < -128 || 127 < delta) + int32_t delta = src->get_item_delta (old, r); + if (delta < min_threshold || max_threshold < delta) { - delta_sz[r] = kShort; - new_short_count++; + delta_sz[r] = kWord; + new_word_count++; break; } else if (delta != 0) - delta_sz[r] = kByte; + delta_sz[r] = kNonWord; } } - unsigned int short_index = 0; - unsigned int byte_index = new_short_count; + + unsigned int word_index = 0; + unsigned int non_word_index = new_word_count; unsigned int new_ri_count = 0; for (r = 0; r < ri_count; r++) if (delta_sz[r]) { - ri_map[r] = (delta_sz[r] == kShort)? short_index++ : byte_index++; + ri_map[r] = (delta_sz[r] == kWord)? word_index++ : non_word_index++; new_ri_count++; } - shortCount = new_short_count; + wordSizeCount = new_word_count | (has_long ? 0x8000u /* LONG_WORDS */ : 0); + regionIndices.len = new_ri_count; if (unlikely (!c->extend (this))) return_trace (false); @@ -2816,28 +2879,55 @@ struct VarData HBUINT8 *get_delta_bytes () { return &StructAfter<HBUINT8> (regionIndices); } - int16_t get_item_delta (unsigned int item, unsigned int region) const + int32_t get_item_delta (unsigned int item, unsigned int region) const { if ( item >= itemCount || unlikely (region >= regionIndices.len)) return 0; - const HBINT8 *p = (const HBINT8 *)get_delta_bytes () + item * get_row_size (); - if (region < shortCount) - return ((const HBINT16 *)p)[region]; + const HBINT8 *p = (const HBINT8 *) get_delta_bytes () + item * get_row_size (); + unsigned word_count = wordCount (); + bool is_long = longWords (); + if (is_long) + { + if (region < word_count) + return ((const HBINT32 *) p)[region]; + else + return ((const HBINT16 *)(p + HBINT32::static_size * word_count))[region - word_count]; + } else - return (p + HBINT16::static_size * shortCount)[region - shortCount]; + { + if (region < word_count) + return ((const HBINT16 *) p)[region]; + else + return (p + HBINT16::static_size * word_count)[region - word_count]; + } } - void set_item_delta (unsigned int item, unsigned int region, int16_t delta) + void set_item_delta (unsigned int item, unsigned int region, int32_t delta) { HBINT8 *p = (HBINT8 *)get_delta_bytes () + item * get_row_size (); - if (region < shortCount) - ((HBINT16 *)p)[region] = delta; + unsigned word_count = wordCount (); + bool is_long = longWords (); + if (is_long) + { + if (region < word_count) + ((HBINT32 *) p)[region] = delta; + else + ((HBINT16 *)(p + HBINT32::static_size * word_count))[region - word_count] = delta; + } else - (p + HBINT16::static_size * shortCount)[region - shortCount] = delta; + { + if (region < word_count) + ((HBINT16 *) p)[region] = delta; + else + (p + HBINT16::static_size * word_count)[region - word_count] = delta; + } } + bool longWords () const { return wordSizeCount & 0x8000u /* LONG_WORDS */; } + unsigned wordCount () const { return wordSizeCount & 0x7FFFu /* WORD_DELTA_COUNT_MASK */; } + protected: HBUINT16 itemCount; - HBUINT16 shortCount; + HBUINT16 wordSizeCount; Array16Of<HBUINT16> regionIndices; /*UnsizedArrayOf<HBUINT8>bytesX;*/ public: @@ -2846,9 +2936,28 @@ struct VarData struct VariationStore { + using cache_t = VarRegionList::cache_t; + + cache_t *create_cache () const + { + auto &r = this+regions; + unsigned count = r.regionCount; + + float *cache = (float *) hb_malloc (sizeof (float) * count); + if (unlikely (!cache)) return nullptr; + + for (unsigned i = 0; i < count; i++) + cache[i] = REGION_CACHE_ITEM_CACHE_INVALID; + + return cache; + } + + static void destroy_cache (cache_t *cache) { hb_free (cache); } + private: float get_delta (unsigned int outer, unsigned int inner, - const int *coords, unsigned int coord_count) const + const int *coords, unsigned int coord_count, + VarRegionList::cache_t *cache = nullptr) const { #ifdef HB_NO_VAR return 0.f; @@ -2859,16 +2968,18 @@ struct VariationStore return (this+dataSets[outer]).get_delta (inner, coords, coord_count, - this+regions); + this+regions, + cache); } public: float get_delta (unsigned int index, - const int *coords, unsigned int coord_count) const + const int *coords, unsigned int coord_count, + VarRegionList::cache_t *cache = nullptr) const { unsigned int outer = index >> 16; unsigned int inner = index & 0xFFFF; - return get_delta (outer, inner, coords, coord_count); + return get_delta (outer, inner, coords, coord_count, cache); } bool sanitize (hb_sanitize_context_t *c) const @@ -2995,6 +3106,8 @@ struct VariationStore DEFINE_SIZE_ARRAY_SIZED (8, dataSets); }; +#undef REGION_CACHE_ITEM_CACHE_INVALID + /* * Feature Variations */ @@ -3462,11 +3575,15 @@ struct VariationDevice private: - hb_position_t get_x_delta (hb_font_t *font, const VariationStore &store) const - { return font->em_scalef_x (get_delta (font, store)); } + hb_position_t get_x_delta (hb_font_t *font, + const VariationStore &store, + VariationStore::cache_t *store_cache = nullptr) const + { return font->em_scalef_x (get_delta (font, store, store_cache)); } - hb_position_t get_y_delta (hb_font_t *font, const VariationStore &store) const - { return font->em_scalef_y (get_delta (font, store)); } + hb_position_t get_y_delta (hb_font_t *font, + const VariationStore &store, + VariationStore::cache_t *store_cache = nullptr) const + { return font->em_scalef_y (get_delta (font, store, store_cache)); } VariationDevice* copy (hb_serialize_context_t *c, const hb_map_t *layout_variation_idx_map) const { @@ -3500,9 +3617,11 @@ struct VariationDevice private: - float get_delta (hb_font_t *font, const VariationStore &store) const + float get_delta (hb_font_t *font, + const VariationStore &store, + VariationStore::cache_t *store_cache = nullptr) const { - return store.get_delta (varIdx, font->coords, font->num_coords); + return store.get_delta (varIdx, font->coords, font->num_coords, (VariationStore::cache_t *) store_cache); } protected: @@ -3525,7 +3644,9 @@ struct DeviceHeader struct Device { - hb_position_t get_x_delta (hb_font_t *font, const VariationStore &store=Null (VariationStore)) const + hb_position_t get_x_delta (hb_font_t *font, + const VariationStore &store=Null (VariationStore), + VariationStore::cache_t *store_cache = nullptr) const { switch (u.b.format) { @@ -3535,13 +3656,15 @@ struct Device #endif #ifndef HB_NO_VAR case 0x8000: - return u.variation.get_x_delta (font, store); + return u.variation.get_x_delta (font, store, store_cache); #endif default: return 0; } } - hb_position_t get_y_delta (hb_font_t *font, const VariationStore &store=Null (VariationStore)) const + hb_position_t get_y_delta (hb_font_t *font, + const VariationStore &store=Null (VariationStore), + VariationStore::cache_t *store_cache = nullptr) const { switch (u.b.format) { @@ -3551,7 +3674,7 @@ struct Device #endif #ifndef HB_NO_VAR case 0x8000: - return u.variation.get_y_delta (font, store); + return u.variation.get_y_delta (font, store, store_cache); #endif default: return 0; diff --git a/thirdparty/harfbuzz/src/hb-ot-layout-gdef-table.hh b/thirdparty/harfbuzz/src/hb-ot-layout-gdef-table.hh index a76d644c4b..9d47bac2b9 100644 --- a/thirdparty/harfbuzz/src/hb-ot-layout-gdef-table.hh +++ b/thirdparty/harfbuzz/src/hb-ot-layout-gdef-table.hh @@ -571,7 +571,7 @@ struct GDEF static_assert (((unsigned int) HB_OT_LAYOUT_GLYPH_PROPS_MARK == (unsigned int) LookupFlag::IgnoreMarks), ""); switch (klass) { - default: return 0; + default: return HB_OT_LAYOUT_GLYPH_CLASS_UNCLASSIFIED; case BaseGlyph: return HB_OT_LAYOUT_GLYPH_PROPS_BASE_GLYPH; case LigatureGlyph: return HB_OT_LAYOUT_GLYPH_PROPS_LIGATURE; case MarkGlyph: diff --git a/thirdparty/harfbuzz/src/hb-ot-layout-gpos-table.hh b/thirdparty/harfbuzz/src/hb-ot-layout-gpos-table.hh index 2f9186a2a7..064d31cdff 100644 --- a/thirdparty/harfbuzz/src/hb-ot-layout-gpos-table.hh +++ b/thirdparty/harfbuzz/src/hb-ot-layout-gpos-table.hh @@ -29,3090 +29,14 @@ #ifndef HB_OT_LAYOUT_GPOS_TABLE_HH #define HB_OT_LAYOUT_GPOS_TABLE_HH -#include "hb-ot-layout-gsubgpos.hh" - +#include "OT/Layout/GPOS.hh" namespace OT { -struct MarkArray; -static void Markclass_closure_and_remap_indexes (const Coverage &mark_coverage, - const MarkArray &mark_array, - const hb_set_t &glyphset, - hb_map_t* klass_mapping /* INOUT */); - -/* buffer **position** var allocations */ -#define attach_chain() var.i16[0] /* glyph to which this attaches to, relative to current glyphs; negative for going back, positive for forward. */ -#define attach_type() var.u8[2] /* attachment type */ -/* Note! if attach_chain() is zero, the value of attach_type() is irrelevant. */ - -enum attach_type_t { - ATTACH_TYPE_NONE = 0X00, - - /* Each attachment should be either a mark or a cursive; can't be both. */ - ATTACH_TYPE_MARK = 0X01, - ATTACH_TYPE_CURSIVE = 0X02, -}; - - -/* Shared Tables: ValueRecord, Anchor Table, and MarkArray */ - -typedef HBUINT16 Value; - -typedef UnsizedArrayOf<Value> ValueRecord; - -struct ValueFormat : HBUINT16 -{ - enum Flags { - xPlacement = 0x0001u, /* Includes horizontal adjustment for placement */ - yPlacement = 0x0002u, /* Includes vertical adjustment for placement */ - xAdvance = 0x0004u, /* Includes horizontal adjustment for advance */ - yAdvance = 0x0008u, /* Includes vertical adjustment for advance */ - xPlaDevice = 0x0010u, /* Includes horizontal Device table for placement */ - yPlaDevice = 0x0020u, /* Includes vertical Device table for placement */ - xAdvDevice = 0x0040u, /* Includes horizontal Device table for advance */ - yAdvDevice = 0x0080u, /* Includes vertical Device table for advance */ - ignored = 0x0F00u, /* Was used in TrueType Open for MM fonts */ - reserved = 0xF000u, /* For future use */ - - devices = 0x00F0u /* Mask for having any Device table */ - }; - -/* All fields are options. Only those available advance the value pointer. */ -#if 0 - HBINT16 xPlacement; /* Horizontal adjustment for - * placement--in design units */ - HBINT16 yPlacement; /* Vertical adjustment for - * placement--in design units */ - HBINT16 xAdvance; /* Horizontal adjustment for - * advance--in design units (only used - * for horizontal writing) */ - HBINT16 yAdvance; /* Vertical adjustment for advance--in - * design units (only used for vertical - * writing) */ - Offset16To<Device> xPlaDevice; /* Offset to Device table for - * horizontal placement--measured from - * beginning of PosTable (may be NULL) */ - Offset16To<Device> yPlaDevice; /* Offset to Device table for vertical - * placement--measured from beginning - * of PosTable (may be NULL) */ - Offset16To<Device> xAdvDevice; /* Offset to Device table for - * horizontal advance--measured from - * beginning of PosTable (may be NULL) */ - Offset16To<Device> yAdvDevice; /* Offset to Device table for vertical - * advance--measured from beginning of - * PosTable (may be NULL) */ -#endif - - IntType& operator = (uint16_t i) { v = i; return *this; } - - unsigned int get_len () const { return hb_popcount ((unsigned int) *this); } - unsigned int get_size () const { return get_len () * Value::static_size; } - - bool apply_value (hb_ot_apply_context_t *c, - const void *base, - const Value *values, - hb_glyph_position_t &glyph_pos) const - { - bool ret = false; - unsigned int format = *this; - if (!format) return ret; - - hb_font_t *font = c->font; - bool horizontal = -#ifndef HB_NO_VERTICAL - HB_DIRECTION_IS_HORIZONTAL (c->direction) -#else - true -#endif - ; - - if (format & xPlacement) glyph_pos.x_offset += font->em_scale_x (get_short (values++, &ret)); - if (format & yPlacement) glyph_pos.y_offset += font->em_scale_y (get_short (values++, &ret)); - if (format & xAdvance) { - if (likely (horizontal)) glyph_pos.x_advance += font->em_scale_x (get_short (values, &ret)); - values++; - } - /* y_advance values grow downward but font-space grows upward, hence negation */ - if (format & yAdvance) { - if (unlikely (!horizontal)) glyph_pos.y_advance -= font->em_scale_y (get_short (values, &ret)); - values++; - } - - if (!has_device ()) return ret; - - bool use_x_device = font->x_ppem || font->num_coords; - bool use_y_device = font->y_ppem || font->num_coords; - - if (!use_x_device && !use_y_device) return ret; - - const VariationStore &store = c->var_store; - - /* pixel -> fractional pixel */ - if (format & xPlaDevice) { - if (use_x_device) glyph_pos.x_offset += (base + get_device (values, &ret)).get_x_delta (font, store); - values++; - } - if (format & yPlaDevice) { - if (use_y_device) glyph_pos.y_offset += (base + get_device (values, &ret)).get_y_delta (font, store); - values++; - } - if (format & xAdvDevice) { - if (horizontal && use_x_device) glyph_pos.x_advance += (base + get_device (values, &ret)).get_x_delta (font, store); - values++; - } - if (format & yAdvDevice) { - /* y_advance values grow downward but font-space grows upward, hence negation */ - if (!horizontal && use_y_device) glyph_pos.y_advance -= (base + get_device (values, &ret)).get_y_delta (font, store); - values++; - } - return ret; - } - - unsigned int get_effective_format (const Value *values) const - { - unsigned int format = *this; - for (unsigned flag = xPlacement; flag <= yAdvDevice; flag = flag << 1) { - if (format & flag) should_drop (*values++, (Flags) flag, &format); - } - - return format; - } - - template<typename Iterator, - hb_requires (hb_is_iterator (Iterator))> - unsigned int get_effective_format (Iterator it) const { - unsigned int new_format = 0; - - for (const hb_array_t<const Value>& values : it) - new_format = new_format | get_effective_format (&values); - - return new_format; - } - - void copy_values (hb_serialize_context_t *c, - unsigned int new_format, - const void *base, - const Value *values, - const hb_map_t *layout_variation_idx_map) const - { - unsigned int format = *this; - if (!format) return; - - if (format & xPlacement) copy_value (c, new_format, xPlacement, *values++); - if (format & yPlacement) copy_value (c, new_format, yPlacement, *values++); - if (format & xAdvance) copy_value (c, new_format, xAdvance, *values++); - if (format & yAdvance) copy_value (c, new_format, yAdvance, *values++); - - if (format & xPlaDevice) copy_device (c, base, values++, layout_variation_idx_map); - if (format & yPlaDevice) copy_device (c, base, values++, layout_variation_idx_map); - if (format & xAdvDevice) copy_device (c, base, values++, layout_variation_idx_map); - if (format & yAdvDevice) copy_device (c, base, values++, layout_variation_idx_map); - } - - void copy_value (hb_serialize_context_t *c, - unsigned int new_format, - Flags flag, - Value value) const - { - // Filter by new format. - if (!(new_format & flag)) return; - c->copy (value); - } - - void collect_variation_indices (hb_collect_variation_indices_context_t *c, - const void *base, - const hb_array_t<const Value>& values) const - { - unsigned format = *this; - unsigned i = 0; - if (format & xPlacement) i++; - if (format & yPlacement) i++; - if (format & xAdvance) i++; - if (format & yAdvance) i++; - if (format & xPlaDevice) - { - (base + get_device (&(values[i]))).collect_variation_indices (c->layout_variation_indices); - i++; - } - - if (format & ValueFormat::yPlaDevice) - { - (base + get_device (&(values[i]))).collect_variation_indices (c->layout_variation_indices); - i++; - } - - if (format & ValueFormat::xAdvDevice) - { - - (base + get_device (&(values[i]))).collect_variation_indices (c->layout_variation_indices); - i++; - } - - if (format & ValueFormat::yAdvDevice) - { - - (base + get_device (&(values[i]))).collect_variation_indices (c->layout_variation_indices); - i++; - } - } - - private: - bool sanitize_value_devices (hb_sanitize_context_t *c, const void *base, const Value *values) const - { - unsigned int format = *this; - - if (format & xPlacement) values++; - if (format & yPlacement) values++; - if (format & xAdvance) values++; - if (format & yAdvance) values++; - - if ((format & xPlaDevice) && !get_device (values++).sanitize (c, base)) return false; - if ((format & yPlaDevice) && !get_device (values++).sanitize (c, base)) return false; - if ((format & xAdvDevice) && !get_device (values++).sanitize (c, base)) return false; - if ((format & yAdvDevice) && !get_device (values++).sanitize (c, base)) return false; - - return true; - } - - static inline Offset16To<Device>& get_device (Value* value) - { - return *static_cast<Offset16To<Device> *> (value); - } - static inline const Offset16To<Device>& get_device (const Value* value, bool *worked=nullptr) - { - if (worked) *worked |= bool (*value); - return *static_cast<const Offset16To<Device> *> (value); - } - - bool copy_device (hb_serialize_context_t *c, const void *base, - const Value *src_value, const hb_map_t *layout_variation_idx_map) const - { - Value *dst_value = c->copy (*src_value); - - if (!dst_value) return false; - if (*dst_value == 0) return true; - - *dst_value = 0; - c->push (); - if ((base + get_device (src_value)).copy (c, layout_variation_idx_map)) - { - c->add_link (*dst_value, c->pop_pack ()); - return true; - } - else - { - c->pop_discard (); - return false; - } - } - - static inline const HBINT16& get_short (const Value* value, bool *worked=nullptr) - { - if (worked) *worked |= bool (*value); - return *reinterpret_cast<const HBINT16 *> (value); - } - - public: - - bool has_device () const - { - unsigned int format = *this; - return (format & devices) != 0; - } - - bool sanitize_value (hb_sanitize_context_t *c, const void *base, const Value *values) const - { - TRACE_SANITIZE (this); - return_trace (c->check_range (values, get_size ()) && (!has_device () || sanitize_value_devices (c, base, values))); - } - - bool sanitize_values (hb_sanitize_context_t *c, const void *base, const Value *values, unsigned int count) const - { - TRACE_SANITIZE (this); - unsigned int len = get_len (); - - if (!c->check_range (values, count, get_size ())) return_trace (false); - - if (!has_device ()) return_trace (true); - - for (unsigned int i = 0; i < count; i++) { - if (!sanitize_value_devices (c, base, values)) - return_trace (false); - values += len; - } - - return_trace (true); - } - - /* Just sanitize referenced Device tables. Doesn't check the values themselves. */ - bool sanitize_values_stride_unsafe (hb_sanitize_context_t *c, const void *base, const Value *values, unsigned int count, unsigned int stride) const - { - TRACE_SANITIZE (this); - - if (!has_device ()) return_trace (true); - - for (unsigned int i = 0; i < count; i++) { - if (!sanitize_value_devices (c, base, values)) - return_trace (false); - values += stride; - } - - return_trace (true); - } - - private: - - void should_drop (Value value, Flags flag, unsigned int* format) const - { - if (value) return; - *format = *format & ~flag; - } - -}; - -template<typename Iterator, typename SrcLookup> -static void SinglePos_serialize (hb_serialize_context_t *c, - const SrcLookup *src, - Iterator it, - const hb_map_t *layout_variation_idx_map); - - -struct AnchorFormat1 -{ - void get_anchor (hb_ot_apply_context_t *c, hb_codepoint_t glyph_id HB_UNUSED, - float *x, float *y) const - { - hb_font_t *font = c->font; - *x = font->em_fscale_x (xCoordinate); - *y = font->em_fscale_y (yCoordinate); - } - - bool sanitize (hb_sanitize_context_t *c) const - { - TRACE_SANITIZE (this); - return_trace (c->check_struct (this)); - } - - AnchorFormat1* copy (hb_serialize_context_t *c) const - { - TRACE_SERIALIZE (this); - AnchorFormat1* out = c->embed<AnchorFormat1> (this); - if (!out) return_trace (out); - out->format = 1; - return_trace (out); - } - - protected: - HBUINT16 format; /* Format identifier--format = 1 */ - FWORD xCoordinate; /* Horizontal value--in design units */ - FWORD yCoordinate; /* Vertical value--in design units */ - public: - DEFINE_SIZE_STATIC (6); -}; - -struct AnchorFormat2 -{ - void get_anchor (hb_ot_apply_context_t *c, hb_codepoint_t glyph_id, - float *x, float *y) const - { - hb_font_t *font = c->font; - -#ifdef HB_NO_HINTING - *x = font->em_fscale_x (xCoordinate); - *y = font->em_fscale_y (yCoordinate); - return; -#endif - - unsigned int x_ppem = font->x_ppem; - unsigned int y_ppem = font->y_ppem; - hb_position_t cx = 0, cy = 0; - bool ret; - - ret = (x_ppem || y_ppem) && - font->get_glyph_contour_point_for_origin (glyph_id, anchorPoint, HB_DIRECTION_LTR, &cx, &cy); - *x = ret && x_ppem ? cx : font->em_fscale_x (xCoordinate); - *y = ret && y_ppem ? cy : font->em_fscale_y (yCoordinate); - } - - bool sanitize (hb_sanitize_context_t *c) const - { - TRACE_SANITIZE (this); - return_trace (c->check_struct (this)); - } - - AnchorFormat2* copy (hb_serialize_context_t *c) const - { - TRACE_SERIALIZE (this); - return_trace (c->embed<AnchorFormat2> (this)); - } - - protected: - HBUINT16 format; /* Format identifier--format = 2 */ - FWORD xCoordinate; /* Horizontal value--in design units */ - FWORD yCoordinate; /* Vertical value--in design units */ - HBUINT16 anchorPoint; /* Index to glyph contour point */ - public: - DEFINE_SIZE_STATIC (8); -}; - -struct AnchorFormat3 -{ - void get_anchor (hb_ot_apply_context_t *c, hb_codepoint_t glyph_id HB_UNUSED, - float *x, float *y) const - { - hb_font_t *font = c->font; - *x = font->em_fscale_x (xCoordinate); - *y = font->em_fscale_y (yCoordinate); - - if (font->x_ppem || font->num_coords) - *x += (this+xDeviceTable).get_x_delta (font, c->var_store); - if (font->y_ppem || font->num_coords) - *y += (this+yDeviceTable).get_y_delta (font, c->var_store); - } - - bool sanitize (hb_sanitize_context_t *c) const - { - TRACE_SANITIZE (this); - return_trace (c->check_struct (this) && xDeviceTable.sanitize (c, this) && yDeviceTable.sanitize (c, this)); - } - - AnchorFormat3* copy (hb_serialize_context_t *c, - const hb_map_t *layout_variation_idx_map) const - { - TRACE_SERIALIZE (this); - if (!layout_variation_idx_map) return_trace (nullptr); - - auto *out = c->embed<AnchorFormat3> (this); - if (unlikely (!out)) return_trace (nullptr); - - out->xDeviceTable.serialize_copy (c, xDeviceTable, this, 0, hb_serialize_context_t::Head, layout_variation_idx_map); - out->yDeviceTable.serialize_copy (c, yDeviceTable, this, 0, hb_serialize_context_t::Head, layout_variation_idx_map); - return_trace (out); - } - - void collect_variation_indices (hb_collect_variation_indices_context_t *c) const - { - (this+xDeviceTable).collect_variation_indices (c->layout_variation_indices); - (this+yDeviceTable).collect_variation_indices (c->layout_variation_indices); - } - - protected: - HBUINT16 format; /* Format identifier--format = 3 */ - FWORD xCoordinate; /* Horizontal value--in design units */ - FWORD yCoordinate; /* Vertical value--in design units */ - Offset16To<Device> - xDeviceTable; /* Offset to Device table for X - * coordinate-- from beginning of - * Anchor table (may be NULL) */ - Offset16To<Device> - yDeviceTable; /* Offset to Device table for Y - * coordinate-- from beginning of - * Anchor table (may be NULL) */ - public: - DEFINE_SIZE_STATIC (10); -}; - -struct Anchor -{ - void get_anchor (hb_ot_apply_context_t *c, hb_codepoint_t glyph_id, - float *x, float *y) const - { - *x = *y = 0; - switch (u.format) { - case 1: u.format1.get_anchor (c, glyph_id, x, y); return; - case 2: u.format2.get_anchor (c, glyph_id, x, y); return; - case 3: u.format3.get_anchor (c, glyph_id, x, y); return; - default: return; - } - } - - bool sanitize (hb_sanitize_context_t *c) const - { - TRACE_SANITIZE (this); - if (!u.format.sanitize (c)) return_trace (false); - switch (u.format) { - case 1: return_trace (u.format1.sanitize (c)); - case 2: return_trace (u.format2.sanitize (c)); - case 3: return_trace (u.format3.sanitize (c)); - default:return_trace (true); - } - } - - bool subset (hb_subset_context_t *c) const - { - TRACE_SUBSET (this); - switch (u.format) { - case 1: return_trace (bool (reinterpret_cast<Anchor *> (u.format1.copy (c->serializer)))); - case 2: - if (c->plan->flags & HB_SUBSET_FLAGS_NO_HINTING) - { - // AnchorFormat 2 just containins extra hinting information, so - // if hints are being dropped convert to format 1. - return_trace (bool (reinterpret_cast<Anchor *> (u.format1.copy (c->serializer)))); - } - return_trace (bool (reinterpret_cast<Anchor *> (u.format2.copy (c->serializer)))); - case 3: return_trace (bool (reinterpret_cast<Anchor *> (u.format3.copy (c->serializer, - c->plan->layout_variation_idx_map)))); - default:return_trace (false); - } - } - - void collect_variation_indices (hb_collect_variation_indices_context_t *c) const - { - switch (u.format) { - case 1: case 2: - return; - case 3: - u.format3.collect_variation_indices (c); - return; - default: return; - } - } - - protected: - union { - HBUINT16 format; /* Format identifier */ - AnchorFormat1 format1; - AnchorFormat2 format2; - AnchorFormat3 format3; - } u; - public: - DEFINE_SIZE_UNION (2, format); -}; - - -struct AnchorMatrix -{ - const Anchor& get_anchor (unsigned int row, unsigned int col, - unsigned int cols, bool *found) const - { - *found = false; - if (unlikely (row >= rows || col >= cols)) return Null (Anchor); - *found = !matrixZ[row * cols + col].is_null (); - return this+matrixZ[row * cols + col]; - } - - template <typename Iterator, - hb_requires (hb_is_iterator (Iterator))> - void collect_variation_indices (hb_collect_variation_indices_context_t *c, - Iterator index_iter) const - { - for (unsigned i : index_iter) - (this+matrixZ[i]).collect_variation_indices (c); - } - - template <typename Iterator, - hb_requires (hb_is_iterator (Iterator))> - bool subset (hb_subset_context_t *c, - unsigned num_rows, - Iterator index_iter) const - { - TRACE_SUBSET (this); - - auto *out = c->serializer->start_embed (this); - - if (!index_iter) return_trace (false); - if (unlikely (!c->serializer->extend_min (out))) return_trace (false); - - out->rows = num_rows; - for (const unsigned i : index_iter) - { - auto *offset = c->serializer->embed (matrixZ[i]); - if (!offset) return_trace (false); - offset->serialize_subset (c, matrixZ[i], this); - } - - return_trace (true); - } - - bool sanitize (hb_sanitize_context_t *c, unsigned int cols) const - { - TRACE_SANITIZE (this); - if (!c->check_struct (this)) return_trace (false); - if (unlikely (hb_unsigned_mul_overflows (rows, cols))) return_trace (false); - unsigned int count = rows * cols; - if (!c->check_array (matrixZ.arrayZ, count)) return_trace (false); - for (unsigned int i = 0; i < count; i++) - if (!matrixZ[i].sanitize (c, this)) return_trace (false); - return_trace (true); - } - - HBUINT16 rows; /* Number of rows */ - UnsizedArrayOf<Offset16To<Anchor>> - matrixZ; /* Matrix of offsets to Anchor tables-- - * from beginning of AnchorMatrix table */ - public: - DEFINE_SIZE_ARRAY (2, matrixZ); -}; - - -struct MarkRecord -{ - friend struct MarkArray; - - unsigned get_class () const { return (unsigned) klass; } - bool sanitize (hb_sanitize_context_t *c, const void *base) const - { - TRACE_SANITIZE (this); - return_trace (c->check_struct (this) && markAnchor.sanitize (c, base)); - } - - MarkRecord *subset (hb_subset_context_t *c, - const void *src_base, - const hb_map_t *klass_mapping) const - { - TRACE_SUBSET (this); - auto *out = c->serializer->embed (this); - if (unlikely (!out)) return_trace (nullptr); - - out->klass = klass_mapping->get (klass); - out->markAnchor.serialize_subset (c, markAnchor, src_base); - return_trace (out); - } - - void collect_variation_indices (hb_collect_variation_indices_context_t *c, - const void *src_base) const - { - (src_base+markAnchor).collect_variation_indices (c); - } - - protected: - HBUINT16 klass; /* Class defined for this mark */ - Offset16To<Anchor> - markAnchor; /* Offset to Anchor table--from - * beginning of MarkArray table */ - public: - DEFINE_SIZE_STATIC (4); -}; - -struct MarkArray : Array16Of<MarkRecord> /* Array of MarkRecords--in Coverage order */ -{ - bool apply (hb_ot_apply_context_t *c, - unsigned int mark_index, unsigned int glyph_index, - const AnchorMatrix &anchors, unsigned int class_count, - unsigned int glyph_pos) const - { - TRACE_APPLY (this); - hb_buffer_t *buffer = c->buffer; - const MarkRecord &record = Array16Of<MarkRecord>::operator[](mark_index); - unsigned int mark_class = record.klass; - - const Anchor& mark_anchor = this + record.markAnchor; - bool found; - const Anchor& glyph_anchor = anchors.get_anchor (glyph_index, mark_class, class_count, &found); - /* If this subtable doesn't have an anchor for this base and this class, - * return false such that the subsequent subtables have a chance at it. */ - if (unlikely (!found)) return_trace (false); - - float mark_x, mark_y, base_x, base_y; - - buffer->unsafe_to_break (glyph_pos, buffer->idx + 1); - mark_anchor.get_anchor (c, buffer->cur().codepoint, &mark_x, &mark_y); - glyph_anchor.get_anchor (c, buffer->info[glyph_pos].codepoint, &base_x, &base_y); - - hb_glyph_position_t &o = buffer->cur_pos(); - o.x_offset = roundf (base_x - mark_x); - o.y_offset = roundf (base_y - mark_y); - o.attach_type() = ATTACH_TYPE_MARK; - o.attach_chain() = (int) glyph_pos - (int) buffer->idx; - buffer->scratch_flags |= HB_BUFFER_SCRATCH_FLAG_HAS_GPOS_ATTACHMENT; - - buffer->idx++; - return_trace (true); - } - - template <typename Iterator, - hb_requires (hb_is_iterator (Iterator))> - bool subset (hb_subset_context_t *c, - Iterator coverage, - const hb_map_t *klass_mapping) const - { - TRACE_SUBSET (this); - const hb_set_t &glyphset = *c->plan->glyphset_gsub (); - - auto* out = c->serializer->start_embed (this); - if (unlikely (!c->serializer->extend_min (out))) return_trace (false); - - auto mark_iter = - + hb_zip (coverage, this->iter ()) - | hb_filter (glyphset, hb_first) - | hb_map (hb_second) - ; - - unsigned new_length = 0; - for (const auto& mark_record : mark_iter) { - if (unlikely (!mark_record.subset (c, this, klass_mapping))) - return_trace (false); - new_length++; - } - - if (unlikely (!c->serializer->check_assign (out->len, new_length, - HB_SERIALIZE_ERROR_ARRAY_OVERFLOW))) - return_trace (false); - - return_trace (true); - } - - bool sanitize (hb_sanitize_context_t *c) const - { - TRACE_SANITIZE (this); - return_trace (Array16Of<MarkRecord>::sanitize (c, this)); - } -}; - - -/* Lookups */ - -struct SinglePosFormat1 -{ - bool intersects (const hb_set_t *glyphs) const - { return (this+coverage).intersects (glyphs); } - - void closure_lookups (hb_closure_lookups_context_t *c) const {} - void collect_variation_indices (hb_collect_variation_indices_context_t *c) const - { - if (!valueFormat.has_device ()) return; - - auto it = - + hb_iter (this+coverage) - | hb_filter (c->glyph_set) - ; - - if (!it) return; - valueFormat.collect_variation_indices (c, this, values.as_array (valueFormat.get_len ())); - } - - void collect_glyphs (hb_collect_glyphs_context_t *c) const - { if (unlikely (!(this+coverage).collect_coverage (c->input))) return; } - - const Coverage &get_coverage () const { return this+coverage; } - - ValueFormat get_value_format () const { return valueFormat; } - - bool apply (hb_ot_apply_context_t *c) const - { - TRACE_APPLY (this); - hb_buffer_t *buffer = c->buffer; - unsigned int index = (this+coverage).get_coverage (buffer->cur().codepoint); - if (likely (index == NOT_COVERED)) return_trace (false); - - valueFormat.apply_value (c, this, values, buffer->cur_pos()); - - buffer->idx++; - return_trace (true); - } - - template<typename Iterator, - typename SrcLookup, - hb_requires (hb_is_iterator (Iterator))> - void serialize (hb_serialize_context_t *c, - const SrcLookup *src, - Iterator it, - ValueFormat newFormat, - const hb_map_t *layout_variation_idx_map) - { - if (unlikely (!c->extend_min (this))) return; - if (unlikely (!c->check_assign (valueFormat, - newFormat, - HB_SERIALIZE_ERROR_INT_OVERFLOW))) return; - - for (const hb_array_t<const Value>& _ : + it | hb_map (hb_second)) - { - src->get_value_format ().copy_values (c, newFormat, src, &_, layout_variation_idx_map); - // Only serialize the first entry in the iterator, the rest are assumed to - // be the same. - break; - } - - auto glyphs = - + it - | hb_map_retains_sorting (hb_first) - ; - - coverage.serialize_serialize (c, glyphs); - } - - bool subset (hb_subset_context_t *c) const - { - TRACE_SUBSET (this); - const hb_set_t &glyphset = *c->plan->glyphset_gsub (); - const hb_map_t &glyph_map = *c->plan->glyph_map; - - auto it = - + hb_iter (this+coverage) - | hb_filter (glyphset) - | hb_map_retains_sorting (glyph_map) - | hb_zip (hb_repeat (values.as_array (valueFormat.get_len ()))) - ; - - bool ret = bool (it); - SinglePos_serialize (c->serializer, this, it, c->plan->layout_variation_idx_map); - return_trace (ret); - } - - bool sanitize (hb_sanitize_context_t *c) const - { - TRACE_SANITIZE (this); - return_trace (c->check_struct (this) && - coverage.sanitize (c, this) && - valueFormat.sanitize_value (c, this, values)); - } - - protected: - HBUINT16 format; /* Format identifier--format = 1 */ - Offset16To<Coverage> - coverage; /* Offset to Coverage table--from - * beginning of subtable */ - ValueFormat valueFormat; /* Defines the types of data in the - * ValueRecord */ - ValueRecord values; /* Defines positioning - * value(s)--applied to all glyphs in - * the Coverage table */ - public: - DEFINE_SIZE_ARRAY (6, values); -}; - -struct SinglePosFormat2 -{ - bool intersects (const hb_set_t *glyphs) const - { return (this+coverage).intersects (glyphs); } - - void closure_lookups (hb_closure_lookups_context_t *c) const {} - void collect_variation_indices (hb_collect_variation_indices_context_t *c) const - { - if (!valueFormat.has_device ()) return; - - auto it = - + hb_zip (this+coverage, hb_range ((unsigned) valueCount)) - | hb_filter (c->glyph_set, hb_first) - ; - - if (!it) return; - - unsigned sub_length = valueFormat.get_len (); - const hb_array_t<const Value> values_array = values.as_array (valueCount * sub_length); - - for (unsigned i : + it - | hb_map (hb_second)) - valueFormat.collect_variation_indices (c, this, values_array.sub_array (i * sub_length, sub_length)); - - } - - void collect_glyphs (hb_collect_glyphs_context_t *c) const - { if (unlikely (!(this+coverage).collect_coverage (c->input))) return; } - - const Coverage &get_coverage () const { return this+coverage; } - - ValueFormat get_value_format () const { return valueFormat; } - - bool apply (hb_ot_apply_context_t *c) const - { - TRACE_APPLY (this); - hb_buffer_t *buffer = c->buffer; - unsigned int index = (this+coverage).get_coverage (buffer->cur().codepoint); - if (likely (index == NOT_COVERED)) return_trace (false); - - if (likely (index >= valueCount)) return_trace (false); - - valueFormat.apply_value (c, this, - &values[index * valueFormat.get_len ()], - buffer->cur_pos()); - - buffer->idx++; - return_trace (true); - } - - template<typename Iterator, - typename SrcLookup, - hb_requires (hb_is_iterator (Iterator))> - void serialize (hb_serialize_context_t *c, - const SrcLookup *src, - Iterator it, - ValueFormat newFormat, - const hb_map_t *layout_variation_idx_map) - { - auto out = c->extend_min (this); - if (unlikely (!out)) return; - if (unlikely (!c->check_assign (valueFormat, newFormat, HB_SERIALIZE_ERROR_INT_OVERFLOW))) return; - if (unlikely (!c->check_assign (valueCount, it.len (), HB_SERIALIZE_ERROR_ARRAY_OVERFLOW))) return; - - + it - | hb_map (hb_second) - | hb_apply ([&] (hb_array_t<const Value> _) - { src->get_value_format ().copy_values (c, newFormat, src, &_, layout_variation_idx_map); }) - ; - - auto glyphs = - + it - | hb_map_retains_sorting (hb_first) - ; - - coverage.serialize_serialize (c, glyphs); - } - - bool subset (hb_subset_context_t *c) const - { - TRACE_SUBSET (this); - const hb_set_t &glyphset = *c->plan->glyphset_gsub (); - const hb_map_t &glyph_map = *c->plan->glyph_map; - - unsigned sub_length = valueFormat.get_len (); - auto values_array = values.as_array (valueCount * sub_length); - - auto it = - + hb_zip (this+coverage, hb_range ((unsigned) valueCount)) - | hb_filter (glyphset, hb_first) - | hb_map_retains_sorting ([&] (const hb_pair_t<hb_codepoint_t, unsigned>& _) - { - return hb_pair (glyph_map[_.first], - values_array.sub_array (_.second * sub_length, - sub_length)); - }) - ; - - bool ret = bool (it); - SinglePos_serialize (c->serializer, this, it, c->plan->layout_variation_idx_map); - return_trace (ret); - } - - bool sanitize (hb_sanitize_context_t *c) const - { - TRACE_SANITIZE (this); - return_trace (c->check_struct (this) && - coverage.sanitize (c, this) && - valueFormat.sanitize_values (c, this, values, valueCount)); - } - - protected: - HBUINT16 format; /* Format identifier--format = 2 */ - Offset16To<Coverage> - coverage; /* Offset to Coverage table--from - * beginning of subtable */ - ValueFormat valueFormat; /* Defines the types of data in the - * ValueRecord */ - HBUINT16 valueCount; /* Number of ValueRecords */ - ValueRecord values; /* Array of ValueRecords--positioning - * values applied to glyphs */ - public: - DEFINE_SIZE_ARRAY (8, values); -}; - -struct SinglePos -{ - template<typename Iterator, - hb_requires (hb_is_iterator (Iterator))> - unsigned get_format (Iterator glyph_val_iter_pairs) - { - hb_array_t<const Value> first_val_iter = hb_second (*glyph_val_iter_pairs); - - for (const auto iter : glyph_val_iter_pairs) - for (const auto _ : hb_zip (iter.second, first_val_iter)) - if (_.first != _.second) - return 2; - - return 1; - } - - - template<typename Iterator, - typename SrcLookup, - hb_requires (hb_is_iterator (Iterator))> - void serialize (hb_serialize_context_t *c, - const SrcLookup* src, - Iterator glyph_val_iter_pairs, - const hb_map_t *layout_variation_idx_map) - { - if (unlikely (!c->extend_min (u.format))) return; - unsigned format = 2; - ValueFormat new_format = src->get_value_format (); - - if (glyph_val_iter_pairs) - { - format = get_format (glyph_val_iter_pairs); - new_format = src->get_value_format ().get_effective_format (+ glyph_val_iter_pairs | hb_map (hb_second)); - } - - u.format = format; - switch (u.format) { - case 1: u.format1.serialize (c, - src, - glyph_val_iter_pairs, - new_format, - layout_variation_idx_map); - return; - case 2: u.format2.serialize (c, - src, - glyph_val_iter_pairs, - new_format, - layout_variation_idx_map); - return; - default:return; - } - } - - template <typename context_t, typename ...Ts> - typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const - { - TRACE_DISPATCH (this, u.format); - if (unlikely (!c->may_dispatch (this, &u.format))) return_trace (c->no_dispatch_return_value ()); - switch (u.format) { - case 1: return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...)); - case 2: return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...)); - default:return_trace (c->default_return_value ()); - } - } - - protected: - union { - HBUINT16 format; /* Format identifier */ - SinglePosFormat1 format1; - SinglePosFormat2 format2; - } u; -}; - -template<typename Iterator, typename SrcLookup> -static void -SinglePos_serialize (hb_serialize_context_t *c, - const SrcLookup *src, - Iterator it, - const hb_map_t *layout_variation_idx_map) -{ c->start_embed<SinglePos> ()->serialize (c, src, it, layout_variation_idx_map); } - - -struct PairValueRecord -{ - friend struct PairSet; - - int cmp (hb_codepoint_t k) const - { return secondGlyph.cmp (k); } - - struct context_t - { - const void *base; - const ValueFormat *valueFormats; - const ValueFormat *newFormats; - unsigned len1; /* valueFormats[0].get_len() */ - const hb_map_t *glyph_map; - const hb_map_t *layout_variation_idx_map; - }; - - bool subset (hb_subset_context_t *c, - context_t *closure) const - { - TRACE_SERIALIZE (this); - auto *s = c->serializer; - auto *out = s->start_embed (*this); - if (unlikely (!s->extend_min (out))) return_trace (false); - - out->secondGlyph = (*closure->glyph_map)[secondGlyph]; - - closure->valueFormats[0].copy_values (s, - closure->newFormats[0], - closure->base, &values[0], - closure->layout_variation_idx_map); - closure->valueFormats[1].copy_values (s, - closure->newFormats[1], - closure->base, - &values[closure->len1], - closure->layout_variation_idx_map); - - return_trace (true); - } - - void collect_variation_indices (hb_collect_variation_indices_context_t *c, - const ValueFormat *valueFormats, - const void *base) const - { - unsigned record1_len = valueFormats[0].get_len (); - unsigned record2_len = valueFormats[1].get_len (); - const hb_array_t<const Value> values_array = values.as_array (record1_len + record2_len); - - if (valueFormats[0].has_device ()) - valueFormats[0].collect_variation_indices (c, base, values_array.sub_array (0, record1_len)); - - if (valueFormats[1].has_device ()) - valueFormats[1].collect_variation_indices (c, base, values_array.sub_array (record1_len, record2_len)); - } - - bool intersects (const hb_set_t& glyphset) const - { - return glyphset.has(secondGlyph); - } - - const Value* get_values_1 () const - { - return &values[0]; - } - - const Value* get_values_2 (ValueFormat format1) const - { - return &values[format1.get_len ()]; - } - - protected: - HBGlyphID16 secondGlyph; /* GlyphID of second glyph in the - * pair--first glyph is listed in the - * Coverage table */ - ValueRecord values; /* Positioning data for the first glyph - * followed by for second glyph */ - public: - DEFINE_SIZE_ARRAY (2, values); -}; - -struct PairSet -{ - friend struct PairPosFormat1; - - bool intersects (const hb_set_t *glyphs, - const ValueFormat *valueFormats) const - { - unsigned int len1 = valueFormats[0].get_len (); - unsigned int len2 = valueFormats[1].get_len (); - unsigned int record_size = HBUINT16::static_size * (1 + len1 + len2); - - const PairValueRecord *record = &firstPairValueRecord; - unsigned int count = len; - for (unsigned int i = 0; i < count; i++) - { - if (glyphs->has (record->secondGlyph)) - return true; - record = &StructAtOffset<const PairValueRecord> (record, record_size); - } - return false; - } - - void collect_glyphs (hb_collect_glyphs_context_t *c, - const ValueFormat *valueFormats) const - { - unsigned int len1 = valueFormats[0].get_len (); - unsigned int len2 = valueFormats[1].get_len (); - unsigned int record_size = HBUINT16::static_size * (1 + len1 + len2); - - const PairValueRecord *record = &firstPairValueRecord; - c->input->add_array (&record->secondGlyph, len, record_size); - } - - void collect_variation_indices (hb_collect_variation_indices_context_t *c, - const ValueFormat *valueFormats) const - { - unsigned len1 = valueFormats[0].get_len (); - unsigned len2 = valueFormats[1].get_len (); - unsigned record_size = HBUINT16::static_size * (1 + len1 + len2); - - const PairValueRecord *record = &firstPairValueRecord; - unsigned count = len; - for (unsigned i = 0; i < count; i++) - { - if (c->glyph_set->has (record->secondGlyph)) - { record->collect_variation_indices (c, valueFormats, this); } - - record = &StructAtOffset<const PairValueRecord> (record, record_size); - } - } - - bool apply (hb_ot_apply_context_t *c, - const ValueFormat *valueFormats, - unsigned int pos) const - { - TRACE_APPLY (this); - hb_buffer_t *buffer = c->buffer; - unsigned int len1 = valueFormats[0].get_len (); - unsigned int len2 = valueFormats[1].get_len (); - unsigned int record_size = HBUINT16::static_size * (1 + len1 + len2); - - const PairValueRecord *record = hb_bsearch (buffer->info[pos].codepoint, - &firstPairValueRecord, - len, - record_size); - if (record) - { - bool applied_first = valueFormats[0].apply_value (c, this, &record->values[0], buffer->cur_pos()); - bool applied_second = valueFormats[1].apply_value (c, this, &record->values[len1], buffer->pos[pos]); - if (applied_first || applied_second) - buffer->unsafe_to_break (buffer->idx, pos + 1); - if (len2) - pos++; - buffer->idx = pos; - return_trace (true); - } - buffer->unsafe_to_concat (buffer->idx, pos + 1); - return_trace (false); - } - - bool subset (hb_subset_context_t *c, - const ValueFormat valueFormats[2], - const ValueFormat newFormats[2]) const - { - TRACE_SUBSET (this); - auto snap = c->serializer->snapshot (); - - auto *out = c->serializer->start_embed (*this); - if (unlikely (!c->serializer->extend_min (out))) return_trace (false); - out->len = 0; - - const hb_set_t &glyphset = *c->plan->glyphset_gsub (); - const hb_map_t &glyph_map = *c->plan->glyph_map; - - unsigned len1 = valueFormats[0].get_len (); - unsigned len2 = valueFormats[1].get_len (); - unsigned record_size = HBUINT16::static_size + Value::static_size * (len1 + len2); - - PairValueRecord::context_t context = - { - this, - valueFormats, - newFormats, - len1, - &glyph_map, - c->plan->layout_variation_idx_map - }; - - const PairValueRecord *record = &firstPairValueRecord; - unsigned count = len, num = 0; - for (unsigned i = 0; i < count; i++) - { - if (glyphset.has (record->secondGlyph) - && record->subset (c, &context)) num++; - record = &StructAtOffset<const PairValueRecord> (record, record_size); - } - - out->len = num; - if (!num) c->serializer->revert (snap); - return_trace (num); - } - - struct sanitize_closure_t - { - const ValueFormat *valueFormats; - unsigned int len1; /* valueFormats[0].get_len() */ - unsigned int stride; /* 1 + len1 + len2 */ - }; - - bool sanitize (hb_sanitize_context_t *c, const sanitize_closure_t *closure) const - { - TRACE_SANITIZE (this); - if (!(c->check_struct (this) - && c->check_range (&firstPairValueRecord, - len, - HBUINT16::static_size, - closure->stride))) return_trace (false); - - unsigned int count = len; - const PairValueRecord *record = &firstPairValueRecord; - return_trace (closure->valueFormats[0].sanitize_values_stride_unsafe (c, this, &record->values[0], count, closure->stride) && - closure->valueFormats[1].sanitize_values_stride_unsafe (c, this, &record->values[closure->len1], count, closure->stride)); - } - - protected: - HBUINT16 len; /* Number of PairValueRecords */ - PairValueRecord firstPairValueRecord; - /* Array of PairValueRecords--ordered - * by GlyphID of the second glyph */ - public: - DEFINE_SIZE_MIN (2); -}; - -struct PairPosFormat1 -{ - bool intersects (const hb_set_t *glyphs) const - { - return - + hb_zip (this+coverage, pairSet) - | hb_filter (*glyphs, hb_first) - | hb_map (hb_second) - | hb_map ([glyphs, this] (const Offset16To<PairSet> &_) - { return (this+_).intersects (glyphs, valueFormat); }) - | hb_any - ; - } - - void closure_lookups (hb_closure_lookups_context_t *c) const {} - void collect_variation_indices (hb_collect_variation_indices_context_t *c) const - { - if ((!valueFormat[0].has_device ()) && (!valueFormat[1].has_device ())) return; - - auto it = - + hb_zip (this+coverage, pairSet) - | hb_filter (c->glyph_set, hb_first) - | hb_map (hb_second) - ; - - if (!it) return; - + it - | hb_map (hb_add (this)) - | hb_apply ([&] (const PairSet& _) { _.collect_variation_indices (c, valueFormat); }) - ; - } - - void collect_glyphs (hb_collect_glyphs_context_t *c) const - { - if (unlikely (!(this+coverage).collect_coverage (c->input))) return; - unsigned int count = pairSet.len; - for (unsigned int i = 0; i < count; i++) - (this+pairSet[i]).collect_glyphs (c, valueFormat); - } - - const Coverage &get_coverage () const { return this+coverage; } - - bool apply (hb_ot_apply_context_t *c) const - { - TRACE_APPLY (this); - hb_buffer_t *buffer = c->buffer; - unsigned int index = (this+coverage).get_coverage (buffer->cur().codepoint); - if (likely (index == NOT_COVERED)) return_trace (false); - - hb_ot_apply_context_t::skipping_iterator_t &skippy_iter = c->iter_input; - skippy_iter.reset (buffer->idx, 1); - unsigned unsafe_to; - if (!skippy_iter.next (&unsafe_to)) - { - buffer->unsafe_to_concat (buffer->idx, unsafe_to); - return_trace (false); - } - - return_trace ((this+pairSet[index]).apply (c, valueFormat, skippy_iter.idx)); - } - - bool subset (hb_subset_context_t *c) const - { - TRACE_SUBSET (this); - - const hb_set_t &glyphset = *c->plan->glyphset_gsub (); - const hb_map_t &glyph_map = *c->plan->glyph_map; - - auto *out = c->serializer->start_embed (*this); - if (unlikely (!c->serializer->extend_min (out))) return_trace (false); - out->format = format; - out->valueFormat[0] = valueFormat[0]; - out->valueFormat[1] = valueFormat[1]; - if (c->plan->flags & HB_SUBSET_FLAGS_NO_HINTING) - { - hb_pair_t<unsigned, unsigned> newFormats = compute_effective_value_formats (glyphset); - out->valueFormat[0] = newFormats.first; - out->valueFormat[1] = newFormats.second; - } - - hb_sorted_vector_t<hb_codepoint_t> new_coverage; - - + hb_zip (this+coverage, pairSet) - | hb_filter (glyphset, hb_first) - | hb_filter ([this, c, out] (const Offset16To<PairSet>& _) - { - auto snap = c->serializer->snapshot (); - auto *o = out->pairSet.serialize_append (c->serializer); - if (unlikely (!o)) return false; - bool ret = o->serialize_subset (c, _, this, valueFormat, out->valueFormat); - if (!ret) - { - out->pairSet.pop (); - c->serializer->revert (snap); - } - return ret; - }, - hb_second) - | hb_map (hb_first) - | hb_map (glyph_map) - | hb_sink (new_coverage) - ; - - out->coverage.serialize_serialize (c->serializer, new_coverage.iter ()); - - return_trace (bool (new_coverage)); - } - - - hb_pair_t<unsigned, unsigned> compute_effective_value_formats (const hb_set_t& glyphset) const - { - unsigned len1 = valueFormat[0].get_len (); - unsigned len2 = valueFormat[1].get_len (); - unsigned record_size = HBUINT16::static_size + Value::static_size * (len1 + len2); - - unsigned format1 = 0; - unsigned format2 = 0; - for (const Offset16To<PairSet>& _ : - + hb_zip (this+coverage, pairSet) | hb_filter (glyphset, hb_first) | hb_map (hb_second)) - { - const PairSet& set = (this + _); - const PairValueRecord *record = &set.firstPairValueRecord; - - for (unsigned i = 0; i < set.len; i++) - { - if (record->intersects (glyphset)) - { - format1 = format1 | valueFormat[0].get_effective_format (record->get_values_1 ()); - format2 = format2 | valueFormat[1].get_effective_format (record->get_values_2 (valueFormat[0])); - } - record = &StructAtOffset<const PairValueRecord> (record, record_size); - } - } - - return hb_pair (format1, format2); - } - - - bool sanitize (hb_sanitize_context_t *c) const - { - TRACE_SANITIZE (this); - - if (!c->check_struct (this)) return_trace (false); - - unsigned int len1 = valueFormat[0].get_len (); - unsigned int len2 = valueFormat[1].get_len (); - PairSet::sanitize_closure_t closure = - { - valueFormat, - len1, - 1 + len1 + len2 - }; - - return_trace (coverage.sanitize (c, this) && pairSet.sanitize (c, this, &closure)); - } - - protected: - HBUINT16 format; /* Format identifier--format = 1 */ - Offset16To<Coverage> - coverage; /* Offset to Coverage table--from - * beginning of subtable */ - ValueFormat valueFormat[2]; /* [0] Defines the types of data in - * ValueRecord1--for the first glyph - * in the pair--may be zero (0) */ - /* [1] Defines the types of data in - * ValueRecord2--for the second glyph - * in the pair--may be zero (0) */ - Array16OfOffset16To<PairSet> - pairSet; /* Array of PairSet tables - * ordered by Coverage Index */ - public: - DEFINE_SIZE_ARRAY (10, pairSet); -}; - -struct PairPosFormat2 -{ - bool intersects (const hb_set_t *glyphs) const - { - return (this+coverage).intersects (glyphs) && - (this+classDef2).intersects (glyphs); - } - - void closure_lookups (hb_closure_lookups_context_t *c) const {} - void collect_variation_indices (hb_collect_variation_indices_context_t *c) const - { - if (!intersects (c->glyph_set)) return; - if ((!valueFormat1.has_device ()) && (!valueFormat2.has_device ())) return; - - hb_set_t klass1_glyphs, klass2_glyphs; - if (!(this+classDef1).collect_coverage (&klass1_glyphs)) return; - if (!(this+classDef2).collect_coverage (&klass2_glyphs)) return; - - hb_set_t class1_set, class2_set; - for (const unsigned cp : + c->glyph_set->iter () | hb_filter (this + coverage)) - { - if (!klass1_glyphs.has (cp)) class1_set.add (0); - else - { - unsigned klass1 = (this+classDef1).get (cp); - class1_set.add (klass1); - } - } - - class2_set.add (0); - for (const unsigned cp : + c->glyph_set->iter () | hb_filter (klass2_glyphs)) - { - unsigned klass2 = (this+classDef2).get (cp); - class2_set.add (klass2); - } - - if (class1_set.is_empty () - || class2_set.is_empty () - || (class2_set.get_population() == 1 && class2_set.has(0))) - return; - - unsigned len1 = valueFormat1.get_len (); - unsigned len2 = valueFormat2.get_len (); - const hb_array_t<const Value> values_array = values.as_array ((unsigned)class1Count * (unsigned) class2Count * (len1 + len2)); - for (const unsigned class1_idx : class1_set.iter ()) - { - for (const unsigned class2_idx : class2_set.iter ()) - { - unsigned start_offset = (class1_idx * (unsigned) class2Count + class2_idx) * (len1 + len2); - if (valueFormat1.has_device ()) - valueFormat1.collect_variation_indices (c, this, values_array.sub_array (start_offset, len1)); - - if (valueFormat2.has_device ()) - valueFormat2.collect_variation_indices (c, this, values_array.sub_array (start_offset+len1, len2)); - } - } - } - - void collect_glyphs (hb_collect_glyphs_context_t *c) const - { - if (unlikely (!(this+coverage).collect_coverage (c->input))) return; - if (unlikely (!(this+classDef2).collect_coverage (c->input))) return; - } - - const Coverage &get_coverage () const { return this+coverage; } - - bool apply (hb_ot_apply_context_t *c) const - { - TRACE_APPLY (this); - hb_buffer_t *buffer = c->buffer; - unsigned int index = (this+coverage).get_coverage (buffer->cur().codepoint); - if (likely (index == NOT_COVERED)) return_trace (false); - - hb_ot_apply_context_t::skipping_iterator_t &skippy_iter = c->iter_input; - skippy_iter.reset (buffer->idx, 1); - unsigned unsafe_to; - if (!skippy_iter.next (&unsafe_to)) - { - buffer->unsafe_to_concat (buffer->idx, unsafe_to); - return_trace (false); - } - - unsigned int len1 = valueFormat1.get_len (); - unsigned int len2 = valueFormat2.get_len (); - unsigned int record_len = len1 + len2; - - unsigned int klass1 = (this+classDef1).get_class (buffer->cur().codepoint); - unsigned int klass2 = (this+classDef2).get_class (buffer->info[skippy_iter.idx].codepoint); - if (unlikely (klass1 >= class1Count || klass2 >= class2Count)) - { - buffer->unsafe_to_concat (buffer->idx, skippy_iter.idx + 1); - return_trace (false); - } - - const Value *v = &values[record_len * (klass1 * class2Count + klass2)]; - - bool applied_first = false, applied_second = false; - - - /* Isolate simple kerning and apply it half to each side. - * Results in better cursor positinoing / underline drawing. - * - * Disabled, because causes issues... :-( - * https://github.com/harfbuzz/harfbuzz/issues/3408 - * https://github.com/harfbuzz/harfbuzz/pull/3235#issuecomment-1029814978 - */ -#ifndef HB_SPLIT_KERN - if (0) -#endif - { - if (!len2) - { - const hb_direction_t dir = buffer->props.direction; - const bool horizontal = HB_DIRECTION_IS_HORIZONTAL (dir); - const bool backward = HB_DIRECTION_IS_BACKWARD (dir); - unsigned mask = horizontal ? ValueFormat::xAdvance : ValueFormat::yAdvance; - if (backward) - mask |= mask >> 2; /* Add eg. xPlacement in RTL. */ - /* Add Devices. */ - mask |= mask << 4; - - if (valueFormat1 & ~mask) - goto bail; - - /* Is simple kern. Apply value on an empty position slot, - * then split it between sides. */ - - hb_glyph_position_t pos{}; - if (valueFormat1.apply_value (c, this, v, pos)) - { - hb_position_t *src = &pos.x_advance; - hb_position_t *dst1 = &buffer->cur_pos().x_advance; - hb_position_t *dst2 = &buffer->pos[skippy_iter.idx].x_advance; - unsigned i = horizontal ? 0 : 1; - - hb_position_t kern = src[i]; - hb_position_t kern1 = kern >> 1; - hb_position_t kern2 = kern - kern1; - - if (!backward) - { - dst1[i] += kern1; - dst2[i] += kern2; - dst2[i + 2] += kern2; - } - else - { - dst1[i] += kern1; - dst1[i + 2] += src[i + 2] - kern2; - dst2[i] += kern2; - } - - applied_first = applied_second = kern != 0; - goto success; - } - goto boring; - } - } - bail: - - - applied_first = valueFormat1.apply_value (c, this, v, buffer->cur_pos()); - applied_second = valueFormat2.apply_value (c, this, v + len1, buffer->pos[skippy_iter.idx]); - - success: - if (applied_first || applied_second) - buffer->unsafe_to_break (buffer->idx, skippy_iter.idx + 1); - else - boring: - buffer->unsafe_to_concat (buffer->idx, skippy_iter.idx + 1); - - - buffer->idx = skippy_iter.idx; - if (len2) - buffer->idx++; - - return_trace (true); - } - - bool subset (hb_subset_context_t *c) const - { - TRACE_SUBSET (this); - auto *out = c->serializer->start_embed (*this); - if (unlikely (!c->serializer->extend_min (out))) return_trace (false); - out->format = format; - - hb_map_t klass1_map; - out->classDef1.serialize_subset (c, classDef1, this, &klass1_map, true, true, &(this + coverage)); - out->class1Count = klass1_map.get_population (); - - hb_map_t klass2_map; - out->classDef2.serialize_subset (c, classDef2, this, &klass2_map, true, false); - out->class2Count = klass2_map.get_population (); - - unsigned len1 = valueFormat1.get_len (); - unsigned len2 = valueFormat2.get_len (); - - hb_pair_t<unsigned, unsigned> newFormats = hb_pair (valueFormat1, valueFormat2); - if (c->plan->flags & HB_SUBSET_FLAGS_NO_HINTING) - newFormats = compute_effective_value_formats (klass1_map, klass2_map); - - out->valueFormat1 = newFormats.first; - out->valueFormat2 = newFormats.second; - - for (unsigned class1_idx : + hb_range ((unsigned) class1Count) | hb_filter (klass1_map)) - { - for (unsigned class2_idx : + hb_range ((unsigned) class2Count) | hb_filter (klass2_map)) - { - unsigned idx = (class1_idx * (unsigned) class2Count + class2_idx) * (len1 + len2); - valueFormat1.copy_values (c->serializer, newFormats.first, this, &values[idx], c->plan->layout_variation_idx_map); - valueFormat2.copy_values (c->serializer, newFormats.second, this, &values[idx + len1], c->plan->layout_variation_idx_map); - } - } - - const hb_set_t &glyphset = *c->plan->glyphset_gsub (); - const hb_map_t &glyph_map = *c->plan->glyph_map; - - auto it = - + hb_iter (this+coverage) - | hb_filter (glyphset) - | hb_map_retains_sorting (glyph_map) - ; - - out->coverage.serialize_serialize (c->serializer, it); - return_trace (out->class1Count && out->class2Count && bool (it)); - } - - - hb_pair_t<unsigned, unsigned> compute_effective_value_formats (const hb_map_t& klass1_map, - const hb_map_t& klass2_map) const - { - unsigned len1 = valueFormat1.get_len (); - unsigned len2 = valueFormat2.get_len (); - - unsigned format1 = 0; - unsigned format2 = 0; - - for (unsigned class1_idx : + hb_range ((unsigned) class1Count) | hb_filter (klass1_map)) - { - for (unsigned class2_idx : + hb_range ((unsigned) class2Count) | hb_filter (klass2_map)) - { - unsigned idx = (class1_idx * (unsigned) class2Count + class2_idx) * (len1 + len2); - format1 = format1 | valueFormat1.get_effective_format (&values[idx]); - format2 = format2 | valueFormat2.get_effective_format (&values[idx + len1]); - } - } - - return hb_pair (format1, format2); - } - - - bool sanitize (hb_sanitize_context_t *c) const - { - TRACE_SANITIZE (this); - if (!(c->check_struct (this) - && coverage.sanitize (c, this) - && classDef1.sanitize (c, this) - && classDef2.sanitize (c, this))) return_trace (false); - - unsigned int len1 = valueFormat1.get_len (); - unsigned int len2 = valueFormat2.get_len (); - unsigned int stride = len1 + len2; - unsigned int record_size = valueFormat1.get_size () + valueFormat2.get_size (); - unsigned int count = (unsigned int) class1Count * (unsigned int) class2Count; - return_trace (c->check_range ((const void *) values, - count, - record_size) && - valueFormat1.sanitize_values_stride_unsafe (c, this, &values[0], count, stride) && - valueFormat2.sanitize_values_stride_unsafe (c, this, &values[len1], count, stride)); - } - - protected: - HBUINT16 format; /* Format identifier--format = 2 */ - Offset16To<Coverage> - coverage; /* Offset to Coverage table--from - * beginning of subtable */ - ValueFormat valueFormat1; /* ValueRecord definition--for the - * first glyph of the pair--may be zero - * (0) */ - ValueFormat valueFormat2; /* ValueRecord definition--for the - * second glyph of the pair--may be - * zero (0) */ - Offset16To<ClassDef> - classDef1; /* Offset to ClassDef table--from - * beginning of PairPos subtable--for - * the first glyph of the pair */ - Offset16To<ClassDef> - classDef2; /* Offset to ClassDef table--from - * beginning of PairPos subtable--for - * the second glyph of the pair */ - HBUINT16 class1Count; /* Number of classes in ClassDef1 - * table--includes Class0 */ - HBUINT16 class2Count; /* Number of classes in ClassDef2 - * table--includes Class0 */ - ValueRecord values; /* Matrix of value pairs: - * class1-major, class2-minor, - * Each entry has value1 and value2 */ - public: - DEFINE_SIZE_ARRAY (16, values); -}; - -struct PairPos -{ - template <typename context_t, typename ...Ts> - typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const - { - TRACE_DISPATCH (this, u.format); - if (unlikely (!c->may_dispatch (this, &u.format))) return_trace (c->no_dispatch_return_value ()); - switch (u.format) { - case 1: return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...)); - case 2: return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...)); - default:return_trace (c->default_return_value ()); - } - } - - protected: - union { - HBUINT16 format; /* Format identifier */ - PairPosFormat1 format1; - PairPosFormat2 format2; - } u; -}; - - -struct EntryExitRecord -{ - friend struct CursivePosFormat1; - - bool sanitize (hb_sanitize_context_t *c, const void *base) const - { - TRACE_SANITIZE (this); - return_trace (entryAnchor.sanitize (c, base) && exitAnchor.sanitize (c, base)); - } - - void collect_variation_indices (hb_collect_variation_indices_context_t *c, - const void *src_base) const - { - (src_base+entryAnchor).collect_variation_indices (c); - (src_base+exitAnchor).collect_variation_indices (c); - } - - EntryExitRecord* subset (hb_subset_context_t *c, - const void *src_base) const - { - TRACE_SERIALIZE (this); - auto *out = c->serializer->embed (this); - if (unlikely (!out)) return_trace (nullptr); - - out->entryAnchor.serialize_subset (c, entryAnchor, src_base); - out->exitAnchor.serialize_subset (c, exitAnchor, src_base); - return_trace (out); - } - - protected: - Offset16To<Anchor> - entryAnchor; /* Offset to EntryAnchor table--from - * beginning of CursivePos - * subtable--may be NULL */ - Offset16To<Anchor> - exitAnchor; /* Offset to ExitAnchor table--from - * beginning of CursivePos - * subtable--may be NULL */ - public: - DEFINE_SIZE_STATIC (4); -}; - -static void -reverse_cursive_minor_offset (hb_glyph_position_t *pos, unsigned int i, hb_direction_t direction, unsigned int new_parent); - -struct CursivePosFormat1 -{ - bool intersects (const hb_set_t *glyphs) const - { return (this+coverage).intersects (glyphs); } - - void closure_lookups (hb_closure_lookups_context_t *c) const {} - - void collect_variation_indices (hb_collect_variation_indices_context_t *c) const - { - + hb_zip (this+coverage, entryExitRecord) - | hb_filter (c->glyph_set, hb_first) - | hb_map (hb_second) - | hb_apply ([&] (const EntryExitRecord& record) { record.collect_variation_indices (c, this); }) - ; - } - - void collect_glyphs (hb_collect_glyphs_context_t *c) const - { if (unlikely (!(this+coverage).collect_coverage (c->input))) return; } - - const Coverage &get_coverage () const { return this+coverage; } - - bool apply (hb_ot_apply_context_t *c) const - { - TRACE_APPLY (this); - hb_buffer_t *buffer = c->buffer; - - const EntryExitRecord &this_record = entryExitRecord[(this+coverage).get_coverage (buffer->cur().codepoint)]; - if (!this_record.entryAnchor) return_trace (false); - - hb_ot_apply_context_t::skipping_iterator_t &skippy_iter = c->iter_input; - skippy_iter.reset (buffer->idx, 1); - unsigned unsafe_from; - if (!skippy_iter.prev (&unsafe_from)) - { - buffer->unsafe_to_concat_from_outbuffer (unsafe_from, buffer->idx + 1); - return_trace (false); - } - - const EntryExitRecord &prev_record = entryExitRecord[(this+coverage).get_coverage (buffer->info[skippy_iter.idx].codepoint)]; - if (!prev_record.exitAnchor) - { - buffer->unsafe_to_concat_from_outbuffer (skippy_iter.idx, buffer->idx + 1); - return_trace (false); - } - - unsigned int i = skippy_iter.idx; - unsigned int j = buffer->idx; - - buffer->unsafe_to_break (i, j); - float entry_x, entry_y, exit_x, exit_y; - (this+prev_record.exitAnchor).get_anchor (c, buffer->info[i].codepoint, &exit_x, &exit_y); - (this+this_record.entryAnchor).get_anchor (c, buffer->info[j].codepoint, &entry_x, &entry_y); - - hb_glyph_position_t *pos = buffer->pos; - - hb_position_t d; - /* Main-direction adjustment */ - switch (c->direction) { - case HB_DIRECTION_LTR: - pos[i].x_advance = roundf (exit_x) + pos[i].x_offset; - - d = roundf (entry_x) + pos[j].x_offset; - pos[j].x_advance -= d; - pos[j].x_offset -= d; - break; - case HB_DIRECTION_RTL: - d = roundf (exit_x) + pos[i].x_offset; - pos[i].x_advance -= d; - pos[i].x_offset -= d; - - pos[j].x_advance = roundf (entry_x) + pos[j].x_offset; - break; - case HB_DIRECTION_TTB: - pos[i].y_advance = roundf (exit_y) + pos[i].y_offset; - - d = roundf (entry_y) + pos[j].y_offset; - pos[j].y_advance -= d; - pos[j].y_offset -= d; - break; - case HB_DIRECTION_BTT: - d = roundf (exit_y) + pos[i].y_offset; - pos[i].y_advance -= d; - pos[i].y_offset -= d; - - pos[j].y_advance = roundf (entry_y); - break; - case HB_DIRECTION_INVALID: - default: - break; - } - - /* Cross-direction adjustment */ - - /* We attach child to parent (think graph theory and rooted trees whereas - * the root stays on baseline and each node aligns itself against its - * parent. - * - * Optimize things for the case of RightToLeft, as that's most common in - * Arabic. */ - unsigned int child = i; - unsigned int parent = j; - hb_position_t x_offset = entry_x - exit_x; - hb_position_t y_offset = entry_y - exit_y; - if (!(c->lookup_props & LookupFlag::RightToLeft)) - { - unsigned int k = child; - child = parent; - parent = k; - x_offset = -x_offset; - y_offset = -y_offset; - } - - /* If child was already connected to someone else, walk through its old - * chain and reverse the link direction, such that the whole tree of its - * previous connection now attaches to new parent. Watch out for case - * where new parent is on the path from old chain... - */ - reverse_cursive_minor_offset (pos, child, c->direction, parent); - - pos[child].attach_type() = ATTACH_TYPE_CURSIVE; - pos[child].attach_chain() = (int) parent - (int) child; - buffer->scratch_flags |= HB_BUFFER_SCRATCH_FLAG_HAS_GPOS_ATTACHMENT; - if (likely (HB_DIRECTION_IS_HORIZONTAL (c->direction))) - pos[child].y_offset = y_offset; - else - pos[child].x_offset = x_offset; - - /* If parent was attached to child, separate them. - * https://github.com/harfbuzz/harfbuzz/issues/2469 - */ - if (unlikely (pos[parent].attach_chain() == -pos[child].attach_chain())) - pos[parent].attach_chain() = 0; - - buffer->idx++; - return_trace (true); - } - - template <typename Iterator, - hb_requires (hb_is_iterator (Iterator))> - void serialize (hb_subset_context_t *c, - Iterator it, - const void *src_base) - { - if (unlikely (!c->serializer->extend_min ((*this)))) return; - this->format = 1; - this->entryExitRecord.len = it.len (); - - for (const EntryExitRecord& entry_record : + it - | hb_map (hb_second)) - entry_record.subset (c, src_base); - - auto glyphs = - + it - | hb_map_retains_sorting (hb_first) - ; - - coverage.serialize_serialize (c->serializer, glyphs); - } - - bool subset (hb_subset_context_t *c) const - { - TRACE_SUBSET (this); - const hb_set_t &glyphset = *c->plan->glyphset_gsub (); - const hb_map_t &glyph_map = *c->plan->glyph_map; - - auto *out = c->serializer->start_embed (*this); - if (unlikely (!out)) return_trace (false); - - auto it = - + hb_zip (this+coverage, entryExitRecord) - | hb_filter (glyphset, hb_first) - | hb_map_retains_sorting ([&] (hb_pair_t<hb_codepoint_t, const EntryExitRecord&> p) -> hb_pair_t<hb_codepoint_t, const EntryExitRecord&> - { return hb_pair (glyph_map[p.first], p.second);}) - ; - - bool ret = bool (it); - out->serialize (c, it, this); - return_trace (ret); - } - - bool sanitize (hb_sanitize_context_t *c) const - { - TRACE_SANITIZE (this); - return_trace (coverage.sanitize (c, this) && entryExitRecord.sanitize (c, this)); - } - - protected: - HBUINT16 format; /* Format identifier--format = 1 */ - Offset16To<Coverage> - coverage; /* Offset to Coverage table--from - * beginning of subtable */ - Array16Of<EntryExitRecord> - entryExitRecord; /* Array of EntryExit records--in - * Coverage Index order */ - public: - DEFINE_SIZE_ARRAY (6, entryExitRecord); -}; - -struct CursivePos -{ - template <typename context_t, typename ...Ts> - typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const - { - TRACE_DISPATCH (this, u.format); - if (unlikely (!c->may_dispatch (this, &u.format))) return_trace (c->no_dispatch_return_value ()); - switch (u.format) { - case 1: return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...)); - default:return_trace (c->default_return_value ()); - } - } - - protected: - union { - HBUINT16 format; /* Format identifier */ - CursivePosFormat1 format1; - } u; -}; - - -typedef AnchorMatrix BaseArray; /* base-major-- - * in order of BaseCoverage Index--, - * mark-minor-- - * ordered by class--zero-based. */ - -static void Markclass_closure_and_remap_indexes (const Coverage &mark_coverage, - const MarkArray &mark_array, - const hb_set_t &glyphset, - hb_map_t* klass_mapping /* INOUT */) -{ - hb_set_t orig_classes; - - + hb_zip (mark_coverage, mark_array) - | hb_filter (glyphset, hb_first) - | hb_map (hb_second) - | hb_map (&MarkRecord::get_class) - | hb_sink (orig_classes) - ; - - unsigned idx = 0; - for (auto klass : orig_classes.iter ()) - { - if (klass_mapping->has (klass)) continue; - klass_mapping->set (klass, idx); - idx++; - } -} - -struct MarkBasePosFormat1 -{ - bool intersects (const hb_set_t *glyphs) const - { - return (this+markCoverage).intersects (glyphs) && - (this+baseCoverage).intersects (glyphs); - } - - void closure_lookups (hb_closure_lookups_context_t *c) const {} - - void collect_variation_indices (hb_collect_variation_indices_context_t *c) const - { - + hb_zip (this+markCoverage, this+markArray) - | hb_filter (c->glyph_set, hb_first) - | hb_map (hb_second) - | hb_apply ([&] (const MarkRecord& record) { record.collect_variation_indices (c, &(this+markArray)); }) - ; - - hb_map_t klass_mapping; - Markclass_closure_and_remap_indexes (this+markCoverage, this+markArray, *c->glyph_set, &klass_mapping); - - unsigned basecount = (this+baseArray).rows; - auto base_iter = - + hb_zip (this+baseCoverage, hb_range (basecount)) - | hb_filter (c->glyph_set, hb_first) - | hb_map (hb_second) - ; - - hb_sorted_vector_t<unsigned> base_indexes; - for (const unsigned row : base_iter) - { - + hb_range ((unsigned) classCount) - | hb_filter (klass_mapping) - | hb_map ([&] (const unsigned col) { return row * (unsigned) classCount + col; }) - | hb_sink (base_indexes) - ; - } - (this+baseArray).collect_variation_indices (c, base_indexes.iter ()); - } - - void collect_glyphs (hb_collect_glyphs_context_t *c) const - { - if (unlikely (!(this+markCoverage).collect_coverage (c->input))) return; - if (unlikely (!(this+baseCoverage).collect_coverage (c->input))) return; - } - - const Coverage &get_coverage () const { return this+markCoverage; } - - bool apply (hb_ot_apply_context_t *c) const - { - TRACE_APPLY (this); - hb_buffer_t *buffer = c->buffer; - unsigned int mark_index = (this+markCoverage).get_coverage (buffer->cur().codepoint); - if (likely (mark_index == NOT_COVERED)) return_trace (false); - - /* Now we search backwards for a non-mark glyph */ - hb_ot_apply_context_t::skipping_iterator_t &skippy_iter = c->iter_input; - skippy_iter.reset (buffer->idx, 1); - skippy_iter.set_lookup_props (LookupFlag::IgnoreMarks); - do { - unsigned unsafe_from; - if (!skippy_iter.prev (&unsafe_from)) - { - buffer->unsafe_to_concat_from_outbuffer (unsafe_from, buffer->idx + 1); - return_trace (false); - } - - /* We only want to attach to the first of a MultipleSubst sequence. - * https://github.com/harfbuzz/harfbuzz/issues/740 - * Reject others... - * ...but stop if we find a mark in the MultipleSubst sequence: - * https://github.com/harfbuzz/harfbuzz/issues/1020 */ - if (!_hb_glyph_info_multiplied (&buffer->info[skippy_iter.idx]) || - 0 == _hb_glyph_info_get_lig_comp (&buffer->info[skippy_iter.idx]) || - (skippy_iter.idx == 0 || - _hb_glyph_info_is_mark (&buffer->info[skippy_iter.idx - 1]) || - _hb_glyph_info_get_lig_id (&buffer->info[skippy_iter.idx]) != - _hb_glyph_info_get_lig_id (&buffer->info[skippy_iter.idx - 1]) || - _hb_glyph_info_get_lig_comp (&buffer->info[skippy_iter.idx]) != - _hb_glyph_info_get_lig_comp (&buffer->info[skippy_iter.idx - 1]) + 1 - )) - break; - skippy_iter.reject (); - } while (true); - - /* Checking that matched glyph is actually a base glyph by GDEF is too strong; disabled */ - //if (!_hb_glyph_info_is_base_glyph (&buffer->info[skippy_iter.idx])) { return_trace (false); } - - unsigned int base_index = (this+baseCoverage).get_coverage (buffer->info[skippy_iter.idx].codepoint); - if (base_index == NOT_COVERED) - { - buffer->unsafe_to_concat_from_outbuffer (skippy_iter.idx, buffer->idx + 1); - return_trace (false); - } - - return_trace ((this+markArray).apply (c, mark_index, base_index, this+baseArray, classCount, skippy_iter.idx)); - } - - bool subset (hb_subset_context_t *c) const - { - TRACE_SUBSET (this); - const hb_set_t &glyphset = *c->plan->glyphset_gsub (); - const hb_map_t &glyph_map = *c->plan->glyph_map; - - auto *out = c->serializer->start_embed (*this); - if (unlikely (!c->serializer->extend_min (out))) return_trace (false); - out->format = format; - - hb_map_t klass_mapping; - Markclass_closure_and_remap_indexes (this+markCoverage, this+markArray, glyphset, &klass_mapping); - - if (!klass_mapping.get_population ()) return_trace (false); - out->classCount = klass_mapping.get_population (); - - auto mark_iter = - + hb_zip (this+markCoverage, this+markArray) - | hb_filter (glyphset, hb_first) - ; - - hb_sorted_vector_t<hb_codepoint_t> new_coverage; - + mark_iter - | hb_map (hb_first) - | hb_map (glyph_map) - | hb_sink (new_coverage) - ; - - if (!out->markCoverage.serialize_serialize (c->serializer, new_coverage.iter ())) - return_trace (false); - - out->markArray.serialize_subset (c, markArray, this, - (this+markCoverage).iter (), - &klass_mapping); - - unsigned basecount = (this+baseArray).rows; - auto base_iter = - + hb_zip (this+baseCoverage, hb_range (basecount)) - | hb_filter (glyphset, hb_first) - ; - - new_coverage.reset (); - + base_iter - | hb_map (hb_first) - | hb_map (glyph_map) - | hb_sink (new_coverage) - ; - - if (!out->baseCoverage.serialize_serialize (c->serializer, new_coverage.iter ())) - return_trace (false); - - hb_sorted_vector_t<unsigned> base_indexes; - for (const unsigned row : + base_iter - | hb_map (hb_second)) - { - + hb_range ((unsigned) classCount) - | hb_filter (klass_mapping) - | hb_map ([&] (const unsigned col) { return row * (unsigned) classCount + col; }) - | hb_sink (base_indexes) - ; - } - - out->baseArray.serialize_subset (c, baseArray, this, - base_iter.len (), - base_indexes.iter ()); - - return_trace (true); - } - - bool sanitize (hb_sanitize_context_t *c) const - { - TRACE_SANITIZE (this); - return_trace (c->check_struct (this) && - markCoverage.sanitize (c, this) && - baseCoverage.sanitize (c, this) && - markArray.sanitize (c, this) && - baseArray.sanitize (c, this, (unsigned int) classCount)); - } - - protected: - HBUINT16 format; /* Format identifier--format = 1 */ - Offset16To<Coverage> - markCoverage; /* Offset to MarkCoverage table--from - * beginning of MarkBasePos subtable */ - Offset16To<Coverage> - baseCoverage; /* Offset to BaseCoverage table--from - * beginning of MarkBasePos subtable */ - HBUINT16 classCount; /* Number of classes defined for marks */ - Offset16To<MarkArray> - markArray; /* Offset to MarkArray table--from - * beginning of MarkBasePos subtable */ - Offset16To<BaseArray> - baseArray; /* Offset to BaseArray table--from - * beginning of MarkBasePos subtable */ - public: - DEFINE_SIZE_STATIC (12); -}; - -struct MarkBasePos -{ - template <typename context_t, typename ...Ts> - typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const - { - TRACE_DISPATCH (this, u.format); - if (unlikely (!c->may_dispatch (this, &u.format))) return_trace (c->no_dispatch_return_value ()); - switch (u.format) { - case 1: return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...)); - default:return_trace (c->default_return_value ()); - } - } - - protected: - union { - HBUINT16 format; /* Format identifier */ - MarkBasePosFormat1 format1; - } u; -}; - - -typedef AnchorMatrix LigatureAttach; /* component-major-- - * in order of writing direction--, - * mark-minor-- - * ordered by class--zero-based. */ - -/* Array of LigatureAttach tables ordered by LigatureCoverage Index */ -struct LigatureArray : List16OfOffset16To<LigatureAttach> -{ - template <typename Iterator, - hb_requires (hb_is_iterator (Iterator))> - bool subset (hb_subset_context_t *c, - Iterator coverage, - unsigned class_count, - const hb_map_t *klass_mapping) const - { - TRACE_SUBSET (this); - const hb_set_t &glyphset = *c->plan->glyphset_gsub (); - - auto *out = c->serializer->start_embed (this); - if (unlikely (!c->serializer->extend_min (out))) return_trace (false); - - for (const auto _ : + hb_zip (coverage, *this) - | hb_filter (glyphset, hb_first)) - { - auto *matrix = out->serialize_append (c->serializer); - if (unlikely (!matrix)) return_trace (false); - - const LigatureAttach& src = (this + _.second); - auto indexes = - + hb_range (src.rows * class_count) - | hb_filter ([=] (unsigned index) { return klass_mapping->has (index % class_count); }) - ; - matrix->serialize_subset (c, - _.second, - this, - src.rows, - indexes); - } - return_trace (this->len); - } -}; - -struct MarkLigPosFormat1 -{ - bool intersects (const hb_set_t *glyphs) const - { - return (this+markCoverage).intersects (glyphs) && - (this+ligatureCoverage).intersects (glyphs); - } - - void closure_lookups (hb_closure_lookups_context_t *c) const {} - - void collect_variation_indices (hb_collect_variation_indices_context_t *c) const - { - + hb_zip (this+markCoverage, this+markArray) - | hb_filter (c->glyph_set, hb_first) - | hb_map (hb_second) - | hb_apply ([&] (const MarkRecord& record) { record.collect_variation_indices (c, &(this+markArray)); }) - ; - - hb_map_t klass_mapping; - Markclass_closure_and_remap_indexes (this+markCoverage, this+markArray, *c->glyph_set, &klass_mapping); - - unsigned ligcount = (this+ligatureArray).len; - auto lig_iter = - + hb_zip (this+ligatureCoverage, hb_range (ligcount)) - | hb_filter (c->glyph_set, hb_first) - | hb_map (hb_second) - ; - - const LigatureArray& lig_array = this+ligatureArray; - for (const unsigned i : lig_iter) - { - hb_sorted_vector_t<unsigned> lig_indexes; - unsigned row_count = lig_array[i].rows; - for (unsigned row : + hb_range (row_count)) - { - + hb_range ((unsigned) classCount) - | hb_filter (klass_mapping) - | hb_map ([&] (const unsigned col) { return row * (unsigned) classCount + col; }) - | hb_sink (lig_indexes) - ; - } - - lig_array[i].collect_variation_indices (c, lig_indexes.iter ()); - } - } - - void collect_glyphs (hb_collect_glyphs_context_t *c) const - { - if (unlikely (!(this+markCoverage).collect_coverage (c->input))) return; - if (unlikely (!(this+ligatureCoverage).collect_coverage (c->input))) return; - } - - const Coverage &get_coverage () const { return this+markCoverage; } - - bool apply (hb_ot_apply_context_t *c) const - { - TRACE_APPLY (this); - hb_buffer_t *buffer = c->buffer; - unsigned int mark_index = (this+markCoverage).get_coverage (buffer->cur().codepoint); - if (likely (mark_index == NOT_COVERED)) return_trace (false); - - /* Now we search backwards for a non-mark glyph */ - hb_ot_apply_context_t::skipping_iterator_t &skippy_iter = c->iter_input; - skippy_iter.reset (buffer->idx, 1); - skippy_iter.set_lookup_props (LookupFlag::IgnoreMarks); - unsigned unsafe_from; - if (!skippy_iter.prev (&unsafe_from)) - { - buffer->unsafe_to_concat_from_outbuffer (unsafe_from, buffer->idx + 1); - return_trace (false); - } - - /* Checking that matched glyph is actually a ligature by GDEF is too strong; disabled */ - //if (!_hb_glyph_info_is_ligature (&buffer->info[skippy_iter.idx])) { return_trace (false); } - - unsigned int j = skippy_iter.idx; - unsigned int lig_index = (this+ligatureCoverage).get_coverage (buffer->info[j].codepoint); - if (lig_index == NOT_COVERED) - { - buffer->unsafe_to_concat_from_outbuffer (skippy_iter.idx, buffer->idx + 1); - return_trace (false); - } - - const LigatureArray& lig_array = this+ligatureArray; - const LigatureAttach& lig_attach = lig_array[lig_index]; - - /* Find component to attach to */ - unsigned int comp_count = lig_attach.rows; - if (unlikely (!comp_count)) - { - buffer->unsafe_to_concat_from_outbuffer (skippy_iter.idx, buffer->idx + 1); - return_trace (false); - } - - /* We must now check whether the ligature ID of the current mark glyph - * is identical to the ligature ID of the found ligature. If yes, we - * can directly use the component index. If not, we attach the mark - * glyph to the last component of the ligature. */ - unsigned int comp_index; - unsigned int lig_id = _hb_glyph_info_get_lig_id (&buffer->info[j]); - unsigned int mark_id = _hb_glyph_info_get_lig_id (&buffer->cur()); - unsigned int mark_comp = _hb_glyph_info_get_lig_comp (&buffer->cur()); - if (lig_id && lig_id == mark_id && mark_comp > 0) - comp_index = hb_min (comp_count, _hb_glyph_info_get_lig_comp (&buffer->cur())) - 1; - else - comp_index = comp_count - 1; - - return_trace ((this+markArray).apply (c, mark_index, comp_index, lig_attach, classCount, j)); - } - - bool subset (hb_subset_context_t *c) const - { - TRACE_SUBSET (this); - const hb_set_t &glyphset = *c->plan->glyphset_gsub (); - const hb_map_t &glyph_map = *c->plan->glyph_map; - - auto *out = c->serializer->start_embed (*this); - if (unlikely (!c->serializer->extend_min (out))) return_trace (false); - out->format = format; - - hb_map_t klass_mapping; - Markclass_closure_and_remap_indexes (this+markCoverage, this+markArray, glyphset, &klass_mapping); - - if (!klass_mapping.get_population ()) return_trace (false); - out->classCount = klass_mapping.get_population (); - - auto mark_iter = - + hb_zip (this+markCoverage, this+markArray) - | hb_filter (glyphset, hb_first) - ; - - auto new_mark_coverage = - + mark_iter - | hb_map_retains_sorting (hb_first) - | hb_map_retains_sorting (glyph_map) - ; - - if (!out->markCoverage.serialize_serialize (c->serializer, new_mark_coverage)) - return_trace (false); - - out->markArray.serialize_subset (c, markArray, this, - (this+markCoverage).iter (), - &klass_mapping); - - auto new_ligature_coverage = - + hb_iter (this + ligatureCoverage) - | hb_filter (glyphset) - | hb_map_retains_sorting (glyph_map) - ; - - if (!out->ligatureCoverage.serialize_serialize (c->serializer, new_ligature_coverage)) - return_trace (false); - - out->ligatureArray.serialize_subset (c, ligatureArray, this, - hb_iter (this+ligatureCoverage), classCount, &klass_mapping); - - return_trace (true); - } - - bool sanitize (hb_sanitize_context_t *c) const - { - TRACE_SANITIZE (this); - return_trace (c->check_struct (this) && - markCoverage.sanitize (c, this) && - ligatureCoverage.sanitize (c, this) && - markArray.sanitize (c, this) && - ligatureArray.sanitize (c, this, (unsigned int) classCount)); - } - - protected: - HBUINT16 format; /* Format identifier--format = 1 */ - Offset16To<Coverage> - markCoverage; /* Offset to Mark Coverage table--from - * beginning of MarkLigPos subtable */ - Offset16To<Coverage> - ligatureCoverage; /* Offset to Ligature Coverage - * table--from beginning of MarkLigPos - * subtable */ - HBUINT16 classCount; /* Number of defined mark classes */ - Offset16To<MarkArray> - markArray; /* Offset to MarkArray table--from - * beginning of MarkLigPos subtable */ - Offset16To<LigatureArray> - ligatureArray; /* Offset to LigatureArray table--from - * beginning of MarkLigPos subtable */ - public: - DEFINE_SIZE_STATIC (12); -}; - - -struct MarkLigPos -{ - template <typename context_t, typename ...Ts> - typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const - { - TRACE_DISPATCH (this, u.format); - if (unlikely (!c->may_dispatch (this, &u.format))) return_trace (c->no_dispatch_return_value ()); - switch (u.format) { - case 1: return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...)); - default:return_trace (c->default_return_value ()); - } - } - - protected: - union { - HBUINT16 format; /* Format identifier */ - MarkLigPosFormat1 format1; - } u; -}; - - -typedef AnchorMatrix Mark2Array; /* mark2-major-- - * in order of Mark2Coverage Index--, - * mark1-minor-- - * ordered by class--zero-based. */ - -struct MarkMarkPosFormat1 -{ - bool intersects (const hb_set_t *glyphs) const - { - return (this+mark1Coverage).intersects (glyphs) && - (this+mark2Coverage).intersects (glyphs); - } - - void closure_lookups (hb_closure_lookups_context_t *c) const {} - - void collect_variation_indices (hb_collect_variation_indices_context_t *c) const - { - + hb_zip (this+mark1Coverage, this+mark1Array) - | hb_filter (c->glyph_set, hb_first) - | hb_map (hb_second) - | hb_apply ([&] (const MarkRecord& record) { record.collect_variation_indices (c, &(this+mark1Array)); }) - ; - - hb_map_t klass_mapping; - Markclass_closure_and_remap_indexes (this+mark1Coverage, this+mark1Array, *c->glyph_set, &klass_mapping); - - unsigned mark2_count = (this+mark2Array).rows; - auto mark2_iter = - + hb_zip (this+mark2Coverage, hb_range (mark2_count)) - | hb_filter (c->glyph_set, hb_first) - | hb_map (hb_second) - ; - - hb_sorted_vector_t<unsigned> mark2_indexes; - for (const unsigned row : mark2_iter) - { - + hb_range ((unsigned) classCount) - | hb_filter (klass_mapping) - | hb_map ([&] (const unsigned col) { return row * (unsigned) classCount + col; }) - | hb_sink (mark2_indexes) - ; - } - (this+mark2Array).collect_variation_indices (c, mark2_indexes.iter ()); - } - - void collect_glyphs (hb_collect_glyphs_context_t *c) const - { - if (unlikely (!(this+mark1Coverage).collect_coverage (c->input))) return; - if (unlikely (!(this+mark2Coverage).collect_coverage (c->input))) return; - } - - const Coverage &get_coverage () const { return this+mark1Coverage; } - - bool apply (hb_ot_apply_context_t *c) const - { - TRACE_APPLY (this); - hb_buffer_t *buffer = c->buffer; - unsigned int mark1_index = (this+mark1Coverage).get_coverage (buffer->cur().codepoint); - if (likely (mark1_index == NOT_COVERED)) return_trace (false); - - /* now we search backwards for a suitable mark glyph until a non-mark glyph */ - hb_ot_apply_context_t::skipping_iterator_t &skippy_iter = c->iter_input; - skippy_iter.reset (buffer->idx, 1); - skippy_iter.set_lookup_props (c->lookup_props & ~LookupFlag::IgnoreFlags); - unsigned unsafe_from; - if (!skippy_iter.prev (&unsafe_from)) - { - buffer->unsafe_to_concat_from_outbuffer (unsafe_from, buffer->idx + 1); - return_trace (false); - } - - if (!_hb_glyph_info_is_mark (&buffer->info[skippy_iter.idx])) - { - buffer->unsafe_to_concat_from_outbuffer (skippy_iter.idx, buffer->idx + 1); - return_trace (false); - } - - unsigned int j = skippy_iter.idx; - - unsigned int id1 = _hb_glyph_info_get_lig_id (&buffer->cur()); - unsigned int id2 = _hb_glyph_info_get_lig_id (&buffer->info[j]); - unsigned int comp1 = _hb_glyph_info_get_lig_comp (&buffer->cur()); - unsigned int comp2 = _hb_glyph_info_get_lig_comp (&buffer->info[j]); - - if (likely (id1 == id2)) - { - if (id1 == 0) /* Marks belonging to the same base. */ - goto good; - else if (comp1 == comp2) /* Marks belonging to the same ligature component. */ - goto good; - } - else - { - /* If ligature ids don't match, it may be the case that one of the marks - * itself is a ligature. In which case match. */ - if ((id1 > 0 && !comp1) || (id2 > 0 && !comp2)) - goto good; - } - - /* Didn't match. */ - buffer->unsafe_to_concat_from_outbuffer (skippy_iter.idx, buffer->idx + 1); - return_trace (false); - - good: - unsigned int mark2_index = (this+mark2Coverage).get_coverage (buffer->info[j].codepoint); - if (mark2_index == NOT_COVERED) - { - buffer->unsafe_to_concat_from_outbuffer (skippy_iter.idx, buffer->idx + 1); - return_trace (false); - } - - return_trace ((this+mark1Array).apply (c, mark1_index, mark2_index, this+mark2Array, classCount, j)); - } - - bool subset (hb_subset_context_t *c) const - { - TRACE_SUBSET (this); - const hb_set_t &glyphset = *c->plan->glyphset_gsub (); - const hb_map_t &glyph_map = *c->plan->glyph_map; - - auto *out = c->serializer->start_embed (*this); - if (unlikely (!c->serializer->extend_min (out))) return_trace (false); - out->format = format; - - hb_map_t klass_mapping; - Markclass_closure_and_remap_indexes (this+mark1Coverage, this+mark1Array, glyphset, &klass_mapping); - - if (!klass_mapping.get_population ()) return_trace (false); - out->classCount = klass_mapping.get_population (); - - auto mark1_iter = - + hb_zip (this+mark1Coverage, this+mark1Array) - | hb_filter (glyphset, hb_first) - ; - - hb_sorted_vector_t<hb_codepoint_t> new_coverage; - + mark1_iter - | hb_map (hb_first) - | hb_map (glyph_map) - | hb_sink (new_coverage) - ; - - if (!out->mark1Coverage.serialize_serialize (c->serializer, new_coverage.iter ())) - return_trace (false); - - out->mark1Array.serialize_subset (c, mark1Array, this, - (this+mark1Coverage).iter (), - &klass_mapping); - - unsigned mark2count = (this+mark2Array).rows; - auto mark2_iter = - + hb_zip (this+mark2Coverage, hb_range (mark2count)) - | hb_filter (glyphset, hb_first) - ; - - new_coverage.reset (); - + mark2_iter - | hb_map (hb_first) - | hb_map (glyph_map) - | hb_sink (new_coverage) - ; - - if (!out->mark2Coverage.serialize_serialize (c->serializer, new_coverage.iter ())) - return_trace (false); - - hb_sorted_vector_t<unsigned> mark2_indexes; - for (const unsigned row : + mark2_iter - | hb_map (hb_second)) - { - + hb_range ((unsigned) classCount) - | hb_filter (klass_mapping) - | hb_map ([&] (const unsigned col) { return row * (unsigned) classCount + col; }) - | hb_sink (mark2_indexes) - ; - } - - out->mark2Array.serialize_subset (c, mark2Array, this, mark2_iter.len (), mark2_indexes.iter ()); - - return_trace (true); - } - - bool sanitize (hb_sanitize_context_t *c) const - { - TRACE_SANITIZE (this); - return_trace (c->check_struct (this) && - mark1Coverage.sanitize (c, this) && - mark2Coverage.sanitize (c, this) && - mark1Array.sanitize (c, this) && - mark2Array.sanitize (c, this, (unsigned int) classCount)); - } - - protected: - HBUINT16 format; /* Format identifier--format = 1 */ - Offset16To<Coverage> - mark1Coverage; /* Offset to Combining Mark1 Coverage - * table--from beginning of MarkMarkPos - * subtable */ - Offset16To<Coverage> - mark2Coverage; /* Offset to Combining Mark2 Coverage - * table--from beginning of MarkMarkPos - * subtable */ - HBUINT16 classCount; /* Number of defined mark classes */ - Offset16To<MarkArray> - mark1Array; /* Offset to Mark1Array table--from - * beginning of MarkMarkPos subtable */ - Offset16To<Mark2Array> - mark2Array; /* Offset to Mark2Array table--from - * beginning of MarkMarkPos subtable */ - public: - DEFINE_SIZE_STATIC (12); -}; - -struct MarkMarkPos -{ - template <typename context_t, typename ...Ts> - typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const - { - TRACE_DISPATCH (this, u.format); - if (unlikely (!c->may_dispatch (this, &u.format))) return_trace (c->no_dispatch_return_value ()); - switch (u.format) { - case 1: return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...)); - default:return_trace (c->default_return_value ()); - } - } - - protected: - union { - HBUINT16 format; /* Format identifier */ - MarkMarkPosFormat1 format1; - } u; -}; - - -struct ContextPos : Context {}; - -struct ChainContextPos : ChainContext {}; - -struct ExtensionPos : Extension<ExtensionPos> -{ - typedef struct PosLookupSubTable SubTable; -}; - - - -/* - * PosLookup - */ - - -struct PosLookupSubTable -{ - friend struct Lookup; - friend struct PosLookup; - - enum Type { - Single = 1, - Pair = 2, - Cursive = 3, - MarkBase = 4, - MarkLig = 5, - MarkMark = 6, - Context = 7, - ChainContext = 8, - Extension = 9 - }; - - template <typename context_t, typename ...Ts> - typename context_t::return_t dispatch (context_t *c, unsigned int lookup_type, Ts&&... ds) const - { - TRACE_DISPATCH (this, lookup_type); - switch (lookup_type) { - case Single: return_trace (u.single.dispatch (c, std::forward<Ts> (ds)...)); - case Pair: return_trace (u.pair.dispatch (c, std::forward<Ts> (ds)...)); - case Cursive: return_trace (u.cursive.dispatch (c, std::forward<Ts> (ds)...)); - case MarkBase: return_trace (u.markBase.dispatch (c, std::forward<Ts> (ds)...)); - case MarkLig: return_trace (u.markLig.dispatch (c, std::forward<Ts> (ds)...)); - case MarkMark: return_trace (u.markMark.dispatch (c, std::forward<Ts> (ds)...)); - case Context: return_trace (u.context.dispatch (c, std::forward<Ts> (ds)...)); - case ChainContext: return_trace (u.chainContext.dispatch (c, std::forward<Ts> (ds)...)); - case Extension: return_trace (u.extension.dispatch (c, std::forward<Ts> (ds)...)); - default: return_trace (c->default_return_value ()); - } - } - - bool intersects (const hb_set_t *glyphs, unsigned int lookup_type) const - { - hb_intersects_context_t c (glyphs); - return dispatch (&c, lookup_type); - } - - protected: - union { - SinglePos single; - PairPos pair; - CursivePos cursive; - MarkBasePos markBase; - MarkLigPos markLig; - MarkMarkPos markMark; - ContextPos context; - ChainContextPos chainContext; - ExtensionPos extension; - } u; - public: - DEFINE_SIZE_MIN (0); -}; - - -struct PosLookup : Lookup -{ - typedef struct PosLookupSubTable SubTable; - - const SubTable& get_subtable (unsigned int i) const - { return Lookup::get_subtable<SubTable> (i); } - - bool is_reverse () const - { - return false; - } - - bool apply (hb_ot_apply_context_t *c) const - { - TRACE_APPLY (this); - return_trace (dispatch (c)); - } - - bool intersects (const hb_set_t *glyphs) const - { - hb_intersects_context_t c (glyphs); - return dispatch (&c); - } - - hb_collect_glyphs_context_t::return_t collect_glyphs (hb_collect_glyphs_context_t *c) const - { return dispatch (c); } - - hb_closure_lookups_context_t::return_t closure_lookups (hb_closure_lookups_context_t *c, unsigned this_index) const - { - if (c->is_lookup_visited (this_index)) - return hb_closure_lookups_context_t::default_return_value (); - - c->set_lookup_visited (this_index); - if (!intersects (c->glyphs)) - { - c->set_lookup_inactive (this_index); - return hb_closure_lookups_context_t::default_return_value (); - } - c->set_recurse_func (dispatch_closure_lookups_recurse_func); - - hb_closure_lookups_context_t::return_t ret = dispatch (c); - return ret; - } - - template <typename set_t> - void collect_coverage (set_t *glyphs) const - { - hb_collect_coverage_context_t<set_t> c (glyphs); - dispatch (&c); - } - - static inline bool apply_recurse_func (hb_ot_apply_context_t *c, unsigned int lookup_index); - - template <typename context_t> - static typename context_t::return_t dispatch_recurse_func (context_t *c, unsigned int lookup_index); - - HB_INTERNAL static hb_closure_lookups_context_t::return_t dispatch_closure_lookups_recurse_func (hb_closure_lookups_context_t *c, unsigned this_index); - - template <typename context_t, typename ...Ts> - typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const - { return Lookup::dispatch<SubTable> (c, std::forward<Ts> (ds)...); } - - bool subset (hb_subset_context_t *c) const - { return Lookup::subset<SubTable> (c); } - - bool sanitize (hb_sanitize_context_t *c) const - { return Lookup::sanitize<SubTable> (c); } -}; - -/* - * GPOS -- Glyph Positioning - * https://docs.microsoft.com/en-us/typography/opentype/spec/gpos - */ - -struct GPOS : GSUBGPOS -{ - static constexpr hb_tag_t tableTag = HB_OT_TAG_GPOS; - - const PosLookup& get_lookup (unsigned int i) const - { return static_cast<const PosLookup &> (GSUBGPOS::get_lookup (i)); } - - static inline void position_start (hb_font_t *font, hb_buffer_t *buffer); - static inline void position_finish_advances (hb_font_t *font, hb_buffer_t *buffer); - static inline void position_finish_offsets (hb_font_t *font, hb_buffer_t *buffer); - - bool subset (hb_subset_context_t *c) const - { - hb_subset_layout_context_t l (c, tableTag, c->plan->gpos_lookups, c->plan->gpos_langsys, c->plan->gpos_features); - return GSUBGPOS::subset<PosLookup> (&l); - } - - bool sanitize (hb_sanitize_context_t *c) const - { return GSUBGPOS::sanitize<PosLookup> (c); } - - HB_INTERNAL bool is_blocklisted (hb_blob_t *blob, - hb_face_t *face) const; - - void collect_variation_indices (hb_collect_variation_indices_context_t *c) const - { - for (unsigned i = 0; i < GSUBGPOS::get_lookup_count (); i++) - { - if (!c->gpos_lookups->has (i)) continue; - const PosLookup &l = get_lookup (i); - l.dispatch (c); - } - } - - void closure_lookups (hb_face_t *face, - const hb_set_t *glyphs, - hb_set_t *lookup_indexes /* IN/OUT */) const - { GSUBGPOS::closure_lookups<PosLookup> (face, glyphs, lookup_indexes); } - - typedef GSUBGPOS::accelerator_t<GPOS> accelerator_t; -}; - - -static void -reverse_cursive_minor_offset (hb_glyph_position_t *pos, unsigned int i, hb_direction_t direction, unsigned int new_parent) -{ - int chain = pos[i].attach_chain(), type = pos[i].attach_type(); - if (likely (!chain || 0 == (type & ATTACH_TYPE_CURSIVE))) - return; - - pos[i].attach_chain() = 0; - - unsigned int j = (int) i + chain; - - /* Stop if we see new parent in the chain. */ - if (j == new_parent) - return; - - reverse_cursive_minor_offset (pos, j, direction, new_parent); - - if (HB_DIRECTION_IS_HORIZONTAL (direction)) - pos[j].y_offset = -pos[i].y_offset; - else - pos[j].x_offset = -pos[i].x_offset; - - pos[j].attach_chain() = -chain; - pos[j].attach_type() = type; -} -static void -propagate_attachment_offsets (hb_glyph_position_t *pos, - unsigned int len, - unsigned int i, - hb_direction_t direction) -{ - /* Adjusts offsets of attached glyphs (both cursive and mark) to accumulate - * offset of glyph they are attached to. */ - int chain = pos[i].attach_chain(), type = pos[i].attach_type(); - if (likely (!chain)) - return; - - pos[i].attach_chain() = 0; - - unsigned int j = (int) i + chain; - - if (unlikely (j >= len)) - return; - - propagate_attachment_offsets (pos, len, j, direction); - - assert (!!(type & ATTACH_TYPE_MARK) ^ !!(type & ATTACH_TYPE_CURSIVE)); - - if (type & ATTACH_TYPE_CURSIVE) - { - if (HB_DIRECTION_IS_HORIZONTAL (direction)) - pos[i].y_offset += pos[j].y_offset; - else - pos[i].x_offset += pos[j].x_offset; - } - else /*if (type & ATTACH_TYPE_MARK)*/ - { - pos[i].x_offset += pos[j].x_offset; - pos[i].y_offset += pos[j].y_offset; - - assert (j < i); - if (HB_DIRECTION_IS_FORWARD (direction)) - for (unsigned int k = j; k < i; k++) { - pos[i].x_offset -= pos[k].x_advance; - pos[i].y_offset -= pos[k].y_advance; - } - else - for (unsigned int k = j + 1; k < i + 1; k++) { - pos[i].x_offset += pos[k].x_advance; - pos[i].y_offset += pos[k].y_advance; - } - } -} - -void -GPOS::position_start (hb_font_t *font HB_UNUSED, hb_buffer_t *buffer) -{ - unsigned int count = buffer->len; - for (unsigned int i = 0; i < count; i++) - buffer->pos[i].attach_chain() = buffer->pos[i].attach_type() = 0; -} - -void -GPOS::position_finish_advances (hb_font_t *font HB_UNUSED, hb_buffer_t *buffer HB_UNUSED) -{ - //_hb_buffer_assert_gsubgpos_vars (buffer); -} - -void -GPOS::position_finish_offsets (hb_font_t *font, hb_buffer_t *buffer) -{ - _hb_buffer_assert_gsubgpos_vars (buffer); - - unsigned int len; - hb_glyph_position_t *pos = hb_buffer_get_glyph_positions (buffer, &len); - hb_direction_t direction = buffer->props.direction; - - /* Handle attachments */ - if (buffer->scratch_flags & HB_BUFFER_SCRATCH_FLAG_HAS_GPOS_ATTACHMENT) - for (unsigned i = 0; i < len; i++) - propagate_attachment_offsets (pos, len, i, direction); - - if (unlikely (font->slant)) - { - for (unsigned i = 0; i < len; i++) - if (unlikely (pos[i].y_offset)) - pos[i].x_offset += _hb_roundf (font->slant_xy * pos[i].y_offset); - } -} - - -struct GPOS_accelerator_t : GPOS::accelerator_t { - GPOS_accelerator_t (hb_face_t *face) : GPOS::accelerator_t (face) {} -}; - +using Layout::GPOS_impl::PosLookup; +// TODO(garretrieger): Move into new layout directory. /* Out-of-class implementation for methods recursing */ - #ifndef HB_NO_OT_LAYOUT template <typename context_t> /*static*/ typename context_t::return_t PosLookup::dispatch_recurse_func (context_t *c, unsigned int lookup_index) @@ -3121,13 +45,16 @@ template <typename context_t> return l.dispatch (c); } -/*static*/ inline hb_closure_lookups_context_t::return_t PosLookup::dispatch_closure_lookups_recurse_func (hb_closure_lookups_context_t *c, unsigned this_index) +template <> +inline hb_closure_lookups_context_t::return_t +PosLookup::dispatch_recurse_func<hb_closure_lookups_context_t> (hb_closure_lookups_context_t *c, unsigned this_index) { const PosLookup &l = c->face->table.GPOS.get_relaxed ()->table->get_lookup (this_index); return l.closure_lookups (c, this_index); } -/*static*/ bool PosLookup::apply_recurse_func (hb_ot_apply_context_t *c, unsigned int lookup_index) +template <> +inline bool PosLookup::dispatch_recurse_func<hb_ot_apply_context_t> (hb_ot_apply_context_t *c, unsigned int lookup_index) { const PosLookup &l = c->face->table.GPOS.get_relaxed ()->table->get_lookup (lookup_index); unsigned int saved_lookup_props = c->lookup_props; @@ -3141,7 +68,6 @@ template <typename context_t> } #endif - } /* namespace OT */ diff --git a/thirdparty/harfbuzz/src/hb-ot-layout-gsub-table.hh b/thirdparty/harfbuzz/src/hb-ot-layout-gsub-table.hh index bef381430b..462542025b 100644 --- a/thirdparty/harfbuzz/src/hb-ot-layout-gsub-table.hh +++ b/thirdparty/harfbuzz/src/hb-ot-layout-gsub-table.hh @@ -59,13 +59,16 @@ template <typename context_t> return l.dispatch (c); } -/*static*/ inline hb_closure_lookups_context_t::return_t SubstLookup::dispatch_closure_lookups_recurse_func (hb_closure_lookups_context_t *c, unsigned this_index) +template <> +inline hb_closure_lookups_context_t::return_t +SubstLookup::dispatch_recurse_func<hb_closure_lookups_context_t> (hb_closure_lookups_context_t *c, unsigned this_index) { const SubstLookup &l = c->face->table.GSUB.get_relaxed ()->table->get_lookup (this_index); return l.closure_lookups (c, this_index); } -/*static*/ bool SubstLookup::apply_recurse_func (hb_ot_apply_context_t *c, unsigned int lookup_index) +template <> +inline bool SubstLookup::dispatch_recurse_func<hb_ot_apply_context_t> (hb_ot_apply_context_t *c, unsigned int lookup_index) { const SubstLookup &l = c->face->table.GSUB.get_relaxed ()->table->get_lookup (lookup_index); unsigned int saved_lookup_props = c->lookup_props; diff --git a/thirdparty/harfbuzz/src/hb-ot-layout-gsubgpos.hh b/thirdparty/harfbuzz/src/hb-ot-layout-gsubgpos.hh index c9750ff63b..31da498652 100644 --- a/thirdparty/harfbuzz/src/hb-ot-layout-gsubgpos.hh +++ b/thirdparty/harfbuzz/src/hb-ot-layout-gsubgpos.hh @@ -109,14 +109,10 @@ struct hb_closure_context_t : { done_lookups_glyph_count->set (lookup_index, glyphs->get_population ()); - if (!done_lookups_glyph_set->get (lookup_index)) + if (!done_lookups_glyph_set->has (lookup_index)) { - hb_set_t* empty_set = hb_set_create (); - if (unlikely (!done_lookups_glyph_set->set (lookup_index, empty_set))) - { - hb_set_destroy (empty_set); + if (unlikely (!done_lookups_glyph_set->set (lookup_index, hb::unique_ptr<hb_set_t> {hb_set_create ()}))) return true; - } } hb_set_clear (done_lookups_glyph_set->get (lookup_index)); @@ -165,21 +161,19 @@ struct hb_closure_context_t : hb_set_t *glyphs; hb_set_t output[1]; hb_vector_t<hb_set_t> active_glyphs_stack; - recurse_func_t recurse_func; + recurse_func_t recurse_func = nullptr; unsigned int nesting_level_left; hb_closure_context_t (hb_face_t *face_, hb_set_t *glyphs_, hb_map_t *done_lookups_glyph_count_, - hb_hashmap_t<unsigned, hb_set_t *> *done_lookups_glyph_set_, + hb_hashmap_t<unsigned, hb::unique_ptr<hb_set_t>> *done_lookups_glyph_set_, unsigned int nesting_level_left_ = HB_MAX_NESTING_LEVEL) : face (face_), glyphs (glyphs_), - recurse_func (nullptr), nesting_level_left (nesting_level_left_), done_lookups_glyph_count (done_lookups_glyph_count_), - done_lookups_glyph_set (done_lookups_glyph_set_), - lookup_count (0) + done_lookups_glyph_set (done_lookups_glyph_set_) {} ~hb_closure_context_t () { flush (); } @@ -197,8 +191,8 @@ struct hb_closure_context_t : private: hb_map_t *done_lookups_glyph_count; - hb_hashmap_t<unsigned, hb_set_t *> *done_lookups_glyph_set; - unsigned int lookup_count; + hb_hashmap_t<unsigned, hb::unique_ptr<hb_set_t>> *done_lookups_glyph_set; + unsigned int lookup_count = 0; }; @@ -400,7 +394,6 @@ struct hb_collect_coverage_context_t : set_t *set; }; - struct hb_ot_apply_context_t : hb_dispatch_context_t<hb_ot_apply_context_t, bool, HB_DEBUG_APPLY> { @@ -416,7 +409,7 @@ struct hb_ot_apply_context_t : match_func (nullptr), match_data (nullptr) {} - typedef bool (*match_func_t) (hb_codepoint_t glyph_id, const HBUINT16 &value, const void *data); + typedef bool (*match_func_t) (hb_glyph_info_t &info, const HBUINT16 &value, const void *data); void set_ignore_zwnj (bool ignore_zwnj_) { ignore_zwnj = ignore_zwnj_; } void set_ignore_zwj (bool ignore_zwj_) { ignore_zwj = ignore_zwj_; } @@ -434,7 +427,7 @@ struct hb_ot_apply_context_t : MATCH_MAYBE }; - may_match_t may_match (const hb_glyph_info_t &info, + may_match_t may_match (hb_glyph_info_t &info, const HBUINT16 *glyph_data) const { if (!(info.mask & mask) || @@ -442,7 +435,7 @@ struct hb_ot_apply_context_t : return MATCH_NO; if (match_func) - return match_func (info.codepoint, *glyph_data, match_data) ? MATCH_YES : MATCH_NO; + return match_func (info, *glyph_data, match_data) ? MATCH_YES : MATCH_NO; return MATCH_MAYBE; } @@ -530,7 +523,7 @@ struct hb_ot_apply_context_t : while (idx + num_items < end) { idx++; - const hb_glyph_info_t &info = c->buffer->info[idx]; + hb_glyph_info_t &info = c->buffer->info[idx]; matcher_t::may_skip_t skip = matcher.may_skip (c, info); if (unlikely (skip == matcher_t::SKIP_YES)) @@ -563,7 +556,7 @@ struct hb_ot_apply_context_t : while (idx > num_items - 1) { idx--; - const hb_glyph_info_t &info = c->buffer->out_info[idx]; + hb_glyph_info_t &info = c->buffer->out_info[idx]; matcher_t::may_skip_t skip = matcher.may_skip (c, info); if (unlikely (skip == matcher_t::SKIP_YES)) @@ -611,7 +604,10 @@ struct hb_ot_apply_context_t : return_t recurse (unsigned int sub_lookup_index) { if (unlikely (nesting_level_left == 0 || !recurse_func || buffer->max_ops-- <= 0)) + { + buffer->shaping_failed = true; return default_return_value (); + } nesting_level_left--; bool ret = recurse_func (this, sub_lookup_index); @@ -621,35 +617,34 @@ struct hb_ot_apply_context_t : skipping_iterator_t iter_input, iter_context; + unsigned int table_index; /* GSUB/GPOS */ hb_font_t *font; hb_face_t *face; hb_buffer_t *buffer; - recurse_func_t recurse_func; + recurse_func_t recurse_func = nullptr; const GDEF &gdef; const VariationStore &var_store; + VariationStore::cache_t *var_store_cache; hb_direction_t direction; - hb_mask_t lookup_mask; - unsigned int table_index; /* GSUB/GPOS */ - unsigned int lookup_index; - unsigned int lookup_props; - unsigned int nesting_level_left; + hb_mask_t lookup_mask = 1; + unsigned int lookup_index = (unsigned) -1; + unsigned int lookup_props = 0; + unsigned int nesting_level_left = HB_MAX_NESTING_LEVEL; bool has_glyph_classes; - bool auto_zwnj; - bool auto_zwj; - bool per_syllable; - bool random; - - uint32_t random_state; - + bool auto_zwnj = true; + bool auto_zwj = true; + bool per_syllable = false; + bool random = false; + uint32_t random_state = 1; + unsigned new_syllables = (unsigned) -1; hb_ot_apply_context_t (unsigned int table_index_, hb_font_t *font_, hb_buffer_t *buffer_) : - iter_input (), iter_context (), + table_index (table_index_), font (font_), face (font->face), buffer (buffer_), - recurse_func (nullptr), gdef ( #ifndef HB_NO_OT_LAYOUT *face->table.GDEF->table @@ -658,18 +653,23 @@ struct hb_ot_apply_context_t : #endif ), var_store (gdef.get_var_store ()), + var_store_cache ( +#ifndef HB_NO_VAR + table_index == 1 && font->num_coords ? var_store.create_cache () : nullptr +#else + nullptr +#endif + ), direction (buffer_->props.direction), - lookup_mask (1), - table_index (table_index_), - lookup_index ((unsigned int) -1), - lookup_props (0), - nesting_level_left (HB_MAX_NESTING_LEVEL), - has_glyph_classes (gdef.has_glyph_classes ()), - auto_zwnj (true), - auto_zwj (true), - per_syllable (false), - random (false), - random_state (1) { init_iters (); } + has_glyph_classes (gdef.has_glyph_classes ()) + { init_iters (); } + + ~hb_ot_apply_context_t () + { +#ifndef HB_NO_VAR + VariationStore::destroy_cache (var_store_cache); +#endif + } void init_iters () { @@ -736,6 +736,9 @@ struct hb_ot_apply_context_t : bool ligature = false, bool component = false) const { + if (new_syllables != (unsigned) -1) + buffer->cur().syllable() = new_syllables; + unsigned int props = _hb_glyph_info_get_glyph_props (&buffer->cur()); props |= HB_OT_LAYOUT_GLYPH_PROPS_SUBSTITUTED; if (ligature) @@ -790,8 +793,8 @@ struct hb_ot_apply_context_t : }; -struct hb_get_subtables_context_t : - hb_dispatch_context_t<hb_get_subtables_context_t> +struct hb_accelerate_subtables_context_t : + hb_dispatch_context_t<hb_accelerate_subtables_context_t> { template <typename Type> static inline bool apply_to (const void *obj, OT::hb_ot_apply_context_t *c) @@ -800,15 +803,53 @@ struct hb_get_subtables_context_t : return typed_obj->apply (c); } +#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE + template <typename T> + static inline auto apply_cached_ (const T *obj, OT::hb_ot_apply_context_t *c, hb_priority<1>) HB_RETURN (bool, obj->apply (c, true) ) + template <typename T> + static inline auto apply_cached_ (const T *obj, OT::hb_ot_apply_context_t *c, hb_priority<0>) HB_RETURN (bool, obj->apply (c) ) + template <typename Type> + static inline bool apply_cached_to (const void *obj, OT::hb_ot_apply_context_t *c) + { + const Type *typed_obj = (const Type *) obj; + return apply_cached_ (typed_obj, c, hb_prioritize); + } + + template <typename T> + static inline auto cache_func_ (const T *obj, OT::hb_ot_apply_context_t *c, bool enter, hb_priority<1>) HB_RETURN (bool, obj->cache_func (c, enter) ) + template <typename T> + static inline bool cache_func_ (const T *obj, OT::hb_ot_apply_context_t *c, bool enter, hb_priority<0>) { return false; } + template <typename Type> + static inline bool cache_func_to (const void *obj, OT::hb_ot_apply_context_t *c, bool enter) + { + const Type *typed_obj = (const Type *) obj; + return cache_func_ (typed_obj, c, enter, hb_prioritize); + } +#endif + typedef bool (*hb_apply_func_t) (const void *obj, OT::hb_ot_apply_context_t *c); + typedef bool (*hb_cache_func_t) (const void *obj, OT::hb_ot_apply_context_t *c, bool enter); struct hb_applicable_t { + friend struct hb_accelerate_subtables_context_t; + friend struct hb_ot_layout_lookup_accelerator_t; + template <typename T> - void init (const T &obj_, hb_apply_func_t apply_func_) + void init (const T &obj_, + hb_apply_func_t apply_func_ +#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE + , hb_apply_func_t apply_cached_func_ + , hb_cache_func_t cache_func_ +#endif + ) { obj = &obj_; apply_func = apply_func_; +#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE + apply_cached_func = apply_cached_func_; + cache_func = cache_func_; +#endif digest.init (); obj_.get_coverage ().collect_coverage (&digest); } @@ -817,38 +858,93 @@ struct hb_get_subtables_context_t : { return digest.may_have (c->buffer->cur().codepoint) && apply_func (obj, c); } +#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE + bool apply_cached (OT::hb_ot_apply_context_t *c) const + { + return digest.may_have (c->buffer->cur().codepoint) && apply_cached_func (obj, c); + } + bool cache_enter (OT::hb_ot_apply_context_t *c) const + { + return cache_func (obj, c, true); + } + void cache_leave (OT::hb_ot_apply_context_t *c) const + { + cache_func (obj, c, false); + } +#endif private: const void *obj; hb_apply_func_t apply_func; +#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE + hb_apply_func_t apply_cached_func; + hb_cache_func_t cache_func; +#endif hb_set_digest_t digest; }; typedef hb_vector_t<hb_applicable_t> array_t; +#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE + template <typename T> + auto cache_cost (const T &obj, hb_priority<1>) HB_AUTO_RETURN ( obj.cache_cost () ) + template <typename T> + auto cache_cost (const T &obj, hb_priority<0>) HB_AUTO_RETURN ( 0u ) +#endif + /* Dispatch interface. */ template <typename T> return_t dispatch (const T &obj) { - hb_applicable_t *entry = array.push(); - entry->init (obj, apply_to<T>); + hb_applicable_t entry; + + entry.init (obj, + apply_to<T> +#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE + , apply_cached_to<T> + , cache_func_to<T> +#endif + ); + + array.push (entry); + +#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE + /* Cache handling + * + * We allow one subtable from each lookup to use a cache. The assumption + * being that multiple subtables of the same lookup cannot use a cache + * because the resources they would use will collide. As such, we ask + * each subtable to tell us how much it costs (which a cache would avoid), + * and we allocate the cache opportunity to the costliest subtable. + */ + unsigned cost = cache_cost (obj, hb_prioritize); + if (cost > cache_user_cost && !array.in_error ()) + { + cache_user_idx = array.length - 1; + cache_user_cost = cost; + } +#endif + return hb_empty_t (); } static return_t default_return_value () { return hb_empty_t (); } - hb_get_subtables_context_t (array_t &array_) : - array (array_) {} + hb_accelerate_subtables_context_t (array_t &array_) : + array (array_) {} array_t &array; -}; - +#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE + unsigned cache_user_idx = (unsigned) -1; + unsigned cache_user_cost = 0; +#endif +}; typedef bool (*intersects_func_t) (const hb_set_t *glyphs, const HBUINT16 &value, const void *data); typedef void (*intersected_glyphs_func_t) (const hb_set_t *glyphs, const void *data, unsigned value, hb_set_t *intersected_glyphs); typedef void (*collect_glyphs_func_t) (hb_set_t *glyphs, const HBUINT16 &value, const void *data); -typedef bool (*match_func_t) (hb_codepoint_t glyph_id, const HBUINT16 &value, const void *data); +typedef bool (*match_func_t) (hb_glyph_info_t &info, const HBUINT16 &value, const void *data); struct ContextClosureFuncs { @@ -863,6 +959,10 @@ struct ContextApplyFuncs { match_func_t match; }; +struct ChainContextApplyFuncs +{ + match_func_t match[3]; +}; static inline bool intersects_glyph (const hb_set_t *glyphs, const HBUINT16 &value, const void *data HB_UNUSED) @@ -939,19 +1039,30 @@ static inline void collect_array (hb_collect_glyphs_context_t *c HB_UNUSED, } -static inline bool match_glyph (hb_codepoint_t glyph_id, const HBUINT16 &value, const void *data HB_UNUSED) +static inline bool match_glyph (hb_glyph_info_t &info, const HBUINT16 &value, const void *data HB_UNUSED) { - return glyph_id == value; + return info.codepoint == value; } -static inline bool match_class (hb_codepoint_t glyph_id, const HBUINT16 &value, const void *data) +static inline bool match_class (hb_glyph_info_t &info, const HBUINT16 &value, const void *data) { const ClassDef &class_def = *reinterpret_cast<const ClassDef *>(data); - return class_def.get_class (glyph_id) == value; + return class_def.get_class (info.codepoint) == value; } -static inline bool match_coverage (hb_codepoint_t glyph_id, const HBUINT16 &value, const void *data) +static inline bool match_class_cached (hb_glyph_info_t &info, const HBUINT16 &value, const void *data) +{ + unsigned klass = info.syllable(); + if (klass < 255) + return klass == value; + const ClassDef &class_def = *reinterpret_cast<const ClassDef *>(data); + klass = class_def.get_class (info.codepoint); + if (likely (klass < 255)) + info.syllable() = klass; + return klass == value; +} +static inline bool match_coverage (hb_glyph_info_t &info, const HBUINT16 &value, const void *data) { const Offset16To<Coverage> &coverage = (const Offset16To<Coverage>&)value; - return (data+coverage).get_coverage (glyph_id) != NOT_COVERED; + return (data+coverage).get_coverage (info.codepoint) != NOT_COVERED; } static inline bool would_match_input (hb_would_apply_context_t *c, @@ -964,8 +1075,12 @@ static inline bool would_match_input (hb_would_apply_context_t *c, return false; for (unsigned int i = 1; i < count; i++) - if (likely (!match_func (c->glyphs[i], input[i - 1], match_data))) + { + hb_glyph_info_t info; + info.codepoint = c->glyphs[i]; + if (likely (!match_func (info, input[i - 1], match_data))) return false; + } return true; } @@ -2125,19 +2240,54 @@ struct ContextFormat2 const Coverage &get_coverage () const { return this+coverage; } - bool apply (hb_ot_apply_context_t *c) const + unsigned cache_cost () const + { + unsigned c = (this+classDef).cost () * ruleSet.len; + return c >= 4 ? c : 0; + } + bool cache_func (hb_ot_apply_context_t *c, bool enter) const + { + if (enter) + { + if (!HB_BUFFER_TRY_ALLOCATE_VAR (c->buffer, syllable)) + return false; + auto &info = c->buffer->info; + unsigned count = c->buffer->len; + for (unsigned i = 0; i < count; i++) + info[i].syllable() = 255; + c->new_syllables = 255; + return true; + } + else + { + c->new_syllables = (unsigned) -1; + HB_BUFFER_DEALLOCATE_VAR (c->buffer, syllable); + return true; + } + } + + bool apply (hb_ot_apply_context_t *c, bool cached = false) const { TRACE_APPLY (this); unsigned int index = (this+coverage).get_coverage (c->buffer->cur().codepoint); if (likely (index == NOT_COVERED)) return_trace (false); const ClassDef &class_def = this+classDef; - index = class_def.get_class (c->buffer->cur().codepoint); - const RuleSet &rule_set = this+ruleSet[index]; + struct ContextApplyLookupContext lookup_context = { - {match_class}, + {cached ? match_class_cached : match_class}, &class_def }; + + if (cached && c->buffer->cur().syllable() < 255) + index = c->buffer->cur().syllable (); + else + { + index = class_def.get_class (c->buffer->cur().codepoint); + if (cached && index < 255) + c->buffer->cur().syllable() = index; + } + const RuleSet &rule_set = this+ruleSet[index]; return_trace (rule_set.apply (c, lookup_context)); } @@ -2411,7 +2561,7 @@ struct ChainContextCollectGlyphsLookupContext struct ChainContextApplyLookupContext { - ContextApplyFuncs funcs; + ChainContextApplyFuncs funcs; const void *match_data[3]; }; @@ -2499,7 +2649,7 @@ static inline bool chain_context_would_apply_lookup (hb_would_apply_context_t *c return (c->zero_context ? !backtrackCount && !lookaheadCount : true) && would_match_input (c, inputCount, input, - lookup_context.funcs.match, lookup_context.match_data[1]); + lookup_context.funcs.match[1], lookup_context.match_data[1]); } static inline bool chain_context_apply_lookup (hb_ot_apply_context_t *c, @@ -2518,11 +2668,11 @@ static inline bool chain_context_apply_lookup (hb_ot_apply_context_t *c, unsigned match_positions[HB_MAX_CONTEXT_LENGTH]; if (!(match_input (c, inputCount, input, - lookup_context.funcs.match, lookup_context.match_data[1], + lookup_context.funcs.match[1], lookup_context.match_data[1], &match_end, match_positions) && (end_index = match_end) && match_lookahead (c, lookaheadCount, lookahead, - lookup_context.funcs.match, lookup_context.match_data[2], + lookup_context.funcs.match[2], lookup_context.match_data[2], match_end, &end_index))) { c->buffer->unsafe_to_concat (c->buffer->idx, end_index); @@ -2532,7 +2682,7 @@ static inline bool chain_context_apply_lookup (hb_ot_apply_context_t *c, unsigned start_index = c->buffer->out_len; if (!match_backtrack (c, backtrackCount, backtrack, - lookup_context.funcs.match, lookup_context.match_data[0], + lookup_context.funcs.match[0], lookup_context.match_data[0], &start_index)) { c->buffer->unsafe_to_concat_from_outbuffer (start_index, end_index); @@ -2934,7 +3084,7 @@ struct ChainContextFormat1 { const ChainRuleSet &rule_set = this+ruleSet[(this+coverage).get_coverage (c->glyphs[0])]; struct ChainContextApplyLookupContext lookup_context = { - {match_glyph}, + {{match_glyph, match_glyph, match_glyph}}, {nullptr, nullptr, nullptr} }; return rule_set.would_apply (c, lookup_context); @@ -2950,7 +3100,7 @@ struct ChainContextFormat1 const ChainRuleSet &rule_set = this+ruleSet[index]; struct ChainContextApplyLookupContext lookup_context = { - {match_glyph}, + {{match_glyph, match_glyph, match_glyph}}, {nullptr, nullptr, nullptr} }; return_trace (rule_set.apply (c, lookup_context)); @@ -3134,7 +3284,7 @@ struct ChainContextFormat2 unsigned int index = input_class_def.get_class (c->glyphs[0]); const ChainRuleSet &rule_set = this+ruleSet[index]; struct ChainContextApplyLookupContext lookup_context = { - {match_class}, + {{match_class, match_class, match_class}}, {&backtrack_class_def, &input_class_def, &lookahead_class_def} @@ -3144,7 +3294,33 @@ struct ChainContextFormat2 const Coverage &get_coverage () const { return this+coverage; } - bool apply (hb_ot_apply_context_t *c) const + unsigned cache_cost () const + { + unsigned c = (this+lookaheadClassDef).cost () * ruleSet.len; + return c >= 4 ? c : 0; + } + bool cache_func (hb_ot_apply_context_t *c, bool enter) const + { + if (enter) + { + if (!HB_BUFFER_TRY_ALLOCATE_VAR (c->buffer, syllable)) + return false; + auto &info = c->buffer->info; + unsigned count = c->buffer->len; + for (unsigned i = 0; i < count; i++) + info[i].syllable() = 255; + c->new_syllables = 255; + return true; + } + else + { + c->new_syllables = (unsigned) -1; + HB_BUFFER_DEALLOCATE_VAR (c->buffer, syllable); + return true; + } + } + + bool apply (hb_ot_apply_context_t *c, bool cached = false) const { TRACE_APPLY (this); unsigned int index = (this+coverage).get_coverage (c->buffer->cur().codepoint); @@ -3154,14 +3330,27 @@ struct ChainContextFormat2 const ClassDef &input_class_def = this+inputClassDef; const ClassDef &lookahead_class_def = this+lookaheadClassDef; - index = input_class_def.get_class (c->buffer->cur().codepoint); - const ChainRuleSet &rule_set = this+ruleSet[index]; + /* For ChainContextFormat2 we cache the LookaheadClassDef instead of InputClassDef. + * The reason is that most heavy fonts want to identify a glyph in context and apply + * a lookup to it. In this scenario, the length of the input sequence is one, whereas + * the lookahead / backtrack are typically longer. The one glyph in input sequence is + * looked-up below and no input glyph is looked up in individual rules, whereas the + * lookahead and backtrack glyphs are tried. Since we match lookahead before backtrack, + * we should cache lookahead. This decisions showed a 20% improvement in shaping of + * the Gulzar font. + */ + struct ChainContextApplyLookupContext lookup_context = { - {match_class}, + {{cached && &backtrack_class_def == &input_class_def ? match_class_cached : match_class, + cached && &input_class_def == &lookahead_class_def ? match_class_cached : match_class, + cached ? match_class_cached : match_class}}, {&backtrack_class_def, &input_class_def, &lookahead_class_def} }; + + index = input_class_def.get_class (c->buffer->cur().codepoint); + const ChainRuleSet &rule_set = this+ruleSet[index]; return_trace (rule_set.apply (c, lookup_context)); } @@ -3359,7 +3548,7 @@ struct ChainContextFormat3 const Array16OfOffset16To<Coverage> &lookahead = StructAfter<Array16OfOffset16To<Coverage>> (input); const Array16Of<LookupRecord> &lookup = StructAfter<Array16Of<LookupRecord>> (lookahead); struct ChainContextApplyLookupContext lookup_context = { - {match_coverage}, + {{match_coverage, match_coverage, match_coverage}}, {this, this, this} }; return chain_context_would_apply_lookup (c, @@ -3386,7 +3575,7 @@ struct ChainContextFormat3 const Array16OfOffset16To<Coverage> &lookahead = StructAfter<Array16OfOffset16To<Coverage>> (input); const Array16Of<LookupRecord> &lookup = StructAfter<Array16Of<LookupRecord>> (lookahead); struct ChainContextApplyLookupContext lookup_context = { - {match_coverage}, + {{match_coverage, match_coverage, match_coverage}}, {this, this, this} }; return_trace (chain_context_apply_lookup (c, @@ -3623,25 +3812,63 @@ struct hb_ot_layout_lookup_accelerator_t lookup.collect_coverage (&digest); subtables.init (); - OT::hb_get_subtables_context_t c_get_subtables (subtables); - lookup.dispatch (&c_get_subtables); + OT::hb_accelerate_subtables_context_t c_accelerate_subtables (subtables); + lookup.dispatch (&c_accelerate_subtables); + +#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE + cache_user_idx = c_accelerate_subtables.cache_user_idx; + for (unsigned i = 0; i < subtables.length; i++) + if (i != cache_user_idx) + subtables[i].apply_cached_func = subtables[i].apply_func; +#endif } void fini () { subtables.fini (); } bool may_have (hb_codepoint_t g) const { return digest.may_have (g); } - bool apply (hb_ot_apply_context_t *c) const + bool apply (hb_ot_apply_context_t *c, bool use_cache) const { - for (unsigned int i = 0; i < subtables.length; i++) - if (subtables[i].apply (c)) - return true; +#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE + if (use_cache) + { + for (unsigned int i = 0; i < subtables.length; i++) + if (subtables[i].apply_cached (c)) + return true; + } + else +#endif + { + for (unsigned int i = 0; i < subtables.length; i++) + if (subtables[i].apply (c)) + return true; + } return false; } + bool cache_enter (OT::hb_ot_apply_context_t *c) const + { +#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE + return cache_user_idx != (unsigned) -1 && + subtables[cache_user_idx].cache_enter (c); +#else + return false; +#endif + } + void cache_leave (OT::hb_ot_apply_context_t *c) const + { +#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE + subtables[cache_user_idx].cache_leave (c); +#endif + } + + private: hb_set_digest_t digest; - hb_get_subtables_context_t::array_t subtables; + hb_accelerate_subtables_context_t::array_t subtables; +#ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE + unsigned cache_user_idx = (unsigned) -1; +#endif }; struct GSUBGPOS @@ -3721,6 +3948,8 @@ struct GSUBGPOS hb_set_t visited_lookups, inactive_lookups; OT::hb_closure_lookups_context_t c (face, glyphs, &visited_lookups, &inactive_lookups); + c.set_recurse_func (TLookup::template dispatch_recurse_func<hb_closure_lookups_context_t>); + for (unsigned lookup_index : + hb_iter (lookup_indexes)) reinterpret_cast<const TLookup &> (get_lookup (lookup_index)).closure_lookups (&c, lookup_index); @@ -3729,7 +3958,7 @@ struct GSUBGPOS } void prune_langsys (const hb_map_t *duplicate_feature_map, - hb_hashmap_t<unsigned, hb_set_t *> *script_langsys_map, + hb_hashmap_t<unsigned, hb::unique_ptr<hb_set_t>> *script_langsys_map, hb_set_t *new_feature_indexes /* OUT */) const { hb_prune_langsys_context_t c (this, script_langsys_map, duplicate_feature_map, new_feature_indexes); @@ -3787,7 +4016,7 @@ struct GSUBGPOS hb_map_t *duplicate_feature_map /* OUT */) const { if (feature_indices->is_empty ()) return; - hb_hashmap_t<hb_tag_t, hb_set_t *> unique_features; + hb_hashmap_t<hb_tag_t, hb::unique_ptr<hb_set_t>> unique_features; //find out duplicate features after subset for (unsigned i : feature_indices->iter ()) { @@ -3795,16 +4024,9 @@ struct GSUBGPOS if (t == HB_MAP_VALUE_INVALID) continue; if (!unique_features.has (t)) { - hb_set_t* indices = hb_set_create (); - if (unlikely (indices == hb_set_get_empty () || - !unique_features.set (t, indices))) - { - hb_set_destroy (indices); - for (auto _ : unique_features.iter ()) - hb_set_destroy (_.second); + if (unlikely (!unique_features.set (t, hb::unique_ptr<hb_set_t> {hb_set_create ()}))) return; - } - if (unique_features.get (t)) + if (unique_features.has (t)) unique_features.get (t)->add (i); duplicate_feature_map->set (i, i); continue; @@ -3849,9 +4071,6 @@ struct GSUBGPOS duplicate_feature_map->set (i, i); } } - - for (auto _ : unique_features.iter ()) - hb_set_destroy (_.second); } void prune_features (const hb_map_t *lookup_indices, /* IN */ diff --git a/thirdparty/harfbuzz/src/hb-ot-layout.cc b/thirdparty/harfbuzz/src/hb-ot-layout.cc index f4ea21a4f9..142c843dad 100644 --- a/thirdparty/harfbuzz/src/hb-ot-layout.cc +++ b/thirdparty/harfbuzz/src/hb-ot-layout.cc @@ -46,7 +46,7 @@ #include "hb-ot-layout-gdef-table.hh" #include "hb-ot-layout-gsub-table.hh" #include "hb-ot-layout-gpos-table.hh" -#include "hb-ot-layout-base-table.hh" // Just so we compile it; unused otherwise. +#include "hb-ot-layout-base-table.hh" #include "hb-ot-layout-jstf-table.hh" // Just so we compile it; unused otherwise. #include "hb-ot-name-table.hh" #include "hb-ot-os2-table.hh" @@ -55,6 +55,7 @@ #include "hb-aat-layout-opbd-table.hh" // Just so we compile it; unused otherwise. using OT::Layout::GSUB::GSUB; +using OT::Layout::GPOS; /** * SECTION:hb-ot-layout @@ -260,7 +261,6 @@ _hb_ot_layout_set_glyph_props (hb_font_t *font, { _hb_glyph_info_set_glyph_props (&buffer->info[i], gdef.get_glyph_props (buffer->info[i].codepoint)); _hb_glyph_info_clear_lig_props (&buffer->info[i]); - buffer->info[i].syllable() = 0; } } @@ -401,7 +401,7 @@ GSUB::is_blocklisted (hb_blob_t *blob HB_UNUSED, } bool -OT::GPOS::is_blocklisted (hb_blob_t *blob HB_UNUSED, +GPOS::is_blocklisted (hb_blob_t *blob HB_UNUSED, hb_face_t *face HB_UNUSED) const { #ifdef HB_NO_OT_LAYOUT_BLOCKLIST @@ -1501,15 +1501,12 @@ hb_ot_layout_lookup_substitute_closure (hb_face_t *face, hb_set_t *glyphs /* OUT */) { hb_map_t done_lookups_glyph_count; - hb_hashmap_t<unsigned, hb_set_t *> done_lookups_glyph_set; + hb_hashmap_t<unsigned, hb::unique_ptr<hb_set_t>> done_lookups_glyph_set; OT::hb_closure_context_t c (face, glyphs, &done_lookups_glyph_count, &done_lookups_glyph_set); const OT::SubstLookup& l = face->table.GSUB->table->get_lookup (lookup_index); l.closure (&c, lookup_index); - - for (auto _ : done_lookups_glyph_set.iter ()) - hb_set_destroy (_.second); } /** @@ -1529,7 +1526,7 @@ hb_ot_layout_lookups_substitute_closure (hb_face_t *face, hb_set_t *glyphs /* OUT */) { hb_map_t done_lookups_glyph_count; - hb_hashmap_t<unsigned, hb_set_t *> done_lookups_glyph_set; + hb_hashmap_t<unsigned, hb::unique_ptr<hb_set_t>> done_lookups_glyph_set; OT::hb_closure_context_t c (face, glyphs, &done_lookups_glyph_count, &done_lookups_glyph_set); const GSUB& gsub = *face->table.GSUB->table; @@ -1551,13 +1548,10 @@ hb_ot_layout_lookups_substitute_closure (hb_face_t *face, } } while (iteration_count++ <= HB_CLOSURE_MAX_STAGES && glyphs_length != glyphs->get_population ()); - - for (auto _ : done_lookups_glyph_set.iter ()) - hb_set_destroy (_.second); } /* - * OT::GPOS + * GPOS */ @@ -1588,7 +1582,7 @@ hb_ot_layout_has_positioning (hb_face_t *face) void hb_ot_layout_position_start (hb_font_t *font, hb_buffer_t *buffer) { - OT::GPOS::position_start (font, buffer); + GPOS::position_start (font, buffer); } @@ -1603,7 +1597,7 @@ hb_ot_layout_position_start (hb_font_t *font, hb_buffer_t *buffer) void hb_ot_layout_position_finish_advances (hb_font_t *font, hb_buffer_t *buffer) { - OT::GPOS::position_finish_advances (font, buffer); + GPOS::position_finish_advances (font, buffer); } /** @@ -1617,7 +1611,7 @@ hb_ot_layout_position_finish_advances (hb_font_t *font, hb_buffer_t *buffer) void hb_ot_layout_position_finish_offsets (hb_font_t *font, hb_buffer_t *buffer) { - OT::GPOS::position_finish_offsets (font, buffer); + GPOS::position_finish_offsets (font, buffer); } @@ -1652,7 +1646,7 @@ hb_ot_layout_get_size_params (hb_face_t *face, unsigned int *range_start, /* OUT. May be NULL */ unsigned int *range_end /* OUT. May be NULL */) { - const OT::GPOS &gpos = *face->table.GPOS->table; + const GPOS &gpos = *face->table.GPOS->table; const hb_tag_t tag = HB_TAG ('s','i','z','e'); unsigned int num_features = gpos.get_feature_count (); @@ -1803,7 +1797,7 @@ hb_ot_layout_feature_get_characters (hb_face_t *face, struct GSUBProxy { static constexpr unsigned table_index = 0u; - static constexpr bool inplace = false; + static constexpr bool always_inplace = false; typedef OT::SubstLookup Lookup; GSUBProxy (hb_face_t *face) : @@ -1817,14 +1811,14 @@ struct GSUBProxy struct GPOSProxy { static constexpr unsigned table_index = 1u; - static constexpr bool inplace = true; + static constexpr bool always_inplace = true; typedef OT::PosLookup Lookup; GPOSProxy (hb_face_t *face) : table (*face->table.GPOS->table), accels (face->table.GPOS->accels) {} - const OT::GPOS &table; + const GPOS &table; const OT::hb_ot_layout_lookup_accelerator_t *accels; }; @@ -1833,6 +1827,8 @@ static inline bool apply_forward (OT::hb_ot_apply_context_t *c, const OT::hb_ot_layout_lookup_accelerator_t &accel) { + bool use_cache = accel.cache_enter (c); + bool ret = false; hb_buffer_t *buffer = c->buffer; while (buffer->idx < buffer->len && buffer->successful) @@ -1842,7 +1838,7 @@ apply_forward (OT::hb_ot_apply_context_t *c, (buffer->cur().mask & c->lookup_mask) && c->check_glyph_property (&buffer->cur(), c->lookup_props)) { - applied = accel.apply (c); + applied = accel.apply (c, use_cache); } if (applied) @@ -1850,6 +1846,10 @@ apply_forward (OT::hb_ot_apply_context_t *c, else (void) buffer->next_glyph (); } + + if (use_cache) + accel.cache_leave (c); + return ret; } @@ -1864,7 +1864,7 @@ apply_backward (OT::hb_ot_apply_context_t *c, if (accel.may_have (buffer->cur().codepoint) && (buffer->cur().mask & c->lookup_mask) && c->check_glyph_property (&buffer->cur(), c->lookup_props)) - ret |= accel.apply (c); + ret |= accel.apply (c, false); /* The reverse lookup doesn't "advance" cursor (for good reason). */ buffer->idx--; @@ -1890,13 +1890,13 @@ apply_string (OT::hb_ot_apply_context_t *c, if (likely (!lookup.is_reverse ())) { /* in/out forward substitution/positioning */ - if (!Proxy::inplace) + if (!Proxy::always_inplace) buffer->clear_output (); buffer->idx = 0; apply_forward (c, accel); - if (!Proxy::inplace) + if (!Proxy::always_inplace) buffer->sync (); } else @@ -1917,7 +1917,7 @@ inline void hb_ot_map_t::apply (const Proxy &proxy, const unsigned int table_index = proxy.table_index; unsigned int i = 0; OT::hb_ot_apply_context_t c (table_index, font, buffer); - c.set_recurse_func (Proxy::Lookup::apply_recurse_func); + c.set_recurse_func (Proxy::Lookup::template dispatch_recurse_func<OT::hb_ot_apply_context_t>); for (unsigned int stage_index = 0; stage_index < stages[table_index].length; stage_index++) { diff --git a/thirdparty/harfbuzz/src/hb-ot-layout.hh b/thirdparty/harfbuzz/src/hb-ot-layout.hh index 75bba0bc50..6395f06670 100644 --- a/thirdparty/harfbuzz/src/hb-ot-layout.hh +++ b/thirdparty/harfbuzz/src/hb-ot-layout.hh @@ -589,13 +589,11 @@ _hb_buffer_allocate_gsubgpos_vars (hb_buffer_t *buffer) { HB_BUFFER_ALLOCATE_VAR (buffer, glyph_props); HB_BUFFER_ALLOCATE_VAR (buffer, lig_props); - HB_BUFFER_ALLOCATE_VAR (buffer, syllable); } static inline void _hb_buffer_deallocate_gsubgpos_vars (hb_buffer_t *buffer) { - HB_BUFFER_DEALLOCATE_VAR (buffer, syllable); HB_BUFFER_DEALLOCATE_VAR (buffer, lig_props); HB_BUFFER_DEALLOCATE_VAR (buffer, glyph_props); } @@ -605,7 +603,6 @@ _hb_buffer_assert_gsubgpos_vars (hb_buffer_t *buffer) { HB_BUFFER_ASSERT_VAR (buffer, glyph_props); HB_BUFFER_ASSERT_VAR (buffer, lig_props); - HB_BUFFER_ASSERT_VAR (buffer, syllable); } /* Make sure no one directly touches our props... */ diff --git a/thirdparty/harfbuzz/src/hb-ot-name-language-static.hh b/thirdparty/harfbuzz/src/hb-ot-name-language-static.hh index c496dc2981..0e0f2d632a 100644 --- a/thirdparty/harfbuzz/src/hb-ot-name-language-static.hh +++ b/thirdparty/harfbuzz/src/hb-ot-name-language-static.hh @@ -45,7 +45,7 @@ struct hb_ot_language_map_t }; static const hb_ot_language_map_t -hb_ms_language_map[] = +_hb_ms_language_map[] = { {0x0001, "ar"}, /* ??? */ {0x0004, "zh"}, /* ??? */ @@ -298,7 +298,7 @@ hb_ms_language_map[] = }; static const hb_ot_language_map_t -hb_mac_language_map[] = +_hb_mac_language_map[] = { { 0, "en"}, /* English */ { 1, "fr"}, /* French */ @@ -441,16 +441,16 @@ hb_language_t _hb_ot_name_language_for_ms_code (unsigned int code) { return _hb_ot_name_language_for (code, - hb_ms_language_map, - ARRAY_LENGTH (hb_ms_language_map)); + _hb_ms_language_map, + ARRAY_LENGTH (_hb_ms_language_map)); } hb_language_t _hb_ot_name_language_for_mac_code (unsigned int code) { return _hb_ot_name_language_for (code, - hb_mac_language_map, - ARRAY_LENGTH (hb_mac_language_map)); + _hb_mac_language_map, + ARRAY_LENGTH (_hb_mac_language_map)); } #endif /* HB_OT_NAME_LANGUAGE_STATIC_HH */ diff --git a/thirdparty/harfbuzz/src/hb-ot-name-table.hh b/thirdparty/harfbuzz/src/hb-ot-name-table.hh index d52367e9b1..01107aad67 100644 --- a/thirdparty/harfbuzz/src/hb-ot-name-table.hh +++ b/thirdparty/harfbuzz/src/hb-ot-name-table.hh @@ -156,7 +156,7 @@ struct NameRecord }; static int -_hb_ot_name_entry_cmp_key (const void *pa, const void *pb) +_hb_ot_name_entry_cmp_key (const void *pa, const void *pb, bool exact) { const hb_ot_name_entry_t *a = (const hb_ot_name_entry_t *) pa; const hb_ot_name_entry_t *b = (const hb_ot_name_entry_t *) pb; @@ -169,8 +169,23 @@ _hb_ot_name_entry_cmp_key (const void *pa, const void *pb) if (a->language == b->language) return 0; if (!a->language) return -1; if (!b->language) return +1; - return strcmp (hb_language_to_string (a->language), - hb_language_to_string (b->language)); + + const char *astr = hb_language_to_string (a->language); + const char *bstr = hb_language_to_string (b->language); + + signed c = strcmp (astr, bstr); + + if (!exact && c) + { + unsigned la = strlen (astr); + unsigned lb = strlen (bstr); + // 'a' is the user request, and 'b' is string in the font. + // If eg. user asks for "en-us" and font has "en", approve. + if (la > lb && astr[lb] == '-' && !strncmp (astr, bstr, lb)) + return 0; + } + + return c; } static int @@ -178,7 +193,7 @@ _hb_ot_name_entry_cmp (const void *pa, const void *pb) { /* Compare by name_id, then language, then score, then index. */ - int v = _hb_ot_name_entry_cmp_key (pa, pb); + int v = _hb_ot_name_entry_cmp_key (pa, pb, true); if (v) return v; @@ -330,7 +345,18 @@ struct name const hb_ot_name_entry_t *entry = hb_bsearch (key, (const hb_ot_name_entry_t *) this->names, this->names.length, sizeof (hb_ot_name_entry_t), - _hb_ot_name_entry_cmp_key); + _hb_ot_name_entry_cmp_key, + true); + + if (!entry) + { + entry = hb_bsearch (key, (const hb_ot_name_entry_t *) this->names, + this->names.length, + sizeof (hb_ot_name_entry_t), + _hb_ot_name_entry_cmp_key, + false); + } + if (!entry) return -1; diff --git a/thirdparty/harfbuzz/src/hb-ot-os2-table.hh b/thirdparty/harfbuzz/src/hb-ot-os2-table.hh index f0035e2f04..3473afef54 100644 --- a/thirdparty/harfbuzz/src/hb-ot-os2-table.hh +++ b/thirdparty/harfbuzz/src/hb-ot-os2-table.hh @@ -224,9 +224,11 @@ struct OS2 *max_cp = hb_min (0xFFFFu, codepoints->get_max ()); } - /* https://github.com/Microsoft/Font-Validator/blob/520aaae/OTFontFileVal/val_OS2.cs#L644-L681 */ + /* https://github.com/Microsoft/Font-Validator/blob/520aaae/OTFontFileVal/val_OS2.cs#L644-L681 + * https://docs.microsoft.com/en-us/typography/legacy/legacy_arabic_fonts */ enum font_page_t { + FONT_PAGE_NONE = 0, FONT_PAGE_HEBREW = 0xB100, /* Hebrew Windows 3.1 font page */ FONT_PAGE_SIMP_ARABIC = 0xB200, /* Simplified Arabic Windows 3.1 font page */ FONT_PAGE_TRAD_ARABIC = 0xB300, /* Traditional Arabic Windows 3.1 font page */ diff --git a/thirdparty/harfbuzz/src/hb-ot-post-table-v2subset.hh b/thirdparty/harfbuzz/src/hb-ot-post-table-v2subset.hh index 0f3cd8e24f..4d427e5431 100644 --- a/thirdparty/harfbuzz/src/hb-ot-post-table-v2subset.hh +++ b/thirdparty/harfbuzz/src/hb-ot-post-table-v2subset.hh @@ -52,16 +52,16 @@ HB_INTERNAL bool postV2Tail::serialize (hb_serialize_context_t *c, { unsigned glyph_id = _.first; unsigned new_index = _.second; - + if (new_index < 258) continue; if (copied_indices.has (new_index)) continue; copied_indices.add (new_index); - + hb_bytes_t s = reinterpret_cast<const post::accelerator_t*> (_post)->find_glyph_name (glyph_id); HBUINT8 *o = c->allocate_size<HBUINT8> (HBUINT8::static_size * (s.length + 1)); if (unlikely (!o)) return_trace (false); if (!c->check_assign (o[0], s.length, HB_SERIALIZE_ERROR_INT_OVERFLOW)) return_trace (false); - memcpy (o+1, s.arrayZ, HBUINT8::static_size * s.length); + hb_memcpy (o+1, s.arrayZ, HBUINT8::static_size * s.length); } return_trace (true); @@ -78,17 +78,19 @@ HB_INTERNAL bool postV2Tail::subset (hb_subset_context_t *c) const post::accelerator_t _post (c->plan->source); - hb_hashmap_t<hb_bytes_t, unsigned, std::nullptr_t, unsigned, nullptr, (unsigned)-1> glyph_name_to_new_index; + hb_hashmap_t<hb_bytes_t, unsigned, true> glyph_name_to_new_index; for (hb_codepoint_t new_gid = 0; new_gid < num_glyphs; new_gid++) { hb_codepoint_t old_gid = reverse_glyph_map.get (new_gid); unsigned old_index = glyphNameIndex[old_gid]; unsigned new_index; + const unsigned *new_index2; if (old_index <= 257) new_index = old_index; - else if (old_new_index_map.has (old_index)) new_index = old_new_index_map.get (old_index); - else + else if (old_new_index_map.has (old_index, &new_index2)) { + new_index = *new_index2; + } else { hb_bytes_t s = _post.find_glyph_name (old_gid); new_index = glyph_name_to_new_index.get (s); if (new_index == (unsigned)-1) diff --git a/thirdparty/harfbuzz/src/hb-ot-shape-complex-indic-machine.hh b/thirdparty/harfbuzz/src/hb-ot-shape-complex-indic-machine.hh deleted file mode 100644 index 74bf3ca0fa..0000000000 --- a/thirdparty/harfbuzz/src/hb-ot-shape-complex-indic-machine.hh +++ /dev/null @@ -1,603 +0,0 @@ - -#line 1 "hb-ot-shape-complex-indic-machine.rl" -/* - * Copyright © 2011,2012 Google, Inc. - * - * This is part of HarfBuzz, a text shaping library. - * - * Permission is hereby granted, without written agreement and without - * license or royalty fees, to use, copy, modify, and distribute this - * software and its documentation for any purpose, provided that the - * above copyright notice and the following two paragraphs appear in - * all copies of this software. - * - * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR - * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES - * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN - * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH - * DAMAGE. - * - * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, - * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS - * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO - * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. - * - * Google Author(s): Behdad Esfahbod - */ - -#ifndef HB_OT_SHAPE_COMPLEX_INDIC_MACHINE_HH -#define HB_OT_SHAPE_COMPLEX_INDIC_MACHINE_HH - -#include "hb.hh" - -enum indic_syllable_type_t { - indic_consonant_syllable, - indic_vowel_syllable, - indic_standalone_cluster, - indic_symbol_cluster, - indic_broken_cluster, - indic_non_indic_cluster, -}; - - -#line 45 "hb-ot-shape-complex-indic-machine.hh" -#define indic_syllable_machine_ex_A 10u -#define indic_syllable_machine_ex_C 1u -#define indic_syllable_machine_ex_CM 17u -#define indic_syllable_machine_ex_CS 19u -#define indic_syllable_machine_ex_DOTTEDCIRCLE 12u -#define indic_syllable_machine_ex_H 4u -#define indic_syllable_machine_ex_M 7u -#define indic_syllable_machine_ex_N 3u -#define indic_syllable_machine_ex_PLACEHOLDER 11u -#define indic_syllable_machine_ex_RS 13u -#define indic_syllable_machine_ex_Ra 16u -#define indic_syllable_machine_ex_Repha 15u -#define indic_syllable_machine_ex_SM 8u -#define indic_syllable_machine_ex_Symbol 18u -#define indic_syllable_machine_ex_V 2u -#define indic_syllable_machine_ex_ZWJ 6u -#define indic_syllable_machine_ex_ZWNJ 5u - - -#line 65 "hb-ot-shape-complex-indic-machine.hh" -static const unsigned char _indic_syllable_machine_trans_keys[] = { - 8u, 8u, 4u, 8u, 5u, 7u, 5u, 8u, 4u, 8u, 6u, 6u, 16u, 16u, 4u, 8u, - 4u, 13u, 4u, 8u, 8u, 8u, 5u, 7u, 5u, 8u, 4u, 8u, 6u, 6u, 16u, 16u, - 4u, 8u, 4u, 13u, 4u, 13u, 4u, 13u, 8u, 8u, 5u, 7u, 5u, 8u, 4u, 8u, - 6u, 6u, 16u, 16u, 4u, 8u, 4u, 8u, 4u, 13u, 8u, 8u, 5u, 7u, 5u, 8u, - 4u, 8u, 6u, 6u, 16u, 16u, 4u, 8u, 4u, 8u, 5u, 8u, 8u, 8u, 1u, 19u, - 3u, 17u, 3u, 17u, 4u, 17u, 1u, 16u, 5u, 10u, 5u, 10u, 10u, 10u, 5u, 10u, - 1u, 16u, 1u, 16u, 1u, 16u, 3u, 10u, 4u, 10u, 5u, 10u, 4u, 10u, 5u, 10u, - 3u, 10u, 5u, 10u, 3u, 17u, 3u, 17u, 3u, 17u, 3u, 17u, 4u, 17u, 1u, 16u, - 3u, 17u, 3u, 17u, 4u, 17u, 1u, 16u, 5u, 10u, 10u, 10u, 5u, 10u, 1u, 16u, - 1u, 16u, 3u, 10u, 4u, 10u, 5u, 10u, 4u, 10u, 5u, 10u, 5u, 10u, 3u, 10u, - 5u, 10u, 3u, 17u, 3u, 17u, 4u, 8u, 3u, 17u, 3u, 17u, 4u, 17u, 1u, 16u, - 3u, 17u, 1u, 16u, 5u, 10u, 10u, 10u, 5u, 10u, 1u, 16u, 1u, 16u, 3u, 10u, - 4u, 10u, 5u, 10u, 3u, 17u, 4u, 10u, 5u, 10u, 5u, 10u, 3u, 10u, 5u, 10u, - 3u, 17u, 4u, 13u, 4u, 8u, 3u, 17u, 3u, 17u, 4u, 17u, 1u, 16u, 3u, 17u, - 1u, 16u, 5u, 10u, 10u, 10u, 5u, 10u, 1u, 16u, 1u, 16u, 3u, 10u, 4u, 10u, - 5u, 10u, 3u, 17u, 4u, 10u, 5u, 10u, 5u, 10u, 3u, 10u, 5u, 10u, 1u, 17u, - 3u, 17u, 1u, 17u, 4u, 13u, 5u, 10u, 10u, 10u, 5u, 10u, 1u, 16u, 3u, 10u, - 5u, 10u, 5u, 10u, 10u, 10u, 5u, 10u, 1u, 16u, 0 -}; - -static const char _indic_syllable_machine_key_spans[] = { - 1, 5, 3, 4, 5, 1, 1, 5, - 10, 5, 1, 3, 4, 5, 1, 1, - 5, 10, 10, 10, 1, 3, 4, 5, - 1, 1, 5, 5, 10, 1, 3, 4, - 5, 1, 1, 5, 5, 4, 1, 19, - 15, 15, 14, 16, 6, 6, 1, 6, - 16, 16, 16, 8, 7, 6, 7, 6, - 8, 6, 15, 15, 15, 15, 14, 16, - 15, 15, 14, 16, 6, 1, 6, 16, - 16, 8, 7, 6, 7, 6, 6, 8, - 6, 15, 15, 5, 15, 15, 14, 16, - 15, 16, 6, 1, 6, 16, 16, 8, - 7, 6, 15, 7, 6, 6, 8, 6, - 15, 10, 5, 15, 15, 14, 16, 15, - 16, 6, 1, 6, 16, 16, 8, 7, - 6, 15, 7, 6, 6, 8, 6, 17, - 15, 17, 10, 6, 1, 6, 16, 8, - 6, 6, 1, 6, 16 -}; - -static const short _indic_syllable_machine_index_offsets[] = { - 0, 2, 8, 12, 17, 23, 25, 27, - 33, 44, 50, 52, 56, 61, 67, 69, - 71, 77, 88, 99, 110, 112, 116, 121, - 127, 129, 131, 137, 143, 154, 156, 160, - 165, 171, 173, 175, 181, 187, 192, 194, - 214, 230, 246, 261, 278, 285, 292, 294, - 301, 318, 335, 352, 361, 369, 376, 384, - 391, 400, 407, 423, 439, 455, 471, 486, - 503, 519, 535, 550, 567, 574, 576, 583, - 600, 617, 626, 634, 641, 649, 656, 663, - 672, 679, 695, 711, 717, 733, 749, 764, - 781, 797, 814, 821, 823, 830, 847, 864, - 873, 881, 888, 904, 912, 919, 926, 935, - 942, 958, 969, 975, 991, 1007, 1022, 1039, - 1055, 1072, 1079, 1081, 1088, 1105, 1122, 1131, - 1139, 1146, 1162, 1170, 1177, 1184, 1193, 1200, - 1218, 1234, 1252, 1263, 1270, 1272, 1279, 1296, - 1305, 1312, 1319, 1321, 1328 -}; - -static const unsigned char _indic_syllable_machine_indicies[] = { - 1, 0, 2, 3, 3, 4, 1, 0, - 3, 3, 4, 0, 3, 3, 4, 1, - 0, 5, 3, 3, 4, 1, 0, 6, - 0, 7, 0, 8, 3, 3, 4, 1, - 0, 2, 3, 3, 4, 1, 0, 0, - 0, 0, 9, 0, 11, 12, 12, 13, - 14, 10, 14, 10, 12, 12, 13, 10, - 12, 12, 13, 14, 10, 15, 12, 12, - 13, 14, 10, 16, 10, 17, 10, 18, - 12, 12, 13, 14, 10, 11, 12, 12, - 13, 14, 10, 10, 10, 10, 19, 10, - 11, 12, 12, 13, 14, 10, 10, 10, - 10, 20, 10, 22, 23, 23, 24, 25, - 21, 21, 21, 21, 26, 21, 25, 21, - 23, 23, 24, 27, 23, 23, 24, 25, - 21, 28, 23, 23, 24, 25, 21, 29, - 21, 30, 21, 22, 23, 23, 24, 25, - 21, 31, 23, 23, 24, 25, 21, 33, - 34, 34, 35, 36, 32, 32, 32, 32, - 37, 32, 36, 32, 34, 34, 35, 32, - 34, 34, 35, 36, 32, 38, 34, 34, - 35, 36, 32, 39, 32, 40, 32, 33, - 34, 34, 35, 36, 32, 41, 34, 34, - 35, 36, 32, 23, 23, 24, 1, 0, - 43, 42, 45, 46, 47, 48, 49, 50, - 24, 25, 44, 51, 52, 52, 26, 44, - 53, 54, 55, 56, 57, 44, 59, 60, - 61, 62, 4, 1, 58, 63, 58, 58, - 9, 58, 58, 58, 64, 58, 65, 60, - 66, 66, 4, 1, 58, 63, 58, 58, - 58, 58, 58, 58, 64, 58, 60, 66, - 66, 4, 1, 58, 63, 58, 58, 58, - 58, 58, 58, 64, 58, 45, 58, 58, - 58, 67, 68, 58, 1, 58, 63, 58, - 58, 58, 58, 58, 45, 58, 69, 69, - 58, 1, 58, 63, 58, 63, 58, 58, - 70, 58, 63, 58, 63, 58, 63, 58, - 58, 58, 58, 63, 58, 45, 58, 71, - 58, 69, 69, 58, 1, 58, 63, 58, - 58, 58, 58, 58, 45, 58, 45, 58, - 58, 58, 69, 69, 58, 1, 58, 63, - 58, 58, 58, 58, 58, 45, 58, 45, - 58, 58, 58, 69, 68, 58, 1, 58, - 63, 58, 58, 58, 58, 58, 45, 58, - 72, 7, 73, 74, 4, 1, 58, 63, - 58, 7, 73, 74, 4, 1, 58, 63, - 58, 73, 73, 4, 1, 58, 63, 58, - 75, 76, 76, 4, 1, 58, 63, 58, - 67, 77, 58, 1, 58, 63, 58, 67, - 58, 69, 69, 58, 1, 58, 63, 58, - 69, 77, 58, 1, 58, 63, 58, 59, - 60, 66, 66, 4, 1, 58, 63, 58, - 58, 58, 58, 58, 58, 64, 58, 59, - 60, 61, 66, 4, 1, 58, 63, 58, - 58, 9, 58, 58, 58, 64, 58, 79, - 80, 81, 82, 13, 14, 78, 83, 78, - 78, 20, 78, 78, 78, 84, 78, 85, - 80, 86, 82, 13, 14, 78, 83, 78, - 78, 78, 78, 78, 78, 84, 78, 80, - 86, 82, 13, 14, 78, 83, 78, 78, - 78, 78, 78, 78, 84, 78, 87, 78, - 78, 78, 88, 89, 78, 14, 78, 83, - 78, 78, 78, 78, 78, 87, 78, 90, - 80, 91, 92, 13, 14, 78, 83, 78, - 78, 19, 78, 78, 78, 84, 78, 93, - 80, 86, 86, 13, 14, 78, 83, 78, - 78, 78, 78, 78, 78, 84, 78, 80, - 86, 86, 13, 14, 78, 83, 78, 78, - 78, 78, 78, 78, 84, 78, 87, 78, - 78, 78, 94, 89, 78, 14, 78, 83, - 78, 78, 78, 78, 78, 87, 78, 83, - 78, 78, 95, 78, 83, 78, 83, 78, - 83, 78, 78, 78, 78, 83, 78, 87, - 78, 96, 78, 94, 94, 78, 14, 78, - 83, 78, 78, 78, 78, 78, 87, 78, - 87, 78, 78, 78, 94, 94, 78, 14, - 78, 83, 78, 78, 78, 78, 78, 87, - 78, 97, 17, 98, 99, 13, 14, 78, - 83, 78, 17, 98, 99, 13, 14, 78, - 83, 78, 98, 98, 13, 14, 78, 83, - 78, 100, 101, 101, 13, 14, 78, 83, - 78, 88, 102, 78, 14, 78, 83, 78, - 94, 94, 78, 14, 78, 83, 78, 88, - 78, 94, 94, 78, 14, 78, 83, 78, - 94, 102, 78, 14, 78, 83, 78, 90, - 80, 86, 86, 13, 14, 78, 83, 78, - 78, 78, 78, 78, 78, 84, 78, 90, - 80, 91, 86, 13, 14, 78, 83, 78, - 78, 19, 78, 78, 78, 84, 78, 11, - 12, 12, 13, 14, 78, 79, 80, 86, - 82, 13, 14, 78, 83, 78, 78, 78, - 78, 78, 78, 84, 78, 104, 48, 105, - 105, 24, 25, 103, 51, 103, 103, 103, - 103, 103, 103, 55, 103, 48, 105, 105, - 24, 25, 103, 51, 103, 103, 103, 103, - 103, 103, 55, 103, 106, 103, 103, 103, - 107, 108, 103, 25, 103, 51, 103, 103, - 103, 103, 103, 106, 103, 47, 48, 109, - 110, 24, 25, 103, 51, 103, 103, 26, - 103, 103, 103, 55, 103, 106, 103, 103, - 103, 111, 108, 103, 25, 103, 51, 103, - 103, 103, 103, 103, 106, 103, 51, 103, - 103, 112, 103, 51, 103, 51, 103, 51, - 103, 103, 103, 103, 51, 103, 106, 103, - 113, 103, 111, 111, 103, 25, 103, 51, - 103, 103, 103, 103, 103, 106, 103, 106, - 103, 103, 103, 111, 111, 103, 25, 103, - 51, 103, 103, 103, 103, 103, 106, 103, - 114, 30, 115, 116, 24, 25, 103, 51, - 103, 30, 115, 116, 24, 25, 103, 51, - 103, 115, 115, 24, 25, 103, 51, 103, - 47, 48, 105, 105, 24, 25, 103, 51, - 103, 103, 103, 103, 103, 103, 55, 103, - 117, 118, 118, 24, 25, 103, 51, 103, - 107, 119, 103, 25, 103, 51, 103, 111, - 111, 103, 25, 103, 51, 103, 107, 103, - 111, 111, 103, 25, 103, 51, 103, 111, - 119, 103, 25, 103, 51, 103, 47, 48, - 109, 105, 24, 25, 103, 51, 103, 103, - 26, 103, 103, 103, 55, 103, 22, 23, - 23, 24, 25, 120, 120, 120, 120, 26, - 120, 22, 23, 23, 24, 25, 120, 122, - 123, 124, 125, 35, 36, 121, 126, 121, - 121, 37, 121, 121, 121, 127, 121, 128, - 123, 125, 125, 35, 36, 121, 126, 121, - 121, 121, 121, 121, 121, 127, 121, 123, - 125, 125, 35, 36, 121, 126, 121, 121, - 121, 121, 121, 121, 127, 121, 129, 121, - 121, 121, 130, 131, 121, 36, 121, 126, - 121, 121, 121, 121, 121, 129, 121, 122, - 123, 124, 52, 35, 36, 121, 126, 121, - 121, 37, 121, 121, 121, 127, 121, 129, - 121, 121, 121, 132, 131, 121, 36, 121, - 126, 121, 121, 121, 121, 121, 129, 121, - 126, 121, 121, 133, 121, 126, 121, 126, - 121, 126, 121, 121, 121, 121, 126, 121, - 129, 121, 134, 121, 132, 132, 121, 36, - 121, 126, 121, 121, 121, 121, 121, 129, - 121, 129, 121, 121, 121, 132, 132, 121, - 36, 121, 126, 121, 121, 121, 121, 121, - 129, 121, 135, 40, 136, 137, 35, 36, - 121, 126, 121, 40, 136, 137, 35, 36, - 121, 126, 121, 136, 136, 35, 36, 121, - 126, 121, 122, 123, 125, 125, 35, 36, - 121, 126, 121, 121, 121, 121, 121, 121, - 127, 121, 138, 139, 139, 35, 36, 121, - 126, 121, 130, 140, 121, 36, 121, 126, - 121, 132, 132, 121, 36, 121, 126, 121, - 130, 121, 132, 132, 121, 36, 121, 126, - 121, 132, 140, 121, 36, 121, 126, 121, - 45, 46, 47, 48, 109, 105, 24, 25, - 103, 51, 52, 52, 26, 103, 103, 45, - 55, 103, 59, 141, 61, 62, 4, 1, - 58, 63, 58, 58, 9, 58, 58, 58, - 64, 58, 45, 46, 47, 48, 142, 143, - 24, 144, 58, 145, 58, 52, 26, 58, - 58, 45, 55, 58, 22, 146, 146, 24, - 144, 58, 63, 58, 58, 26, 58, 145, - 58, 58, 147, 58, 145, 58, 145, 58, - 145, 58, 58, 58, 58, 145, 58, 45, - 58, 71, 22, 146, 146, 24, 144, 58, - 63, 58, 58, 58, 58, 58, 45, 58, - 149, 148, 150, 150, 148, 43, 148, 151, - 148, 150, 150, 148, 43, 148, 151, 148, - 151, 148, 148, 152, 148, 151, 148, 151, - 148, 151, 148, 148, 148, 148, 151, 148, - 45, 120, 120, 120, 120, 120, 120, 120, - 120, 120, 52, 120, 120, 120, 120, 45, - 120, 0 -}; - -static const unsigned char _indic_syllable_machine_trans_targs[] = { - 39, 45, 50, 2, 51, 5, 6, 53, - 57, 58, 39, 67, 11, 73, 68, 14, - 15, 75, 80, 81, 84, 39, 89, 21, - 95, 90, 98, 39, 24, 25, 97, 103, - 39, 112, 30, 118, 113, 121, 33, 34, - 120, 126, 39, 137, 39, 40, 60, 85, - 87, 105, 106, 91, 107, 127, 128, 99, - 135, 140, 39, 41, 43, 8, 59, 46, - 54, 42, 1, 44, 48, 0, 47, 49, - 52, 3, 4, 55, 7, 56, 39, 61, - 63, 18, 83, 69, 76, 62, 9, 64, - 78, 71, 65, 17, 82, 66, 10, 70, - 72, 74, 12, 13, 77, 16, 79, 39, - 86, 26, 88, 101, 93, 19, 104, 20, - 92, 94, 96, 22, 23, 100, 27, 102, - 39, 39, 108, 110, 28, 35, 114, 122, - 109, 111, 124, 116, 29, 115, 117, 119, - 31, 32, 123, 36, 125, 129, 130, 134, - 131, 132, 37, 133, 39, 136, 38, 138, - 139 -}; - -static const char _indic_syllable_machine_trans_actions[] = { - 1, 0, 2, 0, 2, 0, 0, 2, - 2, 2, 3, 2, 0, 2, 0, 0, - 0, 2, 2, 2, 2, 4, 2, 0, - 5, 0, 5, 6, 0, 0, 5, 2, - 7, 2, 0, 2, 0, 2, 0, 0, - 2, 2, 8, 0, 11, 2, 2, 5, - 0, 12, 12, 0, 2, 5, 2, 5, - 2, 0, 13, 2, 0, 0, 2, 0, - 2, 2, 0, 2, 2, 0, 0, 2, - 2, 0, 0, 0, 0, 2, 14, 2, - 0, 0, 2, 0, 2, 2, 0, 2, - 2, 2, 2, 0, 2, 2, 0, 0, - 2, 2, 0, 0, 0, 0, 2, 15, - 5, 0, 5, 2, 2, 0, 5, 0, - 0, 2, 5, 0, 0, 0, 0, 2, - 16, 17, 2, 0, 0, 0, 0, 2, - 2, 2, 2, 2, 0, 0, 2, 2, - 0, 0, 0, 0, 2, 0, 18, 18, - 0, 0, 0, 0, 19, 2, 0, 0, - 0 -}; - -static const char _indic_syllable_machine_to_state_actions[] = { - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 9, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0 -}; - -static const char _indic_syllable_machine_from_state_actions[] = { - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 10, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0 -}; - -static const short _indic_syllable_machine_eof_trans[] = { - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 22, 22, 28, 22, 22, - 22, 22, 22, 22, 33, 33, 33, 33, - 33, 33, 33, 33, 33, 1, 43, 0, - 59, 59, 59, 59, 59, 59, 59, 59, - 59, 59, 59, 59, 59, 59, 59, 59, - 59, 59, 59, 59, 79, 79, 79, 79, - 79, 79, 79, 79, 79, 79, 79, 79, - 79, 79, 79, 79, 79, 79, 79, 79, - 79, 79, 79, 79, 79, 104, 104, 104, - 104, 104, 104, 104, 104, 104, 104, 104, - 104, 104, 104, 104, 104, 104, 104, 104, - 104, 121, 121, 122, 122, 122, 122, 122, - 122, 122, 122, 122, 122, 122, 122, 122, - 122, 122, 122, 122, 122, 122, 122, 104, - 59, 59, 59, 59, 59, 59, 59, 149, - 149, 149, 149, 149, 121 -}; - -static const int indic_syllable_machine_start = 39; -static const int indic_syllable_machine_first_final = 39; -static const int indic_syllable_machine_error = -1; - -static const int indic_syllable_machine_en_main = 39; - - -#line 46 "hb-ot-shape-complex-indic-machine.rl" - - - -#line 102 "hb-ot-shape-complex-indic-machine.rl" - - -#define found_syllable(syllable_type) \ - HB_STMT_START { \ - if (0) fprintf (stderr, "syllable %d..%d %s\n", ts, te, #syllable_type); \ - for (unsigned int i = ts; i < te; i++) \ - info[i].syllable() = (syllable_serial << 4) | syllable_type; \ - syllable_serial++; \ - if (unlikely (syllable_serial == 16)) syllable_serial = 1; \ - } HB_STMT_END - -static void -find_syllables_indic (hb_buffer_t *buffer) -{ - unsigned int p, pe, eof, ts, te, act; - int cs; - hb_glyph_info_t *info = buffer->info; - -#line 440 "hb-ot-shape-complex-indic-machine.hh" - { - cs = indic_syllable_machine_start; - ts = 0; - te = 0; - act = 0; - } - -#line 122 "hb-ot-shape-complex-indic-machine.rl" - - - p = 0; - pe = eof = buffer->len; - - unsigned int syllable_serial = 1; - -#line 456 "hb-ot-shape-complex-indic-machine.hh" - { - int _slen; - int _trans; - const unsigned char *_keys; - const unsigned char *_inds; - if ( p == pe ) - goto _test_eof; -_resume: - switch ( _indic_syllable_machine_from_state_actions[cs] ) { - case 10: -#line 1 "NONE" - {ts = p;} - break; -#line 470 "hb-ot-shape-complex-indic-machine.hh" - } - - _keys = _indic_syllable_machine_trans_keys + (cs<<1); - _inds = _indic_syllable_machine_indicies + _indic_syllable_machine_index_offsets[cs]; - - _slen = _indic_syllable_machine_key_spans[cs]; - _trans = _inds[ _slen > 0 && _keys[0] <=( info[p].indic_category()) && - ( info[p].indic_category()) <= _keys[1] ? - ( info[p].indic_category()) - _keys[0] : _slen ]; - -_eof_trans: - cs = _indic_syllable_machine_trans_targs[_trans]; - - if ( _indic_syllable_machine_trans_actions[_trans] == 0 ) - goto _again; - - switch ( _indic_syllable_machine_trans_actions[_trans] ) { - case 2: -#line 1 "NONE" - {te = p+1;} - break; - case 11: -#line 98 "hb-ot-shape-complex-indic-machine.rl" - {te = p+1;{ found_syllable (indic_non_indic_cluster); }} - break; - case 13: -#line 93 "hb-ot-shape-complex-indic-machine.rl" - {te = p;p--;{ found_syllable (indic_consonant_syllable); }} - break; - case 14: -#line 94 "hb-ot-shape-complex-indic-machine.rl" - {te = p;p--;{ found_syllable (indic_vowel_syllable); }} - break; - case 17: -#line 95 "hb-ot-shape-complex-indic-machine.rl" - {te = p;p--;{ found_syllable (indic_standalone_cluster); }} - break; - case 19: -#line 96 "hb-ot-shape-complex-indic-machine.rl" - {te = p;p--;{ found_syllable (indic_symbol_cluster); }} - break; - case 15: -#line 97 "hb-ot-shape-complex-indic-machine.rl" - {te = p;p--;{ found_syllable (indic_broken_cluster); }} - break; - case 16: -#line 98 "hb-ot-shape-complex-indic-machine.rl" - {te = p;p--;{ found_syllable (indic_non_indic_cluster); }} - break; - case 1: -#line 93 "hb-ot-shape-complex-indic-machine.rl" - {{p = ((te))-1;}{ found_syllable (indic_consonant_syllable); }} - break; - case 3: -#line 94 "hb-ot-shape-complex-indic-machine.rl" - {{p = ((te))-1;}{ found_syllable (indic_vowel_syllable); }} - break; - case 7: -#line 95 "hb-ot-shape-complex-indic-machine.rl" - {{p = ((te))-1;}{ found_syllable (indic_standalone_cluster); }} - break; - case 8: -#line 96 "hb-ot-shape-complex-indic-machine.rl" - {{p = ((te))-1;}{ found_syllable (indic_symbol_cluster); }} - break; - case 4: -#line 97 "hb-ot-shape-complex-indic-machine.rl" - {{p = ((te))-1;}{ found_syllable (indic_broken_cluster); }} - break; - case 6: -#line 1 "NONE" - { switch( act ) { - case 1: - {{p = ((te))-1;} found_syllable (indic_consonant_syllable); } - break; - case 5: - {{p = ((te))-1;} found_syllable (indic_broken_cluster); } - break; - case 6: - {{p = ((te))-1;} found_syllable (indic_non_indic_cluster); } - break; - } - } - break; - case 18: -#line 1 "NONE" - {te = p+1;} -#line 93 "hb-ot-shape-complex-indic-machine.rl" - {act = 1;} - break; - case 5: -#line 1 "NONE" - {te = p+1;} -#line 97 "hb-ot-shape-complex-indic-machine.rl" - {act = 5;} - break; - case 12: -#line 1 "NONE" - {te = p+1;} -#line 98 "hb-ot-shape-complex-indic-machine.rl" - {act = 6;} - break; -#line 573 "hb-ot-shape-complex-indic-machine.hh" - } - -_again: - switch ( _indic_syllable_machine_to_state_actions[cs] ) { - case 9: -#line 1 "NONE" - {ts = 0;} - break; -#line 582 "hb-ot-shape-complex-indic-machine.hh" - } - - if ( ++p != pe ) - goto _resume; - _test_eof: {} - if ( p == eof ) - { - if ( _indic_syllable_machine_eof_trans[cs] > 0 ) { - _trans = _indic_syllable_machine_eof_trans[cs] - 1; - goto _eof_trans; - } - } - - } - -#line 130 "hb-ot-shape-complex-indic-machine.rl" - -} - -#undef found_syllable - -#endif /* HB_OT_SHAPE_COMPLEX_INDIC_MACHINE_HH */ diff --git a/thirdparty/harfbuzz/src/hb-ot-shape-complex-indic-table.cc b/thirdparty/harfbuzz/src/hb-ot-shape-complex-indic-table.cc deleted file mode 100644 index 326aa9f96e..0000000000 --- a/thirdparty/harfbuzz/src/hb-ot-shape-complex-indic-table.cc +++ /dev/null @@ -1,501 +0,0 @@ -/* == Start of generated table == */ -/* - * The following table is generated by running: - * - * ./gen-indic-table.py IndicSyllabicCategory.txt IndicPositionalCategory.txt Blocks.txt - * - * on files with these headers: - * - * # IndicSyllabicCategory-14.0.0.txt - * # Date: 2021-05-22, 01:01:00 GMT [KW, RP] - * # IndicPositionalCategory-14.0.0.txt - * # Date: 2021-05-22, 01:01:00 GMT [KW, RP] - * # Blocks-14.0.0.txt - * # Date: 2021-01-22, 23:29:00 GMT [KW] - */ - -#include "hb.hh" - -#ifndef HB_NO_OT_SHAPE - -#include "hb-ot-shape-complex-indic.hh" - -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-macros" - -#define ISC_A INDIC_SYLLABIC_CATEGORY_AVAGRAHA /* 17 chars; Avagraha */ -#define ISC_Bi INDIC_SYLLABIC_CATEGORY_BINDU /* 91 chars; Bindu */ -#define ISC_BJN INDIC_SYLLABIC_CATEGORY_BRAHMI_JOINING_NUMBER /* 20 chars; Brahmi_Joining_Number */ -#define ISC_Ca INDIC_SYLLABIC_CATEGORY_CANTILLATION_MARK /* 59 chars; Cantillation_Mark */ -#define ISC_C INDIC_SYLLABIC_CATEGORY_CONSONANT /* 2206 chars; Consonant */ -#define ISC_CD INDIC_SYLLABIC_CATEGORY_CONSONANT_DEAD /* 14 chars; Consonant_Dead */ -#define ISC_CF INDIC_SYLLABIC_CATEGORY_CONSONANT_FINAL /* 70 chars; Consonant_Final */ -#define ISC_CHL INDIC_SYLLABIC_CATEGORY_CONSONANT_HEAD_LETTER /* 5 chars; Consonant_Head_Letter */ -#define ISC_CIP INDIC_SYLLABIC_CATEGORY_CONSONANT_INITIAL_POSTFIXED /* 1 chars; Consonant_Initial_Postfixed */ -#define ISC_CK INDIC_SYLLABIC_CATEGORY_CONSONANT_KILLER /* 2 chars; Consonant_Killer */ -#define ISC_CM INDIC_SYLLABIC_CATEGORY_CONSONANT_MEDIAL /* 31 chars; Consonant_Medial */ -#define ISC_CP INDIC_SYLLABIC_CATEGORY_CONSONANT_PLACEHOLDER /* 22 chars; Consonant_Placeholder */ -#define ISC_CPR INDIC_SYLLABIC_CATEGORY_CONSONANT_PRECEDING_REPHA /* 3 chars; Consonant_Preceding_Repha */ -#define ISC_CPrf INDIC_SYLLABIC_CATEGORY_CONSONANT_PREFIXED /* 10 chars; Consonant_Prefixed */ -#define ISC_CS INDIC_SYLLABIC_CATEGORY_CONSONANT_SUBJOINED /* 94 chars; Consonant_Subjoined */ -#define ISC_CSR INDIC_SYLLABIC_CATEGORY_CONSONANT_SUCCEEDING_REPHA /* 1 chars; Consonant_Succeeding_Repha */ -#define ISC_CWS INDIC_SYLLABIC_CATEGORY_CONSONANT_WITH_STACKER /* 8 chars; Consonant_With_Stacker */ -#define ISC_GM INDIC_SYLLABIC_CATEGORY_GEMINATION_MARK /* 3 chars; Gemination_Mark */ -#define ISC_IS INDIC_SYLLABIC_CATEGORY_INVISIBLE_STACKER /* 12 chars; Invisible_Stacker */ -#define ISC_ZWJ INDIC_SYLLABIC_CATEGORY_JOINER /* 1 chars; Joiner */ -#define ISC_ML INDIC_SYLLABIC_CATEGORY_MODIFYING_LETTER /* 1 chars; Modifying_Letter */ -#define ISC_ZWNJ INDIC_SYLLABIC_CATEGORY_NON_JOINER /* 1 chars; Non_Joiner */ -#define ISC_N INDIC_SYLLABIC_CATEGORY_NUKTA /* 32 chars; Nukta */ -#define ISC_Nd INDIC_SYLLABIC_CATEGORY_NUMBER /* 491 chars; Number */ -#define ISC_NJ INDIC_SYLLABIC_CATEGORY_NUMBER_JOINER /* 1 chars; Number_Joiner */ -#define ISC_x INDIC_SYLLABIC_CATEGORY_OTHER /* 1 chars; Other */ -#define ISC_PK INDIC_SYLLABIC_CATEGORY_PURE_KILLER /* 25 chars; Pure_Killer */ -#define ISC_RS INDIC_SYLLABIC_CATEGORY_REGISTER_SHIFTER /* 2 chars; Register_Shifter */ -#define ISC_SM INDIC_SYLLABIC_CATEGORY_SYLLABLE_MODIFIER /* 25 chars; Syllable_Modifier */ -#define ISC_TL INDIC_SYLLABIC_CATEGORY_TONE_LETTER /* 7 chars; Tone_Letter */ -#define ISC_TM INDIC_SYLLABIC_CATEGORY_TONE_MARK /* 42 chars; Tone_Mark */ -#define ISC_V INDIC_SYLLABIC_CATEGORY_VIRAMA /* 27 chars; Virama */ -#define ISC_Vs INDIC_SYLLABIC_CATEGORY_VISARGA /* 35 chars; Visarga */ -#define ISC_Vo INDIC_SYLLABIC_CATEGORY_VOWEL /* 30 chars; Vowel */ -#define ISC_M INDIC_SYLLABIC_CATEGORY_VOWEL_DEPENDENT /* 686 chars; Vowel_Dependent */ -#define ISC_VI INDIC_SYLLABIC_CATEGORY_VOWEL_INDEPENDENT /* 486 chars; Vowel_Independent */ - -#define IMC_B INDIC_MATRA_CATEGORY_BOTTOM /* 352 chars; Bottom */ -#define IMC_BL INDIC_MATRA_CATEGORY_BOTTOM_AND_LEFT /* 1 chars; Bottom_And_Left */ -#define IMC_BR INDIC_MATRA_CATEGORY_BOTTOM_AND_RIGHT /* 4 chars; Bottom_And_Right */ -#define IMC_L INDIC_MATRA_CATEGORY_LEFT /* 64 chars; Left */ -#define IMC_LR INDIC_MATRA_CATEGORY_LEFT_AND_RIGHT /* 22 chars; Left_And_Right */ -#define IMC_x INDIC_MATRA_CATEGORY_NOT_APPLICABLE /* 1 chars; Not_Applicable */ -#define IMC_O INDIC_MATRA_CATEGORY_OVERSTRUCK /* 10 chars; Overstruck */ -#define IMC_R INDIC_MATRA_CATEGORY_RIGHT /* 290 chars; Right */ -#define IMC_T INDIC_MATRA_CATEGORY_TOP /* 418 chars; Top */ -#define IMC_TB INDIC_MATRA_CATEGORY_TOP_AND_BOTTOM /* 10 chars; Top_And_Bottom */ -#define IMC_TBL INDIC_MATRA_CATEGORY_TOP_AND_BOTTOM_AND_LEFT /* 2 chars; Top_And_Bottom_And_Left */ -#define IMC_TBR INDIC_MATRA_CATEGORY_TOP_AND_BOTTOM_AND_RIGHT /* 1 chars; Top_And_Bottom_And_Right */ -#define IMC_TL INDIC_MATRA_CATEGORY_TOP_AND_LEFT /* 6 chars; Top_And_Left */ -#define IMC_TLR INDIC_MATRA_CATEGORY_TOP_AND_LEFT_AND_RIGHT /* 4 chars; Top_And_Left_And_Right */ -#define IMC_TR INDIC_MATRA_CATEGORY_TOP_AND_RIGHT /* 13 chars; Top_And_Right */ -#define IMC_VOL INDIC_MATRA_CATEGORY_VISUAL_ORDER_LEFT /* 19 chars; Visual_Order_Left */ - -#pragma GCC diagnostic pop - -#define _(S,M) INDIC_COMBINE_CATEGORIES (ISC_##S, IMC_##M) - - -static const uint16_t indic_table[] = { - - -#define indic_offset_0x0028u 0 - - - /* Basic Latin */ - - /* 0028 */ _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(CP,x), _(x,x), _(x,x), - /* 0030 */ _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), - /* 0038 */ _(Nd,x), _(Nd,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), - -#define indic_offset_0x00b0u 24 - - - /* Latin-1 Supplement */ - - /* 00B0 */ _(x,x), _(x,x), _(SM,x), _(SM,x), _(x,x), _(x,x), _(x,x), _(x,x), - /* 00B8 */ _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), - /* 00C0 */ _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), - /* 00C8 */ _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), - /* 00D0 */ _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(CP,x), - -#define indic_offset_0x0900u 64 - - - /* Devanagari */ - - /* 0900 */ _(Bi,T), _(Bi,T), _(Bi,T), _(Vs,R), _(VI,x), _(VI,x), _(VI,x), _(VI,x), - /* 0908 */ _(VI,x), _(VI,x), _(VI,x), _(VI,x), _(VI,x), _(VI,x), _(VI,x), _(VI,x), - /* 0910 */ _(VI,x), _(VI,x), _(VI,x), _(VI,x), _(VI,x), _(C,x), _(C,x), _(C,x), - /* 0918 */ _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), - /* 0920 */ _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), - /* 0928 */ _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), - /* 0930 */ _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), - /* 0938 */ _(C,x), _(C,x), _(M,T), _(M,R), _(N,B), _(A,x), _(M,R), _(M,L), - /* 0940 */ _(M,R), _(M,B), _(M,B), _(M,B), _(M,B), _(M,T), _(M,T), _(M,T), - /* 0948 */ _(M,T), _(M,R), _(M,R), _(M,R), _(M,R), _(V,B), _(M,L), _(M,R), - /* 0950 */ _(x,x), _(Ca,T), _(Ca,B), _(x,T), _(x,T), _(M,T), _(M,B), _(M,B), - /* 0958 */ _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), - /* 0960 */ _(VI,x), _(VI,x), _(M,B), _(M,B), _(x,x), _(x,x), _(Nd,x), _(Nd,x), - /* 0968 */ _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), - /* 0970 */ _(x,x), _(x,x), _(VI,x), _(VI,x), _(VI,x), _(VI,x), _(VI,x), _(VI,x), - /* 0978 */ _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), - - /* Bengali */ - - /* 0980 */ _(CP,x), _(Bi,T), _(Bi,R), _(Vs,R), _(x,x), _(VI,x), _(VI,x), _(VI,x), - /* 0988 */ _(VI,x), _(VI,x), _(VI,x), _(VI,x), _(VI,x), _(x,x), _(x,x), _(VI,x), - /* 0990 */ _(VI,x), _(x,x), _(x,x), _(VI,x), _(VI,x), _(C,x), _(C,x), _(C,x), - /* 0998 */ _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), - /* 09A0 */ _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), - /* 09A8 */ _(C,x), _(x,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), - /* 09B0 */ _(C,x), _(x,x), _(C,x), _(x,x), _(x,x), _(x,x), _(C,x), _(C,x), - /* 09B8 */ _(C,x), _(C,x), _(x,x), _(x,x), _(N,B), _(A,x), _(M,R), _(M,L), - /* 09C0 */ _(M,R), _(M,B), _(M,B), _(M,B), _(M,B), _(x,x), _(x,x), _(M,L), - /* 09C8 */ _(M,L), _(x,x), _(x,x), _(M,LR), _(M,LR), _(V,B), _(CD,x), _(x,x), - /* 09D0 */ _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(M,R), - /* 09D8 */ _(x,x), _(x,x), _(x,x), _(x,x), _(C,x), _(C,x), _(x,x), _(C,x), - /* 09E0 */ _(VI,x), _(VI,x), _(M,B), _(M,B), _(x,x), _(x,x), _(Nd,x), _(Nd,x), - /* 09E8 */ _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), - /* 09F0 */ _(C,x), _(C,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), - /* 09F8 */ _(x,x), _(x,x), _(x,x), _(x,x), _(Bi,x), _(x,x), _(SM,T), _(x,x), - - /* Gurmukhi */ - - /* 0A00 */ _(x,x), _(Bi,T), _(Bi,T), _(Vs,R), _(x,x), _(VI,x), _(VI,x), _(VI,x), - /* 0A08 */ _(VI,x), _(VI,x), _(VI,x), _(x,x), _(x,x), _(x,x), _(x,x), _(VI,x), - /* 0A10 */ _(VI,x), _(x,x), _(x,x), _(VI,x), _(VI,x), _(C,x), _(C,x), _(C,x), - /* 0A18 */ _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), - /* 0A20 */ _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), - /* 0A28 */ _(C,x), _(x,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), - /* 0A30 */ _(C,x), _(x,x), _(C,x), _(C,x), _(x,x), _(C,x), _(C,x), _(x,x), - /* 0A38 */ _(C,x), _(C,x), _(x,x), _(x,x), _(N,B), _(x,x), _(M,R), _(M,L), - /* 0A40 */ _(M,R), _(M,B), _(M,B), _(x,x), _(x,x), _(x,x), _(x,x), _(M,T), - /* 0A48 */ _(M,T), _(x,x), _(x,x), _(M,T), _(M,T), _(V,B), _(x,x), _(x,x), - /* 0A50 */ _(x,x), _(Ca,B), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), - /* 0A58 */ _(x,x), _(C,x), _(C,x), _(C,x), _(C,x), _(x,x), _(C,x), _(x,x), - /* 0A60 */ _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(Nd,x), _(Nd,x), - /* 0A68 */ _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), - /* 0A70 */ _(Bi,T), _(GM,T), _(CP,x), _(CP,x), _(x,x), _(CM,B), _(x,x), _(x,x), - /* 0A78 */ _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), - - /* Gujarati */ - - /* 0A80 */ _(x,x), _(Bi,T), _(Bi,T), _(Vs,R), _(x,x), _(VI,x), _(VI,x), _(VI,x), - /* 0A88 */ _(VI,x), _(VI,x), _(VI,x), _(VI,x), _(VI,x), _(VI,x), _(x,x), _(VI,x), - /* 0A90 */ _(VI,x), _(VI,x), _(x,x), _(VI,x), _(VI,x), _(C,x), _(C,x), _(C,x), - /* 0A98 */ _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), - /* 0AA0 */ _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), - /* 0AA8 */ _(C,x), _(x,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), - /* 0AB0 */ _(C,x), _(x,x), _(C,x), _(C,x), _(x,x), _(C,x), _(C,x), _(C,x), - /* 0AB8 */ _(C,x), _(C,x), _(x,x), _(x,x), _(N,B), _(A,x), _(M,R), _(M,L), - /* 0AC0 */ _(M,R), _(M,B), _(M,B), _(M,B), _(M,B), _(M,T), _(x,x), _(M,T), - /* 0AC8 */ _(M,T), _(M,TR), _(x,x), _(M,R), _(M,R), _(V,B), _(x,x), _(x,x), - /* 0AD0 */ _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), - /* 0AD8 */ _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), - /* 0AE0 */ _(VI,x), _(VI,x), _(M,B), _(M,B), _(x,x), _(x,x), _(Nd,x), _(Nd,x), - /* 0AE8 */ _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), - /* 0AF0 */ _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), - /* 0AF8 */ _(x,x), _(C,x), _(Ca,T), _(Ca,T), _(Ca,T), _(N,T), _(N,T), _(N,T), - - /* Oriya */ - - /* 0B00 */ _(x,x), _(Bi,T), _(Bi,R), _(Vs,R), _(x,x), _(VI,x), _(VI,x), _(VI,x), - /* 0B08 */ _(VI,x), _(VI,x), _(VI,x), _(VI,x), _(VI,x), _(x,x), _(x,x), _(VI,x), - /* 0B10 */ _(VI,x), _(x,x), _(x,x), _(VI,x), _(VI,x), _(C,x), _(C,x), _(C,x), - /* 0B18 */ _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), - /* 0B20 */ _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), - /* 0B28 */ _(C,x), _(x,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), - /* 0B30 */ _(C,x), _(x,x), _(C,x), _(C,x), _(x,x), _(C,x), _(C,x), _(C,x), - /* 0B38 */ _(C,x), _(C,x), _(x,x), _(x,x), _(N,B), _(A,x), _(M,R), _(M,T), - /* 0B40 */ _(M,R), _(M,B), _(M,B), _(M,B), _(M,B), _(x,x), _(x,x), _(M,L), - /* 0B48 */ _(M,TL), _(x,x), _(x,x), _(M,LR),_(M,TLR), _(V,B), _(x,x), _(x,x), - /* 0B50 */ _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(M,T), _(M,T), _(M,TR), - /* 0B58 */ _(x,x), _(x,x), _(x,x), _(x,x), _(C,x), _(C,x), _(x,x), _(C,x), - /* 0B60 */ _(VI,x), _(VI,x), _(M,B), _(M,B), _(x,x), _(x,x), _(Nd,x), _(Nd,x), - /* 0B68 */ _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), - /* 0B70 */ _(x,x), _(C,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), - /* 0B78 */ _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), - - /* Tamil */ - - /* 0B80 */ _(x,x), _(x,x), _(Bi,T), _(ML,x), _(x,x), _(VI,x), _(VI,x), _(VI,x), - /* 0B88 */ _(VI,x), _(VI,x), _(VI,x), _(x,x), _(x,x), _(x,x), _(VI,x), _(VI,x), - /* 0B90 */ _(VI,x), _(x,x), _(VI,x), _(VI,x), _(VI,x), _(C,x), _(x,x), _(x,x), - /* 0B98 */ _(x,x), _(C,x), _(C,x), _(x,x), _(C,x), _(x,x), _(C,x), _(C,x), - /* 0BA0 */ _(x,x), _(x,x), _(x,x), _(C,x), _(C,x), _(x,x), _(x,x), _(x,x), - /* 0BA8 */ _(C,x), _(C,x), _(C,x), _(x,x), _(x,x), _(x,x), _(C,x), _(C,x), - /* 0BB0 */ _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), - /* 0BB8 */ _(C,x), _(C,x), _(x,x), _(x,x), _(x,x), _(x,x), _(M,R), _(M,R), - /* 0BC0 */ _(M,T), _(M,R), _(M,R), _(x,x), _(x,x), _(x,x), _(M,L), _(M,L), - /* 0BC8 */ _(M,L), _(x,x), _(M,LR), _(M,LR), _(M,LR), _(V,T), _(x,x), _(x,x), - /* 0BD0 */ _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(M,R), - /* 0BD8 */ _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), - /* 0BE0 */ _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(Nd,x), _(Nd,x), - /* 0BE8 */ _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), - /* 0BF0 */ _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), - /* 0BF8 */ _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), - - /* Telugu */ - - /* 0C00 */ _(Bi,T), _(Bi,R), _(Bi,R), _(Vs,R), _(Bi,T), _(VI,x), _(VI,x), _(VI,x), - /* 0C08 */ _(VI,x), _(VI,x), _(VI,x), _(VI,x), _(VI,x), _(x,x), _(VI,x), _(VI,x), - /* 0C10 */ _(VI,x), _(x,x), _(VI,x), _(VI,x), _(VI,x), _(C,x), _(C,x), _(C,x), - /* 0C18 */ _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), - /* 0C20 */ _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), - /* 0C28 */ _(C,x), _(x,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), - /* 0C30 */ _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), - /* 0C38 */ _(C,x), _(C,x), _(x,x), _(x,x), _(N,B), _(A,x), _(M,T), _(M,T), - /* 0C40 */ _(M,T), _(M,R), _(M,R), _(M,R), _(M,R), _(x,x), _(M,T), _(M,T), - /* 0C48 */ _(M,TB), _(x,x), _(M,T), _(M,T), _(M,T), _(V,T), _(x,x), _(x,x), - /* 0C50 */ _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(M,T), _(M,B), _(x,x), - /* 0C58 */ _(C,x), _(C,x), _(C,x), _(x,x), _(x,x), _(CD,x), _(x,x), _(x,x), - /* 0C60 */ _(VI,x), _(VI,x), _(M,B), _(M,B), _(x,x), _(x,x), _(Nd,x), _(Nd,x), - /* 0C68 */ _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), - /* 0C70 */ _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), - /* 0C78 */ _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), - - /* Kannada */ - - /* 0C80 */ _(Bi,x), _(Bi,T), _(Bi,R), _(Vs,R), _(x,x), _(VI,x), _(VI,x), _(VI,x), - /* 0C88 */ _(VI,x), _(VI,x), _(VI,x), _(VI,x), _(VI,x), _(x,x), _(VI,x), _(VI,x), - /* 0C90 */ _(VI,x), _(x,x), _(VI,x), _(VI,x), _(VI,x), _(C,x), _(C,x), _(C,x), - /* 0C98 */ _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), - /* 0CA0 */ _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), - /* 0CA8 */ _(C,x), _(x,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), - /* 0CB0 */ _(C,x), _(C,x), _(C,x), _(C,x), _(x,x), _(C,x), _(C,x), _(C,x), - /* 0CB8 */ _(C,x), _(C,x), _(x,x), _(x,x), _(N,B), _(A,x), _(M,R), _(M,T), - /* 0CC0 */ _(M,TR), _(M,R), _(M,R), _(M,R), _(M,R), _(x,x), _(M,T), _(M,TR), - /* 0CC8 */ _(M,TR), _(x,x), _(M,TR), _(M,TR), _(M,T), _(V,T), _(x,x), _(x,x), - /* 0CD0 */ _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(M,R), _(M,R), _(x,x), - /* 0CD8 */ _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(CD,x), _(C,x), _(x,x), - /* 0CE0 */ _(VI,x), _(VI,x), _(M,B), _(M,B), _(x,x), _(x,x), _(Nd,x), _(Nd,x), - /* 0CE8 */ _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), - /* 0CF0 */ _(x,x),_(CWS,x),_(CWS,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), - /* 0CF8 */ _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), - - /* Malayalam */ - - /* 0D00 */ _(Bi,T), _(Bi,T), _(Bi,R), _(Vs,R), _(Bi,x), _(VI,x), _(VI,x), _(VI,x), - /* 0D08 */ _(VI,x), _(VI,x), _(VI,x), _(VI,x), _(VI,x), _(x,x), _(VI,x), _(VI,x), - /* 0D10 */ _(VI,x), _(x,x), _(VI,x), _(VI,x), _(VI,x), _(C,x), _(C,x), _(C,x), - /* 0D18 */ _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), - /* 0D20 */ _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), - /* 0D28 */ _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), - /* 0D30 */ _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), - /* 0D38 */ _(C,x), _(C,x), _(C,x), _(PK,T), _(PK,T), _(A,x), _(M,R), _(M,R), - /* 0D40 */ _(M,R), _(M,R), _(M,R), _(M,B), _(M,B), _(x,x), _(M,L), _(M,L), - /* 0D48 */ _(M,L), _(x,x), _(M,LR), _(M,LR), _(M,LR), _(V,T),_(CPR,T), _(x,x), - /* 0D50 */ _(x,x), _(x,x), _(x,x), _(x,x), _(CD,x), _(CD,x), _(CD,x), _(M,R), - /* 0D58 */ _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(VI,x), - /* 0D60 */ _(VI,x), _(VI,x), _(M,B), _(M,B), _(x,x), _(x,x), _(Nd,x), _(Nd,x), - /* 0D68 */ _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), - /* 0D70 */ _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), - /* 0D78 */ _(x,x), _(x,x), _(CD,x), _(CD,x), _(CD,x), _(CD,x), _(CD,x), _(CD,x), - - /* Sinhala */ - - /* 0D80 */ _(x,x), _(Bi,T), _(Bi,R), _(Vs,R), _(x,x), _(VI,x), _(VI,x), _(VI,x), - /* 0D88 */ _(VI,x), _(VI,x), _(VI,x), _(VI,x), _(VI,x), _(VI,x), _(VI,x), _(VI,x), - /* 0D90 */ _(VI,x), _(VI,x), _(VI,x), _(VI,x), _(VI,x), _(VI,x), _(VI,x), _(x,x), - /* 0D98 */ _(x,x), _(x,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), - /* 0DA0 */ _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), - /* 0DA8 */ _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), - /* 0DB0 */ _(C,x), _(C,x), _(x,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), - /* 0DB8 */ _(C,x), _(C,x), _(C,x), _(C,x), _(x,x), _(C,x), _(x,x), _(x,x), - /* 0DC0 */ _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(x,x), - /* 0DC8 */ _(x,x), _(x,x), _(V,T), _(x,x), _(x,x), _(x,x), _(x,x), _(M,R), - /* 0DD0 */ _(M,R), _(M,R), _(M,T), _(M,T), _(M,B), _(x,x), _(M,B), _(x,x), - /* 0DD8 */ _(M,R), _(M,L), _(M,TL), _(M,L), _(M,LR),_(M,TLR), _(M,LR), _(M,R), - /* 0DE0 */ _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(Nd,x), _(Nd,x), - /* 0DE8 */ _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), - /* 0DF0 */ _(x,x), _(x,x), _(M,R), _(M,R), _(x,x), _(x,x), _(x,x), _(x,x), - -#define indic_offset_0x1000u 1336 - - - /* Myanmar */ - - /* 1000 */ _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), - /* 1008 */ _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), - /* 1010 */ _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), - /* 1018 */ _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), - /* 1020 */ _(C,x), _(VI,x), _(VI,x), _(VI,x), _(VI,x), _(VI,x), _(VI,x), _(VI,x), - /* 1028 */ _(VI,x), _(VI,x), _(VI,x), _(M,R), _(M,R), _(M,T), _(M,T), _(M,B), - /* 1030 */ _(M,B), _(M,L), _(M,T), _(M,T), _(M,T), _(M,T), _(Bi,T), _(TM,B), - /* 1038 */ _(Vs,R), _(IS,x), _(PK,T), _(CM,R),_(CM,TBL), _(CM,B), _(CM,B), _(C,x), - /* 1040 */ _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), - /* 1048 */ _(Nd,x), _(Nd,x), _(x,x), _(CP,x), _(x,x), _(x,x), _(CP,x), _(x,x), - /* 1050 */ _(C,x), _(C,x), _(VI,x), _(VI,x), _(VI,x), _(VI,x), _(M,R), _(M,R), - /* 1058 */ _(M,B), _(M,B), _(C,x), _(C,x), _(C,x), _(C,x), _(CM,B), _(CM,B), - /* 1060 */ _(CM,B), _(C,x), _(M,R), _(TM,R), _(TM,R), _(C,x), _(C,x), _(M,R), - /* 1068 */ _(M,R), _(TM,R), _(TM,R), _(TM,R), _(TM,R), _(TM,R), _(C,x), _(C,x), - /* 1070 */ _(C,x), _(M,T), _(M,T), _(M,T), _(M,T), _(C,x), _(C,x), _(C,x), - /* 1078 */ _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), - /* 1080 */ _(C,x), _(C,x), _(CM,B), _(M,R), _(M,L), _(M,T), _(M,T), _(TM,R), - /* 1088 */ _(TM,R), _(TM,R), _(TM,R), _(TM,R), _(TM,R), _(TM,B), _(C,x), _(TM,R), - /* 1090 */ _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), - /* 1098 */ _(Nd,x), _(Nd,x), _(TM,R), _(TM,R), _(M,R), _(M,T), _(x,x), _(x,x), - -#define indic_offset_0x1780u 1496 - - - /* Khmer */ - - /* 1780 */ _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), - /* 1788 */ _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), - /* 1790 */ _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), - /* 1798 */ _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), - /* 17A0 */ _(C,x), _(C,x), _(C,x), _(VI,x), _(VI,x), _(VI,x), _(VI,x), _(VI,x), - /* 17A8 */ _(VI,x), _(VI,x), _(VI,x), _(VI,x), _(VI,x), _(VI,x), _(VI,x), _(VI,x), - /* 17B0 */ _(VI,x), _(VI,x), _(VI,x), _(VI,x), _(x,x), _(x,x), _(M,R), _(M,T), - /* 17B8 */ _(M,T), _(M,T), _(M,T), _(M,B), _(M,B), _(M,B), _(M,TL),_(M,TLR), - /* 17C0 */ _(M,LR), _(M,L), _(M,L), _(M,L), _(M,LR), _(M,LR), _(Bi,T), _(Vs,R), - /* 17C8 */ _(M,R), _(RS,T), _(RS,T), _(SM,T),_(CSR,T), _(CK,T), _(SM,T), _(SM,T), - /* 17D0 */ _(SM,T), _(PK,T), _(IS,x), _(SM,T), _(x,x), _(x,x), _(x,x), _(x,x), - /* 17D8 */ _(x,x), _(x,x), _(x,x), _(x,x), _(A,x), _(SM,T), _(x,x), _(x,x), - /* 17E0 */ _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), - /* 17E8 */ _(Nd,x), _(Nd,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), - -#define indic_offset_0x1cd0u 1608 - - - /* Vedic Extensions */ - - /* 1CD0 */ _(Ca,T), _(Ca,T), _(Ca,T), _(x,x), _(Ca,O), _(Ca,B), _(Ca,B), _(Ca,B), - /* 1CD8 */ _(Ca,B), _(Ca,B), _(Ca,T), _(Ca,T), _(Ca,B), _(Ca,B), _(Ca,B), _(Ca,B), - /* 1CE0 */ _(Ca,T), _(Ca,R), _(x,O), _(x,O), _(x,O), _(x,O), _(x,O), _(x,O), - /* 1CE8 */ _(x,O), _(x,x), _(x,x), _(x,x), _(x,x), _(x,B), _(x,x), _(x,x), - /* 1CF0 */ _(x,x), _(x,x), _(CD,x), _(CD,x), _(Ca,T),_(CWS,x),_(CWS,x), _(Ca,R), - /* 1CF8 */ _(Ca,x), _(Ca,x), _(CP,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), - -#define indic_offset_0x2008u 1656 - - - /* General Punctuation */ - - /* 2008 */ _(x,x), _(x,x), _(x,x), _(x,x),_(ZWNJ,x),_(ZWJ,x), _(x,x), _(x,x), - /* 2010 */ _(CP,x), _(CP,x), _(CP,x), _(CP,x), _(CP,x), _(x,x), _(x,x), _(x,x), - -#define indic_offset_0x2070u 1672 - - - /* Superscripts and Subscripts */ - - /* 2070 */ _(x,x), _(x,x), _(x,x), _(x,x), _(SM,x), _(x,x), _(x,x), _(x,x), - /* 2078 */ _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), - /* 2080 */ _(x,x), _(x,x), _(SM,x), _(SM,x), _(SM,x), _(x,x), _(x,x), _(x,x), - -#define indic_offset_0xa8e0u 1696 - - - /* Devanagari Extended */ - - /* A8E0 */ _(Ca,T), _(Ca,T), _(Ca,T), _(Ca,T), _(Ca,T), _(Ca,T), _(Ca,T), _(Ca,T), - /* A8E8 */ _(Ca,T), _(Ca,T), _(Ca,T), _(Ca,T), _(Ca,T), _(Ca,T), _(Ca,T), _(Ca,T), - /* A8F0 */ _(Ca,T), _(Ca,T), _(Bi,x), _(Bi,x), _(x,x), _(x,x), _(x,x), _(x,x), - /* A8F8 */ _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(VI,x), _(M,T), - -#define indic_offset_0xa9e0u 1728 - - - /* Myanmar Extended-B */ - - /* A9E0 */ _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(M,T), _(x,x), _(C,x), - /* A9E8 */ _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), - /* A9F0 */ _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), - /* A9F8 */ _(Nd,x), _(Nd,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(x,x), - -#define indic_offset_0xaa60u 1760 - - - /* Myanmar Extended-A */ - - /* AA60 */ _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), - /* AA68 */ _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), - /* AA70 */ _(x,x), _(C,x), _(C,x), _(C,x), _(CP,x), _(CP,x), _(CP,x), _(x,x), - /* AA78 */ _(x,x), _(x,x), _(C,x), _(TM,R), _(TM,T), _(TM,R), _(C,x), _(C,x), - -}; /* Table items: 1792; occupancy: 71% */ - -uint16_t -hb_indic_get_categories (hb_codepoint_t u) -{ - switch (u >> 12) - { - case 0x0u: - if (unlikely (u == 0x00A0u)) return _(CP,x); - if (hb_in_range<hb_codepoint_t> (u, 0x0028u, 0x003Fu)) return indic_table[u - 0x0028u + indic_offset_0x0028u]; - if (hb_in_range<hb_codepoint_t> (u, 0x00B0u, 0x00D7u)) return indic_table[u - 0x00B0u + indic_offset_0x00b0u]; - if (hb_in_range<hb_codepoint_t> (u, 0x0900u, 0x0DF7u)) return indic_table[u - 0x0900u + indic_offset_0x0900u]; - break; - - case 0x1u: - if (hb_in_range<hb_codepoint_t> (u, 0x1000u, 0x109Fu)) return indic_table[u - 0x1000u + indic_offset_0x1000u]; - if (hb_in_range<hb_codepoint_t> (u, 0x1780u, 0x17EFu)) return indic_table[u - 0x1780u + indic_offset_0x1780u]; - if (hb_in_range<hb_codepoint_t> (u, 0x1CD0u, 0x1CFFu)) return indic_table[u - 0x1CD0u + indic_offset_0x1cd0u]; - break; - - case 0x2u: - if (unlikely (u == 0x25CCu)) return _(CP,x); - if (hb_in_range<hb_codepoint_t> (u, 0x2008u, 0x2017u)) return indic_table[u - 0x2008u + indic_offset_0x2008u]; - if (hb_in_range<hb_codepoint_t> (u, 0x2070u, 0x2087u)) return indic_table[u - 0x2070u + indic_offset_0x2070u]; - break; - - case 0xAu: - if (hb_in_range<hb_codepoint_t> (u, 0xA8E0u, 0xA8FFu)) return indic_table[u - 0xA8E0u + indic_offset_0xa8e0u]; - if (hb_in_range<hb_codepoint_t> (u, 0xA9E0u, 0xA9FFu)) return indic_table[u - 0xA9E0u + indic_offset_0xa9e0u]; - if (hb_in_range<hb_codepoint_t> (u, 0xAA60u, 0xAA7Fu)) return indic_table[u - 0xAA60u + indic_offset_0xaa60u]; - break; - - default: - break; - } - return _(x,x); -} - -#undef _ - -#undef ISC_A -#undef ISC_Bi -#undef ISC_BJN -#undef ISC_Ca -#undef ISC_C -#undef ISC_CD -#undef ISC_CF -#undef ISC_CHL -#undef ISC_CIP -#undef ISC_CK -#undef ISC_CM -#undef ISC_CP -#undef ISC_CPR -#undef ISC_CPrf -#undef ISC_CS -#undef ISC_CSR -#undef ISC_CWS -#undef ISC_GM -#undef ISC_IS -#undef ISC_ZWJ -#undef ISC_ML -#undef ISC_ZWNJ -#undef ISC_N -#undef ISC_Nd -#undef ISC_NJ -#undef ISC_x -#undef ISC_PK -#undef ISC_RS -#undef ISC_SM -#undef ISC_TL -#undef ISC_TM -#undef ISC_V -#undef ISC_Vs -#undef ISC_Vo -#undef ISC_M -#undef ISC_VI - -#undef IMC_B -#undef IMC_BL -#undef IMC_BR -#undef IMC_L -#undef IMC_LR -#undef IMC_x -#undef IMC_O -#undef IMC_R -#undef IMC_T -#undef IMC_TB -#undef IMC_TBL -#undef IMC_TBR -#undef IMC_TL -#undef IMC_TLR -#undef IMC_TR -#undef IMC_VOL - -#endif - -/* == End of generated table == */ diff --git a/thirdparty/harfbuzz/src/hb-ot-shape-complex-indic.hh b/thirdparty/harfbuzz/src/hb-ot-shape-complex-indic.hh deleted file mode 100644 index da77a2887c..0000000000 --- a/thirdparty/harfbuzz/src/hb-ot-shape-complex-indic.hh +++ /dev/null @@ -1,431 +0,0 @@ -/* - * Copyright © 2012 Google, Inc. - * - * This is part of HarfBuzz, a text shaping library. - * - * Permission is hereby granted, without written agreement and without - * license or royalty fees, to use, copy, modify, and distribute this - * software and its documentation for any purpose, provided that the - * above copyright notice and the following two paragraphs appear in - * all copies of this software. - * - * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR - * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES - * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN - * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH - * DAMAGE. - * - * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, - * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS - * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO - * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. - * - * Google Author(s): Behdad Esfahbod - */ - -#ifndef HB_OT_SHAPE_COMPLEX_INDIC_HH -#define HB_OT_SHAPE_COMPLEX_INDIC_HH - -#include "hb.hh" - -#include "hb-ot-shape-complex-syllabic.hh" - - -/* buffer var allocations */ -#define indic_category() complex_var_u8_category() /* indic_category_t */ -#define indic_position() complex_var_u8_auxiliary() /* indic_position_t */ - - -/* Cateories used in the OpenType spec: - * https://docs.microsoft.com/en-us/typography/script-development/devanagari - */ -/* Note: This enum is duplicated in the -machine.rl source file. - * Not sure how to avoid duplication. */ -enum indic_category_t { - OT_X = 0, - OT_C = 1, - OT_V = 2, - OT_N = 3, - OT_H = 4, - OT_ZWNJ = 5, - OT_ZWJ = 6, - OT_M = 7, - OT_SM = 8, - /* OT_VD = 9, UNUSED; we use OT_A instead. */ - OT_A = 10, - OT_PLACEHOLDER = 11, - OT_DOTTEDCIRCLE = 12, - OT_RS = 13, /* Register Shifter, used in Khmer OT spec. */ - OT_Coeng = 14, /* Khmer-style Virama. */ - OT_Repha = 15, /* Atomically-encoded logical or visual repha. */ - OT_Ra = 16, - OT_CM = 17, /* Consonant-Medial. */ - OT_Symbol = 18, /* Avagraha, etc that take marks (SM,A,VD). */ - OT_CS = 19, - - /* The following are used by Khmer & Myanmar shapers. Defined - * here for them to share. */ - OT_VAbv = 26, - OT_VBlw = 27, - OT_VPre = 28, - OT_VPst = 29, -}; - -#define MEDIAL_FLAGS (FLAG (OT_CM)) - -/* Note: - * - * We treat Vowels and placeholders as if they were consonants. This is safe because Vowels - * cannot happen in a consonant syllable. The plus side however is, we can call the - * consonant syllable logic from the vowel syllable function and get it all right! */ -#define CONSONANT_FLAGS (FLAG (OT_C) | FLAG (OT_CS) | FLAG (OT_Ra) | MEDIAL_FLAGS | FLAG (OT_V) | FLAG (OT_PLACEHOLDER) | FLAG (OT_DOTTEDCIRCLE)) -#define JOINER_FLAGS (FLAG (OT_ZWJ) | FLAG (OT_ZWNJ)) - - -/* Visual positions in a syllable from left to right. */ -enum indic_position_t { - POS_START = 0, - - POS_RA_TO_BECOME_REPH = 1, - POS_PRE_M = 2, - POS_PRE_C = 3, - - POS_BASE_C = 4, - POS_AFTER_MAIN = 5, - - POS_ABOVE_C = 6, - - POS_BEFORE_SUB = 7, - POS_BELOW_C = 8, - POS_AFTER_SUB = 9, - - POS_BEFORE_POST = 10, - POS_POST_C = 11, - POS_AFTER_POST = 12, - - POS_FINAL_C = 13, - POS_SMVD = 14, - - POS_END = 15 -}; - -/* Categories used in IndicSyllabicCategory.txt from UCD. */ -enum indic_syllabic_category_t { - INDIC_SYLLABIC_CATEGORY_OTHER = OT_X, - - INDIC_SYLLABIC_CATEGORY_AVAGRAHA = OT_Symbol, - INDIC_SYLLABIC_CATEGORY_BINDU = OT_SM, - INDIC_SYLLABIC_CATEGORY_BRAHMI_JOINING_NUMBER = OT_PLACEHOLDER, /* Don't care. */ - INDIC_SYLLABIC_CATEGORY_CANTILLATION_MARK = OT_A, - INDIC_SYLLABIC_CATEGORY_CONSONANT = OT_C, - INDIC_SYLLABIC_CATEGORY_CONSONANT_DEAD = OT_C, - INDIC_SYLLABIC_CATEGORY_CONSONANT_FINAL = OT_CM, - INDIC_SYLLABIC_CATEGORY_CONSONANT_HEAD_LETTER = OT_C, - INDIC_SYLLABIC_CATEGORY_CONSONANT_KILLER = OT_M, /* U+17CD only. */ - INDIC_SYLLABIC_CATEGORY_CONSONANT_MEDIAL = OT_CM, - INDIC_SYLLABIC_CATEGORY_CONSONANT_PLACEHOLDER = OT_PLACEHOLDER, - INDIC_SYLLABIC_CATEGORY_CONSONANT_PRECEDING_REPHA = OT_Repha, - INDIC_SYLLABIC_CATEGORY_CONSONANT_PREFIXED = OT_X, /* Don't care. */ - INDIC_SYLLABIC_CATEGORY_CONSONANT_SUBJOINED = OT_CM, - INDIC_SYLLABIC_CATEGORY_CONSONANT_SUCCEEDING_REPHA = OT_CM, - INDIC_SYLLABIC_CATEGORY_CONSONANT_WITH_STACKER = OT_CS, - INDIC_SYLLABIC_CATEGORY_GEMINATION_MARK = OT_SM, /* https://github.com/harfbuzz/harfbuzz/issues/552 */ - INDIC_SYLLABIC_CATEGORY_INVISIBLE_STACKER = OT_Coeng, - INDIC_SYLLABIC_CATEGORY_JOINER = OT_ZWJ, - INDIC_SYLLABIC_CATEGORY_MODIFYING_LETTER = OT_X, - INDIC_SYLLABIC_CATEGORY_NON_JOINER = OT_ZWNJ, - INDIC_SYLLABIC_CATEGORY_NUKTA = OT_N, - INDIC_SYLLABIC_CATEGORY_NUMBER = OT_PLACEHOLDER, - INDIC_SYLLABIC_CATEGORY_NUMBER_JOINER = OT_PLACEHOLDER, /* Don't care. */ - INDIC_SYLLABIC_CATEGORY_PURE_KILLER = OT_M, /* Is like a vowel matra. */ - INDIC_SYLLABIC_CATEGORY_REGISTER_SHIFTER = OT_RS, - INDIC_SYLLABIC_CATEGORY_SYLLABLE_MODIFIER = OT_SM, - INDIC_SYLLABIC_CATEGORY_TONE_LETTER = OT_X, - INDIC_SYLLABIC_CATEGORY_TONE_MARK = OT_N, - INDIC_SYLLABIC_CATEGORY_VIRAMA = OT_H, - INDIC_SYLLABIC_CATEGORY_VISARGA = OT_SM, - INDIC_SYLLABIC_CATEGORY_VOWEL = OT_V, - INDIC_SYLLABIC_CATEGORY_VOWEL_DEPENDENT = OT_M, - INDIC_SYLLABIC_CATEGORY_VOWEL_INDEPENDENT = OT_V -}; - -/* Categories used in IndicSMatraCategory.txt from UCD */ -enum indic_matra_category_t { - INDIC_MATRA_CATEGORY_NOT_APPLICABLE = POS_END, - - INDIC_MATRA_CATEGORY_LEFT = POS_PRE_C, - INDIC_MATRA_CATEGORY_TOP = POS_ABOVE_C, - INDIC_MATRA_CATEGORY_BOTTOM = POS_BELOW_C, - INDIC_MATRA_CATEGORY_RIGHT = POS_POST_C, - - /* These should resolve to the position of the last part of the split sequence. */ - INDIC_MATRA_CATEGORY_BOTTOM_AND_RIGHT = INDIC_MATRA_CATEGORY_RIGHT, - INDIC_MATRA_CATEGORY_LEFT_AND_RIGHT = INDIC_MATRA_CATEGORY_RIGHT, - INDIC_MATRA_CATEGORY_TOP_AND_BOTTOM = INDIC_MATRA_CATEGORY_BOTTOM, - INDIC_MATRA_CATEGORY_TOP_AND_BOTTOM_AND_LEFT = INDIC_MATRA_CATEGORY_BOTTOM, - INDIC_MATRA_CATEGORY_TOP_AND_BOTTOM_AND_RIGHT = INDIC_MATRA_CATEGORY_RIGHT, - INDIC_MATRA_CATEGORY_TOP_AND_LEFT = INDIC_MATRA_CATEGORY_TOP, - INDIC_MATRA_CATEGORY_TOP_AND_LEFT_AND_RIGHT = INDIC_MATRA_CATEGORY_RIGHT, - INDIC_MATRA_CATEGORY_TOP_AND_RIGHT = INDIC_MATRA_CATEGORY_RIGHT, - - INDIC_MATRA_CATEGORY_OVERSTRUCK = POS_AFTER_MAIN, - INDIC_MATRA_CATEGORY_VISUAL_ORDER_LEFT = POS_PRE_M -}; - -#define INDIC_COMBINE_CATEGORIES(S,M) \ - ( \ - static_assert_expr (S < 255 && M < 255) + \ - ( S | \ - ( \ - ( \ - S == INDIC_SYLLABIC_CATEGORY_CONSONANT_MEDIAL || \ - S == INDIC_SYLLABIC_CATEGORY_GEMINATION_MARK || \ - S == INDIC_SYLLABIC_CATEGORY_REGISTER_SHIFTER || \ - S == INDIC_SYLLABIC_CATEGORY_CONSONANT_SUCCEEDING_REPHA || \ - S == INDIC_SYLLABIC_CATEGORY_VIRAMA || \ - S == INDIC_SYLLABIC_CATEGORY_VOWEL_DEPENDENT || \ - false \ - ? M : INDIC_MATRA_CATEGORY_NOT_APPLICABLE \ - ) << 8 \ - ) \ - ) \ - ) - -HB_INTERNAL uint16_t -hb_indic_get_categories (hb_codepoint_t u); - - -static inline bool -is_one_of (const hb_glyph_info_t &info, unsigned int flags) -{ - /* If it ligated, all bets are off. */ - if (_hb_glyph_info_ligated (&info)) return false; - return !!(FLAG_UNSAFE (info.indic_category()) & flags); -} - -static inline bool -is_joiner (const hb_glyph_info_t &info) -{ - return is_one_of (info, JOINER_FLAGS); -} - -static inline bool -is_consonant (const hb_glyph_info_t &info) -{ - return is_one_of (info, CONSONANT_FLAGS); -} - -static inline bool -is_halant (const hb_glyph_info_t &info) -{ - return is_one_of (info, FLAG (OT_H)); -} - -#define IN_HALF_BLOCK(u, Base) (((u) & ~0x7Fu) == (Base)) - -#define IS_DEVA(u) (IN_HALF_BLOCK (u, 0x0900u)) -#define IS_BENG(u) (IN_HALF_BLOCK (u, 0x0980u)) -#define IS_GURU(u) (IN_HALF_BLOCK (u, 0x0A00u)) -#define IS_GUJR(u) (IN_HALF_BLOCK (u, 0x0A80u)) -#define IS_ORYA(u) (IN_HALF_BLOCK (u, 0x0B00u)) -#define IS_TAML(u) (IN_HALF_BLOCK (u, 0x0B80u)) -#define IS_TELU(u) (IN_HALF_BLOCK (u, 0x0C00u)) -#define IS_KNDA(u) (IN_HALF_BLOCK (u, 0x0C80u)) -#define IS_MLYM(u) (IN_HALF_BLOCK (u, 0x0D00u)) -#define IS_SINH(u) (IN_HALF_BLOCK (u, 0x0D80u)) - - -#define MATRA_POS_LEFT(u) POS_PRE_M -#define MATRA_POS_RIGHT(u) ( \ - IS_DEVA(u) ? POS_AFTER_SUB : \ - IS_BENG(u) ? POS_AFTER_POST : \ - IS_GURU(u) ? POS_AFTER_POST : \ - IS_GUJR(u) ? POS_AFTER_POST : \ - IS_ORYA(u) ? POS_AFTER_POST : \ - IS_TAML(u) ? POS_AFTER_POST : \ - IS_TELU(u) ? (u <= 0x0C42u ? POS_BEFORE_SUB : POS_AFTER_SUB) : \ - IS_KNDA(u) ? (u < 0x0CC3u || u > 0xCD6u ? POS_BEFORE_SUB : POS_AFTER_SUB) : \ - IS_MLYM(u) ? POS_AFTER_POST : \ - IS_SINH(u) ? POS_AFTER_SUB : \ - /*default*/ POS_AFTER_SUB \ - ) -#define MATRA_POS_TOP(u) ( /* BENG and MLYM don't have top matras. */ \ - IS_DEVA(u) ? POS_AFTER_SUB : \ - IS_GURU(u) ? POS_AFTER_POST : /* Deviate from spec */ \ - IS_GUJR(u) ? POS_AFTER_SUB : \ - IS_ORYA(u) ? POS_AFTER_MAIN : \ - IS_TAML(u) ? POS_AFTER_SUB : \ - IS_TELU(u) ? POS_BEFORE_SUB : \ - IS_KNDA(u) ? POS_BEFORE_SUB : \ - IS_SINH(u) ? POS_AFTER_SUB : \ - /*default*/ POS_AFTER_SUB \ - ) -#define MATRA_POS_BOTTOM(u) ( \ - IS_DEVA(u) ? POS_AFTER_SUB : \ - IS_BENG(u) ? POS_AFTER_SUB : \ - IS_GURU(u) ? POS_AFTER_POST : \ - IS_GUJR(u) ? POS_AFTER_POST : \ - IS_ORYA(u) ? POS_AFTER_SUB : \ - IS_TAML(u) ? POS_AFTER_POST : \ - IS_TELU(u) ? POS_BEFORE_SUB : \ - IS_KNDA(u) ? POS_BEFORE_SUB : \ - IS_MLYM(u) ? POS_AFTER_POST : \ - IS_SINH(u) ? POS_AFTER_SUB : \ - /*default*/ POS_AFTER_SUB \ - ) - -static inline indic_position_t -matra_position_indic (hb_codepoint_t u, indic_position_t side) -{ - switch ((int) side) - { - case POS_PRE_C: return MATRA_POS_LEFT (u); - case POS_POST_C: return MATRA_POS_RIGHT (u); - case POS_ABOVE_C: return MATRA_POS_TOP (u); - case POS_BELOW_C: return MATRA_POS_BOTTOM (u); - } - return side; -} - -/* XXX - * This is a hack for now. We should move this data into the main Indic table. - * Or completely remove it and just check in the tables. - */ -static const hb_codepoint_t ra_chars[] = { - 0x0930u, /* Devanagari */ - 0x09B0u, /* Bengali */ - 0x09F0u, /* Bengali */ - 0x0A30u, /* Gurmukhi */ /* No Reph */ - 0x0AB0u, /* Gujarati */ - 0x0B30u, /* Oriya */ - 0x0BB0u, /* Tamil */ /* No Reph */ - 0x0C30u, /* Telugu */ /* Reph formed only with ZWJ */ - 0x0CB0u, /* Kannada */ - 0x0D30u, /* Malayalam */ /* No Reph, Logical Repha */ - - 0x0DBBu, /* Sinhala */ /* Reph formed only with ZWJ */ -}; - -static inline bool -is_ra (hb_codepoint_t u) -{ - return hb_array (ra_chars).lfind (u); -} - -static inline void -set_indic_properties (hb_glyph_info_t &info) -{ - hb_codepoint_t u = info.codepoint; - unsigned int type = hb_indic_get_categories (u); - indic_category_t cat = (indic_category_t) (type & 0xFFu); - indic_position_t pos = (indic_position_t) (type >> 8); - - - /* - * Re-assign category - */ - - /* The following act more like the Bindus. */ - if (unlikely (hb_in_range<hb_codepoint_t> (u, 0x0953u, 0x0954u))) - cat = OT_SM; - /* The following act like consonants. */ - else if (unlikely (hb_in_ranges<hb_codepoint_t> (u, 0x0A72u, 0x0A73u, - 0x1CF5u, 0x1CF6u))) - cat = OT_C; - /* TODO: The following should only be allowed after a Visarga. - * For now, just treat them like regular tone marks. */ - else if (unlikely (hb_in_range<hb_codepoint_t> (u, 0x1CE2u, 0x1CE8u))) - cat = OT_A; - /* TODO: The following should only be allowed after some of - * the nasalization marks, maybe only for U+1CE9..U+1CF1. - * For now, just treat them like tone marks. */ - else if (unlikely (u == 0x1CEDu)) - cat = OT_A; - /* The following take marks in standalone clusters, similar to Avagraha. */ - else if (unlikely (hb_in_ranges<hb_codepoint_t> (u, 0xA8F2u, 0xA8F7u, - 0x1CE9u, 0x1CECu, - 0x1CEEu, 0x1CF1u))) - { - cat = OT_Symbol; - static_assert (((int) INDIC_SYLLABIC_CATEGORY_AVAGRAHA == OT_Symbol), ""); - } - else if (unlikely (u == 0x0A51u)) - { - /* https://github.com/harfbuzz/harfbuzz/issues/524 */ - cat = OT_M; - pos = POS_BELOW_C; - } - - /* According to ScriptExtensions.txt, these Grantha marks may also be used in Tamil, - * so the Indic shaper needs to know their categories. */ - else if (unlikely (u == 0x11301u || u == 0x11303u)) cat = OT_SM; - else if (unlikely (u == 0x1133Bu || u == 0x1133Cu)) cat = OT_N; - - else if (unlikely (u == 0x0AFBu)) cat = OT_N; /* https://github.com/harfbuzz/harfbuzz/issues/552 */ - else if (unlikely (u == 0x0B55u)) cat = OT_N; /* https://github.com/harfbuzz/harfbuzz/issues/2849 */ - - else if (unlikely (u == 0x0980u)) cat = OT_PLACEHOLDER; /* https://github.com/harfbuzz/harfbuzz/issues/538 */ - else if (unlikely (u == 0x09FCu)) cat = OT_PLACEHOLDER; /* https://github.com/harfbuzz/harfbuzz/pull/1613 */ - else if (unlikely (u == 0x0C80u)) cat = OT_PLACEHOLDER; /* https://github.com/harfbuzz/harfbuzz/pull/623 */ - else if (unlikely (u == 0x0D04u)) cat = OT_PLACEHOLDER; /* https://github.com/harfbuzz/harfbuzz/pull/3511 */ - else if (unlikely (hb_in_range<hb_codepoint_t> (u, 0x2010u, 0x2011u))) - cat = OT_PLACEHOLDER; - else if (unlikely (u == 0x25CCu)) cat = OT_DOTTEDCIRCLE; - - - /* - * Re-assign position. - */ - - if ((FLAG_UNSAFE (cat) & CONSONANT_FLAGS)) - { - pos = POS_BASE_C; - if (is_ra (u)) - cat = OT_Ra; - } - else if (cat == OT_M) - { - pos = matra_position_indic (u, pos); - } - else if ((FLAG_UNSAFE (cat) & (FLAG (OT_SM) /* | FLAG (OT_VD) */ | FLAG (OT_A) | FLAG (OT_Symbol)))) - { - pos = POS_SMVD; - } - - if (unlikely (u == 0x0B01u)) pos = POS_BEFORE_SUB; /* Oriya Bindu is BeforeSub in the spec. */ - - - - info.indic_category() = cat; - info.indic_position() = pos; -} - -struct hb_indic_would_substitute_feature_t -{ - void init (const hb_ot_map_t *map, hb_tag_t feature_tag, bool zero_context_) - { - zero_context = zero_context_; - map->get_stage_lookups (0/*GSUB*/, - map->get_feature_stage (0/*GSUB*/, feature_tag), - &lookups, &count); - } - - bool would_substitute (const hb_codepoint_t *glyphs, - unsigned int glyphs_count, - hb_face_t *face) const - { - for (unsigned int i = 0; i < count; i++) - if (hb_ot_layout_lookup_would_substitute (face, lookups[i].index, glyphs, glyphs_count, zero_context)) - return true; - return false; - } - - private: - const hb_ot_map_t::lookup_map_t *lookups; - unsigned int count; - bool zero_context; -}; - - -#endif /* HB_OT_SHAPE_COMPLEX_INDIC_HH */ diff --git a/thirdparty/harfbuzz/src/hb-ot-shape-complex-khmer-machine.hh b/thirdparty/harfbuzz/src/hb-ot-shape-complex-khmer-machine.hh deleted file mode 100644 index c52f72f394..0000000000 --- a/thirdparty/harfbuzz/src/hb-ot-shape-complex-khmer-machine.hh +++ /dev/null @@ -1,396 +0,0 @@ - -#line 1 "hb-ot-shape-complex-khmer-machine.rl" -/* - * Copyright © 2011,2012 Google, Inc. - * - * This is part of HarfBuzz, a text shaping library. - * - * Permission is hereby granted, without written agreement and without - * license or royalty fees, to use, copy, modify, and distribute this - * software and its documentation for any purpose, provided that the - * above copyright notice and the following two paragraphs appear in - * all copies of this software. - * - * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR - * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES - * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN - * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH - * DAMAGE. - * - * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, - * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS - * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO - * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. - * - * Google Author(s): Behdad Esfahbod - */ - -#ifndef HB_OT_SHAPE_COMPLEX_KHMER_MACHINE_HH -#define HB_OT_SHAPE_COMPLEX_KHMER_MACHINE_HH - -#include "hb.hh" - -enum khmer_syllable_type_t { - khmer_consonant_syllable, - khmer_broken_cluster, - khmer_non_khmer_cluster, -}; - - -#line 42 "hb-ot-shape-complex-khmer-machine.hh" -#define khmer_syllable_machine_ex_C 1u -#define khmer_syllable_machine_ex_Coeng 14u -#define khmer_syllable_machine_ex_DOTTEDCIRCLE 12u -#define khmer_syllable_machine_ex_PLACEHOLDER 11u -#define khmer_syllable_machine_ex_Ra 16u -#define khmer_syllable_machine_ex_Robatic 20u -#define khmer_syllable_machine_ex_V 2u -#define khmer_syllable_machine_ex_VAbv 26u -#define khmer_syllable_machine_ex_VBlw 27u -#define khmer_syllable_machine_ex_VPre 28u -#define khmer_syllable_machine_ex_VPst 29u -#define khmer_syllable_machine_ex_Xgroup 21u -#define khmer_syllable_machine_ex_Ygroup 22u -#define khmer_syllable_machine_ex_ZWJ 6u -#define khmer_syllable_machine_ex_ZWNJ 5u - - -#line 60 "hb-ot-shape-complex-khmer-machine.hh" -static const unsigned char _khmer_syllable_machine_trans_keys[] = { - 5u, 26u, 5u, 21u, 5u, 26u, 5u, 21u, 1u, 16u, 5u, 21u, 5u, 26u, 5u, 21u, - 5u, 26u, 5u, 21u, 5u, 21u, 5u, 26u, 5u, 21u, 1u, 16u, 5u, 21u, 5u, 26u, - 5u, 21u, 5u, 26u, 5u, 21u, 5u, 26u, 1u, 29u, 5u, 29u, 5u, 29u, 5u, 29u, - 22u, 22u, 5u, 22u, 5u, 29u, 5u, 29u, 5u, 29u, 1u, 16u, 5u, 26u, 5u, 29u, - 5u, 29u, 22u, 22u, 5u, 22u, 5u, 29u, 5u, 29u, 1u, 16u, 5u, 29u, 5u, 29u, - 0 -}; - -static const char _khmer_syllable_machine_key_spans[] = { - 22, 17, 22, 17, 16, 17, 22, 17, - 22, 17, 17, 22, 17, 16, 17, 22, - 17, 22, 17, 22, 29, 25, 25, 25, - 1, 18, 25, 25, 25, 16, 22, 25, - 25, 1, 18, 25, 25, 16, 25, 25 -}; - -static const short _khmer_syllable_machine_index_offsets[] = { - 0, 23, 41, 64, 82, 99, 117, 140, - 158, 181, 199, 217, 240, 258, 275, 293, - 316, 334, 357, 375, 398, 428, 454, 480, - 506, 508, 527, 553, 579, 605, 622, 645, - 671, 697, 699, 718, 744, 770, 787, 813 -}; - -static const char _khmer_syllable_machine_indicies[] = { - 1, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 2, - 3, 0, 0, 0, 0, 4, 0, 1, - 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 3, - 0, 1, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 3, 0, 0, 0, 0, 4, 0, - 5, 5, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 4, 0, 6, 6, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 6, 0, 7, 7, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 8, 0, 9, 9, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 10, 0, 0, - 0, 0, 4, 0, 9, 9, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 10, 0, 11, 11, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 12, 0, - 0, 0, 0, 4, 0, 11, 11, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 12, 0, 14, - 14, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 15, - 13, 14, 14, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, - 16, 15, 16, 16, 16, 16, 17, 16, - 18, 18, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, - 17, 16, 19, 19, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, - 16, 19, 16, 20, 20, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 21, 16, 22, 22, 16, - 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 23, 16, 16, - 16, 16, 17, 16, 22, 22, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 23, 16, 24, 24, - 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 25, 16, - 16, 16, 16, 17, 16, 24, 24, 16, - 16, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 25, 16, 14, - 14, 16, 16, 16, 16, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 26, 15, - 16, 16, 16, 16, 17, 16, 28, 28, - 27, 27, 29, 29, 27, 27, 27, 27, - 2, 2, 27, 30, 27, 28, 27, 27, - 27, 27, 15, 19, 27, 27, 27, 17, - 23, 25, 21, 27, 32, 32, 31, 31, - 31, 31, 31, 31, 31, 33, 31, 31, - 31, 31, 31, 2, 3, 6, 31, 31, - 31, 4, 10, 12, 8, 31, 34, 34, - 31, 31, 31, 31, 31, 31, 31, 35, - 31, 31, 31, 31, 31, 31, 3, 6, - 31, 31, 31, 4, 10, 12, 8, 31, - 5, 5, 31, 31, 31, 31, 31, 31, - 31, 35, 31, 31, 31, 31, 31, 31, - 4, 6, 31, 31, 31, 31, 31, 31, - 8, 31, 6, 31, 7, 7, 31, 31, - 31, 31, 31, 31, 31, 35, 31, 31, - 31, 31, 31, 31, 8, 6, 31, 36, - 36, 31, 31, 31, 31, 31, 31, 31, - 35, 31, 31, 31, 31, 31, 31, 10, - 6, 31, 31, 31, 4, 31, 31, 8, - 31, 37, 37, 31, 31, 31, 31, 31, - 31, 31, 35, 31, 31, 31, 31, 31, - 31, 12, 6, 31, 31, 31, 4, 10, - 31, 8, 31, 34, 34, 31, 31, 31, - 31, 31, 31, 31, 33, 31, 31, 31, - 31, 31, 31, 3, 6, 31, 31, 31, - 4, 10, 12, 8, 31, 28, 28, 31, - 31, 31, 31, 31, 31, 31, 31, 31, - 31, 31, 31, 31, 28, 31, 14, 14, - 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 15, 38, - 38, 38, 38, 17, 38, 40, 40, 39, - 39, 39, 39, 39, 39, 39, 41, 39, - 39, 39, 39, 39, 39, 15, 19, 39, - 39, 39, 17, 23, 25, 21, 39, 18, - 18, 39, 39, 39, 39, 39, 39, 39, - 41, 39, 39, 39, 39, 39, 39, 17, - 19, 39, 39, 39, 39, 39, 39, 21, - 39, 19, 39, 20, 20, 39, 39, 39, - 39, 39, 39, 39, 41, 39, 39, 39, - 39, 39, 39, 21, 19, 39, 42, 42, - 39, 39, 39, 39, 39, 39, 39, 41, - 39, 39, 39, 39, 39, 39, 23, 19, - 39, 39, 39, 17, 39, 39, 21, 39, - 43, 43, 39, 39, 39, 39, 39, 39, - 39, 41, 39, 39, 39, 39, 39, 39, - 25, 19, 39, 39, 39, 17, 23, 39, - 21, 39, 44, 44, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, - 39, 44, 39, 45, 45, 39, 39, 39, - 39, 39, 39, 39, 30, 39, 39, 39, - 39, 39, 26, 15, 19, 39, 39, 39, - 17, 23, 25, 21, 39, 40, 40, 39, - 39, 39, 39, 39, 39, 39, 30, 39, - 39, 39, 39, 39, 39, 15, 19, 39, - 39, 39, 17, 23, 25, 21, 39, 0 -}; - -static const char _khmer_syllable_machine_trans_targs[] = { - 20, 1, 28, 22, 23, 3, 24, 5, - 25, 7, 26, 9, 27, 20, 10, 31, - 20, 32, 12, 33, 14, 34, 16, 35, - 18, 36, 39, 20, 21, 30, 37, 20, - 0, 29, 2, 4, 6, 8, 20, 20, - 11, 13, 15, 17, 38, 19 -}; - -static const char _khmer_syllable_machine_trans_actions[] = { - 1, 0, 2, 2, 2, 0, 0, 0, - 2, 0, 2, 0, 2, 3, 0, 4, - 5, 2, 0, 0, 0, 2, 0, 2, - 0, 2, 4, 8, 2, 9, 0, 10, - 0, 0, 0, 0, 0, 0, 11, 12, - 0, 0, 0, 0, 4, 0 -}; - -static const char _khmer_syllable_machine_to_state_actions[] = { - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 6, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0 -}; - -static const char _khmer_syllable_machine_from_state_actions[] = { - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 7, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0 -}; - -static const unsigned char _khmer_syllable_machine_eof_trans[] = { - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 14, 17, 17, 17, 17, 17, - 17, 17, 17, 17, 0, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 39, 40, - 40, 40, 40, 40, 40, 40, 40, 40 -}; - -static const int khmer_syllable_machine_start = 20; -static const int khmer_syllable_machine_first_final = 20; -static const int khmer_syllable_machine_error = -1; - -static const int khmer_syllable_machine_en_main = 20; - - -#line 43 "hb-ot-shape-complex-khmer-machine.rl" - - - -#line 86 "hb-ot-shape-complex-khmer-machine.rl" - - -#define found_syllable(syllable_type) \ - HB_STMT_START { \ - if (0) fprintf (stderr, "syllable %d..%d %s\n", ts, te, #syllable_type); \ - for (unsigned int i = ts; i < te; i++) \ - info[i].syllable() = (syllable_serial << 4) | syllable_type; \ - syllable_serial++; \ - if (unlikely (syllable_serial == 16)) syllable_serial = 1; \ - } HB_STMT_END - -static void -find_syllables_khmer (hb_buffer_t *buffer) -{ - unsigned int p, pe, eof, ts, te, act HB_UNUSED; - int cs; - hb_glyph_info_t *info = buffer->info; - -#line 266 "hb-ot-shape-complex-khmer-machine.hh" - { - cs = khmer_syllable_machine_start; - ts = 0; - te = 0; - act = 0; - } - -#line 106 "hb-ot-shape-complex-khmer-machine.rl" - - - p = 0; - pe = eof = buffer->len; - - unsigned int syllable_serial = 1; - -#line 282 "hb-ot-shape-complex-khmer-machine.hh" - { - int _slen; - int _trans; - const unsigned char *_keys; - const char *_inds; - if ( p == pe ) - goto _test_eof; -_resume: - switch ( _khmer_syllable_machine_from_state_actions[cs] ) { - case 7: -#line 1 "NONE" - {ts = p;} - break; -#line 296 "hb-ot-shape-complex-khmer-machine.hh" - } - - _keys = _khmer_syllable_machine_trans_keys + (cs<<1); - _inds = _khmer_syllable_machine_indicies + _khmer_syllable_machine_index_offsets[cs]; - - _slen = _khmer_syllable_machine_key_spans[cs]; - _trans = _inds[ _slen > 0 && _keys[0] <=( info[p].khmer_category()) && - ( info[p].khmer_category()) <= _keys[1] ? - ( info[p].khmer_category()) - _keys[0] : _slen ]; - -_eof_trans: - cs = _khmer_syllable_machine_trans_targs[_trans]; - - if ( _khmer_syllable_machine_trans_actions[_trans] == 0 ) - goto _again; - - switch ( _khmer_syllable_machine_trans_actions[_trans] ) { - case 2: -#line 1 "NONE" - {te = p+1;} - break; - case 8: -#line 82 "hb-ot-shape-complex-khmer-machine.rl" - {te = p+1;{ found_syllable (khmer_non_khmer_cluster); }} - break; - case 10: -#line 80 "hb-ot-shape-complex-khmer-machine.rl" - {te = p;p--;{ found_syllable (khmer_consonant_syllable); }} - break; - case 12: -#line 81 "hb-ot-shape-complex-khmer-machine.rl" - {te = p;p--;{ found_syllable (khmer_broken_cluster); }} - break; - case 11: -#line 82 "hb-ot-shape-complex-khmer-machine.rl" - {te = p;p--;{ found_syllable (khmer_non_khmer_cluster); }} - break; - case 1: -#line 80 "hb-ot-shape-complex-khmer-machine.rl" - {{p = ((te))-1;}{ found_syllable (khmer_consonant_syllable); }} - break; - case 5: -#line 81 "hb-ot-shape-complex-khmer-machine.rl" - {{p = ((te))-1;}{ found_syllable (khmer_broken_cluster); }} - break; - case 3: -#line 1 "NONE" - { switch( act ) { - case 2: - {{p = ((te))-1;} found_syllable (khmer_broken_cluster); } - break; - case 3: - {{p = ((te))-1;} found_syllable (khmer_non_khmer_cluster); } - break; - } - } - break; - case 4: -#line 1 "NONE" - {te = p+1;} -#line 81 "hb-ot-shape-complex-khmer-machine.rl" - {act = 2;} - break; - case 9: -#line 1 "NONE" - {te = p+1;} -#line 82 "hb-ot-shape-complex-khmer-machine.rl" - {act = 3;} - break; -#line 366 "hb-ot-shape-complex-khmer-machine.hh" - } - -_again: - switch ( _khmer_syllable_machine_to_state_actions[cs] ) { - case 6: -#line 1 "NONE" - {ts = 0;} - break; -#line 375 "hb-ot-shape-complex-khmer-machine.hh" - } - - if ( ++p != pe ) - goto _resume; - _test_eof: {} - if ( p == eof ) - { - if ( _khmer_syllable_machine_eof_trans[cs] > 0 ) { - _trans = _khmer_syllable_machine_eof_trans[cs] - 1; - goto _eof_trans; - } - } - - } - -#line 114 "hb-ot-shape-complex-khmer-machine.rl" - -} - -#undef found_syllable - -#endif /* HB_OT_SHAPE_COMPLEX_KHMER_MACHINE_HH */ diff --git a/thirdparty/harfbuzz/src/hb-ot-shape-complex-khmer.hh b/thirdparty/harfbuzz/src/hb-ot-shape-complex-khmer.hh deleted file mode 100644 index 35bfbb64d5..0000000000 --- a/thirdparty/harfbuzz/src/hb-ot-shape-complex-khmer.hh +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Copyright © 2018 Google, Inc. - * - * This is part of HarfBuzz, a text shaping library. - * - * Permission is hereby granted, without written agreement and without - * license or royalty fees, to use, copy, modify, and distribute this - * software and its documentation for any purpose, provided that the - * above copyright notice and the following two paragraphs appear in - * all copies of this software. - * - * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR - * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES - * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN - * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH - * DAMAGE. - * - * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, - * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS - * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO - * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. - * - * Google Author(s): Behdad Esfahbod - */ - -#ifndef HB_OT_SHAPE_COMPLEX_KHMER_HH -#define HB_OT_SHAPE_COMPLEX_KHMER_HH - -#include "hb.hh" - -#include "hb-ot-shape-complex-indic.hh" - - -/* buffer var allocations */ -#define khmer_category() indic_category() /* khmer_category_t */ - - -/* Note: This enum is duplicated in the -machine.rl source file. - * Not sure how to avoid duplication. */ -enum khmer_category_t -{ - OT_Robatic = 20, - OT_Xgroup = 21, - OT_Ygroup = 22, - //OT_VAbv = 26, - //OT_VBlw = 27, - //OT_VPre = 28, - //OT_VPst = 29, -}; - -using khmer_position_t = indic_position_t; - -static inline void -set_khmer_properties (hb_glyph_info_t &info) -{ - hb_codepoint_t u = info.codepoint; - unsigned int type = hb_indic_get_categories (u); - khmer_category_t cat = (khmer_category_t) (type & 0xFFu); - khmer_position_t pos = (khmer_position_t) (type >> 8); - - - /* - * Re-assign category - * - * These categories are experimentally extracted from what Uniscribe allows. - */ - switch (u) - { - case 0x179Au: - cat = (khmer_category_t) OT_Ra; - break; - - case 0x17CCu: - case 0x17C9u: - case 0x17CAu: - cat = OT_Robatic; - break; - - case 0x17C6u: - case 0x17CBu: - case 0x17CDu: - case 0x17CEu: - case 0x17CFu: - case 0x17D0u: - case 0x17D1u: - cat = OT_Xgroup; - break; - - case 0x17C7u: - case 0x17C8u: - case 0x17DDu: - case 0x17D3u: /* Just guessing. Uniscribe doesn't categorize it. */ - cat = OT_Ygroup; - break; - } - - /* - * Re-assign position. - */ - if (cat == (khmer_category_t) OT_M) - switch ((int) pos) - { - case POS_PRE_C: cat = (khmer_category_t) OT_VPre; break; - case POS_BELOW_C: cat = (khmer_category_t) OT_VBlw; break; - case POS_ABOVE_C: cat = (khmer_category_t) OT_VAbv; break; - case POS_POST_C: cat = (khmer_category_t) OT_VPst; break; - default: assert (0); - } - - info.khmer_category() = cat; -} - - -#endif /* HB_OT_SHAPE_COMPLEX_KHMER_HH */ diff --git a/thirdparty/harfbuzz/src/hb-ot-shape-complex-myanmar-machine.hh b/thirdparty/harfbuzz/src/hb-ot-shape-complex-myanmar-machine.hh deleted file mode 100644 index f4ef33004d..0000000000 --- a/thirdparty/harfbuzz/src/hb-ot-shape-complex-myanmar-machine.hh +++ /dev/null @@ -1,492 +0,0 @@ - -#line 1 "hb-ot-shape-complex-myanmar-machine.rl" -/* - * Copyright © 2011,2012 Google, Inc. - * - * This is part of HarfBuzz, a text shaping library. - * - * Permission is hereby granted, without written agreement and without - * license or royalty fees, to use, copy, modify, and distribute this - * software and its documentation for any purpose, provided that the - * above copyright notice and the following two paragraphs appear in - * all copies of this software. - * - * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR - * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES - * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN - * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH - * DAMAGE. - * - * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, - * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS - * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO - * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. - * - * Google Author(s): Behdad Esfahbod - */ - -#ifndef HB_OT_SHAPE_COMPLEX_MYANMAR_MACHINE_HH -#define HB_OT_SHAPE_COMPLEX_MYANMAR_MACHINE_HH - -#include "hb.hh" - -enum myanmar_syllable_type_t { - myanmar_consonant_syllable, - myanmar_punctuation_cluster, - myanmar_broken_cluster, - myanmar_non_myanmar_cluster, -}; - - -#line 43 "hb-ot-shape-complex-myanmar-machine.hh" -#define myanmar_syllable_machine_ex_A 10u -#define myanmar_syllable_machine_ex_As 18u -#define myanmar_syllable_machine_ex_C 1u -#define myanmar_syllable_machine_ex_CS 19u -#define myanmar_syllable_machine_ex_D 32u -#define myanmar_syllable_machine_ex_D0 20u -#define myanmar_syllable_machine_ex_DB 3u -#define myanmar_syllable_machine_ex_GB 11u -#define myanmar_syllable_machine_ex_H 4u -#define myanmar_syllable_machine_ex_IV 2u -#define myanmar_syllable_machine_ex_MH 21u -#define myanmar_syllable_machine_ex_ML 33u -#define myanmar_syllable_machine_ex_MR 22u -#define myanmar_syllable_machine_ex_MW 23u -#define myanmar_syllable_machine_ex_MY 24u -#define myanmar_syllable_machine_ex_P 31u -#define myanmar_syllable_machine_ex_PT 25u -#define myanmar_syllable_machine_ex_Ra 16u -#define myanmar_syllable_machine_ex_V 8u -#define myanmar_syllable_machine_ex_VAbv 26u -#define myanmar_syllable_machine_ex_VBlw 27u -#define myanmar_syllable_machine_ex_VPre 28u -#define myanmar_syllable_machine_ex_VPst 29u -#define myanmar_syllable_machine_ex_VS 30u -#define myanmar_syllable_machine_ex_ZWJ 6u -#define myanmar_syllable_machine_ex_ZWNJ 5u - - -#line 72 "hb-ot-shape-complex-myanmar-machine.hh" -static const unsigned char _myanmar_syllable_machine_trans_keys[] = { - 1u, 33u, 3u, 33u, 5u, 29u, 5u, 8u, 5u, 29u, 3u, 25u, 5u, 25u, 5u, 25u, - 3u, 33u, 3u, 29u, 3u, 29u, 3u, 29u, 3u, 33u, 1u, 16u, 3u, 33u, 3u, 33u, - 3u, 29u, 3u, 29u, 3u, 29u, 3u, 30u, 3u, 29u, 3u, 33u, 3u, 33u, 3u, 33u, - 3u, 33u, 3u, 33u, 5u, 29u, 5u, 8u, 5u, 29u, 3u, 25u, 5u, 25u, 5u, 25u, - 3u, 33u, 3u, 29u, 3u, 29u, 3u, 29u, 3u, 33u, 1u, 16u, 3u, 33u, 3u, 33u, - 3u, 33u, 3u, 29u, 3u, 29u, 3u, 29u, 3u, 30u, 3u, 29u, 3u, 33u, 3u, 33u, - 3u, 33u, 3u, 33u, 3u, 33u, 3u, 33u, 3u, 33u, 1u, 33u, 1u, 32u, 8u, 8u, - 0 -}; - -static const char _myanmar_syllable_machine_key_spans[] = { - 33, 31, 25, 4, 25, 23, 21, 21, - 31, 27, 27, 27, 31, 16, 31, 31, - 27, 27, 27, 28, 27, 31, 31, 31, - 31, 31, 25, 4, 25, 23, 21, 21, - 31, 27, 27, 27, 31, 16, 31, 31, - 31, 27, 27, 27, 28, 27, 31, 31, - 31, 31, 31, 31, 31, 33, 32, 1 -}; - -static const short _myanmar_syllable_machine_index_offsets[] = { - 0, 34, 66, 92, 97, 123, 147, 169, - 191, 223, 251, 279, 307, 339, 356, 388, - 420, 448, 476, 504, 533, 561, 593, 625, - 657, 689, 721, 747, 752, 778, 802, 824, - 846, 878, 906, 934, 962, 994, 1011, 1043, - 1075, 1107, 1135, 1163, 1191, 1220, 1248, 1280, - 1312, 1344, 1376, 1408, 1440, 1472, 1506, 1539 -}; - -static const char _myanmar_syllable_machine_indicies[] = { - 1, 1, 2, 3, 4, 4, 0, 5, - 0, 6, 1, 0, 0, 0, 0, 7, - 0, 8, 9, 0, 10, 11, 12, 13, - 14, 15, 16, 17, 18, 19, 20, 1, - 21, 0, 23, 24, 25, 25, 22, 26, - 22, 27, 22, 22, 22, 22, 22, 22, - 22, 28, 22, 22, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 22, 22, - 39, 22, 25, 25, 22, 26, 22, 22, - 22, 22, 22, 22, 22, 22, 22, 40, - 22, 22, 22, 22, 22, 22, 33, 22, - 22, 22, 37, 22, 25, 25, 22, 26, - 22, 25, 25, 22, 26, 22, 22, 22, - 22, 22, 22, 22, 22, 22, 22, 22, - 22, 22, 22, 22, 22, 33, 22, 22, - 22, 37, 22, 41, 22, 25, 25, 22, - 26, 22, 33, 22, 22, 22, 22, 22, - 22, 22, 42, 22, 22, 22, 22, 22, - 22, 33, 22, 25, 25, 22, 26, 22, - 22, 22, 22, 22, 22, 22, 22, 22, - 42, 22, 22, 22, 22, 22, 22, 33, - 22, 25, 25, 22, 26, 22, 22, 22, - 22, 22, 22, 22, 22, 22, 22, 22, - 22, 22, 22, 22, 22, 33, 22, 23, - 22, 25, 25, 22, 26, 22, 27, 22, - 22, 22, 22, 22, 22, 22, 43, 22, - 22, 44, 22, 22, 22, 33, 45, 22, - 22, 37, 22, 22, 22, 43, 22, 23, - 22, 25, 25, 22, 26, 22, 27, 22, - 22, 22, 22, 22, 22, 22, 22, 22, - 22, 22, 22, 22, 22, 33, 22, 22, - 22, 37, 22, 23, 22, 25, 25, 22, - 26, 22, 27, 22, 22, 22, 22, 22, - 22, 22, 43, 22, 22, 22, 22, 22, - 22, 33, 45, 22, 22, 37, 22, 23, - 22, 25, 25, 22, 26, 22, 27, 22, - 22, 22, 22, 22, 22, 22, 22, 22, - 22, 22, 22, 22, 22, 33, 45, 22, - 22, 37, 22, 23, 22, 25, 25, 22, - 26, 22, 27, 22, 22, 22, 22, 22, - 22, 22, 43, 22, 22, 22, 22, 22, - 22, 33, 45, 22, 22, 37, 22, 22, - 22, 43, 22, 1, 1, 22, 22, 22, - 22, 22, 22, 22, 22, 22, 22, 22, - 22, 22, 1, 22, 23, 22, 25, 25, - 22, 26, 22, 27, 22, 22, 22, 22, - 22, 22, 22, 28, 22, 22, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 22, - 22, 22, 39, 22, 23, 22, 25, 25, - 22, 26, 22, 27, 22, 22, 22, 22, - 22, 22, 22, 46, 22, 22, 22, 22, - 22, 22, 33, 34, 35, 36, 37, 22, - 22, 22, 39, 22, 23, 22, 25, 25, - 22, 26, 22, 27, 22, 22, 22, 22, - 22, 22, 22, 22, 22, 22, 22, 22, - 22, 22, 33, 34, 35, 36, 37, 22, - 23, 22, 25, 25, 22, 26, 22, 27, - 22, 22, 22, 22, 22, 22, 22, 22, - 22, 22, 22, 22, 22, 22, 33, 34, - 35, 22, 37, 22, 23, 22, 25, 25, - 22, 26, 22, 27, 22, 22, 22, 22, - 22, 22, 22, 22, 22, 22, 22, 22, - 22, 22, 33, 22, 35, 22, 37, 22, - 23, 22, 25, 25, 22, 26, 22, 27, - 22, 22, 22, 22, 22, 22, 22, 22, - 22, 22, 22, 22, 22, 22, 33, 34, - 35, 36, 37, 46, 22, 23, 22, 25, - 25, 22, 26, 22, 27, 22, 22, 22, - 22, 22, 22, 22, 46, 22, 22, 22, - 22, 22, 22, 33, 34, 35, 36, 37, - 22, 23, 22, 25, 25, 22, 26, 22, - 27, 22, 22, 22, 22, 22, 22, 22, - 22, 22, 22, 29, 22, 31, 22, 33, - 34, 35, 36, 37, 22, 22, 22, 39, - 22, 23, 22, 25, 25, 22, 26, 22, - 27, 22, 22, 22, 22, 22, 22, 22, - 46, 22, 22, 29, 22, 22, 22, 33, - 34, 35, 36, 37, 22, 22, 22, 39, - 22, 23, 22, 25, 25, 22, 26, 22, - 27, 22, 22, 22, 22, 22, 22, 22, - 47, 22, 22, 29, 30, 31, 22, 33, - 34, 35, 36, 37, 22, 22, 22, 39, - 22, 23, 22, 25, 25, 22, 26, 22, - 27, 22, 22, 22, 22, 22, 22, 22, - 22, 22, 22, 29, 30, 31, 22, 33, - 34, 35, 36, 37, 22, 22, 22, 39, - 22, 23, 24, 25, 25, 22, 26, 22, - 27, 22, 22, 22, 22, 22, 22, 22, - 28, 22, 22, 29, 30, 31, 32, 33, - 34, 35, 36, 37, 22, 22, 22, 39, - 22, 49, 49, 48, 5, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 50, 48, - 48, 48, 48, 48, 48, 14, 48, 48, - 48, 18, 48, 49, 49, 48, 5, 48, - 49, 49, 48, 5, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 14, 48, 48, 48, - 18, 48, 51, 48, 49, 49, 48, 5, - 48, 14, 48, 48, 48, 48, 48, 48, - 48, 52, 48, 48, 48, 48, 48, 48, - 14, 48, 49, 49, 48, 5, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 52, - 48, 48, 48, 48, 48, 48, 14, 48, - 49, 49, 48, 5, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 14, 48, 2, 48, - 49, 49, 48, 5, 48, 6, 48, 48, - 48, 48, 48, 48, 48, 53, 48, 48, - 54, 48, 48, 48, 14, 55, 48, 48, - 18, 48, 48, 48, 53, 48, 2, 48, - 49, 49, 48, 5, 48, 6, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 14, 48, 48, 48, - 18, 48, 2, 48, 49, 49, 48, 5, - 48, 6, 48, 48, 48, 48, 48, 48, - 48, 53, 48, 48, 48, 48, 48, 48, - 14, 55, 48, 48, 18, 48, 2, 48, - 49, 49, 48, 5, 48, 6, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 14, 55, 48, 48, - 18, 48, 2, 48, 49, 49, 48, 5, - 48, 6, 48, 48, 48, 48, 48, 48, - 48, 53, 48, 48, 48, 48, 48, 48, - 14, 55, 48, 48, 18, 48, 48, 48, - 53, 48, 56, 56, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, - 48, 56, 48, 2, 3, 49, 49, 48, - 5, 48, 6, 48, 48, 48, 48, 48, - 48, 48, 8, 48, 48, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 19, 48, - 48, 21, 48, 2, 48, 49, 49, 48, - 5, 48, 6, 48, 48, 48, 48, 48, - 48, 48, 8, 48, 48, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 48, 48, - 48, 21, 48, 2, 48, 49, 49, 48, - 5, 48, 6, 48, 48, 48, 48, 48, - 48, 48, 57, 48, 48, 48, 48, 48, - 48, 14, 15, 16, 17, 18, 48, 48, - 48, 21, 48, 2, 48, 49, 49, 48, - 5, 48, 6, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, - 48, 14, 15, 16, 17, 18, 48, 2, - 48, 49, 49, 48, 5, 48, 6, 48, - 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 14, 15, 16, - 48, 18, 48, 2, 48, 49, 49, 48, - 5, 48, 6, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, - 48, 14, 48, 16, 48, 18, 48, 2, - 48, 49, 49, 48, 5, 48, 6, 48, - 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 14, 15, 16, - 17, 18, 57, 48, 2, 48, 49, 49, - 48, 5, 48, 6, 48, 48, 48, 48, - 48, 48, 48, 57, 48, 48, 48, 48, - 48, 48, 14, 15, 16, 17, 18, 48, - 2, 48, 49, 49, 48, 5, 48, 6, - 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 10, 48, 12, 48, 14, 15, - 16, 17, 18, 48, 48, 48, 21, 48, - 2, 48, 49, 49, 48, 5, 48, 6, - 48, 48, 48, 48, 48, 48, 48, 57, - 48, 48, 10, 48, 48, 48, 14, 15, - 16, 17, 18, 48, 48, 48, 21, 48, - 2, 48, 49, 49, 48, 5, 48, 6, - 48, 48, 48, 48, 48, 48, 48, 58, - 48, 48, 10, 11, 12, 48, 14, 15, - 16, 17, 18, 48, 48, 48, 21, 48, - 2, 48, 49, 49, 48, 5, 48, 6, - 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 10, 11, 12, 48, 14, 15, - 16, 17, 18, 48, 48, 48, 21, 48, - 2, 3, 49, 49, 48, 5, 48, 6, - 48, 48, 48, 48, 48, 48, 48, 8, - 48, 48, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 48, 48, 48, 21, 48, - 23, 24, 25, 25, 22, 26, 22, 27, - 22, 22, 22, 22, 22, 22, 22, 59, - 22, 22, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 22, 22, 39, 22, - 23, 60, 25, 25, 22, 26, 22, 27, - 22, 22, 22, 22, 22, 22, 22, 28, - 22, 22, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 22, 22, 22, 39, 22, - 1, 1, 2, 3, 49, 49, 48, 5, - 48, 6, 1, 48, 48, 48, 48, 1, - 48, 8, 48, 48, 10, 11, 12, 13, - 14, 15, 16, 17, 18, 19, 48, 1, - 21, 48, 1, 1, 61, 61, 61, 61, - 61, 61, 61, 61, 1, 61, 61, 61, - 61, 1, 61, 61, 61, 61, 61, 61, - 61, 61, 61, 61, 61, 61, 61, 61, - 61, 1, 61, 62, 61, 0 -}; - -static const char _myanmar_syllable_machine_trans_targs[] = { - 0, 1, 26, 37, 0, 27, 33, 51, - 39, 54, 40, 46, 47, 48, 29, 42, - 43, 44, 32, 50, 55, 45, 0, 2, - 13, 0, 3, 9, 14, 15, 21, 22, - 23, 5, 17, 18, 19, 8, 25, 20, - 4, 6, 7, 10, 12, 11, 16, 24, - 0, 0, 28, 30, 31, 34, 36, 35, - 38, 41, 49, 52, 53, 0, 0 -}; - -static const char _myanmar_syllable_machine_trans_actions[] = { - 3, 0, 0, 0, 4, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 5, 0, - 0, 6, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 7, 8, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 9, 10 -}; - -static const char _myanmar_syllable_machine_to_state_actions[] = { - 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0 -}; - -static const char _myanmar_syllable_machine_from_state_actions[] = { - 2, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0 -}; - -static const short _myanmar_syllable_machine_eof_trans[] = { - 0, 23, 23, 23, 23, 23, 23, 23, - 23, 23, 23, 23, 23, 23, 23, 23, - 23, 23, 23, 23, 23, 23, 23, 23, - 23, 23, 49, 49, 49, 49, 49, 49, - 49, 49, 49, 49, 49, 49, 49, 49, - 49, 49, 49, 49, 49, 49, 49, 49, - 49, 49, 49, 23, 23, 49, 62, 62 -}; - -static const int myanmar_syllable_machine_start = 0; -static const int myanmar_syllable_machine_first_final = 0; -static const int myanmar_syllable_machine_error = -1; - -static const int myanmar_syllable_machine_en_main = 0; - - -#line 44 "hb-ot-shape-complex-myanmar-machine.rl" - - - -#line 102 "hb-ot-shape-complex-myanmar-machine.rl" - - -#define found_syllable(syllable_type) \ - HB_STMT_START { \ - if (0) fprintf (stderr, "syllable %d..%d %s\n", ts, te, #syllable_type); \ - for (unsigned int i = ts; i < te; i++) \ - info[i].syllable() = (syllable_serial << 4) | syllable_type; \ - syllable_serial++; \ - if (unlikely (syllable_serial == 16)) syllable_serial = 1; \ - } HB_STMT_END - -static void -find_syllables_myanmar (hb_buffer_t *buffer) -{ - unsigned int p, pe, eof, ts, te, act HB_UNUSED; - int cs; - hb_glyph_info_t *info = buffer->info; - -#line 382 "hb-ot-shape-complex-myanmar-machine.hh" - { - cs = myanmar_syllable_machine_start; - ts = 0; - te = 0; - act = 0; - } - -#line 122 "hb-ot-shape-complex-myanmar-machine.rl" - - - p = 0; - pe = eof = buffer->len; - - unsigned int syllable_serial = 1; - -#line 398 "hb-ot-shape-complex-myanmar-machine.hh" - { - int _slen; - int _trans; - const unsigned char *_keys; - const char *_inds; - if ( p == pe ) - goto _test_eof; -_resume: - switch ( _myanmar_syllable_machine_from_state_actions[cs] ) { - case 2: -#line 1 "NONE" - {ts = p;} - break; -#line 412 "hb-ot-shape-complex-myanmar-machine.hh" - } - - _keys = _myanmar_syllable_machine_trans_keys + (cs<<1); - _inds = _myanmar_syllable_machine_indicies + _myanmar_syllable_machine_index_offsets[cs]; - - _slen = _myanmar_syllable_machine_key_spans[cs]; - _trans = _inds[ _slen > 0 && _keys[0] <=( info[p].myanmar_category()) && - ( info[p].myanmar_category()) <= _keys[1] ? - ( info[p].myanmar_category()) - _keys[0] : _slen ]; - -_eof_trans: - cs = _myanmar_syllable_machine_trans_targs[_trans]; - - if ( _myanmar_syllable_machine_trans_actions[_trans] == 0 ) - goto _again; - - switch ( _myanmar_syllable_machine_trans_actions[_trans] ) { - case 6: -#line 94 "hb-ot-shape-complex-myanmar-machine.rl" - {te = p+1;{ found_syllable (myanmar_consonant_syllable); }} - break; - case 4: -#line 95 "hb-ot-shape-complex-myanmar-machine.rl" - {te = p+1;{ found_syllable (myanmar_non_myanmar_cluster); }} - break; - case 10: -#line 96 "hb-ot-shape-complex-myanmar-machine.rl" - {te = p+1;{ found_syllable (myanmar_punctuation_cluster); }} - break; - case 8: -#line 97 "hb-ot-shape-complex-myanmar-machine.rl" - {te = p+1;{ found_syllable (myanmar_broken_cluster); }} - break; - case 3: -#line 98 "hb-ot-shape-complex-myanmar-machine.rl" - {te = p+1;{ found_syllable (myanmar_non_myanmar_cluster); }} - break; - case 5: -#line 94 "hb-ot-shape-complex-myanmar-machine.rl" - {te = p;p--;{ found_syllable (myanmar_consonant_syllable); }} - break; - case 7: -#line 97 "hb-ot-shape-complex-myanmar-machine.rl" - {te = p;p--;{ found_syllable (myanmar_broken_cluster); }} - break; - case 9: -#line 98 "hb-ot-shape-complex-myanmar-machine.rl" - {te = p;p--;{ found_syllable (myanmar_non_myanmar_cluster); }} - break; -#line 462 "hb-ot-shape-complex-myanmar-machine.hh" - } - -_again: - switch ( _myanmar_syllable_machine_to_state_actions[cs] ) { - case 1: -#line 1 "NONE" - {ts = 0;} - break; -#line 471 "hb-ot-shape-complex-myanmar-machine.hh" - } - - if ( ++p != pe ) - goto _resume; - _test_eof: {} - if ( p == eof ) - { - if ( _myanmar_syllable_machine_eof_trans[cs] > 0 ) { - _trans = _myanmar_syllable_machine_eof_trans[cs] - 1; - goto _eof_trans; - } - } - - } - -#line 130 "hb-ot-shape-complex-myanmar-machine.rl" - -} - -#undef found_syllable - -#endif /* HB_OT_SHAPE_COMPLEX_MYANMAR_MACHINE_HH */ diff --git a/thirdparty/harfbuzz/src/hb-ot-shape-complex-myanmar.hh b/thirdparty/harfbuzz/src/hb-ot-shape-complex-myanmar.hh deleted file mode 100644 index 7fbca3878f..0000000000 --- a/thirdparty/harfbuzz/src/hb-ot-shape-complex-myanmar.hh +++ /dev/null @@ -1,177 +0,0 @@ -/* - * Copyright © 2018 Google, Inc. - * - * This is part of HarfBuzz, a text shaping library. - * - * Permission is hereby granted, without written agreement and without - * license or royalty fees, to use, copy, modify, and distribute this - * software and its documentation for any purpose, provided that the - * above copyright notice and the following two paragraphs appear in - * all copies of this software. - * - * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR - * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES - * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN - * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH - * DAMAGE. - * - * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, - * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS - * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO - * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. - * - * Google Author(s): Behdad Esfahbod - */ - -#ifndef HB_OT_SHAPE_COMPLEX_MYANMAR_HH -#define HB_OT_SHAPE_COMPLEX_MYANMAR_HH - -#include "hb.hh" - -#include "hb-ot-shape-complex-indic.hh" - - -/* buffer var allocations */ -#define myanmar_category() indic_category() /* myanmar_category_t */ -#define myanmar_position() indic_position() /* myanmar_position_t */ - - -/* Note: This enum is duplicated in the -machine.rl source file. - * Not sure how to avoid duplication. */ -enum myanmar_category_t { - OT_As = 18, /* Asat */ - OT_D0 = 20, /* Digit zero */ - OT_DB = OT_N, /* Dot below */ - OT_GB = OT_PLACEHOLDER, - OT_MH = 21, /* Various consonant medial types */ - OT_MR = 22, /* Various consonant medial types */ - OT_MW = 23, /* Various consonant medial types */ - OT_MY = 24, /* Various consonant medial types */ - OT_PT = 25, /* Pwo and other tones */ - //OT_VAbv = 26, - //OT_VBlw = 27, - //OT_VPre = 28, - //OT_VPst = 29, - OT_VS = 30, /* Variation selectors */ - OT_P = 31, /* Punctuation */ - OT_D = 32, /* Digits except zero */ - OT_ML = 33, /* Various consonant medial types */ -}; - -using myanmar_position_t = indic_position_t; - -static inline void -set_myanmar_properties (hb_glyph_info_t &info) -{ - hb_codepoint_t u = info.codepoint; - unsigned int type = hb_indic_get_categories (u); - unsigned int cat = type & 0xFFu; - myanmar_position_t pos = (myanmar_position_t) (type >> 8); - - /* Myanmar - * https://docs.microsoft.com/en-us/typography/script-development/myanmar#analyze - */ - if (unlikely (hb_in_range<hb_codepoint_t> (u, 0xFE00u, 0xFE0Fu))) - cat = OT_VS; - - switch (u) - { - case 0x104Eu: - cat = OT_C; /* The spec says C, IndicSyllableCategory doesn't have. */ - break; - - case 0x002Du: case 0x00A0u: case 0x00D7u: case 0x2012u: - case 0x2013u: case 0x2014u: case 0x2015u: case 0x2022u: - case 0x25CCu: case 0x25FBu: case 0x25FCu: case 0x25FDu: - case 0x25FEu: - cat = OT_GB; - break; - - case 0x1004u: case 0x101Bu: case 0x105Au: - cat = OT_Ra; - break; - - case 0x1032u: case 0x1036u: - cat = OT_A; - break; - - case 0x1039u: - cat = OT_H; - break; - - case 0x103Au: - cat = OT_As; - break; - - case 0x1041u: case 0x1042u: case 0x1043u: case 0x1044u: - case 0x1045u: case 0x1046u: case 0x1047u: case 0x1048u: - case 0x1049u: case 0x1090u: case 0x1091u: case 0x1092u: - case 0x1093u: case 0x1094u: case 0x1095u: case 0x1096u: - case 0x1097u: case 0x1098u: case 0x1099u: - cat = OT_D; - break; - - case 0x1040u: - cat = OT_D; /* XXX The spec says D0, but Uniscribe doesn't seem to do. */ - break; - - case 0x103Eu: - cat = OT_MH; - break; - - case 0x1060u: - cat = OT_ML; - break; - - case 0x103Cu: - cat = OT_MR; - break; - - case 0x103Du: case 0x1082u: - cat = OT_MW; - break; - - case 0x103Bu: case 0x105Eu: case 0x105Fu: - cat = OT_MY; - break; - - case 0x1063u: case 0x1064u: case 0x1069u: case 0x106Au: - case 0x106Bu: case 0x106Cu: case 0x106Du: case 0xAA7Bu: - cat = OT_PT; - break; - - case 0x1038u: case 0x1087u: case 0x1088u: case 0x1089u: - case 0x108Au: case 0x108Bu: case 0x108Cu: case 0x108Du: - case 0x108Fu: case 0x109Au: case 0x109Bu: case 0x109Cu: - cat = OT_SM; - break; - - case 0x104Au: case 0x104Bu: - cat = OT_P; - break; - - case 0xAA74u: case 0xAA75u: case 0xAA76u: - /* https://github.com/harfbuzz/harfbuzz/issues/218 */ - cat = OT_C; - break; - } - - if (cat == OT_M) - { - switch ((int) pos) - { - case POS_PRE_C: cat = (myanmar_category_t) OT_VPre; - pos = POS_PRE_M; break; - case POS_ABOVE_C: cat = (myanmar_category_t) OT_VAbv; break; - case POS_BELOW_C: cat = (myanmar_category_t) OT_VBlw; break; - case POS_POST_C: cat = (myanmar_category_t) OT_VPst; break; - } - } - - info.myanmar_category() = cat; - info.myanmar_position() = pos; -} - - -#endif /* HB_OT_SHAPE_COMPLEX_MYANMAR_HH */ diff --git a/thirdparty/harfbuzz/src/hb-ot-shape-complex-use-machine.hh b/thirdparty/harfbuzz/src/hb-ot-shape-complex-use-machine.hh deleted file mode 100644 index 468bd95c3f..0000000000 --- a/thirdparty/harfbuzz/src/hb-ot-shape-complex-use-machine.hh +++ /dev/null @@ -1,849 +0,0 @@ - -#line 1 "hb-ot-shape-complex-use-machine.rl" -/* - * Copyright © 2015 Mozilla Foundation. - * Copyright © 2015 Google, Inc. - * - * This is part of HarfBuzz, a text shaping library. - * - * Permission is hereby granted, without written agreement and without - * license or royalty fees, to use, copy, modify, and distribute this - * software and its documentation for any purpose, provided that the - * above copyright notice and the following two paragraphs appear in - * all copies of this software. - * - * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR - * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES - * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN - * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH - * DAMAGE. - * - * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, - * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS - * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO - * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. - * - * Mozilla Author(s): Jonathan Kew - * Google Author(s): Behdad Esfahbod - */ - -#ifndef HB_OT_SHAPE_COMPLEX_USE_MACHINE_HH -#define HB_OT_SHAPE_COMPLEX_USE_MACHINE_HH - -#include "hb.hh" - -#include "hb-ot-shape-complex-syllabic.hh" - -/* buffer var allocations */ -#define use_category() complex_var_u8_category() - -#define USE(Cat) use_syllable_machine_ex_##Cat - -enum use_syllable_type_t { - use_virama_terminated_cluster, - use_sakot_terminated_cluster, - use_standard_cluster, - use_number_joiner_terminated_cluster, - use_numeral_cluster, - use_symbol_cluster, - use_hieroglyph_cluster, - use_broken_cluster, - use_non_cluster, -}; - - -#line 57 "hb-ot-shape-complex-use-machine.hh" -#define use_syllable_machine_ex_B 1u -#define use_syllable_machine_ex_CGJ 6u -#define use_syllable_machine_ex_CMAbv 31u -#define use_syllable_machine_ex_CMBlw 32u -#define use_syllable_machine_ex_CS 43u -#define use_syllable_machine_ex_FAbv 24u -#define use_syllable_machine_ex_FBlw 25u -#define use_syllable_machine_ex_FMAbv 45u -#define use_syllable_machine_ex_FMBlw 46u -#define use_syllable_machine_ex_FMPst 47u -#define use_syllable_machine_ex_FPst 26u -#define use_syllable_machine_ex_G 49u -#define use_syllable_machine_ex_GB 5u -#define use_syllable_machine_ex_H 12u -#define use_syllable_machine_ex_HN 13u -#define use_syllable_machine_ex_IS 44u -#define use_syllable_machine_ex_J 50u -#define use_syllable_machine_ex_MAbv 27u -#define use_syllable_machine_ex_MBlw 28u -#define use_syllable_machine_ex_MPre 30u -#define use_syllable_machine_ex_MPst 29u -#define use_syllable_machine_ex_N 4u -#define use_syllable_machine_ex_O 0u -#define use_syllable_machine_ex_R 18u -#define use_syllable_machine_ex_SB 51u -#define use_syllable_machine_ex_SE 52u -#define use_syllable_machine_ex_SMAbv 41u -#define use_syllable_machine_ex_SMBlw 42u -#define use_syllable_machine_ex_SUB 11u -#define use_syllable_machine_ex_Sk 48u -#define use_syllable_machine_ex_VAbv 33u -#define use_syllable_machine_ex_VBlw 34u -#define use_syllable_machine_ex_VMAbv 37u -#define use_syllable_machine_ex_VMBlw 38u -#define use_syllable_machine_ex_VMPre 23u -#define use_syllable_machine_ex_VMPst 39u -#define use_syllable_machine_ex_VPre 22u -#define use_syllable_machine_ex_VPst 35u -#define use_syllable_machine_ex_WJ 16u -#define use_syllable_machine_ex_ZWNJ 14u - - -#line 100 "hb-ot-shape-complex-use-machine.hh" -static const unsigned char _use_syllable_machine_trans_keys[] = { - 0u, 51u, 11u, 48u, 11u, 48u, 1u, 48u, 23u, 48u, 24u, 47u, 25u, 47u, 26u, 47u, - 45u, 46u, 46u, 46u, 24u, 48u, 24u, 48u, 24u, 48u, 1u, 1u, 24u, 48u, 22u, 48u, - 23u, 48u, 23u, 48u, 23u, 48u, 12u, 48u, 12u, 48u, 12u, 48u, 12u, 48u, 11u, 48u, - 1u, 1u, 11u, 48u, 41u, 42u, 42u, 42u, 11u, 48u, 11u, 48u, 1u, 48u, 23u, 48u, - 24u, 47u, 25u, 47u, 26u, 47u, 45u, 46u, 46u, 46u, 24u, 48u, 24u, 48u, 24u, 48u, - 1u, 1u, 24u, 48u, 22u, 48u, 23u, 48u, 23u, 48u, 23u, 48u, 12u, 48u, 12u, 48u, - 12u, 48u, 12u, 48u, 11u, 48u, 1u, 1u, 13u, 13u, 4u, 4u, 11u, 48u, 11u, 48u, - 1u, 48u, 23u, 48u, 24u, 47u, 25u, 47u, 26u, 47u, 45u, 46u, 46u, 46u, 24u, 48u, - 24u, 48u, 24u, 48u, 1u, 1u, 24u, 48u, 22u, 48u, 23u, 48u, 23u, 48u, 23u, 48u, - 12u, 48u, 12u, 48u, 12u, 48u, 12u, 48u, 11u, 48u, 1u, 1u, 11u, 48u, 11u, 48u, - 1u, 48u, 23u, 48u, 24u, 47u, 25u, 47u, 26u, 47u, 45u, 46u, 46u, 46u, 24u, 48u, - 24u, 48u, 24u, 48u, 1u, 1u, 24u, 48u, 22u, 48u, 23u, 48u, 23u, 48u, 23u, 48u, - 12u, 48u, 12u, 48u, 12u, 48u, 12u, 48u, 11u, 48u, 1u, 1u, 4u, 4u, 13u, 13u, - 1u, 48u, 11u, 48u, 41u, 42u, 42u, 42u, 1u, 5u, 50u, 52u, 49u, 52u, 49u, 51u, - 0 -}; - -static const char _use_syllable_machine_key_spans[] = { - 52, 38, 38, 48, 26, 24, 23, 22, - 2, 1, 25, 25, 25, 1, 25, 27, - 26, 26, 26, 37, 37, 37, 37, 38, - 1, 38, 2, 1, 38, 38, 48, 26, - 24, 23, 22, 2, 1, 25, 25, 25, - 1, 25, 27, 26, 26, 26, 37, 37, - 37, 37, 38, 1, 1, 1, 38, 38, - 48, 26, 24, 23, 22, 2, 1, 25, - 25, 25, 1, 25, 27, 26, 26, 26, - 37, 37, 37, 37, 38, 1, 38, 38, - 48, 26, 24, 23, 22, 2, 1, 25, - 25, 25, 1, 25, 27, 26, 26, 26, - 37, 37, 37, 37, 38, 1, 1, 1, - 48, 38, 2, 1, 5, 3, 4, 3 -}; - -static const short _use_syllable_machine_index_offsets[] = { - 0, 53, 92, 131, 180, 207, 232, 256, - 279, 282, 284, 310, 336, 362, 364, 390, - 418, 445, 472, 499, 537, 575, 613, 651, - 690, 692, 731, 734, 736, 775, 814, 863, - 890, 915, 939, 962, 965, 967, 993, 1019, - 1045, 1047, 1073, 1101, 1128, 1155, 1182, 1220, - 1258, 1296, 1334, 1373, 1375, 1377, 1379, 1418, - 1457, 1506, 1533, 1558, 1582, 1605, 1608, 1610, - 1636, 1662, 1688, 1690, 1716, 1744, 1771, 1798, - 1825, 1863, 1901, 1939, 1977, 2016, 2018, 2057, - 2096, 2145, 2172, 2197, 2221, 2244, 2247, 2249, - 2275, 2301, 2327, 2329, 2355, 2383, 2410, 2437, - 2464, 2502, 2540, 2578, 2616, 2655, 2657, 2659, - 2661, 2710, 2749, 2752, 2754, 2760, 2764, 2769 -}; - -static const char _use_syllable_machine_indicies[] = { - 0, 1, 2, 2, 3, 4, 2, 2, - 2, 2, 2, 5, 6, 7, 2, 2, - 2, 2, 8, 2, 2, 2, 9, 10, - 11, 12, 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 2, 23, 24, 25, - 2, 26, 27, 28, 29, 30, 31, 32, - 29, 33, 2, 34, 2, 36, 37, 35, - 35, 35, 35, 35, 35, 35, 35, 35, - 38, 39, 40, 41, 42, 43, 44, 45, - 46, 47, 48, 49, 50, 51, 35, 52, - 53, 54, 35, 55, 56, 35, 57, 58, - 59, 60, 57, 35, 36, 37, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 38, - 39, 40, 41, 42, 43, 44, 45, 46, - 48, 48, 49, 50, 51, 35, 52, 53, - 54, 35, 35, 35, 35, 57, 58, 59, - 60, 57, 35, 36, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, - 35, 39, 40, 41, 42, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 52, - 53, 54, 35, 35, 35, 35, 35, 58, - 59, 60, 61, 35, 39, 40, 41, 42, - 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 52, 53, 54, 35, 35, 35, - 35, 35, 58, 59, 60, 61, 35, 40, - 41, 42, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 58, 59, 60, 35, - 41, 42, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 58, 59, 60, 35, - 42, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 58, 59, 60, 35, 58, - 59, 35, 59, 35, 40, 41, 42, 35, - 35, 35, 35, 35, 35, 35, 35, 35, - 35, 52, 53, 54, 35, 35, 35, 35, - 35, 58, 59, 60, 61, 35, 40, 41, - 42, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 53, 54, 35, 35, - 35, 35, 35, 58, 59, 60, 61, 35, - 40, 41, 42, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 54, - 35, 35, 35, 35, 35, 58, 59, 60, - 61, 35, 62, 35, 40, 41, 42, 35, - 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, - 35, 58, 59, 60, 61, 35, 38, 39, - 40, 41, 42, 35, 35, 35, 35, 35, - 35, 49, 50, 51, 35, 52, 53, 54, - 35, 35, 35, 35, 35, 58, 59, 60, - 61, 35, 39, 40, 41, 42, 35, 35, - 35, 35, 35, 35, 49, 50, 51, 35, - 52, 53, 54, 35, 35, 35, 35, 35, - 58, 59, 60, 61, 35, 39, 40, 41, - 42, 35, 35, 35, 35, 35, 35, 35, - 50, 51, 35, 52, 53, 54, 35, 35, - 35, 35, 35, 58, 59, 60, 61, 35, - 39, 40, 41, 42, 35, 35, 35, 35, - 35, 35, 35, 35, 51, 35, 52, 53, - 54, 35, 35, 35, 35, 35, 58, 59, - 60, 61, 35, 39, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 38, 39, 40, - 41, 42, 35, 44, 45, 35, 35, 35, - 49, 50, 51, 35, 52, 53, 54, 35, - 35, 35, 35, 35, 58, 59, 60, 61, - 35, 39, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 38, 39, 40, 41, 42, - 35, 35, 45, 35, 35, 35, 49, 50, - 51, 35, 52, 53, 54, 35, 35, 35, - 35, 35, 58, 59, 60, 61, 35, 39, - 35, 35, 35, 35, 35, 35, 35, 35, - 35, 38, 39, 40, 41, 42, 35, 35, - 35, 35, 35, 35, 49, 50, 51, 35, - 52, 53, 54, 35, 35, 35, 35, 35, - 58, 59, 60, 61, 35, 39, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 38, - 39, 40, 41, 42, 43, 44, 45, 35, - 35, 35, 49, 50, 51, 35, 52, 53, - 54, 35, 35, 35, 35, 35, 58, 59, - 60, 61, 35, 36, 37, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 35, - 48, 49, 50, 51, 35, 52, 53, 54, - 35, 35, 35, 35, 57, 58, 59, 60, - 57, 35, 36, 35, 36, 37, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 38, - 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 35, 52, 53, - 54, 35, 35, 35, 35, 57, 58, 59, - 60, 57, 35, 55, 56, 35, 56, 35, - 64, 65, 63, 63, 63, 63, 63, 63, - 63, 63, 63, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 1, 75, 76, 77, - 78, 63, 79, 80, 81, 63, 63, 63, - 63, 82, 83, 84, 85, 86, 63, 64, - 65, 63, 63, 63, 63, 63, 63, 63, - 63, 63, 66, 67, 68, 69, 70, 71, - 72, 73, 74, 75, 75, 76, 77, 78, - 63, 79, 80, 81, 63, 63, 63, 63, - 82, 83, 84, 85, 86, 63, 64, 63, - 63, 63, 63, 63, 63, 63, 63, 63, - 63, 63, 63, 63, 63, 63, 63, 63, - 63, 63, 63, 63, 67, 68, 69, 70, - 63, 63, 63, 63, 63, 63, 63, 63, - 63, 63, 79, 80, 81, 63, 63, 63, - 63, 63, 83, 84, 85, 87, 63, 67, - 68, 69, 70, 63, 63, 63, 63, 63, - 63, 63, 63, 63, 63, 79, 80, 81, - 63, 63, 63, 63, 63, 83, 84, 85, - 87, 63, 68, 69, 70, 63, 63, 63, - 63, 63, 63, 63, 63, 63, 63, 63, - 63, 63, 63, 63, 63, 63, 63, 83, - 84, 85, 63, 69, 70, 63, 63, 63, - 63, 63, 63, 63, 63, 63, 63, 63, - 63, 63, 63, 63, 63, 63, 63, 83, - 84, 85, 63, 70, 63, 63, 63, 63, - 63, 63, 63, 63, 63, 63, 63, 63, - 63, 63, 63, 63, 63, 63, 83, 84, - 85, 63, 83, 84, 63, 84, 63, 68, - 69, 70, 63, 63, 63, 63, 63, 63, - 63, 63, 63, 63, 79, 80, 81, 63, - 63, 63, 63, 63, 83, 84, 85, 87, - 63, 68, 69, 70, 63, 63, 63, 63, - 63, 63, 63, 63, 63, 63, 63, 80, - 81, 63, 63, 63, 63, 63, 83, 84, - 85, 87, 63, 68, 69, 70, 63, 63, - 63, 63, 63, 63, 63, 63, 63, 63, - 63, 63, 81, 63, 63, 63, 63, 63, - 83, 84, 85, 87, 63, 89, 88, 68, - 69, 70, 63, 63, 63, 63, 63, 63, - 63, 63, 63, 63, 63, 63, 63, 63, - 63, 63, 63, 63, 83, 84, 85, 87, - 63, 66, 67, 68, 69, 70, 63, 63, - 63, 63, 63, 63, 76, 77, 78, 63, - 79, 80, 81, 63, 63, 63, 63, 63, - 83, 84, 85, 87, 63, 67, 68, 69, - 70, 63, 63, 63, 63, 63, 63, 76, - 77, 78, 63, 79, 80, 81, 63, 63, - 63, 63, 63, 83, 84, 85, 87, 63, - 67, 68, 69, 70, 63, 63, 63, 63, - 63, 63, 63, 77, 78, 63, 79, 80, - 81, 63, 63, 63, 63, 63, 83, 84, - 85, 87, 63, 67, 68, 69, 70, 63, - 63, 63, 63, 63, 63, 63, 63, 78, - 63, 79, 80, 81, 63, 63, 63, 63, - 63, 83, 84, 85, 87, 63, 67, 63, - 63, 63, 63, 63, 63, 63, 63, 63, - 66, 67, 68, 69, 70, 63, 72, 73, - 63, 63, 63, 76, 77, 78, 63, 79, - 80, 81, 63, 63, 63, 63, 63, 83, - 84, 85, 87, 63, 67, 63, 63, 63, - 63, 63, 63, 63, 63, 63, 66, 67, - 68, 69, 70, 63, 63, 73, 63, 63, - 63, 76, 77, 78, 63, 79, 80, 81, - 63, 63, 63, 63, 63, 83, 84, 85, - 87, 63, 67, 63, 63, 63, 63, 63, - 63, 63, 63, 63, 66, 67, 68, 69, - 70, 63, 63, 63, 63, 63, 63, 76, - 77, 78, 63, 79, 80, 81, 63, 63, - 63, 63, 63, 83, 84, 85, 87, 63, - 67, 63, 63, 63, 63, 63, 63, 63, - 63, 63, 66, 67, 68, 69, 70, 71, - 72, 73, 63, 63, 63, 76, 77, 78, - 63, 79, 80, 81, 63, 63, 63, 63, - 63, 83, 84, 85, 87, 63, 64, 65, - 63, 63, 63, 63, 63, 63, 63, 63, - 63, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 63, 75, 76, 77, 78, 63, - 79, 80, 81, 63, 63, 63, 63, 82, - 83, 84, 85, 86, 63, 64, 90, 92, - 91, 3, 93, 94, 95, 63, 63, 63, - 63, 63, 63, 63, 63, 63, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, - 106, 107, 108, 109, 63, 110, 111, 112, - 63, 55, 56, 63, 113, 114, 115, 85, - 116, 63, 94, 95, 63, 63, 63, 63, - 63, 63, 63, 63, 63, 96, 97, 98, - 99, 100, 101, 102, 103, 104, 106, 106, - 107, 108, 109, 63, 110, 111, 112, 63, - 63, 63, 63, 113, 114, 115, 85, 116, - 63, 94, 63, 63, 63, 63, 63, 63, - 63, 63, 63, 63, 63, 63, 63, 63, - 63, 63, 63, 63, 63, 63, 63, 97, - 98, 99, 100, 63, 63, 63, 63, 63, - 63, 63, 63, 63, 63, 110, 111, 112, - 63, 63, 63, 63, 63, 114, 115, 85, - 117, 63, 97, 98, 99, 100, 63, 63, - 63, 63, 63, 63, 63, 63, 63, 63, - 110, 111, 112, 63, 63, 63, 63, 63, - 114, 115, 85, 117, 63, 98, 99, 100, - 63, 63, 63, 63, 63, 63, 63, 63, - 63, 63, 63, 63, 63, 63, 63, 63, - 63, 63, 114, 115, 85, 63, 99, 100, - 63, 63, 63, 63, 63, 63, 63, 63, - 63, 63, 63, 63, 63, 63, 63, 63, - 63, 63, 114, 115, 85, 63, 100, 63, - 63, 63, 63, 63, 63, 63, 63, 63, - 63, 63, 63, 63, 63, 63, 63, 63, - 63, 114, 115, 85, 63, 114, 115, 63, - 115, 63, 98, 99, 100, 63, 63, 63, - 63, 63, 63, 63, 63, 63, 63, 110, - 111, 112, 63, 63, 63, 63, 63, 114, - 115, 85, 117, 63, 98, 99, 100, 63, - 63, 63, 63, 63, 63, 63, 63, 63, - 63, 63, 111, 112, 63, 63, 63, 63, - 63, 114, 115, 85, 117, 63, 98, 99, - 100, 63, 63, 63, 63, 63, 63, 63, - 63, 63, 63, 63, 63, 112, 63, 63, - 63, 63, 63, 114, 115, 85, 117, 63, - 118, 88, 98, 99, 100, 63, 63, 63, - 63, 63, 63, 63, 63, 63, 63, 63, - 63, 63, 63, 63, 63, 63, 63, 114, - 115, 85, 117, 63, 96, 97, 98, 99, - 100, 63, 63, 63, 63, 63, 63, 107, - 108, 109, 63, 110, 111, 112, 63, 63, - 63, 63, 63, 114, 115, 85, 117, 63, - 97, 98, 99, 100, 63, 63, 63, 63, - 63, 63, 107, 108, 109, 63, 110, 111, - 112, 63, 63, 63, 63, 63, 114, 115, - 85, 117, 63, 97, 98, 99, 100, 63, - 63, 63, 63, 63, 63, 63, 108, 109, - 63, 110, 111, 112, 63, 63, 63, 63, - 63, 114, 115, 85, 117, 63, 97, 98, - 99, 100, 63, 63, 63, 63, 63, 63, - 63, 63, 109, 63, 110, 111, 112, 63, - 63, 63, 63, 63, 114, 115, 85, 117, - 63, 97, 63, 63, 63, 63, 63, 63, - 63, 63, 63, 96, 97, 98, 99, 100, - 63, 102, 103, 63, 63, 63, 107, 108, - 109, 63, 110, 111, 112, 63, 63, 63, - 63, 63, 114, 115, 85, 117, 63, 97, - 63, 63, 63, 63, 63, 63, 63, 63, - 63, 96, 97, 98, 99, 100, 63, 63, - 103, 63, 63, 63, 107, 108, 109, 63, - 110, 111, 112, 63, 63, 63, 63, 63, - 114, 115, 85, 117, 63, 97, 63, 63, - 63, 63, 63, 63, 63, 63, 63, 96, - 97, 98, 99, 100, 63, 63, 63, 63, - 63, 63, 107, 108, 109, 63, 110, 111, - 112, 63, 63, 63, 63, 63, 114, 115, - 85, 117, 63, 97, 63, 63, 63, 63, - 63, 63, 63, 63, 63, 96, 97, 98, - 99, 100, 101, 102, 103, 63, 63, 63, - 107, 108, 109, 63, 110, 111, 112, 63, - 63, 63, 63, 63, 114, 115, 85, 117, - 63, 94, 95, 63, 63, 63, 63, 63, - 63, 63, 63, 63, 96, 97, 98, 99, - 100, 101, 102, 103, 104, 63, 106, 107, - 108, 109, 63, 110, 111, 112, 63, 63, - 63, 63, 113, 114, 115, 85, 116, 63, - 94, 90, 94, 95, 63, 63, 63, 63, - 63, 63, 63, 63, 63, 96, 97, 98, - 99, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 109, 63, 110, 111, 112, 63, - 63, 63, 63, 113, 114, 115, 85, 116, - 63, 5, 6, 119, 119, 119, 119, 119, - 119, 119, 119, 119, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 19, 19, 20, - 21, 22, 119, 23, 24, 25, 119, 119, - 119, 119, 29, 30, 31, 32, 29, 119, - 5, 119, 119, 119, 119, 119, 119, 119, - 119, 119, 119, 119, 119, 119, 119, 119, - 119, 119, 119, 119, 119, 119, 10, 11, - 12, 13, 119, 119, 119, 119, 119, 119, - 119, 119, 119, 119, 23, 24, 25, 119, - 119, 119, 119, 119, 30, 31, 32, 120, - 119, 10, 11, 12, 13, 119, 119, 119, - 119, 119, 119, 119, 119, 119, 119, 23, - 24, 25, 119, 119, 119, 119, 119, 30, - 31, 32, 120, 119, 11, 12, 13, 119, - 119, 119, 119, 119, 119, 119, 119, 119, - 119, 119, 119, 119, 119, 119, 119, 119, - 119, 30, 31, 32, 119, 12, 13, 119, - 119, 119, 119, 119, 119, 119, 119, 119, - 119, 119, 119, 119, 119, 119, 119, 119, - 119, 30, 31, 32, 119, 13, 119, 119, - 119, 119, 119, 119, 119, 119, 119, 119, - 119, 119, 119, 119, 119, 119, 119, 119, - 30, 31, 32, 119, 30, 31, 119, 31, - 119, 11, 12, 13, 119, 119, 119, 119, - 119, 119, 119, 119, 119, 119, 23, 24, - 25, 119, 119, 119, 119, 119, 30, 31, - 32, 120, 119, 11, 12, 13, 119, 119, - 119, 119, 119, 119, 119, 119, 119, 119, - 119, 24, 25, 119, 119, 119, 119, 119, - 30, 31, 32, 120, 119, 11, 12, 13, - 119, 119, 119, 119, 119, 119, 119, 119, - 119, 119, 119, 119, 25, 119, 119, 119, - 119, 119, 30, 31, 32, 120, 119, 121, - 119, 11, 12, 13, 119, 119, 119, 119, - 119, 119, 119, 119, 119, 119, 119, 119, - 119, 119, 119, 119, 119, 119, 30, 31, - 32, 120, 119, 9, 10, 11, 12, 13, - 119, 119, 119, 119, 119, 119, 20, 21, - 22, 119, 23, 24, 25, 119, 119, 119, - 119, 119, 30, 31, 32, 120, 119, 10, - 11, 12, 13, 119, 119, 119, 119, 119, - 119, 20, 21, 22, 119, 23, 24, 25, - 119, 119, 119, 119, 119, 30, 31, 32, - 120, 119, 10, 11, 12, 13, 119, 119, - 119, 119, 119, 119, 119, 21, 22, 119, - 23, 24, 25, 119, 119, 119, 119, 119, - 30, 31, 32, 120, 119, 10, 11, 12, - 13, 119, 119, 119, 119, 119, 119, 119, - 119, 22, 119, 23, 24, 25, 119, 119, - 119, 119, 119, 30, 31, 32, 120, 119, - 10, 119, 119, 119, 119, 119, 119, 119, - 119, 119, 9, 10, 11, 12, 13, 119, - 15, 16, 119, 119, 119, 20, 21, 22, - 119, 23, 24, 25, 119, 119, 119, 119, - 119, 30, 31, 32, 120, 119, 10, 119, - 119, 119, 119, 119, 119, 119, 119, 119, - 9, 10, 11, 12, 13, 119, 119, 16, - 119, 119, 119, 20, 21, 22, 119, 23, - 24, 25, 119, 119, 119, 119, 119, 30, - 31, 32, 120, 119, 10, 119, 119, 119, - 119, 119, 119, 119, 119, 119, 9, 10, - 11, 12, 13, 119, 119, 119, 119, 119, - 119, 20, 21, 22, 119, 23, 24, 25, - 119, 119, 119, 119, 119, 30, 31, 32, - 120, 119, 10, 119, 119, 119, 119, 119, - 119, 119, 119, 119, 9, 10, 11, 12, - 13, 14, 15, 16, 119, 119, 119, 20, - 21, 22, 119, 23, 24, 25, 119, 119, - 119, 119, 119, 30, 31, 32, 120, 119, - 5, 6, 119, 119, 119, 119, 119, 119, - 119, 119, 119, 9, 10, 11, 12, 13, - 14, 15, 16, 17, 119, 19, 20, 21, - 22, 119, 23, 24, 25, 119, 119, 119, - 119, 29, 30, 31, 32, 29, 119, 5, - 119, 122, 119, 7, 119, 1, 119, 119, - 119, 1, 119, 119, 119, 119, 119, 5, - 6, 7, 119, 119, 119, 119, 119, 119, - 119, 119, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, - 119, 23, 24, 25, 119, 26, 27, 119, - 29, 30, 31, 32, 29, 119, 5, 6, - 119, 119, 119, 119, 119, 119, 119, 119, - 119, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 119, - 23, 24, 25, 119, 119, 119, 119, 29, - 30, 31, 32, 29, 119, 26, 27, 119, - 27, 119, 1, 123, 123, 123, 1, 123, - 125, 124, 33, 124, 33, 125, 124, 125, - 124, 33, 124, 34, 124, 0 -}; - -static const char _use_syllable_machine_trans_targs[] = { - 1, 28, 0, 52, 54, 79, 80, 102, - 104, 92, 81, 82, 83, 84, 96, 97, - 98, 99, 105, 100, 93, 94, 95, 87, - 88, 89, 106, 107, 108, 101, 85, 86, - 0, 109, 111, 0, 2, 3, 15, 4, - 5, 6, 7, 19, 20, 21, 22, 25, - 23, 16, 17, 18, 10, 11, 12, 26, - 27, 24, 8, 9, 0, 13, 14, 0, - 29, 30, 42, 31, 32, 33, 34, 46, - 47, 48, 49, 50, 43, 44, 45, 37, - 38, 39, 51, 35, 36, 0, 51, 40, - 0, 41, 0, 0, 53, 0, 55, 56, - 68, 57, 58, 59, 60, 72, 73, 74, - 75, 78, 76, 69, 70, 71, 63, 64, - 65, 77, 61, 62, 77, 66, 67, 0, - 90, 91, 103, 0, 0, 110 -}; - -static const char _use_syllable_machine_trans_actions[] = { - 0, 0, 3, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 4, 0, 0, 5, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 6, 0, 0, 7, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 8, 0, 0, 9, 10, 0, - 11, 0, 12, 13, 0, 14, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 8, 0, 0, 10, 0, 0, 15, - 0, 0, 0, 16, 17, 0 -}; - -static const char _use_syllable_machine_to_state_actions[] = { - 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0 -}; - -static const char _use_syllable_machine_from_state_actions[] = { - 2, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0 -}; - -static const short _use_syllable_machine_eof_trans[] = { - 0, 36, 36, 36, 36, 36, 36, 36, - 36, 36, 36, 36, 36, 36, 36, 36, - 36, 36, 36, 36, 36, 36, 36, 36, - 36, 36, 36, 36, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, - 89, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 91, 92, 94, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 89, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 91, 64, 120, - 120, 120, 120, 120, 120, 120, 120, 120, - 120, 120, 120, 120, 120, 120, 120, 120, - 120, 120, 120, 120, 120, 120, 120, 120, - 120, 120, 120, 120, 124, 125, 125, 125 -}; - -static const int use_syllable_machine_start = 0; -static const int use_syllable_machine_first_final = 0; -static const int use_syllable_machine_error = -1; - -static const int use_syllable_machine_en_main = 0; - - -#line 58 "hb-ot-shape-complex-use-machine.rl" - - - -#line 181 "hb-ot-shape-complex-use-machine.rl" - - -#define found_syllable(syllable_type) \ - HB_STMT_START { \ - if (0) fprintf (stderr, "syllable %d..%d %s\n", (*ts).second.first, (*te).second.first, #syllable_type); \ - for (unsigned i = (*ts).second.first; i < (*te).second.first; ++i) \ - info[i].syllable() = (syllable_serial << 4) | syllable_type; \ - syllable_serial++; \ - if (unlikely (syllable_serial == 16)) syllable_serial = 1; \ - } HB_STMT_END - - -template <typename Iter> -struct machine_index_t : - hb_iter_with_fallback_t<machine_index_t<Iter>, - typename Iter::item_t> -{ - machine_index_t (const Iter& it) : it (it) {} - machine_index_t (const machine_index_t& o) : hb_iter_with_fallback_t<machine_index_t<Iter>, - typename Iter::item_t> (), - it (o.it), is_null (o.is_null) {} - - static constexpr bool is_random_access_iterator = Iter::is_random_access_iterator; - static constexpr bool is_sorted_iterator = Iter::is_sorted_iterator; - - typename Iter::item_t __item__ () const { return *it; } - typename Iter::item_t __item_at__ (unsigned i) const { return it[i]; } - unsigned __len__ () const { return it.len (); } - void __next__ () { ++it; } - void __forward__ (unsigned n) { it += n; } - void __prev__ () { --it; } - void __rewind__ (unsigned n) { it -= n; } - - void operator = (unsigned n) - { - assert (n == 0); - is_null = true; - } - explicit operator bool () { return !is_null; } - - void operator = (const machine_index_t& o) - { - is_null = o.is_null; - unsigned index = (*it).first; - unsigned n = (*o.it).first; - if (index < n) it += n - index; else if (index > n) it -= index - n; - } - bool operator == (const machine_index_t& o) const - { return is_null ? o.is_null : !o.is_null && (*it).first == (*o.it).first; } - bool operator != (const machine_index_t& o) const { return !(*this == o); } - - private: - Iter it; - bool is_null = false; -}; -struct -{ - template <typename Iter, - hb_requires (hb_is_iterable (Iter))> - machine_index_t<hb_iter_type<Iter>> - operator () (Iter&& it) const - { return machine_index_t<hb_iter_type<Iter>> (hb_iter (it)); } -} -HB_FUNCOBJ (machine_index); - - - -static bool -not_ccs_default_ignorable (const hb_glyph_info_t &i) -{ return i.use_category() != USE(CGJ); } - -static inline void -find_syllables_use (hb_buffer_t *buffer) -{ - hb_glyph_info_t *info = buffer->info; - auto p = - + hb_iter (info, buffer->len) - | hb_enumerate - | hb_filter ([] (const hb_glyph_info_t &i) { return not_ccs_default_ignorable (i); }, - hb_second) - | hb_filter ([&] (const hb_pair_t<unsigned, const hb_glyph_info_t &> p) - { - if (p.second.use_category() == USE(ZWNJ)) - for (unsigned i = p.first + 1; i < buffer->len; ++i) - if (not_ccs_default_ignorable (info[i])) - return !_hb_glyph_info_is_unicode_mark (&info[i]); - return true; - }) - | hb_enumerate - | machine_index - ; - auto pe = p + p.len (); - auto eof = +pe; - auto ts = +p; - auto te = +p; - unsigned int act HB_UNUSED; - int cs; - -#line 702 "hb-ot-shape-complex-use-machine.hh" - { - cs = use_syllable_machine_start; - ts = 0; - te = 0; - act = 0; - } - -#line 281 "hb-ot-shape-complex-use-machine.rl" - - - unsigned int syllable_serial = 1; - -#line 715 "hb-ot-shape-complex-use-machine.hh" - { - int _slen; - int _trans; - const unsigned char *_keys; - const char *_inds; - if ( p == pe ) - goto _test_eof; -_resume: - switch ( _use_syllable_machine_from_state_actions[cs] ) { - case 2: -#line 1 "NONE" - {ts = p;} - break; -#line 729 "hb-ot-shape-complex-use-machine.hh" - } - - _keys = _use_syllable_machine_trans_keys + (cs<<1); - _inds = _use_syllable_machine_indicies + _use_syllable_machine_index_offsets[cs]; - - _slen = _use_syllable_machine_key_spans[cs]; - _trans = _inds[ _slen > 0 && _keys[0] <=( (*p).second.second.use_category()) && - ( (*p).second.second.use_category()) <= _keys[1] ? - ( (*p).second.second.use_category()) - _keys[0] : _slen ]; - -_eof_trans: - cs = _use_syllable_machine_trans_targs[_trans]; - - if ( _use_syllable_machine_trans_actions[_trans] == 0 ) - goto _again; - - switch ( _use_syllable_machine_trans_actions[_trans] ) { - case 9: -#line 171 "hb-ot-shape-complex-use-machine.rl" - {te = p+1;{ found_syllable (use_standard_cluster); }} - break; - case 6: -#line 174 "hb-ot-shape-complex-use-machine.rl" - {te = p+1;{ found_syllable (use_symbol_cluster); }} - break; - case 4: -#line 176 "hb-ot-shape-complex-use-machine.rl" - {te = p+1;{ found_syllable (use_broken_cluster); }} - break; - case 3: -#line 177 "hb-ot-shape-complex-use-machine.rl" - {te = p+1;{ found_syllable (use_non_cluster); }} - break; - case 11: -#line 170 "hb-ot-shape-complex-use-machine.rl" - {te = p;p--;{ found_syllable (use_sakot_terminated_cluster); }} - break; - case 7: -#line 171 "hb-ot-shape-complex-use-machine.rl" - {te = p;p--;{ found_syllable (use_standard_cluster); }} - break; - case 14: -#line 172 "hb-ot-shape-complex-use-machine.rl" - {te = p;p--;{ found_syllable (use_number_joiner_terminated_cluster); }} - break; - case 13: -#line 173 "hb-ot-shape-complex-use-machine.rl" - {te = p;p--;{ found_syllable (use_numeral_cluster); }} - break; - case 5: -#line 174 "hb-ot-shape-complex-use-machine.rl" - {te = p;p--;{ found_syllable (use_symbol_cluster); }} - break; - case 17: -#line 175 "hb-ot-shape-complex-use-machine.rl" - {te = p;p--;{ found_syllable (use_hieroglyph_cluster); }} - break; - case 15: -#line 176 "hb-ot-shape-complex-use-machine.rl" - {te = p;p--;{ found_syllable (use_broken_cluster); }} - break; - case 16: -#line 177 "hb-ot-shape-complex-use-machine.rl" - {te = p;p--;{ found_syllable (use_non_cluster); }} - break; - case 12: -#line 1 "NONE" - { switch( act ) { - case 1: - {{p = ((te))-1;} found_syllable (use_virama_terminated_cluster); } - break; - case 2: - {{p = ((te))-1;} found_syllable (use_sakot_terminated_cluster); } - break; - } - } - break; - case 8: -#line 1 "NONE" - {te = p+1;} -#line 169 "hb-ot-shape-complex-use-machine.rl" - {act = 1;} - break; - case 10: -#line 1 "NONE" - {te = p+1;} -#line 170 "hb-ot-shape-complex-use-machine.rl" - {act = 2;} - break; -#line 819 "hb-ot-shape-complex-use-machine.hh" - } - -_again: - switch ( _use_syllable_machine_to_state_actions[cs] ) { - case 1: -#line 1 "NONE" - {ts = 0;} - break; -#line 828 "hb-ot-shape-complex-use-machine.hh" - } - - if ( ++p != pe ) - goto _resume; - _test_eof: {} - if ( p == eof ) - { - if ( _use_syllable_machine_eof_trans[cs] > 0 ) { - _trans = _use_syllable_machine_eof_trans[cs] - 1; - goto _eof_trans; - } - } - - } - -#line 286 "hb-ot-shape-complex-use-machine.rl" - -} - -#undef found_syllable - -#endif /* HB_OT_SHAPE_COMPLEX_USE_MACHINE_HH */ diff --git a/thirdparty/harfbuzz/src/hb-ot-shape-normalize.cc b/thirdparty/harfbuzz/src/hb-ot-shape-normalize.cc index aa5a8eeaa3..7db0b25b73 100644 --- a/thirdparty/harfbuzz/src/hb-ot-shape-normalize.cc +++ b/thirdparty/harfbuzz/src/hb-ot-shape-normalize.cc @@ -29,7 +29,7 @@ #ifndef HB_NO_OT_SHAPE #include "hb-ot-shape-normalize.hh" -#include "hb-ot-shape-complex.hh" +#include "hb-ot-shaper.hh" #include "hb-ot-shape.hh" @@ -69,7 +69,7 @@ * - When a font does not support a character but supports its canonical * decomposition, well, use the decomposition. * - * - The complex shapers can customize the compose and decompose functions to + * - The shapers can customize the compose and decompose functions to * offload some of their requirements to the normalizer. For example, the * Indic shaper may want to disallow recomposing of two matras. */ @@ -143,8 +143,7 @@ decompose (const hb_ot_shape_normalize_context_t *c, bool shortest, hb_codepoint return 1; } - unsigned int ret; - if ((ret = decompose (c, shortest, a))) { + if (unsigned ret = decompose (c, shortest, a)) { if (b) { output_char (buffer, b, b_glyph); return ret + 1; @@ -223,7 +222,7 @@ handle_variation_selector_cluster (const hb_ot_shape_normalize_context_t *c, unsigned int end, bool short_circuit HB_UNUSED) { - /* TODO Currently if there's a variation-selector we give-up, it's just too hard. */ + /* Currently if there's a variation-selector we give-up on normalization, it's just too hard. */ hb_buffer_t * const buffer = c->buffer; hb_font_t * const font = c->font; for (; buffer->idx < end - 1 && buffer->successful;) { @@ -395,7 +394,7 @@ _hb_ot_shape_normalize (const hb_ot_shape_plan_t *plan, break; /* We are going to do a O(n^2). Only do this if the sequence is short. */ - if (end - i > HB_OT_SHAPE_COMPLEX_MAX_COMBINING_MARKS) { + if (end - i > HB_OT_SHAPE_MAX_COMBINING_MARKS) { i = end; continue; } diff --git a/thirdparty/harfbuzz/src/hb-ot-shape.cc b/thirdparty/harfbuzz/src/hb-ot-shape.cc index 99aadab3f0..0806abb7dd 100644 --- a/thirdparty/harfbuzz/src/hb-ot-shape.cc +++ b/thirdparty/harfbuzz/src/hb-ot-shape.cc @@ -37,7 +37,7 @@ #include "hb-shaper-impl.hh" #include "hb-ot-shape.hh" -#include "hb-ot-shape-complex.hh" +#include "hb-ot-shaper.hh" #include "hb-ot-shape-fallback.hh" #include "hb-ot-shape-normalize.hh" @@ -86,14 +86,14 @@ hb_ot_shape_planner_t::hb_ot_shape_planner_t (hb_face_t *fac , apply_morx (_hb_apply_morx (face, props)) #endif { - shaper = hb_ot_shape_complex_categorize (this); + shaper = hb_ot_shaper_categorize (this); script_zero_marks = shaper->zero_width_marks != HB_OT_SHAPE_ZERO_WIDTH_MARKS_NONE; script_fallback_mark_positioning = shaper->fallback_position; /* https://github.com/harfbuzz/harfbuzz/issues/1528 */ - if (apply_morx && shaper != &_hb_ot_complex_shaper_default) - shaper = &_hb_ot_complex_shaper_dumber; + if (apply_morx && shaper != &_hb_ot_shaper_default) + shaper = &_hb_ot_shaper_dumber; } void @@ -927,7 +927,7 @@ hb_ot_substitute_default (const hb_ot_shape_context_t *c) } static inline void -hb_ot_substitute_complex (const hb_ot_shape_context_t *c) +hb_ot_substitute_plan (const hb_ot_shape_context_t *c) { hb_buffer_t *buffer = c->buffer; @@ -946,7 +946,7 @@ hb_ot_substitute_pre (const hb_ot_shape_context_t *c) _hb_buffer_allocate_gsubgpos_vars (c->buffer); - hb_ot_substitute_complex (c); + hb_ot_substitute_plan (c); #ifndef HB_NO_AAT_SHAPE if (c->plan->apply_morx && c->plan->apply_gpos) @@ -1039,7 +1039,7 @@ hb_ot_position_default (const hb_ot_shape_context_t *c) } static inline void -hb_ot_position_complex (const hb_ot_shape_context_t *c) +hb_ot_position_plan (const hb_ot_shape_context_t *c) { unsigned int count = c->buffer->len; hb_glyph_info_t *info = c->buffer->info; @@ -1124,7 +1124,7 @@ hb_ot_position (const hb_ot_shape_context_t *c) hb_ot_position_default (c); - hb_ot_position_complex (c); + hb_ot_position_plan (c); if (HB_DIRECTION_IS_BACKWARD (c->buffer->props.direction)) hb_buffer_reverse (c->buffer); @@ -1159,8 +1159,6 @@ hb_propagate_flags (hb_buffer_t *buffer) static void hb_ot_shape_internal (hb_ot_shape_context_t *c) { - c->buffer->enter (); - /* Save the original direction, we use it later. */ c->target_direction = c->buffer->props.direction; diff --git a/thirdparty/harfbuzz/src/hb-ot-shape.hh b/thirdparty/harfbuzz/src/hb-ot-shape.hh index e8c81015c7..17fa58b337 100644 --- a/thirdparty/harfbuzz/src/hb-ot-shape.hh +++ b/thirdparty/harfbuzz/src/hb-ot-shape.hh @@ -61,7 +61,7 @@ struct hb_shape_plan_key_t; struct hb_ot_shape_plan_t { hb_segment_properties_t props; - const struct hb_ot_complex_shaper_t *shaper; + const struct hb_ot_shaper_t *shaper; hb_ot_map_t map; hb_aat_map_t aat_map; const void *data; @@ -158,7 +158,7 @@ struct hb_ot_shape_planner_t #endif bool script_zero_marks : 1; bool script_fallback_mark_positioning : 1; - const struct hb_ot_complex_shaper_t *shaper; + const struct hb_ot_shaper_t *shaper; HB_INTERNAL hb_ot_shape_planner_t (hb_face_t *face, const hb_segment_properties_t *props); diff --git a/thirdparty/harfbuzz/src/hb-ot-shape-complex-arabic-fallback.hh b/thirdparty/harfbuzz/src/hb-ot-shaper-arabic-fallback.hh index 78f46c1cac..b9f92f72d6 100644 --- a/thirdparty/harfbuzz/src/hb-ot-shape-complex-arabic-fallback.hh +++ b/thirdparty/harfbuzz/src/hb-ot-shaper-arabic-fallback.hh @@ -24,8 +24,8 @@ * Google Author(s): Behdad Esfahbod */ -#ifndef HB_OT_SHAPE_COMPLEX_ARABIC_FALLBACK_HH -#define HB_OT_SHAPE_COMPLEX_ARABIC_FALLBACK_HH +#ifndef HB_OT_SHAPER_ARABIC_FALLBACK_HH +#define HB_OT_SHAPER_ARABIC_FALLBACK_HH #include "hb.hh" @@ -34,7 +34,11 @@ /* Features ordered the same as the entries in shaping_table rows, - * followed by rlig. Don't change. */ + * followed by rlig. Don't change. + * + * We currently support one subtable per lookup, and one lookup + * per feature. But we allow duplicate features, so we use that! + */ static const hb_tag_t arabic_fallback_features[] = { HB_TAG('i','n','i','t'), @@ -42,6 +46,8 @@ static const hb_tag_t arabic_fallback_features[] = HB_TAG('f','i','n','a'), HB_TAG('i','s','o','l'), HB_TAG('r','l','i','g'), + HB_TAG('r','l','i','g'), + HB_TAG('r','l','i','g'), }; static OT::SubstLookup * @@ -95,20 +101,25 @@ arabic_fallback_synthesize_lookup_single (const hb_ot_shape_plan_t *plan HB_UNUS return ret && !c.in_error () ? c.copy<OT::SubstLookup> () : nullptr; } +template <typename T> static OT::SubstLookup * arabic_fallback_synthesize_lookup_ligature (const hb_ot_shape_plan_t *plan HB_UNUSED, - hb_font_t *font) + hb_font_t *font, + const T &ligature_table, + unsigned lookup_flags) { OT::HBGlyphID16 first_glyphs[ARRAY_LENGTH_CONST (ligature_table)]; unsigned int first_glyphs_indirection[ARRAY_LENGTH_CONST (ligature_table)]; unsigned int ligature_per_first_glyph_count_list[ARRAY_LENGTH_CONST (first_glyphs)]; unsigned int num_first_glyphs = 0; - /* We know that all our ligatures are 2-component */ + /* We know that all our ligatures have the same number of components. */ OT::HBGlyphID16 ligature_list[ARRAY_LENGTH_CONST (first_glyphs) * ARRAY_LENGTH_CONST(ligature_table[0].ligatures)]; unsigned int component_count_list[ARRAY_LENGTH_CONST (ligature_list)]; - OT::HBGlyphID16 component_list[ARRAY_LENGTH_CONST (ligature_list) * 1/* One extra component per ligature */]; + OT::HBGlyphID16 component_list[ARRAY_LENGTH_CONST (ligature_list) * + ARRAY_LENGTH_CONST (ligature_table[0].ligatures[0].components)]; unsigned int num_ligatures = 0; + unsigned int num_components = 0; /* Populate arrays */ @@ -133,21 +144,32 @@ arabic_fallback_synthesize_lookup_ligature (const hb_ot_shape_plan_t *plan HB_UN { unsigned int first_glyph_idx = first_glyphs_indirection[i]; - for (unsigned int second_glyph_idx = 0; second_glyph_idx < ARRAY_LENGTH (ligature_table[0].ligatures); second_glyph_idx++) + for (unsigned int ligature_idx = 0; ligature_idx < ARRAY_LENGTH (ligature_table[0].ligatures); ligature_idx++) { - hb_codepoint_t second_u = ligature_table[first_glyph_idx].ligatures[second_glyph_idx].second; - hb_codepoint_t ligature_u = ligature_table[first_glyph_idx].ligatures[second_glyph_idx].ligature; - hb_codepoint_t second_glyph, ligature_glyph; - if (!second_u || - !hb_font_get_glyph (font, second_u, 0, &second_glyph) || - !hb_font_get_glyph (font, ligature_u, 0, &ligature_glyph)) + hb_codepoint_t ligature_u = ligature_table[first_glyph_idx].ligatures[ligature_idx].ligature; + hb_codepoint_t ligature_glyph; + if (!hb_font_get_glyph (font, ligature_u, 0, &ligature_glyph)) continue; - ligature_per_first_glyph_count_list[i]++; + const auto &components = ligature_table[first_glyph_idx].ligatures[ligature_idx].components; + unsigned component_count = ARRAY_LENGTH_CONST (components); + + for (unsigned i = 0; i < component_count; i++) + { + hb_codepoint_t component_u = ligature_table[first_glyph_idx].ligatures[ligature_idx].components[i]; + hb_codepoint_t component_glyph; + if (!component_u || + !hb_font_get_glyph (font, component_u, 0, &component_glyph)) + continue; + component_list[num_components++] = component_glyph; + } + + component_count_list[num_ligatures] = 1 + component_count; ligature_list[num_ligatures] = ligature_glyph; - component_count_list[num_ligatures] = 2; - component_list[num_ligatures] = second_glyph; + + ligature_per_first_glyph_count_list[i]++; + num_ligatures++; } } @@ -161,14 +183,13 @@ arabic_fallback_synthesize_lookup_ligature (const hb_ot_shape_plan_t *plan HB_UN hb_serialize_context_t c (buf, sizeof (buf)); OT::SubstLookup *lookup = c.start_serialize<OT::SubstLookup> (); bool ret = lookup->serialize_ligature (&c, - OT::LookupFlag::IgnoreMarks, + lookup_flags, hb_sorted_array (first_glyphs, num_first_glyphs), hb_array (ligature_per_first_glyph_count_list, num_first_glyphs), hb_array (ligature_list, num_ligatures), hb_array (component_count_list, num_ligatures), - hb_array (component_list, num_ligatures)); + hb_array (component_list, num_components)); c.end_serialize (); - /* TODO sanitize the results? */ return ret && !c.in_error () ? c.copy<OT::SubstLookup> () : nullptr; } @@ -181,10 +202,18 @@ arabic_fallback_synthesize_lookup (const hb_ot_shape_plan_t *plan, if (feature_index < 4) return arabic_fallback_synthesize_lookup_single (plan, font, feature_index); else - return arabic_fallback_synthesize_lookup_ligature (plan, font); + { + switch (feature_index) { + case 4: return arabic_fallback_synthesize_lookup_ligature (plan, font, ligature_3_table, OT::LookupFlag::IgnoreMarks); + case 5: return arabic_fallback_synthesize_lookup_ligature (plan, font, ligature_table, OT::LookupFlag::IgnoreMarks); + case 6: return arabic_fallback_synthesize_lookup_ligature (plan, font, ligature_mark_table, 0); + } + } + assert (false); + return nullptr; } -#define ARABIC_FALLBACK_MAX_LOOKUPS 5 +#define ARABIC_FALLBACK_MAX_LOOKUPS ARRAY_LENGTH_CONST (arabic_fallback_features) struct arabic_fallback_plan_t { @@ -201,7 +230,7 @@ struct arabic_fallback_plan_t #endif #ifdef HB_WITH_WIN1256 -#include "hb-ot-shape-complex-arabic-win1256.hh" +#include "hb-ot-shaper-arabic-win1256.hh" #endif struct ManifestLookup @@ -230,9 +259,8 @@ arabic_fallback_plan_init_win1256 (arabic_fallback_plan_t *fallback_plan HB_UNUS return false; const Manifest &manifest = reinterpret_cast<const Manifest&> (arabic_win1256_gsub_lookups.manifest); - static_assert (sizeof (arabic_win1256_gsub_lookups.manifestData) == + static_assert (sizeof (arabic_win1256_gsub_lookups.manifestData) <= ARABIC_FALLBACK_MAX_LOOKUPS * sizeof (ManifestLookup), ""); - /* TODO sanitize the table? */ unsigned j = 0; unsigned int count = manifest.len; @@ -264,7 +292,7 @@ arabic_fallback_plan_init_unicode (arabic_fallback_plan_t *fallback_plan, const hb_ot_shape_plan_t *plan, hb_font_t *font) { - static_assert ((ARRAY_LENGTH_CONST(arabic_fallback_features) <= ARABIC_FALLBACK_MAX_LOOKUPS), ""); + static_assert ((ARRAY_LENGTH_CONST (arabic_fallback_features) <= ARABIC_FALLBACK_MAX_LOOKUPS), ""); unsigned int j = 0; for (unsigned int i = 0; i < ARRAY_LENGTH(arabic_fallback_features) ; i++) { @@ -345,4 +373,4 @@ arabic_fallback_plan_shape (arabic_fallback_plan_t *fallback_plan, } -#endif /* HB_OT_SHAPE_COMPLEX_ARABIC_FALLBACK_HH */ +#endif /* HB_OT_SHAPER_ARABIC_FALLBACK_HH */ diff --git a/thirdparty/harfbuzz/src/hb-ot-shape-complex-arabic-joining-list.hh b/thirdparty/harfbuzz/src/hb-ot-shaper-arabic-joining-list.hh index e6339ee72b..a5ce3a6c93 100644 --- a/thirdparty/harfbuzz/src/hb-ot-shape-complex-arabic-joining-list.hh +++ b/thirdparty/harfbuzz/src/hb-ot-shaper-arabic-joining-list.hh @@ -12,8 +12,8 @@ * # Date: 2021-07-10, 00:35:31 GMT */ -#ifndef HB_OT_SHAPE_COMPLEX_ARABIC_JOINING_LIST_HH -#define HB_OT_SHAPE_COMPLEX_ARABIC_JOINING_LIST_HH +#ifndef HB_OT_SHAPER_ARABIC_JOINING_LIST_HH +#define HB_OT_SHAPER_ARABIC_JOINING_LIST_HH static bool has_arabic_joining (hb_script_t script) @@ -42,6 +42,6 @@ has_arabic_joining (hb_script_t script) } -#endif /* HB_OT_SHAPE_COMPLEX_ARABIC_JOINING_LIST_HH */ +#endif /* HB_OT_SHAPER_ARABIC_JOINING_LIST_HH */ /* == End of generated function == */ diff --git a/thirdparty/harfbuzz/src/hb-ot-shaper-arabic-pua.hh b/thirdparty/harfbuzz/src/hb-ot-shaper-arabic-pua.hh new file mode 100644 index 0000000000..ba86772f84 --- /dev/null +++ b/thirdparty/harfbuzz/src/hb-ot-shaper-arabic-pua.hh @@ -0,0 +1,118 @@ +/* == Start of generated table == */ +/* + * The following table is generated by running: + * + * ./gen-arabic-pua.py + * + */ + +#ifndef HB_OT_SHAPER_ARABIC_PUA_HH +#define HB_OT_SHAPER_ARABIC_PUA_HH + +static const uint8_t +_hb_arabic_u8[464] = +{ + 84, 86, 85, 85, 85, 85, 85,213, 16, 34, 34, 34, 34, 34, 35, 34, + 34, 34, 34, 34, 34, 34, 34, 34, 36, 34, 34, 34, 34, 34, 34, 34, + 34, 34, 34, 34, 34, 34, 82, 16, 0, 0, 0, 0, 1, 2, 3, 4, + 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 7, + 0, 0, 8, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 0, 0, 0, 22, 0, 23, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 16, 34, 34, 34, 35, 34, 34, 34, + 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, + 34, 34, 34, 34, 34, 34, 34, 66, 16, 50, 68, 68, 68, 68, 68, 68, + 68, 68, 68, 68,101, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, + 71, 68, 68, 68, 68, 68, 68, 68,152,186, 76, 77, 68,254, 16, 50, + 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 0, 0, 5, 6, + 0, 0, 0, 0, 0, 0, 7, 8, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 10, 0, + 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 13, 0, 0, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 23, 23, 29, 30, 31, 32, 33, 0, 0, 0, 0, + 0, 0, 0, 34, 0, 0, 0, 35, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 36, 37, 38, 0, 0, 0, 0, 0, 0, 0, 39, 0, 0, 40, + 41, 42, 0, 43, 44, 0, 0, 45, 46, 0, 47, 48, 49, 0, 0, 0, + 0, 50, 0, 0, 51, 52, 0, 53, 54, 55, 56, 57, 58, 0, 0, 0, + 0, 0, 59, 60, 61, 62, 63, 64, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65, 0, 0, 66, + 0, 0, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, +}; +static const uint16_t +_hb_arabic_u16[720] = +{ + 0, 0, 0, 0, 0, 0, 0, 0,61728,61729,61730, 0, 0,61733, 0, 0, + 61736,61737,61738,61739,61790,61741,61742,61743,61872,61873,61874,61875,61876,61877,61878,61879, + 61880,61881,61754,61755, 0,61757, 0,61759, 0, 0, 0,61787,61788,61789, 0, 0, + 0, 0, 0,61731, 0, 0, 0, 0, 0, 0, 0,61732, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0,61734, 0, 0, 0, 0, 0, 0, 0,61735, + 0, 0, 0, 0,61740, 0, 0, 0, 0, 0, 0,61755, 0, 0, 0,61759, + 0,61869,61765,61763,61883,61767,61882,61761,61770,61865,61772,61774,61777,61780,61783,61784, + 61785,61786,61792,61794,61796,61798,61800,61801,61802,61806,61810,61696,61696,61696,61696,61696, + 61791,61813,61816,61818,61820,61822,61921,61860,61861,61868,61864,61895,61896,61899,61892,61893, + 61898,61897,61894,61696,61696,61696,61696,61696,61696,61696,61696,61696,61696,61696,61696, 0, + 61744,61745,61746,61747,61748,61749,61750,61751,61752,61753, 0,61790,61790, 0, 0, 0, + 0, 0, 0, 0,61708,61709,61710,61711,61756,61758, 0, 0, 0, 0, 0, 0, + 0,61765,61766,61763,61764,61883,61883,61767,61768,61882,61871,61870,61870,61761,61762,61770, + 61770,61769,61769,61865,61866,61772,61772,61771,61771,61774,61774,61773,61773,61777,61776,61775, + 61775,61780,61779,61778,61778,61783,61782,61781,61781,61784,61784,61785,61785,61786,61786,61792, + 61792,61794,61794,61793,61793,61796,61796,61795,61795,61798,61798,61797,61797,61800,61800,61799, + 61799,61801,61801,61801,61801,61802,61802,61802,61802,61806,61805,61803,61804,61810,61809,61807, + 61808,61813,61813,61811,61812,61816,61816,61814,61815,61818,61818,61817,61817,61820,61820,61819, + 61819,61822,61822,61821,61821,61921,61921,61823,61823,61860,61859,61857,61858,61861,61861,61868, + 61867,61864,61863,61862,61862,61888,61889,61886,61887,61890,61891,61885,61884, 0, 0, 0, + 0, 0, 0, 0,61984,61985,61986, 0, 0,61989, 0, 0,61992,61993,61994,61995, + 62046,61997,61998,61999, 0, 0,62010,62011, 0,62013, 0,62015, 0, 0, 0,62043, + 0,62045, 0, 0, 0, 0, 0,61987, 0, 0, 0,61988, 0, 0, 0,61990, + 0, 0, 0,61991,61996, 0, 0, 0, 0, 0, 0,62011, 0, 0, 0,62015, + 0,62165,62021,62019,62170,62023,62169,62017,62028,62161,62032,62036,62040,62048,62052,62053, + 62055,62057,62059,62064,62068,62072,62078,62114,62115,62122,62126,61952,61952,61952,61952,61952, + 62047,62130,62134,62138,62142,62146,62150,62154,62155,62164,62160,62183,62184,62187,62180,62181, + 62186,62185,62182,61952,61952,61952,61952, 0,62000,62001,62002,62003,62004,62005,62006,62007, + 62008,62009, 0,62046,62046, 0, 0, 0,61964,61965,61966,61967,62012,62014, 0, 0, + 61954, 0,61981, 0, 0, 0,61955, 0,61982, 0,61956, 0, 0, 0,62111, 0, + 0, 0, 0,61970,61971,61972,61957, 0,61980, 0, 0, 0, 0, 0,61958, 0, + 61983, 0, 0, 0, 0, 0,62191, 0,62188,62189,62192, 0, 0, 0,61973, 0, + 0,62098, 0, 0,61974, 0, 0,62099, 0, 0,62101, 0, 0,61975, 0, 0, + 62100, 0, 0, 0,62080,62081,62082,62102, 0,62083,62084,62085,62103, 0, 0, 0, + 62106, 0,62107, 0,62108, 0, 0, 0,61976, 0, 0, 0, 0,62086,62087,62088, + 62109,61978,62089,62090,62091,62110,62093,62094, 0,62104, 0, 0, 0, 0,62095,62096, + 62097,62105, 0, 0,61977, 0, 0, 0, 0, 0,62075,62077,61968, 0, 0, 0, + 0,62021,62022,62019,62020,62170,62171,62023,62024,62169,62168,62166,62167,62017,62018,62028, + 62027,62025,62026,62161,62162,62032,62031,62029,62030,62036,62035,62033,62034,62040,62039,62037, + 62038,62048,62044,62041,62042,62052,62051,62049,62050,62053,62054,62055,62056,62057,62058,62059, + 62060,62064,62063,62061,62062,62068,62067,62065,62066,62072,62071,62069,62070,62078,62076,62073, + 62074,62114,62113,62079,62193,62118,62117,62115,62116,62122,62121,62119,62120,62126,62125,62123, + 62124,62130,62129,62127,62128,62134,62133,62131,62132,62138,62137,62135,62136,62142,62141,62139, + 62140,62146,62145,62143,62144,62150,62149,62147,62148,62154,62153,62151,62152,62155,62156,62164, + 62163,62160,62159,62157,62158,62176,62177,62174,62175,62178,62179,62172,62173, 0, 0, 0, +}; + +static inline unsigned +_hb_arabic_b2 (const uint8_t* a, unsigned i) +{ + return (a[i>>2]>>((i&3u)<<1))&3u; +} +static inline unsigned +_hb_arabic_b4 (const uint8_t* a, unsigned i) +{ + return (a[i>>1]>>((i&1u)<<2))&15u; +} +static inline uint_fast16_t +_hb_arabic_pua_simp_map (unsigned u) +{ + return u<65277u?_hb_arabic_u16[((_hb_arabic_u8[40+(((_hb_arabic_b4(8+_hb_arabic_u8,((_hb_arabic_b2(_hb_arabic_u8,u>>3>>4>>4))<<4)+((u>>3>>4)&15u)))<<4)+((u>>3)&15u))])<<3)+((u)&7u)]:0; +} +static inline uint_fast16_t +_hb_arabic_pua_trad_map (unsigned u) +{ + return u<65277u?_hb_arabic_u16[320+(((_hb_arabic_u8[208+(((_hb_arabic_b4(168+_hb_arabic_u8,((_hb_arabic_b4(136+_hb_arabic_u8,u>>2>>4>>4))<<4)+((u>>2>>4)&15u)))<<4)+((u>>2)&15u))])<<2)+((u)&3u))]:0; +} + +#endif /* HB_OT_SHAPER_ARABIC_PUA_HH */ + +/* == End of generated table == */ diff --git a/thirdparty/harfbuzz/src/hb-ot-shape-complex-arabic-table.hh b/thirdparty/harfbuzz/src/hb-ot-shaper-arabic-table.hh index c158964f2c..fd3d8645d1 100644 --- a/thirdparty/harfbuzz/src/hb-ot-shape-complex-arabic-table.hh +++ b/thirdparty/harfbuzz/src/hb-ot-shaper-arabic-table.hh @@ -13,8 +13,8 @@ * UnicodeData.txt does not have a header. */ -#ifndef HB_OT_SHAPE_COMPLEX_ARABIC_TABLE_HH -#define HB_OT_SHAPE_COMPLEX_ARABIC_TABLE_HH +#ifndef HB_OT_SHAPER_ARABIC_TABLE_HH +#define HB_OT_SHAPER_ARABIC_TABLE_HH #define A JOINING_GROUP_ALAPH @@ -416,26 +416,141 @@ static const uint16_t shaping_table[][4] = static const struct ligature_set_t { uint16_t first; struct ligature_pairs_t { - uint16_t second; + uint16_t components[1]; uint16_t ligature; - } ligatures[4]; + } ligatures[14]; } ligature_table[] = { + { 0xFE91u, { + { {0xFEE2u}, 0xFC08u }, /* ARABIC LIGATURE BEH WITH MEEM ISOLATED FORM */ + { {0xFEE4u}, 0xFC9Fu }, /* ARABIC LIGATURE BEH WITH MEEM INITIAL FORM */ + { {0xFEA0u}, 0xFC9Cu }, /* ARABIC LIGATURE BEH WITH JEEM INITIAL FORM */ + { {0xFEA4u}, 0xFC9Du }, /* ARABIC LIGATURE BEH WITH HAH INITIAL FORM */ + { {0xFEA8u}, 0xFC9Eu }, /* ARABIC LIGATURE BEH WITH KHAH INITIAL FORM */ + }}, + { 0xFE92u, { + { {0xFEAEu}, 0xFC6Au }, /* ARABIC LIGATURE BEH WITH REH FINAL FORM */ + { {0xFEE6u}, 0xFC6Du }, /* ARABIC LIGATURE BEH WITH NOON FINAL FORM */ + { {0xFEF2u}, 0xFC6Fu }, /* ARABIC LIGATURE BEH WITH YEH FINAL FORM */ + }}, + { 0xFE97u, { + { {0xFEE2u}, 0xFC0Eu }, /* ARABIC LIGATURE TEH WITH MEEM ISOLATED FORM */ + { {0xFEE4u}, 0xFCA4u }, /* ARABIC LIGATURE TEH WITH MEEM INITIAL FORM */ + { {0xFEA0u}, 0xFCA1u }, /* ARABIC LIGATURE TEH WITH JEEM INITIAL FORM */ + { {0xFEA4u}, 0xFCA2u }, /* ARABIC LIGATURE TEH WITH HAH INITIAL FORM */ + { {0xFEA8u}, 0xFCA3u }, /* ARABIC LIGATURE TEH WITH KHAH INITIAL FORM */ + }}, + { 0xFE98u, { + { {0xFEAEu}, 0xFC70u }, /* ARABIC LIGATURE TEH WITH REH FINAL FORM */ + { {0xFEE6u}, 0xFC73u }, /* ARABIC LIGATURE TEH WITH NOON FINAL FORM */ + { {0xFEF2u}, 0xFC75u }, /* ARABIC LIGATURE TEH WITH YEH FINAL FORM */ + }}, + { 0xFE9Bu, { + { {0xFEE2u}, 0xFC12u }, /* ARABIC LIGATURE THEH WITH MEEM ISOLATED FORM */ + }}, + { 0xFE9Fu, { + { {0xFEE4u}, 0xFCA8u }, /* ARABIC LIGATURE JEEM WITH MEEM INITIAL FORM */ + }}, + { 0xFEA3u, { + { {0xFEE4u}, 0xFCAAu }, /* ARABIC LIGATURE HAH WITH MEEM INITIAL FORM */ + }}, + { 0xFEA7u, { + { {0xFEE4u}, 0xFCACu }, /* ARABIC LIGATURE KHAH WITH MEEM INITIAL FORM */ + }}, + { 0xFEB3u, { + { {0xFEE4u}, 0xFCB0u }, /* ARABIC LIGATURE SEEN WITH MEEM INITIAL FORM */ + }}, + { 0xFEB7u, { + { {0xFEE4u}, 0xFD30u }, /* ARABIC LIGATURE SHEEN WITH MEEM INITIAL FORM */ + }}, + { 0xFED3u, { + { {0xFEF2u}, 0xFC32u }, /* ARABIC LIGATURE FEH WITH YEH ISOLATED FORM */ + }}, { 0xFEDFu, { - { 0xFE82u, 0xFEF5u }, /* ARABIC LIGATURE LAM WITH ALEF WITH MADDA ABOVE ISOLATED FORM */ - { 0xFE84u, 0xFEF7u }, /* ARABIC LIGATURE LAM WITH ALEF WITH HAMZA ABOVE ISOLATED FORM */ - { 0xFE88u, 0xFEF9u }, /* ARABIC LIGATURE LAM WITH ALEF WITH HAMZA BELOW ISOLATED FORM */ - { 0xFE8Eu, 0xFEFBu }, /* ARABIC LIGATURE LAM WITH ALEF ISOLATED FORM */ + { {0xFE9Eu}, 0xFC3Fu }, /* ARABIC LIGATURE LAM WITH JEEM ISOLATED FORM */ + { {0xFEA0u}, 0xFCC9u }, /* ARABIC LIGATURE LAM WITH JEEM INITIAL FORM */ + { {0xFEA2u}, 0xFC40u }, /* ARABIC LIGATURE LAM WITH HAH ISOLATED FORM */ + { {0xFEA4u}, 0xFCCAu }, /* ARABIC LIGATURE LAM WITH HAH INITIAL FORM */ + { {0xFEA6u}, 0xFC41u }, /* ARABIC LIGATURE LAM WITH KHAH ISOLATED FORM */ + { {0xFEA8u}, 0xFCCBu }, /* ARABIC LIGATURE LAM WITH KHAH INITIAL FORM */ + { {0xFEE2u}, 0xFC42u }, /* ARABIC LIGATURE LAM WITH MEEM ISOLATED FORM */ + { {0xFEE4u}, 0xFCCCu }, /* ARABIC LIGATURE LAM WITH MEEM INITIAL FORM */ + { {0xFEF2u}, 0xFC44u }, /* ARABIC LIGATURE LAM WITH YEH ISOLATED FORM */ + { {0xFEECu}, 0xFCCDu }, /* ARABIC LIGATURE LAM WITH HEH INITIAL FORM */ + { {0xFE82u}, 0xFEF5u }, /* ARABIC LIGATURE LAM WITH ALEF WITH MADDA ABOVE ISOLATED FORM */ + { {0xFE84u}, 0xFEF7u }, /* ARABIC LIGATURE LAM WITH ALEF WITH HAMZA ABOVE ISOLATED FORM */ + { {0xFE88u}, 0xFEF9u }, /* ARABIC LIGATURE LAM WITH ALEF WITH HAMZA BELOW ISOLATED FORM */ + { {0xFE8Eu}, 0xFEFBu }, /* ARABIC LIGATURE LAM WITH ALEF ISOLATED FORM */ }}, { 0xFEE0u, { - { 0xFE82u, 0xFEF6u }, /* ARABIC LIGATURE LAM WITH ALEF WITH MADDA ABOVE FINAL FORM */ - { 0xFE84u, 0xFEF8u }, /* ARABIC LIGATURE LAM WITH ALEF WITH HAMZA ABOVE FINAL FORM */ - { 0xFE88u, 0xFEFAu }, /* ARABIC LIGATURE LAM WITH ALEF WITH HAMZA BELOW FINAL FORM */ - { 0xFE8Eu, 0xFEFCu }, /* ARABIC LIGATURE LAM WITH ALEF FINAL FORM */ + { {0xFEF0u}, 0xFC86u }, /* ARABIC LIGATURE LAM WITH ALEF MAKSURA FINAL FORM */ + { {0xFE82u}, 0xFEF6u }, /* ARABIC LIGATURE LAM WITH ALEF WITH MADDA ABOVE FINAL FORM */ + { {0xFE84u}, 0xFEF8u }, /* ARABIC LIGATURE LAM WITH ALEF WITH HAMZA ABOVE FINAL FORM */ + { {0xFE88u}, 0xFEFAu }, /* ARABIC LIGATURE LAM WITH ALEF WITH HAMZA BELOW FINAL FORM */ + { {0xFE8Eu}, 0xFEFCu }, /* ARABIC LIGATURE LAM WITH ALEF FINAL FORM */ + }}, + { 0xFEE3u, { + { {0xFEA0u}, 0xFCCEu }, /* ARABIC LIGATURE MEEM WITH JEEM INITIAL FORM */ + { {0xFEA4u}, 0xFCCFu }, /* ARABIC LIGATURE MEEM WITH HAH INITIAL FORM */ + { {0xFEA8u}, 0xFCD0u }, /* ARABIC LIGATURE MEEM WITH KHAH INITIAL FORM */ + { {0xFEE4u}, 0xFCD1u }, /* ARABIC LIGATURE MEEM WITH MEEM INITIAL FORM */ + }}, + { 0xFEE7u, { + { {0xFEE2u}, 0xFC4Eu }, /* ARABIC LIGATURE NOON WITH MEEM ISOLATED FORM */ + { {0xFEE4u}, 0xFCD5u }, /* ARABIC LIGATURE NOON WITH MEEM INITIAL FORM */ + { {0xFEA0u}, 0xFCD2u }, /* ARABIC LIGATURE NOON WITH JEEM INITIAL FORM */ + { {0xFEA4u}, 0xFCD3u }, /* ARABIC LIGATURE NOON WITH HAH INITIAL FORM */ + }}, + { 0xFEE8u, { + { {0xFEF2u}, 0xFC8Fu }, /* ARABIC LIGATURE NOON WITH YEH FINAL FORM */ + }}, + { 0xFEF3u, { + { {0xFEA0u}, 0xFCDAu }, /* ARABIC LIGATURE YEH WITH JEEM INITIAL FORM */ + { {0xFEA4u}, 0xFCDBu }, /* ARABIC LIGATURE YEH WITH HAH INITIAL FORM */ + { {0xFEA8u}, 0xFCDCu }, /* ARABIC LIGATURE YEH WITH KHAH INITIAL FORM */ + { {0xFEE4u}, 0xFCDDu }, /* ARABIC LIGATURE YEH WITH MEEM INITIAL FORM */ + }}, + { 0xFEF4u, { + { {0xFEAEu}, 0xFC91u }, /* ARABIC LIGATURE YEH WITH REH FINAL FORM */ + { {0xFEE6u}, 0xFC94u }, /* ARABIC LIGATURE YEH WITH NOON FINAL FORM */ + }}, +}; + + +static const struct ligature_mark_set_t { + uint16_t first; + struct ligature_pairs_t { + uint16_t components[1]; + uint16_t ligature; + } ligatures[5]; +} ligature_mark_table[] = +{ + { 0x0651u, { + { {0x064Cu}, 0xFC5Eu }, /* ARABIC LIGATURE SHADDA WITH DAMMATAN ISOLATED FORM */ + { {0x064Eu}, 0xFC60u }, /* ARABIC LIGATURE SHADDA WITH FATHA ISOLATED FORM */ + { {0x064Fu}, 0xFC61u }, /* ARABIC LIGATURE SHADDA WITH DAMMA ISOLATED FORM */ + { {0x0650u}, 0xFC62u }, /* ARABIC LIGATURE SHADDA WITH KASRA ISOLATED FORM */ + { {0x064Bu}, 0xF2EEu }, /* PUA ARABIC LIGATURE SHADDA WITH FATHATAN ISOLATED FORM */ + }}, +}; + + +static const struct ligature_3_set_t { + uint16_t first; + struct ligature_triplets_t { + uint16_t components[2]; + uint16_t ligature; + } ligatures[3]; +} ligature_3_table[] = +{ + { 0xFEDFu, { + { {0xFEE4u, 0xFEA4u}, 0xFD88u}, /* ARABIC LIGATURE LAM WITH MEEM WITH HAH INITIAL FORM */ + { {0xFEE0u, 0xFEEAu}, 0xF201u}, /* PUA ARABIC LIGATURE LELLAH ISOLATED FORM */ + { {0xFEE4u, 0xFEA0u}, 0xF211u}, /* PUA ARABIC LIGATURE LAM WITH MEEM WITH JEEM INITIAL FORM */ }}, }; -#endif /* HB_OT_SHAPE_COMPLEX_ARABIC_TABLE_HH */ +#endif /* HB_OT_SHAPER_ARABIC_TABLE_HH */ /* == End of generated table == */ diff --git a/thirdparty/harfbuzz/src/hb-ot-shape-complex-arabic-win1256.hh b/thirdparty/harfbuzz/src/hb-ot-shaper-arabic-win1256.hh index 429974d05b..b8d481c813 100644 --- a/thirdparty/harfbuzz/src/hb-ot-shape-complex-arabic-win1256.hh +++ b/thirdparty/harfbuzz/src/hb-ot-shaper-arabic-win1256.hh @@ -24,7 +24,7 @@ * Google Author(s): Behdad Esfahbod */ -#ifndef HB_OT_SHAPE_COMPLEX_ARABIC_WIN1256_HH +#ifndef HB_OT_SHAPER_ARABIC_WIN1256_HH /* @@ -342,8 +342,8 @@ OT_TABLE_END #include "hb.hh" /* Make check-includes.sh happy. */ #endif #ifdef OT_MEASURE -#include "hb-ot-shape-complex-arabic-win1256.hh" +#include "hb-ot-shaper-arabic-win1256.hh" #endif -#define HB_OT_SHAPE_COMPLEX_ARABIC_WIN1256_HH -#endif /* HB_OT_SHAPE_COMPLEX_ARABIC_WIN1256_HH */ +#define HB_OT_SHAPER_ARABIC_WIN1256_HH +#endif /* HB_OT_SHAPER_ARABIC_WIN1256_HH */ diff --git a/thirdparty/harfbuzz/src/hb-ot-shape-complex-arabic.cc b/thirdparty/harfbuzz/src/hb-ot-shaper-arabic.cc index 224f8b842e..e869d78509 100644 --- a/thirdparty/harfbuzz/src/hb-ot-shape-complex-arabic.cc +++ b/thirdparty/harfbuzz/src/hb-ot-shaper-arabic.cc @@ -28,14 +28,14 @@ #ifndef HB_NO_OT_SHAPE -#include "hb-ot-shape-complex-arabic.hh" +#include "hb-ot-shaper-arabic.hh" #include "hb-ot-shape.hh" /* buffer var allocations */ -#define arabic_shaping_action() complex_var_u8_auxiliary() /* arabic shaping action */ +#define arabic_shaping_action() ot_shaper_var_u8_auxiliary() /* arabic shaping action */ -#define HB_BUFFER_SCRATCH_FLAG_ARABIC_HAS_STCH HB_BUFFER_SCRATCH_FLAG_COMPLEX0 +#define HB_BUFFER_SCRATCH_FLAG_ARABIC_HAS_STCH HB_BUFFER_SCRATCH_FLAG_SHAPER0 /* See: * https://github.com/harfbuzz/harfbuzz/commit/6e6f82b6f3dde0fc6c3c7d991d9ec6cfff57823d#commitcomment-14248516 */ @@ -81,7 +81,7 @@ enum hb_arabic_joining_type_t { JOINING_TYPE_X = 8 /* means: use general-category to choose between U or T. */ }; -#include "hb-ot-shape-complex-arabic-table.hh" +#include "hb-ot-shaper-arabic-table.hh" static unsigned int get_joining_type (hb_codepoint_t u, hb_unicode_general_category_t gen_cat) { @@ -172,6 +172,14 @@ record_stch (const hb_ot_shape_plan_t *plan, hb_buffer_t *buffer); static void +deallocate_buffer_var (const hb_ot_shape_plan_t *plan, + hb_font_t *font, + hb_buffer_t *buffer) +{ + HB_BUFFER_DEALLOCATE_VAR (buffer, arabic_shaping_action); +} + +static void collect_features_arabic (hb_ot_shape_planner_t *plan) { hb_ot_map_builder_t *map = &plan->map; @@ -213,6 +221,7 @@ collect_features_arabic (hb_ot_shape_planner_t *plan) map->add_feature (arabic_features[i], has_fallback ? F_HAS_FALLBACK : F_NONE); map->add_gsub_pause (nullptr); } + map->add_gsub_pause (deallocate_buffer_var); /* Normally, Unicode says a ZWNJ means "don't ligate". In Arabic script * however, it says a ZWJ should also mean "don't ligate". So we run @@ -240,7 +249,7 @@ collect_features_arabic (hb_ot_shape_planner_t *plan) map->enable_feature (HB_TAG('m','s','e','t')); } -#include "hb-ot-shape-complex-arabic-fallback.hh" +#include "hb-ot-shaper-arabic-fallback.hh" struct arabic_shape_plan_t { @@ -405,7 +414,7 @@ arabic_fallback_shape (const hb_ot_shape_plan_t *plan, hb_font_t *font, hb_buffer_t *buffer) { -#ifdef HB_NO_OT_SHAPE_COMPLEX_ARABIC_FALLBACK +#ifdef HB_NO_OT_SHAPER_ARABIC_FALLBACK return; #endif @@ -619,8 +628,6 @@ postprocess_glyphs_arabic (const hb_ot_shape_plan_t *plan, hb_font_t *font) { apply_stch (plan, buffer, font); - - HB_BUFFER_DEALLOCATE_VAR (buffer, arabic_shaping_action); } /* https://www.unicode.org/reports/tr53/ */ @@ -689,7 +696,7 @@ reorder_marks_arabic (const hb_ot_shape_plan_t *plan HB_UNUSED, /* Shift it! */ DEBUG_MSG (ARABIC, buffer, "Shifting %d's: %d %d", cc, i, j); - hb_glyph_info_t temp[HB_OT_SHAPE_COMPLEX_MAX_COMBINING_MARKS]; + hb_glyph_info_t temp[HB_OT_SHAPE_MAX_COMBINING_MARKS]; assert (j - i <= ARRAY_LENGTH (temp)); buffer->merge_clusters (start, j); memmove (temp, &info[i], (j - i) * sizeof (hb_glyph_info_t)); @@ -720,7 +727,7 @@ reorder_marks_arabic (const hb_ot_shape_plan_t *plan HB_UNUSED, } } -const hb_ot_complex_shaper_t _hb_ot_complex_shaper_arabic = +const hb_ot_shaper_t _hb_ot_shaper_arabic = { collect_features_arabic, nullptr, /* override_features */ diff --git a/thirdparty/harfbuzz/src/hb-ot-shape-complex-arabic.hh b/thirdparty/harfbuzz/src/hb-ot-shaper-arabic.hh index 5bf6ff6338..a025b1a399 100644 --- a/thirdparty/harfbuzz/src/hb-ot-shape-complex-arabic.hh +++ b/thirdparty/harfbuzz/src/hb-ot-shaper-arabic.hh @@ -26,12 +26,12 @@ * Google Author(s): Behdad Esfahbod */ -#ifndef HB_OT_SHAPE_COMPLEX_ARABIC_HH -#define HB_OT_SHAPE_COMPLEX_ARABIC_HH +#ifndef HB_OT_SHAPER_ARABIC_HH +#define HB_OT_SHAPER_ARABIC_HH #include "hb.hh" -#include "hb-ot-shape-complex.hh" +#include "hb-ot-shaper.hh" struct arabic_shape_plan_t; @@ -47,4 +47,4 @@ setup_masks_arabic_plan (const arabic_shape_plan_t *arabic_plan, hb_buffer_t *buffer, hb_script_t script); -#endif /* HB_OT_SHAPE_COMPLEX_ARABIC_HH */ +#endif /* HB_OT_SHAPER_ARABIC_HH */ diff --git a/thirdparty/harfbuzz/src/hb-ot-shape-complex-default.cc b/thirdparty/harfbuzz/src/hb-ot-shaper-default.cc index a755aea098..25716aa81f 100644 --- a/thirdparty/harfbuzz/src/hb-ot-shape-complex-default.cc +++ b/thirdparty/harfbuzz/src/hb-ot-shaper-default.cc @@ -28,10 +28,10 @@ #ifndef HB_NO_OT_SHAPE -#include "hb-ot-shape-complex.hh" +#include "hb-ot-shaper.hh" -const hb_ot_complex_shaper_t _hb_ot_complex_shaper_default = +const hb_ot_shaper_t _hb_ot_shaper_default = { nullptr, /* collect_features */ nullptr, /* override_features */ @@ -51,7 +51,7 @@ const hb_ot_complex_shaper_t _hb_ot_complex_shaper_default = /* Same as default but no mark advance zeroing / fallback positioning. * Dumbest shaper ever, basically. */ -const hb_ot_complex_shaper_t _hb_ot_complex_shaper_dumber = +const hb_ot_shaper_t _hb_ot_shaper_dumber = { nullptr, /* collect_features */ nullptr, /* override_features */ diff --git a/thirdparty/harfbuzz/src/hb-ot-shape-complex-hangul.cc b/thirdparty/harfbuzz/src/hb-ot-shaper-hangul.cc index 3bc9e9b961..aa507c75ca 100644 --- a/thirdparty/harfbuzz/src/hb-ot-shape-complex-hangul.cc +++ b/thirdparty/harfbuzz/src/hb-ot-shaper-hangul.cc @@ -28,7 +28,7 @@ #ifndef HB_NO_OT_SHAPE -#include "hb-ot-shape-complex.hh" +#include "hb-ot-shaper.hh" /* Hangul shaper */ @@ -119,7 +119,7 @@ data_destroy_hangul (void *data) #define isHangulTone(u) (hb_in_range<hb_codepoint_t> ((u), 0x302Eu, 0x302Fu)) /* buffer var allocations */ -#define hangul_shaping_feature() complex_var_u8_auxiliary() /* hangul jamo shaping feature */ +#define hangul_shaping_feature() ot_shaper_var_u8_auxiliary() /* hangul jamo shaping feature */ static bool is_zero_width_char (hb_font_t *font, @@ -414,7 +414,7 @@ setup_masks_hangul (const hb_ot_shape_plan_t *plan, } -const hb_ot_complex_shaper_t _hb_ot_complex_shaper_hangul = +const hb_ot_shaper_t _hb_ot_shaper_hangul = { collect_features_hangul, override_features_hangul, diff --git a/thirdparty/harfbuzz/src/hb-ot-shape-complex-hebrew.cc b/thirdparty/harfbuzz/src/hb-ot-shaper-hebrew.cc index 334d3ded82..f3b6cde179 100644 --- a/thirdparty/harfbuzz/src/hb-ot-shape-complex-hebrew.cc +++ b/thirdparty/harfbuzz/src/hb-ot-shaper-hebrew.cc @@ -28,7 +28,7 @@ #ifndef HB_NO_OT_SHAPE -#include "hb-ot-shape-complex.hh" +#include "hb-ot-shaper.hh" static bool @@ -74,7 +74,7 @@ compose_hebrew (const hb_ot_shape_normalize_context_t *c, bool found = (bool) c->unicode->compose (a, b, ab); -#ifdef HB_NO_OT_SHAPE_COMPLEX_HEBREW_FALLBACK +#ifdef HB_NO_OT_SHAPER_HEBREW_FALLBACK return found; #endif @@ -163,7 +163,7 @@ compose_hebrew (const hb_ot_shape_normalize_context_t *c, } -const hb_ot_complex_shaper_t _hb_ot_complex_shaper_hebrew = +const hb_ot_shaper_t _hb_ot_shaper_hebrew = { nullptr, /* collect_features */ nullptr, /* override_features */ diff --git a/thirdparty/harfbuzz/src/hb-ot-shaper-indic-machine.hh b/thirdparty/harfbuzz/src/hb-ot-shaper-indic-machine.hh new file mode 100644 index 0000000000..d52b13f616 --- /dev/null +++ b/thirdparty/harfbuzz/src/hb-ot-shaper-indic-machine.hh @@ -0,0 +1,589 @@ + +#line 1 "hb-ot-shaper-indic-machine.rl" +/* + * Copyright © 2011,2012 Google, Inc. + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Google Author(s): Behdad Esfahbod + */ + +#ifndef HB_OT_SHAPER_INDIC_MACHINE_HH +#define HB_OT_SHAPER_INDIC_MACHINE_HH + +#include "hb.hh" + +#include "hb-ot-layout.hh" +#include "hb-ot-shaper-indic.hh" + +/* buffer var allocations */ +#define indic_category() ot_shaper_var_u8_category() /* indic_category_t */ +#define indic_position() ot_shaper_var_u8_auxiliary() /* indic_position_t */ + +using indic_category_t = unsigned; +using indic_position_t = ot_position_t; + +#define I_Cat(Cat) indic_syllable_machine_ex_##Cat + +enum indic_syllable_type_t { + indic_consonant_syllable, + indic_vowel_syllable, + indic_standalone_cluster, + indic_symbol_cluster, + indic_broken_cluster, + indic_non_indic_cluster, +}; + + +#line 57 "hb-ot-shaper-indic-machine.hh" +#define indic_syllable_machine_ex_A 9u +#define indic_syllable_machine_ex_C 1u +#define indic_syllable_machine_ex_CM 16u +#define indic_syllable_machine_ex_CS 18u +#define indic_syllable_machine_ex_DOTTEDCIRCLE 11u +#define indic_syllable_machine_ex_H 4u +#define indic_syllable_machine_ex_M 7u +#define indic_syllable_machine_ex_N 3u +#define indic_syllable_machine_ex_PLACEHOLDER 10u +#define indic_syllable_machine_ex_RS 12u +#define indic_syllable_machine_ex_Ra 15u +#define indic_syllable_machine_ex_Repha 14u +#define indic_syllable_machine_ex_SM 8u +#define indic_syllable_machine_ex_Symbol 17u +#define indic_syllable_machine_ex_V 2u +#define indic_syllable_machine_ex_VD 9u +#define indic_syllable_machine_ex_X 0u +#define indic_syllable_machine_ex_ZWJ 6u +#define indic_syllable_machine_ex_ZWNJ 5u + + +#line 79 "hb-ot-shaper-indic-machine.hh" +static const unsigned char _indic_syllable_machine_trans_keys[] = { + 8u, 8u, 4u, 8u, 5u, 7u, 5u, 8u, 4u, 8u, 4u, 12u, 4u, 8u, 8u, 8u, + 5u, 7u, 5u, 8u, 4u, 8u, 4u, 12u, 4u, 12u, 4u, 12u, 8u, 8u, 5u, 7u, + 5u, 8u, 4u, 8u, 4u, 8u, 4u, 12u, 8u, 8u, 5u, 7u, 5u, 8u, 4u, 8u, + 4u, 8u, 5u, 8u, 8u, 8u, 1u, 18u, 3u, 16u, 3u, 16u, 4u, 16u, 1u, 15u, + 5u, 9u, 5u, 9u, 9u, 9u, 5u, 9u, 1u, 15u, 1u, 15u, 1u, 15u, 3u, 9u, + 4u, 9u, 5u, 9u, 4u, 9u, 5u, 9u, 3u, 9u, 5u, 9u, 3u, 16u, 3u, 16u, + 3u, 16u, 3u, 16u, 4u, 16u, 1u, 15u, 3u, 16u, 3u, 16u, 4u, 16u, 1u, 15u, + 5u, 9u, 9u, 9u, 5u, 9u, 1u, 15u, 1u, 15u, 3u, 9u, 4u, 9u, 5u, 9u, + 4u, 9u, 5u, 9u, 5u, 9u, 3u, 9u, 5u, 9u, 3u, 16u, 3u, 16u, 4u, 8u, + 3u, 16u, 3u, 16u, 4u, 16u, 1u, 15u, 3u, 16u, 1u, 15u, 5u, 9u, 9u, 9u, + 5u, 9u, 1u, 15u, 1u, 15u, 3u, 9u, 4u, 9u, 5u, 9u, 3u, 16u, 4u, 9u, + 5u, 9u, 5u, 9u, 3u, 9u, 5u, 9u, 3u, 16u, 4u, 12u, 4u, 8u, 3u, 16u, + 3u, 16u, 4u, 16u, 1u, 15u, 3u, 16u, 1u, 15u, 5u, 9u, 9u, 9u, 5u, 9u, + 1u, 15u, 1u, 15u, 3u, 9u, 4u, 9u, 5u, 9u, 3u, 16u, 4u, 9u, 5u, 9u, + 5u, 9u, 3u, 9u, 5u, 9u, 1u, 16u, 3u, 16u, 1u, 16u, 4u, 12u, 5u, 9u, + 9u, 9u, 5u, 9u, 1u, 15u, 3u, 9u, 5u, 9u, 5u, 9u, 9u, 9u, 5u, 9u, + 1u, 15u, 0 +}; + +static const char _indic_syllable_machine_key_spans[] = { + 1, 5, 3, 4, 5, 9, 5, 1, + 3, 4, 5, 9, 9, 9, 1, 3, + 4, 5, 5, 9, 1, 3, 4, 5, + 5, 4, 1, 18, 14, 14, 13, 15, + 5, 5, 1, 5, 15, 15, 15, 7, + 6, 5, 6, 5, 7, 5, 14, 14, + 14, 14, 13, 15, 14, 14, 13, 15, + 5, 1, 5, 15, 15, 7, 6, 5, + 6, 5, 5, 7, 5, 14, 14, 5, + 14, 14, 13, 15, 14, 15, 5, 1, + 5, 15, 15, 7, 6, 5, 14, 6, + 5, 5, 7, 5, 14, 9, 5, 14, + 14, 13, 15, 14, 15, 5, 1, 5, + 15, 15, 7, 6, 5, 14, 6, 5, + 5, 7, 5, 16, 14, 16, 9, 5, + 1, 5, 15, 7, 5, 5, 1, 5, + 15 +}; + +static const short _indic_syllable_machine_index_offsets[] = { + 0, 2, 8, 12, 17, 23, 33, 39, + 41, 45, 50, 56, 66, 76, 86, 88, + 92, 97, 103, 109, 119, 121, 125, 130, + 136, 142, 147, 149, 168, 183, 198, 212, + 228, 234, 240, 242, 248, 264, 280, 296, + 304, 311, 317, 324, 330, 338, 344, 359, + 374, 389, 404, 418, 434, 449, 464, 478, + 494, 500, 502, 508, 524, 540, 548, 555, + 561, 568, 574, 580, 588, 594, 609, 624, + 630, 645, 660, 674, 690, 705, 721, 727, + 729, 735, 751, 767, 775, 782, 788, 803, + 810, 816, 822, 830, 836, 851, 861, 867, + 882, 897, 911, 927, 942, 958, 964, 966, + 972, 988, 1004, 1012, 1019, 1025, 1040, 1047, + 1053, 1059, 1067, 1073, 1090, 1105, 1122, 1132, + 1138, 1140, 1146, 1162, 1170, 1176, 1182, 1184, + 1190 +}; + +static const unsigned char _indic_syllable_machine_indicies[] = { + 1, 0, 2, 3, 3, 4, 1, 0, + 3, 3, 4, 0, 3, 3, 4, 1, + 0, 5, 3, 3, 4, 1, 0, 2, + 3, 3, 4, 1, 0, 0, 0, 6, + 0, 8, 9, 9, 10, 11, 7, 11, + 7, 9, 9, 10, 7, 9, 9, 10, + 11, 7, 12, 9, 9, 10, 11, 7, + 8, 9, 9, 10, 11, 7, 7, 7, + 13, 7, 8, 9, 9, 10, 11, 7, + 7, 7, 14, 7, 16, 17, 17, 18, + 19, 15, 15, 15, 20, 15, 19, 15, + 17, 17, 18, 21, 17, 17, 18, 19, + 15, 16, 17, 17, 18, 19, 15, 22, + 17, 17, 18, 19, 15, 24, 25, 25, + 26, 27, 23, 23, 23, 28, 23, 27, + 23, 25, 25, 26, 23, 25, 25, 26, + 27, 23, 24, 25, 25, 26, 27, 23, + 29, 25, 25, 26, 27, 23, 17, 17, + 18, 1, 0, 31, 30, 33, 34, 35, + 36, 37, 38, 18, 19, 39, 40, 40, + 20, 32, 41, 42, 43, 44, 45, 32, + 47, 48, 49, 50, 4, 1, 51, 46, + 46, 6, 46, 46, 46, 52, 46, 53, + 48, 54, 54, 4, 1, 51, 46, 46, + 46, 46, 46, 46, 52, 46, 48, 54, + 54, 4, 1, 51, 46, 46, 46, 46, + 46, 46, 52, 46, 33, 46, 46, 46, + 55, 56, 46, 1, 51, 46, 46, 46, + 46, 46, 33, 46, 57, 57, 46, 1, + 51, 46, 51, 46, 46, 58, 51, 46, + 51, 46, 51, 46, 46, 46, 51, 46, + 33, 46, 59, 46, 57, 57, 46, 1, + 51, 46, 46, 46, 46, 46, 33, 46, + 33, 46, 46, 46, 57, 57, 46, 1, + 51, 46, 46, 46, 46, 46, 33, 46, + 33, 46, 46, 46, 57, 56, 46, 1, + 51, 46, 46, 46, 46, 46, 33, 46, + 60, 61, 62, 62, 4, 1, 51, 46, + 61, 62, 62, 4, 1, 51, 46, 62, + 62, 4, 1, 51, 46, 63, 64, 64, + 4, 1, 51, 46, 55, 65, 46, 1, + 51, 46, 55, 46, 57, 57, 46, 1, + 51, 46, 57, 65, 46, 1, 51, 46, + 47, 48, 54, 54, 4, 1, 51, 46, + 46, 46, 46, 46, 46, 52, 46, 47, + 48, 49, 54, 4, 1, 51, 46, 46, + 6, 46, 46, 46, 52, 46, 67, 68, + 69, 70, 10, 11, 71, 66, 66, 14, + 66, 66, 66, 72, 66, 73, 68, 74, + 70, 10, 11, 71, 66, 66, 66, 66, + 66, 66, 72, 66, 68, 74, 70, 10, + 11, 71, 66, 66, 66, 66, 66, 66, + 72, 66, 75, 66, 66, 66, 76, 77, + 66, 11, 71, 66, 66, 66, 66, 66, + 75, 66, 78, 68, 79, 80, 10, 11, + 71, 66, 66, 13, 66, 66, 66, 72, + 66, 81, 68, 74, 74, 10, 11, 71, + 66, 66, 66, 66, 66, 66, 72, 66, + 68, 74, 74, 10, 11, 71, 66, 66, + 66, 66, 66, 66, 72, 66, 75, 66, + 66, 66, 82, 77, 66, 11, 71, 66, + 66, 66, 66, 66, 75, 66, 71, 66, + 66, 83, 71, 66, 71, 66, 71, 66, + 66, 66, 71, 66, 75, 66, 84, 66, + 82, 82, 66, 11, 71, 66, 66, 66, + 66, 66, 75, 66, 75, 66, 66, 66, + 82, 82, 66, 11, 71, 66, 66, 66, + 66, 66, 75, 66, 85, 86, 87, 87, + 10, 11, 71, 66, 86, 87, 87, 10, + 11, 71, 66, 87, 87, 10, 11, 71, + 66, 88, 89, 89, 10, 11, 71, 66, + 76, 90, 66, 11, 71, 66, 82, 82, + 66, 11, 71, 66, 76, 66, 82, 82, + 66, 11, 71, 66, 82, 90, 66, 11, + 71, 66, 78, 68, 74, 74, 10, 11, + 71, 66, 66, 66, 66, 66, 66, 72, + 66, 78, 68, 79, 74, 10, 11, 71, + 66, 66, 13, 66, 66, 66, 72, 66, + 8, 9, 9, 10, 11, 66, 67, 68, + 74, 70, 10, 11, 71, 66, 66, 66, + 66, 66, 66, 72, 66, 92, 36, 93, + 93, 18, 19, 39, 91, 91, 91, 91, + 91, 91, 43, 91, 36, 93, 93, 18, + 19, 39, 91, 91, 91, 91, 91, 91, + 43, 91, 94, 91, 91, 91, 95, 96, + 91, 19, 39, 91, 91, 91, 91, 91, + 94, 91, 35, 36, 97, 98, 18, 19, + 39, 91, 91, 20, 91, 91, 91, 43, + 91, 94, 91, 91, 91, 99, 96, 91, + 19, 39, 91, 91, 91, 91, 91, 94, + 91, 39, 91, 91, 100, 39, 91, 39, + 91, 39, 91, 91, 91, 39, 91, 94, + 91, 101, 91, 99, 99, 91, 19, 39, + 91, 91, 91, 91, 91, 94, 91, 94, + 91, 91, 91, 99, 99, 91, 19, 39, + 91, 91, 91, 91, 91, 94, 91, 102, + 103, 104, 104, 18, 19, 39, 91, 103, + 104, 104, 18, 19, 39, 91, 104, 104, + 18, 19, 39, 91, 35, 36, 93, 93, + 18, 19, 39, 91, 91, 91, 91, 91, + 91, 43, 91, 105, 106, 106, 18, 19, + 39, 91, 95, 107, 91, 19, 39, 91, + 99, 99, 91, 19, 39, 91, 95, 91, + 99, 99, 91, 19, 39, 91, 99, 107, + 91, 19, 39, 91, 35, 36, 97, 93, + 18, 19, 39, 91, 91, 20, 91, 91, + 91, 43, 91, 16, 17, 17, 18, 19, + 108, 108, 108, 20, 108, 16, 17, 17, + 18, 19, 108, 110, 111, 112, 113, 26, + 27, 114, 109, 109, 28, 109, 109, 109, + 115, 109, 116, 111, 113, 113, 26, 27, + 114, 109, 109, 109, 109, 109, 109, 115, + 109, 111, 113, 113, 26, 27, 114, 109, + 109, 109, 109, 109, 109, 115, 109, 117, + 109, 109, 109, 118, 119, 109, 27, 114, + 109, 109, 109, 109, 109, 117, 109, 110, + 111, 112, 40, 26, 27, 114, 109, 109, + 28, 109, 109, 109, 115, 109, 117, 109, + 109, 109, 120, 119, 109, 27, 114, 109, + 109, 109, 109, 109, 117, 109, 114, 109, + 109, 121, 114, 109, 114, 109, 114, 109, + 109, 109, 114, 109, 117, 109, 122, 109, + 120, 120, 109, 27, 114, 109, 109, 109, + 109, 109, 117, 109, 117, 109, 109, 109, + 120, 120, 109, 27, 114, 109, 109, 109, + 109, 109, 117, 109, 123, 124, 125, 125, + 26, 27, 114, 109, 124, 125, 125, 26, + 27, 114, 109, 125, 125, 26, 27, 114, + 109, 110, 111, 113, 113, 26, 27, 114, + 109, 109, 109, 109, 109, 109, 115, 109, + 126, 127, 127, 26, 27, 114, 109, 118, + 128, 109, 27, 114, 109, 120, 120, 109, + 27, 114, 109, 118, 109, 120, 120, 109, + 27, 114, 109, 120, 128, 109, 27, 114, + 109, 33, 34, 35, 36, 97, 93, 18, + 19, 39, 40, 40, 20, 91, 91, 33, + 43, 91, 47, 129, 49, 50, 4, 1, + 51, 46, 46, 6, 46, 46, 46, 52, + 46, 33, 34, 35, 36, 130, 131, 18, + 132, 133, 46, 40, 20, 46, 46, 33, + 43, 46, 16, 134, 134, 18, 132, 51, + 46, 46, 20, 46, 133, 46, 46, 135, + 133, 46, 133, 46, 133, 46, 46, 46, + 133, 46, 33, 46, 59, 16, 134, 134, + 18, 132, 51, 46, 46, 46, 46, 46, + 33, 46, 137, 136, 138, 138, 136, 31, + 139, 136, 138, 138, 136, 31, 139, 136, + 139, 136, 136, 140, 139, 136, 139, 136, + 139, 136, 136, 136, 139, 136, 33, 108, + 108, 108, 108, 108, 108, 108, 108, 40, + 108, 108, 108, 108, 33, 108, 0 +}; + +static const unsigned char _indic_syllable_machine_trans_targs[] = { + 27, 33, 38, 2, 39, 45, 46, 27, + 55, 8, 61, 56, 68, 69, 72, 27, + 77, 15, 83, 78, 86, 27, 91, 27, + 100, 21, 106, 101, 109, 114, 27, 125, + 27, 28, 48, 73, 75, 93, 94, 79, + 95, 115, 116, 87, 123, 128, 27, 29, + 31, 5, 47, 34, 42, 30, 1, 32, + 36, 0, 35, 37, 40, 41, 3, 43, + 4, 44, 27, 49, 51, 12, 71, 57, + 64, 50, 6, 52, 66, 59, 53, 11, + 70, 54, 7, 58, 60, 62, 63, 9, + 65, 10, 67, 27, 74, 17, 76, 89, + 81, 13, 92, 14, 80, 82, 84, 85, + 16, 88, 18, 90, 27, 27, 96, 98, + 19, 23, 102, 110, 97, 99, 112, 104, + 20, 103, 105, 107, 108, 22, 111, 24, + 113, 117, 118, 122, 119, 120, 25, 121, + 27, 124, 26, 126, 127 +}; + +static const char _indic_syllable_machine_trans_actions[] = { + 1, 0, 2, 0, 2, 2, 2, 3, + 2, 0, 2, 0, 2, 2, 2, 4, + 2, 0, 5, 0, 5, 6, 2, 7, + 2, 0, 2, 0, 2, 2, 8, 0, + 11, 2, 2, 5, 0, 12, 12, 0, + 2, 5, 2, 5, 2, 0, 13, 2, + 0, 0, 2, 0, 2, 2, 0, 2, + 2, 0, 0, 2, 2, 2, 0, 0, + 0, 2, 14, 2, 0, 0, 2, 0, + 2, 2, 0, 2, 2, 2, 2, 0, + 2, 2, 0, 0, 2, 2, 2, 0, + 0, 0, 2, 15, 5, 0, 5, 2, + 2, 0, 5, 0, 0, 2, 5, 5, + 0, 0, 0, 2, 16, 17, 2, 0, + 0, 0, 0, 2, 2, 2, 2, 2, + 0, 0, 2, 2, 2, 0, 0, 0, + 2, 0, 18, 18, 0, 0, 0, 0, + 19, 2, 0, 0, 0 +}; + +static const char _indic_syllable_machine_to_state_actions[] = { + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 9, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0 +}; + +static const char _indic_syllable_machine_from_state_actions[] = { + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 10, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0 +}; + +static const short _indic_syllable_machine_eof_trans[] = { + 1, 1, 1, 1, 1, 1, 8, 8, + 8, 8, 8, 8, 8, 16, 16, 22, + 16, 16, 16, 24, 24, 24, 24, 24, + 24, 1, 31, 0, 47, 47, 47, 47, + 47, 47, 47, 47, 47, 47, 47, 47, + 47, 47, 47, 47, 47, 47, 47, 47, + 67, 67, 67, 67, 67, 67, 67, 67, + 67, 67, 67, 67, 67, 67, 67, 67, + 67, 67, 67, 67, 67, 67, 67, 67, + 67, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 92, 92, 109, 109, 110, + 110, 110, 110, 110, 110, 110, 110, 110, + 110, 110, 110, 110, 110, 110, 110, 110, + 110, 110, 110, 92, 47, 47, 47, 47, + 47, 47, 47, 137, 137, 137, 137, 137, + 109 +}; + +static const int indic_syllable_machine_start = 27; +static const int indic_syllable_machine_first_final = 27; +static const int indic_syllable_machine_error = -1; + +static const int indic_syllable_machine_en_main = 27; + + +#line 58 "hb-ot-shaper-indic-machine.rl" + + + +#line 117 "hb-ot-shaper-indic-machine.rl" + + +#define found_syllable(syllable_type) \ + HB_STMT_START { \ + if (0) fprintf (stderr, "syllable %d..%d %s\n", ts, te, #syllable_type); \ + for (unsigned int i = ts; i < te; i++) \ + info[i].syllable() = (syllable_serial << 4) | syllable_type; \ + syllable_serial++; \ + if (unlikely (syllable_serial == 16)) syllable_serial = 1; \ + } HB_STMT_END + +inline void +find_syllables_indic (hb_buffer_t *buffer) +{ + unsigned int p, pe, eof, ts, te, act; + int cs; + hb_glyph_info_t *info = buffer->info; + +#line 426 "hb-ot-shaper-indic-machine.hh" + { + cs = indic_syllable_machine_start; + ts = 0; + te = 0; + act = 0; + } + +#line 137 "hb-ot-shaper-indic-machine.rl" + + + p = 0; + pe = eof = buffer->len; + + unsigned int syllable_serial = 1; + +#line 442 "hb-ot-shaper-indic-machine.hh" + { + int _slen; + int _trans; + const unsigned char *_keys; + const unsigned char *_inds; + if ( p == pe ) + goto _test_eof; +_resume: + switch ( _indic_syllable_machine_from_state_actions[cs] ) { + case 10: +#line 1 "NONE" + {ts = p;} + break; +#line 456 "hb-ot-shaper-indic-machine.hh" + } + + _keys = _indic_syllable_machine_trans_keys + (cs<<1); + _inds = _indic_syllable_machine_indicies + _indic_syllable_machine_index_offsets[cs]; + + _slen = _indic_syllable_machine_key_spans[cs]; + _trans = _inds[ _slen > 0 && _keys[0] <=( info[p].indic_category()) && + ( info[p].indic_category()) <= _keys[1] ? + ( info[p].indic_category()) - _keys[0] : _slen ]; + +_eof_trans: + cs = _indic_syllable_machine_trans_targs[_trans]; + + if ( _indic_syllable_machine_trans_actions[_trans] == 0 ) + goto _again; + + switch ( _indic_syllable_machine_trans_actions[_trans] ) { + case 2: +#line 1 "NONE" + {te = p+1;} + break; + case 11: +#line 113 "hb-ot-shaper-indic-machine.rl" + {te = p+1;{ found_syllable (indic_non_indic_cluster); }} + break; + case 13: +#line 108 "hb-ot-shaper-indic-machine.rl" + {te = p;p--;{ found_syllable (indic_consonant_syllable); }} + break; + case 14: +#line 109 "hb-ot-shaper-indic-machine.rl" + {te = p;p--;{ found_syllable (indic_vowel_syllable); }} + break; + case 17: +#line 110 "hb-ot-shaper-indic-machine.rl" + {te = p;p--;{ found_syllable (indic_standalone_cluster); }} + break; + case 19: +#line 111 "hb-ot-shaper-indic-machine.rl" + {te = p;p--;{ found_syllable (indic_symbol_cluster); }} + break; + case 15: +#line 112 "hb-ot-shaper-indic-machine.rl" + {te = p;p--;{ found_syllable (indic_broken_cluster); buffer->scratch_flags |= HB_BUFFER_SCRATCH_FLAG_HAS_BROKEN_SYLLABLE; }} + break; + case 16: +#line 113 "hb-ot-shaper-indic-machine.rl" + {te = p;p--;{ found_syllable (indic_non_indic_cluster); }} + break; + case 1: +#line 108 "hb-ot-shaper-indic-machine.rl" + {{p = ((te))-1;}{ found_syllable (indic_consonant_syllable); }} + break; + case 3: +#line 109 "hb-ot-shaper-indic-machine.rl" + {{p = ((te))-1;}{ found_syllable (indic_vowel_syllable); }} + break; + case 7: +#line 110 "hb-ot-shaper-indic-machine.rl" + {{p = ((te))-1;}{ found_syllable (indic_standalone_cluster); }} + break; + case 8: +#line 111 "hb-ot-shaper-indic-machine.rl" + {{p = ((te))-1;}{ found_syllable (indic_symbol_cluster); }} + break; + case 4: +#line 112 "hb-ot-shaper-indic-machine.rl" + {{p = ((te))-1;}{ found_syllable (indic_broken_cluster); buffer->scratch_flags |= HB_BUFFER_SCRATCH_FLAG_HAS_BROKEN_SYLLABLE; }} + break; + case 6: +#line 1 "NONE" + { switch( act ) { + case 1: + {{p = ((te))-1;} found_syllable (indic_consonant_syllable); } + break; + case 5: + {{p = ((te))-1;} found_syllable (indic_broken_cluster); buffer->scratch_flags |= HB_BUFFER_SCRATCH_FLAG_HAS_BROKEN_SYLLABLE; } + break; + case 6: + {{p = ((te))-1;} found_syllable (indic_non_indic_cluster); } + break; + } + } + break; + case 18: +#line 1 "NONE" + {te = p+1;} +#line 108 "hb-ot-shaper-indic-machine.rl" + {act = 1;} + break; + case 5: +#line 1 "NONE" + {te = p+1;} +#line 112 "hb-ot-shaper-indic-machine.rl" + {act = 5;} + break; + case 12: +#line 1 "NONE" + {te = p+1;} +#line 113 "hb-ot-shaper-indic-machine.rl" + {act = 6;} + break; +#line 559 "hb-ot-shaper-indic-machine.hh" + } + +_again: + switch ( _indic_syllable_machine_to_state_actions[cs] ) { + case 9: +#line 1 "NONE" + {ts = 0;} + break; +#line 568 "hb-ot-shaper-indic-machine.hh" + } + + if ( ++p != pe ) + goto _resume; + _test_eof: {} + if ( p == eof ) + { + if ( _indic_syllable_machine_eof_trans[cs] > 0 ) { + _trans = _indic_syllable_machine_eof_trans[cs] - 1; + goto _eof_trans; + } + } + + } + +#line 145 "hb-ot-shaper-indic-machine.rl" + +} + +#undef found_syllable + +#endif /* HB_OT_SHAPER_INDIC_MACHINE_HH */ diff --git a/thirdparty/harfbuzz/src/hb-ot-shaper-indic-table.cc b/thirdparty/harfbuzz/src/hb-ot-shaper-indic-table.cc new file mode 100644 index 0000000000..8994f3ca59 --- /dev/null +++ b/thirdparty/harfbuzz/src/hb-ot-shaper-indic-table.cc @@ -0,0 +1,560 @@ +/* == Start of generated table == */ +/* + * The following table is generated by running: + * + * ./gen-indic-table.py IndicSyllabicCategory.txt IndicPositionalCategory.txt Blocks.txt + * + * on files with these headers: + * + * # IndicSyllabicCategory-14.0.0.txt + * # Date: 2021-05-22, 01:01:00 GMT [KW, RP] + * # IndicPositionalCategory-14.0.0.txt + * # Date: 2021-05-22, 01:01:00 GMT [KW, RP] + * # Blocks-14.0.0.txt + * # Date: 2021-01-22, 23:29:00 GMT [KW] + */ + +#include "hb.hh" + +#ifndef HB_NO_OT_SHAPE + +#include "hb-ot-shaper-indic.hh" + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-macros" + +#include "hb-ot-shaper-indic-machine.hh" +#include "hb-ot-shaper-khmer-machine.hh" +#include "hb-ot-shaper-myanmar-machine.hh" + +/* indic */ +#define OT_X I_Cat(X) +#define OT_C I_Cat(C) +#define OT_V I_Cat(V) +#define OT_N I_Cat(N) +#define OT_H I_Cat(H) +#define OT_ZWNJ I_Cat(ZWNJ) +#define OT_ZWJ I_Cat(ZWJ) +#define OT_M I_Cat(M) +#define OT_SM I_Cat(SM) +#define OT_A I_Cat(A) +#define OT_VD I_Cat(VD) +#define OT_PLACEHOLDER I_Cat(PLACEHOLDER) +#define OT_DOTTEDCIRCLE I_Cat(DOTTEDCIRCLE) +#define OT_RS I_Cat(RS) +#define OT_Repha I_Cat(Repha) +#define OT_Ra I_Cat(Ra) +#define OT_CM I_Cat(CM) +#define OT_Symbol I_Cat(Symbol) +#define OT_CS I_Cat(CS) +/* khmer */ +#define OT_VAbv K_Cat(VAbv) +#define OT_VBlw K_Cat(VBlw) +#define OT_VPre K_Cat(VPre) +#define OT_VPst K_Cat(VPst) +#define OT_Robatic K_Cat(Robatic) +#define OT_Xgroup K_Cat(Xgroup) +#define OT_Ygroup K_Cat(Ygroup) +/* myanmar */ +static_assert (OT_VAbv == M_Cat(VAbv), ""); +static_assert (OT_VBlw == M_Cat(VBlw), ""); +static_assert (OT_VPre == M_Cat(VPre), ""); +static_assert (OT_VPst == M_Cat(VPst), ""); +#define OT_IV M_Cat(IV) +#define OT_As M_Cat(As) +#define OT_DB M_Cat(DB) +#define OT_GB M_Cat(GB) +#define OT_MH M_Cat(MH) +#define OT_MR M_Cat(MR) +#define OT_MW M_Cat(MW) +#define OT_MY M_Cat(MY) +#define OT_PT M_Cat(PT) +#define OT_VS M_Cat(VS) +#define OT_ML M_Cat(ML) + + +#define _OT_A OT_A /* 53 chars; A */ +#define _OT_As OT_As /* 1 chars; As */ +#define _OT_C OT_C /* 478 chars; C */ +#define _OT_CM OT_CM /* 1 chars; CM */ +#define _OT_CS OT_CS /* 2 chars; CS */ +#define _OT_DC OT_DOTTEDCIRCLE /* 1 chars; DOTTEDCIRCLE */ +#define _OT_H OT_H /* 11 chars; H */ +#define _OT_M OT_M /* 143 chars; M */ +#define _OT_MH OT_MH /* 1 chars; MH */ +#define _OT_ML OT_ML /* 1 chars; ML */ +#define _OT_MR OT_MR /* 1 chars; MR */ +#define _OT_MW OT_MW /* 2 chars; MW */ +#define _OT_MY OT_MY /* 3 chars; MY */ +#define _OT_N OT_N /* 17 chars; N */ +#define _OT_GB OT_PLACEHOLDER /* 165 chars; PLACEHOLDER */ +#define _OT_PT OT_PT /* 8 chars; PT */ +#define _OT_R OT_Ra /* 14 chars; Ra */ +#define _OT_Rf OT_Repha /* 1 chars; Repha */ +#define _OT_Rt OT_Robatic /* 3 chars; Robatic */ +#define _OT_SM OT_SM /* 55 chars; SM */ +#define _OT_S OT_Symbol /* 22 chars; Symbol */ +#define _OT_V OT_V /* 172 chars; V */ +#define _OT_VA OT_VAbv /* 18 chars; VAbv */ +#define _OT_VB OT_VBlw /* 7 chars; VBlw */ +#define _OT_VL OT_VPre /* 5 chars; VPre */ +#define _OT_VR OT_VPst /* 13 chars; VPst */ +#define _OT_VS OT_VS /* 16 chars; VS */ +#define _OT_X OT_X /* 2 chars; X */ +#define _OT_Xg OT_Xgroup /* 7 chars; Xgroup */ +#define _OT_Yg OT_Ygroup /* 4 chars; Ygroup */ +#define _OT_ZWJ OT_ZWJ /* 1 chars; ZWJ */ +#define _OT_ZWNJ OT_ZWNJ /* 1 chars; ZWNJ */ + +#define _POS_T POS_ABOVE_C /* 22 chars; ABOVE_C */ +#define _POS_A POS_AFTER_MAIN /* 3 chars; AFTER_MAIN */ +#define _POS_AP POS_AFTER_POST /* 50 chars; AFTER_POST */ +#define _POS_AS POS_AFTER_SUB /* 51 chars; AFTER_SUB */ +#define _POS_C POS_BASE_C /* 833 chars; BASE_C */ +#define _POS_BS POS_BEFORE_SUB /* 25 chars; BEFORE_SUB */ +#define _POS_B POS_BELOW_C /* 13 chars; BELOW_C */ +#define _POS_X POS_END /* 71 chars; END */ +#define _POS_R POS_POST_C /* 13 chars; POST_C */ +#define _POS_L POS_PRE_C /* 5 chars; PRE_C */ +#define _POS_LM POS_PRE_M /* 14 chars; PRE_M */ +#define _POS_SM POS_SMVD /* 129 chars; SMVD */ + +#pragma GCC diagnostic pop + +#define INDIC_COMBINE_CATEGORIES(S,M) ((S) | ((M) << 8)) + +#define _(S,M) INDIC_COMBINE_CATEGORIES (_OT_##S, _POS_##M) + + +static const uint16_t indic_table[] = { + + +#define indic_offset_0x0028u 0 + + + /* Basic Latin */ + + /* 0028 */ _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(GB,C), _(X,X), _(X,X), + /* 0030 */ _(GB,C), _(GB,C), _(GB,C), _(GB,C), _(GB,C), _(GB,C), _(GB,C), _(GB,C), + /* 0038 */ _(GB,C), _(GB,C), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), + +#define indic_offset_0x00b0u 24 + + + /* Latin-1 Supplement */ + + /* 00B0 */ _(X,X), _(X,X),_(SM,SM),_(SM,SM), _(X,X), _(X,X), _(X,X), _(X,X), + /* 00B8 */ _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), + /* 00C0 */ _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), + /* 00C8 */ _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), + /* 00D0 */ _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(GB,C), + +#define indic_offset_0x0900u 64 + + + /* Devanagari */ + + /* 0900 */_(SM,SM),_(SM,SM),_(SM,SM),_(SM,SM), _(V,C), _(V,C), _(V,C), _(V,C), + /* 0908 */ _(V,C), _(V,C), _(V,C), _(V,C), _(V,C), _(V,C), _(V,C), _(V,C), + /* 0910 */ _(V,C), _(V,C), _(V,C), _(V,C), _(V,C), _(C,C), _(C,C), _(C,C), + /* 0918 */ _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), + /* 0920 */ _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), + /* 0928 */ _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), + /* 0930 */ _(R,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), + /* 0938 */ _(C,C), _(C,C), _(M,AS), _(M,AS), _(N,X), _(S,SM), _(M,AS), _(M,LM), + /* 0940 */ _(M,AS), _(M,AS), _(M,AS), _(M,AS), _(M,AS), _(M,AS), _(M,AS), _(M,AS), + /* 0948 */ _(M,AS), _(M,AS), _(M,AS), _(M,AS), _(M,AS), _(H,B), _(M,LM), _(M,AS), + /* 0950 */ _(X,X), _(A,SM), _(A,SM),_(SM,SM),_(SM,SM), _(M,AS), _(M,AS), _(M,AS), + /* 0958 */ _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), + /* 0960 */ _(V,C), _(V,C), _(M,AS), _(M,AS), _(X,X), _(X,X), _(GB,C), _(GB,C), + /* 0968 */ _(GB,C), _(GB,C), _(GB,C), _(GB,C), _(GB,C), _(GB,C), _(GB,C), _(GB,C), + /* 0970 */ _(X,X), _(X,X), _(V,C), _(V,C), _(V,C), _(V,C), _(V,C), _(V,C), + /* 0978 */ _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), + + /* Bengali */ + + /* 0980 */ _(GB,C),_(SM,SM),_(SM,SM),_(SM,SM), _(X,X), _(V,C), _(V,C), _(V,C), + /* 0988 */ _(V,C), _(V,C), _(V,C), _(V,C), _(V,C), _(X,X), _(X,X), _(V,C), + /* 0990 */ _(V,C), _(X,X), _(X,X), _(V,C), _(V,C), _(C,C), _(C,C), _(C,C), + /* 0998 */ _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), + /* 09A0 */ _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), + /* 09A8 */ _(C,C), _(X,X), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), + /* 09B0 */ _(R,C), _(X,X), _(C,C), _(X,X), _(X,X), _(X,X), _(C,C), _(C,C), + /* 09B8 */ _(C,C), _(C,C), _(X,X), _(X,X), _(N,X), _(S,SM), _(M,AP), _(M,LM), + /* 09C0 */ _(M,AP), _(M,AS), _(M,AS), _(M,AS), _(M,AS), _(X,X), _(X,X), _(M,LM), + /* 09C8 */ _(M,LM), _(X,X), _(X,X), _(M,AP), _(M,AP), _(H,B), _(C,C), _(X,X), + /* 09D0 */ _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(M,AP), + /* 09D8 */ _(X,X), _(X,X), _(X,X), _(X,X), _(C,C), _(C,C), _(X,X), _(C,C), + /* 09E0 */ _(V,C), _(V,C), _(M,AS), _(M,AS), _(X,X), _(X,X), _(GB,C), _(GB,C), + /* 09E8 */ _(GB,C), _(GB,C), _(GB,C), _(GB,C), _(GB,C), _(GB,C), _(GB,C), _(GB,C), + /* 09F0 */ _(R,C), _(C,C), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), + /* 09F8 */ _(X,X), _(X,X), _(X,X), _(X,X), _(GB,C), _(X,X),_(SM,SM), _(X,X), + + /* Gurmukhi */ + + /* 0A00 */ _(X,X),_(SM,SM),_(SM,SM),_(SM,SM), _(X,X), _(V,C), _(V,C), _(V,C), + /* 0A08 */ _(V,C), _(V,C), _(V,C), _(X,X), _(X,X), _(X,X), _(X,X), _(V,C), + /* 0A10 */ _(V,C), _(X,X), _(X,X), _(V,C), _(V,C), _(C,C), _(C,C), _(C,C), + /* 0A18 */ _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), + /* 0A20 */ _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), + /* 0A28 */ _(C,C), _(X,X), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), + /* 0A30 */ _(R,C), _(X,X), _(C,C), _(C,C), _(X,X), _(C,C), _(C,C), _(X,X), + /* 0A38 */ _(C,C), _(C,C), _(X,X), _(X,X), _(N,X), _(X,X), _(M,AP), _(M,LM), + /* 0A40 */ _(M,AP), _(M,AP), _(M,AP), _(X,X), _(X,X), _(X,X), _(X,X), _(M,AP), + /* 0A48 */ _(M,AP), _(X,X), _(X,X), _(M,AP), _(M,AP), _(H,B), _(X,X), _(X,X), + /* 0A50 */ _(X,X), _(M,B), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), + /* 0A58 */ _(X,X), _(C,C), _(C,C), _(C,C), _(C,C), _(X,X), _(C,C), _(X,X), + /* 0A60 */ _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(GB,C), _(GB,C), + /* 0A68 */ _(GB,C), _(GB,C), _(GB,C), _(GB,C), _(GB,C), _(GB,C), _(GB,C), _(GB,C), + /* 0A70 */_(SM,SM),_(SM,SM), _(C,C), _(C,C), _(X,X), _(CM,C), _(X,X), _(X,X), + /* 0A78 */ _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), + + /* Gujarati */ + + /* 0A80 */ _(X,X),_(SM,SM),_(SM,SM),_(SM,SM), _(X,X), _(V,C), _(V,C), _(V,C), + /* 0A88 */ _(V,C), _(V,C), _(V,C), _(V,C), _(V,C), _(V,C), _(X,X), _(V,C), + /* 0A90 */ _(V,C), _(V,C), _(X,X), _(V,C), _(V,C), _(C,C), _(C,C), _(C,C), + /* 0A98 */ _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), + /* 0AA0 */ _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), + /* 0AA8 */ _(C,C), _(X,X), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), + /* 0AB0 */ _(R,C), _(X,X), _(C,C), _(C,C), _(X,X), _(C,C), _(C,C), _(C,C), + /* 0AB8 */ _(C,C), _(C,C), _(X,X), _(X,X), _(N,X), _(S,SM), _(M,AP), _(M,LM), + /* 0AC0 */ _(M,AP), _(M,AP), _(M,AP), _(M,AP), _(M,AP), _(M,AS), _(X,X), _(M,AS), + /* 0AC8 */ _(M,AS), _(M,AP), _(X,X), _(M,AP), _(M,AP), _(H,B), _(X,X), _(X,X), + /* 0AD0 */ _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), + /* 0AD8 */ _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), + /* 0AE0 */ _(V,C), _(V,C), _(M,AP), _(M,AP), _(X,X), _(X,X), _(GB,C), _(GB,C), + /* 0AE8 */ _(GB,C), _(GB,C), _(GB,C), _(GB,C), _(GB,C), _(GB,C), _(GB,C), _(GB,C), + /* 0AF0 */ _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), + /* 0AF8 */ _(X,X), _(C,C), _(A,SM), _(N,X), _(A,SM), _(N,X), _(N,X), _(N,X), + + /* Oriya */ + + /* 0B00 */ _(X,X),_(SM,BS),_(SM,SM),_(SM,SM), _(X,X), _(V,C), _(V,C), _(V,C), + /* 0B08 */ _(V,C), _(V,C), _(V,C), _(V,C), _(V,C), _(X,X), _(X,X), _(V,C), + /* 0B10 */ _(V,C), _(X,X), _(X,X), _(V,C), _(V,C), _(C,C), _(C,C), _(C,C), + /* 0B18 */ _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), + /* 0B20 */ _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), + /* 0B28 */ _(C,C), _(X,X), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), + /* 0B30 */ _(R,C), _(X,X), _(C,C), _(C,C), _(X,X), _(C,C), _(C,C), _(C,C), + /* 0B38 */ _(C,C), _(C,C), _(X,X), _(X,X), _(N,X), _(S,SM), _(M,AP), _(M,A), + /* 0B40 */ _(M,AP), _(M,AS), _(M,AS), _(M,AS), _(M,AS), _(X,X), _(X,X), _(M,LM), + /* 0B48 */ _(M,A), _(X,X), _(X,X), _(M,AP), _(M,AP), _(H,B), _(X,X), _(X,X), + /* 0B50 */ _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(N,X), _(M,A), _(M,AP), + /* 0B58 */ _(X,X), _(X,X), _(X,X), _(X,X), _(C,C), _(C,C), _(X,X), _(C,C), + /* 0B60 */ _(V,C), _(V,C), _(M,AS), _(M,AS), _(X,X), _(X,X), _(GB,C), _(GB,C), + /* 0B68 */ _(GB,C), _(GB,C), _(GB,C), _(GB,C), _(GB,C), _(GB,C), _(GB,C), _(GB,C), + /* 0B70 */ _(X,X), _(C,C), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), + /* 0B78 */ _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), + + /* Tamil */ + + /* 0B80 */ _(X,X), _(X,X),_(SM,SM), _(X,X), _(X,X), _(V,C), _(V,C), _(V,C), + /* 0B88 */ _(V,C), _(V,C), _(V,C), _(X,X), _(X,X), _(X,X), _(V,C), _(V,C), + /* 0B90 */ _(V,C), _(X,X), _(V,C), _(V,C), _(V,C), _(C,C), _(X,X), _(X,X), + /* 0B98 */ _(X,X), _(C,C), _(C,C), _(X,X), _(C,C), _(X,X), _(C,C), _(C,C), + /* 0BA0 */ _(X,X), _(X,X), _(X,X), _(C,C), _(C,C), _(X,X), _(X,X), _(X,X), + /* 0BA8 */ _(C,C), _(C,C), _(C,C), _(X,X), _(X,X), _(X,X), _(C,C), _(C,C), + /* 0BB0 */ _(R,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), + /* 0BB8 */ _(C,C), _(C,C), _(X,X), _(X,X), _(X,X), _(X,X), _(M,AP), _(M,AP), + /* 0BC0 */ _(M,AS), _(M,AP), _(M,AP), _(X,X), _(X,X), _(X,X), _(M,LM), _(M,LM), + /* 0BC8 */ _(M,LM), _(X,X), _(M,AP), _(M,AP), _(M,AP), _(H,T), _(X,X), _(X,X), + /* 0BD0 */ _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(M,AP), + /* 0BD8 */ _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), + /* 0BE0 */ _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(GB,C), _(GB,C), + /* 0BE8 */ _(GB,C), _(GB,C), _(GB,C), _(GB,C), _(GB,C), _(GB,C), _(GB,C), _(GB,C), + /* 0BF0 */ _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), + /* 0BF8 */ _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), + + /* Telugu */ + + /* 0C00 */_(SM,SM),_(SM,SM),_(SM,SM),_(SM,SM),_(SM,SM), _(V,C), _(V,C), _(V,C), + /* 0C08 */ _(V,C), _(V,C), _(V,C), _(V,C), _(V,C), _(X,X), _(V,C), _(V,C), + /* 0C10 */ _(V,C), _(X,X), _(V,C), _(V,C), _(V,C), _(C,C), _(C,C), _(C,C), + /* 0C18 */ _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), + /* 0C20 */ _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), + /* 0C28 */ _(C,C), _(X,X), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), + /* 0C30 */ _(R,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), + /* 0C38 */ _(C,C), _(C,C), _(X,X), _(X,X), _(N,X), _(S,SM), _(M,BS), _(M,BS), + /* 0C40 */ _(M,BS), _(M,BS), _(M,BS), _(M,AS), _(M,AS), _(X,X), _(M,BS), _(M,BS), + /* 0C48 */ _(M,BS), _(X,X), _(M,BS), _(M,BS), _(M,BS), _(H,T), _(X,X), _(X,X), + /* 0C50 */ _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(M,BS), _(M,BS), _(X,X), + /* 0C58 */ _(C,C), _(C,C), _(C,C), _(X,X), _(X,X), _(C,C), _(X,X), _(X,X), + /* 0C60 */ _(V,C), _(V,C), _(M,BS), _(M,BS), _(X,X), _(X,X), _(GB,C), _(GB,C), + /* 0C68 */ _(GB,C), _(GB,C), _(GB,C), _(GB,C), _(GB,C), _(GB,C), _(GB,C), _(GB,C), + /* 0C70 */ _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), + /* 0C78 */ _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), + + /* Kannada */ + + /* 0C80 */ _(GB,C),_(SM,SM),_(SM,SM),_(SM,SM), _(X,X), _(V,C), _(V,C), _(V,C), + /* 0C88 */ _(V,C), _(V,C), _(V,C), _(V,C), _(V,C), _(X,X), _(V,C), _(V,C), + /* 0C90 */ _(V,C), _(X,X), _(V,C), _(V,C), _(V,C), _(C,C), _(C,C), _(C,C), + /* 0C98 */ _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), + /* 0CA0 */ _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), + /* 0CA8 */ _(C,C), _(X,X), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), + /* 0CB0 */ _(R,C), _(C,C), _(C,C), _(C,C), _(X,X), _(C,C), _(C,C), _(C,C), + /* 0CB8 */ _(C,C), _(C,C), _(X,X), _(X,X), _(N,X), _(S,SM), _(M,BS), _(M,BS), + /* 0CC0 */ _(M,BS), _(M,BS), _(M,BS), _(M,AS), _(M,AS), _(X,X), _(M,BS), _(M,AS), + /* 0CC8 */ _(M,AS), _(X,X), _(M,AS), _(M,AS), _(M,BS), _(H,T), _(X,X), _(X,X), + /* 0CD0 */ _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(M,AS), _(M,AS), _(X,X), + /* 0CD8 */ _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(C,C), _(C,C), _(X,X), + /* 0CE0 */ _(V,C), _(V,C), _(M,BS), _(M,BS), _(X,X), _(X,X), _(GB,C), _(GB,C), + /* 0CE8 */ _(GB,C), _(GB,C), _(GB,C), _(GB,C), _(GB,C), _(GB,C), _(GB,C), _(GB,C), + /* 0CF0 */ _(X,X), _(CS,C), _(CS,C), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), + /* 0CF8 */ _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), + + /* Malayalam */ + + /* 0D00 */_(SM,SM),_(SM,SM),_(SM,SM),_(SM,SM), _(GB,C), _(V,C), _(V,C), _(V,C), + /* 0D08 */ _(V,C), _(V,C), _(V,C), _(V,C), _(V,C), _(X,X), _(V,C), _(V,C), + /* 0D10 */ _(V,C), _(X,X), _(V,C), _(V,C), _(V,C), _(C,C), _(C,C), _(C,C), + /* 0D18 */ _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), + /* 0D20 */ _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), + /* 0D28 */ _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), + /* 0D30 */ _(R,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), + /* 0D38 */ _(C,C), _(C,C), _(C,C), _(M,AS), _(M,AS), _(S,SM), _(M,AP), _(M,AP), + /* 0D40 */ _(M,AP), _(M,AP), _(M,AP), _(M,AP), _(M,AP), _(X,X), _(M,LM), _(M,LM), + /* 0D48 */ _(M,LM), _(X,X), _(M,AP), _(M,AP), _(M,AP), _(H,T), _(Rf,X), _(X,X), + /* 0D50 */ _(X,X), _(X,X), _(X,X), _(X,X), _(C,C), _(C,C), _(C,C), _(M,AP), + /* 0D58 */ _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(V,C), + /* 0D60 */ _(V,C), _(V,C), _(M,AP), _(M,AP), _(X,X), _(X,X), _(GB,C), _(GB,C), + /* 0D68 */ _(GB,C), _(GB,C), _(GB,C), _(GB,C), _(GB,C), _(GB,C), _(GB,C), _(GB,C), + /* 0D70 */ _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), + /* 0D78 */ _(X,X), _(X,X), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), + +#define indic_offset_0x1000u 1216 + + + /* Myanmar */ + + /* 1000 */ _(C,C), _(C,C), _(C,C), _(C,C), _(R,C), _(C,C), _(C,C), _(C,C), + /* 1008 */ _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), + /* 1010 */ _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), + /* 1018 */ _(C,C), _(C,C), _(C,C), _(R,C), _(C,C), _(C,C), _(C,C), _(C,C), + /* 1020 */ _(C,C), _(V,C), _(V,C), _(V,C), _(V,C), _(V,C), _(V,C), _(V,C), + /* 1028 */ _(V,C), _(V,C), _(V,C), _(VR,R), _(VR,R), _(VA,T), _(VA,T), _(VB,B), + /* 1030 */ _(VB,B), _(VL,L), _(A,SM), _(VA,T), _(VA,T), _(VA,T), _(A,SM), _(N,X), + /* 1038 */_(SM,SM), _(H,X), _(As,X), _(MY,X), _(MR,X), _(MW,X), _(MH,X), _(C,C), + /* 1040 */ _(GB,C), _(GB,C), _(GB,C), _(GB,C), _(GB,C), _(GB,C), _(GB,C), _(GB,C), + /* 1048 */ _(GB,C), _(GB,C), _(GB,C), _(GB,C), _(X,X), _(X,X), _(C,C), _(X,X), + /* 1050 */ _(C,C), _(C,C), _(V,C), _(V,C), _(V,C), _(V,C), _(VR,R), _(VR,R), + /* 1058 */ _(VB,B), _(VB,B), _(R,C), _(C,C), _(C,C), _(C,C), _(MY,X), _(MY,X), + /* 1060 */ _(ML,X), _(C,C), _(VR,R), _(PT,X), _(PT,X), _(C,C), _(C,C), _(VR,R), + /* 1068 */ _(VR,R), _(PT,X), _(PT,X), _(PT,X), _(PT,X), _(PT,X), _(C,C), _(C,C), + /* 1070 */ _(C,C), _(VA,T), _(VA,T), _(VA,T), _(VA,T), _(C,C), _(C,C), _(C,C), + /* 1078 */ _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), + /* 1080 */ _(C,C), _(C,C), _(MW,X), _(VR,R), _(VL,L), _(VA,T), _(VA,T),_(SM,SM), + /* 1088 */_(SM,SM),_(SM,SM),_(SM,SM),_(SM,SM),_(SM,SM),_(SM,SM), _(C,C),_(SM,SM), + /* 1090 */ _(GB,C), _(GB,C), _(GB,C), _(GB,C), _(GB,C), _(GB,C), _(GB,C), _(GB,C), + /* 1098 */ _(GB,C), _(GB,C),_(SM,SM),_(SM,SM),_(SM,SM), _(VA,T), _(X,X), _(X,X), + +#define indic_offset_0x1780u 1376 + + + /* Khmer */ + + /* 1780 */ _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), + /* 1788 */ _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), + /* 1790 */ _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), + /* 1798 */ _(C,C), _(C,C), _(R,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), + /* 17A0 */ _(C,C), _(C,C), _(C,C), _(V,C), _(V,C), _(V,C), _(V,C), _(V,C), + /* 17A8 */ _(V,C), _(V,C), _(V,C), _(V,C), _(V,C), _(V,C), _(V,C), _(V,C), + /* 17B0 */ _(V,C), _(V,C), _(V,C), _(V,C), _(X,X), _(X,X), _(VR,R), _(VA,T), + /* 17B8 */ _(VA,T), _(VA,T), _(VA,T), _(VB,B), _(VB,B), _(VB,B), _(VA,T), _(VR,R), + /* 17C0 */ _(VR,R), _(VL,L), _(VL,L), _(VL,L), _(VR,R), _(VR,R), _(Xg,X), _(Yg,X), + /* 17C8 */ _(Yg,X), _(Rt,X), _(Rt,X), _(Xg,X), _(Rt,X), _(Xg,X), _(Xg,X), _(Xg,X), + /* 17D0 */ _(Xg,X), _(Xg,X), _(H,X), _(Yg,X), _(X,X), _(X,X), _(X,X), _(X,X), + /* 17D8 */ _(X,X), _(GB,C), _(X,X), _(X,X), _(S,SM), _(Yg,X), _(X,X), _(X,X), + /* 17E0 */ _(GB,C), _(GB,C), _(GB,C), _(GB,C), _(GB,C), _(GB,C), _(GB,C), _(GB,C), + /* 17E8 */ _(GB,C), _(GB,C), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), + +#define indic_offset_0x1cd0u 1488 + + + /* Vedic Extensions */ + + /* 1CD0 */ _(A,SM), _(A,SM), _(A,SM), _(X,X), _(A,SM), _(A,SM), _(A,SM), _(A,SM), + /* 1CD8 */ _(A,SM), _(A,SM), _(A,SM), _(A,SM), _(A,SM), _(A,SM), _(A,SM), _(A,SM), + /* 1CE0 */ _(A,SM), _(A,SM), _(A,SM), _(A,SM), _(A,SM), _(A,SM), _(A,SM), _(A,SM), + /* 1CE8 */ _(A,SM), _(S,SM), _(S,SM), _(S,SM), _(S,SM), _(A,SM), _(S,SM), _(S,SM), + /* 1CF0 */ _(S,SM), _(S,SM), _(C,C), _(C,C), _(A,SM), _(C,C), _(C,C), _(A,SM), + /* 1CF8 */ _(A,SM), _(A,SM), _(GB,C), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), + +#define indic_offset_0x2008u 1536 + + + /* General Punctuation */ + + /* 2008 */ _(X,X), _(X,X), _(X,X), _(X,X),_(ZWNJ,X),_(ZWJ,X), _(X,X), _(X,X), + /* 2010 */ _(GB,C), _(GB,C), _(GB,C), _(GB,C), _(GB,C), _(GB,C), _(X,X), _(X,X), + /* 2018 */ _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), + /* 2020 */ _(X,X), _(X,X), _(GB,C), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), + +#define indic_offset_0x2070u 1568 + + + /* Superscripts and Subscripts */ + + /* 2070 */ _(X,X), _(X,X), _(X,X), _(X,X),_(SM,SM), _(X,X), _(X,X), _(X,X), + /* 2078 */ _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), + /* 2080 */ _(X,X), _(X,X),_(SM,SM),_(SM,SM),_(SM,SM), _(X,X), _(X,X), _(X,X), + +#define indic_offset_0x25f8u 1592 + + + /* Geometric Shapes */ + + /* 25F8 */ _(X,X), _(X,X), _(X,X), _(GB,C), _(GB,C), _(GB,C), _(GB,C), _(X,X), + +#define indic_offset_0xa8e0u 1600 + + + /* Devanagari Extended */ + + /* A8E0 */ _(A,SM), _(A,SM), _(A,SM), _(A,SM), _(A,SM), _(A,SM), _(A,SM), _(A,SM), + /* A8E8 */ _(A,SM), _(A,SM), _(A,SM), _(A,SM), _(A,SM), _(A,SM), _(A,SM), _(A,SM), + /* A8F0 */ _(A,SM), _(A,SM), _(S,SM), _(S,SM), _(S,SM), _(S,SM), _(S,SM), _(S,SM), + /* A8F8 */ _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(V,C), _(M,AS), + +#define indic_offset_0xa9e0u 1632 + + + /* Myanmar Extended-B */ + + /* A9E0 */ _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(VA,T), _(X,X), _(C,C), + /* A9E8 */ _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), + /* A9F0 */ _(GB,C), _(GB,C), _(GB,C), _(GB,C), _(GB,C), _(GB,C), _(GB,C), _(GB,C), + /* A9F8 */ _(GB,C), _(GB,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(X,X), + +#define indic_offset_0xaa60u 1664 + + + /* Myanmar Extended-A */ + + /* AA60 */ _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), + /* AA68 */ _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), _(C,C), + /* AA70 */ _(X,X), _(C,C), _(C,C), _(C,C), _(GB,C), _(GB,C), _(GB,C), _(X,X), + /* AA78 */ _(X,X), _(X,X), _(C,C), _(PT,X), _(N,X), _(N,X), _(C,C), _(C,C), + +#define indic_offset_0xfe00u 1696 + + + /* Variation Selectors */ + + /* FE00 */ _(VS,X), _(VS,X), _(VS,X), _(VS,X), _(VS,X), _(VS,X), _(VS,X), _(VS,X), + /* FE08 */ _(VS,X), _(VS,X), _(VS,X), _(VS,X), _(VS,X), _(VS,X), _(VS,X), _(VS,X), + +#define indic_offset_0x11300u 1712 + + + /* Grantha */ + + /* 11300 */ _(X,X),_(SM,SM),_(SM,SM),_(SM,SM), _(X,X), _(X,X), _(X,X), _(X,X), + /* 11308 */ _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), + /* 11310 */ _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), + /* 11318 */ _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), + /* 11320 */ _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), + /* 11328 */ _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), + /* 11330 */ _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), _(X,X), + /* 11338 */ _(X,X), _(X,X), _(X,X), _(N,X), _(N,X), _(X,X), _(X,X), _(X,X), + +}; /* Table items: 1776; occupancy: 69% */ + +uint16_t +hb_indic_get_categories (hb_codepoint_t u) +{ + switch (u >> 12) + { + case 0x0u: + if (unlikely (u == 0x00A0u)) return _(GB,C); + if (hb_in_range<hb_codepoint_t> (u, 0x0028u, 0x003Fu)) return indic_table[u - 0x0028u + indic_offset_0x0028u]; + if (hb_in_range<hb_codepoint_t> (u, 0x00B0u, 0x00D7u)) return indic_table[u - 0x00B0u + indic_offset_0x00b0u]; + if (hb_in_range<hb_codepoint_t> (u, 0x0900u, 0x0D7Fu)) return indic_table[u - 0x0900u + indic_offset_0x0900u]; + break; + + case 0x1u: + if (hb_in_range<hb_codepoint_t> (u, 0x1000u, 0x109Fu)) return indic_table[u - 0x1000u + indic_offset_0x1000u]; + if (hb_in_range<hb_codepoint_t> (u, 0x1780u, 0x17EFu)) return indic_table[u - 0x1780u + indic_offset_0x1780u]; + if (hb_in_range<hb_codepoint_t> (u, 0x1CD0u, 0x1CFFu)) return indic_table[u - 0x1CD0u + indic_offset_0x1cd0u]; + break; + + case 0x2u: + if (unlikely (u == 0x25CCu)) return _(DC,C); + if (hb_in_range<hb_codepoint_t> (u, 0x2008u, 0x2027u)) return indic_table[u - 0x2008u + indic_offset_0x2008u]; + if (hb_in_range<hb_codepoint_t> (u, 0x2070u, 0x2087u)) return indic_table[u - 0x2070u + indic_offset_0x2070u]; + if (hb_in_range<hb_codepoint_t> (u, 0x25F8u, 0x25FFu)) return indic_table[u - 0x25F8u + indic_offset_0x25f8u]; + break; + + case 0xAu: + if (hb_in_range<hb_codepoint_t> (u, 0xA8E0u, 0xA8FFu)) return indic_table[u - 0xA8E0u + indic_offset_0xa8e0u]; + if (hb_in_range<hb_codepoint_t> (u, 0xA9E0u, 0xA9FFu)) return indic_table[u - 0xA9E0u + indic_offset_0xa9e0u]; + if (hb_in_range<hb_codepoint_t> (u, 0xAA60u, 0xAA7Fu)) return indic_table[u - 0xAA60u + indic_offset_0xaa60u]; + break; + + case 0xFu: + if (hb_in_range<hb_codepoint_t> (u, 0xFE00u, 0xFE0Fu)) return indic_table[u - 0xFE00u + indic_offset_0xfe00u]; + break; + + case 0x11u: + if (hb_in_range<hb_codepoint_t> (u, 0x11300u, 0x1133Fu)) return indic_table[u - 0x11300u + indic_offset_0x11300u]; + break; + + default: + break; + } + return _(X,X); +} + +#undef _ +#undef INDIC_COMBINE_CATEGORIES + +#undef _OT_A +#undef _OT_As +#undef _OT_C +#undef _OT_CM +#undef _OT_CS +#undef _OT_DC +#undef _OT_H +#undef _OT_M +#undef _OT_MH +#undef _OT_ML +#undef _OT_MR +#undef _OT_MW +#undef _OT_MY +#undef _OT_N +#undef _OT_GB +#undef _OT_PT +#undef _OT_R +#undef _OT_Rf +#undef _OT_Rt +#undef _OT_SM +#undef _OT_S +#undef _OT_V +#undef _OT_VA +#undef _OT_VB +#undef _OT_VL +#undef _OT_VR +#undef _OT_VS +#undef _OT_X +#undef _OT_Xg +#undef _OT_Yg +#undef _OT_ZWJ +#undef _OT_ZWNJ + +#undef _POS_T +#undef _POS_A +#undef _POS_AP +#undef _POS_AS +#undef _POS_C +#undef _POS_BS +#undef _POS_B +#undef _POS_X +#undef _POS_R +#undef _POS_L +#undef _POS_LM +#undef _POS_SM + +#endif + +/* == End of generated table == */ diff --git a/thirdparty/harfbuzz/src/hb-ot-shape-complex-indic.cc b/thirdparty/harfbuzz/src/hb-ot-shaper-indic.cc index c80f7df6a9..48a3c74463 100644 --- a/thirdparty/harfbuzz/src/hb-ot-shape-complex-indic.cc +++ b/thirdparty/harfbuzz/src/hb-ot-shaper-indic.cc @@ -28,9 +28,9 @@ #ifndef HB_NO_OT_SHAPE -#include "hb-ot-shape-complex-indic.hh" -#include "hb-ot-shape-complex-indic-machine.hh" -#include "hb-ot-shape-complex-vowel-constraints.hh" +#include "hb-ot-shaper-indic.hh" +#include "hb-ot-shaper-indic-machine.hh" +#include "hb-ot-shaper-vowel-constraints.hh" #include "hb-ot-layout.hh" @@ -39,6 +39,81 @@ */ +static inline void +set_indic_properties (hb_glyph_info_t &info) +{ + hb_codepoint_t u = info.codepoint; + unsigned int type = hb_indic_get_categories (u); + + info.indic_category() = (indic_category_t) (type & 0xFFu); + info.indic_position() = (indic_position_t) (type >> 8); +} + + +static inline bool +is_one_of (const hb_glyph_info_t &info, unsigned int flags) +{ + /* If it ligated, all bets are off. */ + if (_hb_glyph_info_ligated (&info)) return false; + return !!(FLAG_UNSAFE (info.indic_category()) & flags); +} + +/* Note: + * + * We treat Vowels and placeholders as if they were consonants. This is safe because Vowels + * cannot happen in a consonant syllable. The plus side however is, we can call the + * consonant syllable logic from the vowel syllable function and get it all right! + * + * Keep in sync with consonant_categories in the generator. */ +#define CONSONANT_FLAGS_INDIC (FLAG (I_Cat(C)) | FLAG (I_Cat(CS)) | FLAG (I_Cat(Ra)) | FLAG (I_Cat(CM)) | FLAG (I_Cat(V)) | FLAG (I_Cat(PLACEHOLDER)) | FLAG (I_Cat(DOTTEDCIRCLE))) + +static inline bool +is_consonant (const hb_glyph_info_t &info) +{ + return is_one_of (info, CONSONANT_FLAGS_INDIC); +} + +#define JOINER_FLAGS (FLAG (I_Cat(ZWJ)) | FLAG (I_Cat(ZWNJ))) + +static inline bool +is_joiner (const hb_glyph_info_t &info) +{ + return is_one_of (info, JOINER_FLAGS); +} + +static inline bool +is_halant (const hb_glyph_info_t &info) +{ + return is_one_of (info, FLAG (I_Cat(H))); +} + +struct hb_indic_would_substitute_feature_t +{ + void init (const hb_ot_map_t *map, hb_tag_t feature_tag, bool zero_context_) + { + zero_context = zero_context_; + map->get_stage_lookups (0/*GSUB*/, + map->get_feature_stage (0/*GSUB*/, feature_tag), + &lookups, &count); + } + + bool would_substitute (const hb_codepoint_t *glyphs, + unsigned int glyphs_count, + hb_face_t *face) const + { + for (unsigned int i = 0; i < count; i++) + if (hb_ot_layout_lookup_would_substitute (face, lookups[i].index, glyphs, glyphs_count, zero_context)) + return true; + return false; + } + + private: + const hb_ot_map_t::lookup_map_t *lookups; + unsigned int count; + bool zero_context; +}; + + /* * Indic configurations. Note that we do not want to keep every single script-specific * behavior in these tables necessarily. This should mainly be used for per-script @@ -47,10 +122,6 @@ * instead of adding a new flag in these structs. */ -enum base_position_t { - BASE_POS_LAST_SINHALA, - BASE_POS_LAST -}; enum reph_position_t { REPH_POS_AFTER_MAIN = POS_AFTER_MAIN, REPH_POS_BEFORE_SUB = POS_BEFORE_SUB, @@ -72,7 +143,6 @@ struct indic_config_t hb_script_t script; bool has_old_spec; hb_codepoint_t virama; - base_position_t base_pos; reph_position_t reph_pos; reph_mode_t reph_mode; blwf_mode_t blwf_mode; @@ -81,26 +151,19 @@ struct indic_config_t static const indic_config_t indic_configs[] = { /* Default. Should be first. */ - {HB_SCRIPT_INVALID, false, 0,BASE_POS_LAST, REPH_POS_BEFORE_POST,REPH_MODE_IMPLICIT, BLWF_MODE_PRE_AND_POST}, - {HB_SCRIPT_DEVANAGARI,true, 0x094Du,BASE_POS_LAST, REPH_POS_BEFORE_POST,REPH_MODE_IMPLICIT, BLWF_MODE_PRE_AND_POST}, - {HB_SCRIPT_BENGALI, true, 0x09CDu,BASE_POS_LAST, REPH_POS_AFTER_SUB, REPH_MODE_IMPLICIT, BLWF_MODE_PRE_AND_POST}, - {HB_SCRIPT_GURMUKHI, true, 0x0A4Du,BASE_POS_LAST, REPH_POS_BEFORE_SUB, REPH_MODE_IMPLICIT, BLWF_MODE_PRE_AND_POST}, - {HB_SCRIPT_GUJARATI, true, 0x0ACDu,BASE_POS_LAST, REPH_POS_BEFORE_POST,REPH_MODE_IMPLICIT, BLWF_MODE_PRE_AND_POST}, - {HB_SCRIPT_ORIYA, true, 0x0B4Du,BASE_POS_LAST, REPH_POS_AFTER_MAIN, REPH_MODE_IMPLICIT, BLWF_MODE_PRE_AND_POST}, - {HB_SCRIPT_TAMIL, true, 0x0BCDu,BASE_POS_LAST, REPH_POS_AFTER_POST, REPH_MODE_IMPLICIT, BLWF_MODE_PRE_AND_POST}, - {HB_SCRIPT_TELUGU, true, 0x0C4Du,BASE_POS_LAST, REPH_POS_AFTER_POST, REPH_MODE_EXPLICIT, BLWF_MODE_POST_ONLY}, - {HB_SCRIPT_KANNADA, true, 0x0CCDu,BASE_POS_LAST, REPH_POS_AFTER_POST, REPH_MODE_IMPLICIT, BLWF_MODE_POST_ONLY}, - {HB_SCRIPT_MALAYALAM, true, 0x0D4Du,BASE_POS_LAST, REPH_POS_AFTER_MAIN, REPH_MODE_LOG_REPHA,BLWF_MODE_PRE_AND_POST}, - {HB_SCRIPT_SINHALA, false,0x0DCAu,BASE_POS_LAST_SINHALA, - REPH_POS_AFTER_POST, REPH_MODE_EXPLICIT, BLWF_MODE_PRE_AND_POST}, + {HB_SCRIPT_INVALID, false, 0,REPH_POS_BEFORE_POST,REPH_MODE_IMPLICIT, BLWF_MODE_PRE_AND_POST}, + {HB_SCRIPT_DEVANAGARI,true, 0x094Du,REPH_POS_BEFORE_POST,REPH_MODE_IMPLICIT, BLWF_MODE_PRE_AND_POST}, + {HB_SCRIPT_BENGALI, true, 0x09CDu,REPH_POS_AFTER_SUB, REPH_MODE_IMPLICIT, BLWF_MODE_PRE_AND_POST}, + {HB_SCRIPT_GURMUKHI, true, 0x0A4Du,REPH_POS_BEFORE_SUB, REPH_MODE_IMPLICIT, BLWF_MODE_PRE_AND_POST}, + {HB_SCRIPT_GUJARATI, true, 0x0ACDu,REPH_POS_BEFORE_POST,REPH_MODE_IMPLICIT, BLWF_MODE_PRE_AND_POST}, + {HB_SCRIPT_ORIYA, true, 0x0B4Du,REPH_POS_AFTER_MAIN, REPH_MODE_IMPLICIT, BLWF_MODE_PRE_AND_POST}, + {HB_SCRIPT_TAMIL, true, 0x0BCDu,REPH_POS_AFTER_POST, REPH_MODE_IMPLICIT, BLWF_MODE_PRE_AND_POST}, + {HB_SCRIPT_TELUGU, true, 0x0C4Du,REPH_POS_AFTER_POST, REPH_MODE_EXPLICIT, BLWF_MODE_POST_ONLY}, + {HB_SCRIPT_KANNADA, true, 0x0CCDu,REPH_POS_AFTER_POST, REPH_MODE_IMPLICIT, BLWF_MODE_POST_ONLY}, + {HB_SCRIPT_MALAYALAM, true, 0x0D4Du,REPH_POS_AFTER_MAIN, REPH_MODE_LOG_REPHA,BLWF_MODE_PRE_AND_POST}, }; - -/* - * Indic shaper. - */ - static const hb_ot_map_feature_t indic_features[] = { @@ -207,6 +270,7 @@ static void override_features_indic (hb_ot_shape_planner_t *plan) { plan->map.disable_feature (HB_TAG('l','i','g','a')); + plan->map.add_gsub_pause (hb_syllabic_clear_var); // Don't need syllables anymore, use stop to free buffer var } @@ -356,6 +420,7 @@ setup_syllables_indic (const hb_ot_shape_plan_t *plan HB_UNUSED, hb_font_t *font HB_UNUSED, hb_buffer_t *buffer) { + HB_BUFFER_ALLOCATE_VAR (buffer, syllable); find_syllables_indic (buffer); foreach_syllable (buffer, start, end) buffer->unsafe_to_break (start, end); @@ -367,7 +432,7 @@ compare_indic_order (const hb_glyph_info_t *pa, const hb_glyph_info_t *pb) int a = pa->indic_position(); int b = pb->indic_position(); - return a < b ? -1 : a == b ? 0 : +1; + return (int) a - (int) b; } @@ -379,9 +444,6 @@ update_consonant_positions_indic (const hb_ot_shape_plan_t *plan, { const indic_shape_plan_t *indic_plan = (const indic_shape_plan_t *) plan->data; - if (indic_plan->config->base_pos != BASE_POS_LAST) - return; - hb_codepoint_t virama; if (indic_plan->load_virama_glyph (font, &virama)) { @@ -416,9 +478,9 @@ initial_reordering_consonant_syllable (const hb_ot_shape_plan_t *plan, */ if (buffer->props.script == HB_SCRIPT_KANNADA && start + 3 <= end && - is_one_of (info[start ], FLAG (OT_Ra)) && - is_one_of (info[start+1], FLAG (OT_H)) && - is_one_of (info[start+2], FLAG (OT_ZWJ))) + is_one_of (info[start ], FLAG (I_Cat(Ra))) && + is_one_of (info[start+1], FLAG (I_Cat(H))) && + is_one_of (info[start+2], FLAG (I_Cat(ZWJ)))) { buffer->merge_clusters (start+1, start+3); hb_glyph_info_t tmp = info[start+1]; @@ -452,7 +514,7 @@ initial_reordering_consonant_syllable (const hb_ot_shape_plan_t *plan, start + 3 <= end && ( (indic_plan->config->reph_mode == REPH_MODE_IMPLICIT && !is_joiner (info[start + 2])) || - (indic_plan->config->reph_mode == REPH_MODE_EXPLICIT && info[start + 2].indic_category() == OT_ZWJ) + (indic_plan->config->reph_mode == REPH_MODE_EXPLICIT && info[start + 2].indic_category() == I_Cat(ZWJ)) )) { /* See if it matches the 'rphf' feature. */ @@ -470,7 +532,7 @@ initial_reordering_consonant_syllable (const hb_ot_shape_plan_t *plan, base = start; has_reph = true; } - } else if (indic_plan->config->reph_mode == REPH_MODE_LOG_REPHA && info[start].indic_category() == OT_Repha) + } else if (indic_plan->config->reph_mode == REPH_MODE_LOG_REPHA && info[start].indic_category() == I_Cat(Repha)) { limit += 1; while (limit < end && is_joiner (info[limit])) @@ -479,84 +541,51 @@ initial_reordering_consonant_syllable (const hb_ot_shape_plan_t *plan, has_reph = true; } - switch (indic_plan->config->base_pos) { - case BASE_POS_LAST: - { - /* -> starting from the end of the syllable, move backwards */ - unsigned int i = end; - bool seen_below = false; - do { - i--; - /* -> until a consonant is found */ - if (is_consonant (info[i])) + /* -> starting from the end of the syllable, move backwards */ + unsigned int i = end; + bool seen_below = false; + do { + i--; + /* -> until a consonant is found */ + if (is_consonant (info[i])) + { + /* -> that does not have a below-base or post-base form + * (post-base forms have to follow below-base forms), */ + if (info[i].indic_position() != POS_BELOW_C && + (info[i].indic_position() != POS_POST_C || seen_below)) { - /* -> that does not have a below-base or post-base form - * (post-base forms have to follow below-base forms), */ - if (info[i].indic_position() != POS_BELOW_C && - (info[i].indic_position() != POS_POST_C || seen_below)) - { - base = i; - break; - } - if (info[i].indic_position() == POS_BELOW_C) - seen_below = true; - - /* -> or that is not a pre-base-reordering Ra, - * - * IMPLEMENTATION NOTES: - * - * Our pre-base-reordering Ra's are marked POS_POST_C, so will be skipped - * by the logic above already. - */ - - /* -> or arrive at the first consonant. The consonant stopped at will - * be the base. */ base = i; + break; } - else - { - /* A ZWJ after a Halant stops the base search, and requests an explicit - * half form. - * A ZWJ before a Halant, requests a subjoined form instead, and hence - * search continues. This is particularly important for Bengali - * sequence Ra,H,Ya that should form Ya-Phalaa by subjoining Ya. */ - if (start < i && - info[i].indic_category() == OT_ZWJ && - info[i - 1].indic_category() == OT_H) - break; - } - } while (i > limit); - } - break; - - case BASE_POS_LAST_SINHALA: - { - /* Sinhala base positioning is slightly different from main Indic, in that: - * 1. Its ZWJ behavior is different, - * 2. We don't need to look into the font for consonant positions. - */ - - if (!has_reph) - base = limit; + if (info[i].indic_position() == POS_BELOW_C) + seen_below = true; - /* Find the last base consonant that is not blocked by ZWJ. If there is - * a ZWJ right before a base consonant, that would request a subjoined form. */ - for (unsigned int i = limit; i < end; i++) - if (is_consonant (info[i])) - { - if (limit < i && info[i - 1].indic_category() == OT_ZWJ) - break; - else - base = i; - } + /* -> or that is not a pre-base-reordering Ra, + * + * IMPLEMENTATION NOTES: + * + * Our pre-base-reordering Ra's are marked POS_POST_C, so will be skipped + * by the logic above already. + */ - /* Mark all subsequent consonants as below. */ - for (unsigned int i = base + 1; i < end; i++) - if (is_consonant (info[i])) - info[i].indic_position() = POS_BELOW_C; - } - break; + /* -> or arrive at the first consonant. The consonant stopped at will + * be the base. */ + base = i; + } + else + { + /* A ZWJ after a Halant stops the base search, and requests an explicit + * half form. + * A ZWJ before a Halant, requests a subjoined form instead, and hence + * search continues. This is particularly important for Bengali + * sequence Ra,H,Ya that should form Ya-Phalaa by subjoining Ya. */ + if (start < i && + info[i].indic_category() == I_Cat(ZWJ) && + info[i - 1].indic_category() == I_Cat(H)) + break; + } + } while (i > limit); } /* -> If the syllable starts with Ra + Halant (in a script that has Reph) @@ -611,18 +640,6 @@ initial_reordering_consonant_syllable (const hb_ot_shape_plan_t *plan, if (base < end) info[base].indic_position() = POS_BASE_C; - /* Mark final consonants. A final consonant is one appearing after a matra. - * Happens in Sinhala. */ - for (unsigned int i = base + 1; i < end; i++) - if (info[i].indic_category() == OT_M) { - for (unsigned int j = i + 1; j < end; j++) - if (is_consonant (info[j])) { - info[j].indic_position() = POS_FINAL_C; - break; - } - break; - } - /* Handle beginning Ra */ if (has_reph) info[start].indic_position() = POS_RA_TO_BECOME_REPH; @@ -659,14 +676,14 @@ initial_reordering_consonant_syllable (const hb_ot_shape_plan_t *plan, { bool disallow_double_halants = buffer->props.script == HB_SCRIPT_KANNADA; for (unsigned int i = base + 1; i < end; i++) - if (info[i].indic_category() == OT_H) + if (info[i].indic_category() == I_Cat(H)) { unsigned int j; for (j = end - 1; j > i; j--) if (is_consonant (info[j]) || - (disallow_double_halants && info[j].indic_category() == OT_H)) + (disallow_double_halants && info[j].indic_category() == I_Cat(H))) break; - if (info[j].indic_category() != OT_H && j > i) { + if (info[j].indic_category() != I_Cat(H) && j > i) { /* Move Halant to after last consonant. */ hb_glyph_info_t t = info[i]; memmove (&info[i], &info[i + 1], (j - i) * sizeof (info[0])); @@ -681,20 +698,16 @@ initial_reordering_consonant_syllable (const hb_ot_shape_plan_t *plan, indic_position_t last_pos = POS_START; for (unsigned int i = start; i < end; i++) { - if ((FLAG_UNSAFE (info[i].indic_category()) & (JOINER_FLAGS | FLAG (OT_N) | FLAG (OT_RS) | MEDIAL_FLAGS | FLAG (OT_H)))) + if ((FLAG_UNSAFE (info[i].indic_category()) & (JOINER_FLAGS | FLAG (I_Cat(N)) | FLAG (I_Cat(RS)) | FLAG (I_Cat(CM)) | FLAG (I_Cat(H))))) { info[i].indic_position() = last_pos; - if (unlikely (info[i].indic_category() == OT_H && + if (unlikely (info[i].indic_category() == I_Cat(H) && info[i].indic_position() == POS_PRE_M)) { /* * Uniscribe doesn't move the Halant with Left Matra. - * TEST: U+092B,U+093F,U+094DE - * We follow. This is important for the Sinhala - * U+0DDA split matra since it decomposes to U+0DD9,U+0DCA - * where U+0DD9 is a left matra and U+0DCA is the virama. - * We don't want to move the virama with the left matra. - * TEST: U+0D9A,U+0DDA + * TEST: U+092B,U+093F,U+094D + * We follow. */ for (unsigned int j = i; j > start; j--) if (info[j - 1].indic_position() != POS_PRE_M) { @@ -718,7 +731,7 @@ initial_reordering_consonant_syllable (const hb_ot_shape_plan_t *plan, if (info[j].indic_position() < POS_SMVD) info[j].indic_position() = info[i].indic_position(); last = i; - } else if (info[i].indic_category() == OT_M) + } else if (info[i].indic_category() == I_Cat(M)) last = i; } @@ -849,10 +862,10 @@ initial_reordering_consonant_syllable (const hb_ot_shape_plan_t *plan, * Test case: U+0924,U+094D,U+0930,U+094d,U+200D,U+0915 */ for (unsigned int i = start; i + 1 < base; i++) - if (info[i ].indic_category() == OT_Ra && - info[i+1].indic_category() == OT_H && + if (info[i ].indic_category() == I_Cat(Ra) && + info[i+1].indic_category() == I_Cat(H) && (i + 2 == base || - info[i+2].indic_category() != OT_ZWJ)) + info[i+2].indic_category() != I_Cat(ZWJ))) { info[i ].mask |= indic_plan->mask_array[INDIC_BLWF]; info[i+1].mask |= indic_plan->mask_array[INDIC_BLWF]; @@ -879,7 +892,7 @@ initial_reordering_consonant_syllable (const hb_ot_shape_plan_t *plan, /* Apply ZWJ/ZWNJ effects */ for (unsigned int i = start + 1; i < end; i++) if (is_joiner (info[i])) { - bool non_joiner = info[i].indic_category() == OT_ZWNJ; + bool non_joiner = info[i].indic_category() == I_Cat(ZWNJ); unsigned int j = i; do { @@ -912,7 +925,7 @@ initial_reordering_standalone_cluster (const hb_ot_shape_plan_t *plan, /* For dotted-circle, this is what Uniscribe does: * If dotted-circle is the last glyph, it just does nothing. * Ie. It doesn't form Reph. */ - if (buffer->info[end - 1].indic_category() == OT_DOTTEDCIRCLE) + if (buffer->info[end - 1].indic_category() == I_Cat(DOTTEDCIRCLE)) return; } @@ -955,8 +968,8 @@ initial_reordering_indic (const hb_ot_shape_plan_t *plan, update_consonant_positions_indic (plan, font, buffer); hb_syllabic_insert_dotted_circles (font, buffer, indic_broken_cluster, - OT_DOTTEDCIRCLE, - OT_Repha, + I_Cat(DOTTEDCIRCLE), + I_Cat(Repha), POS_END); foreach_syllable (buffer, start, end) @@ -978,7 +991,7 @@ final_reordering_syllable_indic (const hb_ot_shape_plan_t *plan, * and possibly multiple substitutions happened prior to this * phase, and that might have messed up our properties. Recover * from a particular case of that where we're fairly sure that a - * class of OT_H is desired but has been lost. */ + * class of I_Cat(H) is desired but has been lost. */ /* We don't call load_virama_glyph(), since we know it's already * loaded. */ hb_codepoint_t virama_glyph = indic_plan->virama_glyph.get_relaxed (); @@ -990,7 +1003,7 @@ final_reordering_syllable_indic (const hb_ot_shape_plan_t *plan, _hb_glyph_info_multiplied (&info[i])) { /* This will make sure that this glyph passes is_halant() test. */ - info[i].indic_category() = OT_H; + info[i].indic_category() = I_Cat(H); _hb_glyph_info_clear_ligated_and_multiplied (&info[i]); } } @@ -1056,11 +1069,11 @@ final_reordering_syllable_indic (const hb_ot_shape_plan_t *plan, break; } if (base == end && start < base && - is_one_of (info[base - 1], FLAG (OT_ZWJ))) + is_one_of (info[base - 1], FLAG (I_Cat(ZWJ)))) base--; if (base < end) while (start < base && - is_one_of (info[base], (FLAG (OT_N) | FLAG (OT_H)))) + is_one_of (info[base], (FLAG (I_Cat(N)) | FLAG (I_Cat(H))))) base--; @@ -1105,7 +1118,7 @@ final_reordering_syllable_indic (const hb_ot_shape_plan_t *plan, { search: while (new_pos > start && - !(is_one_of (info[new_pos], (FLAG (OT_M) | FLAG (OT_H))))) + !(is_one_of (info[new_pos], (FLAG (I_Cat(M)) | FLAG (I_Cat(H)))))) new_pos--; /* If we found no Halant we are done. @@ -1122,7 +1135,7 @@ final_reordering_syllable_indic (const hb_ot_shape_plan_t *plan, if (new_pos + 1 < end) { /* -> If ZWJ follows this halant, matra is NOT repositioned after this halant. */ - if (info[new_pos + 1].indic_category() == OT_ZWJ) + if (info[new_pos + 1].indic_category() == I_Cat(ZWJ)) { /* Keep searching. */ if (new_pos > start) @@ -1195,7 +1208,7 @@ final_reordering_syllable_indic (const hb_ot_shape_plan_t *plan, */ if (start + 1 < end && info[start].indic_position() == POS_RA_TO_BECOME_REPH && - ((info[start].indic_category() == OT_Repha) ^ + ((info[start].indic_category() == I_Cat(Repha)) ^ _hb_glyph_info_ligated_and_didnt_multiply (&info[start]))) { unsigned int new_reph_pos; @@ -1305,7 +1318,7 @@ final_reordering_syllable_indic (const hb_ot_shape_plan_t *plan, unlikely (is_halant (info[new_reph_pos]))) { for (unsigned int i = base + 1; i < new_reph_pos; i++) - if (info[i].indic_category() == OT_M) { + if (info[i].indic_category() == I_Cat(M)) { /* Ok, got it. */ new_reph_pos--; } @@ -1365,7 +1378,7 @@ final_reordering_syllable_indic (const hb_ot_shape_plan_t *plan, if (buffer->props.script != HB_SCRIPT_MALAYALAM && buffer->props.script != HB_SCRIPT_TAMIL) { while (new_pos > start && - !(is_one_of (info[new_pos - 1], FLAG(OT_M) | FLAG (OT_H)))) + !(is_one_of (info[new_pos - 1], FLAG(I_Cat(M)) | FLAG (I_Cat(H))))) new_pos--; } @@ -1414,11 +1427,10 @@ final_reordering_syllable_indic (const hb_ot_shape_plan_t *plan, switch ((hb_tag_t) plan->props.script) { case HB_SCRIPT_TAMIL: - case HB_SCRIPT_SINHALA: break; default: - /* Uniscribe merges the entire syllable into a single cluster... Except for Tamil & Sinhala. + /* Uniscribe merges the entire syllable into a single cluster... Except for Tamil. * This means, half forms are submerged into the main consonant's cluster. * This is unnecessary, and makes cursor positioning harder, but that's what * Uniscribe does. */ @@ -1453,7 +1465,9 @@ preprocess_text_indic (const hb_ot_shape_plan_t *plan, hb_buffer_t *buffer, hb_font_t *font) { - _hb_preprocess_text_vowel_constraints (plan, buffer, font); + const indic_shape_plan_t *indic_plan = (const indic_shape_plan_t *) plan->data; + if (!indic_plan->uniscribe_bug_compatible) + _hb_preprocess_text_vowel_constraints (plan, buffer, font); } static bool @@ -1486,48 +1500,6 @@ decompose_indic (const hb_ot_shape_normalize_context_t *c, #endif } - if ((ab == 0x0DDAu || hb_in_range<hb_codepoint_t> (ab, 0x0DDCu, 0x0DDEu))) - { - /* - * Sinhala split matras... Let the fun begin. - * - * These four characters have Unicode decompositions. However, Uniscribe - * decomposes them "Khmer-style", that is, it uses the character itself to - * get the second half. The first half of all four decompositions is always - * U+0DD9. - * - * Now, there are buggy fonts, namely, the widely used lklug.ttf, that are - * broken with Uniscribe. But we need to support them. As such, we only - * do the Uniscribe-style decomposition if the character is transformed into - * its "sec.half" form by the 'pstf' feature. Otherwise, we fall back to - * Unicode decomposition. - * - * Note that we can't unconditionally use Unicode decomposition. That would - * break some other fonts, that are designed to work with Uniscribe, and - * don't have positioning features for the Unicode-style decomposition. - * - * Argh... - * - * The Uniscribe behavior is now documented in the newly published Sinhala - * spec in 2012: - * - * https://docs.microsoft.com/en-us/typography/script-development/sinhala#shaping - */ - - - const indic_shape_plan_t *indic_plan = (const indic_shape_plan_t *) c->plan->data; - hb_codepoint_t glyph; - if (indic_plan->uniscribe_bug_compatible || - (c->font->get_nominal_glyph (ab, &glyph) && - indic_plan->pstf.would_substitute (&glyph, 1, c->font->face))) - { - /* Ok, safe to use Uniscribe-style decomposition. */ - *a = 0x0DD9u; - *b = ab; - return true; - } - } - return (bool) c->unicode->decompose (ab, a, b); } @@ -1548,7 +1520,7 @@ compose_indic (const hb_ot_shape_normalize_context_t *c, } -const hb_ot_complex_shaper_t _hb_ot_complex_shaper_indic = +const hb_ot_shaper_t _hb_ot_shaper_indic = { collect_features_indic, override_features_indic, diff --git a/thirdparty/harfbuzz/src/hb-ot-shaper-indic.hh b/thirdparty/harfbuzz/src/hb-ot-shaper-indic.hh new file mode 100644 index 0000000000..4f822c26e9 --- /dev/null +++ b/thirdparty/harfbuzz/src/hb-ot-shaper-indic.hh @@ -0,0 +1,66 @@ +/* + * Copyright © 2012 Google, Inc. + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Google Author(s): Behdad Esfahbod + */ + +#ifndef HB_OT_SHAPER_INDIC_HH +#define HB_OT_SHAPER_INDIC_HH + +#include "hb.hh" + +#include "hb-ot-shaper-syllabic.hh" + + +/* Visual positions in a syllable from left to right. */ +enum ot_position_t { + POS_START = 0, + + POS_RA_TO_BECOME_REPH = 1, + POS_PRE_M = 2, + POS_PRE_C = 3, + + POS_BASE_C = 4, + POS_AFTER_MAIN = 5, + + POS_ABOVE_C = 6, + + POS_BEFORE_SUB = 7, + POS_BELOW_C = 8, + POS_AFTER_SUB = 9, + + POS_BEFORE_POST = 10, + POS_POST_C = 11, + POS_AFTER_POST = 12, + + POS_SMVD = 13, + + POS_END = 14 +}; + + +HB_INTERNAL uint16_t +hb_indic_get_categories (hb_codepoint_t u); + + +#endif /* HB_OT_SHAPER_INDIC_HH */ diff --git a/thirdparty/harfbuzz/src/hb-ot-shaper-khmer-machine.hh b/thirdparty/harfbuzz/src/hb-ot-shaper-khmer-machine.hh new file mode 100644 index 0000000000..e18bd75ef1 --- /dev/null +++ b/thirdparty/harfbuzz/src/hb-ot-shaper-khmer-machine.hh @@ -0,0 +1,428 @@ + +#line 1 "hb-ot-shaper-khmer-machine.rl" +/* + * Copyright © 2011,2012 Google, Inc. + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Google Author(s): Behdad Esfahbod + */ + +#ifndef HB_OT_SHAPER_KHMER_MACHINE_HH +#define HB_OT_SHAPER_KHMER_MACHINE_HH + +#include "hb.hh" + +#include "hb-ot-layout.hh" +#include "hb-ot-shaper-indic.hh" + +/* buffer var allocations */ +#define khmer_category() ot_shaper_var_u8_category() /* khmer_category_t */ + +using khmer_category_t = unsigned; + +#define K_Cat(Cat) khmer_syllable_machine_ex_##Cat + +enum khmer_syllable_type_t { + khmer_consonant_syllable, + khmer_broken_cluster, + khmer_non_khmer_cluster, +}; + + +#line 52 "hb-ot-shaper-khmer-machine.hh" +#define khmer_syllable_machine_ex_C 1u +#define khmer_syllable_machine_ex_DOTTEDCIRCLE 11u +#define khmer_syllable_machine_ex_H 4u +#define khmer_syllable_machine_ex_PLACEHOLDER 10u +#define khmer_syllable_machine_ex_Ra 15u +#define khmer_syllable_machine_ex_Robatic 25u +#define khmer_syllable_machine_ex_V 2u +#define khmer_syllable_machine_ex_VAbv 20u +#define khmer_syllable_machine_ex_VBlw 21u +#define khmer_syllable_machine_ex_VPre 22u +#define khmer_syllable_machine_ex_VPst 23u +#define khmer_syllable_machine_ex_Xgroup 26u +#define khmer_syllable_machine_ex_Ygroup 27u +#define khmer_syllable_machine_ex_ZWJ 6u +#define khmer_syllable_machine_ex_ZWNJ 5u + + +#line 70 "hb-ot-shaper-khmer-machine.hh" +static const unsigned char _khmer_syllable_machine_trans_keys[] = { + 5u, 26u, 5u, 26u, 1u, 15u, 5u, 26u, 5u, 26u, 5u, 26u, 5u, 26u, 5u, 26u, + 5u, 26u, 5u, 26u, 5u, 26u, 5u, 26u, 5u, 26u, 1u, 15u, 5u, 26u, 5u, 26u, + 5u, 26u, 5u, 26u, 5u, 26u, 5u, 26u, 5u, 26u, 1u, 27u, 4u, 27u, 1u, 15u, + 4u, 27u, 4u, 27u, 27u, 27u, 4u, 27u, 4u, 27u, 4u, 27u, 4u, 27u, 4u, 27u, + 4u, 27u, 1u, 15u, 4u, 27u, 4u, 27u, 27u, 27u, 4u, 27u, 4u, 27u, 4u, 27u, + 4u, 27u, 4u, 27u, 5u, 26u, 0 +}; + +static const char _khmer_syllable_machine_key_spans[] = { + 22, 22, 15, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 15, 22, 22, + 22, 22, 22, 22, 22, 27, 24, 15, + 24, 24, 1, 24, 24, 24, 24, 24, + 24, 15, 24, 24, 1, 24, 24, 24, + 24, 24, 22 +}; + +static const short _khmer_syllable_machine_index_offsets[] = { + 0, 23, 46, 62, 85, 108, 131, 154, + 177, 200, 223, 246, 269, 292, 308, 331, + 354, 377, 400, 423, 446, 469, 497, 522, + 538, 563, 588, 590, 615, 640, 665, 690, + 715, 740, 756, 781, 806, 808, 833, 858, + 883, 908, 933 +}; + +static const char _khmer_syllable_machine_indicies[] = { + 1, 1, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 2, + 0, 0, 0, 0, 3, 4, 0, 1, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 4, 0, 5, 5, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 5, 0, 1, 1, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 2, 0, 0, + 0, 0, 0, 4, 0, 6, 6, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 2, 0, 7, 7, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 8, 0, 9, 9, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 2, 0, 0, 0, 0, 0, + 10, 0, 9, 9, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 10, + 0, 11, 11, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, 12, 0, + 11, 11, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 12, 0, 1, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 2, 0, + 0, 0, 0, 13, 4, 0, 15, 15, + 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 16, 14, 14, + 14, 14, 17, 18, 14, 15, 15, 19, + 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 18, 19, 20, 20, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 20, 14, 15, 15, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 16, 14, 14, 14, 14, + 14, 18, 14, 21, 21, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, + 16, 14, 22, 22, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 23, + 14, 24, 24, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, + 16, 14, 14, 14, 14, 14, 25, 14, + 24, 24, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 25, 14, 26, + 26, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 16, 14, + 14, 14, 14, 14, 27, 14, 26, 26, + 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 27, 14, 29, 29, 28, + 30, 31, 31, 28, 28, 28, 13, 13, + 28, 28, 28, 29, 28, 28, 28, 28, + 16, 25, 27, 23, 28, 17, 18, 20, + 28, 33, 34, 34, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, + 32, 2, 10, 12, 8, 32, 13, 4, + 5, 32, 35, 35, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, + 35, 32, 33, 36, 36, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 2, 10, 12, 8, 32, 3, + 4, 5, 32, 37, 38, 38, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 2, 10, 12, 8, 32, + 32, 4, 5, 32, 5, 32, 37, 6, + 6, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, + 32, 8, 32, 32, 2, 5, 32, 37, + 7, 7, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 8, 5, 32, + 37, 39, 39, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, + 2, 32, 32, 8, 32, 32, 10, 5, + 32, 37, 40, 40, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, + 32, 2, 10, 32, 8, 32, 32, 12, + 5, 32, 33, 38, 38, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 2, 10, 12, 8, 32, 32, + 4, 5, 32, 33, 38, 38, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 2, 10, 12, 8, 32, + 3, 4, 5, 32, 42, 42, 41, 41, + 41, 41, 41, 41, 41, 41, 41, 41, + 41, 41, 42, 41, 30, 43, 43, 41, + 41, 41, 41, 41, 41, 41, 41, 41, + 41, 41, 41, 41, 16, 25, 27, 23, + 41, 17, 18, 20, 41, 44, 45, 45, + 41, 41, 41, 41, 41, 41, 41, 41, + 41, 41, 41, 41, 41, 16, 25, 27, + 23, 41, 41, 18, 20, 41, 20, 41, + 44, 21, 21, 41, 41, 41, 41, 41, + 41, 41, 41, 41, 41, 41, 41, 41, + 41, 41, 41, 23, 41, 41, 16, 20, + 41, 44, 22, 22, 41, 41, 41, 41, + 41, 41, 41, 41, 41, 41, 41, 41, + 41, 41, 41, 41, 41, 41, 41, 23, + 20, 41, 44, 46, 46, 41, 41, 41, + 41, 41, 41, 41, 41, 41, 41, 41, + 41, 41, 16, 41, 41, 23, 41, 41, + 25, 20, 41, 44, 47, 47, 41, 41, + 41, 41, 41, 41, 41, 41, 41, 41, + 41, 41, 41, 16, 25, 41, 23, 41, + 41, 27, 20, 41, 30, 45, 45, 41, + 41, 41, 41, 41, 41, 41, 41, 41, + 41, 41, 41, 41, 16, 25, 27, 23, + 41, 41, 18, 20, 41, 15, 15, 48, + 48, 48, 48, 48, 48, 48, 48, 48, + 48, 48, 48, 48, 16, 48, 48, 48, + 48, 48, 18, 48, 0 +}; + +static const char _khmer_syllable_machine_trans_targs[] = { + 21, 1, 27, 31, 25, 26, 4, 5, + 28, 7, 29, 9, 30, 32, 21, 12, + 37, 41, 35, 21, 36, 15, 16, 38, + 18, 39, 20, 40, 21, 22, 33, 42, + 21, 23, 10, 24, 0, 2, 3, 6, + 8, 21, 34, 11, 13, 14, 17, 19, + 21 +}; + +static const char _khmer_syllable_machine_trans_actions[] = { + 1, 0, 2, 2, 2, 0, 0, 0, + 2, 0, 2, 0, 2, 2, 3, 0, + 2, 4, 4, 5, 0, 0, 0, 2, + 0, 2, 0, 2, 8, 2, 0, 9, + 10, 0, 0, 2, 0, 0, 0, 0, + 0, 11, 4, 0, 0, 0, 0, 0, + 12 +}; + +static const char _khmer_syllable_machine_to_state_actions[] = { + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 6, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0 +}; + +static const char _khmer_syllable_machine_from_state_actions[] = { + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 7, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0 +}; + +static const short _khmer_syllable_machine_eof_trans[] = { + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 15, 20, 15, 15, 15, + 15, 15, 15, 15, 15, 0, 33, 33, + 33, 33, 33, 33, 33, 33, 33, 33, + 33, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 49 +}; + +static const int khmer_syllable_machine_start = 21; +static const int khmer_syllable_machine_first_final = 21; +static const int khmer_syllable_machine_error = -1; + +static const int khmer_syllable_machine_en_main = 21; + + +#line 53 "hb-ot-shaper-khmer-machine.rl" + + + +#line 102 "hb-ot-shaper-khmer-machine.rl" + + +#define found_syllable(syllable_type) \ + HB_STMT_START { \ + if (0) fprintf (stderr, "syllable %d..%d %s\n", ts, te, #syllable_type); \ + for (unsigned int i = ts; i < te; i++) \ + info[i].syllable() = (syllable_serial << 4) | syllable_type; \ + syllable_serial++; \ + if (unlikely (syllable_serial == 16)) syllable_serial = 1; \ + } HB_STMT_END + +inline void +find_syllables_khmer (hb_buffer_t *buffer) +{ + unsigned int p, pe, eof, ts, te, act HB_UNUSED; + int cs; + hb_glyph_info_t *info = buffer->info; + +#line 298 "hb-ot-shaper-khmer-machine.hh" + { + cs = khmer_syllable_machine_start; + ts = 0; + te = 0; + act = 0; + } + +#line 122 "hb-ot-shaper-khmer-machine.rl" + + + p = 0; + pe = eof = buffer->len; + + unsigned int syllable_serial = 1; + +#line 314 "hb-ot-shaper-khmer-machine.hh" + { + int _slen; + int _trans; + const unsigned char *_keys; + const char *_inds; + if ( p == pe ) + goto _test_eof; +_resume: + switch ( _khmer_syllable_machine_from_state_actions[cs] ) { + case 7: +#line 1 "NONE" + {ts = p;} + break; +#line 328 "hb-ot-shaper-khmer-machine.hh" + } + + _keys = _khmer_syllable_machine_trans_keys + (cs<<1); + _inds = _khmer_syllable_machine_indicies + _khmer_syllable_machine_index_offsets[cs]; + + _slen = _khmer_syllable_machine_key_spans[cs]; + _trans = _inds[ _slen > 0 && _keys[0] <=( info[p].khmer_category()) && + ( info[p].khmer_category()) <= _keys[1] ? + ( info[p].khmer_category()) - _keys[0] : _slen ]; + +_eof_trans: + cs = _khmer_syllable_machine_trans_targs[_trans]; + + if ( _khmer_syllable_machine_trans_actions[_trans] == 0 ) + goto _again; + + switch ( _khmer_syllable_machine_trans_actions[_trans] ) { + case 2: +#line 1 "NONE" + {te = p+1;} + break; + case 8: +#line 98 "hb-ot-shaper-khmer-machine.rl" + {te = p+1;{ found_syllable (khmer_non_khmer_cluster); }} + break; + case 10: +#line 96 "hb-ot-shaper-khmer-machine.rl" + {te = p;p--;{ found_syllable (khmer_consonant_syllable); }} + break; + case 11: +#line 97 "hb-ot-shaper-khmer-machine.rl" + {te = p;p--;{ found_syllable (khmer_broken_cluster); buffer->scratch_flags |= HB_BUFFER_SCRATCH_FLAG_HAS_BROKEN_SYLLABLE; }} + break; + case 12: +#line 98 "hb-ot-shaper-khmer-machine.rl" + {te = p;p--;{ found_syllable (khmer_non_khmer_cluster); }} + break; + case 1: +#line 96 "hb-ot-shaper-khmer-machine.rl" + {{p = ((te))-1;}{ found_syllable (khmer_consonant_syllable); }} + break; + case 3: +#line 97 "hb-ot-shaper-khmer-machine.rl" + {{p = ((te))-1;}{ found_syllable (khmer_broken_cluster); buffer->scratch_flags |= HB_BUFFER_SCRATCH_FLAG_HAS_BROKEN_SYLLABLE; }} + break; + case 5: +#line 1 "NONE" + { switch( act ) { + case 2: + {{p = ((te))-1;} found_syllable (khmer_broken_cluster); buffer->scratch_flags |= HB_BUFFER_SCRATCH_FLAG_HAS_BROKEN_SYLLABLE; } + break; + case 3: + {{p = ((te))-1;} found_syllable (khmer_non_khmer_cluster); } + break; + } + } + break; + case 4: +#line 1 "NONE" + {te = p+1;} +#line 97 "hb-ot-shaper-khmer-machine.rl" + {act = 2;} + break; + case 9: +#line 1 "NONE" + {te = p+1;} +#line 98 "hb-ot-shaper-khmer-machine.rl" + {act = 3;} + break; +#line 398 "hb-ot-shaper-khmer-machine.hh" + } + +_again: + switch ( _khmer_syllable_machine_to_state_actions[cs] ) { + case 6: +#line 1 "NONE" + {ts = 0;} + break; +#line 407 "hb-ot-shaper-khmer-machine.hh" + } + + if ( ++p != pe ) + goto _resume; + _test_eof: {} + if ( p == eof ) + { + if ( _khmer_syllable_machine_eof_trans[cs] > 0 ) { + _trans = _khmer_syllable_machine_eof_trans[cs] - 1; + goto _eof_trans; + } + } + + } + +#line 130 "hb-ot-shaper-khmer-machine.rl" + +} + +#undef found_syllable + +#endif /* HB_OT_SHAPER_KHMER_MACHINE_HH */ diff --git a/thirdparty/harfbuzz/src/hb-ot-shape-complex-khmer.cc b/thirdparty/harfbuzz/src/hb-ot-shaper-khmer.cc index a7d5bf574b..e04d633195 100644 --- a/thirdparty/harfbuzz/src/hb-ot-shape-complex-khmer.cc +++ b/thirdparty/harfbuzz/src/hb-ot-shaper-khmer.cc @@ -28,8 +28,8 @@ #ifndef HB_NO_OT_SHAPE -#include "hb-ot-shape-complex-khmer.hh" -#include "hb-ot-shape-complex-khmer-machine.hh" +#include "hb-ot-shaper-khmer-machine.hh" +#include "hb-ot-shaper-indic.hh" #include "hb-ot-layout.hh" @@ -37,6 +37,7 @@ * Khmer shaper. */ + static const hb_ot_map_feature_t khmer_features[] = { @@ -79,6 +80,15 @@ enum { KHMER_BASIC_FEATURES = _KHMER_PRES, /* Don't forget to update this! */ }; +static inline void +set_khmer_properties (hb_glyph_info_t &info) +{ + hb_codepoint_t u = info.codepoint; + unsigned int type = hb_indic_get_categories (u); + + info.khmer_category() = (khmer_category_t) (type & 0xFFu); +} + static void setup_syllables_khmer (const hb_ot_shape_plan_t *plan, hb_font_t *font, @@ -115,7 +125,7 @@ collect_features_khmer (hb_ot_shape_planner_t *plan) map->add_feature (khmer_features[i]); /* https://github.com/harfbuzz/harfbuzz/issues/3531 */ - map->add_gsub_pause (nullptr); + map->add_gsub_pause (hb_syllabic_clear_var); // Don't need syllables anymore, use stop to free buffer var for (; i < KHMER_NUM_FEATURES; i++) map->add_feature (khmer_features[i]); @@ -187,6 +197,7 @@ setup_syllables_khmer (const hb_ot_shape_plan_t *plan HB_UNUSED, hb_font_t *font HB_UNUSED, hb_buffer_t *buffer) { + HB_BUFFER_ALLOCATE_VAR (buffer, syllable); find_syllables_khmer (buffer); foreach_syllable (buffer, start, end) buffer->unsafe_to_break (start, end); @@ -230,11 +241,11 @@ reorder_consonant_syllable (const hb_ot_shape_plan_t *plan, * the 'pref' OpenType feature applied to them. * """ */ - if (info[i].khmer_category() == OT_Coeng && num_coengs <= 2 && i + 1 < end) + if (info[i].khmer_category() == K_Cat(H) && num_coengs <= 2 && i + 1 < end) { num_coengs++; - if (info[i + 1].khmer_category() == OT_Ra) + if (info[i + 1].khmer_category() == K_Cat(Ra)) { for (unsigned int j = 0; j < 2; j++) info[i + j].mask |= khmer_plan->mask_array[KHMER_PREF]; @@ -262,7 +273,7 @@ reorder_consonant_syllable (const hb_ot_shape_plan_t *plan, } /* Reorder left matra piece. */ - else if (info[i].khmer_category() == OT_VPre) + else if (info[i].khmer_category() == K_Cat(VPre)) { /* Move to the start. */ buffer->merge_clusters (start, i + 1); @@ -301,8 +312,8 @@ reorder_khmer (const hb_ot_shape_plan_t *plan, { hb_syllabic_insert_dotted_circles (font, buffer, khmer_broken_cluster, - OT_DOTTEDCIRCLE, - OT_Repha); + K_Cat(DOTTEDCIRCLE), + (unsigned) -1); foreach_syllable (buffer, start, end) reorder_syllable_khmer (plan, font->face, buffer, start, end); @@ -349,7 +360,7 @@ compose_khmer (const hb_ot_shape_normalize_context_t *c, } -const hb_ot_complex_shaper_t _hb_ot_complex_shaper_khmer = +const hb_ot_shaper_t _hb_ot_shaper_khmer = { collect_features_khmer, override_features_khmer, diff --git a/thirdparty/harfbuzz/src/hb-ot-shaper-myanmar-machine.hh b/thirdparty/harfbuzz/src/hb-ot-shaper-myanmar-machine.hh new file mode 100644 index 0000000000..b109708937 --- /dev/null +++ b/thirdparty/harfbuzz/src/hb-ot-shaper-myanmar-machine.hh @@ -0,0 +1,553 @@ + +#line 1 "hb-ot-shaper-myanmar-machine.rl" +/* + * Copyright © 2011,2012 Google, Inc. + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Google Author(s): Behdad Esfahbod + */ + +#ifndef HB_OT_SHAPER_MYANMAR_MACHINE_HH +#define HB_OT_SHAPER_MYANMAR_MACHINE_HH + +#include "hb.hh" + +#include "hb-ot-layout.hh" +#include "hb-ot-shaper-indic.hh" + +/* buffer var allocations */ +#define myanmar_category() ot_shaper_var_u8_category() /* myanmar_category_t */ +#define myanmar_position() ot_shaper_var_u8_auxiliary() /* myanmar_position_t */ + +using myanmar_category_t = unsigned; +using myanmar_position_t = ot_position_t; + +#define M_Cat(Cat) myanmar_syllable_machine_ex_##Cat + +enum myanmar_syllable_type_t { + myanmar_consonant_syllable, + myanmar_broken_cluster, + myanmar_non_myanmar_cluster, +}; + + +#line 54 "hb-ot-shaper-myanmar-machine.hh" +#define myanmar_syllable_machine_ex_A 9u +#define myanmar_syllable_machine_ex_As 32u +#define myanmar_syllable_machine_ex_C 1u +#define myanmar_syllable_machine_ex_CS 18u +#define myanmar_syllable_machine_ex_DB 3u +#define myanmar_syllable_machine_ex_DOTTEDCIRCLE 11u +#define myanmar_syllable_machine_ex_GB 10u +#define myanmar_syllable_machine_ex_H 4u +#define myanmar_syllable_machine_ex_IV 2u +#define myanmar_syllable_machine_ex_MH 35u +#define myanmar_syllable_machine_ex_ML 41u +#define myanmar_syllable_machine_ex_MR 36u +#define myanmar_syllable_machine_ex_MW 37u +#define myanmar_syllable_machine_ex_MY 38u +#define myanmar_syllable_machine_ex_PT 39u +#define myanmar_syllable_machine_ex_Ra 15u +#define myanmar_syllable_machine_ex_SM 8u +#define myanmar_syllable_machine_ex_VAbv 20u +#define myanmar_syllable_machine_ex_VBlw 21u +#define myanmar_syllable_machine_ex_VPre 22u +#define myanmar_syllable_machine_ex_VPst 23u +#define myanmar_syllable_machine_ex_VS 40u +#define myanmar_syllable_machine_ex_ZWJ 6u +#define myanmar_syllable_machine_ex_ZWNJ 5u + + +#line 81 "hb-ot-shaper-myanmar-machine.hh" +static const unsigned char _myanmar_syllable_machine_trans_keys[] = { + 1u, 41u, 3u, 41u, 5u, 39u, 5u, 8u, 3u, 41u, 3u, 39u, 3u, 39u, 5u, 39u, + 5u, 39u, 3u, 39u, 3u, 39u, 3u, 41u, 5u, 39u, 1u, 15u, 3u, 39u, 3u, 39u, + 3u, 40u, 3u, 39u, 3u, 41u, 3u, 41u, 3u, 39u, 3u, 41u, 3u, 41u, 3u, 41u, + 3u, 41u, 3u, 41u, 5u, 39u, 5u, 8u, 3u, 41u, 3u, 39u, 3u, 39u, 5u, 39u, + 5u, 39u, 3u, 39u, 3u, 39u, 3u, 41u, 5u, 39u, 1u, 15u, 3u, 41u, 3u, 39u, + 3u, 39u, 3u, 40u, 3u, 39u, 3u, 41u, 3u, 41u, 3u, 39u, 3u, 41u, 3u, 41u, + 3u, 41u, 3u, 41u, 3u, 41u, 3u, 41u, 3u, 41u, 1u, 41u, 1u, 15u, 0 +}; + +static const char _myanmar_syllable_machine_key_spans[] = { + 41, 39, 35, 4, 39, 37, 37, 35, + 35, 37, 37, 39, 35, 15, 37, 37, + 38, 37, 39, 39, 37, 39, 39, 39, + 39, 39, 35, 4, 39, 37, 37, 35, + 35, 37, 37, 39, 35, 15, 39, 37, + 37, 38, 37, 39, 39, 37, 39, 39, + 39, 39, 39, 39, 39, 41, 15 +}; + +static const short _myanmar_syllable_machine_index_offsets[] = { + 0, 42, 82, 118, 123, 163, 201, 239, + 275, 311, 349, 387, 427, 463, 479, 517, + 555, 594, 632, 672, 712, 750, 790, 830, + 870, 910, 950, 986, 991, 1031, 1069, 1107, + 1143, 1179, 1217, 1255, 1295, 1331, 1347, 1387, + 1425, 1463, 1502, 1540, 1580, 1620, 1658, 1698, + 1738, 1778, 1818, 1858, 1898, 1938, 1980 +}; + +static const char _myanmar_syllable_machine_indicies[] = { + 1, 1, 2, 3, 4, 4, 0, 5, + 6, 1, 1, 0, 0, 0, 7, 0, + 0, 8, 0, 9, 10, 11, 12, 0, + 0, 0, 0, 0, 0, 0, 0, 13, + 0, 0, 14, 15, 16, 17, 18, 19, + 20, 0, 22, 23, 24, 24, 21, 25, + 26, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 27, 28, 29, 30, 21, + 21, 21, 21, 21, 21, 21, 21, 31, + 21, 21, 32, 33, 34, 35, 36, 37, + 38, 21, 24, 24, 21, 25, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 30, 21, 21, 21, + 21, 21, 21, 21, 21, 39, 21, 21, + 21, 21, 21, 21, 36, 21, 24, 24, + 21, 25, 21, 22, 21, 24, 24, 21, + 25, 26, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 40, 21, 21, 30, + 21, 21, 21, 21, 21, 21, 21, 21, + 41, 21, 21, 42, 21, 21, 21, 36, + 21, 41, 21, 22, 21, 24, 24, 21, + 25, 26, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 30, + 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 36, + 21, 43, 21, 24, 24, 21, 25, 36, + 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 44, 21, + 21, 21, 21, 21, 21, 36, 21, 24, + 24, 21, 25, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 44, 21, 21, 21, 21, 21, + 21, 36, 21, 24, 24, 21, 25, 21, + 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 36, 21, 22, + 21, 24, 24, 21, 25, 26, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, + 40, 21, 21, 30, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 36, 21, 22, 21, 24, + 24, 21, 25, 26, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 40, 21, + 21, 30, 21, 21, 21, 21, 21, 21, + 21, 21, 41, 21, 21, 21, 21, 21, + 21, 36, 21, 22, 21, 24, 24, 21, + 25, 26, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 40, 21, 21, 30, + 21, 21, 21, 21, 21, 21, 21, 21, + 41, 21, 21, 21, 21, 21, 21, 36, + 21, 41, 21, 24, 24, 21, 25, 21, + 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 30, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 36, 21, 1, + 1, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 1, 21, 22, + 21, 24, 24, 21, 25, 26, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, + 27, 28, 21, 30, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 36, 21, 22, 21, 24, + 24, 21, 25, 26, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 28, + 21, 30, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, + 21, 36, 21, 22, 21, 24, 24, 21, + 25, 26, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 27, 28, 29, 30, + 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 36, + 45, 21, 22, 21, 24, 24, 21, 25, + 26, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 27, 28, 29, 30, 21, + 21, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 36, 21, + 22, 21, 24, 24, 21, 25, 26, 21, + 21, 21, 21, 21, 21, 21, 21, 21, + 21, 27, 28, 29, 30, 21, 21, 21, + 21, 21, 21, 21, 21, 31, 21, 21, + 32, 33, 34, 35, 36, 21, 38, 21, + 22, 21, 24, 24, 21, 25, 26, 21, + 21, 21, 21, 21, 21, 21, 21, 21, + 21, 27, 28, 29, 30, 21, 21, 21, + 21, 21, 21, 21, 21, 45, 21, 21, + 21, 21, 21, 21, 36, 21, 38, 21, + 22, 21, 24, 24, 21, 25, 26, 21, + 21, 21, 21, 21, 21, 21, 21, 21, + 21, 27, 28, 29, 30, 21, 21, 21, + 21, 21, 21, 21, 21, 45, 21, 21, + 21, 21, 21, 21, 36, 21, 22, 21, + 24, 24, 21, 25, 26, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 27, + 28, 29, 30, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 32, 21, + 34, 21, 36, 21, 38, 21, 22, 21, + 24, 24, 21, 25, 26, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 27, + 28, 29, 30, 21, 21, 21, 21, 21, + 21, 21, 21, 45, 21, 21, 32, 21, + 21, 21, 36, 21, 38, 21, 22, 21, + 24, 24, 21, 25, 26, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 27, + 28, 29, 30, 21, 21, 21, 21, 21, + 21, 21, 21, 46, 21, 21, 32, 33, + 34, 21, 36, 21, 38, 21, 22, 21, + 24, 24, 21, 25, 26, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 27, + 28, 29, 30, 21, 21, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 32, 33, + 34, 21, 36, 21, 38, 21, 22, 23, + 24, 24, 21, 25, 26, 21, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 27, + 28, 29, 30, 21, 21, 21, 21, 21, + 21, 21, 21, 31, 21, 21, 32, 33, + 34, 35, 36, 21, 38, 21, 48, 48, + 47, 5, 47, 47, 47, 47, 47, 47, + 47, 47, 47, 47, 47, 47, 47, 47, + 12, 47, 47, 47, 47, 47, 47, 47, + 47, 49, 47, 47, 47, 47, 47, 47, + 18, 47, 48, 48, 47, 5, 47, 2, + 47, 48, 48, 47, 5, 6, 47, 47, + 47, 47, 47, 47, 47, 47, 47, 47, + 50, 47, 47, 12, 47, 47, 47, 47, + 47, 47, 47, 47, 51, 47, 47, 52, + 47, 47, 47, 18, 47, 51, 47, 2, + 47, 48, 48, 47, 5, 6, 47, 47, + 47, 47, 47, 47, 47, 47, 47, 47, + 47, 47, 47, 12, 47, 47, 47, 47, + 47, 47, 47, 47, 47, 47, 47, 47, + 47, 47, 47, 18, 47, 53, 47, 48, + 48, 47, 5, 18, 47, 47, 47, 47, + 47, 47, 47, 47, 47, 47, 47, 47, + 47, 47, 47, 47, 47, 47, 47, 47, + 47, 47, 54, 47, 47, 47, 47, 47, + 47, 18, 47, 48, 48, 47, 5, 47, + 47, 47, 47, 47, 47, 47, 47, 47, + 47, 47, 47, 47, 47, 47, 47, 47, + 47, 47, 47, 47, 47, 47, 54, 47, + 47, 47, 47, 47, 47, 18, 47, 48, + 48, 47, 5, 47, 47, 47, 47, 47, + 47, 47, 47, 47, 47, 47, 47, 47, + 47, 47, 47, 47, 47, 47, 47, 47, + 47, 47, 47, 47, 47, 47, 47, 47, + 47, 18, 47, 2, 47, 48, 48, 47, + 5, 6, 47, 47, 47, 47, 47, 47, + 47, 47, 47, 47, 50, 47, 47, 12, + 47, 47, 47, 47, 47, 47, 47, 47, + 47, 47, 47, 47, 47, 47, 47, 18, + 47, 2, 47, 48, 48, 47, 5, 6, + 47, 47, 47, 47, 47, 47, 47, 47, + 47, 47, 50, 47, 47, 12, 47, 47, + 47, 47, 47, 47, 47, 47, 51, 47, + 47, 47, 47, 47, 47, 18, 47, 2, + 47, 48, 48, 47, 5, 6, 47, 47, + 47, 47, 47, 47, 47, 47, 47, 47, + 50, 47, 47, 12, 47, 47, 47, 47, + 47, 47, 47, 47, 51, 47, 47, 47, + 47, 47, 47, 18, 47, 51, 47, 48, + 48, 47, 5, 47, 47, 47, 47, 47, + 47, 47, 47, 47, 47, 47, 47, 47, + 47, 12, 47, 47, 47, 47, 47, 47, + 47, 47, 47, 47, 47, 47, 47, 47, + 47, 18, 47, 55, 55, 47, 47, 47, + 47, 47, 47, 47, 47, 47, 47, 47, + 47, 55, 47, 2, 3, 48, 48, 47, + 5, 6, 47, 47, 47, 47, 47, 47, + 47, 47, 47, 47, 9, 10, 11, 12, + 47, 47, 47, 47, 47, 47, 47, 47, + 13, 47, 47, 14, 15, 16, 17, 18, + 19, 20, 47, 2, 47, 48, 48, 47, + 5, 6, 47, 47, 47, 47, 47, 47, + 47, 47, 47, 47, 9, 10, 47, 12, + 47, 47, 47, 47, 47, 47, 47, 47, + 47, 47, 47, 47, 47, 47, 47, 18, + 47, 2, 47, 48, 48, 47, 5, 6, + 47, 47, 47, 47, 47, 47, 47, 47, + 47, 47, 47, 10, 47, 12, 47, 47, + 47, 47, 47, 47, 47, 47, 47, 47, + 47, 47, 47, 47, 47, 18, 47, 2, + 47, 48, 48, 47, 5, 6, 47, 47, + 47, 47, 47, 47, 47, 47, 47, 47, + 9, 10, 11, 12, 47, 47, 47, 47, + 47, 47, 47, 47, 47, 47, 47, 47, + 47, 47, 47, 18, 56, 47, 2, 47, + 48, 48, 47, 5, 6, 47, 47, 47, + 47, 47, 47, 47, 47, 47, 47, 9, + 10, 11, 12, 47, 47, 47, 47, 47, + 47, 47, 47, 47, 47, 47, 47, 47, + 47, 47, 18, 47, 2, 47, 48, 48, + 47, 5, 6, 47, 47, 47, 47, 47, + 47, 47, 47, 47, 47, 9, 10, 11, + 12, 47, 47, 47, 47, 47, 47, 47, + 47, 13, 47, 47, 14, 15, 16, 17, + 18, 47, 20, 47, 2, 47, 48, 48, + 47, 5, 6, 47, 47, 47, 47, 47, + 47, 47, 47, 47, 47, 9, 10, 11, + 12, 47, 47, 47, 47, 47, 47, 47, + 47, 56, 47, 47, 47, 47, 47, 47, + 18, 47, 20, 47, 2, 47, 48, 48, + 47, 5, 6, 47, 47, 47, 47, 47, + 47, 47, 47, 47, 47, 9, 10, 11, + 12, 47, 47, 47, 47, 47, 47, 47, + 47, 56, 47, 47, 47, 47, 47, 47, + 18, 47, 2, 47, 48, 48, 47, 5, + 6, 47, 47, 47, 47, 47, 47, 47, + 47, 47, 47, 9, 10, 11, 12, 47, + 47, 47, 47, 47, 47, 47, 47, 47, + 47, 47, 14, 47, 16, 47, 18, 47, + 20, 47, 2, 47, 48, 48, 47, 5, + 6, 47, 47, 47, 47, 47, 47, 47, + 47, 47, 47, 9, 10, 11, 12, 47, + 47, 47, 47, 47, 47, 47, 47, 56, + 47, 47, 14, 47, 47, 47, 18, 47, + 20, 47, 2, 47, 48, 48, 47, 5, + 6, 47, 47, 47, 47, 47, 47, 47, + 47, 47, 47, 9, 10, 11, 12, 47, + 47, 47, 47, 47, 47, 47, 47, 57, + 47, 47, 14, 15, 16, 47, 18, 47, + 20, 47, 2, 47, 48, 48, 47, 5, + 6, 47, 47, 47, 47, 47, 47, 47, + 47, 47, 47, 9, 10, 11, 12, 47, + 47, 47, 47, 47, 47, 47, 47, 47, + 47, 47, 14, 15, 16, 47, 18, 47, + 20, 47, 2, 3, 48, 48, 47, 5, + 6, 47, 47, 47, 47, 47, 47, 47, + 47, 47, 47, 9, 10, 11, 12, 47, + 47, 47, 47, 47, 47, 47, 47, 13, + 47, 47, 14, 15, 16, 17, 18, 47, + 20, 47, 22, 23, 24, 24, 21, 25, + 26, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 27, 28, 29, 30, 21, + 21, 21, 21, 21, 21, 21, 21, 58, + 21, 21, 32, 33, 34, 35, 36, 37, + 38, 21, 22, 59, 24, 24, 21, 25, + 26, 21, 21, 21, 21, 21, 21, 21, + 21, 21, 21, 27, 28, 29, 30, 21, + 21, 21, 21, 21, 21, 21, 21, 31, + 21, 21, 32, 33, 34, 35, 36, 21, + 38, 21, 1, 1, 2, 3, 48, 48, + 47, 5, 6, 1, 1, 47, 47, 47, + 1, 47, 47, 47, 47, 9, 10, 11, + 12, 47, 47, 47, 47, 47, 47, 47, + 47, 13, 47, 47, 14, 15, 16, 17, + 18, 19, 20, 47, 1, 1, 60, 60, + 60, 60, 60, 60, 60, 1, 1, 60, + 60, 60, 1, 60, 0 +}; + +static const char _myanmar_syllable_machine_trans_targs[] = { + 0, 1, 26, 37, 0, 27, 29, 51, + 54, 39, 40, 41, 28, 43, 44, 46, + 47, 48, 30, 50, 45, 0, 2, 13, + 0, 3, 5, 14, 15, 16, 4, 18, + 19, 21, 22, 23, 6, 25, 20, 12, + 9, 10, 11, 7, 8, 17, 24, 0, + 0, 36, 33, 34, 35, 31, 32, 38, + 42, 49, 52, 53, 0 +}; + +static const char _myanmar_syllable_machine_trans_actions[] = { + 3, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 5, 0, 0, + 6, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 7, + 8, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 9 +}; + +static const char _myanmar_syllable_machine_to_state_actions[] = { + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0 +}; + +static const char _myanmar_syllable_machine_from_state_actions[] = { + 2, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0 +}; + +static const short _myanmar_syllable_machine_eof_trans[] = { + 0, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 48, 48, 48, 48, 48, 48, + 48, 48, 48, 48, 48, 48, 48, 48, + 48, 48, 48, 48, 48, 48, 48, 48, + 48, 48, 48, 22, 22, 48, 61 +}; + +static const int myanmar_syllable_machine_start = 0; +static const int myanmar_syllable_machine_first_final = 0; +static const int myanmar_syllable_machine_error = -1; + +static const int myanmar_syllable_machine_en_main = 0; + + +#line 55 "hb-ot-shaper-myanmar-machine.rl" + + + +#line 117 "hb-ot-shaper-myanmar-machine.rl" + + +#define found_syllable(syllable_type) \ + HB_STMT_START { \ + if (0) fprintf (stderr, "syllable %d..%d %s\n", ts, te, #syllable_type); \ + for (unsigned int i = ts; i < te; i++) \ + info[i].syllable() = (syllable_serial << 4) | syllable_type; \ + syllable_serial++; \ + if (unlikely (syllable_serial == 16)) syllable_serial = 1; \ + } HB_STMT_END + +inline void +find_syllables_myanmar (hb_buffer_t *buffer) +{ + unsigned int p, pe, eof, ts, te, act HB_UNUSED; + int cs; + hb_glyph_info_t *info = buffer->info; + +#line 447 "hb-ot-shaper-myanmar-machine.hh" + { + cs = myanmar_syllable_machine_start; + ts = 0; + te = 0; + act = 0; + } + +#line 137 "hb-ot-shaper-myanmar-machine.rl" + + + p = 0; + pe = eof = buffer->len; + + unsigned int syllable_serial = 1; + +#line 463 "hb-ot-shaper-myanmar-machine.hh" + { + int _slen; + int _trans; + const unsigned char *_keys; + const char *_inds; + if ( p == pe ) + goto _test_eof; +_resume: + switch ( _myanmar_syllable_machine_from_state_actions[cs] ) { + case 2: +#line 1 "NONE" + {ts = p;} + break; +#line 477 "hb-ot-shaper-myanmar-machine.hh" + } + + _keys = _myanmar_syllable_machine_trans_keys + (cs<<1); + _inds = _myanmar_syllable_machine_indicies + _myanmar_syllable_machine_index_offsets[cs]; + + _slen = _myanmar_syllable_machine_key_spans[cs]; + _trans = _inds[ _slen > 0 && _keys[0] <=( info[p].myanmar_category()) && + ( info[p].myanmar_category()) <= _keys[1] ? + ( info[p].myanmar_category()) - _keys[0] : _slen ]; + +_eof_trans: + cs = _myanmar_syllable_machine_trans_targs[_trans]; + + if ( _myanmar_syllable_machine_trans_actions[_trans] == 0 ) + goto _again; + + switch ( _myanmar_syllable_machine_trans_actions[_trans] ) { + case 6: +#line 110 "hb-ot-shaper-myanmar-machine.rl" + {te = p+1;{ found_syllable (myanmar_consonant_syllable); }} + break; + case 4: +#line 111 "hb-ot-shaper-myanmar-machine.rl" + {te = p+1;{ found_syllable (myanmar_non_myanmar_cluster); }} + break; + case 8: +#line 112 "hb-ot-shaper-myanmar-machine.rl" + {te = p+1;{ found_syllable (myanmar_broken_cluster); buffer->scratch_flags |= HB_BUFFER_SCRATCH_FLAG_HAS_BROKEN_SYLLABLE; }} + break; + case 3: +#line 113 "hb-ot-shaper-myanmar-machine.rl" + {te = p+1;{ found_syllable (myanmar_non_myanmar_cluster); }} + break; + case 5: +#line 110 "hb-ot-shaper-myanmar-machine.rl" + {te = p;p--;{ found_syllable (myanmar_consonant_syllable); }} + break; + case 7: +#line 112 "hb-ot-shaper-myanmar-machine.rl" + {te = p;p--;{ found_syllable (myanmar_broken_cluster); buffer->scratch_flags |= HB_BUFFER_SCRATCH_FLAG_HAS_BROKEN_SYLLABLE; }} + break; + case 9: +#line 113 "hb-ot-shaper-myanmar-machine.rl" + {te = p;p--;{ found_syllable (myanmar_non_myanmar_cluster); }} + break; +#line 523 "hb-ot-shaper-myanmar-machine.hh" + } + +_again: + switch ( _myanmar_syllable_machine_to_state_actions[cs] ) { + case 1: +#line 1 "NONE" + {ts = 0;} + break; +#line 532 "hb-ot-shaper-myanmar-machine.hh" + } + + if ( ++p != pe ) + goto _resume; + _test_eof: {} + if ( p == eof ) + { + if ( _myanmar_syllable_machine_eof_trans[cs] > 0 ) { + _trans = _myanmar_syllable_machine_eof_trans[cs] - 1; + goto _eof_trans; + } + } + + } + +#line 145 "hb-ot-shaper-myanmar-machine.rl" + +} + +#undef found_syllable + +#endif /* HB_OT_SHAPER_MYANMAR_MACHINE_HH */ diff --git a/thirdparty/harfbuzz/src/hb-ot-shape-complex-myanmar.cc b/thirdparty/harfbuzz/src/hb-ot-shaper-myanmar.cc index 13beaf4d4c..1ccafbca7e 100644 --- a/thirdparty/harfbuzz/src/hb-ot-shape-complex-myanmar.cc +++ b/thirdparty/harfbuzz/src/hb-ot-shaper-myanmar.cc @@ -28,14 +28,16 @@ #ifndef HB_NO_OT_SHAPE -#include "hb-ot-shape-complex-myanmar.hh" -#include "hb-ot-shape-complex-myanmar-machine.hh" +#include "hb-ot-shaper-myanmar-machine.hh" +#include "hb-ot-shaper-indic.hh" +#include "hb-ot-layout.hh" /* * Myanmar shaper. */ + static const hb_tag_t myanmar_basic_features[] = { @@ -62,6 +64,40 @@ myanmar_other_features[] = HB_TAG('p','s','t','s'), }; +static inline void +set_myanmar_properties (hb_glyph_info_t &info) +{ + hb_codepoint_t u = info.codepoint; + unsigned int type = hb_indic_get_categories (u); + + info.myanmar_category() = (myanmar_category_t) (type & 0xFFu); +} + + +static inline bool +is_one_of_myanmar (const hb_glyph_info_t &info, unsigned int flags) +{ + /* If it ligated, all bets are off. */ + if (_hb_glyph_info_ligated (&info)) return false; + return !!(FLAG_UNSAFE (info.myanmar_category()) & flags); +} + +/* Note: + * + * We treat Vowels and placeholders as if they were consonants. This is safe because Vowels + * cannot happen in a consonant syllable. The plus side however is, we can call the + * consonant syllable logic from the vowel syllable function and get it all right! + * + * Keep in sync with consonant_categories in the generator. */ +#define CONSONANT_FLAGS_MYANMAR (FLAG (M_Cat(C)) | FLAG (M_Cat(CS)) | FLAG (M_Cat(Ra)) | /* FLAG (M_Cat(CM)) | */ FLAG (M_Cat(IV)) | FLAG (M_Cat(GB)) | FLAG (M_Cat(DOTTEDCIRCLE))) + +static inline bool +is_consonant_myanmar (const hb_glyph_info_t &info) +{ + return is_one_of_myanmar (info, CONSONANT_FLAGS_MYANMAR); +} + + static void setup_syllables_myanmar (const hb_ot_shape_plan_t *plan, hb_font_t *font, @@ -92,6 +128,7 @@ collect_features_myanmar (hb_ot_shape_planner_t *plan) map->enable_feature (myanmar_basic_features[i], F_MANUAL_ZWJ | F_PER_SYLLABLE); map->add_gsub_pause (nullptr); } + map->add_gsub_pause (hb_syllabic_clear_var); // Don't need syllables anymore, use stop to free buffer var for (unsigned int i = 0; i < ARRAY_LENGTH (myanmar_other_features); i++) map->enable_feature (myanmar_other_features[i], F_MANUAL_ZWJ); @@ -118,6 +155,7 @@ setup_syllables_myanmar (const hb_ot_shape_plan_t *plan HB_UNUSED, hb_font_t *font HB_UNUSED, hb_buffer_t *buffer) { + HB_BUFFER_ALLOCATE_VAR (buffer, syllable); find_syllables_myanmar (buffer); foreach_syllable (buffer, start, end) buffer->unsafe_to_break (start, end); @@ -129,7 +167,7 @@ compare_myanmar_order (const hb_glyph_info_t *pa, const hb_glyph_info_t *pb) int a = pa->myanmar_position(); int b = pb->myanmar_position(); - return a < b ? -1 : a == b ? 0 : +1; + return (int) a - (int) b; } @@ -148,9 +186,9 @@ initial_reordering_consonant_syllable (hb_buffer_t *buffer, { unsigned int limit = start; if (start + 3 <= end && - info[start ].myanmar_category() == OT_Ra && - info[start+1].myanmar_category() == OT_As && - info[start+2].myanmar_category() == OT_H) + info[start ].myanmar_category() == M_Cat(Ra) && + info[start+1].myanmar_category() == M_Cat(As) && + info[start+2].myanmar_category() == M_Cat(H)) { limit += 3; base = start; @@ -162,7 +200,7 @@ initial_reordering_consonant_syllable (hb_buffer_t *buffer, base = limit; for (unsigned int i = limit; i < end; i++) - if (is_consonant (info[i])) + if (is_consonant_myanmar (info[i])) { base = i; break; @@ -187,39 +225,40 @@ initial_reordering_consonant_syllable (hb_buffer_t *buffer, * Myanmar reordering! */ for (; i < end; i++) { - if (info[i].myanmar_category() == OT_MR) /* Pre-base reordering */ + if (info[i].myanmar_category() == M_Cat(MR)) /* Pre-base reordering */ { info[i].myanmar_position() = POS_PRE_C; continue; } - if (info[i].myanmar_position() < POS_BASE_C) /* Left matra */ + if (info[i].myanmar_category() == M_Cat(VPre)) /* Left matra */ { + info[i].myanmar_position() = POS_PRE_M; continue; } - if (info[i].myanmar_category() == OT_VS) + if (info[i].myanmar_category() == M_Cat(VS)) { info[i].myanmar_position() = info[i - 1].myanmar_position(); continue; } - if (pos == POS_AFTER_MAIN && info[i].myanmar_category() == OT_VBlw) + if (pos == POS_AFTER_MAIN && info[i].myanmar_category() == M_Cat(VBlw)) { pos = POS_BELOW_C; info[i].myanmar_position() = pos; continue; } - if (pos == POS_BELOW_C && info[i].myanmar_category() == OT_A) + if (pos == POS_BELOW_C && info[i].myanmar_category() == M_Cat(A)) { info[i].myanmar_position() = POS_BEFORE_SUB; continue; } - if (pos == POS_BELOW_C && info[i].myanmar_category() == OT_VBlw) + if (pos == POS_BELOW_C && info[i].myanmar_category() == M_Cat(VBlw)) { info[i].myanmar_position() = pos; continue; } - if (pos == POS_BELOW_C && info[i].myanmar_category() != OT_A) + if (pos == POS_BELOW_C && info[i].myanmar_category() != M_Cat(A)) { pos = POS_AFTER_SUB; info[i].myanmar_position() = pos; @@ -247,7 +286,6 @@ reorder_syllable_myanmar (const hb_ot_shape_plan_t *plan HB_UNUSED, initial_reordering_consonant_syllable (buffer, start, end); break; - case myanmar_punctuation_cluster: case myanmar_non_myanmar_cluster: break; } @@ -262,7 +300,7 @@ reorder_myanmar (const hb_ot_shape_plan_t *plan, { hb_syllabic_insert_dotted_circles (font, buffer, myanmar_broken_cluster, - OT_GB); + M_Cat(DOTTEDCIRCLE)); foreach_syllable (buffer, start, end) reorder_syllable_myanmar (plan, font->face, buffer, start, end); @@ -274,7 +312,7 @@ reorder_myanmar (const hb_ot_shape_plan_t *plan, } -const hb_ot_complex_shaper_t _hb_ot_complex_shaper_myanmar = +const hb_ot_shaper_t _hb_ot_shaper_myanmar = { collect_features_myanmar, nullptr, /* override_features */ @@ -296,7 +334,7 @@ const hb_ot_complex_shaper_t _hb_ot_complex_shaper_myanmar = /* Ugly Zawgyi encoding. * Disable all auto processing. * https://github.com/harfbuzz/harfbuzz/issues/1162 */ -const hb_ot_complex_shaper_t _hb_ot_complex_shaper_myanmar_zawgyi = +const hb_ot_shaper_t _hb_ot_shaper_myanmar_zawgyi = { nullptr, /* collect_features */ nullptr, /* override_features */ diff --git a/thirdparty/harfbuzz/src/hb-ot-shape-complex-syllabic.cc b/thirdparty/harfbuzz/src/hb-ot-shaper-syllabic.cc index 76092c7f38..a8e0d8e8c1 100644 --- a/thirdparty/harfbuzz/src/hb-ot-shape-complex-syllabic.cc +++ b/thirdparty/harfbuzz/src/hb-ot-shaper-syllabic.cc @@ -26,7 +26,7 @@ #ifndef HB_NO_OT_SHAPE -#include "hb-ot-shape-complex-syllabic.hh" +#include "hb-ot-shaper-syllabic.hh" void @@ -39,31 +39,18 @@ hb_syllabic_insert_dotted_circles (hb_font_t *font, { if (unlikely (buffer->flags & HB_BUFFER_FLAG_DO_NOT_INSERT_DOTTED_CIRCLE)) return; - - /* Note: This loop is extra overhead, but should not be measurable. - * TODO Use a buffer scratch flag to remove the loop. */ - bool has_broken_syllables = false; - unsigned int count = buffer->len; - hb_glyph_info_t *info = buffer->info; - for (unsigned int i = 0; i < count; i++) - if ((info[i].syllable() & 0x0F) == broken_syllable_type) - { - has_broken_syllables = true; - break; - } - if (likely (!has_broken_syllables)) + if (likely (!(buffer->scratch_flags & HB_BUFFER_SCRATCH_FLAG_HAS_BROKEN_SYLLABLE))) return; - hb_codepoint_t dottedcircle_glyph; if (!font->get_nominal_glyph (0x25CCu, &dottedcircle_glyph)) return; hb_glyph_info_t dottedcircle = {0}; dottedcircle.codepoint = 0x25CCu; - dottedcircle.complex_var_u8_category() = dottedcircle_category; + dottedcircle.ot_shaper_var_u8_category() = dottedcircle_category; if (dottedcircle_position != -1) - dottedcircle.complex_var_u8_auxiliary() = dottedcircle_position; + dottedcircle.ot_shaper_var_u8_auxiliary() = dottedcircle_position; dottedcircle.codepoint = dottedcircle_glyph; buffer->clear_output (); @@ -87,7 +74,7 @@ hb_syllabic_insert_dotted_circles (hb_font_t *font, { while (buffer->idx < buffer->len && buffer->successful && last_syllable == buffer->cur().syllable() && - buffer->cur().complex_var_u8_category() == (unsigned) repha_category) + buffer->cur().ot_shaper_var_u8_category() == (unsigned) repha_category) (void) buffer->next_glyph (); } @@ -99,5 +86,13 @@ hb_syllabic_insert_dotted_circles (hb_font_t *font, buffer->sync (); } +HB_INTERNAL void +hb_syllabic_clear_var (const hb_ot_shape_plan_t *plan, + hb_font_t *font, + hb_buffer_t *buffer) +{ + HB_BUFFER_DEALLOCATE_VAR (buffer, syllable); +} + #endif diff --git a/thirdparty/harfbuzz/src/hb-ot-shape-complex-syllabic.hh b/thirdparty/harfbuzz/src/hb-ot-shaper-syllabic.hh index b901a660d3..e8a15bb48a 100644 --- a/thirdparty/harfbuzz/src/hb-ot-shape-complex-syllabic.hh +++ b/thirdparty/harfbuzz/src/hb-ot-shaper-syllabic.hh @@ -22,12 +22,12 @@ * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. */ -#ifndef HB_OT_SHAPE_COMPLEX_SYLLABIC_HH -#define HB_OT_SHAPE_COMPLEX_SYLLABIC_HH +#ifndef HB_OT_SHAPER_SYLLABIC_HH +#define HB_OT_SHAPER_SYLLABIC_HH #include "hb.hh" -#include "hb-ot-shape-complex.hh" +#include "hb-ot-shaper.hh" HB_INTERNAL void @@ -38,5 +38,10 @@ hb_syllabic_insert_dotted_circles (hb_font_t *font, int repha_category = -1, int dottedcircle_position = -1); +HB_INTERNAL void +hb_syllabic_clear_var (const hb_ot_shape_plan_t *plan, + hb_font_t *font, + hb_buffer_t *buffer); + -#endif /* HB_OT_SHAPE_COMPLEX_SYLLABIC_HH */ +#endif /* HB_OT_SHAPER_SYLLABIC_HH */ diff --git a/thirdparty/harfbuzz/src/hb-ot-shape-complex-thai.cc b/thirdparty/harfbuzz/src/hb-ot-shaper-thai.cc index a1e27a83be..1280e7ed17 100644 --- a/thirdparty/harfbuzz/src/hb-ot-shape-complex-thai.cc +++ b/thirdparty/harfbuzz/src/hb-ot-shaper-thai.cc @@ -28,7 +28,7 @@ #ifndef HB_NO_OT_SHAPE -#include "hb-ot-shape-complex.hh" +#include "hb-ot-shaper.hh" /* Thai / Lao shaper */ @@ -222,7 +222,7 @@ do_thai_pua_shaping (const hb_ot_shape_plan_t *plan HB_UNUSED, hb_buffer_t *buffer, hb_font_t *font) { -#ifdef HB_NO_OT_SHAPE_COMPLEX_THAI_FALLBACK +#ifdef HB_NO_OT_SHAPER_THAI_FALLBACK return; #endif @@ -279,7 +279,7 @@ preprocess_text_thai (const hb_ot_shape_plan_t *plan, * to be what Uniscribe and other engines implement. According to Eric Muller: * * When you have a SARA AM, decompose it in NIKHAHIT + SARA AA, *and* move the - * NIKHAHIT backwards over any tone mark (0E48-0E4B). + * NIKHAHIT backwards over any above-base marks. * * <0E14, 0E4B, 0E33> -> <0E14, 0E4D, 0E4B, 0E32> * @@ -308,8 +308,8 @@ preprocess_text_thai (const hb_ot_shape_plan_t *plan, * Nikhahit: U+0E4D U+0ECD * * Testing shows that Uniscribe reorder the following marks: - * Thai: <0E31,0E34..0E37,0E47..0E4E> - * Lao: <0EB1,0EB4..0EB7,0EC7..0ECE> + * Thai: <0E31,0E34..0E37, 0E47..0E4E> + * Lao: <0EB1,0EB4..0EB7,0EBB,0EC8..0ECD> * * Note how the Lao versions are the same as Thai + 0x80. */ @@ -319,7 +319,7 @@ preprocess_text_thai (const hb_ot_shape_plan_t *plan, #define IS_SARA_AM(x) (((x) & ~0x0080u) == 0x0E33u) #define NIKHAHIT_FROM_SARA_AM(x) ((x) - 0x0E33u + 0x0E4Du) #define SARA_AA_FROM_SARA_AM(x) ((x) - 1) -#define IS_TONE_MARK(x) (hb_in_ranges<hb_codepoint_t> ((x) & ~0x0080u, 0x0E34u, 0x0E37u, 0x0E47u, 0x0E4Eu, 0x0E31u, 0x0E31u)) +#define IS_ABOVE_BASE_MARK(x) (hb_in_ranges<hb_codepoint_t> ((x) & ~0x0080u, 0x0E34u, 0x0E37u, 0x0E47u, 0x0E4Eu, 0x0E31u, 0x0E31u, 0x0E3Bu, 0x0E3Bu)) buffer->clear_output (); unsigned int count = buffer->len; @@ -343,7 +343,7 @@ preprocess_text_thai (const hb_ot_shape_plan_t *plan, /* Ok, let's see... */ unsigned int start = end - 2; - while (start > 0 && IS_TONE_MARK (buffer->out_info[start - 1].codepoint)) + while (start > 0 && IS_ABOVE_BASE_MARK (buffer->out_info[start - 1].codepoint)) start--; if (start + 2 < end) @@ -371,7 +371,7 @@ preprocess_text_thai (const hb_ot_shape_plan_t *plan, do_thai_pua_shaping (plan, buffer, font); } -const hb_ot_complex_shaper_t _hb_ot_complex_shaper_thai = +const hb_ot_shaper_t _hb_ot_shaper_thai = { nullptr, /* collect_features */ nullptr, /* override_features */ diff --git a/thirdparty/harfbuzz/src/hb-ot-shaper-use-machine.hh b/thirdparty/harfbuzz/src/hb-ot-shaper-use-machine.hh new file mode 100644 index 0000000000..65e65ff39d --- /dev/null +++ b/thirdparty/harfbuzz/src/hb-ot-shaper-use-machine.hh @@ -0,0 +1,931 @@ + +#line 1 "hb-ot-shaper-use-machine.rl" +/* + * Copyright © 2015 Mozilla Foundation. + * Copyright © 2015 Google, Inc. + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Mozilla Author(s): Jonathan Kew + * Google Author(s): Behdad Esfahbod + */ + +#ifndef HB_OT_SHAPER_USE_MACHINE_HH +#define HB_OT_SHAPER_USE_MACHINE_HH + +#include "hb.hh" + +#include "hb-ot-shaper-syllabic.hh" + +/* buffer var allocations */ +#define use_category() ot_shaper_var_u8_category() + +#define USE(Cat) use_syllable_machine_ex_##Cat + +enum use_syllable_type_t { + use_virama_terminated_cluster, + use_sakot_terminated_cluster, + use_standard_cluster, + use_number_joiner_terminated_cluster, + use_numeral_cluster, + use_symbol_cluster, + use_hieroglyph_cluster, + use_broken_cluster, + use_non_cluster, +}; + + +#line 57 "hb-ot-shaper-use-machine.hh" +#define use_syllable_machine_ex_B 1u +#define use_syllable_machine_ex_CGJ 6u +#define use_syllable_machine_ex_CMAbv 31u +#define use_syllable_machine_ex_CMBlw 32u +#define use_syllable_machine_ex_CS 43u +#define use_syllable_machine_ex_FAbv 24u +#define use_syllable_machine_ex_FBlw 25u +#define use_syllable_machine_ex_FMAbv 45u +#define use_syllable_machine_ex_FMBlw 46u +#define use_syllable_machine_ex_FMPst 47u +#define use_syllable_machine_ex_FPst 26u +#define use_syllable_machine_ex_G 49u +#define use_syllable_machine_ex_GB 5u +#define use_syllable_machine_ex_H 12u +#define use_syllable_machine_ex_HN 13u +#define use_syllable_machine_ex_HVM 53u +#define use_syllable_machine_ex_IS 44u +#define use_syllable_machine_ex_J 50u +#define use_syllable_machine_ex_MAbv 27u +#define use_syllable_machine_ex_MBlw 28u +#define use_syllable_machine_ex_MPre 30u +#define use_syllable_machine_ex_MPst 29u +#define use_syllable_machine_ex_N 4u +#define use_syllable_machine_ex_O 0u +#define use_syllable_machine_ex_R 18u +#define use_syllable_machine_ex_SB 51u +#define use_syllable_machine_ex_SE 52u +#define use_syllable_machine_ex_SMAbv 41u +#define use_syllable_machine_ex_SMBlw 42u +#define use_syllable_machine_ex_SUB 11u +#define use_syllable_machine_ex_Sk 48u +#define use_syllable_machine_ex_VAbv 33u +#define use_syllable_machine_ex_VBlw 34u +#define use_syllable_machine_ex_VMAbv 37u +#define use_syllable_machine_ex_VMBlw 38u +#define use_syllable_machine_ex_VMPre 23u +#define use_syllable_machine_ex_VMPst 39u +#define use_syllable_machine_ex_VPre 22u +#define use_syllable_machine_ex_VPst 35u +#define use_syllable_machine_ex_WJ 16u +#define use_syllable_machine_ex_ZWNJ 14u + + +#line 101 "hb-ot-shaper-use-machine.hh" +static const unsigned char _use_syllable_machine_trans_keys[] = { + 0u, 53u, 11u, 53u, 11u, 53u, 1u, 53u, 23u, 48u, 24u, 47u, 25u, 47u, 26u, 47u, + 45u, 46u, 46u, 46u, 24u, 48u, 24u, 48u, 24u, 48u, 1u, 1u, 24u, 48u, 22u, 53u, + 23u, 53u, 23u, 53u, 23u, 53u, 12u, 53u, 23u, 53u, 12u, 53u, 12u, 53u, 12u, 53u, + 11u, 53u, 1u, 1u, 1u, 48u, 11u, 53u, 41u, 42u, 42u, 42u, 11u, 53u, 11u, 53u, + 1u, 53u, 23u, 48u, 24u, 47u, 25u, 47u, 26u, 47u, 45u, 46u, 46u, 46u, 24u, 48u, + 24u, 48u, 24u, 48u, 1u, 1u, 24u, 48u, 22u, 53u, 23u, 53u, 23u, 53u, 23u, 53u, + 12u, 53u, 23u, 53u, 12u, 53u, 12u, 53u, 12u, 53u, 11u, 53u, 1u, 1u, 1u, 48u, + 13u, 13u, 4u, 4u, 11u, 53u, 11u, 53u, 1u, 53u, 23u, 48u, 24u, 47u, 25u, 47u, + 26u, 47u, 45u, 46u, 46u, 46u, 24u, 48u, 24u, 48u, 24u, 48u, 1u, 1u, 24u, 48u, + 22u, 53u, 23u, 53u, 23u, 53u, 23u, 53u, 12u, 53u, 23u, 53u, 12u, 53u, 12u, 53u, + 12u, 53u, 11u, 53u, 1u, 1u, 1u, 48u, 11u, 53u, 11u, 53u, 1u, 53u, 23u, 48u, + 24u, 47u, 25u, 47u, 26u, 47u, 45u, 46u, 46u, 46u, 24u, 48u, 24u, 48u, 24u, 48u, + 1u, 1u, 24u, 48u, 22u, 53u, 23u, 53u, 23u, 53u, 23u, 53u, 12u, 53u, 23u, 53u, + 12u, 53u, 12u, 53u, 12u, 53u, 11u, 53u, 1u, 1u, 1u, 48u, 4u, 4u, 13u, 13u, + 1u, 53u, 11u, 53u, 41u, 42u, 42u, 42u, 1u, 5u, 50u, 52u, 49u, 52u, 49u, 51u, + 0 +}; + +static const char _use_syllable_machine_key_spans[] = { + 54, 43, 43, 53, 26, 24, 23, 22, + 2, 1, 25, 25, 25, 1, 25, 32, + 31, 31, 31, 42, 31, 42, 42, 42, + 43, 1, 48, 43, 2, 1, 43, 43, + 53, 26, 24, 23, 22, 2, 1, 25, + 25, 25, 1, 25, 32, 31, 31, 31, + 42, 31, 42, 42, 42, 43, 1, 48, + 1, 1, 43, 43, 53, 26, 24, 23, + 22, 2, 1, 25, 25, 25, 1, 25, + 32, 31, 31, 31, 42, 31, 42, 42, + 42, 43, 1, 48, 43, 43, 53, 26, + 24, 23, 22, 2, 1, 25, 25, 25, + 1, 25, 32, 31, 31, 31, 42, 31, + 42, 42, 42, 43, 1, 48, 1, 1, + 53, 43, 2, 1, 5, 3, 4, 3 +}; + +static const short _use_syllable_machine_index_offsets[] = { + 0, 55, 99, 143, 197, 224, 249, 273, + 296, 299, 301, 327, 353, 379, 381, 407, + 440, 472, 504, 536, 579, 611, 654, 697, + 740, 784, 786, 835, 879, 882, 884, 928, + 972, 1026, 1053, 1078, 1102, 1125, 1128, 1130, + 1156, 1182, 1208, 1210, 1236, 1269, 1301, 1333, + 1365, 1408, 1440, 1483, 1526, 1569, 1613, 1615, + 1664, 1666, 1668, 1712, 1756, 1810, 1837, 1862, + 1886, 1909, 1912, 1914, 1940, 1966, 1992, 1994, + 2020, 2053, 2085, 2117, 2149, 2192, 2224, 2267, + 2310, 2353, 2397, 2399, 2448, 2492, 2536, 2590, + 2617, 2642, 2666, 2689, 2692, 2694, 2720, 2746, + 2772, 2774, 2800, 2833, 2865, 2897, 2929, 2972, + 3004, 3047, 3090, 3133, 3177, 3179, 3228, 3230, + 3232, 3286, 3330, 3333, 3335, 3341, 3345, 3350 +}; + +static const unsigned char _use_syllable_machine_indicies[] = { + 0, 1, 2, 2, 3, 4, 2, 2, + 2, 2, 2, 5, 6, 7, 2, 2, + 2, 2, 8, 2, 2, 2, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 2, 23, 24, 25, + 2, 26, 27, 28, 29, 30, 31, 32, + 29, 33, 2, 34, 2, 35, 2, 37, + 38, 36, 36, 36, 36, 36, 36, 36, + 36, 36, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, + 36, 53, 54, 55, 36, 56, 57, 36, + 58, 59, 60, 61, 58, 36, 36, 36, + 36, 62, 36, 37, 38, 36, 36, 36, + 36, 36, 36, 36, 36, 36, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 49, + 49, 50, 51, 52, 36, 53, 54, 55, + 36, 36, 36, 36, 58, 59, 60, 61, + 58, 36, 36, 36, 36, 62, 36, 37, + 36, 36, 36, 36, 36, 36, 36, 36, + 36, 36, 36, 36, 36, 36, 36, 36, + 36, 36, 36, 36, 36, 40, 41, 42, + 43, 36, 36, 36, 36, 36, 36, 36, + 36, 36, 36, 53, 54, 55, 36, 36, + 36, 36, 36, 59, 60, 61, 63, 36, + 36, 36, 36, 40, 36, 40, 41, 42, + 43, 36, 36, 36, 36, 36, 36, 36, + 36, 36, 36, 53, 54, 55, 36, 36, + 36, 36, 36, 59, 60, 61, 63, 36, + 41, 42, 43, 36, 36, 36, 36, 36, + 36, 36, 36, 36, 36, 36, 36, 36, + 36, 36, 36, 36, 36, 59, 60, 61, + 36, 42, 43, 36, 36, 36, 36, 36, + 36, 36, 36, 36, 36, 36, 36, 36, + 36, 36, 36, 36, 36, 59, 60, 61, + 36, 43, 36, 36, 36, 36, 36, 36, + 36, 36, 36, 36, 36, 36, 36, 36, + 36, 36, 36, 36, 59, 60, 61, 36, + 59, 60, 36, 60, 36, 41, 42, 43, + 36, 36, 36, 36, 36, 36, 36, 36, + 36, 36, 53, 54, 55, 36, 36, 36, + 36, 36, 59, 60, 61, 63, 36, 41, + 42, 43, 36, 36, 36, 36, 36, 36, + 36, 36, 36, 36, 36, 54, 55, 36, + 36, 36, 36, 36, 59, 60, 61, 63, + 36, 41, 42, 43, 36, 36, 36, 36, + 36, 36, 36, 36, 36, 36, 36, 36, + 55, 36, 36, 36, 36, 36, 59, 60, + 61, 63, 36, 64, 36, 41, 42, 43, + 36, 36, 36, 36, 36, 36, 36, 36, + 36, 36, 36, 36, 36, 36, 36, 36, + 36, 36, 59, 60, 61, 63, 36, 39, + 40, 41, 42, 43, 36, 36, 36, 36, + 36, 36, 50, 51, 52, 36, 53, 54, + 55, 36, 36, 36, 36, 36, 59, 60, + 61, 63, 36, 36, 36, 36, 40, 36, + 40, 41, 42, 43, 36, 36, 36, 36, + 36, 36, 50, 51, 52, 36, 53, 54, + 55, 36, 36, 36, 36, 36, 59, 60, + 61, 63, 36, 36, 36, 36, 40, 36, + 40, 41, 42, 43, 36, 36, 36, 36, + 36, 36, 36, 51, 52, 36, 53, 54, + 55, 36, 36, 36, 36, 36, 59, 60, + 61, 63, 36, 36, 36, 36, 40, 36, + 40, 41, 42, 43, 36, 36, 36, 36, + 36, 36, 36, 36, 52, 36, 53, 54, + 55, 36, 36, 36, 36, 36, 59, 60, + 61, 63, 36, 36, 36, 36, 40, 36, + 65, 36, 36, 36, 36, 36, 36, 36, + 36, 36, 39, 40, 41, 42, 43, 36, + 45, 46, 36, 36, 36, 50, 51, 52, + 36, 53, 54, 55, 36, 36, 36, 36, + 36, 59, 60, 61, 63, 36, 36, 36, + 36, 40, 36, 40, 41, 42, 43, 36, + 36, 36, 36, 36, 36, 36, 36, 36, + 36, 53, 54, 55, 36, 36, 36, 36, + 36, 59, 60, 61, 63, 36, 36, 36, + 36, 40, 36, 65, 36, 36, 36, 36, + 36, 36, 36, 36, 36, 39, 40, 41, + 42, 43, 36, 36, 46, 36, 36, 36, + 50, 51, 52, 36, 53, 54, 55, 36, + 36, 36, 36, 36, 59, 60, 61, 63, + 36, 36, 36, 36, 40, 36, 65, 36, + 36, 36, 36, 36, 36, 36, 36, 36, + 39, 40, 41, 42, 43, 36, 36, 36, + 36, 36, 36, 50, 51, 52, 36, 53, + 54, 55, 36, 36, 36, 36, 36, 59, + 60, 61, 63, 36, 36, 36, 36, 40, + 36, 65, 36, 36, 36, 36, 36, 36, + 36, 36, 36, 39, 40, 41, 42, 43, + 44, 45, 46, 36, 36, 36, 50, 51, + 52, 36, 53, 54, 55, 36, 36, 36, + 36, 36, 59, 60, 61, 63, 36, 36, + 36, 36, 40, 36, 37, 38, 36, 36, + 36, 36, 36, 36, 36, 36, 36, 39, + 40, 41, 42, 43, 44, 45, 46, 47, + 36, 49, 50, 51, 52, 36, 53, 54, + 55, 36, 36, 36, 36, 58, 59, 60, + 61, 58, 36, 36, 36, 36, 62, 36, + 37, 36, 37, 36, 36, 36, 36, 36, + 36, 36, 36, 36, 36, 36, 36, 36, + 36, 36, 36, 36, 36, 36, 36, 36, + 40, 41, 42, 43, 36, 36, 36, 36, + 36, 36, 36, 36, 36, 36, 53, 54, + 55, 36, 36, 36, 36, 36, 59, 60, + 61, 63, 36, 37, 38, 36, 36, 36, + 36, 36, 36, 36, 36, 36, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 36, 53, 54, 55, + 36, 36, 36, 36, 58, 59, 60, 61, + 58, 36, 36, 36, 36, 62, 36, 56, + 57, 36, 57, 36, 67, 68, 66, 66, + 66, 66, 66, 66, 66, 66, 66, 69, + 70, 71, 72, 73, 74, 75, 76, 77, + 1, 78, 79, 80, 81, 66, 82, 83, + 84, 66, 66, 66, 66, 85, 86, 87, + 88, 89, 66, 66, 66, 66, 90, 66, + 67, 68, 66, 66, 66, 66, 66, 66, + 66, 66, 66, 69, 70, 71, 72, 73, + 74, 75, 76, 77, 78, 78, 79, 80, + 81, 66, 82, 83, 84, 66, 66, 66, + 66, 85, 86, 87, 88, 89, 66, 66, + 66, 66, 90, 66, 67, 66, 66, 66, + 66, 66, 66, 66, 66, 66, 66, 66, + 66, 66, 66, 66, 66, 66, 66, 66, + 66, 66, 70, 71, 72, 73, 66, 66, + 66, 66, 66, 66, 66, 66, 66, 66, + 82, 83, 84, 66, 66, 66, 66, 66, + 86, 87, 88, 91, 66, 66, 66, 66, + 70, 66, 70, 71, 72, 73, 66, 66, + 66, 66, 66, 66, 66, 66, 66, 66, + 82, 83, 84, 66, 66, 66, 66, 66, + 86, 87, 88, 91, 66, 71, 72, 73, + 66, 66, 66, 66, 66, 66, 66, 66, + 66, 66, 66, 66, 66, 66, 66, 66, + 66, 66, 86, 87, 88, 66, 72, 73, + 66, 66, 66, 66, 66, 66, 66, 66, + 66, 66, 66, 66, 66, 66, 66, 66, + 66, 66, 86, 87, 88, 66, 73, 66, + 66, 66, 66, 66, 66, 66, 66, 66, + 66, 66, 66, 66, 66, 66, 66, 66, + 66, 86, 87, 88, 66, 86, 87, 66, + 87, 66, 71, 72, 73, 66, 66, 66, + 66, 66, 66, 66, 66, 66, 66, 82, + 83, 84, 66, 66, 66, 66, 66, 86, + 87, 88, 91, 66, 71, 72, 73, 66, + 66, 66, 66, 66, 66, 66, 66, 66, + 66, 66, 83, 84, 66, 66, 66, 66, + 66, 86, 87, 88, 91, 66, 71, 72, + 73, 66, 66, 66, 66, 66, 66, 66, + 66, 66, 66, 66, 66, 84, 66, 66, + 66, 66, 66, 86, 87, 88, 91, 66, + 93, 92, 71, 72, 73, 66, 66, 66, + 66, 66, 66, 66, 66, 66, 66, 66, + 66, 66, 66, 66, 66, 66, 66, 86, + 87, 88, 91, 66, 69, 70, 71, 72, + 73, 66, 66, 66, 66, 66, 66, 79, + 80, 81, 66, 82, 83, 84, 66, 66, + 66, 66, 66, 86, 87, 88, 91, 66, + 66, 66, 66, 70, 66, 70, 71, 72, + 73, 66, 66, 66, 66, 66, 66, 79, + 80, 81, 66, 82, 83, 84, 66, 66, + 66, 66, 66, 86, 87, 88, 91, 66, + 66, 66, 66, 70, 66, 70, 71, 72, + 73, 66, 66, 66, 66, 66, 66, 66, + 80, 81, 66, 82, 83, 84, 66, 66, + 66, 66, 66, 86, 87, 88, 91, 66, + 66, 66, 66, 70, 66, 70, 71, 72, + 73, 66, 66, 66, 66, 66, 66, 66, + 66, 81, 66, 82, 83, 84, 66, 66, + 66, 66, 66, 86, 87, 88, 91, 66, + 66, 66, 66, 70, 66, 94, 66, 66, + 66, 66, 66, 66, 66, 66, 66, 69, + 70, 71, 72, 73, 66, 75, 76, 66, + 66, 66, 79, 80, 81, 66, 82, 83, + 84, 66, 66, 66, 66, 66, 86, 87, + 88, 91, 66, 66, 66, 66, 70, 66, + 70, 71, 72, 73, 66, 66, 66, 66, + 66, 66, 66, 66, 66, 66, 82, 83, + 84, 66, 66, 66, 66, 66, 86, 87, + 88, 91, 66, 66, 66, 66, 70, 66, + 94, 66, 66, 66, 66, 66, 66, 66, + 66, 66, 69, 70, 71, 72, 73, 66, + 66, 76, 66, 66, 66, 79, 80, 81, + 66, 82, 83, 84, 66, 66, 66, 66, + 66, 86, 87, 88, 91, 66, 66, 66, + 66, 70, 66, 94, 66, 66, 66, 66, + 66, 66, 66, 66, 66, 69, 70, 71, + 72, 73, 66, 66, 66, 66, 66, 66, + 79, 80, 81, 66, 82, 83, 84, 66, + 66, 66, 66, 66, 86, 87, 88, 91, + 66, 66, 66, 66, 70, 66, 94, 66, + 66, 66, 66, 66, 66, 66, 66, 66, + 69, 70, 71, 72, 73, 74, 75, 76, + 66, 66, 66, 79, 80, 81, 66, 82, + 83, 84, 66, 66, 66, 66, 66, 86, + 87, 88, 91, 66, 66, 66, 66, 70, + 66, 67, 68, 66, 66, 66, 66, 66, + 66, 66, 66, 66, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 66, 78, 79, + 80, 81, 66, 82, 83, 84, 66, 66, + 66, 66, 85, 86, 87, 88, 89, 66, + 66, 66, 66, 90, 66, 67, 95, 67, + 66, 66, 66, 66, 66, 66, 66, 66, + 66, 66, 66, 66, 66, 66, 66, 66, + 66, 66, 66, 66, 66, 70, 71, 72, + 73, 66, 66, 66, 66, 66, 66, 66, + 66, 66, 66, 82, 83, 84, 66, 66, + 66, 66, 66, 86, 87, 88, 91, 66, + 97, 96, 3, 98, 99, 100, 66, 66, + 66, 66, 66, 66, 66, 66, 66, 101, + 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 66, 115, 116, + 117, 66, 56, 57, 66, 118, 119, 120, + 88, 121, 66, 66, 66, 66, 122, 66, + 99, 100, 66, 66, 66, 66, 66, 66, + 66, 66, 66, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 111, 111, 112, 113, + 114, 66, 115, 116, 117, 66, 66, 66, + 66, 118, 119, 120, 88, 121, 66, 66, + 66, 66, 122, 66, 99, 66, 66, 66, + 66, 66, 66, 66, 66, 66, 66, 66, + 66, 66, 66, 66, 66, 66, 66, 66, + 66, 66, 102, 103, 104, 105, 66, 66, + 66, 66, 66, 66, 66, 66, 66, 66, + 115, 116, 117, 66, 66, 66, 66, 66, + 119, 120, 88, 123, 66, 66, 66, 66, + 102, 66, 102, 103, 104, 105, 66, 66, + 66, 66, 66, 66, 66, 66, 66, 66, + 115, 116, 117, 66, 66, 66, 66, 66, + 119, 120, 88, 123, 66, 103, 104, 105, + 66, 66, 66, 66, 66, 66, 66, 66, + 66, 66, 66, 66, 66, 66, 66, 66, + 66, 66, 119, 120, 88, 66, 104, 105, + 66, 66, 66, 66, 66, 66, 66, 66, + 66, 66, 66, 66, 66, 66, 66, 66, + 66, 66, 119, 120, 88, 66, 105, 66, + 66, 66, 66, 66, 66, 66, 66, 66, + 66, 66, 66, 66, 66, 66, 66, 66, + 66, 119, 120, 88, 66, 119, 120, 66, + 120, 66, 103, 104, 105, 66, 66, 66, + 66, 66, 66, 66, 66, 66, 66, 115, + 116, 117, 66, 66, 66, 66, 66, 119, + 120, 88, 123, 66, 103, 104, 105, 66, + 66, 66, 66, 66, 66, 66, 66, 66, + 66, 66, 116, 117, 66, 66, 66, 66, + 66, 119, 120, 88, 123, 66, 103, 104, + 105, 66, 66, 66, 66, 66, 66, 66, + 66, 66, 66, 66, 66, 117, 66, 66, + 66, 66, 66, 119, 120, 88, 123, 66, + 124, 92, 103, 104, 105, 66, 66, 66, + 66, 66, 66, 66, 66, 66, 66, 66, + 66, 66, 66, 66, 66, 66, 66, 119, + 120, 88, 123, 66, 101, 102, 103, 104, + 105, 66, 66, 66, 66, 66, 66, 112, + 113, 114, 66, 115, 116, 117, 66, 66, + 66, 66, 66, 119, 120, 88, 123, 66, + 66, 66, 66, 102, 66, 102, 103, 104, + 105, 66, 66, 66, 66, 66, 66, 112, + 113, 114, 66, 115, 116, 117, 66, 66, + 66, 66, 66, 119, 120, 88, 123, 66, + 66, 66, 66, 102, 66, 102, 103, 104, + 105, 66, 66, 66, 66, 66, 66, 66, + 113, 114, 66, 115, 116, 117, 66, 66, + 66, 66, 66, 119, 120, 88, 123, 66, + 66, 66, 66, 102, 66, 102, 103, 104, + 105, 66, 66, 66, 66, 66, 66, 66, + 66, 114, 66, 115, 116, 117, 66, 66, + 66, 66, 66, 119, 120, 88, 123, 66, + 66, 66, 66, 102, 66, 125, 66, 66, + 66, 66, 66, 66, 66, 66, 66, 101, + 102, 103, 104, 105, 66, 107, 108, 66, + 66, 66, 112, 113, 114, 66, 115, 116, + 117, 66, 66, 66, 66, 66, 119, 120, + 88, 123, 66, 66, 66, 66, 102, 66, + 102, 103, 104, 105, 66, 66, 66, 66, + 66, 66, 66, 66, 66, 66, 115, 116, + 117, 66, 66, 66, 66, 66, 119, 120, + 88, 123, 66, 66, 66, 66, 102, 66, + 125, 66, 66, 66, 66, 66, 66, 66, + 66, 66, 101, 102, 103, 104, 105, 66, + 66, 108, 66, 66, 66, 112, 113, 114, + 66, 115, 116, 117, 66, 66, 66, 66, + 66, 119, 120, 88, 123, 66, 66, 66, + 66, 102, 66, 125, 66, 66, 66, 66, + 66, 66, 66, 66, 66, 101, 102, 103, + 104, 105, 66, 66, 66, 66, 66, 66, + 112, 113, 114, 66, 115, 116, 117, 66, + 66, 66, 66, 66, 119, 120, 88, 123, + 66, 66, 66, 66, 102, 66, 125, 66, + 66, 66, 66, 66, 66, 66, 66, 66, + 101, 102, 103, 104, 105, 106, 107, 108, + 66, 66, 66, 112, 113, 114, 66, 115, + 116, 117, 66, 66, 66, 66, 66, 119, + 120, 88, 123, 66, 66, 66, 66, 102, + 66, 99, 100, 66, 66, 66, 66, 66, + 66, 66, 66, 66, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 66, 111, 112, + 113, 114, 66, 115, 116, 117, 66, 66, + 66, 66, 118, 119, 120, 88, 121, 66, + 66, 66, 66, 122, 66, 99, 95, 99, + 66, 66, 66, 66, 66, 66, 66, 66, + 66, 66, 66, 66, 66, 66, 66, 66, + 66, 66, 66, 66, 66, 102, 103, 104, + 105, 66, 66, 66, 66, 66, 66, 66, + 66, 66, 66, 115, 116, 117, 66, 66, + 66, 66, 66, 119, 120, 88, 123, 66, + 99, 100, 66, 66, 66, 66, 66, 66, + 66, 66, 66, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, + 114, 66, 115, 116, 117, 66, 66, 66, + 66, 118, 119, 120, 88, 121, 66, 66, + 66, 66, 122, 66, 5, 6, 126, 126, + 126, 126, 126, 126, 126, 126, 126, 9, + 10, 11, 12, 13, 14, 15, 16, 17, + 19, 19, 20, 21, 22, 126, 23, 24, + 25, 126, 126, 126, 126, 29, 30, 31, + 32, 29, 126, 126, 126, 126, 35, 126, + 5, 126, 126, 126, 126, 126, 126, 126, + 126, 126, 126, 126, 126, 126, 126, 126, + 126, 126, 126, 126, 126, 126, 10, 11, + 12, 13, 126, 126, 126, 126, 126, 126, + 126, 126, 126, 126, 23, 24, 25, 126, + 126, 126, 126, 126, 30, 31, 32, 127, + 126, 126, 126, 126, 10, 126, 10, 11, + 12, 13, 126, 126, 126, 126, 126, 126, + 126, 126, 126, 126, 23, 24, 25, 126, + 126, 126, 126, 126, 30, 31, 32, 127, + 126, 11, 12, 13, 126, 126, 126, 126, + 126, 126, 126, 126, 126, 126, 126, 126, + 126, 126, 126, 126, 126, 126, 30, 31, + 32, 126, 12, 13, 126, 126, 126, 126, + 126, 126, 126, 126, 126, 126, 126, 126, + 126, 126, 126, 126, 126, 126, 30, 31, + 32, 126, 13, 126, 126, 126, 126, 126, + 126, 126, 126, 126, 126, 126, 126, 126, + 126, 126, 126, 126, 126, 30, 31, 32, + 126, 30, 31, 126, 31, 126, 11, 12, + 13, 126, 126, 126, 126, 126, 126, 126, + 126, 126, 126, 23, 24, 25, 126, 126, + 126, 126, 126, 30, 31, 32, 127, 126, + 11, 12, 13, 126, 126, 126, 126, 126, + 126, 126, 126, 126, 126, 126, 24, 25, + 126, 126, 126, 126, 126, 30, 31, 32, + 127, 126, 11, 12, 13, 126, 126, 126, + 126, 126, 126, 126, 126, 126, 126, 126, + 126, 25, 126, 126, 126, 126, 126, 30, + 31, 32, 127, 126, 128, 126, 11, 12, + 13, 126, 126, 126, 126, 126, 126, 126, + 126, 126, 126, 126, 126, 126, 126, 126, + 126, 126, 126, 30, 31, 32, 127, 126, + 9, 10, 11, 12, 13, 126, 126, 126, + 126, 126, 126, 20, 21, 22, 126, 23, + 24, 25, 126, 126, 126, 126, 126, 30, + 31, 32, 127, 126, 126, 126, 126, 10, + 126, 10, 11, 12, 13, 126, 126, 126, + 126, 126, 126, 20, 21, 22, 126, 23, + 24, 25, 126, 126, 126, 126, 126, 30, + 31, 32, 127, 126, 126, 126, 126, 10, + 126, 10, 11, 12, 13, 126, 126, 126, + 126, 126, 126, 126, 21, 22, 126, 23, + 24, 25, 126, 126, 126, 126, 126, 30, + 31, 32, 127, 126, 126, 126, 126, 10, + 126, 10, 11, 12, 13, 126, 126, 126, + 126, 126, 126, 126, 126, 22, 126, 23, + 24, 25, 126, 126, 126, 126, 126, 30, + 31, 32, 127, 126, 126, 126, 126, 10, + 126, 129, 126, 126, 126, 126, 126, 126, + 126, 126, 126, 9, 10, 11, 12, 13, + 126, 15, 16, 126, 126, 126, 20, 21, + 22, 126, 23, 24, 25, 126, 126, 126, + 126, 126, 30, 31, 32, 127, 126, 126, + 126, 126, 10, 126, 10, 11, 12, 13, + 126, 126, 126, 126, 126, 126, 126, 126, + 126, 126, 23, 24, 25, 126, 126, 126, + 126, 126, 30, 31, 32, 127, 126, 126, + 126, 126, 10, 126, 129, 126, 126, 126, + 126, 126, 126, 126, 126, 126, 9, 10, + 11, 12, 13, 126, 126, 16, 126, 126, + 126, 20, 21, 22, 126, 23, 24, 25, + 126, 126, 126, 126, 126, 30, 31, 32, + 127, 126, 126, 126, 126, 10, 126, 129, + 126, 126, 126, 126, 126, 126, 126, 126, + 126, 9, 10, 11, 12, 13, 126, 126, + 126, 126, 126, 126, 20, 21, 22, 126, + 23, 24, 25, 126, 126, 126, 126, 126, + 30, 31, 32, 127, 126, 126, 126, 126, + 10, 126, 129, 126, 126, 126, 126, 126, + 126, 126, 126, 126, 9, 10, 11, 12, + 13, 14, 15, 16, 126, 126, 126, 20, + 21, 22, 126, 23, 24, 25, 126, 126, + 126, 126, 126, 30, 31, 32, 127, 126, + 126, 126, 126, 10, 126, 5, 6, 126, + 126, 126, 126, 126, 126, 126, 126, 126, + 9, 10, 11, 12, 13, 14, 15, 16, + 17, 126, 19, 20, 21, 22, 126, 23, + 24, 25, 126, 126, 126, 126, 29, 30, + 31, 32, 29, 126, 126, 126, 126, 35, + 126, 5, 126, 5, 126, 126, 126, 126, + 126, 126, 126, 126, 126, 126, 126, 126, + 126, 126, 126, 126, 126, 126, 126, 126, + 126, 10, 11, 12, 13, 126, 126, 126, + 126, 126, 126, 126, 126, 126, 126, 23, + 24, 25, 126, 126, 126, 126, 126, 30, + 31, 32, 127, 126, 130, 126, 7, 126, + 1, 126, 126, 126, 1, 126, 126, 126, + 126, 126, 5, 6, 7, 126, 126, 126, + 126, 126, 126, 126, 126, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 126, 23, 24, 25, 126, + 26, 27, 126, 29, 30, 31, 32, 29, + 126, 126, 126, 126, 35, 126, 5, 6, + 126, 126, 126, 126, 126, 126, 126, 126, + 126, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 126, + 23, 24, 25, 126, 126, 126, 126, 29, + 30, 31, 32, 29, 126, 126, 126, 126, + 35, 126, 26, 27, 126, 27, 126, 1, + 131, 131, 131, 1, 131, 133, 132, 33, + 132, 33, 133, 132, 133, 132, 33, 132, + 34, 132, 0 +}; + +static const char _use_syllable_machine_trans_targs[] = { + 1, 30, 0, 56, 58, 85, 86, 110, + 112, 98, 87, 88, 89, 90, 102, 104, + 105, 106, 113, 107, 99, 100, 101, 93, + 94, 95, 114, 115, 116, 108, 91, 92, + 0, 117, 119, 109, 0, 2, 3, 15, + 4, 5, 6, 7, 19, 21, 22, 23, + 27, 24, 16, 17, 18, 10, 11, 12, + 28, 29, 25, 8, 9, 0, 26, 13, + 14, 20, 0, 31, 32, 44, 33, 34, + 35, 36, 48, 50, 51, 52, 53, 45, + 46, 47, 39, 40, 41, 54, 37, 38, + 0, 54, 55, 42, 0, 43, 49, 0, + 0, 57, 0, 59, 60, 72, 61, 62, + 63, 64, 76, 78, 79, 80, 84, 81, + 73, 74, 75, 67, 68, 69, 82, 65, + 66, 82, 83, 70, 71, 77, 0, 96, + 97, 103, 111, 0, 0, 118 +}; + +static const char _use_syllable_machine_trans_actions[] = { + 0, 0, 3, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 6, 0, 0, + 0, 0, 7, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 8, 0, 0, + 9, 10, 0, 0, 11, 0, 0, 12, + 13, 0, 14, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 8, 0, + 0, 10, 0, 0, 0, 0, 15, 0, + 0, 0, 0, 16, 17, 0 +}; + +static const char _use_syllable_machine_to_state_actions[] = { + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0 +}; + +static const char _use_syllable_machine_from_state_actions[] = { + 2, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0 +}; + +static const short _use_syllable_machine_eof_trans[] = { + 0, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 67, 67, + 67, 67, 67, 67, 67, 67, 67, 67, + 67, 67, 93, 67, 67, 67, 67, 67, + 67, 67, 67, 67, 67, 67, 96, 67, + 97, 99, 67, 67, 67, 67, 67, 67, + 67, 67, 67, 67, 67, 67, 93, 67, + 67, 67, 67, 67, 67, 67, 67, 67, + 67, 67, 96, 67, 67, 127, 127, 127, + 127, 127, 127, 127, 127, 127, 127, 127, + 127, 127, 127, 127, 127, 127, 127, 127, + 127, 127, 127, 127, 127, 127, 127, 127, + 127, 127, 127, 127, 132, 133, 133, 133 +}; + +static const int use_syllable_machine_start = 0; +static const int use_syllable_machine_first_final = 0; +static const int use_syllable_machine_error = -1; + +static const int use_syllable_machine_en_main = 0; + + +#line 58 "hb-ot-shaper-use-machine.rl" + + + +#line 182 "hb-ot-shaper-use-machine.rl" + + +#define found_syllable(syllable_type) \ + HB_STMT_START { \ + if (0) fprintf (stderr, "syllable %d..%d %s\n", (*ts).second.first, (*te).second.first, #syllable_type); \ + for (unsigned i = (*ts).second.first; i < (*te).second.first; ++i) \ + info[i].syllable() = (syllable_serial << 4) | syllable_type; \ + syllable_serial++; \ + if (unlikely (syllable_serial == 16)) syllable_serial = 1; \ + } HB_STMT_END + + +template <typename Iter> +struct machine_index_t : + hb_iter_with_fallback_t<machine_index_t<Iter>, + typename Iter::item_t> +{ + machine_index_t (const Iter& it) : it (it) {} + machine_index_t (const machine_index_t& o) : hb_iter_with_fallback_t<machine_index_t<Iter>, + typename Iter::item_t> (), + it (o.it), is_null (o.is_null) {} + + static constexpr bool is_random_access_iterator = Iter::is_random_access_iterator; + static constexpr bool is_sorted_iterator = Iter::is_sorted_iterator; + + typename Iter::item_t __item__ () const { return *it; } + typename Iter::item_t __item_at__ (unsigned i) const { return it[i]; } + unsigned __len__ () const { return it.len (); } + void __next__ () { ++it; } + void __forward__ (unsigned n) { it += n; } + void __prev__ () { --it; } + void __rewind__ (unsigned n) { it -= n; } + + void operator = (unsigned n) + { + assert (n == 0); + is_null = true; + } + explicit operator bool () { return !is_null; } + + void operator = (const machine_index_t& o) + { + is_null = o.is_null; + unsigned index = (*it).first; + unsigned n = (*o.it).first; + if (index < n) it += n - index; else if (index > n) it -= index - n; + } + bool operator == (const machine_index_t& o) const + { return is_null ? o.is_null : !o.is_null && (*it).first == (*o.it).first; } + bool operator != (const machine_index_t& o) const { return !(*this == o); } + + private: + Iter it; + bool is_null = false; +}; +struct +{ + template <typename Iter, + hb_requires (hb_is_iterable (Iter))> + machine_index_t<hb_iter_type<Iter>> + operator () (Iter&& it) const + { return machine_index_t<hb_iter_type<Iter>> (hb_iter (it)); } +} +HB_FUNCOBJ (machine_index); + + + +static bool +not_ccs_default_ignorable (const hb_glyph_info_t &i) +{ return i.use_category() != USE(CGJ); } + +static inline void +find_syllables_use (hb_buffer_t *buffer) +{ + hb_glyph_info_t *info = buffer->info; + auto p = + + hb_iter (info, buffer->len) + | hb_enumerate + | hb_filter ([] (const hb_glyph_info_t &i) { return not_ccs_default_ignorable (i); }, + hb_second) + | hb_filter ([&] (const hb_pair_t<unsigned, const hb_glyph_info_t &> p) + { + if (p.second.use_category() == USE(ZWNJ)) + for (unsigned i = p.first + 1; i < buffer->len; ++i) + if (not_ccs_default_ignorable (info[i])) + return !_hb_glyph_info_is_unicode_mark (&info[i]); + return true; + }) + | hb_enumerate + | machine_index + ; + auto pe = p + p.len (); + auto eof = +pe; + auto ts = +p; + auto te = +p; + unsigned int act HB_UNUSED; + int cs; + +#line 784 "hb-ot-shaper-use-machine.hh" + { + cs = use_syllable_machine_start; + ts = 0; + te = 0; + act = 0; + } + +#line 282 "hb-ot-shaper-use-machine.rl" + + + unsigned int syllable_serial = 1; + +#line 797 "hb-ot-shaper-use-machine.hh" + { + int _slen; + int _trans; + const unsigned char *_keys; + const unsigned char *_inds; + if ( p == pe ) + goto _test_eof; +_resume: + switch ( _use_syllable_machine_from_state_actions[cs] ) { + case 2: +#line 1 "NONE" + {ts = p;} + break; +#line 811 "hb-ot-shaper-use-machine.hh" + } + + _keys = _use_syllable_machine_trans_keys + (cs<<1); + _inds = _use_syllable_machine_indicies + _use_syllable_machine_index_offsets[cs]; + + _slen = _use_syllable_machine_key_spans[cs]; + _trans = _inds[ _slen > 0 && _keys[0] <=( (*p).second.second.use_category()) && + ( (*p).second.second.use_category()) <= _keys[1] ? + ( (*p).second.second.use_category()) - _keys[0] : _slen ]; + +_eof_trans: + cs = _use_syllable_machine_trans_targs[_trans]; + + if ( _use_syllable_machine_trans_actions[_trans] == 0 ) + goto _again; + + switch ( _use_syllable_machine_trans_actions[_trans] ) { + case 9: +#line 172 "hb-ot-shaper-use-machine.rl" + {te = p+1;{ found_syllable (use_standard_cluster); }} + break; + case 6: +#line 175 "hb-ot-shaper-use-machine.rl" + {te = p+1;{ found_syllable (use_symbol_cluster); }} + break; + case 4: +#line 177 "hb-ot-shaper-use-machine.rl" + {te = p+1;{ found_syllable (use_broken_cluster); buffer->scratch_flags |= HB_BUFFER_SCRATCH_FLAG_HAS_BROKEN_SYLLABLE; }} + break; + case 3: +#line 178 "hb-ot-shaper-use-machine.rl" + {te = p+1;{ found_syllable (use_non_cluster); }} + break; + case 11: +#line 171 "hb-ot-shaper-use-machine.rl" + {te = p;p--;{ found_syllable (use_sakot_terminated_cluster); }} + break; + case 7: +#line 172 "hb-ot-shaper-use-machine.rl" + {te = p;p--;{ found_syllable (use_standard_cluster); }} + break; + case 14: +#line 173 "hb-ot-shaper-use-machine.rl" + {te = p;p--;{ found_syllable (use_number_joiner_terminated_cluster); }} + break; + case 13: +#line 174 "hb-ot-shaper-use-machine.rl" + {te = p;p--;{ found_syllable (use_numeral_cluster); }} + break; + case 5: +#line 175 "hb-ot-shaper-use-machine.rl" + {te = p;p--;{ found_syllable (use_symbol_cluster); }} + break; + case 17: +#line 176 "hb-ot-shaper-use-machine.rl" + {te = p;p--;{ found_syllable (use_hieroglyph_cluster); }} + break; + case 15: +#line 177 "hb-ot-shaper-use-machine.rl" + {te = p;p--;{ found_syllable (use_broken_cluster); buffer->scratch_flags |= HB_BUFFER_SCRATCH_FLAG_HAS_BROKEN_SYLLABLE; }} + break; + case 16: +#line 178 "hb-ot-shaper-use-machine.rl" + {te = p;p--;{ found_syllable (use_non_cluster); }} + break; + case 12: +#line 1 "NONE" + { switch( act ) { + case 1: + {{p = ((te))-1;} found_syllable (use_virama_terminated_cluster); } + break; + case 2: + {{p = ((te))-1;} found_syllable (use_sakot_terminated_cluster); } + break; + } + } + break; + case 8: +#line 1 "NONE" + {te = p+1;} +#line 170 "hb-ot-shaper-use-machine.rl" + {act = 1;} + break; + case 10: +#line 1 "NONE" + {te = p+1;} +#line 171 "hb-ot-shaper-use-machine.rl" + {act = 2;} + break; +#line 901 "hb-ot-shaper-use-machine.hh" + } + +_again: + switch ( _use_syllable_machine_to_state_actions[cs] ) { + case 1: +#line 1 "NONE" + {ts = 0;} + break; +#line 910 "hb-ot-shaper-use-machine.hh" + } + + if ( ++p != pe ) + goto _resume; + _test_eof: {} + if ( p == eof ) + { + if ( _use_syllable_machine_eof_trans[cs] > 0 ) { + _trans = _use_syllable_machine_eof_trans[cs] - 1; + goto _eof_trans; + } + } + + } + +#line 287 "hb-ot-shaper-use-machine.rl" + +} + +#undef found_syllable + +#endif /* HB_OT_SHAPER_USE_MACHINE_HH */ diff --git a/thirdparty/harfbuzz/src/hb-ot-shape-complex-use-table.hh b/thirdparty/harfbuzz/src/hb-ot-shaper-use-table.hh index c8e5151694..5aa025fb4c 100644 --- a/thirdparty/harfbuzz/src/hb-ot-shape-complex-use-table.hh +++ b/thirdparty/harfbuzz/src/hb-ot-shaper-use-table.hh @@ -37,12 +37,12 @@ * UnicodeData.txt does not have a header. */ -#ifndef HB_OT_SHAPE_COMPLEX_USE_TABLE_HH -#define HB_OT_SHAPE_COMPLEX_USE_TABLE_HH +#ifndef HB_OT_SHAPER_USE_TABLE_HH +#define HB_OT_SHAPER_USE_TABLE_HH #include "hb.hh" -#include "hb-ot-shape-complex-use-machine.hh" +#include "hb-ot-shaper-use-machine.hh" #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-macros" @@ -53,6 +53,7 @@ #define GB USE(GB) /* BASE_OTHER */ #define H USE(H) /* HALANT */ #define HN USE(HN) /* HALANT_NUM */ +#define HVM USE(HVM) /* HALANT_OR_VOWEL_MODIFIER */ #define IS USE(IS) /* INVISIBLE_STACKER */ #define J USE(J) /* HIEROGLYPH_JOINER */ #define N USE(N) /* BASE_NUM */ @@ -246,7 +247,7 @@ static const uint8_t use_table[] = { /* 0D90 */ B, B, B, B, B, B, B, WJ, WJ, WJ, B, B, B, B, B, B, /* 0DA0 */ B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, /* 0DB0 */ B, B, WJ, B, B, B, B, B, B, B, B, B, WJ, B, WJ, WJ, - /* 0DC0 */ B, B, B, B, B, B, B, WJ, WJ, WJ, H, WJ, WJ, WJ, WJ, VPst, + /* 0DC0 */ B, B, B, B, B, B, B, WJ, WJ, WJ, HVM, WJ, WJ, WJ, WJ, VPst, /* 0DD0 */ VPst, VPst, VAbv, VAbv, VBlw, WJ, VBlw, WJ, VPst, VPre, VPre, VPre, VPre, VPre, VPre, VPst, /* 0DE0 */ WJ, WJ, WJ, WJ, WJ, WJ, B, B, B, B, B, B, B, B, B, B, /* 0DF0 */ WJ, WJ, VPst, VPst, O, WJ, WJ, WJ, @@ -1531,6 +1532,7 @@ hb_use_get_category (hb_glyph_info_t info) #undef GB #undef H #undef HN +#undef HVM #undef IS #undef J #undef N @@ -1566,5 +1568,5 @@ hb_use_get_category (hb_glyph_info_t info) #undef VMPre -#endif /* HB_OT_SHAPE_COMPLEX_USE_TABLE_HH */ +#endif /* HB_OT_SHAPER_USE_TABLE_HH */ /* == End of generated table == */ diff --git a/thirdparty/harfbuzz/src/hb-ot-shape-complex-use.cc b/thirdparty/harfbuzz/src/hb-ot-shaper-use.cc index 1d13c8a126..60394ed4d8 100644 --- a/thirdparty/harfbuzz/src/hb-ot-shape-complex-use.cc +++ b/thirdparty/harfbuzz/src/hb-ot-shaper-use.cc @@ -30,11 +30,11 @@ #ifndef HB_NO_OT_SHAPE -#include "hb-ot-shape-complex-use-machine.hh" -#include "hb-ot-shape-complex-use-table.hh" -#include "hb-ot-shape-complex-arabic.hh" -#include "hb-ot-shape-complex-arabic-joining-list.hh" -#include "hb-ot-shape-complex-vowel-constraints.hh" +#include "hb-ot-shaper-use-machine.hh" +#include "hb-ot-shaper-use-table.hh" +#include "hb-ot-shaper-arabic.hh" +#include "hb-ot-shaper-arabic-joining-list.hh" +#include "hb-ot-shaper-vowel-constraints.hh" /* @@ -133,6 +133,7 @@ collect_features_use (hb_ot_shape_planner_t *plan) map->enable_feature (use_basic_features[i], F_MANUAL_ZWJ | F_PER_SYLLABLE); map->add_gsub_pause (reorder_use); + map->add_gsub_pause (hb_syllabic_clear_var); // Don't need syllables anymore, use stop to free buffer var /* "Topographical features" */ for (unsigned int i = 0; i < ARRAY_LENGTH (use_topographical_features); i++) @@ -297,6 +298,7 @@ setup_syllables_use (const hb_ot_shape_plan_t *plan, hb_font_t *font HB_UNUSED, hb_buffer_t *buffer) { + HB_BUFFER_ALLOCATE_VAR (buffer, syllable); find_syllables_use (buffer); foreach_syllable (buffer, start, end) buffer->unsafe_to_break (start, end); @@ -349,7 +351,7 @@ record_pref_use (const hb_ot_shape_plan_t *plan HB_UNUSED, static inline bool is_halant_use (const hb_glyph_info_t &info) { - return (info.use_category() == USE(H) || info.use_category() == USE(IS)) && + return (info.use_category() == USE(H) || info.use_category() == USE(HVM) || info.use_category() == USE(IS)) && !_hb_glyph_info_ligated (&info); } @@ -480,7 +482,7 @@ compose_use (const hb_ot_shape_normalize_context_t *c, } -const hb_ot_complex_shaper_t _hb_ot_complex_shaper_use = +const hb_ot_shaper_t _hb_ot_shaper_use = { collect_features_use, nullptr, /* override_features */ diff --git a/thirdparty/harfbuzz/src/hb-ot-shape-complex-vowel-constraints.cc b/thirdparty/harfbuzz/src/hb-ot-shaper-vowel-constraints.cc index d2cca105a4..be4ac813b1 100644 --- a/thirdparty/harfbuzz/src/hb-ot-shape-complex-vowel-constraints.cc +++ b/thirdparty/harfbuzz/src/hb-ot-shaper-vowel-constraints.cc @@ -18,7 +18,7 @@ #ifndef HB_NO_OT_SHAPE -#include "hb-ot-shape-complex-vowel-constraints.hh" +#include "hb-ot-shaper-vowel-constraints.hh" static void _output_dotted_circle (hb_buffer_t *buffer) @@ -39,7 +39,7 @@ _hb_preprocess_text_vowel_constraints (const hb_ot_shape_plan_t *plan HB_UNUSED, hb_buffer_t *buffer, hb_font_t *font HB_UNUSED) { -#ifdef HB_NO_OT_SHAPE_COMPLEX_VOWEL_CONSTRAINTS +#ifdef HB_NO_OT_SHAPER_VOWEL_CONSTRAINTS return; #endif if (buffer->flags & HB_BUFFER_FLAG_DO_NOT_INSERT_DOTTED_CIRCLE) diff --git a/thirdparty/harfbuzz/src/hb-ot-shape-complex-vowel-constraints.hh b/thirdparty/harfbuzz/src/hb-ot-shaper-vowel-constraints.hh index d9082d4ead..5a7ee1b0f2 100644 --- a/thirdparty/harfbuzz/src/hb-ot-shape-complex-vowel-constraints.hh +++ b/thirdparty/harfbuzz/src/hb-ot-shaper-vowel-constraints.hh @@ -24,16 +24,16 @@ * Google Author(s): Behdad Esfahbod */ -#ifndef HB_OT_SHAPE_COMPLEX_VOWEL_CONSTRAINTS_HH -#define HB_OT_SHAPE_COMPLEX_VOWEL_CONSTRAINTS_HH +#ifndef HB_OT_SHAPER_VOWEL_CONSTRAINTS_HH +#define HB_OT_SHAPER_VOWEL_CONSTRAINTS_HH #include "hb.hh" -#include "hb-ot-shape-complex.hh" +#include "hb-ot-shaper.hh" HB_INTERNAL void _hb_preprocess_text_vowel_constraints (const hb_ot_shape_plan_t *plan, hb_buffer_t *buffer, hb_font_t *font); -#endif /* HB_OT_SHAPE_COMPLEX_VOWEL_CONSTRAINTS_HH */ +#endif /* HB_OT_SHAPER_VOWEL_CONSTRAINTS_HH */ diff --git a/thirdparty/harfbuzz/src/hb-ot-shape-complex.hh b/thirdparty/harfbuzz/src/hb-ot-shaper.hh index 8012a9ae94..b823bf003c 100644 --- a/thirdparty/harfbuzz/src/hb-ot-shape-complex.hh +++ b/thirdparty/harfbuzz/src/hb-ot-shaper.hh @@ -24,8 +24,8 @@ * Google Author(s): Behdad Esfahbod */ -#ifndef HB_OT_SHAPE_COMPLEX_HH -#define HB_OT_SHAPE_COMPLEX_HH +#ifndef HB_OT_SHAPER_HH +#define HB_OT_SHAPER_HH #include "hb.hh" @@ -34,12 +34,12 @@ #include "hb-ot-shape-normalize.hh" -/* buffer var allocations, used by complex shapers */ -#define complex_var_u8_category() var2.u8[2] -#define complex_var_u8_auxiliary() var2.u8[3] +/* buffer var allocations, used by all OT shapers */ +#define ot_shaper_var_u8_category() var2.u8[2] +#define ot_shaper_var_u8_auxiliary() var2.u8[3] -#define HB_OT_SHAPE_COMPLEX_MAX_COMBINING_MARKS 32 +#define HB_OT_SHAPE_MAX_COMBINING_MARKS 32 enum hb_ot_shape_zero_width_marks_type_t { HB_OT_SHAPE_ZERO_WIDTH_MARKS_NONE, @@ -49,22 +49,22 @@ enum hb_ot_shape_zero_width_marks_type_t { /* Master OT shaper list */ -#define HB_COMPLEX_SHAPERS_IMPLEMENT_SHAPERS \ - HB_COMPLEX_SHAPER_IMPLEMENT (arabic) \ - HB_COMPLEX_SHAPER_IMPLEMENT (default) \ - HB_COMPLEX_SHAPER_IMPLEMENT (dumber) \ - HB_COMPLEX_SHAPER_IMPLEMENT (hangul) \ - HB_COMPLEX_SHAPER_IMPLEMENT (hebrew) \ - HB_COMPLEX_SHAPER_IMPLEMENT (indic) \ - HB_COMPLEX_SHAPER_IMPLEMENT (khmer) \ - HB_COMPLEX_SHAPER_IMPLEMENT (myanmar) \ - HB_COMPLEX_SHAPER_IMPLEMENT (myanmar_zawgyi) \ - HB_COMPLEX_SHAPER_IMPLEMENT (thai) \ - HB_COMPLEX_SHAPER_IMPLEMENT (use) \ +#define HB_OT_SHAPERS_IMPLEMENT_SHAPERS \ + HB_OT_SHAPER_IMPLEMENT (arabic) \ + HB_OT_SHAPER_IMPLEMENT (default) \ + HB_OT_SHAPER_IMPLEMENT (dumber) \ + HB_OT_SHAPER_IMPLEMENT (hangul) \ + HB_OT_SHAPER_IMPLEMENT (hebrew) \ + HB_OT_SHAPER_IMPLEMENT (indic) \ + HB_OT_SHAPER_IMPLEMENT (khmer) \ + HB_OT_SHAPER_IMPLEMENT (myanmar) \ + HB_OT_SHAPER_IMPLEMENT (myanmar_zawgyi) \ + HB_OT_SHAPER_IMPLEMENT (thai) \ + HB_OT_SHAPER_IMPLEMENT (use) \ /* ^--- Add new shapers here; keep sorted. */ -struct hb_ot_complex_shaper_t +struct hb_ot_shaper_t { /* collect_features() * Called during shape_plan(). @@ -168,18 +168,18 @@ struct hb_ot_complex_shaper_t bool fallback_position; }; -#define HB_COMPLEX_SHAPER_IMPLEMENT(name) extern HB_INTERNAL const hb_ot_complex_shaper_t _hb_ot_complex_shaper_##name; -HB_COMPLEX_SHAPERS_IMPLEMENT_SHAPERS -#undef HB_COMPLEX_SHAPER_IMPLEMENT +#define HB_OT_SHAPER_IMPLEMENT(name) extern HB_INTERNAL const hb_ot_shaper_t _hb_ot_shaper_##name; +HB_OT_SHAPERS_IMPLEMENT_SHAPERS +#undef HB_OT_SHAPER_IMPLEMENT -static inline const hb_ot_complex_shaper_t * -hb_ot_shape_complex_categorize (const hb_ot_shape_planner_t *planner) +static inline const hb_ot_shaper_t * +hb_ot_shaper_categorize (const hb_ot_shape_planner_t *planner) { switch ((hb_tag_t) planner->props.script) { default: - return &_hb_ot_complex_shaper_default; + return &_hb_ot_shaper_default; /* Unicode-1.1 additions */ @@ -195,28 +195,28 @@ hb_ot_shape_complex_categorize (const hb_ot_shape_planner_t *planner) if ((planner->map.chosen_script[0] != HB_OT_TAG_DEFAULT_SCRIPT || planner->props.script == HB_SCRIPT_ARABIC) && HB_DIRECTION_IS_HORIZONTAL(planner->props.direction)) - return &_hb_ot_complex_shaper_arabic; + return &_hb_ot_shaper_arabic; else - return &_hb_ot_complex_shaper_default; + return &_hb_ot_shaper_default; /* Unicode-1.1 additions */ case HB_SCRIPT_THAI: case HB_SCRIPT_LAO: - return &_hb_ot_complex_shaper_thai; + return &_hb_ot_shaper_thai; /* Unicode-1.1 additions */ case HB_SCRIPT_HANGUL: - return &_hb_ot_complex_shaper_hangul; + return &_hb_ot_shaper_hangul; /* Unicode-1.1 additions */ case HB_SCRIPT_HEBREW: - return &_hb_ot_complex_shaper_hebrew; + return &_hb_ot_shaper_hebrew; /* Unicode-1.1 additions */ @@ -230,9 +230,6 @@ hb_ot_shape_complex_categorize (const hb_ot_shape_planner_t *planner) case HB_SCRIPT_TAMIL: case HB_SCRIPT_TELUGU: - /* Unicode-3.0 additions */ - case HB_SCRIPT_SINHALA: - /* If the designer designed the font for the 'DFLT' script, * (or we ended up arbitrarily pick 'latn'), use the default shaper. * Otherwise, use the specific shaper. @@ -240,14 +237,14 @@ hb_ot_shape_complex_categorize (const hb_ot_shape_planner_t *planner) * If it's indy3 tag, send to USE. */ if (planner->map.chosen_script[0] == HB_TAG ('D','F','L','T') || planner->map.chosen_script[0] == HB_TAG ('l','a','t','n')) - return &_hb_ot_complex_shaper_default; + return &_hb_ot_shaper_default; else if ((planner->map.chosen_script[0] & 0x000000FF) == '3') - return &_hb_ot_complex_shaper_use; + return &_hb_ot_shaper_use; else - return &_hb_ot_complex_shaper_indic; + return &_hb_ot_shaper_indic; case HB_SCRIPT_KHMER: - return &_hb_ot_complex_shaper_khmer; + return &_hb_ot_shaper_khmer; case HB_SCRIPT_MYANMAR: /* If the designer designed the font for the 'DFLT' script, @@ -260,16 +257,16 @@ hb_ot_shape_complex_categorize (const hb_ot_shape_planner_t *planner) if (planner->map.chosen_script[0] == HB_TAG ('D','F','L','T') || planner->map.chosen_script[0] == HB_TAG ('l','a','t','n') || planner->map.chosen_script[0] == HB_TAG ('m','y','m','r')) - return &_hb_ot_complex_shaper_default; + return &_hb_ot_shaper_default; else - return &_hb_ot_complex_shaper_myanmar; + return &_hb_ot_shaper_myanmar; #define HB_SCRIPT_MYANMAR_ZAWGYI ((hb_script_t) HB_TAG ('Q','a','a','g')) case HB_SCRIPT_MYANMAR_ZAWGYI: /* https://github.com/harfbuzz/harfbuzz/issues/1162 */ - return &_hb_ot_complex_shaper_myanmar_zawgyi; + return &_hb_ot_shaper_myanmar_zawgyi; /* Unicode-2.0 additions */ @@ -277,7 +274,7 @@ hb_ot_shape_complex_categorize (const hb_ot_shape_planner_t *planner) /* Unicode-3.0 additions */ case HB_SCRIPT_MONGOLIAN: - //case HB_SCRIPT_SINHALA: + case HB_SCRIPT_SINHALA: /* Unicode-3.2 additions */ case HB_SCRIPT_BUHID: @@ -390,11 +387,11 @@ hb_ot_shape_complex_categorize (const hb_ot_shape_planner_t *planner) * GSUB/GPOS needed, so there may be no scripts found! */ if (planner->map.chosen_script[0] == HB_TAG ('D','F','L','T') || planner->map.chosen_script[0] == HB_TAG ('l','a','t','n')) - return &_hb_ot_complex_shaper_default; + return &_hb_ot_shaper_default; else - return &_hb_ot_complex_shaper_use; + return &_hb_ot_shaper_use; } } -#endif /* HB_OT_SHAPE_COMPLEX_HH */ +#endif /* HB_OT_SHAPER_HH */ diff --git a/thirdparty/harfbuzz/src/hb-ot-tag-table.hh b/thirdparty/harfbuzz/src/hb-ot-tag-table.hh index b242fba2d8..9394b90ee6 100644 --- a/thirdparty/harfbuzz/src/hb-ot-tag-table.hh +++ b/thirdparty/harfbuzz/src/hb-ot-tag-table.hh @@ -219,6 +219,7 @@ static const LangTag ot_languages2[] = { {HB_TAG('z','u',' ',' '), HB_TAG('Z','U','L',' ')}, /* Zulu */ }; +#ifndef HB_NO_LANGUAGE_LONG static const LangTag ot_languages3[] = { {HB_TAG('a','a','e',' '), HB_TAG('S','Q','I',' ')}, /* Arbëreshë Albanian -> Albanian */ {HB_TAG('a','a','o',' '), HB_TAG('A','R','A',' ')}, /* Algerian Saharan Arabic -> Arabic */ @@ -1621,6 +1622,7 @@ static const LangTag ot_languages3[] = { /*{HB_TAG('z','z','a',' '), HB_TAG('Z','Z','A',' ')},*/ /* Zazaki [macrolanguage] */ {HB_TAG('z','z','j',' '), HB_TAG('Z','H','A',' ')}, /* Zuojiang Zhuang -> Zhuang */ }; +#endif /** * hb_ot_tags_from_complex_language: @@ -1636,7 +1638,7 @@ static const LangTag ot_languages3[] = { * * Return value: Whether any language systems were retrieved. **/ -static bool +static inline bool hb_ot_tags_from_complex_language (const char *lang_str, const char *limit, unsigned int *count /* IN/OUT */, @@ -2818,7 +2820,7 @@ out: * Return value: The #hb_language_t corresponding to the BCP 47 language tag, * or #HB_LANGUAGE_INVALID if @tag is not ambiguous. **/ -static hb_language_t +static inline hb_language_t hb_ot_ambiguous_tag_to_language (hb_tag_t tag) { switch (tag) diff --git a/thirdparty/harfbuzz/src/hb-ot-tag.cc b/thirdparty/harfbuzz/src/hb-ot-tag.cc index a4a9515362..ce5cdce98b 100644 --- a/thirdparty/harfbuzz/src/hb-ot-tag.cc +++ b/thirdparty/harfbuzz/src/hb-ot-tag.cc @@ -263,15 +263,19 @@ hb_ot_tags_from_language (const char *lang_str, unsigned int *count, hb_tag_t *tags) { - const char *s; +#ifndef HB_NO_LANGUAGE_LONG /* Check for matches of multiple subtags. */ if (hb_ot_tags_from_complex_language (lang_str, limit, count, tags)) return; +#endif /* Find a language matching in the first component. */ - s = strchr (lang_str, '-'); +#ifndef HB_NO_LANGUAGE_LONG + const char *s; s = strchr (lang_str, '-'); +#endif { +#ifndef HB_NO_LANGUAGE_LONG if (s && limit - lang_str >= 6) { const char *extlang_end = strchr (s + 1, '-'); @@ -280,6 +284,7 @@ hb_ot_tags_from_language (const char *lang_str, ISALPHA (s[1])) lang_str = s + 1; } +#endif const LangTag *ot_languages = nullptr; unsigned ot_languages_len = 0; const char *dash = strchr (lang_str, '-'); @@ -289,21 +294,23 @@ hb_ot_tags_from_language (const char *lang_str, ot_languages = ot_languages2; ot_languages_len = ARRAY_LENGTH (ot_languages2); } +#ifndef HB_NO_LANGUAGE_LONG else if (first_len == 3) { ot_languages = ot_languages3; ot_languages_len = ARRAY_LENGTH (ot_languages3); } +#endif hb_tag_t lang_tag = hb_tag_from_string (lang_str, first_len); - static unsigned last_tag_idx; /* Poor man's cache. */ - unsigned tag_idx = last_tag_idx; + static hb_atomic_int_t last_tag_idx; /* Poor man's cache. */ + unsigned tag_idx = last_tag_idx.get_relaxed (); if (likely (tag_idx < ot_languages_len && ot_languages[tag_idx].language == lang_tag) || hb_sorted_array (ot_languages, ot_languages_len).bfind (lang_tag, &tag_idx)) { - last_tag_idx = tag_idx; + last_tag_idx.set_relaxed (tag_idx); unsigned int i; while (tag_idx != 0 && ot_languages[tag_idx].language == ot_languages[tag_idx - 1].language) @@ -320,6 +327,7 @@ hb_ot_tags_from_language (const char *lang_str, } } +#ifndef HB_NO_LANGUAGE_LONG if (!s) s = lang_str + strlen (lang_str); if (s - lang_str == 3) { @@ -328,6 +336,7 @@ hb_ot_tags_from_language (const char *lang_str, *count = 1; return; } +#endif *count = 0; } @@ -472,11 +481,13 @@ hb_ot_tag_to_language (hb_tag_t tag) if (tag == HB_OT_TAG_DEFAULT_LANGUAGE) return nullptr; +#ifndef HB_NO_LANGUAGE_LONG { hb_language_t disambiguated_tag = hb_ot_ambiguous_tag_to_language (tag); if (disambiguated_tag != HB_LANGUAGE_INVALID) return disambiguated_tag; } +#endif char buf[4]; for (i = 0; i < ARRAY_LENGTH (ot_languages2); i++) @@ -485,12 +496,14 @@ hb_ot_tag_to_language (hb_tag_t tag) hb_tag_to_string (ot_languages2[i].language, buf); return hb_language_from_string (buf, 2); } +#ifndef HB_NO_LANGUAGE_LONG for (i = 0; i < ARRAY_LENGTH (ot_languages3); i++) if (ot_languages3[i].tag == tag) { hb_tag_to_string (ot_languages3[i].language, buf); return hb_language_from_string (buf, 3); } +#endif /* Return a custom language in the form of "x-hbot-AABBCCDD". * If it's three letters long, also guess it's ISO 639-3 and lower-case and @@ -596,6 +609,7 @@ test_langs_sorted () abort(); } } +#ifndef HB_NO_LANGUAGE_LONG for (unsigned int i = 1; i < ARRAY_LENGTH (ot_languages3); i++) { int c = ot_languages3[i].cmp (&ot_languages3[i - 1]); @@ -606,6 +620,7 @@ test_langs_sorted () abort(); } } +#endif } int diff --git a/thirdparty/harfbuzz/src/hb-ot-var-fvar-table.hh b/thirdparty/harfbuzz/src/hb-ot-var-fvar-table.hh index e066558683..c5c476bc0e 100644 --- a/thirdparty/harfbuzz/src/hb-ot-var-fvar-table.hh +++ b/thirdparty/harfbuzz/src/hb-ot-var-fvar-table.hh @@ -213,7 +213,7 @@ struct fvar if (!axis_index) axis_index = &i; *axis_index = HB_OT_VAR_NO_AXIS_INDEX; auto axes = get_axes (); - return axes.lfind (tag, axis_index) && (axes[*axis_index].get_axis_deprecated (info), true); + return axes.lfind (tag, axis_index) && ((void) axes[*axis_index].get_axis_deprecated (info), true); } #endif bool @@ -221,7 +221,7 @@ struct fvar { unsigned i; auto axes = get_axes (); - return axes.lfind (tag, &i) && (axes[i].get_axis_info (i, info), true); + return axes.lfind (tag, &i) && ((void) axes[i].get_axis_info (i, info), true); } int normalize_axis_value (unsigned int axis_index, float v) const diff --git a/thirdparty/harfbuzz/src/hb-ot-var-gvar-table.hh b/thirdparty/harfbuzz/src/hb-ot-var-gvar-table.hh index 3b2a38b9a6..bf1039d1d6 100644 --- a/thirdparty/harfbuzz/src/hb-ot-var-gvar-table.hh +++ b/thirdparty/harfbuzz/src/hb-ot-var-gvar-table.hh @@ -45,9 +45,10 @@ struct contour_point_t void translate (const contour_point_t &p) { x += p.x; y += p.y; } - uint8_t flag; - float x, y; - bool is_end_point; + float x = 0.f; + float y = 0.f; + uint8_t flag = 0; + bool is_end_point = false; }; struct contour_point_vector_t : hb_vector_t<contour_point_t> @@ -55,16 +56,24 @@ struct contour_point_vector_t : hb_vector_t<contour_point_t> void extend (const hb_array_t<contour_point_t> &a) { unsigned int old_len = length; - resize (old_len + a.length); - for (unsigned int i = 0; i < a.length; i++) - (*this)[old_len + i] = a[i]; + if (unlikely (!resize (old_len + a.length))) + return; + auto arrayZ = this->arrayZ + old_len; + unsigned count = a.length; + for (unsigned int i = 0; i < count; i++) + arrayZ[i] = a.arrayZ[i]; } void transform (const float (&matrix)[4]) { - for (unsigned int i = 0; i < length; i++) + if (matrix[0] == 1.f && matrix[1] == 0.f && + matrix[2] == 0.f && matrix[3] == 1.f) + return; + auto arrayZ = this->arrayZ; + unsigned count = length; + for (unsigned i = 0; i < count; i++) { - contour_point_t &p = (*this)[i]; + contour_point_t &p = arrayZ[i]; float x_ = p.x * matrix[0] + p.y * matrix[2]; p.y = p.x * matrix[1] + p.y * matrix[3]; p.x = x_; @@ -73,8 +82,12 @@ struct contour_point_vector_t : hb_vector_t<contour_point_t> void translate (const contour_point_t& delta) { - for (unsigned int i = 0; i < length; i++) - (*this)[i].translate (delta); + if (delta.x == 0.f && delta.y == 0.f) + return; + auto arrayZ = this->arrayZ; + unsigned count = length; + for (unsigned i = 0; i < count; i++) + arrayZ[i].translate (delta); } }; @@ -89,7 +102,7 @@ struct TupleVariationHeader const TupleVariationHeader &get_next (unsigned axis_count) const { return StructAtOffset<TupleVariationHeader> (this, get_size (axis_count)); } - float calculate_scalar (const int *coords, unsigned int coord_count, + float calculate_scalar (hb_array_t<int> coords, unsigned int coord_count, const hb_array_t<const F2DOT14> shared_tuples) const { hb_array_t<const F2DOT14> peak_tuple; @@ -208,7 +221,7 @@ struct GlyphVariationData { const HBUINT8 *base = &(var_data+var_data->data); const HBUINT8 *p = base; - if (!unpack_points (p, shared_indices, var_data_bytes)) return false; + if (!unpack_points (p, shared_indices, (const HBUINT8 *) (var_data_bytes.arrayZ + var_data_bytes.length))) return false; data_offset = p - base; } return true; @@ -258,7 +271,7 @@ struct GlyphVariationData static bool unpack_points (const HBUINT8 *&p /* IN/OUT */, hb_vector_t<unsigned int> &points /* OUT */, - const hb_bytes_t &bytes) + const HBUINT8 *end) { enum packed_point_flag_t { @@ -266,21 +279,21 @@ struct GlyphVariationData POINT_RUN_COUNT_MASK = 0x7F }; - if (unlikely (!bytes.check_range (p))) return false; + if (unlikely (p + 1 > end)) return false; uint16_t count = *p++; if (count & POINTS_ARE_WORDS) { - if (unlikely (!bytes.check_range (p))) return false; + if (unlikely (p + 1 > end)) return false; count = ((count & POINT_RUN_COUNT_MASK) << 8) | *p++; } - points.resize (count); + if (unlikely (!points.resize (count))) return false; unsigned int n = 0; uint16_t i = 0; while (i < count) { - if (unlikely (!bytes.check_range (p))) return false; + if (unlikely (p + 1 > end)) return false; uint16_t j; uint8_t control = *p++; uint16_t run_count = (control & POINT_RUN_COUNT_MASK) + 1; @@ -288,8 +301,7 @@ struct GlyphVariationData { for (j = 0; j < run_count && i < count; j++, i++) { - if (unlikely (!bytes.check_range ((const HBUINT16 *) p))) - return false; + if (unlikely (p + HBUINT16::static_size > end)) return false; n += *(const HBUINT16 *)p; points[i] = n; p += HBUINT16::static_size; @@ -299,7 +311,7 @@ struct GlyphVariationData { for (j = 0; j < run_count && i < count; j++, i++) { - if (unlikely (!bytes.check_range (p))) return false; + if (unlikely (p + 1 > end)) return false; n += *p++; points[i] = n; } @@ -311,7 +323,7 @@ struct GlyphVariationData static bool unpack_deltas (const HBUINT8 *&p /* IN/OUT */, hb_vector_t<int> &deltas /* IN/OUT */, - const hb_bytes_t &bytes) + const HBUINT8 *end) { enum packed_delta_flag_t { @@ -324,7 +336,7 @@ struct GlyphVariationData unsigned int count = deltas.length; while (i < count) { - if (unlikely (!bytes.check_range (p))) return false; + if (unlikely (p + 1 > end)) return false; uint8_t control = *p++; unsigned int run_count = (control & DELTA_RUN_COUNT_MASK) + 1; unsigned int j; @@ -334,16 +346,14 @@ struct GlyphVariationData else if (control & DELTAS_ARE_WORDS) for (j = 0; j < run_count && i < count; j++, i++) { - if (unlikely (!bytes.check_range ((const HBUINT16 *) p))) - return false; + if (unlikely (p + HBUINT16::static_size > end)) return false; deltas[i] = *(const HBINT16 *) p; p += HBUINT16::static_size; } else for (j = 0; j < run_count && i < count; j++, i++) { - if (unlikely (!bytes.check_range (p))) - return false; + if (unlikely (p + 1 > end)) return false; deltas[i] = *(const HBINT8 *) p++; } if (j < run_count) @@ -505,19 +515,17 @@ struct gvar ~accelerator_t () { table.destroy (); } private: - struct x_getter { static float get (const contour_point_t &p) { return p.x; } }; - struct y_getter { static float get (const contour_point_t &p) { return p.y; } }; - template <typename T> static float infer_delta (const hb_array_t<contour_point_t> points, const hb_array_t<contour_point_t> deltas, - unsigned int target, unsigned int prev, unsigned int next) + unsigned int target, unsigned int prev, unsigned int next, + float contour_point_t::*m) { - float target_val = T::get (points[target]); - float prev_val = T::get (points[prev]); - float next_val = T::get (points[next]); - float prev_delta = T::get (deltas[prev]); - float next_delta = T::get (deltas[next]); + float target_val = points[target].*m; + float prev_val = points[prev].*m; + float next_val = points[next].*m; + float prev_delta = deltas[prev].*m; + float next_delta = deltas[next].*m; if (prev_val == next_val) return (prev_delta == next_delta) ? prev_delta : 0.f; @@ -528,7 +536,7 @@ struct gvar /* linear interpolation */ float r = (target_val - prev_val) / (next_val - prev_val); - return (1.f - r) * prev_delta + r * next_delta; + return prev_delta + r * (next_delta - prev_delta); } static unsigned int next_index (unsigned int i, unsigned int start, unsigned int end) @@ -538,8 +546,7 @@ struct gvar bool apply_deltas_to_points (hb_codepoint_t glyph, hb_font_t *font, const hb_array_t<contour_point_t> points) const { - /* num_coords should exactly match gvar's axisCount due to how GlyphVariationData tuples are aligned */ - if (!font->num_coords || font->num_coords != table->axisCount) return true; + if (!font->num_coords) return true; if (unlikely (glyph >= table->glyphCount)) return true; @@ -553,21 +560,25 @@ struct gvar /* Save original points for inferred delta calculation */ contour_point_vector_t orig_points; - orig_points.resize (points.length); + if (unlikely (!orig_points.resize (points.length))) return false; for (unsigned int i = 0; i < orig_points.length; i++) - orig_points[i] = points[i]; + orig_points.arrayZ[i] = points.arrayZ[i]; contour_point_vector_t deltas; /* flag is used to indicate referenced point */ - deltas.resize (points.length); + if (unlikely (!deltas.resize (points.length))) return false; hb_vector_t<unsigned> end_points; for (unsigned i = 0; i < points.length; ++i) if (points[i].is_end_point) end_points.push (i); - int *coords = font->coords; - unsigned num_coords = font->num_coords; + auto coords = hb_array (font->coords, font->num_coords); + unsigned num_coords = table->axisCount; hb_array_t<const F2DOT14> shared_tuples = (table+table->sharedTuples).as_array (table->sharedTupleCount * table->axisCount); + + hb_vector_t<unsigned int> private_indices; + hb_vector_t<int> x_deltas; + hb_vector_t<int> y_deltas; do { float scalar = iterator.current_tuple->calculate_scalar (coords, num_coords, shared_tuples); @@ -577,33 +588,30 @@ struct gvar if (unlikely (!iterator.var_data_bytes.check_range (p, length))) return false; - hb_bytes_t bytes ((const char *) p, length); - hb_vector_t<unsigned int> private_indices; + const HBUINT8 *end = p + length; + bool has_private_points = iterator.current_tuple->has_private_points (); if (has_private_points && - !GlyphVariationData::unpack_points (p, private_indices, bytes)) + !GlyphVariationData::unpack_points (p, private_indices, end)) return false; const hb_array_t<unsigned int> &indices = has_private_points ? private_indices : shared_indices; bool apply_to_all = (indices.length == 0); unsigned int num_deltas = apply_to_all ? points.length : indices.length; - hb_vector_t<int> x_deltas; - x_deltas.resize (num_deltas); - if (!GlyphVariationData::unpack_deltas (p, x_deltas, bytes)) - return false; - hb_vector_t<int> y_deltas; - y_deltas.resize (num_deltas); - if (!GlyphVariationData::unpack_deltas (p, y_deltas, bytes)) - return false; + if (unlikely (!x_deltas.resize (num_deltas))) return false; + if (unlikely (!GlyphVariationData::unpack_deltas (p, x_deltas, end))) return false; + if (unlikely (!y_deltas.resize (num_deltas))) return false; + if (unlikely (!GlyphVariationData::unpack_deltas (p, y_deltas, end))) return false; for (unsigned int i = 0; i < deltas.length; i++) deltas[i].init (); for (unsigned int i = 0; i < num_deltas; i++) { unsigned int pt_index = apply_to_all ? i : indices[i]; - deltas[pt_index].flag = 1; /* this point is referenced, i.e., explicit deltas specified */ - deltas[pt_index].x += x_deltas[i] * scalar; - deltas[pt_index].y += y_deltas[i] * scalar; + if (unlikely (pt_index >= deltas.length)) continue; + deltas.arrayZ[pt_index].flag = 1; /* this point is referenced, i.e., explicit deltas specified */ + deltas.arrayZ[pt_index].x += x_deltas.arrayZ[i] * scalar; + deltas.arrayZ[pt_index].y += y_deltas.arrayZ[i] * scalar; } /* infer deltas for unreferenced points */ @@ -647,20 +655,20 @@ struct gvar { i = next_index (i, start_point, end_point); if (i == next) break; - deltas[i].x = infer_delta<x_getter> (orig_points.as_array (), deltas.as_array (), i, prev, next); - deltas[i].y = infer_delta<y_getter> (orig_points.as_array (), deltas.as_array (), i, prev, next); + deltas[i].x = infer_delta (orig_points.as_array (), deltas.as_array (), i, prev, next, &contour_point_t::x); + deltas[i].y = infer_delta (orig_points.as_array (), deltas.as_array (), i, prev, next, &contour_point_t::y); if (--unref_count == 0) goto no_more_gaps; } } -no_more_gaps: + no_more_gaps: start_point = end_point + 1; } /* apply specified / inferred deltas to points */ for (unsigned int i = 0; i < points.length; i++) { - points[i].x += deltas[i].x; - points[i].y += deltas[i].y; + points.arrayZ[i].x += deltas.arrayZ[i].x; + points.arrayZ[i].y += deltas.arrayZ[i].y; } } while (iterator.move_to_next ()); diff --git a/thirdparty/harfbuzz/src/hb-ot-var-hvar-table.hh b/thirdparty/harfbuzz/src/hb-ot-var-hvar-table.hh index e9d90352f0..56efcdbee9 100644 --- a/thirdparty/harfbuzz/src/hb-ot-var-hvar-table.hh +++ b/thirdparty/harfbuzz/src/hb-ot-var-hvar-table.hh @@ -319,10 +319,15 @@ struct HVARVVAR hvar_plan.index_map_plans.as_array ())); } - float get_advance_var (hb_codepoint_t glyph, hb_font_t *font) const + float get_advance_var (hb_codepoint_t glyph, + hb_font_t *font, + VariationStore::cache_t *store_cache = nullptr) const { uint32_t varidx = (this+advMap).map (glyph); - return (this+varStore).get_delta (varidx, font->coords, font->num_coords); + return (this+varStore).get_delta (varidx, + font->coords, + font->num_coords, + store_cache); } float get_side_bearing_var (hb_codepoint_t glyph, @@ -335,7 +340,7 @@ struct HVARVVAR bool has_side_bearing_deltas () const { return lsbMap && rsbMap; } - protected: + public: FixedVersion<>version; /* Version of the metrics variation table * initially set to 0x00010000u */ Offset32To<VariationStore> diff --git a/thirdparty/harfbuzz/src/hb-repacker.hh b/thirdparty/harfbuzz/src/hb-repacker.hh index ce9ff90bb4..683a441ec3 100644 --- a/thirdparty/harfbuzz/src/hb-repacker.hh +++ b/thirdparty/harfbuzz/src/hb-repacker.hh @@ -32,1033 +32,18 @@ #include "hb-priority-queue.hh" #include "hb-serialize.hh" #include "hb-vector.hh" +#include "graph/graph.hh" +#include "graph/serialize.hh" + +using graph::graph_t; /* * For a detailed writeup on the overflow resolution algorithm see: * docs/repacker.md */ -struct graph_t -{ - struct vertex_t - { - hb_serialize_context_t::object_t obj; - int64_t distance = 0 ; - int64_t space = 0 ; - hb_vector_t<unsigned> parents; - unsigned start = 0; - unsigned end = 0; - unsigned priority = 0; - - friend void swap (vertex_t& a, vertex_t& b) - { - hb_swap (a.obj, b.obj); - hb_swap (a.distance, b.distance); - hb_swap (a.space, b.space); - hb_swap (a.parents, b.parents); - hb_swap (a.start, b.start); - hb_swap (a.end, b.end); - hb_swap (a.priority, b.priority); - } - - bool is_shared () const - { - return parents.length > 1; - } - - unsigned incoming_edges () const - { - return parents.length; - } - - void remove_parent (unsigned parent_index) - { - for (unsigned i = 0; i < parents.length; i++) - { - if (parents[i] != parent_index) continue; - parents.remove (i); - break; - } - } - - void remap_parents (const hb_vector_t<unsigned>& id_map) - { - for (unsigned i = 0; i < parents.length; i++) - parents[i] = id_map[parents[i]]; - } - - void remap_parent (unsigned old_index, unsigned new_index) - { - for (unsigned i = 0; i < parents.length; i++) - { - if (parents[i] == old_index) - parents[i] = new_index; - } - } - - bool is_leaf () const - { - return !obj.real_links.length && !obj.virtual_links.length; - } - - bool raise_priority () - { - if (has_max_priority ()) return false; - priority++; - return true; - } - - bool has_max_priority () const { - return priority >= 3; - } - - int64_t modified_distance (unsigned order) const - { - // TODO(garretrieger): once priority is high enough, should try - // setting distance = 0 which will force to sort immediately after - // it's parent where possible. - - int64_t modified_distance = - hb_min (hb_max(distance + distance_modifier (), 0), 0x7FFFFFFFFFF); - if (has_max_priority ()) { - modified_distance = 0; - } - return (modified_distance << 18) | (0x003FFFF & order); - } - - int64_t distance_modifier () const - { - if (!priority) return 0; - int64_t table_size = obj.tail - obj.head; - - if (priority == 1) - return -table_size / 2; - - return -table_size; - } - }; - - struct overflow_record_t - { - unsigned parent; - unsigned child; - }; - - /* - * A topological sorting of an object graph. Ordered - * in reverse serialization order (first object in the - * serialization is at the end of the list). This matches - * the 'packed' object stack used internally in the - * serializer - */ - template<typename T> - graph_t (const T& objects) - : parents_invalid (true), - distance_invalid (true), - positions_invalid (true), - successful (true) - { - num_roots_for_space_.push (1); - bool removed_nil = false; - vertices_.alloc (objects.length); - vertices_scratch_.alloc (objects.length); - for (unsigned i = 0; i < objects.length; i++) - { - // TODO(grieger): check all links point to valid objects. - - // If this graph came from a serialization buffer object 0 is the - // nil object. We don't need it for our purposes here so drop it. - if (i == 0 && !objects[i]) - { - removed_nil = true; - continue; - } - - vertex_t* v = vertices_.push (); - if (check_success (!vertices_.in_error ())) - v->obj = *objects[i]; - if (!removed_nil) continue; - // Fix indices to account for removed nil object. - for (auto& l : v->obj.all_links_writer ()) { - l.objidx--; - } - } - } - - ~graph_t () - { - vertices_.fini (); - } - - bool in_error () const - { - return !successful || - vertices_.in_error () || - num_roots_for_space_.in_error (); - } - - const vertex_t& root () const - { - return vertices_[root_idx ()]; - } - - unsigned root_idx () const - { - // Object graphs are in reverse order, the first object is at the end - // of the vector. Since the graph is topologically sorted it's safe to - // assume the first object has no incoming edges. - return vertices_.length - 1; - } - - const hb_serialize_context_t::object_t& object(unsigned i) const - { - return vertices_[i].obj; - } - - /* - * serialize graph into the provided serialization buffer. - */ - hb_blob_t* serialize () const - { - hb_vector_t<char> buffer; - size_t size = serialized_length (); - if (!buffer.alloc (size)) { - DEBUG_MSG (SUBSET_REPACK, nullptr, "Unable to allocate output buffer."); - return nullptr; - } - hb_serialize_context_t c((void *) buffer, size); - - c.start_serialize<void> (); - for (unsigned i = 0; i < vertices_.length; i++) { - c.push (); - - size_t size = vertices_[i].obj.tail - vertices_[i].obj.head; - char* start = c.allocate_size <char> (size); - if (!start) { - DEBUG_MSG (SUBSET_REPACK, nullptr, "Buffer out of space."); - return nullptr; - } - - memcpy (start, vertices_[i].obj.head, size); - - // Only real links needs to be serialized. - for (const auto& link : vertices_[i].obj.real_links) - serialize_link (link, start, &c); - - // All duplications are already encoded in the graph, so don't - // enable sharing during packing. - c.pop_pack (false); - } - c.end_serialize (); - - if (c.in_error ()) { - DEBUG_MSG (SUBSET_REPACK, nullptr, "Error during serialization. Err flag: %d", - c.errors); - return nullptr; - } - - return c.copy_blob (); - } - - /* - * Generates a new topological sorting of graph ordered by the shortest - * distance to each node. - */ - void sort_shortest_distance () - { - positions_invalid = true; - - if (vertices_.length <= 1) { - // Graph of 1 or less doesn't need sorting. - return; - } - - update_distances (); - - hb_priority_queue_t queue; - hb_vector_t<vertex_t> &sorted_graph = vertices_scratch_; - if (unlikely (!check_success (sorted_graph.resize (vertices_.length)))) return; - hb_vector_t<unsigned> id_map; - if (unlikely (!check_success (id_map.resize (vertices_.length)))) return; - - hb_vector_t<unsigned> removed_edges; - if (unlikely (!check_success (removed_edges.resize (vertices_.length)))) return; - update_parents (); - - queue.insert (root ().modified_distance (0), root_idx ()); - int new_id = root_idx (); - unsigned order = 1; - while (!queue.in_error () && !queue.is_empty ()) - { - unsigned next_id = queue.pop_minimum().second; - - hb_swap (sorted_graph[new_id], vertices_[next_id]); - const vertex_t& next = sorted_graph[new_id]; - - id_map[next_id] = new_id--; - - for (const auto& link : next.obj.all_links ()) { - removed_edges[link.objidx]++; - if (!(vertices_[link.objidx].incoming_edges () - removed_edges[link.objidx])) - // Add the order that the links were encountered to the priority. - // This ensures that ties between priorities objects are broken in a consistent - // way. More specifically this is set up so that if a set of objects have the same - // distance they'll be added to the topological order in the order that they are - // referenced from the parent object. - queue.insert (vertices_[link.objidx].modified_distance (order++), - link.objidx); - } - } - - check_success (!queue.in_error ()); - check_success (!sorted_graph.in_error ()); - if (!check_success (new_id == -1)) - print_orphaned_nodes (); - - remap_all_obj_indices (id_map, &sorted_graph); - - hb_swap (vertices_, sorted_graph); - } - - /* - * Assign unique space numbers to each connected subgraph of 32 bit offset(s). - */ - bool assign_32bit_spaces () - { - unsigned root_index = root_idx (); - hb_set_t visited; - hb_set_t roots; - for (unsigned i = 0; i <= root_index; i++) - { - // Only real links can form 32 bit spaces - for (auto& l : vertices_[i].obj.real_links) - { - if (l.width == 4 && !l.is_signed) - { - roots.add (l.objidx); - find_subgraph (l.objidx, visited); - } - } - } - - // Mark everything not in the subgraphs of 32 bit roots as visited. - // This prevents 32 bit subgraphs from being connected via nodes not in the 32 bit subgraphs. - visited.invert (); - - if (!roots) return false; - - while (roots) - { - unsigned next = HB_SET_VALUE_INVALID; - if (unlikely (!check_success (!roots.in_error ()))) break; - if (!roots.next (&next)) break; - - hb_set_t connected_roots; - find_connected_nodes (next, roots, visited, connected_roots); - if (unlikely (!check_success (!connected_roots.in_error ()))) break; - - isolate_subgraph (connected_roots); - if (unlikely (!check_success (!connected_roots.in_error ()))) break; - - unsigned next_space = this->next_space (); - num_roots_for_space_.push (0); - for (unsigned root : connected_roots) - { - DEBUG_MSG (SUBSET_REPACK, nullptr, "Subgraph %u gets space %u", root, next_space); - vertices_[root].space = next_space; - num_roots_for_space_[next_space] = num_roots_for_space_[next_space] + 1; - distance_invalid = true; - positions_invalid = true; - } - - // TODO(grieger): special case for GSUB/GPOS use extension promotions to move 16 bit space - // into the 32 bit space as needed, instead of using isolation. - } - - - - return true; - } - - /* - * Isolates the subgraph of nodes reachable from root. Any links to nodes in the subgraph - * that originate from outside of the subgraph will be removed by duplicating the linked to - * object. - * - * Indices stored in roots will be updated if any of the roots are duplicated to new indices. - */ - bool isolate_subgraph (hb_set_t& roots) - { - update_parents (); - hb_hashmap_t<unsigned, unsigned> subgraph; - - // incoming edges to root_idx should be all 32 bit in length so we don't need to de-dup these - // set the subgraph incoming edge count to match all of root_idx's incoming edges - hb_set_t parents; - for (unsigned root_idx : roots) - { - subgraph.set (root_idx, wide_parents (root_idx, parents)); - find_subgraph (root_idx, subgraph); - } - - unsigned original_root_idx = root_idx (); - hb_hashmap_t<unsigned, unsigned> index_map; - bool made_changes = false; - for (auto entry : subgraph.iter ()) - { - const auto& node = vertices_[entry.first]; - unsigned subgraph_incoming_edges = entry.second; - - if (subgraph_incoming_edges < node.incoming_edges ()) - { - // Only de-dup objects with incoming links from outside the subgraph. - made_changes = true; - duplicate_subgraph (entry.first, index_map); - } - } - - if (!made_changes) - return false; - - if (original_root_idx != root_idx () - && parents.has (original_root_idx)) - { - // If the root idx has changed since parents was determined, update root idx in parents - parents.add (root_idx ()); - parents.del (original_root_idx); - } - - auto new_subgraph = - + subgraph.keys () - | hb_map([&] (unsigned node_idx) { - if (index_map.has (node_idx)) return index_map[node_idx]; - return node_idx; - }) - ; - - remap_obj_indices (index_map, new_subgraph); - remap_obj_indices (index_map, parents.iter (), true); - - // Update roots set with new indices as needed. - unsigned next = HB_SET_VALUE_INVALID; - while (roots.next (&next)) - { - if (index_map.has (next)) - { - roots.del (next); - roots.add (index_map[next]); - } - } - - return true; - } - - void find_subgraph (unsigned node_idx, hb_hashmap_t<unsigned, unsigned>& subgraph) - { - for (const auto& link : vertices_[node_idx].obj.all_links ()) - { - if (subgraph.has (link.objidx)) - { - subgraph.set (link.objidx, subgraph[link.objidx] + 1); - continue; - } - subgraph.set (link.objidx, 1); - find_subgraph (link.objidx, subgraph); - } - } - - void find_subgraph (unsigned node_idx, hb_set_t& subgraph) - { - if (subgraph.has (node_idx)) return; - subgraph.add (node_idx); - for (const auto& link : vertices_[node_idx].obj.all_links ()) - find_subgraph (link.objidx, subgraph); - } - - /* - * duplicates all nodes in the subgraph reachable from node_idx. Does not re-assign - * links. index_map is updated with mappings from old id to new id. If a duplication has already - * been performed for a given index, then it will be skipped. - */ - void duplicate_subgraph (unsigned node_idx, hb_hashmap_t<unsigned, unsigned>& index_map) - { - if (index_map.has (node_idx)) - return; - - index_map.set (node_idx, duplicate (node_idx)); - for (const auto& l : object (node_idx).all_links ()) { - duplicate_subgraph (l.objidx, index_map); - } - } - - /* - * Creates a copy of node_idx and returns it's new index. - */ - unsigned duplicate (unsigned node_idx) - { - positions_invalid = true; - distance_invalid = true; - - auto* clone = vertices_.push (); - auto& child = vertices_[node_idx]; - if (vertices_.in_error ()) { - return -1; - } - - clone->obj.head = child.obj.head; - clone->obj.tail = child.obj.tail; - clone->distance = child.distance; - clone->space = child.space; - clone->parents.reset (); - - unsigned clone_idx = vertices_.length - 2; - for (const auto& l : child.obj.real_links) - { - clone->obj.real_links.push (l); - vertices_[l.objidx].parents.push (clone_idx); - } - for (const auto& l : child.obj.virtual_links) - { - clone->obj.virtual_links.push (l); - vertices_[l.objidx].parents.push (clone_idx); - } - - check_success (!clone->obj.real_links.in_error ()); - check_success (!clone->obj.virtual_links.in_error ()); - - // The last object is the root of the graph, so swap back the root to the end. - // The root's obj idx does change, however since it's root nothing else refers to it. - // all other obj idx's will be unaffected. - hb_swap (vertices_[vertices_.length - 2], *clone); - - // Since the root moved, update the parents arrays of all children on the root. - for (const auto& l : root ().obj.all_links ()) - vertices_[l.objidx].remap_parent (root_idx () - 1, root_idx ()); - - return clone_idx; - } - - /* - * Creates a copy of child and re-assigns the link from - * parent to the clone. The copy is a shallow copy, objects - * linked from child are not duplicated. - */ - bool duplicate (unsigned parent_idx, unsigned child_idx) - { - update_parents (); - - unsigned links_to_child = 0; - for (const auto& l : vertices_[parent_idx].obj.all_links ()) - { - if (l.objidx == child_idx) links_to_child++; - } - - if (vertices_[child_idx].incoming_edges () <= links_to_child) - { - // Can't duplicate this node, doing so would orphan the original one as all remaining links - // to child are from parent. - DEBUG_MSG (SUBSET_REPACK, nullptr, " Not duplicating %d => %d", - parent_idx, child_idx); - return false; - } - - DEBUG_MSG (SUBSET_REPACK, nullptr, " Duplicating %d => %d", - parent_idx, child_idx); - - unsigned clone_idx = duplicate (child_idx); - if (clone_idx == (unsigned) -1) return false; - // duplicate shifts the root node idx, so if parent_idx was root update it. - if (parent_idx == clone_idx) parent_idx++; - - auto& parent = vertices_[parent_idx]; - for (auto& l : parent.obj.all_links_writer ()) - { - if (l.objidx != child_idx) - continue; - - reassign_link (l, parent_idx, clone_idx); - } - - return true; - } - - /* - * Raises the sorting priority of all children. - */ - bool raise_childrens_priority (unsigned parent_idx) - { - DEBUG_MSG (SUBSET_REPACK, nullptr, " Raising priority of all children of %d", - parent_idx); - // This operation doesn't change ordering until a sort is run, so no need - // to invalidate positions. It does not change graph structure so no need - // to update distances or edge counts. - auto& parent = vertices_[parent_idx].obj; - bool made_change = false; - for (auto& l : parent.all_links_writer ()) - made_change |= vertices_[l.objidx].raise_priority (); - return made_change; - } - - /* - * Will any offsets overflow on graph when it's serialized? - */ - bool will_overflow (hb_vector_t<overflow_record_t>* overflows = nullptr) - { - if (overflows) overflows->resize (0); - update_positions (); - - for (int parent_idx = vertices_.length - 1; parent_idx >= 0; parent_idx--) - { - // Don't need to check virtual links for overflow - for (const auto& link : vertices_[parent_idx].obj.real_links) - { - int64_t offset = compute_offset (parent_idx, link); - if (is_valid_offset (offset, link)) - continue; - - if (!overflows) return true; - - overflow_record_t r; - r.parent = parent_idx; - r.child = link.objidx; - overflows->push (r); - } - } - - if (!overflows) return false; - return overflows->length; - } - - void print_orphaned_nodes () - { - if (!DEBUG_ENABLED(SUBSET_REPACK)) return; - - DEBUG_MSG (SUBSET_REPACK, nullptr, "Graph is not fully connected."); - parents_invalid = true; - update_parents(); - - for (unsigned i = 0; i < root_idx (); i++) - { - const auto& v = vertices_[i]; - if (!v.parents) - DEBUG_MSG (SUBSET_REPACK, nullptr, "Node %u is orphaned.", i); - } - } - - void print_overflows (const hb_vector_t<overflow_record_t>& overflows) - { - if (!DEBUG_ENABLED(SUBSET_REPACK)) return; - - update_parents (); - int limit = 10; - for (const auto& o : overflows) - { - if (!limit--) break; - const auto& parent = vertices_[o.parent]; - const auto& child = vertices_[o.child]; - DEBUG_MSG (SUBSET_REPACK, nullptr, - " overflow from " - "%4d (%4d in, %4d out, space %2d) => " - "%4d (%4d in, %4d out, space %2d)", - o.parent, - parent.incoming_edges (), - parent.obj.real_links.length + parent.obj.virtual_links.length, - space_for (o.parent), - o.child, - child.incoming_edges (), - child.obj.real_links.length + child.obj.virtual_links.length, - space_for (o.child)); - } - if (overflows.length > 10) { - DEBUG_MSG (SUBSET_REPACK, nullptr, " ... plus %d more overflows.", overflows.length - 10); - } - } - - unsigned num_roots_for_space (unsigned space) const - { - return num_roots_for_space_[space]; - } - - unsigned next_space () const - { - return num_roots_for_space_.length; - } - - void move_to_new_space (const hb_set_t& indices) - { - num_roots_for_space_.push (0); - unsigned new_space = num_roots_for_space_.length - 1; - - for (unsigned index : indices) { - auto& node = vertices_[index]; - num_roots_for_space_[node.space] = num_roots_for_space_[node.space] - 1; - num_roots_for_space_[new_space] = num_roots_for_space_[new_space] + 1; - node.space = new_space; - distance_invalid = true; - positions_invalid = true; - } - } - - unsigned space_for (unsigned index, unsigned* root = nullptr) const - { - const auto& node = vertices_[index]; - if (node.space) - { - if (root != nullptr) - *root = index; - return node.space; - } - - if (!node.parents) - { - if (root) - *root = index; - return 0; - } - - return space_for (node.parents[0], root); - } - - void err_other_error () { this->successful = false; } - - private: - - size_t serialized_length () const { - size_t total_size = 0; - for (unsigned i = 0; i < vertices_.length; i++) { - size_t size = vertices_[i].obj.tail - vertices_[i].obj.head; - total_size += size; - } - return total_size; - } - - /* - * Returns the numbers of incoming edges that are 32bits wide. - */ - unsigned wide_parents (unsigned node_idx, hb_set_t& parents) const - { - unsigned count = 0; - hb_set_t visited; - for (unsigned p : vertices_[node_idx].parents) - { - if (visited.has (p)) continue; - visited.add (p); - - // Only real links can be wide - for (const auto& l : vertices_[p].obj.real_links) - { - if (l.objidx == node_idx && l.width == 4 && !l.is_signed) - { - count++; - parents.add (p); - } - } - } - return count; - } - - bool check_success (bool success) - { return this->successful && (success || (err_other_error (), false)); } - - /* - * Creates a map from objid to # of incoming edges. - */ - void update_parents () - { - if (!parents_invalid) return; - - for (unsigned i = 0; i < vertices_.length; i++) - vertices_[i].parents.reset (); - - for (unsigned p = 0; p < vertices_.length; p++) - { - for (auto& l : vertices_[p].obj.all_links ()) - { - vertices_[l.objidx].parents.push (p); - } - } - - parents_invalid = false; - } - - /* - * compute the serialized start and end positions for each vertex. - */ - void update_positions () - { - if (!positions_invalid) return; - - unsigned current_pos = 0; - for (int i = root_idx (); i >= 0; i--) - { - auto& v = vertices_[i]; - v.start = current_pos; - current_pos += v.obj.tail - v.obj.head; - v.end = current_pos; - } - - positions_invalid = false; - } - - /* - * Finds the distance to each object in the graph - * from the initial node. - */ - void update_distances () - { - if (!distance_invalid) return; - - // Uses Dijkstra's algorithm to find all of the shortest distances. - // https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm - // - // Implementation Note: - // Since our priority queue doesn't support fast priority decreases - // we instead just add new entries into the queue when a priority changes. - // Redundant ones are filtered out later on by the visited set. - // According to https://www3.cs.stonybrook.edu/~rezaul/papers/TR-07-54.pdf - // for practical performance this is faster then using a more advanced queue - // (such as a fibonacci queue) with a fast decrease priority. - for (unsigned i = 0; i < vertices_.length; i++) - { - if (i == vertices_.length - 1) - vertices_[i].distance = 0; - else - vertices_[i].distance = hb_int_max (int64_t); - } - - hb_priority_queue_t queue; - queue.insert (0, vertices_.length - 1); - - hb_vector_t<bool> visited; - visited.resize (vertices_.length); - - while (!queue.in_error () && !queue.is_empty ()) - { - unsigned next_idx = queue.pop_minimum ().second; - if (visited[next_idx]) continue; - const auto& next = vertices_[next_idx]; - int64_t next_distance = vertices_[next_idx].distance; - visited[next_idx] = true; - - for (const auto& link : next.obj.all_links ()) - { - if (visited[link.objidx]) continue; - - const auto& child = vertices_[link.objidx].obj; - unsigned link_width = link.width ? link.width : 4; // treat virtual offsets as 32 bits wide - int64_t child_weight = (child.tail - child.head) + - ((int64_t) 1 << (link_width * 8)) * (vertices_[link.objidx].space + 1); - int64_t child_distance = next_distance + child_weight; - - if (child_distance < vertices_[link.objidx].distance) - { - vertices_[link.objidx].distance = child_distance; - queue.insert (child_distance, link.objidx); - } - } - } - - check_success (!queue.in_error ()); - if (!check_success (queue.is_empty ())) - { - print_orphaned_nodes (); - return; - } - - distance_invalid = false; - } - - int64_t compute_offset ( - unsigned parent_idx, - const hb_serialize_context_t::object_t::link_t& link) const - { - const auto& parent = vertices_[parent_idx]; - const auto& child = vertices_[link.objidx]; - int64_t offset = 0; - switch ((hb_serialize_context_t::whence_t) link.whence) { - case hb_serialize_context_t::whence_t::Head: - offset = child.start - parent.start; break; - case hb_serialize_context_t::whence_t::Tail: - offset = child.start - parent.end; break; - case hb_serialize_context_t::whence_t::Absolute: - offset = child.start; break; - } - - assert (offset >= link.bias); - offset -= link.bias; - return offset; - } - - bool is_valid_offset (int64_t offset, - const hb_serialize_context_t::object_t::link_t& link) const - { - if (unlikely (!link.width)) - // Virtual links can't overflow. - return link.is_signed || offset >= 0; - - if (link.is_signed) - { - if (link.width == 4) - return offset >= -((int64_t) 1 << 31) && offset < ((int64_t) 1 << 31); - else - return offset >= -(1 << 15) && offset < (1 << 15); - } - else - { - if (link.width == 4) - return offset >= 0 && offset < ((int64_t) 1 << 32); - else if (link.width == 3) - return offset >= 0 && offset < ((int32_t) 1 << 24); - else - return offset >= 0 && offset < (1 << 16); - } - } - - /* - * Updates a link in the graph to point to a different object. Corrects the - * parents vector on the previous and new child nodes. - */ - void reassign_link (hb_serialize_context_t::object_t::link_t& link, - unsigned parent_idx, - unsigned new_idx) - { - unsigned old_idx = link.objidx; - link.objidx = new_idx; - vertices_[old_idx].remove_parent (parent_idx); - vertices_[new_idx].parents.push (parent_idx); - } - - /* - * Updates all objidx's in all links using the provided mapping. Corrects incoming edge counts. - */ - template<typename Iterator, hb_requires (hb_is_iterator (Iterator))> - void remap_obj_indices (const hb_hashmap_t<unsigned, unsigned>& id_map, - Iterator subgraph, - bool only_wide = false) - { - if (!id_map) return; - for (unsigned i : subgraph) - { - for (auto& link : vertices_[i].obj.all_links_writer ()) - { - if (!id_map.has (link.objidx)) continue; - if (only_wide && !(link.width == 4 && !link.is_signed)) continue; - - reassign_link (link, i, id_map[link.objidx]); - } - } - } - - /* - * Updates all objidx's in all links using the provided mapping. - */ - void remap_all_obj_indices (const hb_vector_t<unsigned>& id_map, - hb_vector_t<vertex_t>* sorted_graph) const - { - for (unsigned i = 0; i < sorted_graph->length; i++) - { - (*sorted_graph)[i].remap_parents (id_map); - for (auto& link : (*sorted_graph)[i].obj.all_links_writer ()) - { - link.objidx = id_map[link.objidx]; - } - } - } - - template <typename O> void - serialize_link_of_type (const hb_serialize_context_t::object_t::link_t& link, - char* head, - hb_serialize_context_t* c) const - { - OT::Offset<O>* offset = reinterpret_cast<OT::Offset<O>*> (head + link.position); - *offset = 0; - c->add_link (*offset, - // serializer has an extra nil object at the start of the - // object array. So all id's are +1 of what our id's are. - link.objidx + 1, - (hb_serialize_context_t::whence_t) link.whence, - link.bias); - } - - void serialize_link (const hb_serialize_context_t::object_t::link_t& link, - char* head, - hb_serialize_context_t* c) const - { - switch (link.width) - { - case 0: - // Virtual links aren't serialized. - return; - case 4: - if (link.is_signed) - { - serialize_link_of_type<OT::HBINT32> (link, head, c); - } else { - serialize_link_of_type<OT::HBUINT32> (link, head, c); - } - return; - case 2: - if (link.is_signed) - { - serialize_link_of_type<OT::HBINT16> (link, head, c); - } else { - serialize_link_of_type<OT::HBUINT16> (link, head, c); - } - return; - case 3: - serialize_link_of_type<OT::HBUINT24> (link, head, c); - return; - default: - // Unexpected link width. - assert (0); - } - } - - /* - * Finds all nodes in targets that are reachable from start_idx, nodes in visited will be skipped. - * For this search the graph is treated as being undirected. - * - * Connected targets will be added to connected and removed from targets. All visited nodes - * will be added to visited. - */ - void find_connected_nodes (unsigned start_idx, - hb_set_t& targets, - hb_set_t& visited, - hb_set_t& connected) - { - if (unlikely (!check_success (!visited.in_error ()))) return; - if (visited.has (start_idx)) return; - visited.add (start_idx); - - if (targets.has (start_idx)) - { - targets.del (start_idx); - connected.add (start_idx); - } - - const auto& v = vertices_[start_idx]; - - // Graph is treated as undirected so search children and parents of start_idx - for (const auto& l : v.obj.all_links ()) - find_connected_nodes (l.objidx, targets, visited, connected); - - for (unsigned p : v.parents) - find_connected_nodes (p, targets, visited, connected); - } - - public: - // TODO(garretrieger): make private, will need to move most of offset overflow code into graph. - hb_vector_t<vertex_t> vertices_; - hb_vector_t<vertex_t> vertices_scratch_; - private: - bool parents_invalid; - bool distance_invalid; - bool positions_invalid; - bool successful; - hb_vector_t<unsigned> num_roots_for_space_; -}; static inline -bool _try_isolating_subgraphs (const hb_vector_t<graph_t::overflow_record_t>& overflows, +bool _try_isolating_subgraphs (const hb_vector_t<graph::overflow_record_t>& overflows, graph_t& sorted_graph) { unsigned space = 0; @@ -1066,7 +51,7 @@ bool _try_isolating_subgraphs (const hb_vector_t<graph_t::overflow_record_t>& ov for (int i = overflows.length - 1; i >= 0; i--) { - const graph_t::overflow_record_t& r = overflows[i]; + const graph::overflow_record_t& r = overflows[i]; unsigned root; unsigned overflow_space = sorted_graph.space_for (r.parent, &root); @@ -1108,7 +93,7 @@ bool _try_isolating_subgraphs (const hb_vector_t<graph_t::overflow_record_t>& ov } static inline -bool _process_overflows (const hb_vector_t<graph_t::overflow_record_t>& overflows, +bool _process_overflows (const hb_vector_t<graph::overflow_record_t>& overflows, hb_set_t& priority_bumped_parents, graph_t& sorted_graph) { @@ -1117,7 +102,7 @@ bool _process_overflows (const hb_vector_t<graph_t::overflow_record_t>& overflow // Try resolving the furthest overflows first. for (int i = overflows.length - 1; i >= 0; i--) { - const graph_t::overflow_record_t& r = overflows[i]; + const graph::overflow_record_t& r = overflows[i]; const auto& child = sorted_graph.vertices_[r.child]; if (child.is_shared ()) { @@ -1173,19 +158,18 @@ inline hb_blob_t* hb_resolve_overflows (const T& packed, hb_tag_t table_tag, unsigned max_rounds = 20) { - // Kahn sort is ~twice as fast as shortest distance sort and works for many fonts - // so try it first to save time. graph_t sorted_graph (packed); - if (!sorted_graph.will_overflow ()) + sorted_graph.sort_shortest_distance (); + + bool will_overflow = graph::will_overflow (sorted_graph); + if (!will_overflow) { - return sorted_graph.serialize (); + return graph::serialize (sorted_graph); } - sorted_graph.sort_shortest_distance (); - if ((table_tag == HB_OT_TAG_GPOS || table_tag == HB_OT_TAG_GSUB) - && sorted_graph.will_overflow ()) + && will_overflow) { DEBUG_MSG (SUBSET_REPACK, nullptr, "Assigning spaces to 32 bit subgraphs."); if (sorted_graph.assign_32bit_spaces ()) @@ -1193,13 +177,13 @@ hb_resolve_overflows (const T& packed, } unsigned round = 0; - hb_vector_t<graph_t::overflow_record_t> overflows; + hb_vector_t<graph::overflow_record_t> overflows; // TODO(garretrieger): select a good limit for max rounds. while (!sorted_graph.in_error () - && sorted_graph.will_overflow (&overflows) + && graph::will_overflow (sorted_graph, &overflows) && round++ < max_rounds) { DEBUG_MSG (SUBSET_REPACK, nullptr, "=== Overflow resolution round %d ===", round); - sorted_graph.print_overflows (overflows); + print_overflows (sorted_graph, overflows); hb_set_t priority_bumped_parents; @@ -1221,13 +205,13 @@ hb_resolve_overflows (const T& packed, return nullptr; } - if (sorted_graph.will_overflow ()) + if (graph::will_overflow (sorted_graph)) { DEBUG_MSG (SUBSET_REPACK, nullptr, "Offset overflow resolution failed."); return nullptr; } - return sorted_graph.serialize (); + return graph::serialize (sorted_graph); } #endif /* HB_REPACKER_HH */ diff --git a/thirdparty/harfbuzz/src/hb-serialize.hh b/thirdparty/harfbuzz/src/hb-serialize.hh index 5663b290c3..cecdcdeb74 100644 --- a/thirdparty/harfbuzz/src/hb-serialize.hh +++ b/thirdparty/harfbuzz/src/hb-serialize.hh @@ -695,7 +695,7 @@ struct hb_serialize_context_t check_assign (off, offset, HB_SERIALIZE_ERROR_OFFSET_OVERFLOW); } - public: /* TODO Make private. */ + public: char *start, *head, *tail, *end; unsigned int debug_depth; hb_serialize_error_t errors; @@ -719,9 +719,7 @@ struct hb_serialize_context_t hb_vector_t<object_t *> packed; /* Map view of packed objects. */ - hb_hashmap_t<const object_t *, objidx_t, - const object_t *, objidx_t, - nullptr, 0> packed_map; + hb_hashmap_t<const object_t *, objidx_t> packed_map; }; #endif /* HB_SERIALIZE_HH */ diff --git a/thirdparty/harfbuzz/src/hb-set-digest.hh b/thirdparty/harfbuzz/src/hb-set-digest.hh index 7d4979b73b..fab36216e4 100644 --- a/thirdparty/harfbuzz/src/hb-set-digest.hh +++ b/thirdparty/harfbuzz/src/hb-set-digest.hh @@ -30,7 +30,7 @@ #include "hb.hh" /* - * The set digests here implement various "filters" that support + * The set-digests here implement various "filters" that support * "approximate member query". Conceptually these are like Bloom * Filter and Quotient Filter, however, much smaller, faster, and * designed to fit the requirements of our uses for glyph coverage @@ -40,13 +40,25 @@ * set of glyphs, but fully flooded and ineffective if coverage is * all over the place. * - * The frozen-set can be used instead of a digest, to trade more - * memory for 100% accuracy, but in practice, that doesn't look like - * an attractive trade-off. + * The way these are used is that the filter is first populated by + * a lookup's or subtable's Coverage table(s), and then when we + * want to apply the lookup or subtable to a glyph, before trying + * to apply, we ask the filter if the glyph may be covered. If it's + * not, we return early. + * + * We use these filters both at the lookup-level, and then again, + * at the subtable-level. Both have performance win. + * + * The main filter we use is a combination of three bits-pattern + * filters. A bits-pattern filter checks a number of bits (5 or 6) + * of the input number (glyph-id in this case) and checks whether + * its pattern is amongst the patterns of any of the accepted values. + * The accepted patterns are represented as a "long" integer. The + * check is done using four bitwise operations only. */ template <typename mask_t, unsigned int shift> -struct hb_set_digest_lowest_bits_t +struct hb_set_digest_bits_pattern_t { static constexpr unsigned mask_bytes = sizeof (mask_t); static constexpr unsigned mask_bits = sizeof (mask_t) * 8; @@ -102,7 +114,7 @@ struct hb_set_digest_lowest_bits_t bool add_sorted_array (const hb_sorted_array_t<const T>& arr) { return add_sorted_array (&arr, arr.len ()); } bool may_have (hb_codepoint_t g) const - { return !!(mask & mask_for (g)); } + { return mask & mask_for (g); } private: @@ -171,11 +183,11 @@ struct hb_set_digest_combiner_t using hb_set_digest_t = hb_set_digest_combiner_t < - hb_set_digest_lowest_bits_t<unsigned long, 4>, + hb_set_digest_bits_pattern_t<unsigned long, 4>, hb_set_digest_combiner_t < - hb_set_digest_lowest_bits_t<unsigned long, 0>, - hb_set_digest_lowest_bits_t<unsigned long, 9> + hb_set_digest_bits_pattern_t<unsigned long, 0>, + hb_set_digest_bits_pattern_t<unsigned long, 9> > > ; diff --git a/thirdparty/harfbuzz/src/hb-set.cc b/thirdparty/harfbuzz/src/hb-set.cc index 0e2c1f77ef..2d458294f8 100644 --- a/thirdparty/harfbuzz/src/hb-set.cc +++ b/thirdparty/harfbuzz/src/hb-set.cc @@ -40,7 +40,7 @@ /** - * hb_set_create: (Xconstructor) + * hb_set_create: * * Creates a new, initially empty set. * @@ -186,6 +186,7 @@ hb_set_t * hb_set_copy (const hb_set_t *set) { hb_set_t *copy = hb_set_create (); + if (unlikely (!copy)) return nullptr; copy->set (*set); return copy; } @@ -359,6 +360,23 @@ hb_set_is_equal (const hb_set_t *set, } /** + * hb_set_hash: + * @set: A set + * + * Creates a hash representing @set. + * + * Return value: + * A hash of @set. + * + * Since: 4.4.0 + **/ +HB_EXTERN unsigned int +hb_set_hash (const hb_set_t *set) +{ + return set->hash (); +} + +/** * hb_set_is_subset: * @set: A set * @larger_set: Another set diff --git a/thirdparty/harfbuzz/src/hb-set.h b/thirdparty/harfbuzz/src/hb-set.h index 10ce7c10d4..56902c267e 100644 --- a/thirdparty/harfbuzz/src/hb-set.h +++ b/thirdparty/harfbuzz/src/hb-set.h @@ -128,6 +128,9 @@ HB_EXTERN hb_bool_t hb_set_is_equal (const hb_set_t *set, const hb_set_t *other); +HB_EXTERN unsigned int +hb_set_hash (const hb_set_t *set); + HB_EXTERN hb_bool_t hb_set_is_subset (const hb_set_t *set, const hb_set_t *larger_set); diff --git a/thirdparty/harfbuzz/src/hb-set.hh b/thirdparty/harfbuzz/src/hb-set.hh index 6025626363..7eb5e19a2a 100644 --- a/thirdparty/harfbuzz/src/hb-set.hh +++ b/thirdparty/harfbuzz/src/hb-set.hh @@ -166,7 +166,6 @@ struct hb_set_t : hb_sparseset_t<hb_bit_set_invertible_t> ~hb_set_t () = default; hb_set_t () : sparseset () {}; - hb_set_t (std::nullptr_t) : hb_set_t () {}; hb_set_t (const hb_set_t &o) : sparseset ((sparseset &) o) {}; hb_set_t (hb_set_t&& o) : sparseset (std::move ((sparseset &) o)) {} hb_set_t& operator = (const hb_set_t&) = default; diff --git a/thirdparty/harfbuzz/src/hb-shape-plan.cc b/thirdparty/harfbuzz/src/hb-shape-plan.cc index 66332165c3..0af07825fc 100644 --- a/thirdparty/harfbuzz/src/hb-shape-plan.cc +++ b/thirdparty/harfbuzz/src/hb-shape-plan.cc @@ -170,7 +170,7 @@ hb_shape_plan_key_t::equal (const hb_shape_plan_key_t *other) /** - * hb_shape_plan_create: (Xconstructor) + * hb_shape_plan_create: * @face: #hb_face_t to use * @props: The #hb_segment_properties_t of the segment * @user_features: (array length=num_user_features): The list of user-selected features @@ -198,7 +198,7 @@ hb_shape_plan_create (hb_face_t *face, } /** - * hb_shape_plan_create2: (Xconstructor) + * hb_shape_plan_create2: * @face: #hb_face_t to use * @props: The #hb_segment_properties_t of the segment * @user_features: (array length=num_user_features): The list of user-selected features @@ -231,7 +231,8 @@ hb_shape_plan_create2 (hb_face_t *face, num_coords, shaper_list); - assert (props->direction != HB_DIRECTION_INVALID); + if (unlikely (props->direction == HB_DIRECTION_INVALID)) + return hb_shape_plan_get_empty (); hb_shape_plan_t *shape_plan; diff --git a/thirdparty/harfbuzz/src/hb-shape.cc b/thirdparty/harfbuzz/src/hb-shape.cc index 3407e1af42..14ec92828f 100644 --- a/thirdparty/harfbuzz/src/hb-shape.cc +++ b/thirdparty/harfbuzz/src/hb-shape.cc @@ -50,7 +50,7 @@ static inline void free_static_shaper_list (); -static const char *nil_shaper_list[] = {nullptr}; +static const char * const nil_shaper_list[] = {nullptr}; static struct hb_shaper_list_lazy_loader_t : hb_lazy_loader_t<const char *, hb_shaper_list_lazy_loader_t> @@ -73,7 +73,7 @@ static struct hb_shaper_list_lazy_loader_t : hb_lazy_loader_t<const char *, } static void destroy (const char **l) { hb_free (l); } - static const char ** get_null () + static const char * const * get_null () { return nil_shaper_list; } } static_shaper_list; @@ -126,6 +126,11 @@ hb_shape_full (hb_font_t *font, unsigned int num_features, const char * const *shaper_list) { + if (unlikely (!buffer->len)) + return true; + + buffer->enter (); + hb_buffer_t *text_buffer = nullptr; if (buffer->flags & HB_BUFFER_FLAG_VERIFY) { @@ -137,12 +142,19 @@ hb_shape_full (hb_font_t *font, features, num_features, font->coords, font->num_coords, shaper_list); + hb_bool_t res = hb_shape_plan_execute (shape_plan, font, buffer, features, num_features); + + if (buffer->max_ops <= 0) + buffer->shaping_failed = true; + hb_shape_plan_destroy (shape_plan); if (text_buffer) { - if (res && !buffer->verify (text_buffer, + if (res && buffer->successful && !buffer->shaping_failed + && text_buffer->successful + && !buffer->verify (text_buffer, font, features, num_features, @@ -151,6 +163,8 @@ hb_shape_full (hb_font_t *font, hb_buffer_destroy (text_buffer); } + buffer->leave (); + return res; } diff --git a/thirdparty/harfbuzz/src/hb-shaper.cc b/thirdparty/harfbuzz/src/hb-shaper.cc index a11ed83afd..da4253ed64 100644 --- a/thirdparty/harfbuzz/src/hb-shaper.cc +++ b/thirdparty/harfbuzz/src/hb-shaper.cc @@ -29,18 +29,18 @@ #include "hb-machinery.hh" -static const hb_shaper_entry_t all_shapers[] = { +static const hb_shaper_entry_t _hb_all_shapers[] = { #define HB_SHAPER_IMPLEMENT(name) {#name, _hb_##name##_shape}, #include "hb-shaper-list.hh" #undef HB_SHAPER_IMPLEMENT }; #ifndef HB_NO_SHAPER -static_assert (0 != ARRAY_LENGTH_CONST (all_shapers), "No shaper enabled."); +static_assert (0 != ARRAY_LENGTH_CONST (_hb_all_shapers), "No shaper enabled."); #endif static inline void free_static_shapers (); -static struct hb_shapers_lazy_loader_t : hb_lazy_loader_t<const hb_shaper_entry_t, +static struct hb_shapers_lazy_loader_t : hb_lazy_loader_t<hb_shaper_entry_t, hb_shapers_lazy_loader_t> { static hb_shaper_entry_t *create () @@ -49,11 +49,11 @@ static struct hb_shapers_lazy_loader_t : hb_lazy_loader_t<const hb_shaper_entry_ if (!env || !*env) return nullptr; - hb_shaper_entry_t *shapers = (hb_shaper_entry_t *) hb_calloc (1, sizeof (all_shapers)); + hb_shaper_entry_t *shapers = (hb_shaper_entry_t *) hb_calloc (1, sizeof (_hb_all_shapers)); if (unlikely (!shapers)) return nullptr; - memcpy (shapers, all_shapers, sizeof (all_shapers)); + memcpy (shapers, _hb_all_shapers, sizeof (_hb_all_shapers)); /* Reorder shaper list to prefer requested shapers. */ unsigned int i = 0; @@ -64,7 +64,7 @@ static struct hb_shapers_lazy_loader_t : hb_lazy_loader_t<const hb_shaper_entry_ if (!end) end = p + strlen (p); - for (unsigned int j = i; j < ARRAY_LENGTH (all_shapers); j++) + for (unsigned int j = i; j < ARRAY_LENGTH (_hb_all_shapers); j++) if (end - p == (int) strlen (shapers[j].name) && 0 == strncmp (shapers[j].name, p, end - p)) { @@ -85,8 +85,8 @@ static struct hb_shapers_lazy_loader_t : hb_lazy_loader_t<const hb_shaper_entry_ return shapers; } - static void destroy (const hb_shaper_entry_t *p) { hb_free ((void *) p); } - static const hb_shaper_entry_t *get_null () { return all_shapers; } + static void destroy (hb_shaper_entry_t *p) { hb_free (p); } + static const hb_shaper_entry_t *get_null () { return _hb_all_shapers; } } static_shapers; static inline diff --git a/thirdparty/harfbuzz/src/hb-static.cc b/thirdparty/harfbuzz/src/hb-static.cc index 7cc51be611..5c5ecce880 100644 --- a/thirdparty/harfbuzz/src/hb-static.cc +++ b/thirdparty/harfbuzz/src/hb-static.cc @@ -53,6 +53,9 @@ DEFINE_NULL_NAMESPACE_BYTES (AAT, SettingName) = {0xFF,0xFF, 0xFF,0xFF}; const unsigned char _hb_Null_AAT_Lookup[2] = {0xFF, 0xFF}; +/* hb_map_t */ + +const hb_codepoint_t minus_1 = -1; /* hb_face_t */ diff --git a/thirdparty/harfbuzz/src/hb-subset-cff-common.hh b/thirdparty/harfbuzz/src/hb-subset-cff-common.hh index ae155b4e3c..bb9f27eec1 100644 --- a/thirdparty/harfbuzz/src/hb-subset-cff-common.hh +++ b/thirdparty/harfbuzz/src/hb-subset-cff-common.hh @@ -44,7 +44,8 @@ struct str_encoder_t void encode_byte (unsigned char b) { - if (unlikely (buff.push (b) == &Crap (unsigned char))) + buff.push (b); + if (unlikely (buff.in_error ())) set_error (); } diff --git a/thirdparty/harfbuzz/src/hb-subset-input.cc b/thirdparty/harfbuzz/src/hb-subset-input.cc index 4885280996..028ddf9035 100644 --- a/thirdparty/harfbuzz/src/hb-subset-input.cc +++ b/thirdparty/harfbuzz/src/hb-subset-input.cc @@ -140,7 +140,20 @@ hb_subset_input_create_or_fail (void) HB_TAG ('r', 't', 'l', 'a'), HB_TAG ('r', 't', 'l', 'm'), - //Complex shapers + //random + HB_TAG ('r', 'a', 'n', 'd'), + + //justify + HB_TAG ('j', 'a', 'l', 't'), // HarfBuzz doesn't use; others might + + //private + HB_TAG ('H', 'a', 'r', 'f'), + HB_TAG ('H', 'A', 'R', 'F'), + HB_TAG ('B', 'u', 'z', 'z'), + HB_TAG ('B', 'U', 'Z', 'Z'), + + //shapers + //arabic HB_TAG ('i', 'n', 'i', 't'), HB_TAG ('m', 'e', 'd', 'i'), diff --git a/thirdparty/harfbuzz/src/hb-subset-plan.cc b/thirdparty/harfbuzz/src/hb-subset-plan.cc index a62ae8e024..4e3bb1d477 100644 --- a/thirdparty/harfbuzz/src/hb-subset-plan.cc +++ b/thirdparty/harfbuzz/src/hb-subset-plan.cc @@ -41,9 +41,9 @@ #include "hb-ot-math-table.hh" using OT::Layout::GSUB::GSUB; +using OT::Layout::GPOS; - -typedef hb_hashmap_t<unsigned, hb_set_t *> script_langsys_map; +typedef hb_hashmap_t<unsigned, hb::unique_ptr<hb_set_t>> script_langsys_map; #ifndef HB_NO_SUBSET_CFF static inline void _add_cff_seac_components (const OT::cff1::accelerator_t &cff, @@ -204,7 +204,7 @@ static inline void hb_map_t *layout_variation_idx_map) { hb_blob_ptr_t<OT::GDEF> gdef = hb_sanitize_context_t ().reference_table<OT::GDEF> (face); - hb_blob_ptr_t<OT::GPOS> gpos = hb_sanitize_context_t ().reference_table<OT::GPOS> (face); + hb_blob_ptr_t<GPOS> gpos = hb_sanitize_context_t ().reference_table<GPOS> (face); if (!gdef->has_data ()) { @@ -347,13 +347,42 @@ _populate_unicodes_to_retain (const hb_set_t *unicodes, } } +#ifndef HB_COMPOSITE_OPERATIONS_PER_GLYPH +#define HB_COMPOSITE_OPERATIONS_PER_GLYPH 64 +#endif + +static unsigned +_glyf_add_gid_and_children (const OT::glyf_accelerator_t &glyf, + hb_codepoint_t gid, + hb_set_t *gids_to_retain, + int operation_count, + unsigned depth = 0) +{ + if (unlikely (depth++ > HB_MAX_NESTING_LEVEL)) return operation_count; + if (unlikely (--operation_count < 0)) return operation_count; + /* Check if is already visited */ + if (gids_to_retain->has (gid)) return operation_count; + + gids_to_retain->add (gid); + + for (auto item : glyf.glyph_for_gid (gid).get_composite_iterator ()) + operation_count = + _glyf_add_gid_and_children (glyf, + item.glyphIndex, + gids_to_retain, + operation_count, + depth); + + return operation_count; +} + static void _populate_gids_to_retain (hb_subset_plan_t* plan, bool close_over_gsub, bool close_over_gpos, bool close_over_gdef) { - OT::glyf::accelerator_t glyf (plan->source); + OT::glyf_accelerator_t glyf (plan->source); #ifndef HB_NO_SUBSET_CFF OT::cff1::accelerator_t cff (plan->source); #endif @@ -374,7 +403,7 @@ _populate_gids_to_retain (hb_subset_plan_t* plan, plan->gsub_langsys); if (close_over_gpos) - _closure_glyphs_lookups_features<OT::GPOS> ( + _closure_glyphs_lookups_features<GPOS> ( plan->source, plan->_glyphset_gsub, plan->layout_features, @@ -398,7 +427,8 @@ _populate_gids_to_retain (hb_subset_plan_t* plan, * composite glyphs. */ if (glyf.has_data ()) for (hb_codepoint_t gid : cur_glyphset) - glyf.add_gid_and_children (gid, plan->_glyphset); + _glyf_add_gid_and_children (glyf, gid, plan->_glyphset, + cur_glyphset.get_population () * HB_COMPOSITE_OPERATIONS_PER_GLYPH); else plan->_glyphset->union_ (cur_glyphset); #ifndef HB_NO_SUBSET_CFF @@ -630,9 +660,6 @@ hb_subset_plan_destroy (hb_subset_plan_t *plan) if (plan->gsub_langsys) { - for (auto _ : plan->gsub_langsys->iter ()) - hb_set_destroy (_.second); - hb_object_destroy (plan->gsub_langsys); plan->gsub_langsys->fini_shallow (); hb_free (plan->gsub_langsys); @@ -640,9 +667,6 @@ hb_subset_plan_destroy (hb_subset_plan_t *plan) if (plan->gpos_langsys) { - for (auto _ : plan->gpos_langsys->iter ()) - hb_set_destroy (_.second); - hb_object_destroy (plan->gpos_langsys); plan->gpos_langsys->fini_shallow (); hb_free (plan->gpos_langsys); diff --git a/thirdparty/harfbuzz/src/hb-subset-plan.hh b/thirdparty/harfbuzz/src/hb-subset-plan.hh index cb567b769e..2aaf19c61d 100644 --- a/thirdparty/harfbuzz/src/hb-subset-plan.hh +++ b/thirdparty/harfbuzz/src/hb-subset-plan.hh @@ -87,8 +87,8 @@ struct hb_subset_plan_t hb_map_t *gpos_lookups; //active langsys we'd like to retain - hb_hashmap_t<unsigned, hb_set_t *> *gsub_langsys; - hb_hashmap_t<unsigned, hb_set_t *> *gpos_langsys; + hb_hashmap_t<unsigned, hb::unique_ptr<hb_set_t>> *gsub_langsys; + hb_hashmap_t<unsigned, hb::unique_ptr<hb_set_t>> *gpos_langsys; //active features after removing redundant langsys and prune_features hb_map_t *gsub_features; diff --git a/thirdparty/harfbuzz/src/hb-subset.cc b/thirdparty/harfbuzz/src/hb-subset.cc index 31ddb4f894..10c572c2f7 100644 --- a/thirdparty/harfbuzz/src/hb-subset.cc +++ b/thirdparty/harfbuzz/src/hb-subset.cc @@ -56,6 +56,7 @@ #include "hb-repacker.hh" using OT::Layout::GSUB::GSUB; +using OT::Layout::GPOS; /** * SECTION:hb-subset @@ -78,6 +79,108 @@ using OT::Layout::GSUB::GSUB; * retain glyph ids option and configure the subset to pass through the layout tables untouched. */ +/* + * The list of tables in the open type spec. Used to check for tables that may need handling + * if we are unable to list the tables in a face. + */ +static hb_tag_t known_tables[] { + HB_TAG ('a', 'v', 'a', 'r'), + HB_OT_TAG_BASE, + HB_OT_TAG_CBDT, + HB_OT_TAG_CBLC, + HB_OT_TAG_cff1, + HB_OT_TAG_cff2, + HB_OT_TAG_cmap, + HB_OT_TAG_COLR, + HB_OT_TAG_CPAL, + HB_TAG ('c', 'v', 'a', 'r'), + HB_TAG ('c', 'v', 't', ' '), + HB_TAG ('D', 'S', 'I', 'G'), + HB_TAG ('E', 'B', 'D', 'T'), + HB_TAG ('E', 'B', 'L', 'C'), + HB_TAG ('E', 'B', 'S', 'C'), + HB_TAG ('f', 'p', 'g', 'm'), + HB_TAG ('f', 'v', 'a', 'r'), + HB_TAG ('g', 'a', 's', 'p'), + HB_OT_TAG_GDEF, + HB_OT_TAG_glyf, + HB_OT_TAG_GPOS, + HB_OT_TAG_GSUB, + HB_OT_TAG_gvar, + HB_OT_TAG_hdmx, + HB_OT_TAG_head, + HB_OT_TAG_hhea, + HB_OT_TAG_hmtx, + HB_OT_TAG_HVAR, + HB_OT_TAG_JSTF, + HB_TAG ('k', 'e', 'r', 'n'), + HB_OT_TAG_loca, + HB_TAG ('L', 'T', 'S', 'H'), + HB_OT_TAG_MATH, + HB_OT_TAG_maxp, + HB_TAG ('M', 'E', 'R', 'G'), + HB_TAG ('m', 'e', 't', 'a'), + HB_TAG ('M', 'V', 'A', 'R'), + HB_TAG ('P', 'C', 'L', 'T'), + HB_OT_TAG_post, + HB_TAG ('p', 'r', 'e', 'p'), + HB_OT_TAG_sbix, + HB_TAG ('S', 'T', 'A', 'T'), + HB_TAG ('S', 'V', 'G', ' '), + HB_TAG ('V', 'D', 'M', 'X'), + HB_OT_TAG_vhea, + HB_OT_TAG_vmtx, + HB_OT_TAG_VORG, + HB_OT_TAG_VVAR, + HB_OT_TAG_name, + HB_OT_TAG_OS2 +}; + +static bool _table_is_empty (const hb_face_t *face, hb_tag_t tag) +{ + hb_blob_t* blob = hb_face_reference_table (face, tag); + bool result = (blob == hb_blob_get_empty ()); + hb_blob_destroy (blob); + return result; +} + +static unsigned int +_get_table_tags (const hb_subset_plan_t* plan, + unsigned int start_offset, + unsigned int *table_count, /* IN/OUT */ + hb_tag_t *table_tags /* OUT */) +{ + unsigned num_tables = hb_face_get_table_tags (plan->source, 0, nullptr, nullptr); + if (num_tables) + return hb_face_get_table_tags (plan->source, start_offset, table_count, table_tags); + + // If face has 0 tables associated with it, assume that it was built from + // hb_face_create_tables and thus is unable to list its tables. Fallback to + // checking each table type we can handle for existence instead. + auto it = + hb_concat ( + + hb_array (known_tables) + | hb_filter ([&] (hb_tag_t tag) { + return !_table_is_empty (plan->source, tag) && !plan->no_subset_tables->has (tag); + }) + | hb_map ([] (hb_tag_t tag) -> hb_tag_t { return tag; }), + + plan->no_subset_tables->iter () + | hb_filter([&] (hb_tag_t tag) { + return !_table_is_empty (plan->source, tag); + })); + + it += start_offset; + + unsigned num_written = 0; + while (bool (it) && num_written < *table_count) + table_tags[num_written++] = *it++; + + *table_count = num_written; + return num_written; +} + + static unsigned _plan_estimate_subset_table_size (hb_subset_plan_t *plan, unsigned table_len, @@ -224,9 +327,17 @@ _subset (hb_subset_plan_t *plan, hb_vector_t<char> &buf) static bool _is_table_present (hb_face_t *source, hb_tag_t tag) { + + if (!hb_face_get_table_tags (source, 0, nullptr, nullptr)) { + // If face has 0 tables associated with it, assume that it was built from + // hb_face_create_tables and thus is unable to list its tables. Fallback to + // checking if the blob associated with tag is empty. + return !_table_is_empty (source, tag); + } + hb_tag_t table_tags[32]; unsigned offset = 0, num_tables = ARRAY_LENGTH (table_tags); - while ((hb_face_get_table_tags (source, offset, &num_tables, table_tags), num_tables)) + while (((void) hb_face_get_table_tags (source, offset, &num_tables, table_tags), num_tables)) { for (unsigned i = 0; i < num_tables; ++i) if (table_tags[i] == tag) @@ -322,7 +433,7 @@ _subset_table (hb_subset_plan_t *plan, #ifndef HB_NO_SUBSET_LAYOUT case HB_OT_TAG_GDEF: return _subset<const OT::GDEF> (plan, buf); case HB_OT_TAG_GSUB: return _subset<const GSUB> (plan, buf); - case HB_OT_TAG_GPOS: return _subset<const OT::GPOS> (plan, buf); + case HB_OT_TAG_GPOS: return _subset<const GPOS> (plan, buf); case HB_OT_TAG_gvar: return _subset<const OT::gvar> (plan, buf); case HB_OT_TAG_HVAR: return _subset<const OT::HVAR> (plan, buf); case HB_OT_TAG_VVAR: return _subset<const OT::VVAR> (plan, buf); @@ -388,7 +499,8 @@ hb_subset_plan_execute_or_fail (hb_subset_plan_t *plan) unsigned offset = 0, num_tables = ARRAY_LENGTH (table_tags); hb_vector_t<char> buf; buf.alloc (4096 - 16); - while ((hb_face_get_table_tags (plan->source, offset, &num_tables, table_tags), num_tables)) + + while (((void) _get_table_tags (plan, offset, &num_tables, table_tags), num_tables)) { for (unsigned i = 0; i < num_tables; ++i) { @@ -400,7 +512,7 @@ hb_subset_plan_execute_or_fail (hb_subset_plan_t *plan) } offset += num_tables; } -end: +end: return success ? hb_face_reference (plan->dest) : nullptr; } diff --git a/thirdparty/harfbuzz/src/hb-ucd-table.hh b/thirdparty/harfbuzz/src/hb-ucd-table.hh index 1a4c89c17f..9e76ca460b 100644 --- a/thirdparty/harfbuzz/src/hb-ucd-table.hh +++ b/thirdparty/harfbuzz/src/hb-ucd-table.hh @@ -13,7 +13,7 @@ #include "hb.hh" static const hb_script_t -_hb_ucd_sc_map[162] = +_hb_ucd_sc_map[163] = { HB_SCRIPT_COMMON, HB_SCRIPT_INHERITED, HB_SCRIPT_UNKNOWN, HB_SCRIPT_ARABIC, @@ -96,6 +96,7 @@ _hb_ucd_sc_map[162] = HB_SCRIPT_YEZIDI, HB_SCRIPT_CYPRO_MINOAN, HB_SCRIPT_OLD_UYGHUR, HB_SCRIPT_TANGSA, HB_SCRIPT_TOTO, HB_SCRIPT_VITHKUQI, + HB_SCRIPT_MATH, }; static const uint16_t _hb_ucd_dm1_p0_map[825] = diff --git a/thirdparty/harfbuzz/src/hb-unicode.cc b/thirdparty/harfbuzz/src/hb-unicode.cc index 83ead6398b..05f74b9237 100644 --- a/thirdparty/harfbuzz/src/hb-unicode.cc +++ b/thirdparty/harfbuzz/src/hb-unicode.cc @@ -169,7 +169,7 @@ hb_unicode_funcs_get_default () #endif /** - * hb_unicode_funcs_create: (Xconstructor) + * hb_unicode_funcs_create: * @parent: (nullable): Parent Unicode-functions structure * * Creates a new #hb_unicode_funcs_t structure of Unicode functions. diff --git a/thirdparty/harfbuzz/src/hb-unicode.hh b/thirdparty/harfbuzz/src/hb-unicode.hh index 4c28bb0cdf..39aaee5baa 100644 --- a/thirdparty/harfbuzz/src/hb-unicode.hh +++ b/thirdparty/harfbuzz/src/hb-unicode.hh @@ -105,12 +105,9 @@ HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS_SIMPLE unsigned int modified_combining_class (hb_codepoint_t u) { - /* XXX This hack belongs to the USE shaper (for Tai Tham): - * Reorder SAKOT to ensure it comes after any tone marks. */ + /* Reorder SAKOT to ensure it comes after any tone marks. */ if (unlikely (u == 0x1A60u)) return 254; - - /* XXX This hack belongs to the Tibetan shaper: - * Reorder PADMA to ensure it comes after any vowel marks. */ + /* Reorder PADMA to ensure it comes after any vowel marks. */ if (unlikely (u == 0x0FC6u)) return 254; /* Reorder TSA -PHRU to reorder before U+0F74 */ if (unlikely (u == 0x0F39u)) return 127; diff --git a/thirdparty/harfbuzz/src/hb-version.h b/thirdparty/harfbuzz/src/hb-version.h index ae707cde6c..f036a12226 100644 --- a/thirdparty/harfbuzz/src/hb-version.h +++ b/thirdparty/harfbuzz/src/hb-version.h @@ -47,20 +47,20 @@ HB_BEGIN_DECLS * * The minor component of the library version available at compile-time. */ -#define HB_VERSION_MINOR 3 +#define HB_VERSION_MINOR 4 /** * HB_VERSION_MICRO: * * The micro component of the library version available at compile-time. */ -#define HB_VERSION_MICRO 0 +#define HB_VERSION_MICRO 1 /** * HB_VERSION_STRING: * * A string literal containing the library version available at compile-time. */ -#define HB_VERSION_STRING "4.3.0" +#define HB_VERSION_STRING "4.4.1" /** * HB_VERSION_ATLEAST: diff --git a/thirdparty/harfbuzz/src/hb.hh b/thirdparty/harfbuzz/src/hb.hh index b9f5f71415..8ec638a2b4 100644 --- a/thirdparty/harfbuzz/src/hb.hh +++ b/thirdparty/harfbuzz/src/hb.hh @@ -29,7 +29,6 @@ #ifndef HB_HH #define HB_HH - #ifndef HB_NO_PRAGMA_GCC_DIAGNOSTIC #ifdef _MSC_VER #pragma warning( disable: 4068 ) /* Unknown pragma */ @@ -65,6 +64,7 @@ #pragma GCC diagnostic error "-Wbitwise-instead-of-logical" #pragma GCC diagnostic error "-Wcast-align" #pragma GCC diagnostic error "-Wcast-function-type" +#pragma GCC diagnostic error "-Wcomma" #pragma GCC diagnostic error "-Wdelete-non-virtual-dtor" #pragma GCC diagnostic error "-Wembedded-directive" #pragma GCC diagnostic error "-Wextra-semi-stmt" @@ -183,7 +183,7 @@ #include <cassert> #include <cfloat> #include <climits> -#ifdef _MSC_VER +#if defined(_MSC_VER) && !defined(_USE_MATH_DEFINES) # define _USE_MATH_DEFINES #endif #include <cmath> @@ -470,6 +470,7 @@ static_assert ((sizeof (hb_var_int_t) == 4), ""); /* Headers we include for everyone. Keep topologically sorted by dependency. * They express dependency amongst themselves, but no other file should include * them directly.*/ +#include "hb-cplusplus.hh" #include "hb-meta.hh" #include "hb-mutex.hh" #include "hb-number.hh" |